From: Andrea Amorese
Date: Fri, 4 Feb 2022 14:10:06 +0000 (+0100)
Subject: Built motion from commit ef9bfea2.|2.6.1
X-Git-Url: http://repos.xcallymotion.com/base//%22?a=commitdiff_plain;h=d8d8033b18c51f0832fa46af262fddec59b9042d;p=motion2.git
Built motion from commit ef9bfea2.|2.6.1
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index a69b2e3..edbaf27 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-02-04T11:23:24.128Z",
+ "time": "2022-02-04T13:58:14.265Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index dd6e8ef..5af4ef6 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-02-04T11:23:24.128Z",
+ "time": "2022-02-04T13:58:14.265Z",
"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 72277b3..0324f05 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 _0x728f=['urlForward[body]','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x5576cc,_0xd2cef5){var _0x40f468=function(_0x56fde6){while(--_0x56fde6){_0x5576cc['push'](_0x5576cc['shift']());}};_0x40f468(++_0xd2cef5);}(_0x728f,0x67));var _0xf728=function(_0x127b52,_0x5ef4e4){_0x127b52=_0x127b52-0x0;var _0x49025b=_0x728f[_0x127b52];return _0x49025b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf728('0x0')],'get':function(_0x299348){return this[_0xf728('0x1')](_0xf728('0x2'));}},'action':{'type':Sequelize[_0xf728('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf728('0x4'),'integration',_0xf728('0x5'),_0xf728('0x6'),_0xf728('0x7'),'browser',_0xf728('0x8'),'script']],'msg':_0xf728('0x9')}},'comment':_0xf728('0x9')},'data1':{'type':Sequelize[_0xf728('0x3')](0x1000),'comment':_0xf728('0xa')},'data2':{'type':Sequelize[_0xf728('0x3')](0x1000),'comment':_0xf728('0xb')},'data3':{'type':Sequelize[_0xf728('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xf728('0x3')](0x1000),'comments':_0xf728('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xf728('0xd')},'data6':{'type':Sequelize[_0xf728('0x3')],'comments':_0xf728('0xe')},'data7':{'type':Sequelize[_0xf728('0xf')],'comments':_0xf728('0x10')}};
\ No newline at end of file
+var _0x7697=['urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','STRING','integration','jscripty'];(function(_0x18e2f3,_0xfea2ca){var _0x1ef3cb=function(_0x6bb00d){while(--_0x6bb00d){_0x18e2f3['push'](_0x18e2f3['shift']());}};_0x1ef3cb(++_0xfea2ca);}(_0x7697,0x10c));var _0x7769=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x7697[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7769('0x0')],'get':function(_0x5307cc){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x7769('0x1')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x7769('0x2'),'motionbar',_0x7769('0x3'),_0x7769('0x4'),_0x7769('0x5'),_0x7769('0x6'),_0x7769('0x7')]],'msg':_0x7769('0x8')}},'comment':_0x7769('0x8')},'data1':{'type':Sequelize[_0x7769('0x1')](0x1000),'comment':_0x7769('0x9')},'data2':{'type':Sequelize[_0x7769('0x1')](0x1000),'comment':_0x7769('0xa')},'data3':{'type':Sequelize[_0x7769('0x1')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x7769('0x1')](0x1000),'comments':_0x7769('0xb')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x7769('0xc')},'data6':{'type':Sequelize[_0x7769('0x1')],'comments':_0x7769('0xd')},'data7':{'type':Sequelize[_0x7769('0xe')],'comments':_0x7769('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index f9411f7..49f9a8b 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 _0x1255=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','Action','find','params','body','catch','eml-format'];(function(_0x1c8e95,_0x2cca4a){var _0x4e1e2d=function(_0x2d3901){while(--_0x2d3901){_0x1c8e95['push'](_0x1c8e95['shift']());}};_0x4e1e2d(++_0x2cca4a);}(_0x1255,0x89));var _0x5125=function(_0x233ca7,_0x335e9f){_0x233ca7=_0x233ca7-0x0;var _0x31728b=_0x1255[_0x233ca7];return _0x31728b;};'use strict';var emlformat=require(_0x5125('0x0'));var rimraf=require(_0x5125('0x1'));var zipdir=require(_0x5125('0x2'));var jsonpatch=require(_0x5125('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5125('0x4'));var Mustache=require(_0x5125('0x5'));var util=require(_0x5125('0x6'));var path=require(_0x5125('0x7'));var sox=require(_0x5125('0x8'));var csv=require(_0x5125('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5125('0xa'));var _=require(_0x5125('0xb'));var squel=require(_0x5125('0xc'));var crypto=require(_0x5125('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5125('0xe'));var toCsv=require(_0x5125('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5125('0xf'));var authService=require(_0x5125('0x10'));var qs=require(_0x5125('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5125('0x12'));var logger=require(_0x5125('0x13'))(_0x5125('0x14'));var utils=require('../../config/utils');var config=require(_0x5125('0x15'));var licenseUtil=require(_0x5125('0x16'));var db=require(_0x5125('0x17'))['db'];function respondWithStatusCode(_0x27284c,_0x37da6b){_0x37da6b=_0x37da6b||0xcc;return function(_0x130c40){if(_0x130c40){return _0x27284c[_0x5125('0x18')](_0x37da6b);}return _0x27284c[_0x5125('0x19')](_0x37da6b)[_0x5125('0x1a')]();};}function respondWithResult(_0x46a83a,_0x3c5598){_0x3c5598=_0x3c5598||0xc8;return function(_0x3c6bea){if(_0x3c6bea){return _0x46a83a[_0x5125('0x19')](_0x3c5598)['json'](_0x3c6bea);}};}function respondWithFilteredResult(_0x12c836,_0x10f143){return function(_0x403096){if(_0x403096){var _0x40b6e6=typeof _0x10f143[_0x5125('0x1b')]===_0x5125('0x1c')&&typeof _0x10f143['limit']===_0x5125('0x1c');var _0x38816d=_0x403096[_0x5125('0x1d')];var _0x1cb8f7=_0x40b6e6?0x0:_0x10f143[_0x5125('0x1b')];var _0x3fce46=_0x40b6e6?_0x403096['count']:_0x10f143[_0x5125('0x1b')]+_0x10f143['limit'];var _0x5657f8;if(_0x3fce46>=_0x38816d){_0x3fce46=_0x38816d;_0x5657f8=0xc8;}else{_0x5657f8=0xce;}_0x12c836['status'](_0x5657f8);return _0x12c836['set'](_0x5125('0x1e'),_0x1cb8f7+'-'+_0x3fce46+'/'+_0x38816d)[_0x5125('0x1f')](_0x403096);}return null;};}function patchUpdates(_0x4e6183){return function(_0x53c45e){try{jsonpatch[_0x5125('0x20')](_0x53c45e,_0x4e6183,!![]);}catch(_0x46621a){return BPromise['reject'](_0x46621a);}return _0x53c45e[_0x5125('0x21')]();};}function saveUpdates(_0x1beb11,_0x5c9d88){return function(_0x2d028a){if(_0x2d028a){return _0x2d028a[_0x5125('0x22')](_0x1beb11)[_0x5125('0x23')](function(_0x50d2ae){return _0x50d2ae;});}return null;};}function removeEntity(_0x39e84c,_0x4472a5){return function(_0x2911c9){if(_0x2911c9){return _0x2911c9[_0x5125('0x24')]()[_0x5125('0x23')](function(){_0x39e84c[_0x5125('0x19')](0xcc)[_0x5125('0x1a')]();});}};}function handleEntityNotFound(_0x327c1b,_0x5f4a31){return function(_0x5b8276){if(!_0x5b8276){_0x327c1b[_0x5125('0x18')](0x194);}return _0x5b8276;};}function handleError(_0x289369,_0x9c5890){_0x9c5890=_0x9c5890||0x1f4;return function(_0xd69bf7){logger[_0x5125('0x25')](_0xd69bf7[_0x5125('0x26')]);if(_0xd69bf7[_0x5125('0x27')]){delete _0xd69bf7[_0x5125('0x27')];}_0x289369[_0x5125('0x19')](_0x9c5890)[_0x5125('0x28')](_0xd69bf7);};}exports[_0x5125('0x22')]=function(_0x4afb8f,_0x52e8bb){if(_0x4afb8f['body']['id']){delete _0x4afb8f['body']['id'];}return db[_0x5125('0x29')][_0x5125('0x2a')]({'where':{'id':_0x4afb8f[_0x5125('0x2b')]['id']}})[_0x5125('0x23')](handleEntityNotFound(_0x52e8bb,null))['then'](saveUpdates(_0x4afb8f[_0x5125('0x2c')],null))[_0x5125('0x23')](respondWithResult(_0x52e8bb,null))['catch'](handleError(_0x52e8bb,null));};exports['destroy']=function(_0x5e27ad,_0x4f1b91){return db[_0x5125('0x29')][_0x5125('0x2a')]({'where':{'id':_0x5e27ad[_0x5125('0x2b')]['id']}})[_0x5125('0x23')](handleEntityNotFound(_0x4f1b91,null))[_0x5125('0x23')](removeEntity(_0x4f1b91,null))[_0x5125('0x2d')](handleError(_0x4f1b91,null));};
\ No newline at end of file
+var _0xf4be=['../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','error','stack','name','send','body','Action','find','then','destroy','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x3a0def,_0x142b55){var _0x52f735=function(_0xf3c9e6){while(--_0xf3c9e6){_0x3a0def['push'](_0x3a0def['shift']());}};_0x52f735(++_0x142b55);}(_0xf4be,0x1c4));var _0xef4b=function(_0x30442,_0x4ef11e){_0x30442=_0x30442-0x0;var _0x2c8a82=_0xf4be[_0x30442];return _0x2c8a82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef4b('0x0'));var zipdir=require(_0xef4b('0x1'));var jsonpatch=require(_0xef4b('0x2'));var rp=require(_0xef4b('0x3'));var moment=require(_0xef4b('0x4'));var BPromise=require(_0xef4b('0x5'));var Mustache=require(_0xef4b('0x6'));var util=require(_0xef4b('0x7'));var path=require(_0xef4b('0x8'));var sox=require(_0xef4b('0x9'));var csv=require(_0xef4b('0xa'));var ejs=require(_0xef4b('0xb'));var fs=require('fs');var fs_extra=require(_0xef4b('0xc'));var _=require('lodash');var squel=require(_0xef4b('0xd'));var crypto=require(_0xef4b('0xe'));var jsforce=require(_0xef4b('0xf'));var deskjs=require(_0xef4b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef4b('0x11'));var Redis=require('ioredis');var authService=require(_0xef4b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef4b('0x13'));var logger=require(_0xef4b('0x14'))('api');var utils=require(_0xef4b('0x15'));var config=require(_0xef4b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xef4b('0x17'))['db'];function respondWithStatusCode(_0x207ff7,_0x17a7a6){_0x17a7a6=_0x17a7a6||0xcc;return function(_0x1a6da9){if(_0x1a6da9){return _0x207ff7['sendStatus'](_0x17a7a6);}return _0x207ff7[_0xef4b('0x18')](_0x17a7a6)[_0xef4b('0x19')]();};}function respondWithResult(_0x7f18,_0xeb6654){_0xeb6654=_0xeb6654||0xc8;return function(_0x1d80ec){if(_0x1d80ec){return _0x7f18['status'](_0xeb6654)[_0xef4b('0x1a')](_0x1d80ec);}};}function respondWithFilteredResult(_0x3557c7,_0x2d42bc){return function(_0x316fd3){if(_0x316fd3){var _0x1197f6=typeof _0x2d42bc[_0xef4b('0x1b')]===_0xef4b('0x1c')&&typeof _0x2d42bc[_0xef4b('0x1d')]===_0xef4b('0x1c');var _0x350984=_0x316fd3[_0xef4b('0x1e')];var _0x4f426e=_0x1197f6?0x0:_0x2d42bc['offset'];var _0x267330=_0x1197f6?_0x316fd3[_0xef4b('0x1e')]:_0x2d42bc['offset']+_0x2d42bc['limit'];var _0x410812;if(_0x267330>=_0x350984){_0x267330=_0x350984;_0x410812=0xc8;}else{_0x410812=0xce;}_0x3557c7[_0xef4b('0x18')](_0x410812);return _0x3557c7[_0xef4b('0x1f')](_0xef4b('0x20'),_0x4f426e+'-'+_0x267330+'/'+_0x350984)['json'](_0x316fd3);}return null;};}function patchUpdates(_0x1e0331){return function(_0x5126ae){try{jsonpatch['apply'](_0x5126ae,_0x1e0331,!![]);}catch(_0x150375){return BPromise[_0xef4b('0x21')](_0x150375);}return _0x5126ae[_0xef4b('0x22')]();};}function saveUpdates(_0x458d5e,_0x18d58d){return function(_0x864257){if(_0x864257){return _0x864257[_0xef4b('0x23')](_0x458d5e)['then'](function(_0x244311){return _0x244311;});}return null;};}function removeEntity(_0x1a2743,_0x101f26){return function(_0x4cb046){if(_0x4cb046){return _0x4cb046['destroy']()['then'](function(){_0x1a2743[_0xef4b('0x18')](0xcc)[_0xef4b('0x19')]();});}};}function handleEntityNotFound(_0x3595e0,_0x3bcb60){return function(_0x3be3cd){if(!_0x3be3cd){_0x3595e0['sendStatus'](0x194);}return _0x3be3cd;};}function handleError(_0x122dc8,_0x1ffd55){_0x1ffd55=_0x1ffd55||0x1f4;return function(_0x103627){logger[_0xef4b('0x24')](_0x103627[_0xef4b('0x25')]);if(_0x103627[_0xef4b('0x26')]){delete _0x103627[_0xef4b('0x26')];}_0x122dc8[_0xef4b('0x18')](_0x1ffd55)[_0xef4b('0x27')](_0x103627);};}exports[_0xef4b('0x23')]=function(_0x2fb4f1,_0x1d81e6){if(_0x2fb4f1[_0xef4b('0x28')]['id']){delete _0x2fb4f1[_0xef4b('0x28')]['id'];}return db[_0xef4b('0x29')][_0xef4b('0x2a')]({'where':{'id':_0x2fb4f1['params']['id']}})[_0xef4b('0x2b')](handleEntityNotFound(_0x1d81e6,null))['then'](saveUpdates(_0x2fb4f1['body'],null))[_0xef4b('0x2b')](respondWithResult(_0x1d81e6,null))['catch'](handleError(_0x1d81e6,null));};exports[_0xef4b('0x2c')]=function(_0x23cadb,_0x2077b7){return db[_0xef4b('0x29')][_0xef4b('0x2a')]({'where':{'id':_0x23cadb[_0xef4b('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2077b7,null))[_0xef4b('0x2b')](removeEntity(_0x2077b7,null))[_0xef4b('0x2e')](handleError(_0x2077b7,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 792bfd8..19b690b 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 _0x559a=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2bc191,_0x3443ec){var _0x1ec55c=function(_0x1b812d){while(--_0x1b812d){_0x2bc191['push'](_0x2bc191['shift']());}};_0x1ec55c(++_0x3443ec);}(_0x559a,0xe3));var _0xa559=function(_0x52a041,_0x1fff86){_0x52a041=_0x52a041-0x0;var _0x31c35e=_0x559a[_0x52a041];return _0x31c35e;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var logger=require(_0xa559('0x2'))(_0xa559('0x3'));var moment=require('moment');var BPromise=require(_0xa559('0x4'));var rp=require(_0xa559('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa559('0x6'));var config=require(_0xa559('0x7'));var attributes=require(_0xa559('0x8'));module[_0xa559('0x9')]=function(_0x42eae7,_0x1d2953){return _0x42eae7[_0xa559('0xa')](_0xa559('0xb'),attributes,{'tableName':_0xa559('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfe9=['moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x1d878b,_0x41ebb6){var _0x477347=function(_0x562be3){while(--_0x562be3){_0x1d878b['push'](_0x1d878b['shift']());}};_0x477347(++_0x41ebb6);}(_0xdfe9,0x14e));var _0x9dfe=function(_0x368618,_0x307064){_0x368618=_0x368618-0x0;var _0xf5fbec=_0xdfe9[_0x368618];return _0xf5fbec;};'use strict';var _=require('lodash');var util=require(_0x9dfe('0x0'));var logger=require(_0x9dfe('0x1'))('api');var moment=require(_0x9dfe('0x2'));var BPromise=require(_0x9dfe('0x3'));var rp=require(_0x9dfe('0x4'));var fs=require('fs');var path=require(_0x9dfe('0x5'));var rimraf=require('rimraf');var config=require(_0x9dfe('0x6'));var attributes=require(_0x9dfe('0x7'));module[_0x9dfe('0x8')]=function(_0x899faf,_0x532c31){return _0x899faf[_0x9dfe('0x9')](_0x9dfe('0xa'),attributes,{'tableName':_0x9dfe('0xb'),'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 59159db..ad1aac3 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 _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x539b10,_0x3c2d7b){_0x539b10=_0x539b10-0x0;var _0x360716=_0x7a54[_0x539b10];return _0x360716;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b3e7f,_0x2c307f){var _0x257f4b=function(_0x2eba4c){while(--_0x2eba4c){_0x1b3e7f['push'](_0x1b3e7f['shift']());}};_0x257f4b(++_0x2c307f);}(_0x326f,0xd1));var _0xf326=function(_0x28fc58,_0x37bc3a){_0x28fc58=_0x28fc58-0x0;var _0x185ada=_0x326f[_0x28fc58];return _0x185ada;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 6afb03a..aaa99f5 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 _0x2a7c=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2a7c,0x105));var _0xc2a7=function(_0x9c12f3,_0x1721ab){_0x9c12f3=_0x9c12f3-0x0;var _0x10f68b=_0x2a7c[_0x9c12f3];return _0x10f68b;};'use strict';var multer=require(_0xc2a7('0x0'));var util=require('util');var path=require(_0xc2a7('0x1'));var timeout=require(_0xc2a7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc2a7('0x3'));var auth=require(_0xc2a7('0x4'));var interaction=require(_0xc2a7('0x5'));var config=require('../../config/environment');var controller=require(_0xc2a7('0x6'));router[_0xc2a7('0x7')](_0xc2a7('0x8'),auth[_0xc2a7('0x9')](),controller['update']);router[_0xc2a7('0xa')](_0xc2a7('0x8'),auth[_0xc2a7('0x9')](),controller[_0xc2a7('0xb')]);module[_0xc2a7('0xc')]=router;
\ No newline at end of file
+var _0x762f=['../../config/environment','./action.controller','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x114da9,_0xd91064){var _0x2d64f0=function(_0x128064){while(--_0x128064){_0x114da9['push'](_0x114da9['shift']());}};_0x2d64f0(++_0xd91064);}(_0x762f,0x161));var _0xf762=function(_0x59b104,_0x3efcd1){_0x59b104=_0x59b104-0x0;var _0x115b85=_0x762f[_0x59b104];return _0x115b85;};'use strict';var multer=require(_0xf762('0x0'));var util=require(_0xf762('0x1'));var path=require(_0xf762('0x2'));var timeout=require('connect-timeout');var express=require(_0xf762('0x3'));var router=express[_0xf762('0x4')]();var fs_extra=require(_0xf762('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf762('0x6'));var config=require(_0xf762('0x7'));var controller=require(_0xf762('0x8'));router['put']('/:id',auth[_0xf762('0x9')](),controller[_0xf762('0xa')]);router[_0xf762('0xb')](_0xf762('0xc'),auth[_0xf762('0x9')](),controller[_0xf762('0xd')]);module[_0xf762('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 5ca1128..3c8ce18 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x27e624,_0x20a70f){var _0x2960a0=function(_0x50be87){while(--_0x50be87){_0x27e624['push'](_0x27e624['shift']());}};_0x2960a0(++_0x20a70f);}(_0xeec6,0x1c2));var _0x6eec=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0xeec6[_0xd1b4d7];return _0x3002ec;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x1fa274,_0x27a51f){var _0x5601e0=function(_0x146c2c){while(--_0x146c2c){_0x1fa274['push'](_0x1fa274['shift']());}};_0x5601e0(++_0x27a51f);}(_0xac9d,0x14d));var _0xdac9=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0xac9d[_0x54f7c0];return _0x245d03;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index e2a5bd2..65e0e49 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 _0xe7f8=['show','params','includeAll','create','body','user','get','role','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','replace','function','format','groupBy','order','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','MetricId','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','clone','QueryTypes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','CustomReports','UserProfileResource','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','options','AnalyticCustomReport','include','rows','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7f8,0x1b3));var _0x8e7f=function(_0x354fa5,_0x1c78f4){_0x354fa5=_0x354fa5-0x0;var _0x2da545=_0xe7f8[_0x354fa5];return _0x2da545;};'use strict';var emlformat=require(_0x8e7f('0x0'));var rimraf=require(_0x8e7f('0x1'));var zipdir=require(_0x8e7f('0x2'));var jsonpatch=require(_0x8e7f('0x3'));var rp=require(_0x8e7f('0x4'));var moment=require(_0x8e7f('0x5'));var BPromise=require(_0x8e7f('0x6'));var Mustache=require(_0x8e7f('0x7'));var util=require('util');var path=require(_0x8e7f('0x8'));var sox=require(_0x8e7f('0x9'));var csv=require('to-csv');var ejs=require(_0x8e7f('0xa'));var fs=require('fs');var fs_extra=require(_0x8e7f('0xb'));var _=require(_0x8e7f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e7f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e7f('0xe'));var querystring=require(_0x8e7f('0xf'));var Papa=require('papaparse');var Redis=require(_0x8e7f('0x10'));var authService=require(_0x8e7f('0x11'));var qs=require(_0x8e7f('0x12'));var as=require(_0x8e7f('0x13'));var hardwareService=require(_0x8e7f('0x14'));var logger=require('../../config/logger')(_0x8e7f('0x15'));var utils=require(_0x8e7f('0x16'));var config=require(_0x8e7f('0x17'));var licenseUtil=require(_0x8e7f('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8e7f('0x19'))[_0x8e7f('0x1a')];function respondWithStatusCode(_0x377fc9,_0x3b6229){_0x3b6229=_0x3b6229||0xcc;return function(_0x46188a){if(_0x46188a){return _0x377fc9[_0x8e7f('0x1b')](_0x3b6229);}return _0x377fc9['status'](_0x3b6229)[_0x8e7f('0x1c')]();};}function respondWithResult(_0x57b6a4,_0x5e6f97){_0x5e6f97=_0x5e6f97||0xc8;return function(_0x1c6b7c){if(_0x1c6b7c){return _0x57b6a4[_0x8e7f('0x1d')](_0x5e6f97)[_0x8e7f('0x1e')](_0x1c6b7c);}};}function respondWithFilteredResult(_0x29c973,_0x24ca19){return function(_0xde89cd){if(_0xde89cd){var _0x1983f6=typeof _0x24ca19[_0x8e7f('0x1f')]===_0x8e7f('0x20')&&typeof _0x24ca19[_0x8e7f('0x21')]===_0x8e7f('0x20');var _0x45c384=_0xde89cd[_0x8e7f('0x22')];var _0x105963=_0x1983f6?0x0:_0x24ca19[_0x8e7f('0x1f')];var _0x470ad4=_0x1983f6?_0xde89cd[_0x8e7f('0x22')]:_0x24ca19['offset']+_0x24ca19[_0x8e7f('0x21')];var _0x51a459;if(_0x470ad4>=_0x45c384){_0x470ad4=_0x45c384;_0x51a459=0xc8;}else{_0x51a459=0xce;}_0x29c973[_0x8e7f('0x1d')](_0x51a459);return _0x29c973[_0x8e7f('0x23')](_0x8e7f('0x24'),_0x105963+'-'+_0x470ad4+'/'+_0x45c384)[_0x8e7f('0x1e')](_0xde89cd);}return null;};}function patchUpdates(_0x3d27a6){return function(_0x1fb732){try{jsonpatch['apply'](_0x1fb732,_0x3d27a6,!![]);}catch(_0x208fb8){return BPromise[_0x8e7f('0x25')](_0x208fb8);}return _0x1fb732['save']();};}function saveUpdates(_0x36dcf6,_0x1b8d06){return function(_0x25ad2d){if(_0x25ad2d){return _0x25ad2d[_0x8e7f('0x26')](_0x36dcf6)[_0x8e7f('0x27')](function(_0x14e322){return _0x14e322;});}return null;};}function removeEntity(_0x22d764,_0x2571fe){return function(_0xb4829f){if(_0xb4829f){return _0xb4829f[_0x8e7f('0x28')]()[_0x8e7f('0x27')](function(){var _0x304fc3=_0xb4829f['get']({'plain':!![]});var _0x4ef107=_0x8e7f('0x29');return db[_0x8e7f('0x2a')]['destroy']({'where':{'type':_0x4ef107,'resourceId':_0x304fc3['id']}})[_0x8e7f('0x27')](function(){return _0xb4829f;});})[_0x8e7f('0x27')](function(){_0x22d764[_0x8e7f('0x1d')](0xcc)[_0x8e7f('0x1c')]();});}};}function handleEntityNotFound(_0x503519,_0xf7ae){return function(_0x3b1b99){if(!_0x3b1b99){_0x503519[_0x8e7f('0x1b')](0x194);}return _0x3b1b99;};}function handleError(_0x5eeef6,_0x57aae7){_0x57aae7=_0x57aae7||0x1f4;return function(_0x3aaa62){logger['error'](_0x3aaa62[_0x8e7f('0x2b')]);if(_0x3aaa62[_0x8e7f('0x2c')]){delete _0x3aaa62[_0x8e7f('0x2c')];}_0x5eeef6[_0x8e7f('0x1d')](_0x57aae7)[_0x8e7f('0x2d')](_0x3aaa62);};}exports[_0x8e7f('0x2e')]=function(_0x193f2b,_0xda752f){var _0x23a610={},_0x24b2a6={},_0x34ff3d={'count':0x0,'rows':[]};var _0x3ebc00=_[_0x8e7f('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0x17b349){return{'name':_0x17b349[_0x8e7f('0x30')],'type':_0x17b349[_0x8e7f('0x31')][_0x8e7f('0x32')]};});_0x24b2a6[_0x8e7f('0x33')]=_[_0x8e7f('0x2f')](_0x3ebc00,_0x8e7f('0x2c'));_0x24b2a6[_0x8e7f('0x34')]=_[_0x8e7f('0x35')](_0x193f2b[_0x8e7f('0x34')]);_0x24b2a6[_0x8e7f('0x36')]=_[_0x8e7f('0x37')](_0x24b2a6[_0x8e7f('0x33')],_0x24b2a6[_0x8e7f('0x34')]);_0x23a610[_0x8e7f('0x38')]=_['intersection'](_0x24b2a6[_0x8e7f('0x33')],qs['fields'](_0x193f2b[_0x8e7f('0x34')][_0x8e7f('0x39')]));_0x23a610[_0x8e7f('0x38')]=_0x23a610['attributes'][_0x8e7f('0x3a')]?_0x23a610[_0x8e7f('0x38')]:_0x24b2a6[_0x8e7f('0x33')];if(!_0x193f2b['query']['hasOwnProperty']('nolimit')){_0x23a610[_0x8e7f('0x21')]=qs[_0x8e7f('0x21')](_0x193f2b['query'][_0x8e7f('0x21')]);_0x23a610['offset']=qs[_0x8e7f('0x1f')](_0x193f2b['query'][_0x8e7f('0x1f')]);}_0x23a610['order']=qs[_0x8e7f('0x3b')](_0x193f2b[_0x8e7f('0x34')]['sort']);_0x23a610['where']=qs[_0x8e7f('0x36')](_[_0x8e7f('0x3c')](_0x193f2b[_0x8e7f('0x34')],_0x24b2a6[_0x8e7f('0x36')]),_0x3ebc00);if(_0x193f2b[_0x8e7f('0x34')][_0x8e7f('0x3d')]){_0x23a610[_0x8e7f('0x3e')]=_[_0x8e7f('0x3f')](_0x23a610[_0x8e7f('0x3e')],{'$or':_[_0x8e7f('0x2f')](_0x3ebc00,function(_0x228c44){if(_0x228c44[_0x8e7f('0x31')]!=='VIRTUAL'){var _0x171cee={};_0x171cee[_0x228c44['name']]={'$like':'%'+_0x193f2b['query'][_0x8e7f('0x3d')]+'%'};return _0x171cee;}})});}_0x23a610=_[_0x8e7f('0x3f')]({},_0x23a610,_0x193f2b[_0x8e7f('0x40')]);var _0x2737e0={'where':_0x23a610[_0x8e7f('0x3e')]};return db[_0x8e7f('0x41')]['count'](_0x2737e0)[_0x8e7f('0x27')](function(_0x320257){_0x34ff3d[_0x8e7f('0x22')]=_0x320257;if(_0x193f2b['query']['includeAll']){_0x23a610[_0x8e7f('0x42')]=[{'all':!![]}];}return db[_0x8e7f('0x41')]['findAll'](_0x23a610);})[_0x8e7f('0x27')](function(_0x221268){_0x34ff3d[_0x8e7f('0x43')]=_0x221268;return _0x34ff3d;})[_0x8e7f('0x27')](respondWithFilteredResult(_0xda752f,_0x23a610))[_0x8e7f('0x44')](handleError(_0xda752f,null));};exports[_0x8e7f('0x45')]=function(_0x14781f,_0x5b651e){var _0x7c8560={'raw':![],'where':{'id':_0x14781f[_0x8e7f('0x46')]['id']}},_0x21f77d={};_0x21f77d[_0x8e7f('0x33')]=_[_0x8e7f('0x35')](db['AnalyticCustomReport']['rawAttributes']);_0x21f77d[_0x8e7f('0x34')]=_[_0x8e7f('0x35')](_0x14781f['query']);_0x21f77d[_0x8e7f('0x36')]=_[_0x8e7f('0x37')](_0x21f77d['model'],_0x21f77d[_0x8e7f('0x34')]);_0x7c8560[_0x8e7f('0x38')]=_[_0x8e7f('0x37')](_0x21f77d[_0x8e7f('0x33')],qs['fields'](_0x14781f[_0x8e7f('0x34')][_0x8e7f('0x39')]));_0x7c8560[_0x8e7f('0x38')]=_0x7c8560[_0x8e7f('0x38')][_0x8e7f('0x3a')]?_0x7c8560['attributes']:_0x21f77d[_0x8e7f('0x33')];if(_0x14781f['query'][_0x8e7f('0x47')]){_0x7c8560[_0x8e7f('0x42')]=[{'all':!![]}];}_0x7c8560=_[_0x8e7f('0x3f')]({},_0x7c8560,_0x14781f[_0x8e7f('0x40')]);return db[_0x8e7f('0x41')]['find'](_0x7c8560)[_0x8e7f('0x27')](handleEntityNotFound(_0x5b651e,null))[_0x8e7f('0x27')](respondWithResult(_0x5b651e,null))[_0x8e7f('0x44')](handleError(_0x5b651e,null));};exports['create']=function(_0x1aeba0,_0x38ba9){return db['AnalyticCustomReport'][_0x8e7f('0x48')](_0x1aeba0[_0x8e7f('0x49')],{})[_0x8e7f('0x27')](function(_0x1e80fa){var _0x5b81c3=_0x1aeba0[_0x8e7f('0x4a')][_0x8e7f('0x4b')]({'plain':!![]});if(!_0x5b81c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b81c3[_0x8e7f('0x4c')]===_0x8e7f('0x4a')){var _0x31b914=_0x1e80fa[_0x8e7f('0x4b')]({'plain':!![]});var _0x57ff11=_0x8e7f('0x4d');return db[_0x8e7f('0x4e')]['find']({'where':{'name':_0x57ff11,'userProfileId':_0x5b81c3['userProfileId']},'raw':!![]})['then'](function(_0x5f234b){if(_0x5f234b&&_0x5f234b[_0x8e7f('0x4f')]===0x0){return db[_0x8e7f('0x2a')][_0x8e7f('0x48')]({'name':_0x31b914[_0x8e7f('0x2c')],'resourceId':_0x31b914['id'],'type':'CustomReports','sectionId':_0x5f234b['id']},{})[_0x8e7f('0x27')](function(){return _0x1e80fa;});}else{return _0x1e80fa;}})[_0x8e7f('0x44')](function(_0x225e13){logger['error'](_0x8e7f('0x50'),_0x225e13);throw _0x225e13;});}return _0x1e80fa;})['then'](respondWithResult(_0x38ba9,0xc9))['catch'](handleError(_0x38ba9,null));};exports['update']=function(_0x180e9d,_0xf28830){if(_0x180e9d['body']['id']){delete _0x180e9d['body']['id'];}return db[_0x8e7f('0x41')]['find']({'where':{'id':_0x180e9d[_0x8e7f('0x46')]['id']}})[_0x8e7f('0x27')](handleEntityNotFound(_0xf28830,null))[_0x8e7f('0x27')](saveUpdates(_0x180e9d[_0x8e7f('0x49')],null))[_0x8e7f('0x27')](respondWithResult(_0xf28830,null))[_0x8e7f('0x44')](handleError(_0xf28830,null));};exports[_0x8e7f('0x28')]=function(_0x3a71ab,_0x240fc8){return db[_0x8e7f('0x41')][_0x8e7f('0x51')]({'where':{'id':_0x3a71ab[_0x8e7f('0x46')]['id']}})[_0x8e7f('0x27')](handleEntityNotFound(_0x240fc8,null))['then'](removeEntity(_0x240fc8,null))[_0x8e7f('0x44')](handleError(_0x240fc8,null));};exports[_0x8e7f('0x52')]=function(_0x1650a3,_0x886fae){var _0x47e35d=0xa;var _0x1d02ae=[_0x8e7f('0x53'),_0x8e7f('0x54'),_0x8e7f('0x55'),'cross_join'];var _0x2d98db={'SUM':_0x8e7f('0x56'),'COUNT':_0x8e7f('0x57'),'COUNT DISTINCT':_0x8e7f('0x58'),'MAX':_0x8e7f('0x59'),'MIN':'MIN(%s)','AVG':_0x8e7f('0x5a'),'GROUP_CONCAT':_0x8e7f('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8e7f('0x5c')};var _0x188cc9={'SEC_TO_TIME':_0x8e7f('0x5d'),'DATE':_0x8e7f('0x5e'),'HOUR':_0x8e7f('0x5f'),'ROUND':_0x8e7f('0x60'),'UNIX_TIMESTAMP':_0x8e7f('0x61')};var _0x1292a6=function(_0x128d30){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8e7f('0x62'),'IS\x20NOT\x20EMPTY'],_0x128d30);};var _0x3921dd=function(_0xed2ba6){if(!_0xed2ba6||!_0xed2ba6['rules']['length']){return'';}for(var _0x3b81b0='(',_0x56f18d=0x0;_0x56f18d<_0xed2ba6[_0x8e7f('0x63')][_0x8e7f('0x3a')];_0x56f18d+=0x1){_0x56f18d>0x0&&(_0x3b81b0+='\x20'+_0xed2ba6[_0x8e7f('0x64')]+'\x20');_0x3b81b0+=_0xed2ba6['rules'][_0x56f18d][_0x8e7f('0x65')]?_0x3921dd(_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x65')]):_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x66')]+'\x20'+_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x67')]+(_0x1292a6(_0xed2ba6['rules'][_0x56f18d][_0x8e7f('0x67')])?'\x20'+_0xed2ba6[_0x8e7f('0x63')][_0x56f18d][_0x8e7f('0x68')]:'');}return _0x3b81b0+')';};var _0x407ed0={'where':{'id':_0x1650a3[_0x8e7f('0x46')]['id']}},_0x5321bc,_0x52f0da,_0x2ec222,_0x2e087a,_0x500279;_0x407ed0=_[_0x8e7f('0x3f')]({},_0x407ed0,_0x1650a3['options']);return db[_0x8e7f('0x41')][_0x8e7f('0x51')](_0x407ed0)[_0x8e7f('0x27')](function(_0x28300a){if(_0x28300a){_0x5321bc=_0x28300a;return _0x28300a[_0x8e7f('0x69')]();}return null;})[_0x8e7f('0x27')](function(_0x4a708c){if(_0x4a708c){if(!_0x4a708c[_0x8e7f('0x3a')]){throw new db['Sequelize'][(_0x8e7f('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x52f0da=_0x4a708c;return db[_0x8e7f('0x6b')][_0x8e7f('0x6c')]({'raw':!![]});}return null;})[_0x8e7f('0x27')](function(_0x1f761d){if(_0x1f761d){_0x2ec222=_[_0x8e7f('0x6d')](_0x1f761d,'id');var _0x1ce7d9;var _0x5d41d4=squel[_0x8e7f('0x6e')]();_0x5d41d4[_0x8e7f('0x6f')](_0x5321bc[_0x8e7f('0x70')]);for(var _0x420d61=0x0;_0x420d61<_0x52f0da[_0x8e7f('0x3a')];_0x420d61+=0x1){_0x1ce7d9=_0x52f0da[_0x420d61]['MetricId']?_0x2ec222[_0x52f0da[_0x420d61]['MetricId']]['metric']:_0x52f0da[_0x420d61][_0x8e7f('0x66')];_0x1ce7d9=_0x52f0da[_0x420d61]['function']?_[_0x8e7f('0x71')](_0x2d98db[_0x52f0da[_0x420d61][_0x8e7f('0x72')]],'%s',_0x1ce7d9):_0x1ce7d9;_0x1ce7d9=_0x52f0da[_0x420d61][_0x8e7f('0x73')]?_[_0x8e7f('0x71')](_0x188cc9[_0x52f0da[_0x420d61][_0x8e7f('0x73')]],'%s',_0x1ce7d9):_0x1ce7d9;if(_0x52f0da[_0x420d61][_0x8e7f('0x74')]){_0x5d41d4[_0x8e7f('0x65')](_0x1ce7d9);}_0x52f0da[_0x420d61]['orderBy']&&_0x5d41d4[_0x8e7f('0x75')](_0x1ce7d9,_0x52f0da[_0x420d61][_0x8e7f('0x76')]===_0x8e7f('0x77')?![]:!![]);_0x5d41d4[_0x8e7f('0x66')](_0x1ce7d9,_0x52f0da[_0x420d61][_0x8e7f('0x78')]||_0x1ce7d9);}if(_0x5321bc[_0x8e7f('0x79')]){_0x5321bc['joins']=JSON[_0x8e7f('0x7a')](_0x5321bc['joins']);for(var _0xb13094=0x0;_0xb13094<_0x5321bc[_0x8e7f('0x79')]['length'];_0xb13094+=0x1){if(_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x31')]&&_[_0x8e7f('0x7b')](_0x1d02ae,_0x5321bc[_0x8e7f('0x79')][_0xb13094]['type'])&&_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7c')]&&_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7d')]&&_0x5321bc['joins'][_0xb13094][_0x8e7f('0x7e')]){_0x5d41d4[_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x31')]](_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7d')],null,util[_0x8e7f('0x73')](_0x8e7f('0x7f'),_0x5321bc[_0x8e7f('0x70')],_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7c')],_0x5321bc['joins'][_0xb13094][_0x8e7f('0x7d')],_0x5321bc[_0x8e7f('0x79')][_0xb13094][_0x8e7f('0x7e')]));}}}if(_0x5321bc[_0x8e7f('0x80')]){_0x5321bc[_0x8e7f('0x80')]=JSON[_0x8e7f('0x7a')](_0x5321bc[_0x8e7f('0x80')]);_0x5d41d4[_0x8e7f('0x3e')](_0x3921dd(_0x5321bc[_0x8e7f('0x80')]['group']));}_0x500279=_0x5d41d4['clone']();_0x5d41d4[_0x8e7f('0x21')](_0x47e35d);_0x5d41d4[_0x8e7f('0x1f')](0x0);logger[_0x8e7f('0x81')](_0x8e7f('0x82'),_0x5d41d4[_0x8e7f('0x83')]());return dbH[_0x8e7f('0x84')][_0x8e7f('0x34')](_0x5d41d4['toString'](),{'type':dbH[_0x8e7f('0x84')]['QueryTypes'][_0x8e7f('0x85')]});}})[_0x8e7f('0x27')](respondWithResult(_0x886fae,null))['catch'](handleError(_0x886fae,null));};function runReport(_0x5e78dc,_0xd0b3e4,_0x400f81){var _0x1de3c4=_0xd0b3e4[_0x8e7f('0x2c')];var _0x5c6cb7=0xa;var _0x101b43=[_0x8e7f('0x53'),'left_join',_0x8e7f('0x55'),_0x8e7f('0x86')];var _0x5cc2f5={'SUM':'SUM(%s)','COUNT':_0x8e7f('0x57'),'COUNT DISTINCT':_0x8e7f('0x58'),'MAX':_0x8e7f('0x59'),'MIN':_0x8e7f('0x87'),'AVG':_0x8e7f('0x5a'),'GROUP_CONCAT':_0x8e7f('0x5b'),'GROUP_CONCAT ASC':_0x8e7f('0x88'),'GROUP_CONCAT DESC':_0x8e7f('0x5c')};var _0x5b2b3d={'SEC_TO_TIME':_0x8e7f('0x5d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x8e7f('0x60'),'UNIX_TIMESTAMP':_0x8e7f('0x61')};var _0x54fb42=function(_0x5b519b){return!_['includes'](['IS\x20NULL',_0x8e7f('0x89'),_0x8e7f('0x62'),'IS\x20NOT\x20EMPTY'],_0x5b519b);};var _0x4f7388=function(_0x4989cb){if(!_0x4989cb||!_0x4989cb['rules'][_0x8e7f('0x3a')]){return'';}for(var _0x1ccb0d='(',_0x14e7d3=0x0;_0x14e7d3<_0x4989cb['rules'][_0x8e7f('0x3a')];_0x14e7d3+=0x1){_0x14e7d3>0x0&&(_0x1ccb0d+='\x20'+_0x4989cb[_0x8e7f('0x64')]+'\x20');_0x1ccb0d+=_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x65')]?_0x4f7388(_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x65')]):_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x66')]+'\x20'+_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x67')]+(_0x54fb42(_0x4989cb['rules'][_0x14e7d3][_0x8e7f('0x67')])?'\x20'+_0x4989cb[_0x8e7f('0x63')][_0x14e7d3][_0x8e7f('0x68')]:'');}return _0x1ccb0d+')';};var _0x4cd40e={'where':{'id':_0x5e78dc['id']}},_0x4557e6,_0x172fcf,_0x1a51ee,_0x35621c,_0x3cbaf6;_0x4cd40e=_[_0x8e7f('0x3f')]({},_0x4cd40e,_0x400f81);return db[_0x8e7f('0x41')][_0x8e7f('0x51')](_0x4cd40e)[_0x8e7f('0x27')](function(_0x52162e){if(_0x52162e){_0x4557e6=_0x52162e;return _0x52162e[_0x8e7f('0x69')]();}return null;})[_0x8e7f('0x27')](function(_0xcae4b5){if(_0xcae4b5){if(!_0xcae4b5[_0x8e7f('0x3a')]){throw new db[(_0x8e7f('0x8a'))]['ValidationErrorItem'](_0x8e7f('0x8b'),0x193);}_0x172fcf=_0xcae4b5;return db[_0x8e7f('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x8e7f('0x27')](function(_0x5b873d){if(_0x5b873d){_0x1a51ee=_[_0x8e7f('0x6d')](_0x5b873d,'id');var _0x4fdc1a;var _0x3b2be7=squel[_0x8e7f('0x6e')]();_0x3b2be7[_0x8e7f('0x6f')](_0x4557e6[_0x8e7f('0x70')]);for(var _0x4a130c=0x0;_0x4a130c<_0x172fcf['length'];_0x4a130c+=0x1){_0x4fdc1a=_0x172fcf[_0x4a130c]['MetricId']?_0x1a51ee[_0x172fcf[_0x4a130c][_0x8e7f('0x8c')]]['metric']:_0x172fcf[_0x4a130c][_0x8e7f('0x66')];_0x4fdc1a=_0x172fcf[_0x4a130c][_0x8e7f('0x72')]?_[_0x8e7f('0x71')](_0x5cc2f5[_0x172fcf[_0x4a130c][_0x8e7f('0x72')]],'%s',_0x4fdc1a):_0x4fdc1a;_0x4fdc1a=_0x172fcf[_0x4a130c]['format']?_[_0x8e7f('0x71')](_0x5b2b3d[_0x172fcf[_0x4a130c][_0x8e7f('0x73')]],'%s',_0x4fdc1a):_0x4fdc1a;if(_0x172fcf[_0x4a130c][_0x8e7f('0x74')]){_0x3b2be7[_0x8e7f('0x65')](_0x4fdc1a);}_0x172fcf[_0x4a130c]['orderBy']&&_0x3b2be7['order'](_0x4fdc1a,_0x172fcf[_0x4a130c][_0x8e7f('0x76')]==='DESC'?![]:!![]);_0x3b2be7[_0x8e7f('0x66')](_0x4fdc1a,_0x172fcf[_0x4a130c][_0x8e7f('0x78')]||_0x4fdc1a);}if(_0x4557e6[_0x8e7f('0x79')]){_0x4557e6[_0x8e7f('0x79')]=JSON[_0x8e7f('0x7a')](_0x4557e6['joins']);for(var _0x5098fa=0x0;_0x5098fa<_0x4557e6['joins'][_0x8e7f('0x3a')];_0x5098fa+=0x1){if(_0x4557e6[_0x8e7f('0x79')][_0x5098fa]['type']&&_[_0x8e7f('0x7b')](_0x101b43,_0x4557e6[_0x8e7f('0x79')][_0x5098fa]['type'])&&_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7c')]&&_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7d')]&&_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7e')]){_0x3b2be7[_0x4557e6['joins'][_0x5098fa][_0x8e7f('0x31')]](_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7d')],null,util['format'](_0x8e7f('0x7f'),_0x4557e6['table'],_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7c')],_0x4557e6[_0x8e7f('0x79')][_0x5098fa][_0x8e7f('0x7d')],_0x4557e6['joins'][_0x5098fa]['foreignKey']));}}}if(_0x4557e6[_0x8e7f('0x80')]){_0x4557e6['conditions']=JSON[_0x8e7f('0x7a')](_0x4557e6[_0x8e7f('0x80')]);_0x3b2be7[_0x8e7f('0x3e')](_0x4f7388(_0x4557e6['conditions'][_0x8e7f('0x65')]));}_0x3cbaf6=_0x3b2be7['clone']();_0x3b2be7['limit'](_0x5c6cb7);_0x3b2be7[_0x8e7f('0x1f')](0x0);return;}})['then'](function(){if(_0xd0b3e4[_0x8e7f('0x8d')]===_0x8e7f('0x8e')){return null;}var _0x5a9b04=_[_0x8e7f('0x3f')](_0xd0b3e4,{'name':_0xd0b3e4[_0x8e7f('0x8f')]||_0xd0b3e4[_0x8e7f('0x2c')]||_0x4557e6['name'],'basename':_0x1de3c4,'savename':util[_0x8e7f('0x73')](_0x8e7f('0x90'),_0xd0b3e4[_0x8e7f('0x2c')]||_0x4557e6['name'],require(_0x8e7f('0x91'))[_0x8e7f('0x92')](0x4),_0xd0b3e4[_0x8e7f('0x8d')]||_0x8e7f('0x93')),'reportId':_0x4557e6['id'],'reportType':'custom'});return db[_0x8e7f('0x94')]['create'](_0x5a9b04,{'raw':!![]});})[_0x8e7f('0x27')](function(_0x2a3046){if(_0x4557e6[_0x8e7f('0x70')]===_0x8e7f('0x95')){_0x3cbaf6[_0x8e7f('0x3e')](_0x4557e6[_0x8e7f('0x70')]+_0x8e7f('0x96'),_0xd0b3e4[_0x8e7f('0x97')],_0xd0b3e4[_0x8e7f('0x98')]);}else{_0x3cbaf6[_0x8e7f('0x3e')](_0x4557e6['table']+_0x8e7f('0x99'),_0xd0b3e4['startDate'],_0xd0b3e4[_0x8e7f('0x98')]);}if(_0x2a3046){logger['info'](_0x8e7f('0x9a'),_0x3cbaf6[_0x8e7f('0x83')]());require(_0x8e7f('0x9b'))[_0x8e7f('0x9c')](path['join'](__dirname,_0x8e7f('0x9d'),_0x2a3046['output']),[_0x2a3046['id'],_0x3cbaf6[_0x8e7f('0x83')](),path[_0x8e7f('0x53')](__dirname,_0x8e7f('0x9e'),_0x2a3046[_0x8e7f('0x9f')]),_0x1de3c4]);return _0x2a3046;}else{var _0x19a8ab=squel[_0x8e7f('0x6e')]();_0x19a8ab[_0x8e7f('0x6f')]('('+_0x3cbaf6[_0x8e7f('0x83')]()+')',_0x8e7f('0xa0'));_0x19a8ab[_0x8e7f('0x66')](_0x8e7f('0xa1'),_0x8e7f('0x22'));_0x3cbaf6[_0x8e7f('0x21')](_0xd0b3e4[_0x8e7f('0x21')]||_0x5c6cb7);_0x3cbaf6[_0x8e7f('0x1f')](_0xd0b3e4[_0x8e7f('0x1f')]||0x0);return dbH['sequelize'][_0x8e7f('0x34')](_0x19a8ab[_0x8e7f('0x83')](),{'type':dbH[_0x8e7f('0x84')]['QueryTypes'][_0x8e7f('0x85')]})[_0x8e7f('0x27')](function(_0x193312){if(!_0x193312[_0x8e7f('0x3a')]){_0x35621c=0x0;}else{_0x35621c=_0x193312[0x0][_0x8e7f('0x22')]||0x0;}return dbH[_0x8e7f('0x84')][_0x8e7f('0x34')](_0x3cbaf6[_0x8e7f('0x83')](),{'type':dbH[_0x8e7f('0x84')]['QueryTypes'][_0x8e7f('0x85')]});})[_0x8e7f('0x27')](function(_0x2ae5c3){return{'rows':_0x2ae5c3||[],'count':_0x35621c};});}});}exports[_0x8e7f('0xa2')]=function(_0x35d0c0,_0xdec254){return runReport(_0x35d0c0[_0x8e7f('0x46')],_0x35d0c0[_0x8e7f('0x34')],_0x35d0c0[_0x8e7f('0x40')])['then'](respondWithResult(_0xdec254,null))[_0x8e7f('0x44')](handleError(_0xdec254,null));};exports[_0x8e7f('0xa3')]=runReport;exports[_0x8e7f('0x34')]=function(_0x569586,_0x153a4f){var _0x4a9397=0xa;var _0x503d9f=['join',_0x8e7f('0x54'),'right_join','cross_join'];var _0x2bcbdd={'SUM':_0x8e7f('0x56'),'COUNT':_0x8e7f('0x57'),'COUNT DISTINCT':_0x8e7f('0x58'),'MAX':'MAX(%s)','MIN':_0x8e7f('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8e7f('0x5b'),'GROUP_CONCAT ASC':_0x8e7f('0x88'),'GROUP_CONCAT DESC':_0x8e7f('0x5c')};var _0x416ad5={'SEC_TO_TIME':_0x8e7f('0x5d'),'DATE':'DATE(%s)','HOUR':_0x8e7f('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3b3380=function(_0x5d0503){return!_[_0x8e7f('0x7b')]([_0x8e7f('0xa4'),_0x8e7f('0x89'),_0x8e7f('0x62'),_0x8e7f('0xa5')],_0x5d0503);};var _0x498378=function(_0x2726c8){if(!_0x2726c8||!_0x2726c8[_0x8e7f('0x63')][_0x8e7f('0x3a')]){return'';}for(var _0xae084c='(',_0x564a08=0x0;_0x564a08<_0x2726c8['rules'][_0x8e7f('0x3a')];_0x564a08+=0x1){_0x564a08>0x0&&(_0xae084c+='\x20'+_0x2726c8[_0x8e7f('0x64')]+'\x20');_0xae084c+=_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x65')]?_0x498378(_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x65')]):_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x66')]+'\x20'+_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x67')]+(_0x3b3380(_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x67')])?'\x20'+_0x2726c8[_0x8e7f('0x63')][_0x564a08][_0x8e7f('0x68')]:'');}return _0xae084c+')';};var _0x59c57d={'where':{'id':_0x569586['params']['id']}},_0x54c400,_0x109832,_0x2ad5ba,_0x4ca6d4,_0x517f71;_0x59c57d=_[_0x8e7f('0x3f')]({},_0x59c57d,_0x569586[_0x8e7f('0x40')]);return db[_0x8e7f('0x41')][_0x8e7f('0x51')](_0x59c57d)[_0x8e7f('0x27')](function(_0x2025c5){if(_0x2025c5){_0x54c400=_0x2025c5;return _0x2025c5[_0x8e7f('0x69')]();}return null;})[_0x8e7f('0x27')](function(_0x2d9053){if(_0x2d9053){if(!_0x2d9053[_0x8e7f('0x3a')]){throw new db[(_0x8e7f('0x8a'))][(_0x8e7f('0x6a'))](_0x8e7f('0x8b'),0x193);}_0x109832=_0x2d9053;return db[_0x8e7f('0x6b')][_0x8e7f('0x6c')]({'raw':!![]});}return null;})[_0x8e7f('0x27')](function(_0x2164b0){if(_0x2164b0){_0x2ad5ba=_[_0x8e7f('0x6d')](_0x2164b0,'id');var _0x3d31d6;var _0x52450c=squel[_0x8e7f('0x6e')]();_0x52450c['from'](_0x54c400[_0x8e7f('0x70')]);for(var _0x31e7fa=0x0;_0x31e7fa<_0x109832[_0x8e7f('0x3a')];_0x31e7fa+=0x1){_0x3d31d6=_0x109832[_0x31e7fa][_0x8e7f('0x8c')]?_0x2ad5ba[_0x109832[_0x31e7fa][_0x8e7f('0x8c')]]['metric']:_0x109832[_0x31e7fa]['field'];_0x3d31d6=_0x109832[_0x31e7fa][_0x8e7f('0x72')]?_[_0x8e7f('0x71')](_0x2bcbdd[_0x109832[_0x31e7fa][_0x8e7f('0x72')]],'%s',_0x3d31d6):_0x3d31d6;_0x3d31d6=_0x109832[_0x31e7fa]['format']?_['replace'](_0x416ad5[_0x109832[_0x31e7fa][_0x8e7f('0x73')]],'%s',_0x3d31d6):_0x3d31d6;if(_0x109832[_0x31e7fa]['groupBy']){_0x52450c[_0x8e7f('0x65')](_0x3d31d6);}_0x109832[_0x31e7fa][_0x8e7f('0x76')]&&_0x52450c['order'](_0x3d31d6,_0x109832[_0x31e7fa]['orderBy']===_0x8e7f('0x77')?![]:!![]);_0x52450c[_0x8e7f('0x66')](_0x3d31d6,_0x109832[_0x31e7fa][_0x8e7f('0x78')]||_0x3d31d6);}if(_0x54c400[_0x8e7f('0x79')]){_0x54c400[_0x8e7f('0x79')]=JSON['parse'](_0x54c400[_0x8e7f('0x79')]);for(var _0x2f8003=0x0;_0x2f8003<_0x54c400['joins'][_0x8e7f('0x3a')];_0x2f8003+=0x1){if(_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x31')]&&_['includes'](_0x503d9f,_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x31')])&&_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7c')]&&_0x54c400['joins'][_0x2f8003]['foreignTable']&&_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7e')]){_0x52450c[_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x31')]](_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7d')],null,util[_0x8e7f('0x73')](_0x8e7f('0x7f'),_0x54c400['table'],_0x54c400[_0x8e7f('0x79')][_0x2f8003]['parentKey'],_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7d')],_0x54c400[_0x8e7f('0x79')][_0x2f8003][_0x8e7f('0x7e')]));}}}if(_0x54c400[_0x8e7f('0x80')]){_0x54c400[_0x8e7f('0x80')]=JSON['parse'](_0x54c400[_0x8e7f('0x80')]);_0x52450c['where'](_0x498378(_0x54c400[_0x8e7f('0x80')][_0x8e7f('0x65')]));}_0x517f71=_0x52450c[_0x8e7f('0xa6')]();_0x52450c['limit'](_0x4a9397);_0x52450c['offset'](0x0);logger['debug']('Limited\x20Query:',_0x52450c[_0x8e7f('0x83')]());return dbH[_0x8e7f('0x84')][_0x8e7f('0x34')](_0x52450c[_0x8e7f('0x83')](),{'type':dbH[_0x8e7f('0x84')][_0x8e7f('0xa7')][_0x8e7f('0x85')]});}})[_0x8e7f('0x27')](function(){return{'sql':_0x517f71[_0x8e7f('0x83')]()};})[_0x8e7f('0x27')](respondWithResult(_0x153a4f,null))['catch'](handleError(_0x153a4f,null));};
\ No newline at end of file
+var _0xadf4=['replace','format','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(%s)','MAX(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','value','getFields','keyBy','groupBy','foreignKey','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','savename','countTable','COUNT(*)','sequelize','QueryTypes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','filter','AnalyticCustomReport','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function'];(function(_0x201fc4,_0x50d5f3){var _0x5a3a8e=function(_0x34e2c0){while(--_0x34e2c0){_0x201fc4['push'](_0x201fc4['shift']());}};_0x5a3a8e(++_0x50d5f3);}(_0xadf4,0xd4));var _0x4adf=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xadf4[_0x503ffd];return _0x160437;};'use strict';var emlformat=require(_0x4adf('0x0'));var rimraf=require(_0x4adf('0x1'));var zipdir=require(_0x4adf('0x2'));var jsonpatch=require(_0x4adf('0x3'));var rp=require(_0x4adf('0x4'));var moment=require('moment');var BPromise=require(_0x4adf('0x5'));var Mustache=require(_0x4adf('0x6'));var util=require(_0x4adf('0x7'));var path=require(_0x4adf('0x8'));var sox=require(_0x4adf('0x9'));var csv=require(_0x4adf('0xa'));var ejs=require(_0x4adf('0xb'));var fs=require('fs');var fs_extra=require(_0x4adf('0xc'));var _=require('lodash');var squel=require(_0x4adf('0xd'));var crypto=require(_0x4adf('0xe'));var jsforce=require(_0x4adf('0xf'));var deskjs=require(_0x4adf('0x10'));var toCsv=require(_0x4adf('0xa'));var querystring=require(_0x4adf('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4adf('0x12'));var qs=require(_0x4adf('0x13'));var as=require(_0x4adf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4adf('0x15'))(_0x4adf('0x16'));var utils=require(_0x4adf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4adf('0x18'));var db=require(_0x4adf('0x19'))['db'];var dbH=require('../../mysqldb')[_0x4adf('0x1a')];function respondWithStatusCode(_0x2cb20c,_0x17d051){_0x17d051=_0x17d051||0xcc;return function(_0x216f58){if(_0x216f58){return _0x2cb20c[_0x4adf('0x1b')](_0x17d051);}return _0x2cb20c['status'](_0x17d051)[_0x4adf('0x1c')]();};}function respondWithResult(_0x38ae51,_0x4104e1){_0x4104e1=_0x4104e1||0xc8;return function(_0x45b7b4){if(_0x45b7b4){return _0x38ae51['status'](_0x4104e1)[_0x4adf('0x1d')](_0x45b7b4);}};}function respondWithFilteredResult(_0x45b161,_0x397e2e){return function(_0x1c0885){if(_0x1c0885){var _0x7ad56b=typeof _0x397e2e['offset']===_0x4adf('0x1e')&&typeof _0x397e2e[_0x4adf('0x1f')]===_0x4adf('0x1e');var _0x560179=_0x1c0885[_0x4adf('0x20')];var _0x400feb=_0x7ad56b?0x0:_0x397e2e['offset'];var _0x4e6241=_0x7ad56b?_0x1c0885[_0x4adf('0x20')]:_0x397e2e[_0x4adf('0x21')]+_0x397e2e['limit'];var _0x5b186b;if(_0x4e6241>=_0x560179){_0x4e6241=_0x560179;_0x5b186b=0xc8;}else{_0x5b186b=0xce;}_0x45b161[_0x4adf('0x22')](_0x5b186b);return _0x45b161[_0x4adf('0x23')](_0x4adf('0x24'),_0x400feb+'-'+_0x4e6241+'/'+_0x560179)[_0x4adf('0x1d')](_0x1c0885);}return null;};}function patchUpdates(_0x3bfc3d){return function(_0x4b2f73){try{jsonpatch[_0x4adf('0x25')](_0x4b2f73,_0x3bfc3d,!![]);}catch(_0x30bcc1){return BPromise[_0x4adf('0x26')](_0x30bcc1);}return _0x4b2f73[_0x4adf('0x27')]();};}function saveUpdates(_0x455bb1,_0x2b9fa0){return function(_0xcb2a77){if(_0xcb2a77){return _0xcb2a77[_0x4adf('0x28')](_0x455bb1)[_0x4adf('0x29')](function(_0x5be2c6){return _0x5be2c6;});}return null;};}function removeEntity(_0x3081ca,_0x1ba54a){return function(_0xe23096){if(_0xe23096){return _0xe23096[_0x4adf('0x2a')]()[_0x4adf('0x29')](function(){var _0x282705=_0xe23096[_0x4adf('0x2b')]({'plain':!![]});var _0x5d09a1=_0x4adf('0x2c');return db['UserProfileResource'][_0x4adf('0x2a')]({'where':{'type':_0x5d09a1,'resourceId':_0x282705['id']}})[_0x4adf('0x29')](function(){return _0xe23096;});})[_0x4adf('0x29')](function(){_0x3081ca[_0x4adf('0x22')](0xcc)[_0x4adf('0x1c')]();});}};}function handleEntityNotFound(_0x1e6b83,_0x1772f1){return function(_0x1579b2){if(!_0x1579b2){_0x1e6b83[_0x4adf('0x1b')](0x194);}return _0x1579b2;};}function handleError(_0x3dacb3,_0x1acfb9){_0x1acfb9=_0x1acfb9||0x1f4;return function(_0xde3030){logger[_0x4adf('0x2d')](_0xde3030[_0x4adf('0x2e')]);if(_0xde3030[_0x4adf('0x2f')]){delete _0xde3030['name'];}_0x3dacb3[_0x4adf('0x22')](_0x1acfb9)[_0x4adf('0x30')](_0xde3030);};}exports['index']=function(_0x5222c1,_0x1f6353){var _0x238ae8={},_0x91228f={},_0x5b2420={'count':0x0,'rows':[]};var _0x420ddc=_['map'](db['AnalyticCustomReport'][_0x4adf('0x31')],function(_0x5dd93d){return{'name':_0x5dd93d[_0x4adf('0x32')],'type':_0x5dd93d['type'][_0x4adf('0x33')]};});_0x91228f['model']=_['map'](_0x420ddc,_0x4adf('0x2f'));_0x91228f[_0x4adf('0x34')]=_['keys'](_0x5222c1[_0x4adf('0x34')]);_0x91228f[_0x4adf('0x35')]=_[_0x4adf('0x36')](_0x91228f[_0x4adf('0x37')],_0x91228f[_0x4adf('0x34')]);_0x238ae8[_0x4adf('0x38')]=_['intersection'](_0x91228f[_0x4adf('0x37')],qs[_0x4adf('0x39')](_0x5222c1[_0x4adf('0x34')][_0x4adf('0x39')]));_0x238ae8[_0x4adf('0x38')]=_0x238ae8[_0x4adf('0x38')][_0x4adf('0x3a')]?_0x238ae8[_0x4adf('0x38')]:_0x91228f[_0x4adf('0x37')];if(!_0x5222c1['query'][_0x4adf('0x3b')]('nolimit')){_0x238ae8['limit']=qs[_0x4adf('0x1f')](_0x5222c1['query'][_0x4adf('0x1f')]);_0x238ae8[_0x4adf('0x21')]=qs['offset'](_0x5222c1[_0x4adf('0x34')][_0x4adf('0x21')]);}_0x238ae8[_0x4adf('0x3c')]=qs[_0x4adf('0x3d')](_0x5222c1[_0x4adf('0x34')][_0x4adf('0x3d')]);_0x238ae8[_0x4adf('0x3e')]=qs[_0x4adf('0x35')](_[_0x4adf('0x3f')](_0x5222c1[_0x4adf('0x34')],_0x91228f[_0x4adf('0x35')]),_0x420ddc);if(_0x5222c1['query']['filter']){_0x238ae8[_0x4adf('0x3e')]=_[_0x4adf('0x40')](_0x238ae8[_0x4adf('0x3e')],{'$or':_[_0x4adf('0x41')](_0x420ddc,function(_0x35ec37){if(_0x35ec37['type']!=='VIRTUAL'){var _0xc3f0ec={};_0xc3f0ec[_0x35ec37['name']]={'$like':'%'+_0x5222c1[_0x4adf('0x34')][_0x4adf('0x42')]+'%'};return _0xc3f0ec;}})});}_0x238ae8=_[_0x4adf('0x40')]({},_0x238ae8,_0x5222c1['options']);var _0x290ed7={'where':_0x238ae8['where']};return db[_0x4adf('0x43')][_0x4adf('0x20')](_0x290ed7)[_0x4adf('0x29')](function(_0x31c31d){_0x5b2420['count']=_0x31c31d;if(_0x5222c1[_0x4adf('0x34')][_0x4adf('0x44')]){_0x238ae8[_0x4adf('0x45')]=[{'all':!![]}];}return db[_0x4adf('0x43')][_0x4adf('0x46')](_0x238ae8);})[_0x4adf('0x29')](function(_0x324844){_0x5b2420[_0x4adf('0x47')]=_0x324844;return _0x5b2420;})[_0x4adf('0x29')](respondWithFilteredResult(_0x1f6353,_0x238ae8))['catch'](handleError(_0x1f6353,null));};exports[_0x4adf('0x48')]=function(_0x3d59ab,_0x45756a){var _0x1af777={'raw':![],'where':{'id':_0x3d59ab[_0x4adf('0x49')]['id']}},_0x1293c7={};_0x1293c7[_0x4adf('0x37')]=_[_0x4adf('0x4a')](db[_0x4adf('0x43')][_0x4adf('0x31')]);_0x1293c7[_0x4adf('0x34')]=_[_0x4adf('0x4a')](_0x3d59ab[_0x4adf('0x34')]);_0x1293c7['filters']=_[_0x4adf('0x36')](_0x1293c7[_0x4adf('0x37')],_0x1293c7['query']);_0x1af777['attributes']=_[_0x4adf('0x36')](_0x1293c7[_0x4adf('0x37')],qs[_0x4adf('0x39')](_0x3d59ab[_0x4adf('0x34')][_0x4adf('0x39')]));_0x1af777[_0x4adf('0x38')]=_0x1af777[_0x4adf('0x38')][_0x4adf('0x3a')]?_0x1af777[_0x4adf('0x38')]:_0x1293c7[_0x4adf('0x37')];if(_0x3d59ab[_0x4adf('0x34')][_0x4adf('0x44')]){_0x1af777[_0x4adf('0x45')]=[{'all':!![]}];}_0x1af777=_[_0x4adf('0x40')]({},_0x1af777,_0x3d59ab[_0x4adf('0x4b')]);return db[_0x4adf('0x43')]['find'](_0x1af777)['then'](handleEntityNotFound(_0x45756a,null))[_0x4adf('0x29')](respondWithResult(_0x45756a,null))[_0x4adf('0x4c')](handleError(_0x45756a,null));};exports[_0x4adf('0x4d')]=function(_0x44c898,_0xd1cbfc){return db['AnalyticCustomReport'][_0x4adf('0x4d')](_0x44c898[_0x4adf('0x4e')],{})[_0x4adf('0x29')](function(_0x2fe1a7){var _0x47afc9=_0x44c898[_0x4adf('0x4f')][_0x4adf('0x2b')]({'plain':!![]});if(!_0x47afc9)throw new Error(_0x4adf('0x50'));if(_0x47afc9[_0x4adf('0x51')]===_0x4adf('0x4f')){var _0x11152e=_0x2fe1a7[_0x4adf('0x2b')]({'plain':!![]});var _0x156ccd='Reports';return db[_0x4adf('0x52')][_0x4adf('0x53')]({'where':{'name':_0x156ccd,'userProfileId':_0x47afc9[_0x4adf('0x54')]},'raw':!![]})[_0x4adf('0x29')](function(_0x3ed8d8){if(_0x3ed8d8&&_0x3ed8d8[_0x4adf('0x55')]===0x0){return db['UserProfileResource'][_0x4adf('0x4d')]({'name':_0x11152e[_0x4adf('0x2f')],'resourceId':_0x11152e['id'],'type':_0x4adf('0x2c'),'sectionId':_0x3ed8d8['id']},{})[_0x4adf('0x29')](function(){return _0x2fe1a7;});}else{return _0x2fe1a7;}})[_0x4adf('0x4c')](function(_0x8ea99a){logger[_0x4adf('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8ea99a);throw _0x8ea99a;});}return _0x2fe1a7;})['then'](respondWithResult(_0xd1cbfc,0xc9))[_0x4adf('0x4c')](handleError(_0xd1cbfc,null));};exports[_0x4adf('0x28')]=function(_0x4f88fd,_0x2dc67e){if(_0x4f88fd[_0x4adf('0x4e')]['id']){delete _0x4f88fd[_0x4adf('0x4e')]['id'];}return db['AnalyticCustomReport'][_0x4adf('0x53')]({'where':{'id':_0x4f88fd[_0x4adf('0x49')]['id']}})[_0x4adf('0x29')](handleEntityNotFound(_0x2dc67e,null))[_0x4adf('0x29')](saveUpdates(_0x4f88fd[_0x4adf('0x4e')],null))[_0x4adf('0x29')](respondWithResult(_0x2dc67e,null))[_0x4adf('0x4c')](handleError(_0x2dc67e,null));};exports['destroy']=function(_0xd75aa3,_0x483be5){return db[_0x4adf('0x43')][_0x4adf('0x53')]({'where':{'id':_0xd75aa3[_0x4adf('0x49')]['id']}})[_0x4adf('0x29')](handleEntityNotFound(_0x483be5,null))[_0x4adf('0x29')](removeEntity(_0x483be5,null))[_0x4adf('0x4c')](handleError(_0x483be5,null));};exports[_0x4adf('0x56')]=function(_0xee28fd,_0x2f3150){var _0x26224c=0xa;var _0x2931a9=[_0x4adf('0x57'),_0x4adf('0x58'),_0x4adf('0x59'),_0x4adf('0x5a')];var _0x5b1846={'SUM':_0x4adf('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4adf('0x5c'),'MAX':'MAX(%s)','MIN':_0x4adf('0x5d'),'AVG':_0x4adf('0x5e'),'GROUP_CONCAT':_0x4adf('0x5f'),'GROUP_CONCAT ASC':_0x4adf('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x32f5d7={'SEC_TO_TIME':_0x4adf('0x61'),'DATE':_0x4adf('0x62'),'HOUR':_0x4adf('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x545fc2=function(_0x3699bb){return!_[_0x4adf('0x64')]([_0x4adf('0x65'),'IS\x20NOT\x20NULL',_0x4adf('0x66'),_0x4adf('0x67')],_0x3699bb);};var _0x4bd318=function(_0x2b33ac){if(!_0x2b33ac||!_0x2b33ac[_0x4adf('0x68')][_0x4adf('0x3a')]){return'';}for(var _0x174eab='(',_0x24a497=0x0;_0x24a497<_0x2b33ac[_0x4adf('0x68')][_0x4adf('0x3a')];_0x24a497+=0x1){_0x24a497>0x0&&(_0x174eab+='\x20'+_0x2b33ac[_0x4adf('0x69')]+'\x20');_0x174eab+=_0x2b33ac['rules'][_0x24a497]['group']?_0x4bd318(_0x2b33ac[_0x4adf('0x68')][_0x24a497][_0x4adf('0x6a')]):_0x2b33ac[_0x4adf('0x68')][_0x24a497][_0x4adf('0x6b')]+'\x20'+_0x2b33ac['rules'][_0x24a497][_0x4adf('0x6c')]+(_0x545fc2(_0x2b33ac[_0x4adf('0x68')][_0x24a497][_0x4adf('0x6c')])?'\x20'+_0x2b33ac['rules'][_0x24a497]['value']:'');}return _0x174eab+')';};var _0x4d1903={'where':{'id':_0xee28fd[_0x4adf('0x49')]['id']}},_0x472f58,_0x3ec440,_0x4ee0af,_0x1c2892,_0x34f6e6;_0x4d1903=_[_0x4adf('0x40')]({},_0x4d1903,_0xee28fd['options']);return db[_0x4adf('0x43')]['find'](_0x4d1903)[_0x4adf('0x29')](function(_0x2805cf){if(_0x2805cf){_0x472f58=_0x2805cf;return _0x2805cf['getFields']();}return null;})[_0x4adf('0x29')](function(_0x4f561a){if(_0x4f561a){if(!_0x4f561a[_0x4adf('0x3a')]){throw new db[(_0x4adf('0x6d'))][(_0x4adf('0x6e'))](_0x4adf('0x6f'),0x193);}_0x3ec440=_0x4f561a;return db[_0x4adf('0x70')][_0x4adf('0x46')]({'raw':!![]});}return null;})['then'](function(_0x26b91e){if(_0x26b91e){_0x4ee0af=_['keyBy'](_0x26b91e,'id');var _0x261fd9;var _0x41221b=squel[_0x4adf('0x71')]();_0x41221b[_0x4adf('0x72')](_0x472f58['table']);for(var _0x5b23dd=0x0;_0x5b23dd<_0x3ec440['length'];_0x5b23dd+=0x1){_0x261fd9=_0x3ec440[_0x5b23dd][_0x4adf('0x73')]?_0x4ee0af[_0x3ec440[_0x5b23dd][_0x4adf('0x73')]][_0x4adf('0x74')]:_0x3ec440[_0x5b23dd][_0x4adf('0x6b')];_0x261fd9=_0x3ec440[_0x5b23dd][_0x4adf('0x75')]?_[_0x4adf('0x76')](_0x5b1846[_0x3ec440[_0x5b23dd]['function']],'%s',_0x261fd9):_0x261fd9;_0x261fd9=_0x3ec440[_0x5b23dd][_0x4adf('0x77')]?_[_0x4adf('0x76')](_0x32f5d7[_0x3ec440[_0x5b23dd][_0x4adf('0x77')]],'%s',_0x261fd9):_0x261fd9;if(_0x3ec440[_0x5b23dd]['groupBy']){_0x41221b[_0x4adf('0x6a')](_0x261fd9);}_0x3ec440[_0x5b23dd][_0x4adf('0x78')]&&_0x41221b[_0x4adf('0x3c')](_0x261fd9,_0x3ec440[_0x5b23dd][_0x4adf('0x78')]===_0x4adf('0x79')?![]:!![]);_0x41221b['field'](_0x261fd9,_0x3ec440[_0x5b23dd][_0x4adf('0x7a')]||_0x261fd9);}if(_0x472f58[_0x4adf('0x7b')]){_0x472f58[_0x4adf('0x7b')]=JSON[_0x4adf('0x7c')](_0x472f58[_0x4adf('0x7b')]);for(var _0x4be794=0x0;_0x4be794<_0x472f58[_0x4adf('0x7b')][_0x4adf('0x3a')];_0x4be794+=0x1){if(_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7d')]&&_['includes'](_0x2931a9,_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7d')])&&_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7e')]&&_0x472f58['joins'][_0x4be794][_0x4adf('0x7f')]&&_0x472f58['joins'][_0x4be794]['foreignKey']){_0x41221b[_0x472f58[_0x4adf('0x7b')][_0x4be794]['type']](_0x472f58[_0x4adf('0x7b')][_0x4be794]['foreignTable'],null,util[_0x4adf('0x77')](_0x4adf('0x80'),_0x472f58[_0x4adf('0x81')],_0x472f58['joins'][_0x4be794][_0x4adf('0x7e')],_0x472f58[_0x4adf('0x7b')][_0x4be794][_0x4adf('0x7f')],_0x472f58[_0x4adf('0x7b')][_0x4be794]['foreignKey']));}}}if(_0x472f58[_0x4adf('0x82')]){_0x472f58[_0x4adf('0x82')]=JSON[_0x4adf('0x7c')](_0x472f58[_0x4adf('0x82')]);_0x41221b['where'](_0x4bd318(_0x472f58['conditions'][_0x4adf('0x6a')]));}_0x34f6e6=_0x41221b['clone']();_0x41221b['limit'](_0x26224c);_0x41221b[_0x4adf('0x21')](0x0);logger[_0x4adf('0x83')](_0x4adf('0x84'),_0x41221b['toString']());return dbH['sequelize']['query'](_0x41221b[_0x4adf('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x4adf('0x86')]});}})[_0x4adf('0x29')](respondWithResult(_0x2f3150,null))[_0x4adf('0x4c')](handleError(_0x2f3150,null));};function runReport(_0x408363,_0x574f6c,_0x3a82b7){var _0xc59a20=_0x574f6c[_0x4adf('0x2f')];var _0x41b3e4=0xa;var _0x4e620b=[_0x4adf('0x57'),'left_join',_0x4adf('0x59'),_0x4adf('0x5a')];var _0x4b4b79={'SUM':_0x4adf('0x5b'),'COUNT':_0x4adf('0x87'),'COUNT DISTINCT':_0x4adf('0x5c'),'MAX':_0x4adf('0x88'),'MIN':'MIN(%s)','AVG':_0x4adf('0x5e'),'GROUP_CONCAT':_0x4adf('0x5f'),'GROUP_CONCAT ASC':_0x4adf('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x16b916={'SEC_TO_TIME':_0x4adf('0x61'),'DATE':_0x4adf('0x62'),'HOUR':_0x4adf('0x63'),'ROUND':_0x4adf('0x89'),'UNIX_TIMESTAMP':_0x4adf('0x8a')};var _0x5b6be0=function(_0x575be8){return!_['includes']([_0x4adf('0x65'),_0x4adf('0x8b'),_0x4adf('0x66'),'IS\x20NOT\x20EMPTY'],_0x575be8);};var _0x5efc93=function(_0xdc823b){if(!_0xdc823b||!_0xdc823b[_0x4adf('0x68')]['length']){return'';}for(var _0x5567de='(',_0x1759e2=0x0;_0x1759e2<_0xdc823b[_0x4adf('0x68')][_0x4adf('0x3a')];_0x1759e2+=0x1){_0x1759e2>0x0&&(_0x5567de+='\x20'+_0xdc823b[_0x4adf('0x69')]+'\x20');_0x5567de+=_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6a')]?_0x5efc93(_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6a')]):_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6b')]+'\x20'+_0xdc823b[_0x4adf('0x68')][_0x1759e2]['condition']+(_0x5b6be0(_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x6c')])?'\x20'+_0xdc823b[_0x4adf('0x68')][_0x1759e2][_0x4adf('0x8c')]:'');}return _0x5567de+')';};var _0x2c0ba3={'where':{'id':_0x408363['id']}},_0xa61d4,_0x4b51a6,_0x10a504,_0x386c16,_0x55f01c;_0x2c0ba3=_[_0x4adf('0x40')]({},_0x2c0ba3,_0x3a82b7);return db['AnalyticCustomReport'][_0x4adf('0x53')](_0x2c0ba3)[_0x4adf('0x29')](function(_0x55c2de){if(_0x55c2de){_0xa61d4=_0x55c2de;return _0x55c2de[_0x4adf('0x8d')]();}return null;})['then'](function(_0x251e5f){if(_0x251e5f){if(!_0x251e5f[_0x4adf('0x3a')]){throw new db[(_0x4adf('0x6d'))][(_0x4adf('0x6e'))](_0x4adf('0x6f'),0x193);}_0x4b51a6=_0x251e5f;return db[_0x4adf('0x70')][_0x4adf('0x46')]({'raw':!![]});}return null;})[_0x4adf('0x29')](function(_0x44aad3){if(_0x44aad3){_0x10a504=_[_0x4adf('0x8e')](_0x44aad3,'id');var _0x48206d;var _0x3a690f=squel['select']();_0x3a690f[_0x4adf('0x72')](_0xa61d4[_0x4adf('0x81')]);for(var _0x3c5811=0x0;_0x3c5811<_0x4b51a6[_0x4adf('0x3a')];_0x3c5811+=0x1){_0x48206d=_0x4b51a6[_0x3c5811][_0x4adf('0x73')]?_0x10a504[_0x4b51a6[_0x3c5811][_0x4adf('0x73')]]['metric']:_0x4b51a6[_0x3c5811]['field'];_0x48206d=_0x4b51a6[_0x3c5811][_0x4adf('0x75')]?_[_0x4adf('0x76')](_0x4b4b79[_0x4b51a6[_0x3c5811][_0x4adf('0x75')]],'%s',_0x48206d):_0x48206d;_0x48206d=_0x4b51a6[_0x3c5811][_0x4adf('0x77')]?_[_0x4adf('0x76')](_0x16b916[_0x4b51a6[_0x3c5811][_0x4adf('0x77')]],'%s',_0x48206d):_0x48206d;if(_0x4b51a6[_0x3c5811][_0x4adf('0x8f')]){_0x3a690f[_0x4adf('0x6a')](_0x48206d);}_0x4b51a6[_0x3c5811][_0x4adf('0x78')]&&_0x3a690f[_0x4adf('0x3c')](_0x48206d,_0x4b51a6[_0x3c5811][_0x4adf('0x78')]===_0x4adf('0x79')?![]:!![]);_0x3a690f[_0x4adf('0x6b')](_0x48206d,_0x4b51a6[_0x3c5811]['alias']||_0x48206d);}if(_0xa61d4[_0x4adf('0x7b')]){_0xa61d4[_0x4adf('0x7b')]=JSON[_0x4adf('0x7c')](_0xa61d4['joins']);for(var _0x41375a=0x0;_0x41375a<_0xa61d4['joins']['length'];_0x41375a+=0x1){if(_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7d')]&&_[_0x4adf('0x64')](_0x4e620b,_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7d')])&&_0xa61d4['joins'][_0x41375a][_0x4adf('0x7e')]&&_0xa61d4[_0x4adf('0x7b')][_0x41375a]['foreignTable']&&_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x90')]){_0x3a690f[_0xa61d4['joins'][_0x41375a]['type']](_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7f')],null,util[_0x4adf('0x77')](_0x4adf('0x80'),_0xa61d4[_0x4adf('0x81')],_0xa61d4['joins'][_0x41375a][_0x4adf('0x7e')],_0xa61d4[_0x4adf('0x7b')][_0x41375a][_0x4adf('0x7f')],_0xa61d4['joins'][_0x41375a]['foreignKey']));}}}if(_0xa61d4['conditions']){_0xa61d4[_0x4adf('0x82')]=JSON[_0x4adf('0x7c')](_0xa61d4['conditions']);_0x3a690f[_0x4adf('0x3e')](_0x5efc93(_0xa61d4[_0x4adf('0x82')][_0x4adf('0x6a')]));}_0x55f01c=_0x3a690f[_0x4adf('0x91')]();_0x3a690f[_0x4adf('0x1f')](_0x41b3e4);_0x3a690f[_0x4adf('0x21')](0x0);return;}})[_0x4adf('0x29')](function(){if(_0x574f6c[_0x4adf('0x92')]===_0x4adf('0x93')){return null;}var _0x43fbad=_[_0x4adf('0x40')](_0x574f6c,{'name':_0x574f6c[_0x4adf('0x94')]||_0x574f6c[_0x4adf('0x2f')]||_0xa61d4[_0x4adf('0x2f')],'basename':_0xc59a20,'savename':util[_0x4adf('0x77')](_0x4adf('0x95'),_0x574f6c[_0x4adf('0x2f')]||_0xa61d4[_0x4adf('0x2f')],require(_0x4adf('0x96'))['generate'](0x4),_0x574f6c[_0x4adf('0x92')]||_0x4adf('0x97')),'reportId':_0xa61d4['id'],'reportType':'custom'});return db[_0x4adf('0x98')][_0x4adf('0x4d')](_0x43fbad,{'raw':!![]});})[_0x4adf('0x29')](function(_0x228298){if(_0xa61d4[_0x4adf('0x81')]===_0x4adf('0x99')){_0x55f01c[_0x4adf('0x3e')](_0xa61d4[_0x4adf('0x81')]+_0x4adf('0x9a'),_0x574f6c[_0x4adf('0x9b')],_0x574f6c['endDate']);}else{_0x55f01c[_0x4adf('0x3e')](_0xa61d4[_0x4adf('0x81')]+_0x4adf('0x9c'),_0x574f6c[_0x4adf('0x9b')],_0x574f6c['endDate']);}if(_0x228298){logger[_0x4adf('0x9d')](_0x4adf('0x9e'),_0x55f01c[_0x4adf('0x85')]());require('child_process')[_0x4adf('0x9f')](path[_0x4adf('0x57')](__dirname,'../../components/export/',_0x228298[_0x4adf('0x92')]),[_0x228298['id'],_0x55f01c[_0x4adf('0x85')](),path[_0x4adf('0x57')](__dirname,'../../files/reports',_0x228298[_0x4adf('0xa0')]),_0xc59a20]);return _0x228298;}else{var _0x22dcac=squel[_0x4adf('0x71')]();_0x22dcac['from']('('+_0x55f01c[_0x4adf('0x85')]()+')',_0x4adf('0xa1'));_0x22dcac[_0x4adf('0x6b')](_0x4adf('0xa2'),_0x4adf('0x20'));_0x55f01c[_0x4adf('0x1f')](_0x574f6c[_0x4adf('0x1f')]||_0x41b3e4);_0x55f01c['offset'](_0x574f6c['offset']||0x0);return dbH[_0x4adf('0xa3')]['query'](_0x22dcac[_0x4adf('0x85')](),{'type':dbH[_0x4adf('0xa3')][_0x4adf('0xa4')][_0x4adf('0x86')]})['then'](function(_0x2d2edc){if(!_0x2d2edc['length']){_0x386c16=0x0;}else{_0x386c16=_0x2d2edc[0x0][_0x4adf('0x20')]||0x0;}return dbH[_0x4adf('0xa3')]['query'](_0x55f01c[_0x4adf('0x85')](),{'type':dbH[_0x4adf('0xa3')][_0x4adf('0xa4')][_0x4adf('0x86')]});})[_0x4adf('0x29')](function(_0x5bb9fd){return{'rows':_0x5bb9fd||[],'count':_0x386c16};});}});}exports['run']=function(_0x142b21,_0x25f7af){return runReport(_0x142b21[_0x4adf('0x49')],_0x142b21[_0x4adf('0x34')],_0x142b21[_0x4adf('0x4b')])[_0x4adf('0x29')](respondWithResult(_0x25f7af,null))[_0x4adf('0x4c')](handleError(_0x25f7af,null));};exports['runReport']=runReport;exports[_0x4adf('0x34')]=function(_0x1df2bd,_0x3f0a8f){var _0x1e8a45=0xa;var _0x453ddc=[_0x4adf('0x57'),_0x4adf('0x58'),_0x4adf('0x59'),_0x4adf('0x5a')];var _0x32d61d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4adf('0x5c'),'MAX':'MAX(%s)','MIN':_0x4adf('0x5d'),'AVG':_0x4adf('0x5e'),'GROUP_CONCAT':_0x4adf('0x5f'),'GROUP_CONCAT ASC':_0x4adf('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b21f1={'SEC_TO_TIME':_0x4adf('0x61'),'DATE':_0x4adf('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x4adf('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2dfc0d=function(_0x1988fb){return!_[_0x4adf('0x64')]([_0x4adf('0x65'),'IS\x20NOT\x20NULL',_0x4adf('0x66'),_0x4adf('0x67')],_0x1988fb);};var _0x5ee4c1=function(_0x2cdf3e){if(!_0x2cdf3e||!_0x2cdf3e['rules'][_0x4adf('0x3a')]){return'';}for(var _0x448307='(',_0x3dc371=0x0;_0x3dc371<_0x2cdf3e[_0x4adf('0x68')]['length'];_0x3dc371+=0x1){_0x3dc371>0x0&&(_0x448307+='\x20'+_0x2cdf3e[_0x4adf('0x69')]+'\x20');_0x448307+=_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6a')]?_0x5ee4c1(_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6a')]):_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6b')]+'\x20'+_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6c')]+(_0x2dfc0d(_0x2cdf3e[_0x4adf('0x68')][_0x3dc371][_0x4adf('0x6c')])?'\x20'+_0x2cdf3e['rules'][_0x3dc371]['value']:'');}return _0x448307+')';};var _0x137c16={'where':{'id':_0x1df2bd['params']['id']}},_0x38180e,_0x325716,_0x4b7d30,_0x277393,_0x5adb2b;_0x137c16=_[_0x4adf('0x40')]({},_0x137c16,_0x1df2bd['options']);return db[_0x4adf('0x43')][_0x4adf('0x53')](_0x137c16)[_0x4adf('0x29')](function(_0x683e3){if(_0x683e3){_0x38180e=_0x683e3;return _0x683e3[_0x4adf('0x8d')]();}return null;})['then'](function(_0x4f981b){if(_0x4f981b){if(!_0x4f981b['length']){throw new db[(_0x4adf('0x6d'))][(_0x4adf('0x6e'))](_0x4adf('0x6f'),0x193);}_0x325716=_0x4f981b;return db['AnalyticMetric'][_0x4adf('0x46')]({'raw':!![]});}return null;})[_0x4adf('0x29')](function(_0x3857fa){if(_0x3857fa){_0x4b7d30=_[_0x4adf('0x8e')](_0x3857fa,'id');var _0x52d7c8;var _0x3dc731=squel[_0x4adf('0x71')]();_0x3dc731[_0x4adf('0x72')](_0x38180e[_0x4adf('0x81')]);for(var _0x57f3a5=0x0;_0x57f3a5<_0x325716[_0x4adf('0x3a')];_0x57f3a5+=0x1){_0x52d7c8=_0x325716[_0x57f3a5][_0x4adf('0x73')]?_0x4b7d30[_0x325716[_0x57f3a5]['MetricId']][_0x4adf('0x74')]:_0x325716[_0x57f3a5][_0x4adf('0x6b')];_0x52d7c8=_0x325716[_0x57f3a5][_0x4adf('0x75')]?_[_0x4adf('0x76')](_0x32d61d[_0x325716[_0x57f3a5][_0x4adf('0x75')]],'%s',_0x52d7c8):_0x52d7c8;_0x52d7c8=_0x325716[_0x57f3a5][_0x4adf('0x77')]?_[_0x4adf('0x76')](_0x2b21f1[_0x325716[_0x57f3a5]['format']],'%s',_0x52d7c8):_0x52d7c8;if(_0x325716[_0x57f3a5][_0x4adf('0x8f')]){_0x3dc731['group'](_0x52d7c8);}_0x325716[_0x57f3a5][_0x4adf('0x78')]&&_0x3dc731[_0x4adf('0x3c')](_0x52d7c8,_0x325716[_0x57f3a5][_0x4adf('0x78')]===_0x4adf('0x79')?![]:!![]);_0x3dc731[_0x4adf('0x6b')](_0x52d7c8,_0x325716[_0x57f3a5]['alias']||_0x52d7c8);}if(_0x38180e[_0x4adf('0x7b')]){_0x38180e['joins']=JSON[_0x4adf('0x7c')](_0x38180e['joins']);for(var _0x1ead2f=0x0;_0x1ead2f<_0x38180e['joins'][_0x4adf('0x3a')];_0x1ead2f+=0x1){if(_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7d')]&&_['includes'](_0x453ddc,_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7d')])&&_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7e')]&&_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['foreignTable']&&_0x38180e['joins'][_0x1ead2f]['foreignKey']){_0x3dc731[_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['type']](_0x38180e[_0x4adf('0x7b')][_0x1ead2f][_0x4adf('0x7f')],null,util[_0x4adf('0x77')](_0x4adf('0x80'),_0x38180e[_0x4adf('0x81')],_0x38180e['joins'][_0x1ead2f][_0x4adf('0x7e')],_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['foreignTable'],_0x38180e[_0x4adf('0x7b')][_0x1ead2f]['foreignKey']));}}}if(_0x38180e[_0x4adf('0x82')]){_0x38180e[_0x4adf('0x82')]=JSON['parse'](_0x38180e[_0x4adf('0x82')]);_0x3dc731['where'](_0x5ee4c1(_0x38180e[_0x4adf('0x82')][_0x4adf('0x6a')]));}_0x5adb2b=_0x3dc731[_0x4adf('0x91')]();_0x3dc731[_0x4adf('0x1f')](_0x1e8a45);_0x3dc731[_0x4adf('0x21')](0x0);logger[_0x4adf('0x83')](_0x4adf('0x84'),_0x3dc731[_0x4adf('0x85')]());return dbH[_0x4adf('0xa3')]['query'](_0x3dc731[_0x4adf('0x85')](),{'type':dbH[_0x4adf('0xa3')]['QueryTypes'][_0x4adf('0x86')]});}})[_0x4adf('0x29')](function(){return{'sql':_0x5adb2b[_0x4adf('0x85')]()};})[_0x4adf('0x29')](respondWithResult(_0x3f0a8f,null))['catch'](handleError(_0x3f0a8f,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 730de48..330adf9 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 _0x4563=['path','rimraf','./analyticCustomReport.attributes','define','lodash','util','api','moment','bluebird','request-promise'];(function(_0xadd56c,_0xe92a4c){var _0x3e9d9e=function(_0x4a8efe){while(--_0x4a8efe){_0xadd56c['push'](_0xadd56c['shift']());}};_0x3e9d9e(++_0xe92a4c);}(_0x4563,0x194));var _0x3456=function(_0x5c6129,_0x51a4dc){_0x5c6129=_0x5c6129-0x0;var _0x496f35=_0x4563[_0x5c6129];return _0x496f35;};'use strict';var _=require(_0x3456('0x0'));var util=require(_0x3456('0x1'));var logger=require('../../config/logger')(_0x3456('0x2'));var moment=require(_0x3456('0x3'));var BPromise=require(_0x3456('0x4'));var rp=require(_0x3456('0x5'));var fs=require('fs');var path=require(_0x3456('0x6'));var rimraf=require(_0x3456('0x7'));var config=require('../../config/environment');var attributes=require(_0x3456('0x8'));module['exports']=function(_0x20c657,_0x467ab2){return _0x20c657[_0x3456('0x9')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedd2=['analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xedd2,0x1c3));var _0x2edd=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xedd2[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x2edd('0x0'));var util=require(_0x2edd('0x1'));var logger=require(_0x2edd('0x2'))(_0x2edd('0x3'));var moment=require('moment');var BPromise=require(_0x2edd('0x4'));var rp=require(_0x2edd('0x5'));var fs=require('fs');var path=require(_0x2edd('0x6'));var rimraf=require('rimraf');var config=require(_0x2edd('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x26ed37,_0x558b0f){return _0x26ed37[_0x2edd('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x2edd('0x9'),'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 54d5298..10b79a7 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 _0x295b=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird'];(function(_0x42c47d,_0x339ceb){var _0xc5ac8d=function(_0x5a19d4){while(--_0x5a19d4){_0x42c47d['push'](_0x42c47d['shift']());}};_0xc5ac8d(++_0x339ceb);}(_0x295b,0xa7));var _0xb295=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x295b[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xb295('0x0'));var util=require(_0xb295('0x1'));var moment=require(_0xb295('0x2'));var BPromise=require(_0xb295('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb295('0x4'));var db=require(_0xb295('0x5'))['db'];var utils=require(_0xb295('0x6'));var logger=require('../../config/logger')(_0xb295('0x7'));var config=require('../../config/environment');var jayson=require(_0xb295('0x8'));var client=jayson[_0xb295('0x9')][_0xb295('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eb083,_0x5e5204,_0x37426b){return new BPromise(function(_0xf5b224,_0x406aa1){return client[_0xb295('0xb')](_0x1eb083,_0x37426b)[_0xb295('0xc')](function(_0x538ec4){logger[_0xb295('0xd')](_0xb295('0xe'),_0x5e5204,_0xb295('0xf'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5e5204,_0xb295('0xf'),JSON['stringify'](_0x538ec4));if(_0x538ec4['error']){if(_0x538ec4['error']['code']===0x1f4){logger['error'](_0xb295('0xe'),_0x5e5204,_0x538ec4[_0xb295('0x10')][_0xb295('0x11')]);return _0x406aa1(_0x538ec4[_0xb295('0x10')][_0xb295('0x11')]);}logger[_0xb295('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e5204,_0x538ec4[_0xb295('0x10')][_0xb295('0x11')]);return _0xf5b224(_0x538ec4['error'][_0xb295('0x11')]);}else{logger['info'](_0xb295('0xe'),_0x5e5204,_0xb295('0xf'));_0xf5b224(_0x538ec4[_0xb295('0x12')]['message']);}})['catch'](function(_0x230980){logger[_0xb295('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e5204,_0x230980);_0x406aa1(_0x230980);});});}
\ No newline at end of file
+var _0x9d4e=['error','code','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x5b2167,_0x250a30){var _0x58c756=function(_0x1ddc4f){while(--_0x1ddc4f){_0x5b2167['push'](_0x5b2167['shift']());}};_0x58c756(++_0x250a30);}(_0x9d4e,0x16c));var _0xe9d4=function(_0xafcda6,_0x2817b9){_0xafcda6=_0xafcda6-0x0;var _0x2f00c5=_0x9d4e[_0xafcda6];return _0x2f00c5;};'use strict';var _=require(_0xe9d4('0x0'));var util=require('util');var moment=require(_0xe9d4('0x1'));var BPromise=require('bluebird');var rs=require(_0xe9d4('0x2'));var fs=require('fs');var Redis=require(_0xe9d4('0x3'));var db=require(_0xe9d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9d4('0x5'))(_0xe9d4('0x6'));var config=require('../../config/environment');var jayson=require(_0xe9d4('0x7'));var client=jayson['client'][_0xe9d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b235c,_0x397343,_0x51202f){return new BPromise(function(_0x42bdc4,_0x20fa6b){return client[_0xe9d4('0x9')](_0x1b235c,_0x51202f)[_0xe9d4('0xa')](function(_0x1c2493){logger[_0xe9d4('0xb')](_0xe9d4('0xc'),_0x397343,_0xe9d4('0xd'));logger[_0xe9d4('0xe')](_0xe9d4('0xf'),_0x397343,_0xe9d4('0xd'),JSON['stringify'](_0x1c2493));if(_0x1c2493['error']){if(_0x1c2493[_0xe9d4('0x10')][_0xe9d4('0x11')]===0x1f4){logger[_0xe9d4('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x397343,_0x1c2493[_0xe9d4('0x10')]['message']);return _0x20fa6b(_0x1c2493[_0xe9d4('0x10')][_0xe9d4('0x12')]);}logger[_0xe9d4('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x397343,_0x1c2493['error'][_0xe9d4('0x12')]);return _0x42bdc4(_0x1c2493[_0xe9d4('0x10')][_0xe9d4('0x12')]);}else{logger['info'](_0xe9d4('0xc'),_0x397343,_0xe9d4('0xd'));_0x42bdc4(_0x1c2493['result'][_0xe9d4('0x12')]);}})['catch'](function(_0x74fedd){logger[_0xe9d4('0x10')](_0xe9d4('0xc'),_0x397343,_0x74fedd);_0x20fa6b(_0x74fedd);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index db15dda..b4855bc 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 _0xd202=['update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','post','create','put'];(function(_0x305539,_0x12eeb3){var _0x95a048=function(_0x3b50b0){while(--_0x3b50b0){_0x305539['push'](_0x305539['shift']());}};_0x95a048(++_0x12eeb3);}(_0xd202,0xe0));var _0x2d20=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xd202[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0x2d20('0x0'));var util=require(_0x2d20('0x1'));var path=require(_0x2d20('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d20('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d20('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2d20('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x2d20('0x6')]('/',auth[_0x2d20('0x7')](),controller[_0x2d20('0x8')]);router['get'](_0x2d20('0x9'),auth['isAuthenticated'](),controller[_0x2d20('0xa')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x2d20('0xb')]);router['get']('/:id/run',auth[_0x2d20('0x7')](),controller[_0x2d20('0xc')]);router[_0x2d20('0x6')]('/:id/query',auth[_0x2d20('0x7')](),controller['query']);router[_0x2d20('0xd')]('/',auth['isAuthenticated'](),controller[_0x2d20('0xe')]);router[_0x2d20('0xf')](_0x2d20('0x9'),auth[_0x2d20('0x7')](),controller[_0x2d20('0x10')]);router[_0x2d20('0x11')](_0x2d20('0x9'),auth[_0x2d20('0x7')](),controller[_0x2d20('0x12')]);module[_0x2d20('0x13')]=router;
\ No newline at end of file
+var _0xa31d=['get','isAuthenticated','index','preview','/:id/run','run','/:id/query','query','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ad53d,_0x3067eb){var _0x57df8d=function(_0x2e1ac3){while(--_0x2e1ac3){_0x1ad53d['push'](_0x1ad53d['shift']());}};_0x57df8d(++_0x3067eb);}(_0xa31d,0xcf));var _0xda31=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xa31d[_0x57d13b];return _0x467696;};'use strict';var multer=require(_0xda31('0x0'));var util=require(_0xda31('0x1'));var path=require(_0xda31('0x2'));var timeout=require('connect-timeout');var express=require(_0xda31('0x3'));var router=express[_0xda31('0x4')]();var fs_extra=require(_0xda31('0x5'));var auth=require(_0xda31('0x6'));var interaction=require(_0xda31('0x7'));var config=require(_0xda31('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xda31('0x9')]('/',auth[_0xda31('0xa')](),controller[_0xda31('0xb')]);router[_0xda31('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xda31('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xda31('0xc')]);router[_0xda31('0x9')](_0xda31('0xd'),auth[_0xda31('0xa')](),controller[_0xda31('0xe')]);router[_0xda31('0x9')](_0xda31('0xf'),auth[_0xda31('0xa')](),controller[_0xda31('0x10')]);router[_0xda31('0x11')]('/',auth['isAuthenticated'](),controller[_0xda31('0x12')]);router['put'](_0xda31('0x13'),auth[_0xda31('0xa')](),controller[_0xda31('0x14')]);router[_0xda31('0x15')]('/:id',auth[_0xda31('0xa')](),controller[_0xda31('0x16')]);module[_0xda31('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 3fd62ad..656d356 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xafc4,0x69));var _0x4afc=function(_0xafbc31,_0x4c57f6){_0xafbc31=_0xafbc31-0x0;var _0x1eca30=_0xafc4[_0xafbc31];return _0x1eca30;};'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
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x504ad9,_0x2dec3e){var _0x4aacf9=function(_0x3fec23){while(--_0x3fec23){_0x504ad9['push'](_0x504ad9['shift']());}};_0x4aacf9(++_0x2dec3e);}(_0x7217,0x19e));var _0x7721=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7217[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 294b673..8328b6e 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x4ef397,_0x2717fb){var _0x23d5da=function(_0x22f045){while(--_0x22f045){_0x4ef397['push'](_0x4ef397['shift']());}};_0x23d5da(++_0x2717fb);}(_0x1967,0x173));var _0x7196=function(_0xafb016,_0x2f4a44){_0xafb016=_0xafb016-0x0;var _0x1a6fa6=_0x1967[_0xafb016];return _0x1a6fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x5f3dfb,_0xef3847){var _0x2e1a49=function(_0x29aec1){while(--_0x29aec1){_0x5f3dfb['push'](_0x5f3dfb['shift']());}};_0x2e1a49(++_0xef3847);}(_0x53ec,0x192));var _0xc53e=function(_0x1e76e8,_0x41ec55){_0x1e76e8=_0x1e76e8-0x0;var _0x2d7a1f=_0x53ec[_0x1e76e8];return _0x2d7a1f;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 042449a..b4caf85 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 _0xeb6a=['bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','moment'];(function(_0x14720a,_0x256276){var _0x28f027=function(_0x4e9dd9){while(--_0x4e9dd9){_0x14720a['push'](_0x14720a['shift']());}};_0x28f027(++_0x256276);}(_0xeb6a,0x1a1));var _0xaeb6=function(_0x37e52e,_0x26c1be){_0x37e52e=_0x37e52e-0x0;var _0x527954=_0xeb6a[_0x37e52e];return _0x527954;};'use strict';var _=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaeb6('0x2'));var BPromise=require(_0xaeb6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeb6('0x4'));var rimraf=require(_0xaeb6('0x5'));var config=require(_0xaeb6('0x6'));var attributes=require(_0xaeb6('0x7'));module[_0xaeb6('0x8')]=function(_0x27d267,_0xcabb5f){return _0x27d267[_0xaeb6('0x9')](_0xaeb6('0xa'),attributes,{'tableName':_0xaeb6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3719=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','api','moment','bluebird','request-promise'];(function(_0x1240be,_0x4a000d){var _0x3b59d0=function(_0x3aa5b8){while(--_0x3aa5b8){_0x1240be['push'](_0x1240be['shift']());}};_0x3b59d0(++_0x4a000d);}(_0x3719,0xeb));var _0x9371=function(_0x4cda78,_0x35e3fd){_0x4cda78=_0x4cda78-0x0;var _0x17e662=_0x3719[_0x4cda78];return _0x17e662;};'use strict';var _=require(_0x9371('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9371('0x1'));var moment=require(_0x9371('0x2'));var BPromise=require(_0x9371('0x3'));var rp=require(_0x9371('0x4'));var fs=require('fs');var path=require(_0x9371('0x5'));var rimraf=require(_0x9371('0x6'));var config=require(_0x9371('0x7'));var attributes=require(_0x9371('0x8'));module[_0x9371('0x9')]=function(_0x590ddb,_0x35e3fb){return _0x590ddb[_0x9371('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x9371('0xb'),'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 b00d7c1..50a0728 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 _0xb232=['rpc','../../config/environment','jayson/promise','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0xb232,0x1c3));var _0x2b23=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0xb232[_0x3005d5];return _0x547c7e;};'use strict';var _=require(_0x2b23('0x0'));var util=require(_0x2b23('0x1'));var moment=require(_0x2b23('0x2'));var BPromise=require(_0x2b23('0x3'));var rs=require(_0x2b23('0x4'));var fs=require('fs');var Redis=require(_0x2b23('0x5'));var db=require(_0x2b23('0x6'))['db'];var utils=require(_0x2b23('0x7'));var logger=require(_0x2b23('0x8'))(_0x2b23('0x9'));var config=require(_0x2b23('0xa'));var jayson=require(_0x2b23('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11bc51,_0x3f2fc7,_0x302ea1){return new BPromise(function(_0x56c2cd,_0x21a4bd){return client[_0x2b23('0xc')](_0x11bc51,_0x302ea1)['then'](function(_0x20f66b){logger['info'](_0x2b23('0xd'),_0x3f2fc7,_0x2b23('0xe'));logger[_0x2b23('0xf')](_0x2b23('0x10'),_0x3f2fc7,_0x2b23('0xe'),JSON[_0x2b23('0x11')](_0x20f66b));if(_0x20f66b['error']){if(_0x20f66b[_0x2b23('0x12')][_0x2b23('0x13')]===0x1f4){logger[_0x2b23('0x12')](_0x2b23('0xd'),_0x3f2fc7,_0x20f66b[_0x2b23('0x12')]['message']);return _0x21a4bd(_0x20f66b[_0x2b23('0x12')][_0x2b23('0x14')]);}logger[_0x2b23('0x12')](_0x2b23('0xd'),_0x3f2fc7,_0x20f66b[_0x2b23('0x12')][_0x2b23('0x14')]);return _0x56c2cd(_0x20f66b[_0x2b23('0x12')][_0x2b23('0x14')]);}else{logger['info'](_0x2b23('0xd'),_0x3f2fc7,_0x2b23('0xe'));_0x56c2cd(_0x20f66b[_0x2b23('0x15')][_0x2b23('0x14')]);}})[_0x2b23('0x16')](function(_0x21ec85){logger[_0x2b23('0x12')](_0x2b23('0xd'),_0x3f2fc7,_0x21ec85);_0x21a4bd(_0x21ec85);});});}
\ No newline at end of file
+var _0x8a76=['../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26ba1b,_0x275f28){var _0xb0d3f1=function(_0x57ef8f){while(--_0x57ef8f){_0x26ba1b['push'](_0x26ba1b['shift']());}};_0xb0d3f1(++_0x275f28);}(_0x8a76,0x92));var _0x68a7=function(_0x13fab8,_0x40c642){_0x13fab8=_0x13fab8-0x0;var _0x112129=_0x8a76[_0x13fab8];return _0x112129;};'use strict';var _=require(_0x68a7('0x0'));var util=require('util');var moment=require(_0x68a7('0x1'));var BPromise=require(_0x68a7('0x2'));var rs=require(_0x68a7('0x3'));var fs=require('fs');var Redis=require(_0x68a7('0x4'));var db=require(_0x68a7('0x5'))['db'];var utils=require(_0x68a7('0x6'));var logger=require(_0x68a7('0x7'))('rpc');var config=require(_0x68a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x68a7('0x9')][_0x68a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fb442,_0x17c3ed,_0x1aaeac){return new BPromise(function(_0x5d431e,_0xc93778){return client[_0x68a7('0xb')](_0x1fb442,_0x1aaeac)[_0x68a7('0xc')](function(_0x33094c){logger[_0x68a7('0xd')](_0x68a7('0xe'),_0x17c3ed,'request\x20sent');logger[_0x68a7('0xf')](_0x68a7('0x10'),_0x17c3ed,_0x68a7('0x11'),JSON[_0x68a7('0x12')](_0x33094c));if(_0x33094c['error']){if(_0x33094c['error']['code']===0x1f4){logger[_0x68a7('0x13')](_0x68a7('0xe'),_0x17c3ed,_0x33094c[_0x68a7('0x13')]['message']);return _0xc93778(_0x33094c['error'][_0x68a7('0x14')]);}logger[_0x68a7('0x13')](_0x68a7('0xe'),_0x17c3ed,_0x33094c[_0x68a7('0x13')]['message']);return _0x5d431e(_0x33094c['error'][_0x68a7('0x14')]);}else{logger[_0x68a7('0xd')](_0x68a7('0xe'),_0x17c3ed,_0x68a7('0x11'));_0x5d431e(_0x33094c['result']['message']);}})[_0x68a7('0x15')](function(_0x206795){logger[_0x68a7('0x13')](_0x68a7('0xe'),_0x17c3ed,_0x206795);_0xc93778(_0x206795);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index be51d38..2753ba3 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 _0xb145=['/:id','show','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x2f3263,_0x271612){var _0x59f249=function(_0x225d49){while(--_0x225d49){_0x2f3263['push'](_0x2f3263['shift']());}};_0x59f249(++_0x271612);}(_0xb145,0xa3));var _0x5b14=function(_0x26ab8e,_0x225df0){_0x26ab8e=_0x26ab8e-0x0;var _0x3eac4e=_0xb145[_0x26ab8e];return _0x3eac4e;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x9')]('/:id/run',auth[_0x5b14('0xa')](),controller[_0x5b14('0x10')]);router[_0x5b14('0x9')](_0x5b14('0x11'),auth[_0x5b14('0xa')](),controller['query']);router[_0x5b14('0x12')]('/',auth['isAuthenticated'](),controller[_0x5b14('0x13')]);router[_0x5b14('0x14')](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x15')]);router[_0x5b14('0x16')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x17')]);module[_0x5b14('0x18')]=router;
\ No newline at end of file
+var _0x2d95=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0xa4c503,_0x5ae5c2){var _0x32716d=function(_0x5e1103){while(--_0x5e1103){_0xa4c503['push'](_0xa4c503['shift']());}};_0x32716d(++_0x5ae5c2);}(_0x2d95,0xca));var _0x52d9=function(_0x353a32,_0x5779d4){_0x353a32=_0x353a32-0x0;var _0x1c6aab=_0x2d95[_0x353a32];return _0x1c6aab;};'use strict';var multer=require(_0x52d9('0x0'));var util=require('util');var path=require(_0x52d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x52d9('0x2'));var router=express[_0x52d9('0x3')]();var fs_extra=require(_0x52d9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x52d9('0x5'));var config=require(_0x52d9('0x6'));var controller=require(_0x52d9('0x7'));router[_0x52d9('0x8')]('/',auth[_0x52d9('0x9')](),controller[_0x52d9('0xa')]);router[_0x52d9('0x8')](_0x52d9('0xb'),auth[_0x52d9('0x9')](),controller[_0x52d9('0xc')]);router[_0x52d9('0x8')](_0x52d9('0xd'),auth[_0x52d9('0x9')](),controller[_0x52d9('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x52d9('0xf')]);router[_0x52d9('0x8')](_0x52d9('0x10'),auth[_0x52d9('0x9')](),controller[_0x52d9('0x11')]);router['post']('/',auth[_0x52d9('0x9')](),controller[_0x52d9('0x12')]);router[_0x52d9('0x13')](_0x52d9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x52d9('0x14')](_0x52d9('0xb'),auth[_0x52d9('0x9')](),controller[_0x52d9('0x15')]);module[_0x52d9('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index d1a8546..4b99899 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 _0xe92f=['Loading','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','xlsx'];(function(_0x74f2e1,_0x139340){var _0x2b832a=function(_0x52af91){while(--_0x52af91){_0x74f2e1['push'](_0x74f2e1['shift']());}};_0x2b832a(++_0x139340);}(_0xe92f,0x126));var _0xfe92=function(_0x3624a7,_0x53946c){_0x3624a7=_0x3624a7-0x0;var _0x11a6e4=_0xe92f[_0x3624a7];return _0x11a6e4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe92('0x0'));module[_0xfe92('0x1')]={'name':{'type':Sequelize[_0xfe92('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xfe92('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfe92('0x3')](_0xfe92('0x4'),'pdf',_0xfe92('0x5')),'allowNull':![],'defaultValue':_0xfe92('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xfe92('0x6')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0xfe92('0x7')},'reportId':{'type':Sequelize[_0xfe92('0x8')](0xb)[_0xfe92('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xadaf=['scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x2cdebc,_0x437797){var _0x306326=function(_0x4529d5){while(--_0x4529d5){_0x2cdebc['push'](_0x2cdebc['shift']());}};_0x306326(++_0x437797);}(_0xadaf,0x179));var _0xfada=function(_0x4b328a,_0x3be393){_0x4b328a=_0x4b328a-0x0;var _0x4ce14d=_0xadaf[_0x4b328a];return _0x4ce14d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xfada('0x0')]={'name':{'type':Sequelize[_0xfada('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xfada('0x2')](_0xfada('0x3'),_0xfada('0x4'),_0xfada('0x5')),'allowNull':![],'defaultValue':_0xfada('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xfada('0x6')]},'status':{'type':Sequelize[_0xfada('0x1')],'defaultValue':_0xfada('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0xfada('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xfada('0x9')](0xb)[_0xfada('0xa')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index afcd937..12c94c0 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 _0x4cc1=['options','includeAll','include','rows','catch','length','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','download','basename','savename','output','root','server/files/reports','Sequelize','ValidationError','exists','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge'];(function(_0x1d7e5a,_0x1a9680){var _0x29a3be=function(_0x4618c1){while(--_0x4618c1){_0x1d7e5a['push'](_0x1d7e5a['shift']());}};_0x29a3be(++_0x1a9680);}(_0x4cc1,0x196));var _0x14cc=function(_0x54813d,_0x101c1f){_0x54813d=_0x54813d-0x0;var _0x561eea=_0x4cc1[_0x54813d];return _0x561eea;};'use strict';var emlformat=require(_0x14cc('0x0'));var rimraf=require(_0x14cc('0x1'));var zipdir=require(_0x14cc('0x2'));var jsonpatch=require(_0x14cc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14cc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x14cc('0x5'));var sox=require(_0x14cc('0x6'));var csv=require(_0x14cc('0x7'));var ejs=require(_0x14cc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14cc('0x9'));var squel=require(_0x14cc('0xa'));var crypto=require(_0x14cc('0xb'));var jsforce=require(_0x14cc('0xc'));var deskjs=require(_0x14cc('0xd'));var toCsv=require(_0x14cc('0x7'));var querystring=require('querystring');var Papa=require(_0x14cc('0xe'));var Redis=require(_0x14cc('0xf'));var authService=require(_0x14cc('0x10'));var qs=require(_0x14cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14cc('0x12'));var logger=require(_0x14cc('0x13'))(_0x14cc('0x14'));var utils=require(_0x14cc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x14cc('0x16'));var db=require(_0x14cc('0x17'))['db'];function respondWithStatusCode(_0x5ac9c3,_0x16cd3c){_0x16cd3c=_0x16cd3c||0xcc;return function(_0xd84bed){if(_0xd84bed){return _0x5ac9c3[_0x14cc('0x18')](_0x16cd3c);}return _0x5ac9c3[_0x14cc('0x19')](_0x16cd3c)['end']();};}function respondWithResult(_0x156832,_0x768534){_0x768534=_0x768534||0xc8;return function(_0x26028b){if(_0x26028b){return _0x156832[_0x14cc('0x19')](_0x768534)[_0x14cc('0x1a')](_0x26028b);}};}function respondWithFilteredResult(_0x33aa5e,_0x4fac10){return function(_0x392976){if(_0x392976){var _0x3ca904=typeof _0x4fac10[_0x14cc('0x1b')]==='undefined'&&typeof _0x4fac10[_0x14cc('0x1c')]==='undefined';var _0x2a389c=_0x392976['count'];var _0x16636c=_0x3ca904?0x0:_0x4fac10[_0x14cc('0x1b')];var _0x5c4ea0=_0x3ca904?_0x392976[_0x14cc('0x1d')]:_0x4fac10[_0x14cc('0x1b')]+_0x4fac10['limit'];var _0x51ed82;if(_0x5c4ea0>=_0x2a389c){_0x5c4ea0=_0x2a389c;_0x51ed82=0xc8;}else{_0x51ed82=0xce;}_0x33aa5e[_0x14cc('0x19')](_0x51ed82);return _0x33aa5e[_0x14cc('0x1e')](_0x14cc('0x1f'),_0x16636c+'-'+_0x5c4ea0+'/'+_0x2a389c)[_0x14cc('0x1a')](_0x392976);}return null;};}function patchUpdates(_0x367b77){return function(_0x3b53bd){try{jsonpatch[_0x14cc('0x20')](_0x3b53bd,_0x367b77,!![]);}catch(_0x4db871){return BPromise['reject'](_0x4db871);}return _0x3b53bd[_0x14cc('0x21')]();};}function saveUpdates(_0x10f95f,_0x31151f){return function(_0x583af9){if(_0x583af9){return _0x583af9['update'](_0x10f95f)[_0x14cc('0x22')](function(_0x1e4243){return _0x1e4243;});}return null;};}function removeEntity(_0x4d17e1,_0x3df23c){return function(_0x5db9da){if(_0x5db9da){return _0x5db9da[_0x14cc('0x23')]()['then'](function(){var _0xae60db=_0x5db9da[_0x14cc('0x24')]({'plain':!![]});var _0x40e2a1=_0x14cc('0x25');return db[_0x14cc('0x26')][_0x14cc('0x23')]({'where':{'type':_0x40e2a1,'resourceId':_0xae60db['id']}})[_0x14cc('0x22')](function(){return _0x5db9da;});})[_0x14cc('0x22')](function(){_0x4d17e1['status'](0xcc)[_0x14cc('0x27')]();});}};}function handleEntityNotFound(_0x2b1d41,_0x5ecf13){return function(_0x2ae3ce){if(!_0x2ae3ce){_0x2b1d41['sendStatus'](0x194);}return _0x2ae3ce;};}function handleError(_0x4c74d3,_0x4ea0e3){_0x4ea0e3=_0x4ea0e3||0x1f4;return function(_0x2add39){logger[_0x14cc('0x28')](_0x2add39[_0x14cc('0x29')]);if(_0x2add39[_0x14cc('0x2a')]){delete _0x2add39[_0x14cc('0x2a')];}_0x4c74d3['status'](_0x4ea0e3)[_0x14cc('0x2b')](_0x2add39);};}exports[_0x14cc('0x2c')]=function(_0x46d0ac,_0x1bbabb){var _0x4d308e={},_0x4c6b69={},_0x486316={'count':0x0,'rows':[]};var _0x101d95=_[_0x14cc('0x2d')](db[_0x14cc('0x2e')][_0x14cc('0x2f')],function(_0x138567){return{'name':_0x138567['fieldName'],'type':_0x138567[_0x14cc('0x30')][_0x14cc('0x31')]};});_0x4c6b69[_0x14cc('0x32')]=_['map'](_0x101d95,'name');_0x4c6b69[_0x14cc('0x33')]=_[_0x14cc('0x34')](_0x46d0ac['query']);_0x4c6b69[_0x14cc('0x35')]=_[_0x14cc('0x36')](_0x4c6b69['model'],_0x4c6b69[_0x14cc('0x33')]);_0x4d308e[_0x14cc('0x37')]=_[_0x14cc('0x36')](_0x4c6b69[_0x14cc('0x32')],qs['fields'](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x38')]));_0x4d308e[_0x14cc('0x37')]=_0x4d308e[_0x14cc('0x37')]['length']?_0x4d308e[_0x14cc('0x37')]:_0x4c6b69[_0x14cc('0x32')];if(!_0x46d0ac[_0x14cc('0x33')]['hasOwnProperty'](_0x14cc('0x39'))){_0x4d308e[_0x14cc('0x1c')]=qs[_0x14cc('0x1c')](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x1c')]);_0x4d308e[_0x14cc('0x1b')]=qs[_0x14cc('0x1b')](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x1b')]);}_0x4d308e[_0x14cc('0x3a')]=qs['sort'](_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x3b')]);_0x4d308e[_0x14cc('0x3c')]=qs['filters'](_[_0x14cc('0x3d')](_0x46d0ac['query'],_0x4c6b69[_0x14cc('0x35')]),_0x101d95);if(_0x46d0ac['query'][_0x14cc('0x3e')]){_0x4d308e['where']=_['merge'](_0x4d308e['where'],{'$or':_[_0x14cc('0x2d')](_0x101d95,function(_0x50f2db){if(_0x50f2db[_0x14cc('0x30')]!=='VIRTUAL'){var _0x44eee2={};_0x44eee2[_0x50f2db['name']]={'$like':'%'+_0x46d0ac[_0x14cc('0x33')][_0x14cc('0x3e')]+'%'};return _0x44eee2;}})});}_0x4d308e=_[_0x14cc('0x3f')]({},_0x4d308e,_0x46d0ac[_0x14cc('0x40')]);var _0x438a6e={'where':_0x4d308e[_0x14cc('0x3c')]};return db[_0x14cc('0x2e')][_0x14cc('0x1d')](_0x438a6e)[_0x14cc('0x22')](function(_0x51995e){_0x486316[_0x14cc('0x1d')]=_0x51995e;if(_0x46d0ac['query'][_0x14cc('0x41')]){_0x4d308e[_0x14cc('0x42')]=[{'all':!![]}];}return db[_0x14cc('0x2e')]['findAll'](_0x4d308e);})[_0x14cc('0x22')](function(_0x5ca270){_0x486316[_0x14cc('0x43')]=_0x5ca270;return _0x486316;})[_0x14cc('0x22')](respondWithFilteredResult(_0x1bbabb,_0x4d308e))[_0x14cc('0x44')](handleError(_0x1bbabb,null));};exports['show']=function(_0x94eb87,_0x486ddb){var _0x443b28={'raw':!![],'where':{'id':_0x94eb87['params']['id']}},_0x5f1e7c={};_0x5f1e7c[_0x14cc('0x32')]=_[_0x14cc('0x34')](db[_0x14cc('0x2e')][_0x14cc('0x2f')]);_0x5f1e7c[_0x14cc('0x33')]=_[_0x14cc('0x34')](_0x94eb87[_0x14cc('0x33')]);_0x5f1e7c[_0x14cc('0x35')]=_['intersection'](_0x5f1e7c[_0x14cc('0x32')],_0x5f1e7c[_0x14cc('0x33')]);_0x443b28[_0x14cc('0x37')]=_[_0x14cc('0x36')](_0x5f1e7c[_0x14cc('0x32')],qs[_0x14cc('0x38')](_0x94eb87[_0x14cc('0x33')]['fields']));_0x443b28[_0x14cc('0x37')]=_0x443b28[_0x14cc('0x37')][_0x14cc('0x45')]?_0x443b28[_0x14cc('0x37')]:_0x5f1e7c[_0x14cc('0x32')];if(_0x94eb87[_0x14cc('0x33')][_0x14cc('0x41')]){_0x443b28[_0x14cc('0x42')]=[{'all':!![]}];}_0x443b28=_['merge']({},_0x443b28,_0x94eb87['options']);return db[_0x14cc('0x2e')]['find'](_0x443b28)[_0x14cc('0x22')](handleEntityNotFound(_0x486ddb,null))['then'](respondWithResult(_0x486ddb,null))[_0x14cc('0x44')](handleError(_0x486ddb,null));};exports['create']=function(_0x34fa5b,_0x4f3550){return db['AnalyticExtractedReport'][_0x14cc('0x46')](_0x34fa5b[_0x14cc('0x47')],{})[_0x14cc('0x22')](function(_0x333f8c){var _0x2a2bdb=_0x34fa5b[_0x14cc('0x48')][_0x14cc('0x24')]({'plain':!![]});if(!_0x2a2bdb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a2bdb[_0x14cc('0x49')]===_0x14cc('0x48')){var _0x3d8e6a=_0x333f8c[_0x14cc('0x24')]({'plain':!![]});var _0x3d966c=_0x14cc('0x25');return db[_0x14cc('0x4a')]['find']({'where':{'name':_0x3d966c,'userProfileId':_0x2a2bdb[_0x14cc('0x4b')]},'raw':!![]})[_0x14cc('0x22')](function(_0x5ad8ba){if(_0x5ad8ba&&_0x5ad8ba[_0x14cc('0x4c')]===0x0){return db[_0x14cc('0x26')][_0x14cc('0x46')]({'name':_0x3d8e6a[_0x14cc('0x2a')],'resourceId':_0x3d8e6a['id'],'type':_0x5ad8ba[_0x14cc('0x2a')],'sectionId':_0x5ad8ba['id']},{})[_0x14cc('0x22')](function(){return _0x333f8c;});}else{return _0x333f8c;}})['catch'](function(_0x4e9892){logger['error'](_0x14cc('0x4d'),_0x4e9892);throw _0x4e9892;});}return _0x333f8c;})[_0x14cc('0x22')](respondWithResult(_0x4f3550,0xc9))[_0x14cc('0x44')](handleError(_0x4f3550,null));};exports[_0x14cc('0x4e')]=function(_0x3c76c4,_0x54f1c0){if(_0x3c76c4[_0x14cc('0x47')]['id']){delete _0x3c76c4['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3c76c4['params']['id']}})[_0x14cc('0x22')](handleEntityNotFound(_0x54f1c0,null))[_0x14cc('0x22')](saveUpdates(_0x3c76c4[_0x14cc('0x47')],null))['then'](respondWithResult(_0x54f1c0,null))[_0x14cc('0x44')](handleError(_0x54f1c0,null));};exports['destroy']=function(_0x3ca781,_0x3cad5c){return db[_0x14cc('0x2e')][_0x14cc('0x4f')]({'where':{'id':_0x3ca781[_0x14cc('0x50')]['id']}})[_0x14cc('0x22')](handleEntityNotFound(_0x3cad5c,null))[_0x14cc('0x22')](removeEntity(_0x3cad5c,null))['catch'](handleError(_0x3cad5c,null));};exports[_0x14cc('0x51')]=function(_0x15b2ee,_0x4b12a1,_0x54df43){return db[_0x14cc('0x2e')][_0x14cc('0x4f')]({'where':{'id':_0x15b2ee[_0x14cc('0x50')]['id']},'attributes':[_0x14cc('0x2a'),_0x14cc('0x52'),_0x14cc('0x53'),_0x14cc('0x54')],'raw':!![]})[_0x14cc('0x22')](handleEntityNotFound(_0x4b12a1,null))['then'](function(_0x2cc4eb){if(_0x2cc4eb){if(!fs['existsSync'](path['join'](config[_0x14cc('0x55')],_0x14cc('0x56'),_0x2cc4eb[_0x14cc('0x53')]))){throw new db[(_0x14cc('0x57'))][(_0x14cc('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x15b2ee[_0x14cc('0x33')][_0x14cc('0x59')]){return _0x4b12a1[_0x14cc('0x18')](0xc8);}return _0x4b12a1[_0x14cc('0x51')](path[_0x14cc('0x5a')](config[_0x14cc('0x55')],_0x14cc('0x56'),_0x2cc4eb[_0x14cc('0x53')]),util[_0x14cc('0x5b')](_0x14cc('0x5c'),_0x2cc4eb[_0x14cc('0x52')]||_0x2cc4eb[_0x14cc('0x2a')],_0x2cc4eb[_0x14cc('0x54')][_0x14cc('0x5d')]()));}})[_0x14cc('0x44')](handleError(_0x4b12a1,null));};
\ No newline at end of file
+var _0xb266=['savename','output','existsSync','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','include','rows','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename'];(function(_0x82a071,_0x252266){var _0x15dda9=function(_0x3f73b0){while(--_0x3f73b0){_0x82a071['push'](_0x82a071['shift']());}};_0x15dda9(++_0x252266);}(_0xb266,0x139));var _0x6b26=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb266[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x6b26('0x0'));var rimraf=require(_0x6b26('0x1'));var zipdir=require(_0x6b26('0x2'));var jsonpatch=require(_0x6b26('0x3'));var rp=require(_0x6b26('0x4'));var moment=require(_0x6b26('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b26('0x6'));var util=require('util');var path=require(_0x6b26('0x7'));var sox=require(_0x6b26('0x8'));var csv=require(_0x6b26('0x9'));var ejs=require(_0x6b26('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b26('0xb'));var squel=require(_0x6b26('0xc'));var crypto=require(_0x6b26('0xd'));var jsforce=require(_0x6b26('0xe'));var deskjs=require(_0x6b26('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6b26('0x10'));var Papa=require(_0x6b26('0x11'));var Redis=require(_0x6b26('0x12'));var authService=require(_0x6b26('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6b26('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b26('0x15'))(_0x6b26('0x16'));var utils=require(_0x6b26('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6b26('0x18'))['db'];function respondWithStatusCode(_0x12e585,_0x2c9e72){_0x2c9e72=_0x2c9e72||0xcc;return function(_0x1ccf5e){if(_0x1ccf5e){return _0x12e585['sendStatus'](_0x2c9e72);}return _0x12e585[_0x6b26('0x19')](_0x2c9e72)[_0x6b26('0x1a')]();};}function respondWithResult(_0x328e32,_0x112b1b){_0x112b1b=_0x112b1b||0xc8;return function(_0x33b728){if(_0x33b728){return _0x328e32[_0x6b26('0x19')](_0x112b1b)['json'](_0x33b728);}};}function respondWithFilteredResult(_0x52bd45,_0x4bb838){return function(_0x4c7bb0){if(_0x4c7bb0){var _0x4a8c63=typeof _0x4bb838[_0x6b26('0x1b')]===_0x6b26('0x1c')&&typeof _0x4bb838[_0x6b26('0x1d')]===_0x6b26('0x1c');var _0x733615=_0x4c7bb0[_0x6b26('0x1e')];var _0x255b59=_0x4a8c63?0x0:_0x4bb838['offset'];var _0x56dd5d=_0x4a8c63?_0x4c7bb0[_0x6b26('0x1e')]:_0x4bb838['offset']+_0x4bb838[_0x6b26('0x1d')];var _0x4b4748;if(_0x56dd5d>=_0x733615){_0x56dd5d=_0x733615;_0x4b4748=0xc8;}else{_0x4b4748=0xce;}_0x52bd45[_0x6b26('0x19')](_0x4b4748);return _0x52bd45['set']('Content-Range',_0x255b59+'-'+_0x56dd5d+'/'+_0x733615)[_0x6b26('0x1f')](_0x4c7bb0);}return null;};}function patchUpdates(_0x3c4384){return function(_0x488f82){try{jsonpatch[_0x6b26('0x20')](_0x488f82,_0x3c4384,!![]);}catch(_0x24b94d){return BPromise['reject'](_0x24b94d);}return _0x488f82[_0x6b26('0x21')]();};}function saveUpdates(_0x39f0f3,_0x5caa6d){return function(_0x59266c){if(_0x59266c){return _0x59266c[_0x6b26('0x22')](_0x39f0f3)[_0x6b26('0x23')](function(_0x543504){return _0x543504;});}return null;};}function removeEntity(_0x164a9d,_0x194ac0){return function(_0x494c10){if(_0x494c10){return _0x494c10[_0x6b26('0x24')]()['then'](function(){var _0xc408ac=_0x494c10[_0x6b26('0x25')]({'plain':!![]});var _0x21c3c0=_0x6b26('0x26');return db[_0x6b26('0x27')][_0x6b26('0x24')]({'where':{'type':_0x21c3c0,'resourceId':_0xc408ac['id']}})[_0x6b26('0x23')](function(){return _0x494c10;});})[_0x6b26('0x23')](function(){_0x164a9d[_0x6b26('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221677,_0x260238){return function(_0x3af961){if(!_0x3af961){_0x221677[_0x6b26('0x28')](0x194);}return _0x3af961;};}function handleError(_0x322808,_0x16aea6){_0x16aea6=_0x16aea6||0x1f4;return function(_0x1ab6d9){logger['error'](_0x1ab6d9[_0x6b26('0x29')]);if(_0x1ab6d9[_0x6b26('0x2a')]){delete _0x1ab6d9[_0x6b26('0x2a')];}_0x322808[_0x6b26('0x19')](_0x16aea6)[_0x6b26('0x2b')](_0x1ab6d9);};}exports[_0x6b26('0x2c')]=function(_0x11a3d0,_0x4f792a){var _0x50cdbf={},_0x39fa46={},_0x10295e={'count':0x0,'rows':[]};var _0xf02513=_[_0x6b26('0x2d')](db[_0x6b26('0x2e')][_0x6b26('0x2f')],function(_0x85cc87){return{'name':_0x85cc87[_0x6b26('0x30')],'type':_0x85cc87['type'][_0x6b26('0x31')]};});_0x39fa46['model']=_['map'](_0xf02513,'name');_0x39fa46[_0x6b26('0x32')]=_['keys'](_0x11a3d0[_0x6b26('0x32')]);_0x39fa46[_0x6b26('0x33')]=_['intersection'](_0x39fa46[_0x6b26('0x34')],_0x39fa46[_0x6b26('0x32')]);_0x50cdbf[_0x6b26('0x35')]=_[_0x6b26('0x36')](_0x39fa46[_0x6b26('0x34')],qs[_0x6b26('0x37')](_0x11a3d0[_0x6b26('0x32')][_0x6b26('0x37')]));_0x50cdbf[_0x6b26('0x35')]=_0x50cdbf[_0x6b26('0x35')][_0x6b26('0x38')]?_0x50cdbf[_0x6b26('0x35')]:_0x39fa46['model'];if(!_0x11a3d0['query'][_0x6b26('0x39')](_0x6b26('0x3a'))){_0x50cdbf['limit']=qs['limit'](_0x11a3d0[_0x6b26('0x32')][_0x6b26('0x1d')]);_0x50cdbf[_0x6b26('0x1b')]=qs[_0x6b26('0x1b')](_0x11a3d0['query']['offset']);}_0x50cdbf[_0x6b26('0x3b')]=qs[_0x6b26('0x3c')](_0x11a3d0['query']['sort']);_0x50cdbf[_0x6b26('0x3d')]=qs[_0x6b26('0x33')](_[_0x6b26('0x3e')](_0x11a3d0[_0x6b26('0x32')],_0x39fa46[_0x6b26('0x33')]),_0xf02513);if(_0x11a3d0['query']['filter']){_0x50cdbf[_0x6b26('0x3d')]=_[_0x6b26('0x3f')](_0x50cdbf[_0x6b26('0x3d')],{'$or':_[_0x6b26('0x2d')](_0xf02513,function(_0xbac530){if(_0xbac530[_0x6b26('0x40')]!=='VIRTUAL'){var _0x237506={};_0x237506[_0xbac530['name']]={'$like':'%'+_0x11a3d0[_0x6b26('0x32')][_0x6b26('0x41')]+'%'};return _0x237506;}})});}_0x50cdbf=_['merge']({},_0x50cdbf,_0x11a3d0['options']);var _0x33ce38={'where':_0x50cdbf[_0x6b26('0x3d')]};return db[_0x6b26('0x2e')][_0x6b26('0x1e')](_0x33ce38)[_0x6b26('0x23')](function(_0xca35b3){_0x10295e[_0x6b26('0x1e')]=_0xca35b3;if(_0x11a3d0['query']['includeAll']){_0x50cdbf[_0x6b26('0x42')]=[{'all':!![]}];}return db[_0x6b26('0x2e')]['findAll'](_0x50cdbf);})[_0x6b26('0x23')](function(_0x258f62){_0x10295e[_0x6b26('0x43')]=_0x258f62;return _0x10295e;})[_0x6b26('0x23')](respondWithFilteredResult(_0x4f792a,_0x50cdbf))['catch'](handleError(_0x4f792a,null));};exports[_0x6b26('0x44')]=function(_0x183685,_0x585d3e){var _0x103f34={'raw':!![],'where':{'id':_0x183685[_0x6b26('0x45')]['id']}},_0x4fec27={};_0x4fec27['model']=_[_0x6b26('0x46')](db[_0x6b26('0x2e')][_0x6b26('0x2f')]);_0x4fec27[_0x6b26('0x32')]=_[_0x6b26('0x46')](_0x183685[_0x6b26('0x32')]);_0x4fec27[_0x6b26('0x33')]=_[_0x6b26('0x36')](_0x4fec27[_0x6b26('0x34')],_0x4fec27[_0x6b26('0x32')]);_0x103f34[_0x6b26('0x35')]=_[_0x6b26('0x36')](_0x4fec27[_0x6b26('0x34')],qs[_0x6b26('0x37')](_0x183685[_0x6b26('0x32')]['fields']));_0x103f34[_0x6b26('0x35')]=_0x103f34[_0x6b26('0x35')]['length']?_0x103f34[_0x6b26('0x35')]:_0x4fec27[_0x6b26('0x34')];if(_0x183685[_0x6b26('0x32')][_0x6b26('0x47')]){_0x103f34['include']=[{'all':!![]}];}_0x103f34=_[_0x6b26('0x3f')]({},_0x103f34,_0x183685[_0x6b26('0x48')]);return db['AnalyticExtractedReport'][_0x6b26('0x49')](_0x103f34)[_0x6b26('0x23')](handleEntityNotFound(_0x585d3e,null))[_0x6b26('0x23')](respondWithResult(_0x585d3e,null))['catch'](handleError(_0x585d3e,null));};exports[_0x6b26('0x4a')]=function(_0x4db989,_0x2379d0){return db[_0x6b26('0x2e')][_0x6b26('0x4a')](_0x4db989[_0x6b26('0x4b')],{})['then'](function(_0x445c25){var _0x321308=_0x4db989[_0x6b26('0x4c')]['get']({'plain':!![]});if(!_0x321308)throw new Error(_0x6b26('0x4d'));if(_0x321308[_0x6b26('0x4e')]===_0x6b26('0x4c')){var _0x3eebd4=_0x445c25[_0x6b26('0x25')]({'plain':!![]});var _0x122ab2=_0x6b26('0x26');return db[_0x6b26('0x4f')][_0x6b26('0x49')]({'where':{'name':_0x122ab2,'userProfileId':_0x321308[_0x6b26('0x50')]},'raw':!![]})['then'](function(_0x13c71c){if(_0x13c71c&&_0x13c71c[_0x6b26('0x51')]===0x0){return db[_0x6b26('0x27')][_0x6b26('0x4a')]({'name':_0x3eebd4['name'],'resourceId':_0x3eebd4['id'],'type':_0x13c71c[_0x6b26('0x2a')],'sectionId':_0x13c71c['id']},{})['then'](function(){return _0x445c25;});}else{return _0x445c25;}})[_0x6b26('0x52')](function(_0xf2dd1d){logger[_0x6b26('0x53')](_0x6b26('0x54'),_0xf2dd1d);throw _0xf2dd1d;});}return _0x445c25;})[_0x6b26('0x23')](respondWithResult(_0x2379d0,0xc9))[_0x6b26('0x52')](handleError(_0x2379d0,null));};exports[_0x6b26('0x22')]=function(_0x32eaea,_0x29f649){if(_0x32eaea[_0x6b26('0x4b')]['id']){delete _0x32eaea[_0x6b26('0x4b')]['id'];}return db[_0x6b26('0x2e')][_0x6b26('0x49')]({'where':{'id':_0x32eaea['params']['id']}})[_0x6b26('0x23')](handleEntityNotFound(_0x29f649,null))['then'](saveUpdates(_0x32eaea[_0x6b26('0x4b')],null))[_0x6b26('0x23')](respondWithResult(_0x29f649,null))[_0x6b26('0x52')](handleError(_0x29f649,null));};exports[_0x6b26('0x24')]=function(_0x3d7c6d,_0x14f606){return db['AnalyticExtractedReport'][_0x6b26('0x49')]({'where':{'id':_0x3d7c6d[_0x6b26('0x45')]['id']}})['then'](handleEntityNotFound(_0x14f606,null))[_0x6b26('0x23')](removeEntity(_0x14f606,null))[_0x6b26('0x52')](handleError(_0x14f606,null));};exports[_0x6b26('0x55')]=function(_0x159369,_0x15855d,_0x3f4806){return db[_0x6b26('0x2e')][_0x6b26('0x49')]({'where':{'id':_0x159369[_0x6b26('0x45')]['id']},'attributes':[_0x6b26('0x2a'),_0x6b26('0x56'),_0x6b26('0x57'),_0x6b26('0x58')],'raw':!![]})[_0x6b26('0x23')](handleEntityNotFound(_0x15855d,null))['then'](function(_0x2e67dd){if(_0x2e67dd){if(!fs[_0x6b26('0x59')](path['join'](config['root'],_0x6b26('0x5a'),_0x2e67dd[_0x6b26('0x57')]))){throw new db[(_0x6b26('0x5b'))][(_0x6b26('0x5c'))](_0x6b26('0x5d'));}if(_0x159369['query'][_0x6b26('0x5e')]){return _0x15855d[_0x6b26('0x28')](0xc8);}return _0x15855d[_0x6b26('0x55')](path[_0x6b26('0x5f')](config[_0x6b26('0x60')],_0x6b26('0x5a'),_0x2e67dd[_0x6b26('0x57')]),util[_0x6b26('0x61')](_0x6b26('0x62'),_0x2e67dd['basename']||_0x2e67dd['name'],_0x2e67dd[_0x6b26('0x58')][_0x6b26('0x63')]()));}})[_0x6b26('0x52')](handleError(_0x15855d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 67161e0..31ad0a4 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 _0x703f=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x1dc1ea,_0x44ab67){var _0x44e0e2=function(_0x415548){while(--_0x415548){_0x1dc1ea['push'](_0x1dc1ea['shift']());}};_0x44e0e2(++_0x44ab67);}(_0x703f,0x13c));var _0xf703=function(_0x1d59c1,_0x52bc80){_0x1d59c1=_0x1d59c1-0x0;var _0x3f4681=_0x703f[_0x1d59c1];return _0x3f4681;};'use strict';var _=require(_0xf703('0x0'));var util=require(_0xf703('0x1'));var logger=require(_0xf703('0x2'))(_0xf703('0x3'));var moment=require('moment');var BPromise=require(_0xf703('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf703('0x5'));var rimraf=require(_0xf703('0x6'));var config=require(_0xf703('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf703('0x8')]=function(_0x1c90d4,_0xc7d461){return _0x1c90d4[_0xf703('0x9')](_0xf703('0xa'),attributes,{'tableName':_0xf703('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1a7=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd1a7,0x113));var _0x7d1a=function(_0x316458,_0x588d62){_0x316458=_0x316458-0x0;var _0x213445=_0xd1a7[_0x316458];return _0x213445;};'use strict';var _=require(_0x7d1a('0x0'));var util=require('util');var logger=require(_0x7d1a('0x1'))(_0x7d1a('0x2'));var moment=require(_0x7d1a('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d1a('0x4'));var fs=require('fs');var path=require(_0x7d1a('0x5'));var rimraf=require(_0x7d1a('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d1a('0x7'));module['exports']=function(_0x448b69,_0x1035b3){return _0x448b69[_0x7d1a('0x8')](_0x7d1a('0x9'),attributes,{'tableName':_0x7d1a('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 fcb6e81..da8fe09 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 _0xd291=['error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd291,0x1af));var _0x1d29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd291[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1d29('0x0'));var util=require(_0x1d29('0x1'));var moment=require('moment');var BPromise=require(_0x1d29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d29('0x3'));var db=require(_0x1d29('0x4'))['db'];var utils=require(_0x1d29('0x5'));var logger=require(_0x1d29('0x6'))(_0x1d29('0x7'));var config=require(_0x1d29('0x8'));var jayson=require(_0x1d29('0x9'));var client=jayson[_0x1d29('0xa')][_0x1d29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24123f,_0x530254,_0x5856ad){return new BPromise(function(_0x1ca0b6,_0x25ef3d){return client[_0x1d29('0xc')](_0x24123f,_0x5856ad)[_0x1d29('0xd')](function(_0x1c023c){logger['info'](_0x1d29('0xe'),_0x530254,_0x1d29('0xf'));logger[_0x1d29('0x10')](_0x1d29('0x11'),_0x530254,_0x1d29('0xf'),JSON[_0x1d29('0x12')](_0x1c023c));if(_0x1c023c[_0x1d29('0x13')]){if(_0x1c023c[_0x1d29('0x13')][_0x1d29('0x14')]===0x1f4){logger[_0x1d29('0x13')](_0x1d29('0xe'),_0x530254,_0x1c023c[_0x1d29('0x13')][_0x1d29('0x15')]);return _0x25ef3d(_0x1c023c[_0x1d29('0x13')][_0x1d29('0x15')]);}logger[_0x1d29('0x13')](_0x1d29('0xe'),_0x530254,_0x1c023c['error'][_0x1d29('0x15')]);return _0x1ca0b6(_0x1c023c[_0x1d29('0x13')][_0x1d29('0x15')]);}else{logger[_0x1d29('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x530254,_0x1d29('0xf'));_0x1ca0b6(_0x1c023c[_0x1d29('0x17')][_0x1d29('0x15')]);}})[_0x1d29('0x18')](function(_0x31bec5){logger['error'](_0x1d29('0xe'),_0x530254,_0x31bec5);_0x25ef3d(_0x31bec5);});});}
\ No newline at end of file
+var _0x43c2=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x245fd8,_0x4f5262){var _0x5958a8=function(_0x42166e){while(--_0x42166e){_0x245fd8['push'](_0x245fd8['shift']());}};_0x5958a8(++_0x4f5262);}(_0x43c2,0x1a1));var _0x243c=function(_0x31ee74,_0x3f055b){_0x31ee74=_0x31ee74-0x0;var _0xe904ee=_0x43c2[_0x31ee74];return _0xe904ee;};'use strict';var _=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var moment=require(_0x243c('0x2'));var BPromise=require(_0x243c('0x3'));var rs=require(_0x243c('0x4'));var fs=require('fs');var Redis=require(_0x243c('0x5'));var db=require(_0x243c('0x6'))['db'];var utils=require(_0x243c('0x7'));var logger=require(_0x243c('0x8'))(_0x243c('0x9'));var config=require(_0x243c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x243c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1de96c,_0x45ef59,_0x211fe){return new BPromise(function(_0x57f579,_0x16b16b){return client[_0x243c('0xc')](_0x1de96c,_0x211fe)[_0x243c('0xd')](function(_0x58c50f){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x45ef59,'request\x20sent');logger[_0x243c('0xe')](_0x243c('0xf'),_0x45ef59,'request\x20sent',JSON[_0x243c('0x10')](_0x58c50f));if(_0x58c50f[_0x243c('0x11')]){if(_0x58c50f[_0x243c('0x11')]['code']===0x1f4){logger[_0x243c('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x45ef59,_0x58c50f[_0x243c('0x11')]['message']);return _0x16b16b(_0x58c50f['error']['message']);}logger[_0x243c('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x45ef59,_0x58c50f[_0x243c('0x11')][_0x243c('0x12')]);return _0x57f579(_0x58c50f['error']['message']);}else{logger[_0x243c('0x13')](_0x243c('0x14'),_0x45ef59,_0x243c('0x15'));_0x57f579(_0x58c50f[_0x243c('0x16')][_0x243c('0x12')]);}})['catch'](function(_0x26d996){logger['error'](_0x243c('0x14'),_0x45ef59,_0x26d996);_0x16b16b(_0x26d996);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 27f8e85..aeeae1b 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 _0x5c99=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','post','create','destroy','exports'];(function(_0x35d77b,_0x4e353d){var _0x292c58=function(_0x187162){while(--_0x187162){_0x35d77b['push'](_0x35d77b['shift']());}};_0x292c58(++_0x4e353d);}(_0x5c99,0x17c));var _0x95c9=function(_0x776414,_0x10d2de){_0x776414=_0x776414-0x0;var _0x7ec5f6=_0x5c99[_0x776414];return _0x7ec5f6;};'use strict';var multer=require(_0x95c9('0x0'));var util=require(_0x95c9('0x1'));var path=require(_0x95c9('0x2'));var timeout=require(_0x95c9('0x3'));var express=require(_0x95c9('0x4'));var router=express[_0x95c9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x95c9('0x6'));var interaction=require(_0x95c9('0x7'));var config=require(_0x95c9('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x95c9('0x9')]('/',auth['isAuthenticated'](),controller[_0x95c9('0xa')]);router[_0x95c9('0x9')](_0x95c9('0xb'),auth[_0x95c9('0xc')](),controller[_0x95c9('0xd')]);router['get'](_0x95c9('0xe'),auth[_0x95c9('0xc')](),controller['download']);router[_0x95c9('0xf')]('/',auth[_0x95c9('0xc')](),controller[_0x95c9('0x10')]);router['put'](_0x95c9('0xb'),auth[_0x95c9('0xc')](),controller['update']);router['delete'](_0x95c9('0xb'),auth[_0x95c9('0xc')](),controller[_0x95c9('0x11')]);module[_0x95c9('0x12')]=router;
\ No newline at end of file
+var _0x97eb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','util','path','express','Router'];(function(_0x52d4ab,_0x5d7cdf){var _0x170deb=function(_0x38aaf5){while(--_0x38aaf5){_0x52d4ab['push'](_0x52d4ab['shift']());}};_0x170deb(++_0x5d7cdf);}(_0x97eb,0x1f3));var _0xb97e=function(_0x94f78d,_0x2a0822){_0x94f78d=_0x94f78d-0x0;var _0x4f0d4b=_0x97eb[_0x94f78d];return _0x4f0d4b;};'use strict';var multer=require(_0xb97e('0x0'));var util=require(_0xb97e('0x1'));var path=require(_0xb97e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb97e('0x3'));var router=express[_0xb97e('0x4')]();var fs_extra=require(_0xb97e('0x5'));var auth=require(_0xb97e('0x6'));var interaction=require(_0xb97e('0x7'));var config=require(_0xb97e('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xb97e('0x9')]('/',auth[_0xb97e('0xa')](),controller[_0xb97e('0xb')]);router[_0xb97e('0x9')](_0xb97e('0xc'),auth['isAuthenticated'](),controller[_0xb97e('0xd')]);router[_0xb97e('0x9')](_0xb97e('0xe'),auth[_0xb97e('0xa')](),controller[_0xb97e('0xf')]);router[_0xb97e('0x10')]('/',auth[_0xb97e('0xa')](),controller[_0xb97e('0x11')]);router['put'](_0xb97e('0xc'),auth['isAuthenticated'](),controller[_0xb97e('0x12')]);router[_0xb97e('0x13')](_0xb97e('0xc'),auth[_0xb97e('0xa')](),controller['destroy']);module[_0xb97e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1dfdb4e..6a75a6e 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 _0x443c=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x443c,0x11c));var _0xc443=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0x443c[_0x1e03e4];return _0x4a887e;};'use strict';var Sequelize=require(_0xc443('0x0'));module[_0xc443('0x1')]={'field':{'type':Sequelize[_0xc443('0x2')]},'alias':{'type':Sequelize[_0xc443('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc443('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc443('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x79c5=['exports','TEXT','STRING','BOOLEAN'];(function(_0x223e3d,_0x584f24){var _0x414d57=function(_0x1604a5){while(--_0x1604a5){_0x223e3d['push'](_0x223e3d['shift']());}};_0x414d57(++_0x584f24);}(_0x79c5,0xdc));var _0x579c=function(_0xf2e13d,_0x424179){_0xf2e13d=_0xf2e13d-0x0;var _0x26e9a1=_0x79c5[_0xf2e13d];return _0x26e9a1;};'use strict';var Sequelize=require('sequelize');module[_0x579c('0x0')]={'field':{'type':Sequelize[_0x579c('0x1')]},'alias':{'type':Sequelize[_0x579c('0x2')]},'function':{'type':Sequelize[_0x579c('0x2')]},'format':{'type':Sequelize[_0x579c('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x579c('0x2')]},'custom':{'type':Sequelize[_0x579c('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 cc2ef71..cba53d7 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 _0xd08a=['findOne','sequelize','transaction','CustomReportId','findAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','filters','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','intersection','find','create','bulkCreate','body','bulkDestroy','ids','addFields'];(function(_0x1dcac4,_0x1896f6){var _0x486fc1=function(_0x2cb7e6){while(--_0x2cb7e6){_0x1dcac4['push'](_0x1dcac4['shift']());}};_0x486fc1(++_0x1896f6);}(_0xd08a,0xf8));var _0xad08=function(_0x37ac34,_0x2db651){_0x37ac34=_0x37ac34-0x0;var _0x2cfbce=_0xd08a[_0x37ac34];return _0x2cfbce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad08('0x0'));var jsonpatch=require(_0xad08('0x1'));var rp=require(_0xad08('0x2'));var moment=require(_0xad08('0x3'));var BPromise=require(_0xad08('0x4'));var Mustache=require(_0xad08('0x5'));var util=require(_0xad08('0x6'));var path=require(_0xad08('0x7'));var sox=require(_0xad08('0x8'));var csv=require('to-csv');var ejs=require(_0xad08('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xad08('0xa'));var jsforce=require(_0xad08('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xad08('0xc'));var querystring=require('querystring');var Papa=require(_0xad08('0xd'));var Redis=require(_0xad08('0xe'));var authService=require(_0xad08('0xf'));var qs=require(_0xad08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad08('0x11'));var logger=require(_0xad08('0x12'))(_0xad08('0x13'));var utils=require(_0xad08('0x14'));var config=require(_0xad08('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xad08('0x16'))['db'];function respondWithStatusCode(_0x495bff,_0x3f34f3){_0x3f34f3=_0x3f34f3||0xcc;return function(_0x149e89){if(_0x149e89){return _0x495bff['sendStatus'](_0x3f34f3);}return _0x495bff[_0xad08('0x17')](_0x3f34f3)[_0xad08('0x18')]();};}function respondWithResult(_0x1c452b,_0x17f870){_0x17f870=_0x17f870||0xc8;return function(_0x17097e){if(_0x17097e){return _0x1c452b[_0xad08('0x17')](_0x17f870)[_0xad08('0x19')](_0x17097e);}};}function respondWithFilteredResult(_0x5374fd,_0x588c59){return function(_0x1d74fc){if(_0x1d74fc){var _0x28983e=typeof _0x588c59[_0xad08('0x1a')]===_0xad08('0x1b')&&typeof _0x588c59[_0xad08('0x1c')]===_0xad08('0x1b');var _0x4dc891=_0x1d74fc[_0xad08('0x1d')];var _0x37bd5a=_0x28983e?0x0:_0x588c59[_0xad08('0x1a')];var _0x272d7d=_0x28983e?_0x1d74fc[_0xad08('0x1d')]:_0x588c59[_0xad08('0x1a')]+_0x588c59[_0xad08('0x1c')];var _0x4a0d0f;if(_0x272d7d>=_0x4dc891){_0x272d7d=_0x4dc891;_0x4a0d0f=0xc8;}else{_0x4a0d0f=0xce;}_0x5374fd[_0xad08('0x17')](_0x4a0d0f);return _0x5374fd[_0xad08('0x1e')](_0xad08('0x1f'),_0x37bd5a+'-'+_0x272d7d+'/'+_0x4dc891)['json'](_0x1d74fc);}return null;};}function patchUpdates(_0x370318){return function(_0xb524fb){try{jsonpatch[_0xad08('0x20')](_0xb524fb,_0x370318,!![]);}catch(_0x12e59a){return BPromise['reject'](_0x12e59a);}return _0xb524fb['save']();};}function saveUpdates(_0x1c210e,_0x2a4790){return function(_0x2161de){if(_0x2161de){return _0x2161de[_0xad08('0x21')](_0x1c210e)[_0xad08('0x22')](function(_0x5e8ee1){return _0x5e8ee1;});}return null;};}function removeEntity(_0x3275a0,_0x53896e){return function(_0x59a217){if(_0x59a217){return _0x59a217[_0xad08('0x23')]()[_0xad08('0x22')](function(){_0x3275a0[_0xad08('0x17')](0xcc)[_0xad08('0x18')]();});}};}function handleEntityNotFound(_0x4a3810,_0x1b36ed){return function(_0x508709){if(!_0x508709){_0x4a3810['sendStatus'](0x194);}return _0x508709;};}function handleError(_0x5bbc46,_0x2392ae){_0x2392ae=_0x2392ae||0x1f4;return function(_0x26d537){logger[_0xad08('0x24')](_0x26d537[_0xad08('0x25')]);if(_0x26d537[_0xad08('0x26')]){delete _0x26d537[_0xad08('0x26')];}_0x5bbc46[_0xad08('0x17')](_0x2392ae)[_0xad08('0x27')](_0x26d537);};}exports[_0xad08('0x28')]=function(_0x575159,_0x59a0e6){var _0x3ae57c={},_0x5a92ce={},_0x158086={'count':0x0,'rows':[]};var _0x47c495=_[_0xad08('0x29')](db[_0xad08('0x2a')][_0xad08('0x2b')],function(_0x1581dd){return{'name':_0x1581dd[_0xad08('0x2c')],'type':_0x1581dd[_0xad08('0x2d')][_0xad08('0x2e')]};});_0x5a92ce[_0xad08('0x2f')]=_[_0xad08('0x29')](_0x47c495,_0xad08('0x26'));_0x5a92ce['query']=_['keys'](_0x575159['query']);_0x5a92ce[_0xad08('0x30')]=_['intersection'](_0x5a92ce[_0xad08('0x2f')],_0x5a92ce[_0xad08('0x31')]);_0x3ae57c['attributes']=_['intersection'](_0x5a92ce[_0xad08('0x2f')],qs['fields'](_0x575159[_0xad08('0x31')][_0xad08('0x32')]));_0x3ae57c['attributes']=_0x3ae57c[_0xad08('0x33')][_0xad08('0x34')]?_0x3ae57c[_0xad08('0x33')]:_0x5a92ce[_0xad08('0x2f')];if(!_0x575159[_0xad08('0x31')][_0xad08('0x35')](_0xad08('0x36'))){_0x3ae57c[_0xad08('0x1c')]=qs[_0xad08('0x1c')](_0x575159[_0xad08('0x31')][_0xad08('0x1c')]);_0x3ae57c[_0xad08('0x1a')]=qs[_0xad08('0x1a')](_0x575159[_0xad08('0x31')][_0xad08('0x1a')]);}_0x3ae57c['order']=qs[_0xad08('0x37')](_0x575159[_0xad08('0x31')][_0xad08('0x37')]);_0x3ae57c[_0xad08('0x38')]=qs['filters'](_[_0xad08('0x39')](_0x575159[_0xad08('0x31')],_0x5a92ce[_0xad08('0x30')]),_0x47c495);if(_0x575159['query'][_0xad08('0x3a')]){_0x3ae57c[_0xad08('0x38')]=_['merge'](_0x3ae57c[_0xad08('0x38')],{'$or':_[_0xad08('0x29')](_0x47c495,function(_0x591f8d){if(_0x591f8d[_0xad08('0x2d')]!==_0xad08('0x3b')){var _0x40fb21={};_0x40fb21[_0x591f8d[_0xad08('0x26')]]={'$like':'%'+_0x575159[_0xad08('0x31')][_0xad08('0x3a')]+'%'};return _0x40fb21;}})});}_0x3ae57c=_['merge']({},_0x3ae57c,_0x575159[_0xad08('0x3c')]);var _0x17e4b7={'where':_0x3ae57c[_0xad08('0x38')]};return db['AnalyticFieldReport'][_0xad08('0x1d')](_0x17e4b7)['then'](function(_0x267bc4){_0x158086[_0xad08('0x1d')]=_0x267bc4;if(_0x575159[_0xad08('0x31')][_0xad08('0x3d')]){_0x3ae57c[_0xad08('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x3ae57c);})[_0xad08('0x22')](function(_0x2ad55e){_0x158086[_0xad08('0x3f')]=_0x2ad55e;return _0x158086;})[_0xad08('0x22')](respondWithFilteredResult(_0x59a0e6,_0x3ae57c))[_0xad08('0x40')](handleError(_0x59a0e6,null));};exports[_0xad08('0x41')]=function(_0x5b8ff1,_0x3075bb){var _0x5646fd={'raw':![],'where':{'id':_0x5b8ff1[_0xad08('0x42')]['id']}},_0x2f60b8={};_0x2f60b8[_0xad08('0x2f')]=_[_0xad08('0x43')](db[_0xad08('0x2a')][_0xad08('0x2b')]);_0x2f60b8[_0xad08('0x31')]=_[_0xad08('0x43')](_0x5b8ff1['query']);_0x2f60b8[_0xad08('0x30')]=_['intersection'](_0x2f60b8[_0xad08('0x2f')],_0x2f60b8[_0xad08('0x31')]);_0x5646fd['attributes']=_[_0xad08('0x44')](_0x2f60b8[_0xad08('0x2f')],qs[_0xad08('0x32')](_0x5b8ff1['query'][_0xad08('0x32')]));_0x5646fd[_0xad08('0x33')]=_0x5646fd[_0xad08('0x33')][_0xad08('0x34')]?_0x5646fd[_0xad08('0x33')]:_0x2f60b8[_0xad08('0x2f')];if(_0x5b8ff1[_0xad08('0x31')][_0xad08('0x3d')]){_0x5646fd['include']=[{'all':!![]}];}_0x5646fd=_['merge']({},_0x5646fd,_0x5b8ff1['options']);return db[_0xad08('0x2a')][_0xad08('0x45')](_0x5646fd)[_0xad08('0x22')](handleEntityNotFound(_0x3075bb,null))[_0xad08('0x22')](respondWithResult(_0x3075bb,null))[_0xad08('0x40')](handleError(_0x3075bb,null));};exports['create']=function(_0x5a44e5,_0x2ae7ed){return db[_0xad08('0x2a')][_0xad08('0x46')](_0x5a44e5['body'],{})[_0xad08('0x22')](respondWithResult(_0x2ae7ed,0xc9))[_0xad08('0x40')](handleError(_0x2ae7ed,null));};exports[_0xad08('0x47')]=function(_0x5c32cd,_0x412068){return db[_0xad08('0x2a')][_0xad08('0x47')](_0x5c32cd['body'],{'raw':![],'individualHooks':!![]})[_0xad08('0x22')](respondWithResult(_0x412068,0xc9))[_0xad08('0x40')](handleError(_0x412068,null));};exports[_0xad08('0x21')]=function(_0x202f66,_0x1d5567){if(_0x202f66[_0xad08('0x48')]['id']){delete _0x202f66['body']['id'];}return db[_0xad08('0x2a')][_0xad08('0x45')]({'where':{'id':_0x202f66[_0xad08('0x42')]['id']}})[_0xad08('0x22')](handleEntityNotFound(_0x1d5567,null))[_0xad08('0x22')](saveUpdates(_0x202f66[_0xad08('0x48')],null))[_0xad08('0x22')](respondWithResult(_0x1d5567,null))[_0xad08('0x40')](handleError(_0x1d5567,null));};exports[_0xad08('0x23')]=function(_0x597706,_0x53a550){return db[_0xad08('0x2a')][_0xad08('0x45')]({'where':{'id':_0x597706['params']['id']}})[_0xad08('0x22')](handleEntityNotFound(_0x53a550,null))[_0xad08('0x22')](removeEntity(_0x53a550,null))[_0xad08('0x40')](handleError(_0x53a550,null));};exports[_0xad08('0x49')]=function(_0x100f9a,_0x4a20ff){return db[_0xad08('0x2a')][_0xad08('0x23')]({'where':{'id':_0x100f9a[_0xad08('0x31')][_0xad08('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xad08('0x22')](respondWithResult(_0x4a20ff,0xcc))[_0xad08('0x40')](handleError(_0x4a20ff,null));};exports[_0xad08('0x4b')]=function(_0x32a3e2,_0x26225f,_0x184189){return db['AnalyticCustomReport'][_0xad08('0x4c')]({'where':{'id':_0x32a3e2[_0xad08('0x42')]['id']}})['then'](handleEntityNotFound(_0x26225f,null))[_0xad08('0x22')](function(_0x30b7af){if(_0x30b7af){return db[_0xad08('0x4d')][_0xad08('0x4e')](function(_0x4f0793){return db[_0xad08('0x2a')][_0xad08('0x23')]({'where':{'CustomReportId':_0x32a3e2[_0xad08('0x42')]['id']},'transaction':_0x4f0793})['then'](function(_0x222352){var _0x197016=_[_0xad08('0x29')](_0x32a3e2[_0xad08('0x48')],function(_0x1644f){delete _0x1644f['id'];_0x1644f[_0xad08('0x4f')]=_0x32a3e2['params']['id'];return _0x1644f;});return db[_0xad08('0x2a')][_0xad08('0x47')](_0x197016,{'transaction':_0x4f0793});});})['then'](function(){return db[_0xad08('0x2a')][_0xad08('0x50')]({'where':{'CustomReportId':_0x32a3e2[_0xad08('0x42')]['id']}});});}})['then'](respondWithResult(_0x26225f,null))[_0xad08('0x40')](handleError(_0x26225f,null));};
\ No newline at end of file
+var _0xb90d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','update','destroy','then','end','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis'];(function(_0x4220d3,_0x4341e0){var _0x3dba53=function(_0xb9c7e3){while(--_0xb9c7e3){_0x4220d3['push'](_0x4220d3['shift']());}};_0x3dba53(++_0x4341e0);}(_0xb90d,0x17a));var _0xdb90=function(_0x52a505,_0x5dec98){_0x52a505=_0x52a505-0x0;var _0x1fc95e=_0xb90d[_0x52a505];return _0x1fc95e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb90('0x0'));var zipdir=require(_0xdb90('0x1'));var jsonpatch=require(_0xdb90('0x2'));var rp=require(_0xdb90('0x3'));var moment=require(_0xdb90('0x4'));var BPromise=require(_0xdb90('0x5'));var Mustache=require('mustache');var util=require(_0xdb90('0x6'));var path=require(_0xdb90('0x7'));var sox=require(_0xdb90('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb90('0x9'));var _=require(_0xdb90('0xa'));var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb90('0xd'));var toCsv=require(_0xdb90('0xe'));var querystring=require(_0xdb90('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb90('0x10'));var authService=require(_0xdb90('0x11'));var qs=require(_0xdb90('0x12'));var as=require(_0xdb90('0x13'));var hardwareService=require(_0xdb90('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdb90('0x15'));var licenseUtil=require(_0xdb90('0x16'));var db=require(_0xdb90('0x17'))['db'];function respondWithStatusCode(_0xb5ea64,_0xdc179e){_0xdc179e=_0xdc179e||0xcc;return function(_0x113659){if(_0x113659){return _0xb5ea64['sendStatus'](_0xdc179e);}return _0xb5ea64['status'](_0xdc179e)['end']();};}function respondWithResult(_0x511592,_0x569d40){_0x569d40=_0x569d40||0xc8;return function(_0x5eb6ef){if(_0x5eb6ef){return _0x511592[_0xdb90('0x18')](_0x569d40)[_0xdb90('0x19')](_0x5eb6ef);}};}function respondWithFilteredResult(_0x5b93b1,_0x19b02e){return function(_0x1cde0d){if(_0x1cde0d){var _0x4db002=typeof _0x19b02e['offset']===_0xdb90('0x1a')&&typeof _0x19b02e[_0xdb90('0x1b')]===_0xdb90('0x1a');var _0x5101e9=_0x1cde0d[_0xdb90('0x1c')];var _0x13f6df=_0x4db002?0x0:_0x19b02e[_0xdb90('0x1d')];var _0x44d4d4=_0x4db002?_0x1cde0d[_0xdb90('0x1c')]:_0x19b02e[_0xdb90('0x1d')]+_0x19b02e[_0xdb90('0x1b')];var _0x1838ed;if(_0x44d4d4>=_0x5101e9){_0x44d4d4=_0x5101e9;_0x1838ed=0xc8;}else{_0x1838ed=0xce;}_0x5b93b1[_0xdb90('0x18')](_0x1838ed);return _0x5b93b1[_0xdb90('0x1e')]('Content-Range',_0x13f6df+'-'+_0x44d4d4+'/'+_0x5101e9)['json'](_0x1cde0d);}return null;};}function patchUpdates(_0x4110c7){return function(_0x1c2dbe){try{jsonpatch[_0xdb90('0x1f')](_0x1c2dbe,_0x4110c7,!![]);}catch(_0x13f84d){return BPromise[_0xdb90('0x20')](_0x13f84d);}return _0x1c2dbe['save']();};}function saveUpdates(_0x31f9df,_0x922395){return function(_0x590e6a){if(_0x590e6a){return _0x590e6a[_0xdb90('0x21')](_0x31f9df)['then'](function(_0x185b08){return _0x185b08;});}return null;};}function removeEntity(_0x2fdb1b,_0x1fe5ab){return function(_0x463199){if(_0x463199){return _0x463199[_0xdb90('0x22')]()[_0xdb90('0x23')](function(){_0x2fdb1b[_0xdb90('0x18')](0xcc)[_0xdb90('0x24')]();});}};}function handleEntityNotFound(_0x1ef44a,_0x1fed39){return function(_0x64268c){if(!_0x64268c){_0x1ef44a['sendStatus'](0x194);}return _0x64268c;};}function handleError(_0x1a27c3,_0xedb1a6){_0xedb1a6=_0xedb1a6||0x1f4;return function(_0x3fcafd){logger['error'](_0x3fcafd['stack']);if(_0x3fcafd[_0xdb90('0x25')]){delete _0x3fcafd[_0xdb90('0x25')];}_0x1a27c3[_0xdb90('0x18')](_0xedb1a6)[_0xdb90('0x26')](_0x3fcafd);};}exports[_0xdb90('0x27')]=function(_0x321efc,_0x46f743){var _0x67aebc={},_0x554d8f={},_0x3c8671={'count':0x0,'rows':[]};var _0x204f8a=_[_0xdb90('0x28')](db[_0xdb90('0x29')][_0xdb90('0x2a')],function(_0x66ecd3){return{'name':_0x66ecd3[_0xdb90('0x2b')],'type':_0x66ecd3[_0xdb90('0x2c')][_0xdb90('0x2d')]};});_0x554d8f[_0xdb90('0x2e')]=_[_0xdb90('0x28')](_0x204f8a,_0xdb90('0x25'));_0x554d8f[_0xdb90('0x2f')]=_[_0xdb90('0x30')](_0x321efc['query']);_0x554d8f[_0xdb90('0x31')]=_[_0xdb90('0x32')](_0x554d8f[_0xdb90('0x2e')],_0x554d8f[_0xdb90('0x2f')]);_0x67aebc[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x554d8f[_0xdb90('0x2e')],qs[_0xdb90('0x34')](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x34')]));_0x67aebc['attributes']=_0x67aebc[_0xdb90('0x33')][_0xdb90('0x35')]?_0x67aebc['attributes']:_0x554d8f[_0xdb90('0x2e')];if(!_0x321efc[_0xdb90('0x2f')][_0xdb90('0x36')](_0xdb90('0x37'))){_0x67aebc[_0xdb90('0x1b')]=qs['limit'](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x1b')]);_0x67aebc[_0xdb90('0x1d')]=qs['offset'](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x1d')]);}_0x67aebc['order']=qs[_0xdb90('0x38')](_0x321efc[_0xdb90('0x2f')][_0xdb90('0x38')]);_0x67aebc[_0xdb90('0x39')]=qs['filters'](_[_0xdb90('0x3a')](_0x321efc[_0xdb90('0x2f')],_0x554d8f['filters']),_0x204f8a);if(_0x321efc['query'][_0xdb90('0x3b')]){_0x67aebc[_0xdb90('0x39')]=_[_0xdb90('0x3c')](_0x67aebc[_0xdb90('0x39')],{'$or':_['map'](_0x204f8a,function(_0x13ae1b){if(_0x13ae1b['type']!=='VIRTUAL'){var _0x5676db={};_0x5676db[_0x13ae1b[_0xdb90('0x25')]]={'$like':'%'+_0x321efc[_0xdb90('0x2f')][_0xdb90('0x3b')]+'%'};return _0x5676db;}})});}_0x67aebc=_[_0xdb90('0x3c')]({},_0x67aebc,_0x321efc[_0xdb90('0x3d')]);var _0x57ba6b={'where':_0x67aebc[_0xdb90('0x39')]};return db['AnalyticFieldReport'][_0xdb90('0x1c')](_0x57ba6b)[_0xdb90('0x23')](function(_0x5afca9){_0x3c8671['count']=_0x5afca9;if(_0x321efc[_0xdb90('0x2f')]['includeAll']){_0x67aebc[_0xdb90('0x3e')]=[{'all':!![]}];}return db[_0xdb90('0x29')][_0xdb90('0x3f')](_0x67aebc);})['then'](function(_0x300d70){_0x3c8671[_0xdb90('0x40')]=_0x300d70;return _0x3c8671;})['then'](respondWithFilteredResult(_0x46f743,_0x67aebc))[_0xdb90('0x41')](handleError(_0x46f743,null));};exports[_0xdb90('0x42')]=function(_0x2eec66,_0x68e9e5){var _0x1e2e7f={'raw':![],'where':{'id':_0x2eec66[_0xdb90('0x43')]['id']}},_0x284342={};_0x284342[_0xdb90('0x2e')]=_['keys'](db[_0xdb90('0x29')]['rawAttributes']);_0x284342['query']=_['keys'](_0x2eec66[_0xdb90('0x2f')]);_0x284342['filters']=_['intersection'](_0x284342[_0xdb90('0x2e')],_0x284342[_0xdb90('0x2f')]);_0x1e2e7f[_0xdb90('0x33')]=_[_0xdb90('0x32')](_0x284342['model'],qs[_0xdb90('0x34')](_0x2eec66[_0xdb90('0x2f')][_0xdb90('0x34')]));_0x1e2e7f[_0xdb90('0x33')]=_0x1e2e7f[_0xdb90('0x33')][_0xdb90('0x35')]?_0x1e2e7f[_0xdb90('0x33')]:_0x284342[_0xdb90('0x2e')];if(_0x2eec66[_0xdb90('0x2f')][_0xdb90('0x44')]){_0x1e2e7f[_0xdb90('0x3e')]=[{'all':!![]}];}_0x1e2e7f=_[_0xdb90('0x3c')]({},_0x1e2e7f,_0x2eec66[_0xdb90('0x3d')]);return db['AnalyticFieldReport']['find'](_0x1e2e7f)['then'](handleEntityNotFound(_0x68e9e5,null))['then'](respondWithResult(_0x68e9e5,null))[_0xdb90('0x41')](handleError(_0x68e9e5,null));};exports['create']=function(_0x56fef9,_0x4ba023){return db[_0xdb90('0x29')]['create'](_0x56fef9[_0xdb90('0x45')],{})[_0xdb90('0x23')](respondWithResult(_0x4ba023,0xc9))[_0xdb90('0x41')](handleError(_0x4ba023,null));};exports[_0xdb90('0x46')]=function(_0x16888b,_0x21c540){return db[_0xdb90('0x29')][_0xdb90('0x46')](_0x16888b['body'],{'raw':![],'individualHooks':!![]})[_0xdb90('0x23')](respondWithResult(_0x21c540,0xc9))[_0xdb90('0x41')](handleError(_0x21c540,null));};exports['update']=function(_0x58ca62,_0x133d8b){if(_0x58ca62[_0xdb90('0x45')]['id']){delete _0x58ca62[_0xdb90('0x45')]['id'];}return db['AnalyticFieldReport'][_0xdb90('0x47')]({'where':{'id':_0x58ca62[_0xdb90('0x43')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x133d8b,null))[_0xdb90('0x23')](saveUpdates(_0x58ca62[_0xdb90('0x45')],null))[_0xdb90('0x23')](respondWithResult(_0x133d8b,null))[_0xdb90('0x41')](handleError(_0x133d8b,null));};exports[_0xdb90('0x22')]=function(_0x3ed260,_0x507d6e){return db[_0xdb90('0x29')][_0xdb90('0x47')]({'where':{'id':_0x3ed260['params']['id']}})['then'](handleEntityNotFound(_0x507d6e,null))['then'](removeEntity(_0x507d6e,null))[_0xdb90('0x41')](handleError(_0x507d6e,null));};exports[_0xdb90('0x48')]=function(_0x54237b,_0x57b8f4){return db[_0xdb90('0x29')][_0xdb90('0x22')]({'where':{'id':_0x54237b[_0xdb90('0x2f')][_0xdb90('0x49')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x57b8f4,0xcc))[_0xdb90('0x41')](handleError(_0x57b8f4,null));};exports[_0xdb90('0x4a')]=function(_0x507138,_0x5e7dd1,_0x37210d){return db[_0xdb90('0x4b')][_0xdb90('0x4c')]({'where':{'id':_0x507138[_0xdb90('0x43')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x5e7dd1,null))[_0xdb90('0x23')](function(_0x510edd){if(_0x510edd){return db['sequelize'][_0xdb90('0x4d')](function(_0x2f51d4){return db['AnalyticFieldReport'][_0xdb90('0x22')]({'where':{'CustomReportId':_0x507138[_0xdb90('0x43')]['id']},'transaction':_0x2f51d4})[_0xdb90('0x23')](function(_0x255166){var _0x5acf12=_[_0xdb90('0x28')](_0x507138['body'],function(_0x323dbb){delete _0x323dbb['id'];_0x323dbb[_0xdb90('0x4e')]=_0x507138[_0xdb90('0x43')]['id'];return _0x323dbb;});return db[_0xdb90('0x29')][_0xdb90('0x46')](_0x5acf12,{'transaction':_0x2f51d4});});})['then'](function(){return db['AnalyticFieldReport'][_0xdb90('0x3f')]({'where':{'CustomReportId':_0x507138[_0xdb90('0x43')]['id']}});});}})[_0xdb90('0x23')](respondWithResult(_0x5e7dd1,null))[_0xdb90('0x41')](handleError(_0x5e7dd1,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index a3fe2dc..afddcd6 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 _0x193a=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x235501,_0x13031d){var _0x745218=function(_0x3e37e8){while(--_0x3e37e8){_0x235501['push'](_0x235501['shift']());}};_0x745218(++_0x13031d);}(_0x193a,0xd9));var _0xa193=function(_0x1e836c,_0x2da665){_0x1e836c=_0x1e836c-0x0;var _0x195f47=_0x193a[_0x1e836c];return _0x195f47;};'use strict';var _=require(_0xa193('0x0'));var util=require(_0xa193('0x1'));var logger=require(_0xa193('0x2'))(_0xa193('0x3'));var moment=require(_0xa193('0x4'));var BPromise=require(_0xa193('0x5'));var rp=require(_0xa193('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa193('0x7'));var config=require(_0xa193('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xa193('0x9')]=function(_0xba6b9e,_0x2190b4){return _0xba6b9e[_0xa193('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0xa193('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a89=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x375da7,_0x18765c){var _0x324c46=function(_0x56f5f0){while(--_0x56f5f0){_0x375da7['push'](_0x375da7['shift']());}};_0x324c46(++_0x18765c);}(_0x7a89,0x13b));var _0x97a8=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x7a89[_0x1ee351];return _0x245aaf;};'use strict';var _=require(_0x97a8('0x0'));var util=require(_0x97a8('0x1'));var logger=require('../../config/logger')(_0x97a8('0x2'));var moment=require(_0x97a8('0x3'));var BPromise=require(_0x97a8('0x4'));var rp=require(_0x97a8('0x5'));var fs=require('fs');var path=require(_0x97a8('0x6'));var rimraf=require(_0x97a8('0x7'));var config=require(_0x97a8('0x8'));var attributes=require(_0x97a8('0x9'));module[_0x97a8('0xa')]=function(_0xd64f3c,_0x5685f8){return _0xd64f3c['define'](_0x97a8('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index f1b6b4b..3e86861 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 _0xbd7b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xbd7b,0x17b));var _0xbbd7=function(_0xb347b9,_0x3c4105){_0xb347b9=_0xb347b9-0x0;var _0x40091b=_0xbd7b[_0xb347b9];return _0x40091b;};'use strict';var _=require(_0xbbd7('0x0'));var util=require(_0xbbd7('0x1'));var moment=require(_0xbbd7('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbd7('0x3'));var fs=require('fs');var Redis=require(_0xbbd7('0x4'));var db=require(_0xbbd7('0x5'))['db'];var utils=require(_0xbbd7('0x6'));var logger=require(_0xbbd7('0x7'))(_0xbbd7('0x8'));var config=require('../../config/environment');var jayson=require(_0xbbd7('0x9'));var client=jayson[_0xbbd7('0xa')][_0xbbd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x68fc99,_0x3a3012,_0x115ce3){return new BPromise(function(_0x235b1b,_0x40187b){return client[_0xbbd7('0xc')](_0x68fc99,_0x115ce3)[_0xbbd7('0xd')](function(_0x3e6ae1){logger[_0xbbd7('0xe')](_0xbbd7('0xf'),_0x3a3012,_0xbbd7('0x10'));logger[_0xbbd7('0x11')](_0xbbd7('0x12'),_0x3a3012,_0xbbd7('0x10'),JSON[_0xbbd7('0x13')](_0x3e6ae1));if(_0x3e6ae1['error']){if(_0x3e6ae1[_0xbbd7('0x14')]['code']===0x1f4){logger['error'](_0xbbd7('0xf'),_0x3a3012,_0x3e6ae1[_0xbbd7('0x14')][_0xbbd7('0x15')]);return _0x40187b(_0x3e6ae1[_0xbbd7('0x14')]['message']);}logger[_0xbbd7('0x14')](_0xbbd7('0xf'),_0x3a3012,_0x3e6ae1[_0xbbd7('0x14')][_0xbbd7('0x15')]);return _0x235b1b(_0x3e6ae1[_0xbbd7('0x14')][_0xbbd7('0x15')]);}else{logger[_0xbbd7('0xe')](_0xbbd7('0xf'),_0x3a3012,_0xbbd7('0x10'));_0x235b1b(_0x3e6ae1[_0xbbd7('0x16')][_0xbbd7('0x15')]);}})[_0xbbd7('0x17')](function(_0x5b2fde){logger[_0xbbd7('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a3012,_0x5b2fde);_0x40187b(_0x5b2fde);});});}
\ No newline at end of file
+var _0x3611=['http','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x3611,0xbc));var _0x1361=function(_0x3409ec,_0x1bb946){_0x3409ec=_0x3409ec-0x0;var _0x11a522=_0x3611[_0x3409ec];return _0x11a522;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var moment=require(_0x1361('0x1'));var BPromise=require(_0x1361('0x2'));var rs=require(_0x1361('0x3'));var fs=require('fs');var Redis=require(_0x1361('0x4'));var db=require(_0x1361('0x5'))['db'];var utils=require(_0x1361('0x6'));var logger=require(_0x1361('0x7'))(_0x1361('0x8'));var config=require(_0x1361('0x9'));var jayson=require(_0x1361('0xa'));var client=jayson[_0x1361('0xb')][_0x1361('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6198b4,_0x560214,_0x2b2e22){return new BPromise(function(_0x36a5da,_0x58d67b){return client['request'](_0x6198b4,_0x2b2e22)[_0x1361('0xd')](function(_0x1e854f){logger['info'](_0x1361('0xe'),_0x560214,'request\x20sent');logger[_0x1361('0xf')](_0x1361('0x10'),_0x560214,_0x1361('0x11'),JSON[_0x1361('0x12')](_0x1e854f));if(_0x1e854f[_0x1361('0x13')]){if(_0x1e854f[_0x1361('0x13')][_0x1361('0x14')]===0x1f4){logger[_0x1361('0x13')](_0x1361('0xe'),_0x560214,_0x1e854f['error']['message']);return _0x58d67b(_0x1e854f['error'][_0x1361('0x15')]);}logger[_0x1361('0x13')](_0x1361('0xe'),_0x560214,_0x1e854f['error'][_0x1361('0x15')]);return _0x36a5da(_0x1e854f[_0x1361('0x13')][_0x1361('0x15')]);}else{logger[_0x1361('0x16')](_0x1361('0xe'),_0x560214,_0x1361('0x11'));_0x36a5da(_0x1e854f[_0x1361('0x17')]['message']);}})[_0x1361('0x18')](function(_0x1c93be){logger['error'](_0x1361('0xe'),_0x560214,_0x1c93be);_0x58d67b(_0x1c93be);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index db4df04..c046005 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(_0x4d0cc8,_0x2787ac){var _0x49faef=function(_0x26ba10){while(--_0x26ba10){_0x4d0cc8['push'](_0x4d0cc8['shift']());}};_0x49faef(++_0x2787ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x7f162d,_0x190ff5){var _0x2d58d8=function(_0x5a93cf){while(--_0x5a93cf){_0x7f162d['push'](_0x7f162d['shift']());}};_0x2d58d8(++_0x190ff5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 d4d5473..f5bbcb0 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 _0xf69c=['name','TEXT','sequelize','exports','STRING'];(function(_0x3df30a,_0x469c8a){var _0x1ad138=function(_0x3c6d2a){while(--_0x3c6d2a){_0x3df30a['push'](_0x3df30a['shift']());}};_0x1ad138(++_0x469c8a);}(_0xf69c,0x1e2));var _0xcf69=function(_0x47d4fc,_0x51d987){_0x47d4fc=_0x47d4fc-0x0;var _0x3f3027=_0xf69c[_0x47d4fc];return _0x3f3027;};'use strict';var Sequelize=require(_0xcf69('0x0'));module[_0xcf69('0x1')]={'name':{'type':Sequelize[_0xcf69('0x2')],'allowNull':![],'unique':_0xcf69('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xcf69('0x4')]},'description':{'type':Sequelize[_0xcf69('0x2')]}};
\ No newline at end of file
+var _0x7980=['TEXT','sequelize','exports','name','STRING'];(function(_0x4d83ef,_0x49c76e){var _0x495f4f=function(_0x970086){while(--_0x970086){_0x4d83ef['push'](_0x4d83ef['shift']());}};_0x495f4f(++_0x49c76e);}(_0x7980,0x123));var _0x0798=function(_0x16e01a,_0x3621ad){_0x16e01a=_0x16e01a-0x0;var _0x287045=_0x7980[_0x16e01a];return _0x287045;};'use strict';var Sequelize=require(_0x0798('0x0'));module[_0x0798('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0798('0x2')},'table':{'type':Sequelize[_0x0798('0x3')]},'metric':{'type':Sequelize[_0x0798('0x4')]},'description':{'type':Sequelize[_0x0798('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index bf8a0f1..557a502 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7da7,0x10d));var _0x77da=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x7da7[_0x2d486b];return _0x4291d1;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
+var _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x2ac083,_0x1c4617){var _0x567a7c=function(_0x37eb78){while(--_0x37eb78){_0x2ac083['push'](_0x2ac083['shift']());}};_0x567a7c(++_0x1c4617);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5472dc,_0x3ba0cf){_0x5472dc=_0x5472dc-0x0;var _0x729862=_0xd6d6[_0x5472dc];return _0x729862;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 49c618d..75f43cb 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 _0xc43c=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','request-promise'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0xc43c,0xd4));var _0xcc43=function(_0x17f90b,_0x55cc6e){_0x17f90b=_0x17f90b-0x0;var _0x4eeba2=_0xc43c[_0x17f90b];return _0x4eeba2;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc43('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc43('0x4'));module[_0xcc43('0x5')]=function(_0x13d329,_0x5e818f){return _0x13d329[_0xcc43('0x6')](_0xcc43('0x7'),attributes,{'tableName':_0xcc43('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x723e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x4e7413,_0x5dffb1){var _0x11b6de=function(_0xd6721b){while(--_0xd6721b){_0x4e7413['push'](_0x4e7413['shift']());}};_0x11b6de(++_0x5dffb1);}(_0x723e,0x179));var _0xe723=function(_0x27817b,_0x2f7e80){_0x27817b=_0x27817b-0x0;var _0x11692c=_0x723e[_0x27817b];return _0x11692c;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var moment=require(_0xe723('0x3'));var BPromise=require(_0xe723('0x4'));var rp=require(_0xe723('0x5'));var fs=require('fs');var path=require(_0xe723('0x6'));var rimraf=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var attributes=require(_0xe723('0x9'));module['exports']=function(_0x32d689,_0x20c13b){return _0x32d689[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':_0xe723('0xc'),'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 4a4141d..13d1319 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 _0x30c8=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x4c794a,_0x5e1056){var _0x4d9858=function(_0x1a588a){while(--_0x1a588a){_0x4c794a['push'](_0x4c794a['shift']());}};_0x4d9858(++_0x5e1056);}(_0x30c8,0x86));var _0x830c=function(_0x183f90,_0x3bd6ac){_0x183f90=_0x183f90-0x0;var _0x456fcf=_0x30c8[_0x183f90];return _0x456fcf;};'use strict';var _=require(_0x830c('0x0'));var util=require('util');var moment=require(_0x830c('0x1'));var BPromise=require(_0x830c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x830c('0x3'));var db=require(_0x830c('0x4'))['db'];var utils=require(_0x830c('0x5'));var logger=require('../../config/logger')(_0x830c('0x6'));var config=require('../../config/environment');var jayson=require(_0x830c('0x7'));var client=jayson['client'][_0x830c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1490a3,_0x2d11cd,_0x1ca147){return new BPromise(function(_0x524cd9,_0x22674b){return client[_0x830c('0x9')](_0x1490a3,_0x1ca147)['then'](function(_0x237205){logger[_0x830c('0xa')](_0x830c('0xb'),_0x2d11cd,_0x830c('0xc'));logger[_0x830c('0xd')](_0x830c('0xe'),_0x2d11cd,_0x830c('0xc'),JSON[_0x830c('0xf')](_0x237205));if(_0x237205[_0x830c('0x10')]){if(_0x237205[_0x830c('0x10')][_0x830c('0x11')]===0x1f4){logger[_0x830c('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x2d11cd,_0x237205[_0x830c('0x10')]['message']);return _0x22674b(_0x237205[_0x830c('0x10')]['message']);}logger['error'](_0x830c('0xb'),_0x2d11cd,_0x237205['error'][_0x830c('0x12')]);return _0x524cd9(_0x237205[_0x830c('0x10')][_0x830c('0x12')]);}else{logger[_0x830c('0xa')](_0x830c('0xb'),_0x2d11cd,_0x830c('0xc'));_0x524cd9(_0x237205[_0x830c('0x13')]['message']);}})[_0x830c('0x14')](function(_0xcd68d4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x2d11cd,_0xcd68d4);_0x22674b(_0xcd68d4);});});}
\ No newline at end of file
+var _0x16a9=['then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x16a9,0x107));var _0x916a=function(_0x218422,_0x367e3c){_0x218422=_0x218422-0x0;var _0x2fc5a5=_0x16a9[_0x218422];return _0x2fc5a5;};'use strict';var _=require(_0x916a('0x0'));var util=require('util');var moment=require(_0x916a('0x1'));var BPromise=require(_0x916a('0x2'));var rs=require(_0x916a('0x3'));var fs=require('fs');var Redis=require(_0x916a('0x4'));var db=require(_0x916a('0x5'))['db'];var utils=require(_0x916a('0x6'));var logger=require(_0x916a('0x7'))('rpc');var config=require(_0x916a('0x8'));var jayson=require(_0x916a('0x9'));var client=jayson[_0x916a('0xa')][_0x916a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x410c75,_0x3256d3,_0x27ca04){return new BPromise(function(_0x2e66b3,_0xbe274a){return client[_0x916a('0xc')](_0x410c75,_0x27ca04)[_0x916a('0xd')](function(_0x5df37a){logger['info'](_0x916a('0xe'),_0x3256d3,_0x916a('0xf'));logger[_0x916a('0x10')](_0x916a('0x11'),_0x3256d3,'request\x20sent',JSON[_0x916a('0x12')](_0x5df37a));if(_0x5df37a[_0x916a('0x13')]){if(_0x5df37a['error']['code']===0x1f4){logger[_0x916a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3256d3,_0x5df37a[_0x916a('0x13')][_0x916a('0x14')]);return _0xbe274a(_0x5df37a['error'][_0x916a('0x14')]);}logger[_0x916a('0x13')](_0x916a('0xe'),_0x3256d3,_0x5df37a['error'][_0x916a('0x14')]);return _0x2e66b3(_0x5df37a[_0x916a('0x13')]['message']);}else{logger[_0x916a('0x15')](_0x916a('0xe'),_0x3256d3,_0x916a('0xf'));_0x2e66b3(_0x5df37a[_0x916a('0x16')][_0x916a('0x14')]);}})['catch'](function(_0x428433){logger[_0x916a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3256d3,_0x428433);_0xbe274a(_0x428433);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index cb8b00e..ba6b976 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 _0x9879=['./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9e5ff5,_0xce6382){var _0x58ac51=function(_0x4d0ed8){while(--_0x4d0ed8){_0x9e5ff5['push'](_0x9e5ff5['shift']());}};_0x58ac51(++_0xce6382);}(_0x9879,0x98));var _0x9987=function(_0x4ceef7,_0x526d8e){_0x4ceef7=_0x4ceef7-0x0;var _0x385b02=_0x9879[_0x4ceef7];return _0x385b02;};'use strict';var multer=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var path=require(_0x9987('0x2'));var timeout=require('connect-timeout');var express=require(_0x9987('0x3'));var router=express['Router']();var fs_extra=require(_0x9987('0x4'));var auth=require(_0x9987('0x5'));var interaction=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var controller=require(_0x9987('0x8'));router[_0x9987('0x9')]('/',auth[_0x9987('0xa')](),controller['index']);router[_0x9987('0x9')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0xb')]);router[_0x9987('0xc')]('/',auth[_0x9987('0xa')](),controller[_0x9987('0xd')]);router[_0x9987('0xe')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x10')]);router[_0x9987('0x11')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x12')]);module[_0x9987('0x13')]=router;
\ No newline at end of file
+var _0xdf98=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf98,0xcf));var _0x8df9=function(_0x10e653,_0x59f1cc){_0x10e653=_0x10e653-0x0;var _0x328dfd=_0xdf98[_0x10e653];return _0x328dfd;};'use strict';var multer=require(_0x8df9('0x0'));var util=require('util');var path=require(_0x8df9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8df9('0x2')]();var fs_extra=require(_0x8df9('0x3'));var auth=require(_0x8df9('0x4'));var interaction=require(_0x8df9('0x5'));var config=require(_0x8df9('0x6'));var controller=require(_0x8df9('0x7'));router[_0x8df9('0x8')]('/',auth[_0x8df9('0x9')](),controller[_0x8df9('0xa')]);router['get'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8df9('0xd')]);router['put'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xe')]);router[_0x8df9('0xf')](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0x10')]);module[_0x8df9('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a5059bd..69a30cb 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe578=['sequelize','exports','TEXT'];(function(_0x22dcaa,_0x7e9f63){var _0x1d991b=function(_0x179ef9){while(--_0x179ef9){_0x22dcaa['push'](_0x22dcaa['shift']());}};_0x1d991b(++_0x7e9f63);}(_0xe578,0xd5));var _0x8e57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe578[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8e57('0x0'));module[_0x8e57('0x1')]={'tree':{'type':Sequelize[_0x8e57('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xce0a=['TEXT','sequelize'];(function(_0x2d6498,_0x16b741){var _0x5398a8=function(_0x104458){while(--_0x104458){_0x2d6498['push'](_0x2d6498['shift']());}};_0x5398a8(++_0x16b741);}(_0xce0a,0xc1));var _0xace0=function(_0x2a1e2d,_0x195473){_0x2a1e2d=_0x2a1e2d-0x0;var _0x32b8cc=_0xce0a[_0x2a1e2d];return _0x32b8cc;};'use strict';var Sequelize=require(_0xace0('0x0'));module['exports']={'tree':{'type':Sequelize[_0xace0('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 1ed8b8a..88448a6 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 _0x0935=['VIRTUAL','options','includeAll','findAll','catch','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map'];(function(_0x403987,_0x38e1f8){var _0x4b900f=function(_0x21f5b8){while(--_0x21f5b8){_0x403987['push'](_0x403987['shift']());}};_0x4b900f(++_0x38e1f8);}(_0x0935,0x16d));var _0x5093=function(_0x410a16,_0x2f9f5f){_0x410a16=_0x410a16-0x0;var _0x21199a=_0x0935[_0x410a16];return _0x21199a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5093('0x0'));var zipdir=require(_0x5093('0x1'));var jsonpatch=require(_0x5093('0x2'));var rp=require(_0x5093('0x3'));var moment=require(_0x5093('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5093('0x5'));var util=require(_0x5093('0x6'));var path=require(_0x5093('0x7'));var sox=require('sox');var csv=require(_0x5093('0x8'));var ejs=require(_0x5093('0x9'));var fs=require('fs');var fs_extra=require(_0x5093('0xa'));var _=require(_0x5093('0xb'));var squel=require(_0x5093('0xc'));var crypto=require(_0x5093('0xd'));var jsforce=require(_0x5093('0xe'));var deskjs=require(_0x5093('0xf'));var toCsv=require(_0x5093('0x8'));var querystring=require('querystring');var Papa=require(_0x5093('0x10'));var Redis=require(_0x5093('0x11'));var authService=require(_0x5093('0x12'));var qs=require(_0x5093('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5093('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5093('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5093('0x16'))['db'];function respondWithStatusCode(_0x3df08a,_0x4f2f09){_0x4f2f09=_0x4f2f09||0xcc;return function(_0xdeefd1){if(_0xdeefd1){return _0x3df08a[_0x5093('0x17')](_0x4f2f09);}return _0x3df08a[_0x5093('0x18')](_0x4f2f09)[_0x5093('0x19')]();};}function respondWithResult(_0x2a3f85,_0x3576c7){_0x3576c7=_0x3576c7||0xc8;return function(_0xff92c9){if(_0xff92c9){return _0x2a3f85[_0x5093('0x18')](_0x3576c7)['json'](_0xff92c9);}};}function respondWithFilteredResult(_0x1588cb,_0x1a5025){return function(_0x255072){if(_0x255072){var _0x389de3=typeof _0x1a5025[_0x5093('0x1a')]===_0x5093('0x1b')&&typeof _0x1a5025[_0x5093('0x1c')]===_0x5093('0x1b');var _0x570d2f=_0x255072[_0x5093('0x1d')];var _0x298fa4=_0x389de3?0x0:_0x1a5025[_0x5093('0x1a')];var _0x57a9ff=_0x389de3?_0x255072[_0x5093('0x1d')]:_0x1a5025[_0x5093('0x1a')]+_0x1a5025[_0x5093('0x1c')];var _0x284a77;if(_0x57a9ff>=_0x570d2f){_0x57a9ff=_0x570d2f;_0x284a77=0xc8;}else{_0x284a77=0xce;}_0x1588cb[_0x5093('0x18')](_0x284a77);return _0x1588cb['set'](_0x5093('0x1e'),_0x298fa4+'-'+_0x57a9ff+'/'+_0x570d2f)[_0x5093('0x1f')](_0x255072);}return null;};}function patchUpdates(_0x4be9f1){return function(_0x1b6570){try{jsonpatch[_0x5093('0x20')](_0x1b6570,_0x4be9f1,!![]);}catch(_0x24a0de){return BPromise[_0x5093('0x21')](_0x24a0de);}return _0x1b6570['save']();};}function saveUpdates(_0x50eb3a,_0xff069f){return function(_0xee40fd){if(_0xee40fd){return _0xee40fd[_0x5093('0x22')](_0x50eb3a)[_0x5093('0x23')](function(_0x4a515b){return _0x4a515b;});}return null;};}function removeEntity(_0x2e6dda,_0x374c3d){return function(_0x3a70c6){if(_0x3a70c6){return _0x3a70c6[_0x5093('0x24')]()[_0x5093('0x23')](function(){_0x2e6dda['status'](0xcc)[_0x5093('0x19')]();});}};}function handleEntityNotFound(_0x46b13f,_0x390a72){return function(_0x3de267){if(!_0x3de267){_0x46b13f[_0x5093('0x17')](0x194);}return _0x3de267;};}function handleError(_0x8853d9,_0x23808a){_0x23808a=_0x23808a||0x1f4;return function(_0x9928ac){logger[_0x5093('0x25')](_0x9928ac[_0x5093('0x26')]);if(_0x9928ac[_0x5093('0x27')]){delete _0x9928ac[_0x5093('0x27')];}_0x8853d9[_0x5093('0x18')](_0x23808a)[_0x5093('0x28')](_0x9928ac);};}exports[_0x5093('0x29')]=function(_0x2fde7b,_0x1edb29){var _0x4af1b5={},_0x145ea2={},_0x2eb5dd={'count':0x0,'rows':[]};var _0x55a3f5=_['map'](db[_0x5093('0x2a')][_0x5093('0x2b')],function(_0x4f9163){return{'name':_0x4f9163['fieldName'],'type':_0x4f9163[_0x5093('0x2c')][_0x5093('0x2d')]};});_0x145ea2[_0x5093('0x2e')]=_['map'](_0x55a3f5,_0x5093('0x27'));_0x145ea2[_0x5093('0x2f')]=_[_0x5093('0x30')](_0x2fde7b[_0x5093('0x2f')]);_0x145ea2[_0x5093('0x31')]=_[_0x5093('0x32')](_0x145ea2['model'],_0x145ea2[_0x5093('0x2f')]);_0x4af1b5[_0x5093('0x33')]=_[_0x5093('0x32')](_0x145ea2[_0x5093('0x2e')],qs[_0x5093('0x34')](_0x2fde7b[_0x5093('0x2f')][_0x5093('0x34')]));_0x4af1b5['attributes']=_0x4af1b5['attributes'][_0x5093('0x35')]?_0x4af1b5[_0x5093('0x33')]:_0x145ea2[_0x5093('0x2e')];if(!_0x2fde7b[_0x5093('0x2f')]['hasOwnProperty'](_0x5093('0x36'))){_0x4af1b5[_0x5093('0x1c')]=qs[_0x5093('0x1c')](_0x2fde7b['query']['limit']);_0x4af1b5[_0x5093('0x1a')]=qs[_0x5093('0x1a')](_0x2fde7b[_0x5093('0x2f')]['offset']);}_0x4af1b5[_0x5093('0x37')]=qs[_0x5093('0x38')](_0x2fde7b['query'][_0x5093('0x38')]);_0x4af1b5[_0x5093('0x39')]=qs[_0x5093('0x31')](_['pick'](_0x2fde7b[_0x5093('0x2f')],_0x145ea2[_0x5093('0x31')]),_0x55a3f5);if(_0x2fde7b[_0x5093('0x2f')][_0x5093('0x3a')]){_0x4af1b5[_0x5093('0x39')]=_[_0x5093('0x3b')](_0x4af1b5[_0x5093('0x39')],{'$or':_[_0x5093('0x3c')](_0x55a3f5,function(_0x3c1e0c){if(_0x3c1e0c[_0x5093('0x2c')]!==_0x5093('0x3d')){var _0xa83df7={};_0xa83df7[_0x3c1e0c[_0x5093('0x27')]]={'$like':'%'+_0x2fde7b['query'][_0x5093('0x3a')]+'%'};return _0xa83df7;}})});}_0x4af1b5=_['merge']({},_0x4af1b5,_0x2fde7b[_0x5093('0x3e')]);var _0x31795c={'where':_0x4af1b5[_0x5093('0x39')]};return db[_0x5093('0x2a')]['count'](_0x31795c)[_0x5093('0x23')](function(_0xf92349){_0x2eb5dd[_0x5093('0x1d')]=_0xf92349;if(_0x2fde7b[_0x5093('0x2f')][_0x5093('0x3f')]){_0x4af1b5['include']=[{'all':!![]}];}return db[_0x5093('0x2a')][_0x5093('0x40')](_0x4af1b5);})[_0x5093('0x23')](function(_0x1d823b){_0x2eb5dd['rows']=_0x1d823b;return _0x2eb5dd;})[_0x5093('0x23')](respondWithFilteredResult(_0x1edb29,_0x4af1b5))[_0x5093('0x41')](handleError(_0x1edb29,null));};exports['show']=function(_0x535898,_0x2ca3ea){var _0x1f1bec={'raw':!![],'where':{'id':_0x535898['params']['id']}},_0x1387e6={};_0x1387e6['model']=_[_0x5093('0x30')](db[_0x5093('0x2a')][_0x5093('0x2b')]);_0x1387e6['query']=_['keys'](_0x535898[_0x5093('0x2f')]);_0x1387e6['filters']=_[_0x5093('0x32')](_0x1387e6[_0x5093('0x2e')],_0x1387e6[_0x5093('0x2f')]);_0x1f1bec['attributes']=_[_0x5093('0x32')](_0x1387e6['model'],qs[_0x5093('0x34')](_0x535898['query'][_0x5093('0x34')]));_0x1f1bec[_0x5093('0x33')]=_0x1f1bec[_0x5093('0x33')][_0x5093('0x35')]?_0x1f1bec[_0x5093('0x33')]:_0x1387e6[_0x5093('0x2e')];if(_0x535898[_0x5093('0x2f')]['includeAll']){_0x1f1bec[_0x5093('0x42')]=[{'all':!![]}];}_0x1f1bec=_[_0x5093('0x3b')]({},_0x1f1bec,_0x535898[_0x5093('0x3e')]);return db['AnalyticTreeReport'][_0x5093('0x43')](_0x1f1bec)['then'](handleEntityNotFound(_0x2ca3ea,null))[_0x5093('0x23')](respondWithResult(_0x2ca3ea,null))[_0x5093('0x41')](handleError(_0x2ca3ea,null));};exports['create']=function(_0x6f94a,_0x7bb1ab){return db[_0x5093('0x2a')][_0x5093('0x44')](_0x6f94a[_0x5093('0x45')],{})[_0x5093('0x23')](respondWithResult(_0x7bb1ab,0xc9))[_0x5093('0x41')](handleError(_0x7bb1ab,null));};exports[_0x5093('0x22')]=function(_0x4fd6a9,_0x1712d2){if(_0x4fd6a9[_0x5093('0x45')]['id']){delete _0x4fd6a9[_0x5093('0x45')]['id'];}return db[_0x5093('0x2a')][_0x5093('0x43')]({'where':{'id':_0x4fd6a9[_0x5093('0x46')]['id']}})['then'](handleEntityNotFound(_0x1712d2,null))[_0x5093('0x23')](saveUpdates(_0x4fd6a9[_0x5093('0x45')],null))[_0x5093('0x23')](respondWithResult(_0x1712d2,null))[_0x5093('0x41')](handleError(_0x1712d2,null));};exports['destroy']=function(_0x21b60c,_0x30aab0){return db[_0x5093('0x2a')][_0x5093('0x43')]({'where':{'id':_0x21b60c[_0x5093('0x46')]['id']}})[_0x5093('0x23')](handleEntityNotFound(_0x30aab0,null))[_0x5093('0x23')](removeEntity(_0x30aab0,null))[_0x5093('0x41')](handleError(_0x30aab0,null));};
\ No newline at end of file
+var _0xfb75=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','name','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x177225,_0x2476b5){var _0x5d6a65=function(_0x3b98f1){while(--_0x3b98f1){_0x177225['push'](_0x177225['shift']());}};_0x5d6a65(++_0x2476b5);}(_0xfb75,0x1f3));var _0x5fb7=function(_0x448d4f,_0x1d4201){_0x448d4f=_0x448d4f-0x0;var _0x156d90=_0xfb75[_0x448d4f];return _0x156d90;};'use strict';var emlformat=require(_0x5fb7('0x0'));var rimraf=require(_0x5fb7('0x1'));var zipdir=require(_0x5fb7('0x2'));var jsonpatch=require(_0x5fb7('0x3'));var rp=require(_0x5fb7('0x4'));var moment=require(_0x5fb7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fb7('0x6'));var util=require(_0x5fb7('0x7'));var path=require(_0x5fb7('0x8'));var sox=require(_0x5fb7('0x9'));var csv=require(_0x5fb7('0xa'));var ejs=require(_0x5fb7('0xb'));var fs=require('fs');var fs_extra=require(_0x5fb7('0xc'));var _=require(_0x5fb7('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5fb7('0xe'));var Redis=require(_0x5fb7('0xf'));var authService=require(_0x5fb7('0x10'));var qs=require(_0x5fb7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fb7('0x12'));var logger=require(_0x5fb7('0x13'))(_0x5fb7('0x14'));var utils=require('../../config/utils');var config=require(_0x5fb7('0x15'));var licenseUtil=require(_0x5fb7('0x16'));var db=require(_0x5fb7('0x17'))['db'];function respondWithStatusCode(_0x18641f,_0xeea3e4){_0xeea3e4=_0xeea3e4||0xcc;return function(_0xf002e1){if(_0xf002e1){return _0x18641f[_0x5fb7('0x18')](_0xeea3e4);}return _0x18641f['status'](_0xeea3e4)['end']();};}function respondWithResult(_0x1d3e62,_0xa86ecb){_0xa86ecb=_0xa86ecb||0xc8;return function(_0x3e1a9d){if(_0x3e1a9d){return _0x1d3e62[_0x5fb7('0x19')](_0xa86ecb)[_0x5fb7('0x1a')](_0x3e1a9d);}};}function respondWithFilteredResult(_0x1aac89,_0x5d6a6e){return function(_0x543b31){if(_0x543b31){var _0x2ee629=typeof _0x5d6a6e[_0x5fb7('0x1b')]===_0x5fb7('0x1c')&&typeof _0x5d6a6e['limit']===_0x5fb7('0x1c');var _0x4cd2f5=_0x543b31[_0x5fb7('0x1d')];var _0x21f698=_0x2ee629?0x0:_0x5d6a6e['offset'];var _0x251b28=_0x2ee629?_0x543b31['count']:_0x5d6a6e[_0x5fb7('0x1b')]+_0x5d6a6e['limit'];var _0x955a7f;if(_0x251b28>=_0x4cd2f5){_0x251b28=_0x4cd2f5;_0x955a7f=0xc8;}else{_0x955a7f=0xce;}_0x1aac89[_0x5fb7('0x19')](_0x955a7f);return _0x1aac89[_0x5fb7('0x1e')](_0x5fb7('0x1f'),_0x21f698+'-'+_0x251b28+'/'+_0x4cd2f5)[_0x5fb7('0x1a')](_0x543b31);}return null;};}function patchUpdates(_0x3a4192){return function(_0x83591b){try{jsonpatch[_0x5fb7('0x20')](_0x83591b,_0x3a4192,!![]);}catch(_0x31abe1){return BPromise['reject'](_0x31abe1);}return _0x83591b[_0x5fb7('0x21')]();};}function saveUpdates(_0x54cc12,_0x23bbfb){return function(_0x1c45e4){if(_0x1c45e4){return _0x1c45e4[_0x5fb7('0x22')](_0x54cc12)[_0x5fb7('0x23')](function(_0xe4e96f){return _0xe4e96f;});}return null;};}function removeEntity(_0x52c9ba,_0x3cbc33){return function(_0x7026b2){if(_0x7026b2){return _0x7026b2[_0x5fb7('0x24')]()['then'](function(){_0x52c9ba[_0x5fb7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e7e9,_0x4de460){return function(_0x285bd6){if(!_0x285bd6){_0x41e7e9[_0x5fb7('0x18')](0x194);}return _0x285bd6;};}function handleError(_0x284054,_0x245f97){_0x245f97=_0x245f97||0x1f4;return function(_0xb11f33){logger[_0x5fb7('0x25')](_0xb11f33[_0x5fb7('0x26')]);if(_0xb11f33['name']){delete _0xb11f33['name'];}_0x284054[_0x5fb7('0x19')](_0x245f97)[_0x5fb7('0x27')](_0xb11f33);};}exports['index']=function(_0x2dcbae,_0x2c3e39){var _0x1d6447={},_0x4e62ff={},_0x4247f5={'count':0x0,'rows':[]};var _0x1e91f1=_[_0x5fb7('0x28')](db[_0x5fb7('0x29')][_0x5fb7('0x2a')],function(_0x445f09){return{'name':_0x445f09[_0x5fb7('0x2b')],'type':_0x445f09[_0x5fb7('0x2c')][_0x5fb7('0x2d')]};});_0x4e62ff[_0x5fb7('0x2e')]=_[_0x5fb7('0x28')](_0x1e91f1,'name');_0x4e62ff['query']=_[_0x5fb7('0x2f')](_0x2dcbae[_0x5fb7('0x30')]);_0x4e62ff['filters']=_[_0x5fb7('0x31')](_0x4e62ff[_0x5fb7('0x2e')],_0x4e62ff['query']);_0x1d6447[_0x5fb7('0x32')]=_[_0x5fb7('0x31')](_0x4e62ff[_0x5fb7('0x2e')],qs[_0x5fb7('0x33')](_0x2dcbae['query'][_0x5fb7('0x33')]));_0x1d6447[_0x5fb7('0x32')]=_0x1d6447[_0x5fb7('0x32')]['length']?_0x1d6447[_0x5fb7('0x32')]:_0x4e62ff[_0x5fb7('0x2e')];if(!_0x2dcbae['query'][_0x5fb7('0x34')](_0x5fb7('0x35'))){_0x1d6447[_0x5fb7('0x36')]=qs['limit'](_0x2dcbae[_0x5fb7('0x30')]['limit']);_0x1d6447[_0x5fb7('0x1b')]=qs[_0x5fb7('0x1b')](_0x2dcbae[_0x5fb7('0x30')]['offset']);}_0x1d6447[_0x5fb7('0x37')]=qs['sort'](_0x2dcbae[_0x5fb7('0x30')][_0x5fb7('0x38')]);_0x1d6447[_0x5fb7('0x39')]=qs[_0x5fb7('0x3a')](_[_0x5fb7('0x3b')](_0x2dcbae['query'],_0x4e62ff[_0x5fb7('0x3a')]),_0x1e91f1);if(_0x2dcbae[_0x5fb7('0x30')]['filter']){_0x1d6447[_0x5fb7('0x39')]=_[_0x5fb7('0x3c')](_0x1d6447[_0x5fb7('0x39')],{'$or':_[_0x5fb7('0x28')](_0x1e91f1,function(_0x1a04c6){if(_0x1a04c6[_0x5fb7('0x2c')]!==_0x5fb7('0x3d')){var _0x3efb47={};_0x3efb47[_0x1a04c6[_0x5fb7('0x3e')]]={'$like':'%'+_0x2dcbae[_0x5fb7('0x30')][_0x5fb7('0x3f')]+'%'};return _0x3efb47;}})});}_0x1d6447=_['merge']({},_0x1d6447,_0x2dcbae[_0x5fb7('0x40')]);var _0x320704={'where':_0x1d6447[_0x5fb7('0x39')]};return db[_0x5fb7('0x29')][_0x5fb7('0x1d')](_0x320704)[_0x5fb7('0x23')](function(_0x171120){_0x4247f5[_0x5fb7('0x1d')]=_0x171120;if(_0x2dcbae[_0x5fb7('0x30')]['includeAll']){_0x1d6447[_0x5fb7('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x5fb7('0x42')](_0x1d6447);})[_0x5fb7('0x23')](function(_0x24e2b5){_0x4247f5['rows']=_0x24e2b5;return _0x4247f5;})[_0x5fb7('0x23')](respondWithFilteredResult(_0x2c3e39,_0x1d6447))[_0x5fb7('0x43')](handleError(_0x2c3e39,null));};exports[_0x5fb7('0x44')]=function(_0xa5d8af,_0x34b278){var _0xec72f={'raw':!![],'where':{'id':_0xa5d8af[_0x5fb7('0x45')]['id']}},_0x51dad3={};_0x51dad3[_0x5fb7('0x2e')]=_['keys'](db['AnalyticTreeReport'][_0x5fb7('0x2a')]);_0x51dad3['query']=_[_0x5fb7('0x2f')](_0xa5d8af[_0x5fb7('0x30')]);_0x51dad3[_0x5fb7('0x3a')]=_[_0x5fb7('0x31')](_0x51dad3[_0x5fb7('0x2e')],_0x51dad3[_0x5fb7('0x30')]);_0xec72f['attributes']=_['intersection'](_0x51dad3[_0x5fb7('0x2e')],qs['fields'](_0xa5d8af['query']['fields']));_0xec72f[_0x5fb7('0x32')]=_0xec72f[_0x5fb7('0x32')]['length']?_0xec72f['attributes']:_0x51dad3['model'];if(_0xa5d8af['query'][_0x5fb7('0x46')]){_0xec72f[_0x5fb7('0x41')]=[{'all':!![]}];}_0xec72f=_[_0x5fb7('0x3c')]({},_0xec72f,_0xa5d8af[_0x5fb7('0x40')]);return db[_0x5fb7('0x29')][_0x5fb7('0x47')](_0xec72f)[_0x5fb7('0x23')](handleEntityNotFound(_0x34b278,null))[_0x5fb7('0x23')](respondWithResult(_0x34b278,null))[_0x5fb7('0x43')](handleError(_0x34b278,null));};exports[_0x5fb7('0x48')]=function(_0x1edf63,_0x5078b4){return db[_0x5fb7('0x29')][_0x5fb7('0x48')](_0x1edf63[_0x5fb7('0x49')],{})[_0x5fb7('0x23')](respondWithResult(_0x5078b4,0xc9))['catch'](handleError(_0x5078b4,null));};exports[_0x5fb7('0x22')]=function(_0x277df3,_0xcb5e17){if(_0x277df3[_0x5fb7('0x49')]['id']){delete _0x277df3[_0x5fb7('0x49')]['id'];}return db[_0x5fb7('0x29')][_0x5fb7('0x47')]({'where':{'id':_0x277df3[_0x5fb7('0x45')]['id']}})['then'](handleEntityNotFound(_0xcb5e17,null))['then'](saveUpdates(_0x277df3['body'],null))[_0x5fb7('0x23')](respondWithResult(_0xcb5e17,null))[_0x5fb7('0x43')](handleError(_0xcb5e17,null));};exports[_0x5fb7('0x24')]=function(_0x4cebca,_0x188d8b){return db[_0x5fb7('0x29')]['find']({'where':{'id':_0x4cebca[_0x5fb7('0x45')]['id']}})[_0x5fb7('0x23')](handleEntityNotFound(_0x188d8b,null))[_0x5fb7('0x23')](removeEntity(_0x188d8b,null))[_0x5fb7('0x43')](handleError(_0x188d8b,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 1efc10e..3443de4 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 _0xed3b=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0xed3b,0x68));var _0xbed3=function(_0xab4668,_0x2419f3){_0xab4668=_0xab4668-0x0;var _0x19410d=_0xed3b[_0xab4668];return _0x19410d;};'use strict';var _=require(_0xbed3('0x0'));var util=require(_0xbed3('0x1'));var logger=require('../../config/logger')(_0xbed3('0x2'));var moment=require(_0xbed3('0x3'));var BPromise=require(_0xbed3('0x4'));var rp=require(_0xbed3('0x5'));var fs=require('fs');var path=require(_0xbed3('0x6'));var rimraf=require(_0xbed3('0x7'));var config=require(_0xbed3('0x8'));var attributes=require(_0xbed3('0x9'));module[_0xbed3('0xa')]=function(_0x502b34,_0x2243e8){return _0x502b34[_0xbed3('0xb')](_0xbed3('0xc'),attributes,{'tableName':_0xbed3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7b0=['analytics_report_trees','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport'];(function(_0x35fccf,_0x3cad3b){var _0x58831a=function(_0x59faa4){while(--_0x59faa4){_0x35fccf['push'](_0x35fccf['shift']());}};_0x58831a(++_0x3cad3b);}(_0xa7b0,0xa1));var _0x0a7b=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0xa7b0[_0x49beea];return _0x27693a;};'use strict';var _=require(_0x0a7b('0x0'));var util=require('util');var logger=require(_0x0a7b('0x1'))(_0x0a7b('0x2'));var moment=require('moment');var BPromise=require(_0x0a7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a7b('0x4'));var rimraf=require(_0x0a7b('0x5'));var config=require(_0x0a7b('0x6'));var attributes=require(_0x0a7b('0x7'));module['exports']=function(_0x3a59a5,_0x9df57f){return _0x3a59a5['define'](_0x0a7b('0x8'),attributes,{'tableName':_0x0a7b('0x9'),'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 a2f2211..99c1642 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5bb9ac,_0x417c09){var _0x38fd65=function(_0x17b739){while(--_0x17b739){_0x5bb9ac['push'](_0x5bb9ac['shift']());}};_0x38fd65(++_0x417c09);}(_0xadb5,0xad));var _0x5adb=function(_0x41e1ed,_0x336b60){_0x41e1ed=_0x41e1ed-0x0;var _0x34c3d7=_0xadb5[_0x41e1ed];return _0x34c3d7;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xc352bd,_0x312795){var _0x10e333=function(_0x9fc6bd){while(--_0x9fc6bd){_0xc352bd['push'](_0xc352bd['shift']());}};_0x10e333(++_0x312795);}(_0xadb5,0xad));var _0x5adb=function(_0x28813c,_0xce074e){_0x28813c=_0x28813c-0x0;var _0x4cd4bb=_0xadb5[_0x28813c];return _0x4cd4bb;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a8505c9..54fcec6 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 _0xaf09=['/:id','show','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index'];(function(_0x3fcab0,_0x5874eb){var _0x1fa5de=function(_0x1ceb06){while(--_0x1ceb06){_0x3fcab0['push'](_0x3fcab0['shift']());}};_0x1fa5de(++_0x5874eb);}(_0xaf09,0x10f));var _0x9af0=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xaf09[_0x16de68];return _0x1c277e;};'use strict';var multer=require('multer');var util=require(_0x9af0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9af0('0x1'));var router=express[_0x9af0('0x2')]();var fs_extra=require(_0x9af0('0x3'));var auth=require(_0x9af0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9af0('0x5'));var controller=require(_0x9af0('0x6'));router['get']('/',auth[_0x9af0('0x7')](),controller[_0x9af0('0x8')]);router['get'](_0x9af0('0x9'),auth[_0x9af0('0x7')](),controller[_0x9af0('0xa')]);router['post']('/',auth[_0x9af0('0x7')](),controller['create']);router['put'](_0x9af0('0x9'),auth[_0x9af0('0x7')](),controller['update']);router[_0x9af0('0xb')]('/:id',auth[_0x9af0('0x7')](),controller[_0x9af0('0xc')]);module[_0x9af0('0xd')]=router;
\ No newline at end of file
+var _0x2ad4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','post','create','put','delete','destroy'];(function(_0x5d1566,_0x3fed4b){var _0x3441a2=function(_0x57c3fe){while(--_0x57c3fe){_0x5d1566['push'](_0x5d1566['shift']());}};_0x3441a2(++_0x3fed4b);}(_0x2ad4,0x12d));var _0x42ad=function(_0x2de81b,_0x322f1d){_0x2de81b=_0x2de81b-0x0;var _0x3df553=_0x2ad4[_0x2de81b];return _0x3df553;};'use strict';var multer=require(_0x42ad('0x0'));var util=require(_0x42ad('0x1'));var path=require(_0x42ad('0x2'));var timeout=require(_0x42ad('0x3'));var express=require(_0x42ad('0x4'));var router=express[_0x42ad('0x5')]();var fs_extra=require(_0x42ad('0x6'));var auth=require(_0x42ad('0x7'));var interaction=require(_0x42ad('0x8'));var config=require(_0x42ad('0x9'));var controller=require(_0x42ad('0xa'));router['get']('/',auth[_0x42ad('0xb')](),controller[_0x42ad('0xc')]);router['get'](_0x42ad('0xd'),auth[_0x42ad('0xb')](),controller['show']);router[_0x42ad('0xe')]('/',auth['isAuthenticated'](),controller[_0x42ad('0xf')]);router[_0x42ad('0x10')](_0x42ad('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x42ad('0x11')](_0x42ad('0xd'),auth[_0x42ad('0xb')](),controller[_0x42ad('0x12')]);module[_0x42ad('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 6cbbe82..0d242d7 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 _0x5636=['sequelize','exports'];(function(_0x5abdef,_0x5ac510){var _0x1c2c1c=function(_0x3032a2){while(--_0x3032a2){_0x5abdef['push'](_0x5abdef['shift']());}};_0x1c2c1c(++_0x5ac510);}(_0x5636,0x102));var _0x6563=function(_0x53c82d,_0x12eaba){_0x53c82d=_0x53c82d-0x0;var _0x300e93=_0x5636[_0x53c82d];return _0x300e93;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x56e6=['exports','STRING','sequelize'];(function(_0x36140c,_0x5190e7){var _0x128ddd=function(_0x1be27b){while(--_0x1be27b){_0x36140c['push'](_0x36140c['shift']());}};_0x128ddd(++_0x5190e7);}(_0x56e6,0x6b));var _0x656e=function(_0x5476c8,_0x12cc06){_0x5476c8=_0x5476c8-0x0;var _0x4e3bac=_0x56e6[_0x5476c8];return _0x4e3bac;};'use strict';var Sequelize=require(_0x656e('0x0'));module[_0x656e('0x1')]={'name':{'type':Sequelize[_0x656e('0x2')]},'basename':{'type':Sequelize[_0x656e('0x2')]},'type':{'type':Sequelize[_0x656e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9c75ddb..9722e8c 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 _0xea2a=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','catch','show','params','include','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea2a,0xa7));var _0xaea2=function(_0x3496bb,_0x53ab1b){_0x3496bb=_0x3496bb-0x0;var _0x41aa58=_0xea2a[_0x3496bb];return _0x41aa58;};'use strict';var emlformat=require(_0xaea2('0x0'));var rimraf=require(_0xaea2('0x1'));var zipdir=require(_0xaea2('0x2'));var jsonpatch=require(_0xaea2('0x3'));var rp=require(_0xaea2('0x4'));var moment=require(_0xaea2('0x5'));var BPromise=require(_0xaea2('0x6'));var Mustache=require(_0xaea2('0x7'));var util=require(_0xaea2('0x8'));var path=require(_0xaea2('0x9'));var sox=require(_0xaea2('0xa'));var csv=require(_0xaea2('0xb'));var ejs=require(_0xaea2('0xc'));var fs=require('fs');var fs_extra=require(_0xaea2('0xd'));var _=require('lodash');var squel=require(_0xaea2('0xe'));var crypto=require(_0xaea2('0xf'));var jsforce=require(_0xaea2('0x10'));var deskjs=require(_0xaea2('0x11'));var toCsv=require(_0xaea2('0xb'));var querystring=require(_0xaea2('0x12'));var Papa=require(_0xaea2('0x13'));var Redis=require(_0xaea2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xaea2('0x15'));var as=require(_0xaea2('0x16'));var hardwareService=require(_0xaea2('0x17'));var logger=require('../../config/logger')(_0xaea2('0x18'));var utils=require('../../config/utils');var config=require(_0xaea2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaea2('0x1a'))['db'];function respondWithStatusCode(_0x167ba7,_0x4986b1){_0x4986b1=_0x4986b1||0xcc;return function(_0x2a6815){if(_0x2a6815){return _0x167ba7[_0xaea2('0x1b')](_0x4986b1);}return _0x167ba7[_0xaea2('0x1c')](_0x4986b1)[_0xaea2('0x1d')]();};}function respondWithResult(_0x27ba2d,_0x68d596){_0x68d596=_0x68d596||0xc8;return function(_0x54a280){if(_0x54a280){return _0x27ba2d[_0xaea2('0x1c')](_0x68d596)['json'](_0x54a280);}};}function respondWithFilteredResult(_0x3354c0,_0x3509de){return function(_0x33b614){if(_0x33b614){var _0x3ddf50=typeof _0x3509de[_0xaea2('0x1e')]===_0xaea2('0x1f')&&typeof _0x3509de[_0xaea2('0x20')]==='undefined';var _0x5a4ebf=_0x33b614['count'];var _0x43c367=_0x3ddf50?0x0:_0x3509de[_0xaea2('0x1e')];var _0x2b0734=_0x3ddf50?_0x33b614[_0xaea2('0x21')]:_0x3509de[_0xaea2('0x1e')]+_0x3509de['limit'];var _0xb104d3;if(_0x2b0734>=_0x5a4ebf){_0x2b0734=_0x5a4ebf;_0xb104d3=0xc8;}else{_0xb104d3=0xce;}_0x3354c0[_0xaea2('0x1c')](_0xb104d3);return _0x3354c0[_0xaea2('0x22')]('Content-Range',_0x43c367+'-'+_0x2b0734+'/'+_0x5a4ebf)[_0xaea2('0x23')](_0x33b614);}return null;};}function patchUpdates(_0x4f4a72){return function(_0x19863b){try{jsonpatch[_0xaea2('0x24')](_0x19863b,_0x4f4a72,!![]);}catch(_0x5b3e6f){return BPromise[_0xaea2('0x25')](_0x5b3e6f);}return _0x19863b[_0xaea2('0x26')]();};}function saveUpdates(_0x14a1f4,_0x4b12c0){return function(_0x5160a9){if(_0x5160a9){return _0x5160a9[_0xaea2('0x27')](_0x14a1f4)[_0xaea2('0x28')](function(_0x228f7f){return _0x228f7f;});}return null;};}function removeEntity(_0x333091,_0x36bfda){return function(_0x5b3bea){if(_0x5b3bea){return _0x5b3bea[_0xaea2('0x29')]()[_0xaea2('0x28')](function(){_0x333091['status'](0xcc)[_0xaea2('0x1d')]();});}};}function handleEntityNotFound(_0xf0df98,_0x43375e){return function(_0x2ffe73){if(!_0x2ffe73){_0xf0df98[_0xaea2('0x1b')](0x194);}return _0x2ffe73;};}function handleError(_0x467812,_0x148622){_0x148622=_0x148622||0x1f4;return function(_0x437be6){logger['error'](_0x437be6[_0xaea2('0x2a')]);if(_0x437be6[_0xaea2('0x2b')]){delete _0x437be6[_0xaea2('0x2b')];}_0x467812[_0xaea2('0x1c')](_0x148622)[_0xaea2('0x2c')](_0x437be6);};}exports[_0xaea2('0x2d')]=function(_0xc2c58f,_0x468f26){var _0x1dffd1={},_0x2b5bc4={},_0x36a077={'count':0x0,'rows':[]};var _0x348549=_[_0xaea2('0x2e')](db[_0xaea2('0x2f')][_0xaea2('0x30')],function(_0x37197b){return{'name':_0x37197b[_0xaea2('0x31')],'type':_0x37197b[_0xaea2('0x32')][_0xaea2('0x33')]};});_0x2b5bc4[_0xaea2('0x34')]=_[_0xaea2('0x2e')](_0x348549,_0xaea2('0x2b'));_0x2b5bc4[_0xaea2('0x35')]=_[_0xaea2('0x36')](_0xc2c58f['query']);_0x2b5bc4['filters']=_[_0xaea2('0x37')](_0x2b5bc4[_0xaea2('0x34')],_0x2b5bc4[_0xaea2('0x35')]);_0x1dffd1[_0xaea2('0x38')]=_['intersection'](_0x2b5bc4['model'],qs['fields'](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x39')]));_0x1dffd1[_0xaea2('0x38')]=_0x1dffd1[_0xaea2('0x38')][_0xaea2('0x3a')]?_0x1dffd1['attributes']:_0x2b5bc4[_0xaea2('0x34')];if(!_0xc2c58f[_0xaea2('0x35')]['hasOwnProperty'](_0xaea2('0x3b'))){_0x1dffd1['limit']=qs[_0xaea2('0x20')](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x20')]);_0x1dffd1['offset']=qs[_0xaea2('0x1e')](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x1e')]);}_0x1dffd1[_0xaea2('0x3c')]=qs[_0xaea2('0x3d')](_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x3d')]);_0x1dffd1[_0xaea2('0x3e')]=qs[_0xaea2('0x3f')](_['pick'](_0xc2c58f[_0xaea2('0x35')],_0x2b5bc4['filters']),_0x348549);if(_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x40')]){_0x1dffd1[_0xaea2('0x3e')]=_['merge'](_0x1dffd1[_0xaea2('0x3e')],{'$or':_[_0xaea2('0x2e')](_0x348549,function(_0x25f824){if(_0x25f824[_0xaea2('0x32')]!==_0xaea2('0x41')){var _0x12d8b1={};_0x12d8b1[_0x25f824[_0xaea2('0x2b')]]={'$like':'%'+_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x40')]+'%'};return _0x12d8b1;}})});}_0x1dffd1=_[_0xaea2('0x42')]({},_0x1dffd1,_0xc2c58f[_0xaea2('0x43')]);var _0x15af3c={'where':_0x1dffd1[_0xaea2('0x3e')]};return db[_0xaea2('0x2f')][_0xaea2('0x21')](_0x15af3c)[_0xaea2('0x28')](function(_0x182734){_0x36a077[_0xaea2('0x21')]=_0x182734;if(_0xc2c58f[_0xaea2('0x35')][_0xaea2('0x44')]){_0x1dffd1['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1dffd1);})[_0xaea2('0x28')](function(_0xb51ab4){_0x36a077['rows']=_0xb51ab4;return _0x36a077;})[_0xaea2('0x28')](respondWithFilteredResult(_0x468f26,_0x1dffd1))[_0xaea2('0x45')](handleError(_0x468f26,null));};exports[_0xaea2('0x46')]=function(_0x5b7f54,_0x11eddf){var _0x3ba52c={'raw':!![],'where':{'id':_0x5b7f54[_0xaea2('0x47')]['id']}},_0x4ebb60={};_0x4ebb60[_0xaea2('0x34')]=_[_0xaea2('0x36')](db[_0xaea2('0x2f')][_0xaea2('0x30')]);_0x4ebb60['query']=_[_0xaea2('0x36')](_0x5b7f54[_0xaea2('0x35')]);_0x4ebb60['filters']=_[_0xaea2('0x37')](_0x4ebb60[_0xaea2('0x34')],_0x4ebb60[_0xaea2('0x35')]);_0x3ba52c['attributes']=_[_0xaea2('0x37')](_0x4ebb60[_0xaea2('0x34')],qs[_0xaea2('0x39')](_0x5b7f54['query'][_0xaea2('0x39')]));_0x3ba52c['attributes']=_0x3ba52c['attributes'][_0xaea2('0x3a')]?_0x3ba52c['attributes']:_0x4ebb60[_0xaea2('0x34')];if(_0x5b7f54[_0xaea2('0x35')]['includeAll']){_0x3ba52c[_0xaea2('0x48')]=[{'all':!![]}];}_0x3ba52c=_['merge']({},_0x3ba52c,_0x5b7f54[_0xaea2('0x43')]);return db[_0xaea2('0x2f')][_0xaea2('0x49')](_0x3ba52c)[_0xaea2('0x28')](handleEntityNotFound(_0x11eddf,null))[_0xaea2('0x28')](respondWithResult(_0x11eddf,null))[_0xaea2('0x45')](handleError(_0x11eddf,null));};exports[_0xaea2('0x4a')]=function(_0x5edcc6,_0x173b90){var _0x160843={'where':{'id':_0x5edcc6['params']['id']}},_0x4a8aa8={};_0x4a8aa8[_0xaea2('0x34')]=_[_0xaea2('0x36')](db[_0xaea2('0x2f')][_0xaea2('0x30')]);_0x160843[_0xaea2('0x38')]=_[_0xaea2('0x37')](_0x4a8aa8['model'],qs[_0xaea2('0x39')](_0x5edcc6[_0xaea2('0x35')][_0xaea2('0x39')]));_0x160843[_0xaea2('0x38')]=_0x160843[_0xaea2('0x38')][_0xaea2('0x3a')]?_0x160843[_0xaea2('0x38')]:_0x4a8aa8[_0xaea2('0x34')];if(_0x5edcc6['query'][_0xaea2('0x44')]){_0x160843[_0xaea2('0x48')]=[{'all':!![]}];}_0x160843=_[_0xaea2('0x42')]({},_0x160843,_0x5edcc6[_0xaea2('0x43')]);return db[_0xaea2('0x2f')][_0xaea2('0x49')](_0x160843)[_0xaea2('0x28')](handleEntityNotFound(_0x173b90,null))[_0xaea2('0x28')](function(_0x28557d){if(_0x28557d){var _0xf0c395=_0x28557d[_0xaea2('0x4b')]({'plain':!![]});_0xf0c395=qs[_0xaea2('0x4c')](_0xf0c395,['id',_0xaea2('0x4d'),_0xaea2('0x4e')]);_0x5edcc6[_0xaea2('0x4f')]=_[_0xaea2('0x4c')](_0x5edcc6['body'],['id',_0xaea2('0x4d'),_0xaea2('0x4e')]);return db['Attachment']['create'](_['merge'](_0xf0c395,_0x5edcc6[_0xaea2('0x4f')]),{'include':_0x5edcc6[_0xaea2('0x35')][_0xaea2('0x44')]?[{'all':!![]}]:undefined});}})[_0xaea2('0x28')](respondWithResult(_0x173b90,0xc9))[_0xaea2('0x45')](handleError(_0x173b90,null));};exports[_0xaea2('0x27')]=function(_0xe1bc15,_0x3fcce4){if(_0xe1bc15[_0xaea2('0x4f')]['id']){delete _0xe1bc15[_0xaea2('0x4f')]['id'];}return db[_0xaea2('0x2f')][_0xaea2('0x49')]({'where':{'id':_0xe1bc15['params']['id']}})[_0xaea2('0x28')](handleEntityNotFound(_0x3fcce4,null))[_0xaea2('0x28')](saveUpdates(_0xe1bc15[_0xaea2('0x4f')],null))[_0xaea2('0x28')](respondWithResult(_0x3fcce4,null))[_0xaea2('0x45')](handleError(_0x3fcce4,null));};exports['destroy']=function(_0xd5382f,_0x590010){return db[_0xaea2('0x2f')][_0xaea2('0x49')]({'where':{'id':_0xd5382f[_0xaea2('0x47')]['id']}})['then'](handleEntityNotFound(_0x590010,null))[_0xaea2('0x28')](removeEntity(_0x590010,null))[_0xaea2('0x45')](handleError(_0x590010,null));};exports[_0xaea2('0x50')]=function(_0x351717,_0x2a35ce,_0xa890f7){_0x351717['body'][_0xaea2('0x2b')]=_0x351717[_0xaea2('0x51')][_0xaea2('0x52')];_0x351717[_0xaea2('0x4f')][_0xaea2('0x53')]=_0x351717[_0xaea2('0x51')][_0xaea2('0x54')];_0x351717[_0xaea2('0x4f')][_0xaea2('0x32')]=_0x351717[_0xaea2('0x51')]['mimetype'];return db[_0xaea2('0x2f')]['create'](_0x351717[_0xaea2('0x4f')])[_0xaea2('0x28')](respondWithResult(_0x2a35ce,0xc9))[_0xaea2('0x45')](handleError(_0x2a35ce,null));};exports['download']=function(_0x44b425,_0x370d0f,_0x41a61a){return db['Attachment'][_0xaea2('0x55')]({'where':{'id':_0x44b425[_0xaea2('0x47')]['id']},'raw':!![]})[_0xaea2('0x28')](handleEntityNotFound(_0x370d0f,null))[_0xaea2('0x28')](function(_0x1af4e9){if(_0x1af4e9){var _0x4642a8=_0x1af4e9[_0xaea2('0x56')]!==null;var _0x4b0808=path[_0xaea2('0x57')](config['root'],_0xaea2('0x58'));if(_0x4642a8){_0x4b0808=path[_0xaea2('0x57')](_0x4b0808,_0xaea2('0x59'));}var _0x43083a=path['join'](_0x4b0808,_0x1af4e9[_0xaea2('0x53')]);return _0x370d0f['download'](_0x43083a);}})[_0xaea2('0x45')](handleError(_0x370d0f,null));};
\ No newline at end of file
+var _0xfec7=['body','omit','updatedAt','create','update','file','originalname','basename','mimetype','findOne','join','root','server/files/attachments/','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','Attachment','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','clone','find','get','createdAt'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0xfec7,0x112));var _0x7fec=function(_0x58b84b,_0x1a464b){_0x58b84b=_0x58b84b-0x0;var _0x43d902=_0xfec7[_0x58b84b];return _0x43d902;};'use strict';var emlformat=require(_0x7fec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fec('0x1'));var jsonpatch=require(_0x7fec('0x2'));var rp=require(_0x7fec('0x3'));var moment=require(_0x7fec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7fec('0x5'));var util=require(_0x7fec('0x6'));var path=require('path');var sox=require(_0x7fec('0x7'));var csv=require(_0x7fec('0x8'));var ejs=require(_0x7fec('0x9'));var fs=require('fs');var fs_extra=require(_0x7fec('0xa'));var _=require(_0x7fec('0xb'));var squel=require(_0x7fec('0xc'));var crypto=require('crypto');var jsforce=require(_0x7fec('0xd'));var deskjs=require(_0x7fec('0xe'));var toCsv=require(_0x7fec('0x8'));var querystring=require(_0x7fec('0xf'));var Papa=require(_0x7fec('0x10'));var Redis=require(_0x7fec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7fec('0x12'));var as=require(_0x7fec('0x13'));var hardwareService=require(_0x7fec('0x14'));var logger=require(_0x7fec('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x7fec('0x16'));var licenseUtil=require(_0x7fec('0x17'));var db=require(_0x7fec('0x18'))['db'];function respondWithStatusCode(_0xca6401,_0x209f2b){_0x209f2b=_0x209f2b||0xcc;return function(_0x17bc19){if(_0x17bc19){return _0xca6401[_0x7fec('0x19')](_0x209f2b);}return _0xca6401[_0x7fec('0x1a')](_0x209f2b)['end']();};}function respondWithResult(_0xdd3dd4,_0x577151){_0x577151=_0x577151||0xc8;return function(_0x507092){if(_0x507092){return _0xdd3dd4[_0x7fec('0x1a')](_0x577151)['json'](_0x507092);}};}function respondWithFilteredResult(_0x43bac2,_0x2a1b56){return function(_0x42c8ca){if(_0x42c8ca){var _0xfa167e=typeof _0x2a1b56['offset']===_0x7fec('0x1b')&&typeof _0x2a1b56[_0x7fec('0x1c')]===_0x7fec('0x1b');var _0x1cc59a=_0x42c8ca['count'];var _0x26c355=_0xfa167e?0x0:_0x2a1b56[_0x7fec('0x1d')];var _0x4ad22e=_0xfa167e?_0x42c8ca[_0x7fec('0x1e')]:_0x2a1b56[_0x7fec('0x1d')]+_0x2a1b56[_0x7fec('0x1c')];var _0x5e7dea;if(_0x4ad22e>=_0x1cc59a){_0x4ad22e=_0x1cc59a;_0x5e7dea=0xc8;}else{_0x5e7dea=0xce;}_0x43bac2[_0x7fec('0x1a')](_0x5e7dea);return _0x43bac2[_0x7fec('0x1f')](_0x7fec('0x20'),_0x26c355+'-'+_0x4ad22e+'/'+_0x1cc59a)['json'](_0x42c8ca);}return null;};}function patchUpdates(_0x31497d){return function(_0x3c5d8e){try{jsonpatch[_0x7fec('0x21')](_0x3c5d8e,_0x31497d,!![]);}catch(_0xcc8a86){return BPromise[_0x7fec('0x22')](_0xcc8a86);}return _0x3c5d8e['save']();};}function saveUpdates(_0x14e54d,_0x3c5cfe){return function(_0x1ba84b){if(_0x1ba84b){return _0x1ba84b['update'](_0x14e54d)[_0x7fec('0x23')](function(_0x551ef1){return _0x551ef1;});}return null;};}function removeEntity(_0x3ca971,_0x2fb33a){return function(_0x100f24){if(_0x100f24){return _0x100f24[_0x7fec('0x24')]()[_0x7fec('0x23')](function(){_0x3ca971[_0x7fec('0x1a')](0xcc)[_0x7fec('0x25')]();});}};}function handleEntityNotFound(_0x469529,_0x535f57){return function(_0x3df643){if(!_0x3df643){_0x469529[_0x7fec('0x19')](0x194);}return _0x3df643;};}function handleError(_0x498c5e,_0x284124){_0x284124=_0x284124||0x1f4;return function(_0x178974){logger[_0x7fec('0x26')](_0x178974[_0x7fec('0x27')]);if(_0x178974['name']){delete _0x178974[_0x7fec('0x28')];}_0x498c5e[_0x7fec('0x1a')](_0x284124)[_0x7fec('0x29')](_0x178974);};}exports[_0x7fec('0x2a')]=function(_0x28b491,_0x5dc91a){var _0x5a7097={},_0x2e0b79={},_0x9b8427={'count':0x0,'rows':[]};var _0x4129f6=_[_0x7fec('0x2b')](db[_0x7fec('0x2c')]['rawAttributes'],function(_0x1bfa3e){return{'name':_0x1bfa3e['fieldName'],'type':_0x1bfa3e['type']['key']};});_0x2e0b79[_0x7fec('0x2d')]=_[_0x7fec('0x2b')](_0x4129f6,_0x7fec('0x28'));_0x2e0b79[_0x7fec('0x2e')]=_['keys'](_0x28b491[_0x7fec('0x2e')]);_0x2e0b79['filters']=_[_0x7fec('0x2f')](_0x2e0b79[_0x7fec('0x2d')],_0x2e0b79[_0x7fec('0x2e')]);_0x5a7097[_0x7fec('0x30')]=_[_0x7fec('0x2f')](_0x2e0b79[_0x7fec('0x2d')],qs['fields'](_0x28b491['query'][_0x7fec('0x31')]));_0x5a7097[_0x7fec('0x30')]=_0x5a7097[_0x7fec('0x30')][_0x7fec('0x32')]?_0x5a7097[_0x7fec('0x30')]:_0x2e0b79['model'];if(!_0x28b491['query'][_0x7fec('0x33')](_0x7fec('0x34'))){_0x5a7097[_0x7fec('0x1c')]=qs['limit'](_0x28b491[_0x7fec('0x2e')][_0x7fec('0x1c')]);_0x5a7097[_0x7fec('0x1d')]=qs[_0x7fec('0x1d')](_0x28b491[_0x7fec('0x2e')][_0x7fec('0x1d')]);}_0x5a7097[_0x7fec('0x35')]=qs[_0x7fec('0x36')](_0x28b491[_0x7fec('0x2e')][_0x7fec('0x36')]);_0x5a7097[_0x7fec('0x37')]=qs['filters'](_['pick'](_0x28b491[_0x7fec('0x2e')],_0x2e0b79[_0x7fec('0x38')]),_0x4129f6);if(_0x28b491['query'][_0x7fec('0x39')]){_0x5a7097['where']=_[_0x7fec('0x3a')](_0x5a7097[_0x7fec('0x37')],{'$or':_[_0x7fec('0x2b')](_0x4129f6,function(_0x251960){if(_0x251960[_0x7fec('0x3b')]!=='VIRTUAL'){var _0x41a1a4={};_0x41a1a4[_0x251960[_0x7fec('0x28')]]={'$like':'%'+_0x28b491[_0x7fec('0x2e')]['filter']+'%'};return _0x41a1a4;}})});}_0x5a7097=_['merge']({},_0x5a7097,_0x28b491[_0x7fec('0x3c')]);var _0x2b5b61={'where':_0x5a7097[_0x7fec('0x37')]};return db[_0x7fec('0x2c')]['count'](_0x2b5b61)[_0x7fec('0x23')](function(_0x185537){_0x9b8427[_0x7fec('0x1e')]=_0x185537;if(_0x28b491['query']['includeAll']){_0x5a7097[_0x7fec('0x3d')]=[{'all':!![]}];}return db[_0x7fec('0x2c')][_0x7fec('0x3e')](_0x5a7097);})[_0x7fec('0x23')](function(_0x3759cd){_0x9b8427[_0x7fec('0x3f')]=_0x3759cd;return _0x9b8427;})[_0x7fec('0x23')](respondWithFilteredResult(_0x5dc91a,_0x5a7097))[_0x7fec('0x40')](handleError(_0x5dc91a,null));};exports[_0x7fec('0x41')]=function(_0x553118,_0x2969ff){var _0x5573e7={'raw':!![],'where':{'id':_0x553118[_0x7fec('0x42')]['id']}},_0x9fdc4b={};_0x9fdc4b[_0x7fec('0x2d')]=_[_0x7fec('0x43')](db[_0x7fec('0x2c')][_0x7fec('0x44')]);_0x9fdc4b[_0x7fec('0x2e')]=_[_0x7fec('0x43')](_0x553118[_0x7fec('0x2e')]);_0x9fdc4b[_0x7fec('0x38')]=_['intersection'](_0x9fdc4b[_0x7fec('0x2d')],_0x9fdc4b[_0x7fec('0x2e')]);_0x5573e7['attributes']=_[_0x7fec('0x2f')](_0x9fdc4b[_0x7fec('0x2d')],qs[_0x7fec('0x31')](_0x553118['query']['fields']));_0x5573e7[_0x7fec('0x30')]=_0x5573e7[_0x7fec('0x30')][_0x7fec('0x32')]?_0x5573e7[_0x7fec('0x30')]:_0x9fdc4b[_0x7fec('0x2d')];if(_0x553118[_0x7fec('0x2e')][_0x7fec('0x45')]){_0x5573e7['include']=[{'all':!![]}];}_0x5573e7=_[_0x7fec('0x3a')]({},_0x5573e7,_0x553118[_0x7fec('0x3c')]);return db[_0x7fec('0x2c')]['find'](_0x5573e7)[_0x7fec('0x23')](handleEntityNotFound(_0x2969ff,null))[_0x7fec('0x23')](respondWithResult(_0x2969ff,null))[_0x7fec('0x40')](handleError(_0x2969ff,null));};exports[_0x7fec('0x46')]=function(_0x24262b,_0x1c83cc){var _0x17ce0b={'where':{'id':_0x24262b[_0x7fec('0x42')]['id']}},_0x54b4a3={};_0x54b4a3[_0x7fec('0x2d')]=_[_0x7fec('0x43')](db[_0x7fec('0x2c')][_0x7fec('0x44')]);_0x17ce0b[_0x7fec('0x30')]=_['intersection'](_0x54b4a3[_0x7fec('0x2d')],qs['fields'](_0x24262b['query'][_0x7fec('0x31')]));_0x17ce0b['attributes']=_0x17ce0b[_0x7fec('0x30')][_0x7fec('0x32')]?_0x17ce0b['attributes']:_0x54b4a3[_0x7fec('0x2d')];if(_0x24262b[_0x7fec('0x2e')][_0x7fec('0x45')]){_0x17ce0b[_0x7fec('0x3d')]=[{'all':!![]}];}_0x17ce0b=_[_0x7fec('0x3a')]({},_0x17ce0b,_0x24262b[_0x7fec('0x3c')]);return db['Attachment'][_0x7fec('0x47')](_0x17ce0b)[_0x7fec('0x23')](handleEntityNotFound(_0x1c83cc,null))['then'](function(_0x31ab72){if(_0x31ab72){var _0x143470=_0x31ab72[_0x7fec('0x48')]({'plain':!![]});_0x143470=qs['omit'](_0x143470,['id',_0x7fec('0x49'),'updatedAt']);_0x24262b[_0x7fec('0x4a')]=_[_0x7fec('0x4b')](_0x24262b[_0x7fec('0x4a')],['id',_0x7fec('0x49'),_0x7fec('0x4c')]);return db[_0x7fec('0x2c')][_0x7fec('0x4d')](_[_0x7fec('0x3a')](_0x143470,_0x24262b[_0x7fec('0x4a')]),{'include':_0x24262b[_0x7fec('0x2e')][_0x7fec('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1c83cc,0xc9))['catch'](handleError(_0x1c83cc,null));};exports[_0x7fec('0x4e')]=function(_0x5a2dd9,_0x42cd6e){if(_0x5a2dd9[_0x7fec('0x4a')]['id']){delete _0x5a2dd9[_0x7fec('0x4a')]['id'];}return db[_0x7fec('0x2c')]['find']({'where':{'id':_0x5a2dd9[_0x7fec('0x42')]['id']}})[_0x7fec('0x23')](handleEntityNotFound(_0x42cd6e,null))[_0x7fec('0x23')](saveUpdates(_0x5a2dd9[_0x7fec('0x4a')],null))[_0x7fec('0x23')](respondWithResult(_0x42cd6e,null))['catch'](handleError(_0x42cd6e,null));};exports['destroy']=function(_0x5eeb57,_0x3e1165){return db[_0x7fec('0x2c')][_0x7fec('0x47')]({'where':{'id':_0x5eeb57[_0x7fec('0x42')]['id']}})[_0x7fec('0x23')](handleEntityNotFound(_0x3e1165,null))['then'](removeEntity(_0x3e1165,null))[_0x7fec('0x40')](handleError(_0x3e1165,null));};exports['create']=function(_0x15d539,_0x1abfe7,_0x452a81){_0x15d539[_0x7fec('0x4a')][_0x7fec('0x28')]=_0x15d539[_0x7fec('0x4f')][_0x7fec('0x50')];_0x15d539[_0x7fec('0x4a')][_0x7fec('0x51')]=_0x15d539['file']['filename'];_0x15d539['body'][_0x7fec('0x3b')]=_0x15d539['file'][_0x7fec('0x52')];return db[_0x7fec('0x2c')][_0x7fec('0x4d')](_0x15d539[_0x7fec('0x4a')])[_0x7fec('0x23')](respondWithResult(_0x1abfe7,0xc9))['catch'](handleError(_0x1abfe7,null));};exports['download']=function(_0x11361e,_0x1961f2,_0xda181b){return db[_0x7fec('0x2c')][_0x7fec('0x53')]({'where':{'id':_0x11361e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1961f2,null))[_0x7fec('0x23')](function(_0x4ec5cb){if(_0x4ec5cb){var _0x373fe9=_0x4ec5cb['ChatOfflineMessageId']!==null;var _0x48e613=path[_0x7fec('0x54')](config[_0x7fec('0x55')],_0x7fec('0x56'));if(_0x373fe9){_0x48e613=path[_0x7fec('0x54')](_0x48e613,'offline-chat/');}var _0x59fe57=path[_0x7fec('0x54')](_0x48e613,_0x4ec5cb[_0x7fec('0x51')]);return _0x1961f2['download'](_0x59fe57);}})[_0x7fec('0x40')](handleError(_0x1961f2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0942a10..5c63111 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 _0xa064=['../../config/environment','define','Attachment','attachments','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa064,0x126));var _0x4a06=function(_0x3727a9,_0x1c2edb){_0x3727a9=_0x3727a9-0x0;var _0xa16806=_0xa064[_0x3727a9];return _0xa16806;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4a06('0x0'));var moment=require(_0x4a06('0x1'));var BPromise=require(_0x4a06('0x2'));var rp=require(_0x4a06('0x3'));var fs=require('fs');var path=require(_0x4a06('0x4'));var rimraf=require(_0x4a06('0x5'));var config=require(_0x4a06('0x6'));var attributes=require('./attachment.attributes');module['exports']=function(_0x1188bf,_0x512050){return _0x1188bf[_0x4a06('0x7')](_0x4a06('0x8'),attributes,{'tableName':_0x4a06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d1c=['rimraf','../../config/environment','./attachment.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x126026,_0x19498c){var _0x57de09=function(_0x526589){while(--_0x526589){_0x126026['push'](_0x126026['shift']());}};_0x57de09(++_0x19498c);}(_0x6d1c,0x185));var _0xc6d1=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x6d1c[_0x27bd2c];return _0x3784ea;};'use strict';var _=require(_0xc6d1('0x0'));var util=require('util');var logger=require(_0xc6d1('0x1'))(_0xc6d1('0x2'));var moment=require(_0xc6d1('0x3'));var BPromise=require(_0xc6d1('0x4'));var rp=require(_0xc6d1('0x5'));var fs=require('fs');var path=require(_0xc6d1('0x6'));var rimraf=require(_0xc6d1('0x7'));var config=require(_0xc6d1('0x8'));var attributes=require(_0xc6d1('0x9'));module[_0xc6d1('0xa')]=function(_0x553757,_0x2f13d3){return _0x553757['define']('Attachment',attributes,{'tableName':'attachments','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 d8e316e..f2c8d5d 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 _0x89c4=['then','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','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x89c4,0x82));var _0x489c=function(_0x38b55b,_0x240023){_0x38b55b=_0x38b55b-0x0;var _0x1cefe2=_0x89c4[_0x38b55b];return _0x1cefe2;};'use strict';var _=require(_0x489c('0x0'));var util=require(_0x489c('0x1'));var moment=require('moment');var BPromise=require(_0x489c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x489c('0x3'))['db'];var utils=require(_0x489c('0x4'));var logger=require(_0x489c('0x5'))(_0x489c('0x6'));var config=require(_0x489c('0x7'));var jayson=require(_0x489c('0x8'));var client=jayson[_0x489c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5e402,_0x476dfe,_0x122c44){return new BPromise(function(_0xceb82c,_0x5a301e){return client['request'](_0xe5e402,_0x122c44)[_0x489c('0xa')](function(_0x54ea10){logger[_0x489c('0xb')](_0x489c('0xc'),_0x476dfe,_0x489c('0xd'));logger[_0x489c('0xe')](_0x489c('0xf'),_0x476dfe,_0x489c('0xd'),JSON[_0x489c('0x10')](_0x54ea10));if(_0x54ea10[_0x489c('0x11')]){if(_0x54ea10['error'][_0x489c('0x12')]===0x1f4){logger['error'](_0x489c('0xc'),_0x476dfe,_0x54ea10['error']['message']);return _0x5a301e(_0x54ea10[_0x489c('0x11')]['message']);}logger[_0x489c('0x11')]('Attachment,\x20%s,\x20%s',_0x476dfe,_0x54ea10[_0x489c('0x11')][_0x489c('0x13')]);return _0xceb82c(_0x54ea10['error'][_0x489c('0x13')]);}else{logger[_0x489c('0xb')]('Attachment,\x20%s,\x20%s',_0x476dfe,'request\x20sent');_0xceb82c(_0x54ea10[_0x489c('0x14')]['message']);}})[_0x489c('0x15')](function(_0x2e89c4){logger[_0x489c('0x11')](_0x489c('0xc'),_0x476dfe,_0x2e89c4);_0x5a301e(_0x2e89c4);});});}exports[_0x489c('0x16')]=function(_0x4519ce){var _0x44972a=this;return new Promise(function(_0x431782,_0xa91de){return db[_0x489c('0x17')][_0x489c('0x18')](_0x4519ce[_0x489c('0x19')],{'raw':_0x4519ce[_0x489c('0x1a')]?_0x4519ce[_0x489c('0x1a')][_0x489c('0x1b')]===undefined?!![]:![]:!![]})[_0x489c('0xa')](function(_0x14677b){logger[_0x489c('0xb')]('CreateAttachment',_0x4519ce);logger[_0x489c('0xe')](_0x489c('0x16'),_0x4519ce,JSON[_0x489c('0x10')](_0x14677b));_0x431782(_0x14677b);})[_0x489c('0x15')](function(_0x18cf8b){logger['error'](_0x489c('0x16'),_0x18cf8b[_0x489c('0x13')],_0x4519ce);_0xa91de(_0x44972a[_0x489c('0x11')](0x1f4,_0x18cf8b['message']));});});};
\ No newline at end of file
+var _0x39cb=['message','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Attachment,\x20%s,\x20%s'];(function(_0x3835f0,_0x415627){var _0x1d727a=function(_0x122ff2){while(--_0x122ff2){_0x3835f0['push'](_0x3835f0['shift']());}};_0x1d727a(++_0x415627);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('Attachment,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}exports[_0xb39c('0x16')]=function(_0x4e02cf){var _0x35dade=this;return new Promise(function(_0x2eeae6,_0x559ad6){return db[_0xb39c('0x17')][_0xb39c('0x18')](_0x4e02cf[_0xb39c('0x19')],{'raw':_0x4e02cf[_0xb39c('0x1a')]?_0x4e02cf['options'][_0xb39c('0x1b')]===undefined?!![]:![]:!![]})[_0xb39c('0xb')](function(_0x5e4a0b){logger[_0xb39c('0xc')](_0xb39c('0x16'),_0x4e02cf);logger[_0xb39c('0x1c')]('CreateAttachment',_0x4e02cf,JSON['stringify'](_0x5e4a0b));_0x2eeae6(_0x5e4a0b);})[_0xb39c('0x15')](function(_0x1a5b9d){logger[_0xb39c('0x10')]('CreateAttachment',_0x1a5b9d[_0xb39c('0x13')],_0x4e02cf);_0x559ad6(_0x35dade[_0xb39c('0x10')](0x1f4,_0x1a5b9d[_0xb39c('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index f6bc6cb..5897bf5 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1b64be,_0x4ae2c4){var _0x19bfca=function(_0x3928bb){while(--_0x3928bb){_0x1b64be['push'](_0x1b64be['shift']());}};_0x19bfca(++_0x4ae2c4);}(_0x2032,0xd9));var _0x2203=function(_0x1044be,_0x5c324d){_0x1044be=_0x1044be-0x0;var _0x2ac3ab=_0x2032[_0x1044be];return _0x2ac3ab;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0xf6b163,_0x520e2e){var _0x55fc52=function(_0x55e0de){while(--_0x55e0de){_0xf6b163['push'](_0xf6b163['shift']());}};_0x55fc52(++_0x520e2e);}(_0xadb5,0xad));var _0x5adb=function(_0x30c1c4,_0x4f9952){_0x30c1c4=_0x30c1c4-0x0;var _0x41ddf8=_0xadb5[_0x30c1c4];return _0x41ddf8;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index faec0b0..f968162 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x034c=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','disabled','blocked','blockedAt','user','agent','domain','blockDuration','minutes','clearBlockUser','getLicense','catch','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','authenticate','error'];(function(_0x55af0d,_0x5db5c9){var _0x245085=function(_0x39d897){while(--_0x39d897){_0x55af0d['push'](_0x55af0d['shift']());}};_0x245085(++_0x5db5c9);}(_0x034c,0xf2));var _0xc034=function(_0x13126c,_0x12afb6){_0x13126c=_0x13126c-0x0;var _0x56736b=_0x034c[_0x13126c];return _0x56736b;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xc034('0x0'))[_0xc034('0x1')];var moment=require(_0xc034('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xc034('0x3'));var util=require(_0xc034('0x4'));var db=require(_0xc034('0x5'))['db'];var authService=require(_0xc034('0x6'));var utils=require(_0xc034('0x7'));var config=require(_0xc034('0x8'));var logger=require(_0xc034('0x9'))(_0xc034('0xa'));function isActiveDirectoryConfigured(_0x5ce7f7){var _0x34b109=![];if(typeof _0x5ce7f7['activedirectory']!==_0xc034('0xb')){_0x34b109=_0x5ce7f7[_0xc034('0xc')][_0xc034('0xd')]&&_0x5ce7f7[_0xc034('0xc')]['url']&&_0x5ce7f7[_0xc034('0xc')]['domain'];}return _0x34b109;}function adAuthenticate(_0x2ae3e9,_0x216313,_0x374ff0){return new BPromise(function(_0x2271e3,_0x1b143f){try{var _0x3e8012=new ActiveDirectory(_0x2ae3e9);_0x3e8012[_0xc034('0xe')](_0x216313,_0x374ff0,function(_0x32eec3,_0x5c4025){if(_0x32eec3){logger[_0xc034('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x216313,util['inspect'](_0x32eec3,{'showHidden':![],'depth':null}));_0x1b143f(_0xc034('0x10'));}else if(!_0x5c4025){logger[_0xc034('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x216313);_0x1b143f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2271e3(_0x5c4025);}});}catch(_0x30e476){_0x1b143f(_0x30e476);}});}function ActiveDirectoryAuthenticate(_0x579203,_0x220ca7,_0x33b1b1,_0x2387cd){var _0x17922,_0x2d3589;if(!isActiveDirectoryConfigured(config)){logger[_0xc034('0xf')](_0xc034('0x11'),_0x220ca7);return _0x2387cd(null,![],{'message':_0xc034('0x10')});}return db['Setting'][_0xc034('0x12')]({'where':{'id':0x1},'attributes':[_0xc034('0x13'),'blockDuration'],'raw':!![]})[_0xc034('0x14')](function(_0x2607dc){_0x17922=_0x2607dc;if(!_0x17922[_0xc034('0x13')]){logger['error'](_0xc034('0x15'),_0x220ca7);throw new Error(_0xc034('0x10'));}return _0x579203[_0xc034('0x12')]({'logging':!![],'attributes':['id',_0xc034('0x16'),_0xc034('0x17'),'salt','role',_0xc034('0x18'),_0xc034('0x19'),_0xc034('0x1a'),'online'],'where':{'name':_0x220ca7,'role':{'$or':['admin',_0xc034('0x1b'),_0xc034('0x1c')]},'adSsoEnabled':!![]}});})[_0xc034('0x14')](function(_0x276050){if(!_0x276050||_0x276050&&_0x276050[_0xc034('0x16')]!==_0x220ca7){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x2d3589=_0x276050;var _0x56b04a=_0x2d3589[_0xc034('0x16')]+'@'+config['activedirectory'][_0xc034('0x1d')];return adAuthenticate(config[_0xc034('0xc')],_0x56b04a,_0x33b1b1);})[_0xc034('0x14')](function(_0x42f262){if(_0x2d3589[_0xc034('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x17922[_0xc034('0x1e')]>0x0){if(_0x2d3589[_0xc034('0x19')]){if(moment(_0x2d3589[_0xc034('0x1a')])['add'](_0x17922['blockDuration'],_0xc034('0x1f'))>moment()){throw new Error(_0xc034('0x10'));}return utils[_0xc034('0x20')](_0x2d3589,0x0,![],null)[_0xc034('0x14')](function(){return utils[_0xc034('0x21')](_0x2d3589);})[_0xc034('0x14')](function(){return _0x2387cd(null,_0x2d3589);});}else{return utils[_0xc034('0x21')](_0x2d3589)[_0xc034('0x14')](function(){return _0x2387cd(null,_0x2d3589);});}}else{return utils[_0xc034('0x21')](_0x2d3589)[_0xc034('0x14')](function(){return _0x2387cd(null,_0x2d3589);});}})[_0xc034('0x22')](function(_0xeee741){return _0x2387cd(null,![],_0xeee741);});}function handleError(_0x2e16c3,_0x332181,_0x55b173){return _0x2e16c3['status'](_0x332181||0x1f4)[_0xc034('0x23')]({'message':_0x55b173?_0x55b173[_0xc034('0x24')]||_0x55b173:''});}exports['login']=function(_0x1d663f,_0x3ca5ad,_0x21c196){passport[_0xc034('0xe')](_0xc034('0x25'),function(_0xb249b,_0x4fbc44,_0x59bd30){var _0x3b4377=_0xb249b||_0x59bd30;if(_0x3b4377){return handleError(_0x3ca5ad,0x191,_0x3b4377);}if(!_0x4fbc44){return handleError(_0x3ca5ad,0x194,{'message':_0xc034('0x26')});}else{var _0x5ad91d={'payload':{'id':_0x4fbc44['id'],'role':_0x4fbc44['role']},'options':{'expiresIn':0x15180}};return authService[_0xc034('0x27')](_0x5ad91d)[_0xc034('0x14')](function(_0x4def1a){_0x3ca5ad[_0xc034('0x28')]({'id':_0x4fbc44['id'],'token':_0x4def1a,'statusCall':'','isAlreadyLogged':_0x4fbc44[_0xc034('0x29')]});});}})(_0x1d663f,_0x3ca5ad,_0x21c196);};passport['use'](_0xc034('0x25'),new LocalStrategy({'usernameField':_0xc034('0x16'),'passwordField':'password'},function(_0x18d7f6,_0x5b2fb9,_0x2dd624){return ActiveDirectoryAuthenticate(db[_0xc034('0x2a')],_0x18d7f6,_0x5b2fb9,_0x2dd624);}));
\ No newline at end of file
+var _0x07b8=['clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','password','passport','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role','disabled','blockedAt','online','user','agent','name','domain'];(function(_0xd6ccdc,_0x23b167){var _0x1eac6d=function(_0x198a14){while(--_0x198a14){_0xd6ccdc['push'](_0xd6ccdc['shift']());}};_0x1eac6d(++_0x23b167);}(_0x07b8,0x183));var _0x807b=function(_0x255caf,_0x2f893b){_0x255caf=_0x255caf-0x0;var _0x25e862=_0x07b8[_0x255caf];return _0x25e862;};'use strict';var passport=require(_0x807b('0x0'));var LocalStrategy=require('passport-local')[_0x807b('0x1')];var moment=require(_0x807b('0x2'));var ActiveDirectory=require(_0x807b('0x3'));var BPromise=require(_0x807b('0x4'));var util=require(_0x807b('0x5'));var db=require(_0x807b('0x6'))['db'];var authService=require(_0x807b('0x7'));var utils=require('../../config/utils');var config=require(_0x807b('0x8'));var logger=require(_0x807b('0x9'))(_0x807b('0xa'));function isActiveDirectoryConfigured(_0x550aa5){var _0x20cbe6=![];if(typeof _0x550aa5[_0x807b('0xb')]!==_0x807b('0xc')){_0x20cbe6=_0x550aa5[_0x807b('0xb')][_0x807b('0xd')]&&_0x550aa5[_0x807b('0xb')][_0x807b('0xe')]&&_0x550aa5[_0x807b('0xb')]['domain'];}return _0x20cbe6;}function adAuthenticate(_0x7d8ad1,_0x271b12,_0xb7deab){return new BPromise(function(_0x3c1a74,_0x288c6d){try{var _0x30efed=new ActiveDirectory(_0x7d8ad1);_0x30efed['authenticate'](_0x271b12,_0xb7deab,function(_0x80025c,_0x5edc00){if(_0x80025c){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x271b12,util[_0x807b('0xf')](_0x80025c,{'showHidden':![],'depth':null}));_0x288c6d(_0x807b('0x10'));}else if(!_0x5edc00){logger[_0x807b('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x271b12);_0x288c6d(_0x807b('0x10'));}else{_0x3c1a74(_0x5edc00);}});}catch(_0x240fa0){_0x288c6d(_0x240fa0);}});}function ActiveDirectoryAuthenticate(_0x4137d9,_0x577452,_0x578859,_0x111122){var _0x2a193c,_0x547b69;if(!isActiveDirectoryConfigured(config)){logger[_0x807b('0x11')](_0x807b('0x12'),_0x577452);return _0x111122(null,![],{'message':_0x807b('0x10')});}return db[_0x807b('0x13')][_0x807b('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x807b('0x15')],'raw':!![]})[_0x807b('0x16')](function(_0x39be02){_0x2a193c=_0x39be02;if(!_0x2a193c['adSsoEnabled']){logger[_0x807b('0x11')](_0x807b('0x17'),_0x577452);throw new Error(_0x807b('0x10'));}return _0x4137d9['findOne']({'logging':!![],'attributes':['id','name','password',_0x807b('0x18'),_0x807b('0x19'),_0x807b('0x1a'),'blocked',_0x807b('0x1b'),_0x807b('0x1c')],'where':{'name':_0x577452,'role':{'$or':['admin',_0x807b('0x1d'),_0x807b('0x1e')]},'adSsoEnabled':!![]}});})[_0x807b('0x16')](function(_0xc0fc0d){if(!_0xc0fc0d||_0xc0fc0d&&_0xc0fc0d[_0x807b('0x1f')]!==_0x577452){throw new Error(_0x807b('0x10'));}_0x547b69=_0xc0fc0d;var _0x399cbd=_0x547b69[_0x807b('0x1f')]+'@'+config['activedirectory'][_0x807b('0x20')];return adAuthenticate(config[_0x807b('0xb')],_0x399cbd,_0x578859);})[_0x807b('0x16')](function(_0x4eca2c){if(_0x547b69[_0x807b('0x1a')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2a193c[_0x807b('0x15')]>0x0){if(_0x547b69['blocked']){if(moment(_0x547b69[_0x807b('0x1b')])['add'](_0x2a193c[_0x807b('0x15')],'minutes')>moment()){throw new Error(_0x807b('0x10'));}return utils[_0x807b('0x21')](_0x547b69,0x0,![],null)['then'](function(){return utils[_0x807b('0x22')](_0x547b69);})[_0x807b('0x16')](function(){return _0x111122(null,_0x547b69);});}else{return utils[_0x807b('0x22')](_0x547b69)[_0x807b('0x16')](function(){return _0x111122(null,_0x547b69);});}}else{return utils[_0x807b('0x22')](_0x547b69)[_0x807b('0x16')](function(){return _0x111122(null,_0x547b69);});}})['catch'](function(_0x3d6889){return _0x111122(null,![],_0x3d6889);});}function handleError(_0x2931f1,_0x3d4e3a,_0x43817d){return _0x2931f1[_0x807b('0x23')](_0x3d4e3a||0x1f4)[_0x807b('0x24')]({'message':_0x43817d?_0x43817d[_0x807b('0x25')]||_0x43817d:''});}exports[_0x807b('0x26')]=function(_0x57ed4b,_0x574891,_0x5ec5a7){passport['authenticate'](_0x807b('0x27'),function(_0x5569b9,_0x1a6de4,_0x52f8a8){var _0x1c2677=_0x5569b9||_0x52f8a8;if(_0x1c2677){return handleError(_0x574891,0x191,_0x1c2677);}if(!_0x1a6de4){return handleError(_0x574891,0x194,{'message':_0x807b('0x28')});}else{var _0x5ee722={'payload':{'id':_0x1a6de4['id'],'role':_0x1a6de4['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5ee722)['then'](function(_0x158f6a){_0x574891['json']({'id':_0x1a6de4['id'],'token':_0x158f6a,'statusCall':'','isAlreadyLogged':_0x1a6de4[_0x807b('0x1c')]});});}})(_0x57ed4b,_0x574891,_0x5ec5a7);};passport['use'](_0x807b('0x27'),new LocalStrategy({'usernameField':_0x807b('0x1f'),'passwordField':_0x807b('0x29')},function(_0x44df6b,_0x1e3176,_0xbd5052){return ActiveDirectoryAuthenticate(db['User'],_0x44df6b,_0x1e3176,_0xbd5052);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 8dc1543..fc7c453 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80b7=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x80b7,0x1b4));var _0x780b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80b7[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x780b('0x0'));var router=express[_0x780b('0x1')]();var controller=require(_0x780b('0x2'));router[_0x780b('0x3')]('/',controller[_0x780b('0x4')]);module[_0x780b('0x5')]=router;
\ No newline at end of file
+var _0xcc1b=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x1ea092,_0x448c9e){var _0xd259ea=function(_0x2f059f){while(--_0x2f059f){_0x1ea092['push'](_0x1ea092['shift']());}};_0xd259ea(++_0x448c9e);}(_0xcc1b,0xfd));var _0xbcc1=function(_0x32a337,_0x5a776){_0x32a337=_0x32a337-0x0;var _0x23730f=_0xcc1b[_0x32a337];return _0x23730f;};'use strict';var express=require(_0xbcc1('0x0'));var router=express[_0xbcc1('0x1')]();var controller=require(_0xbcc1('0x2'));router[_0xbcc1('0x3')]('/',controller[_0xbcc1('0x4')]);module[_0xbcc1('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 8530b5d..7d2105c 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x339cfb,_0xe0335b){_0x339cfb=_0x339cfb-0x0;var _0x1e6df0=_0x7a54[_0x339cfb];return _0x1e6df0;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x7a54,0x106));var _0x47a5=function(_0x463d05,_0x48fafe){_0x463d05=_0x463d05-0x0;var _0x2d4014=_0x7a54[_0x463d05];return _0x2d4014;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index d80e6da..fac00a4 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 _0x6aa4=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aa4,0x12e));var _0x46aa=function(_0x3797a7,_0x23263b){_0x3797a7=_0x3797a7-0x0;var _0x2b38c1=_0x6aa4[_0x3797a7];return _0x2b38c1;};'use strict';var express=require(_0x46aa('0x0'));var passport=require(_0x46aa('0x1'));var router=express['Router']();var controller=require(_0x46aa('0x2'));var userController=require(_0x46aa('0x3'));var authService=require(_0x46aa('0x4'));router['get']('/',controller[_0x46aa('0x5')]);router['get'](_0x46aa('0x6'),controller[_0x46aa('0x7')],authService[_0x46aa('0x8')],userController['login'],authService[_0x46aa('0x9')]);module[_0x46aa('0xa')]=router;
\ No newline at end of file
+var _0x66ad=['exports','express','passport','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x66ad,0x12a));var _0xd66a=function(_0x102147,_0x170d81){_0x102147=_0x102147-0x0;var _0x5e2d52=_0x66ad[_0x102147];return _0x5e2d52;};'use strict';var express=require(_0xd66a('0x0'));var passport=require(_0xd66a('0x1'));var router=express['Router']();var controller=require(_0xd66a('0x2'));var userController=require(_0xd66a('0x3'));var authService=require('../../components/auth/service');router[_0xd66a('0x4')]('/',controller['login']);router[_0xd66a('0x4')](_0xd66a('0x5'),controller[_0xd66a('0x6')],authService['isMiddleware'],userController[_0xd66a('0x7')],authService['setTokenCookie']);module[_0xd66a('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 95cb3e8..85984b1 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 _0x905c=['http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','user','request','SendMail','error','format','message','status','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','use','local-login','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client'];(function(_0x41fd75,_0x26c6c3){var _0x11c35b=function(_0x125999){while(--_0x125999){_0x41fd75['push'](_0x41fd75['shift']());}};_0x11c35b(++_0x26c6c3);}(_0x905c,0x13a));var _0xc905=function(_0x2c8f13,_0x51a3d4){_0x2c8f13=_0x2c8f13-0x0;var _0x4ae53a=_0x905c[_0x2c8f13];return _0x4ae53a;};'use strict';var util=require('util');var passport=require(_0xc905('0x0'));var LocalStrategy=require('passport-local')[_0xc905('0x1')];var jayson=require(_0xc905('0x2'));var _=require(_0xc905('0x3'));var rs=require(_0xc905('0x4'));var moment=require(_0xc905('0x5'));var db=require(_0xc905('0x6'))['db'];var authService=require(_0xc905('0x7'));var utils=require(_0xc905('0x8'));var client=jayson[_0xc905('0x9')][_0xc905('0xa')]({'port':0x232b});function localAuthenticate(_0x1e6bc4,_0x5531d9,_0x12fdb1,_0x43c215){var _0x184280,_0x62ea72;return db[_0xc905('0xb')][_0xc905('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc905('0xd')],'raw':!![]})[_0xc905('0xe')](function(_0x2dc6ca){_0x184280=_0x2dc6ca;return _0x1e6bc4['findOne']({'attributes':['id',_0xc905('0xf'),_0xc905('0x10'),_0xc905('0x11'),_0xc905('0x12'),_0xc905('0x13'),_0xc905('0x14'),_0xc905('0x15'),'loginAttempts'],'where':{'name':_0x5531d9,'role':{'$or':[_0xc905('0x16'),'user',_0xc905('0x17')]}}});})[_0xc905('0xe')](function(_0x15c6c8){if(!_0x15c6c8||_0x15c6c8&&_0x15c6c8[_0xc905('0xf')]!==_0x5531d9){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x62ea72=_0x15c6c8;return _0x62ea72;}})[_0xc905('0xe')](function(){_0x62ea72['authenticate'](_0x12fdb1,function(_0x35a822,_0x1d7700){var _0x3d8a85=_0x62ea72[_0xc905('0x18')]+0x1;if(_0x35a822){return _0x43c215(_0x35a822);}else if(!_0x1d7700){if(_0x62ea72[_0xc905('0x13')]){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else if(_0x184280[_0xc905('0x1a')]>0x0){if(_0x62ea72[_0xc905('0x14')]){if(_0x184280[_0xc905('0xd')]>0x0){if(moment(_0x62ea72[_0xc905('0x15')])[_0xc905('0x1b')](_0x184280[_0xc905('0xd')],_0xc905('0x1c'))>moment()){return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc905('0x1d')](_0x62ea72,_0x3d8a85,![],null)[_0xc905('0xe')](function(){return _0x43c215(null,![],{'message':_0xc905('0x19')});});}}else{return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3d8a85>=_0x184280[_0xc905('0x1a')]){return utils[_0xc905('0x1d')](_0x62ea72,0x0,!![],moment())[_0xc905('0xe')](function(){return _0x43c215(null,![],{'message':_0xc905('0x19')});});}else{return utils['clearBlockUser'](_0x62ea72,_0x3d8a85,![],null)[_0xc905('0xe')](function(){return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x43c215(null,![],{'message':_0xc905('0x19')});}}else{if(_0x62ea72[_0xc905('0x13')]){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else if(_0x184280['allowedLoginAttempts']>0x0){if(_0x62ea72[_0xc905('0x14')]){if(_0x184280[_0xc905('0xd')]>0x0){if(moment(_0x62ea72[_0xc905('0x15')])[_0xc905('0x1b')](_0x184280['blockDuration'],'minutes')>moment()){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else{return utils[_0xc905('0x1d')](_0x62ea72,0x0,![],null)[_0xc905('0xe')](function(){return utils['getLicense'](_0x62ea72);})['then'](function(){return _0x43c215(null,_0x62ea72);});}}else{return _0x43c215(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x62ea72,0x0,![],null)[_0xc905('0xe')](function(){return utils[_0xc905('0x1e')](_0x62ea72);})[_0xc905('0xe')](function(){return _0x43c215(null,_0x62ea72);})[_0xc905('0x1f')](function(_0x3ba864){return _0x43c215(null,![],_0x3ba864);});}}else{if(_0x62ea72[_0xc905('0x14')]){return _0x43c215(null,![],{'message':_0xc905('0x19')});}else{return utils[_0xc905('0x1e')](_0x62ea72)[_0xc905('0xe')](function(){return _0x43c215(null,_0x62ea72);});}}}});})[_0xc905('0x1f')](function(_0x661e35){return _0x43c215(null,![],_0x661e35);});}function sendServiceMail(_0x5c3bb7){return db[_0xc905('0x20')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xc905('0x21')],'include':[{'model':db['MailServerOut'],'as':_0xc905('0x22'),'include':[{'model':db['CloudProvider'],'as':_0xc905('0x23')}]}]})[_0xc905('0xe')](function(_0x566274){if(!_0x566274){throw new Error(_0xc905('0x24'));}var _0x39a54f=_0x566274[_0xc905('0x25')]();var _0x102541={'account':_0x39a54f,'message':_[_0xc905('0x26')]({'from':util['format'](_0xc905('0x27'),_0x566274[_0xc905('0xf')],_0x566274['email']||_0x566274[_0xc905('0x22')][_0xc905('0x28')])},_0x5c3bb7)};return client[_0xc905('0x29')](_0xc905('0x2a'),_0x102541);})[_0xc905('0xe')](function(_0x1fba73){if(_0x1fba73[_0xc905('0x2b')]){throw new Error(util[_0xc905('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1fba73[_0xc905('0x2b')][_0xc905('0x2d')]||JSON['stringify'](_0x1fba73[_0xc905('0x2b')])));}return!![];});}function handleError(_0x27cb1c,_0x54b2d1,_0x18e3f2){return _0x27cb1c[_0xc905('0x2e')](_0x54b2d1||0x1f4)['send']({'message':_0x18e3f2?_0x18e3f2['message']||_0x18e3f2:''});}exports['login']=function(_0x54c9f0,_0xfc8d9c,_0x25b676){passport[_0xc905('0x2f')]('local-login',function(_0x19769b,_0x4919cb,_0x377d07){var _0x5aac77=_0x19769b||_0x377d07;if(_0x5aac77){return handleError(_0xfc8d9c,0x191,_0x5aac77);}if(!_0x4919cb){return handleError(_0xfc8d9c,0x194,{'message':_0xc905('0x30')});}else{var _0xbd8ea2={'payload':{'id':_0x4919cb['id'],'role':_0x4919cb['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xbd8ea2)['then'](function(_0x2b1cba){_0xfc8d9c[_0xc905('0x31')]({'id':_0x4919cb['id'],'token':_0x2b1cba,'statusCall':'','isAlreadyLogged':_0x4919cb[_0xc905('0x32')]});});}})(_0x54c9f0,_0xfc8d9c,_0x25b676);};exports['forgot']=function(_0x24a05c,_0x4f2752){if(!_0x24a05c[_0xc905('0x33')][_0xc905('0x21')]){return handleError(_0x4f2752,0x1f4,{'message':_0xc905('0x34')});}var _0x329666=rs['generate']();_0x24a05c[_0xc905('0x33')][_0xc905('0x21')]=_0x24a05c['body']['email'][_0xc905('0x35')]()[_0xc905('0x36')]();var _0x307c16;return db[_0xc905('0xb')][_0xc905('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc905('0xd')],'raw':!![]})['then'](function(_0x556d9a){_0x307c16=_0x556d9a;return db['User'][_0xc905('0x37')]({'where':{'email':_0x24a05c[_0xc905('0x33')][_0xc905('0x21')]}});})[_0xc905('0xe')](function(_0x48e955){if(!_0x48e955){throw new Error(_0xc905('0x38'));}if(_0x48e955['disabled']){throw new Error(_0xc905('0x39'));}if(_0x48e955[_0xc905('0x14')]){if(moment(_0x48e955[_0xc905('0x15')])[_0xc905('0x1b')](_0x307c16['blockDuration'],'minutes')>moment()){throw new Error(_0xc905('0x3a'));}else{_0x48e955['blocked']=![];_0x48e955[_0xc905('0x15')]=null;}}_0x48e955[_0xc905('0x3b')]=_0x329666;_0x48e955[_0xc905('0x3c')]=Date[_0xc905('0x3d')]()+0x36ee80;return _0x48e955[_0xc905('0x3e')]();})['then'](function(){return sendServiceMail({'to':_0x24a05c[_0xc905('0x33')][_0xc905('0x21')],'subject':_0xc905('0x3f'),'text':_0xc905('0x40')+_0xc905('0x41')+_0xc905('0x42')+_0x24a05c['headers']['host']+_0xc905('0x43')+_0x329666+'\x0a\x0a'+_0xc905('0x44')});})['then'](function(){_0x4f2752['status'](0xc8)[_0xc905('0x45')]({'message':_0xc905('0x46')});})[_0xc905('0x1f')](function(_0x396170){return handleError(_0x4f2752,0x1f4,_0x396170);});};exports[_0xc905('0x47')]=function(_0x379664,_0x1e2df6){return db['User'][_0xc905('0x37')]({'where':{'resetPasswordToken':_0x379664['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xc905('0x3d')]()}}})['then'](function(_0x15dfba){if(!_0x15dfba){throw new Error(_0xc905('0x48'));}return db[_0xc905('0xb')][_0xc905('0xc')]({'attributes':['id',_0xc905('0x49'),_0xc905('0x4a'),'passwordHistoryLimit']})[_0xc905('0xe')](function(_0x506bf9){if(_0x506bf9[_0xc905('0x49')])authService[_0xc905('0x4b')](_0x379664[_0xc905('0x33')]['password']);if(!_0x506bf9[_0xc905('0x4a')]||!_0x15dfba[_0xc905('0x4c')])return _0x15dfba;authService[_0xc905('0x4d')](_0x379664[_0xc905('0x33')]['password'],_0x15dfba[_0xc905('0x4c')],_0x506bf9[_0xc905('0x4e')]);return _0x15dfba;})[_0xc905('0xe')](function(){_0x15dfba[_0xc905('0x10')]=_0x379664[_0xc905('0x33')][_0xc905('0x10')];_0x15dfba[_0xc905('0x3b')]=null;_0x15dfba[_0xc905('0x3c')]=null;return _0x15dfba[_0xc905('0x3e')]();});})[_0xc905('0xe')](function(){_0x1e2df6[_0xc905('0x2e')](0xc8)[_0xc905('0x45')]({'message':'Password\x20reset!'});})['catch'](function(_0x230fc6){return handleError(_0x1e2df6,0x1f4,_0x230fc6);});};passport[_0xc905('0x4f')](_0xc905('0x50'),new LocalStrategy({'usernameField':_0xc905('0xf'),'passwordField':_0xc905('0x10')},function(_0x223eef,_0x39ba50,_0x5d7078){return localAuthenticate(db['User'],_0x223eef,_0x39ba50,_0x5d7078);}));
\ No newline at end of file
+var _0x9cac=['minutes','clearBlockUser','blocked','getLicense','catch','find','email','Smtp','CloudProvider','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','message','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','password','Password\x20reset!','use','util','passport','Strategy','lodash','randomstring','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','then','salt','blockedAt','loginAttempts','admin','user','agent','name','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0x9cac,0x82));var _0xc9ca=function(_0x515062,_0x3610b1){_0x515062=_0x515062-0x0;var _0x5cc7f3=_0x9cac[_0x515062];return _0x5cc7f3;};'use strict';var util=require(_0xc9ca('0x0'));var passport=require(_0xc9ca('0x1'));var LocalStrategy=require('passport-local')[_0xc9ca('0x2')];var jayson=require('jayson/promise');var _=require(_0xc9ca('0x3'));var rs=require(_0xc9ca('0x4'));var moment=require('moment');var db=require(_0xc9ca('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc9ca('0x6'));var client=jayson[_0xc9ca('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x43754a,_0x325659,_0x52426f,_0x457b91){var _0x1ba25b,_0x5335a9;return db[_0xc9ca('0x8')][_0xc9ca('0x9')]({'where':{'id':0x1},'attributes':[_0xc9ca('0xa'),'blockDuration'],'raw':!![]})[_0xc9ca('0xb')](function(_0x88ac31){_0x1ba25b=_0x88ac31;return _0x43754a[_0xc9ca('0x9')]({'attributes':['id','name','password',_0xc9ca('0xc'),'role','disabled','blocked',_0xc9ca('0xd'),_0xc9ca('0xe')],'where':{'name':_0x325659,'role':{'$or':[_0xc9ca('0xf'),_0xc9ca('0x10'),_0xc9ca('0x11')]}}});})['then'](function(_0xdcd2c8){if(!_0xdcd2c8||_0xdcd2c8&&_0xdcd2c8[_0xc9ca('0x12')]!==_0x325659){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5335a9=_0xdcd2c8;return _0x5335a9;}})['then'](function(){_0x5335a9[_0xc9ca('0x13')](_0x52426f,function(_0x3e20c5,_0x59db1a){var _0x2b88ad=_0x5335a9[_0xc9ca('0xe')]+0x1;if(_0x3e20c5){return _0x457b91(_0x3e20c5);}else if(!_0x59db1a){if(_0x5335a9[_0xc9ca('0x14')]){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}else if(_0x1ba25b[_0xc9ca('0xa')]>0x0){if(_0x5335a9['blocked']){if(_0x1ba25b[_0xc9ca('0x16')]>0x0){if(moment(_0x5335a9[_0xc9ca('0xd')])[_0xc9ca('0x17')](_0x1ba25b['blockDuration'],_0xc9ca('0x18'))>moment()){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}else{return utils[_0xc9ca('0x19')](_0x5335a9,_0x2b88ad,![],null)[_0xc9ca('0xb')](function(){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});});}}else{return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}}else{if(_0x2b88ad>=_0x1ba25b['allowedLoginAttempts']){return utils[_0xc9ca('0x19')](_0x5335a9,0x0,!![],moment())[_0xc9ca('0xb')](function(){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});});}else{return utils[_0xc9ca('0x19')](_0x5335a9,_0x2b88ad,![],null)[_0xc9ca('0xb')](function(){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});});}}}else{return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}}else{if(_0x5335a9[_0xc9ca('0x14')]){return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}else if(_0x1ba25b[_0xc9ca('0xa')]>0x0){if(_0x5335a9[_0xc9ca('0x1a')]){if(_0x1ba25b[_0xc9ca('0x16')]>0x0){if(moment(_0x5335a9['blockedAt'])[_0xc9ca('0x17')](_0x1ba25b[_0xc9ca('0x16')],_0xc9ca('0x18'))>moment()){return _0x457b91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x5335a9,0x0,![],null)[_0xc9ca('0xb')](function(){return utils[_0xc9ca('0x1b')](_0x5335a9);})[_0xc9ca('0xb')](function(){return _0x457b91(null,_0x5335a9);});}}else{return _0x457b91(null,![],{'message':_0xc9ca('0x15')});}}else{return utils[_0xc9ca('0x19')](_0x5335a9,0x0,![],null)[_0xc9ca('0xb')](function(){return utils[_0xc9ca('0x1b')](_0x5335a9);})[_0xc9ca('0xb')](function(){return _0x457b91(null,_0x5335a9);})[_0xc9ca('0x1c')](function(_0x3ca059){return _0x457b91(null,![],_0x3ca059);});}}else{if(_0x5335a9[_0xc9ca('0x1a')]){return _0x457b91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc9ca('0x1b')](_0x5335a9)[_0xc9ca('0xb')](function(){return _0x457b91(null,_0x5335a9);});}}}});})[_0xc9ca('0x1c')](function(_0x3c66e6){return _0x457b91(null,![],_0x3c66e6);});}function sendServiceMail(_0x3008bb){return db['MailAccount'][_0xc9ca('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xc9ca('0x12'),_0xc9ca('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0xc9ca('0x1f'),'include':[{'model':db['CloudProvider'],'as':_0xc9ca('0x20')}]}]})[_0xc9ca('0xb')](function(_0x2d0d1d){if(!_0x2d0d1d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5d2b62=_0x2d0d1d['getSmtpOptions']();var _0x493a92={'account':_0x5d2b62,'message':_['merge']({'from':util['format'](_0xc9ca('0x21'),_0x2d0d1d[_0xc9ca('0x12')],_0x2d0d1d[_0xc9ca('0x1e')]||_0x2d0d1d[_0xc9ca('0x1f')][_0xc9ca('0x10')])},_0x3008bb)};return client[_0xc9ca('0x22')]('SendMail',_0x493a92);})['then'](function(_0x39a944){if(_0x39a944[_0xc9ca('0x23')]){throw new Error(util[_0xc9ca('0x24')](_0xc9ca('0x25'),_0x39a944['error']['message']||JSON['stringify'](_0x39a944[_0xc9ca('0x23')])));}return!![];});}function handleError(_0x429274,_0x2a1bc2,_0x1be8e3){return _0x429274[_0xc9ca('0x26')](_0x2a1bc2||0x1f4)['send']({'message':_0x1be8e3?_0x1be8e3[_0xc9ca('0x27')]||_0x1be8e3:''});}exports['login']=function(_0x1ec555,_0x1651a8,_0x68d056){passport['authenticate'](_0xc9ca('0x28'),function(_0x245b31,_0xb10a4c,_0x5e8a42){var _0xddd9fe=_0x245b31||_0x5e8a42;if(_0xddd9fe){return handleError(_0x1651a8,0x191,_0xddd9fe);}if(!_0xb10a4c){return handleError(_0x1651a8,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4329c3={'payload':{'id':_0xb10a4c['id'],'role':_0xb10a4c['role']},'options':{'expiresIn':0x15180}};return authService[_0xc9ca('0x29')](_0x4329c3)['then'](function(_0x260b7e){_0x1651a8[_0xc9ca('0x2a')]({'id':_0xb10a4c['id'],'token':_0x260b7e,'statusCall':'','isAlreadyLogged':_0xb10a4c[_0xc9ca('0x2b')]});});}})(_0x1ec555,_0x1651a8,_0x68d056);};exports[_0xc9ca('0x2c')]=function(_0x10f5a2,_0x504c6a){if(!_0x10f5a2[_0xc9ca('0x2d')][_0xc9ca('0x1e')]){return handleError(_0x504c6a,0x1f4,{'message':_0xc9ca('0x2e')});}var _0x1cff62=rs[_0xc9ca('0x2f')]();_0x10f5a2[_0xc9ca('0x2d')][_0xc9ca('0x1e')]=_0x10f5a2['body'][_0xc9ca('0x1e')][_0xc9ca('0x30')]()[_0xc9ca('0x31')]();var _0x5aefa4;return db[_0xc9ca('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xc9ca('0xa'),_0xc9ca('0x16')],'raw':!![]})[_0xc9ca('0xb')](function(_0x1ad888){_0x5aefa4=_0x1ad888;return db['User'][_0xc9ca('0x1d')]({'where':{'email':_0x10f5a2['body']['email']}});})[_0xc9ca('0xb')](function(_0x5593fa){if(!_0x5593fa){throw new Error(_0xc9ca('0x32'));}if(_0x5593fa[_0xc9ca('0x14')]){throw new Error(_0xc9ca('0x33'));}if(_0x5593fa[_0xc9ca('0x1a')]){if(moment(_0x5593fa[_0xc9ca('0xd')])['add'](_0x5aefa4[_0xc9ca('0x16')],_0xc9ca('0x18'))>moment()){throw new Error(_0xc9ca('0x34'));}else{_0x5593fa[_0xc9ca('0x1a')]=![];_0x5593fa[_0xc9ca('0xd')]=null;}}_0x5593fa[_0xc9ca('0x35')]=_0x1cff62;_0x5593fa[_0xc9ca('0x36')]=Date['now']()+0x36ee80;return _0x5593fa[_0xc9ca('0x37')]();})['then'](function(){return sendServiceMail({'to':_0x10f5a2[_0xc9ca('0x2d')][_0xc9ca('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc9ca('0x38')+_0xc9ca('0x39')+_0xc9ca('0x3a')+_0x10f5a2[_0xc9ca('0x3b')][_0xc9ca('0x3c')]+_0xc9ca('0x3d')+_0x1cff62+'\x0a\x0a'+_0xc9ca('0x3e')});})[_0xc9ca('0xb')](function(){_0x504c6a[_0xc9ca('0x26')](0xc8)[_0xc9ca('0x3f')]({'message':_0xc9ca('0x40')});})[_0xc9ca('0x1c')](function(_0x5177f5){return handleError(_0x504c6a,0x1f4,_0x5177f5);});};exports[_0xc9ca('0x41')]=function(_0x402450,_0x5b5dfd){return db[_0xc9ca('0x42')]['find']({'where':{'resetPasswordToken':_0x402450['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xc9ca('0x43')]()}}})[_0xc9ca('0xb')](function(_0x1a348a){if(!_0x1a348a){throw new Error(_0xc9ca('0x44'));}return db[_0xc9ca('0x8')]['findOne']({'attributes':['id',_0xc9ca('0x45'),_0xc9ca('0x46'),_0xc9ca('0x47')]})[_0xc9ca('0xb')](function(_0x4dfb05){if(_0x4dfb05['securePassword'])authService[_0xc9ca('0x48')](_0x402450['body']['password']);if(!_0x4dfb05[_0xc9ca('0x46')]||!_0x1a348a[_0xc9ca('0x49')])return _0x1a348a;authService['validatePasswordHistory'](_0x402450[_0xc9ca('0x2d')][_0xc9ca('0x4a')],_0x1a348a['previousPasswords'],_0x4dfb05[_0xc9ca('0x47')]);return _0x1a348a;})[_0xc9ca('0xb')](function(){_0x1a348a['password']=_0x402450[_0xc9ca('0x2d')]['password'];_0x1a348a[_0xc9ca('0x35')]=null;_0x1a348a['resetPasswordExpires']=null;return _0x1a348a[_0xc9ca('0x37')]();});})[_0xc9ca('0xb')](function(){_0x5b5dfd[_0xc9ca('0x26')](0xc8)[_0xc9ca('0x3f')]({'message':_0xc9ca('0x4b')});})[_0xc9ca('0x1c')](function(_0xec4065){return handleError(_0x5b5dfd,0x1f4,_0xec4065);});};passport[_0xc9ca('0x4c')](_0xc9ca('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0xc9ca('0x4a')},function(_0x3d3bf7,_0x45fec7,_0x2a7f0a){return localAuthenticate(db[_0xc9ca('0x42')],_0x3d3bf7,_0x45fec7,_0x2a7f0a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b48e693..3277724 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 _0x4f3b=['./authLocal.controller','post','login','forgot','/reset/:token','express','Router'];(function(_0x50daa4,_0x3c336d){var _0x389935=function(_0x292d12){while(--_0x292d12){_0x50daa4['push'](_0x50daa4['shift']());}};_0x389935(++_0x3c336d);}(_0x4f3b,0xa6));var _0xb4f3=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x4f3b[_0x1ed116];return _0x574066;};'use strict';var express=require(_0xb4f3('0x0'));var router=express[_0xb4f3('0x1')]();var controller=require(_0xb4f3('0x2'));router[_0xb4f3('0x3')]('/',controller[_0xb4f3('0x4')]);router[_0xb4f3('0x3')]('/forgot',controller[_0xb4f3('0x5')]);router[_0xb4f3('0x3')](_0xb4f3('0x6'),controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0xbea4=['exports','express','login','post','/forgot','/reset/:token'];(function(_0x519663,_0x3dcd48){var _0x5009e0=function(_0x3f6053){while(--_0x3f6053){_0x519663['push'](_0x519663['shift']());}};_0x5009e0(++_0x3dcd48);}(_0xbea4,0xf1));var _0x4bea=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xbea4[_0x4fc9e6];return _0x551d28;};'use strict';var express=require(_0x4bea('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4bea('0x1')]);router[_0x4bea('0x2')](_0x4bea('0x3'),controller['forgot']);router[_0x4bea('0x2')](_0x4bea('0x4'),controller['reset']);module[_0x4bea('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index da217c1..468b884 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 _0xa830=['exports','STRING','INTEGER','sequelize'];(function(_0x21bb9c,_0x3d75dc){var _0x51f2a2=function(_0x122eb3){while(--_0x122eb3){_0x21bb9c['push'](_0x21bb9c['shift']());}};_0x51f2a2(++_0x3d75dc);}(_0xa830,0xbb));var _0x0a83=function(_0x470d17,_0x32e508){_0x470d17=_0x470d17-0x0;var _0xd6558d=_0xa830[_0x470d17];return _0xd6558d;};'use strict';var Sequelize=require(_0x0a83('0x0'));module[_0x0a83('0x1')]={'name':{'type':Sequelize[_0x0a83('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0a83('0x2')]},'description':{'type':Sequelize[_0x0a83('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a83('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x6d33=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x6d33,0x82));var _0x36d3=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x6d33[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0x36d3('0x0'));module[_0x36d3('0x1')]={'name':{'type':Sequelize[_0x36d3('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x36d3('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x36d3('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x36d3('0x4')],'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 851b786..66235e0 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 _0x0b54=['nolimit','order','sort','pick','where','merge','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','addConditions','Condition','ids','getConditions','findOne','filter','hasOwnProperty','addActions','getActions','Action','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes'];(function(_0x44afb1,_0x46d299){var _0x450252=function(_0x185f2a){while(--_0x185f2a){_0x44afb1['push'](_0x44afb1['shift']());}};_0x450252(++_0x46d299);}(_0x0b54,0x11b));var _0x40b5=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x0b54[_0x166742];return _0xb7814a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40b5('0x0'));var zipdir=require(_0x40b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40b5('0x2'));var moment=require(_0x40b5('0x3'));var BPromise=require(_0x40b5('0x4'));var Mustache=require(_0x40b5('0x5'));var util=require(_0x40b5('0x6'));var path=require(_0x40b5('0x7'));var sox=require('sox');var csv=require(_0x40b5('0x8'));var ejs=require(_0x40b5('0x9'));var fs=require('fs');var fs_extra=require(_0x40b5('0xa'));var _=require(_0x40b5('0xb'));var squel=require(_0x40b5('0xc'));var crypto=require(_0x40b5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x40b5('0xe'));var toCsv=require(_0x40b5('0x8'));var querystring=require(_0x40b5('0xf'));var Papa=require('papaparse');var Redis=require(_0x40b5('0x10'));var authService=require(_0x40b5('0x11'));var qs=require(_0x40b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40b5('0x13'));var logger=require(_0x40b5('0x14'))('api');var utils=require(_0x40b5('0x15'));var config=require(_0x40b5('0x16'));var licenseUtil=require(_0x40b5('0x17'));var db=require(_0x40b5('0x18'))['db'];function respondWithStatusCode(_0x3b52e4,_0x1d5bff){_0x1d5bff=_0x1d5bff||0xcc;return function(_0x44e38a){if(_0x44e38a){return _0x3b52e4[_0x40b5('0x19')](_0x1d5bff);}return _0x3b52e4[_0x40b5('0x1a')](_0x1d5bff)[_0x40b5('0x1b')]();};}function respondWithResult(_0x312658,_0x290e62){_0x290e62=_0x290e62||0xc8;return function(_0x179741){if(_0x179741){return _0x312658[_0x40b5('0x1a')](_0x290e62)[_0x40b5('0x1c')](_0x179741);}};}function respondWithFilteredResult(_0x4f14de,_0x25c6e1){return function(_0x315124){if(_0x315124){var _0x1f9339=typeof _0x25c6e1[_0x40b5('0x1d')]===_0x40b5('0x1e')&&typeof _0x25c6e1[_0x40b5('0x1f')]===_0x40b5('0x1e');var _0x40d34d=_0x315124['count'];var _0x3e735a=_0x1f9339?0x0:_0x25c6e1[_0x40b5('0x1d')];var _0xc98446=_0x1f9339?_0x315124[_0x40b5('0x20')]:_0x25c6e1[_0x40b5('0x1d')]+_0x25c6e1[_0x40b5('0x1f')];var _0x215451;if(_0xc98446>=_0x40d34d){_0xc98446=_0x40d34d;_0x215451=0xc8;}else{_0x215451=0xce;}_0x4f14de['status'](_0x215451);return _0x4f14de[_0x40b5('0x21')](_0x40b5('0x22'),_0x3e735a+'-'+_0xc98446+'/'+_0x40d34d)['json'](_0x315124);}return null;};}function patchUpdates(_0x4e55a7){return function(_0x3fe024){try{jsonpatch[_0x40b5('0x23')](_0x3fe024,_0x4e55a7,!![]);}catch(_0x23578d){return BPromise[_0x40b5('0x24')](_0x23578d);}return _0x3fe024['save']();};}function saveUpdates(_0x2ee085,_0x35ff79){return function(_0x15eef7){if(_0x15eef7){return _0x15eef7[_0x40b5('0x25')](_0x2ee085)[_0x40b5('0x26')](function(_0x4e1bf5){return _0x4e1bf5;});}return null;};}function removeEntity(_0x46d86a,_0x19582c){return function(_0x524993){if(_0x524993){return _0x524993[_0x40b5('0x27')]()[_0x40b5('0x26')](function(){_0x46d86a['status'](0xcc)[_0x40b5('0x1b')]();});}};}function handleEntityNotFound(_0x501150,_0x5f5a65){return function(_0x446d53){if(!_0x446d53){_0x501150[_0x40b5('0x19')](0x194);}return _0x446d53;};}function handleError(_0x50d681,_0x5469a8){_0x5469a8=_0x5469a8||0x1f4;return function(_0x49894e){logger[_0x40b5('0x28')](_0x49894e[_0x40b5('0x29')]);if(_0x49894e['name']){delete _0x49894e[_0x40b5('0x2a')];}_0x50d681['status'](_0x5469a8)[_0x40b5('0x2b')](_0x49894e);};}exports[_0x40b5('0x2c')]=function(_0x6821d1,_0x5cc153){var _0x5ebd16={},_0xb7aace={},_0x1d90ad={'count':0x0,'rows':[]};var _0x3b9011=_[_0x40b5('0x2d')](db[_0x40b5('0x2e')][_0x40b5('0x2f')],function(_0x2a2f21){return{'name':_0x2a2f21[_0x40b5('0x30')],'type':_0x2a2f21[_0x40b5('0x31')][_0x40b5('0x32')]};});_0xb7aace[_0x40b5('0x33')]=_[_0x40b5('0x2d')](_0x3b9011,'name');_0xb7aace[_0x40b5('0x34')]=_[_0x40b5('0x35')](_0x6821d1[_0x40b5('0x34')]);_0xb7aace[_0x40b5('0x36')]=_['intersection'](_0xb7aace[_0x40b5('0x33')],_0xb7aace[_0x40b5('0x34')]);_0x5ebd16['attributes']=_['intersection'](_0xb7aace['model'],qs[_0x40b5('0x37')](_0x6821d1['query']['fields']));_0x5ebd16[_0x40b5('0x38')]=_0x5ebd16[_0x40b5('0x38')]['length']?_0x5ebd16['attributes']:_0xb7aace['model'];if(!_0x6821d1['query']['hasOwnProperty'](_0x40b5('0x39'))){_0x5ebd16[_0x40b5('0x1f')]=qs[_0x40b5('0x1f')](_0x6821d1[_0x40b5('0x34')][_0x40b5('0x1f')]);_0x5ebd16[_0x40b5('0x1d')]=qs['offset'](_0x6821d1[_0x40b5('0x34')]['offset']);}_0x5ebd16[_0x40b5('0x3a')]=qs['sort'](_0x6821d1[_0x40b5('0x34')][_0x40b5('0x3b')]);_0x5ebd16['where']=qs[_0x40b5('0x36')](_[_0x40b5('0x3c')](_0x6821d1[_0x40b5('0x34')],_0xb7aace[_0x40b5('0x36')]),_0x3b9011);if(_0x6821d1[_0x40b5('0x34')]['filter']){_0x5ebd16[_0x40b5('0x3d')]=_[_0x40b5('0x3e')](_0x5ebd16[_0x40b5('0x3d')],{'$or':_[_0x40b5('0x2d')](_0x3b9011,function(_0xaa3b11){if(_0xaa3b11[_0x40b5('0x31')]!=='VIRTUAL'){var _0x1afc24={};_0x1afc24[_0xaa3b11['name']]={'$like':'%'+_0x6821d1['query']['filter']+'%'};return _0x1afc24;}})});}_0x5ebd16=_[_0x40b5('0x3e')]({},_0x5ebd16,_0x6821d1[_0x40b5('0x3f')]);var _0x54161d={'where':_0x5ebd16[_0x40b5('0x3d')]};return db['Automation'][_0x40b5('0x20')](_0x54161d)[_0x40b5('0x26')](function(_0x1757e9){_0x1d90ad[_0x40b5('0x20')]=_0x1757e9;if(_0x6821d1[_0x40b5('0x34')][_0x40b5('0x40')]){_0x5ebd16[_0x40b5('0x41')]=[{'all':!![]}];}return db[_0x40b5('0x2e')]['findAll'](_0x5ebd16);})['then'](function(_0xcdc996){_0x1d90ad[_0x40b5('0x42')]=_0xcdc996;return _0x1d90ad;})[_0x40b5('0x26')](respondWithFilteredResult(_0x5cc153,_0x5ebd16))[_0x40b5('0x43')](handleError(_0x5cc153,null));};exports[_0x40b5('0x44')]=function(_0x4a691a,_0x359f51){var _0x556e40={'raw':![],'where':{'id':_0x4a691a[_0x40b5('0x45')]['id']}},_0x5cab5c={};_0x5cab5c['model']=_[_0x40b5('0x35')](db['Automation'][_0x40b5('0x2f')]);_0x5cab5c[_0x40b5('0x34')]=_[_0x40b5('0x35')](_0x4a691a['query']);_0x5cab5c[_0x40b5('0x36')]=_[_0x40b5('0x46')](_0x5cab5c['model'],_0x5cab5c[_0x40b5('0x34')]);_0x556e40['attributes']=_[_0x40b5('0x46')](_0x5cab5c[_0x40b5('0x33')],qs[_0x40b5('0x37')](_0x4a691a[_0x40b5('0x34')]['fields']));_0x556e40['attributes']=_0x556e40['attributes'][_0x40b5('0x47')]?_0x556e40[_0x40b5('0x38')]:_0x5cab5c[_0x40b5('0x33')];if(_0x4a691a[_0x40b5('0x34')][_0x40b5('0x40')]){_0x556e40[_0x40b5('0x41')]=[{'all':!![]}];}_0x556e40=_[_0x40b5('0x3e')]({},_0x556e40,_0x4a691a[_0x40b5('0x3f')]);return db[_0x40b5('0x2e')][_0x40b5('0x48')](_0x556e40)[_0x40b5('0x26')](handleEntityNotFound(_0x359f51,null))[_0x40b5('0x26')](respondWithResult(_0x359f51,null))['catch'](handleError(_0x359f51,null));};exports[_0x40b5('0x49')]=function(_0x2884be,_0x27e082){return db[_0x40b5('0x2e')][_0x40b5('0x49')](_0x2884be[_0x40b5('0x4a')],{})['then'](respondWithResult(_0x27e082,0xc9))['catch'](handleError(_0x27e082,null));};exports[_0x40b5('0x25')]=function(_0x1a42c2,_0x2fa794){if(_0x1a42c2[_0x40b5('0x4a')]['id']){delete _0x1a42c2['body']['id'];}return db[_0x40b5('0x2e')][_0x40b5('0x48')]({'where':{'id':_0x1a42c2['params']['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x2fa794,null))[_0x40b5('0x26')](saveUpdates(_0x1a42c2[_0x40b5('0x4a')],null))[_0x40b5('0x26')](respondWithResult(_0x2fa794,null))[_0x40b5('0x43')](handleError(_0x2fa794,null));};exports[_0x40b5('0x27')]=function(_0x1d3571,_0x55fa75){return db[_0x40b5('0x2e')]['find']({'where':{'id':_0x1d3571['params']['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x55fa75,null))[_0x40b5('0x26')](removeEntity(_0x55fa75,null))['catch'](handleError(_0x55fa75,null));};exports[_0x40b5('0x4b')]=function(_0x38aa6f,_0x3c0a6d,_0x9a7447){return db[_0x40b5('0x4c')][_0x40b5('0x48')]({'where':{'id':_0x38aa6f[_0x40b5('0x45')]['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x3c0a6d,null))[_0x40b5('0x26')](function(_0x49aca7){if(_0x49aca7){return _0x49aca7[_0x40b5('0x4b')](_0x38aa6f[_0x40b5('0x4a')][_0x40b5('0x4d')],_['omit'](_0x38aa6f[_0x40b5('0x4a')],[_0x40b5('0x4d'),'id'])||{});}})[_0x40b5('0x26')](respondWithResult(_0x3c0a6d,null))[_0x40b5('0x43')](handleError(_0x3c0a6d,null));};exports[_0x40b5('0x4e')]=function(_0x4d15f1,_0xf402ff,_0x411d3e){var _0x3735d4={};var _0x284291={};var _0x343483;var _0x4b2080;return db[_0x40b5('0x2e')][_0x40b5('0x4f')]({'where':{'id':_0x4d15f1[_0x40b5('0x45')]['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0xf402ff,null))[_0x40b5('0x26')](function(_0x1f14a3){if(_0x1f14a3){_0x343483=_0x1f14a3;_0x284291['model']=_[_0x40b5('0x35')](db[_0x40b5('0x4c')]['rawAttributes']);_0x284291['query']=_[_0x40b5('0x35')](_0x4d15f1[_0x40b5('0x34')]);_0x284291[_0x40b5('0x36')]=_[_0x40b5('0x46')](_0x284291[_0x40b5('0x33')],_0x284291['query']);_0x3735d4[_0x40b5('0x38')]=_['intersection'](_0x284291[_0x40b5('0x33')],qs['fields'](_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x37')]));_0x3735d4[_0x40b5('0x38')]=_0x3735d4[_0x40b5('0x38')][_0x40b5('0x47')]?_0x3735d4[_0x40b5('0x38')]:_0x284291[_0x40b5('0x33')];_0x3735d4['order']=qs[_0x40b5('0x3b')](_0x4d15f1['query'][_0x40b5('0x3b')]);_0x3735d4[_0x40b5('0x3d')]=qs[_0x40b5('0x36')](_['pick'](_0x4d15f1[_0x40b5('0x34')],_0x284291[_0x40b5('0x36')]));if(_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x50')]){_0x3735d4[_0x40b5('0x3d')]=_[_0x40b5('0x3e')](_0x3735d4['where'],{'$or':_['map'](_0x3735d4[_0x40b5('0x38')],function(_0x4cc76b){var _0x303da6={};_0x303da6[_0x4cc76b]={'$like':'%'+_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x50')]+'%'};return _0x303da6;})});}_0x3735d4=_[_0x40b5('0x3e')]({},_0x3735d4,_0x4d15f1['options']);return _0x343483['getConditions'](_0x3735d4);}})['then'](function(_0x3c1130){if(_0x3c1130){_0x4b2080=_0x3c1130['length'];if(!_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x51')](_0x40b5('0x39'))){_0x3735d4[_0x40b5('0x1f')]=qs[_0x40b5('0x1f')](_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x1f')]);_0x3735d4[_0x40b5('0x1d')]=qs[_0x40b5('0x1d')](_0x4d15f1[_0x40b5('0x34')][_0x40b5('0x1d')]);}return _0x343483[_0x40b5('0x4e')](_0x3735d4);}})['then'](function(_0x1cea2e){if(_0x1cea2e){return _0x1cea2e?{'count':_0x4b2080,'rows':_0x1cea2e}:null;}})[_0x40b5('0x26')](respondWithResult(_0xf402ff,null))['catch'](handleError(_0xf402ff,null));};exports[_0x40b5('0x52')]=function(_0x26831c,_0x222410,_0x2352d0){return db['Action'][_0x40b5('0x48')]({'where':{'id':_0x26831c['params']['id']}})[_0x40b5('0x26')](handleEntityNotFound(_0x222410,null))['then'](function(_0x370225){if(_0x370225){return _0x370225[_0x40b5('0x52')](_0x26831c[_0x40b5('0x4a')][_0x40b5('0x4d')],_['omit'](_0x26831c[_0x40b5('0x4a')],['ids','id'])||{});}})[_0x40b5('0x26')](respondWithResult(_0x222410,null))[_0x40b5('0x43')](handleError(_0x222410,null));};exports[_0x40b5('0x53')]=function(_0x209646,_0x4cb395,_0x3d93dc){var _0x3835a4={};var _0x35e607={};var _0x46db84;var _0x5a7610;return db[_0x40b5('0x2e')][_0x40b5('0x4f')]({'where':{'id':_0x209646['params']['id']}})['then'](handleEntityNotFound(_0x4cb395,null))[_0x40b5('0x26')](function(_0x59af8e){if(_0x59af8e){_0x46db84=_0x59af8e;_0x35e607['model']=_['keys'](db[_0x40b5('0x54')]['rawAttributes']);_0x35e607[_0x40b5('0x34')]=_[_0x40b5('0x35')](_0x209646[_0x40b5('0x34')]);_0x35e607[_0x40b5('0x36')]=_['intersection'](_0x35e607[_0x40b5('0x33')],_0x35e607[_0x40b5('0x34')]);_0x3835a4['attributes']=_['intersection'](_0x35e607[_0x40b5('0x33')],qs[_0x40b5('0x37')](_0x209646[_0x40b5('0x34')][_0x40b5('0x37')]));_0x3835a4[_0x40b5('0x38')]=_0x3835a4[_0x40b5('0x38')]['length']?_0x3835a4['attributes']:_0x35e607['model'];_0x3835a4[_0x40b5('0x3a')]=qs[_0x40b5('0x3b')](_0x209646[_0x40b5('0x34')][_0x40b5('0x3b')]);_0x3835a4[_0x40b5('0x3d')]=qs[_0x40b5('0x36')](_[_0x40b5('0x3c')](_0x209646[_0x40b5('0x34')],_0x35e607[_0x40b5('0x36')]));if(_0x209646[_0x40b5('0x34')][_0x40b5('0x50')]){_0x3835a4[_0x40b5('0x3d')]=_[_0x40b5('0x3e')](_0x3835a4['where'],{'$or':_[_0x40b5('0x2d')](_0x3835a4['attributes'],function(_0x5b2940){var _0x5ac201={};_0x5ac201[_0x5b2940]={'$like':'%'+_0x209646[_0x40b5('0x34')]['filter']+'%'};return _0x5ac201;})});}_0x3835a4=_[_0x40b5('0x3e')]({},_0x3835a4,_0x209646['options']);return _0x46db84[_0x40b5('0x53')](_0x3835a4);}})[_0x40b5('0x26')](function(_0x228cd6){if(_0x228cd6){_0x5a7610=_0x228cd6['length'];if(!_0x209646[_0x40b5('0x34')][_0x40b5('0x51')](_0x40b5('0x39'))){_0x3835a4[_0x40b5('0x1f')]=qs[_0x40b5('0x1f')](_0x209646[_0x40b5('0x34')][_0x40b5('0x1f')]);_0x3835a4[_0x40b5('0x1d')]=qs[_0x40b5('0x1d')](_0x209646[_0x40b5('0x34')]['offset']);}return _0x46db84[_0x40b5('0x53')](_0x3835a4);}})[_0x40b5('0x26')](function(_0x502f3d){if(_0x502f3d){return _0x502f3d?{'count':_0x5a7610,'rows':_0x502f3d}:null;}})['then'](respondWithResult(_0x4cb395,null))[_0x40b5('0x43')](handleError(_0x4cb395,null));};
\ No newline at end of file
+var _0xc4b5=['jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','Automation','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','getActions','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x220900,_0x5b1eeb){var _0x5e143c=function(_0x230886){while(--_0x230886){_0x220900['push'](_0x220900['shift']());}};_0x5e143c(++_0x5b1eeb);}(_0xc4b5,0xf7));var _0x5c4b=function(_0xa9b530,_0xb439e3){_0xa9b530=_0xa9b530-0x0;var _0x5d21e5=_0xc4b5[_0xa9b530];return _0x5d21e5;};'use strict';var emlformat=require(_0x5c4b('0x0'));var rimraf=require(_0x5c4b('0x1'));var zipdir=require(_0x5c4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c4b('0x3'));var moment=require(_0x5c4b('0x4'));var BPromise=require(_0x5c4b('0x5'));var Mustache=require(_0x5c4b('0x6'));var util=require(_0x5c4b('0x7'));var path=require(_0x5c4b('0x8'));var sox=require(_0x5c4b('0x9'));var csv=require('to-csv');var ejs=require(_0x5c4b('0xa'));var fs=require('fs');var fs_extra=require(_0x5c4b('0xb'));var _=require('lodash');var squel=require(_0x5c4b('0xc'));var crypto=require(_0x5c4b('0xd'));var jsforce=require(_0x5c4b('0xe'));var deskjs=require(_0x5c4b('0xf'));var toCsv=require(_0x5c4b('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c4b('0x11'));var qs=require(_0x5c4b('0x12'));var as=require(_0x5c4b('0x13'));var hardwareService=require(_0x5c4b('0x14'));var logger=require(_0x5c4b('0x15'))(_0x5c4b('0x16'));var utils=require(_0x5c4b('0x17'));var config=require(_0x5c4b('0x18'));var licenseUtil=require(_0x5c4b('0x19'));var db=require(_0x5c4b('0x1a'))['db'];function respondWithStatusCode(_0x46e246,_0xf379b4){_0xf379b4=_0xf379b4||0xcc;return function(_0x201a47){if(_0x201a47){return _0x46e246[_0x5c4b('0x1b')](_0xf379b4);}return _0x46e246[_0x5c4b('0x1c')](_0xf379b4)[_0x5c4b('0x1d')]();};}function respondWithResult(_0x17df64,_0x21c9ef){_0x21c9ef=_0x21c9ef||0xc8;return function(_0x303a47){if(_0x303a47){return _0x17df64[_0x5c4b('0x1c')](_0x21c9ef)['json'](_0x303a47);}};}function respondWithFilteredResult(_0x236ef0,_0x260ef5){return function(_0x190fee){if(_0x190fee){var _0xbed3d5=typeof _0x260ef5['offset']===_0x5c4b('0x1e')&&typeof _0x260ef5[_0x5c4b('0x1f')]===_0x5c4b('0x1e');var _0x2e2726=_0x190fee[_0x5c4b('0x20')];var _0x30a27f=_0xbed3d5?0x0:_0x260ef5[_0x5c4b('0x21')];var _0xf0e71f=_0xbed3d5?_0x190fee['count']:_0x260ef5[_0x5c4b('0x21')]+_0x260ef5[_0x5c4b('0x1f')];var _0x3c576e;if(_0xf0e71f>=_0x2e2726){_0xf0e71f=_0x2e2726;_0x3c576e=0xc8;}else{_0x3c576e=0xce;}_0x236ef0[_0x5c4b('0x1c')](_0x3c576e);return _0x236ef0[_0x5c4b('0x22')](_0x5c4b('0x23'),_0x30a27f+'-'+_0xf0e71f+'/'+_0x2e2726)[_0x5c4b('0x24')](_0x190fee);}return null;};}function patchUpdates(_0x350ab4){return function(_0x499cde){try{jsonpatch[_0x5c4b('0x25')](_0x499cde,_0x350ab4,!![]);}catch(_0x331b5b){return BPromise[_0x5c4b('0x26')](_0x331b5b);}return _0x499cde[_0x5c4b('0x27')]();};}function saveUpdates(_0x15ba64,_0x323ff1){return function(_0x1ddfa7){if(_0x1ddfa7){return _0x1ddfa7['update'](_0x15ba64)[_0x5c4b('0x28')](function(_0x25a31c){return _0x25a31c;});}return null;};}function removeEntity(_0x10b7d6,_0x37bd49){return function(_0x13ba35){if(_0x13ba35){return _0x13ba35[_0x5c4b('0x29')]()['then'](function(){_0x10b7d6[_0x5c4b('0x1c')](0xcc)[_0x5c4b('0x1d')]();});}};}function handleEntityNotFound(_0x431eae,_0x1d1f54){return function(_0x4da10a){if(!_0x4da10a){_0x431eae[_0x5c4b('0x1b')](0x194);}return _0x4da10a;};}function handleError(_0x49756f,_0x118306){_0x118306=_0x118306||0x1f4;return function(_0x3c7d68){logger[_0x5c4b('0x2a')](_0x3c7d68['stack']);if(_0x3c7d68[_0x5c4b('0x2b')]){delete _0x3c7d68[_0x5c4b('0x2b')];}_0x49756f['status'](_0x118306)[_0x5c4b('0x2c')](_0x3c7d68);};}exports[_0x5c4b('0x2d')]=function(_0x1e8086,_0x4706f5){var _0x494c3b={},_0x9ae907={},_0x343b66={'count':0x0,'rows':[]};var _0x59b80f=_['map'](db[_0x5c4b('0x2e')][_0x5c4b('0x2f')],function(_0x11521c){return{'name':_0x11521c[_0x5c4b('0x30')],'type':_0x11521c['type'][_0x5c4b('0x31')]};});_0x9ae907[_0x5c4b('0x32')]=_[_0x5c4b('0x33')](_0x59b80f,_0x5c4b('0x2b'));_0x9ae907[_0x5c4b('0x34')]=_[_0x5c4b('0x35')](_0x1e8086[_0x5c4b('0x34')]);_0x9ae907[_0x5c4b('0x36')]=_[_0x5c4b('0x37')](_0x9ae907['model'],_0x9ae907[_0x5c4b('0x34')]);_0x494c3b['attributes']=_['intersection'](_0x9ae907['model'],qs[_0x5c4b('0x38')](_0x1e8086[_0x5c4b('0x34')][_0x5c4b('0x38')]));_0x494c3b[_0x5c4b('0x39')]=_0x494c3b['attributes'][_0x5c4b('0x3a')]?_0x494c3b[_0x5c4b('0x39')]:_0x9ae907['model'];if(!_0x1e8086[_0x5c4b('0x34')]['hasOwnProperty'](_0x5c4b('0x3b'))){_0x494c3b['limit']=qs[_0x5c4b('0x1f')](_0x1e8086[_0x5c4b('0x34')]['limit']);_0x494c3b[_0x5c4b('0x21')]=qs[_0x5c4b('0x21')](_0x1e8086['query'][_0x5c4b('0x21')]);}_0x494c3b[_0x5c4b('0x3c')]=qs['sort'](_0x1e8086['query'][_0x5c4b('0x3d')]);_0x494c3b[_0x5c4b('0x3e')]=qs['filters'](_[_0x5c4b('0x3f')](_0x1e8086['query'],_0x9ae907[_0x5c4b('0x36')]),_0x59b80f);if(_0x1e8086[_0x5c4b('0x34')]['filter']){_0x494c3b[_0x5c4b('0x3e')]=_[_0x5c4b('0x40')](_0x494c3b[_0x5c4b('0x3e')],{'$or':_['map'](_0x59b80f,function(_0x1c336b){if(_0x1c336b[_0x5c4b('0x41')]!=='VIRTUAL'){var _0x47da97={};_0x47da97[_0x1c336b[_0x5c4b('0x2b')]]={'$like':'%'+_0x1e8086[_0x5c4b('0x34')][_0x5c4b('0x42')]+'%'};return _0x47da97;}})});}_0x494c3b=_['merge']({},_0x494c3b,_0x1e8086['options']);var _0x5b0381={'where':_0x494c3b[_0x5c4b('0x3e')]};return db[_0x5c4b('0x2e')][_0x5c4b('0x20')](_0x5b0381)[_0x5c4b('0x28')](function(_0x36cb2c){_0x343b66[_0x5c4b('0x20')]=_0x36cb2c;if(_0x1e8086['query'][_0x5c4b('0x43')]){_0x494c3b[_0x5c4b('0x44')]=[{'all':!![]}];}return db['Automation'][_0x5c4b('0x45')](_0x494c3b);})[_0x5c4b('0x28')](function(_0x510055){_0x343b66[_0x5c4b('0x46')]=_0x510055;return _0x343b66;})[_0x5c4b('0x28')](respondWithFilteredResult(_0x4706f5,_0x494c3b))[_0x5c4b('0x47')](handleError(_0x4706f5,null));};exports[_0x5c4b('0x48')]=function(_0x605704,_0x34f214){var _0x32ad7b={'raw':![],'where':{'id':_0x605704[_0x5c4b('0x49')]['id']}},_0x33e3cb={};_0x33e3cb[_0x5c4b('0x32')]=_['keys'](db[_0x5c4b('0x2e')][_0x5c4b('0x2f')]);_0x33e3cb['query']=_[_0x5c4b('0x35')](_0x605704[_0x5c4b('0x34')]);_0x33e3cb['filters']=_[_0x5c4b('0x37')](_0x33e3cb[_0x5c4b('0x32')],_0x33e3cb[_0x5c4b('0x34')]);_0x32ad7b[_0x5c4b('0x39')]=_['intersection'](_0x33e3cb['model'],qs[_0x5c4b('0x38')](_0x605704[_0x5c4b('0x34')]['fields']));_0x32ad7b[_0x5c4b('0x39')]=_0x32ad7b[_0x5c4b('0x39')][_0x5c4b('0x3a')]?_0x32ad7b['attributes']:_0x33e3cb[_0x5c4b('0x32')];if(_0x605704[_0x5c4b('0x34')][_0x5c4b('0x43')]){_0x32ad7b[_0x5c4b('0x44')]=[{'all':!![]}];}_0x32ad7b=_[_0x5c4b('0x40')]({},_0x32ad7b,_0x605704[_0x5c4b('0x4a')]);return db['Automation']['find'](_0x32ad7b)['then'](handleEntityNotFound(_0x34f214,null))[_0x5c4b('0x28')](respondWithResult(_0x34f214,null))[_0x5c4b('0x47')](handleError(_0x34f214,null));};exports[_0x5c4b('0x4b')]=function(_0x193277,_0x3ad117){return db[_0x5c4b('0x2e')][_0x5c4b('0x4b')](_0x193277[_0x5c4b('0x4c')],{})[_0x5c4b('0x28')](respondWithResult(_0x3ad117,0xc9))[_0x5c4b('0x47')](handleError(_0x3ad117,null));};exports['update']=function(_0x3a1587,_0x7d5756){if(_0x3a1587[_0x5c4b('0x4c')]['id']){delete _0x3a1587['body']['id'];}return db[_0x5c4b('0x2e')][_0x5c4b('0x4d')]({'where':{'id':_0x3a1587[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x7d5756,null))[_0x5c4b('0x28')](saveUpdates(_0x3a1587[_0x5c4b('0x4c')],null))[_0x5c4b('0x28')](respondWithResult(_0x7d5756,null))[_0x5c4b('0x47')](handleError(_0x7d5756,null));};exports[_0x5c4b('0x29')]=function(_0x241801,_0x26c0c9){return db[_0x5c4b('0x2e')][_0x5c4b('0x4d')]({'where':{'id':_0x241801[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x26c0c9,null))[_0x5c4b('0x28')](removeEntity(_0x26c0c9,null))[_0x5c4b('0x47')](handleError(_0x26c0c9,null));};exports['addConditions']=function(_0x20be87,_0x1c0133,_0x9f4561){return db[_0x5c4b('0x4e')]['find']({'where':{'id':_0x20be87[_0x5c4b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c0133,null))[_0x5c4b('0x28')](function(_0x382f35){if(_0x382f35){return _0x382f35['addConditions'](_0x20be87['body'][_0x5c4b('0x4f')],_[_0x5c4b('0x50')](_0x20be87[_0x5c4b('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x1c0133,null))['catch'](handleError(_0x1c0133,null));};exports[_0x5c4b('0x51')]=function(_0x34f068,_0xa90c8f,_0x72ebc5){var _0x4380d1={};var _0x5462fc={};var _0x2a467b;var _0x1a9817;return db['Automation'][_0x5c4b('0x52')]({'where':{'id':_0x34f068[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0xa90c8f,null))[_0x5c4b('0x28')](function(_0x4f71ad){if(_0x4f71ad){_0x2a467b=_0x4f71ad;_0x5462fc['model']=_[_0x5c4b('0x35')](db['Condition'][_0x5c4b('0x2f')]);_0x5462fc[_0x5c4b('0x34')]=_[_0x5c4b('0x35')](_0x34f068[_0x5c4b('0x34')]);_0x5462fc[_0x5c4b('0x36')]=_[_0x5c4b('0x37')](_0x5462fc['model'],_0x5462fc[_0x5c4b('0x34')]);_0x4380d1[_0x5c4b('0x39')]=_[_0x5c4b('0x37')](_0x5462fc[_0x5c4b('0x32')],qs[_0x5c4b('0x38')](_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x38')]));_0x4380d1[_0x5c4b('0x39')]=_0x4380d1[_0x5c4b('0x39')][_0x5c4b('0x3a')]?_0x4380d1[_0x5c4b('0x39')]:_0x5462fc[_0x5c4b('0x32')];_0x4380d1[_0x5c4b('0x3c')]=qs[_0x5c4b('0x3d')](_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x3d')]);_0x4380d1[_0x5c4b('0x3e')]=qs[_0x5c4b('0x36')](_['pick'](_0x34f068[_0x5c4b('0x34')],_0x5462fc[_0x5c4b('0x36')]));if(_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x42')]){_0x4380d1[_0x5c4b('0x3e')]=_[_0x5c4b('0x40')](_0x4380d1[_0x5c4b('0x3e')],{'$or':_[_0x5c4b('0x33')](_0x4380d1[_0x5c4b('0x39')],function(_0x3bac64){var _0x12eb39={};_0x12eb39[_0x3bac64]={'$like':'%'+_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x42')]+'%'};return _0x12eb39;})});}_0x4380d1=_['merge']({},_0x4380d1,_0x34f068['options']);return _0x2a467b[_0x5c4b('0x51')](_0x4380d1);}})[_0x5c4b('0x28')](function(_0x1cd444){if(_0x1cd444){_0x1a9817=_0x1cd444['length'];if(!_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x53')](_0x5c4b('0x3b'))){_0x4380d1[_0x5c4b('0x1f')]=qs[_0x5c4b('0x1f')](_0x34f068[_0x5c4b('0x34')][_0x5c4b('0x1f')]);_0x4380d1[_0x5c4b('0x21')]=qs['offset'](_0x34f068[_0x5c4b('0x34')]['offset']);}return _0x2a467b[_0x5c4b('0x51')](_0x4380d1);}})[_0x5c4b('0x28')](function(_0x201af9){if(_0x201af9){return _0x201af9?{'count':_0x1a9817,'rows':_0x201af9}:null;}})[_0x5c4b('0x28')](respondWithResult(_0xa90c8f,null))[_0x5c4b('0x47')](handleError(_0xa90c8f,null));};exports[_0x5c4b('0x54')]=function(_0x5a6639,_0x58b56d,_0x2fbed6){return db['Action']['find']({'where':{'id':_0x5a6639[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x58b56d,null))[_0x5c4b('0x28')](function(_0x5addda){if(_0x5addda){return _0x5addda['addActions'](_0x5a6639[_0x5c4b('0x4c')][_0x5c4b('0x4f')],_[_0x5c4b('0x50')](_0x5a6639[_0x5c4b('0x4c')],[_0x5c4b('0x4f'),'id'])||{});}})[_0x5c4b('0x28')](respondWithResult(_0x58b56d,null))[_0x5c4b('0x47')](handleError(_0x58b56d,null));};exports[_0x5c4b('0x55')]=function(_0x4bb7b8,_0x43b073,_0x4daeb8){var _0x60a490={};var _0x2b7137={};var _0x241c39;var _0xa60f53;return db[_0x5c4b('0x2e')][_0x5c4b('0x52')]({'where':{'id':_0x4bb7b8[_0x5c4b('0x49')]['id']}})[_0x5c4b('0x28')](handleEntityNotFound(_0x43b073,null))[_0x5c4b('0x28')](function(_0x4775b1){if(_0x4775b1){_0x241c39=_0x4775b1;_0x2b7137[_0x5c4b('0x32')]=_[_0x5c4b('0x35')](db[_0x5c4b('0x56')]['rawAttributes']);_0x2b7137[_0x5c4b('0x34')]=_[_0x5c4b('0x35')](_0x4bb7b8[_0x5c4b('0x34')]);_0x2b7137[_0x5c4b('0x36')]=_[_0x5c4b('0x37')](_0x2b7137[_0x5c4b('0x32')],_0x2b7137['query']);_0x60a490[_0x5c4b('0x39')]=_[_0x5c4b('0x37')](_0x2b7137[_0x5c4b('0x32')],qs[_0x5c4b('0x38')](_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x38')]));_0x60a490[_0x5c4b('0x39')]=_0x60a490[_0x5c4b('0x39')][_0x5c4b('0x3a')]?_0x60a490[_0x5c4b('0x39')]:_0x2b7137[_0x5c4b('0x32')];_0x60a490['order']=qs[_0x5c4b('0x3d')](_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x3d')]);_0x60a490[_0x5c4b('0x3e')]=qs[_0x5c4b('0x36')](_[_0x5c4b('0x3f')](_0x4bb7b8[_0x5c4b('0x34')],_0x2b7137[_0x5c4b('0x36')]));if(_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x42')]){_0x60a490[_0x5c4b('0x3e')]=_[_0x5c4b('0x40')](_0x60a490[_0x5c4b('0x3e')],{'$or':_[_0x5c4b('0x33')](_0x60a490[_0x5c4b('0x39')],function(_0x5cc85e){var _0x23a8e2={};_0x23a8e2[_0x5cc85e]={'$like':'%'+_0x4bb7b8[_0x5c4b('0x34')]['filter']+'%'};return _0x23a8e2;})});}_0x60a490=_[_0x5c4b('0x40')]({},_0x60a490,_0x4bb7b8[_0x5c4b('0x4a')]);return _0x241c39['getActions'](_0x60a490);}})[_0x5c4b('0x28')](function(_0x565e2f){if(_0x565e2f){_0xa60f53=_0x565e2f[_0x5c4b('0x3a')];if(!_0x4bb7b8[_0x5c4b('0x34')][_0x5c4b('0x53')](_0x5c4b('0x3b'))){_0x60a490[_0x5c4b('0x1f')]=qs[_0x5c4b('0x1f')](_0x4bb7b8[_0x5c4b('0x34')]['limit']);_0x60a490[_0x5c4b('0x21')]=qs[_0x5c4b('0x21')](_0x4bb7b8[_0x5c4b('0x34')]['offset']);}return _0x241c39[_0x5c4b('0x55')](_0x60a490);}})['then'](function(_0x3194f1){if(_0x3194f1){return _0x3194f1?{'count':_0xa60f53,'rows':_0x3194f1}:null;}})[_0x5c4b('0x28')](respondWithResult(_0x43b073,null))['catch'](handleError(_0x43b073,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 32b30e6..2c55ff4 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 _0x6150=['bluebird','path','rimraf','../../config/environment','define','tools_automations','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6150,0x84));var _0x0615=function(_0x30c77f,_0x44693d){_0x30c77f=_0x30c77f-0x0;var _0x1d97a7=_0x6150[_0x30c77f];return _0x1d97a7;};'use strict';var _=require(_0x0615('0x0'));var util=require(_0x0615('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0615('0x2'));var BPromise=require(_0x0615('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0615('0x4'));var rimraf=require(_0x0615('0x5'));var config=require(_0x0615('0x6'));var attributes=require('./automation.attributes');module['exports']=function(_0x24c347,_0x4fc441){return _0x24c347[_0x0615('0x7')]('Automation',attributes,{'tableName':_0x0615('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x23c0=['./automation.attributes','exports','Automation','util','api','bluebird','rimraf','../../config/environment'];(function(_0x246371,_0x3ca7e0){var _0x1da5b5=function(_0x37f80b){while(--_0x37f80b){_0x246371['push'](_0x246371['shift']());}};_0x1da5b5(++_0x3ca7e0);}(_0x23c0,0x1c3));var _0x023c=function(_0x463e5b,_0x52feee){_0x463e5b=_0x463e5b-0x0;var _0x1b5e35=_0x23c0[_0x463e5b];return _0x1b5e35;};'use strict';var _=require('lodash');var util=require(_0x023c('0x0'));var logger=require('../../config/logger')(_0x023c('0x1'));var moment=require('moment');var BPromise=require(_0x023c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x023c('0x3'));var config=require(_0x023c('0x4'));var attributes=require(_0x023c('0x5'));module[_0x023c('0x6')]=function(_0x47f354,_0x2b17ea){return _0x47f354['define'](_0x023c('0x7'),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 1018420..e9af981 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 _0x0954=['Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info'];(function(_0x849e7c,_0x34014e){var _0x11722f=function(_0x1a3fa3){while(--_0x1a3fa3){_0x849e7c['push'](_0x849e7c['shift']());}};_0x11722f(++_0x34014e);}(_0x0954,0x135));var _0x4095=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x0954[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x4095('0x0'));var util=require('util');var moment=require(_0x4095('0x1'));var BPromise=require(_0x4095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4095('0x3'));var db=require(_0x4095('0x4'))['db'];var utils=require(_0x4095('0x5'));var logger=require(_0x4095('0x6'))(_0x4095('0x7'));var config=require(_0x4095('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14b440,_0x352c8f,_0x1cf027){return new BPromise(function(_0x1440af,_0x24adfd){return client[_0x4095('0x9')](_0x14b440,_0x1cf027)['then'](function(_0x158dc7){logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,'request\x20sent');logger[_0x4095('0xc')](_0x4095('0xd'),_0x352c8f,_0x4095('0xe'),JSON['stringify'](_0x158dc7));if(_0x158dc7[_0x4095('0xf')]){if(_0x158dc7['error'][_0x4095('0x10')]===0x1f4){logger['error'](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x24adfd(_0x158dc7['error']['message']);}logger[_0x4095('0xf')](_0x4095('0xb'),_0x352c8f,_0x158dc7[_0x4095('0xf')][_0x4095('0x11')]);return _0x1440af(_0x158dc7['error']['message']);}else{logger[_0x4095('0xa')](_0x4095('0xb'),_0x352c8f,_0x4095('0xe'));_0x1440af(_0x158dc7[_0x4095('0x12')][_0x4095('0x11')]);}})[_0x4095('0x13')](function(_0x50c8c0){logger['error'](_0x4095('0xb'),_0x352c8f,_0x50c8c0);_0x24adfd(_0x50c8c0);});});}
\ No newline at end of file
+var _0x8f1a=['debug','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x35c12c,_0x378ba0){var _0x2bab3a=function(_0x43eeb2){while(--_0x43eeb2){_0x35c12c['push'](_0x35c12c['shift']());}};_0x2bab3a(++_0x378ba0);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x51f537,_0x5a2b9b){_0x51f537=_0x51f537-0x0;var _0x4b3920=_0x8f1a[_0x51f537];return _0x4b3920;};'use strict';var _=require(_0xa8f1('0x0'));var util=require(_0xa8f1('0x1'));var moment=require(_0xa8f1('0x2'));var BPromise=require(_0xa8f1('0x3'));var rs=require(_0xa8f1('0x4'));var fs=require('fs');var Redis=require(_0xa8f1('0x5'));var db=require(_0xa8f1('0x6'))['db'];var utils=require(_0xa8f1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8f1('0x9')][_0xa8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c2920,_0x43c3ed,_0x13f210){return new BPromise(function(_0xcc8a38,_0x36b58b){return client[_0xa8f1('0xb')](_0x4c2920,_0x13f210)[_0xa8f1('0xc')](function(_0x1a23a0){logger[_0xa8f1('0xd')]('Automation,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'));logger[_0xa8f1('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'),JSON['stringify'](_0x1a23a0));if(_0x1a23a0[_0xa8f1('0x10')]){if(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x11')]===0x1f4){logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);return _0x36b58b(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);}logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0['error'][_0xa8f1('0x13')]);return _0xcc8a38(_0x1a23a0[_0xa8f1('0x10')]['message']);}else{logger['info'](_0xa8f1('0x12'),_0x43c3ed,_0xa8f1('0xe'));_0xcc8a38(_0x1a23a0[_0xa8f1('0x14')][_0xa8f1('0x13')]);}})[_0xa8f1('0x15')](function(_0x15bfad){logger[_0xa8f1('0x10')](_0xa8f1('0x12'),_0x43c3ed,_0x15bfad);_0x36b58b(_0x15bfad);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 480956b..538e8ee 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 _0x82f5=['getConditions','getActions','post','create','addConditions','/:id/actions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions'];(function(_0x55eae9,_0x609612){var _0x1db073=function(_0x32f0ff){while(--_0x32f0ff){_0x55eae9['push'](_0x55eae9['shift']());}};_0x1db073(++_0x609612);}(_0x82f5,0x15d));var _0x582f=function(_0x4168ba,_0x544a68){_0x4168ba=_0x4168ba-0x0;var _0x314cd5=_0x82f5[_0x4168ba];return _0x314cd5;};'use strict';var multer=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var path=require(_0x582f('0x2'));var timeout=require(_0x582f('0x3'));var express=require(_0x582f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x582f('0x5'));var interaction=require(_0x582f('0x6'));var config=require(_0x582f('0x7'));var controller=require(_0x582f('0x8'));router[_0x582f('0x9')]('/',auth[_0x582f('0xa')](),controller[_0x582f('0xb')]);router['get'](_0x582f('0xc'),auth['isAuthenticated'](),controller[_0x582f('0xd')]);router[_0x582f('0x9')](_0x582f('0xe'),auth['isAuthenticated'](),controller[_0x582f('0xf')]);router[_0x582f('0x9')]('/:id/actions',auth[_0x582f('0xa')](),controller[_0x582f('0x10')]);router[_0x582f('0x11')]('/',auth[_0x582f('0xa')](),controller[_0x582f('0x12')]);router['post']('/:id/conditions',auth[_0x582f('0xa')](),controller[_0x582f('0x13')]);router[_0x582f('0x11')](_0x582f('0x14'),auth[_0x582f('0xa')](),controller['addActions']);router[_0x582f('0x15')](_0x582f('0xc'),auth['isAuthenticated'](),controller[_0x582f('0x16')]);router[_0x582f('0x17')](_0x582f('0xc'),auth[_0x582f('0xa')](),controller[_0x582f('0x18')]);module[_0x582f('0x19')]=router;
\ No newline at end of file
+var _0x430e=['Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports','util','path','express'];(function(_0x26b7f7,_0x1533fe){var _0x199e66=function(_0x14357e){while(--_0x14357e){_0x26b7f7['push'](_0x26b7f7['shift']());}};_0x199e66(++_0x1533fe);}(_0x430e,0x105));var _0xe430=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0x430e[_0x2fb356];return _0x27fb4b;};'use strict';var multer=require('multer');var util=require(_0xe430('0x0'));var path=require(_0xe430('0x1'));var timeout=require('connect-timeout');var express=require(_0xe430('0x2'));var router=express[_0xe430('0x3')]();var fs_extra=require(_0xe430('0x4'));var auth=require(_0xe430('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe430('0x6'));var controller=require(_0xe430('0x7'));router[_0xe430('0x8')]('/',auth[_0xe430('0x9')](),controller['index']);router[_0xe430('0x8')](_0xe430('0xa'),auth[_0xe430('0x9')](),controller[_0xe430('0xb')]);router[_0xe430('0x8')]('/:id/conditions',auth[_0xe430('0x9')](),controller[_0xe430('0xc')]);router[_0xe430('0x8')](_0xe430('0xd'),auth[_0xe430('0x9')](),controller['getActions']);router[_0xe430('0xe')]('/',auth[_0xe430('0x9')](),controller[_0xe430('0xf')]);router[_0xe430('0xe')](_0xe430('0x10'),auth['isAuthenticated'](),controller[_0xe430('0x11')]);router['post']('/:id/actions',auth[_0xe430('0x9')](),controller[_0xe430('0x12')]);router[_0xe430('0x13')](_0xe430('0xa'),auth[_0xe430('0x9')](),controller[_0xe430('0x14')]);router[_0xe430('0x15')]('/:id',auth[_0xe430('0x9')](),controller[_0xe430('0x16')]);module[_0xe430('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 98d0463..8ecaa85 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 _0xb2af=['always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','onlyIfOpen'];(function(_0x2d194b,_0x28fa16){var _0x53c88d=function(_0x213ff5){while(--_0x213ff5){_0x2d194b['push'](_0x2d194b['shift']());}};_0x53c88d(++_0x28fa16);}(_0xb2af,0xd2));var _0xfb2a=function(_0x876d6d,_0xd557c){_0x876d6d=_0x876d6d-0x0;var _0x5d5a43=_0xb2af[_0x876d6d];return _0x5d5a43;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'name':{'type':Sequelize[_0xfb2a('0x2')],'unique':_0xfb2a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfb2a('0x4')),'allowNull':![],'defaultValue':_0xfb2a('0x4')},'description':{'type':Sequelize[_0xfb2a('0x2')]},'active':{'type':Sequelize[_0xfb2a('0x5')],'defaultValue':0x0,'comment':_0xfb2a('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfb2a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfb2a('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfb2a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xfb2a('0x10')]('always','never',_0xfb2a('0x11')),'defaultValue':_0xfb2a('0x12')},'dialAMDActive':{'type':Sequelize[_0xfb2a('0x5')],'defaultValue':0x0,'comment':_0xfb2a('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfb2a('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfb2a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfb2a('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfb2a('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xfb2a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfb2a('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfb2a('0x9')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfb2a('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfb2a('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfb2a('0x9')](0x9)[_0xfb2a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfb2a('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfb2a('0x10')](_0xfb2a('0x1b'),_0xfb2a('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xfb2a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xfb2a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfb2a('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xfb2a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfb2a('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)[_0xfb2a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb2a('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfb2a('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfb2a('0x9')](0x5)[_0xfb2a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb2a('0x25')}};
\ No newline at end of file
+var _0xef6d=['07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ivr','BOOLEAN','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x29f96d,_0x35e5b6){var _0x223056=function(_0x1c2a43){while(--_0x1c2a43){_0x29f96d['push'](_0x29f96d['shift']());}};_0x223056(++_0x35e5b6);}(_0xef6d,0x1df));var _0xdef6=function(_0x4e75bf,_0x3b7e84){_0x4e75bf=_0x4e75bf-0x0;var _0x1e8f3e=_0xef6d[_0x4e75bf];return _0x1e8f3e;};'use strict';var Sequelize=require(_0xdef6('0x0'));module[_0xdef6('0x1')]={'name':{'type':Sequelize[_0xdef6('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdef6('0x3')),'allowNull':![],'defaultValue':_0xdef6('0x3')},'description':{'type':Sequelize[_0xdef6('0x2')]},'active':{'type':Sequelize[_0xdef6('0x4')],'defaultValue':0x0,'comment':_0xdef6('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xdef6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdef6('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdef6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdef6('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdef6('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdef6('0x2')],'defaultValue':_0xdef6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xdef6('0x10')]('always',_0xdef6('0x11'),_0xdef6('0x12')),'defaultValue':_0xdef6('0x13')},'dialAMDActive':{'type':Sequelize[_0xdef6('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdef6('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdef6('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xdef6('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdef6('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdef6('0x8')](0x9)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdef6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdef6('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdef6('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdef6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdef6('0x10')](_0xdef6('0x1a'),_0xdef6('0x1b')),'defaultValue':_0xdef6('0x1a')},'dialPrefix':{'type':Sequelize[_0xdef6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdef6('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdef6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdef6('0x8')](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdef6('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdef6('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdef6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdef6('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 07bf36b..1911a27 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 _0x6e90=['sort','filters','pick','filter','where','merge','type','VIRTUAL','Campaign','includeAll','findAll','rows','catch','show','params','include','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','error','update','getHoppers','CmHopper','nolimit','CampaignId','getHopperHistories','findOne','CmHopperHistory','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','ContactId','COALESCE(phone,\x27\x27)','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x6e90,0xf5));var _0x06e9=function(_0x4071a3,_0x3f18e5){_0x4071a3=_0x4071a3-0x0;var _0x310280=_0x6e90[_0x4071a3];return _0x310280;};'use strict';var emlformat=require(_0x06e9('0x0'));var rimraf=require(_0x06e9('0x1'));var zipdir=require(_0x06e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x06e9('0x4'));var util=require(_0x06e9('0x5'));var path=require(_0x06e9('0x6'));var sox=require(_0x06e9('0x7'));var csv=require(_0x06e9('0x8'));var ejs=require(_0x06e9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06e9('0xa'));var squel=require(_0x06e9('0xb'));var crypto=require(_0x06e9('0xc'));var jsforce=require(_0x06e9('0xd'));var deskjs=require(_0x06e9('0xe'));var toCsv=require(_0x06e9('0x8'));var querystring=require(_0x06e9('0xf'));var Papa=require(_0x06e9('0x10'));var Redis=require(_0x06e9('0x11'));var authService=require(_0x06e9('0x12'));var qs=require(_0x06e9('0x13'));var as=require(_0x06e9('0x14'));var hardwareService=require(_0x06e9('0x15'));var logger=require(_0x06e9('0x16'))(_0x06e9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x06e9('0x18'));var db=require(_0x06e9('0x19'))['db'];function respondWithStatusCode(_0x3eea8d,_0xf8100a){_0xf8100a=_0xf8100a||0xcc;return function(_0x1d1e2b){if(_0x1d1e2b){return _0x3eea8d[_0x06e9('0x1a')](_0xf8100a);}return _0x3eea8d['status'](_0xf8100a)[_0x06e9('0x1b')]();};}function respondWithResult(_0x3783bd,_0x215c94){_0x215c94=_0x215c94||0xc8;return function(_0x365f2c){if(_0x365f2c){return _0x3783bd[_0x06e9('0x1c')](_0x215c94)[_0x06e9('0x1d')](_0x365f2c);}};}function respondWithFilteredResult(_0xf808b6,_0x1855b8){return function(_0x27c3b5){if(_0x27c3b5){var _0x309b7d=typeof _0x1855b8[_0x06e9('0x1e')]==='undefined'&&typeof _0x1855b8['limit']===_0x06e9('0x1f');var _0xf42c19=_0x27c3b5[_0x06e9('0x20')];var _0x54167b=_0x309b7d?0x0:_0x1855b8[_0x06e9('0x1e')];var _0x22cc1e=_0x309b7d?_0x27c3b5['count']:_0x1855b8[_0x06e9('0x1e')]+_0x1855b8[_0x06e9('0x21')];var _0x4aa3dc;if(_0x22cc1e>=_0xf42c19){_0x22cc1e=_0xf42c19;_0x4aa3dc=0xc8;}else{_0x4aa3dc=0xce;}_0xf808b6['status'](_0x4aa3dc);return _0xf808b6[_0x06e9('0x22')](_0x06e9('0x23'),_0x54167b+'-'+_0x22cc1e+'/'+_0xf42c19)[_0x06e9('0x1d')](_0x27c3b5);}return null;};}function patchUpdates(_0x3d6d4f){return function(_0x5568b5){try{jsonpatch['apply'](_0x5568b5,_0x3d6d4f,!![]);}catch(_0x4fe4f1){return BPromise[_0x06e9('0x24')](_0x4fe4f1);}return _0x5568b5[_0x06e9('0x25')]();};}function saveUpdates(_0x19b3e1,_0x5264b9){return function(_0x2d27c5){if(_0x2d27c5){return _0x2d27c5['update'](_0x19b3e1)['then'](function(_0x1862bd){return _0x1862bd;});}return null;};}function removeEntity(_0x3a6936,_0x533fd8){return function(_0x4aced4){if(_0x4aced4){return _0x4aced4[_0x06e9('0x26')]()[_0x06e9('0x27')](function(){var _0x13f5ce=_0x4aced4[_0x06e9('0x28')]({'plain':!![]});var _0x58f4be=_0x06e9('0x29');return db[_0x06e9('0x2a')][_0x06e9('0x26')]({'where':{'type':_0x58f4be,'resourceId':_0x13f5ce['id']}})[_0x06e9('0x27')](function(){return _0x4aced4;});})['then'](function(){_0x3a6936[_0x06e9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdaf290,_0x426a29){return function(_0x1f685){if(!_0x1f685){_0xdaf290[_0x06e9('0x1a')](0x194);}return _0x1f685;};}function handleError(_0x5b9317,_0x3c3f39){_0x3c3f39=_0x3c3f39||0x1f4;return function(_0x13a981){logger['error'](_0x13a981[_0x06e9('0x2b')]);if(_0x13a981['name']){delete _0x13a981[_0x06e9('0x2c')];}_0x5b9317[_0x06e9('0x1c')](_0x3c3f39)[_0x06e9('0x2d')](_0x13a981);};}exports[_0x06e9('0x2e')]=function(_0x4d1b10,_0x490377){var _0x355858={},_0x574bbf={},_0x346296={'count':0x0,'rows':[]};var _0x5936e8=_[_0x06e9('0x2f')](db['Campaign'][_0x06e9('0x30')],function(_0x544f2c){return{'name':_0x544f2c[_0x06e9('0x31')],'type':_0x544f2c['type'][_0x06e9('0x32')]};});_0x574bbf[_0x06e9('0x33')]=_[_0x06e9('0x2f')](_0x5936e8,_0x06e9('0x2c'));_0x574bbf['query']=_[_0x06e9('0x34')](_0x4d1b10[_0x06e9('0x35')]);_0x574bbf['filters']=_[_0x06e9('0x36')](_0x574bbf[_0x06e9('0x33')],_0x574bbf[_0x06e9('0x35')]);_0x355858['attributes']=_[_0x06e9('0x36')](_0x574bbf['model'],qs[_0x06e9('0x37')](_0x4d1b10['query'][_0x06e9('0x37')]));_0x355858[_0x06e9('0x38')]=_0x355858[_0x06e9('0x38')][_0x06e9('0x39')]?_0x355858['attributes']:_0x574bbf['model'];if(!_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x3a')]('nolimit')){_0x355858[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x4d1b10['query'][_0x06e9('0x21')]);_0x355858[_0x06e9('0x1e')]=qs['offset'](_0x4d1b10['query']['offset']);}_0x355858['order']=qs[_0x06e9('0x3b')](_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x355858['where']=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x4d1b10['query'],_0x574bbf[_0x06e9('0x3c')]),_0x5936e8);if(_0x4d1b10['query'][_0x06e9('0x3e')]){_0x355858[_0x06e9('0x3f')]=_[_0x06e9('0x40')](_0x355858[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x5936e8,function(_0x4e1085){if(_0x4e1085[_0x06e9('0x41')]!==_0x06e9('0x42')){var _0x21cfdf={};_0x21cfdf[_0x4e1085['name']]={'$like':'%'+_0x4d1b10['query'][_0x06e9('0x3e')]+'%'};return _0x21cfdf;}})});}_0x355858=_[_0x06e9('0x40')]({},_0x355858,_0x4d1b10['options']);var _0x27f304={'where':_0x355858[_0x06e9('0x3f')]};return db[_0x06e9('0x43')][_0x06e9('0x20')](_0x27f304)['then'](function(_0x1b5b10){_0x346296[_0x06e9('0x20')]=_0x1b5b10;if(_0x4d1b10[_0x06e9('0x35')][_0x06e9('0x44')]){_0x355858['include']=[{'all':!![]}];}return db[_0x06e9('0x43')][_0x06e9('0x45')](_0x355858);})[_0x06e9('0x27')](function(_0x42bdbf){_0x346296[_0x06e9('0x46')]=_0x42bdbf;return _0x346296;})[_0x06e9('0x27')](respondWithFilteredResult(_0x490377,_0x355858))[_0x06e9('0x47')](handleError(_0x490377,null));};exports[_0x06e9('0x48')]=function(_0x59dd17,_0x6b41dd){var _0x178b0f={'raw':![],'where':{'id':_0x59dd17[_0x06e9('0x49')]['id']}},_0x43e06b={};_0x43e06b['model']=_[_0x06e9('0x34')](db[_0x06e9('0x43')][_0x06e9('0x30')]);_0x43e06b[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x59dd17['query']);_0x43e06b['filters']=_[_0x06e9('0x36')](_0x43e06b['model'],_0x43e06b[_0x06e9('0x35')]);_0x178b0f[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0x43e06b[_0x06e9('0x33')],qs['fields'](_0x59dd17[_0x06e9('0x35')][_0x06e9('0x37')]));_0x178b0f['attributes']=_0x178b0f['attributes'][_0x06e9('0x39')]?_0x178b0f[_0x06e9('0x38')]:_0x43e06b[_0x06e9('0x33')];if(_0x59dd17[_0x06e9('0x35')][_0x06e9('0x44')]){_0x178b0f[_0x06e9('0x4a')]=[{'all':!![]}];}_0x178b0f=_[_0x06e9('0x40')]({},_0x178b0f,_0x59dd17[_0x06e9('0x4b')]);return db[_0x06e9('0x43')]['find'](_0x178b0f)[_0x06e9('0x27')](handleEntityNotFound(_0x6b41dd,null))['then'](respondWithResult(_0x6b41dd,null))[_0x06e9('0x47')](handleError(_0x6b41dd,null));};exports['create']=function(_0x587609,_0x33bfc5){return db[_0x06e9('0x43')]['create'](_0x587609[_0x06e9('0x4c')],{})['then'](function(_0x59a4bc){var _0x17ef2c=_0x587609['user'][_0x06e9('0x28')]({'plain':!![]});if(!_0x17ef2c)throw new Error(_0x06e9('0x4d'));if(_0x17ef2c[_0x06e9('0x4e')]===_0x06e9('0x4f')){var _0x50af90=_0x59a4bc[_0x06e9('0x28')]({'plain':!![]});var _0x2a39a5=_0x06e9('0x29');return db[_0x06e9('0x50')][_0x06e9('0x51')]({'where':{'name':_0x2a39a5,'userProfileId':_0x17ef2c[_0x06e9('0x52')]},'raw':!![]})['then'](function(_0xd05d6c){if(_0xd05d6c&&_0xd05d6c[_0x06e9('0x53')]===0x0){return db[_0x06e9('0x2a')]['create']({'name':_0x50af90[_0x06e9('0x2c')],'resourceId':_0x50af90['id'],'type':_0xd05d6c[_0x06e9('0x2c')],'sectionId':_0xd05d6c['id']},{})[_0x06e9('0x27')](function(){return _0x59a4bc;});}else{return _0x59a4bc;}})[_0x06e9('0x47')](function(_0x90ae69){logger['error'](_0x06e9('0x54'),_0x90ae69);throw _0x90ae69;});}return _0x59a4bc;})['then'](respondWithResult(_0x33bfc5,0xc9))[_0x06e9('0x47')](handleError(_0x33bfc5,null));};exports[_0x06e9('0x55')]=function(_0x49f60d,_0x56ef80){var _0x587b6a={'where':{'id':_0x49f60d[_0x06e9('0x49')]['id']}},_0xb73d5c={};_0xb73d5c['model']=_[_0x06e9('0x34')](db[_0x06e9('0x43')]['rawAttributes']);_0x587b6a['attributes']=_[_0x06e9('0x36')](_0xb73d5c[_0x06e9('0x33')],qs['fields'](_0x49f60d[_0x06e9('0x35')]['fields']));_0x587b6a['attributes']=_0x587b6a['attributes']['length']?_0x587b6a['attributes']:_0xb73d5c['model'];if(_0x49f60d[_0x06e9('0x35')][_0x06e9('0x44')]){_0x587b6a[_0x06e9('0x4a')]=[{'all':!![]}];}_0x587b6a=_[_0x06e9('0x40')]({},_0x587b6a,_0x49f60d[_0x06e9('0x4b')]);return db[_0x06e9('0x43')][_0x06e9('0x51')](_0x587b6a)[_0x06e9('0x27')](handleEntityNotFound(_0x56ef80,null))[_0x06e9('0x27')](function(_0x513c39){if(_0x513c39){var _0x1d25bd=_0x513c39[_0x06e9('0x28')]({'plain':!![]});_0x1d25bd=qs['omit'](_0x1d25bd,['id',_0x06e9('0x56'),_0x06e9('0x57')]);_0x49f60d[_0x06e9('0x4c')]=_[_0x06e9('0x58')](_0x49f60d['body'],['id',_0x06e9('0x56'),'updatedAt']);return db[_0x06e9('0x43')][_0x06e9('0x59')](_[_0x06e9('0x40')](_0x1d25bd,_0x49f60d[_0x06e9('0x4c')]),{'include':_0x49f60d[_0x06e9('0x35')][_0x06e9('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x1d29e7){var _0x944bb3=_0x49f60d[_0x06e9('0x4f')]['get']({'plain':!![]});if(!_0x944bb3)throw new Error(_0x06e9('0x4d'));if(_0x944bb3[_0x06e9('0x4e')]==='user'){var _0x482c83=_0x1d29e7[_0x06e9('0x28')]({'plain':!![]});var _0x2a2605='IvrCampaigns';return db[_0x06e9('0x50')][_0x06e9('0x51')]({'where':{'name':_0x2a2605,'userProfileId':_0x944bb3[_0x06e9('0x52')]},'raw':!![]})['then'](function(_0x11ffe5){if(_0x11ffe5&&_0x11ffe5[_0x06e9('0x53')]===0x0){return db[_0x06e9('0x2a')][_0x06e9('0x59')]({'name':_0x482c83[_0x06e9('0x2c')],'resourceId':_0x482c83['id'],'type':_0x11ffe5[_0x06e9('0x2c')],'sectionId':_0x11ffe5['id']},{})[_0x06e9('0x27')](function(){return _0x1d29e7;});}else{return _0x1d29e7;}})[_0x06e9('0x47')](function(_0x5414d4){logger[_0x06e9('0x5a')](_0x06e9('0x54'),_0x5414d4);throw _0x5414d4;});}return _0x1d29e7;});}})['then'](respondWithResult(_0x56ef80,0xc9))['catch'](handleError(_0x56ef80,null));};exports[_0x06e9('0x5b')]=function(_0x26ac58,_0x45bf8a){if(_0x26ac58[_0x06e9('0x4c')]['id']){delete _0x26ac58[_0x06e9('0x4c')]['id'];}return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x26ac58[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x45bf8a,null))['then'](saveUpdates(_0x26ac58[_0x06e9('0x4c')],null))[_0x06e9('0x27')](respondWithResult(_0x45bf8a,null))[_0x06e9('0x47')](handleError(_0x45bf8a,null));};exports[_0x06e9('0x26')]=function(_0x14b897,_0xca7886){return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x14b897[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0xca7886,null))[_0x06e9('0x27')](removeEntity(_0xca7886,null))[_0x06e9('0x47')](handleError(_0xca7886,null));};exports[_0x06e9('0x5c')]=function(_0x2d5d36,_0x3afdff,_0x16a3df){var _0x463268={'raw':!![],'where':{}};var _0x2f319b={};var _0x3635ed={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2d5d36[_0x06e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3afdff,null))[_0x06e9('0x27')](function(_0x396a2d){if(_0x396a2d){_0x2f319b[_0x06e9('0x33')]=_[_0x06e9('0x34')](db[_0x06e9('0x5d')][_0x06e9('0x30')]);_0x2f319b['query']=_[_0x06e9('0x34')](_0x2d5d36[_0x06e9('0x35')]);_0x2f319b[_0x06e9('0x3c')]=_['intersection'](_0x2f319b[_0x06e9('0x33')],_0x2f319b['query']);_0x463268['attributes']=_[_0x06e9('0x36')](_0x2f319b['model'],qs[_0x06e9('0x37')](_0x2d5d36[_0x06e9('0x35')]['fields']));_0x463268[_0x06e9('0x38')]=_0x463268[_0x06e9('0x38')][_0x06e9('0x39')]?_0x463268[_0x06e9('0x38')]:_0x2f319b[_0x06e9('0x33')];if(!_0x2d5d36[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x463268[_0x06e9('0x21')]=qs['limit'](_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x21')]);_0x463268[_0x06e9('0x1e')]=qs[_0x06e9('0x1e')](_0x2d5d36[_0x06e9('0x35')]['offset']);}_0x463268['order']=qs['sort'](_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x463268[_0x06e9('0x3f')]=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x2d5d36[_0x06e9('0x35')],_0x2f319b['filters']));_0x463268[_0x06e9('0x3f')][_0x06e9('0x5f')]=_0x396a2d['id'];if(_0x2d5d36['query'][_0x06e9('0x3e')]){_0x463268['where']=_[_0x06e9('0x40')](_0x463268['where'],{'$or':_[_0x06e9('0x2f')](_0x463268['attributes'],function(_0x307a93){var _0x130746={};_0x130746[_0x307a93]={'$like':'%'+_0x2d5d36[_0x06e9('0x35')]['filter']+'%'};return _0x130746;})});}_0x463268=_[_0x06e9('0x40')]({},_0x463268,_0x2d5d36[_0x06e9('0x4b')]);return db[_0x06e9('0x5d')][_0x06e9('0x20')]({'where':_0x463268['where']})[_0x06e9('0x27')](function(_0x35d8af){_0x3635ed['count']=_0x35d8af;if(_0x2d5d36[_0x06e9('0x35')][_0x06e9('0x44')]){_0x463268[_0x06e9('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x06e9('0x45')](_0x463268);})['then'](function(_0x10b752){_0x3635ed[_0x06e9('0x46')]=_0x10b752;return _0x3635ed;});}})[_0x06e9('0x27')](respondWithFilteredResult(_0x3afdff,_0x463268))[_0x06e9('0x47')](handleError(_0x3afdff,null));};exports[_0x06e9('0x60')]=function(_0x34b35f,_0x233cba,_0x2aaff5){var _0x56383e={'raw':!![],'where':{}};var _0x15d5f0={};var _0x3c677f={'count':0x0,'rows':[]};return db[_0x06e9('0x43')][_0x06e9('0x61')]({'where':{'id':_0x34b35f[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x233cba,null))[_0x06e9('0x27')](function(_0x191756){if(_0x191756){_0x15d5f0[_0x06e9('0x33')]=_[_0x06e9('0x34')](db[_0x06e9('0x62')][_0x06e9('0x30')]);_0x15d5f0[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x34b35f['query']);_0x15d5f0['filters']=_[_0x06e9('0x36')](_0x15d5f0['model'],_0x15d5f0[_0x06e9('0x35')]);_0x56383e[_0x06e9('0x38')]=_['intersection'](_0x15d5f0['model'],qs[_0x06e9('0x37')](_0x34b35f[_0x06e9('0x35')]['fields']));_0x56383e[_0x06e9('0x38')]=_0x56383e[_0x06e9('0x38')]['length']?_0x56383e['attributes']:_0x15d5f0[_0x06e9('0x33')];if(!_0x34b35f[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x56383e[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x34b35f[_0x06e9('0x35')][_0x06e9('0x21')]);_0x56383e[_0x06e9('0x1e')]=qs['offset'](_0x34b35f[_0x06e9('0x35')][_0x06e9('0x1e')]);}_0x56383e[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x34b35f[_0x06e9('0x35')]['sort']);_0x56383e[_0x06e9('0x3f')]=qs['filters'](_['pick'](_0x34b35f['query'],_0x15d5f0[_0x06e9('0x3c')]));_0x56383e['where'][_0x06e9('0x5f')]=_0x191756['id'];if(_0x34b35f[_0x06e9('0x35')]['filter']){_0x56383e[_0x06e9('0x3f')]=_['merge'](_0x56383e[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x56383e[_0x06e9('0x38')],function(_0x277733){var _0x245075={};_0x245075[_0x277733]={'$like':'%'+_0x34b35f[_0x06e9('0x35')]['filter']+'%'};return _0x245075;})});}_0x56383e=_[_0x06e9('0x40')]({},_0x56383e,_0x34b35f[_0x06e9('0x4b')]);return db[_0x06e9('0x62')][_0x06e9('0x20')]({'where':_0x56383e[_0x06e9('0x3f')]})['then'](function(_0x3630e5){_0x3c677f['count']=_0x3630e5;if(_0x34b35f[_0x06e9('0x35')][_0x06e9('0x44')]){_0x56383e[_0x06e9('0x4a')]=[{'all':!![]}];}return db[_0x06e9('0x62')][_0x06e9('0x45')](_0x56383e);})['then'](function(_0x1b44b3){_0x3c677f[_0x06e9('0x46')]=_0x1b44b3;return _0x3c677f;});}})[_0x06e9('0x27')](respondWithFilteredResult(_0x233cba,_0x56383e))['catch'](handleError(_0x233cba,null));};exports['getHopperFinals']=function(_0x3b253,_0x5a8dd0,_0x389b5a){var _0x35ab45={'raw':!![],'where':{}};var _0x267180={};var _0xbbd819={'count':0x0,'rows':[]};return db[_0x06e9('0x43')][_0x06e9('0x61')]({'where':{'id':_0x3b253[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x5a8dd0,null))[_0x06e9('0x27')](function(_0x5960c4){if(_0x5960c4){_0x267180['model']=_['keys'](db[_0x06e9('0x64')]['rawAttributes']);_0x267180[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x3b253[_0x06e9('0x35')]);_0x267180[_0x06e9('0x3c')]=_[_0x06e9('0x36')](_0x267180['model'],_0x267180[_0x06e9('0x35')]);_0x35ab45[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0x267180[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x3b253['query'][_0x06e9('0x37')]));_0x35ab45[_0x06e9('0x38')]=_0x35ab45[_0x06e9('0x38')][_0x06e9('0x39')]?_0x35ab45[_0x06e9('0x38')]:_0x267180[_0x06e9('0x33')];if(!_0x3b253[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x35ab45[_0x06e9('0x21')]=qs[_0x06e9('0x21')](_0x3b253[_0x06e9('0x35')][_0x06e9('0x21')]);_0x35ab45['offset']=qs['offset'](_0x3b253[_0x06e9('0x35')][_0x06e9('0x1e')]);}_0x35ab45[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x3b253['query'][_0x06e9('0x3b')]);_0x35ab45['where']=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x3b253[_0x06e9('0x35')],_0x267180[_0x06e9('0x3c')]));_0x35ab45[_0x06e9('0x3f')][_0x06e9('0x5f')]=_0x5960c4['id'];if(_0x3b253['query']['filter']){_0x35ab45[_0x06e9('0x3f')]=_['merge'](_0x35ab45[_0x06e9('0x3f')],{'$or':_['map'](_0x35ab45[_0x06e9('0x38')],function(_0x2cbac4){var _0x2fbe15={};_0x2fbe15[_0x2cbac4]={'$like':'%'+_0x3b253[_0x06e9('0x35')]['filter']+'%'};return _0x2fbe15;})});}_0x35ab45=_[_0x06e9('0x40')]({},_0x35ab45,_0x3b253[_0x06e9('0x4b')]);return db[_0x06e9('0x64')][_0x06e9('0x20')]({'where':_0x35ab45[_0x06e9('0x3f')]})[_0x06e9('0x27')](function(_0x480877){_0xbbd819[_0x06e9('0x20')]=_0x480877;if(_0x3b253[_0x06e9('0x35')][_0x06e9('0x44')]){_0x35ab45[_0x06e9('0x4a')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x06e9('0x45')](_0x35ab45);})[_0x06e9('0x27')](function(_0x2d3ec6){_0xbbd819[_0x06e9('0x46')]=_0x2d3ec6;return _0xbbd819;});}})['then'](respondWithFilteredResult(_0x5a8dd0,_0x35ab45))[_0x06e9('0x47')](handleError(_0x5a8dd0,null));};exports[_0x06e9('0x65')]=function(_0x30adef,_0x4b545e,_0x175b9d){var _0x12a326={'raw':!![],'where':{}};var _0xc0eb3f={};var _0x4feadb={'count':0x0,'rows':[]};return db[_0x06e9('0x43')]['findOne']({'where':{'id':_0x30adef[_0x06e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b545e,null))['then'](function(_0x2d86e0){if(_0x2d86e0){_0xc0eb3f['model']=_[_0x06e9('0x34')](db[_0x06e9('0x66')][_0x06e9('0x30')]);_0xc0eb3f['query']=_[_0x06e9('0x34')](_0x30adef['query']);_0xc0eb3f[_0x06e9('0x3c')]=_[_0x06e9('0x36')](_0xc0eb3f[_0x06e9('0x33')],_0xc0eb3f[_0x06e9('0x35')]);_0x12a326[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0xc0eb3f[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x30adef['query'][_0x06e9('0x37')]));_0x12a326['attributes']=_0x12a326[_0x06e9('0x38')]['length']?_0x12a326[_0x06e9('0x38')]:_0xc0eb3f[_0x06e9('0x33')];if(!_0x30adef[_0x06e9('0x35')][_0x06e9('0x3a')](_0x06e9('0x5e'))){_0x12a326['limit']=qs[_0x06e9('0x21')](_0x30adef[_0x06e9('0x35')][_0x06e9('0x21')]);_0x12a326[_0x06e9('0x1e')]=qs[_0x06e9('0x1e')](_0x30adef[_0x06e9('0x35')]['offset']);}_0x12a326[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x30adef[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x12a326[_0x06e9('0x3f')]=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x30adef[_0x06e9('0x35')],_0xc0eb3f[_0x06e9('0x3c')]));_0x12a326[_0x06e9('0x3f')][_0x06e9('0x5f')]=_0x2d86e0['id'];if(_0x30adef['query'][_0x06e9('0x3e')]){_0x12a326['where']=_['merge'](_0x12a326['where'],{'$or':_[_0x06e9('0x2f')](_0x12a326['attributes'],function(_0x1d2e0c){var _0x469519={};_0x469519[_0x1d2e0c]={'$like':'%'+_0x30adef['query'][_0x06e9('0x3e')]+'%'};return _0x469519;})});}_0x12a326=_[_0x06e9('0x40')]({},_0x12a326,_0x30adef['options']);return db[_0x06e9('0x66')][_0x06e9('0x20')]({'where':_0x12a326['where']})['then'](function(_0x286d66){_0x4feadb['count']=_0x286d66;if(_0x30adef['query'][_0x06e9('0x44')]){_0x12a326['include']=[{'all':!![]}];}return db[_0x06e9('0x66')][_0x06e9('0x45')](_0x12a326);})[_0x06e9('0x27')](function(_0x309da2){_0x4feadb['rows']=_0x309da2;return _0x4feadb;});}})['then'](respondWithFilteredResult(_0x4b545e,_0x12a326))[_0x06e9('0x47')](handleError(_0x4b545e,null));};exports[_0x06e9('0x67')]=function(_0x476a0b,_0x9038c5,_0xfb1b08){var _0x1f3b06={};var _0x27ace2={};var _0x18152f;var _0x42bff2;return db['Campaign']['findOne']({'where':{'id':_0x476a0b[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x9038c5,null))[_0x06e9('0x27')](function(_0x38dff2){if(_0x38dff2){_0x18152f=_0x38dff2;_0x27ace2[_0x06e9('0x33')]=_['keys'](db[_0x06e9('0x68')]['rawAttributes']);_0x27ace2[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x476a0b[_0x06e9('0x35')]);_0x27ace2[_0x06e9('0x3c')]=_[_0x06e9('0x36')](_0x27ace2[_0x06e9('0x33')],_0x27ace2[_0x06e9('0x35')]);_0x1f3b06[_0x06e9('0x38')]=_[_0x06e9('0x36')](_0x27ace2[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x476a0b[_0x06e9('0x35')][_0x06e9('0x37')]));_0x1f3b06[_0x06e9('0x38')]=_0x1f3b06[_0x06e9('0x38')][_0x06e9('0x39')]?_0x1f3b06[_0x06e9('0x38')]:_0x27ace2['model'];_0x1f3b06[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x476a0b[_0x06e9('0x35')]['sort']);_0x1f3b06['where']=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x476a0b[_0x06e9('0x35')],_0x27ace2[_0x06e9('0x3c')]));if(_0x476a0b[_0x06e9('0x35')][_0x06e9('0x3e')]){_0x1f3b06[_0x06e9('0x3f')]=_[_0x06e9('0x40')](_0x1f3b06[_0x06e9('0x3f')],{'$or':_[_0x06e9('0x2f')](_0x1f3b06[_0x06e9('0x38')],function(_0x406b90){var _0x5bcedf={};_0x5bcedf[_0x406b90]={'$like':'%'+_0x476a0b[_0x06e9('0x35')]['filter']+'%'};return _0x5bcedf;})});}_0x1f3b06=_[_0x06e9('0x40')]({},_0x1f3b06,_0x476a0b[_0x06e9('0x4b')]);return _0x18152f[_0x06e9('0x67')](_0x1f3b06);}})[_0x06e9('0x27')](function(_0x302dbf){if(_0x302dbf){_0x42bff2=_0x302dbf['length'];if(!_0x476a0b[_0x06e9('0x35')]['hasOwnProperty'](_0x06e9('0x5e'))){_0x1f3b06[_0x06e9('0x21')]=qs['limit'](_0x476a0b[_0x06e9('0x35')][_0x06e9('0x21')]);_0x1f3b06[_0x06e9('0x1e')]=qs['offset'](_0x476a0b[_0x06e9('0x35')][_0x06e9('0x1e')]);}return _0x18152f[_0x06e9('0x67')](_0x1f3b06);}})[_0x06e9('0x27')](function(_0x572378){if(_0x572378){return _0x572378?{'count':_0x42bff2,'rows':_0x572378}:null;}})[_0x06e9('0x27')](respondWithResult(_0x9038c5,null))['catch'](handleError(_0x9038c5,null));};exports[_0x06e9('0x69')]=function(_0x4b98c6,_0x395c93,_0x3e05fb){var _0x3652c6,_0x44776b;var _0x41877c=[];var _0x150c1b=moment()[_0x06e9('0x6a')](_0x06e9('0x6b'));return db['Campaign'][_0x06e9('0x51')]({'where':{'id':_0x4b98c6[_0x06e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x395c93,null))[_0x06e9('0x27')](function(_0x28a8d4){if(_0x28a8d4){_0x44776b=_0x28a8d4;return _0x28a8d4['addLists'](_0x4b98c6[_0x06e9('0x4c')][_0x06e9('0x6c')],_[_0x06e9('0x58')](_0x4b98c6[_0x06e9('0x4c')],[_0x06e9('0x6c'),'id'])||{});}return null;})['spread'](function(_0x23bd8e){var _0x498413;var _0x2682b2;_0x3652c6=_0x23bd8e||[];var _0x3941a8=[];if(_0x23bd8e){for(var _0x596e3d=0x0;_0x596e3d<_0x23bd8e[_0x06e9('0x39')];_0x596e3d+=0x1){var _0x5c0a96=_0x23bd8e[_0x596e3d]['get']({'plain':!![]});_0x44776b['dialCheckDuplicateType']=_0x4b98c6[_0x06e9('0x4c')][_0x06e9('0x6d')]?_0x4b98c6['body'][_0x06e9('0x6d')]:_0x44776b[_0x06e9('0x6d')];switch(_0x44776b['dialCheckDuplicateType']){case _0x06e9('0x6e'):_0x498413=squel[_0x06e9('0x6f')]()[_0x06e9('0x70')](_0x06e9('0x71'))[_0x06e9('0x72')]([_0x06e9('0x73'),_0x06e9('0x74'),'ContactId',_0x06e9('0x75'),_0x06e9('0x5f'),_0x06e9('0x56'),'updatedAt'],squel['select']()['field']('phone','phone')[_0x06e9('0x76')]('NOW()',_0x06e9('0x74'))[_0x06e9('0x76')]('id','ContactId')[_0x06e9('0x76')](_0x5c0a96['CmListId'][_0x06e9('0x77')](),_0x06e9('0x75'))[_0x06e9('0x76')](_0x4b98c6['params']['id']['toString'](),_0x06e9('0x5f'))[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27',_0x06e9('0x56'))[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27',_0x06e9('0x57'))[_0x06e9('0x78')](_0x06e9('0x79'))['where'](_0x06e9('0x7a'))[_0x06e9('0x3f')]('ListId\x20=\x20?',_0x5c0a96[_0x06e9('0x7b')][_0x06e9('0x77')]())[_0x06e9('0x3f')](_0x06e9('0x7c'))[_0x06e9('0x3f')](_0x06e9('0x7d'),squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x7f'))[_0x06e9('0x78')]('cm_hopper_final')[_0x06e9('0x3f')](_0x06e9('0x80'),_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')]()))[_0x06e9('0x3f')](_0x06e9('0x7d'),squel[_0x06e9('0x7e')]()[_0x06e9('0x76')]('COALESCE(phone,\x27\x27)')[_0x06e9('0x78')](_0x06e9('0x71'))['where'](_0x06e9('0x80'),_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')]())))[_0x06e9('0x77')]();break;case _0x06e9('0x81'):_0x498413=squel['insert']()[_0x06e9('0x70')](_0x06e9('0x71'))[_0x06e9('0x72')]([_0x06e9('0x73'),_0x06e9('0x74'),_0x06e9('0x82'),_0x06e9('0x75'),'CampaignId',_0x06e9('0x56'),_0x06e9('0x57')],squel[_0x06e9('0x7e')]()[_0x06e9('0x76')]('phone',_0x06e9('0x73'))[_0x06e9('0x76')]('NOW()',_0x06e9('0x74'))[_0x06e9('0x76')]('id','ContactId')[_0x06e9('0x76')](_0x5c0a96[_0x06e9('0x7b')][_0x06e9('0x77')](),_0x06e9('0x75'))['field'](_0x4b98c6[_0x06e9('0x49')]['id']['toString'](),'CampaignId')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27','createdAt')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27','updatedAt')[_0x06e9('0x78')](_0x06e9('0x79'))['where'](_0x06e9('0x7a'))[_0x06e9('0x3f')]('ListId\x20=\x20?',_0x5c0a96['CmListId'][_0x06e9('0x77')]())[_0x06e9('0x3f')](_0x06e9('0x7c'))[_0x06e9('0x3f')](_0x06e9('0x7d'),squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x83'))['from']('cm_hopper')[_0x06e9('0x3f')](_0x06e9('0x80'),_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')]())))[_0x06e9('0x77')]();break;default:_0x498413=squel['insert']()[_0x06e9('0x70')](_0x06e9('0x71'))[_0x06e9('0x72')]([_0x06e9('0x73'),'scheduledAt','ContactId','ListId',_0x06e9('0x5f'),_0x06e9('0x56'),_0x06e9('0x57')],squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x73'),_0x06e9('0x73'))['field'](_0x06e9('0x84'),_0x06e9('0x74'))[_0x06e9('0x76')]('id',_0x06e9('0x82'))[_0x06e9('0x76')](_0x5c0a96['CmListId'][_0x06e9('0x77')](),_0x06e9('0x75'))[_0x06e9('0x76')](_0x4b98c6[_0x06e9('0x49')]['id'][_0x06e9('0x77')](),_0x06e9('0x5f'))['field']('\x27'+_0x150c1b+'\x27','createdAt')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27',_0x06e9('0x57'))[_0x06e9('0x78')](_0x06e9('0x79'))[_0x06e9('0x3f')](_0x06e9('0x7a'))[_0x06e9('0x3f')](_0x06e9('0x85'),_0x5c0a96[_0x06e9('0x7b')]['toString']())[_0x06e9('0x3f')](_0x06e9('0x7c')))[_0x06e9('0x77')]();}_0x2682b2=squel[_0x06e9('0x6f')]()[_0x06e9('0x70')](_0x06e9('0x86'))[_0x06e9('0x72')]([_0x06e9('0x87'),_0x06e9('0x74'),_0x06e9('0x73'),'OrderBy','createdAt',_0x06e9('0x57')],squel['select']()[_0x06e9('0x76')](_0x06e9('0x88'),'id')[_0x06e9('0x76')]('NOW()',_0x06e9('0x74'))[_0x06e9('0x76')](_0x06e9('0x89'),_0x06e9('0x73'))[_0x06e9('0x76')](_0x06e9('0x8a'),'OrderBy')[_0x06e9('0x76')]('\x27'+_0x150c1b+'\x27','createdAt')['field']('\x27'+_0x150c1b+'\x27','updatedAt')[_0x06e9('0x78')](_0x06e9('0x8b'),'ci')['join'](_0x06e9('0x71'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x06e9('0x3f')](_0x06e9('0x8c'),_0x5c0a96[_0x06e9('0x7b')][_0x06e9('0x77')]())['where'](_0x06e9('0x8d'),_0x4b98c6['params']['id'][_0x06e9('0x77')]())['where'](_0x06e9('0x8e'),_0x150c1b))[_0x06e9('0x77')]();_0x3941a8['push'](db[_0x06e9('0x8f')][_0x06e9('0x35')](_0x498413));_0x41877c['push'](db[_0x06e9('0x8f')][_0x06e9('0x35')](_0x2682b2));}return BPromise[_0x06e9('0x90')](_0x3941a8);}})['then'](function(){return BPromise[_0x06e9('0x90')](_0x41877c);})['then'](function(){return _0x3652c6;})[_0x06e9('0x27')](respondWithResult(_0x395c93,null))[_0x06e9('0x47')](handleError(_0x395c93,null));};exports['removeLists']=function(_0x4045a1,_0x1f9b56,_0x5f0176){return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x4045a1[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x1f9b56,null))[_0x06e9('0x27')](function(_0x548fe3){if(_0x548fe3){return _0x548fe3[_0x06e9('0x91')](_0x4045a1[_0x06e9('0x35')][_0x06e9('0x6c')]);}})[_0x06e9('0x27')](function(_0x8b14f2){if(_0x8b14f2){return db['CmHopper']['destroy']({'where':{'ListId':_0x4045a1[_0x06e9('0x35')][_0x06e9('0x6c')],'CampaignId':_0x4045a1[_0x06e9('0x49')]['id']}})['then'](function(){return _0x8b14f2;});}})[_0x06e9('0x27')](respondWithStatusCode(_0x1f9b56,null))['catch'](handleError(_0x1f9b56,null));};exports[_0x06e9('0x92')]=function(_0x1b578b,_0x4a6cad,_0x5a7e90){var _0x362b88={};var _0x212685={};var _0x66b793;var _0x502530;return db[_0x06e9('0x43')][_0x06e9('0x61')]({'where':{'id':_0x1b578b[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x4a6cad,null))[_0x06e9('0x27')](function(_0x455a65){if(_0x455a65){_0x66b793=_0x455a65;_0x212685[_0x06e9('0x33')]=_[_0x06e9('0x34')](db['CmList']['rawAttributes']);_0x212685[_0x06e9('0x35')]=_[_0x06e9('0x34')](_0x1b578b['query']);_0x212685[_0x06e9('0x3c')]=_['intersection'](_0x212685[_0x06e9('0x33')],_0x212685[_0x06e9('0x35')]);_0x362b88[_0x06e9('0x38')]=_['intersection'](_0x212685[_0x06e9('0x33')],qs[_0x06e9('0x37')](_0x1b578b[_0x06e9('0x35')][_0x06e9('0x37')]));_0x362b88[_0x06e9('0x38')]=_0x362b88[_0x06e9('0x38')][_0x06e9('0x39')]?_0x362b88[_0x06e9('0x38')]:_0x212685[_0x06e9('0x33')];_0x362b88[_0x06e9('0x63')]=qs[_0x06e9('0x3b')](_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3b')]);_0x362b88[_0x06e9('0x3f')]=qs[_0x06e9('0x3c')](_[_0x06e9('0x3d')](_0x1b578b[_0x06e9('0x35')],_0x212685[_0x06e9('0x3c')]));if(_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3e')]){_0x362b88['where']=_[_0x06e9('0x40')](_0x362b88['where'],{'$or':_['map'](_0x362b88[_0x06e9('0x38')],function(_0x3e8265){var _0xb07c20={};_0xb07c20[_0x3e8265]={'$like':'%'+_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3e')]+'%'};return _0xb07c20;})});}_0x362b88=_['merge']({},_0x362b88,_0x1b578b[_0x06e9('0x4b')]);return _0x66b793[_0x06e9('0x92')](_0x362b88);}})['then'](function(_0x548d3b){if(_0x548d3b){_0x502530=_0x548d3b['length'];if(!_0x1b578b[_0x06e9('0x35')][_0x06e9('0x3a')](_0x06e9('0x5e'))){_0x362b88[_0x06e9('0x21')]=qs['limit'](_0x1b578b[_0x06e9('0x35')][_0x06e9('0x21')]);_0x362b88[_0x06e9('0x1e')]=qs['offset'](_0x1b578b['query'][_0x06e9('0x1e')]);}return _0x66b793[_0x06e9('0x92')](_0x362b88);}})[_0x06e9('0x27')](function(_0x1c63b4){if(_0x1c63b4){return _0x1c63b4?{'count':_0x502530,'rows':_0x1c63b4}:null;}})[_0x06e9('0x27')](respondWithResult(_0x4a6cad,null))[_0x06e9('0x47')](handleError(_0x4a6cad,null));};exports[_0x06e9('0x93')]=function(_0x295e22,_0x5882a8,_0x5e34c6){var _0x2ee274,_0x4b40d2;var _0x2a6b09=[];var _0x12472f=moment()[_0x06e9('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x06e9('0x43')][_0x06e9('0x51')]({'where':{'id':_0x295e22[_0x06e9('0x49')]['id']}})[_0x06e9('0x27')](handleEntityNotFound(_0x5882a8,null))[_0x06e9('0x27')](function(_0x466aac){if(_0x466aac){_0x4b40d2=_0x466aac;return _0x466aac[_0x06e9('0x93')](_0x295e22['body'][_0x06e9('0x6c')],_['omit'](_0x295e22[_0x06e9('0x4c')],[_0x06e9('0x6c'),'id'])||{});}return null;})[_0x06e9('0x94')](function(_0x4530b0){var _0x25967b;var _0x295342;_0x2ee274=_0x4530b0||[];var _0x199ff1=[];if(_0x4530b0){for(var _0x58a95f=0x0;_0x58a95f<_0x4530b0[_0x06e9('0x39')];_0x58a95f+=0x1){var _0x313e6c=_0x4530b0[_0x58a95f][_0x06e9('0x28')]({'plain':!![]});_0x25967b=squel[_0x06e9('0x6f')]()[_0x06e9('0x70')](_0x06e9('0x95'))['fromQuery']([_0x06e9('0x73'),_0x06e9('0x82'),_0x06e9('0x75'),'CampaignId',_0x06e9('0x56'),_0x06e9('0x57')],squel[_0x06e9('0x7e')]()[_0x06e9('0x76')](_0x06e9('0x73'),_0x06e9('0x73'))[_0x06e9('0x76')]('id','ContactId')[_0x06e9('0x76')](_0x313e6c['CmListId']['toString'](),'ListId')[_0x06e9('0x76')](_0x295e22['params']['id']['toString'](),_0x06e9('0x5f'))['field'](_0x06e9('0x84'),_0x06e9('0x56'))[_0x06e9('0x76')](_0x06e9('0x84'),_0x06e9('0x57'))[_0x06e9('0x78')](_0x06e9('0x79'))[_0x06e9('0x3f')](_0x06e9('0x7a'))[_0x06e9('0x3f')]('ListId\x20=\x20?',_0x313e6c['CmListId'][_0x06e9('0x77')]())[_0x06e9('0x3f')](_0x06e9('0x7c')))[_0x06e9('0x77')]();_0x199ff1[_0x06e9('0x96')](db[_0x06e9('0x8f')][_0x06e9('0x35')](_0x25967b));}return BPromise[_0x06e9('0x90')](_0x199ff1);}})[_0x06e9('0x27')](function(){return _0x2ee274;})['then'](respondWithResult(_0x5882a8,null))[_0x06e9('0x47')](handleError(_0x5882a8,null));};exports[_0x06e9('0x97')]=function(_0xe0aa86,_0x2176a5,_0x1ca3eb){return db['Campaign']['find']({'where':{'id':_0xe0aa86['params']['id']}})['then'](handleEntityNotFound(_0x2176a5,null))['then'](function(_0x3f115b){if(_0x3f115b){return _0x3f115b[_0x06e9('0x97')](_0xe0aa86['query'][_0x06e9('0x6c')]);}})[_0x06e9('0x27')](function(_0x4af149){if(_0x4af149){return db[_0x06e9('0x66')][_0x06e9('0x26')]({'where':{'ListId':_0xe0aa86[_0x06e9('0x35')][_0x06e9('0x6c')],'CampaignId':_0xe0aa86[_0x06e9('0x49')]['id']}})['then'](function(){return _0x4af149;});}})[_0x06e9('0x27')](respondWithStatusCode(_0x2176a5,null))[_0x06e9('0x47')](handleError(_0x2176a5,null));};
\ No newline at end of file
+var _0x16d1=['attributes','fields','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','keys','query','filters','intersection','model'];(function(_0x4cf2bb,_0xc26020){var _0x44e779=function(_0x371446){while(--_0x371446){_0x4cf2bb['push'](_0x4cf2bb['shift']());}};_0x44e779(++_0xc26020);}(_0x16d1,0xf7));var _0x116d=function(_0x259aab,_0x3c2b69){_0x259aab=_0x259aab-0x0;var _0x2824b1=_0x16d1[_0x259aab];return _0x2824b1;};'use strict';var emlformat=require(_0x116d('0x0'));var rimraf=require(_0x116d('0x1'));var zipdir=require(_0x116d('0x2'));var jsonpatch=require(_0x116d('0x3'));var rp=require(_0x116d('0x4'));var moment=require('moment');var BPromise=require(_0x116d('0x5'));var Mustache=require('mustache');var util=require(_0x116d('0x6'));var path=require(_0x116d('0x7'));var sox=require(_0x116d('0x8'));var csv=require('to-csv');var ejs=require(_0x116d('0x9'));var fs=require('fs');var fs_extra=require(_0x116d('0xa'));var _=require(_0x116d('0xb'));var squel=require('squel');var crypto=require(_0x116d('0xc'));var jsforce=require(_0x116d('0xd'));var deskjs=require(_0x116d('0xe'));var toCsv=require(_0x116d('0xf'));var querystring=require(_0x116d('0x10'));var Papa=require(_0x116d('0x11'));var Redis=require(_0x116d('0x12'));var authService=require(_0x116d('0x13'));var qs=require(_0x116d('0x14'));var as=require(_0x116d('0x15'));var hardwareService=require(_0x116d('0x16'));var logger=require(_0x116d('0x17'))(_0x116d('0x18'));var utils=require(_0x116d('0x19'));var config=require(_0x116d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4471cd,_0x51c4a5){_0x51c4a5=_0x51c4a5||0xcc;return function(_0x17ef0b){if(_0x17ef0b){return _0x4471cd['sendStatus'](_0x51c4a5);}return _0x4471cd[_0x116d('0x1b')](_0x51c4a5)[_0x116d('0x1c')]();};}function respondWithResult(_0x3e40db,_0x2df82e){_0x2df82e=_0x2df82e||0xc8;return function(_0x239502){if(_0x239502){return _0x3e40db[_0x116d('0x1b')](_0x2df82e)[_0x116d('0x1d')](_0x239502);}};}function respondWithFilteredResult(_0x431381,_0x5d3f12){return function(_0x79c787){if(_0x79c787){var _0x4d323b=typeof _0x5d3f12[_0x116d('0x1e')]===_0x116d('0x1f')&&typeof _0x5d3f12[_0x116d('0x20')]===_0x116d('0x1f');var _0x503d43=_0x79c787[_0x116d('0x21')];var _0x16f75d=_0x4d323b?0x0:_0x5d3f12[_0x116d('0x1e')];var _0x527211=_0x4d323b?_0x79c787[_0x116d('0x21')]:_0x5d3f12['offset']+_0x5d3f12[_0x116d('0x20')];var _0x4e783d;if(_0x527211>=_0x503d43){_0x527211=_0x503d43;_0x4e783d=0xc8;}else{_0x4e783d=0xce;}_0x431381['status'](_0x4e783d);return _0x431381['set'](_0x116d('0x22'),_0x16f75d+'-'+_0x527211+'/'+_0x503d43)[_0x116d('0x1d')](_0x79c787);}return null;};}function patchUpdates(_0x466928){return function(_0x1177f6){try{jsonpatch[_0x116d('0x23')](_0x1177f6,_0x466928,!![]);}catch(_0x5aaf80){return BPromise[_0x116d('0x24')](_0x5aaf80);}return _0x1177f6[_0x116d('0x25')]();};}function saveUpdates(_0x36da9a,_0x4dae8c){return function(_0x3eef37){if(_0x3eef37){return _0x3eef37[_0x116d('0x26')](_0x36da9a)[_0x116d('0x27')](function(_0x4db1ee){return _0x4db1ee;});}return null;};}function removeEntity(_0x3dc071,_0x50f05c){return function(_0x4b7268){if(_0x4b7268){return _0x4b7268[_0x116d('0x28')]()['then'](function(){var _0x5a90bd=_0x4b7268[_0x116d('0x29')]({'plain':!![]});var _0x25b9b9=_0x116d('0x2a');return db['UserProfileResource'][_0x116d('0x28')]({'where':{'type':_0x25b9b9,'resourceId':_0x5a90bd['id']}})[_0x116d('0x27')](function(){return _0x4b7268;});})['then'](function(){_0x3dc071[_0x116d('0x1b')](0xcc)[_0x116d('0x1c')]();});}};}function handleEntityNotFound(_0x519588,_0x464b16){return function(_0x14ae6f){if(!_0x14ae6f){_0x519588[_0x116d('0x2b')](0x194);}return _0x14ae6f;};}function handleError(_0x2024b3,_0x27b0f7){_0x27b0f7=_0x27b0f7||0x1f4;return function(_0x59618c){logger[_0x116d('0x2c')](_0x59618c[_0x116d('0x2d')]);if(_0x59618c[_0x116d('0x2e')]){delete _0x59618c[_0x116d('0x2e')];}_0x2024b3['status'](_0x27b0f7)[_0x116d('0x2f')](_0x59618c);};}exports[_0x116d('0x30')]=function(_0x324f3c,_0x4c3509){var _0xf9abe2={},_0x4918e0={},_0x27e1e0={'count':0x0,'rows':[]};var _0x3fa09e=_[_0x116d('0x31')](db[_0x116d('0x32')][_0x116d('0x33')],function(_0x279f2){return{'name':_0x279f2[_0x116d('0x34')],'type':_0x279f2['type'][_0x116d('0x35')]};});_0x4918e0['model']=_[_0x116d('0x31')](_0x3fa09e,_0x116d('0x2e'));_0x4918e0['query']=_[_0x116d('0x36')](_0x324f3c[_0x116d('0x37')]);_0x4918e0[_0x116d('0x38')]=_[_0x116d('0x39')](_0x4918e0[_0x116d('0x3a')],_0x4918e0[_0x116d('0x37')]);_0xf9abe2[_0x116d('0x3b')]=_['intersection'](_0x4918e0[_0x116d('0x3a')],qs['fields'](_0x324f3c[_0x116d('0x37')][_0x116d('0x3c')]));_0xf9abe2[_0x116d('0x3b')]=_0xf9abe2[_0x116d('0x3b')]['length']?_0xf9abe2[_0x116d('0x3b')]:_0x4918e0[_0x116d('0x3a')];if(!_0x324f3c[_0x116d('0x37')]['hasOwnProperty']('nolimit')){_0xf9abe2[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x324f3c[_0x116d('0x37')][_0x116d('0x20')]);_0xf9abe2[_0x116d('0x1e')]=qs[_0x116d('0x1e')](_0x324f3c['query'][_0x116d('0x1e')]);}_0xf9abe2[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x324f3c[_0x116d('0x37')][_0x116d('0x3e')]);_0xf9abe2[_0x116d('0x3f')]=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x324f3c[_0x116d('0x37')],_0x4918e0[_0x116d('0x38')]),_0x3fa09e);if(_0x324f3c['query'][_0x116d('0x41')]){_0xf9abe2[_0x116d('0x3f')]=_[_0x116d('0x42')](_0xf9abe2[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x3fa09e,function(_0x2b8138){if(_0x2b8138[_0x116d('0x43')]!=='VIRTUAL'){var _0x2716c1={};_0x2716c1[_0x2b8138[_0x116d('0x2e')]]={'$like':'%'+_0x324f3c[_0x116d('0x37')]['filter']+'%'};return _0x2716c1;}})});}_0xf9abe2=_[_0x116d('0x42')]({},_0xf9abe2,_0x324f3c[_0x116d('0x44')]);var _0x152cd2={'where':_0xf9abe2['where']};return db[_0x116d('0x32')][_0x116d('0x21')](_0x152cd2)[_0x116d('0x27')](function(_0x446870){_0x27e1e0[_0x116d('0x21')]=_0x446870;if(_0x324f3c[_0x116d('0x37')][_0x116d('0x45')]){_0xf9abe2[_0x116d('0x46')]=[{'all':!![]}];}return db[_0x116d('0x32')][_0x116d('0x47')](_0xf9abe2);})[_0x116d('0x27')](function(_0x4fc6d8){_0x27e1e0[_0x116d('0x48')]=_0x4fc6d8;return _0x27e1e0;})[_0x116d('0x27')](respondWithFilteredResult(_0x4c3509,_0xf9abe2))['catch'](handleError(_0x4c3509,null));};exports[_0x116d('0x49')]=function(_0x3df272,_0x22eed2){var _0x5f30c9={'raw':![],'where':{'id':_0x3df272[_0x116d('0x4a')]['id']}},_0x50f72e={};_0x50f72e[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x32')]['rawAttributes']);_0x50f72e[_0x116d('0x37')]=_[_0x116d('0x36')](_0x3df272[_0x116d('0x37')]);_0x50f72e[_0x116d('0x38')]=_['intersection'](_0x50f72e[_0x116d('0x3a')],_0x50f72e[_0x116d('0x37')]);_0x5f30c9[_0x116d('0x3b')]=_['intersection'](_0x50f72e[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x3df272[_0x116d('0x37')][_0x116d('0x3c')]));_0x5f30c9[_0x116d('0x3b')]=_0x5f30c9[_0x116d('0x3b')][_0x116d('0x4b')]?_0x5f30c9[_0x116d('0x3b')]:_0x50f72e[_0x116d('0x3a')];if(_0x3df272[_0x116d('0x37')]['includeAll']){_0x5f30c9[_0x116d('0x46')]=[{'all':!![]}];}_0x5f30c9=_[_0x116d('0x42')]({},_0x5f30c9,_0x3df272[_0x116d('0x44')]);return db[_0x116d('0x32')][_0x116d('0x4c')](_0x5f30c9)[_0x116d('0x27')](handleEntityNotFound(_0x22eed2,null))[_0x116d('0x27')](respondWithResult(_0x22eed2,null))[_0x116d('0x4d')](handleError(_0x22eed2,null));};exports[_0x116d('0x4e')]=function(_0x397154,_0x2f2690){return db[_0x116d('0x32')][_0x116d('0x4e')](_0x397154['body'],{})[_0x116d('0x27')](function(_0x586d27){var _0xe5917f=_0x397154[_0x116d('0x4f')]['get']({'plain':!![]});if(!_0xe5917f)throw new Error(_0x116d('0x50'));if(_0xe5917f[_0x116d('0x51')]===_0x116d('0x4f')){var _0x5420ff=_0x586d27[_0x116d('0x29')]({'plain':!![]});var _0x2291bb=_0x116d('0x2a');return db[_0x116d('0x52')]['find']({'where':{'name':_0x2291bb,'userProfileId':_0xe5917f['userProfileId']},'raw':!![]})[_0x116d('0x27')](function(_0x20ddf3){if(_0x20ddf3&&_0x20ddf3[_0x116d('0x53')]===0x0){return db[_0x116d('0x54')][_0x116d('0x4e')]({'name':_0x5420ff['name'],'resourceId':_0x5420ff['id'],'type':_0x20ddf3[_0x116d('0x2e')],'sectionId':_0x20ddf3['id']},{})[_0x116d('0x27')](function(){return _0x586d27;});}else{return _0x586d27;}})[_0x116d('0x4d')](function(_0x1eba28){logger[_0x116d('0x2c')](_0x116d('0x55'),_0x1eba28);throw _0x1eba28;});}return _0x586d27;})['then'](respondWithResult(_0x2f2690,0xc9))[_0x116d('0x4d')](handleError(_0x2f2690,null));};exports[_0x116d('0x56')]=function(_0x5e988a,_0x3c8299){var _0x517d85={'where':{'id':_0x5e988a[_0x116d('0x4a')]['id']}},_0xf505cc={};_0xf505cc[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x32')][_0x116d('0x33')]);_0x517d85[_0x116d('0x3b')]=_[_0x116d('0x39')](_0xf505cc[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x5e988a[_0x116d('0x37')]['fields']));_0x517d85[_0x116d('0x3b')]=_0x517d85['attributes'][_0x116d('0x4b')]?_0x517d85[_0x116d('0x3b')]:_0xf505cc['model'];if(_0x5e988a['query'][_0x116d('0x45')]){_0x517d85['include']=[{'all':!![]}];}_0x517d85=_['merge']({},_0x517d85,_0x5e988a[_0x116d('0x44')]);return db[_0x116d('0x32')][_0x116d('0x4c')](_0x517d85)[_0x116d('0x27')](handleEntityNotFound(_0x3c8299,null))[_0x116d('0x27')](function(_0x288144){if(_0x288144){var _0x1d033d=_0x288144['get']({'plain':!![]});_0x1d033d=qs[_0x116d('0x57')](_0x1d033d,['id',_0x116d('0x58'),_0x116d('0x59')]);_0x5e988a[_0x116d('0x5a')]=_['omit'](_0x5e988a[_0x116d('0x5a')],['id','createdAt',_0x116d('0x59')]);return db[_0x116d('0x32')][_0x116d('0x4e')](_[_0x116d('0x42')](_0x1d033d,_0x5e988a[_0x116d('0x5a')]),{'include':_0x5e988a['query'][_0x116d('0x45')]?[{'all':!![]}]:undefined})[_0x116d('0x27')](function(_0xe7d18b){var _0xad15b6=_0x5e988a[_0x116d('0x4f')][_0x116d('0x29')]({'plain':!![]});if(!_0xad15b6)throw new Error(_0x116d('0x50'));if(_0xad15b6['role']==='user'){var _0x42fb07=_0xe7d18b[_0x116d('0x29')]({'plain':!![]});var _0x3d510e=_0x116d('0x2a');return db['UserProfileSection'][_0x116d('0x4c')]({'where':{'name':_0x3d510e,'userProfileId':_0xad15b6[_0x116d('0x5b')]},'raw':!![]})['then'](function(_0x5bf417){if(_0x5bf417&&_0x5bf417['autoAssociation']===0x0){return db['UserProfileResource'][_0x116d('0x4e')]({'name':_0x42fb07[_0x116d('0x2e')],'resourceId':_0x42fb07['id'],'type':_0x5bf417[_0x116d('0x2e')],'sectionId':_0x5bf417['id']},{})['then'](function(){return _0xe7d18b;});}else{return _0xe7d18b;}})[_0x116d('0x4d')](function(_0x1a6014){logger['error'](_0x116d('0x55'),_0x1a6014);throw _0x1a6014;});}return _0xe7d18b;});}})[_0x116d('0x27')](respondWithResult(_0x3c8299,0xc9))[_0x116d('0x4d')](handleError(_0x3c8299,null));};exports[_0x116d('0x26')]=function(_0xaf50cf,_0x3d28b6){if(_0xaf50cf[_0x116d('0x5a')]['id']){delete _0xaf50cf[_0x116d('0x5a')]['id'];}return db['Campaign']['find']({'where':{'id':_0xaf50cf['params']['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x3d28b6,null))['then'](saveUpdates(_0xaf50cf['body'],null))[_0x116d('0x27')](respondWithResult(_0x3d28b6,null))[_0x116d('0x4d')](handleError(_0x3d28b6,null));};exports[_0x116d('0x28')]=function(_0x3bb363,_0x5265b7){return db[_0x116d('0x32')][_0x116d('0x4c')]({'where':{'id':_0x3bb363[_0x116d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5265b7,null))[_0x116d('0x27')](removeEntity(_0x5265b7,null))[_0x116d('0x4d')](handleError(_0x5265b7,null));};exports[_0x116d('0x5c')]=function(_0x418773,_0x1e2117,_0x28d201){var _0x32fa2c={'raw':!![],'where':{}};var _0x44453b={};var _0x5472ef={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x418773[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x1e2117,null))[_0x116d('0x27')](function(_0x56dbcf){if(_0x56dbcf){_0x44453b[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x5e')]['rawAttributes']);_0x44453b[_0x116d('0x37')]=_['keys'](_0x418773[_0x116d('0x37')]);_0x44453b['filters']=_['intersection'](_0x44453b[_0x116d('0x3a')],_0x44453b[_0x116d('0x37')]);_0x32fa2c['attributes']=_[_0x116d('0x39')](_0x44453b['model'],qs[_0x116d('0x3c')](_0x418773[_0x116d('0x37')][_0x116d('0x3c')]));_0x32fa2c[_0x116d('0x3b')]=_0x32fa2c[_0x116d('0x3b')][_0x116d('0x4b')]?_0x32fa2c[_0x116d('0x3b')]:_0x44453b[_0x116d('0x3a')];if(!_0x418773[_0x116d('0x37')][_0x116d('0x5f')](_0x116d('0x60'))){_0x32fa2c[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x418773[_0x116d('0x37')]['limit']);_0x32fa2c['offset']=qs[_0x116d('0x1e')](_0x418773[_0x116d('0x37')]['offset']);}_0x32fa2c[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x418773[_0x116d('0x37')]['sort']);_0x32fa2c[_0x116d('0x3f')]=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x418773[_0x116d('0x37')],_0x44453b[_0x116d('0x38')]));_0x32fa2c[_0x116d('0x3f')][_0x116d('0x61')]=_0x56dbcf['id'];if(_0x418773[_0x116d('0x37')][_0x116d('0x41')]){_0x32fa2c[_0x116d('0x3f')]=_[_0x116d('0x42')](_0x32fa2c[_0x116d('0x3f')],{'$or':_['map'](_0x32fa2c[_0x116d('0x3b')],function(_0x1b093a){var _0x8da400={};_0x8da400[_0x1b093a]={'$like':'%'+_0x418773[_0x116d('0x37')][_0x116d('0x41')]+'%'};return _0x8da400;})});}_0x32fa2c=_[_0x116d('0x42')]({},_0x32fa2c,_0x418773[_0x116d('0x44')]);return db[_0x116d('0x5e')]['count']({'where':_0x32fa2c['where']})['then'](function(_0x485fd7){_0x5472ef['count']=_0x485fd7;if(_0x418773[_0x116d('0x37')][_0x116d('0x45')]){_0x32fa2c[_0x116d('0x46')]=[{'all':!![]}];}return db['CmHopper'][_0x116d('0x47')](_0x32fa2c);})[_0x116d('0x27')](function(_0x443d52){_0x5472ef[_0x116d('0x48')]=_0x443d52;return _0x5472ef;});}})['then'](respondWithFilteredResult(_0x1e2117,_0x32fa2c))[_0x116d('0x4d')](handleError(_0x1e2117,null));};exports[_0x116d('0x62')]=function(_0x2317ed,_0x3775e7,_0x2f1266){var _0x2f0b6a={'raw':!![],'where':{}};var _0x4a5a60={};var _0x4deff2={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x2317ed[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x3775e7,null))['then'](function(_0x536c61){if(_0x536c61){_0x4a5a60[_0x116d('0x3a')]=_['keys'](db[_0x116d('0x63')]['rawAttributes']);_0x4a5a60[_0x116d('0x37')]=_[_0x116d('0x36')](_0x2317ed[_0x116d('0x37')]);_0x4a5a60['filters']=_['intersection'](_0x4a5a60['model'],_0x4a5a60[_0x116d('0x37')]);_0x2f0b6a[_0x116d('0x3b')]=_[_0x116d('0x39')](_0x4a5a60[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x2317ed[_0x116d('0x37')]['fields']));_0x2f0b6a['attributes']=_0x2f0b6a[_0x116d('0x3b')][_0x116d('0x4b')]?_0x2f0b6a[_0x116d('0x3b')]:_0x4a5a60[_0x116d('0x3a')];if(!_0x2317ed['query'][_0x116d('0x5f')](_0x116d('0x60'))){_0x2f0b6a[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x2317ed[_0x116d('0x37')][_0x116d('0x20')]);_0x2f0b6a[_0x116d('0x1e')]=qs[_0x116d('0x1e')](_0x2317ed[_0x116d('0x37')][_0x116d('0x1e')]);}_0x2f0b6a[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x2317ed[_0x116d('0x37')][_0x116d('0x3e')]);_0x2f0b6a[_0x116d('0x3f')]=qs['filters'](_[_0x116d('0x40')](_0x2317ed['query'],_0x4a5a60[_0x116d('0x38')]));_0x2f0b6a[_0x116d('0x3f')]['CampaignId']=_0x536c61['id'];if(_0x2317ed[_0x116d('0x37')]['filter']){_0x2f0b6a[_0x116d('0x3f')]=_[_0x116d('0x42')](_0x2f0b6a[_0x116d('0x3f')],{'$or':_['map'](_0x2f0b6a[_0x116d('0x3b')],function(_0x2dd027){var _0x24b9a8={};_0x24b9a8[_0x2dd027]={'$like':'%'+_0x2317ed[_0x116d('0x37')][_0x116d('0x41')]+'%'};return _0x24b9a8;})});}_0x2f0b6a=_[_0x116d('0x42')]({},_0x2f0b6a,_0x2317ed[_0x116d('0x44')]);return db[_0x116d('0x63')]['count']({'where':_0x2f0b6a['where']})[_0x116d('0x27')](function(_0x496997){_0x4deff2[_0x116d('0x21')]=_0x496997;if(_0x2317ed[_0x116d('0x37')][_0x116d('0x45')]){_0x2f0b6a['include']=[{'all':!![]}];}return db[_0x116d('0x63')][_0x116d('0x47')](_0x2f0b6a);})['then'](function(_0x47d8d2){_0x4deff2[_0x116d('0x48')]=_0x47d8d2;return _0x4deff2;});}})[_0x116d('0x27')](respondWithFilteredResult(_0x3775e7,_0x2f0b6a))[_0x116d('0x4d')](handleError(_0x3775e7,null));};exports[_0x116d('0x64')]=function(_0x2db20f,_0x150136,_0x278b7d){var _0x26d354={'raw':!![],'where':{}};var _0x3048c1={};var _0x3e1903={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x2db20f[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x150136,null))[_0x116d('0x27')](function(_0x39f0e8){if(_0x39f0e8){_0x3048c1[_0x116d('0x3a')]=_[_0x116d('0x36')](db['CmHopperFinal'][_0x116d('0x33')]);_0x3048c1['query']=_[_0x116d('0x36')](_0x2db20f['query']);_0x3048c1[_0x116d('0x38')]=_[_0x116d('0x39')](_0x3048c1['model'],_0x3048c1[_0x116d('0x37')]);_0x26d354['attributes']=_[_0x116d('0x39')](_0x3048c1[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x2db20f['query'][_0x116d('0x3c')]));_0x26d354[_0x116d('0x3b')]=_0x26d354[_0x116d('0x3b')][_0x116d('0x4b')]?_0x26d354[_0x116d('0x3b')]:_0x3048c1[_0x116d('0x3a')];if(!_0x2db20f['query'][_0x116d('0x5f')](_0x116d('0x60'))){_0x26d354[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x2db20f[_0x116d('0x37')]['limit']);_0x26d354[_0x116d('0x1e')]=qs['offset'](_0x2db20f[_0x116d('0x37')][_0x116d('0x1e')]);}_0x26d354[_0x116d('0x3d')]=qs['sort'](_0x2db20f[_0x116d('0x37')][_0x116d('0x3e')]);_0x26d354['where']=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x2db20f[_0x116d('0x37')],_0x3048c1[_0x116d('0x38')]));_0x26d354[_0x116d('0x3f')]['CampaignId']=_0x39f0e8['id'];if(_0x2db20f['query']['filter']){_0x26d354['where']=_[_0x116d('0x42')](_0x26d354[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x26d354[_0x116d('0x3b')],function(_0x38c38a){var _0x27483e={};_0x27483e[_0x38c38a]={'$like':'%'+_0x2db20f[_0x116d('0x37')][_0x116d('0x41')]+'%'};return _0x27483e;})});}_0x26d354=_['merge']({},_0x26d354,_0x2db20f[_0x116d('0x44')]);return db[_0x116d('0x65')]['count']({'where':_0x26d354[_0x116d('0x3f')]})[_0x116d('0x27')](function(_0x2e6a9b){_0x3e1903['count']=_0x2e6a9b;if(_0x2db20f[_0x116d('0x37')][_0x116d('0x45')]){_0x26d354[_0x116d('0x46')]=[{'all':!![]}];}return db[_0x116d('0x65')][_0x116d('0x47')](_0x26d354);})[_0x116d('0x27')](function(_0x57a4e6){_0x3e1903[_0x116d('0x48')]=_0x57a4e6;return _0x3e1903;});}})[_0x116d('0x27')](respondWithFilteredResult(_0x150136,_0x26d354))['catch'](handleError(_0x150136,null));};exports[_0x116d('0x66')]=function(_0x18085e,_0x3587aa,_0x4388c0){var _0x4979ed={'raw':!![],'where':{}};var _0x3e2953={};var _0x52c2a9={'count':0x0,'rows':[]};return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x18085e[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x3587aa,null))['then'](function(_0x57b469){if(_0x57b469){_0x3e2953[_0x116d('0x3a')]=_['keys'](db[_0x116d('0x67')][_0x116d('0x33')]);_0x3e2953['query']=_[_0x116d('0x36')](_0x18085e['query']);_0x3e2953[_0x116d('0x38')]=_['intersection'](_0x3e2953['model'],_0x3e2953[_0x116d('0x37')]);_0x4979ed[_0x116d('0x3b')]=_['intersection'](_0x3e2953[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x18085e['query'][_0x116d('0x3c')]));_0x4979ed[_0x116d('0x3b')]=_0x4979ed['attributes'][_0x116d('0x4b')]?_0x4979ed['attributes']:_0x3e2953[_0x116d('0x3a')];if(!_0x18085e[_0x116d('0x37')][_0x116d('0x5f')](_0x116d('0x60'))){_0x4979ed[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x18085e[_0x116d('0x37')][_0x116d('0x20')]);_0x4979ed[_0x116d('0x1e')]=qs[_0x116d('0x1e')](_0x18085e[_0x116d('0x37')]['offset']);}_0x4979ed[_0x116d('0x3d')]=qs[_0x116d('0x3e')](_0x18085e[_0x116d('0x37')][_0x116d('0x3e')]);_0x4979ed['where']=qs[_0x116d('0x38')](_[_0x116d('0x40')](_0x18085e['query'],_0x3e2953[_0x116d('0x38')]));_0x4979ed[_0x116d('0x3f')][_0x116d('0x61')]=_0x57b469['id'];if(_0x18085e[_0x116d('0x37')][_0x116d('0x41')]){_0x4979ed[_0x116d('0x3f')]=_[_0x116d('0x42')](_0x4979ed[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x4979ed[_0x116d('0x3b')],function(_0x4d68e3){var _0x580ad5={};_0x580ad5[_0x4d68e3]={'$like':'%'+_0x18085e[_0x116d('0x37')]['filter']+'%'};return _0x580ad5;})});}_0x4979ed=_['merge']({},_0x4979ed,_0x18085e[_0x116d('0x44')]);return db['CmHopperBlack'][_0x116d('0x21')]({'where':_0x4979ed[_0x116d('0x3f')]})[_0x116d('0x27')](function(_0xd9e310){_0x52c2a9[_0x116d('0x21')]=_0xd9e310;if(_0x18085e[_0x116d('0x37')][_0x116d('0x45')]){_0x4979ed[_0x116d('0x46')]=[{'all':!![]}];}return db[_0x116d('0x67')][_0x116d('0x47')](_0x4979ed);})[_0x116d('0x27')](function(_0x3d45c4){_0x52c2a9[_0x116d('0x48')]=_0x3d45c4;return _0x52c2a9;});}})[_0x116d('0x27')](respondWithFilteredResult(_0x3587aa,_0x4979ed))['catch'](handleError(_0x3587aa,null));};exports[_0x116d('0x68')]=function(_0x16214f,_0x44009a,_0x55c06d){var _0x5befd5={};var _0x5e6e50={};var _0xae0b19;var _0x4a6f2e;return db[_0x116d('0x32')]['findOne']({'where':{'id':_0x16214f[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x44009a,null))['then'](function(_0x5dfe6f){if(_0x5dfe6f){_0xae0b19=_0x5dfe6f;_0x5e6e50[_0x116d('0x3a')]=_[_0x116d('0x36')](db[_0x116d('0x69')]['rawAttributes']);_0x5e6e50[_0x116d('0x37')]=_['keys'](_0x16214f[_0x116d('0x37')]);_0x5e6e50['filters']=_[_0x116d('0x39')](_0x5e6e50[_0x116d('0x3a')],_0x5e6e50[_0x116d('0x37')]);_0x5befd5[_0x116d('0x3b')]=_[_0x116d('0x39')](_0x5e6e50[_0x116d('0x3a')],qs['fields'](_0x16214f[_0x116d('0x37')]['fields']));_0x5befd5[_0x116d('0x3b')]=_0x5befd5[_0x116d('0x3b')]['length']?_0x5befd5[_0x116d('0x3b')]:_0x5e6e50[_0x116d('0x3a')];_0x5befd5[_0x116d('0x3d')]=qs['sort'](_0x16214f[_0x116d('0x37')][_0x116d('0x3e')]);_0x5befd5[_0x116d('0x3f')]=qs['filters'](_[_0x116d('0x40')](_0x16214f[_0x116d('0x37')],_0x5e6e50['filters']));if(_0x16214f[_0x116d('0x37')][_0x116d('0x41')]){_0x5befd5['where']=_[_0x116d('0x42')](_0x5befd5[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0x5befd5[_0x116d('0x3b')],function(_0x7b15b2){var _0xa5dbcf={};_0xa5dbcf[_0x7b15b2]={'$like':'%'+_0x16214f['query'][_0x116d('0x41')]+'%'};return _0xa5dbcf;})});}_0x5befd5=_['merge']({},_0x5befd5,_0x16214f[_0x116d('0x44')]);return _0xae0b19['getLists'](_0x5befd5);}})[_0x116d('0x27')](function(_0x27c5a7){if(_0x27c5a7){_0x4a6f2e=_0x27c5a7['length'];if(!_0x16214f[_0x116d('0x37')][_0x116d('0x5f')]('nolimit')){_0x5befd5['limit']=qs[_0x116d('0x20')](_0x16214f[_0x116d('0x37')][_0x116d('0x20')]);_0x5befd5['offset']=qs[_0x116d('0x1e')](_0x16214f[_0x116d('0x37')]['offset']);}return _0xae0b19['getLists'](_0x5befd5);}})['then'](function(_0x4b3b11){if(_0x4b3b11){return _0x4b3b11?{'count':_0x4a6f2e,'rows':_0x4b3b11}:null;}})[_0x116d('0x27')](respondWithResult(_0x44009a,null))[_0x116d('0x4d')](handleError(_0x44009a,null));};exports['addLists']=function(_0x66cbcd,_0x188b5f,_0x4cc913){var _0x10bc73,_0x53a8e9;var _0x3e05dc=[];var _0x1b08a9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x116d('0x32')][_0x116d('0x4c')]({'where':{'id':_0x66cbcd['params']['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x188b5f,null))[_0x116d('0x27')](function(_0x14d3ba){if(_0x14d3ba){_0x53a8e9=_0x14d3ba;return _0x14d3ba[_0x116d('0x6a')](_0x66cbcd[_0x116d('0x5a')][_0x116d('0x6b')],_[_0x116d('0x57')](_0x66cbcd['body'],[_0x116d('0x6b'),'id'])||{});}return null;})['spread'](function(_0x28e5ae){var _0x5a37e3;var _0x4d2bbf;_0x10bc73=_0x28e5ae||[];var _0x5df04d=[];if(_0x28e5ae){for(var _0xb712c4=0x0;_0xb712c4<_0x28e5ae['length'];_0xb712c4+=0x1){var _0x20309a=_0x28e5ae[_0xb712c4]['get']({'plain':!![]});_0x53a8e9['dialCheckDuplicateType']=_0x66cbcd[_0x116d('0x5a')][_0x116d('0x6c')]?_0x66cbcd[_0x116d('0x5a')]['dialCheckDuplicateType']:_0x53a8e9['dialCheckDuplicateType'];switch(_0x53a8e9[_0x116d('0x6c')]){case'always':_0x5a37e3=squel[_0x116d('0x6d')]()[_0x116d('0x6e')](_0x116d('0x6f'))[_0x116d('0x70')]([_0x116d('0x71'),'scheduledAt',_0x116d('0x72'),_0x116d('0x73'),_0x116d('0x61'),_0x116d('0x58'),'updatedAt'],squel[_0x116d('0x74')]()['field'](_0x116d('0x71'),_0x116d('0x71'))[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x77'))[_0x116d('0x75')]('id',_0x116d('0x72'))[_0x116d('0x75')](_0x20309a[_0x116d('0x78')]['toString'](),_0x116d('0x73'))[_0x116d('0x75')](_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')](),'CampaignId')[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27','createdAt')[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27',_0x116d('0x59'))[_0x116d('0x7a')](_0x116d('0x7b'))[_0x116d('0x3f')](_0x116d('0x7c'))[_0x116d('0x3f')](_0x116d('0x7d'),_0x20309a['CmListId']['toString']())[_0x116d('0x3f')](_0x116d('0x7e'))[_0x116d('0x3f')](_0x116d('0x7f'),squel[_0x116d('0x74')]()[_0x116d('0x75')](_0x116d('0x80'))[_0x116d('0x7a')](_0x116d('0x81'))[_0x116d('0x3f')](_0x116d('0x82'),_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')]()))[_0x116d('0x3f')](_0x116d('0x7f'),squel['select']()[_0x116d('0x75')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x116d('0x82'),_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')]())))[_0x116d('0x79')]();break;case _0x116d('0x83'):_0x5a37e3=squel[_0x116d('0x6d')]()[_0x116d('0x6e')]('cm_hopper')[_0x116d('0x70')]([_0x116d('0x71'),_0x116d('0x77'),_0x116d('0x72'),_0x116d('0x73'),'CampaignId',_0x116d('0x58'),_0x116d('0x59')],squel['select']()[_0x116d('0x75')](_0x116d('0x71'),_0x116d('0x71'))[_0x116d('0x75')](_0x116d('0x76'),'scheduledAt')[_0x116d('0x75')]('id',_0x116d('0x72'))[_0x116d('0x75')](_0x20309a[_0x116d('0x78')][_0x116d('0x79')](),_0x116d('0x73'))[_0x116d('0x75')](_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')](),_0x116d('0x61'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27',_0x116d('0x58'))['field']('\x27'+_0x1b08a9+'\x27',_0x116d('0x59'))[_0x116d('0x7a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x20309a['CmListId']['toString']())[_0x116d('0x3f')](_0x116d('0x7e'))['where'](_0x116d('0x7f'),squel[_0x116d('0x74')]()[_0x116d('0x75')](_0x116d('0x84'))[_0x116d('0x7a')]('cm_hopper')['where'](_0x116d('0x82'),_0x66cbcd[_0x116d('0x4a')]['id'][_0x116d('0x79')]())))[_0x116d('0x79')]();break;default:_0x5a37e3=squel[_0x116d('0x6d')]()[_0x116d('0x6e')]('cm_hopper')[_0x116d('0x70')]([_0x116d('0x71'),_0x116d('0x77'),'ContactId','ListId',_0x116d('0x61'),_0x116d('0x58'),'updatedAt'],squel[_0x116d('0x74')]()[_0x116d('0x75')]('phone',_0x116d('0x71'))[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x77'))[_0x116d('0x75')]('id','ContactId')[_0x116d('0x75')](_0x20309a[_0x116d('0x78')][_0x116d('0x79')](),_0x116d('0x73'))[_0x116d('0x75')](_0x66cbcd['params']['id'][_0x116d('0x79')](),_0x116d('0x61'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27',_0x116d('0x58'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27','updatedAt')['from'](_0x116d('0x7b'))[_0x116d('0x3f')]('deletedAt\x20IS\x20NULL')[_0x116d('0x3f')](_0x116d('0x7d'),_0x20309a['CmListId'][_0x116d('0x79')]())[_0x116d('0x3f')](_0x116d('0x7e')))[_0x116d('0x79')]();}_0x4d2bbf=squel[_0x116d('0x6d')]()[_0x116d('0x6e')](_0x116d('0x85'))[_0x116d('0x70')]([_0x116d('0x86'),'scheduledAt',_0x116d('0x71'),_0x116d('0x87'),'createdAt','updatedAt'],squel['select']()[_0x116d('0x75')](_0x116d('0x88'),'id')[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x77'))[_0x116d('0x75')](_0x116d('0x89'),'phone')[_0x116d('0x75')](_0x116d('0x8a'),'OrderBy')['field']('\x27'+_0x1b08a9+'\x27',_0x116d('0x58'))[_0x116d('0x75')]('\x27'+_0x1b08a9+'\x27','updatedAt')['from']('cm_contact_has_items','ci')['join'](_0x116d('0x6f'),'h',_0x116d('0x8b'))[_0x116d('0x3f')](_0x116d('0x8c'),_0x20309a[_0x116d('0x78')][_0x116d('0x79')]())['where'](_0x116d('0x8d'),_0x66cbcd[_0x116d('0x4a')]['id']['toString']())[_0x116d('0x3f')]('h.createdAt\x20=\x20?',_0x1b08a9))[_0x116d('0x79')]();_0x5df04d[_0x116d('0x8e')](db[_0x116d('0x8f')][_0x116d('0x37')](_0x5a37e3));_0x3e05dc['push'](db[_0x116d('0x8f')][_0x116d('0x37')](_0x4d2bbf));}return BPromise[_0x116d('0x90')](_0x5df04d);}})[_0x116d('0x27')](function(){return BPromise[_0x116d('0x90')](_0x3e05dc);})[_0x116d('0x27')](function(){return _0x10bc73;})[_0x116d('0x27')](respondWithResult(_0x188b5f,null))['catch'](handleError(_0x188b5f,null));};exports[_0x116d('0x91')]=function(_0x2a440b,_0xb25df5,_0x3a10fd){return db['Campaign'][_0x116d('0x4c')]({'where':{'id':_0x2a440b[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0xb25df5,null))[_0x116d('0x27')](function(_0x395bb4){if(_0x395bb4){return _0x395bb4[_0x116d('0x91')](_0x2a440b[_0x116d('0x37')]['ids']);}})['then'](function(_0x2c26cf){if(_0x2c26cf){return db[_0x116d('0x5e')][_0x116d('0x28')]({'where':{'ListId':_0x2a440b['query'][_0x116d('0x6b')],'CampaignId':_0x2a440b[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](function(){return _0x2c26cf;});}})[_0x116d('0x27')](respondWithStatusCode(_0xb25df5,null))['catch'](handleError(_0xb25df5,null));};exports[_0x116d('0x92')]=function(_0x51a6f1,_0x215665,_0x492165){var _0xf3b2c2={};var _0x21bc9b={};var _0xa321ab;var _0x229d9e;return db[_0x116d('0x32')][_0x116d('0x5d')]({'where':{'id':_0x51a6f1[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x215665,null))['then'](function(_0x10647d){if(_0x10647d){_0xa321ab=_0x10647d;_0x21bc9b[_0x116d('0x3a')]=_['keys'](db[_0x116d('0x69')][_0x116d('0x33')]);_0x21bc9b[_0x116d('0x37')]=_['keys'](_0x51a6f1[_0x116d('0x37')]);_0x21bc9b['filters']=_['intersection'](_0x21bc9b[_0x116d('0x3a')],_0x21bc9b[_0x116d('0x37')]);_0xf3b2c2[_0x116d('0x3b')]=_[_0x116d('0x39')](_0x21bc9b[_0x116d('0x3a')],qs[_0x116d('0x3c')](_0x51a6f1['query'][_0x116d('0x3c')]));_0xf3b2c2[_0x116d('0x3b')]=_0xf3b2c2[_0x116d('0x3b')]['length']?_0xf3b2c2[_0x116d('0x3b')]:_0x21bc9b[_0x116d('0x3a')];_0xf3b2c2['order']=qs[_0x116d('0x3e')](_0x51a6f1[_0x116d('0x37')][_0x116d('0x3e')]);_0xf3b2c2[_0x116d('0x3f')]=qs['filters'](_[_0x116d('0x40')](_0x51a6f1['query'],_0x21bc9b[_0x116d('0x38')]));if(_0x51a6f1[_0x116d('0x37')][_0x116d('0x41')]){_0xf3b2c2[_0x116d('0x3f')]=_[_0x116d('0x42')](_0xf3b2c2[_0x116d('0x3f')],{'$or':_[_0x116d('0x31')](_0xf3b2c2[_0x116d('0x3b')],function(_0x2b0eff){var _0x42f61f={};_0x42f61f[_0x2b0eff]={'$like':'%'+_0x51a6f1[_0x116d('0x37')]['filter']+'%'};return _0x42f61f;})});}_0xf3b2c2=_[_0x116d('0x42')]({},_0xf3b2c2,_0x51a6f1[_0x116d('0x44')]);return _0xa321ab[_0x116d('0x92')](_0xf3b2c2);}})[_0x116d('0x27')](function(_0x4f9357){if(_0x4f9357){_0x229d9e=_0x4f9357[_0x116d('0x4b')];if(!_0x51a6f1[_0x116d('0x37')]['hasOwnProperty'](_0x116d('0x60'))){_0xf3b2c2[_0x116d('0x20')]=qs[_0x116d('0x20')](_0x51a6f1[_0x116d('0x37')]['limit']);_0xf3b2c2[_0x116d('0x1e')]=qs['offset'](_0x51a6f1[_0x116d('0x37')][_0x116d('0x1e')]);}return _0xa321ab[_0x116d('0x92')](_0xf3b2c2);}})[_0x116d('0x27')](function(_0x4c3a5b){if(_0x4c3a5b){return _0x4c3a5b?{'count':_0x229d9e,'rows':_0x4c3a5b}:null;}})[_0x116d('0x27')](respondWithResult(_0x215665,null))[_0x116d('0x4d')](handleError(_0x215665,null));};exports[_0x116d('0x93')]=function(_0x48046d,_0x52efa5,_0x323cf3){var _0x52bd60,_0x28436e;var _0x193b2e=[];var _0x5dbf4a=moment()[_0x116d('0x94')](_0x116d('0x95'));return db[_0x116d('0x32')]['find']({'where':{'id':_0x48046d[_0x116d('0x4a')]['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x52efa5,null))[_0x116d('0x27')](function(_0x57d8e1){if(_0x57d8e1){_0x28436e=_0x57d8e1;return _0x57d8e1[_0x116d('0x93')](_0x48046d[_0x116d('0x5a')]['ids'],_[_0x116d('0x57')](_0x48046d[_0x116d('0x5a')],[_0x116d('0x6b'),'id'])||{});}return null;})[_0x116d('0x96')](function(_0x164563){var _0x16f66f;var _0x2e4351;_0x52bd60=_0x164563||[];var _0x8e5c3a=[];if(_0x164563){for(var _0x41c52f=0x0;_0x41c52f<_0x164563[_0x116d('0x4b')];_0x41c52f+=0x1){var _0x1272db=_0x164563[_0x41c52f][_0x116d('0x29')]({'plain':!![]});_0x16f66f=squel[_0x116d('0x6d')]()[_0x116d('0x6e')](_0x116d('0x97'))[_0x116d('0x70')](['phone','ContactId',_0x116d('0x73'),_0x116d('0x61'),_0x116d('0x58'),_0x116d('0x59')],squel[_0x116d('0x74')]()[_0x116d('0x75')]('phone',_0x116d('0x71'))[_0x116d('0x75')]('id',_0x116d('0x72'))[_0x116d('0x75')](_0x1272db['CmListId'][_0x116d('0x79')](),_0x116d('0x73'))[_0x116d('0x75')](_0x48046d[_0x116d('0x4a')]['id']['toString'](),_0x116d('0x61'))['field'](_0x116d('0x76'),_0x116d('0x58'))[_0x116d('0x75')](_0x116d('0x76'),_0x116d('0x59'))[_0x116d('0x7a')](_0x116d('0x7b'))[_0x116d('0x3f')](_0x116d('0x7c'))[_0x116d('0x3f')]('ListId\x20=\x20?',_0x1272db[_0x116d('0x78')][_0x116d('0x79')]())['where'](_0x116d('0x7e')))[_0x116d('0x79')]();_0x8e5c3a[_0x116d('0x8e')](db['sequelize'][_0x116d('0x37')](_0x16f66f));}return BPromise[_0x116d('0x90')](_0x8e5c3a);}})[_0x116d('0x27')](function(){return _0x52bd60;})['then'](respondWithResult(_0x52efa5,null))[_0x116d('0x4d')](handleError(_0x52efa5,null));};exports['removeBlackLists']=function(_0x33d394,_0x371097,_0x3156d9){return db[_0x116d('0x32')][_0x116d('0x4c')]({'where':{'id':_0x33d394['params']['id']}})[_0x116d('0x27')](handleEntityNotFound(_0x371097,null))[_0x116d('0x27')](function(_0x32a566){if(_0x32a566){return _0x32a566[_0x116d('0x98')](_0x33d394[_0x116d('0x37')][_0x116d('0x6b')]);}})[_0x116d('0x27')](function(_0x4841e8){if(_0x4841e8){return db[_0x116d('0x67')][_0x116d('0x28')]({'where':{'ListId':_0x33d394[_0x116d('0x37')]['ids'],'CampaignId':_0x33d394['params']['id']}})[_0x116d('0x27')](function(){return _0x4841e8;});}})[_0x116d('0x27')](respondWithStatusCode(_0x371097,null))[_0x116d('0x4d')](handleError(_0x371097,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index c8a4953..ba543f6 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(_0x5dc1cb,_0x1dd487){var _0x5df13f=function(_0x20a271){while(--_0x20a271){_0x5dc1cb['push'](_0x5dc1cb['shift']());}};_0x5df13f(++_0x1dd487);}(_0x7a54,0x106));var _0x47a5=function(_0x4eed6c,_0x55c573){_0x4eed6c=_0x4eed6c-0x0;var _0x37ec5d=_0x7a54[_0x4eed6c];return _0x37ec5d;};'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(_0xdb9db5,_0x16cb80){var _0x35c68f=function(_0x26117c){while(--_0x26117c){_0xdb9db5['push'](_0xdb9db5['shift']());}};_0x35c68f(++_0x16cb80);}(_0x7a54,0x106));var _0x47a5=function(_0x2822ff,_0x115d25){_0x2822ff=_0x2822ff-0x0;var _0x38a45f=_0x7a54[_0x2822ff];return _0x38a45f;};'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 3ada73f..9dfcc48 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 _0x4849=['catch','GetCampaign','Campaign','findAll','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x39d6f1,_0x1a160c){var _0x2b4bb1=function(_0x45a04f){while(--_0x45a04f){_0x39d6f1['push'](_0x39d6f1['shift']());}};_0x2b4bb1(++_0x1a160c);}(_0x4849,0x86));var _0x9484=function(_0x30f85e,_0x479e45){_0x30f85e=_0x30f85e-0x0;var _0x11189d=_0x4849[_0x30f85e];return _0x11189d;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var moment=require('moment');var BPromise=require(_0x9484('0x2'));var rs=require(_0x9484('0x3'));var fs=require('fs');var Redis=require(_0x9484('0x4'));var db=require(_0x9484('0x5'))['db'];var utils=require(_0x9484('0x6'));var logger=require(_0x9484('0x7'))(_0x9484('0x8'));var config=require('../../config/environment');var jayson=require(_0x9484('0x9'));var client=jayson[_0x9484('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ed772,_0x163a82,_0x3cdf53){return new BPromise(function(_0x387fb5,_0x2433e2){return client['request'](_0x1ed772,_0x3cdf53)[_0x9484('0xb')](function(_0x1bea3b){logger[_0x9484('0xc')](_0x9484('0xd'),_0x163a82,'request\x20sent');logger[_0x9484('0xe')](_0x9484('0xf'),_0x163a82,_0x9484('0x10'),JSON[_0x9484('0x11')](_0x1bea3b));if(_0x1bea3b[_0x9484('0x12')]){if(_0x1bea3b[_0x9484('0x12')][_0x9484('0x13')]===0x1f4){logger['error'](_0x9484('0xd'),_0x163a82,_0x1bea3b[_0x9484('0x12')]['message']);return _0x2433e2(_0x1bea3b['error'][_0x9484('0x14')]);}logger[_0x9484('0x12')](_0x9484('0xd'),_0x163a82,_0x1bea3b[_0x9484('0x12')][_0x9484('0x14')]);return _0x387fb5(_0x1bea3b[_0x9484('0x12')][_0x9484('0x14')]);}else{logger[_0x9484('0xc')](_0x9484('0xd'),_0x163a82,_0x9484('0x10'));_0x387fb5(_0x1bea3b['result'][_0x9484('0x14')]);}})[_0x9484('0x15')](function(_0x58dab8){logger[_0x9484('0x12')](_0x9484('0xd'),_0x163a82,_0x58dab8);_0x2433e2(_0x58dab8);});});}exports[_0x9484('0x16')]=function(_0x44dce6){var _0x13585d=this;return new Promise(function(_0x515320,_0x228bbc){return db[_0x9484('0x17')][_0x9484('0x18')]({'raw':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')]['where']||null:null,'attributes':_0x44dce6[_0x9484('0x19')]?_0x44dce6['options'][_0x9484('0x1a')]||null:null,'limit':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')][_0x9484('0x1b')]||null:null,'include':_0x44dce6[_0x9484('0x19')]?_0x44dce6[_0x9484('0x19')][_0x9484('0x1c')]?_['map'](_0x44dce6['options']['include'],function(_0x5b4143){return{'model':db[_0x5b4143[_0x9484('0x1d')]],'as':_0x5b4143['as'],'attributes':_0x5b4143[_0x9484('0x1a')],'include':_0x5b4143[_0x9484('0x1c')]?_[_0x9484('0x1e')](_0x5b4143[_0x9484('0x1c')],function(_0xec2e98){return{'model':db[_0xec2e98['model']],'as':_0xec2e98['as'],'attributes':_0xec2e98[_0x9484('0x1a')],'include':_0xec2e98['include']?_['map'](_0xec2e98['include'],function(_0x11d5dc){return{'model':db[_0x11d5dc[_0x9484('0x1d')]],'as':_0x11d5dc['as'],'attributes':_0x11d5dc[_0x9484('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9484('0xb')](function(_0x4de9d7){logger[_0x9484('0xc')](_0x9484('0x16'),_0x44dce6);logger[_0x9484('0xe')]('GetCampaign',_0x44dce6,JSON['stringify'](_0x4de9d7));_0x515320(_0x4de9d7);})['catch'](function(_0x1cd898){logger[_0x9484('0x12')](_0x9484('0x16'),_0x1cd898['message'],_0x44dce6);_0x228bbc(_0x13585d[_0x9484('0x12')](0x1f4,_0x1cd898[_0x9484('0x14')]));});});};
\ No newline at end of file
+var _0x0269=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0x0269,0x135));var _0x9026=function(_0x37bca8,_0x2fb3ac){_0x37bca8=_0x37bca8-0x0;var _0x40eb58=_0x0269[_0x37bca8];return _0x40eb58;};'use strict';var _=require(_0x9026('0x0'));var util=require('util');var moment=require(_0x9026('0x1'));var BPromise=require('bluebird');var rs=require(_0x9026('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9026('0x3'))['db'];var utils=require(_0x9026('0x4'));var logger=require(_0x9026('0x5'))(_0x9026('0x6'));var config=require('../../config/environment');var jayson=require(_0x9026('0x7'));var client=jayson[_0x9026('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x540056,_0x97c0c3,_0x1a212f){return new BPromise(function(_0x1149ad,_0xd97c29){return client['request'](_0x540056,_0x1a212f)[_0x9026('0x9')](function(_0x1a238a){logger[_0x9026('0xa')]('Campaign,\x20%s,\x20%s',_0x97c0c3,_0x9026('0xb'));logger[_0x9026('0xc')](_0x9026('0xd'),_0x97c0c3,'request\x20sent',JSON[_0x9026('0xe')](_0x1a238a));if(_0x1a238a['error']){if(_0x1a238a[_0x9026('0xf')][_0x9026('0x10')]===0x1f4){logger[_0x9026('0xf')](_0x9026('0x11'),_0x97c0c3,_0x1a238a[_0x9026('0xf')][_0x9026('0x12')]);return _0xd97c29(_0x1a238a[_0x9026('0xf')]['message']);}logger[_0x9026('0xf')]('Campaign,\x20%s,\x20%s',_0x97c0c3,_0x1a238a[_0x9026('0xf')][_0x9026('0x12')]);return _0x1149ad(_0x1a238a[_0x9026('0xf')][_0x9026('0x12')]);}else{logger[_0x9026('0xa')](_0x9026('0x11'),_0x97c0c3,_0x9026('0xb'));_0x1149ad(_0x1a238a[_0x9026('0x13')]['message']);}})[_0x9026('0x14')](function(_0x2b9834){logger['error'](_0x9026('0x11'),_0x97c0c3,_0x2b9834);_0xd97c29(_0x2b9834);});});}exports[_0x9026('0x15')]=function(_0x15b3ab){var _0x4e37d0=this;return new Promise(function(_0x1d1613,_0x3e57f7){return db[_0x9026('0x16')][_0x9026('0x17')]({'raw':_0x15b3ab['options']?_0x15b3ab[_0x9026('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab['options'][_0x9026('0x19')]||null:null,'attributes':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab[_0x9026('0x18')][_0x9026('0x1a')]||null:null,'limit':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab[_0x9026('0x18')][_0x9026('0x1b')]||null:null,'include':_0x15b3ab[_0x9026('0x18')]?_0x15b3ab[_0x9026('0x18')]['include']?_['map'](_0x15b3ab[_0x9026('0x18')][_0x9026('0x1c')],function(_0x2968fb){return{'model':db[_0x2968fb[_0x9026('0x1d')]],'as':_0x2968fb['as'],'attributes':_0x2968fb[_0x9026('0x1a')],'include':_0x2968fb[_0x9026('0x1c')]?_[_0x9026('0x1e')](_0x2968fb[_0x9026('0x1c')],function(_0x775596){return{'model':db[_0x775596[_0x9026('0x1d')]],'as':_0x775596['as'],'attributes':_0x775596[_0x9026('0x1a')],'include':_0x775596[_0x9026('0x1c')]?_[_0x9026('0x1e')](_0x775596[_0x9026('0x1c')],function(_0x28dba4){return{'model':db[_0x28dba4[_0x9026('0x1d')]],'as':_0x28dba4['as'],'attributes':_0x28dba4[_0x9026('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9026('0x9')](function(_0x2fae98){logger['info'](_0x9026('0x15'),_0x15b3ab);logger[_0x9026('0xc')](_0x9026('0x15'),_0x15b3ab,JSON[_0x9026('0xe')](_0x2fae98));_0x1d1613(_0x2fae98);})[_0x9026('0x14')](function(_0x3cead8){logger[_0x9026('0xf')](_0x9026('0x15'),_0x3cead8[_0x9026('0x12')],_0x15b3ab);_0x3e57f7(_0x4e37d0[_0x9026('0xf')](0x1f4,_0x3cead8[_0x9026('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 0c8a3bf..d9a00b8 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 _0xec9a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','delete','destroy','removeLists','exports','multer','util'];(function(_0x5bbb0a,_0x34b481){var _0x443e82=function(_0x4fbd29){while(--_0x4fbd29){_0x5bbb0a['push'](_0x5bbb0a['shift']());}};_0x443e82(++_0x34b481);}(_0xec9a,0x196));var _0xaec9=function(_0x109c8b,_0x1867ed){_0x109c8b=_0x109c8b-0x0;var _0x9324=_0xec9a[_0x109c8b];return _0x9324;};'use strict';var multer=require(_0xaec9('0x0'));var util=require(_0xaec9('0x1'));var path=require('path');var timeout=require(_0xaec9('0x2'));var express=require('express');var router=express[_0xaec9('0x3')]();var fs_extra=require(_0xaec9('0x4'));var auth=require(_0xaec9('0x5'));var interaction=require(_0xaec9('0x6'));var config=require(_0xaec9('0x7'));var controller=require(_0xaec9('0x8'));router[_0xaec9('0x9')]('/',auth[_0xaec9('0xa')](),controller['index']);router[_0xaec9('0x9')](_0xaec9('0xb'),auth[_0xaec9('0xa')](),controller[_0xaec9('0xc')]);router[_0xaec9('0x9')](_0xaec9('0xd'),auth[_0xaec9('0xa')](),controller[_0xaec9('0xe')]);router['get'](_0xaec9('0xf'),auth[_0xaec9('0xa')](),controller['getHopperHistories']);router[_0xaec9('0x9')](_0xaec9('0x10'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x11')]);router['get'](_0xaec9('0x12'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x13')]);router[_0xaec9('0x9')]('/:id/lists',auth[_0xaec9('0xa')](),controller[_0xaec9('0x14')]);router['get']('/:id/blacklists',auth[_0xaec9('0xa')](),controller[_0xaec9('0x15')]);router[_0xaec9('0x16')]('/',auth[_0xaec9('0xa')](),controller[_0xaec9('0x17')]);router['post']('/:id/clone',auth[_0xaec9('0xa')](),controller[_0xaec9('0x18')]);router[_0xaec9('0x16')](_0xaec9('0x19'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x1a')]);router[_0xaec9('0x16')](_0xaec9('0x1b'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x1c')]);router[_0xaec9('0x1d')](_0xaec9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xaec9('0x1e')](_0xaec9('0xb'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x1f')]);router['delete'](_0xaec9('0x19'),auth[_0xaec9('0xa')](),controller[_0xaec9('0x20')]);router[_0xaec9('0x1e')](_0xaec9('0x1b'),auth[_0xaec9('0xa')](),controller['removeBlackLists']);module[_0xaec9('0x21')]=router;
\ No newline at end of file
+var _0x28ff=['getHopperFinals','getHopperBlacks','/:id/lists','getLists','post','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','index','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals'];(function(_0x516b5d,_0x5a0ee0){var _0x28be8e=function(_0x3573c2){while(--_0x3573c2){_0x516b5d['push'](_0x516b5d['shift']());}};_0x28be8e(++_0x5a0ee0);}(_0x28ff,0x138));var _0xf28f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28ff[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf28f('0x0'));var path=require(_0xf28f('0x1'));var timeout=require(_0xf28f('0x2'));var express=require(_0xf28f('0x3'));var router=express[_0xf28f('0x4')]();var fs_extra=require(_0xf28f('0x5'));var auth=require(_0xf28f('0x6'));var interaction=require(_0xf28f('0x7'));var config=require('../../config/environment');var controller=require(_0xf28f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf28f('0x9')]);router[_0xf28f('0xa')](_0xf28f('0xb'),auth[_0xf28f('0xc')](),controller[_0xf28f('0xd')]);router[_0xf28f('0xa')](_0xf28f('0xe'),auth[_0xf28f('0xc')](),controller[_0xf28f('0xf')]);router[_0xf28f('0xa')](_0xf28f('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xf28f('0xa')](_0xf28f('0x11'),auth['isAuthenticated'](),controller[_0xf28f('0x12')]);router[_0xf28f('0xa')]('/:id/hopper_black',auth[_0xf28f('0xc')](),controller[_0xf28f('0x13')]);router['get'](_0xf28f('0x14'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x15')]);router['get']('/:id/blacklists',auth[_0xf28f('0xc')](),controller['getBlackLists']);router[_0xf28f('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf28f('0x16')](_0xf28f('0x17'),auth['isAuthenticated'](),controller[_0xf28f('0x18')]);router[_0xf28f('0x16')](_0xf28f('0x14'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x19')]);router[_0xf28f('0x16')](_0xf28f('0x1a'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x1b')]);router[_0xf28f('0x1c')](_0xf28f('0xb'),auth[_0xf28f('0xc')](),controller['update']);router[_0xf28f('0x1d')](_0xf28f('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xf28f('0x1d')](_0xf28f('0x14'),auth[_0xf28f('0xc')](),controller[_0xf28f('0x1e')]);router['delete'](_0xf28f('0x1a'),auth['isAuthenticated'](),controller[_0xf28f('0x1f')]);module[_0xf28f('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index da403b3..d22604d 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 _0x9156=['STRING','TEXT','VIRTUAL','exports'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x9156,0x7f));var _0x6915=function(_0x3ee026,_0x5dbab7){_0x3ee026=_0x3ee026-0x0;var _0x5da522=_0x9156[_0x3ee026];return _0x5da522;};'use strict';var Sequelize=require('sequelize');module[_0x6915('0x0')]={'key':{'type':Sequelize[_0x6915('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x6915('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6915('0x3')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x57b2=['key','sequelize','STRING','TEXT','getDataValue'];(function(_0x8e7fb0,_0x3453c1){var _0x2d20b9=function(_0x3075a8){while(--_0x3075a8){_0x8e7fb0['push'](_0x8e7fb0['shift']());}};_0x2d20b9(++_0x3453c1);}(_0x57b2,0x150));var _0x257b=function(_0x2ba5d2,_0x14ef5c){_0x2ba5d2=_0x2ba5d2-0x0;var _0x5d9933=_0x57b2[_0x2ba5d2];return _0x5d9933;};'use strict';var Sequelize=require(_0x257b('0x0'));module['exports']={'key':{'type':Sequelize[_0x257b('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x257b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x257b('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x257b('0x3')](_0x257b('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index b8768ff..8807730 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 _0xa352=['status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','findAll','rows','show','params','length','options','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus'];(function(_0x4a7228,_0x38a45e){var _0x91b7a3=function(_0x60cd55){while(--_0x60cd55){_0x4a7228['push'](_0x4a7228['shift']());}};_0x91b7a3(++_0x38a45e);}(_0xa352,0x9a));var _0x2a35=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa352[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x2a35('0x0'));var rimraf=require(_0x2a35('0x1'));var zipdir=require(_0x2a35('0x2'));var jsonpatch=require(_0x2a35('0x3'));var rp=require(_0x2a35('0x4'));var moment=require(_0x2a35('0x5'));var BPromise=require(_0x2a35('0x6'));var Mustache=require(_0x2a35('0x7'));var util=require(_0x2a35('0x8'));var path=require('path');var sox=require(_0x2a35('0x9'));var csv=require('to-csv');var ejs=require(_0x2a35('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a35('0xb'));var crypto=require('crypto');var jsforce=require(_0x2a35('0xc'));var deskjs=require(_0x2a35('0xd'));var toCsv=require(_0x2a35('0xe'));var querystring=require('querystring');var Papa=require(_0x2a35('0xf'));var Redis=require(_0x2a35('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2a35('0x11'));var as=require(_0x2a35('0x12'));var hardwareService=require(_0x2a35('0x13'));var logger=require('../../config/logger')(_0x2a35('0x14'));var utils=require(_0x2a35('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2a35('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x521958,_0x39a837){_0x39a837=_0x39a837||0xcc;return function(_0x5ed7e9){if(_0x5ed7e9){return _0x521958[_0x2a35('0x17')](_0x39a837);}return _0x521958[_0x2a35('0x18')](_0x39a837)['end']();};}function respondWithResult(_0x278367,_0x3ccab0){_0x3ccab0=_0x3ccab0||0xc8;return function(_0x59d90d){if(_0x59d90d){return _0x278367[_0x2a35('0x18')](_0x3ccab0)[_0x2a35('0x19')](_0x59d90d);}};}function respondWithFilteredResult(_0xfdf2a8,_0x59400d){return function(_0x584ade){if(_0x584ade){var _0x580532=typeof _0x59400d[_0x2a35('0x1a')]===_0x2a35('0x1b')&&typeof _0x59400d[_0x2a35('0x1c')]===_0x2a35('0x1b');var _0x44d3eb=_0x584ade[_0x2a35('0x1d')];var _0x38a2de=_0x580532?0x0:_0x59400d[_0x2a35('0x1a')];var _0x143d87=_0x580532?_0x584ade[_0x2a35('0x1d')]:_0x59400d[_0x2a35('0x1a')]+_0x59400d[_0x2a35('0x1c')];var _0x36009b;if(_0x143d87>=_0x44d3eb){_0x143d87=_0x44d3eb;_0x36009b=0xc8;}else{_0x36009b=0xce;}_0xfdf2a8[_0x2a35('0x18')](_0x36009b);return _0xfdf2a8[_0x2a35('0x1e')](_0x2a35('0x1f'),_0x38a2de+'-'+_0x143d87+'/'+_0x44d3eb)['json'](_0x584ade);}return null;};}function patchUpdates(_0x1d7f3d){return function(_0xbd1cb5){try{jsonpatch['apply'](_0xbd1cb5,_0x1d7f3d,!![]);}catch(_0x420a84){return BPromise[_0x2a35('0x20')](_0x420a84);}return _0xbd1cb5[_0x2a35('0x21')]();};}function saveUpdates(_0x355e44,_0x595523){return function(_0x4019c5){if(_0x4019c5){return _0x4019c5['update'](_0x355e44)[_0x2a35('0x22')](function(_0x2165a4){return _0x2165a4;});}return null;};}function removeEntity(_0x3d56c1,_0x4dba2b){return function(_0x4a8374){if(_0x4a8374){return _0x4a8374['destroy']()[_0x2a35('0x22')](function(){var _0x19ef50=_0x4a8374[_0x2a35('0x23')]({'plain':!![]});var _0x3645f7='CannedAnswers';return db[_0x2a35('0x24')][_0x2a35('0x25')]({'where':{'type':_0x3645f7,'resourceId':_0x19ef50['id']}})[_0x2a35('0x22')](function(){return _0x4a8374;});})[_0x2a35('0x22')](function(){_0x3d56c1[_0x2a35('0x18')](0xcc)[_0x2a35('0x26')]();});}};}function handleEntityNotFound(_0x562d57,_0xa6bb30){return function(_0x49da8c){if(!_0x49da8c){_0x562d57['sendStatus'](0x194);}return _0x49da8c;};}function handleError(_0x5ecc9e,_0xef5c8b){_0xef5c8b=_0xef5c8b||0x1f4;return function(_0x581fb7){logger[_0x2a35('0x27')](_0x581fb7[_0x2a35('0x28')]);if(_0x581fb7[_0x2a35('0x29')]){delete _0x581fb7[_0x2a35('0x29')];}_0x5ecc9e[_0x2a35('0x18')](_0xef5c8b)[_0x2a35('0x2a')](_0x581fb7);};}exports[_0x2a35('0x2b')]=function(_0x1988cb,_0x182a14){var _0x3168e6={},_0x3f8758={},_0x39de9b={'count':0x0,'rows':[]};var _0x32a189=_['map'](db[_0x2a35('0x2c')][_0x2a35('0x2d')],function(_0x52ce4c){return{'name':_0x52ce4c[_0x2a35('0x2e')],'type':_0x52ce4c[_0x2a35('0x2f')][_0x2a35('0x30')]};});_0x3f8758[_0x2a35('0x31')]=_[_0x2a35('0x32')](_0x32a189,_0x2a35('0x29'));_0x3f8758[_0x2a35('0x33')]=_[_0x2a35('0x34')](_0x1988cb[_0x2a35('0x33')]);_0x3f8758[_0x2a35('0x35')]=_[_0x2a35('0x36')](_0x3f8758[_0x2a35('0x31')],_0x3f8758[_0x2a35('0x33')]);_0x3168e6[_0x2a35('0x37')]=_[_0x2a35('0x36')](_0x3f8758['model'],qs[_0x2a35('0x38')](_0x1988cb[_0x2a35('0x33')]['fields']));_0x3168e6['attributes']=_0x3168e6['attributes']['length']?_0x3168e6[_0x2a35('0x37')]:_0x3f8758[_0x2a35('0x31')];if(!_0x1988cb[_0x2a35('0x33')][_0x2a35('0x39')](_0x2a35('0x3a'))){_0x3168e6[_0x2a35('0x1c')]=qs['limit'](_0x1988cb[_0x2a35('0x33')][_0x2a35('0x1c')]);_0x3168e6[_0x2a35('0x1a')]=qs[_0x2a35('0x1a')](_0x1988cb[_0x2a35('0x33')][_0x2a35('0x1a')]);}_0x3168e6[_0x2a35('0x3b')]=qs[_0x2a35('0x3c')](_0x1988cb['query'][_0x2a35('0x3c')]);_0x3168e6[_0x2a35('0x3d')]=qs[_0x2a35('0x35')](_[_0x2a35('0x3e')](_0x1988cb[_0x2a35('0x33')],_0x3f8758[_0x2a35('0x35')]),_0x32a189);if(_0x1988cb[_0x2a35('0x33')]['filter']){_0x3168e6[_0x2a35('0x3d')]=_[_0x2a35('0x3f')](_0x3168e6[_0x2a35('0x3d')],{'$or':[{'key':{'$like':'%'+_0x1988cb['query'][_0x2a35('0x40')]+'%'}},{'value':{'$like':'%'+_0x1988cb[_0x2a35('0x33')][_0x2a35('0x40')]+'%'}}]});}_0x3168e6=_[_0x2a35('0x3f')]({},_0x3168e6,_0x1988cb['options']);var _0x4b3e40={'where':_0x3168e6[_0x2a35('0x3d')]};return db[_0x2a35('0x2c')][_0x2a35('0x1d')](_0x4b3e40)[_0x2a35('0x22')](function(_0x3981c5){_0x39de9b[_0x2a35('0x1d')]=_0x3981c5;if(_0x1988cb[_0x2a35('0x33')][_0x2a35('0x41')]){_0x3168e6['include']=[{'all':!![]}];}return db[_0x2a35('0x2c')][_0x2a35('0x42')](_0x3168e6);})[_0x2a35('0x22')](function(_0x5df4e6){_0x39de9b[_0x2a35('0x43')]=_0x5df4e6;return _0x39de9b;})[_0x2a35('0x22')](respondWithFilteredResult(_0x182a14,_0x3168e6))['catch'](handleError(_0x182a14,null));};exports[_0x2a35('0x44')]=function(_0x4007ea,_0x174ce1){var _0x1f09e9={'raw':!![],'where':{'id':_0x4007ea[_0x2a35('0x45')]['id']}},_0x41d0f4={};_0x41d0f4['model']=_['keys'](db[_0x2a35('0x2c')][_0x2a35('0x2d')]);_0x41d0f4[_0x2a35('0x33')]=_[_0x2a35('0x34')](_0x4007ea[_0x2a35('0x33')]);_0x41d0f4[_0x2a35('0x35')]=_[_0x2a35('0x36')](_0x41d0f4[_0x2a35('0x31')],_0x41d0f4['query']);_0x1f09e9[_0x2a35('0x37')]=_[_0x2a35('0x36')](_0x41d0f4['model'],qs['fields'](_0x4007ea['query']['fields']));_0x1f09e9[_0x2a35('0x37')]=_0x1f09e9[_0x2a35('0x37')][_0x2a35('0x46')]?_0x1f09e9['attributes']:_0x41d0f4[_0x2a35('0x31')];if(_0x4007ea[_0x2a35('0x33')][_0x2a35('0x41')]){_0x1f09e9['include']=[{'all':!![]}];}_0x1f09e9=_[_0x2a35('0x3f')]({},_0x1f09e9,_0x4007ea[_0x2a35('0x47')]);return db[_0x2a35('0x2c')][_0x2a35('0x48')](_0x1f09e9)[_0x2a35('0x22')](handleEntityNotFound(_0x174ce1,null))[_0x2a35('0x22')](respondWithResult(_0x174ce1,null))[_0x2a35('0x49')](handleError(_0x174ce1,null));};exports[_0x2a35('0x4a')]=function(_0x3a2ecd,_0x2bf8df){if(_0x3a2ecd['body']['id']){delete _0x3a2ecd[_0x2a35('0x4b')]['id'];}return db[_0x2a35('0x2c')][_0x2a35('0x48')]({'where':{'id':_0x3a2ecd[_0x2a35('0x45')]['id']}})[_0x2a35('0x22')](handleEntityNotFound(_0x2bf8df,null))[_0x2a35('0x22')](saveUpdates(_0x3a2ecd['body'],null))[_0x2a35('0x22')](respondWithResult(_0x2bf8df,null))['catch'](handleError(_0x2bf8df,null));};exports[_0x2a35('0x25')]=function(_0x26455f,_0x1cc5ac){return db['CannedAnswer'][_0x2a35('0x48')]({'where':{'id':_0x26455f[_0x2a35('0x45')]['id']}})[_0x2a35('0x22')](handleEntityNotFound(_0x1cc5ac,null))['then'](removeEntity(_0x1cc5ac,null))[_0x2a35('0x49')](handleError(_0x1cc5ac,null));};exports['create']=function(_0x15d43d,_0x5221c1){var _0xb91a76={'key':_0x15d43d['body'][_0x2a35('0x30')]};if(_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4c')]){_0xb91a76[_0x2a35('0x4c')]=_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4c')];}else if(_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4d')]){_0xb91a76[_0x2a35('0x4d')]=_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4d')];}else if(_0x15d43d[_0x2a35('0x4b')][_0x2a35('0x4e')]){_0xb91a76[_0x2a35('0x4e')]=_0x15d43d['body']['OpenchannelAccountId'];}else if(_0x15d43d[_0x2a35('0x4b')]['ChatWebsiteId']){_0xb91a76[_0x2a35('0x4f')]=_0x15d43d[_0x2a35('0x4b')]['ChatWebsiteId'];}return db[_0x2a35('0x2c')]['find']({'where':_0xb91a76})[_0x2a35('0x22')](function(_0x1319c9){if(_0x1319c9){throw new db['Sequelize']['ValidationError'](_0x2a35('0x50'));}return db[_0x2a35('0x2c')][_0x2a35('0x51')](_0x15d43d['body']);})[_0x2a35('0x22')](function(_0x3947ee){var _0x27f973=_0x15d43d[_0x2a35('0x52')][_0x2a35('0x23')]({'plain':!![]});if(!_0x27f973)throw new Error(_0x2a35('0x53'));if(_0x27f973[_0x2a35('0x54')]===_0x2a35('0x52')){var _0x44d672=_0x3947ee[_0x2a35('0x23')]({'plain':!![]});return db[_0x2a35('0x55')][_0x2a35('0x48')]({'where':{'name':_0x2a35('0x56'),'userProfileId':_0x27f973[_0x2a35('0x57')]},'raw':!![]})[_0x2a35('0x22')](function(_0x37fa75){if(_0x37fa75&&_0x37fa75[_0x2a35('0x58')]===0x0){return db[_0x2a35('0x24')]['create']({'name':_0x44d672['name'],'resourceId':_0x44d672['id'],'type':_0x37fa75[_0x2a35('0x29')],'sectionId':_0x37fa75['id']},{})['then'](function(){return _0x3947ee;});}else{return _0x3947ee;}})[_0x2a35('0x49')](function(_0x3f32d5){logger[_0x2a35('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f32d5);throw _0x3f32d5;});}return _0x3947ee;})[_0x2a35('0x22')](respondWithResult(_0x5221c1,0xc9))[_0x2a35('0x49')](handleError(_0x5221c1,null));};
\ No newline at end of file
+var _0xa986=['mustache','path','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','includeAll','findAll','rows','catch','show','params','keys','length','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','bluebird'];(function(_0x59416f,_0x24068d){var _0x5cd23a=function(_0x5174f7){while(--_0x5174f7){_0x59416f['push'](_0x59416f['shift']());}};_0x5cd23a(++_0x24068d);}(_0xa986,0x1ee));var _0x6a98=function(_0x4342b4,_0x157ddf){_0x4342b4=_0x4342b4-0x0;var _0x13e947=_0xa986[_0x4342b4];return _0x13e947;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a98('0x0'));var zipdir=require(_0x6a98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a98('0x2'));var moment=require('moment');var BPromise=require(_0x6a98('0x3'));var Mustache=require(_0x6a98('0x4'));var util=require('util');var path=require(_0x6a98('0x5'));var sox=require('sox');var csv=require(_0x6a98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a98('0x7'));var squel=require(_0x6a98('0x8'));var crypto=require('crypto');var jsforce=require(_0x6a98('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a98('0xa'));var Papa=require(_0x6a98('0xb'));var Redis=require('ioredis');var authService=require(_0x6a98('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6a98('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a98('0xe'))(_0x6a98('0xf'));var utils=require(_0x6a98('0x10'));var config=require(_0x6a98('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a98('0x12'))['db'];function respondWithStatusCode(_0xe97200,_0x15013a){_0x15013a=_0x15013a||0xcc;return function(_0x53ae3d){if(_0x53ae3d){return _0xe97200[_0x6a98('0x13')](_0x15013a);}return _0xe97200[_0x6a98('0x14')](_0x15013a)[_0x6a98('0x15')]();};}function respondWithResult(_0x356100,_0x3b2faf){_0x3b2faf=_0x3b2faf||0xc8;return function(_0x416eac){if(_0x416eac){return _0x356100[_0x6a98('0x14')](_0x3b2faf)[_0x6a98('0x16')](_0x416eac);}};}function respondWithFilteredResult(_0x233241,_0x5ea882){return function(_0x101fc0){if(_0x101fc0){var _0x4b61d5=typeof _0x5ea882[_0x6a98('0x17')]===_0x6a98('0x18')&&typeof _0x5ea882[_0x6a98('0x19')]===_0x6a98('0x18');var _0x52177=_0x101fc0[_0x6a98('0x1a')];var _0x3b290a=_0x4b61d5?0x0:_0x5ea882[_0x6a98('0x17')];var _0x1e8de9=_0x4b61d5?_0x101fc0['count']:_0x5ea882[_0x6a98('0x17')]+_0x5ea882[_0x6a98('0x19')];var _0x3d3fef;if(_0x1e8de9>=_0x52177){_0x1e8de9=_0x52177;_0x3d3fef=0xc8;}else{_0x3d3fef=0xce;}_0x233241[_0x6a98('0x14')](_0x3d3fef);return _0x233241[_0x6a98('0x1b')]('Content-Range',_0x3b290a+'-'+_0x1e8de9+'/'+_0x52177)[_0x6a98('0x16')](_0x101fc0);}return null;};}function patchUpdates(_0x43fd58){return function(_0x193b2a){try{jsonpatch[_0x6a98('0x1c')](_0x193b2a,_0x43fd58,!![]);}catch(_0x351dff){return BPromise[_0x6a98('0x1d')](_0x351dff);}return _0x193b2a[_0x6a98('0x1e')]();};}function saveUpdates(_0x5777af,_0x4ca9f4){return function(_0x4427de){if(_0x4427de){return _0x4427de[_0x6a98('0x1f')](_0x5777af)[_0x6a98('0x20')](function(_0x114c3b){return _0x114c3b;});}return null;};}function removeEntity(_0x128f47,_0x292233){return function(_0x5ef0fd){if(_0x5ef0fd){return _0x5ef0fd[_0x6a98('0x21')]()[_0x6a98('0x20')](function(){var _0x19ec84=_0x5ef0fd[_0x6a98('0x22')]({'plain':!![]});var _0x4ad6f3=_0x6a98('0x23');return db[_0x6a98('0x24')][_0x6a98('0x21')]({'where':{'type':_0x4ad6f3,'resourceId':_0x19ec84['id']}})[_0x6a98('0x20')](function(){return _0x5ef0fd;});})[_0x6a98('0x20')](function(){_0x128f47[_0x6a98('0x14')](0xcc)[_0x6a98('0x15')]();});}};}function handleEntityNotFound(_0x188734,_0x5b5b1f){return function(_0x2184bb){if(!_0x2184bb){_0x188734[_0x6a98('0x13')](0x194);}return _0x2184bb;};}function handleError(_0x2f6dd6,_0x51f158){_0x51f158=_0x51f158||0x1f4;return function(_0x1ef0c3){logger[_0x6a98('0x25')](_0x1ef0c3['stack']);if(_0x1ef0c3[_0x6a98('0x26')]){delete _0x1ef0c3['name'];}_0x2f6dd6[_0x6a98('0x14')](_0x51f158)[_0x6a98('0x27')](_0x1ef0c3);};}exports[_0x6a98('0x28')]=function(_0x7ad977,_0x23e24c){var _0xdaa70={},_0x3b387f={},_0x16b108={'count':0x0,'rows':[]};var _0x57896a=_['map'](db[_0x6a98('0x29')][_0x6a98('0x2a')],function(_0x5f0a8c){return{'name':_0x5f0a8c[_0x6a98('0x2b')],'type':_0x5f0a8c[_0x6a98('0x2c')][_0x6a98('0x2d')]};});_0x3b387f[_0x6a98('0x2e')]=_[_0x6a98('0x2f')](_0x57896a,_0x6a98('0x26'));_0x3b387f[_0x6a98('0x30')]=_['keys'](_0x7ad977[_0x6a98('0x30')]);_0x3b387f['filters']=_[_0x6a98('0x31')](_0x3b387f[_0x6a98('0x2e')],_0x3b387f[_0x6a98('0x30')]);_0xdaa70[_0x6a98('0x32')]=_[_0x6a98('0x31')](_0x3b387f[_0x6a98('0x2e')],qs[_0x6a98('0x33')](_0x7ad977[_0x6a98('0x30')]['fields']));_0xdaa70['attributes']=_0xdaa70['attributes']['length']?_0xdaa70[_0x6a98('0x32')]:_0x3b387f['model'];if(!_0x7ad977[_0x6a98('0x30')][_0x6a98('0x34')]('nolimit')){_0xdaa70[_0x6a98('0x19')]=qs['limit'](_0x7ad977[_0x6a98('0x30')]['limit']);_0xdaa70[_0x6a98('0x17')]=qs[_0x6a98('0x17')](_0x7ad977[_0x6a98('0x30')][_0x6a98('0x17')]);}_0xdaa70[_0x6a98('0x35')]=qs['sort'](_0x7ad977[_0x6a98('0x30')][_0x6a98('0x36')]);_0xdaa70[_0x6a98('0x37')]=qs['filters'](_[_0x6a98('0x38')](_0x7ad977['query'],_0x3b387f[_0x6a98('0x39')]),_0x57896a);if(_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3a')]){_0xdaa70['where']=_['merge'](_0xdaa70[_0x6a98('0x37')],{'$or':[{'key':{'$like':'%'+_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3a')]+'%'}},{'value':{'$like':'%'+_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3a')]+'%'}}]});}_0xdaa70=_[_0x6a98('0x3b')]({},_0xdaa70,_0x7ad977['options']);var _0x3698ef={'where':_0xdaa70[_0x6a98('0x37')]};return db[_0x6a98('0x29')][_0x6a98('0x1a')](_0x3698ef)[_0x6a98('0x20')](function(_0x2cca33){_0x16b108[_0x6a98('0x1a')]=_0x2cca33;if(_0x7ad977[_0x6a98('0x30')][_0x6a98('0x3c')]){_0xdaa70['include']=[{'all':!![]}];}return db[_0x6a98('0x29')][_0x6a98('0x3d')](_0xdaa70);})[_0x6a98('0x20')](function(_0x47b33c){_0x16b108[_0x6a98('0x3e')]=_0x47b33c;return _0x16b108;})[_0x6a98('0x20')](respondWithFilteredResult(_0x23e24c,_0xdaa70))[_0x6a98('0x3f')](handleError(_0x23e24c,null));};exports[_0x6a98('0x40')]=function(_0xc6e39c,_0x1df41f){var _0x4fe5b7={'raw':!![],'where':{'id':_0xc6e39c[_0x6a98('0x41')]['id']}},_0x1328f6={};_0x1328f6['model']=_[_0x6a98('0x42')](db[_0x6a98('0x29')][_0x6a98('0x2a')]);_0x1328f6['query']=_[_0x6a98('0x42')](_0xc6e39c[_0x6a98('0x30')]);_0x1328f6[_0x6a98('0x39')]=_[_0x6a98('0x31')](_0x1328f6['model'],_0x1328f6['query']);_0x4fe5b7[_0x6a98('0x32')]=_[_0x6a98('0x31')](_0x1328f6[_0x6a98('0x2e')],qs[_0x6a98('0x33')](_0xc6e39c['query']['fields']));_0x4fe5b7['attributes']=_0x4fe5b7['attributes'][_0x6a98('0x43')]?_0x4fe5b7[_0x6a98('0x32')]:_0x1328f6[_0x6a98('0x2e')];if(_0xc6e39c[_0x6a98('0x30')][_0x6a98('0x3c')]){_0x4fe5b7['include']=[{'all':!![]}];}_0x4fe5b7=_['merge']({},_0x4fe5b7,_0xc6e39c[_0x6a98('0x44')]);return db[_0x6a98('0x29')][_0x6a98('0x45')](_0x4fe5b7)['then'](handleEntityNotFound(_0x1df41f,null))['then'](respondWithResult(_0x1df41f,null))[_0x6a98('0x3f')](handleError(_0x1df41f,null));};exports[_0x6a98('0x1f')]=function(_0x1b45bc,_0x212056){if(_0x1b45bc[_0x6a98('0x46')]['id']){delete _0x1b45bc[_0x6a98('0x46')]['id'];}return db['CannedAnswer'][_0x6a98('0x45')]({'where':{'id':_0x1b45bc['params']['id']}})[_0x6a98('0x20')](handleEntityNotFound(_0x212056,null))[_0x6a98('0x20')](saveUpdates(_0x1b45bc['body'],null))[_0x6a98('0x20')](respondWithResult(_0x212056,null))[_0x6a98('0x3f')](handleError(_0x212056,null));};exports[_0x6a98('0x21')]=function(_0x2aef2b,_0x5c636d){return db[_0x6a98('0x29')][_0x6a98('0x45')]({'where':{'id':_0x2aef2b[_0x6a98('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c636d,null))[_0x6a98('0x20')](removeEntity(_0x5c636d,null))[_0x6a98('0x3f')](handleError(_0x5c636d,null));};exports['create']=function(_0x1a0505,_0x25b8ac){var _0x1f7a4b={'key':_0x1a0505[_0x6a98('0x46')][_0x6a98('0x2d')]};if(_0x1a0505[_0x6a98('0x46')][_0x6a98('0x47')]){_0x1f7a4b[_0x6a98('0x47')]=_0x1a0505[_0x6a98('0x46')]['MailAccountId'];}else if(_0x1a0505['body'][_0x6a98('0x48')]){_0x1f7a4b[_0x6a98('0x48')]=_0x1a0505[_0x6a98('0x46')][_0x6a98('0x48')];}else if(_0x1a0505[_0x6a98('0x46')][_0x6a98('0x49')]){_0x1f7a4b['OpenchannelAccountId']=_0x1a0505[_0x6a98('0x46')][_0x6a98('0x49')];}else if(_0x1a0505['body'][_0x6a98('0x4a')]){_0x1f7a4b['ChatWebsiteId']=_0x1a0505[_0x6a98('0x46')][_0x6a98('0x4a')];}return db[_0x6a98('0x29')]['find']({'where':_0x1f7a4b})[_0x6a98('0x20')](function(_0x3d3c1f){if(_0x3d3c1f){throw new db[(_0x6a98('0x4b'))][(_0x6a98('0x4c'))](_0x6a98('0x4d'));}return db[_0x6a98('0x29')]['create'](_0x1a0505[_0x6a98('0x46')]);})['then'](function(_0xca9153){var _0x2fd526=_0x1a0505[_0x6a98('0x4e')]['get']({'plain':!![]});if(!_0x2fd526)throw new Error(_0x6a98('0x4f'));if(_0x2fd526['role']==='user'){var _0x32440b=_0xca9153[_0x6a98('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x2fd526[_0x6a98('0x50')]},'raw':!![]})[_0x6a98('0x20')](function(_0x460009){if(_0x460009&&_0x460009['autoAssociation']===0x0){return db['UserProfileResource'][_0x6a98('0x51')]({'name':_0x32440b[_0x6a98('0x26')],'resourceId':_0x32440b['id'],'type':_0x460009[_0x6a98('0x26')],'sectionId':_0x460009['id']},{})[_0x6a98('0x20')](function(){return _0xca9153;});}else{return _0xca9153;}})['catch'](function(_0x36d39e){logger[_0x6a98('0x25')](_0x6a98('0x52'),_0x36d39e);throw _0x36d39e;});}return _0xca9153;})[_0x6a98('0x20')](respondWithResult(_0x25b8ac,0xc9))[_0x6a98('0x3f')](handleError(_0x25b8ac,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index de12153..cf85ecb 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 _0x1e06=['../../config/logger','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util'];(function(_0x56f6e3,_0x58c45c){var _0x2b27ad=function(_0x332a1f){while(--_0x332a1f){_0x56f6e3['push'](_0x56f6e3['shift']());}};_0x2b27ad(++_0x58c45c);}(_0x1e06,0x73));var _0x61e0=function(_0x282c12,_0x189c40){_0x282c12=_0x282c12-0x0;var _0x3f61e7=_0x1e06[_0x282c12];return _0x3f61e7;};'use strict';var _=require(_0x61e0('0x0'));var util=require(_0x61e0('0x1'));var logger=require(_0x61e0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x61e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61e0('0x4'));var rimraf=require(_0x61e0('0x5'));var config=require(_0x61e0('0x6'));var attributes=require(_0x61e0('0x7'));module[_0x61e0('0x8')]=function(_0x30f7d9,_0x37b341){return _0x30f7d9[_0x61e0('0x9')](_0x61e0('0xa'),attributes,{'tableName':_0x61e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61e0('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9d3f=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers'];(function(_0x1e814b,_0x4262ac){var _0x13456c=function(_0x205d42){while(--_0x205d42){_0x1e814b['push'](_0x1e814b['shift']());}};_0x13456c(++_0x4262ac);}(_0x9d3f,0x18e));var _0xf9d3=function(_0x17d011,_0x441407){_0x17d011=_0x17d011-0x0;var _0x4c754a=_0x9d3f[_0x17d011];return _0x4c754a;};'use strict';var _=require('lodash');var util=require(_0xf9d3('0x0'));var logger=require('../../config/logger')(_0xf9d3('0x1'));var moment=require(_0xf9d3('0x2'));var BPromise=require(_0xf9d3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf9d3('0x4'));var config=require(_0xf9d3('0x5'));var attributes=require(_0xf9d3('0x6'));module['exports']=function(_0x29d4ef,_0x273ef5){return _0x29d4ef[_0xf9d3('0x7')](_0xf9d3('0x8'),attributes,{'tableName':_0xf9d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf9d3('0xa'),'collate':_0xf9d3('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index da44496..14852d4 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(_0x1670c7,_0x39d84a){var _0x279b10=function(_0x5d65a8){while(--_0x5d65a8){_0x1670c7['push'](_0x1670c7['shift']());}};_0x279b10(++_0x39d84a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0xe431fd,_0x437ce0){var _0x80aee5=function(_0x3bb191){while(--_0x3bb191){_0xe431fd['push'](_0xe431fd['shift']());}};_0x80aee5(++_0x437ce0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 bf8267f..20dfc0d 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 _0x2c84=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x12399e,_0x124066){var _0x3f0dab=function(_0x453dd7){while(--_0x453dd7){_0x12399e['push'](_0x12399e['shift']());}};_0x3f0dab(++_0x124066);}(_0x2c84,0x76));var _0x42c8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2c84[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x42c8('0x0'));var util=require('util');var path=require(_0x42c8('0x1'));var timeout=require('connect-timeout');var express=require(_0x42c8('0x2'));var router=express[_0x42c8('0x3')]();var fs_extra=require(_0x42c8('0x4'));var auth=require(_0x42c8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42c8('0x6'));var controller=require(_0x42c8('0x7'));router[_0x42c8('0x8')]('/',auth[_0x42c8('0x9')](),controller[_0x42c8('0xa')]);router['get'](_0x42c8('0xb'),auth['isAuthenticated'](),controller[_0x42c8('0xc')]);router[_0x42c8('0xd')]('/',auth['isAuthenticated'](),controller[_0x42c8('0xe')]);router[_0x42c8('0xf')]('/:id',auth[_0x42c8('0x9')](),controller[_0x42c8('0x10')]);router[_0x42c8('0x11')](_0x42c8('0xb'),auth[_0x42c8('0x9')](),controller[_0x42c8('0x12')]);module[_0x42c8('0x13')]=router;
\ No newline at end of file
+var _0x74b7=['index','/:id','show','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x2157fe,_0x4f7ac4){var _0x55a8ef=function(_0x2ef1dc){while(--_0x2ef1dc){_0x2157fe['push'](_0x2157fe['shift']());}};_0x55a8ef(++_0x4f7ac4);}(_0x74b7,0x174));var _0x774b=function(_0x1eb7d4,_0x11bbf7){_0x1eb7d4=_0x1eb7d4-0x0;var _0xce6879=_0x74b7[_0x1eb7d4];return _0xce6879;};'use strict';var multer=require(_0x774b('0x0'));var util=require(_0x774b('0x1'));var path=require(_0x774b('0x2'));var timeout=require(_0x774b('0x3'));var express=require('express');var router=express[_0x774b('0x4')]();var fs_extra=require(_0x774b('0x5'));var auth=require(_0x774b('0x6'));var interaction=require(_0x774b('0x7'));var config=require(_0x774b('0x8'));var controller=require(_0x774b('0x9'));router[_0x774b('0xa')]('/',auth[_0x774b('0xb')](),controller[_0x774b('0xc')]);router[_0x774b('0xa')](_0x774b('0xd'),auth[_0x774b('0xb')](),controller[_0x774b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x774b('0xd'),auth[_0x774b('0xb')](),controller[_0x774b('0xf')]);router['delete'](_0x774b('0xd'),auth[_0x774b('0xb')](),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 33b6df0..9bad500 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 _0xe50e=['sequelize','STRING','INTEGER'];(function(_0x4f764a,_0x314898){var _0xab6e7=function(_0x45006a){while(--_0x45006a){_0x4f764a['push'](_0x4f764a['shift']());}};_0xab6e7(++_0x314898);}(_0xe50e,0xf9));var _0xee50=function(_0x548500,_0x25424b){_0x548500=_0x548500-0x0;var _0x4df2d7=_0xe50e[_0x548500];return _0x4df2d7;};'use strict';var Sequelize=require(_0xee50('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xee50('0x1')]},'src':{'type':Sequelize[_0xee50('0x1')]},'dst':{'type':Sequelize[_0xee50('0x1')]},'dcontext':{'type':Sequelize[_0xee50('0x1')]},'channel':{'type':Sequelize[_0xee50('0x1')]},'dstchannel':{'type':Sequelize[_0xee50('0x1')]},'lastapp':{'type':Sequelize[_0xee50('0x1')]},'lastdata':{'type':Sequelize[_0xee50('0x1')]},'duration':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee50('0x1')]},'amaflags':{'type':Sequelize[_0xee50('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xee50('0x1')]},'userfield':{'type':Sequelize[_0xee50('0x1')]},'uniqueid':{'type':Sequelize[_0xee50('0x1')]},'linkedid':{'type':Sequelize[_0xee50('0x1')]},'sequence':{'type':Sequelize[_0xee50('0x1')]},'peeraccount':{'type':Sequelize[_0xee50('0x1')]},'type':{'type':Sequelize[_0xee50('0x1')]},'tag':{'type':Sequelize[_0xee50('0x1')]}};
\ No newline at end of file
+var _0x18e0=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0xd33936,_0x1ffe76){var _0x899e0a=function(_0x3129c1){while(--_0x3129c1){_0xd33936['push'](_0xd33936['shift']());}};_0x899e0a(++_0x1ffe76);}(_0x18e0,0xa2));var _0x018e=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x18e0[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require('sequelize');module[_0x018e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x018e('0x1')},'clid':{'type':Sequelize[_0x018e('0x2')]},'src':{'type':Sequelize[_0x018e('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x018e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x018e('0x2')]},'lastdata':{'type':Sequelize[_0x018e('0x2')]},'duration':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x018e('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x018e('0x2')]},'linkedid':{'type':Sequelize[_0x018e('0x2')]},'sequence':{'type':Sequelize[_0x018e('0x2')]},'peeraccount':{'type':Sequelize[_0x018e('0x2')]},'type':{'type':Sequelize[_0x018e('0x2')]},'tag':{'type':Sequelize[_0x018e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 607c408..da97343 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 _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x49fad7,_0x1e4cf0){var _0x248e94=function(_0x5f28d3){while(--_0x5f28d3){_0x49fad7['push'](_0x49fad7['shift']());}};_0x248e94(++_0x1e4cf0);}(_0x24ca,0x8c));var _0xa24c=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x24ca[_0x264545];return _0x114d10;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['Cdr'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['Cdr'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));};
\ No newline at end of file
+var _0xafdd=['pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','fieldName','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xafdd,0x19a));var _0xdafd=function(_0x28e5b3,_0x33c91d){_0x28e5b3=_0x28e5b3-0x0;var _0x24d7d5=_0xafdd[_0x28e5b3];return _0x24d7d5;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['index']=function(_0x243182,_0x14626b){var _0x13ab81={},_0x249743={},_0x21edb6={'count':0x0,'rows':[]};var _0x324f0f=_['map'](db['Cdr']['rawAttributes'],function(_0xcca4f){return{'name':_0xcca4f[_0xdafd('0x2e')],'type':_0xcca4f['type']['key']};});_0x249743[_0xdafd('0x2f')]=_[_0xdafd('0x30')](_0x324f0f,_0xdafd('0x2c'));_0x249743[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0x243182[_0xdafd('0x31')]);_0x249743[_0xdafd('0x33')]=_['intersection'](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x31')]);_0x13ab81[_0xdafd('0x34')]=_['intersection'](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0x243182['query'][_0xdafd('0x35')]));_0x13ab81[_0xdafd('0x34')]=_0x13ab81[_0xdafd('0x34')]['length']?_0x13ab81[_0xdafd('0x34')]:_0x249743[_0xdafd('0x2f')];if(!_0x243182[_0xdafd('0x31')][_0xdafd('0x36')](_0xdafd('0x37'))){_0x13ab81[_0xdafd('0x20')]=qs[_0xdafd('0x20')](_0x243182['query'][_0xdafd('0x20')]);_0x13ab81[_0xdafd('0x1e')]=qs[_0xdafd('0x1e')](_0x243182[_0xdafd('0x31')][_0xdafd('0x1e')]);}_0x13ab81['order']=qs[_0xdafd('0x38')](_0x243182[_0xdafd('0x31')]['sort']);_0x13ab81[_0xdafd('0x39')]=qs[_0xdafd('0x33')](_[_0xdafd('0x3a')](_0x243182[_0xdafd('0x31')],_0x249743[_0xdafd('0x33')]),_0x324f0f);if(_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]){_0x13ab81[_0xdafd('0x39')]=_[_0xdafd('0x3c')](_0x13ab81[_0xdafd('0x39')],{'$or':_[_0xdafd('0x30')](_0x324f0f,function(_0x245163){if(_0x245163[_0xdafd('0x3d')]!==_0xdafd('0x3e')){var _0xb1e264={};_0xb1e264[_0x245163[_0xdafd('0x2c')]]={'$like':'%'+_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]+'%'};return _0xb1e264;}})});}_0x13ab81=_[_0xdafd('0x3c')]({},_0x13ab81,_0x243182[_0xdafd('0x3f')]);var _0x3f25c2={'where':_0x13ab81[_0xdafd('0x39')]};return db[_0xdafd('0x40')][_0xdafd('0x21')](_0x3f25c2)[_0xdafd('0x27')](function(_0x21d43d){_0x21edb6['count']=_0x21d43d;if(_0x243182['query'][_0xdafd('0x41')]){_0x13ab81['include']=[{'all':!![]}];}return db[_0xdafd('0x40')][_0xdafd('0x42')](_0x13ab81);})['then'](function(_0x4b463c){_0x21edb6[_0xdafd('0x43')]=_0x4b463c;return _0x21edb6;})[_0xdafd('0x27')](respondWithFilteredResult(_0x14626b,_0x13ab81))[_0xdafd('0x44')](handleError(_0x14626b,null));};exports[_0xdafd('0x45')]=function(_0xbc5159,_0x184a59){var _0x3a3a14={'raw':!![],'where':{'id':_0xbc5159[_0xdafd('0x46')]['id']}},_0x2417f8={};_0x2417f8['model']=_['keys'](db[_0xdafd('0x40')][_0xdafd('0x47')]);_0x2417f8[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0xbc5159[_0xdafd('0x31')]);_0x2417f8[_0xdafd('0x33')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],_0x2417f8[_0xdafd('0x31')]);_0x3a3a14[_0xdafd('0x34')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0xbc5159['query'][_0xdafd('0x35')]));_0x3a3a14['attributes']=_0x3a3a14[_0xdafd('0x34')]['length']?_0x3a3a14[_0xdafd('0x34')]:_0x2417f8[_0xdafd('0x2f')];if(_0xbc5159[_0xdafd('0x31')][_0xdafd('0x41')]){_0x3a3a14[_0xdafd('0x49')]=[{'all':!![]}];}_0x3a3a14=_[_0xdafd('0x3c')]({},_0x3a3a14,_0xbc5159['options']);return db[_0xdafd('0x40')][_0xdafd('0x4a')](_0x3a3a14)[_0xdafd('0x27')](handleEntityNotFound(_0x184a59,null))[_0xdafd('0x27')](respondWithResult(_0x184a59,null))[_0xdafd('0x44')](handleError(_0x184a59,null));};exports['create']=function(_0x48cc85,_0x189d61){return db[_0xdafd('0x40')][_0xdafd('0x4b')](_0x48cc85[_0xdafd('0x4c')],{})[_0xdafd('0x27')](respondWithResult(_0x189d61,0xc9))[_0xdafd('0x44')](handleError(_0x189d61,null));};exports[_0xdafd('0x4d')]=function(_0x2f5e4c,_0x2ae4cd){if(_0x2f5e4c['body']['id']){delete _0x2f5e4c[_0xdafd('0x4c')]['id'];}return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x2f5e4c[_0xdafd('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ae4cd,null))[_0xdafd('0x27')](saveUpdates(_0x2f5e4c[_0xdafd('0x4c')],null))[_0xdafd('0x27')](respondWithResult(_0x2ae4cd,null))[_0xdafd('0x44')](handleError(_0x2ae4cd,null));};exports[_0xdafd('0x28')]=function(_0x4b6fbb,_0x5af1a8){return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x4b6fbb['params']['id']}})['then'](handleEntityNotFound(_0x5af1a8,null))[_0xdafd('0x27')](removeEntity(_0x5af1a8,null))[_0xdafd('0x44')](handleError(_0x5af1a8,null));};exports['describe']=function(_0x2dde06,_0x5dc9a0){return db[_0xdafd('0x40')]['describe']()['then'](respondWithResult(_0x5dc9a0,null))[_0xdafd('0x44')](handleError(_0x5dc9a0,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 12fdb77..ff7f640 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(_0x57dec1,_0x256a77){var _0x2fd5f8=function(_0x3dfbfc){while(--_0x3dfbfc){_0x57dec1['push'](_0x57dec1['shift']());}};_0x2fd5f8(++_0x256a77);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x5bb2d8,_0x47a1db){var _0x19dc01=function(_0x205c45){while(--_0x205c45){_0x5bb2d8['push'](_0x5bb2d8['shift']());}};_0x19dc01(++_0x47a1db);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 6f84291..94c134c 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 _0xb700=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x37b546,_0x8c85de){var _0x24a3b5=function(_0x337bc5){while(--_0x337bc5){_0x37b546['push'](_0x37b546['shift']());}};_0x24a3b5(++_0x8c85de);}(_0xb700,0x7f));var _0x0b70=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0xb700[_0xe84805];return _0x398efd;};'use strict';var _=require(_0x0b70('0x0'));var util=require(_0x0b70('0x1'));var moment=require('moment');var BPromise=require(_0x0b70('0x2'));var rs=require(_0x0b70('0x3'));var fs=require('fs');var Redis=require(_0x0b70('0x4'));var db=require(_0x0b70('0x5'))['db'];var utils=require(_0x0b70('0x6'));var logger=require(_0x0b70('0x7'))('rpc');var config=require(_0x0b70('0x8'));var jayson=require(_0x0b70('0x9'));var client=jayson[_0x0b70('0xa')][_0x0b70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55422e,_0x28fcf1,_0x69b509){return new BPromise(function(_0x4105d9,_0x15d8ba){return client['request'](_0x55422e,_0x69b509)[_0x0b70('0xc')](function(_0x1883fa){logger['info'](_0x0b70('0xd'),_0x28fcf1,_0x0b70('0xe'));logger[_0x0b70('0xf')](_0x0b70('0x10'),_0x28fcf1,'request\x20sent',JSON['stringify'](_0x1883fa));if(_0x1883fa['error']){if(_0x1883fa[_0x0b70('0x11')]['code']===0x1f4){logger[_0x0b70('0x11')](_0x0b70('0xd'),_0x28fcf1,_0x1883fa[_0x0b70('0x11')][_0x0b70('0x12')]);return _0x15d8ba(_0x1883fa[_0x0b70('0x11')]['message']);}logger['error'](_0x0b70('0xd'),_0x28fcf1,_0x1883fa[_0x0b70('0x11')]['message']);return _0x4105d9(_0x1883fa[_0x0b70('0x11')][_0x0b70('0x12')]);}else{logger[_0x0b70('0x13')]('Cdr,\x20%s,\x20%s',_0x28fcf1,'request\x20sent');_0x4105d9(_0x1883fa[_0x0b70('0x14')][_0x0b70('0x12')]);}})['catch'](function(_0x5ccc0e){logger['error'](_0x0b70('0xd'),_0x28fcf1,_0x5ccc0e);_0x15d8ba(_0x5ccc0e);});});}
\ No newline at end of file
+var _0x90ea=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','debug','request\x20sent','code','error','message','info','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x90ea,0xa3));var _0xa90e=function(_0x17fba1,_0x4533c1){_0x17fba1=_0x17fba1-0x0;var _0x5d95b1=_0x90ea[_0x17fba1];return _0x5d95b1;};'use strict';var _=require('lodash');var util=require(_0xa90e('0x0'));var moment=require('moment');var BPromise=require(_0xa90e('0x1'));var rs=require(_0xa90e('0x2'));var fs=require('fs');var Redis=require(_0xa90e('0x3'));var db=require(_0xa90e('0x4'))['db'];var utils=require(_0xa90e('0x5'));var logger=require(_0xa90e('0x6'))(_0xa90e('0x7'));var config=require(_0xa90e('0x8'));var jayson=require(_0xa90e('0x9'));var client=jayson[_0xa90e('0xa')][_0xa90e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b2176,_0x2feb65,_0x4dece6){return new BPromise(function(_0xc2d625,_0x278c34){return client[_0xa90e('0xc')](_0x1b2176,_0x4dece6)[_0xa90e('0xd')](function(_0x30388a){logger['info'](_0xa90e('0xe'),_0x2feb65,'request\x20sent');logger[_0xa90e('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2feb65,_0xa90e('0x10'),JSON['stringify'](_0x30388a));if(_0x30388a['error']){if(_0x30388a['error'][_0xa90e('0x11')]===0x1f4){logger[_0xa90e('0x12')](_0xa90e('0xe'),_0x2feb65,_0x30388a[_0xa90e('0x12')][_0xa90e('0x13')]);return _0x278c34(_0x30388a['error'][_0xa90e('0x13')]);}logger[_0xa90e('0x12')](_0xa90e('0xe'),_0x2feb65,_0x30388a['error']['message']);return _0xc2d625(_0x30388a['error'][_0xa90e('0x13')]);}else{logger[_0xa90e('0x14')]('Cdr,\x20%s,\x20%s',_0x2feb65,_0xa90e('0x10'));_0xc2d625(_0x30388a['result'][_0xa90e('0x13')]);}})['catch'](function(_0x44f8ec){logger[_0xa90e('0x12')](_0xa90e('0xe'),_0x2feb65,_0x44f8ec);_0x278c34(_0x44f8ec);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 962dfdb..4cd0360 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(_0x5e4e54,_0x22683c){var _0x20b557=function(_0x59d565){while(--_0x59d565){_0x5e4e54['push'](_0x5e4e54['shift']());}};_0x20b557(++_0x22683c);}(_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 _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(_0x54bc96,_0x20cb68){var _0x4685b9=function(_0x41f797){while(--_0x41f797){_0x54bc96['push'](_0x54bc96['shift']());}};_0x4685b9(++_0x20cb68);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index d53db4c..13ccae6 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 _0x039c=['STRING','noop','*,*,*,*','INTEGER'];(function(_0x37b3b9,_0x16e2c8){var _0x5bbcc8=function(_0x3b6c90){while(--_0x3b6c90){_0x37b3b9['push'](_0x37b3b9['shift']());}};_0x5bbcc8(++_0x16e2c8);}(_0x039c,0x67));var _0xc039=function(_0x2cee93,_0x4e9f10){_0x2cee93=_0x2cee93-0x0;var _0x36023e=_0x039c[_0x2cee93];return _0x36023e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xc039('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xc039('0x1')],'allowNull':![],'defaultValue':_0xc039('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc039('0x1')]},'interval':{'type':Sequelize[_0xc039('0x1')],'defaultValue':_0xc039('0x3')}};
\ No newline at end of file
+var _0x64a6=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x557c42,_0x13d1b1){var _0x2c56f9=function(_0x1055c1){while(--_0x1055c1){_0x557c42['push'](_0x557c42['shift']());}};_0x2c56f9(++_0x13d1b1);}(_0x64a6,0x183));var _0x664a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x64a6[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x664a('0x0'));module[_0x664a('0x1')]={'priority':{'type':Sequelize[_0x664a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x664a('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x664a('0x4')],'defaultValue':_0x664a('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 19ad873..fbc88ba 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 _0x9e0d=['sox','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/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x15ab85,_0x5a07e6){var _0x228f01=function(_0x10f9af){while(--_0x10f9af){_0x15ab85['push'](_0x15ab85['shift']());}};_0x228f01(++_0x5a07e6);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x3a017e,_0x8b2e9d){_0x3a017e=_0x3a017e-0x0;var _0xf1802d=_0x9e0d[_0x3a017e];return _0xf1802d;};'use strict';var emlformat=require(_0xd9e0('0x0'));var rimraf=require(_0xd9e0('0x1'));var zipdir=require(_0xd9e0('0x2'));var jsonpatch=require(_0xd9e0('0x3'));var rp=require('request-promise');var moment=require(_0xd9e0('0x4'));var BPromise=require(_0xd9e0('0x5'));var Mustache=require(_0xd9e0('0x6'));var util=require(_0xd9e0('0x7'));var path=require(_0xd9e0('0x8'));var sox=require(_0xd9e0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e0('0xa'));var _=require(_0xd9e0('0xb'));var squel=require(_0xd9e0('0xc'));var crypto=require(_0xd9e0('0xd'));var jsforce=require(_0xd9e0('0xe'));var deskjs=require(_0xd9e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9e0('0x10'));var Papa=require(_0xd9e0('0x11'));var Redis=require(_0xd9e0('0x12'));var authService=require(_0xd9e0('0x13'));var qs=require(_0xd9e0('0x14'));var as=require(_0xd9e0('0x15'));var hardwareService=require(_0xd9e0('0x16'));var logger=require('../../config/logger')(_0xd9e0('0x17'));var utils=require(_0xd9e0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd9e0('0x19'));var db=require(_0xd9e0('0x1a'))['db'];function respondWithStatusCode(_0x418d84,_0x1fb454){_0x1fb454=_0x1fb454||0xcc;return function(_0x18fdf2){if(_0x18fdf2){return _0x418d84['sendStatus'](_0x1fb454);}return _0x418d84[_0xd9e0('0x1b')](_0x1fb454)['end']();};}function respondWithResult(_0x2f311c,_0x55c704){_0x55c704=_0x55c704||0xc8;return function(_0x24d361){if(_0x24d361){return _0x2f311c[_0xd9e0('0x1b')](_0x55c704)[_0xd9e0('0x1c')](_0x24d361);}};}function respondWithFilteredResult(_0x18301b,_0x3e4c5d){return function(_0x4da900){if(_0x4da900){var _0x58d44c=typeof _0x3e4c5d['offset']===_0xd9e0('0x1d')&&typeof _0x3e4c5d[_0xd9e0('0x1e')]===_0xd9e0('0x1d');var _0x1cdcb6=_0x4da900['count'];var _0x209c04=_0x58d44c?0x0:_0x3e4c5d['offset'];var _0x483b74=_0x58d44c?_0x4da900[_0xd9e0('0x1f')]:_0x3e4c5d[_0xd9e0('0x20')]+_0x3e4c5d['limit'];var _0x5ac8f5;if(_0x483b74>=_0x1cdcb6){_0x483b74=_0x1cdcb6;_0x5ac8f5=0xc8;}else{_0x5ac8f5=0xce;}_0x18301b[_0xd9e0('0x1b')](_0x5ac8f5);return _0x18301b[_0xd9e0('0x21')]('Content-Range',_0x209c04+'-'+_0x483b74+'/'+_0x1cdcb6)[_0xd9e0('0x1c')](_0x4da900);}return null;};}function patchUpdates(_0x4cc3c9){return function(_0xd3d455){try{jsonpatch[_0xd9e0('0x22')](_0xd3d455,_0x4cc3c9,!![]);}catch(_0x67f69f){return BPromise[_0xd9e0('0x23')](_0x67f69f);}return _0xd3d455[_0xd9e0('0x24')]();};}function saveUpdates(_0x5711a1,_0x19534a){return function(_0x333233){if(_0x333233){return _0x333233['update'](_0x5711a1)[_0xd9e0('0x25')](function(_0x124ca7){return _0x124ca7;});}return null;};}function removeEntity(_0x5d4549,_0x357bd9){return function(_0x5e17d4){if(_0x5e17d4){return _0x5e17d4[_0xd9e0('0x26')]()[_0xd9e0('0x25')](function(){_0x5d4549['status'](0xcc)[_0xd9e0('0x27')]();});}};}function handleEntityNotFound(_0x53cf67,_0x554aeb){return function(_0x50f57d){if(!_0x50f57d){_0x53cf67[_0xd9e0('0x28')](0x194);}return _0x50f57d;};}function handleError(_0x21c796,_0x7065c6){_0x7065c6=_0x7065c6||0x1f4;return function(_0x1c36df){logger[_0xd9e0('0x29')](_0x1c36df[_0xd9e0('0x2a')]);if(_0x1c36df[_0xd9e0('0x2b')]){delete _0x1c36df['name'];}_0x21c796[_0xd9e0('0x1b')](_0x7065c6)[_0xd9e0('0x2c')](_0x1c36df);};}exports[_0xd9e0('0x2d')]=function(_0x17a899,_0x2738e9){var _0x4f5367={'raw':!![],'where':{'id':_0x17a899['params']['id']}},_0x4b4f7d={};_0x4b4f7d[_0xd9e0('0x2e')]=_[_0xd9e0('0x2f')](db['ChatApplication'][_0xd9e0('0x30')]);_0x4b4f7d[_0xd9e0('0x31')]=_[_0xd9e0('0x2f')](_0x17a899[_0xd9e0('0x31')]);_0x4b4f7d[_0xd9e0('0x32')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],_0x4b4f7d['query']);_0x4f5367[_0xd9e0('0x34')]=_[_0xd9e0('0x33')](_0x4b4f7d[_0xd9e0('0x2e')],qs[_0xd9e0('0x35')](_0x17a899[_0xd9e0('0x31')][_0xd9e0('0x35')]));_0x4f5367[_0xd9e0('0x34')]=_0x4f5367[_0xd9e0('0x34')][_0xd9e0('0x36')]?_0x4f5367[_0xd9e0('0x34')]:_0x4b4f7d[_0xd9e0('0x2e')];if(_0x17a899[_0xd9e0('0x31')]['includeAll']){_0x4f5367[_0xd9e0('0x37')]=[{'all':!![]}];}_0x4f5367=_[_0xd9e0('0x38')]({},_0x4f5367,_0x17a899[_0xd9e0('0x39')]);return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')](_0x4f5367)['then'](handleEntityNotFound(_0x2738e9,null))[_0xd9e0('0x25')](respondWithResult(_0x2738e9,null))[_0xd9e0('0x3c')](handleError(_0x2738e9,null));};exports[_0xd9e0('0x3d')]=function(_0x23901a,_0x588f8c){if(_0x23901a[_0xd9e0('0x3e')]['id']){delete _0x23901a['body']['id'];}return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x23901a[_0xd9e0('0x3f')]['id']}})[_0xd9e0('0x25')](handleEntityNotFound(_0x588f8c,null))[_0xd9e0('0x25')](saveUpdates(_0x23901a[_0xd9e0('0x3e')],null))[_0xd9e0('0x25')](respondWithResult(_0x588f8c,null))[_0xd9e0('0x3c')](handleError(_0x588f8c,null));};exports[_0xd9e0('0x26')]=function(_0x5065f7,_0x318679){return db[_0xd9e0('0x3a')][_0xd9e0('0x3b')]({'where':{'id':_0x5065f7[_0xd9e0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x318679,null))[_0xd9e0('0x25')](removeEntity(_0x318679,null))[_0xd9e0('0x3c')](handleError(_0x318679,null));};
\ No newline at end of file
+var _0x4627=['Content-Range','json','apply','reject','save','then','end','sendStatus','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4627,0x115));var _0x7462=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x4627[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x7462('0x0'));var rimraf=require(_0x7462('0x1'));var zipdir=require(_0x7462('0x2'));var jsonpatch=require(_0x7462('0x3'));var rp=require(_0x7462('0x4'));var moment=require(_0x7462('0x5'));var BPromise=require(_0x7462('0x6'));var Mustache=require(_0x7462('0x7'));var util=require(_0x7462('0x8'));var path=require(_0x7462('0x9'));var sox=require(_0x7462('0xa'));var csv=require(_0x7462('0xb'));var ejs=require(_0x7462('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7462('0xd'));var squel=require(_0x7462('0xe'));var crypto=require(_0x7462('0xf'));var jsforce=require(_0x7462('0x10'));var deskjs=require(_0x7462('0x11'));var toCsv=require(_0x7462('0xb'));var querystring=require(_0x7462('0x12'));var Papa=require(_0x7462('0x13'));var Redis=require(_0x7462('0x14'));var authService=require(_0x7462('0x15'));var qs=require(_0x7462('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7462('0x17'))(_0x7462('0x18'));var utils=require(_0x7462('0x19'));var config=require(_0x7462('0x1a'));var licenseUtil=require(_0x7462('0x1b'));var db=require(_0x7462('0x1c'))['db'];function respondWithStatusCode(_0x31bf84,_0x4e313a){_0x4e313a=_0x4e313a||0xcc;return function(_0x5cb363){if(_0x5cb363){return _0x31bf84['sendStatus'](_0x4e313a);}return _0x31bf84[_0x7462('0x1d')](_0x4e313a)['end']();};}function respondWithResult(_0x1ba7e5,_0x461bd2){_0x461bd2=_0x461bd2||0xc8;return function(_0x368f45){if(_0x368f45){return _0x1ba7e5[_0x7462('0x1d')](_0x461bd2)['json'](_0x368f45);}};}function respondWithFilteredResult(_0x27b8f5,_0x4913ff){return function(_0x36b008){if(_0x36b008){var _0x42ed50=typeof _0x4913ff[_0x7462('0x1e')]===_0x7462('0x1f')&&typeof _0x4913ff['limit']===_0x7462('0x1f');var _0x56ed70=_0x36b008[_0x7462('0x20')];var _0x216eba=_0x42ed50?0x0:_0x4913ff[_0x7462('0x1e')];var _0x26e25f=_0x42ed50?_0x36b008['count']:_0x4913ff[_0x7462('0x1e')]+_0x4913ff['limit'];var _0x85341c;if(_0x26e25f>=_0x56ed70){_0x26e25f=_0x56ed70;_0x85341c=0xc8;}else{_0x85341c=0xce;}_0x27b8f5[_0x7462('0x1d')](_0x85341c);return _0x27b8f5['set'](_0x7462('0x21'),_0x216eba+'-'+_0x26e25f+'/'+_0x56ed70)[_0x7462('0x22')](_0x36b008);}return null;};}function patchUpdates(_0x4d0e60){return function(_0x25a44a){try{jsonpatch[_0x7462('0x23')](_0x25a44a,_0x4d0e60,!![]);}catch(_0x2e9a25){return BPromise[_0x7462('0x24')](_0x2e9a25);}return _0x25a44a[_0x7462('0x25')]();};}function saveUpdates(_0x4404eb,_0x32da06){return function(_0x3c9616){if(_0x3c9616){return _0x3c9616['update'](_0x4404eb)[_0x7462('0x26')](function(_0x52460e){return _0x52460e;});}return null;};}function removeEntity(_0x185934,_0x11caf5){return function(_0x290715){if(_0x290715){return _0x290715['destroy']()[_0x7462('0x26')](function(){_0x185934['status'](0xcc)[_0x7462('0x27')]();});}};}function handleEntityNotFound(_0x5473d1,_0x5759fa){return function(_0x29992b){if(!_0x29992b){_0x5473d1[_0x7462('0x28')](0x194);}return _0x29992b;};}function handleError(_0x51d9d9,_0x5575fc){_0x5575fc=_0x5575fc||0x1f4;return function(_0x554d21){logger['error'](_0x554d21['stack']);if(_0x554d21[_0x7462('0x29')]){delete _0x554d21[_0x7462('0x29')];}_0x51d9d9['status'](_0x5575fc)[_0x7462('0x2a')](_0x554d21);};}exports[_0x7462('0x2b')]=function(_0x3a3313,_0x10a673){var _0x4948c9={'raw':!![],'where':{'id':_0x3a3313[_0x7462('0x2c')]['id']}},_0x1f279b={};_0x1f279b[_0x7462('0x2d')]=_[_0x7462('0x2e')](db[_0x7462('0x2f')][_0x7462('0x30')]);_0x1f279b[_0x7462('0x31')]=_[_0x7462('0x2e')](_0x3a3313[_0x7462('0x31')]);_0x1f279b[_0x7462('0x32')]=_['intersection'](_0x1f279b[_0x7462('0x2d')],_0x1f279b['query']);_0x4948c9[_0x7462('0x33')]=_[_0x7462('0x34')](_0x1f279b[_0x7462('0x2d')],qs[_0x7462('0x35')](_0x3a3313['query'][_0x7462('0x35')]));_0x4948c9[_0x7462('0x33')]=_0x4948c9[_0x7462('0x33')][_0x7462('0x36')]?_0x4948c9[_0x7462('0x33')]:_0x1f279b[_0x7462('0x2d')];if(_0x3a3313['query'][_0x7462('0x37')]){_0x4948c9['include']=[{'all':!![]}];}_0x4948c9=_[_0x7462('0x38')]({},_0x4948c9,_0x3a3313['options']);return db[_0x7462('0x2f')][_0x7462('0x39')](_0x4948c9)['then'](handleEntityNotFound(_0x10a673,null))[_0x7462('0x26')](respondWithResult(_0x10a673,null))[_0x7462('0x3a')](handleError(_0x10a673,null));};exports[_0x7462('0x3b')]=function(_0x1f713b,_0x469a7e){if(_0x1f713b[_0x7462('0x3c')]['id']){delete _0x1f713b[_0x7462('0x3c')]['id'];}return db[_0x7462('0x2f')][_0x7462('0x39')]({'where':{'id':_0x1f713b[_0x7462('0x2c')]['id']}})[_0x7462('0x26')](handleEntityNotFound(_0x469a7e,null))[_0x7462('0x26')](saveUpdates(_0x1f713b[_0x7462('0x3c')],null))[_0x7462('0x26')](respondWithResult(_0x469a7e,null))['catch'](handleError(_0x469a7e,null));};exports[_0x7462('0x3d')]=function(_0x92edff,_0xb65b90){return db[_0x7462('0x2f')]['find']({'where':{'id':_0x92edff[_0x7462('0x2c')]['id']}})[_0x7462('0x26')](handleEntityNotFound(_0xb65b90,null))[_0x7462('0x26')](removeEntity(_0xb65b90,null))[_0x7462('0x3a')](handleError(_0xb65b90,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 28ad467..1eee96a 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 _0xa251=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2e6181,_0x2f2146){var _0x25f0ef=function(_0x43078e){while(--_0x43078e){_0x2e6181['push'](_0x2e6181['shift']());}};_0x25f0ef(++_0x2f2146);}(_0xa251,0x1de));var _0x1a25=function(_0x404634,_0x56ed3f){_0x404634=_0x404634-0x0;var _0x524e06=_0xa251[_0x404634];return _0x524e06;};'use strict';var _=require(_0x1a25('0x0'));var util=require(_0x1a25('0x1'));var logger=require(_0x1a25('0x2'))(_0x1a25('0x3'));var moment=require('moment');var BPromise=require(_0x1a25('0x4'));var rp=require(_0x1a25('0x5'));var fs=require('fs');var path=require(_0x1a25('0x6'));var rimraf=require(_0x1a25('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a25('0x8'));module[_0x1a25('0x9')]=function(_0x106d02,_0x1c2a7a){return _0x106d02['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a25('0xa'),'collate':_0x1a25('0xb')});};
\ No newline at end of file
+var _0x848d=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x36a66a,_0x3ea9fc){var _0x5aaefd=function(_0x200838){while(--_0x200838){_0x36a66a['push'](_0x36a66a['shift']());}};_0x5aaefd(++_0x3ea9fc);}(_0x848d,0x1d5));var _0xd848=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x848d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd848('0x0'));var util=require(_0xd848('0x1'));var logger=require(_0xd848('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd848('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd848('0x4'));var rimraf=require(_0xd848('0x5'));var config=require(_0xd848('0x6'));var attributes=require(_0xd848('0x7'));module[_0xd848('0x8')]=function(_0x11c998,_0x3c4d1b){return _0x11c998[_0xd848('0x9')](_0xd848('0xa'),attributes,{'tableName':_0xd848('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd848('0xc'),'collate':_0xd848('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0ab06e9..3d7c125 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 _0x5a5b=['ChatApplication,\x20%s,\x20%s,\x20%s','code','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug'];(function(_0x5363a3,_0x3c6310){var _0x4cd0c6=function(_0x3d7747){while(--_0x3d7747){_0x5363a3['push'](_0x5363a3['shift']());}};_0x4cd0c6(++_0x3c6310);}(_0x5a5b,0x118));var _0xb5a5=function(_0x23f8ed,_0x3fcc5e){_0x23f8ed=_0x23f8ed-0x0;var _0x2872a6=_0x5a5b[_0x23f8ed];return _0x2872a6;};'use strict';var _=require(_0xb5a5('0x0'));var util=require(_0xb5a5('0x1'));var moment=require('moment');var BPromise=require(_0xb5a5('0x2'));var rs=require(_0xb5a5('0x3'));var fs=require('fs');var Redis=require(_0xb5a5('0x4'));var db=require(_0xb5a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5a5('0x6'));var config=require(_0xb5a5('0x7'));var jayson=require(_0xb5a5('0x8'));var client=jayson[_0xb5a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33ea98,_0x336235,_0x1d05d5){return new BPromise(function(_0x2e00ee,_0x11100e){return client['request'](_0x33ea98,_0x1d05d5)[_0xb5a5('0xa')](function(_0x23f05d){logger[_0xb5a5('0xb')]('ChatApplication,\x20%s,\x20%s',_0x336235,_0xb5a5('0xc'));logger[_0xb5a5('0xd')](_0xb5a5('0xe'),_0x336235,'request\x20sent',JSON['stringify'](_0x23f05d));if(_0x23f05d['error']){if(_0x23f05d['error'][_0xb5a5('0xf')]===0x1f4){logger[_0xb5a5('0x10')](_0xb5a5('0x11'),_0x336235,_0x23f05d[_0xb5a5('0x10')][_0xb5a5('0x12')]);return _0x11100e(_0x23f05d[_0xb5a5('0x10')][_0xb5a5('0x12')]);}logger['error'](_0xb5a5('0x11'),_0x336235,_0x23f05d['error']['message']);return _0x2e00ee(_0x23f05d[_0xb5a5('0x10')][_0xb5a5('0x12')]);}else{logger[_0xb5a5('0xb')]('ChatApplication,\x20%s,\x20%s',_0x336235,_0xb5a5('0xc'));_0x2e00ee(_0x23f05d[_0xb5a5('0x13')][_0xb5a5('0x12')]);}})[_0xb5a5('0x14')](function(_0x369a2c){logger['error'](_0xb5a5('0x11'),_0x336235,_0x369a2c);_0x11100e(_0x369a2c);});});}
\ No newline at end of file
+var _0xc337=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x57541b,_0x4d54a4){var _0x39d2ef=function(_0x3b7910){while(--_0x3b7910){_0x57541b['push'](_0x57541b['shift']());}};_0x39d2ef(++_0x4d54a4);}(_0xc337,0x167));var _0x7c33=function(_0xb4aa18,_0x37b8ef){_0xb4aa18=_0xb4aa18-0x0;var _0x2b704a=_0xc337[_0xb4aa18];return _0x2b704a;};'use strict';var _=require(_0x7c33('0x0'));var util=require(_0x7c33('0x1'));var moment=require(_0x7c33('0x2'));var BPromise=require(_0x7c33('0x3'));var rs=require(_0x7c33('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c33('0x5'))['db'];var utils=require(_0x7c33('0x6'));var logger=require(_0x7c33('0x7'))('rpc');var config=require(_0x7c33('0x8'));var jayson=require(_0x7c33('0x9'));var client=jayson['client'][_0x7c33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1222de,_0x2634ec,_0x3d5151){return new BPromise(function(_0x320c28,_0x3da34c){return client[_0x7c33('0xb')](_0x1222de,_0x3d5151)['then'](function(_0x4af7e1){logger['info'](_0x7c33('0xc'),_0x2634ec,_0x7c33('0xd'));logger[_0x7c33('0xe')](_0x7c33('0xf'),_0x2634ec,_0x7c33('0xd'),JSON['stringify'](_0x4af7e1));if(_0x4af7e1['error']){if(_0x4af7e1['error']['code']===0x1f4){logger[_0x7c33('0x10')](_0x7c33('0xc'),_0x2634ec,_0x4af7e1[_0x7c33('0x10')][_0x7c33('0x11')]);return _0x3da34c(_0x4af7e1[_0x7c33('0x10')][_0x7c33('0x11')]);}logger[_0x7c33('0x10')](_0x7c33('0xc'),_0x2634ec,_0x4af7e1[_0x7c33('0x10')]['message']);return _0x320c28(_0x4af7e1[_0x7c33('0x10')][_0x7c33('0x11')]);}else{logger[_0x7c33('0x12')](_0x7c33('0xc'),_0x2634ec,_0x7c33('0xd'));_0x320c28(_0x4af7e1[_0x7c33('0x13')][_0x7c33('0x11')]);}})[_0x7c33('0x14')](function(_0x42b2bf){logger[_0x7c33('0x10')](_0x7c33('0xc'),_0x2634ec,_0x42b2bf);_0x3da34c(_0x42b2bf);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index d4e7652..f952abd 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 _0x0b71=['get','isAuthenticated','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x3d4777,_0xd17068){var _0x3e8a60=function(_0x552a1a){while(--_0x552a1a){_0x3d4777['push'](_0x3d4777['shift']());}};_0x3e8a60(++_0xd17068);}(_0x0b71,0x199));var _0x10b7=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x0b71[_0x251d9c];return _0x16ae64;};'use strict';var multer=require(_0x10b7('0x0'));var util=require(_0x10b7('0x1'));var path=require(_0x10b7('0x2'));var timeout=require(_0x10b7('0x3'));var express=require(_0x10b7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x10b7('0x5'));var config=require(_0x10b7('0x6'));var controller=require('./chatApplication.controller');router[_0x10b7('0x7')]('/:id',auth[_0x10b7('0x8')](),controller['show']);router[_0x10b7('0x9')](_0x10b7('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x10b7('0xb')]('/:id',auth[_0x10b7('0x8')](),controller[_0x10b7('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x268c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3e5197,_0x409cb1){var _0x410b01=function(_0x43b2dd){while(--_0x43b2dd){_0x3e5197['push'](_0x3e5197['shift']());}};_0x410b01(++_0x409cb1);}(_0x268c,0x13d));var _0xc268=function(_0x315aea,_0x318a80){_0x315aea=_0x315aea-0x0;var _0x4a4bdb=_0x268c[_0x315aea];return _0x4a4bdb;};'use strict';var multer=require(_0xc268('0x0'));var util=require(_0xc268('0x1'));var path=require(_0xc268('0x2'));var timeout=require(_0xc268('0x3'));var express=require('express');var router=express[_0xc268('0x4')]();var fs_extra=require(_0xc268('0x5'));var auth=require(_0xc268('0x6'));var interaction=require(_0xc268('0x7'));var config=require(_0xc268('0x8'));var controller=require(_0xc268('0x9'));router[_0xc268('0xa')](_0xc268('0xb'),auth['isAuthenticated'](),controller[_0xc268('0xc')]);router[_0xc268('0xd')]('/:id',auth[_0xc268('0xe')](),controller[_0xc268('0xf')]);router['delete'](_0xc268('0xb'),auth[_0xc268('0xe')](),controller['destroy']);module[_0xc268('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 36ace70..d9a47d8 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 _0x238d=['sequelize','exports','STRING'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x238d,0x123));var _0xd238=function(_0x11c780,_0x25b547){_0x11c780=_0x11c780-0x0;var _0x44c830=_0x238d[_0x11c780];return _0x44c830;};'use strict';var Sequelize=require(_0xd238('0x0'));module[_0xd238('0x1')]={'name':{'type':Sequelize[_0xd238('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd238('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2b0a=['sequelize','exports','STRING'];(function(_0x10673f,_0x5f1781){var _0x36ce1c=function(_0x1d88d6){while(--_0x1d88d6){_0x10673f['push'](_0x10673f['shift']());}};_0x36ce1c(++_0x5f1781);}(_0x2b0a,0x84));var _0xa2b0=function(_0x4f7cba,_0x570c91){_0x4f7cba=_0x4f7cba-0x0;var _0x3fb190=_0x2b0a[_0x4f7cba];return _0x3fb190;};'use strict';var Sequelize=require(_0xa2b0('0x0'));module[_0xa2b0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa2b0('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index dd96d64..1c5f723 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 _0xa8f6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','stack','name','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','toInteger','addMembers','omit','getMembers','findOne','User','removeMembers','ids','ChatGroupId','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x269cbf,_0x36f17b){var _0x51b582=function(_0x49dad2){while(--_0x49dad2){_0x269cbf['push'](_0x269cbf['shift']());}};_0x51b582(++_0x36f17b);}(_0xa8f6,0x1bd));var _0x6a8f=function(_0x1e5cef,_0x418f4c){_0x1e5cef=_0x1e5cef-0x0;var _0x346535=_0xa8f6[_0x1e5cef];return _0x346535;};'use strict';var emlformat=require(_0x6a8f('0x0'));var rimraf=require(_0x6a8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a8f('0x2'));var rp=require('request-promise');var moment=require(_0x6a8f('0x3'));var BPromise=require(_0x6a8f('0x4'));var Mustache=require('mustache');var util=require(_0x6a8f('0x5'));var path=require(_0x6a8f('0x6'));var sox=require(_0x6a8f('0x7'));var csv=require(_0x6a8f('0x8'));var ejs=require(_0x6a8f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a8f('0xa'));var squel=require(_0x6a8f('0xb'));var crypto=require(_0x6a8f('0xc'));var jsforce=require(_0x6a8f('0xd'));var deskjs=require(_0x6a8f('0xe'));var toCsv=require(_0x6a8f('0x8'));var querystring=require(_0x6a8f('0xf'));var Papa=require(_0x6a8f('0x10'));var Redis=require(_0x6a8f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a8f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6a8f('0x13'));var utils=require(_0x6a8f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6a8f('0x15'));var db=require(_0x6a8f('0x16'))['db'];config[_0x6a8f('0x17')]=_[_0x6a8f('0x18')](config[_0x6a8f('0x17')],{'host':_0x6a8f('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6a8f('0x1a'))[_0x6a8f('0x1b')](socket);function respondWithStatusCode(_0x45eda5,_0x4631d6){_0x4631d6=_0x4631d6||0xcc;return function(_0x4ddecf){if(_0x4ddecf){return _0x45eda5[_0x6a8f('0x1c')](_0x4631d6);}return _0x45eda5[_0x6a8f('0x1d')](_0x4631d6)[_0x6a8f('0x1e')]();};}function respondWithResult(_0x242135,_0x9be1e6){_0x9be1e6=_0x9be1e6||0xc8;return function(_0x4632f1){if(_0x4632f1){return _0x242135[_0x6a8f('0x1d')](_0x9be1e6)['json'](_0x4632f1);}};}function respondWithFilteredResult(_0x251481,_0x2511ad){return function(_0x1b98b9){if(_0x1b98b9){var _0xf453b3=typeof _0x2511ad[_0x6a8f('0x1f')]==='undefined'&&typeof _0x2511ad['limit']===_0x6a8f('0x20');var _0x187e34=_0x1b98b9[_0x6a8f('0x21')];var _0x26201a=_0xf453b3?0x0:_0x2511ad[_0x6a8f('0x1f')];var _0x442784=_0xf453b3?_0x1b98b9[_0x6a8f('0x21')]:_0x2511ad[_0x6a8f('0x1f')]+_0x2511ad[_0x6a8f('0x22')];var _0x550fbe;if(_0x442784>=_0x187e34){_0x442784=_0x187e34;_0x550fbe=0xc8;}else{_0x550fbe=0xce;}_0x251481['status'](_0x550fbe);return _0x251481[_0x6a8f('0x23')]('Content-Range',_0x26201a+'-'+_0x442784+'/'+_0x187e34)[_0x6a8f('0x24')](_0x1b98b9);}return null;};}function patchUpdates(_0x26f7f4){return function(_0x50d239){try{jsonpatch[_0x6a8f('0x25')](_0x50d239,_0x26f7f4,!![]);}catch(_0xec2909){return BPromise[_0x6a8f('0x26')](_0xec2909);}return _0x50d239['save']();};}function saveUpdates(_0x464059,_0x4965d5){return function(_0x464f42){if(_0x464f42){return _0x464f42[_0x6a8f('0x27')](_0x464059)[_0x6a8f('0x28')](function(_0x2baf17){return _0x2baf17;});}return null;};}function removeEntity(_0x3127b0,_0x511849){return function(_0xde1c40){if(_0xde1c40){return _0xde1c40[_0x6a8f('0x29')]()[_0x6a8f('0x28')](function(){_0x3127b0[_0x6a8f('0x1d')](0xcc)[_0x6a8f('0x1e')]();});}};}function handleEntityNotFound(_0x53e36d,_0x339172){return function(_0x3f08a1){if(!_0x3f08a1){_0x53e36d[_0x6a8f('0x1c')](0x194);}return _0x3f08a1;};}function handleError(_0x9b1713,_0x2ecd0c){_0x2ecd0c=_0x2ecd0c||0x1f4;return function(_0x50c32c){logger['error'](_0x50c32c[_0x6a8f('0x2a')]);if(_0x50c32c[_0x6a8f('0x2b')]){delete _0x50c32c[_0x6a8f('0x2b')];}_0x9b1713['status'](_0x2ecd0c)['send'](_0x50c32c);};}exports[_0x6a8f('0x2c')]=function(_0x390b49,_0x4bddd9){var _0x3f3e89={},_0x373140={},_0x12aabe={'count':0x0,'rows':[]};var _0x4a341d=_[_0x6a8f('0x2d')](db['ChatGroup']['rawAttributes'],function(_0x1522be){return{'name':_0x1522be[_0x6a8f('0x2e')],'type':_0x1522be['type']['key']};});_0x373140[_0x6a8f('0x2f')]=_[_0x6a8f('0x2d')](_0x4a341d,_0x6a8f('0x2b'));_0x373140[_0x6a8f('0x30')]=_[_0x6a8f('0x31')](_0x390b49[_0x6a8f('0x30')]);_0x373140[_0x6a8f('0x32')]=_[_0x6a8f('0x33')](_0x373140['model'],_0x373140[_0x6a8f('0x30')]);_0x3f3e89[_0x6a8f('0x34')]=_[_0x6a8f('0x33')](_0x373140[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x35')]));_0x3f3e89[_0x6a8f('0x34')]=_0x3f3e89[_0x6a8f('0x34')]['length']?_0x3f3e89[_0x6a8f('0x34')]:_0x373140[_0x6a8f('0x2f')];if(!_0x390b49['query'][_0x6a8f('0x36')](_0x6a8f('0x37'))){_0x3f3e89[_0x6a8f('0x22')]=qs[_0x6a8f('0x22')](_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x22')]);_0x3f3e89[_0x6a8f('0x1f')]=qs['offset'](_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x1f')]);}_0x3f3e89[_0x6a8f('0x38')]=qs[_0x6a8f('0x39')](_0x390b49['query'][_0x6a8f('0x39')]);_0x3f3e89[_0x6a8f('0x3a')]=qs[_0x6a8f('0x32')](_[_0x6a8f('0x3b')](_0x390b49['query'],_0x373140[_0x6a8f('0x32')]),_0x4a341d);if(_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x3c')]){_0x3f3e89[_0x6a8f('0x3a')]=_[_0x6a8f('0x3d')](_0x3f3e89['where'],{'$or':_[_0x6a8f('0x2d')](_0x4a341d,function(_0x72d3f9){if(_0x72d3f9['type']!==_0x6a8f('0x3e')){var _0x44cbdd={};_0x44cbdd[_0x72d3f9[_0x6a8f('0x2b')]]={'$like':'%'+_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x3c')]+'%'};return _0x44cbdd;}})});}_0x3f3e89=_[_0x6a8f('0x3d')]({},_0x3f3e89,_0x390b49[_0x6a8f('0x3f')]);var _0x318daf={'where':_0x3f3e89[_0x6a8f('0x3a')]};return db[_0x6a8f('0x40')][_0x6a8f('0x21')](_0x318daf)[_0x6a8f('0x28')](function(_0x416544){_0x12aabe[_0x6a8f('0x21')]=_0x416544;if(_0x390b49[_0x6a8f('0x30')][_0x6a8f('0x41')]){_0x3f3e89['include']=[{'all':!![]}];}return db['ChatGroup'][_0x6a8f('0x42')](_0x3f3e89);})[_0x6a8f('0x28')](function(_0x52a420){_0x12aabe[_0x6a8f('0x43')]=_0x52a420;return _0x12aabe;})[_0x6a8f('0x28')](respondWithFilteredResult(_0x4bddd9,_0x3f3e89))[_0x6a8f('0x44')](handleError(_0x4bddd9,null));};exports[_0x6a8f('0x45')]=function(_0x38abc6,_0x357b58){var _0x44370c={'raw':!![],'where':{'id':_0x38abc6[_0x6a8f('0x46')]['id']}},_0x4350ad={};_0x4350ad[_0x6a8f('0x2f')]=_[_0x6a8f('0x31')](db[_0x6a8f('0x40')][_0x6a8f('0x47')]);_0x4350ad[_0x6a8f('0x30')]=_['keys'](_0x38abc6[_0x6a8f('0x30')]);_0x4350ad['filters']=_[_0x6a8f('0x33')](_0x4350ad[_0x6a8f('0x2f')],_0x4350ad[_0x6a8f('0x30')]);_0x44370c['attributes']=_[_0x6a8f('0x33')](_0x4350ad[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x38abc6['query']['fields']));_0x44370c[_0x6a8f('0x34')]=_0x44370c[_0x6a8f('0x34')][_0x6a8f('0x48')]?_0x44370c[_0x6a8f('0x34')]:_0x4350ad[_0x6a8f('0x2f')];if(_0x38abc6[_0x6a8f('0x30')][_0x6a8f('0x41')]){_0x44370c['include']=[{'all':!![]}];}_0x44370c=_[_0x6a8f('0x3d')]({},_0x44370c,_0x38abc6[_0x6a8f('0x3f')]);return db['ChatGroup']['find'](_0x44370c)[_0x6a8f('0x28')](handleEntityNotFound(_0x357b58,null))[_0x6a8f('0x28')](respondWithResult(_0x357b58,null))['catch'](handleError(_0x357b58,null));};exports['create']=function(_0x478c01,_0x1e9b27){return db[_0x6a8f('0x40')][_0x6a8f('0x49')](_0x478c01['body'],{})['then'](respondWithResult(_0x1e9b27,0xc9))[_0x6a8f('0x44')](handleError(_0x1e9b27,null));};exports[_0x6a8f('0x27')]=function(_0x2f6c67,_0x119fb7){if(_0x2f6c67[_0x6a8f('0x4a')]['id']){delete _0x2f6c67[_0x6a8f('0x4a')]['id'];}return db[_0x6a8f('0x40')][_0x6a8f('0x4b')]({'where':{'id':_0x2f6c67[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x119fb7,null))['then'](saveUpdates(_0x2f6c67[_0x6a8f('0x4a')],null))[_0x6a8f('0x28')](respondWithResult(_0x119fb7,null))[_0x6a8f('0x44')](handleError(_0x119fb7,null));};exports['destroy']=function(_0x3ff8d4,_0xf43437){return db[_0x6a8f('0x40')][_0x6a8f('0x4b')]({'where':{'id':_0x3ff8d4[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0xf43437,null))[_0x6a8f('0x28')](removeEntity(_0xf43437,null))[_0x6a8f('0x44')](handleError(_0xf43437,null));};exports['describe']=function(_0x20c6ca,_0x885e63){return db[_0x6a8f('0x40')]['describe']()[_0x6a8f('0x28')](respondWithResult(_0x885e63,null))[_0x6a8f('0x44')](handleError(_0x885e63,null));};exports['getUnread']=function(_0x72dfc4,_0xe63a57,_0x65a233){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x72dfc4[_0x6a8f('0x46')]['id'],'ToId':_0x72dfc4['user']['id'],'read':![]}})[_0x6a8f('0x28')](function(_0x560efb){return{'id':_[_0x6a8f('0x4c')](_0x72dfc4[_0x6a8f('0x46')]['id']),'count':_0x560efb};})[_0x6a8f('0x28')](respondWithResult(_0xe63a57,null))['catch'](handleError(_0xe63a57,null));};exports[_0x6a8f('0x4d')]=function(_0x47ad74,_0x2a2057,_0x1fd0fa){return db[_0x6a8f('0x40')]['find']({'where':{'id':_0x47ad74[_0x6a8f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a2057,null))[_0x6a8f('0x28')](function(_0x220a41){if(_0x220a41){return _0x220a41[_0x6a8f('0x4d')](_0x47ad74[_0x6a8f('0x4a')]['ids'],_[_0x6a8f('0x4e')](_0x47ad74[_0x6a8f('0x4a')],['ids','id'])||{});}})[_0x6a8f('0x28')](respondWithResult(_0x2a2057,null))[_0x6a8f('0x44')](handleError(_0x2a2057,null));};exports[_0x6a8f('0x4f')]=function(_0x46cb06,_0x3a9da1,_0x3624bf){var _0x31a10f={};var _0x27490f={};var _0x1652ee;var _0x113e9d;return db['ChatGroup'][_0x6a8f('0x50')]({'where':{'id':_0x46cb06[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x3a9da1,null))[_0x6a8f('0x28')](function(_0x32f373){if(_0x32f373){_0x1652ee=_0x32f373;_0x27490f['model']=_[_0x6a8f('0x31')](db[_0x6a8f('0x51')]['rawAttributes']);_0x27490f['query']=_[_0x6a8f('0x31')](_0x46cb06[_0x6a8f('0x30')]);_0x27490f['filters']=_['intersection'](_0x27490f[_0x6a8f('0x2f')],_0x27490f[_0x6a8f('0x30')]);_0x31a10f[_0x6a8f('0x34')]=_['intersection'](_0x27490f[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x35')]));_0x31a10f[_0x6a8f('0x34')]=_0x31a10f[_0x6a8f('0x34')][_0x6a8f('0x48')]?_0x31a10f[_0x6a8f('0x34')]:_0x27490f[_0x6a8f('0x2f')];_0x31a10f['order']=qs['sort'](_0x46cb06[_0x6a8f('0x30')]['sort']);_0x31a10f[_0x6a8f('0x3a')]=qs[_0x6a8f('0x32')](_[_0x6a8f('0x3b')](_0x46cb06[_0x6a8f('0x30')],_0x27490f['filters']));if(_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x3c')]){_0x31a10f[_0x6a8f('0x3a')]=_['merge'](_0x31a10f[_0x6a8f('0x3a')],{'$or':_[_0x6a8f('0x2d')](_0x31a10f['attributes'],function(_0x45adfd){var _0xfbc053={};_0xfbc053[_0x45adfd]={'$like':'%'+_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x3c')]+'%'};return _0xfbc053;})});}_0x31a10f=_[_0x6a8f('0x3d')]({},_0x31a10f,_0x46cb06[_0x6a8f('0x3f')]);return _0x1652ee[_0x6a8f('0x4f')](_0x31a10f);}})[_0x6a8f('0x28')](function(_0x161798){if(_0x161798){_0x113e9d=_0x161798[_0x6a8f('0x48')];if(!_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x36')](_0x6a8f('0x37'))){_0x31a10f[_0x6a8f('0x22')]=qs[_0x6a8f('0x22')](_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x22')]);_0x31a10f[_0x6a8f('0x1f')]=qs['offset'](_0x46cb06[_0x6a8f('0x30')][_0x6a8f('0x1f')]);}return _0x1652ee[_0x6a8f('0x4f')](_0x31a10f);}})[_0x6a8f('0x28')](function(_0x32b818){if(_0x32b818){return _0x32b818?{'count':_0x113e9d,'rows':_0x32b818}:null;}})['then'](respondWithResult(_0x3a9da1,null))[_0x6a8f('0x44')](handleError(_0x3a9da1,null));};exports[_0x6a8f('0x52')]=function(_0x319d0d,_0x19acca,_0x243596){return db[_0x6a8f('0x40')][_0x6a8f('0x4b')]({'where':{'id':_0x319d0d[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x19acca,null))[_0x6a8f('0x28')](function(_0x4f9da9){if(_0x4f9da9){return _0x4f9da9[_0x6a8f('0x52')](_0x319d0d[_0x6a8f('0x30')][_0x6a8f('0x53')]);}})[_0x6a8f('0x28')](respondWithStatusCode(_0x19acca,null))[_0x6a8f('0x44')](handleError(_0x19acca,null));};exports['addMessage']=function(_0x326385,_0x2b9bb1,_0x549220){if(_0x326385['body']['id']){delete _0x326385[_0x6a8f('0x4a')]['id'];}return db[_0x6a8f('0x40')]['find']({'where':{'id':_0x326385[_0x6a8f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b9bb1,null))['then'](function(_0x58cf85){if(_0x58cf85){_0x326385[_0x6a8f('0x4a')][_0x6a8f('0x54')]=_0x58cf85['id'];return db['ChatInternalMessage'][_0x6a8f('0x49')](_0x326385[_0x6a8f('0x4a')]);}})[_0x6a8f('0x28')](respondWithResult(_0x2b9bb1,null))[_0x6a8f('0x44')](handleError(_0x2b9bb1,null));};exports[_0x6a8f('0x55')]=function(_0x268362,_0x8b7b97,_0x42c81b){var _0xb2f394={};var _0x424f1c={};var _0x1d7b0f;var _0x3b3dee;return db[_0x6a8f('0x40')]['findOne']({'where':{'id':_0x268362[_0x6a8f('0x46')]['id']}})[_0x6a8f('0x28')](handleEntityNotFound(_0x8b7b97,null))[_0x6a8f('0x28')](function(_0x10b062){if(_0x10b062){_0x1d7b0f=_0x10b062;_0x424f1c[_0x6a8f('0x2f')]=_[_0x6a8f('0x31')](db[_0x6a8f('0x56')][_0x6a8f('0x47')]);_0x424f1c['query']=_['keys'](_0x268362[_0x6a8f('0x30')]);_0x424f1c[_0x6a8f('0x32')]=_[_0x6a8f('0x33')](_0x424f1c[_0x6a8f('0x2f')],_0x424f1c[_0x6a8f('0x30')]);_0xb2f394[_0x6a8f('0x34')]=_[_0x6a8f('0x33')](_0x424f1c[_0x6a8f('0x2f')],qs[_0x6a8f('0x35')](_0x268362[_0x6a8f('0x30')][_0x6a8f('0x35')]));_0xb2f394[_0x6a8f('0x34')]=_0xb2f394[_0x6a8f('0x34')][_0x6a8f('0x48')]?_0xb2f394[_0x6a8f('0x34')]:_0x424f1c[_0x6a8f('0x2f')];_0xb2f394[_0x6a8f('0x38')]=qs['sort'](_0x268362[_0x6a8f('0x30')][_0x6a8f('0x39')]);_0xb2f394[_0x6a8f('0x3a')]=qs[_0x6a8f('0x32')](_[_0x6a8f('0x3b')](_0x268362[_0x6a8f('0x30')],_0x424f1c['filters']));if(_0x268362[_0x6a8f('0x30')]['filter']){_0xb2f394[_0x6a8f('0x3a')]=_[_0x6a8f('0x3d')](_0xb2f394['where'],{'$or':_[_0x6a8f('0x2d')](_0xb2f394['attributes'],function(_0x3a21f5){var _0xe95743={};_0xe95743[_0x3a21f5]={'$like':'%'+_0x268362['query'][_0x6a8f('0x3c')]+'%'};return _0xe95743;})});}if(_0x268362['query'][_0x6a8f('0x57')]){var _0x323308=_0x268362[_0x6a8f('0x30')][_0x6a8f('0x57')][_0x6a8f('0x58')](',');var _0x5109c6={};_0x5109c6[_0x323308[0x0]]={'$gte':moment(_0x323308[0x1])[_0x6a8f('0x59')](_0x6a8f('0x5a'))};_0xb2f394[_0x6a8f('0x3a')]=_['merge'](_0xb2f394[_0x6a8f('0x3a')],_0x5109c6);}_0xb2f394=_['merge']({},_0xb2f394,_0x268362[_0x6a8f('0x3f')]);return _0x1d7b0f[_0x6a8f('0x55')](_0xb2f394);}})[_0x6a8f('0x28')](function(_0x5a39dd){if(_0x5a39dd){_0x3b3dee=_0x5a39dd[_0x6a8f('0x48')];if(!_0x268362[_0x6a8f('0x30')][_0x6a8f('0x36')](_0x6a8f('0x37'))){_0xb2f394[_0x6a8f('0x22')]=qs[_0x6a8f('0x22')](_0x268362[_0x6a8f('0x30')]['limit']);_0xb2f394[_0x6a8f('0x1f')]=qs[_0x6a8f('0x1f')](_0x268362['query'][_0x6a8f('0x1f')]);}return _0x1d7b0f[_0x6a8f('0x55')](_0xb2f394);}})[_0x6a8f('0x28')](function(_0x54bbe1){if(_0x54bbe1){return _0x54bbe1?{'count':_0x3b3dee,'rows':_0x54bbe1}:null;}})[_0x6a8f('0x28')](respondWithResult(_0x8b7b97,null))[_0x6a8f('0x44')](handleError(_0x8b7b97,null));};
\ No newline at end of file
+var _0x4aca=['moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','json','offset','undefined','count','limit','apply','reject','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','ChatGroup','findAll','rows','catch','params','intersection','create','body','find','describe','getUnread','user','toInteger','addMembers','ids','getMembers','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','split','format','getMessages','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0x4aca,0x164));var _0xa4ac=function(_0x4f9d00,_0x47eeca){_0x4f9d00=_0x4f9d00-0x0;var _0x32aca1=_0x4aca[_0x4f9d00];return _0x32aca1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4ac('0x0'));var zipdir=require(_0xa4ac('0x1'));var jsonpatch=require(_0xa4ac('0x2'));var rp=require(_0xa4ac('0x3'));var moment=require(_0xa4ac('0x4'));var BPromise=require(_0xa4ac('0x5'));var Mustache=require('mustache');var util=require(_0xa4ac('0x6'));var path=require('path');var sox=require(_0xa4ac('0x7'));var csv=require(_0xa4ac('0x8'));var ejs=require(_0xa4ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4ac('0xa'));var squel=require('squel');var crypto=require(_0xa4ac('0xb'));var jsforce=require(_0xa4ac('0xc'));var deskjs=require(_0xa4ac('0xd'));var toCsv=require(_0xa4ac('0x8'));var querystring=require('querystring');var Papa=require(_0xa4ac('0xe'));var Redis=require('ioredis');var authService=require(_0xa4ac('0xf'));var qs=require(_0xa4ac('0x10'));var as=require(_0xa4ac('0x11'));var hardwareService=require(_0xa4ac('0x12'));var logger=require(_0xa4ac('0x13'))(_0xa4ac('0x14'));var utils=require(_0xa4ac('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4ac('0x16'))['db'];config[_0xa4ac('0x17')]=_[_0xa4ac('0x18')](config[_0xa4ac('0x17')],{'host':_0xa4ac('0x19'),'port':0x18eb});var socket=require(_0xa4ac('0x1a'))(new Redis(config[_0xa4ac('0x17')]));require(_0xa4ac('0x1b'))['register'](socket);function respondWithStatusCode(_0x1a6d11,_0x578860){_0x578860=_0x578860||0xcc;return function(_0xc23219){if(_0xc23219){return _0x1a6d11['sendStatus'](_0x578860);}return _0x1a6d11[_0xa4ac('0x1c')](_0x578860)['end']();};}function respondWithResult(_0x25fb05,_0x27d0cd){_0x27d0cd=_0x27d0cd||0xc8;return function(_0x254121){if(_0x254121){return _0x25fb05[_0xa4ac('0x1c')](_0x27d0cd)[_0xa4ac('0x1d')](_0x254121);}};}function respondWithFilteredResult(_0x38d690,_0x505c33){return function(_0x540b4a){if(_0x540b4a){var _0x1c9aff=typeof _0x505c33[_0xa4ac('0x1e')]===_0xa4ac('0x1f')&&typeof _0x505c33['limit']===_0xa4ac('0x1f');var _0x4d47b9=_0x540b4a[_0xa4ac('0x20')];var _0x58aa1c=_0x1c9aff?0x0:_0x505c33[_0xa4ac('0x1e')];var _0xf1235c=_0x1c9aff?_0x540b4a[_0xa4ac('0x20')]:_0x505c33[_0xa4ac('0x1e')]+_0x505c33[_0xa4ac('0x21')];var _0x5e3e8a;if(_0xf1235c>=_0x4d47b9){_0xf1235c=_0x4d47b9;_0x5e3e8a=0xc8;}else{_0x5e3e8a=0xce;}_0x38d690[_0xa4ac('0x1c')](_0x5e3e8a);return _0x38d690['set']('Content-Range',_0x58aa1c+'-'+_0xf1235c+'/'+_0x4d47b9)[_0xa4ac('0x1d')](_0x540b4a);}return null;};}function patchUpdates(_0x4e11ac){return function(_0x1f6ff2){try{jsonpatch[_0xa4ac('0x22')](_0x1f6ff2,_0x4e11ac,!![]);}catch(_0x1e14a0){return BPromise[_0xa4ac('0x23')](_0x1e14a0);}return _0x1f6ff2['save']();};}function saveUpdates(_0x5363f7,_0x5d7ff8){return function(_0x40b09d){if(_0x40b09d){return _0x40b09d[_0xa4ac('0x24')](_0x5363f7)[_0xa4ac('0x25')](function(_0x378b83){return _0x378b83;});}return null;};}function removeEntity(_0x46f9b,_0x21b6b5){return function(_0x8ad001){if(_0x8ad001){return _0x8ad001[_0xa4ac('0x26')]()[_0xa4ac('0x25')](function(){_0x46f9b[_0xa4ac('0x1c')](0xcc)[_0xa4ac('0x27')]();});}};}function handleEntityNotFound(_0x544db3,_0x5c1256){return function(_0x5ae549){if(!_0x5ae549){_0x544db3['sendStatus'](0x194);}return _0x5ae549;};}function handleError(_0x1f6564,_0x3b0a29){_0x3b0a29=_0x3b0a29||0x1f4;return function(_0x4181c2){logger[_0xa4ac('0x28')](_0x4181c2['stack']);if(_0x4181c2[_0xa4ac('0x29')]){delete _0x4181c2['name'];}_0x1f6564['status'](_0x3b0a29)['send'](_0x4181c2);};}exports[_0xa4ac('0x2a')]=function(_0x32c823,_0x4cf8fc){var _0x57f6b8={},_0x426c58={},_0x1d2951={'count':0x0,'rows':[]};var _0x2ff75a=_[_0xa4ac('0x2b')](db['ChatGroup'][_0xa4ac('0x2c')],function(_0x45ffe7){return{'name':_0x45ffe7[_0xa4ac('0x2d')],'type':_0x45ffe7['type'][_0xa4ac('0x2e')]};});_0x426c58[_0xa4ac('0x2f')]=_[_0xa4ac('0x2b')](_0x2ff75a,_0xa4ac('0x29'));_0x426c58[_0xa4ac('0x30')]=_[_0xa4ac('0x31')](_0x32c823['query']);_0x426c58[_0xa4ac('0x32')]=_['intersection'](_0x426c58[_0xa4ac('0x2f')],_0x426c58[_0xa4ac('0x30')]);_0x57f6b8[_0xa4ac('0x33')]=_['intersection'](_0x426c58[_0xa4ac('0x2f')],qs['fields'](_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x34')]));_0x57f6b8[_0xa4ac('0x33')]=_0x57f6b8[_0xa4ac('0x33')][_0xa4ac('0x35')]?_0x57f6b8[_0xa4ac('0x33')]:_0x426c58['model'];if(!_0x32c823[_0xa4ac('0x30')]['hasOwnProperty'](_0xa4ac('0x36'))){_0x57f6b8[_0xa4ac('0x21')]=qs[_0xa4ac('0x21')](_0x32c823[_0xa4ac('0x30')]['limit']);_0x57f6b8[_0xa4ac('0x1e')]=qs[_0xa4ac('0x1e')](_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x1e')]);}_0x57f6b8[_0xa4ac('0x37')]=qs[_0xa4ac('0x38')](_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x38')]);_0x57f6b8['where']=qs[_0xa4ac('0x32')](_[_0xa4ac('0x39')](_0x32c823['query'],_0x426c58['filters']),_0x2ff75a);if(_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x3a')]){_0x57f6b8[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x57f6b8['where'],{'$or':_[_0xa4ac('0x2b')](_0x2ff75a,function(_0x23ebd5){if(_0x23ebd5[_0xa4ac('0x3d')]!=='VIRTUAL'){var _0x5b9ecc={};_0x5b9ecc[_0x23ebd5[_0xa4ac('0x29')]]={'$like':'%'+_0x32c823[_0xa4ac('0x30')]['filter']+'%'};return _0x5b9ecc;}})});}_0x57f6b8=_[_0xa4ac('0x3c')]({},_0x57f6b8,_0x32c823[_0xa4ac('0x3e')]);var _0x4afb16={'where':_0x57f6b8[_0xa4ac('0x3b')]};return db['ChatGroup'][_0xa4ac('0x20')](_0x4afb16)['then'](function(_0x3492b6){_0x1d2951['count']=_0x3492b6;if(_0x32c823[_0xa4ac('0x30')][_0xa4ac('0x3f')]){_0x57f6b8['include']=[{'all':!![]}];}return db[_0xa4ac('0x40')][_0xa4ac('0x41')](_0x57f6b8);})['then'](function(_0x489226){_0x1d2951[_0xa4ac('0x42')]=_0x489226;return _0x1d2951;})[_0xa4ac('0x25')](respondWithFilteredResult(_0x4cf8fc,_0x57f6b8))[_0xa4ac('0x43')](handleError(_0x4cf8fc,null));};exports['show']=function(_0x2109d7,_0x155ca0){var _0x2be022={'raw':!![],'where':{'id':_0x2109d7[_0xa4ac('0x44')]['id']}},_0x353fd1={};_0x353fd1[_0xa4ac('0x2f')]=_['keys'](db[_0xa4ac('0x40')][_0xa4ac('0x2c')]);_0x353fd1['query']=_['keys'](_0x2109d7['query']);_0x353fd1[_0xa4ac('0x32')]=_[_0xa4ac('0x45')](_0x353fd1[_0xa4ac('0x2f')],_0x353fd1['query']);_0x2be022[_0xa4ac('0x33')]=_['intersection'](_0x353fd1['model'],qs[_0xa4ac('0x34')](_0x2109d7[_0xa4ac('0x30')][_0xa4ac('0x34')]));_0x2be022['attributes']=_0x2be022['attributes']['length']?_0x2be022[_0xa4ac('0x33')]:_0x353fd1[_0xa4ac('0x2f')];if(_0x2109d7[_0xa4ac('0x30')][_0xa4ac('0x3f')]){_0x2be022['include']=[{'all':!![]}];}_0x2be022=_[_0xa4ac('0x3c')]({},_0x2be022,_0x2109d7[_0xa4ac('0x3e')]);return db[_0xa4ac('0x40')]['find'](_0x2be022)[_0xa4ac('0x25')](handleEntityNotFound(_0x155ca0,null))[_0xa4ac('0x25')](respondWithResult(_0x155ca0,null))[_0xa4ac('0x43')](handleError(_0x155ca0,null));};exports[_0xa4ac('0x46')]=function(_0x2abfa7,_0x2579c1){return db[_0xa4ac('0x40')]['create'](_0x2abfa7[_0xa4ac('0x47')],{})[_0xa4ac('0x25')](respondWithResult(_0x2579c1,0xc9))[_0xa4ac('0x43')](handleError(_0x2579c1,null));};exports['update']=function(_0x2859e0,_0x5109b7){if(_0x2859e0['body']['id']){delete _0x2859e0['body']['id'];}return db[_0xa4ac('0x40')][_0xa4ac('0x48')]({'where':{'id':_0x2859e0['params']['id']}})['then'](handleEntityNotFound(_0x5109b7,null))['then'](saveUpdates(_0x2859e0[_0xa4ac('0x47')],null))[_0xa4ac('0x25')](respondWithResult(_0x5109b7,null))[_0xa4ac('0x43')](handleError(_0x5109b7,null));};exports[_0xa4ac('0x26')]=function(_0x4ee4e1,_0x39178){return db[_0xa4ac('0x40')][_0xa4ac('0x48')]({'where':{'id':_0x4ee4e1[_0xa4ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x39178,null))[_0xa4ac('0x25')](removeEntity(_0x39178,null))[_0xa4ac('0x43')](handleError(_0x39178,null));};exports[_0xa4ac('0x49')]=function(_0xddb0b6,_0x93f93b){return db['ChatGroup']['describe']()[_0xa4ac('0x25')](respondWithResult(_0x93f93b,null))[_0xa4ac('0x43')](handleError(_0x93f93b,null));};exports[_0xa4ac('0x4a')]=function(_0x3c44f2,_0x5f1f2e,_0x3fabed){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x3c44f2[_0xa4ac('0x44')]['id'],'ToId':_0x3c44f2[_0xa4ac('0x4b')]['id'],'read':![]}})[_0xa4ac('0x25')](function(_0x4ee9bf){return{'id':_[_0xa4ac('0x4c')](_0x3c44f2[_0xa4ac('0x44')]['id']),'count':_0x4ee9bf};})[_0xa4ac('0x25')](respondWithResult(_0x5f1f2e,null))[_0xa4ac('0x43')](handleError(_0x5f1f2e,null));};exports[_0xa4ac('0x4d')]=function(_0x43d8f3,_0x238a5f,_0x3c4bad){return db[_0xa4ac('0x40')][_0xa4ac('0x48')]({'where':{'id':_0x43d8f3[_0xa4ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x238a5f,null))[_0xa4ac('0x25')](function(_0x364e3e){if(_0x364e3e){return _0x364e3e[_0xa4ac('0x4d')](_0x43d8f3['body'][_0xa4ac('0x4e')],_['omit'](_0x43d8f3['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x238a5f,null))['catch'](handleError(_0x238a5f,null));};exports[_0xa4ac('0x4f')]=function(_0x5e690,_0x292622,_0x2f5df4){var _0x274017={};var _0x560558={};var _0x2787b1;var _0x27be1e;return db[_0xa4ac('0x40')]['findOne']({'where':{'id':_0x5e690['params']['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x292622,null))[_0xa4ac('0x25')](function(_0x454cac){if(_0x454cac){_0x2787b1=_0x454cac;_0x560558[_0xa4ac('0x2f')]=_[_0xa4ac('0x31')](db[_0xa4ac('0x50')]['rawAttributes']);_0x560558[_0xa4ac('0x30')]=_['keys'](_0x5e690[_0xa4ac('0x30')]);_0x560558[_0xa4ac('0x32')]=_[_0xa4ac('0x45')](_0x560558[_0xa4ac('0x2f')],_0x560558[_0xa4ac('0x30')]);_0x274017[_0xa4ac('0x33')]=_['intersection'](_0x560558[_0xa4ac('0x2f')],qs[_0xa4ac('0x34')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x34')]));_0x274017[_0xa4ac('0x33')]=_0x274017['attributes'][_0xa4ac('0x35')]?_0x274017[_0xa4ac('0x33')]:_0x560558['model'];_0x274017[_0xa4ac('0x37')]=qs[_0xa4ac('0x38')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x38')]);_0x274017[_0xa4ac('0x3b')]=qs['filters'](_[_0xa4ac('0x39')](_0x5e690[_0xa4ac('0x30')],_0x560558['filters']));if(_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x3a')]){_0x274017[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x274017[_0xa4ac('0x3b')],{'$or':_[_0xa4ac('0x2b')](_0x274017[_0xa4ac('0x33')],function(_0x4c8bca){var _0xffc38={};_0xffc38[_0x4c8bca]={'$like':'%'+_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x3a')]+'%'};return _0xffc38;})});}_0x274017=_[_0xa4ac('0x3c')]({},_0x274017,_0x5e690[_0xa4ac('0x3e')]);return _0x2787b1[_0xa4ac('0x4f')](_0x274017);}})[_0xa4ac('0x25')](function(_0x58dfee){if(_0x58dfee){_0x27be1e=_0x58dfee['length'];if(!_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x51')](_0xa4ac('0x36'))){_0x274017[_0xa4ac('0x21')]=qs[_0xa4ac('0x21')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x21')]);_0x274017['offset']=qs[_0xa4ac('0x1e')](_0x5e690[_0xa4ac('0x30')][_0xa4ac('0x1e')]);}return _0x2787b1[_0xa4ac('0x4f')](_0x274017);}})['then'](function(_0x475794){if(_0x475794){return _0x475794?{'count':_0x27be1e,'rows':_0x475794}:null;}})[_0xa4ac('0x25')](respondWithResult(_0x292622,null))[_0xa4ac('0x43')](handleError(_0x292622,null));};exports[_0xa4ac('0x52')]=function(_0x289b9b,_0x28ba0a,_0x4b9226){return db['ChatGroup'][_0xa4ac('0x48')]({'where':{'id':_0x289b9b['params']['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x28ba0a,null))[_0xa4ac('0x25')](function(_0x2a8105){if(_0x2a8105){return _0x2a8105[_0xa4ac('0x52')](_0x289b9b[_0xa4ac('0x30')]['ids']);}})[_0xa4ac('0x25')](respondWithStatusCode(_0x28ba0a,null))[_0xa4ac('0x43')](handleError(_0x28ba0a,null));};exports[_0xa4ac('0x53')]=function(_0x5d598f,_0x46bebd,_0x27ef86){if(_0x5d598f[_0xa4ac('0x47')]['id']){delete _0x5d598f[_0xa4ac('0x47')]['id'];}return db[_0xa4ac('0x40')]['find']({'where':{'id':_0x5d598f[_0xa4ac('0x44')]['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x46bebd,null))[_0xa4ac('0x25')](function(_0x1d2c82){if(_0x1d2c82){_0x5d598f['body'][_0xa4ac('0x54')]=_0x1d2c82['id'];return db[_0xa4ac('0x55')][_0xa4ac('0x46')](_0x5d598f[_0xa4ac('0x47')]);}})[_0xa4ac('0x25')](respondWithResult(_0x46bebd,null))[_0xa4ac('0x43')](handleError(_0x46bebd,null));};exports['getMessages']=function(_0x4d3cda,_0x3c0887,_0x284008){var _0x50d559={};var _0x25be8f={};var _0x51462c;var _0x34e403;return db[_0xa4ac('0x40')]['findOne']({'where':{'id':_0x4d3cda[_0xa4ac('0x44')]['id']}})[_0xa4ac('0x25')](handleEntityNotFound(_0x3c0887,null))[_0xa4ac('0x25')](function(_0x51b9d2){if(_0x51b9d2){_0x51462c=_0x51b9d2;_0x25be8f[_0xa4ac('0x2f')]=_[_0xa4ac('0x31')](db[_0xa4ac('0x55')][_0xa4ac('0x2c')]);_0x25be8f[_0xa4ac('0x30')]=_['keys'](_0x4d3cda[_0xa4ac('0x30')]);_0x25be8f['filters']=_['intersection'](_0x25be8f['model'],_0x25be8f['query']);_0x50d559[_0xa4ac('0x33')]=_['intersection'](_0x25be8f[_0xa4ac('0x2f')],qs[_0xa4ac('0x34')](_0x4d3cda['query'][_0xa4ac('0x34')]));_0x50d559[_0xa4ac('0x33')]=_0x50d559[_0xa4ac('0x33')][_0xa4ac('0x35')]?_0x50d559['attributes']:_0x25be8f['model'];_0x50d559[_0xa4ac('0x37')]=qs[_0xa4ac('0x38')](_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x38')]);_0x50d559[_0xa4ac('0x3b')]=qs[_0xa4ac('0x32')](_['pick'](_0x4d3cda[_0xa4ac('0x30')],_0x25be8f[_0xa4ac('0x32')]));if(_0x4d3cda[_0xa4ac('0x30')]['filter']){_0x50d559[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x50d559['where'],{'$or':_[_0xa4ac('0x2b')](_0x50d559[_0xa4ac('0x33')],function(_0x2a12e6){var _0x2a8703={};_0x2a8703[_0x2a12e6]={'$like':'%'+_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x3a')]+'%'};return _0x2a8703;})});}if(_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x56')]){var _0x226676=_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x56')][_0xa4ac('0x57')](',');var _0xba6d10={};_0xba6d10[_0x226676[0x0]]={'$gte':moment(_0x226676[0x1])[_0xa4ac('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50d559[_0xa4ac('0x3b')]=_[_0xa4ac('0x3c')](_0x50d559[_0xa4ac('0x3b')],_0xba6d10);}_0x50d559=_[_0xa4ac('0x3c')]({},_0x50d559,_0x4d3cda[_0xa4ac('0x3e')]);return _0x51462c[_0xa4ac('0x59')](_0x50d559);}})[_0xa4ac('0x25')](function(_0x49216e){if(_0x49216e){_0x34e403=_0x49216e[_0xa4ac('0x35')];if(!_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x51')](_0xa4ac('0x36'))){_0x50d559[_0xa4ac('0x21')]=qs[_0xa4ac('0x21')](_0x4d3cda[_0xa4ac('0x30')][_0xa4ac('0x21')]);_0x50d559[_0xa4ac('0x1e')]=qs[_0xa4ac('0x1e')](_0x4d3cda['query'][_0xa4ac('0x1e')]);}return _0x51462c['getMessages'](_0x50d559);}})[_0xa4ac('0x25')](function(_0x3ab1e0){if(_0x3ab1e0){return _0x3ab1e0?{'count':_0x34e403,'rows':_0x3ab1e0}:null;}})[_0xa4ac('0x25')](respondWithResult(_0x3c0887,null))[_0xa4ac('0x43')](handleError(_0x3c0887,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 7280fba..17e7aee 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 _0x7d14=['save','update','remove','emit','events','../../mysqldb','setMaxListeners'];(function(_0x3dbc20,_0x2fe008){var _0x1141cb=function(_0x288aae){while(--_0x288aae){_0x3dbc20['push'](_0x3dbc20['shift']());}};_0x1141cb(++_0x2fe008);}(_0x7d14,0x6d));var _0x47d1=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0x7d14[_0x80544e];return _0x4f9b90;};'use strict';var EventEmitter=require(_0x47d1('0x0'));var ChatGroup=require(_0x47d1('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x47d1('0x2')](0x0);var events={'afterCreate':_0x47d1('0x3'),'afterUpdate':_0x47d1('0x4'),'afterDestroy':_0x47d1('0x5')};function emitEvent(_0x5723fc){return function(_0x37d8f2,_0x33fe33,_0x8f3654){ChatGroupEvents[_0x47d1('0x6')](_0x5723fc+':'+_0x37d8f2['id'],_0x37d8f2);ChatGroupEvents[_0x47d1('0x6')](_0x5723fc,_0x37d8f2);_0x8f3654(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xd709=['emit','hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','update','remove'];(function(_0x9f78b9,_0x1b4ab3){var _0x2262e5=function(_0x20990f){while(--_0x20990f){_0x9f78b9['push'](_0x9f78b9['shift']());}};_0x2262e5(++_0x1b4ab3);}(_0xd709,0x104));var _0x9d70=function(_0x404bbf,_0x4e6a0a){_0x404bbf=_0x404bbf-0x0;var _0x52a7dc=_0xd709[_0x404bbf];return _0x52a7dc;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x9d70('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9d70('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9d70('0x2'),'afterDestroy':_0x9d70('0x3')};function emitEvent(_0x4bdb69){return function(_0x587d75,_0x294a79,_0x391db5){ChatGroupEvents[_0x9d70('0x4')](_0x4bdb69+':'+_0x587d75['id'],_0x587d75);ChatGroupEvents[_0x9d70('0x4')](_0x4bdb69,_0x587d75);_0x391db5(null);};}for(var e in events){if(events[_0x9d70('0x5')](e)){var event=events[e];ChatGroup[_0x9d70('0x6')](e,emitEvent(event));}}module[_0x9d70('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index a669d75..f062e99 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 _0xd570=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd570,0x1d0));var _0x0d57=function(_0x517a3f,_0x3521c5){_0x517a3f=_0x517a3f-0x0;var _0x25497b=_0xd570[_0x517a3f];return _0x25497b;};'use strict';var _=require(_0x0d57('0x0'));var util=require(_0x0d57('0x1'));var logger=require(_0x0d57('0x2'))(_0x0d57('0x3'));var moment=require('moment');var BPromise=require(_0x0d57('0x4'));var rp=require(_0x0d57('0x5'));var fs=require('fs');var path=require(_0x0d57('0x6'));var rimraf=require(_0x0d57('0x7'));var config=require(_0x0d57('0x8'));var attributes=require(_0x0d57('0x9'));module[_0x0d57('0xa')]=function(_0x53e1b1,_0x452a94){return _0x53e1b1[_0x0d57('0xb')](_0x0d57('0xc'),attributes,{'tableName':_0x0d57('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12f8=['bluebird','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','api','moment'];(function(_0xca9e2,_0x350f76){var _0x145f56=function(_0x7f3b77){while(--_0x7f3b77){_0xca9e2['push'](_0xca9e2['shift']());}};_0x145f56(++_0x350f76);}(_0x12f8,0xec));var _0x812f=function(_0x1539ad,_0x2794de){_0x1539ad=_0x1539ad-0x0;var _0xc91daf=_0x12f8[_0x1539ad];return _0xc91daf;};'use strict';var _=require(_0x812f('0x0'));var util=require(_0x812f('0x1'));var logger=require('../../config/logger')(_0x812f('0x2'));var moment=require(_0x812f('0x3'));var BPromise=require(_0x812f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x812f('0x5'));var rimraf=require('rimraf');var config=require(_0x812f('0x6'));var attributes=require(_0x812f('0x7'));module[_0x812f('0x8')]=function(_0x20b80b,_0x4622e4){return _0x20b80b[_0x812f('0x9')](_0x812f('0xa'),attributes,{'tableName':_0x812f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 7ff2c1c..4bdcb94 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 _0x8758=['ChatGroup,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./chatGroup.socket','request','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4b13ce,_0x339cb0){var _0x427d4b=function(_0x26aaad){while(--_0x26aaad){_0x4b13ce['push'](_0x4b13ce['shift']());}};_0x427d4b(++_0x339cb0);}(_0x8758,0x1b8));var _0x8875=function(_0x1856a7,_0x3d6bec){_0x1856a7=_0x1856a7-0x0;var _0xa0d4f=_0x8758[_0x1856a7];return _0xa0d4f;};'use strict';var _=require(_0x8875('0x0'));var util=require(_0x8875('0x1'));var moment=require('moment');var BPromise=require(_0x8875('0x2'));var rs=require(_0x8875('0x3'));var fs=require('fs');var Redis=require(_0x8875('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8875('0x5'));var logger=require(_0x8875('0x6'))(_0x8875('0x7'));var config=require(_0x8875('0x8'));var jayson=require(_0x8875('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8875('0xa')]=_['defaults'](config[_0x8875('0xa')],{'host':_0x8875('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8875('0xa')]));require(_0x8875('0xc'))['register'](socket);function respondWithRpcPromise(_0xab0840,_0x5496c8,_0x4f3ad5){return new BPromise(function(_0x6adc25,_0x40d139){return client[_0x8875('0xd')](_0xab0840,_0x4f3ad5)['then'](function(_0x968393){logger['info']('ChatGroup,\x20%s,\x20%s',_0x5496c8,_0x8875('0xe'));logger[_0x8875('0xf')](_0x8875('0x10'),_0x5496c8,_0x8875('0xe'),JSON[_0x8875('0x11')](_0x968393));if(_0x968393['error']){if(_0x968393[_0x8875('0x12')]['code']===0x1f4){logger[_0x8875('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5496c8,_0x968393[_0x8875('0x12')][_0x8875('0x13')]);return _0x40d139(_0x968393['error'][_0x8875('0x13')]);}logger[_0x8875('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5496c8,_0x968393['error'][_0x8875('0x13')]);return _0x6adc25(_0x968393[_0x8875('0x12')]['message']);}else{logger['info'](_0x8875('0x14'),_0x5496c8,'request\x20sent');_0x6adc25(_0x968393[_0x8875('0x15')]['message']);}})[_0x8875('0x16')](function(_0x1cc2a8){logger[_0x8875('0x12')](_0x8875('0x14'),_0x5496c8,_0x1cc2a8);_0x40d139(_0x1cc2a8);});});}
\ No newline at end of file
+var _0xaeaf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x419893,_0x1aab65){var _0x542714=function(_0x53efb1){while(--_0x53efb1){_0x419893['push'](_0x419893['shift']());}};_0x542714(++_0x1aab65);}(_0xaeaf,0x14e));var _0xfaea=function(_0x311e77,_0x49a459){_0x311e77=_0x311e77-0x0;var _0x559c54=_0xaeaf[_0x311e77];return _0x559c54;};'use strict';var _=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var moment=require(_0xfaea('0x2'));var BPromise=require(_0xfaea('0x3'));var rs=require(_0xfaea('0x4'));var fs=require('fs');var Redis=require(_0xfaea('0x5'));var db=require(_0xfaea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaea('0x7'))(_0xfaea('0x8'));var config=require(_0xfaea('0x9'));var jayson=require(_0xfaea('0xa'));var client=jayson['client'][_0xfaea('0xb')]({'port':0x232a});config[_0xfaea('0xc')]=_[_0xfaea('0xd')](config[_0xfaea('0xc')],{'host':_0xfaea('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaea('0xc')]));require(_0xfaea('0xf'))['register'](socket);function respondWithRpcPromise(_0x191039,_0x3c1f4d,_0x2462f5){return new BPromise(function(_0x5078b6,_0x116379){return client[_0xfaea('0x10')](_0x191039,_0x2462f5)[_0xfaea('0x11')](function(_0x5c4746){logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));logger[_0xfaea('0x15')](_0xfaea('0x16'),_0x3c1f4d,'request\x20sent',JSON[_0xfaea('0x17')](_0x5c4746));if(_0x5c4746['error']){if(_0x5c4746[_0xfaea('0x18')]['code']===0x1f4){logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error'][_0xfaea('0x19')]);return _0x116379(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error']['message']);return _0x5078b6(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}else{logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));_0x5078b6(_0x5c4746[_0xfaea('0x1a')][_0xfaea('0x19')]);}})[_0xfaea('0x1b')](function(_0x328924){logger[_0xfaea('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3c1f4d,_0x328924);_0x116379(_0x328924);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 63106d3..74efbcb 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 _0x4c8d=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register','length'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0x4c8d,0xf9));var _0xd4c8=function(_0x6ff6c1,_0x2777bf){_0x6ff6c1=_0x6ff6c1-0x0;var _0x20b599=_0x4c8d[_0x6ff6c1];return _0x20b599;};'use strict';var ChatGroupEvents=require(_0xd4c8('0x0'));var events=['save',_0xd4c8('0x1'),_0xd4c8('0x2')];function createListener(_0x207298,_0x26b550){return function(_0x5b73ac){_0x26b550[_0xd4c8('0x3')](_0x207298,_0x5b73ac);};}function removeListener(_0x10c8f7,_0x380a0e){return function(){ChatGroupEvents[_0xd4c8('0x4')](_0x10c8f7,_0x380a0e);};}exports[_0xd4c8('0x5')]=function(_0x1274d3){for(var _0x44f7b3=0x0,_0x30bafc=events[_0xd4c8('0x6')];_0x44f7b3<_0x30bafc;_0x44f7b3++){var _0x4de03e=events[_0x44f7b3];var _0x15e6e7=createListener(_0xd4c8('0x7')+_0x4de03e,_0x1274d3);ChatGroupEvents['on'](_0x4de03e,_0x15e6e7);}};
\ No newline at end of file
+var _0xe6b9=['./chatGroup.events','update','emit','removeListener','register','chatGroup:'];(function(_0x14f814,_0x1e4ffa){var _0x351e4d=function(_0x3a3342){while(--_0x3a3342){_0x14f814['push'](_0x14f814['shift']());}};_0x351e4d(++_0x1e4ffa);}(_0xe6b9,0x144));var _0x9e6b=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0xe6b9[_0x413b4d];return _0x8b810a;};'use strict';var ChatGroupEvents=require(_0x9e6b('0x0'));var events=['save','remove',_0x9e6b('0x1')];function createListener(_0x3aba29,_0x369d3c){return function(_0x517a60){_0x369d3c[_0x9e6b('0x2')](_0x3aba29,_0x517a60);};}function removeListener(_0x2e6f0d,_0xf0ed5a){return function(){ChatGroupEvents[_0x9e6b('0x3')](_0x2e6f0d,_0xf0ed5a);};}exports[_0x9e6b('0x4')]=function(_0x57df67){for(var _0x499403=0x0,_0x2f5899=events['length'];_0x499403<_0x2f5899;_0x499403++){var _0x5df622=events[_0x499403];var _0xe6a057=createListener(_0x9e6b('0x5')+_0x5df622,_0x57df67);ChatGroupEvents['on'](_0x5df622,_0xe6a057);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index b0eed18..f6e1b82 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 _0xa0f8=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','create','post','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x4d6d3d,_0x3600f9){var _0x45e62d=function(_0x56a25b){while(--_0x56a25b){_0x4d6d3d['push'](_0x4d6d3d['shift']());}};_0x45e62d(++_0x3600f9);}(_0xa0f8,0x1a9));var _0x8a0f=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xa0f8[_0x2b8077];return _0x308091;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a0f('0x0'));var timeout=require(_0x8a0f('0x1'));var express=require(_0x8a0f('0x2'));var router=express[_0x8a0f('0x3')]();var fs_extra=require(_0x8a0f('0x4'));var auth=require(_0x8a0f('0x5'));var interaction=require(_0x8a0f('0x6'));var config=require(_0x8a0f('0x7'));var controller=require(_0x8a0f('0x8'));router[_0x8a0f('0x9')]('/',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0xb')]);router[_0x8a0f('0x9')](_0x8a0f('0xc'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0xd')]);router[_0x8a0f('0x9')](_0x8a0f('0xe'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0xf')]);router[_0x8a0f('0x9')](_0x8a0f('0x10'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x11')]);router[_0x8a0f('0x9')]('/:id/members',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x12')]);router[_0x8a0f('0x9')]('/:id/messages',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x13')]);router['post']('/',auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x14')]);router[_0x8a0f('0x15')](_0x8a0f('0x16'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x17')]);router[_0x8a0f('0x15')](_0x8a0f('0x18'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x19')]);router[_0x8a0f('0x1a')](_0x8a0f('0xe'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x1b')]);router[_0x8a0f('0x1c')](_0x8a0f('0xe'),auth[_0x8a0f('0xa')](),controller[_0x8a0f('0x1d')]);router[_0x8a0f('0x1c')]('/:id/members',auth[_0x8a0f('0xa')](),controller['removeMembers']);module[_0x8a0f('0x1e')]=router;
\ No newline at end of file
+var _0xae91=['index','/describe','describe','show','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x148fa9,_0x5232a7){var _0x5c87da=function(_0x5c1323){while(--_0x5c1323){_0x148fa9['push'](_0x148fa9['shift']());}};_0x5c87da(++_0x5232a7);}(_0xae91,0xd5));var _0x1ae9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae91[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x1ae9('0x0'));var util=require(_0x1ae9('0x1'));var path=require(_0x1ae9('0x2'));var timeout=require(_0x1ae9('0x3'));var express=require(_0x1ae9('0x4'));var router=express[_0x1ae9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1ae9('0x6'));var interaction=require(_0x1ae9('0x7'));var config=require(_0x1ae9('0x8'));var controller=require('./chatGroup.controller');router[_0x1ae9('0x9')]('/',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0xb')]);router[_0x1ae9('0x9')](_0x1ae9('0xc'),auth[_0x1ae9('0xa')](),controller[_0x1ae9('0xd')]);router['get']('/:id',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0xe')]);router[_0x1ae9('0x9')]('/:id/unread',auth['isAuthenticated'](),controller[_0x1ae9('0xf')]);router[_0x1ae9('0x9')]('/:id/members',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x10')]);router[_0x1ae9('0x9')](_0x1ae9('0x11'),auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x12')]);router[_0x1ae9('0x13')]('/',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x14')]);router['post'](_0x1ae9('0x15'),auth['isAuthenticated'](),controller[_0x1ae9('0x16')]);router[_0x1ae9('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x1ae9('0x17')](_0x1ae9('0x18'),auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x19')]);router[_0x1ae9('0x1a')]('/:id',auth[_0x1ae9('0xa')](),controller[_0x1ae9('0x1b')]);router[_0x1ae9('0x1a')](_0x1ae9('0x15'),auth[_0x1ae9('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 81dad6e..655553d 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 _0x8caf=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports','BOOLEAN'];(function(_0x3a8bcc,_0x303a01){var _0x24e335=function(_0x159711){while(--_0x159711){_0x3a8bcc['push'](_0x3a8bcc['shift']());}};_0x24e335(++_0x303a01);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x3d2438,_0x2e7922){_0x3d2438=_0x3d2438-0x0;var _0xd18de5=_0x8caf[_0x3d2438];return _0xd18de5;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'closed':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf8ca('0x2')]},'ratingType':{'type':Sequelize[_0xf8ca('0x3')](_0xf8ca('0x4'),_0xf8ca('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf8ca('0x6')]},'pathTranscript':{'type':Sequelize[_0xf8ca('0x6')]},'mailTranscript':{'type':Sequelize[_0xf8ca('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf8ca('0x8')]},'disposition':{'type':Sequelize[_0xf8ca('0x7')]},'secondDisposition':{'type':Sequelize[_0xf8ca('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf8ca('0x7')]},'browserName':{'type':Sequelize[_0xf8ca('0x7')]},'browserVersion':{'type':Sequelize[_0xf8ca('0x7')]},'osName':{'type':Sequelize[_0xf8ca('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf8ca('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xf8ca('0x6')]},'customerIp':{'type':Sequelize[_0xf8ca('0x7')]},'formData':{'type':Sequelize[_0xf8ca('0x6')](_0xf8ca('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf8ca('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf8ca('0x3')]('in',_0xf8ca('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf8ca('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xf8ca('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xaf4c=['long','DATE','out','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING'];(function(_0x5e2976,_0x2cc1ec){var _0x5979c9=function(_0x21c481){while(--_0x21c481){_0x5e2976['push'](_0x5e2976['shift']());}};_0x5979c9(++_0x2cc1ec);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x303e1c,_0x34b41e){_0x303e1c=_0x303e1c-0x0;var _0x2ea37f=_0xaf4c[_0x303e1c];return _0x2ea37f;};'use strict';var Sequelize=require('sequelize');module[_0xcaf4('0x0')]={'closed':{'type':Sequelize[_0xcaf4('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xcaf4('0x2')](_0xcaf4('0x3'),_0xcaf4('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xcaf4('0x5')]},'pathTranscript':{'type':Sequelize[_0xcaf4('0x5')]},'mailTranscript':{'type':Sequelize[_0xcaf4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcaf4('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcaf4('0x6')]},'note':{'type':Sequelize[_0xcaf4('0x6')]},'browserName':{'type':Sequelize[_0xcaf4('0x6')]},'browserVersion':{'type':Sequelize[_0xcaf4('0x6')]},'osName':{'type':Sequelize[_0xcaf4('0x6')]},'osVersion':{'type':Sequelize[_0xcaf4('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xcaf4('0x6')]},'referer':{'type':Sequelize[_0xcaf4('0x5')]},'customerIp':{'type':Sequelize[_0xcaf4('0x6')]},'formData':{'type':Sequelize[_0xcaf4('0x5')](_0xcaf4('0x7'))},'read1stAt':{'type':Sequelize[_0xcaf4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xcaf4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xcaf4('0x2')]('in',_0xcaf4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xcaf4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xcaf4('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index eb34b71..8f6c00b 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 _0xa8a8=['map','fullname','TagIds','Tags','push','talking','answered','unmanaged','abandoned','total','closed','waiting','disposition','UserId','ChatInteraction','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','conditions','find','unreadMessages','value','having','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','count','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','options','create','params','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','POST','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','download','server/files/chat/upload/','transcript-%s.txt','now','Messages','agentAlias','customer','format','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','ChatMessage','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','findAll','setTags','chatInteractionTags:save','removeTags','server','attachments','transcript-%d-%s.zip','firstName','lastName','ChatWebsite','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','set','update','stack','render','merge','body','contact','agent','interaction','account','Users'];(function(_0x3130c7,_0x3e1c27){var _0x4c2a82=function(_0x54c292){while(--_0x54c292){_0x3130c7['push'](_0x3130c7['shift']());}};_0x4c2a82(++_0x3e1c27);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4ea5df,_0x5ea887){_0x4ea5df=_0x4ea5df-0x0;var _0xb2cdd9=_0xa8a8[_0x4ea5df];return _0xb2cdd9;};'use strict';var rimraf=require(_0x8a8a('0x0'));var zipdir=require(_0x8a8a('0x1'));var rp=require(_0x8a8a('0x2'));var moment=require(_0x8a8a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8a8a('0x4'));var util=require(_0x8a8a('0x5'));var path=require(_0x8a8a('0x6'));var ejs=require(_0x8a8a('0x7'));var fs=require('fs');var _=require(_0x8a8a('0x8'));var squel=require(_0x8a8a('0x9'));var Redis=require(_0x8a8a('0xa'));var qs=require(_0x8a8a('0xb'));var as=require(_0x8a8a('0xc'));var pdf=require(_0x8a8a('0xd'));var logger=require(_0x8a8a('0xe'))(_0x8a8a('0xf'));var config=require(_0x8a8a('0x10'));var db=require(_0x8a8a('0x11'))['db'];config[_0x8a8a('0x12')]=_['defaults'](config['redis'],{'host':_0x8a8a('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a8a('0x12')]));require(_0x8a8a('0x14'))['register'](socket);var jayson=require(_0x8a8a('0x15'));var client=jayson[_0x8a8a('0x16')][_0x8a8a('0x17')]({'port':0x232b});var client9004=jayson['client'][_0x8a8a('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x42fab7,_0x330796,_0x234481,_0x4a1b91){return new BPromise(function(_0x23febf,_0x4e5d74){var _0x25e1d5=_0x4a1b91||client;return _0x25e1d5[_0x8a8a('0x18')](_0x42fab7,_0x234481)[_0x8a8a('0x19')](function(_0x2f6e33){logger[_0x8a8a('0x1a')](_0x8a8a('0x1b'),_0x330796,_0x8a8a('0x1c'));logger['debug'](_0x8a8a('0x1d'),_0x330796,'request\x20sent',JSON[_0x8a8a('0x1e')](_0x2f6e33));if(_0x2f6e33[_0x8a8a('0x1f')]){if(_0x2f6e33[_0x8a8a('0x1f')][_0x8a8a('0x20')]===0x1f4){logger[_0x8a8a('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x330796,_0x2f6e33[_0x8a8a('0x1f')][_0x8a8a('0x21')]);return _0x4e5d74(_0x2f6e33[_0x8a8a('0x1f')][_0x8a8a('0x21')]);}logger[_0x8a8a('0x1f')](_0x8a8a('0x1b'),_0x330796,_0x2f6e33['error']['message']);return _0x23febf(_0x2f6e33['error']['message']);}else{logger['info'](_0x8a8a('0x1b'),_0x330796,_0x8a8a('0x1c'));_0x23febf(_0x2f6e33[_0x8a8a('0x22')][_0x8a8a('0x21')]);}})[_0x8a8a('0x23')](function(_0x2f6af2){logger[_0x8a8a('0x1f')](_0x8a8a('0x1b'),_0x330796,_0x2f6af2);_0x4e5d74(_0x2f6af2);});});}function respondWithStatusCode(_0x25d5d4,_0x2deecb){_0x2deecb=_0x2deecb||0xcc;return function(_0xb9db78){if(_0xb9db78){return _0x25d5d4[_0x8a8a('0x24')](_0x2deecb);}return _0x25d5d4[_0x8a8a('0x25')](_0x2deecb)[_0x8a8a('0x26')]();};}function respondWithResult(_0x442c00,_0x545a38){_0x545a38=_0x545a38||0xc8;return function(_0x3c096f){if(_0x3c096f){return _0x442c00[_0x8a8a('0x25')](_0x545a38)[_0x8a8a('0x27')](_0x3c096f);}};}function respondWithFilteredResult(_0x7662e,_0x36e6d4){return function(_0x251315){if(_0x251315){var _0x3aa46d=typeof _0x36e6d4['offset']===_0x8a8a('0x28')&&typeof _0x36e6d4[_0x8a8a('0x29')]===_0x8a8a('0x28');var _0x54ff7e=_0x251315['count'];var _0x2dafcd=_0x3aa46d?0x0:_0x36e6d4[_0x8a8a('0x2a')];var _0x5c70bd=_0x3aa46d?_0x251315['count']:_0x36e6d4['offset']+_0x36e6d4[_0x8a8a('0x29')];var _0x5c7e58;if(_0x5c70bd>=_0x54ff7e){_0x5c70bd=_0x54ff7e;_0x5c7e58=0xc8;}else{_0x5c7e58=0xce;}_0x7662e[_0x8a8a('0x25')](_0x5c7e58);return _0x7662e[_0x8a8a('0x2b')]('Content-Range',_0x2dafcd+'-'+_0x5c70bd+'/'+_0x54ff7e)[_0x8a8a('0x27')](_0x251315);}return null;};}function saveUpdates(_0x2c8f27){return function(_0x250852){if(_0x250852){return _0x250852[_0x8a8a('0x2c')](_0x2c8f27)[_0x8a8a('0x19')](function(_0x3d6594){return _0x3d6594;});}return null;};}function removeEntity(_0x3e73b1){return function(_0x2a2917){if(_0x2a2917){return _0x2a2917['destroy']()['then'](function(){_0x3e73b1['status'](0xcc)[_0x8a8a('0x26')]();});}};}function handleEntityNotFound(_0x3bf77d){return function(_0x5f301e){if(!_0x5f301e){_0x3bf77d[_0x8a8a('0x24')](0x194);}return _0x5f301e;};}function handleError(_0x304e83,_0x481e92){_0x481e92=_0x481e92||0x1f4;return function(_0x3abab2){logger[_0x8a8a('0x1f')](_0x3abab2[_0x8a8a('0x2d')]);if(_0x3abab2['name']){delete _0x3abab2['name'];}_0x304e83[_0x8a8a('0x25')](_0x481e92)['send'](_0x3abab2);};}function getMustacheRender(_0x2a3198,_0x3a4aa6){return Mustache[_0x8a8a('0x2e')](_0x2a3198,_[_0x8a8a('0x2f')](_0x3a4aa6[_0x8a8a('0x30')],{'contact':_0x3a4aa6[_0x8a8a('0x31')],'message':_0x3a4aa6[_0x8a8a('0x21')],'agent':_0x3a4aa6[_0x8a8a('0x32')],'interaction':_0x3a4aa6[_0x8a8a('0x33')],'account':_0x3a4aa6[_0x8a8a('0x34')]}))||'';}function getInteractionUsers(_0x27de26,_0x45ddb4){return new BPromise(function(_0x17a36c,_0x37e644){try{if(_0x45ddb4[_0x27de26['id']]){_0x27de26[_0x8a8a('0x35')]=_[_0x8a8a('0x36')](_0x45ddb4[_0x27de26['id']],function(_0x8e3017){return{'id':_0x8e3017['id'],'fullname':_0x8e3017[_0x8a8a('0x37')]};});}}catch(_0x4c8003){_0x37e644(_0x4c8003);}_0x17a36c(_0x27de26);});}function getInteractionTags(_0x4cc605,_0x53da01){return new BPromise(function(_0x34db33,_0x9e0128){try{if(_0x4cc605[_0x8a8a('0x38')]){_0x4cc605[_0x8a8a('0x39')]=[];_0x4cc605[_0x8a8a('0x38')]['split'](',')['forEach'](function(_0x8d8481){_0x4cc605['Tags'][_0x8a8a('0x3a')](_0x53da01[_0x8d8481]);});}delete _0x4cc605['TagIds'];}catch(_0x52811b){_0x9e0128(_0x52811b);}_0x34db33(_0x4cc605);});}function updateChatInteraction(_0x1b33eb,_0x1ac761,_0x285e2c){return new BPromise(function(_0x19d41d,_0x31307c){return getInteractionUsers(_0x1b33eb,_0x285e2c)[_0x8a8a('0x19')](function(_0x20584a){return getInteractionTags(_0x20584a,_0x1ac761);})['then'](function(_0x40d509){return getStateInteraction(_0x40d509);})[_0x8a8a('0x19')](function(_0x46edea){_0x19d41d(_0x46edea);})['catch'](function(_0x3a4662){_0x31307c(_0x3a4662);});});}function getStateInteraction(_0x323f89){return new BPromise(function(_0x3f845e){_0x323f89['waiting']=0x0;_0x323f89[_0x8a8a('0x3b')]=0x0;_0x323f89[_0x8a8a('0x3c')]=0x0;_0x323f89[_0x8a8a('0x3d')]=0x0;_0x323f89[_0x8a8a('0x3e')]=0x0;_0x323f89[_0x8a8a('0x3f')]=0x0;if(!_0x323f89[_0x8a8a('0x40')]&&!_0x323f89['UserId']){_0x323f89['waiting']+=0x1;}if(!_0x323f89[_0x8a8a('0x40')]&&_0x323f89['UserId']){_0x323f89[_0x8a8a('0x3b')]+=0x1;if(_0x323f89[_0x8a8a('0x41')]){_0x323f89['waiting']-=0x1;}}if(_0x323f89['closed']&&_0x323f89[_0x8a8a('0x42')]===_0x8a8a('0x3e')){_0x323f89[_0x8a8a('0x3e')]+=0x1;if(_0x323f89[_0x8a8a('0x41')]){_0x323f89['waiting']-=0x1;}}else if(_0x323f89[_0x8a8a('0x40')]&&!_0x323f89['UserId']&&_0x323f89[_0x8a8a('0x42')]){_0x323f89[_0x8a8a('0x3d')]+=0x1;if(_0x323f89['waiting']){_0x323f89[_0x8a8a('0x41')]-=0x1;}}else if(_0x323f89[_0x8a8a('0x40')]&&_0x323f89[_0x8a8a('0x43')]){_0x323f89['answered']+=0x1;if(_0x323f89[_0x8a8a('0x3b')]){_0x323f89[_0x8a8a('0x3b')]-=0x1;}}_0x323f89[_0x8a8a('0x3f')]+=0x1;_0x3f845e(_0x323f89);});}exports['index']=function(_0x5466d4,_0x44aed3){var _0x1eb8bf={},_0x1b842a={},_0x5c6c98={'count':0x0,'rows':[]};var _0x18449b=_[_0x8a8a('0x36')](db[_0x8a8a('0x44')][_0x8a8a('0x45')],function(_0x2d4c11){return{'name':_0x2d4c11[_0x8a8a('0x46')],'type':_0x2d4c11[_0x8a8a('0x47')][_0x8a8a('0x48')]};});_0x1b842a[_0x8a8a('0x49')]=_[_0x8a8a('0x36')](_0x18449b,_0x8a8a('0x4a'));_0x1b842a['query']=_[_0x8a8a('0x4b')](_0x5466d4[_0x8a8a('0x4c')]);_0x1b842a[_0x8a8a('0x4d')]=_[_0x8a8a('0x4e')](_0x1b842a[_0x8a8a('0x49')],_0x1b842a[_0x8a8a('0x4c')]);_0x1eb8bf['attributes']=_[_0x8a8a('0x4e')](_0x1b842a[_0x8a8a('0x49')],qs[_0x8a8a('0x4f')](_0x5466d4[_0x8a8a('0x4c')]['fields']));_0x1eb8bf[_0x8a8a('0x50')]=_0x1eb8bf[_0x8a8a('0x50')][_0x8a8a('0x51')]?_0x1eb8bf['attributes']:_0x1b842a['model'];if(!_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x52')](_0x8a8a('0x53'))){_0x1eb8bf[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x29')]);_0x1eb8bf[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x5466d4['query']['offset']);}_0x1eb8bf[_0x8a8a('0x54')]=qs[_0x8a8a('0x55')](_0x5466d4['query']['sort']);_0x1eb8bf[_0x8a8a('0x56')]=qs['filters'](_[_0x8a8a('0x57')](_0x5466d4['query'],_0x1b842a[_0x8a8a('0x4d')]),_0x18449b);var _0xa2b8a1=[];var _0x339be6=squel[_0x8a8a('0x58')]()[_0x8a8a('0x59')]('id')[_0x8a8a('0x59')](_0x8a8a('0x4a'))[_0x8a8a('0x59')](_0x8a8a('0x5a'))[_0x8a8a('0x5b')]('tools_tags');var _0x329bfb=squel[_0x8a8a('0x58')]()[_0x8a8a('0x59')](_0x8a8a('0x5c'))[_0x8a8a('0x59')]('u.fullname')[_0x8a8a('0x59')](_0x8a8a('0x5d'))['from']('user_has_chat_interactions','ui')[_0x8a8a('0x5e')](_0x8a8a('0x5f'),'u',_0x8a8a('0x60'));var _0x2ba3bf=squel[_0x8a8a('0x58')]()[_0x8a8a('0x5b')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x8a8a('0x61'))['left_join'](_0x8a8a('0x5f'),'o',_0x8a8a('0x62'))['left_join'](_0x8a8a('0x63'),'a',_0x8a8a('0x64'))[_0x8a8a('0x5e')](_0x8a8a('0x65'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x8a8a('0x5e')]('chat_interaction_has_tags','it',_0x8a8a('0x66'))[_0x8a8a('0x5e')]('tools_tags','t',_0x8a8a('0x67'));var _0x101543=squel[_0x8a8a('0x68')]();var _0x183015=[];var _0x50b5c5=squel[_0x8a8a('0x68')]();var _0x37a9bb;if(_0x5466d4[_0x8a8a('0x4c')]['search']){_0x37a9bb=as['parseSearch'](_0x5466d4[_0x8a8a('0x4c')]['search']);var _0x5a34a6=_0x37a9bb['sqlOperator'];for(var _0x395564=0x0;_0x395564<_0x37a9bb[_0x8a8a('0x69')]['length'];_0x395564++){var _0x3f9377=_0x37a9bb['conditions'][_0x395564];var _0x4aa202='i';var _0x142ba6=_[_0x8a8a('0x6a')](_0x18449b,['name',_0x3f9377[_0x8a8a('0x59')]]);if(!_0x142ba6){switch(_0x3f9377[_0x8a8a('0x59')]){case _0x8a8a('0x6b'):if(_0x3f9377[_0x8a8a('0x6c')]==0x1){_0x2ba3bf[_0x8a8a('0x6d')]('`'+_0x3f9377[_0x8a8a('0x59')]+'`\x20=\x200');}else{_0x2ba3bf[_0x8a8a('0x6d')]('`'+_0x3f9377[_0x8a8a('0x59')]+'`\x20>\x200');}break;case _0x8a8a('0x6e'):if(_0x3f9377[_0x8a8a('0x6f')]===_0x8a8a('0x70')){if(_0x3f9377[_0x8a8a('0x6c')][_0x8a8a('0x71')]('\x20')[_0x8a8a('0x51')]>0x1){_0x101543[_0x5a34a6](_0x8a8a('0x72'),qs[_0x8a8a('0x73')](_0x3f9377[_0x8a8a('0x6c')]),null);}else{var _0x176ad3='%'+_0x3f9377['value']+'%';_0x101543[_0x5a34a6](_0x8a8a('0x74'),_0x176ad3,_0x176ad3,_0x176ad3);}}else{_0x142ba6=_[_0x8a8a('0x6a')](_0x18449b,['name',_0x8a8a('0x75')]);_0x3f9377[_0x8a8a('0x59')]=_0x8a8a('0x75');_0x33f5c8=as[_0x8a8a('0x76')](_0x4aa202,_0x142ba6[_0x8a8a('0x47')],_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8['text'],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x77')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x26')]);}break;case _0x8a8a('0x78'):var _0x224ec2=_0x3f9377[_0x8a8a('0x6c')]['split'](',')[_0x8a8a('0x36')](function(_0x260a6b){return Number(_0x260a6b);});_0x224ec2[_0x8a8a('0x79')](function(_0x50a069){_0x50b5c5['or'](_0x8a8a('0x7a'),'%,'+_0x50a069+',%');});_0x183015=_['union'](_0x183015,_0x224ec2);break;case _0x8a8a('0x7b'):if(_0x3f9377[_0x8a8a('0x6f')]==='$substring'){_0x101543[_0x5a34a6](_0x8a8a('0x7c'),'%'+_0x3f9377[_0x8a8a('0x6c')]+'%',null);}else{_0x142ba6=_[_0x8a8a('0x6a')](_0x18449b,[_0x8a8a('0x4a'),_0x8a8a('0x43')]);_0x3f9377[_0x8a8a('0x59')]=_0x8a8a('0x43');_0x33f5c8=as[_0x8a8a('0x76')](_0x4aa202,_0x142ba6[_0x8a8a('0x47')],_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8[_0x8a8a('0x7d')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x77')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x26')]);}break;case _0x8a8a('0x30'):_0x33f5c8=as[_0x8a8a('0x76')]('me',null,_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8[_0x8a8a('0x7d')],_0x33f5c8[_0x8a8a('0x6c')]['start'],_0x33f5c8[_0x8a8a('0x6c')]['end']);break;}}else{var _0x33f5c8=as[_0x8a8a('0x76')](_0x4aa202,_0x142ba6[_0x8a8a('0x47')],_0x3f9377);_0x101543[_0x5a34a6](_0x33f5c8['text'],_0x33f5c8['value'][_0x8a8a('0x77')],_0x33f5c8[_0x8a8a('0x6c')][_0x8a8a('0x26')]);}}}else{var _0x4b3db2=_(_0x5466d4['query'])[_0x8a8a('0x4b')]()[_0x8a8a('0x36')](function(_0x46a556){return _[_0x8a8a('0x7e')](_0x18449b,[_0x8a8a('0x4a'),_0x46a556])?_0x46a556:undefined;})[_0x8a8a('0x7f')]()[_0x8a8a('0x6c')]();if(!_[_0x8a8a('0x80')](_0x4b3db2)){_0x4b3db2['forEach'](function(_0x38d6ab){if(_0x38d6ab===_0x8a8a('0x81')){_0x2ba3bf['where'](_0x8a8a('0x82'),[][_0x8a8a('0x83')](_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab]));}else if(_0x38d6ab===_0x8a8a('0x84')){var _0x309725=JSON[_0x8a8a('0x85')](_0x5466d4['query'][_0x38d6ab])[_0x8a8a('0x86')];var _0x15ba84=JSON[_0x8a8a('0x85')](_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab])[_0x8a8a('0x87')];_0x2ba3bf['where'](_0x8a8a('0x88'),_0x309725,_0x15ba84);}else{if(_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab]===_0x8a8a('0x89')){_0x2ba3bf[_0x8a8a('0x56')]('i.'+_0x38d6ab+_0x8a8a('0x8a'));}else{_0x2ba3bf[_0x8a8a('0x56')]('i.'+_0x38d6ab+_0x8a8a('0x8b'),_0x5466d4[_0x8a8a('0x4c')][_0x38d6ab]);}}});}if(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x8c')]){if(_0x5466d4['query'][_0x8a8a('0x8c')]==0x1){_0x2ba3bf[_0x8a8a('0x6d')](_0x8a8a('0x8d'));}else{_0x2ba3bf[_0x8a8a('0x6d')](_0x8a8a('0x8e'));}}if(_0x5466d4['query']['tag']){_0x183015=_[_0x8a8a('0x8f')](_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x90')])?_0x5466d4['query'][_0x8a8a('0x90')]:new Array(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x90')]);_0x183015[_0x8a8a('0x79')](function(_0x5675ec){_0x50b5c5['or'](_0x8a8a('0x7a'),'%,'+_0x5675ec+',%');});}if(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x91')]){var _0x5cee89=_0x5466d4['query']['filter'][_0x8a8a('0x92')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8a8a('0x93')](_0x5cee89)){_0x101543['or']('i.id\x20LIKE\x20?',_0x5cee89+'%');}else{_0x101543['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8a8a('0x73')](_0x5cee89))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5cee89+'%');}}}_0x2ba3bf['where'](_0x101543);_0x2ba3bf['group'](_0x8a8a('0x94'));var _0x49aa1b={'type':db['Sequelize'][_0x8a8a('0x95')]['SELECT'],'raw':!![]};var _0x376c22=_0x2ba3bf['clone']();_0x376c22[_0x8a8a('0x59')](_0x8a8a('0x94'));_0x376c22[_0x8a8a('0x59')](_0x8a8a('0x96'),'unreadMessages');if(_0x1eb8bf[_0x8a8a('0x54')]){_0x1eb8bf[_0x8a8a('0x54')]['forEach'](function(_0x395bdd){var _0xf3cf32=_0x395bdd[0x0]===_0x8a8a('0x97')?_0x395bdd[0x0]:'i.'+_0x395bdd[0x0];_0x2ba3bf[_0x8a8a('0x54')](_0xf3cf32,_0x395bdd[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x183015)){_0x2ba3bf[_0x8a8a('0x6d')](_0x50b5c5);_0x376c22[_0x8a8a('0x56')](_0x8a8a('0x98'),_0x183015);}BPromise['resolve']()[_0x8a8a('0x19')](function(){if(!_0x37a9bb){if(_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x81')])return;_0x376c22['where'](_0x8a8a('0x99'));_0x2ba3bf[_0x8a8a('0x56')](_0x8a8a('0x99'));return;}if(_0x5466d4[_0x8a8a('0x9a')][_0x8a8a('0x9b')]!=='agent')return;return _0x5466d4[_0x8a8a('0x9a')][_0x8a8a('0x9c')]({'attributes':['id'],'raw':!![]})[_0x8a8a('0x19')](function(_0x161c44){if(_[_0x8a8a('0x80')](_0x161c44)){_0x376c22[_0x8a8a('0x56')](_0x8a8a('0x9d'));_0x2ba3bf['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x376c22[_0x8a8a('0x56')](_0x8a8a('0x82'),_[_0x8a8a('0x36')](_0x161c44,'id'));_0x2ba3bf['where'](_0x8a8a('0x82'),_[_0x8a8a('0x36')](_0x161c44,'id'));}});})[_0x8a8a('0x19')](function(){if(_0x5466d4[_0x8a8a('0x9a')][_0x8a8a('0x9b')]===_0x8a8a('0x32')&&!_0x37a9bb&&!_0x5466d4[_0x8a8a('0x4c')][_0x8a8a('0x81')])return[];return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x376c22['toString'](),_0x49aa1b);})[_0x8a8a('0x19')](function(_0x2b21c0){_0x5c6c98[_0x8a8a('0x9f')]=_0x2b21c0['length'];if(_0x5c6c98[_0x8a8a('0x9f')]===0x0)return[];return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x339be6['toString'](),_0x49aa1b)['then'](function(_0x1f409b){_0xa2b8a1=_[_0x8a8a('0xa0')](_0x1f409b,'id');_0x49aa1b=_[_0x8a8a('0x2f')](_0x49aa1b,{'model':db[_0x8a8a('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5466d4['query'][_0x8a8a('0x4f')]){_0x1eb8bf[_0x8a8a('0x50')][_0x8a8a('0x79')](function(_0xa23098){_0x2ba3bf['field']('i.'+_0xa23098);});}else{_0x2ba3bf['field'](_0x8a8a('0x96'),_0x8a8a('0x6b'));_0x2ba3bf[_0x8a8a('0x59')]('a.key',_0x8a8a('0xa1'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa2'),_0x8a8a('0xa3'));_0x2ba3bf[_0x8a8a('0x59')]('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',_0x8a8a('0x97'));_0x2ba3bf['field'](_0x8a8a('0xa4'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa5'),_0x8a8a('0xa6'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa7'),'Contact.lastName');_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xa8'),'Contact.email');_0x2ba3bf['field'](_0x8a8a('0xa9'),_0x8a8a('0xaa'));_0x2ba3bf['field'](_0x8a8a('0xab'),'Contact.mobile');_0x2ba3bf['field'](_0x8a8a('0xac'),_0x8a8a('0xad'));_0x2ba3bf[_0x8a8a('0x59')]('o.fullname',_0x8a8a('0xae'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xaf'),_0x8a8a('0xb0'));_0x2ba3bf[_0x8a8a('0x59')](_0x8a8a('0xb1'),'TagIds');}if(_0x1eb8bf['limit'])_0x2ba3bf['limit'](_0x1eb8bf[_0x8a8a('0x29')]);if(_0x1eb8bf[_0x8a8a('0x2a')])_0x2ba3bf[_0x8a8a('0x2a')](_0x1eb8bf[_0x8a8a('0x2a')]);return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x2ba3bf[_0x8a8a('0xb2')](),_0x49aa1b);})[_0x8a8a('0x19')](function(_0x3afd87){if(_0x3afd87['length']>0x0)_0x329bfb[_0x8a8a('0x56')](_0x8a8a('0xb3'),_[_0x8a8a('0x36')](_0x3afd87,'id'));return db[_0x8a8a('0x9e')][_0x8a8a('0x4c')](_0x329bfb[_0x8a8a('0xb2')](),_0x49aa1b)['then'](function(_0x563e90){var _0x5b3092=_[_0x8a8a('0xb4')](_0x563e90,'ChatInteractionId');var _0x2fab56=[];_0x3afd87['forEach'](function(_0x227dde){_0x2fab56['push'](updateChatInteraction(_0x227dde,_0xa2b8a1,_0x5b3092));});return BPromise[_0x8a8a('0xb5')](_0x2fab56);});});})[_0x8a8a('0x19')](function(_0x5e8094){_0x5c6c98[_0x8a8a('0xb6')]=_0x5e8094;return _0x5c6c98;})['then'](respondWithFilteredResult(_0x44aed3,_0x1eb8bf))['catch'](handleError(_0x44aed3,null));};exports[_0x8a8a('0xb7')]=function(_0x4a1658,_0x32fa90){var _0x4d6119={'raw':![],'where':{'id':_0x4a1658['params']['id']}},_0x17f681={};_0x17f681[_0x8a8a('0x49')]=_[_0x8a8a('0x4b')](db[_0x8a8a('0x44')][_0x8a8a('0x45')]);_0x17f681['query']=_[_0x8a8a('0x4b')](_0x4a1658[_0x8a8a('0x4c')]);_0x17f681[_0x8a8a('0x4d')]=_[_0x8a8a('0x4e')](_0x17f681['model'],_0x17f681[_0x8a8a('0x4c')]);_0x4d6119[_0x8a8a('0x50')]=_[_0x8a8a('0x4e')](_0x17f681['model'],qs[_0x8a8a('0x4f')](_0x4a1658[_0x8a8a('0x4c')][_0x8a8a('0x4f')]));_0x4d6119[_0x8a8a('0x50')]=_0x4d6119[_0x8a8a('0x50')]['length']?_0x4d6119['attributes']:_0x17f681[_0x8a8a('0x49')];if(_0x4a1658[_0x8a8a('0x4c')][_0x8a8a('0xb8')]){_0x4d6119['include']=[{'all':!![]}];}_0x4d6119=_[_0x8a8a('0x2f')]({},_0x4d6119,_0x4a1658[_0x8a8a('0xb9')]);return db['ChatInteraction']['find'](_0x4d6119)[_0x8a8a('0x19')](handleEntityNotFound(_0x32fa90,null))[_0x8a8a('0x19')](respondWithResult(_0x32fa90,null))[_0x8a8a('0x23')](handleError(_0x32fa90,null));};exports['create']=function(_0x32921f,_0x2f3aa6){return db['ChatInteraction'][_0x8a8a('0xba')](_0x32921f[_0x8a8a('0x30')],{})['then'](respondWithResult(_0x2f3aa6,0xc9))[_0x8a8a('0x23')](handleError(_0x2f3aa6,null));};exports['update']=function(_0x1e35ac,_0x16a4a8){if(_0x1e35ac['body']['id']){delete _0x1e35ac[_0x8a8a('0x30')]['id'];}return db[_0x8a8a('0x44')]['find']({'where':{'id':_0x1e35ac[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x16a4a8,null))[_0x8a8a('0x19')](saveUpdates(_0x1e35ac[_0x8a8a('0x30')],null))['then'](respondWithResult(_0x16a4a8,null))[_0x8a8a('0x23')](handleError(_0x16a4a8,null));};exports[_0x8a8a('0xbc')]=function(_0x33935b,_0x52ffa0){return db[_0x8a8a('0x44')]['find']({'where':{'id':_0x33935b[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](handleEntityNotFound(_0x52ffa0,null))[_0x8a8a('0x19')](removeEntity(_0x52ffa0,null))[_0x8a8a('0x23')](handleError(_0x52ffa0,null));};exports[_0x8a8a('0xbd')]=function(_0x54ad37,_0x19d4f6){return db[_0x8a8a('0x44')]['describe']()[_0x8a8a('0x19')](respondWithResult(_0x19d4f6,null))[_0x8a8a('0x23')](handleError(_0x19d4f6,null));};exports[_0x8a8a('0xbe')]=function(_0x5b22b6,_0x586dbd){var _0x35d9e2=_0x5b22b6[_0x8a8a('0xbb')]['id'];var _0x279002;var _0x7504b2;var _0x461430;return db[_0x8a8a('0x44')][_0x8a8a('0xbf')]({'where':{'id':_0x35d9e2}})['then'](function(_0x496f08){_0x279002=_0x496f08;return db['ChatWebsite'][_0x8a8a('0xbf')]({'where':{'id':_0x496f08[_0x8a8a('0x81')]},'attributes':['id',_0x8a8a('0xc0'),'vidaooEscalation',_0x8a8a('0xc1'),_0x8a8a('0xc2'),_0x8a8a('0xc3')],'raw':!![]});})[_0x8a8a('0x19')](function(_0x3154ee){if(_0x3154ee&&_0x3154ee['vidaooApiKey']&&_0x3154ee[_0x8a8a('0xc4')]){_0x7504b2=_0x3154ee;var _0xde7f73={'interaction':{'id':_0x35d9e2},'agent':{'id':_0x5b22b6[_0x8a8a('0x9a')]['id'],'name':_0x5b22b6['user'][_0x8a8a('0x4a')],'fullname':_0x5b22b6[_0x8a8a('0x9a')][_0x8a8a('0x37')],'email':_0x5b22b6['user']['email']},'contact':_0x5b22b6[_0x8a8a('0x30')][_0x8a8a('0x31')],'account':_0x5b22b6[_0x8a8a('0x30')]['account']};var _0x2fed73={'rejectUnauthorized':![],'method':_0x8a8a('0xc5'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3154ee[_0x8a8a('0xc0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5b22b6[_0x8a8a('0x9a')]['email']],'buttons':null,'topic':_0x7504b2[_0x8a8a('0xc1')],'note':_['isNull'](_0x7504b2['vidaooNote'])?null:getMustacheRender(_0x7504b2[_0x8a8a('0xc2')],_0xde7f73),'metadata':null},'redirect':_0x8a8a('0xc6'),'json':!![]};try{if(!_['isNull'](_0x7504b2['vidaooMetadata'])){var _0x591ca2=getMustacheRender(_0x7504b2[_0x8a8a('0xc3')],_0xde7f73);var _0x55bec7=JSON['parse'](_0x591ca2);_0x2fed73[_0x8a8a('0x30')][_0x8a8a('0xc7')]=_0x55bec7;}}catch(_0x58ac24){throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))](_0x8a8a('0xca'));}return rp(_0x2fed73);}else{throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x8a8a('0x19')](function(_0x4930ad){_0x461430=_0x4930ad;if(_0x461430['id']){var _0x3ae28a={'body':_0x461430[_0x8a8a('0xcb')],'ChatWebsiteId':_0x7504b2['id'],'ChatInteractionId':_0x279002['id'],'direction':_0x8a8a('0xcc'),'UserId':_0x5b22b6[_0x8a8a('0x9a')]['id']};return db['ChatMessage']['create'](_0x3ae28a,{});}else{throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x8a8a('0x19')](function(){return _0x279002[_0x8a8a('0xcd')]({'vidaooSessionId':_0x461430['id']});})['then'](respondWithResult(_0x586dbd,null))[_0x8a8a('0x23')](handleError(_0x586dbd,null));};exports[_0x8a8a('0xce')]=function(_0x14cd8d,_0x4be66d){if(_0x14cd8d['body']['id']){delete _0x14cd8d[_0x8a8a('0x30')]['id'];}return db['ChatInteraction'][_0x8a8a('0x6a')]({'where':{'id':_0x14cd8d['params']['id']},'include':[{'model':db[_0x8a8a('0xcf')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x4be66d,null))['then'](saveUpdates(_0x14cd8d['body'],null))[_0x8a8a('0x19')](respondWithResult(_0x4be66d,null))[_0x8a8a('0x23')](handleError(_0x4be66d,null));};exports[_0x8a8a('0xd0')]=function(_0x5d955f,_0x32eb6b){if(_0x5d955f[_0x8a8a('0x30')]['id']){delete _0x5d955f[_0x8a8a('0x30')]['id'];}return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0x5d955f[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](function(_0x586686){if(!_0x586686){logger['error'](_0x8a8a('0xd1'),_0x8a8a('0xd0'),0x194,_0x8a8a('0xd2'));_0x32eb6b['sendStatus'](0x194);}else{if(_0x586686[_0x8a8a('0x43')]){throw new db[(_0x8a8a('0xc8'))][(_0x8a8a('0xc9'))](_0x8a8a('0xd3'));}}return _0x586686;})['then'](function(_0x5023d7){if(_0x5023d7){return _0x5023d7[_0x8a8a('0x2c')]({'closed':_0x5d955f[_0x8a8a('0x30')][_0x8a8a('0x40')],'disposition':_0x5d955f[_0x8a8a('0x30')][_0x8a8a('0x42')]})[_0x8a8a('0x19')](function(_0x40a76d){return _0x40a76d;});}})[_0x8a8a('0x19')](function(){return respondWithRpcPromise(_0x8a8a('0xd4'),_0x8a8a('0xd0'),_0x5d955f[_0x8a8a('0x30')],client9004);})['then'](respondWithResult(_0x32eb6b,null))[_0x8a8a('0x23')](handleError(_0x32eb6b,null));};exports[_0x8a8a('0xd5')]=function(_0xe30557,_0x37815b){_0xe30557[_0x8a8a('0x30')][_0x8a8a('0x4a')]=_0xe30557[_0x8a8a('0xd6')][_0x8a8a('0xd7')];_0xe30557[_0x8a8a('0x30')][_0x8a8a('0xd8')]=_0xe30557[_0x8a8a('0xd6')]['filename'];_0xe30557[_0x8a8a('0x30')][_0x8a8a('0x47')]=_0xe30557[_0x8a8a('0xd6')][_0x8a8a('0xd9')];return db['Attachment'][_0x8a8a('0xba')](_0xe30557[_0x8a8a('0x30')])[_0x8a8a('0x19')](respondWithResult(_0x37815b,0xc9))[_0x8a8a('0x23')](handleError(_0x37815b,null));};exports[_0x8a8a('0xda')]=function(_0x419998,_0x59ed64){return db[_0x8a8a('0x44')][_0x8a8a('0xbf')]({'where':{'id':_0x419998[_0x8a8a('0xbb')]['id']},'raw':!![]})[_0x8a8a('0x19')](handleEntityNotFound(_0x59ed64,null))[_0x8a8a('0x19')](function(_0x17e607){if(_0x17e607){if(_0x17e607[_0x8a8a('0x40')]){return _0x59ed64[_0x8a8a('0x25')](0x193)['json']({'status':0x193,'message':_0x8a8a('0xdb')});}return db[_0x8a8a('0xdc')][_0x8a8a('0xbf')]({'where':{'id':_0x419998[_0x8a8a('0x4c')][_0x8a8a('0xdd')]},'raw':!![]})[_0x8a8a('0x19')](handleEntityNotFound(_0x59ed64,null));}})[_0x8a8a('0x19')](function(_0xc79caa){if(_0xc79caa){var _0x3a2fa1=_0xc79caa['ChatOfflineMessageId']!==null;var _0x6f8834=path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],_0x8a8a('0xe0'));if(_0x3a2fa1){_0x6f8834=path[_0x8a8a('0xde')](_0x6f8834,'offline-chat/');}var _0xa5a1bc=path[_0x8a8a('0xde')](_0x6f8834,_0xc79caa[_0x8a8a('0xd8')]);return _0x59ed64[_0x8a8a('0xe1')](_0xa5a1bc);}})[_0x8a8a('0x23')](handleError(_0x59ed64,null));};exports['close']=function(_0x4dbb00,_0x57c44c){var _0x2b8cf5=null;var _0x3074a2=null;var _0x24a0e0=null;if(_0x4dbb00[_0x8a8a('0x30')]['id']){delete _0x4dbb00[_0x8a8a('0x30')]['id'];}if(_0x4dbb00[_0x8a8a('0x30')]['mailTranscript']){_0x24a0e0=path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],_0x8a8a('0xe2'),util['format'](_0x8a8a('0xe3'),Date[_0x8a8a('0xe4')]()));_0x4dbb00[_0x8a8a('0x30')]['pathTranscript']=_0x24a0e0;}return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0x4dbb00['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x8a8a('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x57c44c,null))[_0x8a8a('0x19')](saveUpdates(_0x4dbb00[_0x8a8a('0x30')],null))[_0x8a8a('0x19')](function(_0x20bc23){if(_0x20bc23){_0x2b8cf5=_0x20bc23;return db['ChatWebsite'][_0x8a8a('0x6a')]({'where':{'id':_0x2b8cf5['ChatWebsiteId']}});}})[_0x8a8a('0x19')](function(_0x419eef){if(_0x419eef){_0x3074a2=_0x419eef;return db['CmContact'][_0x8a8a('0x6a')]({'where':{'id':_0x2b8cf5[_0x8a8a('0x75')]}});}})['then'](function(_0x3b3c55){if(_0x3b3c55){if(_0x24a0e0){var _0x14cc59=null;for(var _0x5e9e59=0x1;_0x5e9e59<_0x2b8cf5[_0x8a8a('0xe5')][_0x8a8a('0x51')];++_0x5e9e59){_0x14cc59=_0x2b8cf5[_0x8a8a('0xe5')][_0x5e9e59];var _0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?util['format']('%s%d',_0x3074a2[_0x8a8a('0xe6')],_0x14cc59[_0x8a8a('0x43')]):'System';var _0x25a514=_0x4dbb00[_0x8a8a('0x30')][_0x8a8a('0xe7')]||util[_0x8a8a('0xe8')](_0x8a8a('0xe9'),_0x8a8a('0xea'),_0x14cc59[_0x8a8a('0x75')]);switch(_0x3074a2[_0x8a8a('0xeb')]){case _0x8a8a('0xec'):_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?util[_0x8a8a('0xe8')](_0x8a8a('0xe9'),_0x3074a2[_0x8a8a('0xe6')],_0x14cc59['UserId']):_0x8a8a('0xed');break;case _0x8a8a('0xee'):_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?_0x14cc59['User'][_0x8a8a('0xef')]||_0x14cc59[_0x8a8a('0x7b')][_0x8a8a('0x37')]:_0x8a8a('0xed');break;case _0x8a8a('0xf0'):_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?_0x14cc59[_0x8a8a('0x7b')][_0x8a8a('0x37')]:_0x8a8a('0xed');break;default:_0x5ac2e2=_0x14cc59[_0x8a8a('0x43')]?util[_0x8a8a('0xe8')]('%s%d',_0x3074a2[_0x8a8a('0xe6')],_0x14cc59[_0x8a8a('0x43')]):_0x8a8a('0xed');}var _0x22d259=util[_0x8a8a('0xe8')](_0x8a8a('0xf1'),moment(_0x14cc59[_0x8a8a('0x84')])['format'](_0x8a8a('0xf2')),_0x14cc59[_0x8a8a('0xf3')]==='in'?_0x25a514:_0x5ac2e2,_0x14cc59['body']);if(!_0x14cc59[_0x8a8a('0xf4')]){fs['appendFileSync'](_0x24a0e0,_0x22d259);}}return db[_0x8a8a('0xf5')][_0x8a8a('0xbf')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8a8a('0xf6'),'raw':!![],'include':[{'model':db[_0x8a8a('0xf7')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x8a8a('0x19')](function(_0x7e29e1){if(!_0x7e29e1||!_0x7e29e1['Smtp']||!_0x4dbb00[_0x8a8a('0x30')])return _0x2b8cf5;var _0x4b106f=_0x7e29e1[_0x8a8a('0xf8')]();return respondWithRpcPromise(_0x8a8a('0xf9'),_0x8a8a('0xfa'),{'account':_0x4b106f,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x7e29e1[_0x8a8a('0x4a')],_0x7e29e1['email']||_0x7e29e1[_0x8a8a('0xf6')]['user']),'to':_0x4dbb00['body'][_0x8a8a('0xfb')],'subject':'Mail\x20Transcript','text':util['format'](_0x8a8a('0xfc'),_0x4dbb00[_0x8a8a('0x30')][_0x8a8a('0xfb')]),'attachments':[{'path':_0x24a0e0}]}})[_0x8a8a('0x19')](function(){return _0x2b8cf5;})[_0x8a8a('0x23')](function(_0x4cb1da){logger[_0x8a8a('0x1f')](_0x4cb1da);});})[_0x8a8a('0x19')](respondWithStatusCode(_0x57c44c,0xc8))[_0x8a8a('0x23')](handleError(_0x57c44c,null));};exports['addMessage']=function(_0x3e63d4,_0x5de5ae){return db['ChatMessage']['find']({'where':{'id':_0x3e63d4[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x5de5ae,null))['then'](function(_0x484cc6){if(_0x484cc6){return _0x484cc6[_0x8a8a('0xfd')](_0x3e63d4[_0x8a8a('0x30')][_0x8a8a('0xfe')],_[_0x8a8a('0xff')](_0x3e63d4['body'],[_0x8a8a('0xfe'),'id'])||{});}})[_0x8a8a('0x19')](respondWithResult(_0x5de5ae,null))[_0x8a8a('0x23')](handleError(_0x5de5ae,null));};exports['getMessages']=function(_0x186c2c,_0x55148e){var _0x50315b={'raw':![],'where':{}};var _0x40c9cb={};var _0x2b4119={'count':0x0,'rows':[]};return db[_0x8a8a('0x44')][_0x8a8a('0xbf')]({'where':{'id':_0x186c2c[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x55148e,null))[_0x8a8a('0x19')](function(_0x33e008){if(_0x33e008){_0x40c9cb[_0x8a8a('0x49')]=_[_0x8a8a('0x4b')](db[_0x8a8a('0x100')][_0x8a8a('0x45')]);_0x40c9cb[_0x8a8a('0x4c')]=_[_0x8a8a('0x4b')](_0x186c2c[_0x8a8a('0x4c')]);_0x40c9cb['filters']=_[_0x8a8a('0x4e')](_0x40c9cb['model'],_0x40c9cb[_0x8a8a('0x4c')]);_0x50315b[_0x8a8a('0x50')]=_['intersection'](_0x40c9cb['model'],qs[_0x8a8a('0x4f')](_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x4f')]));_0x50315b[_0x8a8a('0x50')]=_0x50315b[_0x8a8a('0x50')][_0x8a8a('0x51')]?_0x50315b[_0x8a8a('0x50')]:_0x40c9cb[_0x8a8a('0x49')];if(!_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x52')](_0x8a8a('0x53'))){_0x50315b[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x186c2c['query'][_0x8a8a('0x29')]);_0x50315b[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x2a')]);}_0x50315b[_0x8a8a('0x54')]=qs[_0x8a8a('0x55')](_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x55')]);_0x50315b[_0x8a8a('0x56')]=qs[_0x8a8a('0x4d')](_[_0x8a8a('0x57')](_0x186c2c[_0x8a8a('0x4c')],_0x40c9cb[_0x8a8a('0x4d')]));_0x50315b[_0x8a8a('0x56')][_0x8a8a('0x101')]=_0x33e008['id'];if(_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x91')]){_0x50315b[_0x8a8a('0x56')]=_[_0x8a8a('0x2f')](_0x50315b[_0x8a8a('0x56')],{'$or':_[_0x8a8a('0x36')](_0x50315b[_0x8a8a('0x50')],function(_0x433051){var _0x3f064c={};_0x3f064c[_0x433051]={'$like':'%'+_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x91')]+'%'};return _0x3f064c;})});}if(_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0x86')]){var _0x36baf8=_0x186c2c[_0x8a8a('0x4c')]['$gte']['split'](',');var _0x1af0b6={};_0x1af0b6[_0x36baf8[0x0]]={'$gte':moment(_0x36baf8[0x1])['format'](_0x8a8a('0x102'))};_0x50315b[_0x8a8a('0x56')]=_[_0x8a8a('0x2f')](_0x50315b[_0x8a8a('0x56')],_0x1af0b6);}_0x50315b=_['merge']({},_0x50315b,_0x186c2c[_0x8a8a('0xb9')]);return db[_0x8a8a('0x100')][_0x8a8a('0x9f')]({'where':_0x50315b[_0x8a8a('0x56')]})[_0x8a8a('0x19')](function(_0x204dde){_0x2b4119[_0x8a8a('0x9f')]=_0x204dde;if(_0x186c2c[_0x8a8a('0x4c')][_0x8a8a('0xb8')]){_0x50315b[_0x8a8a('0x103')]=[{'all':!![]}];}return db[_0x8a8a('0x100')]['findAll'](_0x50315b);})[_0x8a8a('0x19')](function(_0x25b624){_0x2b4119[_0x8a8a('0xb6')]=_0x25b624;return _0x2b4119;});}})[_0x8a8a('0x19')](respondWithFilteredResult(_0x55148e,_0x50315b))[_0x8a8a('0x23')](handleError(_0x55148e,null));};exports[_0x8a8a('0x104')]=function(_0x413ab7,_0x32cc2a){var _0x1e8490={'where':{}},_0x159761={},_0xe16caf={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8a8a('0xbf')]({'where':{'id':_0x413ab7[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](handleEntityNotFound(_0x32cc2a,null))[_0x8a8a('0x19')](function(_0x2847bd){if(_0x2847bd){_0x159761['model']=_['keys'](db[_0x8a8a('0x100')][_0x8a8a('0x45')]);_0x159761[_0x8a8a('0x4c')]=_[_0x8a8a('0x4b')](_0x413ab7[_0x8a8a('0x4c')]);_0x159761['filters']=_[_0x8a8a('0x4e')](_0x159761[_0x8a8a('0x49')],_0x159761[_0x8a8a('0x4c')]);_0x1e8490[_0x8a8a('0x50')]=_[_0x8a8a('0x4e')](_0x159761[_0x8a8a('0x49')],qs[_0x8a8a('0x4f')](_0x413ab7['query'][_0x8a8a('0x4f')]));_0x1e8490[_0x8a8a('0x50')]=_0x1e8490[_0x8a8a('0x50')][_0x8a8a('0x51')]?_0x1e8490[_0x8a8a('0x50')]:_0x159761[_0x8a8a('0x49')];if(!_0x413ab7[_0x8a8a('0x4c')][_0x8a8a('0x52')](_0x8a8a('0x53'))){_0x1e8490[_0x8a8a('0x29')]=qs[_0x8a8a('0x29')](_0x413ab7['query'][_0x8a8a('0x29')]);_0x1e8490[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x413ab7[_0x8a8a('0x4c')][_0x8a8a('0x2a')]);}_0x1e8490['order']=qs['sort'](_0x413ab7[_0x8a8a('0x4c')][_0x8a8a('0x55')]);_0x1e8490['where']=qs[_0x8a8a('0x4d')](_[_0x8a8a('0x57')](_0x413ab7['query'],_0x159761[_0x8a8a('0x4d')]));_0x1e8490[_0x8a8a('0x56')][_0x8a8a('0x101')]=_0x2847bd['id'];if(_0x413ab7[_0x8a8a('0x4c')]['filter']){_0x1e8490[_0x8a8a('0x56')]=_[_0x8a8a('0x2f')](_0x1e8490[_0x8a8a('0x56')],{'$or':_[_0x8a8a('0x36')](_0x1e8490['attributes'],function(_0x453a30){var _0x34ac37={};_0x34ac37[_0x453a30]={'$like':'%'+_0x413ab7['query'][_0x8a8a('0x91')]+'%'};return _0x34ac37;})});}_0x1e8490[_0x8a8a('0x56')][_0x8a8a('0xf4')]=![];if(_0x413ab7[_0x8a8a('0x4c')]['id']){_0x1e8490[_0x8a8a('0x56')]['id']={'$gt':_0x413ab7[_0x8a8a('0x4c')]['id']};}_0x1e8490=_[_0x8a8a('0x2f')]({},_0x1e8490,_0x413ab7[_0x8a8a('0xb9')]);return db[_0x8a8a('0x100')][_0x8a8a('0x9f')]({'where':_0x1e8490[_0x8a8a('0x56')]})[_0x8a8a('0x19')](function(_0x50536f){_0xe16caf[_0x8a8a('0x9f')]=_0x50536f;_0x1e8490['include']=[];if(_0x413ab7[_0x8a8a('0x4c')]['includeAgent']){_0x1e8490[_0x8a8a('0x103')][_0x8a8a('0x3a')]({'model':db[_0x8a8a('0x7b')],'as':_0x8a8a('0x7b'),'attributes':['id','fullname',_0x8a8a('0xef')]});}if(_0x413ab7['query'][_0x8a8a('0xb8')]){_0x1e8490[_0x8a8a('0x103')]=[{'all':!![]}];}return db[_0x8a8a('0x100')][_0x8a8a('0x105')](_0x1e8490);})[_0x8a8a('0x19')](function(_0x1a7bff){_0xe16caf[_0x8a8a('0xb6')]=_0x1a7bff;return _0xe16caf;});}})[_0x8a8a('0x19')](respondWithFilteredResult(_0x32cc2a,_0x1e8490))['catch'](handleError(_0x32cc2a,null));};exports['addTags']=function(_0x2deb61,_0x268a78){return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0x2deb61[_0x8a8a('0xbb')]['id']}})[_0x8a8a('0x19')](handleEntityNotFound(_0x268a78,null))[_0x8a8a('0x19')](function(_0x6812b2){if(_0x6812b2){return _0x6812b2[_0x8a8a('0x106')](_0x2deb61[_0x8a8a('0x30')]['ids'],_['omit'](_0x2deb61[_0x8a8a('0x30')],[_0x8a8a('0xfe'),'id'])||{})['spread'](function(){return db[_0x8a8a('0x78')][_0x8a8a('0x105')]({'attributes':['id',_0x8a8a('0x4a'),'color'],'where':{'id':_0x2deb61[_0x8a8a('0x30')][_0x8a8a('0xfe')]}});})[_0x8a8a('0x19')](function(_0x5a88c4){socket['emit'](_0x8a8a('0x107'),{'id':Number(_0x2deb61[_0x8a8a('0xbb')]['id']),'tags':_0x5a88c4||[]});return{'id':Number(_0x2deb61[_0x8a8a('0xbb')]['id']),'tags':_0x5a88c4||[]};});}})[_0x8a8a('0x19')](respondWithResult(_0x268a78,null))[_0x8a8a('0x23')](handleError(_0x268a78,null));};exports[_0x8a8a('0x108')]=function(_0x17c85c,_0x49b219){return db['ChatInteraction'][_0x8a8a('0x6a')]({'where':{'id':_0x17c85c[_0x8a8a('0xbb')]['id']}})['then'](handleEntityNotFound(_0x49b219,null))[_0x8a8a('0x19')](function(_0x5a177b){if(_0x5a177b){return _0x5a177b['removeTags'](_0x17c85c['query'][_0x8a8a('0xfe')]);}})[_0x8a8a('0x19')](respondWithStatusCode(_0x49b219,null))[_0x8a8a('0x23')](handleError(_0x49b219,null));};exports[_0x8a8a('0xe1')]=function(_0xcfd82f,_0x3a49c0){var _0x52328d=moment()['unix']()['toString']();var _0x192040=path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],'server','files','tmp');var _0x3ce207=path['join'](config[_0x8a8a('0xdf')],_0x8a8a('0x109'),'files',_0x8a8a('0x10a'));var _0x52c858=path['join'](_0x192040,_0x52328d);var _0x19c612=util[_0x8a8a('0xe8')](_0x8a8a('0x10b'),_0xcfd82f['params']['id'],_0x52328d);var _0x29e6d0=path[_0x8a8a('0xde')](_0x192040,_0x19c612);var _0x517c95=[];_0x517c95[_0x8a8a('0x3a')]({'model':db[_0x8a8a('0x7b')],'as':_0x8a8a('0x7b'),'attributes':['id',_0x8a8a('0x37')],'raw':!![]});_0x517c95[_0x8a8a('0x3a')]({'model':db[_0x8a8a('0xcf')],'as':'Contact','attributes':['id',_0x8a8a('0x10c'),_0x8a8a('0x10d')],'raw':!![]});if(_0xcfd82f[_0x8a8a('0x4c')][_0x8a8a('0x10a')]){_0x517c95[_0x8a8a('0x3a')]({'model':db['Attachment'],'as':_0x8a8a('0xdc'),'raw':!![]});}var _0x55737e=[{'model':db[_0x8a8a('0x100')],'as':_0x8a8a('0xe5'),'attributes':['id',_0x8a8a('0x30'),_0x8a8a('0x84'),_0x8a8a('0xf3'),_0x8a8a('0xf4'),'read'],'include':_0x517c95}];_0x55737e['push']({'model':db[_0x8a8a('0x10e')],'as':_0x8a8a('0x10f'),'attributes':['id',_0x8a8a('0x4a')]});_0x55737e[_0x8a8a('0x3a')]({'model':db[_0x8a8a('0x7b')],'as':_0x8a8a('0x110'),'attributes':['id',_0x8a8a('0x37')]});return db[_0x8a8a('0x44')][_0x8a8a('0x6a')]({'where':{'id':_0xcfd82f[_0x8a8a('0xbb')]['id']},'include':_0x55737e})[_0x8a8a('0x19')](handleEntityNotFound(_0x3a49c0,null))[_0x8a8a('0x19')](function(_0x49525c){if(_0x49525c){var _0x2f5897=_0x49525c['get']({'plain':!![]});fs[_0x8a8a('0x111')](_0x52c858);var _0x1d7a76={'channel':_0x8a8a('0x112'),'account':_0x2f5897[_0x8a8a('0x10f')][_0x8a8a('0x4a')],'agent':_0x2f5897[_0x8a8a('0x110')]?_0x2f5897[_0x8a8a('0x110')]['fullname']:_0x8a8a('0x113'),'createdAt':moment(_0x2f5897['createdAt'])[_0x8a8a('0xe8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8a8a('0xb2')](),'closedAt':_0x2f5897[_0x8a8a('0x40')]?moment(_0x2f5897[_0x8a8a('0x114')])[_0x8a8a('0xe8')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2f5897[_0x8a8a('0x42')],'chatInfo':{'browser':_0x2f5897[_0x8a8a('0x115')],'os':_0x2f5897['osName'],'referer':_0x2f5897[_0x8a8a('0x116')],'customerIp':_0x2f5897['customerIp'],'customerPort':_0x2f5897['customerPort']?_0x2f5897[_0x8a8a('0x117')]:_0x8a8a('0x113')},'messages':_(_0x2f5897[_0x8a8a('0xe5')])['tail']()[_0x8a8a('0x91')]({'secret':![]})[_0x8a8a('0x36')](function(_0x2e34e6){if(_0x2e34e6['Attachment']){var _0x1be060=path[_0x8a8a('0xde')](_0x3ce207,_0x2e34e6['Attachment']['basename']);if(fs[_0x8a8a('0x118')](_0x1be060)){fs[_0x8a8a('0x119')](_0x1be060)[_0x8a8a('0x11a')](fs[_0x8a8a('0x11b')](path[_0x8a8a('0xde')](_0x52c858,_0x2e34e6['Attachment'][_0x8a8a('0xd8')])));}}return{'date':moment(_0x2e34e6['createdAt'])['format'](_0x8a8a('0x102'))[_0x8a8a('0xb2')](),'sender':_0x2e34e6[_0x8a8a('0xf3')]===_0x8a8a('0xcc')?_0x2e34e6[_0x8a8a('0x7b')]?_0x2e34e6[_0x8a8a('0x7b')]['fullname']:_0x8a8a('0xed'):_0x2e34e6[_0x8a8a('0x6e')][_0x8a8a('0x10c')]+(_0x2e34e6[_0x8a8a('0x6e')][_0x8a8a('0x10d')]?'\x20'+_0x2e34e6['Contact'][_0x8a8a('0x10d')]:''),'body':_0x2e34e6['Attachment']?_0x2e34e6[_0x8a8a('0xdc')]['basename']:_0x2e34e6['body'],'direction':_0x2e34e6[_0x8a8a('0xf3')]===_0x8a8a('0xcc')?'A':'C','secret':_0x2e34e6[_0x8a8a('0xf4')],'read':_0x2e34e6['read'],'attachment':_0x2e34e6[_0x8a8a('0xdc')]};})['value']()};return ejs[_0x8a8a('0x11c')](path[_0x8a8a('0xde')](config[_0x8a8a('0xdf')],_0x8a8a('0x109'),_0x8a8a('0x11d'),_0x8a8a('0x11e')),{'interaction':_0x1d7a76})[_0x8a8a('0x19')](function(_0x44dd5c){var _0x3d5bf0=path[_0x8a8a('0xde')](_0x52c858,_0x8a8a('0x11f')+_0x2f5897['id']+'-'+_0x52328d+'.pdf');var _0x5bfe3b={'path':_0x3d5bf0,'channel':_0x8a8a('0x112'),'interactionId':_0x2f5897['id']};return pdf[_0x8a8a('0x120')](_0x44dd5c,_0x5bfe3b);})[_0x8a8a('0x19')](function(){return new Promise(function(_0x50b445,_0x5738e4){zipdir(_0x52c858,{'saveTo':_0x29e6d0},function(_0x1b602b,_0xccfb49){if(_0x1b602b)return _0x5738e4(_0x1b602b);return _0x50b445(_0xccfb49);});})['then'](function(){return new BPromise(function(_0x4bb67b,_0x839b37){rimraf(_0x52c858,function(_0xb08e40){if(_0xb08e40)_0x839b37(_0xb08e40);return _0x4bb67b();});});})['then'](function(){return _0x3a49c0['download'](_0x29e6d0,_0x19c612,function(_0x19d186){if(_0x19d186){logger['error'](_0x8a8a('0x121'),_0x19d186);}else{fs['unlinkSync'](_0x29e6d0);}});});});}else{return _0x3a49c0[_0x8a8a('0x24')](0xc8);}})['catch'](handleError(_0x3a49c0,null));};
\ No newline at end of file
+var _0x9c44=['join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','findAll','options','addTags','spread','emit','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','sendStatus','request-promise','moment','bluebird','mustache','util','path','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','update','name','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','compact','isEmpty','ChatWebsiteId','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','Account.key','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','contactName','i.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','create','ValidationError','updateAttributes','abandon','AbandonInteraction','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x49c4('0x0'));var moment=require(_0x49c4('0x1'));var BPromise=require(_0x49c4('0x2'));var Mustache=require(_0x49c4('0x3'));var util=require(_0x49c4('0x4'));var path=require(_0x49c4('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x49c4('0x6'));var Redis=require('ioredis');var qs=require(_0x49c4('0x7'));var as=require(_0x49c4('0x8'));var pdf=require(_0x49c4('0x9'));var logger=require(_0x49c4('0xa'))(_0x49c4('0xb'));var config=require('../../config/environment');var db=require(_0x49c4('0xc'))['db'];config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config[_0x49c4('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49c4('0xd')]));require(_0x49c4('0xf'))['register'](socket);var jayson=require(_0x49c4('0x10'));var client=jayson[_0x49c4('0x11')]['http']({'port':0x232b});var client9004=jayson['client'][_0x49c4('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x6d1b08,_0x5487cd,_0x7df3a9,_0x403bfb){return new BPromise(function(_0x5f2fd9,_0x1909fe){var _0x280996=_0x403bfb||client;return _0x280996[_0x49c4('0x13')](_0x6d1b08,_0x7df3a9)[_0x49c4('0x14')](function(_0x12777c){logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));logger['debug'](_0x49c4('0x18'),_0x5487cd,_0x49c4('0x17'),JSON[_0x49c4('0x19')](_0x12777c));if(_0x12777c[_0x49c4('0x1a')]){if(_0x12777c[_0x49c4('0x1a')]['code']===0x1f4){logger[_0x49c4('0x1a')](_0x49c4('0x16'),_0x5487cd,_0x12777c['error']['message']);return _0x1909fe(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}logger[_0x49c4('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x12777c[_0x49c4('0x1a')]['message']);return _0x5f2fd9(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}else{logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));_0x5f2fd9(_0x12777c[_0x49c4('0x1c')][_0x49c4('0x1b')]);}})[_0x49c4('0x1d')](function(_0x2197d2){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x2197d2);_0x1909fe(_0x2197d2);});});}function respondWithStatusCode(_0x57f502,_0x1c99b1){_0x1c99b1=_0x1c99b1||0xcc;return function(_0x4f0b62){if(_0x4f0b62){return _0x57f502['sendStatus'](_0x1c99b1);}return _0x57f502[_0x49c4('0x1e')](_0x1c99b1)[_0x49c4('0x1f')]();};}function respondWithResult(_0x26c640,_0xd335e4){_0xd335e4=_0xd335e4||0xc8;return function(_0x4811c4){if(_0x4811c4){return _0x26c640['status'](_0xd335e4)[_0x49c4('0x20')](_0x4811c4);}};}function respondWithFilteredResult(_0x9cb797,_0x565423){return function(_0x207358){if(_0x207358){var _0x43e014=typeof _0x565423[_0x49c4('0x21')]===_0x49c4('0x22')&&typeof _0x565423['limit']==='undefined';var _0x449960=_0x207358['count'];var _0x3800b7=_0x43e014?0x0:_0x565423[_0x49c4('0x21')];var _0x3f1708=_0x43e014?_0x207358[_0x49c4('0x23')]:_0x565423['offset']+_0x565423[_0x49c4('0x24')];var _0x2b2793;if(_0x3f1708>=_0x449960){_0x3f1708=_0x449960;_0x2b2793=0xc8;}else{_0x2b2793=0xce;}_0x9cb797[_0x49c4('0x1e')](_0x2b2793);return _0x9cb797[_0x49c4('0x25')](_0x49c4('0x26'),_0x3800b7+'-'+_0x3f1708+'/'+_0x449960)[_0x49c4('0x20')](_0x207358);}return null;};}function saveUpdates(_0x26ba17){return function(_0x427b26){if(_0x427b26){return _0x427b26[_0x49c4('0x27')](_0x26ba17)[_0x49c4('0x14')](function(_0x46f7ea){return _0x46f7ea;});}return null;};}function removeEntity(_0x4ea6ea){return function(_0x4f4495){if(_0x4f4495){return _0x4f4495['destroy']()[_0x49c4('0x14')](function(){_0x4ea6ea[_0x49c4('0x1e')](0xcc)[_0x49c4('0x1f')]();});}};}function handleEntityNotFound(_0x27e467){return function(_0x28eb47){if(!_0x28eb47){_0x27e467['sendStatus'](0x194);}return _0x28eb47;};}function handleError(_0x38ad77,_0x116eb4){_0x116eb4=_0x116eb4||0x1f4;return function(_0x2e7a69){logger[_0x49c4('0x1a')](_0x2e7a69['stack']);if(_0x2e7a69['name']){delete _0x2e7a69[_0x49c4('0x28')];}_0x38ad77[_0x49c4('0x1e')](_0x116eb4)[_0x49c4('0x29')](_0x2e7a69);};}function getMustacheRender(_0x13b3b4,_0xd38540){return Mustache['render'](_0x13b3b4,_[_0x49c4('0x2a')](_0xd38540[_0x49c4('0x2b')],{'contact':_0xd38540[_0x49c4('0x2c')],'message':_0xd38540['message'],'agent':_0xd38540['agent'],'interaction':_0xd38540[_0x49c4('0x2d')],'account':_0xd38540[_0x49c4('0x2e')]}))||'';}function getInteractionUsers(_0x3bec0a,_0x1238c0){return new BPromise(function(_0x2b45a1,_0x2cf897){try{if(_0x1238c0[_0x3bec0a['id']]){_0x3bec0a[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x1238c0[_0x3bec0a['id']],function(_0x3209cd){return{'id':_0x3209cd['id'],'fullname':_0x3209cd['fullname']};});}}catch(_0x2d34ca){_0x2cf897(_0x2d34ca);}_0x2b45a1(_0x3bec0a);});}function getInteractionTags(_0x5b96df,_0xdda586){return new BPromise(function(_0x349791,_0x2625a6){try{if(_0x5b96df[_0x49c4('0x31')]){_0x5b96df['Tags']=[];_0x5b96df[_0x49c4('0x31')][_0x49c4('0x32')](',')[_0x49c4('0x33')](function(_0x4e913a){_0x5b96df[_0x49c4('0x34')][_0x49c4('0x35')](_0xdda586[_0x4e913a]);});}delete _0x5b96df[_0x49c4('0x31')];}catch(_0x5e5366){_0x2625a6(_0x5e5366);}_0x349791(_0x5b96df);});}function updateChatInteraction(_0x1ba7a0,_0x24c177,_0x143916){return new BPromise(function(_0x2ba76a,_0x70e552){return getInteractionUsers(_0x1ba7a0,_0x143916)[_0x49c4('0x14')](function(_0x1e506a){return getInteractionTags(_0x1e506a,_0x24c177);})['then'](function(_0x2d2510){return getStateInteraction(_0x2d2510);})[_0x49c4('0x14')](function(_0x32b172){_0x2ba76a(_0x32b172);})[_0x49c4('0x1d')](function(_0x41ad28){_0x70e552(_0x41ad28);});});}function getStateInteraction(_0x29dd5d){return new BPromise(function(_0x1be62d){_0x29dd5d[_0x49c4('0x36')]=0x0;_0x29dd5d[_0x49c4('0x37')]=0x0;_0x29dd5d[_0x49c4('0x38')]=0x0;_0x29dd5d[_0x49c4('0x39')]=0x0;_0x29dd5d[_0x49c4('0x3a')]=0x0;_0x29dd5d[_0x49c4('0x3b')]=0x0;if(!_0x29dd5d['closed']&&!_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d['waiting']+=0x1;}if(!_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x37')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d['disposition']==='abandoned'){_0x29dd5d[_0x49c4('0x3a')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&!_0x29dd5d['UserId']&&_0x29dd5d[_0x49c4('0x3e')]){_0x29dd5d[_0x49c4('0x39')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x38')]+=0x1;if(_0x29dd5d[_0x49c4('0x37')]){_0x29dd5d[_0x49c4('0x37')]-=0x1;}}_0x29dd5d['total']+=0x1;_0x1be62d(_0x29dd5d);});}exports[_0x49c4('0x3f')]=function(_0x4d27d0,_0x33696e){var _0x628423={},_0x301def={},_0x258abe={'count':0x0,'rows':[]};var _0x2d93d8=_['map'](db[_0x49c4('0x40')][_0x49c4('0x41')],function(_0x384862){return{'name':_0x384862[_0x49c4('0x42')],'type':_0x384862[_0x49c4('0x43')][_0x49c4('0x44')]};});_0x301def[_0x49c4('0x45')]=_['map'](_0x2d93d8,_0x49c4('0x28'));_0x301def['query']=_[_0x49c4('0x46')](_0x4d27d0[_0x49c4('0x47')]);_0x301def[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x301def[_0x49c4('0x45')],_0x301def[_0x49c4('0x47')]);_0x628423[_0x49c4('0x4a')]=_['intersection'](_0x301def[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x4d27d0['query'][_0x49c4('0x4b')]));_0x628423[_0x49c4('0x4a')]=_0x628423[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x628423['attributes']:_0x301def['model'];if(!_0x4d27d0[_0x49c4('0x47')]['hasOwnProperty'](_0x49c4('0x4d'))){_0x628423[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x24')]);_0x628423[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0x4d27d0['query'][_0x49c4('0x21')]);}_0x628423[_0x49c4('0x4e')]=qs[_0x49c4('0x4f')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x628423[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_[_0x49c4('0x51')](_0x4d27d0[_0x49c4('0x47')],_0x301def[_0x49c4('0x48')]),_0x2d93d8);var _0x5b822f=[];var _0x5e63f0=squel[_0x49c4('0x52')]()[_0x49c4('0x53')]('id')['field']('name')[_0x49c4('0x53')]('color')['from'](_0x49c4('0x54'));var _0x4081a5=squel[_0x49c4('0x52')]()[_0x49c4('0x53')](_0x49c4('0x55'))[_0x49c4('0x53')](_0x49c4('0x56'))['field'](_0x49c4('0x57'))[_0x49c4('0x58')](_0x49c4('0x59'),'ui')[_0x49c4('0x5a')](_0x49c4('0x5b'),'u',_0x49c4('0x5c'));var _0x5d24f3=squel['select']()[_0x49c4('0x58')](_0x49c4('0x5d'),'i')[_0x49c4('0x5a')](_0x49c4('0x5e'),'c',_0x49c4('0x5f'))[_0x49c4('0x5a')](_0x49c4('0x5b'),'o','o.id\x20=\x20i.UserId')[_0x49c4('0x5a')](_0x49c4('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x49c4('0x5a')]('chat_messages','me',_0x49c4('0x61'))[_0x49c4('0x5a')](_0x49c4('0x62'),'it',_0x49c4('0x63'))[_0x49c4('0x5a')](_0x49c4('0x54'),'t',_0x49c4('0x64'));var _0x2f520f=squel['expr']();var _0x3894e0=[];var _0x27b9c2=squel['expr']();var _0x10dec7;if(_0x4d27d0[_0x49c4('0x47')]['search']){_0x10dec7=as[_0x49c4('0x65')](_0x4d27d0[_0x49c4('0x47')]['search']);var _0x4dc54d=_0x10dec7['sqlOperator'];for(var _0x513879=0x0;_0x513879<_0x10dec7[_0x49c4('0x66')]['length'];_0x513879++){var _0xb20a5d=_0x10dec7[_0x49c4('0x66')][_0x513879];var _0x515240='i';var _0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name',_0xb20a5d[_0x49c4('0x53')]]);if(!_0x679134){switch(_0xb20a5d[_0x49c4('0x53')]){case _0x49c4('0x68'):if(_0xb20a5d[_0x49c4('0x69')]==0x1){_0x5d24f3['having']('`'+_0xb20a5d[_0x49c4('0x53')]+_0x49c4('0x6a'));}else{_0x5d24f3[_0x49c4('0x6b')]('`'+_0xb20a5d[_0x49c4('0x53')]+'`\x20>\x200');}break;case _0x49c4('0x6c'):if(_0xb20a5d['operator']==='$substring'){if(_0xb20a5d['value']['split']('\x20')[_0x49c4('0x4c')]>0x1){_0x2f520f[_0x4dc54d](_0x49c4('0x6d'),qs[_0x49c4('0x6e')](_0xb20a5d[_0x49c4('0x69')]),null);}else{var _0x5b056e='%'+_0xb20a5d['value']+'%';_0x2f520f[_0x4dc54d](_0x49c4('0x6f'),_0x5b056e,_0x5b056e,_0x5b056e);}}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,[_0x49c4('0x28'),_0x49c4('0x70')]);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x70');_0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')]['start'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);}break;case _0x49c4('0x72'):var _0x1ea1b4=_0xb20a5d[_0x49c4('0x69')][_0x49c4('0x32')](',')[_0x49c4('0x30')](function(_0x3feb0b){return Number(_0x3feb0b);});_0x1ea1b4[_0x49c4('0x33')](function(_0x1743d0){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0x1743d0+',%');});_0x3894e0=_[_0x49c4('0x74')](_0x3894e0,_0x1ea1b4);break;case _0x49c4('0x75'):if(_0xb20a5d[_0x49c4('0x76')]===_0x49c4('0x77')){_0x2f520f[_0x4dc54d](_0x49c4('0x78'),'%'+_0xb20a5d[_0x49c4('0x69')]+'%',null);}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name','UserId']);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x3c');_0x191afb=as['buildExpression'](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb['value']['end']);}break;case'body':_0x191afb=as[_0x49c4('0x71')]('me',null,_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);break;}}else{var _0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')]['end']);}}}else{var _0x4448b9=_(_0x4d27d0[_0x49c4('0x47')])[_0x49c4('0x46')]()[_0x49c4('0x30')](function(_0x1f25be){return _[_0x49c4('0x7b')](_0x2d93d8,[_0x49c4('0x28'),_0x1f25be])?_0x1f25be:undefined;})[_0x49c4('0x7c')]()['value']();if(!_[_0x49c4('0x7d')](_0x4448b9)){_0x4448b9[_0x49c4('0x33')](function(_0x85540f){if(_0x85540f===_0x49c4('0x7e')){_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x4d27d0[_0x49c4('0x47')][_0x85540f]));}else if(_0x85540f==='createdAt'){var _0x34cf49=JSON['parse'](_0x4d27d0[_0x49c4('0x47')][_0x85540f])[_0x49c4('0x7f')];var _0x3b03dd=JSON[_0x49c4('0x80')](_0x4d27d0['query'][_0x85540f])[_0x49c4('0x81')];_0x5d24f3[_0x49c4('0x50')](_0x49c4('0x82'),_0x34cf49,_0x3b03dd);}else{if(_0x4d27d0[_0x49c4('0x47')][_0x85540f]===_0x49c4('0x83')){_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x84'));}else{_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x85'),_0x4d27d0[_0x49c4('0x47')][_0x85540f]);}}});}if(_0x4d27d0['query'][_0x49c4('0x86')]){if(_0x4d27d0[_0x49c4('0x47')]['read']==0x1){_0x5d24f3[_0x49c4('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x5d24f3[_0x49c4('0x6b')](_0x49c4('0x87'));}}if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]){_0x3894e0=_[_0x49c4('0x89')](_0x4d27d0['query'][_0x49c4('0x88')])?_0x4d27d0[_0x49c4('0x47')]['tag']:new Array(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]);_0x3894e0['forEach'](function(_0xbd12b9){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0xbd12b9+',%');});}if(_0x4d27d0['query'][_0x49c4('0x8a')]){var _0x993d00=_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x49c4('0x8b')](/'/g,'\x27\x27');if(qs[_0x49c4('0x8c')](_0x993d00)){_0x2f520f['or']('i.id\x20LIKE\x20?',_0x993d00+'%');}else{_0x2f520f['or'](_0x49c4('0x8d'),qs['getFullTextValue'](_0x993d00))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x993d00+'%');}}}_0x5d24f3[_0x49c4('0x50')](_0x2f520f);_0x5d24f3['group']('i.id');var _0x39cacf={'type':db[_0x49c4('0x8e')]['QueryTypes'][_0x49c4('0x8f')],'raw':!![]};var _0x5c3509=_0x5d24f3['clone']();_0x5c3509['field'](_0x49c4('0x90'));_0x5c3509[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));if(_0x628423['order']){_0x628423['order'][_0x49c4('0x33')](function(_0x48705c){var _0x2c560e=_0x48705c[0x0]==='contactName'?_0x48705c[0x0]:'i.'+_0x48705c[0x0];_0x5d24f3[_0x49c4('0x4e')](_0x2c560e,_0x48705c[0x1]===_0x49c4('0x92')?![]:!![]);});}if(!_[_0x49c4('0x7d')](_0x3894e0)){_0x5d24f3[_0x49c4('0x6b')](_0x27b9c2);_0x5c3509[_0x49c4('0x50')](_0x49c4('0x93'),_0x3894e0);}BPromise[_0x49c4('0x94')]()['then'](function(){if(!_0x10dec7){if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x7e')])return;_0x5c3509[_0x49c4('0x50')](_0x49c4('0x95'));_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]!==_0x49c4('0x98'))return;return _0x4d27d0['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x49c4('0x14')](function(_0x27b31d){if(_[_0x49c4('0x7d')](_0x27b31d)){_0x5c3509[_0x49c4('0x50')](_0x49c4('0x99'));_0x5d24f3['where'](_0x49c4('0x99'));}else{_0x5c3509[_0x49c4('0x50')](_0x49c4('0x9a'),_[_0x49c4('0x30')](_0x27b31d,'id'));_0x5d24f3['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x49c4('0x30')](_0x27b31d,'id'));}});})[_0x49c4('0x14')](function(){if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]===_0x49c4('0x98')&&!_0x10dec7&&!_0x4d27d0['query'][_0x49c4('0x7e')])return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5c3509[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x8f37e5){_0x258abe['count']=_0x8f37e5[_0x49c4('0x4c')];if(_0x258abe[_0x49c4('0x23')]===0x0)return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5e63f0['toString'](),_0x39cacf)['then'](function(_0xa96f53){_0x5b822f=_['keyBy'](_0xa96f53,'id');_0x39cacf=_[_0x49c4('0x2a')](_0x39cacf,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4b')]){_0x628423[_0x49c4('0x4a')][_0x49c4('0x33')](function(_0x4eebc9){_0x5d24f3['field']('i.'+_0x4eebc9);});}else{_0x5d24f3[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));_0x5d24f3['field']('a.key',_0x49c4('0x9d'));_0x5d24f3['field']('a.mandatoryDisposition',_0x49c4('0x9e'));_0x5d24f3['field'](_0x49c4('0x9f'),_0x49c4('0xa0'));_0x5d24f3['field'](_0x49c4('0xa1'));_0x5d24f3[_0x49c4('0x53')]('c.firstName','Contact.firstName');_0x5d24f3[_0x49c4('0x53')]('c.lastName',_0x49c4('0xa2'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa3'),_0x49c4('0xa4'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa5'),_0x49c4('0xa6'));_0x5d24f3['field'](_0x49c4('0xa7'),_0x49c4('0xa8'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa9'),_0x49c4('0xaa'));_0x5d24f3['field'](_0x49c4('0xab'),'Owner.fullname');_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xac'),_0x49c4('0xad'));_0x5d24f3[_0x49c4('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x49c4('0x31'));}if(_0x628423[_0x49c4('0x24')])_0x5d24f3[_0x49c4('0x24')](_0x628423[_0x49c4('0x24')]);if(_0x628423[_0x49c4('0x21')])_0x5d24f3[_0x49c4('0x21')](_0x628423['offset']);return db[_0x49c4('0x9b')]['query'](_0x5d24f3[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x1db53d){if(_0x1db53d[_0x49c4('0x4c')]>0x0)_0x4081a5['where'](_0x49c4('0xae'),_[_0x49c4('0x30')](_0x1db53d,'id'));return db['sequelize'][_0x49c4('0x47')](_0x4081a5[_0x49c4('0x9c')](),_0x39cacf)['then'](function(_0x562f47){var _0x25f1c7=_[_0x49c4('0xaf')](_0x562f47,_0x49c4('0xb0'));var _0x1aa3a3=[];_0x1db53d[_0x49c4('0x33')](function(_0x15e403){_0x1aa3a3[_0x49c4('0x35')](updateChatInteraction(_0x15e403,_0x5b822f,_0x25f1c7));});return BPromise[_0x49c4('0xb1')](_0x1aa3a3);});});})[_0x49c4('0x14')](function(_0x117c64){_0x258abe[_0x49c4('0xb2')]=_0x117c64;return _0x258abe;})['then'](respondWithFilteredResult(_0x33696e,_0x628423))['catch'](handleError(_0x33696e,null));};exports[_0x49c4('0xb3')]=function(_0x1e286e,_0xccdf6d){var _0x5be042={'raw':![],'where':{'id':_0x1e286e[_0x49c4('0xb4')]['id']}},_0x1276bf={};_0x1276bf['model']=_[_0x49c4('0x46')](db['ChatInteraction'][_0x49c4('0x41')]);_0x1276bf[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0x1e286e[_0x49c4('0x47')]);_0x1276bf['filters']=_[_0x49c4('0x49')](_0x1276bf[_0x49c4('0x45')],_0x1276bf[_0x49c4('0x47')]);_0x5be042[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x1276bf['model'],qs['fields'](_0x1e286e['query'][_0x49c4('0x4b')]));_0x5be042[_0x49c4('0x4a')]=_0x5be042[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5be042[_0x49c4('0x4a')]:_0x1276bf['model'];if(_0x1e286e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5be042[_0x49c4('0xb6')]=[{'all':!![]}];}_0x5be042=_[_0x49c4('0x2a')]({},_0x5be042,_0x1e286e['options']);return db[_0x49c4('0x40')][_0x49c4('0x67')](_0x5be042)[_0x49c4('0x14')](handleEntityNotFound(_0xccdf6d,null))[_0x49c4('0x14')](respondWithResult(_0xccdf6d,null))[_0x49c4('0x1d')](handleError(_0xccdf6d,null));};exports['create']=function(_0x1d9e1a,_0x9b622d){return db[_0x49c4('0x40')]['create'](_0x1d9e1a[_0x49c4('0x2b')],{})[_0x49c4('0x14')](respondWithResult(_0x9b622d,0xc9))[_0x49c4('0x1d')](handleError(_0x9b622d,null));};exports['update']=function(_0x97f579,_0x491231){if(_0x97f579['body']['id']){delete _0x97f579[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x97f579[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x491231,null))[_0x49c4('0x14')](saveUpdates(_0x97f579[_0x49c4('0x2b')],null))[_0x49c4('0x14')](respondWithResult(_0x491231,null))[_0x49c4('0x1d')](handleError(_0x491231,null));};exports[_0x49c4('0xb7')]=function(_0x219133,_0x59dbef){return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x219133[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x59dbef,null))['then'](removeEntity(_0x59dbef,null))['catch'](handleError(_0x59dbef,null));};exports[_0x49c4('0xb8')]=function(_0x3222ec,_0xd979f7){return db[_0x49c4('0x40')][_0x49c4('0xb8')]()[_0x49c4('0x14')](respondWithResult(_0xd979f7,null))[_0x49c4('0x1d')](handleError(_0xd979f7,null));};exports[_0x49c4('0xb9')]=function(_0x318008,_0x1e2dd3){var _0xa42e74=_0x318008[_0x49c4('0xb4')]['id'];var _0x352b67;var _0xbfb25b;var _0x4cc855;return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0xa42e74}})[_0x49c4('0x14')](function(_0x318aaf){_0x352b67=_0x318aaf;return db['ChatWebsite']['findOne']({'where':{'id':_0x318aaf[_0x49c4('0x7e')]},'attributes':['id','vidaooApiKey',_0x49c4('0xbb'),_0x49c4('0xbc'),_0x49c4('0xbd'),_0x49c4('0xbe')],'raw':!![]});})[_0x49c4('0x14')](function(_0x45a2ef){if(_0x45a2ef&&_0x45a2ef[_0x49c4('0xbf')]&&_0x45a2ef[_0x49c4('0xbb')]){_0xbfb25b=_0x45a2ef;var _0x31ba95={'interaction':{'id':_0xa42e74},'agent':{'id':_0x318008[_0x49c4('0x96')]['id'],'name':_0x318008[_0x49c4('0x96')][_0x49c4('0x28')],'fullname':_0x318008['user'][_0x49c4('0xc0')],'email':_0x318008[_0x49c4('0x96')][_0x49c4('0xc1')]},'contact':_0x318008['body'][_0x49c4('0x2c')],'account':_0x318008['body'][_0x49c4('0x2e')]};var _0x82925={'rejectUnauthorized':![],'method':_0x49c4('0xc2'),'url':_0x49c4('0xc3'),'headers':{'X-APIKEY':_0x45a2ef['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x318008[_0x49c4('0x96')]['email']],'buttons':null,'topic':_0xbfb25b['vidaooTopic'],'note':_[_0x49c4('0xc4')](_0xbfb25b[_0x49c4('0xbd')])?null:getMustacheRender(_0xbfb25b[_0x49c4('0xbd')],_0x31ba95),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0xbfb25b[_0x49c4('0xbe')])){var _0x1221de=getMustacheRender(_0xbfb25b[_0x49c4('0xbe')],_0x31ba95);var _0x330512=JSON[_0x49c4('0x80')](_0x1221de);_0x82925[_0x49c4('0x2b')][_0x49c4('0xc5')]=_0x330512;}}catch(_0x19f30b){throw new db[(_0x49c4('0x8e'))]['ValidationError'](_0x49c4('0xc6'));}return rp(_0x82925);}else{throw new db[(_0x49c4('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x49c4('0x14')](function(_0x4d5481){_0x4cc855=_0x4d5481;if(_0x4cc855['id']){var _0xefec38={'body':_0x4cc855['join_url'],'ChatWebsiteId':_0xbfb25b['id'],'ChatInteractionId':_0x352b67['id'],'direction':_0x49c4('0xc7'),'UserId':_0x318008['user']['id']};return db[_0x49c4('0xc8')][_0x49c4('0xc9')](_0xefec38,{});}else{throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x352b67[_0x49c4('0xcb')]({'vidaooSessionId':_0x4cc855['id']});})[_0x49c4('0x14')](respondWithResult(_0x1e2dd3,null))[_0x49c4('0x1d')](handleError(_0x1e2dd3,null));};exports['customUpdate']=function(_0x367d3d,_0x1814c4){if(_0x367d3d['body']['id']){delete _0x367d3d['body']['id'];}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x367d3d[_0x49c4('0xb4')]['id']},'include':[{'model':db['CmContact'],'as':_0x49c4('0x6c')}]})[_0x49c4('0x14')](handleEntityNotFound(_0x1814c4,null))[_0x49c4('0x14')](saveUpdates(_0x367d3d[_0x49c4('0x2b')],null))['then'](respondWithResult(_0x1814c4,null))[_0x49c4('0x1d')](handleError(_0x1814c4,null));};exports['abandon']=function(_0x4d0a28,_0xf5f718){if(_0x4d0a28[_0x49c4('0x2b')]['id']){delete _0x4d0a28[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x4d0a28[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](function(_0xa6f48){if(!_0xa6f48){logger[_0x49c4('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x49c4('0xcc'),0x194,'entity\x20not\x20found');_0xf5f718['sendStatus'](0x194);}else{if(_0xa6f48[_0x49c4('0x3c')]){throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Interaction\x20already\x20assigned');}}return _0xa6f48;})[_0x49c4('0x14')](function(_0x4a874a){if(_0x4a874a){return _0x4a874a[_0x49c4('0x27')]({'closed':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3d')],'disposition':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3e')]})[_0x49c4('0x14')](function(_0x2b31ac){return _0x2b31ac;});}})['then'](function(){return respondWithRpcPromise(_0x49c4('0xcd'),_0x49c4('0xcc'),_0x4d0a28[_0x49c4('0x2b')],client9004);})[_0x49c4('0x14')](respondWithResult(_0xf5f718,null))['catch'](handleError(_0xf5f718,null));};exports['attachmentUpload']=function(_0x4c15ff,_0x2d4f8a){_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0x28')]=_0x4c15ff[_0x49c4('0xce')][_0x49c4('0xcf')];_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0xd0')]=_0x4c15ff['file'][_0x49c4('0xd1')];_0x4c15ff[_0x49c4('0x2b')]['type']=_0x4c15ff['file']['mimetype'];return db[_0x49c4('0xd2')][_0x49c4('0xc9')](_0x4c15ff[_0x49c4('0x2b')])[_0x49c4('0x14')](respondWithResult(_0x2d4f8a,0xc9))[_0x49c4('0x1d')](handleError(_0x2d4f8a,null));};exports[_0x49c4('0xd3')]=function(_0x2f36c6,_0x5039fc){return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0x2f36c6[_0x49c4('0xb4')]['id']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null))['then'](function(_0x3440ad){if(_0x3440ad){if(_0x3440ad[_0x49c4('0x3d')]){return _0x5039fc[_0x49c4('0x1e')](0x193)[_0x49c4('0x20')]({'status':0x193,'message':_0x49c4('0xd4')});}return db['Attachment'][_0x49c4('0xba')]({'where':{'id':_0x2f36c6['query']['attachId']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null));}})[_0x49c4('0x14')](function(_0x113beb){if(_0x113beb){var _0x35289f=_0x113beb[_0x49c4('0xd5')]!==null;var _0x5b9591=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0xd8'));if(_0x35289f){_0x5b9591=path['join'](_0x5b9591,_0x49c4('0xd9'));}var _0x45c34a=path['join'](_0x5b9591,_0x113beb[_0x49c4('0xd0')]);return _0x5039fc[_0x49c4('0xda')](_0x45c34a);}})[_0x49c4('0x1d')](handleError(_0x5039fc,null));};exports[_0x49c4('0xdb')]=function(_0x2ef538,_0x163128){var _0x1679ca=null;var _0x4b0114=null;var _0x261d61=null;if(_0x2ef538[_0x49c4('0x2b')]['id']){delete _0x2ef538[_0x49c4('0x2b')]['id'];}if(_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]){_0x261d61=path['join'](config[_0x49c4('0xd7')],_0x49c4('0xdd'),util[_0x49c4('0xde')](_0x49c4('0xdf'),Date[_0x49c4('0xe0')]()));_0x2ef538['body'][_0x49c4('0xe1')]=_0x261d61;}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x2ef538[_0x49c4('0xb4')]['id']},'include':[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'include':[{'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75')}]}]})[_0x49c4('0x14')](handleEntityNotFound(_0x163128,null))[_0x49c4('0x14')](saveUpdates(_0x2ef538['body'],null))[_0x49c4('0x14')](function(_0x1b6966){if(_0x1b6966){_0x1679ca=_0x1b6966;return db[_0x49c4('0xe3')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x7e')]}});}})['then'](function(_0x501786){if(_0x501786){_0x4b0114=_0x501786;return db[_0x49c4('0xe4')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x70')]}});}})[_0x49c4('0x14')](function(_0xd87f7e){if(_0xd87f7e){if(_0x261d61){var _0x25d2a1=null;for(var _0x58d24f=0x1;_0x58d24f<_0x1679ca[_0x49c4('0xe2')][_0x49c4('0x4c')];++_0x58d24f){_0x25d2a1=_0x1679ca['Messages'][_0x58d24f];var _0x386595=_0x25d2a1['UserId']?util[_0x49c4('0xde')](_0x49c4('0xe5'),_0x4b0114[_0x49c4('0xe6')],_0x25d2a1['UserId']):_0x49c4('0xe7');var _0x4f431e=_0x2ef538[_0x49c4('0x2b')]['customer']||util['format'](_0x49c4('0xe5'),_0x49c4('0xe8'),_0x25d2a1[_0x49c4('0x70')]);switch(_0x4b0114[_0x49c4('0xe9')]){case _0x49c4('0xea'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):_0x49c4('0xe7');break;case _0x49c4('0xeb'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1[_0x49c4('0x75')][_0x49c4('0xec')]||_0x25d2a1['User']['fullname']:'System';break;case'agent_fullname':_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1['User'][_0x49c4('0xc0')]:_0x49c4('0xe7');break;default:_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):'System';}var _0x4323ec=util[_0x49c4('0xde')](_0x49c4('0xed'),moment(_0x25d2a1[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0xef')),_0x25d2a1['direction']==='in'?_0x4f431e:_0x386595,_0x25d2a1[_0x49c4('0x2b')]);if(!_0x25d2a1[_0x49c4('0xf0')]){fs[_0x49c4('0xf1')](_0x261d61,_0x4323ec);}}return db['MailAccount'][_0x49c4('0xba')]({'where':{'service':!![]},'include':[{'model':db[_0x49c4('0xf2')],'as':_0x49c4('0xf3'),'raw':!![],'include':[{'model':db[_0x49c4('0xf4')],'as':_0x49c4('0xf4'),'raw':!![]}]}]});}}})[_0x49c4('0x14')](function(_0x82c4bf){if(!_0x82c4bf||!_0x82c4bf[_0x49c4('0xf3')]||!_0x2ef538['body'])return _0x1679ca;var _0x2fc500=_0x82c4bf[_0x49c4('0xf5')]();return respondWithRpcPromise(_0x49c4('0xf6'),_0x49c4('0xf7'),{'account':_0x2fc500,'message':{'from':util[_0x49c4('0xde')](_0x49c4('0xf8'),_0x82c4bf['name'],_0x82c4bf[_0x49c4('0xc1')]||_0x82c4bf[_0x49c4('0xf3')][_0x49c4('0x96')]),'to':_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')],'subject':_0x49c4('0xf9'),'text':util[_0x49c4('0xde')](_0x49c4('0xfa'),_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]),'attachments':[{'path':_0x261d61}]}})[_0x49c4('0x14')](function(){return _0x1679ca;})[_0x49c4('0x1d')](function(_0x471e28){logger[_0x49c4('0x1a')](_0x471e28);});})['then'](respondWithStatusCode(_0x163128,0xc8))['catch'](handleError(_0x163128,null));};exports[_0x49c4('0xfb')]=function(_0x3b6fd2,_0x4c07b3){return db['ChatMessage'][_0x49c4('0x67')]({'where':{'id':_0x3b6fd2['params']['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x4c07b3,null))[_0x49c4('0x14')](function(_0x1ac2c0){if(_0x1ac2c0){return _0x1ac2c0[_0x49c4('0xfb')](_0x3b6fd2[_0x49c4('0x2b')][_0x49c4('0xfc')],_[_0x49c4('0xfd')](_0x3b6fd2[_0x49c4('0x2b')],['ids','id'])||{});}})[_0x49c4('0x14')](respondWithResult(_0x4c07b3,null))[_0x49c4('0x1d')](handleError(_0x4c07b3,null));};exports[_0x49c4('0xfe')]=function(_0xd2ee5e,_0x201909){var _0x5b2cc8={'raw':![],'where':{}};var _0x2bfa4f={};var _0x2b507f={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x49c4('0xba')]({'where':{'id':_0xd2ee5e[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x201909,null))[_0x49c4('0x14')](function(_0x3119a5){if(_0x3119a5){_0x2bfa4f[_0x49c4('0x45')]=_['keys'](db[_0x49c4('0xc8')][_0x49c4('0x41')]);_0x2bfa4f[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0xd2ee5e['query']);_0x2bfa4f[_0x49c4('0x48')]=_['intersection'](_0x2bfa4f[_0x49c4('0x45')],_0x2bfa4f[_0x49c4('0x47')]);_0x5b2cc8[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x2bfa4f['model'],qs[_0x49c4('0x4b')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4b')]));_0x5b2cc8[_0x49c4('0x4a')]=_0x5b2cc8[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5b2cc8['attributes']:_0x2bfa4f['model'];if(!_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xff')](_0x49c4('0x4d'))){_0x5b2cc8[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x24')]);_0x5b2cc8[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x21')]);}_0x5b2cc8[_0x49c4('0x4e')]=qs['sort'](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x5b2cc8['where']=qs[_0x49c4('0x48')](_['pick'](_0xd2ee5e[_0x49c4('0x47')],_0x2bfa4f[_0x49c4('0x48')]));_0x5b2cc8['where'][_0x49c4('0xb0')]=_0x3119a5['id'];if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],{'$or':_[_0x49c4('0x30')](_0x5b2cc8['attributes'],function(_0x1c74ce){var _0x216896={};_0x216896[_0x1c74ce]={'$like':'%'+_0xd2ee5e[_0x49c4('0x47')]['filter']+'%'};return _0x216896;})});}if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x7f')]){var _0x37ec56=_0xd2ee5e['query']['$gte'][_0x49c4('0x32')](',');var _0x590586={};_0x590586[_0x37ec56[0x0]]={'$gte':moment(_0x37ec56[0x1])[_0x49c4('0xde')](_0x49c4('0x100'))};_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],_0x590586);}_0x5b2cc8=_['merge']({},_0x5b2cc8,_0xd2ee5e['options']);return db[_0x49c4('0xc8')][_0x49c4('0x23')]({'where':_0x5b2cc8[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x5255f7){_0x2b507f[_0x49c4('0x23')]=_0x5255f7;if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5b2cc8[_0x49c4('0xb6')]=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x5b2cc8);})[_0x49c4('0x14')](function(_0x1d2931){_0x2b507f[_0x49c4('0xb2')]=_0x1d2931;return _0x2b507f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x201909,_0x5b2cc8))[_0x49c4('0x1d')](handleError(_0x201909,null));};exports['getMyMessages']=function(_0x16e808,_0x514446){var _0x3308c4={'where':{}},_0x3683d7={},_0x4feb6f={'count':0x0,'rows':[]};return db[_0x49c4('0x40')]['findOne']({'where':{'id':_0x16e808[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x514446,null))['then'](function(_0x577ae6){if(_0x577ae6){_0x3683d7[_0x49c4('0x45')]=_[_0x49c4('0x46')](db[_0x49c4('0xc8')]['rawAttributes']);_0x3683d7[_0x49c4('0x47')]=_['keys'](_0x16e808[_0x49c4('0x47')]);_0x3683d7[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x3683d7['model'],_0x3683d7[_0x49c4('0x47')]);_0x3308c4[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x3683d7[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x16e808['query'][_0x49c4('0x4b')]));_0x3308c4[_0x49c4('0x4a')]=_0x3308c4[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x3308c4['attributes']:_0x3683d7['model'];if(!_0x16e808[_0x49c4('0x47')][_0x49c4('0xff')]('nolimit')){_0x3308c4[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x24')]);_0x3308c4['offset']=qs[_0x49c4('0x21')](_0x16e808[_0x49c4('0x47')]['offset']);}_0x3308c4['order']=qs[_0x49c4('0x4f')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x3308c4[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_['pick'](_0x16e808[_0x49c4('0x47')],_0x3683d7['filters']));_0x3308c4[_0x49c4('0x50')][_0x49c4('0xb0')]=_0x577ae6['id'];if(_0x16e808[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x3308c4['where']=_['merge'](_0x3308c4['where'],{'$or':_[_0x49c4('0x30')](_0x3308c4[_0x49c4('0x4a')],function(_0x14d5ca){var _0x2cb936={};_0x2cb936[_0x14d5ca]={'$like':'%'+_0x16e808['query']['filter']+'%'};return _0x2cb936;})});}_0x3308c4[_0x49c4('0x50')]['secret']=![];if(_0x16e808[_0x49c4('0x47')]['id']){_0x3308c4[_0x49c4('0x50')]['id']={'$gt':_0x16e808['query']['id']};}_0x3308c4=_[_0x49c4('0x2a')]({},_0x3308c4,_0x16e808[_0x49c4('0x102')]);return db[_0x49c4('0xc8')]['count']({'where':_0x3308c4[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x1a5755){_0x4feb6f['count']=_0x1a5755;_0x3308c4[_0x49c4('0xb6')]=[];if(_0x16e808[_0x49c4('0x47')]['includeAgent']){_0x3308c4[_0x49c4('0xb6')][_0x49c4('0x35')]({'model':db['User'],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0'),_0x49c4('0xec')]});}if(_0x16e808[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x3308c4['include']=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x3308c4);})['then'](function(_0x5a4b35){_0x4feb6f[_0x49c4('0xb2')]=_0x5a4b35;return _0x4feb6f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x514446,_0x3308c4))['catch'](handleError(_0x514446,null));};exports[_0x49c4('0x103')]=function(_0x55bb71,_0x4059b0){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x55bb71[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x4059b0,null))[_0x49c4('0x14')](function(_0x17ab2c){if(_0x17ab2c){return _0x17ab2c['setTags'](_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')],_['omit'](_0x55bb71['body'],[_0x49c4('0xfc'),'id'])||{})[_0x49c4('0x104')](function(){return db[_0x49c4('0x72')][_0x49c4('0x101')]({'attributes':['id',_0x49c4('0x28'),'color'],'where':{'id':_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')]}});})[_0x49c4('0x14')](function(_0xd62ca){socket[_0x49c4('0x105')]('chatInteractionTags:save',{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]});return{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]};});}})[_0x49c4('0x14')](respondWithResult(_0x4059b0,null))[_0x49c4('0x1d')](handleError(_0x4059b0,null));};exports[_0x49c4('0x106')]=function(_0x39abbf,_0x3de5d8){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x39abbf[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x3de5d8,null))[_0x49c4('0x14')](function(_0x5a4b4c){if(_0x5a4b4c){return _0x5a4b4c['removeTags'](_0x39abbf[_0x49c4('0x47')]['ids']);}})[_0x49c4('0x14')](respondWithStatusCode(_0x3de5d8,null))[_0x49c4('0x1d')](handleError(_0x3de5d8,null));};exports[_0x49c4('0xda')]=function(_0x3f0e74,_0x55f423){var _0x3ce0f9=moment()[_0x49c4('0x107')]()[_0x49c4('0x9c')]();var _0x156a4f=path['join'](config[_0x49c4('0xd7')],_0x49c4('0x108'),'files',_0x49c4('0x109'));var _0x22005f=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0x108'),_0x49c4('0x10a'),_0x49c4('0x10b'));var _0x1d3b1a=path['join'](_0x156a4f,_0x3ce0f9);var _0x4eb6ba=util['format'](_0x49c4('0x10c'),_0x3f0e74[_0x49c4('0xb4')]['id'],_0x3ce0f9);var _0x418ead=path[_0x49c4('0xd6')](_0x156a4f,_0x4eb6ba);var _0x39ff8b=[];_0x39ff8b['push']({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0')],'raw':!![]});_0x39ff8b[_0x49c4('0x35')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x49c4('0x10d'),_0x49c4('0x10e')],'raw':!![]});if(_0x3f0e74[_0x49c4('0x47')][_0x49c4('0x10b')]){_0x39ff8b[_0x49c4('0x35')]({'model':db[_0x49c4('0xd2')],'as':'Attachment','raw':!![]});}var _0x58a5c9=[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'attributes':['id',_0x49c4('0x2b'),_0x49c4('0xee'),_0x49c4('0x10f'),'secret',_0x49c4('0x86')],'include':_0x39ff8b}];_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0xe3')],'as':_0x49c4('0x110'),'attributes':['id',_0x49c4('0x28')]});_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x111'),'attributes':['id',_0x49c4('0xc0')]});return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x3f0e74[_0x49c4('0xb4')]['id']},'include':_0x58a5c9})[_0x49c4('0x14')](handleEntityNotFound(_0x55f423,null))[_0x49c4('0x14')](function(_0xe5bb64){if(_0xe5bb64){var _0x5e5ca3=_0xe5bb64[_0x49c4('0x112')]({'plain':!![]});fs[_0x49c4('0x113')](_0x1d3b1a);var _0x485c2d={'channel':_0x49c4('0x114'),'account':_0x5e5ca3['Account'][_0x49c4('0x28')],'agent':_0x5e5ca3['Owner']?_0x5e5ca3[_0x49c4('0x111')][_0x49c4('0xc0')]:'N.A.','createdAt':moment(_0x5e5ca3[_0x49c4('0xee')])['format'](_0x49c4('0x100'))[_0x49c4('0x9c')](),'closedAt':_0x5e5ca3[_0x49c4('0x3d')]?moment(_0x5e5ca3[_0x49c4('0x115')])[_0x49c4('0xde')]('YYYY-MM-DD\x20HH:mm:ss')[_0x49c4('0x9c')]():'','disposition':_0x5e5ca3[_0x49c4('0x3e')],'chatInfo':{'browser':_0x5e5ca3[_0x49c4('0x116')],'os':_0x5e5ca3[_0x49c4('0x117')],'referer':_0x5e5ca3[_0x49c4('0x118')],'customerIp':_0x5e5ca3[_0x49c4('0x119')],'customerPort':_0x5e5ca3[_0x49c4('0x11a')]?_0x5e5ca3[_0x49c4('0x11a')]:'N.A.'},'messages':_(_0x5e5ca3[_0x49c4('0xe2')])[_0x49c4('0x11b')]()[_0x49c4('0x8a')]({'secret':![]})[_0x49c4('0x30')](function(_0x341528){if(_0x341528[_0x49c4('0xd2')]){var _0x2a0ef8=path[_0x49c4('0xd6')](_0x22005f,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')]);if(fs[_0x49c4('0x11c')](_0x2a0ef8)){fs[_0x49c4('0x11d')](_0x2a0ef8)['pipe'](fs[_0x49c4('0x11e')](path['join'](_0x1d3b1a,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')])));}}return{'date':moment(_0x341528[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0x100'))[_0x49c4('0x9c')](),'sender':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?_0x341528[_0x49c4('0x75')]?_0x341528[_0x49c4('0x75')][_0x49c4('0xc0')]:_0x49c4('0xe7'):_0x341528[_0x49c4('0x6c')][_0x49c4('0x10d')]+(_0x341528[_0x49c4('0x6c')]['lastName']?'\x20'+_0x341528[_0x49c4('0x6c')][_0x49c4('0x10e')]:''),'body':_0x341528['Attachment']?_0x341528[_0x49c4('0xd2')]['basename']:_0x341528[_0x49c4('0x2b')],'direction':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?'A':'C','secret':_0x341528[_0x49c4('0xf0')],'read':_0x341528[_0x49c4('0x86')],'attachment':_0x341528['Attachment']};})['value']()};return ejs[_0x49c4('0x11f')](path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],'server',_0x49c4('0x120'),_0x49c4('0x121')),{'interaction':_0x485c2d})['then'](function(_0x6a1d66){var _0x563f95=path['join'](_0x1d3b1a,'transcript-'+_0x5e5ca3['id']+'-'+_0x3ce0f9+_0x49c4('0x122'));var _0x442210={'path':_0x563f95,'channel':_0x49c4('0x114'),'interactionId':_0x5e5ca3['id']};return pdf[_0x49c4('0x123')](_0x6a1d66,_0x442210);})[_0x49c4('0x14')](function(){return new Promise(function(_0x547d37,_0x223fa2){zipdir(_0x1d3b1a,{'saveTo':_0x418ead},function(_0x147d5e,_0x29674d){if(_0x147d5e)return _0x223fa2(_0x147d5e);return _0x547d37(_0x29674d);});})['then'](function(){return new BPromise(function(_0x17b015,_0x724d15){rimraf(_0x1d3b1a,function(_0x3350da){if(_0x3350da)_0x724d15(_0x3350da);return _0x17b015();});});})[_0x49c4('0x14')](function(){return _0x55f423[_0x49c4('0xda')](_0x418ead,_0x4eb6ba,function(_0x146c6e){if(_0x146c6e){logger[_0x49c4('0x1a')](_0x49c4('0x124'),_0x146c6e);}else{fs[_0x49c4('0x125')](_0x418ead);}});});});}else{return _0x55f423[_0x49c4('0x126')](0xc8);}})[_0x49c4('0x1d')](handleError(_0x55f423,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index ab9638e..cbbd6c3 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 _0x4d38=['exports','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','emit','hook'];(function(_0xc0e064,_0x130563){var _0x1748fe=function(_0x102f58){while(--_0x102f58){_0xc0e064['push'](_0xc0e064['shift']());}};_0x1748fe(++_0x130563);}(_0x4d38,0x15a));var _0x84d3=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x4d38[_0x38854e];return _0x3f8415;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x84d3('0x0')];var ChatMessage=require('../../mysqldb')['db'][_0x84d3('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x84d3('0x2')](0x0);var events={'afterCreate':_0x84d3('0x3'),'afterUpdate':_0x84d3('0x4'),'afterDestroy':_0x84d3('0x5')};function emitEvent(_0x3e49f3){return function(_0x31e5cc,_0x18e553,_0x3186f9){_0x31e5cc[_0x84d3('0x6')]({'attributes':['id'],'raw':!![]})[_0x84d3('0x7')](function(_0x4950eb){_0x31e5cc['setDataValue'](_0x84d3('0x8'),_0x4950eb[_0x84d3('0x9')](function(_0x2ba877){return{'id':_0x2ba877['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x31e5cc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3c7da){_0x31e5cc[_0x84d3('0xa')](_0x84d3('0xb'),_0x3c7da['length']);ChatInteractionEvents[_0x84d3('0xc')](_0x3e49f3+':'+_0x31e5cc['id'],_0x31e5cc);ChatInteractionEvents[_0x84d3('0xc')](_0x3e49f3,_0x31e5cc);_0x3186f9(null);})['catch'](_0x3186f9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x84d3('0xd')](e,emitEvent(event));}}module[_0x84d3('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x76b2=['Users','map','findAll','then','unreadMessages','emit','hasOwnProperty','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76b2,0xa8));var _0x276b=function(_0x176b6c,_0x1c8db3){_0x176b6c=_0x176b6c-0x0;var _0x24aa00=_0x76b2[_0x176b6c];return _0x24aa00;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x276b('0x0')];var ChatMessage=require(_0x276b('0x1'))['db'][_0x276b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x276b('0x3')](0x0);var events={'afterCreate':_0x276b('0x4'),'afterUpdate':'update','afterDestroy':_0x276b('0x5')};function emitEvent(_0x2e61ff){return function(_0x1d66f4,_0x407ac7,_0x3fb4aa){_0x1d66f4[_0x276b('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1d14a3){_0x1d66f4[_0x276b('0x7')](_0x276b('0x8'),_0x1d14a3[_0x276b('0x9')](function(_0x283b06){return{'id':_0x283b06['id']};}));return ChatMessage[_0x276b('0xa')]({'where':{'ChatInteractionId':_0x1d66f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x276b('0xb')](function(_0x553cda){_0x1d66f4[_0x276b('0x7')](_0x276b('0xc'),_0x553cda['length']);ChatInteractionEvents[_0x276b('0xd')](_0x2e61ff+':'+_0x1d66f4['id'],_0x1d66f4);ChatInteractionEvents['emit'](_0x2e61ff,_0x1d66f4);_0x3fb4aa(null);})['catch'](_0x3fb4aa(null));};}for(var e in events){if(events[_0x276b('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x276b('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 53c637d..67ea4b7 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 _0xda29=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x735cfe,_0x483598){var _0x530e22=function(_0x5587c0){while(--_0x5587c0){_0x735cfe['push'](_0x735cfe['shift']());}};_0x530e22(++_0x483598);}(_0xda29,0x148));var _0x9da2=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xda29[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x9da2('0x0'));var util=require('util');var logger=require(_0x9da2('0x1'))(_0x9da2('0x2'));var moment=require(_0x9da2('0x3'));var BPromise=require(_0x9da2('0x4'));var rp=require(_0x9da2('0x5'));var fs=require('fs');var path=require(_0x9da2('0x6'));var rimraf=require(_0x9da2('0x7'));var config=require(_0x9da2('0x8'));var attributes=require(_0x9da2('0x9'));module[_0x9da2('0xa')]=function(_0x64cf7,_0x5506a1){return _0x64cf7[_0x9da2('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x236057,_0x5422ae,_0xa2c3d6){if(_0x236057[_0x9da2('0xc')](_0x9da2('0xd'))){_0x236057['closedAt']=moment()[_0x9da2('0xe')](_0x9da2('0xf'));}_0xa2c3d6(null,_0x236057);}},'charset':_0x9da2('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe8af=['define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xe8af,0x1a1));var _0xfe8a=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0xe8af[_0x359bbe];return _0x1b3353;};'use strict';var _=require('lodash');var util=require(_0xfe8a('0x0'));var logger=require(_0xfe8a('0x1'))(_0xfe8a('0x2'));var moment=require(_0xfe8a('0x3'));var BPromise=require('bluebird');var rp=require(_0xfe8a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe8a('0x5'));var config=require(_0xfe8a('0x6'));var attributes=require(_0xfe8a('0x7'));module['exports']=function(_0x66c5a6,_0x3aeb4f){return _0x66c5a6[_0xfe8a('0x8')](_0xfe8a('0x9'),attributes,{'tableName':_0xfe8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x234da0,_0x2e3f3d,_0x28bb3b){if(_0x234da0['changed'](_0xfe8a('0xb'))){_0x234da0[_0xfe8a('0xc')]=moment()[_0xfe8a('0xd')](_0xfe8a('0xe'));}_0x28bb3b(null,_0x234da0);}},'charset':_0xfe8a('0xf'),'collate':_0xfe8a('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 94e666d..63c8e6c 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 _0x17a4=['ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','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','ChatInteraction','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags'];(function(_0x3d18af,_0x5b4fa0){var _0x2ef919=function(_0x3c26d6){while(--_0x3c26d6){_0x3d18af['push'](_0x3d18af['shift']());}};_0x2ef919(++_0x5b4fa0);}(_0x17a4,0x1bb));var _0x417a=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x17a4[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x417a('0x0'));var util=require('util');var moment=require(_0x417a('0x1'));var BPromise=require(_0x417a('0x2'));var rs=require(_0x417a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x417a('0x4'))('rpc');var config=require(_0x417a('0x5'));var jayson=require(_0x417a('0x6'));var client=jayson[_0x417a('0x7')]['http']({'port':0x232a});config[_0x417a('0x8')]=_[_0x417a('0x9')](config[_0x417a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x417a('0xa'))(new Redis(config[_0x417a('0x8')]));require(_0x417a('0xb'))[_0x417a('0xc')](socket);function respondWithRpcPromise(_0x159f68,_0xfaddc,_0x862792){return new BPromise(function(_0x5760f0,_0x2e7114){return client[_0x417a('0xd')](_0x159f68,_0x862792)[_0x417a('0xe')](function(_0xfbbc9a){logger[_0x417a('0xf')](_0x417a('0x10'),_0xfaddc,_0x417a('0x11'));logger[_0x417a('0x12')](_0x417a('0x13'),_0xfaddc,'request\x20sent',JSON[_0x417a('0x14')](_0xfbbc9a));if(_0xfbbc9a['error']){if(_0xfbbc9a[_0x417a('0x15')][_0x417a('0x16')]===0x1f4){logger[_0x417a('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xfaddc,_0xfbbc9a['error']['message']);return _0x2e7114(_0xfbbc9a[_0x417a('0x15')][_0x417a('0x17')]);}logger[_0x417a('0x15')](_0x417a('0x10'),_0xfaddc,_0xfbbc9a[_0x417a('0x15')][_0x417a('0x17')]);return _0x5760f0(_0xfbbc9a[_0x417a('0x15')][_0x417a('0x17')]);}else{logger[_0x417a('0xf')](_0x417a('0x10'),_0xfaddc,_0x417a('0x11'));_0x5760f0(_0xfbbc9a[_0x417a('0x18')][_0x417a('0x17')]);}})[_0x417a('0x19')](function(_0x577b8a){logger[_0x417a('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xfaddc,_0x577b8a);_0x2e7114(_0x577b8a);});});}exports[_0x417a('0x1a')]=function(_0x5b8a8e){var _0x3a5412=this;return new Promise(function(_0x406113,_0x162f20){return db[_0x417a('0x1b')]['update'](_0x5b8a8e[_0x417a('0x1c')],{'raw':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e[_0x417a('0x1d')][_0x417a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e['options'][_0x417a('0x1f')]||null:null,'attributes':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e[_0x417a('0x1d')][_0x417a('0x20')]||null:null,'limit':_0x5b8a8e[_0x417a('0x1d')]?_0x5b8a8e[_0x417a('0x1d')][_0x417a('0x21')]||null:null})[_0x417a('0xe')](function(_0x11827f){logger[_0x417a('0xf')]('UpdateChatInteraction',_0x5b8a8e);logger[_0x417a('0x12')](_0x417a('0x1a'),_0x5b8a8e,JSON[_0x417a('0x14')](_0x11827f));_0x406113(_0x11827f);})[_0x417a('0x19')](function(_0x49784f){logger[_0x417a('0x15')](_0x417a('0x1a'),_0x49784f['message'],_0x5b8a8e);_0x162f20(_0x3a5412[_0x417a('0x15')](0x1f4,_0x49784f[_0x417a('0x17')]));});});};exports[_0x417a('0x22')]=function(_0x38c420){return new Promise(function(_0x382b5b,_0x235cf6){return db[_0x417a('0x1b')][_0x417a('0x23')]({'where':_0x38c420[_0x417a('0x1d')]?_0x38c420[_0x417a('0x1d')]['where']||null:null})['then'](function(_0x436fc6){if(_0x436fc6){return _0x436fc6[_0x417a('0x24')](_0x38c420[_0x417a('0x1c')][_0x417a('0x25')],_['omit'](_0x38c420['body'],[_0x417a('0x25'),'id'])||{});}})[_0x417a('0x26')](function(_0x125a4c){logger['info'](_0x417a('0x27'),_0x38c420);logger[_0x417a('0x12')](_0x417a('0x27'),_0x38c420,JSON[_0x417a('0x14')](_0x125a4c));_0x382b5b(_0x125a4c);})['catch'](function(_0x13f8cf){logger[_0x417a('0x15')](_0x417a('0x27'),_0x13f8cf[_0x417a('0x17')],_0x38c420);_0x235cf6(_this[_0x417a('0x15')](0x1f4,_0x13f8cf['message']));});});};
\ No newline at end of file
+var _0x7df8=['then','debug','UpdateChatInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ChatInteraction','body','options','where','limit'];(function(_0x189b1d,_0x1df005){var _0x3d8ab0=function(_0x59a27f){while(--_0x59a27f){_0x189b1d['push'](_0x189b1d['shift']());}};_0x3d8ab0(++_0x1df005);}(_0x7df8,0x1f1));var _0x87df=function(_0x73302,_0x49d341){_0x73302=_0x73302-0x0;var _0x1e65b9=_0x7df8[_0x73302];return _0x1e65b9;};'use strict';var _=require(_0x87df('0x0'));var util=require(_0x87df('0x1'));var moment=require(_0x87df('0x2'));var BPromise=require(_0x87df('0x3'));var rs=require(_0x87df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87df('0x5'))['db'];var utils=require(_0x87df('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x87df('0x7'));var jayson=require(_0x87df('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x87df('0x9'),'port':0x18eb});var socket=require(_0x87df('0xa'))(new Redis(config[_0x87df('0xb')]));require(_0x87df('0xc'))[_0x87df('0xd')](socket);function respondWithRpcPromise(_0x3a0a2e,_0x11354a,_0x1a9735){return new BPromise(function(_0x36956d,_0x2d8ad9){return client[_0x87df('0xe')](_0x3a0a2e,_0x1a9735)['then'](function(_0x75aaff){logger[_0x87df('0xf')](_0x87df('0x10'),_0x11354a,_0x87df('0x11'));logger['debug'](_0x87df('0x12'),_0x11354a,'request\x20sent',JSON[_0x87df('0x13')](_0x75aaff));if(_0x75aaff[_0x87df('0x14')]){if(_0x75aaff['error']['code']===0x1f4){logger[_0x87df('0x14')](_0x87df('0x10'),_0x11354a,_0x75aaff[_0x87df('0x14')]['message']);return _0x2d8ad9(_0x75aaff[_0x87df('0x14')][_0x87df('0x15')]);}logger['error'](_0x87df('0x10'),_0x11354a,_0x75aaff[_0x87df('0x14')][_0x87df('0x15')]);return _0x36956d(_0x75aaff[_0x87df('0x14')][_0x87df('0x15')]);}else{logger[_0x87df('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x11354a,_0x87df('0x11'));_0x36956d(_0x75aaff['result'][_0x87df('0x15')]);}})[_0x87df('0x16')](function(_0x23ff95){logger[_0x87df('0x14')](_0x87df('0x10'),_0x11354a,_0x23ff95);_0x2d8ad9(_0x23ff95);});});}exports['UpdateChatInteraction']=function(_0x2c83a0){var _0x25edb5=this;return new Promise(function(_0x390553,_0x35061c){return db[_0x87df('0x17')]['update'](_0x2c83a0[_0x87df('0x18')],{'raw':_0x2c83a0[_0x87df('0x19')]?_0x2c83a0[_0x87df('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c83a0[_0x87df('0x19')]?_0x2c83a0[_0x87df('0x19')][_0x87df('0x1a')]||null:null,'attributes':_0x2c83a0['options']?_0x2c83a0[_0x87df('0x19')]['attributes']||null:null,'limit':_0x2c83a0['options']?_0x2c83a0['options'][_0x87df('0x1b')]||null:null})[_0x87df('0x1c')](function(_0x388097){logger['info']('UpdateChatInteraction',_0x2c83a0);logger[_0x87df('0x1d')](_0x87df('0x1e'),_0x2c83a0,JSON[_0x87df('0x13')](_0x388097));_0x390553(_0x388097);})[_0x87df('0x16')](function(_0x3a91c3){logger['error'](_0x87df('0x1e'),_0x3a91c3[_0x87df('0x15')],_0x2c83a0);_0x35061c(_0x25edb5['error'](0x1f4,_0x3a91c3[_0x87df('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x2a5cd7){return new Promise(function(_0x598291,_0x479659){return db[_0x87df('0x17')][_0x87df('0x1f')]({'where':_0x2a5cd7[_0x87df('0x19')]?_0x2a5cd7[_0x87df('0x19')][_0x87df('0x1a')]||null:null})[_0x87df('0x1c')](function(_0x2094d9){if(_0x2094d9){return _0x2094d9['addTags'](_0x2a5cd7[_0x87df('0x18')][_0x87df('0x20')],_[_0x87df('0x21')](_0x2a5cd7[_0x87df('0x18')],['ids','id'])||{});}})['spread'](function(_0x20183d){logger[_0x87df('0xf')]('AddTags',_0x2a5cd7);logger['debug'](_0x87df('0x22'),_0x2a5cd7,JSON[_0x87df('0x13')](_0x20183d));_0x598291(_0x20183d);})[_0x87df('0x16')](function(_0x49b330){logger[_0x87df('0x14')](_0x87df('0x22'),_0x49b330['message'],_0x2a5cd7);_0x479659(_this['error'](0x1f4,_0x49b330[_0x87df('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f8d3a64..a573f48 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 _0xac22=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x424800,_0x173bce){var _0x13e2f4=function(_0x550915){while(--_0x550915){_0x424800['push'](_0x424800['shift']());}};_0x13e2f4(++_0x173bce);}(_0xac22,0x172));var _0x2ac2=function(_0x37043b,_0x3131df){_0x37043b=_0x37043b-0x0;var _0x50b0c0=_0xac22[_0x37043b];return _0x50b0c0;};'use strict';var ChatInteractionEvents=require(_0x2ac2('0x0'));var events=[_0x2ac2('0x1'),_0x2ac2('0x2'),_0x2ac2('0x3')];function createListener(_0x5afe32,_0x373b25){return function(_0x2a13c6){_0x373b25[_0x2ac2('0x4')](_0x5afe32,_0x2a13c6);};}function removeListener(_0x3a109d,_0x13902c){return function(){ChatInteractionEvents[_0x2ac2('0x5')](_0x3a109d,_0x13902c);};}exports[_0x2ac2('0x6')]=function(_0x57c3c3){for(var _0x385015=0x0,_0xb9cc0b=events[_0x2ac2('0x7')];_0x385015<_0xb9cc0b;_0x385015++){var _0x44b2eb=events[_0x385015];var _0x1439de=createListener(_0x2ac2('0x8')+_0x44b2eb,_0x57c3c3);ChatInteractionEvents['on'](_0x44b2eb,_0x1439de);}};
\ No newline at end of file
+var _0x1b15=['register','length','chatInteraction:','./chatInteraction.events','save','remove','emit'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x1b15,0x81));var _0x51b1=function(_0x5a4040,_0x10f3b0){_0x5a4040=_0x5a4040-0x0;var _0x122652=_0x1b15[_0x5a4040];return _0x122652;};'use strict';var ChatInteractionEvents=require(_0x51b1('0x0'));var events=[_0x51b1('0x1'),_0x51b1('0x2'),'update'];function createListener(_0x285f42,_0x77f306){return function(_0x638cc1){_0x77f306[_0x51b1('0x3')](_0x285f42,_0x638cc1);};}function removeListener(_0x30f3f9,_0x3c7805){return function(){ChatInteractionEvents['removeListener'](_0x30f3f9,_0x3c7805);};}exports[_0x51b1('0x4')]=function(_0x52f185){for(var _0x16d0a4=0x0,_0x46b3ea=events[_0x51b1('0x5')];_0x16d0a4<_0x46b3ea;_0x16d0a4++){var _0xe69605=events[_0x16d0a4];var _0x37d594=createListener(_0x51b1('0x6')+_0xe69605,_0x52f185);ChatInteractionEvents['on'](_0xe69605,_0x37d594);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3b3b56a..a8d0e4a 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 _0xe606=['index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','replace','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated'];(function(_0x2fb7ce,_0x4be2fa){var _0x9ccd5a=function(_0x3d2d2f){while(--_0x3d2d2f){_0x2fb7ce['push'](_0x2fb7ce['shift']());}};_0x9ccd5a(++_0x4be2fa);}(_0xe606,0x93));var _0x6e60=function(_0x193868,_0xa30942){_0x193868=_0x193868-0x0;var _0x419415=_0xe606[_0x193868];return _0x419415;};'use strict';var multer=require(_0x6e60('0x0'));var util=require('util');var path=require(_0x6e60('0x1'));var timeout=require(_0x6e60('0x2'));var express=require(_0x6e60('0x3'));var router=express[_0x6e60('0x4')]();var fs_extra=require(_0x6e60('0x5'));var auth=require(_0x6e60('0x6'));var interaction=require(_0x6e60('0x7'));var config=require(_0x6e60('0x8'));var controller=require(_0x6e60('0x9'));router[_0x6e60('0xa')]('/',auth[_0x6e60('0xb')](),controller[_0x6e60('0xc')]);router[_0x6e60('0xa')](_0x6e60('0xd'),auth[_0x6e60('0xb')](),controller[_0x6e60('0xe')]);router[_0x6e60('0xa')](_0x6e60('0xf'),auth[_0x6e60('0x10')](),controller[_0x6e60('0x11')]);router['get'](_0x6e60('0x12'),auth[_0x6e60('0x10')](),controller[_0x6e60('0x13')]);router[_0x6e60('0xa')](_0x6e60('0x14'),auth[_0x6e60('0xb')](),controller[_0x6e60('0x15')]);router[_0x6e60('0xa')](_0x6e60('0x16'),auth[_0x6e60('0x10')](),controller['getMyMessages']);router[_0x6e60('0xa')](_0x6e60('0x17'),auth[_0x6e60('0xb')](),controller[_0x6e60('0x18')]);router[_0x6e60('0x19')]('/',auth[_0x6e60('0xb')](),controller[_0x6e60('0x1a')]);router[_0x6e60('0x19')](_0x6e60('0x1b'),auth[_0x6e60('0xb')](),controller[_0x6e60('0x1c')]);var upload=multer({'storage':multer[_0x6e60('0x1d')]({'destination':function(_0x3e7a7f,_0x3a2208,_0x287308){_0x287308(null,path[_0x6e60('0x1e')](config['root'],'server/files/attachments/'));},'filename':function(_0x2d510c,_0x384132,_0x49b1c8){_0x49b1c8(null,util[_0x6e60('0x1f')](_0x6e60('0x20'),Date[_0x6e60('0x21')](),_0x384132['originalname'][_0x6e60('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6e60('0x19')]('/:id/attachment_upload',upload[_0x6e60('0x23')](_0x6e60('0x24')),controller['attachmentUpload']);router[_0x6e60('0x19')]('/:id/messages',auth[_0x6e60('0x10')](),controller[_0x6e60('0x25')]);router['post'](_0x6e60('0x26'),auth['isAuthenticated'](),interaction[_0x6e60('0x27')](_0x6e60('0x28'),_0x6e60('0x29')),controller[_0x6e60('0x2a')]);router['put'](_0x6e60('0xf'),auth[_0x6e60('0xb')](),interaction['tracked']('chat',_0x6e60('0x2b')),controller[_0x6e60('0x2c')]);router[_0x6e60('0x2d')]('/:id/custom_update',controller[_0x6e60('0x2e')]);router[_0x6e60('0x2d')](_0x6e60('0x2f'),auth[_0x6e60('0x10')](),controller[_0x6e60('0x30')]);router[_0x6e60('0x2d')]('/:id/close',controller['close']);router[_0x6e60('0x31')](_0x6e60('0xf'),auth[_0x6e60('0xb')](),interaction[_0x6e60('0x27')](_0x6e60('0x28'),_0x6e60('0x32')),controller[_0x6e60('0x33')]);router['delete']('/:id/tags',auth[_0x6e60('0xb')](),controller['removeTags']);module[_0x6e60('0x34')]=router;
\ No newline at end of file
+var _0x55fd=['describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','isAuthenticated'];(function(_0xc93fcf,_0x2db4fe){var _0x182f27=function(_0x26fd4b){while(--_0x26fd4b){_0xc93fcf['push'](_0xc93fcf['shift']());}};_0x182f27(++_0x2db4fe);}(_0x55fd,0x1ca));var _0xd55f=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x55fd[_0xdc37a1];return _0x99b4fe;};'use strict';var multer=require(_0xd55f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd55f('0x1'));var router=express['Router']();var fs_extra=require(_0xd55f('0x2'));var auth=require(_0xd55f('0x3'));var interaction=require(_0xd55f('0x4'));var config=require(_0xd55f('0x5'));var controller=require(_0xd55f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd55f('0x7')]);router[_0xd55f('0x8')]('/describe',auth[_0xd55f('0x9')](),controller[_0xd55f('0xa')]);router[_0xd55f('0x8')](_0xd55f('0xb'),auth[_0xd55f('0xc')](),controller[_0xd55f('0xd')]);router[_0xd55f('0x8')]('/:id/attachment_download',auth[_0xd55f('0xc')](),controller[_0xd55f('0xe')]);router[_0xd55f('0x8')](_0xd55f('0xf'),auth[_0xd55f('0x9')](),controller[_0xd55f('0x10')]);router['get'](_0xd55f('0x11'),auth[_0xd55f('0xc')](),controller['getMyMessages']);router[_0xd55f('0x8')](_0xd55f('0x12'),auth[_0xd55f('0x9')](),controller[_0xd55f('0x13')]);router['post']('/',auth[_0xd55f('0x9')](),controller[_0xd55f('0x14')]);router[_0xd55f('0x15')](_0xd55f('0x16'),auth[_0xd55f('0x9')](),controller[_0xd55f('0x17')]);var upload=multer({'storage':multer[_0xd55f('0x18')]({'destination':function(_0x24c030,_0x17d205,_0x1fb575){_0x1fb575(null,path[_0xd55f('0x19')](config[_0xd55f('0x1a')],_0xd55f('0x1b')));},'filename':function(_0x214eeb,_0x54c040,_0x22ba8e){_0x22ba8e(null,util[_0xd55f('0x1c')](_0xd55f('0x1d'),Date[_0xd55f('0x1e')](),_0x54c040['originalname'][_0xd55f('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd55f('0x20'),upload[_0xd55f('0x21')](_0xd55f('0x22')),controller[_0xd55f('0x23')]);router[_0xd55f('0x15')](_0xd55f('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xd55f('0x24')]);router[_0xd55f('0x15')](_0xd55f('0x25'),auth[_0xd55f('0x9')](),interaction[_0xd55f('0x26')](_0xd55f('0x27'),_0xd55f('0x28')),controller['addTags']);router[_0xd55f('0x29')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xd55f('0x27'),_0xd55f('0x2a')),controller[_0xd55f('0x2b')]);router[_0xd55f('0x29')](_0xd55f('0x2c'),controller[_0xd55f('0x2d')]);router[_0xd55f('0x29')]('/:id/abandon',auth[_0xd55f('0xc')](),controller[_0xd55f('0x2e')]);router[_0xd55f('0x29')](_0xd55f('0x2f'),controller[_0xd55f('0x30')]);router[_0xd55f('0x31')](_0xd55f('0xb'),auth[_0xd55f('0x9')](),interaction[_0xd55f('0x26')]('chat',_0xd55f('0x32')),controller['destroy']);router[_0xd55f('0x31')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd55f('0x33')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 137f2e3..ae9973f 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 _0x7e1b=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7e1b,0x124));var _0xb7e1=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x7e1b[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require(_0xb7e1('0x0'));module[_0xb7e1('0x1')]={'body':{'type':Sequelize[_0xb7e1('0x2')](_0xb7e1('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb7e1('0x4')]}};
\ No newline at end of file
+var _0x4c84=['sequelize','TEXT','medium'];(function(_0x29be19,_0x1f63c5){var _0x212385=function(_0x389450){while(--_0x389450){_0x29be19['push'](_0x29be19['shift']());}};_0x212385(++_0x1f63c5);}(_0x4c84,0xe4));var _0x44c8=function(_0x3fab48,_0x1d55ea){_0x3fab48=_0x3fab48-0x0;var _0x11dd8d=_0x4c84[_0x3fab48];return _0x11dd8d;};'use strict';var Sequelize=require(_0x44c8('0x0'));module['exports']={'body':{'type':Sequelize[_0x44c8('0x1')](_0x44c8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index d074e59..f4d26ff 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 _0xee9d=['sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','find','create','body','update','describe','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x82b791,_0x31f657){var _0x27c356=function(_0x1e3ba4){while(--_0x1e3ba4){_0x82b791['push'](_0x82b791['shift']());}};_0x27c356(++_0x31f657);}(_0xee9d,0xce));var _0xdee9=function(_0xcc86cb,_0x117504){_0xcc86cb=_0xcc86cb-0x0;var _0xabf3ae=_0xee9d[_0xcc86cb];return _0xabf3ae;};'use strict';var emlformat=require(_0xdee9('0x0'));var rimraf=require(_0xdee9('0x1'));var zipdir=require(_0xdee9('0x2'));var jsonpatch=require(_0xdee9('0x3'));var rp=require('request-promise');var moment=require(_0xdee9('0x4'));var BPromise=require(_0xdee9('0x5'));var Mustache=require(_0xdee9('0x6'));var util=require(_0xdee9('0x7'));var path=require(_0xdee9('0x8'));var sox=require(_0xdee9('0x9'));var csv=require(_0xdee9('0xa'));var ejs=require(_0xdee9('0xb'));var fs=require('fs');var fs_extra=require(_0xdee9('0xc'));var _=require(_0xdee9('0xd'));var squel=require(_0xdee9('0xe'));var crypto=require(_0xdee9('0xf'));var jsforce=require(_0xdee9('0x10'));var deskjs=require(_0xdee9('0x11'));var toCsv=require(_0xdee9('0xa'));var querystring=require(_0xdee9('0x12'));var Papa=require(_0xdee9('0x13'));var Redis=require(_0xdee9('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdee9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdee9('0x16'));var utils=require(_0xdee9('0x17'));var config=require(_0xdee9('0x18'));var licenseUtil=require(_0xdee9('0x19'));var db=require('../../mysqldb')['db'];config[_0xdee9('0x1a')]=_[_0xdee9('0x1b')](config[_0xdee9('0x1a')],{'host':_0xdee9('0x1c'),'port':0x18eb});var socket=require(_0xdee9('0x1d'))(new Redis(config[_0xdee9('0x1a')]));require(_0xdee9('0x1e'))[_0xdee9('0x1f')](socket);function respondWithStatusCode(_0x50ecbd,_0x5c9b74){_0x5c9b74=_0x5c9b74||0xcc;return function(_0x5b5d94){if(_0x5b5d94){return _0x50ecbd[_0xdee9('0x20')](_0x5c9b74);}return _0x50ecbd['status'](_0x5c9b74)[_0xdee9('0x21')]();};}function respondWithResult(_0x5561e0,_0x2691f9){_0x2691f9=_0x2691f9||0xc8;return function(_0x5820f8){if(_0x5820f8){return _0x5561e0[_0xdee9('0x22')](_0x2691f9)['json'](_0x5820f8);}};}function respondWithFilteredResult(_0x50373b,_0x4a2733){return function(_0x4fa948){if(_0x4fa948){var _0x1f6499=typeof _0x4a2733[_0xdee9('0x23')]===_0xdee9('0x24')&&typeof _0x4a2733['limit']===_0xdee9('0x24');var _0x84fe7a=_0x4fa948[_0xdee9('0x25')];var _0x44f45d=_0x1f6499?0x0:_0x4a2733[_0xdee9('0x23')];var _0x1ffa39=_0x1f6499?_0x4fa948[_0xdee9('0x25')]:_0x4a2733[_0xdee9('0x23')]+_0x4a2733[_0xdee9('0x26')];var _0x5635f2;if(_0x1ffa39>=_0x84fe7a){_0x1ffa39=_0x84fe7a;_0x5635f2=0xc8;}else{_0x5635f2=0xce;}_0x50373b[_0xdee9('0x22')](_0x5635f2);return _0x50373b[_0xdee9('0x27')](_0xdee9('0x28'),_0x44f45d+'-'+_0x1ffa39+'/'+_0x84fe7a)[_0xdee9('0x29')](_0x4fa948);}return null;};}function patchUpdates(_0x59395c){return function(_0x51c0ae){try{jsonpatch[_0xdee9('0x2a')](_0x51c0ae,_0x59395c,!![]);}catch(_0x501775){return BPromise[_0xdee9('0x2b')](_0x501775);}return _0x51c0ae[_0xdee9('0x2c')]();};}function saveUpdates(_0x33e844,_0x3eeb36){return function(_0x485f50){if(_0x485f50){return _0x485f50['update'](_0x33e844)['then'](function(_0x44822b){return _0x44822b;});}return null;};}function removeEntity(_0xe45236,_0x34bd17){return function(_0x2b1688){if(_0x2b1688){return _0x2b1688[_0xdee9('0x2d')]()[_0xdee9('0x2e')](function(){_0xe45236[_0xdee9('0x22')](0xcc)[_0xdee9('0x21')]();});}};}function handleEntityNotFound(_0x27e00b,_0x3e15d5){return function(_0x2e246){if(!_0x2e246){_0x27e00b[_0xdee9('0x20')](0x194);}return _0x2e246;};}function handleError(_0x3e3d5a,_0x5e774e){_0x5e774e=_0x5e774e||0x1f4;return function(_0xe1c244){logger[_0xdee9('0x2f')](_0xe1c244[_0xdee9('0x30')]);if(_0xe1c244['name']){delete _0xe1c244['name'];}_0x3e3d5a[_0xdee9('0x22')](_0x5e774e)[_0xdee9('0x31')](_0xe1c244);};}exports[_0xdee9('0x32')]=function(_0x18398a,_0x4e2950){var _0x486a2b={},_0x5dc61b={},_0x1187b8={'count':0x0,'rows':[]};var _0x1de5b1=_['map'](db[_0xdee9('0x33')][_0xdee9('0x34')],function(_0x2ebe93){return{'name':_0x2ebe93[_0xdee9('0x35')],'type':_0x2ebe93[_0xdee9('0x36')][_0xdee9('0x37')]};});_0x5dc61b[_0xdee9('0x38')]=_[_0xdee9('0x39')](_0x1de5b1,_0xdee9('0x3a'));_0x5dc61b['query']=_[_0xdee9('0x3b')](_0x18398a[_0xdee9('0x3c')]);_0x5dc61b[_0xdee9('0x3d')]=_[_0xdee9('0x3e')](_0x5dc61b['model'],_0x5dc61b[_0xdee9('0x3c')]);_0x486a2b[_0xdee9('0x3f')]=_[_0xdee9('0x3e')](_0x5dc61b[_0xdee9('0x38')],qs['fields'](_0x18398a[_0xdee9('0x3c')][_0xdee9('0x40')]));_0x486a2b[_0xdee9('0x3f')]=_0x486a2b[_0xdee9('0x3f')][_0xdee9('0x41')]?_0x486a2b[_0xdee9('0x3f')]:_0x5dc61b['model'];if(!_0x18398a['query'][_0xdee9('0x42')](_0xdee9('0x43'))){_0x486a2b[_0xdee9('0x26')]=qs[_0xdee9('0x26')](_0x18398a['query'][_0xdee9('0x26')]);_0x486a2b[_0xdee9('0x23')]=qs[_0xdee9('0x23')](_0x18398a['query'][_0xdee9('0x23')]);}_0x486a2b[_0xdee9('0x44')]=qs[_0xdee9('0x45')](_0x18398a[_0xdee9('0x3c')]['sort']);_0x486a2b[_0xdee9('0x46')]=qs[_0xdee9('0x3d')](_[_0xdee9('0x47')](_0x18398a[_0xdee9('0x3c')],_0x5dc61b[_0xdee9('0x3d')]),_0x1de5b1);if(_0x18398a[_0xdee9('0x3c')]['filter']){_0x486a2b[_0xdee9('0x46')]=_[_0xdee9('0x48')](_0x486a2b[_0xdee9('0x46')],{'$or':_['map'](_0x1de5b1,function(_0x3fafa4){if(_0x3fafa4[_0xdee9('0x36')]!==_0xdee9('0x49')){var _0x536031={};_0x536031[_0x3fafa4[_0xdee9('0x3a')]]={'$like':'%'+_0x18398a['query'][_0xdee9('0x4a')]+'%'};return _0x536031;}})});}_0x486a2b=_[_0xdee9('0x48')]({},_0x486a2b,_0x18398a[_0xdee9('0x4b')]);var _0x5dbb90={'where':_0x486a2b['where']};return db[_0xdee9('0x33')][_0xdee9('0x25')](_0x5dbb90)[_0xdee9('0x2e')](function(_0x3f66ae){_0x1187b8[_0xdee9('0x25')]=_0x3f66ae;if(_0x18398a[_0xdee9('0x3c')][_0xdee9('0x4c')]){_0x486a2b['include']=[{'all':!![]}];}return db[_0xdee9('0x33')]['findAll'](_0x486a2b);})[_0xdee9('0x2e')](function(_0x30778c){_0x1187b8[_0xdee9('0x4d')]=_0x30778c;return _0x1187b8;})[_0xdee9('0x2e')](respondWithFilteredResult(_0x4e2950,_0x486a2b))[_0xdee9('0x4e')](handleError(_0x4e2950,null));};exports[_0xdee9('0x4f')]=function(_0x593a08,_0x4352c8){var _0x112ffd={'raw':!![],'where':{'id':_0x593a08[_0xdee9('0x50')]['id']}},_0x4fdb88={};_0x4fdb88[_0xdee9('0x38')]=_[_0xdee9('0x3b')](db[_0xdee9('0x33')][_0xdee9('0x34')]);_0x4fdb88['query']=_[_0xdee9('0x3b')](_0x593a08[_0xdee9('0x3c')]);_0x4fdb88[_0xdee9('0x3d')]=_[_0xdee9('0x3e')](_0x4fdb88['model'],_0x4fdb88[_0xdee9('0x3c')]);_0x112ffd[_0xdee9('0x3f')]=_[_0xdee9('0x3e')](_0x4fdb88['model'],qs['fields'](_0x593a08[_0xdee9('0x3c')][_0xdee9('0x40')]));_0x112ffd['attributes']=_0x112ffd['attributes'][_0xdee9('0x41')]?_0x112ffd[_0xdee9('0x3f')]:_0x4fdb88[_0xdee9('0x38')];if(_0x593a08[_0xdee9('0x3c')][_0xdee9('0x4c')]){_0x112ffd['include']=[{'all':!![]}];}_0x112ffd=_[_0xdee9('0x48')]({},_0x112ffd,_0x593a08[_0xdee9('0x4b')]);return db[_0xdee9('0x33')][_0xdee9('0x51')](_0x112ffd)[_0xdee9('0x2e')](handleEntityNotFound(_0x4352c8,null))[_0xdee9('0x2e')](respondWithResult(_0x4352c8,null))[_0xdee9('0x4e')](handleError(_0x4352c8,null));};exports[_0xdee9('0x52')]=function(_0x40d4f8,_0x5581ac){return db[_0xdee9('0x33')]['create'](_0x40d4f8[_0xdee9('0x53')],{})[_0xdee9('0x2e')](respondWithResult(_0x5581ac,0xc9))[_0xdee9('0x4e')](handleError(_0x5581ac,null));};exports[_0xdee9('0x54')]=function(_0xe0e48c,_0x30e0ca){if(_0xe0e48c['body']['id']){delete _0xe0e48c[_0xdee9('0x53')]['id'];}return db[_0xdee9('0x33')][_0xdee9('0x51')]({'where':{'id':_0xe0e48c[_0xdee9('0x50')]['id']}})['then'](handleEntityNotFound(_0x30e0ca,null))[_0xdee9('0x2e')](saveUpdates(_0xe0e48c[_0xdee9('0x53')],null))[_0xdee9('0x2e')](respondWithResult(_0x30e0ca,null))['catch'](handleError(_0x30e0ca,null));};exports[_0xdee9('0x2d')]=function(_0xd6856c,_0x5e2749){return db['ChatInternalMessage'][_0xdee9('0x51')]({'where':{'id':_0xd6856c[_0xdee9('0x50')]['id']}})[_0xdee9('0x2e')](handleEntityNotFound(_0x5e2749,null))[_0xdee9('0x2e')](removeEntity(_0x5e2749,null))[_0xdee9('0x4e')](handleError(_0x5e2749,null));};exports[_0xdee9('0x55')]=function(_0x728393,_0x64eb8c){return db['ChatInternalMessage'][_0xdee9('0x55')]()[_0xdee9('0x2e')](respondWithResult(_0x64eb8c,null))[_0xdee9('0x4e')](handleError(_0x64eb8c,null));};function wrapUser(_0x27cde3){return function(_0x1142aa){var _0x4b6495=_0x27cde3['get']({'plain':!![]});_0x4b6495[_0xdee9('0x56')]=[];if(_0x1142aa){_0x4b6495['lastMessageAt']=_0x1142aa[_0xdee9('0x57')];_0x4b6495[_0xdee9('0x58')]=_0x1142aa;}else{_0x4b6495[_0xdee9('0x59')]=moment(0x0)[_0xdee9('0x5a')](_0xdee9('0x5b'));_0x4b6495['lastMessage']={};}return _0x4b6495;};}exports[_0xdee9('0x5c')]=function(_0x5116fe,_0x564839,_0x48b3b1){var _0x28f6d5=[];return db[_0xdee9('0x5d')][_0xdee9('0x5e')]({'where':{'role':[_0xdee9('0x5f'),_0xdee9('0x60'),_0xdee9('0x61')]},'attributes':['id','fullname',_0xdee9('0x3a'),_0xdee9('0x62'),_0xdee9('0x63'),'internal',_0xdee9('0x64'),_0xdee9('0x65'),_0xdee9('0x66'),_0xdee9('0x67')],'order':qs[_0xdee9('0x45')](_0xdee9('0x68')),'include':[{'model':db[_0xdee9('0x69')],'as':_0xdee9('0x6a'),'attributes':['id',_0xdee9('0x3a'),'type'],'through':{'attributes':[]}}]})[_0xdee9('0x2e')](function(_0x5812c0){if(_0x5812c0){var _0x59eae1=_0x5116fe[_0xdee9('0x61')][_0xdee9('0x6b')]({'plain':!![]});if(!_0x59eae1)throw new Error(_0xdee9('0x6c'));if(_0x59eae1[_0xdee9('0x62')]===_0xdee9('0x61')){return db[_0xdee9('0x6d')]['find']({'where':{'name':_0xdee9('0x6e'),'userProfileId':_0x59eae1[_0xdee9('0x6f')]},'raw':!![]})['then'](function(_0x56be79){if(_0x56be79){if(_0x56be79[_0xdee9('0x70')]===0x0){return db[_0xdee9('0x71')][_0xdee9('0x5e')]({'where':{'sectionId':_0x56be79['id']},'raw':!![]})['then'](function(_0xede05f){var _0x344fa2=[];if(_[_0xdee9('0x72')](_0xede05f)){_0x344fa2=_[_0xdee9('0x4a')](_0x5812c0,function(_0x18f3d2){if(_0x18f3d2[_0xdee9('0x62')]!==_0xdee9('0x5f')){return _0x18f3d2;}});return _0x344fa2;}else{for(var _0xdf08da=0x0;_0xdf08da<_0x5812c0['length'];_0xdf08da++){var _0x737cc7=_0x5812c0[_0xdf08da];if(_0x737cc7[_0xdee9('0x62')]==='agent'){var _0x44409f=_['find'](_0xede05f,function(_0x58fa69){return _0x58fa69['resourceId']===_0x737cc7['id'];});if(_0x44409f)_0x344fa2[_0xdee9('0x73')](_0x737cc7);}else{_0x344fa2[_0xdee9('0x73')](_0x737cc7);}}return _0x344fa2;}});}else{return _0x5812c0;}}else{var _0x557977=_['filter'](_0x5812c0,function(_0x43559e){if(_0x43559e['role']!==_0xdee9('0x5f')){return _0x43559e;}});return _0x557977;}});}else{return _0x5812c0;}}})[_0xdee9('0x2e')](function(_0x47dcc6){var _0x4d5338=[];if(_0x47dcc6){_0x28f6d5=_0x47dcc6;for(var _0x3b4d72=0x0;_0x3b4d72<_0x47dcc6[_0xdee9('0x41')];_0x3b4d72+=0x1){_0x28f6d5[_0x3b4d72]['messages']=[];_0x4d5338['push'](db[_0xdee9('0x33')][_0xdee9('0x51')]({'where':{'FromId':[_0x5116fe['user']['id'],_0x47dcc6[_0x3b4d72]['id']],'ToId':[_0x5116fe[_0xdee9('0x61')]['id'],_0x47dcc6[_0x3b4d72]['id']],'ChatGroupId':null},'attributes':['id',_0xdee9('0x57'),'FromId',_0xdee9('0x74'),_0xdee9('0x75'),_0xdee9('0x53')],'order':qs[_0xdee9('0x45')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdee9('0x2e')](wrapUser(_0x47dcc6[_0x3b4d72])));}return BPromise[_0xdee9('0x76')](_0x4d5338);}return[];})['then'](function(_0x25d13a){return{'rows':_0x25d13a,'count':_0x25d13a['length']};})['then'](respondWithResult(_0x564839,null))[_0xdee9('0x4e')](handleError(_0x564839,null));};
\ No newline at end of file
+var _0xe83e=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','role','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x4bacd2,_0x465d39){var _0x312fe7=function(_0x5916c7){while(--_0x5916c7){_0x4bacd2['push'](_0x4bacd2['shift']());}};_0x312fe7(++_0x465d39);}(_0xe83e,0x180));var _0xee83=function(_0x245500,_0x3ece34){_0x245500=_0x245500-0x0;var _0x3d934c=_0xe83e[_0x245500];return _0x3d934c;};'use strict';var emlformat=require(_0xee83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee83('0x1'));var jsonpatch=require(_0xee83('0x2'));var rp=require(_0xee83('0x3'));var moment=require('moment');var BPromise=require(_0xee83('0x4'));var Mustache=require(_0xee83('0x5'));var util=require('util');var path=require(_0xee83('0x6'));var sox=require('sox');var csv=require(_0xee83('0x7'));var ejs=require(_0xee83('0x8'));var fs=require('fs');var fs_extra=require(_0xee83('0x9'));var _=require('lodash');var squel=require(_0xee83('0xa'));var crypto=require(_0xee83('0xb'));var jsforce=require(_0xee83('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee83('0xd'));var Papa=require(_0xee83('0xe'));var Redis=require(_0xee83('0xf'));var authService=require(_0xee83('0x10'));var qs=require(_0xee83('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xee83('0x12'))(_0xee83('0x13'));var utils=require(_0xee83('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xee83('0x15'));var db=require(_0xee83('0x16'))['db'];config['redis']=_[_0xee83('0x17')](config['redis'],{'host':_0xee83('0x18'),'port':0x18eb});var socket=require(_0xee83('0x19'))(new Redis(config[_0xee83('0x1a')]));require('./chatInternalMessage.socket')[_0xee83('0x1b')](socket);function respondWithStatusCode(_0x454712,_0x1c3f45){_0x1c3f45=_0x1c3f45||0xcc;return function(_0x405c58){if(_0x405c58){return _0x454712[_0xee83('0x1c')](_0x1c3f45);}return _0x454712[_0xee83('0x1d')](_0x1c3f45)[_0xee83('0x1e')]();};}function respondWithResult(_0x474b25,_0x4ab994){_0x4ab994=_0x4ab994||0xc8;return function(_0x4c04ad){if(_0x4c04ad){return _0x474b25[_0xee83('0x1d')](_0x4ab994)[_0xee83('0x1f')](_0x4c04ad);}};}function respondWithFilteredResult(_0x1a647f,_0x19e9d4){return function(_0x7f12c0){if(_0x7f12c0){var _0x54ac2e=typeof _0x19e9d4['offset']===_0xee83('0x20')&&typeof _0x19e9d4[_0xee83('0x21')]===_0xee83('0x20');var _0xded38f=_0x7f12c0[_0xee83('0x22')];var _0x2538d3=_0x54ac2e?0x0:_0x19e9d4['offset'];var _0x10ccbc=_0x54ac2e?_0x7f12c0[_0xee83('0x22')]:_0x19e9d4[_0xee83('0x23')]+_0x19e9d4[_0xee83('0x21')];var _0x21a834;if(_0x10ccbc>=_0xded38f){_0x10ccbc=_0xded38f;_0x21a834=0xc8;}else{_0x21a834=0xce;}_0x1a647f['status'](_0x21a834);return _0x1a647f[_0xee83('0x24')](_0xee83('0x25'),_0x2538d3+'-'+_0x10ccbc+'/'+_0xded38f)[_0xee83('0x1f')](_0x7f12c0);}return null;};}function patchUpdates(_0x37a710){return function(_0x569e84){try{jsonpatch[_0xee83('0x26')](_0x569e84,_0x37a710,!![]);}catch(_0x1cd001){return BPromise['reject'](_0x1cd001);}return _0x569e84['save']();};}function saveUpdates(_0x2d2c12,_0xffce18){return function(_0x3f9406){if(_0x3f9406){return _0x3f9406[_0xee83('0x27')](_0x2d2c12)[_0xee83('0x28')](function(_0x53c7b2){return _0x53c7b2;});}return null;};}function removeEntity(_0x1cb295,_0x343bef){return function(_0x4fcae2){if(_0x4fcae2){return _0x4fcae2['destroy']()[_0xee83('0x28')](function(){_0x1cb295[_0xee83('0x1d')](0xcc)[_0xee83('0x1e')]();});}};}function handleEntityNotFound(_0x1c98f5,_0x220936){return function(_0x293848){if(!_0x293848){_0x1c98f5[_0xee83('0x1c')](0x194);}return _0x293848;};}function handleError(_0x14a189,_0x3a1d){_0x3a1d=_0x3a1d||0x1f4;return function(_0x58cf36){logger[_0xee83('0x29')](_0x58cf36[_0xee83('0x2a')]);if(_0x58cf36[_0xee83('0x2b')]){delete _0x58cf36[_0xee83('0x2b')];}_0x14a189[_0xee83('0x1d')](_0x3a1d)[_0xee83('0x2c')](_0x58cf36);};}exports[_0xee83('0x2d')]=function(_0x453d7a,_0x1cf2da){var _0x4c6197={},_0x24bf0b={},_0x4cc5ee={'count':0x0,'rows':[]};var _0x4f0314=_[_0xee83('0x2e')](db[_0xee83('0x2f')][_0xee83('0x30')],function(_0x26b004){return{'name':_0x26b004['fieldName'],'type':_0x26b004[_0xee83('0x31')][_0xee83('0x32')]};});_0x24bf0b['model']=_[_0xee83('0x2e')](_0x4f0314,_0xee83('0x2b'));_0x24bf0b[_0xee83('0x33')]=_[_0xee83('0x34')](_0x453d7a[_0xee83('0x33')]);_0x24bf0b[_0xee83('0x35')]=_[_0xee83('0x36')](_0x24bf0b[_0xee83('0x37')],_0x24bf0b[_0xee83('0x33')]);_0x4c6197[_0xee83('0x38')]=_[_0xee83('0x36')](_0x24bf0b[_0xee83('0x37')],qs[_0xee83('0x39')](_0x453d7a[_0xee83('0x33')][_0xee83('0x39')]));_0x4c6197[_0xee83('0x38')]=_0x4c6197['attributes'][_0xee83('0x3a')]?_0x4c6197['attributes']:_0x24bf0b['model'];if(!_0x453d7a[_0xee83('0x33')][_0xee83('0x3b')](_0xee83('0x3c'))){_0x4c6197[_0xee83('0x21')]=qs[_0xee83('0x21')](_0x453d7a['query'][_0xee83('0x21')]);_0x4c6197[_0xee83('0x23')]=qs['offset'](_0x453d7a[_0xee83('0x33')][_0xee83('0x23')]);}_0x4c6197[_0xee83('0x3d')]=qs[_0xee83('0x3e')](_0x453d7a['query'][_0xee83('0x3e')]);_0x4c6197[_0xee83('0x3f')]=qs[_0xee83('0x35')](_['pick'](_0x453d7a[_0xee83('0x33')],_0x24bf0b[_0xee83('0x35')]),_0x4f0314);if(_0x453d7a['query']['filter']){_0x4c6197[_0xee83('0x3f')]=_[_0xee83('0x40')](_0x4c6197[_0xee83('0x3f')],{'$or':_[_0xee83('0x2e')](_0x4f0314,function(_0x75d624){if(_0x75d624[_0xee83('0x31')]!=='VIRTUAL'){var _0x4567b0={};_0x4567b0[_0x75d624[_0xee83('0x2b')]]={'$like':'%'+_0x453d7a[_0xee83('0x33')][_0xee83('0x41')]+'%'};return _0x4567b0;}})});}_0x4c6197=_['merge']({},_0x4c6197,_0x453d7a[_0xee83('0x42')]);var _0x1e6808={'where':_0x4c6197['where']};return db[_0xee83('0x2f')][_0xee83('0x22')](_0x1e6808)[_0xee83('0x28')](function(_0x2eddfa){_0x4cc5ee['count']=_0x2eddfa;if(_0x453d7a[_0xee83('0x33')][_0xee83('0x43')]){_0x4c6197[_0xee83('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xee83('0x45')](_0x4c6197);})[_0xee83('0x28')](function(_0x1734f3){_0x4cc5ee[_0xee83('0x46')]=_0x1734f3;return _0x4cc5ee;})['then'](respondWithFilteredResult(_0x1cf2da,_0x4c6197))[_0xee83('0x47')](handleError(_0x1cf2da,null));};exports['show']=function(_0x486588,_0x5d13f8){var _0x230136={'raw':!![],'where':{'id':_0x486588[_0xee83('0x48')]['id']}},_0x1d0dd5={};_0x1d0dd5['model']=_['keys'](db[_0xee83('0x2f')][_0xee83('0x30')]);_0x1d0dd5[_0xee83('0x33')]=_[_0xee83('0x34')](_0x486588[_0xee83('0x33')]);_0x1d0dd5[_0xee83('0x35')]=_[_0xee83('0x36')](_0x1d0dd5[_0xee83('0x37')],_0x1d0dd5['query']);_0x230136['attributes']=_[_0xee83('0x36')](_0x1d0dd5[_0xee83('0x37')],qs['fields'](_0x486588[_0xee83('0x33')]['fields']));_0x230136[_0xee83('0x38')]=_0x230136[_0xee83('0x38')][_0xee83('0x3a')]?_0x230136[_0xee83('0x38')]:_0x1d0dd5['model'];if(_0x486588[_0xee83('0x33')][_0xee83('0x43')]){_0x230136[_0xee83('0x44')]=[{'all':!![]}];}_0x230136=_[_0xee83('0x40')]({},_0x230136,_0x486588[_0xee83('0x42')]);return db['ChatInternalMessage'][_0xee83('0x49')](_0x230136)[_0xee83('0x28')](handleEntityNotFound(_0x5d13f8,null))[_0xee83('0x28')](respondWithResult(_0x5d13f8,null))[_0xee83('0x47')](handleError(_0x5d13f8,null));};exports['create']=function(_0x5ee57c,_0x1d2efc){return db[_0xee83('0x2f')][_0xee83('0x4a')](_0x5ee57c[_0xee83('0x4b')],{})[_0xee83('0x28')](respondWithResult(_0x1d2efc,0xc9))[_0xee83('0x47')](handleError(_0x1d2efc,null));};exports[_0xee83('0x27')]=function(_0x1c490c,_0x5b1fd2){if(_0x1c490c[_0xee83('0x4b')]['id']){delete _0x1c490c[_0xee83('0x4b')]['id'];}return db[_0xee83('0x2f')][_0xee83('0x49')]({'where':{'id':_0x1c490c['params']['id']}})[_0xee83('0x28')](handleEntityNotFound(_0x5b1fd2,null))[_0xee83('0x28')](saveUpdates(_0x1c490c[_0xee83('0x4b')],null))[_0xee83('0x28')](respondWithResult(_0x5b1fd2,null))['catch'](handleError(_0x5b1fd2,null));};exports[_0xee83('0x4c')]=function(_0x4e6604,_0x5ce878){return db[_0xee83('0x2f')][_0xee83('0x49')]({'where':{'id':_0x4e6604[_0xee83('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ce878,null))[_0xee83('0x28')](removeEntity(_0x5ce878,null))[_0xee83('0x47')](handleError(_0x5ce878,null));};exports[_0xee83('0x4d')]=function(_0x360c58,_0x1f0cef){return db['ChatInternalMessage']['describe']()[_0xee83('0x28')](respondWithResult(_0x1f0cef,null))['catch'](handleError(_0x1f0cef,null));};function wrapUser(_0x126448){return function(_0x5e6b38){var _0x2fbc97=_0x126448[_0xee83('0x4e')]({'plain':!![]});_0x2fbc97[_0xee83('0x4f')]=[];if(_0x5e6b38){_0x2fbc97[_0xee83('0x50')]=_0x5e6b38[_0xee83('0x51')];_0x2fbc97[_0xee83('0x52')]=_0x5e6b38;}else{_0x2fbc97[_0xee83('0x50')]=moment(0x0)[_0xee83('0x53')](_0xee83('0x54'));_0x2fbc97['lastMessage']={};}return _0x2fbc97;};}exports[_0xee83('0x55')]=function(_0x24cba2,_0x580445,_0x593cee){var _0x2c5c7d=[];return db[_0xee83('0x56')]['findAll']({'where':{'role':[_0xee83('0x57'),_0xee83('0x58'),_0xee83('0x59')]},'attributes':['id',_0xee83('0x5a'),_0xee83('0x2b'),'role',_0xee83('0x5b'),_0xee83('0x5c'),_0xee83('0x5d'),'lastLoginAt',_0xee83('0x5e'),_0xee83('0x5f')],'order':qs['sort'](_0xee83('0x60')),'include':[{'model':db[_0xee83('0x61')],'as':_0xee83('0x62'),'attributes':['id',_0xee83('0x2b'),_0xee83('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x495500){if(_0x495500){var _0x52bd87=_0x24cba2[_0xee83('0x59')]['get']({'plain':!![]});if(!_0x52bd87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52bd87[_0xee83('0x63')]===_0xee83('0x59')){return db['UserProfileSection'][_0xee83('0x49')]({'where':{'name':_0xee83('0x64'),'userProfileId':_0x52bd87[_0xee83('0x65')]},'raw':!![]})[_0xee83('0x28')](function(_0x9812fb){if(_0x9812fb){if(_0x9812fb['autoAssociation']===0x0){return db[_0xee83('0x66')][_0xee83('0x45')]({'where':{'sectionId':_0x9812fb['id']},'raw':!![]})[_0xee83('0x28')](function(_0x47f6fe){var _0x3833b4=[];if(_[_0xee83('0x67')](_0x47f6fe)){_0x3833b4=_['filter'](_0x495500,function(_0x2a7412){if(_0x2a7412['role']!==_0xee83('0x57')){return _0x2a7412;}});return _0x3833b4;}else{for(var _0x1598be=0x0;_0x1598be<_0x495500['length'];_0x1598be++){var _0x1583cc=_0x495500[_0x1598be];if(_0x1583cc['role']===_0xee83('0x57')){var _0x4e68bc=_[_0xee83('0x49')](_0x47f6fe,function(_0x1fdc02){return _0x1fdc02[_0xee83('0x68')]===_0x1583cc['id'];});if(_0x4e68bc)_0x3833b4[_0xee83('0x69')](_0x1583cc);}else{_0x3833b4['push'](_0x1583cc);}}return _0x3833b4;}});}else{return _0x495500;}}else{var _0x852979=_[_0xee83('0x41')](_0x495500,function(_0x3c370a){if(_0x3c370a[_0xee83('0x63')]!==_0xee83('0x57')){return _0x3c370a;}});return _0x852979;}});}else{return _0x495500;}}})['then'](function(_0x20b137){var _0x37b380=[];if(_0x20b137){_0x2c5c7d=_0x20b137;for(var _0x3204d7=0x0;_0x3204d7<_0x20b137[_0xee83('0x3a')];_0x3204d7+=0x1){_0x2c5c7d[_0x3204d7]['messages']=[];_0x37b380['push'](db[_0xee83('0x2f')][_0xee83('0x49')]({'where':{'FromId':[_0x24cba2[_0xee83('0x59')]['id'],_0x20b137[_0x3204d7]['id']],'ToId':[_0x24cba2[_0xee83('0x59')]['id'],_0x20b137[_0x3204d7]['id']],'ChatGroupId':null},'attributes':['id',_0xee83('0x51'),_0xee83('0x6a'),_0xee83('0x6b'),_0xee83('0x6c'),'body'],'order':qs[_0xee83('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xee83('0x28')](wrapUser(_0x20b137[_0x3204d7])));}return BPromise[_0xee83('0x6d')](_0x37b380);}return[];})[_0xee83('0x28')](function(_0xcb12d9){return{'rows':_0xcb12d9,'count':_0xcb12d9[_0xee83('0x3a')]};})[_0xee83('0x28')](respondWithResult(_0x580445,null))['catch'](handleError(_0x580445,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 08fa5e5..17f92d2 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 _0xf401=['emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','update','remove'];(function(_0x942090,_0x400630){var _0x2abd03=function(_0x132066){while(--_0x132066){_0x942090['push'](_0x942090['shift']());}};_0x2abd03(++_0x400630);}(_0xf401,0xe3));var _0x1f40=function(_0x51f371,_0x876a24){_0x51f371=_0x51f371-0x0;var _0x11188e=_0xf401[_0x51f371];return _0x11188e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1f40('0x0'))['db'][_0x1f40('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f40('0x2'),'afterDestroy':_0x1f40('0x3')};function emitEvent(_0x59fbf1){return function(_0x31dde1,_0x373ecc,_0x2159bb){ChatInternalMessageEvents[_0x1f40('0x4')](_0x59fbf1+':'+_0x31dde1['id'],_0x31dde1);ChatInternalMessageEvents[_0x1f40('0x4')](_0x59fbf1,_0x31dde1);_0x2159bb(null);};}for(var e in events){if(events[_0x1f40('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x1f40('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5d2e=['events','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3e0bb2,_0x400cd6){var _0x476100=function(_0x315174){while(--_0x315174){_0x3e0bb2['push'](_0x3e0bb2['shift']());}};_0x476100(++_0x400cd6);}(_0x5d2e,0x120));var _0xe5d2=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5d2e[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0xe5d2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xe5d2('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5d2('0x2')](0x0);var events={'afterCreate':_0xe5d2('0x3'),'afterUpdate':'update','afterDestroy':_0xe5d2('0x4')};function emitEvent(_0x57c20a){return function(_0x17c2d2,_0x253eff,_0x159287){ChatInternalMessageEvents[_0xe5d2('0x5')](_0x57c20a+':'+_0x17c2d2['id'],_0x17c2d2);ChatInternalMessageEvents[_0xe5d2('0x5')](_0x57c20a,_0x17c2d2);_0x159287(null);};}for(var e in events){if(events[_0xe5d2('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe5d2('0x7')](e,emitEvent(event));}}module[_0xe5d2('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index b03cf70..187f4bb 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 _0x60be=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0x60be,0x142));var _0xe60b=function(_0x1fd28b,_0x7f3a39){_0x1fd28b=_0x1fd28b-0x0;var _0x71d5a1=_0x60be[_0x1fd28b];return _0x71d5a1;};'use strict';var _=require(_0xe60b('0x0'));var util=require(_0xe60b('0x1'));var logger=require(_0xe60b('0x2'))(_0xe60b('0x3'));var moment=require(_0xe60b('0x4'));var BPromise=require(_0xe60b('0x5'));var rp=require(_0xe60b('0x6'));var fs=require('fs');var path=require(_0xe60b('0x7'));var rimraf=require(_0xe60b('0x8'));var config=require(_0xe60b('0x9'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x2575ad,_0xb1d8be){return _0x2575ad[_0xe60b('0xa')](_0xe60b('0xb'),attributes,{'tableName':_0xe60b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2a78=['../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf'];(function(_0x15168f,_0xcd139b){var _0x484b3d=function(_0x156419){while(--_0x156419){_0x15168f['push'](_0x15168f['shift']());}};_0x484b3d(++_0xcd139b);}(_0x2a78,0xd7));var _0x82a7=function(_0x301979,_0x1127b6){_0x301979=_0x301979-0x0;var _0xafa18d=_0x2a78[_0x301979];return _0xafa18d;};'use strict';var _=require('lodash');var util=require(_0x82a7('0x0'));var logger=require('../../config/logger')(_0x82a7('0x1'));var moment=require(_0x82a7('0x2'));var BPromise=require('bluebird');var rp=require(_0x82a7('0x3'));var fs=require('fs');var path=require(_0x82a7('0x4'));var rimraf=require(_0x82a7('0x5'));var config=require(_0x82a7('0x6'));var attributes=require(_0x82a7('0x7'));module[_0x82a7('0x8')]=function(_0x1d04b7,_0x395832){return _0x1d04b7['define'](_0x82a7('0x9'),attributes,{'tableName':_0x82a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82a7('0xb'),'collate':_0x82a7('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index d9b738a..078fbb0 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 _0x7d28=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbbf250,_0x4cfddb){var _0x4e3bc2=function(_0x5668a6){while(--_0x5668a6){_0xbbf250['push'](_0xbbf250['shift']());}};_0x4e3bc2(++_0x4cfddb);}(_0x7d28,0x73));var _0x87d2=function(_0x9086df,_0x3a8a7b){_0x9086df=_0x9086df-0x0;var _0x9b0bfc=_0x7d28[_0x9086df];return _0x9b0bfc;};'use strict';var _=require(_0x87d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x87d2('0x1'));var rs=require(_0x87d2('0x2'));var fs=require('fs');var Redis=require(_0x87d2('0x3'));var db=require(_0x87d2('0x4'))['db'];var utils=require(_0x87d2('0x5'));var logger=require(_0x87d2('0x6'))(_0x87d2('0x7'));var config=require(_0x87d2('0x8'));var jayson=require(_0x87d2('0x9'));var client=jayson[_0x87d2('0xa')][_0x87d2('0xb')]({'port':0x232a});config['redis']=_[_0x87d2('0xc')](config[_0x87d2('0xd')],{'host':_0x87d2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87d2('0xd')]));require('./chatInternalMessage.socket')[_0x87d2('0xf')](socket);function respondWithRpcPromise(_0x35c66d,_0x121481,_0x37ca4e){return new BPromise(function(_0x199374,_0x3032c9){return client['request'](_0x35c66d,_0x37ca4e)['then'](function(_0x56523c){logger[_0x87d2('0x10')](_0x87d2('0x11'),_0x121481,_0x87d2('0x12'));logger[_0x87d2('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x121481,_0x87d2('0x12'),JSON['stringify'](_0x56523c));if(_0x56523c[_0x87d2('0x14')]){if(_0x56523c[_0x87d2('0x14')][_0x87d2('0x15')]===0x1f4){logger[_0x87d2('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x121481,_0x56523c['error'][_0x87d2('0x16')]);return _0x3032c9(_0x56523c[_0x87d2('0x14')]['message']);}logger[_0x87d2('0x14')](_0x87d2('0x11'),_0x121481,_0x56523c['error'][_0x87d2('0x16')]);return _0x199374(_0x56523c[_0x87d2('0x14')][_0x87d2('0x16')]);}else{logger[_0x87d2('0x10')](_0x87d2('0x11'),_0x121481,'request\x20sent');_0x199374(_0x56523c[_0x87d2('0x17')]['message']);}})['catch'](function(_0x46e523){logger[_0x87d2('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x121481,_0x46e523);_0x3032c9(_0x46e523);});});}
\ No newline at end of file
+var _0xf5a7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x499056,_0x29efc4){var _0x37feb6=function(_0x1edcd1){while(--_0x1edcd1){_0x499056['push'](_0x499056['shift']());}};_0x37feb6(++_0x29efc4);}(_0xf5a7,0x133));var _0x7f5a=function(_0x26fa3a,_0x530f65){_0x26fa3a=_0x26fa3a-0x0;var _0x494b57=_0xf5a7[_0x26fa3a];return _0x494b57;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var moment=require('moment');var BPromise=require(_0x7f5a('0x2'));var rs=require(_0x7f5a('0x3'));var fs=require('fs');var Redis=require(_0x7f5a('0x4'));var db=require(_0x7f5a('0x5'))['db'];var utils=require(_0x7f5a('0x6'));var logger=require(_0x7f5a('0x7'))(_0x7f5a('0x8'));var config=require(_0x7f5a('0x9'));var jayson=require(_0x7f5a('0xa'));var client=jayson['client'][_0x7f5a('0xb')]({'port':0x232a});config[_0x7f5a('0xc')]=_['defaults'](config[_0x7f5a('0xc')],{'host':_0x7f5a('0xd'),'port':0x18eb});var socket=require(_0x7f5a('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x7f5a('0xf')](socket);function respondWithRpcPromise(_0x43a45c,_0x570faa,_0x47cba6){return new BPromise(function(_0x438daa,_0x3bf4bd){return client['request'](_0x43a45c,_0x47cba6)['then'](function(_0x43b061){logger[_0x7f5a('0x10')](_0x7f5a('0x11'),_0x570faa,_0x7f5a('0x12'));logger[_0x7f5a('0x13')](_0x7f5a('0x14'),_0x570faa,'request\x20sent',JSON[_0x7f5a('0x15')](_0x43b061));if(_0x43b061[_0x7f5a('0x16')]){if(_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x17')]===0x1f4){logger[_0x7f5a('0x16')](_0x7f5a('0x11'),_0x570faa,_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x18')]);return _0x3bf4bd(_0x43b061['error'][_0x7f5a('0x18')]);}logger[_0x7f5a('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x570faa,_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x18')]);return _0x438daa(_0x43b061[_0x7f5a('0x16')][_0x7f5a('0x18')]);}else{logger['info'](_0x7f5a('0x11'),_0x570faa,_0x7f5a('0x12'));_0x438daa(_0x43b061[_0x7f5a('0x19')][_0x7f5a('0x18')]);}})['catch'](function(_0x45d387){logger[_0x7f5a('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x570faa,_0x45d387);_0x3bf4bd(_0x45d387);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 2be215a..9d529e7 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 _0x6717=['removeListener','register','length','chatInternalMessage:','emit'];(function(_0x210cc1,_0x10d2d6){var _0x46bda=function(_0x344ac3){while(--_0x344ac3){_0x210cc1['push'](_0x210cc1['shift']());}};_0x46bda(++_0x10d2d6);}(_0x6717,0xea));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove','update'];function createListener(_0x56c639,_0x4823dc){return function(_0x4faec9){_0x4823dc[_0x7671('0x0')](_0x56c639,_0x4faec9);};}function removeListener(_0x2bd1d5,_0x45c73c){return function(){ChatInternalMessageEvents[_0x7671('0x1')](_0x2bd1d5,_0x45c73c);};}exports[_0x7671('0x2')]=function(_0x474696){for(var _0x4f1717=0x0,_0x2a6989=events[_0x7671('0x3')];_0x4f1717<_0x2a6989;_0x4f1717++){var _0x2a6da0=events[_0x4f1717];var _0x19972b=createListener(_0x7671('0x4')+_0x2a6da0,_0x474696);ChatInternalMessageEvents['on'](_0x2a6da0,_0x19972b);}};
\ No newline at end of file
+var _0x4266=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x603235,_0x27c57a){var _0x32b3c6=function(_0x38d305){while(--_0x38d305){_0x603235['push'](_0x603235['shift']());}};_0x32b3c6(++_0x27c57a);}(_0x4266,0x8d));var _0x6426=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4266[_0x19e35c];return _0x3e1fe8;};'use strict';var ChatInternalMessageEvents=require(_0x6426('0x0'));var events=[_0x6426('0x1'),_0x6426('0x2'),_0x6426('0x3')];function createListener(_0x4efbba,_0x4692bb){return function(_0x59a9c8){_0x4692bb[_0x6426('0x4')](_0x4efbba,_0x59a9c8);};}function removeListener(_0x1df96a,_0x225dce){return function(){ChatInternalMessageEvents[_0x6426('0x5')](_0x1df96a,_0x225dce);};}exports['register']=function(_0x14b9b6){for(var _0x5795e8=0x0,_0x4b572b=events['length'];_0x5795e8<_0x4b572b;_0x5795e8++){var _0x41bc62=events[_0x5795e8];var _0x14deac=createListener(_0x6426('0x6')+_0x41bc62,_0x14b9b6);ChatInternalMessageEvents['on'](_0x41bc62,_0x14deac);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 0ac71d9..42b315a 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 _0xb468=['create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post'];(function(_0x467e0d,_0x724800){var _0x2902c3=function(_0x30d4da){while(--_0x30d4da){_0x467e0d['push'](_0x467e0d['shift']());}};_0x2902c3(++_0x724800);}(_0xb468,0x1e8));var _0x8b46=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb468[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x8b46('0x0'));var util=require(_0x8b46('0x1'));var path=require(_0x8b46('0x2'));var timeout=require(_0x8b46('0x3'));var express=require(_0x8b46('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8b46('0x5'));var interaction=require(_0x8b46('0x6'));var config=require(_0x8b46('0x7'));var controller=require(_0x8b46('0x8'));router[_0x8b46('0x9')]('/',auth[_0x8b46('0xa')](),controller[_0x8b46('0xb')]);router['get'](_0x8b46('0xc'),auth['isAuthenticated'](),controller[_0x8b46('0xd')]);router[_0x8b46('0x9')]('/users',auth[_0x8b46('0xa')](),controller[_0x8b46('0xe')]);router[_0x8b46('0x9')](_0x8b46('0xf'),auth[_0x8b46('0xa')](),controller[_0x8b46('0x10')]);router[_0x8b46('0x11')]('/',auth[_0x8b46('0xa')](),controller[_0x8b46('0x12')]);router[_0x8b46('0x13')](_0x8b46('0xf'),controller[_0x8b46('0x14')]);router['delete']('/:id',auth[_0x8b46('0xa')](),controller['destroy']);module[_0x8b46('0x15')]=router;
\ No newline at end of file
+var _0xf95c=['/:id','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers'];(function(_0xd0e3b7,_0x5d0d4b){var _0x4ff0b3=function(_0x572b7b){while(--_0x572b7b){_0xd0e3b7['push'](_0xd0e3b7['shift']());}};_0x4ff0b3(++_0x5d0d4b);}(_0xf95c,0x10e));var _0xcf95=function(_0x4aaf83,_0x2aaedb){_0x4aaf83=_0x4aaf83-0x0;var _0x49fb97=_0xf95c[_0x4aaf83];return _0x49fb97;};'use strict';var multer=require('multer');var util=require(_0xcf95('0x0'));var path=require(_0xcf95('0x1'));var timeout=require(_0xcf95('0x2'));var express=require('express');var router=express[_0xcf95('0x3')]();var fs_extra=require(_0xcf95('0x4'));var auth=require(_0xcf95('0x5'));var interaction=require(_0xcf95('0x6'));var config=require(_0xcf95('0x7'));var controller=require(_0xcf95('0x8'));router[_0xcf95('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf95('0xa')]);router[_0xcf95('0x9')](_0xcf95('0xb'),auth[_0xcf95('0xc')](),controller[_0xcf95('0xd')]);router[_0xcf95('0x9')](_0xcf95('0xe'),auth[_0xcf95('0xc')](),controller[_0xcf95('0xf')]);router[_0xcf95('0x9')](_0xcf95('0x10'),auth[_0xcf95('0xc')](),controller['show']);router['post']('/',auth[_0xcf95('0xc')](),controller['create']);router[_0xcf95('0x11')](_0xcf95('0x10'),controller[_0xcf95('0x12')]);router[_0xcf95('0x13')](_0xcf95('0x10'),auth[_0xcf95('0xc')](),controller[_0xcf95('0x14')]);module[_0xcf95('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 45a0fca..21e3c5d 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 _0x58a4=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x20a5a4,_0x4bc4c6){var _0x5c7441=function(_0x2cc652){while(--_0x2cc652){_0x20a5a4['push'](_0x20a5a4['shift']());}};_0x5c7441(++_0x4bc4c6);}(_0x58a4,0xbf));var _0x458a=function(_0x3f0c06,_0x3d0ecf){_0x3f0c06=_0x3f0c06-0x0;var _0x507d9f=_0x58a4[_0x3f0c06];return _0x507d9f;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'body':{'type':Sequelize[_0x458a('0x2')](_0x458a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x458a('0x5')]('in',_0x458a('0x6')),'defaultValue':_0x458a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x458a('0x7')]},'providerName':{'type':Sequelize[_0x458a('0x8')]},'providerResponse':{'type':Sequelize[_0x458a('0x2')]}};
\ No newline at end of file
+var _0xdac7=['exports','BOOLEAN','ENUM','out','sequelize'];(function(_0x537348,_0x1b9186){var _0x41ca46=function(_0x31c782){while(--_0x31c782){_0x537348['push'](_0x537348['shift']());}};_0x41ca46(++_0x1b9186);}(_0xdac7,0x180));var _0x7dac=function(_0x2975ff,_0x5267be){_0x2975ff=_0x2975ff-0x0;var _0x7ac006=_0xdac7[_0x2975ff];return _0x7ac006;};'use strict';var Sequelize=require(_0x7dac('0x0'));module[_0x7dac('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7dac('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7dac('0x3')]('in',_0x7dac('0x4')),'defaultValue':_0x7dac('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index dc091df..04ca2ff 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 _0xb2b0=['stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','params','find','create','body','describe','../../config/logger','chat-interactions','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','isNil','format','interaction','info','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','fullname','agent','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','Sequelize','User','email','internal','SIP/%s','rejectmessage','rimraf','zip-dir','request-promise','moment','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','http','client','request','then','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy'];(function(_0x40da2b,_0x4c8c73){var _0x122eb5=function(_0x2fc5f3){while(--_0x2fc5f3){_0x40da2b['push'](_0x40da2b['shift']());}};_0x122eb5(++_0x4c8c73);}(_0xb2b0,0xc6));var _0x0b2b=function(_0xee05ad,_0xe1ea6a){_0xee05ad=_0xee05ad-0x0;var _0x2feea7=_0xb2b0[_0xee05ad];return _0x2feea7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b2b('0x0'));var zipdir=require(_0x0b2b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b2b('0x2'));var moment=require(_0x0b2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0b2b('0x4'));var util=require(_0x0b2b('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b2b('0x6'));var squel=require(_0x0b2b('0x7'));var crypto=require(_0x0b2b('0x8'));var jsforce=require(_0x0b2b('0x9'));var deskjs=require(_0x0b2b('0xa'));var toCsv=require(_0x0b2b('0xb'));var querystring=require(_0x0b2b('0xc'));var Papa=require('papaparse');var Redis=require(_0x0b2b('0xd'));var authService=require(_0x0b2b('0xe'));var qs=require(_0x0b2b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b2b('0x10'));var logger=require('../../config/logger')(_0x0b2b('0x11'));var utils=require(_0x0b2b('0x12'));var config=require(_0x0b2b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b2b('0x14'))['db'];config[_0x0b2b('0x15')]=_['defaults'](config[_0x0b2b('0x15')],{'host':_0x0b2b('0x16'),'port':0x18eb});var socket=require(_0x0b2b('0x17'))(new Redis(config[_0x0b2b('0x15')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0b2b('0x18')]({'port':0x232c});var client9002=jayson[_0x0b2b('0x19')][_0x0b2b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3095db,_0x34738e,_0x107db8,_0x3e5d15){return new BPromise(function(_0x26a449,_0x1a0581){var _0x48c030=_0x3e5d15||client;return _0x48c030[_0x0b2b('0x1a')](_0x3095db,_0x107db8)[_0x0b2b('0x1b')](function(_0x22d927){logger['info']('ChatMessage,\x20%s,\x20%s',_0x34738e,'request\x20sent');logger['debug'](_0x0b2b('0x1c'),_0x34738e,_0x0b2b('0x1d'),JSON[_0x0b2b('0x1e')](_0x22d927));if(_0x22d927[_0x0b2b('0x1f')]){if(_0x22d927['error'][_0x0b2b('0x20')]===0x1f4){logger[_0x0b2b('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x34738e,_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);return _0x1a0581(_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);}logger[_0x0b2b('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x34738e,_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);return _0x26a449(_0x22d927[_0x0b2b('0x1f')][_0x0b2b('0x21')]);}else{logger['info'](_0x0b2b('0x22'),_0x34738e,_0x0b2b('0x1d'));_0x26a449(_0x22d927['result'][_0x0b2b('0x21')]);}})[_0x0b2b('0x23')](function(_0xefdf5){logger['error'](_0x0b2b('0x22'),_0x34738e,_0xefdf5);_0x1a0581(_0xefdf5);});});}function respondWithStatusCode(_0x45eafa,_0x4e6eac){_0x4e6eac=_0x4e6eac||0xcc;return function(_0x1e6026){if(_0x1e6026){return _0x45eafa[_0x0b2b('0x24')](_0x4e6eac);}return _0x45eafa[_0x0b2b('0x25')](_0x4e6eac)[_0x0b2b('0x26')]();};}function respondWithResult(_0x1ad121,_0xa41d26){_0xa41d26=_0xa41d26||0xc8;return function(_0x2f57f0){if(_0x2f57f0){return _0x1ad121[_0x0b2b('0x25')](_0xa41d26)[_0x0b2b('0x27')](_0x2f57f0);}};}function respondWithFilteredResult(_0x1e202e,_0x3cfe33){return function(_0x2e3b08){if(_0x2e3b08){var _0x56f4f1=typeof _0x3cfe33[_0x0b2b('0x28')]===_0x0b2b('0x29')&&typeof _0x3cfe33[_0x0b2b('0x2a')]==='undefined';var _0x23b720=_0x2e3b08[_0x0b2b('0x2b')];var _0xfd0c4c=_0x56f4f1?0x0:_0x3cfe33[_0x0b2b('0x28')];var _0x3e940f=_0x56f4f1?_0x2e3b08[_0x0b2b('0x2b')]:_0x3cfe33['offset']+_0x3cfe33[_0x0b2b('0x2a')];var _0x109977;if(_0x3e940f>=_0x23b720){_0x3e940f=_0x23b720;_0x109977=0xc8;}else{_0x109977=0xce;}_0x1e202e[_0x0b2b('0x25')](_0x109977);return _0x1e202e[_0x0b2b('0x2c')](_0x0b2b('0x2d'),_0xfd0c4c+'-'+_0x3e940f+'/'+_0x23b720)[_0x0b2b('0x27')](_0x2e3b08);}return null;};}function patchUpdates(_0x1059b4){return function(_0x208740){try{jsonpatch[_0x0b2b('0x2e')](_0x208740,_0x1059b4,!![]);}catch(_0x2bebdf){return BPromise[_0x0b2b('0x2f')](_0x2bebdf);}return _0x208740['save']();};}function saveUpdates(_0x22a42f,_0x481c97){return function(_0x4bc0cf){if(_0x4bc0cf){return _0x4bc0cf[_0x0b2b('0x30')](_0x22a42f)[_0x0b2b('0x1b')](function(_0x38d911){return _0x38d911;});}return null;};}function removeEntity(_0x40a6c8,_0x41d1c8){return function(_0x2be2c1){if(_0x2be2c1){return _0x2be2c1[_0x0b2b('0x31')]()['then'](function(){_0x40a6c8[_0x0b2b('0x25')](0xcc)[_0x0b2b('0x26')]();});}};}function handleEntityNotFound(_0x354ed8,_0x7ae2e8){return function(_0x3bf13d){if(!_0x3bf13d){_0x354ed8[_0x0b2b('0x24')](0x194);}return _0x3bf13d;};}function handleError(_0x2cdc9c,_0x4ce28b){_0x4ce28b=_0x4ce28b||0x1f4;return function(_0xfe1ba){logger['error'](_0xfe1ba[_0x0b2b('0x32')]);if(_0xfe1ba['name']){delete _0xfe1ba[_0x0b2b('0x33')];}_0x2cdc9c['status'](_0x4ce28b)[_0x0b2b('0x34')](_0xfe1ba);};}exports['index']=function(_0xad748c,_0x34fadc){var _0x4708aa={},_0x4f7ba5={},_0x43a570={'count':0x0,'rows':[]};var _0x247703=_[_0x0b2b('0x35')](db[_0x0b2b('0x36')][_0x0b2b('0x37')],function(_0x3e3015){return{'name':_0x3e3015[_0x0b2b('0x38')],'type':_0x3e3015['type'][_0x0b2b('0x39')]};});_0x4f7ba5[_0x0b2b('0x3a')]=_['map'](_0x247703,_0x0b2b('0x33'));_0x4f7ba5['query']=_[_0x0b2b('0x3b')](_0xad748c[_0x0b2b('0x3c')]);_0x4f7ba5[_0x0b2b('0x3d')]=_[_0x0b2b('0x3e')](_0x4f7ba5[_0x0b2b('0x3a')],_0x4f7ba5['query']);_0x4708aa['attributes']=_[_0x0b2b('0x3e')](_0x4f7ba5[_0x0b2b('0x3a')],qs[_0x0b2b('0x3f')](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x3f')]));_0x4708aa['attributes']=_0x4708aa[_0x0b2b('0x40')][_0x0b2b('0x41')]?_0x4708aa[_0x0b2b('0x40')]:_0x4f7ba5[_0x0b2b('0x3a')];if(!_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x42')]('nolimit')){_0x4708aa[_0x0b2b('0x2a')]=qs[_0x0b2b('0x2a')](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x2a')]);_0x4708aa[_0x0b2b('0x28')]=qs['offset'](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x28')]);}_0x4708aa[_0x0b2b('0x43')]=qs['sort'](_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x44')]);_0x4708aa[_0x0b2b('0x45')]=qs[_0x0b2b('0x3d')](_['pick'](_0xad748c[_0x0b2b('0x3c')],_0x4f7ba5[_0x0b2b('0x3d')]),_0x247703);if(_0xad748c['query']['filter']){_0x4708aa['where']=_[_0x0b2b('0x46')](_0x4708aa[_0x0b2b('0x45')],{'$or':_[_0x0b2b('0x35')](_0x247703,function(_0x332608){if(_0x332608[_0x0b2b('0x47')]!==_0x0b2b('0x48')){var _0x56225d={};_0x56225d[_0x332608[_0x0b2b('0x33')]]={'$like':'%'+_0xad748c[_0x0b2b('0x3c')][_0x0b2b('0x49')]+'%'};return _0x56225d;}})});}_0x4708aa=_[_0x0b2b('0x46')]({},_0x4708aa,_0xad748c[_0x0b2b('0x4a')]);var _0x5e1757={'where':_0x4708aa[_0x0b2b('0x45')]};return db[_0x0b2b('0x36')]['count'](_0x5e1757)[_0x0b2b('0x1b')](function(_0x5cdde8){_0x43a570[_0x0b2b('0x2b')]=_0x5cdde8;if(_0xad748c[_0x0b2b('0x3c')]['includeAll']){_0x4708aa[_0x0b2b('0x4b')]=[{'all':!![]}];}return db[_0x0b2b('0x36')][_0x0b2b('0x4c')](_0x4708aa);})[_0x0b2b('0x1b')](function(_0x54be30){_0x43a570[_0x0b2b('0x4d')]=_0x54be30;return _0x43a570;})[_0x0b2b('0x1b')](respondWithFilteredResult(_0x34fadc,_0x4708aa))['catch'](handleError(_0x34fadc,null));};exports['show']=function(_0x338a64,_0x2038a9){var _0xa23457={'raw':!![],'where':{'id':_0x338a64[_0x0b2b('0x4e')]['id']}},_0x95aedc={};_0x95aedc[_0x0b2b('0x3a')]=_[_0x0b2b('0x3b')](db[_0x0b2b('0x36')][_0x0b2b('0x37')]);_0x95aedc[_0x0b2b('0x3c')]=_[_0x0b2b('0x3b')](_0x338a64[_0x0b2b('0x3c')]);_0x95aedc['filters']=_[_0x0b2b('0x3e')](_0x95aedc['model'],_0x95aedc[_0x0b2b('0x3c')]);_0xa23457[_0x0b2b('0x40')]=_[_0x0b2b('0x3e')](_0x95aedc[_0x0b2b('0x3a')],qs[_0x0b2b('0x3f')](_0x338a64[_0x0b2b('0x3c')][_0x0b2b('0x3f')]));_0xa23457[_0x0b2b('0x40')]=_0xa23457[_0x0b2b('0x40')][_0x0b2b('0x41')]?_0xa23457[_0x0b2b('0x40')]:_0x95aedc['model'];if(_0x338a64[_0x0b2b('0x3c')]['includeAll']){_0xa23457['include']=[{'all':!![]}];}_0xa23457=_[_0x0b2b('0x46')]({},_0xa23457,_0x338a64[_0x0b2b('0x4a')]);return db[_0x0b2b('0x36')][_0x0b2b('0x4f')](_0xa23457)[_0x0b2b('0x1b')](handleEntityNotFound(_0x2038a9,null))[_0x0b2b('0x1b')](respondWithResult(_0x2038a9,null))[_0x0b2b('0x23')](handleError(_0x2038a9,null));};exports[_0x0b2b('0x50')]=function(_0x3949c7,_0x5e5db6){return db[_0x0b2b('0x36')]['create'](_0x3949c7[_0x0b2b('0x51')],{})['then'](respondWithResult(_0x5e5db6,0xc9))[_0x0b2b('0x23')](handleError(_0x5e5db6,null));};exports[_0x0b2b('0x30')]=function(_0x529075,_0x22fd8e){if(_0x529075[_0x0b2b('0x51')]['id']){delete _0x529075['body']['id'];}return db['ChatMessage'][_0x0b2b('0x4f')]({'where':{'id':_0x529075['params']['id']}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x22fd8e,null))[_0x0b2b('0x1b')](saveUpdates(_0x529075['body'],null))['then'](respondWithResult(_0x22fd8e,null))['catch'](handleError(_0x22fd8e,null));};exports[_0x0b2b('0x31')]=function(_0x18b160,_0x538a3a){return db[_0x0b2b('0x36')][_0x0b2b('0x4f')]({'where':{'id':_0x18b160['params']['id']}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x538a3a,null))[_0x0b2b('0x1b')](removeEntity(_0x538a3a,null))[_0x0b2b('0x23')](handleError(_0x538a3a,null));};exports[_0x0b2b('0x52')]=function(_0x2b613b,_0x2984ad){return db[_0x0b2b('0x36')][_0x0b2b('0x52')]()[_0x0b2b('0x1b')](respondWithResult(_0x2984ad,null))[_0x0b2b('0x23')](handleError(_0x2984ad,null));};var interaction_log=require(_0x0b2b('0x53'))(_0x0b2b('0x54'));exports['accept']=function(_0x2e0ce3,_0x298548,_0x5c69dc){var _0x1226d9={'agent':{},'channel':_0x0b2b('0x55')};if(_0x2e0ce3[_0x0b2b('0x51')]['id']){delete _0x2e0ce3['body']['id'];}_0x2e0ce3['body']['read']=!![];_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x56')]=moment()['format'](_0x0b2b('0x57'));_0x2e0ce3['body']['UserId']=_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x58')]||_0x2e0ce3['user']['id'];_0x1226d9['agent']['id']=_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x58')];return db['ChatMessage'][_0x0b2b('0x4f')]({'where':{'id':_0x2e0ce3['params']['id'],'UserId':null}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x298548,null))[_0x0b2b('0x1b')](saveUpdates(_0x2e0ce3['body'],null))[_0x0b2b('0x1b')](function(_0x248412){if(_0x248412){_0x1226d9[_0x0b2b('0x21')]=_0x248412[_0x0b2b('0x59')]({'plain':!![]});return db[_0x0b2b('0x5a')][_0x0b2b('0x4f')]({'where':{'id':_0x248412['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x298548,null))[_0x0b2b('0x1b')](function(_0x4d463d){if(_0x4d463d){return _0x4d463d[_0x0b2b('0x30')]({'UserId':_0x2e0ce3[_0x0b2b('0x51')]['UserId'],'read1stAt':_[_0x0b2b('0x5b')](_0x4d463d['read1stAt'])?moment()[_0x0b2b('0x5c')](_0x0b2b('0x57')):undefined});}return null;})[_0x0b2b('0x1b')](function(_0x25b635){if(_0x25b635){_0x1226d9[_0x0b2b('0x5d')]=_0x25b635[_0x0b2b('0x59')]({'plain':!![]});interaction_log[_0x0b2b('0x5e')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e0ce3['user']['id'],_0x2e0ce3[_0x0b2b('0x5f')]['name'],_0x2e0ce3[_0x0b2b('0x5f')][_0x0b2b('0x60')],_0x1226d9['interaction']['id'],_0x2e0ce3[_0x0b2b('0x51')]?JSON['stringify'](_0x2e0ce3[_0x0b2b('0x51')]):_0x0b2b('0x61'));return respondWithRpcPromise('AcceptMessage',_0x0b2b('0x62'),_0x1226d9);}return null;})['then'](function(_0x35e11a){var _0x18d6d2=_0x0b2b('0x63')+_0x35e11a[_0x0b2b('0x21')]['ContactId'];return db[_0x0b2b('0x64')][_0x0b2b('0x3c')](_0x18d6d2,{'type':db['Sequelize'][_0x0b2b('0x65')][_0x0b2b('0x66')],'raw':!![]})[_0x0b2b('0x1b')](function(_0x377d80){return _0x377d80;});})[_0x0b2b('0x1b')](function(_0x7ceb65){if(_0x7ceb65){_0x1226d9[_0x0b2b('0x21')]['contact']=_0x7ceb65[0x0];if(!_0x2e0ce3['body']['UserId'])return;return db['User'][_0x0b2b('0x4f')]({'where':{'id':_0x2e0ce3[_0x0b2b('0x51')][_0x0b2b('0x58')],'role':'agent'},'attributes':['id','name',_0x0b2b('0x67'),'email','internal'],'raw':!![]});}return null;})[_0x0b2b('0x1b')](function(_0x10116d){if(!_0x10116d)return null;_0x1226d9['message'][_0x0b2b('0x68')]=_0x10116d;return _0x1226d9;})[_0x0b2b('0x1b')](function(_0x2a072b){if(_0x2a072b){if(_0x2e0ce3['body'][_0x0b2b('0x69')]){_0x1226d9[_0x0b2b('0x21')][_0x0b2b('0x6a')]=util['format']('SIP/%s',_0x2e0ce3['user']['name']);_0x1226d9['message'][_0x0b2b('0x6b')]=_0x1226d9[_0x0b2b('0x6b')];_0x1226d9[_0x0b2b('0x21')][_0x0b2b('0x6c')]=_0x1226d9[_0x0b2b('0x6b')];_0x1226d9[_0x0b2b('0x21')][_0x0b2b('0x6d')]=_0x0b2b('0x6e');return respondWithRpcPromise(_0x0b2b('0x6f'),_0x0b2b('0x6f'),{'event':_0x0b2b('0x70'),'message':_['merge'](_0x1226d9[_0x0b2b('0x21')],JSON[_0x0b2b('0x71')](_0x1226d9[_0x0b2b('0x5d')][_0x0b2b('0x72')]))},client9002)[_0x0b2b('0x1b')](function(){return _0x1226d9;});}return _0x1226d9;}return null;})[_0x0b2b('0x1b')](respondWithResult(_0x298548,null))[_0x0b2b('0x23')](handleError(_0x298548,null));};var interaction_log=require(_0x0b2b('0x53'))(_0x0b2b('0x54'));exports[_0x0b2b('0x2f')]=function(_0x9510de,_0x5c7361,_0x22bbc0){var _0x1313d6={'agent':{},'channel':'chat'};if(_0x9510de[_0x0b2b('0x51')]['id']){delete _0x9510de[_0x0b2b('0x51')]['id'];}_0x9510de[_0x0b2b('0x51')][_0x0b2b('0x58')]=_0x9510de[_0x0b2b('0x51')][_0x0b2b('0x58')]||_0x9510de[_0x0b2b('0x5f')]['id'];_0x1313d6[_0x0b2b('0x68')]['id']=_0x9510de[_0x0b2b('0x51')][_0x0b2b('0x58')];return db[_0x0b2b('0x36')]['find']({'where':{'id':_0x9510de['params']['id'],'UserId':null}})[_0x0b2b('0x1b')](handleEntityNotFound(_0x5c7361,null))[_0x0b2b('0x1b')](function(_0x545416){if(_0x545416){_0x1313d6[_0x0b2b('0x21')]=_0x545416[_0x0b2b('0x59')]({'plain':!![]});return db['ChatInteraction'][_0x0b2b('0x4f')]({'where':{'id':_0x545416['ChatInteractionId']}});}return null;})[_0x0b2b('0x1b')](handleEntityNotFound(_0x5c7361,null))[_0x0b2b('0x1b')](function(_0x2f14c4){if(_0x2f14c4){_0x1313d6[_0x0b2b('0x5d')]=_0x2f14c4[_0x0b2b('0x59')]({'plain':!![]});interaction_log[_0x0b2b('0x5e')](_0x0b2b('0x73'),_0x9510de[_0x0b2b('0x5f')]['id'],_0x9510de[_0x0b2b('0x5f')]['name'],_0x9510de['user']['role'],_0x1313d6[_0x0b2b('0x5d')]['id'],_0x9510de[_0x0b2b('0x51')]?JSON['stringify'](_0x9510de[_0x0b2b('0x51')]):_0x0b2b('0x61'));return respondWithRpcPromise('RejectMessage',_0x0b2b('0x74'),_0x1313d6);}return null;})[_0x0b2b('0x1b')](function(_0x1d6d5f){var _0x15c633=_0x0b2b('0x63')+_0x1d6d5f[_0x0b2b('0x21')][_0x0b2b('0x75')];return db['sequelize'][_0x0b2b('0x3c')](_0x15c633,{'type':db[_0x0b2b('0x76')][_0x0b2b('0x65')][_0x0b2b('0x66')],'raw':!![]})[_0x0b2b('0x1b')](function(_0x53ed1e){return _0x53ed1e;});})['then'](function(_0x8ea34a){if(_0x8ea34a){_0x1313d6[_0x0b2b('0x21')]['contact']=_0x8ea34a[0x0];if(!_0x9510de[_0x0b2b('0x51')]['UserId'])return;return db[_0x0b2b('0x77')][_0x0b2b('0x4f')]({'where':{'id':_0x9510de['body'][_0x0b2b('0x58')],'role':_0x0b2b('0x68')},'attributes':['id',_0x0b2b('0x33'),_0x0b2b('0x67'),_0x0b2b('0x78'),_0x0b2b('0x79')],'raw':!![]});}return null;})['then'](function(_0x5b5a1d){if(!_0x5b5a1d)return null;_0x1313d6[_0x0b2b('0x21')]['agent']=_0x5b5a1d;return _0x1313d6;})[_0x0b2b('0x1b')](function(_0x5778f8){if(_0x5778f8){_0x5778f8[_0x0b2b('0x21')][_0x0b2b('0x6a')]=util[_0x0b2b('0x5c')](_0x0b2b('0x7a'),_0x9510de[_0x0b2b('0x5f')][_0x0b2b('0x33')]);_0x5778f8[_0x0b2b('0x21')][_0x0b2b('0x6b')]=_0x1313d6[_0x0b2b('0x6b')];_0x5778f8[_0x0b2b('0x21')]['motionChannel']=_0x1313d6[_0x0b2b('0x6b')];_0x5778f8['message'][_0x0b2b('0x6d')]=_0x0b2b('0x2f');respondWithRpcPromise(_0x0b2b('0x6f'),'EventManager',{'event':_0x0b2b('0x7b'),'message':_[_0x0b2b('0x46')](_0x1313d6[_0x0b2b('0x21')],JSON[_0x0b2b('0x71')](_0x1313d6[_0x0b2b('0x5d')]['formData']))},client9002);return _0x1313d6;}return null;})[_0x0b2b('0x1b')](respondWithResult(_0x5c7361,null))[_0x0b2b('0x23')](handleError(_0x5c7361,null));};
\ No newline at end of file
+var _0xd0ed=['sequelize','Sequelize','SELECT','contact','User','fullname','internal','agent','manual','interface','format','channel','motionChannel','event','EventManager','acceptmessage','merge','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','rejectmessage','parse','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','describe','chat-interactions','accept','chat','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','info','name','null','AcceptMessage','acceptMessage','ContactId'];(function(_0x1b06ae,_0x3db6f1){var _0x5f4972=function(_0x3b5bbc){while(--_0x3b5bbc){_0x1b06ae['push'](_0x1b06ae['shift']());}};_0x5f4972(++_0x3db6f1);}(_0xd0ed,0x127));var _0xdd0e=function(_0x1a4d43,_0x28b32c){_0x1a4d43=_0x1a4d43-0x0;var _0x3650e0=_0xd0ed[_0x1a4d43];return _0x3650e0;};'use strict';var emlformat=require(_0xdd0e('0x0'));var rimraf=require(_0xdd0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd0e('0x2'));var rp=require(_0xdd0e('0x3'));var moment=require(_0xdd0e('0x4'));var BPromise=require(_0xdd0e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdd0e('0x6'));var sox=require(_0xdd0e('0x7'));var csv=require('to-csv');var ejs=require(_0xdd0e('0x8'));var fs=require('fs');var fs_extra=require(_0xdd0e('0x9'));var _=require(_0xdd0e('0xa'));var squel=require(_0xdd0e('0xb'));var crypto=require('crypto');var jsforce=require(_0xdd0e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdd0e('0xd'));var querystring=require(_0xdd0e('0xe'));var Papa=require('papaparse');var Redis=require(_0xdd0e('0xf'));var authService=require(_0xdd0e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd0e('0x11'));var logger=require(_0xdd0e('0x12'))(_0xdd0e('0x13'));var utils=require(_0xdd0e('0x14'));var config=require(_0xdd0e('0x15'));var licenseUtil=require(_0xdd0e('0x16'));var db=require(_0xdd0e('0x17'))['db'];config[_0xdd0e('0x18')]=_['defaults'](config[_0xdd0e('0x18')],{'host':_0xdd0e('0x19'),'port':0x18eb});var socket=require(_0xdd0e('0x1a'))(new Redis(config['redis']));require(_0xdd0e('0x1b'))[_0xdd0e('0x1c')](socket);var jayson=require(_0xdd0e('0x1d'));var client=jayson[_0xdd0e('0x1e')][_0xdd0e('0x1f')]({'port':0x232c});var client9002=jayson[_0xdd0e('0x1e')][_0xdd0e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1af92e,_0x481ba6,_0x88a694,_0xa614e4){return new BPromise(function(_0x4aff71,_0x34591a){var _0x4cf1e4=_0xa614e4||client;return _0x4cf1e4[_0xdd0e('0x20')](_0x1af92e,_0x88a694)[_0xdd0e('0x21')](function(_0x432628){logger['info'](_0xdd0e('0x22'),_0x481ba6,'request\x20sent');logger[_0xdd0e('0x23')](_0xdd0e('0x24'),_0x481ba6,_0xdd0e('0x25'),JSON[_0xdd0e('0x26')](_0x432628));if(_0x432628[_0xdd0e('0x27')]){if(_0x432628[_0xdd0e('0x27')][_0xdd0e('0x28')]===0x1f4){logger['error'](_0xdd0e('0x22'),_0x481ba6,_0x432628[_0xdd0e('0x27')][_0xdd0e('0x29')]);return _0x34591a(_0x432628['error']['message']);}logger[_0xdd0e('0x27')](_0xdd0e('0x22'),_0x481ba6,_0x432628[_0xdd0e('0x27')]['message']);return _0x4aff71(_0x432628[_0xdd0e('0x27')]['message']);}else{logger['info'](_0xdd0e('0x22'),_0x481ba6,'request\x20sent');_0x4aff71(_0x432628['result']['message']);}})[_0xdd0e('0x2a')](function(_0x28f1ec){logger['error'](_0xdd0e('0x22'),_0x481ba6,_0x28f1ec);_0x34591a(_0x28f1ec);});});}function respondWithStatusCode(_0x4aac55,_0x46df22){_0x46df22=_0x46df22||0xcc;return function(_0x158112){if(_0x158112){return _0x4aac55[_0xdd0e('0x2b')](_0x46df22);}return _0x4aac55[_0xdd0e('0x2c')](_0x46df22)[_0xdd0e('0x2d')]();};}function respondWithResult(_0x382542,_0x3ee425){_0x3ee425=_0x3ee425||0xc8;return function(_0x356226){if(_0x356226){return _0x382542[_0xdd0e('0x2c')](_0x3ee425)[_0xdd0e('0x2e')](_0x356226);}};}function respondWithFilteredResult(_0x29110a,_0x1ace7e){return function(_0x427378){if(_0x427378){var _0x3fbfc7=typeof _0x1ace7e[_0xdd0e('0x2f')]==='undefined'&&typeof _0x1ace7e[_0xdd0e('0x30')]===_0xdd0e('0x31');var _0x17b94f=_0x427378[_0xdd0e('0x32')];var _0x4dc077=_0x3fbfc7?0x0:_0x1ace7e[_0xdd0e('0x2f')];var _0x22370a=_0x3fbfc7?_0x427378[_0xdd0e('0x32')]:_0x1ace7e[_0xdd0e('0x2f')]+_0x1ace7e['limit'];var _0x2042b4;if(_0x22370a>=_0x17b94f){_0x22370a=_0x17b94f;_0x2042b4=0xc8;}else{_0x2042b4=0xce;}_0x29110a[_0xdd0e('0x2c')](_0x2042b4);return _0x29110a[_0xdd0e('0x33')](_0xdd0e('0x34'),_0x4dc077+'-'+_0x22370a+'/'+_0x17b94f)[_0xdd0e('0x2e')](_0x427378);}return null;};}function patchUpdates(_0x155e9b){return function(_0xb5a236){try{jsonpatch['apply'](_0xb5a236,_0x155e9b,!![]);}catch(_0x1b2710){return BPromise[_0xdd0e('0x35')](_0x1b2710);}return _0xb5a236[_0xdd0e('0x36')]();};}function saveUpdates(_0x445289,_0x1392b0){return function(_0x28a33a){if(_0x28a33a){return _0x28a33a[_0xdd0e('0x37')](_0x445289)['then'](function(_0x2e8ddb){return _0x2e8ddb;});}return null;};}function removeEntity(_0x2248e1,_0x14c00f){return function(_0x2f8436){if(_0x2f8436){return _0x2f8436[_0xdd0e('0x38')]()[_0xdd0e('0x21')](function(){_0x2248e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b0b5,_0x4c4564){return function(_0x36cf27){if(!_0x36cf27){_0x57b0b5[_0xdd0e('0x2b')](0x194);}return _0x36cf27;};}function handleError(_0xe8b6f,_0x3e08f0){_0x3e08f0=_0x3e08f0||0x1f4;return function(_0x507240){logger[_0xdd0e('0x27')](_0x507240['stack']);if(_0x507240['name']){delete _0x507240['name'];}_0xe8b6f[_0xdd0e('0x2c')](_0x3e08f0)[_0xdd0e('0x39')](_0x507240);};}exports['index']=function(_0x5c3a7e,_0x5b01ec){var _0x25a9a1={},_0x562610={},_0x58c3db={'count':0x0,'rows':[]};var _0xf0134c=_[_0xdd0e('0x3a')](db[_0xdd0e('0x3b')][_0xdd0e('0x3c')],function(_0x741e6e){return{'name':_0x741e6e[_0xdd0e('0x3d')],'type':_0x741e6e[_0xdd0e('0x3e')][_0xdd0e('0x3f')]};});_0x562610[_0xdd0e('0x40')]=_[_0xdd0e('0x3a')](_0xf0134c,'name');_0x562610[_0xdd0e('0x41')]=_[_0xdd0e('0x42')](_0x5c3a7e[_0xdd0e('0x41')]);_0x562610['filters']=_[_0xdd0e('0x43')](_0x562610['model'],_0x562610[_0xdd0e('0x41')]);_0x25a9a1[_0xdd0e('0x44')]=_['intersection'](_0x562610['model'],qs[_0xdd0e('0x45')](_0x5c3a7e['query'][_0xdd0e('0x45')]));_0x25a9a1[_0xdd0e('0x44')]=_0x25a9a1['attributes'][_0xdd0e('0x46')]?_0x25a9a1['attributes']:_0x562610[_0xdd0e('0x40')];if(!_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x47')](_0xdd0e('0x48'))){_0x25a9a1[_0xdd0e('0x30')]=qs[_0xdd0e('0x30')](_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x30')]);_0x25a9a1[_0xdd0e('0x2f')]=qs[_0xdd0e('0x2f')](_0x5c3a7e['query'][_0xdd0e('0x2f')]);}_0x25a9a1[_0xdd0e('0x49')]=qs[_0xdd0e('0x4a')](_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x4a')]);_0x25a9a1[_0xdd0e('0x4b')]=qs[_0xdd0e('0x4c')](_[_0xdd0e('0x4d')](_0x5c3a7e[_0xdd0e('0x41')],_0x562610[_0xdd0e('0x4c')]),_0xf0134c);if(_0x5c3a7e['query'][_0xdd0e('0x4e')]){_0x25a9a1[_0xdd0e('0x4b')]=_['merge'](_0x25a9a1[_0xdd0e('0x4b')],{'$or':_[_0xdd0e('0x3a')](_0xf0134c,function(_0x36f2c5){if(_0x36f2c5['type']!==_0xdd0e('0x4f')){var _0x4b03ce={};_0x4b03ce[_0x36f2c5['name']]={'$like':'%'+_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x4e')]+'%'};return _0x4b03ce;}})});}_0x25a9a1=_['merge']({},_0x25a9a1,_0x5c3a7e[_0xdd0e('0x50')]);var _0x10a72c={'where':_0x25a9a1[_0xdd0e('0x4b')]};return db[_0xdd0e('0x3b')]['count'](_0x10a72c)['then'](function(_0x5352a6){_0x58c3db[_0xdd0e('0x32')]=_0x5352a6;if(_0x5c3a7e[_0xdd0e('0x41')][_0xdd0e('0x51')]){_0x25a9a1['include']=[{'all':!![]}];}return db['ChatMessage'][_0xdd0e('0x52')](_0x25a9a1);})['then'](function(_0x40cd35){_0x58c3db[_0xdd0e('0x53')]=_0x40cd35;return _0x58c3db;})['then'](respondWithFilteredResult(_0x5b01ec,_0x25a9a1))[_0xdd0e('0x2a')](handleError(_0x5b01ec,null));};exports[_0xdd0e('0x54')]=function(_0x4a4ebc,_0x55b6d0){var _0x384cab={'raw':!![],'where':{'id':_0x4a4ebc[_0xdd0e('0x55')]['id']}},_0x207694={};_0x207694[_0xdd0e('0x40')]=_[_0xdd0e('0x42')](db['ChatMessage'][_0xdd0e('0x3c')]);_0x207694[_0xdd0e('0x41')]=_[_0xdd0e('0x42')](_0x4a4ebc[_0xdd0e('0x41')]);_0x207694[_0xdd0e('0x4c')]=_[_0xdd0e('0x43')](_0x207694[_0xdd0e('0x40')],_0x207694[_0xdd0e('0x41')]);_0x384cab[_0xdd0e('0x44')]=_[_0xdd0e('0x43')](_0x207694['model'],qs[_0xdd0e('0x45')](_0x4a4ebc[_0xdd0e('0x41')][_0xdd0e('0x45')]));_0x384cab['attributes']=_0x384cab['attributes'][_0xdd0e('0x46')]?_0x384cab[_0xdd0e('0x44')]:_0x207694[_0xdd0e('0x40')];if(_0x4a4ebc[_0xdd0e('0x41')][_0xdd0e('0x51')]){_0x384cab[_0xdd0e('0x56')]=[{'all':!![]}];}_0x384cab=_['merge']({},_0x384cab,_0x4a4ebc[_0xdd0e('0x50')]);return db['ChatMessage'][_0xdd0e('0x57')](_0x384cab)[_0xdd0e('0x21')](handleEntityNotFound(_0x55b6d0,null))['then'](respondWithResult(_0x55b6d0,null))[_0xdd0e('0x2a')](handleError(_0x55b6d0,null));};exports[_0xdd0e('0x58')]=function(_0x635bc1,_0x250680){return db['ChatMessage'][_0xdd0e('0x58')](_0x635bc1[_0xdd0e('0x59')],{})['then'](respondWithResult(_0x250680,0xc9))[_0xdd0e('0x2a')](handleError(_0x250680,null));};exports[_0xdd0e('0x37')]=function(_0x595772,_0x228cbc){if(_0x595772[_0xdd0e('0x59')]['id']){delete _0x595772[_0xdd0e('0x59')]['id'];}return db['ChatMessage'][_0xdd0e('0x57')]({'where':{'id':_0x595772[_0xdd0e('0x55')]['id']}})[_0xdd0e('0x21')](handleEntityNotFound(_0x228cbc,null))[_0xdd0e('0x21')](saveUpdates(_0x595772['body'],null))[_0xdd0e('0x21')](respondWithResult(_0x228cbc,null))[_0xdd0e('0x2a')](handleError(_0x228cbc,null));};exports[_0xdd0e('0x38')]=function(_0x2a5a88,_0x29c6bb){return db[_0xdd0e('0x3b')]['find']({'where':{'id':_0x2a5a88['params']['id']}})[_0xdd0e('0x21')](handleEntityNotFound(_0x29c6bb,null))[_0xdd0e('0x21')](removeEntity(_0x29c6bb,null))[_0xdd0e('0x2a')](handleError(_0x29c6bb,null));};exports[_0xdd0e('0x5a')]=function(_0xfe4137,_0x25aaf9){return db[_0xdd0e('0x3b')][_0xdd0e('0x5a')]()[_0xdd0e('0x21')](respondWithResult(_0x25aaf9,null))[_0xdd0e('0x2a')](handleError(_0x25aaf9,null));};var interaction_log=require(_0xdd0e('0x12'))(_0xdd0e('0x5b'));exports[_0xdd0e('0x5c')]=function(_0x21c0ed,_0x4d71d3,_0x13887d){var _0x33cba3={'agent':{},'channel':_0xdd0e('0x5d')};if(_0x21c0ed[_0xdd0e('0x59')]['id']){delete _0x21c0ed[_0xdd0e('0x59')]['id'];}_0x21c0ed[_0xdd0e('0x59')]['read']=!![];_0x21c0ed[_0xdd0e('0x59')]['readAt']=moment()['format'](_0xdd0e('0x5e'));_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x5f')]=_0x21c0ed['body']['UserId']||_0x21c0ed[_0xdd0e('0x60')]['id'];_0x33cba3['agent']['id']=_0x21c0ed[_0xdd0e('0x59')]['UserId'];return db['ChatMessage'][_0xdd0e('0x57')]({'where':{'id':_0x21c0ed[_0xdd0e('0x55')]['id'],'UserId':null}})[_0xdd0e('0x21')](handleEntityNotFound(_0x4d71d3,null))[_0xdd0e('0x21')](saveUpdates(_0x21c0ed['body'],null))[_0xdd0e('0x21')](function(_0x53d8d7){if(_0x53d8d7){_0x33cba3['message']=_0x53d8d7[_0xdd0e('0x61')]({'plain':!![]});return db[_0xdd0e('0x62')][_0xdd0e('0x57')]({'where':{'id':_0x53d8d7[_0xdd0e('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4d71d3,null))[_0xdd0e('0x21')](function(_0x1979c6){if(_0x1979c6){return _0x1979c6[_0xdd0e('0x37')]({'UserId':_0x21c0ed['body'][_0xdd0e('0x5f')],'read1stAt':_[_0xdd0e('0x64')](_0x1979c6['read1stAt'])?moment()['format'](_0xdd0e('0x5e')):undefined});}return null;})[_0xdd0e('0x21')](function(_0x56f7cd){if(_0x56f7cd){_0x33cba3['interaction']=_0x56f7cd[_0xdd0e('0x61')]({'plain':!![]});interaction_log[_0xdd0e('0x65')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21c0ed['user']['id'],_0x21c0ed[_0xdd0e('0x60')][_0xdd0e('0x66')],_0x21c0ed[_0xdd0e('0x60')]['role'],_0x33cba3['interaction']['id'],_0x21c0ed[_0xdd0e('0x59')]?JSON[_0xdd0e('0x26')](_0x21c0ed['body']):_0xdd0e('0x67'));return respondWithRpcPromise(_0xdd0e('0x68'),_0xdd0e('0x69'),_0x33cba3);}return null;})[_0xdd0e('0x21')](function(_0x2c6f9c){var _0x41179f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c6f9c[_0xdd0e('0x29')][_0xdd0e('0x6a')];return db[_0xdd0e('0x6b')][_0xdd0e('0x41')](_0x41179f,{'type':db[_0xdd0e('0x6c')]['QueryTypes'][_0xdd0e('0x6d')],'raw':!![]})[_0xdd0e('0x21')](function(_0xe77d27){return _0xe77d27;});})[_0xdd0e('0x21')](function(_0x29227b){if(_0x29227b){_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x6e')]=_0x29227b[0x0];if(!_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x5f')])return;return db[_0xdd0e('0x6f')][_0xdd0e('0x57')]({'where':{'id':_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x5f')],'role':'agent'},'attributes':['id',_0xdd0e('0x66'),_0xdd0e('0x70'),'email',_0xdd0e('0x71')],'raw':!![]});}return null;})['then'](function(_0x51c27c){if(!_0x51c27c)return null;_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x72')]=_0x51c27c;return _0x33cba3;})['then'](function(_0x3264e3){if(_0x3264e3){if(_0x21c0ed[_0xdd0e('0x59')][_0xdd0e('0x73')]){_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x74')]=util[_0xdd0e('0x75')]('SIP/%s',_0x21c0ed[_0xdd0e('0x60')]['name']);_0x33cba3['message'][_0xdd0e('0x76')]=_0x33cba3[_0xdd0e('0x76')];_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x77')]=_0x33cba3[_0xdd0e('0x76')];_0x33cba3[_0xdd0e('0x29')][_0xdd0e('0x78')]=_0xdd0e('0x5c');return respondWithRpcPromise(_0xdd0e('0x79'),_0xdd0e('0x79'),{'event':_0xdd0e('0x7a'),'message':_[_0xdd0e('0x7b')](_0x33cba3[_0xdd0e('0x29')],JSON['parse'](_0x33cba3[_0xdd0e('0x7c')][_0xdd0e('0x7d')]))},client9002)['then'](function(){return _0x33cba3;});}return _0x33cba3;}return null;})[_0xdd0e('0x21')](respondWithResult(_0x4d71d3,null))[_0xdd0e('0x2a')](handleError(_0x4d71d3,null));};var interaction_log=require(_0xdd0e('0x12'))(_0xdd0e('0x5b'));exports['reject']=function(_0x34408b,_0x4e0fad,_0x181e3e){var _0x1b787e={'agent':{},'channel':_0xdd0e('0x5d')};if(_0x34408b[_0xdd0e('0x59')]['id']){delete _0x34408b[_0xdd0e('0x59')]['id'];}_0x34408b[_0xdd0e('0x59')][_0xdd0e('0x5f')]=_0x34408b[_0xdd0e('0x59')]['UserId']||_0x34408b[_0xdd0e('0x60')]['id'];_0x1b787e[_0xdd0e('0x72')]['id']=_0x34408b[_0xdd0e('0x59')][_0xdd0e('0x5f')];return db[_0xdd0e('0x3b')]['find']({'where':{'id':_0x34408b[_0xdd0e('0x55')]['id'],'UserId':null}})[_0xdd0e('0x21')](handleEntityNotFound(_0x4e0fad,null))[_0xdd0e('0x21')](function(_0x4709c1){if(_0x4709c1){_0x1b787e[_0xdd0e('0x29')]=_0x4709c1['get']({'plain':!![]});return db[_0xdd0e('0x62')][_0xdd0e('0x57')]({'where':{'id':_0x4709c1[_0xdd0e('0x63')]}});}return null;})[_0xdd0e('0x21')](handleEntityNotFound(_0x4e0fad,null))[_0xdd0e('0x21')](function(_0x1cbafa){if(_0x1cbafa){_0x1b787e[_0xdd0e('0x7c')]=_0x1cbafa['get']({'plain':!![]});interaction_log['info'](_0xdd0e('0x7e'),_0x34408b[_0xdd0e('0x60')]['id'],_0x34408b['user'][_0xdd0e('0x66')],_0x34408b[_0xdd0e('0x60')][_0xdd0e('0x7f')],_0x1b787e[_0xdd0e('0x7c')]['id'],_0x34408b[_0xdd0e('0x59')]?JSON[_0xdd0e('0x26')](_0x34408b[_0xdd0e('0x59')]):_0xdd0e('0x67'));return respondWithRpcPromise(_0xdd0e('0x80'),'rejectMessage',_0x1b787e);}return null;})[_0xdd0e('0x21')](function(_0x87bfa4){var _0x22d510=_0xdd0e('0x81')+_0x87bfa4['message']['ContactId'];return db[_0xdd0e('0x6b')][_0xdd0e('0x41')](_0x22d510,{'type':db[_0xdd0e('0x6c')][_0xdd0e('0x82')][_0xdd0e('0x6d')],'raw':!![]})[_0xdd0e('0x21')](function(_0x380d64){return _0x380d64;});})[_0xdd0e('0x21')](function(_0x309ee8){if(_0x309ee8){_0x1b787e[_0xdd0e('0x29')][_0xdd0e('0x6e')]=_0x309ee8[0x0];if(!_0x34408b['body'][_0xdd0e('0x5f')])return;return db[_0xdd0e('0x6f')][_0xdd0e('0x57')]({'where':{'id':_0x34408b[_0xdd0e('0x59')][_0xdd0e('0x5f')],'role':'agent'},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xdd0e('0x21')](function(_0x455d05){if(!_0x455d05)return null;_0x1b787e[_0xdd0e('0x29')]['agent']=_0x455d05;return _0x1b787e;})[_0xdd0e('0x21')](function(_0x361b28){if(_0x361b28){_0x361b28['message'][_0xdd0e('0x74')]=util[_0xdd0e('0x75')](_0xdd0e('0x83'),_0x34408b['user']['name']);_0x361b28[_0xdd0e('0x29')][_0xdd0e('0x76')]=_0x1b787e[_0xdd0e('0x76')];_0x361b28['message'][_0xdd0e('0x77')]=_0x1b787e[_0xdd0e('0x76')];_0x361b28[_0xdd0e('0x29')]['event']='reject';respondWithRpcPromise(_0xdd0e('0x79'),'EventManager',{'event':_0xdd0e('0x84'),'message':_[_0xdd0e('0x7b')](_0x1b787e['message'],JSON[_0xdd0e('0x85')](_0x1b787e['interaction'][_0xdd0e('0x7d')]))},client9002);return _0x1b787e;}return null;})['then'](respondWithResult(_0x4e0fad,null))['catch'](handleError(_0x4e0fad,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 7e4f2ae..28b0689 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 _0xf826=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x2f3be8,_0x78f0c0){var _0x5c054a=function(_0x77a4ff){while(--_0x77a4ff){_0x2f3be8['push'](_0x2f3be8['shift']());}};_0x5c054a(++_0x78f0c0);}(_0xf826,0x19a));var _0x6f82=function(_0xd3d5c3,_0x42d2af){_0xd3d5c3=_0xd3d5c3-0x0;var _0x29a808=_0xf826[_0xd3d5c3];return _0x29a808;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x6f82('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6f82('0x1')](0x0);var events={'afterCreate':_0x6f82('0x2'),'afterUpdate':_0x6f82('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1ff1e0){return function(_0x270e76,_0x4c04fe,_0x4cd86d){ChatMessageEvents[_0x6f82('0x4')](_0x1ff1e0+':'+_0x270e76['id'],_0x270e76);ChatMessageEvents['emit'](_0x1ff1e0,_0x270e76);_0x4cd86d(null);};}for(var e in events){if(events[_0x6f82('0x5')](e)){var event=events[e];ChatMessage[_0x6f82('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x8456=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4ddc7a,_0x5b6cb8){var _0x4547c1=function(_0x3739e7){while(--_0x3739e7){_0x4ddc7a['push'](_0x4ddc7a['shift']());}};_0x4547c1(++_0x5b6cb8);}(_0x8456,0x9e));var _0x6845=function(_0x2bdd0e,_0x16948d){_0x2bdd0e=_0x2bdd0e-0x0;var _0x317ebd=_0x8456[_0x2bdd0e];return _0x317ebd;};'use strict';var EventEmitter=require(_0x6845('0x0'));var ChatMessage=require(_0x6845('0x1'))['db'][_0x6845('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6845('0x3')](0x0);var events={'afterCreate':_0x6845('0x4'),'afterUpdate':_0x6845('0x5'),'afterDestroy':_0x6845('0x6')};function emitEvent(_0x5dd97e){return function(_0x2c47c0,_0x13f2ad,_0x3f7e4a){ChatMessageEvents[_0x6845('0x7')](_0x5dd97e+':'+_0x2c47c0['id'],_0x2c47c0);ChatMessageEvents[_0x6845('0x7')](_0x5dd97e,_0x2c47c0);_0x3f7e4a(null);};}for(var e in events){if(events[_0x6845('0x8')](e)){var event=events[e];ChatMessage[_0x6845('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index a802644..10691e3 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 _0xf963=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','body','FULLTEXT','models','get','toLowerCase','out','secret','UserId','findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path'];(function(_0x4b350a,_0x5cf71f){var _0x387e19=function(_0x59e66b){while(--_0x59e66b){_0x4b350a['push'](_0x4b350a['shift']());}};_0x387e19(++_0x5cf71f);}(_0xf963,0x133));var _0x3f96=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xf963[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0x3f96('0x0'));var logger=require(_0x3f96('0x1'))('api');var moment=require(_0x3f96('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f96('0x3'));var fs=require('fs');var path=require(_0x3f96('0x4'));var rimraf=require(_0x3f96('0x5'));var config=require(_0x3f96('0x6'));var attributes=require(_0x3f96('0x7'));module[_0x3f96('0x8')]=function(_0x38e583,_0x20d21c){return _0x38e583[_0x3f96('0x9')](_0x3f96('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3f96('0xb')],'type':_0x3f96('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa3b8e,_0x3983ef,_0x56fc8b){var _0x98d5ea=_0x38e583[_0x3f96('0xd')];var _0x5b0cf0=_0xa3b8e[_0x3f96('0xe')]({'plain':!![]});if(_0x5b0cf0['direction'][_0x3f96('0xf')]()==='in'||_0x5b0cf0['direction']['toLowerCase']()===_0x3f96('0x10')&&!_0x5b0cf0[_0x3f96('0x11')]&&!_['isNil'](_0x5b0cf0[_0x3f96('0x12')])){_0x98d5ea['ChatInteraction'][_0x3f96('0x13')]({'where':{'id':_0x5b0cf0['ChatInteractionId']}})[_0x3f96('0x14')](function(_0x443dc8){if(_0x443dc8){_0x443dc8['update']({'lastMsgAt':_0x5b0cf0[_0x3f96('0x15')],'lastMsgDirection':_0x5b0cf0['direction'][_0x3f96('0xf')]()});}})[_0x3f96('0x16')](function(_0x24cb30){console[_0x3f96('0x17')](_0x24cb30);});}_0x56fc8b();}},'charset':_0x3f96('0x18'),'collate':_0x3f96('0x19')});};
\ No newline at end of file
+var _0x3c6d=['ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil'];(function(_0x26aafa,_0x100c92){var _0x13b20e=function(_0x3f6216){while(--_0x3f6216){_0x26aafa['push'](_0x26aafa['shift']());}};_0x13b20e(++_0x100c92);}(_0x3c6d,0x190));var _0xd3c6=function(_0x10beb5,_0x3758b8){_0x10beb5=_0x10beb5-0x0;var _0x361364=_0x3c6d[_0x10beb5];return _0x361364;};'use strict';var _=require(_0xd3c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd3c6('0x1'));var moment=require(_0xd3c6('0x2'));var BPromise=require(_0xd3c6('0x3'));var rp=require(_0xd3c6('0x4'));var fs=require('fs');var path=require(_0xd3c6('0x5'));var rimraf=require(_0xd3c6('0x6'));var config=require(_0xd3c6('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x4523d4,_0x4a1c95){return _0x4523d4[_0xd3c6('0x8')]('ChatMessage',attributes,{'tableName':_0xd3c6('0x9'),'paranoid':![],'indexes':[{'name':_0xd3c6('0xa'),'fields':[_0xd3c6('0xb')],'type':_0xd3c6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6492c9,_0x1f1ce7,_0x316ab5){var _0x2d6b68=_0x4523d4[_0xd3c6('0xd')];var _0x185b28=_0x6492c9[_0xd3c6('0xe')]({'plain':!![]});if(_0x185b28['direction'][_0xd3c6('0xf')]()==='in'||_0x185b28[_0xd3c6('0x10')][_0xd3c6('0xf')]()===_0xd3c6('0x11')&&!_0x185b28[_0xd3c6('0x12')]&&!_[_0xd3c6('0x13')](_0x185b28['UserId'])){_0x2d6b68[_0xd3c6('0x14')][_0xd3c6('0x15')]({'where':{'id':_0x185b28['ChatInteractionId']}})[_0xd3c6('0x16')](function(_0x1c45dc){if(_0x1c45dc){_0x1c45dc[_0xd3c6('0x17')]({'lastMsgAt':_0x185b28[_0xd3c6('0x18')],'lastMsgDirection':_0x185b28[_0xd3c6('0x10')][_0xd3c6('0xf')]()});}})[_0xd3c6('0x19')](function(_0x1b8653){console['error'](_0x1b8653);});}_0x316ab5();}},'charset':_0xd3c6('0x1a'),'collate':_0xd3c6('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 90a6a33..e9238ad 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 _0x7d3a=['create','body','options','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2c7900,_0x44f3b6){var _0x35c02f=function(_0x343749){while(--_0x343749){_0x2c7900['push'](_0x2c7900['shift']());}};_0x35c02f(++_0x44f3b6);}(_0x7d3a,0x17a));var _0xa7d3=function(_0x435fda,_0xf6b683){_0x435fda=_0x435fda-0x0;var _0x28c3df=_0x7d3a[_0x435fda];return _0x28c3df;};'use strict';var _=require(_0xa7d3('0x0'));var util=require(_0xa7d3('0x1'));var moment=require(_0xa7d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa7d3('0x3'));var fs=require('fs');var Redis=require(_0xa7d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7d3('0x5'));var logger=require(_0xa7d3('0x6'))('rpc');var config=require(_0xa7d3('0x7'));var jayson=require(_0xa7d3('0x8'));var client=jayson[_0xa7d3('0x9')][_0xa7d3('0xa')]({'port':0x232a});config['redis']=_[_0xa7d3('0xb')](config[_0xa7d3('0xc')],{'host':_0xa7d3('0xd'),'port':0x18eb});var socket=require(_0xa7d3('0xe'))(new Redis(config[_0xa7d3('0xc')]));require(_0xa7d3('0xf'))[_0xa7d3('0x10')](socket);function respondWithRpcPromise(_0x426d0f,_0x2470d3,_0x31989e){return new BPromise(function(_0x5a4903,_0x2527e9){return client[_0xa7d3('0x11')](_0x426d0f,_0x31989e)[_0xa7d3('0x12')](function(_0x5899d9){logger[_0xa7d3('0x13')](_0xa7d3('0x14'),_0x2470d3,_0xa7d3('0x15'));logger[_0xa7d3('0x16')](_0xa7d3('0x17'),_0x2470d3,_0xa7d3('0x15'),JSON[_0xa7d3('0x18')](_0x5899d9));if(_0x5899d9[_0xa7d3('0x19')]){if(_0x5899d9[_0xa7d3('0x19')][_0xa7d3('0x1a')]===0x1f4){logger[_0xa7d3('0x19')](_0xa7d3('0x14'),_0x2470d3,_0x5899d9[_0xa7d3('0x19')][_0xa7d3('0x1b')]);return _0x2527e9(_0x5899d9[_0xa7d3('0x19')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x2470d3,_0x5899d9[_0xa7d3('0x19')][_0xa7d3('0x1b')]);return _0x5a4903(_0x5899d9['error'][_0xa7d3('0x1b')]);}else{logger[_0xa7d3('0x13')](_0xa7d3('0x14'),_0x2470d3,_0xa7d3('0x15'));_0x5a4903(_0x5899d9[_0xa7d3('0x1c')][_0xa7d3('0x1b')]);}})[_0xa7d3('0x1d')](function(_0x44f664){logger[_0xa7d3('0x19')](_0xa7d3('0x14'),_0x2470d3,_0x44f664);_0x2527e9(_0x44f664);});});}exports['CreateChatMessage']=function(_0x25236d){var _0x15eb02=this;return new Promise(function(_0x3b6590,_0x421ce4){return db['ChatMessage'][_0xa7d3('0x1e')](_0x25236d[_0xa7d3('0x1f')],{'raw':_0x25236d[_0xa7d3('0x20')]?_0x25236d[_0xa7d3('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xa7d3('0x12')](function(_0x123cc4){logger[_0xa7d3('0x13')](_0xa7d3('0x21'),_0x25236d);logger[_0xa7d3('0x16')](_0xa7d3('0x21'),_0x25236d,JSON[_0xa7d3('0x18')](_0x123cc4));_0x3b6590(_0x123cc4);})[_0xa7d3('0x1d')](function(_0x5b26b7){logger[_0xa7d3('0x19')](_0xa7d3('0x21'),_0x5b26b7[_0xa7d3('0x1b')],_0x25236d);_0x421ce4(_0x15eb02[_0xa7d3('0x19')](0x1f4,_0x5b26b7['message']));});});};
\ No newline at end of file
+var _0xec28=['CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','catch'];(function(_0x4e7c73,_0x44dc00){var _0x3da080=function(_0x587a6b){while(--_0x587a6b){_0x4e7c73['push'](_0x4e7c73['shift']());}};_0x3da080(++_0x44dc00);}(_0xec28,0x14a));var _0x8ec2=function(_0x5ac791,_0x504d37){_0x5ac791=_0x5ac791-0x0;var _0x9e3a19=_0xec28[_0x5ac791];return _0x9e3a19;};'use strict';var _=require(_0x8ec2('0x0'));var util=require(_0x8ec2('0x1'));var moment=require('moment');var BPromise=require(_0x8ec2('0x2'));var rs=require(_0x8ec2('0x3'));var fs=require('fs');var Redis=require(_0x8ec2('0x4'));var db=require(_0x8ec2('0x5'))['db'];var utils=require(_0x8ec2('0x6'));var logger=require(_0x8ec2('0x7'))(_0x8ec2('0x8'));var config=require(_0x8ec2('0x9'));var jayson=require(_0x8ec2('0xa'));var client=jayson[_0x8ec2('0xb')][_0x8ec2('0xc')]({'port':0x232a});config[_0x8ec2('0xd')]=_[_0x8ec2('0xe')](config[_0x8ec2('0xd')],{'host':_0x8ec2('0xf'),'port':0x18eb});var socket=require(_0x8ec2('0x10'))(new Redis(config[_0x8ec2('0xd')]));require(_0x8ec2('0x11'))[_0x8ec2('0x12')](socket);function respondWithRpcPromise(_0x51fd43,_0x437b3e,_0x4cb148){return new BPromise(function(_0x179825,_0x3b02ce){return client[_0x8ec2('0x13')](_0x51fd43,_0x4cb148)[_0x8ec2('0x14')](function(_0x34c39e){logger[_0x8ec2('0x15')]('ChatMessage,\x20%s,\x20%s',_0x437b3e,_0x8ec2('0x16'));logger[_0x8ec2('0x17')](_0x8ec2('0x18'),_0x437b3e,_0x8ec2('0x16'),JSON[_0x8ec2('0x19')](_0x34c39e));if(_0x34c39e[_0x8ec2('0x1a')]){if(_0x34c39e['error']['code']===0x1f4){logger[_0x8ec2('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x437b3e,_0x34c39e[_0x8ec2('0x1a')]['message']);return _0x3b02ce(_0x34c39e[_0x8ec2('0x1a')][_0x8ec2('0x1b')]);}logger[_0x8ec2('0x1a')](_0x8ec2('0x1c'),_0x437b3e,_0x34c39e['error'][_0x8ec2('0x1b')]);return _0x179825(_0x34c39e[_0x8ec2('0x1a')][_0x8ec2('0x1b')]);}else{logger[_0x8ec2('0x15')](_0x8ec2('0x1c'),_0x437b3e,'request\x20sent');_0x179825(_0x34c39e['result'][_0x8ec2('0x1b')]);}})[_0x8ec2('0x1d')](function(_0x4cc094){logger[_0x8ec2('0x1a')](_0x8ec2('0x1c'),_0x437b3e,_0x4cc094);_0x3b02ce(_0x4cc094);});});}exports[_0x8ec2('0x1e')]=function(_0x1e7381){var _0xc922cf=this;return new Promise(function(_0x148367,_0x5ed09a){return db[_0x8ec2('0x1f')][_0x8ec2('0x20')](_0x1e7381[_0x8ec2('0x21')],{'raw':_0x1e7381[_0x8ec2('0x22')]?_0x1e7381[_0x8ec2('0x22')][_0x8ec2('0x23')]===undefined?!![]:![]:!![]})[_0x8ec2('0x14')](function(_0x87ac84){logger['info'](_0x8ec2('0x1e'),_0x1e7381);logger[_0x8ec2('0x17')](_0x8ec2('0x1e'),_0x1e7381,JSON[_0x8ec2('0x19')](_0x87ac84));_0x148367(_0x87ac84);})[_0x8ec2('0x1d')](function(_0x4d72b3){logger[_0x8ec2('0x1a')](_0x8ec2('0x1e'),_0x4d72b3[_0x8ec2('0x1b')],_0x1e7381);_0x5ed09a(_0xc922cf[_0x8ec2('0x1a')](0x1f4,_0x4d72b3[_0x8ec2('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 6c3e619..7bbff99 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 _0x38d3=['save','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x38d3,0x1a7));var _0x338d=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x38d3[_0x42f009];return _0x22a1e0;};'use strict';var ChatMessageEvents=require(_0x338d('0x0'));var events=[_0x338d('0x1'),'remove',_0x338d('0x2')];function createListener(_0x338ef5,_0x22c076){return function(_0x43ebf7){_0x22c076[_0x338d('0x3')](_0x338ef5,_0x43ebf7);};}function removeListener(_0x1c47c6,_0x2b867){return function(){ChatMessageEvents[_0x338d('0x4')](_0x1c47c6,_0x2b867);};}exports[_0x338d('0x5')]=function(_0x4e32b4){for(var _0x2a056d=0x0,_0x2012c3=events[_0x338d('0x6')];_0x2a056d<_0x2012c3;_0x2a056d++){var _0x2b7aab=events[_0x2a056d];var _0x60eaa1=createListener(_0x338d('0x7')+_0x2b7aab,_0x4e32b4);ChatMessageEvents['on'](_0x2b7aab,_0x60eaa1);}};
\ No newline at end of file
+var _0x2975=['update','removeListener','register','length','chatMessage:','save','remove'];(function(_0x667ff8,_0x59e7df){var _0x2ddfc7=function(_0x5a4a46){while(--_0x5a4a46){_0x667ff8['push'](_0x667ff8['shift']());}};_0x2ddfc7(++_0x59e7df);}(_0x2975,0x1c5));var _0x5297=function(_0x382609,_0x1d2fa2){_0x382609=_0x382609-0x0;var _0x5a6ae5=_0x2975[_0x382609];return _0x5a6ae5;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5297('0x0'),_0x5297('0x1'),_0x5297('0x2')];function createListener(_0x1a511b,_0x115e60){return function(_0x178801){_0x115e60['emit'](_0x1a511b,_0x178801);};}function removeListener(_0x56371f,_0x5e9de3){return function(){ChatMessageEvents[_0x5297('0x3')](_0x56371f,_0x5e9de3);};}exports[_0x5297('0x4')]=function(_0x11a43d){for(var _0x3da9c6=0x0,_0x4d1d2c=events[_0x5297('0x5')];_0x3da9c6<_0x4d1d2c;_0x3da9c6++){var _0x1b72a7=events[_0x3da9c6];var _0x4f12b0=createListener(_0x5297('0x6')+_0x1b72a7,_0x11a43d);ChatMessageEvents['on'](_0x1b72a7,_0x4f12b0);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 2663ffe..8f8ec4c 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 _0xf7b4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','show','post','tracked','chat','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x1ab82e,_0x4c95e2){var _0x37acd2=function(_0x54dd37){while(--_0x54dd37){_0x1ab82e['push'](_0x1ab82e['shift']());}};_0x37acd2(++_0x4c95e2);}(_0xf7b4,0x1ef));var _0x4f7b=function(_0x4452ea,_0x305536){_0x4452ea=_0x4452ea-0x0;var _0x49e391=_0xf7b4[_0x4452ea];return _0x49e391;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require(_0x4f7b('0x1'));var path=require(_0x4f7b('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f7b('0x3'));var router=express['Router']();var fs_extra=require(_0x4f7b('0x4'));var auth=require(_0x4f7b('0x5'));var interaction=require(_0x4f7b('0x6'));var config=require(_0x4f7b('0x7'));var controller=require(_0x4f7b('0x8'));router['get']('/',auth[_0x4f7b('0x9')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0xb')]('/describe',auth[_0x4f7b('0x9')](),controller['describe']);router[_0x4f7b('0xb')]('/:id',auth[_0x4f7b('0x9')](),controller[_0x4f7b('0xc')]);router[_0x4f7b('0xd')]('/',auth['isAuthenticated'](),interaction[_0x4f7b('0xe')](_0x4f7b('0xf'),'chatmessage:create'),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),controller[_0x4f7b('0x12')]);router[_0x4f7b('0x10')](_0x4f7b('0x13'),auth[_0x4f7b('0x9')](),controller[_0x4f7b('0x14')]);router[_0x4f7b('0x10')](_0x4f7b('0x15'),auth[_0x4f7b('0x9')](),controller['reject']);router[_0x4f7b('0x16')](_0x4f7b('0x11'),auth[_0x4f7b('0x9')](),controller[_0x4f7b('0x17')]);module[_0x4f7b('0x18')]=router;
\ No newline at end of file
+var _0x8f15=['destroy','exports','multer','util','path','express','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked','chatmessage:create','put','/:id','update','/:id/accept','accept'];(function(_0x5b54c8,_0x952a7){var _0x50339a=function(_0x3b04d7){while(--_0x3b04d7){_0x5b54c8['push'](_0x5b54c8['shift']());}};_0x50339a(++_0x952a7);}(_0x8f15,0xd4));var _0x58f1=function(_0x36a92a,_0x519210){_0x36a92a=_0x36a92a-0x0;var _0x539e72=_0x8f15[_0x36a92a];return _0x539e72;};'use strict';var multer=require(_0x58f1('0x0'));var util=require(_0x58f1('0x1'));var path=require(_0x58f1('0x2'));var timeout=require('connect-timeout');var express=require(_0x58f1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58f1('0x4'));var config=require('../../config/environment');var controller=require(_0x58f1('0x5'));router[_0x58f1('0x6')]('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0x8')]);router[_0x58f1('0x6')](_0x58f1('0x9'),auth['isAuthenticated'](),controller[_0x58f1('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x58f1('0xb')]);router['post']('/',auth[_0x58f1('0x7')](),interaction[_0x58f1('0xc')]('chat',_0x58f1('0xd')),controller['create']);router[_0x58f1('0xe')](_0x58f1('0xf'),controller[_0x58f1('0x10')]);router[_0x58f1('0xe')](_0x58f1('0x11'),auth['isAuthenticated'](),controller[_0x58f1('0x12')]);router[_0x58f1('0xe')]('/:id/reject',auth[_0x58f1('0x7')](),controller['reject']);router['delete'](_0x58f1('0xf'),auth['isAuthenticated'](),controller[_0x58f1('0x13')]);module[_0x58f1('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b983fa0..c1ab779 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0b0e,0x187));var _0xe0b0=function(_0x248fc8,_0x121ebf){_0x248fc8=_0x248fc8-0x0;var _0x1ec5d1=_0x0b0e[_0x248fc8];return _0x1ec5d1;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x2681de,_0x2f0760){var _0x565a4b=function(_0x126b4b){while(--_0x126b4b){_0x2681de['push'](_0x2681de['shift']());}};_0x565a4b(++_0x2f0760);}(_0xadb5,0xad));var _0x5adb=function(_0x49ca88,_0x4a5082){_0x49ca88=_0x49ca88-0x0;var _0x16f46d=_0xadb5[_0x49ca88];return _0x16f46d;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 0d1b5ca..094e011 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1aac,_0x54d27b){_0x5e1aac=_0x5e1aac-0x0;var _0x573143=_0x7a54[_0x5e1aac];return _0x573143;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x7a54,0x106));var _0x47a5=function(_0x21d0c4,_0x1798cb){_0x21d0c4=_0x21d0c4-0x0;var _0x4a7389=_0x7a54[_0x21d0c4];return _0x4a7389;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 6276699..5ba2c23 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b27=['ChatOfflineMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3be115,_0x28b2c3){var _0x2d9bed=function(_0x2075b5){while(--_0x2075b5){_0x3be115['push'](_0x3be115['shift']());}};_0x2d9bed(++_0x28b2c3);}(_0x7b27,0x12a));var _0x77b2=function(_0x33055c,_0xa858b5){_0x33055c=_0x33055c-0x0;var _0x27d777=_0x7b27[_0x33055c];return _0x27d777;};'use strict';var EventEmitter=require(_0x77b2('0x0'));var ChatOfflineMessage=require(_0x77b2('0x1'))['db'][_0x77b2('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x77b2('0x3'),'afterUpdate':_0x77b2('0x4'),'afterDestroy':_0x77b2('0x5')};function emitEvent(_0x550126){return function(_0x490fd8,_0x504e3e,_0x4222a0){ChatOfflineMessageEvents['emit'](_0x550126+':'+_0x490fd8['id'],_0x490fd8);ChatOfflineMessageEvents[_0x77b2('0x6')](_0x550126,_0x490fd8);_0x4222a0(null);};}for(var e in events){if(events[_0x77b2('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x77b2('0x8')](e,emitEvent(event));}}module[_0x77b2('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x6217=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x52e66b,_0x1413cf){var _0x3dc151=function(_0x566945){while(--_0x566945){_0x52e66b['push'](_0x52e66b['shift']());}};_0x3dc151(++_0x1413cf);}(_0x6217,0x1bc));var _0x7621=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x6217[_0xa990b7];return _0x52c99c;};'use strict';var EventEmitter=require(_0x7621('0x0'));var ChatOfflineMessage=require(_0x7621('0x1'))['db'][_0x7621('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7621('0x3')](0x0);var events={'afterCreate':_0x7621('0x4'),'afterUpdate':_0x7621('0x5'),'afterDestroy':_0x7621('0x6')};function emitEvent(_0x5051bc){return function(_0x4c36b9,_0x3fc5be,_0x21a300){ChatOfflineMessageEvents[_0x7621('0x7')](_0x5051bc+':'+_0x4c36b9['id'],_0x4c36b9);ChatOfflineMessageEvents[_0x7621('0x7')](_0x5051bc,_0x4c36b9);_0x21a300(null);};}for(var e in events){if(events[_0x7621('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x7621('0x9')](e,emitEvent(event));}}module[_0x7621('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 89da61a..4e30152 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 _0x3a8d=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x3a8d,0x16c));var _0xd3a8=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0x3a8d[_0x127a60];return _0xc1f6a3;};'use strict';var attributes=require(_0xd3a8('0x0'));module[_0xd3a8('0x1')]=function(_0x51ebe7){return _0x51ebe7['define'](_0xd3a8('0x2'),attributes,{'tableName':_0xd3a8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd3a8('0x4'),'collate':_0xd3a8('0x5')});};
\ No newline at end of file
+var _0x8f57=['define','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x4ba160,_0x249ba7){var _0x57196b=function(_0x364b5b){while(--_0x364b5b){_0x4ba160['push'](_0x4ba160['shift']());}};_0x57196b(++_0x249ba7);}(_0x8f57,0xa8));var _0x78f5=function(_0x4bcbc2,_0x46cbff){_0x4bcbc2=_0x4bcbc2-0x0;var _0xe5b888=_0x8f57[_0x4bcbc2];return _0xe5b888;};'use strict';var attributes=require(_0x78f5('0x0'));module[_0x78f5('0x1')]=function(_0x41c1a5){return _0x41c1a5[_0x78f5('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x78f5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x78f5('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7fadccb..5a270d2 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 _0xcfa1=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfa1,0xbe));var _0x1cfa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfa1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1cfa('0x0'));var util=require('util');var moment=require(_0x1cfa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cfa('0x2'));var db=require(_0x1cfa('0x3'))['db'];var utils=require(_0x1cfa('0x4'));var logger=require(_0x1cfa('0x5'))(_0x1cfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x1cfa('0x7'));var client=jayson[_0x1cfa('0x8')][_0x1cfa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b62b7,_0x574566,_0x596bd9){return new BPromise(function(_0x2c60b2,_0x47b83b){return client[_0x1cfa('0xa')](_0x5b62b7,_0x596bd9)[_0x1cfa('0xb')](function(_0x450def){logger['info'](_0x1cfa('0xc'),_0x574566,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x574566,_0x1cfa('0xd'),JSON[_0x1cfa('0xe')](_0x450def));if(_0x450def[_0x1cfa('0xf')]){if(_0x450def[_0x1cfa('0xf')][_0x1cfa('0x10')]===0x1f4){logger['error'](_0x1cfa('0xc'),_0x574566,_0x450def[_0x1cfa('0xf')][_0x1cfa('0x11')]);return _0x47b83b(_0x450def[_0x1cfa('0xf')][_0x1cfa('0x11')]);}logger[_0x1cfa('0xf')](_0x1cfa('0xc'),_0x574566,_0x450def[_0x1cfa('0xf')][_0x1cfa('0x11')]);return _0x2c60b2(_0x450def['error']['message']);}else{logger[_0x1cfa('0x12')](_0x1cfa('0xc'),_0x574566,'request\x20sent');_0x2c60b2(_0x450def[_0x1cfa('0x13')][_0x1cfa('0x11')]);}})[_0x1cfa('0x14')](function(_0x4a7701){logger[_0x1cfa('0xf')](_0x1cfa('0xc'),_0x574566,_0x4a7701);_0x47b83b(_0x4a7701);});});}
\ No newline at end of file
+var _0xa0d6=['message','result','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x416939,_0x5e8347){var _0x10b649=function(_0xaf7094){while(--_0xaf7094){_0x416939['push'](_0x416939['shift']());}};_0x10b649(++_0x5e8347);}(_0xa0d6,0x1f0));var _0x6a0d=function(_0x1e5ad6,_0x34417a){_0x1e5ad6=_0x1e5ad6-0x0;var _0x5bc0d3=_0xa0d6[_0x1e5ad6];return _0x5bc0d3;};'use strict';var _=require(_0x6a0d('0x0'));var util=require(_0x6a0d('0x1'));var moment=require('moment');var BPromise=require(_0x6a0d('0x2'));var rs=require(_0x6a0d('0x3'));var fs=require('fs');var Redis=require(_0x6a0d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6a0d('0x5'));var config=require(_0x6a0d('0x6'));var jayson=require(_0x6a0d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x172d9a,_0x53d72d,_0x123a87){return new BPromise(function(_0x1f7595,_0x205615){return client[_0x6a0d('0x8')](_0x172d9a,_0x123a87)[_0x6a0d('0x9')](function(_0x39aa65){logger[_0x6a0d('0xa')](_0x6a0d('0xb'),_0x53d72d,'request\x20sent');logger[_0x6a0d('0xc')](_0x6a0d('0xd'),_0x53d72d,_0x6a0d('0xe'),JSON['stringify'](_0x39aa65));if(_0x39aa65['error']){if(_0x39aa65[_0x6a0d('0xf')][_0x6a0d('0x10')]===0x1f4){logger[_0x6a0d('0xf')](_0x6a0d('0xb'),_0x53d72d,_0x39aa65['error'][_0x6a0d('0x11')]);return _0x205615(_0x39aa65[_0x6a0d('0xf')][_0x6a0d('0x11')]);}logger[_0x6a0d('0xf')](_0x6a0d('0xb'),_0x53d72d,_0x39aa65[_0x6a0d('0xf')][_0x6a0d('0x11')]);return _0x1f7595(_0x39aa65['error'][_0x6a0d('0x11')]);}else{logger['info'](_0x6a0d('0xb'),_0x53d72d,'request\x20sent');_0x1f7595(_0x39aa65[_0x6a0d('0x12')][_0x6a0d('0x11')]);}})['catch'](function(_0x5f5d6d){logger[_0x6a0d('0xf')](_0x6a0d('0xb'),_0x53d72d,_0x5f5d6d);_0x205615(_0x5f5d6d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d852c43..2129bb0 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 _0xc142=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','post','create','/:id','delete','exports'];(function(_0x172df9,_0x2c9c2f){var _0x5d5ad1=function(_0x4f14f5){while(--_0x4f14f5){_0x172df9['push'](_0x172df9['shift']());}};_0x5d5ad1(++_0x2c9c2f);}(_0xc142,0x10e));var _0x2c14=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xc142[_0x11ce46];return _0x368a1e;};'use strict';var multer=require('multer');var util=require(_0x2c14('0x0'));var path=require(_0x2c14('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c14('0x2'));var router=express[_0x2c14('0x3')]();var fs_extra=require(_0x2c14('0x4'));var auth=require(_0x2c14('0x5'));var interaction=require(_0x2c14('0x6'));var config=require('../../config/environment');var controller=require(_0x2c14('0x7'));router[_0x2c14('0x8')]('/',auth[_0x2c14('0x9')](),controller[_0x2c14('0xa')]);router[_0x2c14('0x8')](_0x2c14('0xb'),auth[_0x2c14('0x9')](),controller[_0x2c14('0xc')]);router[_0x2c14('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2c14('0xd')]('/',auth[_0x2c14('0x9')](),controller[_0x2c14('0xe')]);router['put'](_0x2c14('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x2c14('0x10')](_0x2c14('0xf'),auth[_0x2c14('0x9')](),controller['destroy']);module[_0x2c14('0x11')]=router;
\ No newline at end of file
+var _0xb406=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb406,0x197));var _0x6b40=function(_0xb20e64,_0x5cd27d){_0xb20e64=_0xb20e64-0x0;var _0x5efca5=_0xb406[_0xb20e64];return _0x5efca5;};'use strict';var multer=require(_0x6b40('0x0'));var util=require('util');var path=require(_0x6b40('0x1'));var timeout=require(_0x6b40('0x2'));var express=require(_0x6b40('0x3'));var router=express[_0x6b40('0x4')]();var fs_extra=require(_0x6b40('0x5'));var auth=require(_0x6b40('0x6'));var interaction=require(_0x6b40('0x7'));var config=require(_0x6b40('0x8'));var controller=require(_0x6b40('0x9'));router[_0x6b40('0xa')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0xc')]);router[_0x6b40('0xa')](_0x6b40('0xd'),auth['isAuthenticated'](),controller[_0x6b40('0xe')]);router['get'](_0x6b40('0xf'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x10')]);router[_0x6b40('0x11')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0x12')]);router['put']('/:id',auth[_0x6b40('0xb')](),controller[_0x6b40('0x13')]);router[_0x6b40('0x14')]('/:id',auth[_0x6b40('0xb')](),controller[_0x6b40('0x15')]);module[_0x6b40('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 6844103..7fd7017 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 _0x58b7=['INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x1c3ae6,_0x1385bb){var _0x54811c=function(_0x183950){while(--_0x183950){_0x1c3ae6['push'](_0x1c3ae6['shift']());}};_0x54811c(++_0x1385bb);}(_0x58b7,0xb0));var _0x758b=function(_0x1549dc,_0x371c41){_0x1549dc=_0x1549dc-0x0;var _0x39beb8=_0x58b7[_0x1549dc];return _0x39beb8;};'use strict';var Sequelize=require(_0x758b('0x0'));module[_0x758b('0x1')]={'name':{'type':Sequelize[_0x758b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x758b('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x758b('0x4')]}};
\ No newline at end of file
+var _0x280a=['ENUM','mouseOver','timeout','sequelize','exports','STRING'];(function(_0x29be47,_0xf5e31b){var _0x595d1b=function(_0x343b49){while(--_0x343b49){_0x29be47['push'](_0x29be47['shift']());}};_0x595d1b(++_0xf5e31b);}(_0x280a,0xab));var _0xa280=function(_0x92724b,_0x18e7d6){_0x92724b=_0x92724b-0x0;var _0x12e4f5=_0x280a[_0x92724b];return _0x12e4f5;};'use strict';var Sequelize=require(_0xa280('0x0'));module[_0xa280('0x1')]={'name':{'type':Sequelize[_0xa280('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa280('0x3')](_0xa280('0x4'),_0xa280('0x5')),'defaultValue':_0xa280('0x4')},'selector':{'type':Sequelize[_0xa280('0x2')]},'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 e85ebc8..ced2eb3 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 _0x032e=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','params','rawAttributes','query','keys','intersection','model','attributes','fields','length','includeAll','merge','ChatProactiveAction','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x4e5650,_0x2bf847){var _0x1e096c=function(_0x169928){while(--_0x169928){_0x4e5650['push'](_0x4e5650['shift']());}};_0x1e096c(++_0x2bf847);}(_0x032e,0x124));var _0xe032=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x032e[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['show']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={'raw':!![],'where':{'id':_0x5573e4[_0xe032('0x2b')]['id']}},_0x469290={};_0x469290['model']=_['keys'](db['ChatProactiveAction'][_0xe032('0x2c')]);_0x469290[_0xe032('0x2d')]=_[_0xe032('0x2e')](_0x5573e4[_0xe032('0x2d')]);_0x469290['filters']=_[_0xe032('0x2f')](_0x469290[_0xe032('0x30')],_0x469290[_0xe032('0x2d')]);_0x38e7ea[_0xe032('0x31')]=_[_0xe032('0x2f')](_0x469290['model'],qs[_0xe032('0x32')](_0x5573e4[_0xe032('0x2d')][_0xe032('0x32')]));_0x38e7ea[_0xe032('0x31')]=_0x38e7ea['attributes'][_0xe032('0x33')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x30')];if(_0x5573e4['query'][_0xe032('0x34')]){_0x38e7ea['include']=[{'all':!![]}];}_0x38e7ea=_[_0xe032('0x35')]({},_0x38e7ea,_0x5573e4['options']);return db[_0xe032('0x36')][_0xe032('0x37')](_0x38e7ea)['then'](handleEntityNotFound(_0x3e2575,null))[_0xe032('0x27')](respondWithResult(_0x3e2575,null))[_0xe032('0x38')](handleError(_0x3e2575,null));};exports[_0xe032('0x39')]=function(_0x2620d2,_0x4e222c){return db[_0xe032('0x36')]['create'](_0x2620d2[_0xe032('0x3a')],{})[_0xe032('0x27')](respondWithResult(_0x4e222c,0xc9))['catch'](handleError(_0x4e222c,null));};exports[_0xe032('0x26')]=function(_0x23b790,_0x4a4447){if(_0x23b790[_0xe032('0x3a')]['id']){delete _0x23b790[_0xe032('0x3a')]['id'];}return db[_0xe032('0x36')][_0xe032('0x37')]({'where':{'id':_0x23b790[_0xe032('0x2b')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x4a4447,null))[_0xe032('0x27')](saveUpdates(_0x23b790[_0xe032('0x3a')],null))[_0xe032('0x27')](respondWithResult(_0x4a4447,null))[_0xe032('0x38')](handleError(_0x4a4447,null));};exports[_0xe032('0x3b')]=function(_0x432d39,_0x30571c){return db[_0xe032('0x36')][_0xe032('0x37')]({'where':{'id':_0x432d39[_0xe032('0x2b')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x30571c,null))['then'](removeEntity(_0x30571c,null))[_0xe032('0x38')](handleError(_0x30571c,null));};
\ No newline at end of file
+var _0x8781=['limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','show','model','keys','query','filters','intersection','attributes','fields','includeAll','include','find','catch','ChatProactiveAction','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined'];(function(_0x3342ee,_0x2dd43e){var _0x11d861=function(_0x3e64b0){while(--_0x3e64b0){_0x3342ee['push'](_0x3342ee['shift']());}};_0x11d861(++_0x2dd43e);}(_0x8781,0x1c8));var _0x1878=function(_0x24b55c,_0x163e62){_0x24b55c=_0x24b55c-0x0;var _0x1f034e=_0x8781[_0x24b55c];return _0x1f034e;};'use strict';var emlformat=require(_0x1878('0x0'));var rimraf=require(_0x1878('0x1'));var zipdir=require(_0x1878('0x2'));var jsonpatch=require(_0x1878('0x3'));var rp=require(_0x1878('0x4'));var moment=require(_0x1878('0x5'));var BPromise=require(_0x1878('0x6'));var Mustache=require('mustache');var util=require(_0x1878('0x7'));var path=require(_0x1878('0x8'));var sox=require(_0x1878('0x9'));var csv=require(_0x1878('0xa'));var ejs=require(_0x1878('0xb'));var fs=require('fs');var fs_extra=require(_0x1878('0xc'));var _=require('lodash');var squel=require(_0x1878('0xd'));var crypto=require(_0x1878('0xe'));var jsforce=require(_0x1878('0xf'));var deskjs=require(_0x1878('0x10'));var toCsv=require(_0x1878('0xa'));var querystring=require(_0x1878('0x11'));var Papa=require(_0x1878('0x12'));var Redis=require(_0x1878('0x13'));var authService=require(_0x1878('0x14'));var qs=require(_0x1878('0x15'));var as=require(_0x1878('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1878('0x17'))(_0x1878('0x18'));var utils=require(_0x1878('0x19'));var config=require(_0x1878('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4272ab,_0x1ed9f0){_0x1ed9f0=_0x1ed9f0||0xcc;return function(_0x181e51){if(_0x181e51){return _0x4272ab[_0x1878('0x1b')](_0x1ed9f0);}return _0x4272ab['status'](_0x1ed9f0)['end']();};}function respondWithResult(_0x19ffaa,_0x396f3a){_0x396f3a=_0x396f3a||0xc8;return function(_0x49d3a1){if(_0x49d3a1){return _0x19ffaa[_0x1878('0x1c')](_0x396f3a)[_0x1878('0x1d')](_0x49d3a1);}};}function respondWithFilteredResult(_0xb324ba,_0x4a5ba9){return function(_0x562902){if(_0x562902){var _0x13e16d=typeof _0x4a5ba9[_0x1878('0x1e')]===_0x1878('0x1f')&&typeof _0x4a5ba9[_0x1878('0x20')]===_0x1878('0x1f');var _0x430e64=_0x562902[_0x1878('0x21')];var _0x1642b3=_0x13e16d?0x0:_0x4a5ba9[_0x1878('0x1e')];var _0x2b8492=_0x13e16d?_0x562902[_0x1878('0x21')]:_0x4a5ba9['offset']+_0x4a5ba9['limit'];var _0xf80c60;if(_0x2b8492>=_0x430e64){_0x2b8492=_0x430e64;_0xf80c60=0xc8;}else{_0xf80c60=0xce;}_0xb324ba[_0x1878('0x1c')](_0xf80c60);return _0xb324ba['set'](_0x1878('0x22'),_0x1642b3+'-'+_0x2b8492+'/'+_0x430e64)[_0x1878('0x1d')](_0x562902);}return null;};}function patchUpdates(_0x1fae20){return function(_0x387f5){try{jsonpatch[_0x1878('0x23')](_0x387f5,_0x1fae20,!![]);}catch(_0x4dc6f1){return BPromise[_0x1878('0x24')](_0x4dc6f1);}return _0x387f5['save']();};}function saveUpdates(_0x1c2b5d,_0x45e2b6){return function(_0x2bc65b){if(_0x2bc65b){return _0x2bc65b[_0x1878('0x25')](_0x1c2b5d)[_0x1878('0x26')](function(_0x524e68){return _0x524e68;});}return null;};}function removeEntity(_0x461905,_0x10ce95){return function(_0x215e59){if(_0x215e59){return _0x215e59[_0x1878('0x27')]()[_0x1878('0x26')](function(){_0x461905[_0x1878('0x1c')](0xcc)[_0x1878('0x28')]();});}};}function handleEntityNotFound(_0x4e114d,_0x122c65){return function(_0x10ab5c){if(!_0x10ab5c){_0x4e114d[_0x1878('0x1b')](0x194);}return _0x10ab5c;};}function handleError(_0xb191d0,_0x46f5b7){_0x46f5b7=_0x46f5b7||0x1f4;return function(_0x57580b){logger[_0x1878('0x29')](_0x57580b[_0x1878('0x2a')]);if(_0x57580b[_0x1878('0x2b')]){delete _0x57580b[_0x1878('0x2b')];}_0xb191d0['status'](_0x46f5b7)[_0x1878('0x2c')](_0x57580b);};}exports[_0x1878('0x2d')]=function(_0x13fb40,_0x31b2ba){var _0x1eda2b={'raw':!![],'where':{'id':_0x13fb40['params']['id']}},_0x45e3db={};_0x45e3db[_0x1878('0x2e')]=_[_0x1878('0x2f')](db['ChatProactiveAction']['rawAttributes']);_0x45e3db[_0x1878('0x30')]=_['keys'](_0x13fb40['query']);_0x45e3db[_0x1878('0x31')]=_[_0x1878('0x32')](_0x45e3db[_0x1878('0x2e')],_0x45e3db['query']);_0x1eda2b[_0x1878('0x33')]=_[_0x1878('0x32')](_0x45e3db[_0x1878('0x2e')],qs[_0x1878('0x34')](_0x13fb40['query'][_0x1878('0x34')]));_0x1eda2b[_0x1878('0x33')]=_0x1eda2b[_0x1878('0x33')]['length']?_0x1eda2b['attributes']:_0x45e3db[_0x1878('0x2e')];if(_0x13fb40['query'][_0x1878('0x35')]){_0x1eda2b[_0x1878('0x36')]=[{'all':!![]}];}_0x1eda2b=_['merge']({},_0x1eda2b,_0x13fb40['options']);return db['ChatProactiveAction'][_0x1878('0x37')](_0x1eda2b)[_0x1878('0x26')](handleEntityNotFound(_0x31b2ba,null))[_0x1878('0x26')](respondWithResult(_0x31b2ba,null))[_0x1878('0x38')](handleError(_0x31b2ba,null));};exports['create']=function(_0xcd00c2,_0x4ca033){return db[_0x1878('0x39')][_0x1878('0x3a')](_0xcd00c2['body'],{})[_0x1878('0x26')](respondWithResult(_0x4ca033,0xc9))[_0x1878('0x38')](handleError(_0x4ca033,null));};exports['update']=function(_0xd589dc,_0x4086ea){if(_0xd589dc['body']['id']){delete _0xd589dc[_0x1878('0x3b')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0xd589dc[_0x1878('0x3c')]['id']}})[_0x1878('0x26')](handleEntityNotFound(_0x4086ea,null))['then'](saveUpdates(_0xd589dc[_0x1878('0x3b')],null))[_0x1878('0x26')](respondWithResult(_0x4086ea,null))[_0x1878('0x38')](handleError(_0x4086ea,null));};exports[_0x1878('0x27')]=function(_0x5cbdfe,_0x41e778){return db[_0x1878('0x39')][_0x1878('0x37')]({'where':{'id':_0x5cbdfe['params']['id']}})['then'](handleEntityNotFound(_0x41e778,null))[_0x1878('0x26')](removeEntity(_0x41e778,null))[_0x1878('0x38')](handleError(_0x41e778,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6f56a8e..796ca6b 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 _0x646c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger'];(function(_0x1cb581,_0x58507b){var _0xbd2a2=function(_0x152df2){while(--_0x152df2){_0x1cb581['push'](_0x1cb581['shift']());}};_0xbd2a2(++_0x58507b);}(_0x646c,0xf6));var _0xc646=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x646c[_0x1b6186];return _0x186121;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc646('0x0'))(_0xc646('0x1'));var moment=require(_0xc646('0x2'));var BPromise=require(_0xc646('0x3'));var rp=require(_0xc646('0x4'));var fs=require('fs');var path=require(_0xc646('0x5'));var rimraf=require(_0xc646('0x6'));var config=require(_0xc646('0x7'));var attributes=require(_0xc646('0x8'));module[_0xc646('0x9')]=function(_0x187702,_0x41fd6f){return _0x187702[_0xc646('0xa')](_0xc646('0xb'),attributes,{'tableName':_0xc646('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45dd=['api','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger'];(function(_0x57172c,_0x1df512){var _0x38e8a4=function(_0x1bc9a5){while(--_0x1bc9a5){_0x57172c['push'](_0x57172c['shift']());}};_0x38e8a4(++_0x1df512);}(_0x45dd,0x172));var _0xd45d=function(_0x343d34,_0x2efaa0){_0x343d34=_0x343d34-0x0;var _0x12acc3=_0x45dd[_0x343d34];return _0x12acc3;};'use strict';var _=require(_0xd45d('0x0'));var util=require('util');var logger=require(_0xd45d('0x1'))(_0xd45d('0x2'));var moment=require(_0xd45d('0x3'));var BPromise=require(_0xd45d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd45d('0x5'));var rimraf=require(_0xd45d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd45d('0x7'));module[_0xd45d('0x8')]=function(_0x17fecc,_0x20af6a){return _0x17fecc[_0xd45d('0x9')](_0xd45d('0xa'),attributes,{'tableName':_0xd45d('0xb'),'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 6908e35..a2fab5d 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 _0x2769=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x2769,0xcf));var _0x9276=function(_0x5e7ed5,_0x1ec933){_0x5e7ed5=_0x5e7ed5-0x0;var _0x3e1460=_0x2769[_0x5e7ed5];return _0x3e1460;};'use strict';var _=require('lodash');var util=require(_0x9276('0x0'));var moment=require('moment');var BPromise=require(_0x9276('0x1'));var rs=require(_0x9276('0x2'));var fs=require('fs');var Redis=require(_0x9276('0x3'));var db=require(_0x9276('0x4'))['db'];var utils=require(_0x9276('0x5'));var logger=require(_0x9276('0x6'))('rpc');var config=require(_0x9276('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9276('0x8')][_0x9276('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d3baf,_0xd854d5,_0x19e660){return new BPromise(function(_0x277236,_0x552f72){return client[_0x9276('0xa')](_0x5d3baf,_0x19e660)[_0x9276('0xb')](function(_0x32fa31){logger[_0x9276('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0xd854d5,_0x9276('0xd'));logger[_0x9276('0xe')](_0x9276('0xf'),_0xd854d5,_0x9276('0xd'),JSON['stringify'](_0x32fa31));if(_0x32fa31[_0x9276('0x10')]){if(_0x32fa31[_0x9276('0x10')][_0x9276('0x11')]===0x1f4){logger[_0x9276('0x10')](_0x9276('0x12'),_0xd854d5,_0x32fa31['error'][_0x9276('0x13')]);return _0x552f72(_0x32fa31[_0x9276('0x10')]['message']);}logger[_0x9276('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0xd854d5,_0x32fa31[_0x9276('0x10')][_0x9276('0x13')]);return _0x277236(_0x32fa31[_0x9276('0x10')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0xd854d5,'request\x20sent');_0x277236(_0x32fa31[_0x9276('0x14')][_0x9276('0x13')]);}})[_0x9276('0x15')](function(_0x570252){logger[_0x9276('0x10')](_0x9276('0x12'),_0xd854d5,_0x570252);_0x552f72(_0x570252);});});}
\ No newline at end of file
+var _0xdceb=['client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0xdceb,0x160));var _0xbdce=function(_0x34fa5c,_0x44c7a7){_0x34fa5c=_0x34fa5c-0x0;var _0x590357=_0xdceb[_0x34fa5c];return _0x590357;};'use strict';var _=require('lodash');var util=require(_0xbdce('0x0'));var moment=require('moment');var BPromise=require(_0xbdce('0x1'));var rs=require(_0xbdce('0x2'));var fs=require('fs');var Redis=require(_0xbdce('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdce('0x4'));var logger=require(_0xbdce('0x5'))('rpc');var config=require(_0xbdce('0x6'));var jayson=require(_0xbdce('0x7'));var client=jayson[_0xbdce('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x155cc6,_0x311e09,_0x3c7791){return new BPromise(function(_0x2af993,_0x662f1d){return client['request'](_0x155cc6,_0x3c7791)[_0xbdce('0x9')](function(_0x280e9d){logger[_0xbdce('0xa')](_0xbdce('0xb'),_0x311e09,_0xbdce('0xc'));logger[_0xbdce('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x311e09,_0xbdce('0xc'),JSON[_0xbdce('0xe')](_0x280e9d));if(_0x280e9d[_0xbdce('0xf')]){if(_0x280e9d['error'][_0xbdce('0x10')]===0x1f4){logger[_0xbdce('0xf')](_0xbdce('0xb'),_0x311e09,_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);return _0x662f1d(_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);}logger[_0xbdce('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x311e09,_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);return _0x2af993(_0x280e9d[_0xbdce('0xf')][_0xbdce('0x11')]);}else{logger[_0xbdce('0xa')](_0xbdce('0xb'),_0x311e09,_0xbdce('0xc'));_0x2af993(_0x280e9d[_0xbdce('0x12')][_0xbdce('0x11')]);}})[_0xbdce('0x13')](function(_0xa1fbc5){logger[_0xbdce('0xf')](_0xbdce('0xb'),_0x311e09,_0xa1fbc5);_0x662f1d(_0xa1fbc5);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index b60cbe6..13b63e8 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 _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x401f2e,_0x119d0d){var _0x4ef876=function(_0x5bb365){while(--_0x5bb365){_0x401f2e['push'](_0x401f2e['shift']());}};_0x4ef876(++_0x119d0d);}(_0xae24,0x182));var _0x4ae2=function(_0x488202,_0x624b77){_0x488202=_0x488202-0x0;var _0x31523b=_0xae24[_0x488202];return _0x31523b;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router;
\ No newline at end of file
+var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x2bd8,0x130));var _0x82bd=function(_0x25e703,_0x433147){_0x25e703=_0x25e703-0x0;var _0x534a40=_0x2bd8[_0x25e703];return _0x534a40;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index fb206e9..477b6b2 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 _0x908c=['STRING','name','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x908c,0xbb));var _0xc908=function(_0xc4d029,_0x514de7){_0xc4d029=_0xc4d029-0x0;var _0x1fa5ac=_0x908c[_0xc4d029];return _0x1fa5ac;};'use strict';var Sequelize=require(_0xc908('0x0'));module[_0xc908('0x1')]={'name':{'type':Sequelize[_0xc908('0x2')],'unique':_0xc908('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc908('0x2')]},'timeout':{'type':Sequelize[_0xc908('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc908('0x5'),_0xc908('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xb7b8=['STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x58fcb4,_0xca5a33){var _0x53bfe1=function(_0x1289e6){while(--_0x1289e6){_0x58fcb4['push'](_0x58fcb4['shift']());}};_0x53bfe1(++_0xca5a33);}(_0xb7b8,0x1d4));var _0x8b7b=function(_0x5d3a2b,_0x2f3586){_0x5d3a2b=_0x5d3a2b-0x0;var _0x226126=_0xb7b8[_0x5d3a2b];return _0x226126;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8b7b('0x0')],'unique':_0x8b7b('0x1'),'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[_0x8b7b('0x2')](_0x8b7b('0x3'),_0x8b7b('0x4'),_0x8b7b('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index e57cc40..b8c81e9 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 _0xde89=['describe','getMembers','params','UserChatQueue','nolimit','User','findAndCountAll','agent','updatedAt','createdAt','format','SIP','chatPause','findOne','Team','order','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','union','value','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xde89,0x156));var _0x9de8=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xde89[_0x2cc569];return _0x1bfc2e;};'use strict';var emlformat=require(_0x9de8('0x0'));var rimraf=require(_0x9de8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9de8('0x2'));var Mustache=require(_0x9de8('0x3'));var util=require('util');var path=require(_0x9de8('0x4'));var sox=require(_0x9de8('0x5'));var csv=require(_0x9de8('0x6'));var ejs=require(_0x9de8('0x7'));var fs=require('fs');var fs_extra=require(_0x9de8('0x8'));var _=require('lodash');var squel=require(_0x9de8('0x9'));var crypto=require(_0x9de8('0xa'));var jsforce=require(_0x9de8('0xb'));var deskjs=require(_0x9de8('0xc'));var toCsv=require(_0x9de8('0x6'));var querystring=require('querystring');var Papa=require(_0x9de8('0xd'));var Redis=require(_0x9de8('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9de8('0xf'));var hardwareService=require(_0x9de8('0x10'));var logger=require(_0x9de8('0x11'))(_0x9de8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9de8('0x13'));var db=require(_0x9de8('0x14'))['db'];config[_0x9de8('0x15')]=_[_0x9de8('0x16')](config[_0x9de8('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9de8('0x17'))(new Redis(config['redis']));require(_0x9de8('0x18'))[_0x9de8('0x19')](socket);var jayson=require(_0x9de8('0x1a'));var client=jayson[_0x9de8('0x1b')][_0x9de8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x32447c,_0x5ba223,_0x57a303,_0x6c33ad){return new BPromise(function(_0x41af96,_0x1932d1){var _0x25f2c3=_0x6c33ad||client;return _0x25f2c3[_0x9de8('0x1d')](_0x32447c,_0x57a303)['then'](function(_0x7374a){logger['info'](_0x9de8('0x1e'),_0x5ba223,_0x9de8('0x1f'));logger['debug'](_0x9de8('0x20'),_0x5ba223,_0x9de8('0x1f'),JSON[_0x9de8('0x21')](_0x7374a));if(_0x7374a[_0x9de8('0x22')]){if(_0x7374a['error'][_0x9de8('0x23')]===0x1f4){logger[_0x9de8('0x22')](_0x9de8('0x1e'),_0x5ba223,_0x7374a[_0x9de8('0x22')]['message']);return _0x1932d1(_0x7374a[_0x9de8('0x22')][_0x9de8('0x24')]);}logger[_0x9de8('0x22')](_0x9de8('0x1e'),_0x5ba223,_0x7374a[_0x9de8('0x22')]['message']);return _0x41af96(_0x7374a[_0x9de8('0x22')][_0x9de8('0x24')]);}else{logger[_0x9de8('0x25')](_0x9de8('0x1e'),_0x5ba223,_0x9de8('0x1f'));_0x41af96(_0x7374a[_0x9de8('0x26')]['message']);}})[_0x9de8('0x27')](function(_0x531ada){logger[_0x9de8('0x22')](_0x9de8('0x1e'),_0x5ba223,_0x531ada);_0x1932d1(_0x531ada);});});}function respondWithStatusCode(_0x220d9c,_0x39b168){_0x39b168=_0x39b168||0xcc;return function(_0x553f96){if(_0x553f96){return _0x220d9c['sendStatus'](_0x39b168);}return _0x220d9c[_0x9de8('0x28')](_0x39b168)[_0x9de8('0x29')]();};}function respondWithResult(_0x5c666f,_0x13ca93){_0x13ca93=_0x13ca93||0xc8;return function(_0x4bdb19){if(_0x4bdb19){return _0x5c666f[_0x9de8('0x28')](_0x13ca93)[_0x9de8('0x2a')](_0x4bdb19);}};}function respondWithFilteredResult(_0x35b809,_0x41722b){return function(_0x1beb17){if(_0x1beb17){var _0x4bd8f6=typeof _0x41722b[_0x9de8('0x2b')]===_0x9de8('0x2c')&&typeof _0x41722b[_0x9de8('0x2d')]===_0x9de8('0x2c');var _0x2aaafa=_0x1beb17[_0x9de8('0x2e')];var _0x1c2aed=_0x4bd8f6?0x0:_0x41722b['offset'];var _0x41619e=_0x4bd8f6?_0x1beb17[_0x9de8('0x2e')]:_0x41722b['offset']+_0x41722b[_0x9de8('0x2d')];var _0x1da7ed;if(_0x41619e>=_0x2aaafa){_0x41619e=_0x2aaafa;_0x1da7ed=0xc8;}else{_0x1da7ed=0xce;}_0x35b809[_0x9de8('0x28')](_0x1da7ed);return _0x35b809['set']('Content-Range',_0x1c2aed+'-'+_0x41619e+'/'+_0x2aaafa)[_0x9de8('0x2a')](_0x1beb17);}return null;};}function patchUpdates(_0x3f02b0){return function(_0x552716){try{jsonpatch[_0x9de8('0x2f')](_0x552716,_0x3f02b0,!![]);}catch(_0x4bdf10){return BPromise['reject'](_0x4bdf10);}return _0x552716[_0x9de8('0x30')]();};}function saveUpdates(_0xa1d8b6,_0x32ede4){return function(_0x2be8be){if(_0x2be8be){return _0x2be8be['update'](_0xa1d8b6)[_0x9de8('0x31')](function(_0x55a122){return _0x55a122;});}return null;};}function removeEntity(_0x1437a2,_0x13f5a8){return function(_0x36a3be){if(_0x36a3be){return _0x36a3be[_0x9de8('0x32')]()[_0x9de8('0x31')](function(){var _0x4a1b3c=_0x36a3be[_0x9de8('0x33')]({'plain':!![]});var _0x4e8b8f=_0x9de8('0x34');return db[_0x9de8('0x35')][_0x9de8('0x32')]({'where':{'type':_0x4e8b8f,'resourceId':_0x4a1b3c['id']}})[_0x9de8('0x31')](function(){return _0x36a3be;});})[_0x9de8('0x31')](function(){_0x1437a2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2978cd,_0x1c3b31){return function(_0x41eac7){if(!_0x41eac7){_0x2978cd[_0x9de8('0x36')](0x194);}return _0x41eac7;};}function handleError(_0x4d503c,_0x54eab2){_0x54eab2=_0x54eab2||0x1f4;return function(_0x81f38d){logger[_0x9de8('0x22')](_0x81f38d['stack']);if(_0x81f38d[_0x9de8('0x37')]){delete _0x81f38d[_0x9de8('0x37')];}_0x4d503c[_0x9de8('0x28')](_0x54eab2)[_0x9de8('0x38')](_0x81f38d);};}exports[_0x9de8('0x39')]=function(_0x125a23,_0x393647){var _0x576e70={},_0x20c45d={},_0x4b0a36={'count':0x0,'rows':[]};var _0x4752d7=_[_0x9de8('0x3a')](db[_0x9de8('0x3b')][_0x9de8('0x3c')],function(_0x550917){return{'name':_0x550917['fieldName'],'type':_0x550917[_0x9de8('0x3d')][_0x9de8('0x3e')]};});_0x20c45d[_0x9de8('0x3f')]=_['map'](_0x4752d7,'name');_0x20c45d[_0x9de8('0x40')]=_[_0x9de8('0x41')](_0x125a23[_0x9de8('0x40')]);_0x20c45d[_0x9de8('0x42')]=_['intersection'](_0x20c45d[_0x9de8('0x3f')],_0x20c45d[_0x9de8('0x40')]);_0x576e70[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x20c45d['model'],qs['fields'](_0x125a23['query'][_0x9de8('0x45')]));_0x576e70[_0x9de8('0x43')]=_0x576e70['attributes']['length']?_0x576e70[_0x9de8('0x43')]:_0x20c45d[_0x9de8('0x3f')];if(!_0x125a23[_0x9de8('0x40')][_0x9de8('0x46')]('nolimit')){_0x576e70[_0x9de8('0x2d')]=qs['limit'](_0x125a23['query'][_0x9de8('0x2d')]);_0x576e70['offset']=qs[_0x9de8('0x2b')](_0x125a23[_0x9de8('0x40')][_0x9de8('0x2b')]);}_0x576e70['order']=qs['sort'](_0x125a23[_0x9de8('0x40')][_0x9de8('0x47')]);_0x576e70[_0x9de8('0x48')]=qs['filters'](_[_0x9de8('0x49')](_0x125a23[_0x9de8('0x40')],_0x20c45d[_0x9de8('0x42')]),_0x4752d7);if(_0x125a23[_0x9de8('0x40')][_0x9de8('0x4a')]){_0x576e70['where']=_[_0x9de8('0x4b')](_0x576e70['where'],{'$or':_[_0x9de8('0x3a')](_0x4752d7,function(_0x9d22ee){if(_0x9d22ee['type']!=='VIRTUAL'){var _0x17bc39={};_0x17bc39[_0x9d22ee['name']]={'$like':'%'+_0x125a23[_0x9de8('0x40')][_0x9de8('0x4a')]+'%'};return _0x17bc39;}})});}_0x576e70=_['merge']({},_0x576e70,_0x125a23[_0x9de8('0x4c')]);var _0x4bacd1={'where':_0x576e70[_0x9de8('0x48')]};return db[_0x9de8('0x3b')]['count'](_0x4bacd1)[_0x9de8('0x31')](function(_0x578ad1){_0x4b0a36['count']=_0x578ad1;if(_0x125a23[_0x9de8('0x40')][_0x9de8('0x4d')]){_0x576e70['include']=[{'all':!![]}];}return db[_0x9de8('0x3b')][_0x9de8('0x4e')](_0x576e70);})[_0x9de8('0x31')](function(_0x2c3ae7){_0x4b0a36[_0x9de8('0x4f')]=_0x2c3ae7;return _0x4b0a36;})[_0x9de8('0x31')](respondWithFilteredResult(_0x393647,_0x576e70))[_0x9de8('0x27')](handleError(_0x393647,null));};exports[_0x9de8('0x50')]=function(_0x3818e6,_0x451beb){var _0xd15d19={'raw':!![],'where':{'id':_0x3818e6['params']['id']}},_0x1d3f2e={};_0x1d3f2e['model']=_[_0x9de8('0x41')](db[_0x9de8('0x3b')][_0x9de8('0x3c')]);_0x1d3f2e[_0x9de8('0x40')]=_['keys'](_0x3818e6[_0x9de8('0x40')]);_0x1d3f2e['filters']=_[_0x9de8('0x44')](_0x1d3f2e[_0x9de8('0x3f')],_0x1d3f2e['query']);_0xd15d19[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x1d3f2e[_0x9de8('0x3f')],qs[_0x9de8('0x45')](_0x3818e6[_0x9de8('0x40')]['fields']));_0xd15d19['attributes']=_0xd15d19[_0x9de8('0x43')][_0x9de8('0x51')]?_0xd15d19[_0x9de8('0x43')]:_0x1d3f2e[_0x9de8('0x3f')];if(_0x3818e6['query']['includeAll']){_0xd15d19[_0x9de8('0x52')]=[{'all':!![]}];}_0xd15d19=_['merge']({},_0xd15d19,_0x3818e6[_0x9de8('0x4c')]);return db[_0x9de8('0x3b')][_0x9de8('0x53')](_0xd15d19)[_0x9de8('0x31')](handleEntityNotFound(_0x451beb,null))[_0x9de8('0x31')](respondWithResult(_0x451beb,null))[_0x9de8('0x27')](handleError(_0x451beb,null));};exports[_0x9de8('0x54')]=function(_0x4d2277,_0x2ec732){return db[_0x9de8('0x3b')][_0x9de8('0x54')](_0x4d2277[_0x9de8('0x55')],{})[_0x9de8('0x31')](function(_0x2f8fd0){var _0x495585=_0x4d2277[_0x9de8('0x56')]['get']({'plain':!![]});if(!_0x495585)throw new Error(_0x9de8('0x57'));if(_0x495585[_0x9de8('0x58')]===_0x9de8('0x56')){var _0x3fd2c9=_0x2f8fd0[_0x9de8('0x33')]({'plain':!![]});var _0x1536f2=_0x9de8('0x34');return db[_0x9de8('0x59')][_0x9de8('0x53')]({'where':{'name':_0x1536f2,'userProfileId':_0x495585[_0x9de8('0x5a')]},'raw':!![]})[_0x9de8('0x31')](function(_0x116166){if(_0x116166&&_0x116166['autoAssociation']===0x0){return db[_0x9de8('0x35')]['create']({'name':_0x3fd2c9[_0x9de8('0x37')],'resourceId':_0x3fd2c9['id'],'type':_0x116166[_0x9de8('0x37')],'sectionId':_0x116166['id']},{})['then'](function(){return _0x2f8fd0;});}else{return _0x2f8fd0;}})[_0x9de8('0x27')](function(_0x5c6b48){logger[_0x9de8('0x22')](_0x9de8('0x5b'),_0x5c6b48);throw _0x5c6b48;});}return _0x2f8fd0;})['then'](respondWithResult(_0x2ec732,0xc9))['catch'](handleError(_0x2ec732,null));};exports[_0x9de8('0x5c')]=function(_0x217f50,_0x4f00a3){if(_0x217f50['body']['id']){delete _0x217f50[_0x9de8('0x55')]['id'];}return db['ChatQueue'][_0x9de8('0x53')]({'where':{'id':_0x217f50['params']['id']}})['then'](handleEntityNotFound(_0x4f00a3,null))[_0x9de8('0x31')](saveUpdates(_0x217f50[_0x9de8('0x55')],null))[_0x9de8('0x31')](respondWithResult(_0x4f00a3,null))[_0x9de8('0x27')](handleError(_0x4f00a3,null));};exports[_0x9de8('0x32')]=function(_0x51b233,_0x5d10c1){return db['ChatQueue'][_0x9de8('0x53')]({'where':{'id':_0x51b233['params']['id']}})['then'](handleEntityNotFound(_0x5d10c1,null))[_0x9de8('0x31')](removeEntity(_0x5d10c1,null))['catch'](handleError(_0x5d10c1,null));};exports['describe']=function(_0x5a1ea2,_0xe18ee2){return db[_0x9de8('0x3b')][_0x9de8('0x5d')]()[_0x9de8('0x31')](respondWithResult(_0xe18ee2,null))[_0x9de8('0x27')](handleError(_0xe18ee2,null));};exports[_0x9de8('0x5e')]=function(_0x3d383a,_0x30b7d8,_0x3bb569){var _0x529fcb={'raw':!![],'where':{}},_0x3f1c27={},_0x1b264a;return db[_0x9de8('0x3b')]['findOne']({'where':{'id':_0x3d383a[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x30b7d8,null))[_0x9de8('0x31')](function(_0x5c51ad){if(_0x5c51ad){_0x1b264a=_0x5c51ad[_0x9de8('0x33')]({'plain':!![]});_0x3f1c27['model']=_['keys'](db[_0x9de8('0x60')][_0x9de8('0x3c')]);_0x3f1c27[_0x9de8('0x40')]=_[_0x9de8('0x41')](_0x3d383a[_0x9de8('0x40')]);_0x3f1c27[_0x9de8('0x42')]=_['intersection'](_0x3f1c27[_0x9de8('0x3f')],_0x3f1c27[_0x9de8('0x40')]);_0x529fcb[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x3f1c27[_0x9de8('0x3f')],qs['fields'](_0x3d383a['query']['fields']));_0x529fcb[_0x9de8('0x43')]=_0x529fcb['attributes'][_0x9de8('0x51')]?_0x529fcb[_0x9de8('0x43')]:_0x3f1c27[_0x9de8('0x3f')];if(!_0x3d383a[_0x9de8('0x40')][_0x9de8('0x46')](_0x9de8('0x61'))){_0x529fcb[_0x9de8('0x2d')]=qs[_0x9de8('0x2d')](_0x3d383a['query'][_0x9de8('0x2d')]);_0x529fcb['offset']=qs[_0x9de8('0x2b')](_0x3d383a[_0x9de8('0x40')]['offset']);}_0x529fcb['order']=qs[_0x9de8('0x47')](_0x3d383a[_0x9de8('0x40')]['sort']);_0x529fcb[_0x9de8('0x48')]=qs['filters'](_[_0x9de8('0x49')](_0x3d383a['query'],_0x3f1c27[_0x9de8('0x42')]));_0x529fcb[_0x9de8('0x48')]['ChatQueueId']=_0x5c51ad['id'];if(_0x3d383a['query']['filter']){_0x529fcb[_0x9de8('0x48')]=_[_0x9de8('0x4b')](_0x529fcb[_0x9de8('0x48')],{'$or':_[_0x9de8('0x3a')](_0x529fcb[_0x9de8('0x43')],function(_0x2c5203){var _0x29a8c0={};_0x29a8c0[_0x2c5203]={'$like':'%'+_0x3d383a['query'][_0x9de8('0x4a')]+'%'};return _0x29a8c0;})});}_0x529fcb=_[_0x9de8('0x4b')]({},_0x529fcb,_0x3d383a['options']);return db[_0x9de8('0x60')]['findAll'](_0x529fcb);}})[_0x9de8('0x31')](function(_0x48eda3){if(_0x48eda3){return db[_0x9de8('0x62')][_0x9de8('0x63')]({'where':{'id':_['map'](_0x48eda3,'UserId'),'role':_0x9de8('0x64')},'attributes':['id',_0x9de8('0x37'),'chatPause',_0x9de8('0x65'),_0x9de8('0x66')]});}})[_0x9de8('0x31')](function(_0x2376d8){if(_0x2376d8){return{'count':_0x2376d8[_0x9de8('0x2e')],'rows':_[_0x9de8('0x3a')](_0x2376d8[_0x9de8('0x4f')],function(_0x4356b1){return{'membername':_0x4356b1['name'],'UserId':_0x4356b1['id'],'queue_name':_0x1b264a[_0x9de8('0x37')],'ChatQueueId':_0x1b264a['id'],'interface':util[_0x9de8('0x67')]('%s/%s',_0x9de8('0x68'),_0x4356b1[_0x9de8('0x37')]),'penalty':0x0,'paused':_0x4356b1[_0x9de8('0x69')],'createdAt':_0x4356b1['createdAt'],'updatedAt':_0x4356b1[_0x9de8('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x30b7d8,_0x529fcb))[_0x9de8('0x27')](handleError(_0x30b7d8,null));};exports['getTeams']=function(_0x184b5e,_0x58cf06,_0x4a694a){var _0x2e5a51={};var _0x1a763d={};var _0x639965;var _0x92d293;return db[_0x9de8('0x3b')][_0x9de8('0x6a')]({'where':{'id':_0x184b5e[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x58cf06,null))[_0x9de8('0x31')](function(_0x39507){if(_0x39507){_0x639965=_0x39507;_0x1a763d[_0x9de8('0x3f')]=_['keys'](db[_0x9de8('0x6b')][_0x9de8('0x3c')]);_0x1a763d[_0x9de8('0x40')]=_['keys'](_0x184b5e[_0x9de8('0x40')]);_0x1a763d[_0x9de8('0x42')]=_['intersection'](_0x1a763d['model'],_0x1a763d[_0x9de8('0x40')]);_0x2e5a51[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x1a763d['model'],qs[_0x9de8('0x45')](_0x184b5e[_0x9de8('0x40')]['fields']));_0x2e5a51['attributes']=_0x2e5a51[_0x9de8('0x43')][_0x9de8('0x51')]?_0x2e5a51['attributes']:_0x1a763d[_0x9de8('0x3f')];_0x2e5a51[_0x9de8('0x6c')]=qs[_0x9de8('0x47')](_0x184b5e[_0x9de8('0x40')][_0x9de8('0x47')]);_0x2e5a51['where']=qs['filters'](_[_0x9de8('0x49')](_0x184b5e[_0x9de8('0x40')],_0x1a763d[_0x9de8('0x42')]));if(_0x184b5e['query'][_0x9de8('0x4a')]){_0x2e5a51[_0x9de8('0x48')]=_['merge'](_0x2e5a51[_0x9de8('0x48')],{'$or':_['map'](_0x2e5a51['attributes'],function(_0x445d78){var _0x27f1b5={};_0x27f1b5[_0x445d78]={'$like':'%'+_0x184b5e['query'][_0x9de8('0x4a')]+'%'};return _0x27f1b5;})});}_0x2e5a51=_[_0x9de8('0x4b')]({},_0x2e5a51,_0x184b5e[_0x9de8('0x4c')]);return _0x639965[_0x9de8('0x6d')](_0x2e5a51);}})[_0x9de8('0x31')](function(_0xb124e8){if(_0xb124e8){_0x92d293=_0xb124e8['length'];if(!_0x184b5e['query'][_0x9de8('0x46')](_0x9de8('0x61'))){_0x2e5a51[_0x9de8('0x2d')]=qs[_0x9de8('0x2d')](_0x184b5e['query'][_0x9de8('0x2d')]);_0x2e5a51[_0x9de8('0x2b')]=qs[_0x9de8('0x2b')](_0x184b5e[_0x9de8('0x40')][_0x9de8('0x2b')]);}return _0x639965[_0x9de8('0x6d')](_0x2e5a51);}})[_0x9de8('0x31')](function(_0x13f928){if(_0x13f928){return _0x13f928?{'count':_0x92d293,'rows':_0x13f928}:null;}})[_0x9de8('0x31')](respondWithResult(_0x58cf06,null))[_0x9de8('0x27')](handleError(_0x58cf06,null));};exports[_0x9de8('0x6e')]=function(_0x51db3d,_0x886900,_0x5716c5){var _0x2b8789=_0x51db3d[_0x9de8('0x55')][_0x9de8('0x6f')];return db['Team'][_0x9de8('0x4e')]({'where':{'id':_0x2b8789},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9de8('0x70'),'attributes':['id',_0x9de8('0x37'),_0x9de8('0x71'),'voicePause',_0x9de8('0x72')],'raw':!![]}]})['then'](function(_0x142f11){if(_0x142f11){var _0x42d2cf=_[_0x9de8('0x73')](_0x142f11,function(_0x3e451d){var _0x2e00e6=_0x3e451d[_0x9de8('0x33')]({'plain':!![]});return _0x2e00e6[_0x9de8('0x70')];});return db['ChatQueue'][_0x9de8('0x53')]({'where':{'id':_0x51db3d[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](function(_0x20aee7){return db[_0x9de8('0x74')][_0x9de8('0x75')](function(_0x520a2f){return _0x20aee7['addTeams'](_0x2b8789,{'transaction':_0x520a2f})['then'](function(){return BPromise['each'](_0x42d2cf,function(_0x59bb77){return db[_0x9de8('0x60')][_0x9de8('0x76')]({'where':{'UserId':_0x59bb77['id'],'ChatQueueId':_0x51db3d[_0x9de8('0x5f')]['id']},'transaction':_0x520a2f});});})['then'](function(){_0x42d2cf[_0x9de8('0x77')](function(_0x41400f){socket[_0x9de8('0x78')](_0x9de8('0x79'),{'UserId':_0x41400f['id'],'ChatQueueId':_0x20aee7['id']});});});});});}})['then'](respondWithStatusCode(_0x886900,null))[_0x9de8('0x27')](handleError(_0x886900,null));};exports[_0x9de8('0x7a')]=function(_0x1896fc,_0x31708b,_0xde4478){return db[_0x9de8('0x6b')][_0x9de8('0x4e')]({'where':{'id':_0x1896fc['query'][_0x9de8('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x9de8('0x62')],'as':_0x9de8('0x70'),'attributes':['id'],'raw':!![]}]})[_0x9de8('0x31')](handleEntityNotFound(_0x31708b,null))[_0x9de8('0x31')](function(_0x4fdfdd){var _0x309b27=_['map'](_0x4fdfdd,'id');var _0x1ba31d=[];var _0x467cda=[];var _0x36c7e6=squel[_0x9de8('0x7b')]();_0x36c7e6[_0x9de8('0x7c')]('tq.TeamId')[_0x9de8('0x7d')](_0x9de8('0x7e'),'tq')[_0x9de8('0x7f')]('user_has_teams','ut',_0x9de8('0x80'))['where'](_0x9de8('0x81'),_0x1896fc[_0x9de8('0x5f')]['id']);for(var _0x4cb16f=0x0;_0x4cb16f<_0x4fdfdd[_0x9de8('0x51')];_0x4cb16f+=0x1){let _0x1825bf=_0x4fdfdd[_0x4cb16f];for(var _0x5a081b=0x0;_0x5a081b<_0x1825bf[_0x9de8('0x70')][_0x9de8('0x51')];_0x5a081b+=0x1){let _0x1c2ea0=_0x1825bf[_0x9de8('0x70')][_0x5a081b];var _0x310a60=_0x36c7e6['clone']();_0x310a60[_0x9de8('0x48')](_0x9de8('0x82'),_0x1c2ea0['id']);_0x467cda[_0x9de8('0x83')](db[_0x9de8('0x74')][_0x9de8('0x40')](_0x310a60[_0x9de8('0x84')](),{'type':db['sequelize'][_0x9de8('0x85')]['SELECT']})[_0x9de8('0x31')](function(_0x2f39a8){if(_0x2f39a8['length']===0x1){return _0x1c2ea0['id'];}else{var _0x41c177=_[_0x9de8('0x86')](_[_0x9de8('0x3a')](_0x2f39a8,_0x9de8('0x87')),function(_0x57eba1){return _['includes'](_0x309b27,_0x57eba1);});if(_0x41c177){return _0x1c2ea0['id'];}}}));}}return BPromise['all'](_0x467cda)['then'](function(_0x5515b3){_0x1ba31d=_(_0x1ba31d)[_0x9de8('0x88')](_0x5515b3)['compact']()[_0x9de8('0x89')]();return db[_0x9de8('0x3b')][_0x9de8('0x53')]({'where':{'id':_0x1896fc[_0x9de8('0x5f')]['id']}})['then'](function(_0x31c9a9){return db[_0x9de8('0x74')][_0x9de8('0x75')](function(_0x21c048){return _0x31c9a9[_0x9de8('0x7a')](_0x1896fc[_0x9de8('0x40')][_0x9de8('0x6f')],{'transaction':_0x21c048})[_0x9de8('0x31')](function(){if(!_['isEmpty'](_0x1ba31d)){return _0x31c9a9['removeAgents'](_0x1ba31d,{'transaction':_0x21c048});}})[_0x9de8('0x31')](function(){_0x1ba31d['forEach'](function(_0x8faaf5){socket[_0x9de8('0x78')](_0x9de8('0x8a'),{'UserId':_0x8faaf5,'ChatQueueId':_0x31c9a9['id']});});});});});});})[_0x9de8('0x31')](respondWithStatusCode(_0x31708b,null))[_0x9de8('0x27')](handleError(_0x31708b,null));};exports[_0x9de8('0x8b')]=function(_0x552fd3,_0x1ce651,_0x3af5c8){return db[_0x9de8('0x3b')][_0x9de8('0x53')]({'where':{'id':_0x552fd3['params']['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x1ce651,null))[_0x9de8('0x31')](function(_0x5ea688){if(_0x5ea688){return _0x5ea688['addAgents'](_0x552fd3[_0x9de8('0x55')]['ids'],_[_0x9de8('0x8c')](_0x552fd3['body'],[_0x9de8('0x6f'),'id'])||{})[_0x9de8('0x8d')](function(_0x23d657){for(var _0x2e3826=0x0;_0x2e3826<_0x552fd3[_0x9de8('0x55')][_0x9de8('0x6f')][_0x9de8('0x51')];_0x2e3826+=0x1){socket[_0x9de8('0x78')]('userChatQueue:save',{'UserId':Number(_0x552fd3[_0x9de8('0x55')]['ids'][_0x2e3826]),'ChatQueueId':Number(_0x552fd3[_0x9de8('0x5f')]['id'])});}return _0x23d657;});}})[_0x9de8('0x31')](respondWithResult(_0x1ce651,null))['catch'](handleError(_0x1ce651,null));};exports[_0x9de8('0x8e')]=function(_0x46dbec,_0x5d85e6,_0x594581){return db[_0x9de8('0x3b')][_0x9de8('0x53')]({'where':{'id':_0x46dbec[_0x9de8('0x5f')]['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x5d85e6,null))[_0x9de8('0x31')](function(_0x56b25d){if(_0x56b25d){return _0x56b25d[_0x9de8('0x8e')](_0x46dbec['query'][_0x9de8('0x6f')])[_0x9de8('0x31')](function(){if(_[_0x9de8('0x8f')](_0x46dbec['query'][_0x9de8('0x6f')])){for(var _0x1f5d69=0x0;_0x1f5d69<_0x46dbec[_0x9de8('0x40')]['ids'][_0x9de8('0x51')];_0x1f5d69+=0x1){socket[_0x9de8('0x78')](_0x9de8('0x8a'),{'UserId':Number(_0x46dbec[_0x9de8('0x40')][_0x9de8('0x6f')][_0x1f5d69]),'ChatQueueId':Number(_0x46dbec[_0x9de8('0x5f')]['id'])});}}else{socket[_0x9de8('0x78')](_0x9de8('0x8a'),{'UserId':Number(_0x46dbec[_0x9de8('0x40')][_0x9de8('0x6f')]),'ChatQueueId':Number(_0x46dbec[_0x9de8('0x5f')]['id'])});}});}})[_0x9de8('0x31')](respondWithStatusCode(_0x5d85e6,null))[_0x9de8('0x27')](handleError(_0x5d85e6,null));};exports[_0x9de8('0x90')]=function(_0x4011a7,_0x596296,_0x13ba96){var _0x47a592={};var _0x42b55b={};var _0x46bb59;var _0x5f4523;return db[_0x9de8('0x3b')]['findOne']({'where':{'id':_0x4011a7['params']['id']}})[_0x9de8('0x31')](handleEntityNotFound(_0x596296,null))[_0x9de8('0x31')](function(_0x17d5bc){if(_0x17d5bc){_0x46bb59=_0x17d5bc;_0x42b55b[_0x9de8('0x3f')]=_[_0x9de8('0x41')](db['User'][_0x9de8('0x3c')]);_0x42b55b[_0x9de8('0x40')]=_[_0x9de8('0x41')](_0x4011a7[_0x9de8('0x40')]);_0x42b55b[_0x9de8('0x42')]=_[_0x9de8('0x44')](_0x42b55b['model'],_0x42b55b[_0x9de8('0x40')]);_0x47a592[_0x9de8('0x43')]=_[_0x9de8('0x44')](_0x42b55b[_0x9de8('0x3f')],qs[_0x9de8('0x45')](_0x4011a7[_0x9de8('0x40')][_0x9de8('0x45')]));_0x47a592[_0x9de8('0x43')]=_0x47a592['attributes'][_0x9de8('0x51')]?_0x47a592['attributes']:_0x42b55b[_0x9de8('0x3f')];_0x47a592[_0x9de8('0x6c')]=qs['sort'](_0x4011a7['query']['sort']);_0x47a592[_0x9de8('0x48')]=qs[_0x9de8('0x42')](_[_0x9de8('0x49')](_0x4011a7['query'],_0x42b55b['filters']));if(_0x4011a7[_0x9de8('0x40')]['filter']){_0x47a592[_0x9de8('0x48')]=_[_0x9de8('0x4b')](_0x47a592[_0x9de8('0x48')],{'$or':_[_0x9de8('0x3a')](_0x47a592[_0x9de8('0x43')],function(_0x3f6709){var _0x313daf={};_0x313daf[_0x3f6709]={'$like':'%'+_0x4011a7[_0x9de8('0x40')][_0x9de8('0x4a')]+'%'};return _0x313daf;})});}_0x47a592=_[_0x9de8('0x4b')]({},_0x47a592,_0x4011a7[_0x9de8('0x4c')]);return _0x46bb59[_0x9de8('0x90')](_0x47a592);}})['then'](function(_0x5f14d4){if(_0x5f14d4){_0x5f4523=_0x5f14d4[_0x9de8('0x51')];if(!_0x4011a7[_0x9de8('0x40')][_0x9de8('0x46')](_0x9de8('0x61'))){_0x47a592[_0x9de8('0x2d')]=qs[_0x9de8('0x2d')](_0x4011a7['query'][_0x9de8('0x2d')]);_0x47a592['offset']=qs[_0x9de8('0x2b')](_0x4011a7[_0x9de8('0x40')][_0x9de8('0x2b')]);}return _0x46bb59[_0x9de8('0x90')](_0x47a592);}})[_0x9de8('0x31')](function(_0x500e4d){if(_0x500e4d){return _0x500e4d?{'count':_0x5f4523,'rows':_0x500e4d}:null;}})['then'](respondWithResult(_0x596296,null))['catch'](handleError(_0x596296,null));};
\ No newline at end of file
+var _0x2f87=['then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','UserProfileResource','destroy','end','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','ChatQueue','includeAll','include','params','keys','rawAttributes','find','create','body','get','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','nolimit','pick','ChatQueueId','User','findAndCountAll','UserId','updatedAt','rows','format','SIP','chatPause','createdAt','findOne','getTeams','addTeams','findAll','Agents','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','Team','ids','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','addAgents','omit','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','jayson/promise','client','http','request'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x2f87,0x10c));var _0x72f8=function(_0x49762c,_0x59b975){_0x49762c=_0x49762c-0x0;var _0x2462cb=_0x2f87[_0x49762c];return _0x2462cb;};'use strict';var emlformat=require(_0x72f8('0x0'));var rimraf=require(_0x72f8('0x1'));var zipdir=require(_0x72f8('0x2'));var jsonpatch=require(_0x72f8('0x3'));var rp=require('request-promise');var moment=require(_0x72f8('0x4'));var BPromise=require(_0x72f8('0x5'));var Mustache=require(_0x72f8('0x6'));var util=require(_0x72f8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x72f8('0x8'));var ejs=require(_0x72f8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72f8('0xa'));var squel=require(_0x72f8('0xb'));var crypto=require(_0x72f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x72f8('0xd'));var toCsv=require(_0x72f8('0x8'));var querystring=require(_0x72f8('0xe'));var Papa=require(_0x72f8('0xf'));var Redis=require(_0x72f8('0x10'));var authService=require(_0x72f8('0x11'));var qs=require(_0x72f8('0x12'));var as=require(_0x72f8('0x13'));var hardwareService=require(_0x72f8('0x14'));var logger=require(_0x72f8('0x15'))(_0x72f8('0x16'));var utils=require(_0x72f8('0x17'));var config=require(_0x72f8('0x18'));var licenseUtil=require(_0x72f8('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x72f8('0x1a')],{'host':_0x72f8('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72f8('0x1a')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x72f8('0x1c'));var client=jayson[_0x72f8('0x1d')][_0x72f8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3bdd56,_0xf507e1,_0x409c94,_0x23400f){return new BPromise(function(_0x51d61e,_0x2e5a20){var _0x36ffbd=_0x23400f||client;return _0x36ffbd[_0x72f8('0x1f')](_0x3bdd56,_0x409c94)[_0x72f8('0x20')](function(_0x57a777){logger[_0x72f8('0x21')]('ChatQueue,\x20%s,\x20%s',_0xf507e1,_0x72f8('0x22'));logger['debug'](_0x72f8('0x23'),_0xf507e1,'request\x20sent',JSON[_0x72f8('0x24')](_0x57a777));if(_0x57a777[_0x72f8('0x25')]){if(_0x57a777[_0x72f8('0x25')][_0x72f8('0x26')]===0x1f4){logger[_0x72f8('0x25')]('ChatQueue,\x20%s,\x20%s',_0xf507e1,_0x57a777['error'][_0x72f8('0x27')]);return _0x2e5a20(_0x57a777[_0x72f8('0x25')][_0x72f8('0x27')]);}logger[_0x72f8('0x25')](_0x72f8('0x28'),_0xf507e1,_0x57a777[_0x72f8('0x25')][_0x72f8('0x27')]);return _0x51d61e(_0x57a777[_0x72f8('0x25')]['message']);}else{logger[_0x72f8('0x21')](_0x72f8('0x28'),_0xf507e1,'request\x20sent');_0x51d61e(_0x57a777[_0x72f8('0x29')][_0x72f8('0x27')]);}})[_0x72f8('0x2a')](function(_0x473253){logger[_0x72f8('0x25')]('ChatQueue,\x20%s,\x20%s',_0xf507e1,_0x473253);_0x2e5a20(_0x473253);});});}function respondWithStatusCode(_0x2c7509,_0x5712a3){_0x5712a3=_0x5712a3||0xcc;return function(_0x530a08){if(_0x530a08){return _0x2c7509[_0x72f8('0x2b')](_0x5712a3);}return _0x2c7509[_0x72f8('0x2c')](_0x5712a3)['end']();};}function respondWithResult(_0x185847,_0x303662){_0x303662=_0x303662||0xc8;return function(_0x2b12f2){if(_0x2b12f2){return _0x185847[_0x72f8('0x2c')](_0x303662)['json'](_0x2b12f2);}};}function respondWithFilteredResult(_0x2633e6,_0x323795){return function(_0x210628){if(_0x210628){var _0x384b0a=typeof _0x323795[_0x72f8('0x2d')]===_0x72f8('0x2e')&&typeof _0x323795[_0x72f8('0x2f')]==='undefined';var _0x419be6=_0x210628['count'];var _0x33f3b8=_0x384b0a?0x0:_0x323795[_0x72f8('0x2d')];var _0xf06103=_0x384b0a?_0x210628[_0x72f8('0x30')]:_0x323795[_0x72f8('0x2d')]+_0x323795[_0x72f8('0x2f')];var _0x1ab95e;if(_0xf06103>=_0x419be6){_0xf06103=_0x419be6;_0x1ab95e=0xc8;}else{_0x1ab95e=0xce;}_0x2633e6[_0x72f8('0x2c')](_0x1ab95e);return _0x2633e6[_0x72f8('0x31')]('Content-Range',_0x33f3b8+'-'+_0xf06103+'/'+_0x419be6)[_0x72f8('0x32')](_0x210628);}return null;};}function patchUpdates(_0x25720f){return function(_0x14798a){try{jsonpatch[_0x72f8('0x33')](_0x14798a,_0x25720f,!![]);}catch(_0xa02fce){return BPromise[_0x72f8('0x34')](_0xa02fce);}return _0x14798a['save']();};}function saveUpdates(_0x2f29fe,_0x29082b){return function(_0x22e3d2){if(_0x22e3d2){return _0x22e3d2[_0x72f8('0x35')](_0x2f29fe)[_0x72f8('0x20')](function(_0x4e6a52){return _0x4e6a52;});}return null;};}function removeEntity(_0x1b41e7,_0x122017){return function(_0x2f9cc2){if(_0x2f9cc2){return _0x2f9cc2['destroy']()[_0x72f8('0x20')](function(){var _0x59e5ee=_0x2f9cc2['get']({'plain':!![]});var _0x1b7653='ChatQueues';return db[_0x72f8('0x36')][_0x72f8('0x37')]({'where':{'type':_0x1b7653,'resourceId':_0x59e5ee['id']}})[_0x72f8('0x20')](function(){return _0x2f9cc2;});})[_0x72f8('0x20')](function(){_0x1b41e7[_0x72f8('0x2c')](0xcc)[_0x72f8('0x38')]();});}};}function handleEntityNotFound(_0x527af4,_0x5ca29a){return function(_0x183ac4){if(!_0x183ac4){_0x527af4[_0x72f8('0x2b')](0x194);}return _0x183ac4;};}function handleError(_0x2a37a9,_0x2d606b){_0x2d606b=_0x2d606b||0x1f4;return function(_0x680cc5){logger[_0x72f8('0x25')](_0x680cc5[_0x72f8('0x39')]);if(_0x680cc5[_0x72f8('0x3a')]){delete _0x680cc5[_0x72f8('0x3a')];}_0x2a37a9[_0x72f8('0x2c')](_0x2d606b)[_0x72f8('0x3b')](_0x680cc5);};}exports['index']=function(_0x7a1dc8,_0x22aa94){var _0x70efc7={},_0x4d5a69={},_0x3a2c8b={'count':0x0,'rows':[]};var _0x144c1f=_['map'](db['ChatQueue']['rawAttributes'],function(_0x39550f){return{'name':_0x39550f[_0x72f8('0x3c')],'type':_0x39550f[_0x72f8('0x3d')][_0x72f8('0x3e')]};});_0x4d5a69[_0x72f8('0x3f')]=_[_0x72f8('0x40')](_0x144c1f,_0x72f8('0x3a'));_0x4d5a69[_0x72f8('0x41')]=_['keys'](_0x7a1dc8[_0x72f8('0x41')]);_0x4d5a69[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x4d5a69['model'],_0x4d5a69[_0x72f8('0x41')]);_0x70efc7['attributes']=_[_0x72f8('0x43')](_0x4d5a69[_0x72f8('0x3f')],qs[_0x72f8('0x44')](_0x7a1dc8['query'][_0x72f8('0x44')]));_0x70efc7['attributes']=_0x70efc7[_0x72f8('0x45')][_0x72f8('0x46')]?_0x70efc7[_0x72f8('0x45')]:_0x4d5a69[_0x72f8('0x3f')];if(!_0x7a1dc8['query'][_0x72f8('0x47')]('nolimit')){_0x70efc7[_0x72f8('0x2f')]=qs[_0x72f8('0x2f')](_0x7a1dc8[_0x72f8('0x41')]['limit']);_0x70efc7['offset']=qs[_0x72f8('0x2d')](_0x7a1dc8['query'][_0x72f8('0x2d')]);}_0x70efc7[_0x72f8('0x48')]=qs[_0x72f8('0x49')](_0x7a1dc8['query']['sort']);_0x70efc7['where']=qs['filters'](_['pick'](_0x7a1dc8[_0x72f8('0x41')],_0x4d5a69[_0x72f8('0x42')]),_0x144c1f);if(_0x7a1dc8['query'][_0x72f8('0x4a')]){_0x70efc7['where']=_[_0x72f8('0x4b')](_0x70efc7[_0x72f8('0x4c')],{'$or':_[_0x72f8('0x40')](_0x144c1f,function(_0x407aa7){if(_0x407aa7[_0x72f8('0x3d')]!==_0x72f8('0x4d')){var _0x122a95={};_0x122a95[_0x407aa7[_0x72f8('0x3a')]]={'$like':'%'+_0x7a1dc8['query'][_0x72f8('0x4a')]+'%'};return _0x122a95;}})});}_0x70efc7=_[_0x72f8('0x4b')]({},_0x70efc7,_0x7a1dc8[_0x72f8('0x4e')]);var _0x39a85f={'where':_0x70efc7[_0x72f8('0x4c')]};return db[_0x72f8('0x4f')][_0x72f8('0x30')](_0x39a85f)[_0x72f8('0x20')](function(_0x5c2539){_0x3a2c8b['count']=_0x5c2539;if(_0x7a1dc8['query'][_0x72f8('0x50')]){_0x70efc7[_0x72f8('0x51')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x70efc7);})[_0x72f8('0x20')](function(_0x2a98df){_0x3a2c8b['rows']=_0x2a98df;return _0x3a2c8b;})[_0x72f8('0x20')](respondWithFilteredResult(_0x22aa94,_0x70efc7))['catch'](handleError(_0x22aa94,null));};exports['show']=function(_0x434e33,_0xa2f10){var _0x1ab20b={'raw':!![],'where':{'id':_0x434e33[_0x72f8('0x52')]['id']}},_0x1e1d7d={};_0x1e1d7d[_0x72f8('0x3f')]=_[_0x72f8('0x53')](db[_0x72f8('0x4f')][_0x72f8('0x54')]);_0x1e1d7d[_0x72f8('0x41')]=_[_0x72f8('0x53')](_0x434e33[_0x72f8('0x41')]);_0x1e1d7d[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x1e1d7d[_0x72f8('0x3f')],_0x1e1d7d[_0x72f8('0x41')]);_0x1ab20b[_0x72f8('0x45')]=_[_0x72f8('0x43')](_0x1e1d7d[_0x72f8('0x3f')],qs[_0x72f8('0x44')](_0x434e33[_0x72f8('0x41')]['fields']));_0x1ab20b[_0x72f8('0x45')]=_0x1ab20b[_0x72f8('0x45')][_0x72f8('0x46')]?_0x1ab20b['attributes']:_0x1e1d7d['model'];if(_0x434e33[_0x72f8('0x41')]['includeAll']){_0x1ab20b[_0x72f8('0x51')]=[{'all':!![]}];}_0x1ab20b=_[_0x72f8('0x4b')]({},_0x1ab20b,_0x434e33['options']);return db[_0x72f8('0x4f')][_0x72f8('0x55')](_0x1ab20b)[_0x72f8('0x20')](handleEntityNotFound(_0xa2f10,null))[_0x72f8('0x20')](respondWithResult(_0xa2f10,null))['catch'](handleError(_0xa2f10,null));};exports[_0x72f8('0x56')]=function(_0x15a80a,_0x3b0859){return db['ChatQueue']['create'](_0x15a80a[_0x72f8('0x57')],{})[_0x72f8('0x20')](function(_0x19de47){var _0x262760=_0x15a80a['user'][_0x72f8('0x58')]({'plain':!![]});if(!_0x262760)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x262760[_0x72f8('0x59')]==='user'){var _0x4761c1=_0x19de47['get']({'plain':!![]});var _0x3fd6ee=_0x72f8('0x5a');return db['UserProfileSection'][_0x72f8('0x55')]({'where':{'name':_0x3fd6ee,'userProfileId':_0x262760[_0x72f8('0x5b')]},'raw':!![]})[_0x72f8('0x20')](function(_0x20836e){if(_0x20836e&&_0x20836e[_0x72f8('0x5c')]===0x0){return db[_0x72f8('0x36')][_0x72f8('0x56')]({'name':_0x4761c1[_0x72f8('0x3a')],'resourceId':_0x4761c1['id'],'type':_0x20836e[_0x72f8('0x3a')],'sectionId':_0x20836e['id']},{})[_0x72f8('0x20')](function(){return _0x19de47;});}else{return _0x19de47;}})[_0x72f8('0x2a')](function(_0x21590b){logger[_0x72f8('0x25')](_0x72f8('0x5d'),_0x21590b);throw _0x21590b;});}return _0x19de47;})['then'](respondWithResult(_0x3b0859,0xc9))[_0x72f8('0x2a')](handleError(_0x3b0859,null));};exports[_0x72f8('0x35')]=function(_0x10f26f,_0x1df9a8){if(_0x10f26f[_0x72f8('0x57')]['id']){delete _0x10f26f[_0x72f8('0x57')]['id'];}return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x10f26f[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x1df9a8,null))['then'](saveUpdates(_0x10f26f[_0x72f8('0x57')],null))[_0x72f8('0x20')](respondWithResult(_0x1df9a8,null))[_0x72f8('0x2a')](handleError(_0x1df9a8,null));};exports['destroy']=function(_0x3ba9b0,_0x3f1f53){return db['ChatQueue'][_0x72f8('0x55')]({'where':{'id':_0x3ba9b0[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x3f1f53,null))[_0x72f8('0x20')](removeEntity(_0x3f1f53,null))['catch'](handleError(_0x3f1f53,null));};exports[_0x72f8('0x5e')]=function(_0x469a5d,_0x2bcae4){return db[_0x72f8('0x4f')][_0x72f8('0x5e')]()['then'](respondWithResult(_0x2bcae4,null))[_0x72f8('0x2a')](handleError(_0x2bcae4,null));};exports[_0x72f8('0x5f')]=function(_0x585adc,_0x38f5a7,_0xb8a604){var _0x15abff={'raw':!![],'where':{}},_0x1c2464={},_0x9be2fa;return db[_0x72f8('0x4f')]['findOne']({'where':{'id':_0x585adc[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x38f5a7,null))[_0x72f8('0x20')](function(_0x1267ea){if(_0x1267ea){_0x9be2fa=_0x1267ea['get']({'plain':!![]});_0x1c2464[_0x72f8('0x3f')]=_['keys'](db[_0x72f8('0x60')][_0x72f8('0x54')]);_0x1c2464[_0x72f8('0x41')]=_[_0x72f8('0x53')](_0x585adc[_0x72f8('0x41')]);_0x1c2464[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x1c2464['model'],_0x1c2464[_0x72f8('0x41')]);_0x15abff['attributes']=_[_0x72f8('0x43')](_0x1c2464[_0x72f8('0x3f')],qs['fields'](_0x585adc[_0x72f8('0x41')][_0x72f8('0x44')]));_0x15abff[_0x72f8('0x45')]=_0x15abff[_0x72f8('0x45')][_0x72f8('0x46')]?_0x15abff[_0x72f8('0x45')]:_0x1c2464[_0x72f8('0x3f')];if(!_0x585adc['query'][_0x72f8('0x47')](_0x72f8('0x61'))){_0x15abff[_0x72f8('0x2f')]=qs['limit'](_0x585adc[_0x72f8('0x41')]['limit']);_0x15abff[_0x72f8('0x2d')]=qs[_0x72f8('0x2d')](_0x585adc[_0x72f8('0x41')][_0x72f8('0x2d')]);}_0x15abff[_0x72f8('0x48')]=qs['sort'](_0x585adc[_0x72f8('0x41')][_0x72f8('0x49')]);_0x15abff[_0x72f8('0x4c')]=qs['filters'](_[_0x72f8('0x62')](_0x585adc[_0x72f8('0x41')],_0x1c2464[_0x72f8('0x42')]));_0x15abff['where'][_0x72f8('0x63')]=_0x1267ea['id'];if(_0x585adc[_0x72f8('0x41')]['filter']){_0x15abff['where']=_[_0x72f8('0x4b')](_0x15abff[_0x72f8('0x4c')],{'$or':_['map'](_0x15abff[_0x72f8('0x45')],function(_0x4c4bd1){var _0x5e2c06={};_0x5e2c06[_0x4c4bd1]={'$like':'%'+_0x585adc[_0x72f8('0x41')][_0x72f8('0x4a')]+'%'};return _0x5e2c06;})});}_0x15abff=_[_0x72f8('0x4b')]({},_0x15abff,_0x585adc[_0x72f8('0x4e')]);return db['UserChatQueue']['findAll'](_0x15abff);}})[_0x72f8('0x20')](function(_0x397f59){if(_0x397f59){return db[_0x72f8('0x64')][_0x72f8('0x65')]({'where':{'id':_[_0x72f8('0x40')](_0x397f59,_0x72f8('0x66')),'role':'agent'},'attributes':['id','name','chatPause',_0x72f8('0x67'),'createdAt']});}})['then'](function(_0x2ea4b0){if(_0x2ea4b0){return{'count':_0x2ea4b0[_0x72f8('0x30')],'rows':_['map'](_0x2ea4b0[_0x72f8('0x68')],function(_0x3a2436){return{'membername':_0x3a2436[_0x72f8('0x3a')],'UserId':_0x3a2436['id'],'queue_name':_0x9be2fa['name'],'ChatQueueId':_0x9be2fa['id'],'interface':util[_0x72f8('0x69')]('%s/%s',_0x72f8('0x6a'),_0x3a2436[_0x72f8('0x3a')]),'penalty':0x0,'paused':_0x3a2436[_0x72f8('0x6b')],'createdAt':_0x3a2436[_0x72f8('0x6c')],'updatedAt':_0x3a2436[_0x72f8('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x72f8('0x20')](respondWithFilteredResult(_0x38f5a7,_0x15abff))[_0x72f8('0x2a')](handleError(_0x38f5a7,null));};exports['getTeams']=function(_0x64c593,_0x221660,_0x3afb2c){var _0xb6812e={};var _0x12faef={};var _0x52993f;var _0x4f9d15;return db[_0x72f8('0x4f')][_0x72f8('0x6d')]({'where':{'id':_0x64c593[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x221660,null))[_0x72f8('0x20')](function(_0x378e5b){if(_0x378e5b){_0x52993f=_0x378e5b;_0x12faef['model']=_[_0x72f8('0x53')](db['Team'][_0x72f8('0x54')]);_0x12faef[_0x72f8('0x41')]=_[_0x72f8('0x53')](_0x64c593[_0x72f8('0x41')]);_0x12faef[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x12faef[_0x72f8('0x3f')],_0x12faef[_0x72f8('0x41')]);_0xb6812e[_0x72f8('0x45')]=_[_0x72f8('0x43')](_0x12faef['model'],qs[_0x72f8('0x44')](_0x64c593[_0x72f8('0x41')][_0x72f8('0x44')]));_0xb6812e['attributes']=_0xb6812e['attributes'][_0x72f8('0x46')]?_0xb6812e[_0x72f8('0x45')]:_0x12faef[_0x72f8('0x3f')];_0xb6812e[_0x72f8('0x48')]=qs['sort'](_0x64c593[_0x72f8('0x41')]['sort']);_0xb6812e[_0x72f8('0x4c')]=qs[_0x72f8('0x42')](_[_0x72f8('0x62')](_0x64c593[_0x72f8('0x41')],_0x12faef[_0x72f8('0x42')]));if(_0x64c593['query'][_0x72f8('0x4a')]){_0xb6812e[_0x72f8('0x4c')]=_[_0x72f8('0x4b')](_0xb6812e[_0x72f8('0x4c')],{'$or':_['map'](_0xb6812e[_0x72f8('0x45')],function(_0x7862f9){var _0x1b6cd6={};_0x1b6cd6[_0x7862f9]={'$like':'%'+_0x64c593[_0x72f8('0x41')]['filter']+'%'};return _0x1b6cd6;})});}_0xb6812e=_[_0x72f8('0x4b')]({},_0xb6812e,_0x64c593[_0x72f8('0x4e')]);return _0x52993f[_0x72f8('0x6e')](_0xb6812e);}})['then'](function(_0x565c57){if(_0x565c57){_0x4f9d15=_0x565c57[_0x72f8('0x46')];if(!_0x64c593[_0x72f8('0x41')]['hasOwnProperty'](_0x72f8('0x61'))){_0xb6812e['limit']=qs[_0x72f8('0x2f')](_0x64c593[_0x72f8('0x41')][_0x72f8('0x2f')]);_0xb6812e['offset']=qs[_0x72f8('0x2d')](_0x64c593[_0x72f8('0x41')][_0x72f8('0x2d')]);}return _0x52993f[_0x72f8('0x6e')](_0xb6812e);}})[_0x72f8('0x20')](function(_0x3198b1){if(_0x3198b1){return _0x3198b1?{'count':_0x4f9d15,'rows':_0x3198b1}:null;}})['then'](respondWithResult(_0x221660,null))[_0x72f8('0x2a')](handleError(_0x221660,null));};exports[_0x72f8('0x6f')]=function(_0x2d6129,_0x3b601c,_0x225d24){var _0x266f18=_0x2d6129['body']['ids'];return db['Team'][_0x72f8('0x70')]({'where':{'id':_0x266f18},'attributes':['id'],'include':[{'model':db[_0x72f8('0x64')],'as':_0x72f8('0x71'),'attributes':['id','name','online',_0x72f8('0x72'),_0x72f8('0x73')],'raw':!![]}]})['then'](function(_0x357de4){if(_0x357de4){var _0x38c107=_['flatMap'](_0x357de4,function(_0xddfe40){var _0x4f1717=_0xddfe40[_0x72f8('0x58')]({'plain':!![]});return _0x4f1717[_0x72f8('0x71')];});return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x2d6129[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](function(_0x44bc17){return db['sequelize'][_0x72f8('0x74')](function(_0x4c384a){return _0x44bc17[_0x72f8('0x6f')](_0x266f18,{'transaction':_0x4c384a})[_0x72f8('0x20')](function(){return BPromise[_0x72f8('0x75')](_0x38c107,function(_0x13e161){return db['UserChatQueue'][_0x72f8('0x76')]({'where':{'UserId':_0x13e161['id'],'ChatQueueId':_0x2d6129[_0x72f8('0x52')]['id']},'transaction':_0x4c384a});});})[_0x72f8('0x20')](function(){_0x38c107[_0x72f8('0x77')](function(_0x3ed5ce){socket[_0x72f8('0x78')](_0x72f8('0x79'),{'UserId':_0x3ed5ce['id'],'ChatQueueId':_0x44bc17['id']});});});});});}})[_0x72f8('0x20')](respondWithStatusCode(_0x3b601c,null))['catch'](handleError(_0x3b601c,null));};exports['removeTeams']=function(_0x47da86,_0x32ceb5,_0x34e9a5){return db[_0x72f8('0x7a')][_0x72f8('0x70')]({'where':{'id':_0x47da86[_0x72f8('0x41')][_0x72f8('0x7b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x32ceb5,null))[_0x72f8('0x20')](function(_0x3c07ba){var _0x442a82=_['map'](_0x3c07ba,'id');var _0x1ce612=[];var _0x1ee3c2=[];var _0x146180=squel[_0x72f8('0x7c')]();_0x146180['field'](_0x72f8('0x7d'))[_0x72f8('0x7e')](_0x72f8('0x7f'),'tq')[_0x72f8('0x80')](_0x72f8('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x72f8('0x82'),_0x47da86[_0x72f8('0x52')]['id']);for(var _0x4a302b=0x0;_0x4a302b<_0x3c07ba[_0x72f8('0x46')];_0x4a302b+=0x1){let _0x4896eb=_0x3c07ba[_0x4a302b];for(var _0x47aedb=0x0;_0x47aedb<_0x4896eb[_0x72f8('0x71')]['length'];_0x47aedb+=0x1){let _0x14a0c3=_0x4896eb[_0x72f8('0x71')][_0x47aedb];var _0x25bbc8=_0x146180[_0x72f8('0x83')]();_0x25bbc8[_0x72f8('0x4c')](_0x72f8('0x84'),_0x14a0c3['id']);_0x1ee3c2[_0x72f8('0x85')](db[_0x72f8('0x86')][_0x72f8('0x41')](_0x25bbc8[_0x72f8('0x87')](),{'type':db[_0x72f8('0x86')][_0x72f8('0x88')][_0x72f8('0x89')]})[_0x72f8('0x20')](function(_0x1f80ff){if(_0x1f80ff[_0x72f8('0x46')]===0x1){return _0x14a0c3['id'];}else{var _0x2ba3fd=_['every'](_[_0x72f8('0x40')](_0x1f80ff,_0x72f8('0x8a')),function(_0x290388){return _[_0x72f8('0x8b')](_0x442a82,_0x290388);});if(_0x2ba3fd){return _0x14a0c3['id'];}}}));}}return BPromise[_0x72f8('0x8c')](_0x1ee3c2)['then'](function(_0x48a9c5){_0x1ce612=_(_0x1ce612)[_0x72f8('0x8d')](_0x48a9c5)['compact']()[_0x72f8('0x8e')]();return db[_0x72f8('0x4f')][_0x72f8('0x55')]({'where':{'id':_0x47da86['params']['id']}})[_0x72f8('0x20')](function(_0x2c7107){return db['sequelize'][_0x72f8('0x74')](function(_0x1274d8){return _0x2c7107[_0x72f8('0x8f')](_0x47da86['query']['ids'],{'transaction':_0x1274d8})['then'](function(){if(!_[_0x72f8('0x90')](_0x1ce612)){return _0x2c7107[_0x72f8('0x91')](_0x1ce612,{'transaction':_0x1274d8});}})['then'](function(){_0x1ce612[_0x72f8('0x77')](function(_0x575d05){socket[_0x72f8('0x78')]('userChatQueue:remove',{'UserId':_0x575d05,'ChatQueueId':_0x2c7107['id']});});});});});});})[_0x72f8('0x20')](respondWithStatusCode(_0x32ceb5,null))[_0x72f8('0x2a')](handleError(_0x32ceb5,null));};exports[_0x72f8('0x92')]=function(_0x3b0abb,_0x59dc87,_0x271472){return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x3b0abb['params']['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x59dc87,null))[_0x72f8('0x20')](function(_0x1e5707){if(_0x1e5707){return _0x1e5707[_0x72f8('0x92')](_0x3b0abb['body'][_0x72f8('0x7b')],_[_0x72f8('0x93')](_0x3b0abb['body'],[_0x72f8('0x7b'),'id'])||{})['spread'](function(_0x4f2746){for(var _0x236464=0x0;_0x236464<_0x3b0abb['body'][_0x72f8('0x7b')][_0x72f8('0x46')];_0x236464+=0x1){socket[_0x72f8('0x78')]('userChatQueue:save',{'UserId':Number(_0x3b0abb['body']['ids'][_0x236464]),'ChatQueueId':Number(_0x3b0abb[_0x72f8('0x52')]['id'])});}return _0x4f2746;});}})[_0x72f8('0x20')](respondWithResult(_0x59dc87,null))['catch'](handleError(_0x59dc87,null));};exports[_0x72f8('0x91')]=function(_0x21366a,_0x403fd9,_0x1ef836){return db[_0x72f8('0x4f')]['find']({'where':{'id':_0x21366a[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0x403fd9,null))[_0x72f8('0x20')](function(_0x24eb2d){if(_0x24eb2d){return _0x24eb2d['removeAgents'](_0x21366a[_0x72f8('0x41')][_0x72f8('0x7b')])['then'](function(){if(_['isArray'](_0x21366a['query'][_0x72f8('0x7b')])){for(var _0x31ea8e=0x0;_0x31ea8e<_0x21366a[_0x72f8('0x41')][_0x72f8('0x7b')][_0x72f8('0x46')];_0x31ea8e+=0x1){socket['emit'](_0x72f8('0x94'),{'UserId':Number(_0x21366a[_0x72f8('0x41')]['ids'][_0x31ea8e]),'ChatQueueId':Number(_0x21366a[_0x72f8('0x52')]['id'])});}}else{socket['emit'](_0x72f8('0x94'),{'UserId':Number(_0x21366a['query'][_0x72f8('0x7b')]),'ChatQueueId':Number(_0x21366a['params']['id'])});}});}})[_0x72f8('0x20')](respondWithStatusCode(_0x403fd9,null))[_0x72f8('0x2a')](handleError(_0x403fd9,null));};exports['getAgents']=function(_0x2ceb9b,_0xdca97b,_0x5ca41c){var _0x4b8c05={};var _0x2109dd={};var _0x239eba;var _0x3e84c6;return db[_0x72f8('0x4f')][_0x72f8('0x6d')]({'where':{'id':_0x2ceb9b[_0x72f8('0x52')]['id']}})[_0x72f8('0x20')](handleEntityNotFound(_0xdca97b,null))[_0x72f8('0x20')](function(_0x4fc861){if(_0x4fc861){_0x239eba=_0x4fc861;_0x2109dd['model']=_[_0x72f8('0x53')](db[_0x72f8('0x64')][_0x72f8('0x54')]);_0x2109dd['query']=_[_0x72f8('0x53')](_0x2ceb9b[_0x72f8('0x41')]);_0x2109dd[_0x72f8('0x42')]=_[_0x72f8('0x43')](_0x2109dd[_0x72f8('0x3f')],_0x2109dd[_0x72f8('0x41')]);_0x4b8c05['attributes']=_[_0x72f8('0x43')](_0x2109dd[_0x72f8('0x3f')],qs[_0x72f8('0x44')](_0x2ceb9b['query'][_0x72f8('0x44')]));_0x4b8c05[_0x72f8('0x45')]=_0x4b8c05['attributes']['length']?_0x4b8c05[_0x72f8('0x45')]:_0x2109dd[_0x72f8('0x3f')];_0x4b8c05[_0x72f8('0x48')]=qs['sort'](_0x2ceb9b['query'][_0x72f8('0x49')]);_0x4b8c05[_0x72f8('0x4c')]=qs[_0x72f8('0x42')](_[_0x72f8('0x62')](_0x2ceb9b['query'],_0x2109dd[_0x72f8('0x42')]));if(_0x2ceb9b[_0x72f8('0x41')][_0x72f8('0x4a')]){_0x4b8c05[_0x72f8('0x4c')]=_['merge'](_0x4b8c05[_0x72f8('0x4c')],{'$or':_[_0x72f8('0x40')](_0x4b8c05[_0x72f8('0x45')],function(_0xed0ccc){var _0x2e8921={};_0x2e8921[_0xed0ccc]={'$like':'%'+_0x2ceb9b['query'][_0x72f8('0x4a')]+'%'};return _0x2e8921;})});}_0x4b8c05=_[_0x72f8('0x4b')]({},_0x4b8c05,_0x2ceb9b['options']);return _0x239eba[_0x72f8('0x95')](_0x4b8c05);}})[_0x72f8('0x20')](function(_0x287781){if(_0x287781){_0x3e84c6=_0x287781[_0x72f8('0x46')];if(!_0x2ceb9b['query'][_0x72f8('0x47')]('nolimit')){_0x4b8c05['limit']=qs[_0x72f8('0x2f')](_0x2ceb9b[_0x72f8('0x41')]['limit']);_0x4b8c05[_0x72f8('0x2d')]=qs['offset'](_0x2ceb9b[_0x72f8('0x41')]['offset']);}return _0x239eba[_0x72f8('0x95')](_0x4b8c05);}})['then'](function(_0x38b831){if(_0x38b831){return _0x38b831?{'count':_0x3e84c6,'rows':_0x38b831}:null;}})[_0x72f8('0x20')](respondWithResult(_0xdca97b,null))[_0x72f8('0x2a')](handleError(_0xdca97b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 818a096..79a7644 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 _0xf5b7=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x43cd76,_0x595855){var _0x1b3f7b=function(_0xa65115){while(--_0xa65115){_0x43cd76['push'](_0x43cd76['shift']());}};_0x1b3f7b(++_0x595855);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x3ba095,_0x29b419){_0x3ba095=_0x3ba095-0x0;var _0x38b10f=_0xf5b7[_0x3ba095];return _0x38b10f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x7f5b('0x0'))['db'][_0x7f5b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7f5b('0x2')](0x0);var events={'afterCreate':_0x7f5b('0x3'),'afterUpdate':_0x7f5b('0x4'),'afterDestroy':_0x7f5b('0x5')};function emitEvent(_0x4adde7){return function(_0x30569b,_0x566b54,_0xb1bfd3){ChatQueueEvents[_0x7f5b('0x6')](_0x4adde7+':'+_0x30569b['id'],_0x30569b);ChatQueueEvents['emit'](_0x4adde7,_0x30569b);_0xb1bfd3(null);};}for(var e in events){if(events[_0x7f5b('0x7')](e)){var event=events[e];ChatQueue[_0x7f5b('0x8')](e,emitEvent(event));}}module[_0x7f5b('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0xb4a9=['exports','events','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x332e43,_0x252844){var _0x13bee3=function(_0x28c39a){while(--_0x28c39a){_0x332e43['push'](_0x332e43['shift']());}};_0x13bee3(++_0x252844);}(_0xb4a9,0x1c1));var _0x9b4a=function(_0x3a8be4,_0x11056d){_0x3a8be4=_0x3a8be4-0x0;var _0x5f0406=_0xb4a9[_0x3a8be4];return _0x5f0406;};'use strict';var EventEmitter=require(_0x9b4a('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9b4a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9b4a('0x2')};function emitEvent(_0x48824e){return function(_0x5cc501,_0x1a1ec6,_0x6e3590){ChatQueueEvents[_0x9b4a('0x3')](_0x48824e+':'+_0x5cc501['id'],_0x5cc501);ChatQueueEvents[_0x9b4a('0x3')](_0x48824e,_0x5cc501);_0x6e3590(null);};}for(var e in events){if(events[_0x9b4a('0x4')](e)){var event=events[e];ChatQueue[_0x9b4a('0x5')](e,emitEvent(event));}}module[_0x9b4a('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index bb4a94e..b142aad 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 _0x82b9=['moment','bluebird','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','util','../../config/logger','api'];(function(_0x9ec221,_0x2594a6){var _0xdbe55e=function(_0x4b4c43){while(--_0x4b4c43){_0x9ec221['push'](_0x9ec221['shift']());}};_0xdbe55e(++_0x2594a6);}(_0x82b9,0x11b));var _0x982b=function(_0x352311,_0x5b2dfc){_0x352311=_0x352311-0x0;var _0x15c3c6=_0x82b9[_0x352311];return _0x15c3c6;};'use strict';var _=require('lodash');var util=require(_0x982b('0x0'));var logger=require(_0x982b('0x1'))(_0x982b('0x2'));var moment=require(_0x982b('0x3'));var BPromise=require(_0x982b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x982b('0x5'));var rimraf=require(_0x982b('0x6'));var config=require('../../config/environment');var attributes=require(_0x982b('0x7'));module['exports']=function(_0x2533f5,_0x1b41e5){return _0x2533f5[_0x982b('0x8')](_0x982b('0x9'),attributes,{'tableName':_0x982b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b48=['bluebird','request-promise','../../config/environment','exports','define','ChatQueue','util','api','moment'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x0b48,0x1bf));var _0x80b4=function(_0xc22a01,_0x77c37f){_0xc22a01=_0xc22a01-0x0;var _0x26ffbc=_0x0b48[_0xc22a01];return _0x26ffbc;};'use strict';var _=require('lodash');var util=require(_0x80b4('0x0'));var logger=require('../../config/logger')(_0x80b4('0x1'));var moment=require(_0x80b4('0x2'));var BPromise=require(_0x80b4('0x3'));var rp=require(_0x80b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x80b4('0x5'));var attributes=require('./chatQueue.attributes');module[_0x80b4('0x6')]=function(_0x4bd2f4,_0x36eb76){return _0x4bd2f4[_0x80b4('0x7')](_0x80b4('0x8'),attributes,{'tableName':'chat_queues','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 1ccb7d7..ba22160 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 _0x5ed0=['debug','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','limit','include','model','attributes','map','stringify','ShowChatQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5237de,_0x28dfaa){var _0x53eb92=function(_0x34f770){while(--_0x34f770){_0x5237de['push'](_0x5237de['shift']());}};_0x53eb92(++_0x28dfaa);}(_0x5ed0,0xcb));var _0x05ed=function(_0x4d0899,_0x23afea){_0x4d0899=_0x4d0899-0x0;var _0x360aab=_0x5ed0[_0x4d0899];return _0x360aab;};'use strict';var _=require('lodash');var util=require(_0x05ed('0x0'));var moment=require(_0x05ed('0x1'));var BPromise=require(_0x05ed('0x2'));var rs=require(_0x05ed('0x3'));var fs=require('fs');var Redis=require(_0x05ed('0x4'));var db=require(_0x05ed('0x5'))['db'];var utils=require(_0x05ed('0x6'));var logger=require(_0x05ed('0x7'))('rpc');var config=require(_0x05ed('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x05ed('0x9')]({'port':0x232a});config[_0x05ed('0xa')]=_[_0x05ed('0xb')](config[_0x05ed('0xa')],{'host':_0x05ed('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05ed('0xa')]));require('./chatQueue.socket')[_0x05ed('0xd')](socket);function respondWithRpcPromise(_0x1f64ac,_0x4dd2e4,_0x8a6298){return new BPromise(function(_0x1c6502,_0x4fdba5){return client[_0x05ed('0xe')](_0x1f64ac,_0x8a6298)[_0x05ed('0xf')](function(_0x18954b){logger[_0x05ed('0x10')](_0x05ed('0x11'),_0x4dd2e4,_0x05ed('0x12'));logger[_0x05ed('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4dd2e4,'request\x20sent',JSON['stringify'](_0x18954b));if(_0x18954b[_0x05ed('0x14')]){if(_0x18954b[_0x05ed('0x14')][_0x05ed('0x15')]===0x1f4){logger['error'](_0x05ed('0x11'),_0x4dd2e4,_0x18954b[_0x05ed('0x14')][_0x05ed('0x16')]);return _0x4fdba5(_0x18954b[_0x05ed('0x14')]['message']);}logger[_0x05ed('0x14')](_0x05ed('0x11'),_0x4dd2e4,_0x18954b[_0x05ed('0x14')]['message']);return _0x1c6502(_0x18954b[_0x05ed('0x14')][_0x05ed('0x16')]);}else{logger['info'](_0x05ed('0x11'),_0x4dd2e4,'request\x20sent');_0x1c6502(_0x18954b[_0x05ed('0x17')][_0x05ed('0x16')]);}})[_0x05ed('0x18')](function(_0x519124){logger['error'](_0x05ed('0x11'),_0x4dd2e4,_0x519124);_0x4fdba5(_0x519124);});});}exports[_0x05ed('0x19')]=function(_0x28de40){var _0x1bdf4d=this;return new Promise(function(_0x397a45,_0x3b023c){return db[_0x05ed('0x1a')]['findAll']({'raw':_0x28de40[_0x05ed('0x1b')]?_0x28de40[_0x05ed('0x1b')][_0x05ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x28de40['options']?_0x28de40[_0x05ed('0x1b')]['where']||null:null,'attributes':_0x28de40[_0x05ed('0x1b')]?_0x28de40['options']['attributes']||null:null,'limit':_0x28de40['options']?_0x28de40['options'][_0x05ed('0x1d')]||null:null,'include':_0x28de40[_0x05ed('0x1b')]?_0x28de40[_0x05ed('0x1b')][_0x05ed('0x1e')]?_['map'](_0x28de40['options'][_0x05ed('0x1e')],function(_0x307321){return{'model':db[_0x307321[_0x05ed('0x1f')]],'as':_0x307321['as'],'attributes':_0x307321[_0x05ed('0x20')],'include':_0x307321[_0x05ed('0x1e')]?_[_0x05ed('0x21')](_0x307321[_0x05ed('0x1e')],function(_0x141c8f){return{'model':db[_0x141c8f[_0x05ed('0x1f')]],'as':_0x141c8f['as'],'attributes':_0x141c8f['attributes'],'include':_0x141c8f['include']?_['map'](_0x141c8f[_0x05ed('0x1e')],function(_0x5854cc){return{'model':db[_0x5854cc[_0x05ed('0x1f')]],'as':_0x5854cc['as'],'attributes':_0x5854cc[_0x05ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x05ed('0xf')](function(_0x4db7f4){logger['info'](_0x05ed('0x19'),_0x28de40);logger['debug'](_0x05ed('0x19'),_0x28de40,JSON[_0x05ed('0x22')](_0x4db7f4));_0x397a45(_0x4db7f4);})[_0x05ed('0x18')](function(_0x7644f0){logger[_0x05ed('0x14')](_0x05ed('0x19'),_0x7644f0['message'],_0x28de40);_0x3b023c(_0x1bdf4d['error'](0x1f4,_0x7644f0[_0x05ed('0x16')]));});});};exports[_0x05ed('0x23')]=function(_0x409588){var _0x1c7759=this;return new Promise(function(_0x1668ba,_0x3e95ad){return db[_0x05ed('0x1a')][_0x05ed('0x24')]({'raw':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')][_0x05ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x409588['options']?_0x409588['options']['where']||null:null,'attributes':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')]['attributes']||null:null,'include':_0x409588[_0x05ed('0x1b')]?_0x409588[_0x05ed('0x1b')][_0x05ed('0x1e')]?_[_0x05ed('0x21')](_0x409588[_0x05ed('0x1b')][_0x05ed('0x1e')],function(_0x3454f7){return{'model':db[_0x3454f7[_0x05ed('0x1f')]],'as':_0x3454f7['as'],'attributes':_0x3454f7[_0x05ed('0x20')],'include':_0x3454f7[_0x05ed('0x1e')]?_['map'](_0x3454f7['include'],function(_0x3f8f26){return{'model':db[_0x3f8f26[_0x05ed('0x1f')]],'as':_0x3f8f26['as'],'attributes':_0x3f8f26['attributes'],'include':_0x3f8f26['include']?_[_0x05ed('0x21')](_0x3f8f26[_0x05ed('0x1e')],function(_0x30d771){return{'model':db[_0x30d771[_0x05ed('0x1f')]],'as':_0x30d771['as'],'attributes':_0x30d771[_0x05ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x05ed('0xf')](function(_0x46b118){logger[_0x05ed('0x10')](_0x05ed('0x23'),_0x409588);logger[_0x05ed('0x13')](_0x05ed('0x23'),_0x409588,JSON[_0x05ed('0x22')](_0x46b118));_0x1668ba(_0x46b118);})[_0x05ed('0x18')](function(_0x1ec847){logger['error'](_0x05ed('0x23'),_0x1ec847[_0x05ed('0x16')],_0x409588);_0x3e95ad(_0x1c7759[_0x05ed('0x14')](0x1f4,_0x1ec847[_0x05ed('0x16')]));});});};
\ No newline at end of file
+var _0xd0f5=['catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x27d6b6,_0x317686){var _0xc06c37=function(_0x6f6aa6){while(--_0x6f6aa6){_0x27d6b6['push'](_0x27d6b6['shift']());}};_0xc06c37(++_0x317686);}(_0xd0f5,0xda));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d0f('0x0'));var util=require(_0x5d0f('0x1'));var moment=require('moment');var BPromise=require(_0x5d0f('0x2'));var rs=require(_0x5d0f('0x3'));var fs=require('fs');var Redis=require(_0x5d0f('0x4'));var db=require(_0x5d0f('0x5'))['db'];var utils=require(_0x5d0f('0x6'));var logger=require(_0x5d0f('0x7'))(_0x5d0f('0x8'));var config=require(_0x5d0f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d0f('0xa')][_0x5d0f('0xb')]({'port':0x232a});config['redis']=_[_0x5d0f('0xc')](config[_0x5d0f('0xd')],{'host':_0x5d0f('0xe'),'port':0x18eb});var socket=require(_0x5d0f('0xf'))(new Redis(config['redis']));require(_0x5d0f('0x10'))[_0x5d0f('0x11')](socket);function respondWithRpcPromise(_0x138715,_0x47f7a7,_0x177101){return new BPromise(function(_0x29164d,_0x49aba5){return client[_0x5d0f('0x12')](_0x138715,_0x177101)[_0x5d0f('0x13')](function(_0x5c5bc1){logger[_0x5d0f('0x14')](_0x5d0f('0x15'),_0x47f7a7,_0x5d0f('0x16'));logger[_0x5d0f('0x17')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x47f7a7,'request\x20sent',JSON[_0x5d0f('0x18')](_0x5c5bc1));if(_0x5c5bc1['error']){if(_0x5c5bc1[_0x5d0f('0x19')][_0x5d0f('0x1a')]===0x1f4){logger[_0x5d0f('0x19')](_0x5d0f('0x15'),_0x47f7a7,_0x5c5bc1[_0x5d0f('0x19')][_0x5d0f('0x1b')]);return _0x49aba5(_0x5c5bc1[_0x5d0f('0x19')][_0x5d0f('0x1b')]);}logger[_0x5d0f('0x19')](_0x5d0f('0x15'),_0x47f7a7,_0x5c5bc1[_0x5d0f('0x19')]['message']);return _0x29164d(_0x5c5bc1['error'][_0x5d0f('0x1b')]);}else{logger[_0x5d0f('0x14')](_0x5d0f('0x15'),_0x47f7a7,_0x5d0f('0x16'));_0x29164d(_0x5c5bc1['result'][_0x5d0f('0x1b')]);}})[_0x5d0f('0x1c')](function(_0x1c3976){logger[_0x5d0f('0x19')](_0x5d0f('0x15'),_0x47f7a7,_0x1c3976);_0x49aba5(_0x1c3976);});});}exports[_0x5d0f('0x1d')]=function(_0x27de43){var _0xdf02d5=this;return new Promise(function(_0x4a8fdb,_0x1679e2){return db[_0x5d0f('0x1e')][_0x5d0f('0x1f')]({'raw':_0x27de43[_0x5d0f('0x20')]?_0x27de43[_0x5d0f('0x20')][_0x5d0f('0x21')]===undefined?!![]:![]:!![],'where':_0x27de43[_0x5d0f('0x20')]?_0x27de43[_0x5d0f('0x20')]['where']||null:null,'attributes':_0x27de43['options']?_0x27de43[_0x5d0f('0x20')][_0x5d0f('0x22')]||null:null,'limit':_0x27de43['options']?_0x27de43[_0x5d0f('0x20')][_0x5d0f('0x23')]||null:null,'include':_0x27de43[_0x5d0f('0x20')]?_0x27de43['options'][_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x27de43['options'][_0x5d0f('0x24')],function(_0x35aa62){return{'model':db[_0x35aa62[_0x5d0f('0x26')]],'as':_0x35aa62['as'],'attributes':_0x35aa62[_0x5d0f('0x22')],'include':_0x35aa62[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x35aa62[_0x5d0f('0x24')],function(_0x2a35eb){return{'model':db[_0x2a35eb[_0x5d0f('0x26')]],'as':_0x2a35eb['as'],'attributes':_0x2a35eb[_0x5d0f('0x22')],'include':_0x2a35eb[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x2a35eb['include'],function(_0x3886f8){return{'model':db[_0x3886f8['model']],'as':_0x3886f8['as'],'attributes':_0x3886f8[_0x5d0f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5d0f('0x13')](function(_0x4fbddf){logger[_0x5d0f('0x14')](_0x5d0f('0x1d'),_0x27de43);logger[_0x5d0f('0x17')]('GetChatQueue',_0x27de43,JSON[_0x5d0f('0x18')](_0x4fbddf));_0x4a8fdb(_0x4fbddf);})[_0x5d0f('0x1c')](function(_0x564496){logger[_0x5d0f('0x19')](_0x5d0f('0x1d'),_0x564496[_0x5d0f('0x1b')],_0x27de43);_0x1679e2(_0xdf02d5[_0x5d0f('0x19')](0x1f4,_0x564496[_0x5d0f('0x1b')]));});});};exports['ShowChatQueue']=function(_0x4d15e9){var _0x37c61e=this;return new Promise(function(_0x397c63,_0x13207d){return db[_0x5d0f('0x1e')][_0x5d0f('0x27')]({'raw':_0x4d15e9['options']?_0x4d15e9['options'][_0x5d0f('0x21')]===undefined?!![]:![]:!![],'where':_0x4d15e9[_0x5d0f('0x20')]?_0x4d15e9[_0x5d0f('0x20')]['where']||null:null,'attributes':_0x4d15e9[_0x5d0f('0x20')]?_0x4d15e9[_0x5d0f('0x20')][_0x5d0f('0x22')]||null:null,'include':_0x4d15e9[_0x5d0f('0x20')]?_0x4d15e9['options'][_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x4d15e9[_0x5d0f('0x20')][_0x5d0f('0x24')],function(_0x16e25e){return{'model':db[_0x16e25e[_0x5d0f('0x26')]],'as':_0x16e25e['as'],'attributes':_0x16e25e[_0x5d0f('0x22')],'include':_0x16e25e[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x16e25e[_0x5d0f('0x24')],function(_0x3b2e11){return{'model':db[_0x3b2e11['model']],'as':_0x3b2e11['as'],'attributes':_0x3b2e11[_0x5d0f('0x22')],'include':_0x3b2e11[_0x5d0f('0x24')]?_[_0x5d0f('0x25')](_0x3b2e11['include'],function(_0x5bbfc2){return{'model':db[_0x5bbfc2[_0x5d0f('0x26')]],'as':_0x5bbfc2['as'],'attributes':_0x5bbfc2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x396cd0){logger[_0x5d0f('0x14')]('ShowChatQueue',_0x4d15e9);logger[_0x5d0f('0x17')](_0x5d0f('0x28'),_0x4d15e9,JSON['stringify'](_0x396cd0));_0x397c63(_0x396cd0);})[_0x5d0f('0x1c')](function(_0x2b5c15){logger[_0x5d0f('0x19')](_0x5d0f('0x28'),_0x2b5c15[_0x5d0f('0x1b')],_0x4d15e9);_0x13207d(_0x37c61e[_0x5d0f('0x19')](0x1f4,_0x2b5c15['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6cdd16b..de5f7fc 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 _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x411c31,_0x58bedc){var _0x262758=function(_0x44fade){while(--_0x44fade){_0x411c31['push'](_0x411c31['shift']());}};_0x262758(++_0x58bedc);}(_0x54ef,0x112));var _0xf54e=function(_0x15609c,_0x3715f0){_0x15609c=_0x15609c-0x0;var _0xda5394=_0x54ef[_0x15609c];return _0xda5394;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
+var _0x84ab=['update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x47f1cc,_0x1081db){var _0x43760a=function(_0x55949b){while(--_0x55949b){_0x47f1cc['push'](_0x47f1cc['shift']());}};_0x43760a(++_0x1081db);}(_0x84ab,0x12f));var _0xb84a=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x84ab[_0x38ced4];return _0x547c07;};'use strict';var ChatQueueEvents=require(_0xb84a('0x0'));var events=[_0xb84a('0x1'),_0xb84a('0x2'),_0xb84a('0x3')];function createListener(_0x473c3,_0x512f13){return function(_0xc83587){_0x512f13[_0xb84a('0x4')](_0x473c3,_0xc83587);};}function removeListener(_0x47b8e3,_0x9d3a00){return function(){ChatQueueEvents[_0xb84a('0x5')](_0x47b8e3,_0x9d3a00);};}exports[_0xb84a('0x6')]=function(_0x5b9def){for(var _0x521a64=0x0,_0x4dc496=events[_0xb84a('0x7')];_0x521a64<_0x4dc496;_0x521a64++){var _0x4fac4d=events[_0x521a64];var _0x3e9086=createListener(_0xb84a('0x8')+_0x4fac4d,_0x5b9def);ChatQueueEvents['on'](_0x4fac4d,_0x3e9086);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 45e7829..6ce4f00 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 _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(_0x13850d,_0x35e9b2){var _0xa73b99=function(_0x4e8047){while(--_0x4e8047){_0x13850d['push'](_0x13850d['shift']());}};_0xa73b99(++_0x35e9b2);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x48ae10,_0x140e3c){var _0x66cd50=function(_0x253b59){while(--_0x253b59){_0x48ae10['push'](_0x48ae10['shift']());}};_0x66cd50(++_0x140e3c);}(_0x7217,0x19e));var _0x7721=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x7217[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 24d6a35..50d41b9 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 _0x81f3=['moment','exports','STRING','DATE'];(function(_0x215433,_0x35140a){var _0xb0a105=function(_0xe5b6fb){while(--_0xe5b6fb){_0x215433['push'](_0x215433['shift']());}};_0xb0a105(++_0x35140a);}(_0x81f3,0x1b8));var _0x381f=function(_0x517a75,_0x28b97b){_0x517a75=_0x517a75-0x0;var _0x59fffd=_0x81f3[_0x517a75];return _0x59fffd;};'use strict';var moment=require(_0x381f('0x0'));var Sequelize=require('sequelize');module[_0x381f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x381f('0x2')]},'joinAt':{'type':Sequelize[_0x381f('0x3')]},'leaveAt':{'type':Sequelize[_0x381f('0x3')]},'acceptAt':{'type':Sequelize[_0x381f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x381f('0x2')]}};
\ No newline at end of file
+var _0x8457=['STRING','DATE','moment','sequelize','exports'];(function(_0x3ccdeb,_0x44306d){var _0x1552e4=function(_0x18f396){while(--_0x18f396){_0x3ccdeb['push'](_0x3ccdeb['shift']());}};_0x1552e4(++_0x44306d);}(_0x8457,0x142));var _0x7845=function(_0x5c313d,_0x45bdf7){_0x5c313d=_0x5c313d-0x0;var _0x317ecf=_0x8457[_0x5c313d];return _0x317ecf;};'use strict';var moment=require(_0x7845('0x0'));var Sequelize=require(_0x7845('0x1'));module[_0x7845('0x2')]={'uniqueid':{'type':Sequelize[_0x7845('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7845('0x3')]},'joinAt':{'type':Sequelize[_0x7845('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7845('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7845('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 138a753..7fe0067 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 _0xaf5a=['desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','filter','options','ChatQueueReport','includeAll','include','findAll','catch','show','params','keys','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x395eec,_0x365bce){var _0x3d2753=function(_0x59be0e){while(--_0x59be0e){_0x395eec['push'](_0x395eec['shift']());}};_0x3d2753(++_0x365bce);}(_0xaf5a,0x116));var _0xaaf5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xaf5a[_0x374ccf];return _0x443cde;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaf5('0x0'));var zipdir=require(_0xaaf5('0x1'));var jsonpatch=require(_0xaaf5('0x2'));var rp=require(_0xaaf5('0x3'));var moment=require(_0xaaf5('0x4'));var BPromise=require(_0xaaf5('0x5'));var Mustache=require(_0xaaf5('0x6'));var util=require(_0xaaf5('0x7'));var path=require('path');var sox=require(_0xaaf5('0x8'));var csv=require(_0xaaf5('0x9'));var ejs=require(_0xaaf5('0xa'));var fs=require('fs');var fs_extra=require(_0xaaf5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaaf5('0xc'));var jsforce=require(_0xaaf5('0xd'));var deskjs=require(_0xaaf5('0xe'));var toCsv=require(_0xaaf5('0x9'));var querystring=require(_0xaaf5('0xf'));var Papa=require('papaparse');var Redis=require(_0xaaf5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaaf5('0x11'));var hardwareService=require(_0xaaf5('0x12'));var logger=require('../../config/logger')(_0xaaf5('0x13'));var utils=require(_0xaaf5('0x14'));var config=require(_0xaaf5('0x15'));var licenseUtil=require(_0xaaf5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x459334,_0x9ce7ce){_0x9ce7ce=_0x9ce7ce||0xcc;return function(_0x4b5c4c){if(_0x4b5c4c){return _0x459334[_0xaaf5('0x17')](_0x9ce7ce);}return _0x459334['status'](_0x9ce7ce)[_0xaaf5('0x18')]();};}function respondWithResult(_0xe50810,_0x35d891){_0x35d891=_0x35d891||0xc8;return function(_0x304060){if(_0x304060){return _0xe50810['status'](_0x35d891)[_0xaaf5('0x19')](_0x304060);}};}function respondWithFilteredResult(_0x3079c3,_0x2e8482){return function(_0x215007){if(_0x215007){var _0x277f2b=typeof _0x2e8482[_0xaaf5('0x1a')]===_0xaaf5('0x1b')&&typeof _0x2e8482['limit']===_0xaaf5('0x1b');var _0x14bc84=_0x215007[_0xaaf5('0x1c')];var _0x3a036d=_0x277f2b?0x0:_0x2e8482[_0xaaf5('0x1a')];var _0x403bb2=_0x277f2b?_0x215007[_0xaaf5('0x1c')]:_0x2e8482['offset']+_0x2e8482['limit'];var _0xf60239;if(_0x403bb2>=_0x14bc84){_0x403bb2=_0x14bc84;_0xf60239=0xc8;}else{_0xf60239=0xce;}_0x3079c3[_0xaaf5('0x1d')](_0xf60239);return _0x3079c3[_0xaaf5('0x1e')](_0xaaf5('0x1f'),_0x3a036d+'-'+_0x403bb2+'/'+_0x14bc84)[_0xaaf5('0x19')](_0x215007);}return null;};}function patchUpdates(_0x6131a3){return function(_0x589ed0){try{jsonpatch['apply'](_0x589ed0,_0x6131a3,!![]);}catch(_0xd31eae){return BPromise[_0xaaf5('0x20')](_0xd31eae);}return _0x589ed0[_0xaaf5('0x21')]();};}function saveUpdates(_0x24cef7,_0x3020b0){return function(_0x2a390c){if(_0x2a390c){return _0x2a390c[_0xaaf5('0x22')](_0x24cef7)[_0xaaf5('0x23')](function(_0x270783){return _0x270783;});}return null;};}function removeEntity(_0x2aabab,_0x43b064){return function(_0xd7db51){if(_0xd7db51){return _0xd7db51[_0xaaf5('0x24')]()[_0xaaf5('0x23')](function(){_0x2aabab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a6e4,_0x569c78){return function(_0x44aef2){if(!_0x44aef2){_0x15a6e4['sendStatus'](0x194);}return _0x44aef2;};}function handleError(_0x501017,_0x236131){_0x236131=_0x236131||0x1f4;return function(_0x26f14a){logger[_0xaaf5('0x25')](_0x26f14a[_0xaaf5('0x26')]);if(_0x26f14a[_0xaaf5('0x27')]){delete _0x26f14a[_0xaaf5('0x27')];}_0x501017['status'](_0x236131)[_0xaaf5('0x28')](_0x26f14a);};}exports['index']=function(_0x4beb05,_0x24cd49){var _0x461fd9={},_0x443c1b={},_0x17d742={'count':0x0,'rows':[]};var _0x66ac51=_[_0xaaf5('0x29')](db['ChatQueueReport'][_0xaaf5('0x2a')],function(_0x4954af){return{'name':_0x4954af[_0xaaf5('0x2b')],'type':_0x4954af[_0xaaf5('0x2c')]['key']};});_0x443c1b[_0xaaf5('0x2d')]=_['map'](_0x66ac51,_0xaaf5('0x27'));_0x443c1b[_0xaaf5('0x2e')]=_['keys'](_0x4beb05[_0xaaf5('0x2e')]);_0x443c1b['filters']=_[_0xaaf5('0x2f')](_0x443c1b[_0xaaf5('0x2d')],_0x443c1b['query']);_0x461fd9[_0xaaf5('0x30')]=_['intersection'](_0x443c1b[_0xaaf5('0x2d')],qs[_0xaaf5('0x31')](_0x4beb05['query'][_0xaaf5('0x31')]));_0x461fd9['attributes']=_0x461fd9[_0xaaf5('0x30')][_0xaaf5('0x32')]?_0x461fd9[_0xaaf5('0x30')]:_0x443c1b[_0xaaf5('0x2d')];if(!_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x33')](_0xaaf5('0x34'))){_0x461fd9['limit']=qs[_0xaaf5('0x35')](_0x4beb05[_0xaaf5('0x2e')]['limit']);_0x461fd9[_0xaaf5('0x1a')]=qs[_0xaaf5('0x1a')](_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x1a')]);}_0x461fd9['order']=qs[_0xaaf5('0x36')](_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x36')]);_0x461fd9[_0xaaf5('0x37')]=qs[_0xaaf5('0x38')](_[_0xaaf5('0x39')](_0x4beb05['query'],_0x443c1b[_0xaaf5('0x38')]),_0x66ac51);if(_0x4beb05[_0xaaf5('0x2e')]['filter']){_0x461fd9[_0xaaf5('0x37')]=_[_0xaaf5('0x3a')](_0x461fd9[_0xaaf5('0x37')],{'$or':_[_0xaaf5('0x29')](_0x66ac51,function(_0x583a3d){if(_0x583a3d[_0xaaf5('0x2c')]!=='VIRTUAL'){var _0x32b7f4={};_0x32b7f4[_0x583a3d[_0xaaf5('0x27')]]={'$like':'%'+_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x3b')]+'%'};return _0x32b7f4;}})});}_0x461fd9=_[_0xaaf5('0x3a')]({},_0x461fd9,_0x4beb05[_0xaaf5('0x3c')]);var _0x43a126={'where':_0x461fd9[_0xaaf5('0x37')]};return db[_0xaaf5('0x3d')][_0xaaf5('0x1c')](_0x43a126)[_0xaaf5('0x23')](function(_0x294bf9){_0x17d742['count']=_0x294bf9;if(_0x4beb05[_0xaaf5('0x2e')][_0xaaf5('0x3e')]){_0x461fd9[_0xaaf5('0x3f')]=[{'all':!![]}];}return db[_0xaaf5('0x3d')][_0xaaf5('0x40')](_0x461fd9);})[_0xaaf5('0x23')](function(_0x3401fa){_0x17d742['rows']=_0x3401fa;return _0x17d742;})[_0xaaf5('0x23')](respondWithFilteredResult(_0x24cd49,_0x461fd9))[_0xaaf5('0x41')](handleError(_0x24cd49,null));};exports[_0xaaf5('0x42')]=function(_0x7fa50a,_0xbcd7f1){var _0x111cda={'raw':!![],'where':{'id':_0x7fa50a[_0xaaf5('0x43')]['id']}},_0xcf08ff={};_0xcf08ff[_0xaaf5('0x2d')]=_[_0xaaf5('0x44')](db[_0xaaf5('0x3d')][_0xaaf5('0x2a')]);_0xcf08ff['query']=_[_0xaaf5('0x44')](_0x7fa50a[_0xaaf5('0x2e')]);_0xcf08ff[_0xaaf5('0x38')]=_[_0xaaf5('0x2f')](_0xcf08ff[_0xaaf5('0x2d')],_0xcf08ff[_0xaaf5('0x2e')]);_0x111cda[_0xaaf5('0x30')]=_[_0xaaf5('0x2f')](_0xcf08ff['model'],qs[_0xaaf5('0x31')](_0x7fa50a['query']['fields']));_0x111cda[_0xaaf5('0x30')]=_0x111cda['attributes'][_0xaaf5('0x32')]?_0x111cda[_0xaaf5('0x30')]:_0xcf08ff['model'];if(_0x7fa50a[_0xaaf5('0x2e')]['includeAll']){_0x111cda['include']=[{'all':!![]}];}_0x111cda=_[_0xaaf5('0x3a')]({},_0x111cda,_0x7fa50a[_0xaaf5('0x3c')]);return db[_0xaaf5('0x3d')]['find'](_0x111cda)[_0xaaf5('0x23')](handleEntityNotFound(_0xbcd7f1,null))[_0xaaf5('0x23')](respondWithResult(_0xbcd7f1,null))[_0xaaf5('0x41')](handleError(_0xbcd7f1,null));};exports[_0xaaf5('0x45')]=function(_0x47d566,_0x461f9c){return db['ChatQueueReport']['create'](_0x47d566[_0xaaf5('0x46')],{})['then'](respondWithResult(_0x461f9c,0xc9))[_0xaaf5('0x41')](handleError(_0x461f9c,null));};exports[_0xaaf5('0x22')]=function(_0xd2ffe7,_0x12c65f){if(_0xd2ffe7[_0xaaf5('0x46')]['id']){delete _0xd2ffe7[_0xaaf5('0x46')]['id'];}return db['ChatQueueReport'][_0xaaf5('0x47')]({'where':{'id':_0xd2ffe7[_0xaaf5('0x43')]['id']}})['then'](handleEntityNotFound(_0x12c65f,null))[_0xaaf5('0x23')](saveUpdates(_0xd2ffe7[_0xaaf5('0x46')],null))[_0xaaf5('0x23')](respondWithResult(_0x12c65f,null))[_0xaaf5('0x41')](handleError(_0x12c65f,null));};exports[_0xaaf5('0x24')]=function(_0x879ee4,_0x12afb2){return db[_0xaaf5('0x3d')]['find']({'where':{'id':_0x879ee4[_0xaaf5('0x43')]['id']}})[_0xaaf5('0x23')](handleEntityNotFound(_0x12afb2,null))[_0xaaf5('0x23')](removeEntity(_0x12afb2,null))[_0xaaf5('0x41')](handleError(_0x12afb2,null));};exports[_0xaaf5('0x48')]=function(_0x170708,_0x5a5c73){return db[_0xaaf5('0x3d')][_0xaaf5('0x48')]()[_0xaaf5('0x23')](respondWithResult(_0x5a5c73,null))[_0xaaf5('0x41')](handleError(_0x5a5c73,null));};
\ No newline at end of file
+var _0xa647=['../../config/license/util','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x141da6,_0x4d933d){var _0x1edf5a=function(_0x462593){while(--_0x462593){_0x141da6['push'](_0x141da6['shift']());}};_0x1edf5a(++_0x4d933d);}(_0xa647,0x81));var _0x7a64=function(_0x2939f6,_0x6dc867){_0x2939f6=_0x2939f6-0x0;var _0x58330c=_0xa647[_0x2939f6];return _0x58330c;};'use strict';var emlformat=require(_0x7a64('0x0'));var rimraf=require(_0x7a64('0x1'));var zipdir=require(_0x7a64('0x2'));var jsonpatch=require(_0x7a64('0x3'));var rp=require(_0x7a64('0x4'));var moment=require(_0x7a64('0x5'));var BPromise=require(_0x7a64('0x6'));var Mustache=require(_0x7a64('0x7'));var util=require(_0x7a64('0x8'));var path=require(_0x7a64('0x9'));var sox=require(_0x7a64('0xa'));var csv=require(_0x7a64('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a64('0xc'));var _=require(_0x7a64('0xd'));var squel=require('squel');var crypto=require(_0x7a64('0xe'));var jsforce=require(_0x7a64('0xf'));var deskjs=require(_0x7a64('0x10'));var toCsv=require(_0x7a64('0xb'));var querystring=require(_0x7a64('0x11'));var Papa=require(_0x7a64('0x12'));var Redis=require(_0x7a64('0x13'));var authService=require(_0x7a64('0x14'));var qs=require(_0x7a64('0x15'));var as=require(_0x7a64('0x16'));var hardwareService=require(_0x7a64('0x17'));var logger=require(_0x7a64('0x18'))(_0x7a64('0x19'));var utils=require('../../config/utils');var config=require(_0x7a64('0x1a'));var licenseUtil=require(_0x7a64('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d549,_0x5923c){_0x5923c=_0x5923c||0xcc;return function(_0x30a408){if(_0x30a408){return _0x10d549['sendStatus'](_0x5923c);}return _0x10d549[_0x7a64('0x1c')](_0x5923c)[_0x7a64('0x1d')]();};}function respondWithResult(_0x38e79b,_0x293021){_0x293021=_0x293021||0xc8;return function(_0x24f0e3){if(_0x24f0e3){return _0x38e79b[_0x7a64('0x1c')](_0x293021)[_0x7a64('0x1e')](_0x24f0e3);}};}function respondWithFilteredResult(_0x4829f8,_0x136263){return function(_0x5ae1c3){if(_0x5ae1c3){var _0x47a13d=typeof _0x136263[_0x7a64('0x1f')]===_0x7a64('0x20')&&typeof _0x136263[_0x7a64('0x21')]==='undefined';var _0x126eef=_0x5ae1c3['count'];var _0x30c214=_0x47a13d?0x0:_0x136263['offset'];var _0x41e444=_0x47a13d?_0x5ae1c3['count']:_0x136263[_0x7a64('0x1f')]+_0x136263[_0x7a64('0x21')];var _0x5c196a;if(_0x41e444>=_0x126eef){_0x41e444=_0x126eef;_0x5c196a=0xc8;}else{_0x5c196a=0xce;}_0x4829f8['status'](_0x5c196a);return _0x4829f8['set'](_0x7a64('0x22'),_0x30c214+'-'+_0x41e444+'/'+_0x126eef)[_0x7a64('0x1e')](_0x5ae1c3);}return null;};}function patchUpdates(_0x4f56ab){return function(_0x57fa06){try{jsonpatch[_0x7a64('0x23')](_0x57fa06,_0x4f56ab,!![]);}catch(_0x5751b3){return BPromise[_0x7a64('0x24')](_0x5751b3);}return _0x57fa06[_0x7a64('0x25')]();};}function saveUpdates(_0x435abe,_0x2e78af){return function(_0x5dbac4){if(_0x5dbac4){return _0x5dbac4[_0x7a64('0x26')](_0x435abe)[_0x7a64('0x27')](function(_0x5e34d5){return _0x5e34d5;});}return null;};}function removeEntity(_0x2caaa4,_0xdfce54){return function(_0x61efd8){if(_0x61efd8){return _0x61efd8[_0x7a64('0x28')]()['then'](function(){_0x2caaa4['status'](0xcc)[_0x7a64('0x1d')]();});}};}function handleEntityNotFound(_0x40af63,_0x593144){return function(_0x38acec){if(!_0x38acec){_0x40af63['sendStatus'](0x194);}return _0x38acec;};}function handleError(_0x329f34,_0x3cc6a7){_0x3cc6a7=_0x3cc6a7||0x1f4;return function(_0x177132){logger[_0x7a64('0x29')](_0x177132[_0x7a64('0x2a')]);if(_0x177132[_0x7a64('0x2b')]){delete _0x177132[_0x7a64('0x2b')];}_0x329f34[_0x7a64('0x1c')](_0x3cc6a7)[_0x7a64('0x2c')](_0x177132);};}exports[_0x7a64('0x2d')]=function(_0x317183,_0x4e4136){var _0x1ce700={},_0x2dc737={},_0x358916={'count':0x0,'rows':[]};var _0x35a913=_['map'](db[_0x7a64('0x2e')]['rawAttributes'],function(_0x421092){return{'name':_0x421092['fieldName'],'type':_0x421092[_0x7a64('0x2f')]['key']};});_0x2dc737['model']=_[_0x7a64('0x30')](_0x35a913,_0x7a64('0x2b'));_0x2dc737[_0x7a64('0x31')]=_[_0x7a64('0x32')](_0x317183['query']);_0x2dc737[_0x7a64('0x33')]=_[_0x7a64('0x34')](_0x2dc737[_0x7a64('0x35')],_0x2dc737[_0x7a64('0x31')]);_0x1ce700['attributes']=_[_0x7a64('0x34')](_0x2dc737[_0x7a64('0x35')],qs['fields'](_0x317183['query'][_0x7a64('0x36')]));_0x1ce700[_0x7a64('0x37')]=_0x1ce700[_0x7a64('0x37')][_0x7a64('0x38')]?_0x1ce700[_0x7a64('0x37')]:_0x2dc737['model'];if(!_0x317183[_0x7a64('0x31')][_0x7a64('0x39')](_0x7a64('0x3a'))){_0x1ce700[_0x7a64('0x21')]=qs[_0x7a64('0x21')](_0x317183['query'][_0x7a64('0x21')]);_0x1ce700[_0x7a64('0x1f')]=qs[_0x7a64('0x1f')](_0x317183[_0x7a64('0x31')]['offset']);}_0x1ce700[_0x7a64('0x3b')]=qs[_0x7a64('0x3c')](_0x317183[_0x7a64('0x31')]['sort']);_0x1ce700[_0x7a64('0x3d')]=qs[_0x7a64('0x33')](_[_0x7a64('0x3e')](_0x317183[_0x7a64('0x31')],_0x2dc737[_0x7a64('0x33')]),_0x35a913);if(_0x317183['query'][_0x7a64('0x3f')]){_0x1ce700[_0x7a64('0x3d')]=_[_0x7a64('0x40')](_0x1ce700[_0x7a64('0x3d')],{'$or':_[_0x7a64('0x30')](_0x35a913,function(_0x5a1692){if(_0x5a1692[_0x7a64('0x2f')]!=='VIRTUAL'){var _0x255061={};_0x255061[_0x5a1692[_0x7a64('0x2b')]]={'$like':'%'+_0x317183[_0x7a64('0x31')][_0x7a64('0x3f')]+'%'};return _0x255061;}})});}_0x1ce700=_[_0x7a64('0x40')]({},_0x1ce700,_0x317183[_0x7a64('0x41')]);var _0x137b4d={'where':_0x1ce700[_0x7a64('0x3d')]};return db[_0x7a64('0x2e')]['count'](_0x137b4d)[_0x7a64('0x27')](function(_0xf7898a){_0x358916[_0x7a64('0x42')]=_0xf7898a;if(_0x317183[_0x7a64('0x31')][_0x7a64('0x43')]){_0x1ce700[_0x7a64('0x44')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x1ce700);})[_0x7a64('0x27')](function(_0x77b1e1){_0x358916[_0x7a64('0x45')]=_0x77b1e1;return _0x358916;})[_0x7a64('0x27')](respondWithFilteredResult(_0x4e4136,_0x1ce700))[_0x7a64('0x46')](handleError(_0x4e4136,null));};exports[_0x7a64('0x47')]=function(_0x1519a6,_0x306827){var _0x3f0766={'raw':!![],'where':{'id':_0x1519a6[_0x7a64('0x48')]['id']}},_0x5426f1={};_0x5426f1[_0x7a64('0x35')]=_[_0x7a64('0x32')](db[_0x7a64('0x2e')][_0x7a64('0x49')]);_0x5426f1[_0x7a64('0x31')]=_[_0x7a64('0x32')](_0x1519a6[_0x7a64('0x31')]);_0x5426f1['filters']=_[_0x7a64('0x34')](_0x5426f1[_0x7a64('0x35')],_0x5426f1[_0x7a64('0x31')]);_0x3f0766[_0x7a64('0x37')]=_['intersection'](_0x5426f1[_0x7a64('0x35')],qs[_0x7a64('0x36')](_0x1519a6[_0x7a64('0x31')][_0x7a64('0x36')]));_0x3f0766[_0x7a64('0x37')]=_0x3f0766[_0x7a64('0x37')][_0x7a64('0x38')]?_0x3f0766[_0x7a64('0x37')]:_0x5426f1[_0x7a64('0x35')];if(_0x1519a6['query'][_0x7a64('0x43')]){_0x3f0766[_0x7a64('0x44')]=[{'all':!![]}];}_0x3f0766=_[_0x7a64('0x40')]({},_0x3f0766,_0x1519a6[_0x7a64('0x41')]);return db[_0x7a64('0x2e')]['find'](_0x3f0766)[_0x7a64('0x27')](handleEntityNotFound(_0x306827,null))[_0x7a64('0x27')](respondWithResult(_0x306827,null))[_0x7a64('0x46')](handleError(_0x306827,null));};exports[_0x7a64('0x4a')]=function(_0x7d9d89,_0x2b3148){return db[_0x7a64('0x2e')]['create'](_0x7d9d89['body'],{})[_0x7a64('0x27')](respondWithResult(_0x2b3148,0xc9))['catch'](handleError(_0x2b3148,null));};exports[_0x7a64('0x26')]=function(_0x4eaa4f,_0x24b932){if(_0x4eaa4f['body']['id']){delete _0x4eaa4f[_0x7a64('0x4b')]['id'];}return db[_0x7a64('0x2e')][_0x7a64('0x4c')]({'where':{'id':_0x4eaa4f[_0x7a64('0x48')]['id']}})[_0x7a64('0x27')](handleEntityNotFound(_0x24b932,null))[_0x7a64('0x27')](saveUpdates(_0x4eaa4f['body'],null))[_0x7a64('0x27')](respondWithResult(_0x24b932,null))[_0x7a64('0x46')](handleError(_0x24b932,null));};exports[_0x7a64('0x28')]=function(_0x2dbd81,_0xfa8bfe){return db[_0x7a64('0x2e')][_0x7a64('0x4c')]({'where':{'id':_0x2dbd81[_0x7a64('0x48')]['id']}})['then'](handleEntityNotFound(_0xfa8bfe,null))[_0x7a64('0x27')](removeEntity(_0xfa8bfe,null))['catch'](handleError(_0xfa8bfe,null));};exports['describe']=function(_0x53d828,_0x5f4cd1){return db[_0x7a64('0x2e')][_0x7a64('0x4d')]()['then'](respondWithResult(_0x5f4cd1,null))[_0x7a64('0x46')](handleError(_0x5f4cd1,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 5ea630c..73fc330 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(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_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(_0x1488d4,_0x1286ec){var _0x5ce26d=function(_0x1cab99){while(--_0x1cab99){_0x1488d4['push'](_0x1488d4['shift']());}};_0x5ce26d(++_0x1286ec);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 decc543..75dc592 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 _0xc260=['stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x297814,_0x36b00e){var _0x29801d=function(_0x17aa83){while(--_0x17aa83){_0x297814['push'](_0x297814['shift']());}};_0x29801d(++_0x36b00e);}(_0xc260,0x10f));var _0x0c26=function(_0x1294aa,_0x242aeb){_0x1294aa=_0x1294aa-0x0;var _0x1a5c83=_0xc260[_0x1294aa];return _0x1a5c83;};'use strict';var _=require(_0x0c26('0x0'));var util=require(_0x0c26('0x1'));var moment=require(_0x0c26('0x2'));var BPromise=require(_0x0c26('0x3'));var rs=require(_0x0c26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c26('0x5'))['db'];var utils=require(_0x0c26('0x6'));var logger=require('../../config/logger')(_0x0c26('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c26('0x8'));var client=jayson['client'][_0x0c26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x249491,_0x284726,_0x14d2a1){return new BPromise(function(_0xd8331e,_0x512054){return client[_0x0c26('0xa')](_0x249491,_0x14d2a1)[_0x0c26('0xb')](function(_0xeb0d29){logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));logger[_0x0c26('0xf')](_0x0c26('0x10'),_0x284726,_0x0c26('0xe'),JSON[_0x0c26('0x11')](_0xeb0d29));if(_0xeb0d29['error']){if(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x13')]===0x1f4){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);return _0x512054(_0xeb0d29[_0x0c26('0x12')]['message']);}logger['error'](_0x0c26('0xd'),_0x284726,_0xeb0d29['error'][_0x0c26('0x14')]);return _0xd8331e(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);}else{logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));_0xd8331e(_0xeb0d29['result'][_0x0c26('0x14')]);}})[_0x0c26('0x15')](function(_0x5e87bf){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0x5e87bf);_0x512054(_0x5e87bf);});});}exports[_0x0c26('0x16')]=function(_0x55fead){var _0x2f37d7=this;return new Promise(function(_0xe29adc,_0x5702dc){return db[_0x0c26('0x17')][_0x0c26('0x18')](_0x55fead[_0x0c26('0x19')],{'raw':_0x55fead['options']?_0x55fead[_0x0c26('0x1a')][_0x0c26('0x1b')]===undefined?!![]:![]:!![]})[_0x0c26('0xb')](function(_0xfff859){logger[_0x0c26('0xc')](_0x0c26('0x16'),_0x55fead);logger['debug']('CreateChatQueueReport',_0x55fead,JSON[_0x0c26('0x11')](_0xfff859));_0xe29adc(_0xfff859);})[_0x0c26('0x15')](function(_0x5af0ca){logger[_0x0c26('0x12')](_0x0c26('0x16'),_0x5af0ca[_0x0c26('0x14')],_0x55fead);_0x5702dc(_0x2f37d7['error'](0x1f4,_0x5af0ca[_0x0c26('0x14')]));});});};exports[_0x0c26('0x1c')]=function(_0x1f3021){var _0x2174e3=this;return new Promise(function(_0x120942,_0x8fb00e){return db[_0x0c26('0x17')]['update'](_0x1f3021[_0x0c26('0x19')],{'raw':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1d')]||null:null,'attributes':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1e')]||null:null,'limit':_0x1f3021['options']?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1f')]||null:null})['then'](function(_0x2c2111){logger[_0x0c26('0xc')](_0x0c26('0x1c'),_0x1f3021);logger['debug'](_0x0c26('0x1c'),_0x1f3021,JSON['stringify'](_0x2c2111));_0x120942(_0x2c2111);})[_0x0c26('0x15')](function(_0x4c90dc){logger[_0x0c26('0x12')]('UpdateChatQueueReport',_0x4c90dc[_0x0c26('0x14')],_0x1f3021);_0x8fb00e(_0x2174e3['error'](0x1f4,_0x4c90dc[_0x0c26('0x14')]));});});};
\ No newline at end of file
+var _0x51c5=['limit','UpdateChatQueueReport','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','update','where'];(function(_0x4e4315,_0x5d7615){var _0x31f97a=function(_0x330858){while(--_0x330858){_0x4e4315['push'](_0x4e4315['shift']());}};_0x31f97a(++_0x5d7615);}(_0x51c5,0xc8));var _0x551c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x51c5[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x551c('0x0'));var BPromise=require(_0x551c('0x1'));var rs=require(_0x551c('0x2'));var fs=require('fs');var Redis=require(_0x551c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x551c('0x4'));var logger=require(_0x551c('0x5'))(_0x551c('0x6'));var config=require(_0x551c('0x7'));var jayson=require(_0x551c('0x8'));var client=jayson[_0x551c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5309,_0x3449a0,_0x24611b){return new BPromise(function(_0x39e753,_0x4758ac){return client[_0x551c('0xa')](_0x1c5309,_0x24611b)[_0x551c('0xb')](function(_0x1b83c4){logger[_0x551c('0xc')](_0x551c('0xd'),_0x3449a0,'request\x20sent');logger['debug'](_0x551c('0xe'),_0x3449a0,'request\x20sent',JSON[_0x551c('0xf')](_0x1b83c4));if(_0x1b83c4[_0x551c('0x10')]){if(_0x1b83c4['error'][_0x551c('0x11')]===0x1f4){logger['error'](_0x551c('0xd'),_0x3449a0,_0x1b83c4[_0x551c('0x10')][_0x551c('0x12')]);return _0x4758ac(_0x1b83c4[_0x551c('0x10')][_0x551c('0x12')]);}logger[_0x551c('0x10')](_0x551c('0xd'),_0x3449a0,_0x1b83c4['error'][_0x551c('0x12')]);return _0x39e753(_0x1b83c4[_0x551c('0x10')]['message']);}else{logger['info'](_0x551c('0xd'),_0x3449a0,_0x551c('0x13'));_0x39e753(_0x1b83c4[_0x551c('0x14')]['message']);}})[_0x551c('0x15')](function(_0x2f9710){logger[_0x551c('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x3449a0,_0x2f9710);_0x4758ac(_0x2f9710);});});}exports[_0x551c('0x16')]=function(_0x29d639){var _0x58267b=this;return new Promise(function(_0x34e284,_0x4d7669){return db[_0x551c('0x17')][_0x551c('0x18')](_0x29d639[_0x551c('0x19')],{'raw':_0x29d639['options']?_0x29d639[_0x551c('0x1a')][_0x551c('0x1b')]===undefined?!![]:![]:!![]})[_0x551c('0xb')](function(_0x1fff90){logger['info'](_0x551c('0x16'),_0x29d639);logger[_0x551c('0x1c')](_0x551c('0x16'),_0x29d639,JSON['stringify'](_0x1fff90));_0x34e284(_0x1fff90);})[_0x551c('0x15')](function(_0x10e611){logger[_0x551c('0x10')](_0x551c('0x16'),_0x10e611[_0x551c('0x12')],_0x29d639);_0x4d7669(_0x58267b['error'](0x1f4,_0x10e611[_0x551c('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x24b561){var _0x3d8c54=this;return new Promise(function(_0x488ac2,_0x5c1a8e){return db[_0x551c('0x17')][_0x551c('0x1d')](_0x24b561[_0x551c('0x19')],{'raw':_0x24b561[_0x551c('0x1a')]?_0x24b561[_0x551c('0x1a')][_0x551c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24b561[_0x551c('0x1a')]?_0x24b561[_0x551c('0x1a')][_0x551c('0x1e')]||null:null,'attributes':_0x24b561[_0x551c('0x1a')]?_0x24b561['options']['attributes']||null:null,'limit':_0x24b561[_0x551c('0x1a')]?_0x24b561[_0x551c('0x1a')][_0x551c('0x1f')]||null:null})[_0x551c('0xb')](function(_0x37b5fa){logger[_0x551c('0xc')](_0x551c('0x20'),_0x24b561);logger[_0x551c('0x1c')](_0x551c('0x20'),_0x24b561,JSON[_0x551c('0xf')](_0x37b5fa));_0x488ac2(_0x37b5fa);})[_0x551c('0x15')](function(_0x4dbe97){logger[_0x551c('0x10')](_0x551c('0x20'),_0x4dbe97[_0x551c('0x12')],_0x24b561);_0x5c1a8e(_0x3d8c54[_0x551c('0x10')](0x1f4,_0x4dbe97[_0x551c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 6ffc47d..d4e3245 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 _0x801a=['/:id','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','isAuthenticated','describe'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x801a,0x137));var _0xa801=function(_0x370f53,_0x142c7e){_0x370f53=_0x370f53-0x0;var _0x5aed78=_0x801a[_0x370f53];return _0x5aed78;};'use strict';var multer=require(_0xa801('0x0'));var util=require('util');var path=require(_0xa801('0x1'));var timeout=require(_0xa801('0x2'));var express=require('express');var router=express[_0xa801('0x3')]();var fs_extra=require(_0xa801('0x4'));var auth=require(_0xa801('0x5'));var interaction=require(_0xa801('0x6'));var config=require(_0xa801('0x7'));var controller=require(_0xa801('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa801('0x9')]);router[_0xa801('0xa')]('/describe',auth[_0xa801('0xb')](),controller[_0xa801('0xc')]);router['get'](_0xa801('0xd'),auth[_0xa801('0xb')](),controller['show']);router['post']('/',auth[_0xa801('0xb')](),controller['create']);router[_0xa801('0xe')](_0xa801('0xd'),auth[_0xa801('0xb')](),controller[_0xa801('0xf')]);router['delete'](_0xa801('0xd'),auth['isAuthenticated'](),controller[_0xa801('0x10')]);module[_0xa801('0x11')]=router;
\ No newline at end of file
+var _0x22a0=['../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x141da1,_0x3905c7){var _0x5abdbd=function(_0xc78a12){while(--_0xc78a12){_0x141da1['push'](_0x141da1['shift']());}};_0x5abdbd(++_0x3905c7);}(_0x22a0,0x80));var _0x022a=function(_0x1eb308,_0x140fa8){_0x1eb308=_0x1eb308-0x0;var _0x26d5c2=_0x22a0[_0x1eb308];return _0x26d5c2;};'use strict';var multer=require(_0x022a('0x0'));var util=require(_0x022a('0x1'));var path=require(_0x022a('0x2'));var timeout=require(_0x022a('0x3'));var express=require('express');var router=express[_0x022a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x022a('0x5'));var interaction=require(_0x022a('0x6'));var config=require('../../config/environment');var controller=require(_0x022a('0x7'));router['get']('/',auth[_0x022a('0x8')](),controller[_0x022a('0x9')]);router[_0x022a('0xa')]('/describe',auth[_0x022a('0x8')](),controller[_0x022a('0xb')]);router['get'](_0x022a('0xc'),auth['isAuthenticated'](),controller[_0x022a('0xd')]);router['post']('/',auth[_0x022a('0x8')](),controller['create']);router[_0x022a('0xe')](_0x022a('0xc'),auth['isAuthenticated'](),controller[_0x022a('0xf')]);router[_0x022a('0x10')](_0x022a('0xc'),auth[_0x022a('0x8')](),controller[_0x022a('0x11')]);module[_0x022a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f5c75c5..659a77d 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x4f9993,_0xd91b5b){var _0x482152=function(_0x25b089){while(--_0x25b089){_0x4f9993['push'](_0x4f9993['shift']());}};_0x482152(++_0xd91b5b);}(_0xedd9,0xfc));var _0x9edd=function(_0x56a935,_0x1b4d7b){_0x56a935=_0x56a935-0x0;var _0x56b8a9=_0xedd9[_0x56a935];return _0x56b8a9;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xb43b,0x1b2));var _0xbb43=function(_0x33b476,_0x1d4cd3){_0x33b476=_0x33b476-0x0;var _0x99fa39=_0xb43b[_0x33b476];return _0x99fa39;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 779be0d..1fe704f 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 _0x3067=['limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','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','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','undefined'];(function(_0x6cfc64,_0x53d1b1){var _0x592670=function(_0x4e538b){while(--_0x4e538b){_0x6cfc64['push'](_0x6cfc64['shift']());}};_0x592670(++_0x53d1b1);}(_0x3067,0x7e));var _0x7306=function(_0x20a6db,_0x3a00a5){_0x20a6db=_0x20a6db-0x0;var _0x406dc1=_0x3067[_0x20a6db];return _0x406dc1;};'use strict';var emlformat=require(_0x7306('0x0'));var rimraf=require(_0x7306('0x1'));var zipdir=require(_0x7306('0x2'));var jsonpatch=require(_0x7306('0x3'));var rp=require(_0x7306('0x4'));var moment=require(_0x7306('0x5'));var BPromise=require(_0x7306('0x6'));var Mustache=require(_0x7306('0x7'));var util=require(_0x7306('0x8'));var path=require(_0x7306('0x9'));var sox=require(_0x7306('0xa'));var csv=require(_0x7306('0xb'));var ejs=require(_0x7306('0xc'));var fs=require('fs');var fs_extra=require(_0x7306('0xd'));var _=require(_0x7306('0xe'));var squel=require(_0x7306('0xf'));var crypto=require(_0x7306('0x10'));var jsforce=require(_0x7306('0x11'));var deskjs=require(_0x7306('0x12'));var toCsv=require(_0x7306('0xb'));var querystring=require(_0x7306('0x13'));var Papa=require(_0x7306('0x14'));var Redis=require(_0x7306('0x15'));var authService=require(_0x7306('0x16'));var qs=require(_0x7306('0x17'));var as=require(_0x7306('0x18'));var hardwareService=require(_0x7306('0x19'));var logger=require(_0x7306('0x1a'))(_0x7306('0x1b'));var utils=require(_0x7306('0x1c'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7306('0x1d'))['db'];function respondWithStatusCode(_0x26b43d,_0x191032){_0x191032=_0x191032||0xcc;return function(_0x2e0c76){if(_0x2e0c76){return _0x26b43d['sendStatus'](_0x191032);}return _0x26b43d['status'](_0x191032)[_0x7306('0x1e')]();};}function respondWithResult(_0x37ddac,_0x492bc6){_0x492bc6=_0x492bc6||0xc8;return function(_0x3b784f){if(_0x3b784f){return _0x37ddac[_0x7306('0x1f')](_0x492bc6)[_0x7306('0x20')](_0x3b784f);}};}function respondWithFilteredResult(_0x21764a,_0x546d58){return function(_0x1cbf0a){if(_0x1cbf0a){var _0x8e6278=typeof _0x546d58['offset']===_0x7306('0x21')&&typeof _0x546d58[_0x7306('0x22')]==='undefined';var _0x3c5e18=_0x1cbf0a[_0x7306('0x23')];var _0x50f5ef=_0x8e6278?0x0:_0x546d58[_0x7306('0x24')];var _0x33a144=_0x8e6278?_0x1cbf0a[_0x7306('0x23')]:_0x546d58[_0x7306('0x24')]+_0x546d58[_0x7306('0x22')];var _0x20baec;if(_0x33a144>=_0x3c5e18){_0x33a144=_0x3c5e18;_0x20baec=0xc8;}else{_0x20baec=0xce;}_0x21764a[_0x7306('0x1f')](_0x20baec);return _0x21764a['set']('Content-Range',_0x50f5ef+'-'+_0x33a144+'/'+_0x3c5e18)[_0x7306('0x20')](_0x1cbf0a);}return null;};}function patchUpdates(_0x5ee224){return function(_0x3ff934){try{jsonpatch[_0x7306('0x25')](_0x3ff934,_0x5ee224,!![]);}catch(_0xda48a0){return BPromise[_0x7306('0x26')](_0xda48a0);}return _0x3ff934[_0x7306('0x27')]();};}function saveUpdates(_0xf3d021,_0x223f21){return function(_0x2ae177){if(_0x2ae177){return _0x2ae177[_0x7306('0x28')](_0xf3d021)[_0x7306('0x29')](function(_0xa87e91){return _0xa87e91;});}return null;};}function removeEntity(_0x2bfb37,_0x1da87b){return function(_0x56f5c8){if(_0x56f5c8){return _0x56f5c8[_0x7306('0x2a')]()[_0x7306('0x29')](function(){_0x2bfb37[_0x7306('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be940,_0x419b1a){return function(_0xb9b205){if(!_0xb9b205){_0x4be940['sendStatus'](0x194);}return _0xb9b205;};}function handleError(_0x237de5,_0x863b4){_0x863b4=_0x863b4||0x1f4;return function(_0x4b8ed3){logger[_0x7306('0x2b')](_0x4b8ed3[_0x7306('0x2c')]);if(_0x4b8ed3[_0x7306('0x2d')]){delete _0x4b8ed3[_0x7306('0x2d')];}_0x237de5[_0x7306('0x1f')](_0x863b4)[_0x7306('0x2e')](_0x4b8ed3);};}exports['index']=function(_0x29f7d6,_0x4c952d){var _0x1f623a={},_0x557473={},_0x1954eb={'count':0x0,'rows':[]};var _0x441fe9=_[_0x7306('0x2f')](db[_0x7306('0x30')]['rawAttributes'],function(_0x4e6a54){return{'name':_0x4e6a54[_0x7306('0x31')],'type':_0x4e6a54[_0x7306('0x32')][_0x7306('0x33')]};});_0x557473[_0x7306('0x34')]=_[_0x7306('0x2f')](_0x441fe9,'name');_0x557473['query']=_['keys'](_0x29f7d6[_0x7306('0x35')]);_0x557473[_0x7306('0x36')]=_[_0x7306('0x37')](_0x557473[_0x7306('0x34')],_0x557473[_0x7306('0x35')]);_0x1f623a['attributes']=_[_0x7306('0x37')](_0x557473['model'],qs['fields'](_0x29f7d6['query'][_0x7306('0x38')]));_0x1f623a['attributes']=_0x1f623a[_0x7306('0x39')]['length']?_0x1f623a[_0x7306('0x39')]:_0x557473[_0x7306('0x34')];if(!_0x29f7d6[_0x7306('0x35')][_0x7306('0x3a')](_0x7306('0x3b'))){_0x1f623a[_0x7306('0x22')]=qs[_0x7306('0x22')](_0x29f7d6['query'][_0x7306('0x22')]);_0x1f623a[_0x7306('0x24')]=qs[_0x7306('0x24')](_0x29f7d6[_0x7306('0x35')][_0x7306('0x24')]);}_0x1f623a[_0x7306('0x3c')]=qs['sort'](_0x29f7d6[_0x7306('0x35')][_0x7306('0x3d')]);_0x1f623a[_0x7306('0x3e')]=qs[_0x7306('0x36')](_[_0x7306('0x3f')](_0x29f7d6[_0x7306('0x35')],_0x557473['filters']),_0x441fe9);if(_0x29f7d6[_0x7306('0x35')]['filter']){_0x1f623a[_0x7306('0x3e')]=_['merge'](_0x1f623a[_0x7306('0x3e')],{'$or':_[_0x7306('0x2f')](_0x441fe9,function(_0x4d86a4){if(_0x4d86a4[_0x7306('0x32')]!==_0x7306('0x40')){var _0x18535c={};_0x18535c[_0x4d86a4['name']]={'$like':'%'+_0x29f7d6[_0x7306('0x35')][_0x7306('0x41')]+'%'};return _0x18535c;}})});}_0x1f623a=_[_0x7306('0x42')]({},_0x1f623a,_0x29f7d6[_0x7306('0x43')]);var _0x39647f={'where':_0x1f623a[_0x7306('0x3e')]};return db['ChatTransferReport'][_0x7306('0x23')](_0x39647f)['then'](function(_0x39479e){_0x1954eb['count']=_0x39479e;if(_0x29f7d6['query'][_0x7306('0x44')]){_0x1f623a[_0x7306('0x45')]=[{'all':!![]}];}return db[_0x7306('0x30')][_0x7306('0x46')](_0x1f623a);})[_0x7306('0x29')](function(_0x4df175){_0x1954eb['rows']=_0x4df175;return _0x1954eb;})[_0x7306('0x29')](respondWithFilteredResult(_0x4c952d,_0x1f623a))[_0x7306('0x47')](handleError(_0x4c952d,null));};exports[_0x7306('0x48')]=function(_0x42fa55,_0x2fdaa3){var _0x44fb77={'raw':!![],'where':{'id':_0x42fa55[_0x7306('0x49')]['id']}},_0x2f7b14={};_0x2f7b14[_0x7306('0x34')]=_['keys'](db[_0x7306('0x30')]['rawAttributes']);_0x2f7b14['query']=_[_0x7306('0x4a')](_0x42fa55[_0x7306('0x35')]);_0x2f7b14[_0x7306('0x36')]=_[_0x7306('0x37')](_0x2f7b14['model'],_0x2f7b14['query']);_0x44fb77[_0x7306('0x39')]=_[_0x7306('0x37')](_0x2f7b14['model'],qs[_0x7306('0x38')](_0x42fa55[_0x7306('0x35')][_0x7306('0x38')]));_0x44fb77[_0x7306('0x39')]=_0x44fb77[_0x7306('0x39')][_0x7306('0x4b')]?_0x44fb77[_0x7306('0x39')]:_0x2f7b14['model'];if(_0x42fa55[_0x7306('0x35')][_0x7306('0x44')]){_0x44fb77['include']=[{'all':!![]}];}_0x44fb77=_[_0x7306('0x42')]({},_0x44fb77,_0x42fa55[_0x7306('0x43')]);return db[_0x7306('0x30')][_0x7306('0x4c')](_0x44fb77)['then'](handleEntityNotFound(_0x2fdaa3,null))[_0x7306('0x29')](respondWithResult(_0x2fdaa3,null))[_0x7306('0x47')](handleError(_0x2fdaa3,null));};exports[_0x7306('0x4d')]=function(_0x3f5bd6,_0x23ebed){return db[_0x7306('0x30')][_0x7306('0x4d')](_0x3f5bd6[_0x7306('0x4e')],{})[_0x7306('0x29')](respondWithResult(_0x23ebed,0xc9))['catch'](handleError(_0x23ebed,null));};exports[_0x7306('0x28')]=function(_0x4c219e,_0x5e8cc6){if(_0x4c219e['body']['id']){delete _0x4c219e['body']['id'];}return db[_0x7306('0x30')][_0x7306('0x4c')]({'where':{'id':_0x4c219e['params']['id']}})[_0x7306('0x29')](handleEntityNotFound(_0x5e8cc6,null))[_0x7306('0x29')](saveUpdates(_0x4c219e[_0x7306('0x4e')],null))['then'](respondWithResult(_0x5e8cc6,null))['catch'](handleError(_0x5e8cc6,null));};exports[_0x7306('0x2a')]=function(_0xce3ccb,_0x14418c){return db[_0x7306('0x30')][_0x7306('0x4c')]({'where':{'id':_0xce3ccb['params']['id']}})['then'](handleEntityNotFound(_0x14418c,null))[_0x7306('0x29')](removeEntity(_0x14418c,null))[_0x7306('0x47')](handleError(_0x14418c,null));};exports[_0x7306('0x4f')]=function(_0x11b353,_0x14299d){return db[_0x7306('0x30')][_0x7306('0x4f')]()['then'](respondWithResult(_0x14299d,null))[_0x7306('0x47')](handleError(_0x14299d,null));};
\ No newline at end of file
+var _0x8286=['show','params','rawAttributes','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','limit','count','Content-Range','reject','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0xf7ec9b,_0xefe7a3){var _0x519f33=function(_0x3764d2){while(--_0x3764d2){_0xf7ec9b['push'](_0xf7ec9b['shift']());}};_0x519f33(++_0xefe7a3);}(_0x8286,0x17b));var _0x6828=function(_0xeb6b88,_0x313a36){_0xeb6b88=_0xeb6b88-0x0;var _0x23d2ab=_0x8286[_0xeb6b88];return _0x23d2ab;};'use strict';var emlformat=require(_0x6828('0x0'));var rimraf=require(_0x6828('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6828('0x2'));var rp=require('request-promise');var moment=require(_0x6828('0x3'));var BPromise=require(_0x6828('0x4'));var Mustache=require(_0x6828('0x5'));var util=require(_0x6828('0x6'));var path=require(_0x6828('0x7'));var sox=require(_0x6828('0x8'));var csv=require(_0x6828('0x9'));var ejs=require(_0x6828('0xa'));var fs=require('fs');var fs_extra=require(_0x6828('0xb'));var _=require(_0x6828('0xc'));var squel=require('squel');var crypto=require(_0x6828('0xd'));var jsforce=require(_0x6828('0xe'));var deskjs=require(_0x6828('0xf'));var toCsv=require(_0x6828('0x9'));var querystring=require(_0x6828('0x10'));var Papa=require(_0x6828('0x11'));var Redis=require(_0x6828('0x12'));var authService=require(_0x6828('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6828('0x14'));var logger=require(_0x6828('0x15'))(_0x6828('0x16'));var utils=require('../../config/utils');var config=require(_0x6828('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6828('0x18'))['db'];function respondWithStatusCode(_0x266e5e,_0x1f44e5){_0x1f44e5=_0x1f44e5||0xcc;return function(_0x31e39c){if(_0x31e39c){return _0x266e5e['sendStatus'](_0x1f44e5);}return _0x266e5e[_0x6828('0x19')](_0x1f44e5)['end']();};}function respondWithResult(_0x11979a,_0x541c20){_0x541c20=_0x541c20||0xc8;return function(_0x463c75){if(_0x463c75){return _0x11979a[_0x6828('0x19')](_0x541c20)[_0x6828('0x1a')](_0x463c75);}};}function respondWithFilteredResult(_0x541537,_0x53fb85){return function(_0x520d5b){if(_0x520d5b){var _0x2d5f91=typeof _0x53fb85['offset']===_0x6828('0x1b')&&typeof _0x53fb85[_0x6828('0x1c')]==='undefined';var _0x4d1d8c=_0x520d5b[_0x6828('0x1d')];var _0x492365=_0x2d5f91?0x0:_0x53fb85['offset'];var _0x453ef1=_0x2d5f91?_0x520d5b['count']:_0x53fb85['offset']+_0x53fb85[_0x6828('0x1c')];var _0xdc4f1a;if(_0x453ef1>=_0x4d1d8c){_0x453ef1=_0x4d1d8c;_0xdc4f1a=0xc8;}else{_0xdc4f1a=0xce;}_0x541537['status'](_0xdc4f1a);return _0x541537['set'](_0x6828('0x1e'),_0x492365+'-'+_0x453ef1+'/'+_0x4d1d8c)[_0x6828('0x1a')](_0x520d5b);}return null;};}function patchUpdates(_0x72ff48){return function(_0x4d534e){try{jsonpatch['apply'](_0x4d534e,_0x72ff48,!![]);}catch(_0x2bf16d){return BPromise[_0x6828('0x1f')](_0x2bf16d);}return _0x4d534e['save']();};}function saveUpdates(_0x2cab6e,_0x2dddda){return function(_0x2ffe37){if(_0x2ffe37){return _0x2ffe37['update'](_0x2cab6e)[_0x6828('0x20')](function(_0x47c314){return _0x47c314;});}return null;};}function removeEntity(_0x58dc7b,_0xb4a764){return function(_0x4e197c){if(_0x4e197c){return _0x4e197c[_0x6828('0x21')]()[_0x6828('0x20')](function(){_0x58dc7b['status'](0xcc)[_0x6828('0x22')]();});}};}function handleEntityNotFound(_0x1200e4,_0x14de9b){return function(_0x1a32cc){if(!_0x1a32cc){_0x1200e4['sendStatus'](0x194);}return _0x1a32cc;};}function handleError(_0x515226,_0x66a9b9){_0x66a9b9=_0x66a9b9||0x1f4;return function(_0x28e279){logger[_0x6828('0x23')](_0x28e279[_0x6828('0x24')]);if(_0x28e279[_0x6828('0x25')]){delete _0x28e279[_0x6828('0x25')];}_0x515226['status'](_0x66a9b9)[_0x6828('0x26')](_0x28e279);};}exports[_0x6828('0x27')]=function(_0x4a1d53,_0x59e36a){var _0x920346={},_0xd87f9d={},_0xf60440={'count':0x0,'rows':[]};var _0x526c97=_[_0x6828('0x28')](db[_0x6828('0x29')]['rawAttributes'],function(_0x26eb3b){return{'name':_0x26eb3b[_0x6828('0x2a')],'type':_0x26eb3b[_0x6828('0x2b')][_0x6828('0x2c')]};});_0xd87f9d[_0x6828('0x2d')]=_[_0x6828('0x28')](_0x526c97,_0x6828('0x25'));_0xd87f9d[_0x6828('0x2e')]=_[_0x6828('0x2f')](_0x4a1d53[_0x6828('0x2e')]);_0xd87f9d[_0x6828('0x30')]=_[_0x6828('0x31')](_0xd87f9d[_0x6828('0x2d')],_0xd87f9d[_0x6828('0x2e')]);_0x920346[_0x6828('0x32')]=_[_0x6828('0x31')](_0xd87f9d[_0x6828('0x2d')],qs[_0x6828('0x33')](_0x4a1d53['query'][_0x6828('0x33')]));_0x920346[_0x6828('0x32')]=_0x920346[_0x6828('0x32')][_0x6828('0x34')]?_0x920346[_0x6828('0x32')]:_0xd87f9d[_0x6828('0x2d')];if(!_0x4a1d53[_0x6828('0x2e')]['hasOwnProperty']('nolimit')){_0x920346[_0x6828('0x1c')]=qs[_0x6828('0x1c')](_0x4a1d53['query'][_0x6828('0x1c')]);_0x920346['offset']=qs[_0x6828('0x35')](_0x4a1d53[_0x6828('0x2e')][_0x6828('0x35')]);}_0x920346[_0x6828('0x36')]=qs[_0x6828('0x37')](_0x4a1d53[_0x6828('0x2e')]['sort']);_0x920346[_0x6828('0x38')]=qs[_0x6828('0x30')](_[_0x6828('0x39')](_0x4a1d53[_0x6828('0x2e')],_0xd87f9d[_0x6828('0x30')]),_0x526c97);if(_0x4a1d53['query'][_0x6828('0x3a')]){_0x920346[_0x6828('0x38')]=_[_0x6828('0x3b')](_0x920346[_0x6828('0x38')],{'$or':_[_0x6828('0x28')](_0x526c97,function(_0x13b8d5){if(_0x13b8d5[_0x6828('0x2b')]!=='VIRTUAL'){var _0x16392e={};_0x16392e[_0x13b8d5[_0x6828('0x25')]]={'$like':'%'+_0x4a1d53[_0x6828('0x2e')][_0x6828('0x3a')]+'%'};return _0x16392e;}})});}_0x920346=_['merge']({},_0x920346,_0x4a1d53[_0x6828('0x3c')]);var _0x225d68={'where':_0x920346[_0x6828('0x38')]};return db['ChatTransferReport'][_0x6828('0x1d')](_0x225d68)[_0x6828('0x20')](function(_0x40320f){_0xf60440[_0x6828('0x1d')]=_0x40320f;if(_0x4a1d53[_0x6828('0x2e')][_0x6828('0x3d')]){_0x920346[_0x6828('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6828('0x3f')](_0x920346);})[_0x6828('0x20')](function(_0xbacc2b){_0xf60440[_0x6828('0x40')]=_0xbacc2b;return _0xf60440;})[_0x6828('0x20')](respondWithFilteredResult(_0x59e36a,_0x920346))['catch'](handleError(_0x59e36a,null));};exports[_0x6828('0x41')]=function(_0x152eed,_0x35df70){var _0xddbf59={'raw':!![],'where':{'id':_0x152eed[_0x6828('0x42')]['id']}},_0x5e5d75={};_0x5e5d75['model']=_[_0x6828('0x2f')](db['ChatTransferReport'][_0x6828('0x43')]);_0x5e5d75[_0x6828('0x2e')]=_['keys'](_0x152eed[_0x6828('0x2e')]);_0x5e5d75[_0x6828('0x30')]=_[_0x6828('0x31')](_0x5e5d75[_0x6828('0x2d')],_0x5e5d75['query']);_0xddbf59['attributes']=_[_0x6828('0x31')](_0x5e5d75[_0x6828('0x2d')],qs[_0x6828('0x33')](_0x152eed[_0x6828('0x2e')][_0x6828('0x33')]));_0xddbf59[_0x6828('0x32')]=_0xddbf59[_0x6828('0x32')]['length']?_0xddbf59[_0x6828('0x32')]:_0x5e5d75['model'];if(_0x152eed[_0x6828('0x2e')][_0x6828('0x3d')]){_0xddbf59[_0x6828('0x3e')]=[{'all':!![]}];}_0xddbf59=_[_0x6828('0x3b')]({},_0xddbf59,_0x152eed[_0x6828('0x3c')]);return db['ChatTransferReport'][_0x6828('0x44')](_0xddbf59)['then'](handleEntityNotFound(_0x35df70,null))[_0x6828('0x20')](respondWithResult(_0x35df70,null))[_0x6828('0x45')](handleError(_0x35df70,null));};exports[_0x6828('0x46')]=function(_0x5dbf75,_0x14ac38){return db[_0x6828('0x29')][_0x6828('0x46')](_0x5dbf75[_0x6828('0x47')],{})[_0x6828('0x20')](respondWithResult(_0x14ac38,0xc9))['catch'](handleError(_0x14ac38,null));};exports[_0x6828('0x48')]=function(_0x33614d,_0x11d0c0){if(_0x33614d[_0x6828('0x47')]['id']){delete _0x33614d[_0x6828('0x47')]['id'];}return db[_0x6828('0x29')]['find']({'where':{'id':_0x33614d[_0x6828('0x42')]['id']}})[_0x6828('0x20')](handleEntityNotFound(_0x11d0c0,null))[_0x6828('0x20')](saveUpdates(_0x33614d[_0x6828('0x47')],null))[_0x6828('0x20')](respondWithResult(_0x11d0c0,null))[_0x6828('0x45')](handleError(_0x11d0c0,null));};exports[_0x6828('0x21')]=function(_0x445dcf,_0x2e35ab){return db[_0x6828('0x29')][_0x6828('0x44')]({'where':{'id':_0x445dcf[_0x6828('0x42')]['id']}})[_0x6828('0x20')](handleEntityNotFound(_0x2e35ab,null))[_0x6828('0x20')](removeEntity(_0x2e35ab,null))[_0x6828('0x45')](handleError(_0x2e35ab,null));};exports[_0x6828('0x49')]=function(_0x2fdabb,_0x1f5ffa){return db[_0x6828('0x29')][_0x6828('0x49')]()[_0x6828('0x20')](respondWithResult(_0x1f5ffa,null))[_0x6828('0x45')](handleError(_0x1f5ffa,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e70b9eb..1c1a2e0 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 _0xd9a9=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x417b50,_0x35c440){var _0x493c22=function(_0x248018){while(--_0x248018){_0x417b50['push'](_0x417b50['shift']());}};_0x493c22(++_0x35c440);}(_0xd9a9,0xf6));var _0x9d9a=function(_0x2c0ede,_0x4c5d6f){_0x2c0ede=_0x2c0ede-0x0;var _0x4c0880=_0xd9a9[_0x2c0ede];return _0x4c0880;};'use strict';var _=require('lodash');var util=require(_0x9d9a('0x0'));var logger=require(_0x9d9a('0x1'))(_0x9d9a('0x2'));var moment=require(_0x9d9a('0x3'));var BPromise=require(_0x9d9a('0x4'));var rp=require(_0x9d9a('0x5'));var fs=require('fs');var path=require(_0x9d9a('0x6'));var rimraf=require(_0x9d9a('0x7'));var config=require(_0x9d9a('0x8'));var attributes=require(_0x9d9a('0x9'));module[_0x9d9a('0xa')]=function(_0x1aeab6,_0x2ed0b4){return _0x1aeab6[_0x9d9a('0xb')]('ChatTransferReport',attributes,{'tableName':_0x9d9a('0xc'),'paranoid':![],'indexes':[{'name':_0x9d9a('0xd'),'fields':[_0x9d9a('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f2c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x7054ce,_0x3a24ad){var _0x3670c2=function(_0x1abf0d){while(--_0x1abf0d){_0x7054ce['push'](_0x7054ce['shift']());}};_0x3670c2(++_0x3a24ad);}(_0x9f2c,0x1ba));var _0xc9f2=function(_0x347399,_0x42bbda){_0x347399=_0x347399-0x0;var _0x24e7be=_0x9f2c[_0x347399];return _0x24e7be;};'use strict';var _=require('lodash');var util=require(_0xc9f2('0x0'));var logger=require(_0xc9f2('0x1'))(_0xc9f2('0x2'));var moment=require(_0xc9f2('0x3'));var BPromise=require(_0xc9f2('0x4'));var rp=require(_0xc9f2('0x5'));var fs=require('fs');var path=require(_0xc9f2('0x6'));var rimraf=require(_0xc9f2('0x7'));var config=require(_0xc9f2('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2922dc,_0x490086){return _0x2922dc['define'](_0xc9f2('0x9'),attributes,{'tableName':_0xc9f2('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc9f2('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 70ff396..8ce40d6 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 _0x8f47=['then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x2eccc8,_0x29bee5){var _0x258cf4=function(_0x2f6f86){while(--_0x2f6f86){_0x2eccc8['push'](_0x2eccc8['shift']());}};_0x258cf4(++_0x29bee5);}(_0x8f47,0x6b));var _0x78f4=function(_0x59f670,_0x2a34aa){_0x59f670=_0x59f670-0x0;var _0x4ad264=_0x8f47[_0x59f670];return _0x4ad264;};'use strict';var _=require(_0x78f4('0x0'));var util=require(_0x78f4('0x1'));var moment=require('moment');var BPromise=require(_0x78f4('0x2'));var rs=require(_0x78f4('0x3'));var fs=require('fs');var Redis=require(_0x78f4('0x4'));var db=require(_0x78f4('0x5'))['db'];var utils=require(_0x78f4('0x6'));var logger=require(_0x78f4('0x7'))(_0x78f4('0x8'));var config=require('../../config/environment');var jayson=require(_0x78f4('0x9'));var client=jayson[_0x78f4('0xa')][_0x78f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53096d,_0x149515,_0x305f49){return new BPromise(function(_0x15efa7,_0x55541e){return client[_0x78f4('0xc')](_0x53096d,_0x305f49)[_0x78f4('0xd')](function(_0x4b371b){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x149515,_0x78f4('0xe'));logger[_0x78f4('0xf')](_0x78f4('0x10'),_0x149515,_0x78f4('0xe'),JSON[_0x78f4('0x11')](_0x4b371b));if(_0x4b371b[_0x78f4('0x12')]){if(_0x4b371b[_0x78f4('0x12')][_0x78f4('0x13')]===0x1f4){logger['error'](_0x78f4('0x14'),_0x149515,_0x4b371b['error'][_0x78f4('0x15')]);return _0x55541e(_0x4b371b['error'][_0x78f4('0x15')]);}logger['error'](_0x78f4('0x14'),_0x149515,_0x4b371b['error'][_0x78f4('0x15')]);return _0x15efa7(_0x4b371b[_0x78f4('0x12')]['message']);}else{logger[_0x78f4('0x16')](_0x78f4('0x14'),_0x149515,'request\x20sent');_0x15efa7(_0x4b371b[_0x78f4('0x17')][_0x78f4('0x15')]);}})['catch'](function(_0x25c284){logger['error'](_0x78f4('0x14'),_0x149515,_0x25c284);_0x55541e(_0x25c284);});});}
\ No newline at end of file
+var _0x6a95=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x486b5e,_0x2c0ef8){var _0x343b2c=function(_0x274039){while(--_0x274039){_0x486b5e['push'](_0x486b5e['shift']());}};_0x343b2c(++_0x2c0ef8);}(_0x6a95,0x105));var _0x56a9=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x6a95[_0x32d457];return _0x338386;};'use strict';var _=require(_0x56a9('0x0'));var util=require('util');var moment=require(_0x56a9('0x1'));var BPromise=require(_0x56a9('0x2'));var rs=require(_0x56a9('0x3'));var fs=require('fs');var Redis=require(_0x56a9('0x4'));var db=require(_0x56a9('0x5'))['db'];var utils=require(_0x56a9('0x6'));var logger=require(_0x56a9('0x7'))('rpc');var config=require(_0x56a9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x56a9('0x9')][_0x56a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3747e9,_0x4df9de,_0x3661de){return new BPromise(function(_0x2402f8,_0x403481){return client[_0x56a9('0xb')](_0x3747e9,_0x3661de)[_0x56a9('0xc')](function(_0x63c99c){logger[_0x56a9('0xd')](_0x56a9('0xe'),_0x4df9de,'request\x20sent');logger[_0x56a9('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4df9de,_0x56a9('0x10'),JSON[_0x56a9('0x11')](_0x63c99c));if(_0x63c99c[_0x56a9('0x12')]){if(_0x63c99c[_0x56a9('0x12')][_0x56a9('0x13')]===0x1f4){logger['error'](_0x56a9('0xe'),_0x4df9de,_0x63c99c['error'][_0x56a9('0x14')]);return _0x403481(_0x63c99c[_0x56a9('0x12')][_0x56a9('0x14')]);}logger[_0x56a9('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4df9de,_0x63c99c[_0x56a9('0x12')][_0x56a9('0x14')]);return _0x2402f8(_0x63c99c['error'][_0x56a9('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4df9de,_0x56a9('0x10'));_0x2402f8(_0x63c99c[_0x56a9('0x15')][_0x56a9('0x14')]);}})['catch'](function(_0xe29e76){logger[_0x56a9('0x12')](_0x56a9('0xe'),_0x4df9de,_0xe29e76);_0x403481(_0xe29e76);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 49ab5e0..ed52283 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 _0x1977=['show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/:id'];(function(_0x1227fd,_0x49d01f){var _0x2bba3f=function(_0x2e754a){while(--_0x2e754a){_0x1227fd['push'](_0x1227fd['shift']());}};_0x2bba3f(++_0x49d01f);}(_0x1977,0x141));var _0x7197=function(_0x13be32,_0x43266c){_0x13be32=_0x13be32-0x0;var _0x2a073b=_0x1977[_0x13be32];return _0x2a073b;};'use strict';var multer=require(_0x7197('0x0'));var util=require(_0x7197('0x1'));var path=require(_0x7197('0x2'));var timeout=require(_0x7197('0x3'));var express=require(_0x7197('0x4'));var router=express[_0x7197('0x5')]();var fs_extra=require(_0x7197('0x6'));var auth=require(_0x7197('0x7'));var interaction=require(_0x7197('0x8'));var config=require(_0x7197('0x9'));var controller=require(_0x7197('0xa'));router[_0x7197('0xb')]('/',auth[_0x7197('0xc')](),controller[_0x7197('0xd')]);router[_0x7197('0xb')]('/describe',auth[_0x7197('0xc')](),controller['describe']);router[_0x7197('0xb')](_0x7197('0xe'),auth['isAuthenticated'](),controller[_0x7197('0xf')]);router[_0x7197('0x10')]('/',auth[_0x7197('0xc')](),controller[_0x7197('0x11')]);router[_0x7197('0x12')]('/:id',auth[_0x7197('0xc')](),controller['update']);router['delete']('/:id',auth[_0x7197('0xc')](),controller[_0x7197('0x13')]);module[_0x7197('0x14')]=router;
\ No newline at end of file
+var _0x1a86=['/describe','describe','get','/:id','show','post','create','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated'];(function(_0x484780,_0xbbe226){var _0x2f6a92=function(_0x37e258){while(--_0x37e258){_0x484780['push'](_0x484780['shift']());}};_0x2f6a92(++_0xbbe226);}(_0x1a86,0x121));var _0x61a8=function(_0x2feae7,_0x4c7bf4){_0x2feae7=_0x2feae7-0x0;var _0x27ca97=_0x1a86[_0x2feae7];return _0x27ca97;};'use strict';var multer=require(_0x61a8('0x0'));var util=require('util');var path=require(_0x61a8('0x1'));var timeout=require(_0x61a8('0x2'));var express=require(_0x61a8('0x3'));var router=express[_0x61a8('0x4')]();var fs_extra=require(_0x61a8('0x5'));var auth=require(_0x61a8('0x6'));var interaction=require(_0x61a8('0x7'));var config=require(_0x61a8('0x8'));var controller=require(_0x61a8('0x9'));router['get']('/',auth[_0x61a8('0xa')](),controller['index']);router['get'](_0x61a8('0xb'),auth[_0x61a8('0xa')](),controller[_0x61a8('0xc')]);router[_0x61a8('0xd')](_0x61a8('0xe'),auth['isAuthenticated'](),controller[_0x61a8('0xf')]);router[_0x61a8('0x10')]('/',auth['isAuthenticated'](),controller[_0x61a8('0x11')]);router[_0x61a8('0x12')](_0x61a8('0xe'),auth[_0x61a8('0xa')](),controller[_0x61a8('0x13')]);router['delete'](_0x61a8('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index bfa5b21..478f145 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 _0x34e8=['Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','name','text','input','getDataValue','onlineForm','stringify','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','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'];(function(_0x5b7d4c,_0x336fd6){var _0x2d58d4=function(_0x512e38){while(--_0x512e38){_0x5b7d4c['push'](_0x5b7d4c['shift']());}};_0x2d58d4(++_0x336fd6);}(_0x34e8,0x12c));var _0x834e=function(_0x5e3bbd,_0x4e2c8a){_0x5e3bbd=_0x5e3bbd-0x0;var _0x16f6c2=_0x34e8[_0x5e3bbd];return _0x16f6c2;};'use strict';var Sequelize=require(_0x834e('0x0'));var rs=require(_0x834e('0x1'));module[_0x834e('0x2')]={'name':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x834e('0x4')},'description':{'type':Sequelize[_0x834e('0x3')]},'mapKey':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'key':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x834e('0x3')]},'animation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x834e('0xb')](_0x834e('0xc'),_0x834e('0xd')),'defaultValue':_0x834e('0xc')},'header_online':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0xf')},'offline_chat_button':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x10')},'download_transcript':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x13')},'noteTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x15')},'closingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x16')},'closingMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x17')},'skipMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x834e('0xb')](_0x834e('0x19'),'thumb'),'defaultValue':_0x834e('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x834e('0x1b'),'type':_0x834e('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x834e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x1f'))?JSON['parse'](this[_0x834e('0x1e')](_0x834e('0x1f'))):{};},'set':function(_0x5e1cc5){return this['setDataValue'](_0x834e('0x1f'),JSON['stringify'](_0x5e1cc5));}},'offlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON[_0x834e('0x20')]({'items':[{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x834e('0x5'),'type':_0x834e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x21'))?JSON[_0x834e('0x22')](this['getDataValue'](_0x834e('0x21'))):{};},'set':function(_0x11f1ce){return this[_0x834e('0x23')](_0x834e('0x21'),JSON[_0x834e('0x20')](_0x11f1ce));}},'token':{'type':Sequelize[_0x834e('0x3')],'defaultValue':function(){return rs[_0x834e('0x24')]();}},'autoclose':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x834e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x834e('0x3')]},'waitingTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x25')},'waitingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x27')},'offlineMessageBody':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x29')},'skipUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'sendUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return _0x834e('0x2a');}},'notificationSound':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2b')},'verticalAlignment':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2c')},'messagesAlignment':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x834e('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x834e('0x9')],'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[_0x834e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x834e('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x834e('0x9')],'comment':_0x834e('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![],'comment':_0x834e('0x2f'),'set':function(_0x574ea8){if(!_0x574ea8)this[_0x834e('0x23')](_0x834e('0x30'),null);this[_0x834e('0x23')]('mandatoryDisposition',_0x574ea8);}},'vidaooEscalation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x834e('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x834e('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xf4eb=['squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','text','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN'];(function(_0x2cf3b0,_0x4e6a14){var _0x29fd9c=function(_0x514c07){while(--_0x514c07){_0x2cf3b0['push'](_0x2cf3b0['shift']());}};_0x29fd9c(++_0x4e6a14);}(_0xf4eb,0xec));var _0xbf4e=function(_0x60403,_0x70a934){_0x60403=_0x60403-0x0;var _0x134abb=_0xf4eb[_0x60403];return _0x134abb;};'use strict';var Sequelize=require(_0xbf4e('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbf4e('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x2')},'mapKeyOffline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2')},'key':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x4')},'customerAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbf4e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbf4e('0x3')]},'animation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xbf4e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xc')},'download_transcript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xf')},'noteTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x12')},'conditionAgreement':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x13')},'ratingType':{'type':Sequelize[_0xbf4e('0x14')](_0xbf4e('0x15'),_0xbf4e('0x16')),'defaultValue':_0xbf4e('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':_0xbf4e('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xbf4e('0x1a'),'required':!![]},'props':{'title':_0xbf4e('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))?JSON['parse'](this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))):{};},'set':function(_0x3d6863){return this['setDataValue'](_0xbf4e('0x1d'),JSON['stringify'](_0x3d6863));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null},{'type':_0xbf4e('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0xbf4e('0x1f'),'helpText':_0xbf4e('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xbf4e('0x1c')]('offlineForm')?JSON[_0xbf4e('0x21')](this['getDataValue'](_0xbf4e('0x22'))):{};},'set':function(_0x1421e1){return this[_0xbf4e('0x23')]('offlineForm',JSON[_0xbf4e('0x18')](_0x1421e1));}},'token':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return rs[_0xbf4e('0x24')]();}},'autoclose':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbf4e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x25')},'waitingMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x27')},'enableCustomerAttachment':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbf4e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return _0xbf4e('0x28');}},'notificationSound':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x29')},'verticalAlignment':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2a')},'messagesAlignment':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2b')},'defaultTitle':{'type':Sequelize[_0xbf4e('0x3')]},'customerAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2d')},'systemAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbf4e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'comment':_0xbf4e('0x2e'),'set':function(_0x3aa308){if(!_0x3aa308)this[_0xbf4e('0x23')]('mandatoryDispositionPauseId',null);this[_0xbf4e('0x23')](_0xbf4e('0x2f'),_0x3aa308);}},'vidaooEscalation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbf4e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x30')},'vidaooNote':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index a380606..c7fe785 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 _0x425b=['ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','from','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','CmList','List','Contacts','ChatApplication','Applications','applications','list','orderBy','account','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','update','created','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','push','server/files/chat/iframe.ejs','remote','x-real-ip','connection','render','alignment','verticalAlignment','color','labelText','textColor','color_button','backgroundColor','IntervalId','addApplications','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','hasOwnProperty','chatProactiveAction','addProactiveActions','omit','getFields','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','destroy','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','query','keys','filters','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','sitepic','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425b,0x1b7));var _0xb425=function(_0x34e7d0,_0x156956){_0x34e7d0=_0x34e7d0-0x0;var _0x2b1800=_0x425b[_0x34e7d0];return _0x2b1800;};'use strict';var BPromise=require(_0xb425('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0xb425('0x1'));var fs=require('fs');var fs_extra=require(_0xb425('0x2'));var _=require(_0xb425('0x3'));var querystring=require(_0xb425('0x4'));var Redis=require(_0xb425('0x5'));var qs=require(_0xb425('0x6'));var logger=require('../../config/logger')(_0xb425('0x7'));var config=require(_0xb425('0x8'));var db=require(_0xb425('0x9'))['db'];config['redis']=_[_0xb425('0xa')](config[_0xb425('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb425('0xc'))(new Redis(config[_0xb425('0xb')]));require(_0xb425('0xd'))[_0xb425('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xb425('0xf'));var client=jayson['client'][_0xb425('0x10')]({'port':0x232c});var client9002=jayson['client'][_0xb425('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xb425('0x10')]({'port':0x232b});var client9001=jayson[_0xb425('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4903e9,_0x49d1b9,_0x520683,_0x1e966e){return new BPromise(function(_0xe778a8,_0x45c482){var _0x31eb72=_0x1e966e||client;return _0x31eb72[_0xb425('0x12')](_0x4903e9,_0x520683)[_0xb425('0x13')](function(_0x21c17b){logger[_0xb425('0x14')](_0xb425('0x15'),_0x49d1b9,_0xb425('0x16'));logger[_0xb425('0x17')](_0xb425('0x18'),_0x49d1b9,_0xb425('0x16'),JSON[_0xb425('0x19')](_0x21c17b));if(_0x21c17b[_0xb425('0x1a')]){if(_0x21c17b['error'][_0xb425('0x1b')]===0x1f4){logger[_0xb425('0x1a')](_0xb425('0x15'),_0x49d1b9,_0x21c17b[_0xb425('0x1a')][_0xb425('0x1c')]);return _0x45c482(_0x21c17b['error'][_0xb425('0x1c')]);}logger['error'](_0xb425('0x15'),_0x49d1b9,_0x21c17b[_0xb425('0x1a')]['message']);return _0xe778a8(_0x21c17b[_0xb425('0x1a')][_0xb425('0x1c')]);}else{logger[_0xb425('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x49d1b9,'request\x20sent');_0xe778a8(_0x21c17b[_0xb425('0x1d')][_0xb425('0x1c')]);}})[_0xb425('0x1e')](function(_0x1ad19e){logger[_0xb425('0x1a')](_0xb425('0x15'),_0x49d1b9,_0x1ad19e);_0x45c482(_0x1ad19e);});});}function respondWithStatusCode(_0x1884fe,_0x4d1bf1){_0x4d1bf1=_0x4d1bf1||0xcc;return function(_0x10c1a1){if(_0x10c1a1){return _0x1884fe[_0xb425('0x1f')](_0x4d1bf1);}return _0x1884fe['status'](_0x4d1bf1)['end']();};}function respondWithResult(_0x550fc0,_0x23ec8b){_0x23ec8b=_0x23ec8b||0xc8;return function(_0x156f74){if(_0x156f74){return _0x550fc0[_0xb425('0x20')](_0x23ec8b)['json'](_0x156f74);}};}function respondWithFilteredResult(_0x1a4156,_0x47e36a){return function(_0x4433db){if(_0x4433db){var _0x1d4531=typeof _0x47e36a[_0xb425('0x21')]===_0xb425('0x22')&&typeof _0x47e36a[_0xb425('0x23')]===_0xb425('0x22');var _0x154810=_0x4433db[_0xb425('0x24')];var _0x41000b=_0x1d4531?0x0:_0x47e36a[_0xb425('0x21')];var _0x2f2766=_0x1d4531?_0x4433db[_0xb425('0x24')]:_0x47e36a[_0xb425('0x21')]+_0x47e36a[_0xb425('0x23')];var _0xdf2c63;if(_0x2f2766>=_0x154810){_0x2f2766=_0x154810;_0xdf2c63=0xc8;}else{_0xdf2c63=0xce;}_0x1a4156[_0xb425('0x20')](_0xdf2c63);return _0x1a4156[_0xb425('0x25')](_0xb425('0x26'),_0x41000b+'-'+_0x2f2766+'/'+_0x154810)[_0xb425('0x27')](_0x4433db);}return null;};}function saveUpdates(_0x484b09){return function(_0x2a9994){if(_0x2a9994){return _0x2a9994['update'](_0x484b09)[_0xb425('0x13')](function(_0x3d58b4){return _0x3d58b4;});}return null;};}function removeEntity(_0x6777c0){return function(_0x2e9578){if(_0x2e9578){return _0x2e9578[_0xb425('0x28')]()[_0xb425('0x13')](function(){var _0x18ce8e=_0x2e9578['get']({'plain':!![]});var _0x52bb2b='ChatWebsites';return db[_0xb425('0x29')][_0xb425('0x28')]({'where':{'type':_0x52bb2b,'resourceId':_0x18ce8e['id']}})[_0xb425('0x13')](function(){return _0x2e9578;});})[_0xb425('0x13')](function(){_0x6777c0['status'](0xcc)[_0xb425('0x2a')]();});}};}function handleEntityNotFound(_0x5d3876){return function(_0x8f5ce){if(!_0x8f5ce){_0x5d3876[_0xb425('0x1f')](0x194);}return _0x8f5ce;};}function handleError(_0x3f9679,_0x166ac9){_0x166ac9=_0x166ac9||0x1f4;return function(_0xdf85b){logger[_0xb425('0x1a')](_0xdf85b[_0xb425('0x2b')]);if(_0xdf85b[_0xb425('0x2c')]){delete _0xdf85b[_0xb425('0x2c')];}_0x3f9679['status'](_0x166ac9)[_0xb425('0x2d')](_0xdf85b);};}exports[_0xb425('0x2e')]=function(_0xd18626,_0x54ad5f){var _0x315078={'include':[{'model':db[_0xb425('0x2f')],'as':_0xb425('0x30')}]},_0x7a0a2b={},_0x3dadfc={'count':0x0,'rows':[]};var _0x139c6b=_[_0xb425('0x31')](db[_0xb425('0x32')][_0xb425('0x33')],function(_0x439fba){return{'name':_0x439fba['fieldName'],'type':_0x439fba[_0xb425('0x34')]['key']};});_0x7a0a2b['model']=_[_0xb425('0x31')](_0x139c6b,'name');_0x7a0a2b[_0xb425('0x35')]=_[_0xb425('0x36')](_0xd18626[_0xb425('0x35')]);_0x7a0a2b[_0xb425('0x37')]=_['intersection'](_0x7a0a2b[_0xb425('0x38')],_0x7a0a2b['query']);_0x315078['attributes']=_['intersection'](_0x7a0a2b[_0xb425('0x38')],qs[_0xb425('0x39')](_0xd18626[_0xb425('0x35')][_0xb425('0x39')]));_0x315078[_0xb425('0x3a')]=_0x315078[_0xb425('0x3a')][_0xb425('0x3b')]?_0x315078['attributes']:_0x7a0a2b[_0xb425('0x38')];if(!_0xd18626['query']['hasOwnProperty'](_0xb425('0x3c'))){_0x315078['limit']=qs[_0xb425('0x23')](_0xd18626[_0xb425('0x35')][_0xb425('0x23')]);_0x315078[_0xb425('0x21')]=qs[_0xb425('0x21')](_0xd18626['query']['offset']);}_0x315078[_0xb425('0x3d')]=qs['sort'](_0xd18626['query'][_0xb425('0x3e')]);_0x315078['where']=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0xd18626[_0xb425('0x35')],_0x7a0a2b[_0xb425('0x37')]),_0x139c6b);if(_0xd18626[_0xb425('0x35')][_0xb425('0x40')]){_0x315078[_0xb425('0x41')]=_['merge'](_0x315078['where'],{'$or':_['map'](_0x139c6b,function(_0x2e5a88){if(_0x2e5a88[_0xb425('0x34')]!=='VIRTUAL'){var _0x2502c6={};_0x2502c6[_0x2e5a88['name']]={'$like':'%'+_0xd18626['query'][_0xb425('0x40')]+'%'};return _0x2502c6;}})});}_0x315078=_[_0xb425('0x42')]({},_0x315078,_0xd18626[_0xb425('0x43')]);var _0xd835d0={'where':_0x315078['where']};return db[_0xb425('0x32')]['count'](_0xd835d0)['then'](function(_0x3d6aaf){_0x3dadfc[_0xb425('0x24')]=_0x3d6aaf;if(_0xd18626[_0xb425('0x35')][_0xb425('0x44')]){_0x315078['include']=[{'all':!![]}];}return db[_0xb425('0x32')][_0xb425('0x45')](_0x315078);})[_0xb425('0x13')](function(_0x246370){_0x3dadfc[_0xb425('0x46')]=_0x246370;return _0x3dadfc;})[_0xb425('0x13')](respondWithFilteredResult(_0x54ad5f,_0x315078))['catch'](handleError(_0x54ad5f,null));};exports[_0xb425('0x47')]=function(_0x2e88eb,_0x5c0575){var _0x304129={'raw':![],'where':{'id':_0x2e88eb[_0xb425('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0xb425('0x30')}]},_0x9579={};_0x9579[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x32')][_0xb425('0x33')]);_0x9579['query']=_['keys'](_0x2e88eb[_0xb425('0x35')]);_0x9579['filters']=_[_0xb425('0x49')](_0x9579[_0xb425('0x38')],_0x9579['query']);_0x304129[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x9579[_0xb425('0x38')],qs[_0xb425('0x39')](_0x2e88eb['query'][_0xb425('0x39')]));_0x304129[_0xb425('0x3a')]=_0x304129[_0xb425('0x3a')]['length']?_0x304129[_0xb425('0x3a')]:_0x9579[_0xb425('0x38')];if(_0x2e88eb[_0xb425('0x35')]['includeAll']){_0x304129[_0xb425('0x4a')]=[{'all':!![]}];}_0x304129=_[_0xb425('0x42')]({},_0x304129,_0x2e88eb[_0xb425('0x43')]);return db['ChatWebsite']['find'](_0x304129)[_0xb425('0x13')](handleEntityNotFound(_0x5c0575,null))[_0xb425('0x13')](respondWithResult(_0x5c0575,null))[_0xb425('0x1e')](handleError(_0x5c0575,null));};exports[_0xb425('0x4b')]=function(_0x4c2443,_0x3328be){return db[_0xb425('0x32')][_0xb425('0x4b')](_0x4c2443[_0xb425('0x4c')],{})['then'](function(_0x352885){var _0x533536=_0x4c2443[_0xb425('0x4d')]['get']({'plain':!![]});if(!_0x533536)throw new Error(_0xb425('0x4e'));if(_0x533536[_0xb425('0x4f')]==='user'){var _0x387b15=_0x352885[_0xb425('0x50')]({'plain':!![]});var _0x10818f='ChatWebsites';return db[_0xb425('0x51')]['find']({'where':{'name':_0x10818f,'userProfileId':_0x533536[_0xb425('0x52')]},'raw':!![]})[_0xb425('0x13')](function(_0x27c6de){if(_0x27c6de&&_0x27c6de['autoAssociation']===0x0){return db[_0xb425('0x29')][_0xb425('0x4b')]({'name':_0x387b15[_0xb425('0x2c')],'resourceId':_0x387b15['id'],'type':_0x27c6de[_0xb425('0x2c')],'sectionId':_0x27c6de['id']},{})['then'](function(){return _0x352885;});}else{return _0x352885;}})[_0xb425('0x1e')](function(_0x432cc9){logger[_0xb425('0x1a')](_0xb425('0x53'),_0x432cc9);throw _0x432cc9;});}return _0x352885;})[_0xb425('0x13')](respondWithResult(_0x3328be,0xc9))[_0xb425('0x1e')](handleError(_0x3328be,null));};exports['update']=function(_0x40de51,_0x1d4226){if(_0x40de51[_0xb425('0x4c')]['id']){delete _0x40de51[_0xb425('0x4c')]['id'];}return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x40de51['params']['id']},'include':[{'model':db[_0xb425('0x2f')],'as':'mandatoryDispositionPause'}]})[_0xb425('0x13')](handleEntityNotFound(_0x1d4226,null))[_0xb425('0x13')](saveUpdates(_0x40de51[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0x1d4226,null))[_0xb425('0x1e')](handleError(_0x1d4226,null));};exports[_0xb425('0x28')]=function(_0x139bd2,_0x799d39){return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x139bd2[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x799d39,null))[_0xb425('0x13')](removeEntity(_0x799d39,null))[_0xb425('0x1e')](handleError(_0x799d39,null));};exports[_0xb425('0x55')]=function(_0x13661d,_0x3532d9){return db[_0xb425('0x32')][_0xb425('0x55')]()[_0xb425('0x13')](respondWithResult(_0x3532d9,null))[_0xb425('0x1e')](handleError(_0x3532d9,null));};exports['addDisposition']=function(_0x5c0fcc,_0x154444){if(_0x5c0fcc['body']['id']){delete _0x5c0fcc['body']['id'];}return db[_0xb425('0x32')]['find']({'where':{'id':_0x5c0fcc[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x154444,null))[_0xb425('0x13')](function(_0x311946){if(_0x311946){_0x5c0fcc['body'][_0xb425('0x56')]=_0x311946['id'];return db[_0xb425('0x57')][_0xb425('0x4b')](_0x5c0fcc[_0xb425('0x4c')]);}})[_0xb425('0x13')](respondWithResult(_0x154444,null))[_0xb425('0x1e')](handleError(_0x154444,null));};exports['getDispositions']=function(_0x566113,_0x241460){var _0x572152={'raw':![],'where':{}};var _0x12b788={};var _0x5c86d2={'count':0x0,'rows':[]};return db[_0xb425('0x32')][_0xb425('0x58')]({'where':{'id':_0x566113['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x241460,null))[_0xb425('0x13')](function(_0x30cad0){if(_0x30cad0){_0x12b788[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x57')][_0xb425('0x33')]);_0x12b788[_0xb425('0x35')]=_[_0xb425('0x36')](_0x566113[_0xb425('0x35')]);_0x12b788['filters']=_['intersection'](_0x12b788[_0xb425('0x38')],_0x12b788[_0xb425('0x35')]);_0x572152[_0xb425('0x3a')]=_['intersection'](_0x12b788[_0xb425('0x38')],qs[_0xb425('0x39')](_0x566113[_0xb425('0x35')][_0xb425('0x39')]));_0x572152[_0xb425('0x3a')]=_0x572152['attributes'][_0xb425('0x3b')]?_0x572152[_0xb425('0x3a')]:_0x12b788[_0xb425('0x38')];if(!_0x566113[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x572152[_0xb425('0x23')]=qs[_0xb425('0x23')](_0x566113[_0xb425('0x35')][_0xb425('0x23')]);_0x572152[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x566113[_0xb425('0x35')][_0xb425('0x21')]);}_0x572152[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x566113[_0xb425('0x35')][_0xb425('0x3e')]);_0x572152[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x566113[_0xb425('0x35')],_0x12b788[_0xb425('0x37')]));_0x572152[_0xb425('0x41')]['ChatWebsiteId']=_0x30cad0['id'];if(_0x566113[_0xb425('0x35')]['filter']){_0x572152[_0xb425('0x41')]=_['merge'](_0x572152['where'],{'$or':_[_0xb425('0x31')](_0x572152['attributes'],function(_0x15cb50){var _0x4e9175={};_0x4e9175[_0x15cb50]={'$like':'%'+_0x566113[_0xb425('0x35')]['filter']+'%'};return _0x4e9175;})});}_0x572152=_[_0xb425('0x42')]({},_0x572152,_0x566113[_0xb425('0x43')]);return db[_0xb425('0x57')][_0xb425('0x24')]({'where':_0x572152[_0xb425('0x41')]})[_0xb425('0x13')](function(_0x4329bb){_0x5c86d2[_0xb425('0x24')]=_0x4329bb;if(_0x566113['query'][_0xb425('0x44')]){_0x572152[_0xb425('0x4a')]=[{'all':!![]}];}return db['Disposition'][_0xb425('0x45')](_0x572152);})[_0xb425('0x13')](function(_0x74aafe){_0x5c86d2[_0xb425('0x46')]=_0x74aafe;return _0x5c86d2;});}})['then'](respondWithFilteredResult(_0x241460,_0x572152))['catch'](handleError(_0x241460,null));};exports[_0xb425('0x59')]=function(_0x368b9a,_0x240350){return db[_0xb425('0x32')]['find']({'where':{'id':_0x368b9a['params']['id']}})['then'](handleEntityNotFound(_0x240350,null))[_0xb425('0x13')](function(_0x45aecc){if(_0x45aecc){return _0x45aecc[_0xb425('0x59')](_0x368b9a[_0xb425('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x240350,null))[_0xb425('0x1e')](handleError(_0x240350,null));};exports[_0xb425('0x5a')]=function(_0x1087b2,_0x22d0aa){if(_0x1087b2[_0xb425('0x4c')]['id']){delete _0x1087b2[_0xb425('0x4c')]['id'];}return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x1087b2[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x22d0aa,null))[_0xb425('0x13')](function(_0x765474){if(_0x765474){_0x1087b2['body'][_0xb425('0x56')]=_0x765474['id'];return db[_0xb425('0x5b')][_0xb425('0x4b')](_0x1087b2[_0xb425('0x4c')]);}})[_0xb425('0x13')](respondWithResult(_0x22d0aa,null))[_0xb425('0x1e')](handleError(_0x22d0aa,null));};exports[_0xb425('0x5c')]=function(_0x7ea25e,_0x34d0e9){var _0x1b37af={'raw':![],'where':{}};var _0x5313c1={};var _0x3ecf32={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb425('0x58')]({'where':{'id':_0x7ea25e[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x34d0e9,null))[_0xb425('0x13')](function(_0x41c65c){if(_0x41c65c){_0x5313c1[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x5b')][_0xb425('0x33')]);_0x5313c1[_0xb425('0x35')]=_['keys'](_0x7ea25e[_0xb425('0x35')]);_0x5313c1[_0xb425('0x37')]=_[_0xb425('0x49')](_0x5313c1[_0xb425('0x38')],_0x5313c1[_0xb425('0x35')]);_0x1b37af[_0xb425('0x3a')]=_['intersection'](_0x5313c1[_0xb425('0x38')],qs[_0xb425('0x39')](_0x7ea25e['query'][_0xb425('0x39')]));_0x1b37af[_0xb425('0x3a')]=_0x1b37af[_0xb425('0x3a')][_0xb425('0x3b')]?_0x1b37af[_0xb425('0x3a')]:_0x5313c1[_0xb425('0x38')];if(!_0x7ea25e['query']['hasOwnProperty']('nolimit')){_0x1b37af['limit']=qs[_0xb425('0x23')](_0x7ea25e['query']['limit']);_0x1b37af[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x7ea25e['query'][_0xb425('0x21')]);}_0x1b37af[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x7ea25e[_0xb425('0x35')][_0xb425('0x3e')]);_0x1b37af[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x7ea25e['query'],_0x5313c1[_0xb425('0x37')]));_0x1b37af[_0xb425('0x41')][_0xb425('0x56')]=_0x41c65c['id'];if(_0x7ea25e[_0xb425('0x35')]['filter']){_0x1b37af[_0xb425('0x41')]=_[_0xb425('0x42')](_0x1b37af[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x1b37af[_0xb425('0x3a')],function(_0x27a2c5){var _0x1e4a87={};_0x1e4a87[_0x27a2c5]={'$like':'%'+_0x7ea25e['query'][_0xb425('0x40')]+'%'};return _0x1e4a87;})});}_0x1b37af=_['merge']({},_0x1b37af,_0x7ea25e[_0xb425('0x43')]);return db[_0xb425('0x5b')]['count']({'where':_0x1b37af[_0xb425('0x41')]})[_0xb425('0x13')](function(_0x5a88d0){_0x3ecf32[_0xb425('0x24')]=_0x5a88d0;if(_0x7ea25e[_0xb425('0x35')][_0xb425('0x44')]){_0x1b37af[_0xb425('0x4a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb425('0x45')](_0x1b37af);})['then'](function(_0x4dae0e){_0x3ecf32[_0xb425('0x46')]=_0x4dae0e;return _0x3ecf32;});}})[_0xb425('0x13')](respondWithFilteredResult(_0x34d0e9,_0x1b37af))[_0xb425('0x1e')](handleError(_0x34d0e9,null));};exports[_0xb425('0x5d')]=function(_0x1d9a9c,_0x46de7e){return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x1d9a9c[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x46de7e,null))[_0xb425('0x13')](function(_0x4b51bb){if(_0x4b51bb){return _0x4b51bb[_0xb425('0x5d')](_0x1d9a9c['query'][_0xb425('0x5e')]);}})[_0xb425('0x13')](respondWithStatusCode(_0x46de7e,null))[_0xb425('0x1e')](handleError(_0x46de7e,null));};exports[_0xb425('0x5f')]=function(_0x5a88d4,_0x9893e3){_0x5a88d4[_0xb425('0x4c')]['sitepic']=_0x5a88d4[_0xb425('0x60')][_0xb425('0x61')];return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x5a88d4[_0xb425('0x48')]['id']}})['then'](handleEntityNotFound(_0x9893e3,null))[_0xb425('0x13')](saveUpdates(_0x5a88d4[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0x9893e3,null))[_0xb425('0x1e')](handleError(_0x9893e3,null));};exports[_0xb425('0x62')]=function(_0x4f5e52,_0x481cd9){_0x4f5e52[_0xb425('0x4c')][_0xb425('0x63')]=_0x4f5e52[_0xb425('0x60')][_0xb425('0x61')];return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x4f5e52[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x481cd9,null))[_0xb425('0x13')](saveUpdates(_0x4f5e52[_0xb425('0x4c')],null))['then'](respondWithResult(_0x481cd9,null))['catch'](handleError(_0x481cd9,null));};exports['addCustomerAvatar']=function(_0x5d741a,_0xfaa3bb){_0x5d741a['body'][_0xb425('0x64')]=_0x5d741a[_0xb425('0x60')]['filename'];return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x5d741a[_0xb425('0x48')]['id']}})['then'](handleEntityNotFound(_0xfaa3bb,null))['then'](saveUpdates(_0x5d741a[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0xfaa3bb,null))[_0xb425('0x1e')](handleError(_0xfaa3bb,null));};exports['addSystemAvatar']=function(_0x245a02,_0x36cde2){_0x245a02[_0xb425('0x4c')]['systemAvatar']=_0x245a02[_0xb425('0x60')]['filename'];return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x245a02['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x36cde2,null))[_0xb425('0x13')](saveUpdates(_0x245a02[_0xb425('0x4c')],null))[_0xb425('0x13')](respondWithResult(_0x36cde2,null))[_0xb425('0x1e')](handleError(_0x36cde2,null));};exports[_0xb425('0x65')]=function(_0x226892,_0x2f2515){var _0x466605=path[_0xb425('0x66')](config['root'],_0xb425('0x67'));var _0x20ff51={'where':{'id':_0x226892[_0xb425('0x48')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x44028c=![];return require(_0xb425('0x68'))[_0xb425('0x69')]()[_0xb425('0x13')](function(_0x58ef39){if(_0x58ef39){_0x44028c=_0x58ef39[_0xb425('0x6a')];}})['then'](function(){return db[_0xb425('0x32')]['find'](_0x20ff51);})[_0xb425('0x13')](handleEntityNotFound(_0x2f2515,null))[_0xb425('0x13')](function(_0x21d887){if(_0x21d887){if(!_['isNil'](_0x21d887['sitepic'])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x6d'),_0x21d887[_0xb425('0x6e')]))&&_0x44028c){_0x466605=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x6d'),_0x21d887[_0xb425('0x6e')]);}}return _0x2f2515[_0xb425('0x6f')](_0x466605);}})[_0xb425('0x1e')](handleError(_0x2f2515,null));};exports['getAvatar']=function(_0x17659e,_0x3ea6c6){var _0x5a5607=path['join'](config[_0xb425('0x6c')],_0xb425('0x70'));var _0x1876cf={'where':{'id':_0x17659e['params']['id']},'attributes':['id',_0xb425('0x63')],'raw':!![]};return db['ChatWebsite'][_0xb425('0x54')](_0x1876cf)[_0xb425('0x13')](handleEntityNotFound(_0x3ea6c6,null))[_0xb425('0x13')](function(_0x4e933a){if(_0x4e933a){if(!_[_0xb425('0x71')](_0x4e933a[_0xb425('0x63')])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x4e933a[_0xb425('0x63')]))){_0x5a5607=path['join'](config[_0xb425('0x6c')],_0xb425('0x72'),_0x4e933a[_0xb425('0x63')]);}}return _0x3ea6c6[_0xb425('0x6f')](_0x5a5607);}})[_0xb425('0x1e')](handleError(_0x3ea6c6,null));};exports['getCustomerAvatar']=function(_0x390f13,_0x3b7123){var _0x2e8899=path['join'](config[_0xb425('0x6c')],_0xb425('0x73'));var _0x421b0d={'where':{'id':_0x390f13['params']['id']},'attributes':['id',_0xb425('0x64'),'showCustomerAvatar'],'raw':!![]};return db[_0xb425('0x32')]['find'](_0x421b0d)['then'](handleEntityNotFound(_0x3b7123,null))['then'](function(_0x295fcc){if(_0x295fcc){if(!_[_0xb425('0x71')](_0x295fcc[_0xb425('0x64')])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x295fcc[_0xb425('0x64')]))&&_0x295fcc[_0xb425('0x74')]){_0x2e8899=path[_0xb425('0x66')](config['root'],_0xb425('0x72'),_0x295fcc[_0xb425('0x64')]);}}return _0x3b7123[_0xb425('0x6f')](_0x2e8899);}})[_0xb425('0x1e')](handleError(_0x3b7123,null));};exports['getSystemAvatar']=function(_0x9295ca,_0x54eacc){var _0x113b90=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x75'));var _0x4a37ad={'where':{'id':_0x9295ca['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb425('0x32')][_0xb425('0x54')](_0x4a37ad)[_0xb425('0x13')](handleEntityNotFound(_0x54eacc,null))['then'](function(_0x612912){if(_0x612912){if(!_[_0xb425('0x71')](_0x612912[_0xb425('0x76')])){if(fs[_0xb425('0x6b')](path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x612912[_0xb425('0x76')]))){_0x113b90=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0x72'),_0x612912['systemAvatar']);}}return _0x54eacc['download'](_0x113b90);}})['catch'](handleError(_0x54eacc,null));};exports['notify']=function(_0x3fe7ce,_0x556e32){var _0x90bc29=require(_0xb425('0x77'));var _0x5695c7=new _0x90bc29();var _0x547928=_0x5695c7[_0xb425('0x78')](_0x3fe7ce[_0xb425('0x79')][_0xb425('0x7a')])[_0xb425('0x7b')]();var _0x2cf1e2={'body':_0x3fe7ce[_0xb425('0x4c')],'channel':_0xb425('0x7c')};var _0x248884=[];var _0xbc92ff=[];var _0x1c1649={};var _0x3ed658=![];return db[_0xb425('0x7d')]['describe']()['then'](function(_0x1dc3f9){if(!_0x1dc3f9){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))]('no\x20available\x20attributes');}_0x248884=_['difference'](_['keys'](_0x1dc3f9),['createdAt',_0xb425('0x80')]);_0xbc92ff=_[_0xb425('0x81')](_[_0xb425('0x36')](_0x1dc3f9),[_0xb425('0x82'),'updatedAt',_0xb425('0x83'),_0xb425('0x84')]);if(_0x3fe7ce[_0xb425('0x4c')]['id']){delete _0x3fe7ce[_0xb425('0x4c')]['id'];}if(_['isNil'](_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')])){throw new db['Sequelize']['ValidationError'](_0xb425('0x86'));}if(_[_0xb425('0x71')](_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x4c')])||_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x4c')]===''){throw new db[(_0xb425('0x7e'))]['ValidationError'](_0xb425('0x87'));}if(_[_0xb425('0x71')](_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x88')])){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))](_0xb425('0x89')+_0xbc92ff);}if(!_[_0xb425('0x8a')](_0xbc92ff,_0x3fe7ce['body'][_0xb425('0x88')])){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))](_0xb425('0x8b')+_0xbc92ff);}_0x1c1649[_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x88')]]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')];})[_0xb425('0x13')](function(){return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x3fe7ce[_0xb425('0x48')]['id']},'include':[{'model':db[_0xb425('0x8c')],'as':_0xb425('0x8d'),'include':[{'model':db['CmContact'],'as':_0xb425('0x8e'),'where':_0x1c1649,'limit':0x1,'order':[[_0xb425('0x80'),'DESC']]}]},{'model':db[_0xb425('0x8f')],'as':_0xb425('0x90')}]});})[_0xb425('0x13')](handleEntityNotFound(_0x556e32,null))[_0xb425('0x13')](function(_0xc36932){if(_0xc36932&&_0xc36932['List']){_0x2cf1e2['account']=_0xc36932;_0x2cf1e2[_0xb425('0x91')]=_0xc36932[_0xb425('0x90')];_0x2cf1e2[_0xb425('0x92')]=_0xc36932[_0xb425('0x8d')];_0x2cf1e2[_0xb425('0x91')]=_[_0xb425('0x93')](_0x2cf1e2[_0xb425('0x91')],['priority'],['asc']);if(_0x2cf1e2['account']['Applications']){delete _0x2cf1e2['account'][_0xb425('0x90')];}if(_0x2cf1e2['account'][_0xb425('0x8d')]&&_0x2cf1e2[_0xb425('0x94')][_0xb425('0x8d')][_0xb425('0x8e')][_0xb425('0x3b')]){return _0x2cf1e2[_0xb425('0x94')][_0xb425('0x8d')]['Contacts'][0x0];}var _0x2080c5=_[_0xb425('0xa')](_0x3fe7ce[_0xb425('0x4c')],{'firstName':_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')],'ListId':_0xc36932[_0xb425('0x84')]});_0x2080c5[_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x88')]]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x85')];return db[_0xb425('0x7d')][_0xb425('0x4b')](_0x2080c5,{'fields':_0x248884,'raw':!![]});}})['then'](handleEntityNotFound(_0x556e32,null))[_0xb425('0x13')](function(_0x55c5fd){_0x2cf1e2[_0xb425('0x95')]=_0x55c5fd;var _0x59a6c0=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0x96')];if(_0x3fe7ce[_0xb425('0x79')][_0xb425('0x97')]){_0x59a6c0=_0x3fe7ce[_0xb425('0x79')][_0xb425('0x97')];}else if(_0x3fe7ce['headers']['x-forwarded-for']){_0x59a6c0=_[_0xb425('0x98')](_0x3fe7ce[_0xb425('0x79')][_0xb425('0x99')][_0xb425('0x9a')](','));}if(_0x55c5fd){var _0x3f1a66={'ContactId':_0x55c5fd['id'],'ChatWebsiteId':_0x3fe7ce[_0xb425('0x48')]['id'],'from':(_0x55c5fd[_0xb425('0x9b')]||'')+'\x20'+(_0x55c5fd[_0xb425('0x9c')]||''),'customerIp':_0x59a6c0,'customerPort':_0x3fe7ce[_0xb425('0x79')][_0xb425('0x9d')]?_0x3fe7ce[_0xb425('0x79')][_0xb425('0x9d')]:null,'referer':_0x3fe7ce['body'][_0xb425('0x9e')],'browserName':_0x547928[_0xb425('0x9f')][_0xb425('0x2c')]&&_0x547928[_0xb425('0x9f')][_0xb425('0xa0')]?util[_0xb425('0xa1')]('%s\x20%s',_0x547928['browser'][_0xb425('0x2c')],_0x547928[_0xb425('0x9f')][_0xb425('0xa0')]):_0xb425('0xa2'),'browserVersion':_0x547928['browser'][_0xb425('0xa0')]||_0xb425('0xa2'),'osName':util[_0xb425('0xa1')](_0xb425('0xa3'),_0x547928['os'][_0xb425('0x2c')],_0x547928['os'][_0xb425('0xa0')]),'osVersion':_0x547928['os'][_0xb425('0xa0')],'deviceModel':_0x547928[_0xb425('0xa4')][_0xb425('0x38')]&&_0x547928[_0xb425('0xa4')]['vendor']?util[_0xb425('0xa1')](_0xb425('0xa5'),_0x547928[_0xb425('0xa4')][_0xb425('0x38')],_0x547928['device'][_0xb425('0xa6')],_0x547928[_0xb425('0xa4')]['type']):null,'deviceVendor':_0x547928[_0xb425('0xa4')][_0xb425('0xa6')],'deviceType':_0x547928[_0xb425('0xa4')][_0xb425('0x34')],'formData':JSON[_0xb425('0x19')](_0x3fe7ce['body'])};var _0x152bb4={'ChatWebsiteId':_0x3fe7ce[_0xb425('0x48')]['id'],'closed':![]};if(_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')]){_0x152bb4[_0xb425('0xa7')]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')];return db['ChatInteraction'][_0xb425('0x54')]({'where':_0x152bb4})[_0xb425('0x13')](function(_0x34e9ce){if(_0x34e9ce){return[_0x34e9ce,![]];}_0x3f1a66[_0xb425('0xa7')]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')];_0x3f1a66[_0xb425('0xa8')]=_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa8')];return db[_0xb425('0xa9')][_0xb425('0x4b')](_0x3f1a66)[_0xb425('0x13')](function(_0x1cc010){return[_0x1cc010,!![]];});});}_0x152bb4[_0xb425('0xaa')]=_0x55c5fd['id'];if(_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xab')]&&_0x3fe7ce['body'][_0xb425('0xab')]['id']){_0x152bb4['id']=_0x3fe7ce['body'][_0xb425('0xab')]['id'];return db[_0xb425('0xa9')][_0xb425('0x54')]({'where':_0x152bb4})[_0xb425('0x13')](function(_0x5f1a23){if(_0x5f1a23){return[_0x5f1a23,![]];}return db['ChatInteraction'][_0xb425('0x4b')](_0x3f1a66)[_0xb425('0x13')](function(_0x6c3ccd){return[_0x6c3ccd,!![]];});});}return db[_0xb425('0xa9')][_0xb425('0x4b')](_0x3f1a66)[_0xb425('0x13')](function(_0x13be6d){return[_0x13be6d,!![]];});}})[_0xb425('0xac')](function(_0x53247b,_0x7c1ad5){if(_0x53247b){_0x3ed658=_0x7c1ad5;if(!_0x7c1ad5){var _0x2c4a3f={'from':(_0x2cf1e2[_0xb425('0x95')][_0xb425('0x9b')]||'')+'\x20'+(_0x2cf1e2[_0xb425('0x95')][_0xb425('0x9c')]||'')};if(_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xa7')]&&_0x3fe7ce[_0xb425('0x4c')]['messageId']&&_0x3fe7ce[_0xb425('0x4c')]['threadId']!=_0x3fe7ce[_0xb425('0x4c')]['messageId']){_0x2c4a3f[_0xb425('0xa7')]=_0x3fe7ce[_0xb425('0x4c')]['messageId'];}return _0x53247b[_0xb425('0xad')](_0x2c4a3f);}else{return _0x53247b;}}})[_0xb425('0x13')](function(_0x290e18){_0x2cf1e2[_0xb425('0xab')]=_0x290e18[_0xb425('0x50')]({'plain':!![]});_0x2cf1e2[_0xb425('0xab')][_0xb425('0xae')]=_0x3ed658;if(_0x2cf1e2['interaction'][_0xb425('0xae')]){if(_0x2cf1e2['account']['autoclose']){_0x2cf1e2['applications']['push']({'id':0x0,'priority':_0x2cf1e2[_0xb425('0x91')][_0xb425('0x3b')]+0x1,'app':'close','appdata':_0xb425('0xaf'),'interval':_0xb425('0xb0')});}}return db['ChatMessage'][_0xb425('0x4b')]({'body':_0x3fe7ce[_0xb425('0x4c')]['body'],'ChatWebsiteId':_0x3fe7ce[_0xb425('0x48')]['id'],'ChatInteractionId':_0x290e18['id'],'direction':'in','ContactId':_0x2cf1e2[_0xb425('0x95')]['id'],'AttachmentId':_0x3fe7ce[_0xb425('0x4c')][_0xb425('0xb1')]});})[_0xb425('0x13')](function(_0x4044ff){_0x2cf1e2['message']=_0x4044ff;if(_0x2cf1e2[_0xb425('0xab')]['UserId']){return db[_0xb425('0xb2')][_0xb425('0x54')]({'attributes':['id',_0xb425('0x2c')],'where':{'id':_0x2cf1e2[_0xb425('0xab')]['UserId']}})[_0xb425('0x13')](function(_0x5549be){if(_0x5549be){_0x2cf1e2[_0xb425('0x91')][_0xb425('0xb3')]({'id':0x0,'priority':0x0,'app':_0xb425('0xb4'),'appdata':_0x5549be[_0xb425('0x2c')]+','+(_0x2cf1e2[_0xb425('0x94')]['waitForTheAssignedAgent']||0xa),'interval':_0xb425('0xb0')});_0x2cf1e2[_0xb425('0xb5')]=!![];}return respondWithRpcPromise(_0xb425('0xb6'),_0xb425('0xb7'),_0x2cf1e2);});}return respondWithRpcPromise(_0xb425('0xb6'),'startRouting',_0x2cf1e2);})[_0xb425('0x13')](function(_0x67b0e6){respondWithRpcPromise(_0xb425('0xb8'),_0xb425('0xb8'),{'event':'notify','message':_0x67b0e6},client9002);return _0x67b0e6;})[_0xb425('0x13')](respondWithResult(_0x556e32,null))[_0xb425('0x1e')](handleError(_0x556e32,null));};exports['offline']=function(_0x14c951,_0x384903){var _0x19b5be,_0x5ea4d4,_0x23a9fc;var _0x5888ea=[];var _0x5356ad={};var _0x57fe59=_0x14c951[_0xb425('0xb9')]||[];var _0x136559=[];var _0x432094;return db[_0xb425('0x7d')][_0xb425('0x55')]()[_0xb425('0x13')](function(_0x1099b0){if(!_0x1099b0){throw new db[(_0xb425('0x7e'))][(_0xb425('0x7f'))](_0xb425('0xba'));}_0x5888ea=_[_0xb425('0x81')](_[_0xb425('0x36')](_0x1099b0),['createdAt','updatedAt',_0xb425('0x83'),'ListId']);if(_0x14c951[_0xb425('0x4c')]['id']){delete _0x14c951[_0xb425('0x4c')]['id'];}if(_[_0xb425('0x71')](_0x14c951[_0xb425('0x4c')][_0xb425('0x85')])){throw _0x384903[_0xb425('0x20')](0x1f4)[_0xb425('0x2d')](new db['Sequelize'][(_0xb425('0x7f'))](_0xb425('0x86')));}if(_[_0xb425('0x71')](_0x14c951['body'][_0xb425('0x4c')])||_0x14c951['body']['body']===''){throw _0x384903[_0xb425('0x20')](0x1f4)[_0xb425('0x2d')](new db['Sequelize']['ValidationError'](_0xb425('0x87')));}if(_['isNil'](_0x14c951[_0xb425('0x4c')][_0xb425('0xbb')])){throw _0x384903['status'](0x1f4)[_0xb425('0x2d')](new db['Sequelize'][(_0xb425('0x7f'))](_0xb425('0xbc')+_0x5888ea));}if(!_[_0xb425('0x8a')](_0x5888ea,_0x14c951['body']['mapKeyOffline'])){throw _0x384903['status'](0x1f4)[_0xb425('0x2d')](new db[(_0xb425('0x7e'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5888ea));}_0x5356ad[_0x14c951['body']['mapKeyOffline']]=_0x14c951['body'][_0xb425('0x85')];})[_0xb425('0x13')](function(){return db[_0xb425('0x32')]['find']({'where':{'id':_0x14c951[_0xb425('0x48')]['id']},'include':[{'model':db[_0xb425('0x8c')],'as':_0xb425('0x8d')},{'model':db[_0xb425('0xbd')],'as':_0xb425('0xbd')}]});})[_0xb425('0x13')](handleEntityNotFound(_0x384903,null))[_0xb425('0x13')](function(_0x2d5955){if(_0x2d5955&&_0x2d5955[_0xb425('0x8d')]){_0x5ea4d4=_0x2d5955;var _0x3391c7=_[_0xb425('0xa')](_0x14c951[_0xb425('0x4c')],{'firstName':_0x14c951['body'][_0xb425('0x85')],'phone':_0x14c951['body'][_0xb425('0x85')],'ListId':_0x2d5955['ListId']});_0x3391c7[_0x14c951[_0xb425('0x4c')][_0xb425('0xbb')]]=_0x14c951[_0xb425('0x4c')][_0xb425('0x85')];return db[_0xb425('0x7d')][_0xb425('0xbe')]({'where':_0x5356ad,'defaults':_0x3391c7});}})[_0xb425('0xac')](function(_0x17a707){if(_0x17a707){_0x23a9fc=_0x17a707;var _0x4150a5=fs[_0xb425('0xbf')](path[_0xb425('0x66')](config[_0xb425('0x6c')],'server/files/templates/chatOfflineMessage.ejs'),_0xb425('0xc0'));var _0x393699=ejs['render'](_0x4150a5,{'body':_[_0xb425('0xc1')](_0x14c951['body'][_0xb425('0x4c')]),'bodyTitle':_0x5ea4d4[_0xb425('0xc2')]});return db[_0xb425('0xc3')][_0xb425('0x4b')]({'body':_0x393699,'plainBody':htmlToText[_0xb425('0xc4')](_0x393699),'ContactId':_0x17a707['id'],'ChatWebsiteId':_0x5ea4d4['id']});}})[_0xb425('0x13')](function(_0x493dae){_0x432094=_0x493dae;if(_0x57fe59['length']){var _0x2296f0=_0x57fe59[_0xb425('0x31')](function(_0x32b4af){return{'name':_0x32b4af[_0xb425('0xc5')],'basename':_0x32b4af[_0xb425('0x61')],'type':_0x32b4af[_0xb425('0xc6')],'ChatOfflineMessageId':_0x493dae['id']};});_0x136559=_0x2296f0[_0xb425('0x31')](_0x36bad9=>{var _0x42b475={'filename':_0x36bad9[_0xb425('0x2c')],'path':path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0xc7'),_0xb425('0xb9'),_0xb425('0xc8'),_0xb425('0xc9'),_0x36bad9[_0xb425('0xca')])};return _0x42b475;});if(!_0x5ea4d4[_0xb425('0xcb')]){return db[_0xb425('0xcc')][_0xb425('0xcd')](function(_0x6c2b59){return db[_0xb425('0xce')][_0xb425('0xcf')](_0x2296f0,{'transaction':_0x6c2b59});});}}})[_0xb425('0x13')](function(){if(_0x432094){_0x19b5be=_0x432094;return db[_0xb425('0xbd')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xb425('0xd0')],'as':_0xb425('0xd1'),'raw':!![],'include':[{'model':db[_0xb425('0xd2')],'as':_0xb425('0xd2'),'raw':!![]}]}]});}})[_0xb425('0x13')](function(_0x5eed23){if(_0x5eed23&&_0x5eed23['Smtp']&&_0x5ea4d4[_0xb425('0xd3')]&&_0x5ea4d4['forwardOfflineAddress']){var _0x415e2f=_0x5eed23['getSmtpOptions']();return respondWithRpcPromise(_0xb425('0xd4'),'sendMail',{'account':_0x415e2f,'message':{'from':util[_0xb425('0xa1')]('\x22%s\x22\x20<%s>',_0x5eed23[_0xb425('0x2c')],_0x5eed23[_0xb425('0xd5')]||_0x5eed23[_0xb425('0xd1')][_0xb425('0x4d')]),'to':_0x5ea4d4[_0xb425('0xd6')],'subject':_0x5ea4d4[_0xb425('0xd7')],'html':_0x19b5be[_0xb425('0x4c')],'attachments':_0x136559}},client9003)[_0xb425('0x13')](function(){return _0x19b5be;})['catch'](function(_0x5ce87d){logger[_0xb425('0x1a')](_0x5ce87d);});}})[_0xb425('0x13')](function(){if(_0x5ea4d4&&_0x5ea4d4['openNewInteraction']&&_0x5ea4d4[_0xb425('0xd8')]){var _0x29fc55=[];if(_0x57fe59[_0xb425('0x3b')]){_0x29fc55=_0x57fe59[_0xb425('0x31')](function(_0x21db27){return{'name':_0x21db27[_0xb425('0xc5')],'basename':_0x21db27[_0xb425('0x61')],'type':_0x21db27[_0xb425('0xc6')],'ChatOfflineMessageId':_0x432094['id']};});}var _0x1f7830;if(!_[_0xb425('0x71')](_0x5ea4d4[_0xb425('0xd9')])){var _0x1194bc=_[_0xb425('0x31')](_0x14c951['body'],function(_0x5e7bac){return _0x5e7bac;});var _0x18dc91=_['toPairsIn'](_0x1194bc)[0x0];var _0x40ce7b=_['mapValues'](_0x18dc91,function(_0x440089){return _0x440089;});_0x1f7830=_0x40ce7b[0x1][_0x5ea4d4['subjectOffline']];}var _0xe81d18={'from':_0x23a9fc[_0xb425('0xd5')],'firstName':_0x23a9fc[_0xb425('0x9b')],'lastName':_0x23a9fc[_0xb425('0x9c')],'mapKey':'email','message':{'from':_0x23a9fc['email'],'to':_0x5ea4d4[_0xb425('0xbd')]['email'],'cc':'','subject':_[_0xb425('0x71')](_0x1f7830)?_0x5ea4d4['offlineMessageSubject']:_0x1f7830,'messageId':'','sentAt':new Date(),'attach':_0x29fc55[_0xb425('0x3b')],'attachments':_0x29fc55,'originChannel':_0xb425('0xda'),'ChatWebsiteId':_0x5ea4d4['id'],'ChatOfflineMessageId':_0x19b5be['id'],'originTo':_0x5ea4d4[_0xb425('0xbd')][_0xb425('0xd5')]},'body':_0x19b5be[_0xb425('0x4c')]};var _0x1ca9b7={'account':{'id':_0x5ea4d4[_0xb425('0xd8')]},'body':_0xe81d18,'log':_0xb425('0xdb')};return respondWithRpcPromise(_0xb425('0xdb'),_0xb425('0xdc'),_0x1ca9b7,client9001)[_0xb425('0x13')](function(){return _0x19b5be;})[_0xb425('0x1e')](function(_0x2f01ba){logger['error'](_0x2f01ba);});}return;})['then'](function(){if(_0x19b5be){return _0x19b5be;}})[_0xb425('0x13')](respondWithResult(_0x384903,null))[_0xb425('0x1e')](function(_0x2f0130){logger['error']('catch',_0x2f0130);for(var _0x243eac of _0x57fe59){var _0x52375e=path[_0xb425('0x66')](config[_0xb425('0x6c')],_0xb425('0xc7'),_0xb425('0xb9'),_0xb425('0xc8'),_0xb425('0xc9'),_0x243eac['filename']);fs_extra[_0xb425('0xdd')](_0x52375e)[_0xb425('0x1e')](function(_0x3d1c0c){logger['error'](_0xb425('0xde'),_0x52375e,_0x3d1c0c);});}});};exports[_0xb425('0xdf')]=function(_0x273a7a,_0x59ff52){return db[_0xb425('0xa9')]['find']({'where':{'id':_0x273a7a['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x59ff52,null))[_0xb425('0x13')](function(_0x14dd53){if(_0x14dd53){return _0x14dd53[_0xb425('0xdf')](_0x273a7a[_0xb425('0x4c')][_0xb425('0x5e')],_['omit'](_0x273a7a[_0xb425('0x4c')],[_0xb425('0x5e'),'id'])||{});}})[_0xb425('0x13')](respondWithResult(_0x59ff52,null))[_0xb425('0x1e')](handleError(_0x59ff52,null));};exports[_0xb425('0xe0')]=function(_0x573873,_0x370c06){var _0x55bec6={'raw':![],'where':{}};var _0x2db934={};var _0x4131f0={'count':0x0,'rows':[]};return db[_0xb425('0x32')][_0xb425('0x58')]({'where':{'id':_0x573873['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x370c06,null))[_0xb425('0x13')](function(_0x55bbad){if(_0x55bbad){_0x2db934[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0xa9')][_0xb425('0x33')]);_0x2db934[_0xb425('0x35')]=_['keys'](_0x573873[_0xb425('0x35')]);_0x2db934[_0xb425('0x37')]=_['intersection'](_0x2db934[_0xb425('0x38')],_0x2db934[_0xb425('0x35')]);_0x55bec6[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x2db934[_0xb425('0x38')],qs['fields'](_0x573873[_0xb425('0x35')][_0xb425('0x39')]));_0x55bec6[_0xb425('0x3a')]=_0x55bec6[_0xb425('0x3a')][_0xb425('0x3b')]?_0x55bec6[_0xb425('0x3a')]:_0x2db934[_0xb425('0x38')];if(!_0x573873[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x55bec6['limit']=qs[_0xb425('0x23')](_0x573873[_0xb425('0x35')][_0xb425('0x23')]);_0x55bec6[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x573873[_0xb425('0x35')]['offset']);}_0x55bec6[_0xb425('0x3d')]=qs['sort'](_0x573873[_0xb425('0x35')][_0xb425('0x3e')]);_0x55bec6[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x573873[_0xb425('0x35')],_0x2db934['filters']));_0x55bec6[_0xb425('0x41')][_0xb425('0x56')]=_0x55bbad['id'];if(_0x573873['query'][_0xb425('0x40')]){_0x55bec6[_0xb425('0x41')]=_[_0xb425('0x42')](_0x55bec6['where'],{'$or':_['map'](_0x55bec6[_0xb425('0x3a')],function(_0x4491b0){var _0x3da31c={};_0x3da31c[_0x4491b0]={'$like':'%'+_0x573873['query']['filter']+'%'};return _0x3da31c;})});}_0x55bec6=_[_0xb425('0x42')]({},_0x55bec6,_0x573873[_0xb425('0x43')]);return db[_0xb425('0xa9')][_0xb425('0x24')]({'where':_0x55bec6[_0xb425('0x41')]})['then'](function(_0x7942fb){_0x4131f0['count']=_0x7942fb;if(_0x573873[_0xb425('0x35')][_0xb425('0x44')]){_0x55bec6[_0xb425('0x4a')]=[{'model':db[_0xb425('0x7d')],'as':_0xb425('0xe1'),'required':![]},{'model':db['User'],'as':_0xb425('0xe2'),'attributes':[_0xb425('0x2c'),'fullname','internal'],'required':![]},{'model':db[_0xb425('0xe3')],'as':_0xb425('0xe4'),'attributes':['id',_0xb425('0x2c'),'color'],'where':_0x573873['query'][_0xb425('0xe5')]?{'id':_0x573873['query'][_0xb425('0xe5')]}:undefined,'required':_0x573873[_0xb425('0x35')][_0xb425('0xe5')]?!![]:![]}];}return db[_0xb425('0xa9')][_0xb425('0x45')](_0x55bec6);})['then'](function(_0x4ff92d){_0x4131f0['rows']=_0x4ff92d;return _0x4131f0;});}})[_0xb425('0x13')](respondWithFilteredResult(_0x370c06,_0x55bec6))[_0xb425('0x1e')](handleError(_0x370c06,null));};function iftimePromise(_0x143412,_0x1bf4f6){return respondWithRpcPromise(_0xb425('0xe6'),_0xb425('0xe7'),{'command':_0x1bf4f6[_0xb425('0xe8')]?util[_0xb425('0xa1')](_0xb425('0xe9'),_0x143412['interval'],_0x1bf4f6['timezone']):util[_0xb425('0xa1')](_0xb425('0xea'),_0x143412[_0xb425('0xeb')])},client9002)[_0xb425('0x13')](function(_0x4f32b7){var _0x48a05d=_0x4f32b7&&_0x4f32b7[_0xb425('0xec')](_0xb425('0xed'))>=0x0?!![]:![];logger[_0xb425('0x14')](_0xb425('0xee'),_0x1bf4f6['id'],_0x143412['id'],_0x143412[_0xb425('0xeb')],_0x48a05d?_0xb425('0xef'):_0xb425('0xf0'),_0x1bf4f6[_0xb425('0xe8')]?_0x1bf4f6[_0xb425('0xe8')]:_0xb425('0xf1'));return _0x48a05d;})[_0xb425('0x1e')](function(_0x5cc71a){logger['error'](_0xb425('0xee'),_0x1bf4f6['id'],_0x143412['id'],_0x143412['interval'],util['inspect'](_0x5cc71a,{'showHidden':![],'depth':null}),_0x1bf4f6[_0xb425('0xe8')]?_0x1bf4f6[_0xb425('0xe8')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x72d2de,_0x150624){var _0x456a09=0x0;var _0x1aad58=0x0;var _0x29bbf4=![];var _0x250754;var _0x14750a;return db[_0xb425('0x32')]['find']({'where':{'id':_0x72d2de[_0xb425('0x48')]['id']},'include':[{'model':db[_0xb425('0xf2')],'as':_0xb425('0xf2'),'include':[{'model':db[_0xb425('0xf2')],'as':_0xb425('0xf3'),'attributes':['id',_0xb425('0xeb')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x150624,null))['then'](function(_0x1fce48){if(_0x1fce48){_0x250754=_0x1fce48;return _0x1fce48[_0xb425('0xf4')]({'raw':!![]});}})[_0xb425('0x13')](function(_0x4346bc){if(_0x250754){if(_0x4346bc){_0x14750a=_0x4346bc;}}return require(_0xb425('0x68'))['getLicense']();})[_0xb425('0x13')](function(_0x231bd8){if(_0x231bd8){_0x1aad58=_0x231bd8[_0xb425('0xf5')];_0x29bbf4=_0x231bd8[_0xb425('0x6a')];}})[_0xb425('0x13')](function(){return db[_0xb425('0xa9')][_0xb425('0x24')]({'where':{'closed':![]}});})[_0xb425('0x13')](function(_0xd4af9b){_0x456a09=_0xd4af9b;if(_0x1aad58&&_0xd4af9b>_0x1aad58){return db['License'][_0xb425('0x58')]({'where':{'id':0x1}})['then'](function(_0x1c21d1){if(_0x1c21d1){_0x1c21d1[_0xb425('0xf6')](_0xb425('0xf7'));}});}})[_0xb425('0x13')](function(){if(_0x250754['Interval']&&_0x250754['Interval'][_0xb425('0xf3')]){var _0x42e51e=[];for(var _0x16112d=0x0;_0x16112d<_0x250754[_0xb425('0xf2')][_0xb425('0xf3')][_0xb425('0x3b')];_0x16112d++){var _0x11ccea=_0x250754[_0xb425('0xf2')][_0xb425('0xf3')][_0x16112d][_0xb425('0x50')]({'plain':!![]});_0x42e51e[_0xb425('0xf8')](iftimePromise(_0x11ccea,_0x250754));}return BPromise['all'](_0x42e51e)[_0xb425('0x13')](function(_0x37ff26){return _['some'](_0x37ff26);});}else{return!![];}})[_0xb425('0x13')](function(_0x56e131){var _0x41720c=fs['readFileSync'](path['join'](config[_0xb425('0x6c')],_0xb425('0xf9')),_0xb425('0xc0'));var _0x230d9f={'remote':_0x250754[_0xb425('0xfa')],'query':querystring[_0xb425('0x19')](_['merge'](_0x250754[_0xb425('0x50')]({'plain':!![]}),{'customerIp':_0x72d2de[_0xb425('0x79')][_0xb425('0x99')]||_0x72d2de[_0xb425('0x79')][_0xb425('0xfb')]||_0x72d2de[_0xb425('0xfc')]['remoteAddress']||_0x72d2de['ip'],'referer':_0x72d2de[_0xb425('0x79')][_0xb425('0x9e')],'openedInteractions':_0x456a09,'maxInteractions':_0x1aad58,'virtual':_0x29bbf4[_0xb425('0xf5')],'online':_0x56e131,'custom':_0x29bbf4}))['replace'](/'/g,'\x5c\x27')};_0x150624[_0xb425('0x2d')](ejs['render'](Mustache[_0xb425('0xfd')](_0x41720c,_0x230d9f),{'proactiveActions':_0x14750a,'alignment':_0x250754[_0xb425('0xfe')],'verticalAlignment':_0x250754[_0xb425('0xff')],'div_color':_0x250754[_0xb425('0x100')],'labelText':_0x250754[_0xb425('0x101')],'text_color':_0x250754[_0xb425('0x102')],'text_button_color':_0x250754['textButtonColor'],'button_color':_0x250754[_0xb425('0x103')],'background_color':_0x250754[_0xb425('0x104')],'hideWhenOffline':_0x250754['hideWhenOffline'],'interval':_0x250754[_0xb425('0x105')]}));})[_0xb425('0x1e')](handleError(_0x150624,null));};exports[_0xb425('0x106')]=function(_0x334d81,_0x478a31){var _0x1eabb3=_0x334d81[_0xb425('0x48')]['id'];var _0x4fb13b=_0x334d81[_0xb425('0x4c')];var _0x55e3ad=0xc8;var _0x348360=null;return db[_0xb425('0xcc')][_0xb425('0xcd')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0xb425('0x107')]},function(_0x54d839){return db['ChatWebsite']['findOne']({'where':{'id':_0x1eabb3},'transaction':_0x54d839})[_0xb425('0x13')](function(_0xa34c01){if(_0xa34c01){return db[_0xb425('0x8f')][_0xb425('0x28')]({'where':{'ChatWebsiteId':_0x1eabb3},'transaction':_0x54d839})[_0xb425('0x13')](function(){var _0x3e7740=_[_0xb425('0x31')](_0x4fb13b,function(_0x583500){_0x583500['ChatWebsiteId']=_0x1eabb3;return _0x583500;});return db['ChatApplication'][_0xb425('0xcf')](_0x3e7740,{'transaction':_0x54d839});});}else{_0x55e3ad=0x194;_0x348360=[];}});})['then'](function(){if(_0x55e3ad!==0x194){return db[_0xb425('0x8f')][_0xb425('0x108')]({'where':{'ChatWebsiteId':_0x1eabb3},'order':_0xb425('0x109')})[_0xb425('0x13')](function(_0x565fd8){_0x348360=_0x565fd8;});}})[_0xb425('0x1e')](function(_0x5b1c95){_0x55e3ad=0x1f4;logger['error'](_0x5b1c95[_0xb425('0x2b')]);if(_0x5b1c95['name']){delete _0x5b1c95[_0xb425('0x2c')];}_0x348360=_0x5b1c95;})[_0xb425('0x10a')](function(){if(_0x348360===null){_0x478a31[_0xb425('0x1f')](_0x55e3ad);}else{if(_0x55e3ad===0x1f4){_0x478a31[_0xb425('0x20')](_0x55e3ad)[_0xb425('0x2d')](_0x348360);}else{_0x478a31[_0xb425('0x20')](_0x55e3ad)[_0xb425('0x27')](_0x348360);}}});};exports[_0xb425('0x10b')]=function(_0x164471,_0xc65da8){var _0x122434={};var _0x3063f6={};var _0x560701;var _0x51b8be;return db['ChatWebsite'][_0xb425('0x58')]({'where':{'id':_0x164471[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0xc65da8,null))[_0xb425('0x13')](function(_0x587c90){if(_0x587c90){_0x560701=_0x587c90;_0x3063f6[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0x8f')][_0xb425('0x33')]);_0x3063f6[_0xb425('0x35')]=_[_0xb425('0x36')](_0x164471[_0xb425('0x35')]);_0x3063f6[_0xb425('0x37')]=_[_0xb425('0x49')](_0x3063f6[_0xb425('0x38')],_0x3063f6[_0xb425('0x35')]);_0x122434[_0xb425('0x3a')]=_['intersection'](_0x3063f6[_0xb425('0x38')],qs[_0xb425('0x39')](_0x164471['query']['fields']));_0x122434[_0xb425('0x3a')]=_0x122434['attributes'][_0xb425('0x3b')]?_0x122434[_0xb425('0x3a')]:_0x3063f6['model'];_0x122434['order']=qs[_0xb425('0x3e')](_0x164471[_0xb425('0x35')]['sort']);_0x122434[_0xb425('0x41')]=qs[_0xb425('0x37')](_['pick'](_0x164471[_0xb425('0x35')],_0x3063f6[_0xb425('0x37')]));if(_0x164471[_0xb425('0x35')][_0xb425('0x40')]){_0x122434['where']=_[_0xb425('0x42')](_0x122434[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x122434[_0xb425('0x3a')],function(_0x28de7a){var _0x1ae7cb={};_0x1ae7cb[_0x28de7a]={'$like':'%'+_0x164471[_0xb425('0x35')][_0xb425('0x40')]+'%'};return _0x1ae7cb;})});}_0x122434=_[_0xb425('0x42')]({},_0x122434,_0x164471[_0xb425('0x43')]);return _0x560701[_0xb425('0x10b')](_0x122434);}})[_0xb425('0x13')](function(_0x30bc01){if(_0x30bc01){_0x51b8be=_0x30bc01[_0xb425('0x3b')];if(!_0x164471[_0xb425('0x35')][_0xb425('0x10c')](_0xb425('0x3c'))){_0x122434[_0xb425('0x23')]=qs[_0xb425('0x23')](_0x164471[_0xb425('0x35')][_0xb425('0x23')]);_0x122434[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x164471[_0xb425('0x35')][_0xb425('0x21')]);}return _0x560701[_0xb425('0x10b')](_0x122434);}})[_0xb425('0x13')](function(_0x49ae8f){if(_0x49ae8f){return _0x49ae8f?{'count':_0x51b8be,'rows':_0x49ae8f}:null;}})[_0xb425('0x13')](respondWithResult(_0xc65da8,null))[_0xb425('0x1e')](handleError(_0xc65da8,null));};exports['addProactiveActions']=function(_0x40b314,_0x7c0ce8){return db[_0xb425('0x10d')]['find']({'where':{'id':_0x40b314['params']['id']}})['then'](handleEntityNotFound(_0x7c0ce8,null))[_0xb425('0x13')](function(_0x24d7f0){if(_0x24d7f0){return _0x24d7f0[_0xb425('0x10e')](_0x40b314[_0xb425('0x4c')][_0xb425('0x5e')],_[_0xb425('0x10f')](_0x40b314[_0xb425('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x7c0ce8,null))[_0xb425('0x1e')](handleError(_0x7c0ce8,null));};exports[_0xb425('0xf4')]=function(_0x499bb6,_0x303b08){var _0x544db3={};var _0x4e5d61={};var _0x28edd3;var _0x54b6c4;return db['ChatWebsite']['findOne']({'where':{'id':_0x499bb6[_0xb425('0x48')]['id']}})['then'](handleEntityNotFound(_0x303b08,null))[_0xb425('0x13')](function(_0x11ed91){if(_0x11ed91){_0x28edd3=_0x11ed91;_0x4e5d61[_0xb425('0x38')]=_[_0xb425('0x36')](db['ChatProactiveAction'][_0xb425('0x33')]);_0x4e5d61[_0xb425('0x35')]=_[_0xb425('0x36')](_0x499bb6[_0xb425('0x35')]);_0x4e5d61[_0xb425('0x37')]=_[_0xb425('0x49')](_0x4e5d61[_0xb425('0x38')],_0x4e5d61[_0xb425('0x35')]);_0x544db3[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x4e5d61['model'],qs[_0xb425('0x39')](_0x499bb6[_0xb425('0x35')][_0xb425('0x39')]));_0x544db3[_0xb425('0x3a')]=_0x544db3[_0xb425('0x3a')]['length']?_0x544db3[_0xb425('0x3a')]:_0x4e5d61[_0xb425('0x38')];_0x544db3[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x499bb6[_0xb425('0x35')][_0xb425('0x3e')]);_0x544db3[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x499bb6[_0xb425('0x35')],_0x4e5d61['filters']));if(_0x499bb6[_0xb425('0x35')][_0xb425('0x40')]){_0x544db3[_0xb425('0x41')]=_['merge'](_0x544db3[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x544db3[_0xb425('0x3a')],function(_0x5f2df0){var _0x278460={};_0x278460[_0x5f2df0]={'$like':'%'+_0x499bb6[_0xb425('0x35')]['filter']+'%'};return _0x278460;})});}_0x544db3=_[_0xb425('0x42')]({},_0x544db3,_0x499bb6[_0xb425('0x43')]);return _0x28edd3['getProactiveActions'](_0x544db3);}})[_0xb425('0x13')](function(_0xa2a78d){if(_0xa2a78d){_0x54b6c4=_0xa2a78d[_0xb425('0x3b')];if(!_0x499bb6[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x544db3['limit']=qs[_0xb425('0x23')](_0x499bb6[_0xb425('0x35')]['limit']);_0x544db3[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x499bb6['query'][_0xb425('0x21')]);}return _0x28edd3[_0xb425('0xf4')](_0x544db3);}})[_0xb425('0x13')](function(_0x525dee){if(_0x525dee){return _0x525dee?{'count':_0x54b6c4,'rows':_0x525dee}:null;}})[_0xb425('0x13')](respondWithResult(_0x303b08,null))[_0xb425('0x1e')](handleError(_0x303b08,null));};exports[_0xb425('0x110')]=function(_0x272f69,_0x133c41){var _0x1cd720=_0x272f69[_0xb425('0x35')]['online']==='false'?'offlineForm':_0xb425('0x111');return db['ChatWebsite'][_0xb425('0x54')]({'attributes':['id',_0x1cd720],'where':{'id':_0x272f69[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x133c41,null))[_0xb425('0x13')](function(_0x577c5e){if(_0x577c5e){var _0x57444e=_0x577c5e[_0x1cd720];var _0x4ceb89=_0x57444e&&_0x57444e[_0xb425('0x112')]?_0x57444e[_0xb425('0x112')]:[];_0x133c41[_0xb425('0x2d')]({'fromKey':_[_0xb425('0x71')](_0x57444e[_0xb425('0x113')])?undefined:_0x57444e['fromKey'],'count':_0x4ceb89[_0xb425('0x3b')],'rows':_0x4ceb89});}})[_0xb425('0x1e')](handleError(_0x133c41,null));};exports['getOfflineMessages']=function(_0x2b87db,_0x365bae){var _0x58e832={'raw':![],'where':{}};var _0x4be10d={};var _0x5b55e9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2b87db['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x365bae,null))[_0xb425('0x13')](function(_0x4d739b){if(_0x4d739b){_0x4be10d[_0xb425('0x38')]=_[_0xb425('0x36')](db[_0xb425('0xc3')][_0xb425('0x33')]);_0x4be10d[_0xb425('0x35')]=_[_0xb425('0x36')](_0x2b87db['query']);_0x4be10d['filters']=_[_0xb425('0x49')](_0x4be10d[_0xb425('0x38')],_0x4be10d['query']);_0x58e832['attributes']=_[_0xb425('0x49')](_0x4be10d[_0xb425('0x38')],qs[_0xb425('0x39')](_0x2b87db['query'][_0xb425('0x39')]));_0x58e832['attributes']=_0x58e832['attributes'][_0xb425('0x3b')]?_0x58e832[_0xb425('0x3a')]:_0x4be10d[_0xb425('0x38')];if(!_0x2b87db[_0xb425('0x35')][_0xb425('0x10c')]('nolimit')){_0x58e832['limit']=qs[_0xb425('0x23')](_0x2b87db[_0xb425('0x35')][_0xb425('0x23')]);_0x58e832[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x2b87db[_0xb425('0x35')]['offset']);}_0x58e832[_0xb425('0x3d')]=qs[_0xb425('0x3e')](_0x2b87db[_0xb425('0x35')][_0xb425('0x3e')]);_0x58e832[_0xb425('0x41')]=qs['filters'](_[_0xb425('0x3f')](_0x2b87db[_0xb425('0x35')],_0x4be10d[_0xb425('0x37')]));_0x58e832[_0xb425('0x41')]['ChatWebsiteId']=_0x4d739b['id'];if(_0x2b87db[_0xb425('0x35')][_0xb425('0x40')]){_0x58e832[_0xb425('0x41')]=_['merge'](_0x58e832[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x58e832[_0xb425('0x3a')],function(_0x4a0036){var _0x520837={};_0x520837[_0x4a0036]={'$like':'%'+_0x2b87db[_0xb425('0x35')][_0xb425('0x40')]+'%'};return _0x520837;})});}_0x58e832=_['merge']({},_0x58e832,_0x2b87db[_0xb425('0x43')]);return db['ChatOfflineMessage'][_0xb425('0x24')]({'where':_0x58e832[_0xb425('0x41')]})[_0xb425('0x13')](function(_0x1a5870){_0x5b55e9[_0xb425('0x24')]=_0x1a5870;if(_0x2b87db[_0xb425('0x35')][_0xb425('0x44')]){_0x58e832[_0xb425('0x4a')]=[{'all':!![]}];}else{_0x58e832[_0xb425('0x4a')]=[{'model':db[_0xb425('0x7d')],'as':_0xb425('0xe1'),'required':![]},{'model':db[_0xb425('0xce')],'as':'Attachments','required':![]}];}return db[_0xb425('0xc3')]['findAll'](_0x58e832);})['then'](function(_0x430a95){_0x5b55e9[_0xb425('0x46')]=_0x430a95;return _0x5b55e9;});}})['then'](respondWithFilteredResult(_0x365bae,_0x58e832))[_0xb425('0x1e')](handleError(_0x365bae,null));};exports[_0xb425('0x114')]=function(_0x3eff07,_0x382663){return db['ChatWebsite'][_0xb425('0x54')]({'where':{'id':_0x3eff07[_0xb425('0x48')]['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x382663,null))[_0xb425('0x13')](function(_0x12edd2){if(_0x12edd2){return _0x12edd2['addAgents'](_0x3eff07['body']['ids'],_['omit'](_0x3eff07['body'],[_0xb425('0x5e'),'id'])||{})[_0xb425('0xac')](function(_0x2896a3){for(var _0x3e6fc7=0x0;_0x3e6fc7<_0x3eff07['body']['ids']['length'];_0x3e6fc7+=0x1){socket[_0xb425('0x115')](_0xb425('0x116'),{'UserId':Number(_0x3eff07[_0xb425('0x4c')][_0xb425('0x5e')][_0x3e6fc7]),'ChatWebsiteId':Number(_0x3eff07[_0xb425('0x48')]['id'])});}return _0x2896a3;});}})[_0xb425('0x13')](respondWithResult(_0x382663,null))['catch'](handleError(_0x382663,null));};exports[_0xb425('0x117')]=function(_0x1ec824,_0xf68045){return db[_0xb425('0x32')][_0xb425('0x54')]({'where':{'id':_0x1ec824['params']['id']}})['then'](handleEntityNotFound(_0xf68045,null))['then'](function(_0x42285f){if(_0x42285f){return _0x42285f[_0xb425('0x117')](_0x1ec824['query']['ids'])[_0xb425('0x13')](function(){if(_[_0xb425('0x118')](_0x1ec824['query'][_0xb425('0x5e')])){for(var _0x5ba7be=0x0;_0x5ba7be<_0x1ec824['query'][_0xb425('0x5e')][_0xb425('0x3b')];_0x5ba7be+=0x1){socket[_0xb425('0x115')](_0xb425('0x119'),{'UserId':Number(_0x1ec824['query']['ids'][_0x5ba7be]),'ChatWebsiteId':Number(_0x1ec824[_0xb425('0x48')]['id'])});}}else{socket[_0xb425('0x115')]('userChatWebsite:remove',{'UserId':Number(_0x1ec824['query']['ids']),'ChatWebsiteId':Number(_0x1ec824[_0xb425('0x48')]['id'])});}});}})[_0xb425('0x13')](respondWithStatusCode(_0xf68045,null))[_0xb425('0x1e')](handleError(_0xf68045,null));};exports[_0xb425('0x11a')]=function(_0x229d54,_0x54926e){var _0x1f22d7={};var _0x1993dd={};var _0x5834c0;var _0x271c07;return db[_0xb425('0x32')][_0xb425('0x58')]({'where':{'id':_0x229d54['params']['id']}})[_0xb425('0x13')](handleEntityNotFound(_0x54926e,null))['then'](function(_0x2a0567){if(_0x2a0567){_0x5834c0=_0x2a0567;_0x1993dd['model']=_['keys'](db[_0xb425('0xb2')][_0xb425('0x33')]);_0x1993dd[_0xb425('0x35')]=_[_0xb425('0x36')](_0x229d54['query']);_0x1993dd[_0xb425('0x37')]=_[_0xb425('0x49')](_0x1993dd[_0xb425('0x38')],_0x1993dd[_0xb425('0x35')]);_0x1f22d7[_0xb425('0x3a')]=_[_0xb425('0x49')](_0x1993dd[_0xb425('0x38')],qs[_0xb425('0x39')](_0x229d54[_0xb425('0x35')]['fields']));_0x1f22d7[_0xb425('0x3a')]=_0x1f22d7[_0xb425('0x3a')][_0xb425('0x3b')]?_0x1f22d7['attributes']:_0x1993dd[_0xb425('0x38')];_0x1f22d7[_0xb425('0x3d')]=qs['sort'](_0x229d54[_0xb425('0x35')][_0xb425('0x3e')]);_0x1f22d7[_0xb425('0x41')]=qs[_0xb425('0x37')](_[_0xb425('0x3f')](_0x229d54[_0xb425('0x35')],_0x1993dd[_0xb425('0x37')]));if(_0x229d54[_0xb425('0x35')]['filter']){_0x1f22d7[_0xb425('0x41')]=_[_0xb425('0x42')](_0x1f22d7[_0xb425('0x41')],{'$or':_[_0xb425('0x31')](_0x1f22d7['attributes'],function(_0x470f97){var _0x305837={};_0x305837[_0x470f97]={'$like':'%'+_0x229d54['query']['filter']+'%'};return _0x305837;})});}_0x1f22d7=_[_0xb425('0x42')]({},_0x1f22d7,_0x229d54[_0xb425('0x43')]);return _0x5834c0[_0xb425('0x11a')](_0x1f22d7);}})['then'](function(_0x9a8ac9){if(_0x9a8ac9){_0x271c07=_0x9a8ac9['length'];if(!_0x229d54[_0xb425('0x35')]['hasOwnProperty'](_0xb425('0x3c'))){_0x1f22d7[_0xb425('0x23')]=qs['limit'](_0x229d54[_0xb425('0x35')][_0xb425('0x23')]);_0x1f22d7[_0xb425('0x21')]=qs[_0xb425('0x21')](_0x229d54[_0xb425('0x35')]['offset']);}return _0x5834c0[_0xb425('0x11a')](_0x1f22d7);}})['then'](function(_0x314afc){if(_0x314afc){return _0x314afc?{'count':_0x271c07,'rows':_0x314afc}:null;}})['then'](respondWithResult(_0x54926e,null))[_0xb425('0x1e')](handleError(_0x54926e,null));};
\ No newline at end of file
+var _0x95b6=['Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','inspect','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','License','increment','Intervals','readFileSync','remote','x-real-ip','remoteAddress','replace','render','alignment','verticalAlignment','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','offlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','keys','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','Disposition','getDispositions','findOne','length','ChatWebsiteId','removeDispositions','ids','CannedAnswer','findAll','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','account','list','List','applications','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','format','unknown','version','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ContactId','interaction','ChatInteraction','spread','lastName','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','files','difference','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','email','Smtp','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','internal','Tag','Tags','color','tag'];(function(_0x275c39,_0x3584f0){var _0x437901=function(_0xdb2d9b){while(--_0xdb2d9b){_0x275c39['push'](_0x275c39['shift']());}};_0x437901(++_0x3584f0);}(_0x95b6,0x15f));var _0x695b=function(_0x87e81b,_0x2ddb31){_0x87e81b=_0x87e81b-0x0;var _0x1d4c78=_0x95b6[_0x87e81b];return _0x1d4c78;};'use strict';var BPromise=require(_0x695b('0x0'));var Mustache=require(_0x695b('0x1'));var util=require('util');var path=require(_0x695b('0x2'));var ejs=require(_0x695b('0x3'));var fs=require('fs');var fs_extra=require(_0x695b('0x4'));var _=require(_0x695b('0x5'));var querystring=require('querystring');var Redis=require(_0x695b('0x6'));var qs=require(_0x695b('0x7'));var logger=require(_0x695b('0x8'))(_0x695b('0x9'));var config=require(_0x695b('0xa'));var db=require(_0x695b('0xb'))['db'];config[_0x695b('0xc')]=_[_0x695b('0xd')](config[_0x695b('0xc')],{'host':_0x695b('0xe'),'port':0x18eb});var socket=require(_0x695b('0xf'))(new Redis(config[_0x695b('0xc')]));require(_0x695b('0x10'))[_0x695b('0x11')](socket);var htmlToText=require(_0x695b('0x12'));var jayson=require(_0x695b('0x13'));var client=jayson[_0x695b('0x14')][_0x695b('0x15')]({'port':0x232c});var client9002=jayson[_0x695b('0x14')]['http']({'port':0x232a});var client9003=jayson['client'][_0x695b('0x15')]({'port':0x232b});var client9001=jayson['client'][_0x695b('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x146620,_0x233a7f,_0x3b9468,_0xec8f34){return new BPromise(function(_0x1128f6,_0x15809e){var _0x9d0ca8=_0xec8f34||client;return _0x9d0ca8['request'](_0x146620,_0x3b9468)[_0x695b('0x16')](function(_0x5aebd2){logger[_0x695b('0x17')](_0x695b('0x18'),_0x233a7f,_0x695b('0x19'));logger[_0x695b('0x1a')](_0x695b('0x1b'),_0x233a7f,_0x695b('0x19'),JSON['stringify'](_0x5aebd2));if(_0x5aebd2[_0x695b('0x1c')]){if(_0x5aebd2[_0x695b('0x1c')][_0x695b('0x1d')]===0x1f4){logger[_0x695b('0x1c')](_0x695b('0x18'),_0x233a7f,_0x5aebd2[_0x695b('0x1c')][_0x695b('0x1e')]);return _0x15809e(_0x5aebd2['error'][_0x695b('0x1e')]);}logger[_0x695b('0x1c')](_0x695b('0x18'),_0x233a7f,_0x5aebd2['error']['message']);return _0x1128f6(_0x5aebd2[_0x695b('0x1c')][_0x695b('0x1e')]);}else{logger[_0x695b('0x17')](_0x695b('0x18'),_0x233a7f,_0x695b('0x19'));_0x1128f6(_0x5aebd2[_0x695b('0x1f')][_0x695b('0x1e')]);}})[_0x695b('0x20')](function(_0x5a5221){logger[_0x695b('0x1c')](_0x695b('0x18'),_0x233a7f,_0x5a5221);_0x15809e(_0x5a5221);});});}function respondWithStatusCode(_0x19b4d8,_0x2b85a3){_0x2b85a3=_0x2b85a3||0xcc;return function(_0x4c9dd4){if(_0x4c9dd4){return _0x19b4d8[_0x695b('0x21')](_0x2b85a3);}return _0x19b4d8[_0x695b('0x22')](_0x2b85a3)[_0x695b('0x23')]();};}function respondWithResult(_0x18b4fe,_0x1d009b){_0x1d009b=_0x1d009b||0xc8;return function(_0x2935e){if(_0x2935e){return _0x18b4fe[_0x695b('0x22')](_0x1d009b)[_0x695b('0x24')](_0x2935e);}};}function respondWithFilteredResult(_0x11041d,_0x24085a){return function(_0x1b6eec){if(_0x1b6eec){var _0x12d645=typeof _0x24085a['offset']==='undefined'&&typeof _0x24085a['limit']===_0x695b('0x25');var _0x1875c9=_0x1b6eec[_0x695b('0x26')];var _0x3dbd41=_0x12d645?0x0:_0x24085a[_0x695b('0x27')];var _0x3be238=_0x12d645?_0x1b6eec[_0x695b('0x26')]:_0x24085a[_0x695b('0x27')]+_0x24085a[_0x695b('0x28')];var _0x1d7bc3;if(_0x3be238>=_0x1875c9){_0x3be238=_0x1875c9;_0x1d7bc3=0xc8;}else{_0x1d7bc3=0xce;}_0x11041d[_0x695b('0x22')](_0x1d7bc3);return _0x11041d['set'](_0x695b('0x29'),_0x3dbd41+'-'+_0x3be238+'/'+_0x1875c9)[_0x695b('0x24')](_0x1b6eec);}return null;};}function saveUpdates(_0x4d1062){return function(_0x178859){if(_0x178859){return _0x178859[_0x695b('0x2a')](_0x4d1062)[_0x695b('0x16')](function(_0xa1d932){return _0xa1d932;});}return null;};}function removeEntity(_0x31303e){return function(_0x4a831d){if(_0x4a831d){return _0x4a831d[_0x695b('0x2b')]()[_0x695b('0x16')](function(){var _0x11df91=_0x4a831d[_0x695b('0x2c')]({'plain':!![]});var _0x58f8f7=_0x695b('0x2d');return db[_0x695b('0x2e')][_0x695b('0x2b')]({'where':{'type':_0x58f8f7,'resourceId':_0x11df91['id']}})[_0x695b('0x16')](function(){return _0x4a831d;});})[_0x695b('0x16')](function(){_0x31303e[_0x695b('0x22')](0xcc)[_0x695b('0x23')]();});}};}function handleEntityNotFound(_0x4623fb){return function(_0xb40d02){if(!_0xb40d02){_0x4623fb[_0x695b('0x21')](0x194);}return _0xb40d02;};}function handleError(_0x5b3f0a,_0x5c688a){_0x5c688a=_0x5c688a||0x1f4;return function(_0xc48b60){logger[_0x695b('0x1c')](_0xc48b60['stack']);if(_0xc48b60[_0x695b('0x2f')]){delete _0xc48b60[_0x695b('0x2f')];}_0x5b3f0a['status'](_0x5c688a)[_0x695b('0x30')](_0xc48b60);};}exports[_0x695b('0x31')]=function(_0x3b6ad6,_0x1bdff6){var _0x399a95={'include':[{'model':db[_0x695b('0x32')],'as':_0x695b('0x33')}]},_0x235ba4={},_0x1052c1={'count':0x0,'rows':[]};var _0x1c7cf3=_['map'](db[_0x695b('0x34')]['rawAttributes'],function(_0x18886e){return{'name':_0x18886e['fieldName'],'type':_0x18886e[_0x695b('0x35')][_0x695b('0x36')]};});_0x235ba4[_0x695b('0x37')]=_[_0x695b('0x38')](_0x1c7cf3,_0x695b('0x2f'));_0x235ba4[_0x695b('0x39')]=_['keys'](_0x3b6ad6['query']);_0x235ba4[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x235ba4[_0x695b('0x37')],_0x235ba4[_0x695b('0x39')]);_0x399a95[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x235ba4[_0x695b('0x37')],qs[_0x695b('0x3d')](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x3d')]));_0x399a95[_0x695b('0x3c')]=_0x399a95[_0x695b('0x3c')]['length']?_0x399a95['attributes']:_0x235ba4['model'];if(!_0x3b6ad6[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x399a95['limit']=qs[_0x695b('0x28')](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x28')]);_0x399a95[_0x695b('0x27')]=qs['offset'](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x27')]);}_0x399a95[_0x695b('0x40')]=qs['sort'](_0x3b6ad6[_0x695b('0x39')][_0x695b('0x41')]);_0x399a95[_0x695b('0x42')]=qs[_0x695b('0x3a')](_[_0x695b('0x43')](_0x3b6ad6[_0x695b('0x39')],_0x235ba4[_0x695b('0x3a')]),_0x1c7cf3);if(_0x3b6ad6[_0x695b('0x39')][_0x695b('0x44')]){_0x399a95[_0x695b('0x42')]=_['merge'](_0x399a95[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x1c7cf3,function(_0x265fa9){if(_0x265fa9['type']!==_0x695b('0x45')){var _0x108ecf={};_0x108ecf[_0x265fa9[_0x695b('0x2f')]]={'$like':'%'+_0x3b6ad6[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x108ecf;}})});}_0x399a95=_[_0x695b('0x46')]({},_0x399a95,_0x3b6ad6[_0x695b('0x47')]);var _0x3a7b8f={'where':_0x399a95['where']};return db['ChatWebsite'][_0x695b('0x26')](_0x3a7b8f)[_0x695b('0x16')](function(_0x23add8){_0x1052c1['count']=_0x23add8;if(_0x3b6ad6[_0x695b('0x39')][_0x695b('0x48')]){_0x399a95['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x399a95);})['then'](function(_0x53946a){_0x1052c1[_0x695b('0x49')]=_0x53946a;return _0x1052c1;})['then'](respondWithFilteredResult(_0x1bdff6,_0x399a95))[_0x695b('0x20')](handleError(_0x1bdff6,null));};exports[_0x695b('0x4a')]=function(_0x5db67c,_0x5492b6){var _0x2617f0={'raw':![],'where':{'id':_0x5db67c[_0x695b('0x4b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1d4c13={};_0x1d4c13[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0x34')][_0x695b('0x4d')]);_0x1d4c13['query']=_[_0x695b('0x4c')](_0x5db67c[_0x695b('0x39')]);_0x1d4c13['filters']=_['intersection'](_0x1d4c13[_0x695b('0x37')],_0x1d4c13[_0x695b('0x39')]);_0x2617f0[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x1d4c13['model'],qs[_0x695b('0x3d')](_0x5db67c[_0x695b('0x39')][_0x695b('0x3d')]));_0x2617f0[_0x695b('0x3c')]=_0x2617f0[_0x695b('0x3c')]['length']?_0x2617f0[_0x695b('0x3c')]:_0x1d4c13[_0x695b('0x37')];if(_0x5db67c['query'][_0x695b('0x48')]){_0x2617f0[_0x695b('0x4e')]=[{'all':!![]}];}_0x2617f0=_[_0x695b('0x46')]({},_0x2617f0,_0x5db67c[_0x695b('0x47')]);return db[_0x695b('0x34')]['find'](_0x2617f0)['then'](handleEntityNotFound(_0x5492b6,null))['then'](respondWithResult(_0x5492b6,null))[_0x695b('0x20')](handleError(_0x5492b6,null));};exports[_0x695b('0x4f')]=function(_0x20285d,_0x8d8e53){return db['ChatWebsite'][_0x695b('0x4f')](_0x20285d[_0x695b('0x50')],{})[_0x695b('0x16')](function(_0x18cee7){var _0x52c2b9=_0x20285d[_0x695b('0x51')][_0x695b('0x2c')]({'plain':!![]});if(!_0x52c2b9)throw new Error(_0x695b('0x52'));if(_0x52c2b9[_0x695b('0x53')]==='user'){var _0x664a22=_0x18cee7[_0x695b('0x2c')]({'plain':!![]});var _0x47e397=_0x695b('0x2d');return db[_0x695b('0x54')]['find']({'where':{'name':_0x47e397,'userProfileId':_0x52c2b9[_0x695b('0x55')]},'raw':!![]})[_0x695b('0x16')](function(_0x47bf4d){if(_0x47bf4d&&_0x47bf4d[_0x695b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x664a22['name'],'resourceId':_0x664a22['id'],'type':_0x47bf4d[_0x695b('0x2f')],'sectionId':_0x47bf4d['id']},{})[_0x695b('0x16')](function(){return _0x18cee7;});}else{return _0x18cee7;}})[_0x695b('0x20')](function(_0x2ed6c1){logger[_0x695b('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ed6c1);throw _0x2ed6c1;});}return _0x18cee7;})['then'](respondWithResult(_0x8d8e53,0xc9))['catch'](handleError(_0x8d8e53,null));};exports[_0x695b('0x2a')]=function(_0x2a8184,_0x5cc323){if(_0x2a8184[_0x695b('0x50')]['id']){delete _0x2a8184[_0x695b('0x50')]['id'];}return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x2a8184[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x32')],'as':_0x695b('0x33')}]})[_0x695b('0x16')](handleEntityNotFound(_0x5cc323,null))['then'](saveUpdates(_0x2a8184['body'],null))[_0x695b('0x16')](respondWithResult(_0x5cc323,null))[_0x695b('0x20')](handleError(_0x5cc323,null));};exports['destroy']=function(_0x5d6ef7,_0x8f34d){return db[_0x695b('0x34')]['find']({'where':{'id':_0x5d6ef7[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x8f34d,null))[_0x695b('0x16')](removeEntity(_0x8f34d,null))[_0x695b('0x20')](handleError(_0x8f34d,null));};exports['describe']=function(_0x581c11,_0x329fab){return db['ChatWebsite'][_0x695b('0x58')]()[_0x695b('0x16')](respondWithResult(_0x329fab,null))[_0x695b('0x20')](handleError(_0x329fab,null));};exports[_0x695b('0x59')]=function(_0x31a4e6,_0x233bbf){if(_0x31a4e6['body']['id']){delete _0x31a4e6['body']['id'];}return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x31a4e6['params']['id']}})['then'](handleEntityNotFound(_0x233bbf,null))[_0x695b('0x16')](function(_0xa7e6b7){if(_0xa7e6b7){_0x31a4e6['body']['ChatWebsiteId']=_0xa7e6b7['id'];return db[_0x695b('0x5a')]['create'](_0x31a4e6[_0x695b('0x50')]);}})['then'](respondWithResult(_0x233bbf,null))[_0x695b('0x20')](handleError(_0x233bbf,null));};exports[_0x695b('0x5b')]=function(_0x475aae,_0x3937ed){var _0x25d827={'raw':![],'where':{}};var _0x3e8627={};var _0x32a4d7={'count':0x0,'rows':[]};return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x475aae['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x3937ed,null))[_0x695b('0x16')](function(_0x3a0553){if(_0x3a0553){_0x3e8627[_0x695b('0x37')]=_[_0x695b('0x4c')](db['Disposition'][_0x695b('0x4d')]);_0x3e8627[_0x695b('0x39')]=_['keys'](_0x475aae[_0x695b('0x39')]);_0x3e8627[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x3e8627['model'],_0x3e8627[_0x695b('0x39')]);_0x25d827['attributes']=_['intersection'](_0x3e8627[_0x695b('0x37')],qs[_0x695b('0x3d')](_0x475aae[_0x695b('0x39')]['fields']));_0x25d827[_0x695b('0x3c')]=_0x25d827[_0x695b('0x3c')][_0x695b('0x5d')]?_0x25d827[_0x695b('0x3c')]:_0x3e8627[_0x695b('0x37')];if(!_0x475aae['query']['hasOwnProperty']('nolimit')){_0x25d827[_0x695b('0x28')]=qs['limit'](_0x475aae[_0x695b('0x39')][_0x695b('0x28')]);_0x25d827[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x475aae['query'][_0x695b('0x27')]);}_0x25d827[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x475aae[_0x695b('0x39')][_0x695b('0x41')]);_0x25d827[_0x695b('0x42')]=qs['filters'](_[_0x695b('0x43')](_0x475aae['query'],_0x3e8627[_0x695b('0x3a')]));_0x25d827[_0x695b('0x42')][_0x695b('0x5e')]=_0x3a0553['id'];if(_0x475aae['query']['filter']){_0x25d827['where']=_['merge'](_0x25d827['where'],{'$or':_[_0x695b('0x38')](_0x25d827['attributes'],function(_0x53ac2d){var _0x4591d6={};_0x4591d6[_0x53ac2d]={'$like':'%'+_0x475aae[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x4591d6;})});}_0x25d827=_['merge']({},_0x25d827,_0x475aae[_0x695b('0x47')]);return db['Disposition'][_0x695b('0x26')]({'where':_0x25d827['where']})[_0x695b('0x16')](function(_0x588e5a){_0x32a4d7[_0x695b('0x26')]=_0x588e5a;if(_0x475aae[_0x695b('0x39')][_0x695b('0x48')]){_0x25d827[_0x695b('0x4e')]=[{'all':!![]}];}return db[_0x695b('0x5a')]['findAll'](_0x25d827);})[_0x695b('0x16')](function(_0xe53420){_0x32a4d7[_0x695b('0x49')]=_0xe53420;return _0x32a4d7;});}})[_0x695b('0x16')](respondWithFilteredResult(_0x3937ed,_0x25d827))[_0x695b('0x20')](handleError(_0x3937ed,null));};exports[_0x695b('0x5f')]=function(_0x46ac48,_0x376de3){return db[_0x695b('0x34')]['find']({'where':{'id':_0x46ac48[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x376de3,null))[_0x695b('0x16')](function(_0x43e79b){if(_0x43e79b){return _0x43e79b[_0x695b('0x5f')](_0x46ac48[_0x695b('0x39')][_0x695b('0x60')]);}})[_0x695b('0x16')](respondWithStatusCode(_0x376de3,null))['catch'](handleError(_0x376de3,null));};exports['addAnswer']=function(_0x3eb981,_0xf3a860){if(_0x3eb981[_0x695b('0x50')]['id']){delete _0x3eb981[_0x695b('0x50')]['id'];}return db['ChatWebsite'][_0x695b('0x57')]({'where':{'id':_0x3eb981['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0xf3a860,null))['then'](function(_0x4c723b){if(_0x4c723b){_0x3eb981[_0x695b('0x50')][_0x695b('0x5e')]=_0x4c723b['id'];return db[_0x695b('0x61')][_0x695b('0x4f')](_0x3eb981['body']);}})[_0x695b('0x16')](respondWithResult(_0xf3a860,null))[_0x695b('0x20')](handleError(_0xf3a860,null));};exports['getAnswers']=function(_0x133242,_0x36f466){var _0x103456={'raw':![],'where':{}};var _0x1bb992={};var _0x2a7c5f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x695b('0x5c')]({'where':{'id':_0x133242[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x36f466,null))[_0x695b('0x16')](function(_0x4600d7){if(_0x4600d7){_0x1bb992[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0x61')][_0x695b('0x4d')]);_0x1bb992['query']=_['keys'](_0x133242['query']);_0x1bb992['filters']=_[_0x695b('0x3b')](_0x1bb992[_0x695b('0x37')],_0x1bb992['query']);_0x103456[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x1bb992['model'],qs[_0x695b('0x3d')](_0x133242[_0x695b('0x39')][_0x695b('0x3d')]));_0x103456[_0x695b('0x3c')]=_0x103456[_0x695b('0x3c')][_0x695b('0x5d')]?_0x103456[_0x695b('0x3c')]:_0x1bb992[_0x695b('0x37')];if(!_0x133242['query'][_0x695b('0x3e')]('nolimit')){_0x103456[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x133242[_0x695b('0x39')][_0x695b('0x28')]);_0x103456[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x133242['query'][_0x695b('0x27')]);}_0x103456['order']=qs[_0x695b('0x41')](_0x133242['query'][_0x695b('0x41')]);_0x103456[_0x695b('0x42')]=qs[_0x695b('0x3a')](_['pick'](_0x133242[_0x695b('0x39')],_0x1bb992[_0x695b('0x3a')]));_0x103456[_0x695b('0x42')][_0x695b('0x5e')]=_0x4600d7['id'];if(_0x133242['query']['filter']){_0x103456[_0x695b('0x42')]=_[_0x695b('0x46')](_0x103456[_0x695b('0x42')],{'$or':_['map'](_0x103456[_0x695b('0x3c')],function(_0x41fd32){var _0x3c3fd4={};_0x3c3fd4[_0x41fd32]={'$like':'%'+_0x133242[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x3c3fd4;})});}_0x103456=_[_0x695b('0x46')]({},_0x103456,_0x133242['options']);return db[_0x695b('0x61')][_0x695b('0x26')]({'where':_0x103456['where']})[_0x695b('0x16')](function(_0x2d26b4){_0x2a7c5f[_0x695b('0x26')]=_0x2d26b4;if(_0x133242[_0x695b('0x39')][_0x695b('0x48')]){_0x103456['include']=[{'all':!![]}];}return db[_0x695b('0x61')][_0x695b('0x62')](_0x103456);})[_0x695b('0x16')](function(_0x437b89){_0x2a7c5f[_0x695b('0x49')]=_0x437b89;return _0x2a7c5f;});}})[_0x695b('0x16')](respondWithFilteredResult(_0x36f466,_0x103456))['catch'](handleError(_0x36f466,null));};exports[_0x695b('0x63')]=function(_0x577454,_0x530fc0){return db[_0x695b('0x34')]['find']({'where':{'id':_0x577454['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x530fc0,null))['then'](function(_0x23e857){if(_0x23e857){return _0x23e857['removeAnswers'](_0x577454['query'][_0x695b('0x60')]);}})['then'](respondWithStatusCode(_0x530fc0,null))['catch'](handleError(_0x530fc0,null));};exports[_0x695b('0x64')]=function(_0xf8a4db,_0x176135){_0xf8a4db['body'][_0x695b('0x65')]=_0xf8a4db['file'][_0x695b('0x66')];return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0xf8a4db[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x176135,null))[_0x695b('0x16')](saveUpdates(_0xf8a4db[_0x695b('0x50')],null))[_0x695b('0x16')](respondWithResult(_0x176135,null))[_0x695b('0x20')](handleError(_0x176135,null));};exports[_0x695b('0x67')]=function(_0xfa4da4,_0x21682b){_0xfa4da4[_0x695b('0x50')]['agentAvatar']=_0xfa4da4[_0x695b('0x68')][_0x695b('0x66')];return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0xfa4da4['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x21682b,null))[_0x695b('0x16')](saveUpdates(_0xfa4da4[_0x695b('0x50')],null))['then'](respondWithResult(_0x21682b,null))['catch'](handleError(_0x21682b,null));};exports[_0x695b('0x69')]=function(_0xa8344d,_0x177ca4){_0xa8344d[_0x695b('0x50')][_0x695b('0x6a')]=_0xa8344d[_0x695b('0x68')][_0x695b('0x66')];return db[_0x695b('0x34')]['find']({'where':{'id':_0xa8344d[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x177ca4,null))[_0x695b('0x16')](saveUpdates(_0xa8344d[_0x695b('0x50')],null))[_0x695b('0x16')](respondWithResult(_0x177ca4,null))[_0x695b('0x20')](handleError(_0x177ca4,null));};exports[_0x695b('0x6b')]=function(_0xcaa570,_0x22f1a8){_0xcaa570['body'][_0x695b('0x6c')]=_0xcaa570[_0x695b('0x68')]['filename'];return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0xcaa570[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22f1a8,null))[_0x695b('0x16')](saveUpdates(_0xcaa570[_0x695b('0x50')],null))['then'](respondWithResult(_0x22f1a8,null))['catch'](handleError(_0x22f1a8,null));};exports[_0x695b('0x6d')]=function(_0x2ba3a8,_0x167724){var _0x3b698d=path['join'](config[_0x695b('0x6e')],_0x695b('0x6f'));var _0x4e452b={'where':{'id':_0x2ba3a8[_0x695b('0x4b')]['id']},'attributes':['id',_0x695b('0x65')],'raw':!![]};var _0x2f1f54=![];return require(_0x695b('0x70'))[_0x695b('0x71')]()[_0x695b('0x16')](function(_0x3d87f6){if(_0x3d87f6){_0x2f1f54=_0x3d87f6[_0x695b('0x72')];}})[_0x695b('0x16')](function(){return db['ChatWebsite'][_0x695b('0x57')](_0x4e452b);})[_0x695b('0x16')](handleEntityNotFound(_0x167724,null))['then'](function(_0xfcadd5){if(_0xfcadd5){if(!_['isNil'](_0xfcadd5[_0x695b('0x65')])){if(fs['existsSync'](path[_0x695b('0x73')](config['root'],_0x695b('0x74'),_0xfcadd5['sitepic']))&&_0x2f1f54){_0x3b698d=path[_0x695b('0x73')](config[_0x695b('0x6e')],'server/files/images/logos/',_0xfcadd5[_0x695b('0x65')]);}}return _0x167724[_0x695b('0x75')](_0x3b698d);}})[_0x695b('0x20')](handleError(_0x167724,null));};exports[_0x695b('0x76')]=function(_0x3ae23a,_0x368167){var _0xcd5d75=path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0x77'));var _0x128363={'where':{'id':_0x3ae23a[_0x695b('0x4b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x695b('0x34')][_0x695b('0x57')](_0x128363)[_0x695b('0x16')](handleEntityNotFound(_0x368167,null))['then'](function(_0xc37a1a){if(_0xc37a1a){if(!_[_0x695b('0x78')](_0xc37a1a[_0x695b('0x79')])){if(fs[_0x695b('0x7a')](path['join'](config[_0x695b('0x6e')],_0x695b('0x7b'),_0xc37a1a[_0x695b('0x79')]))){_0xcd5d75=path[_0x695b('0x73')](config[_0x695b('0x6e')],'server/files/images/avatars/',_0xc37a1a[_0x695b('0x79')]);}}return _0x368167[_0x695b('0x75')](_0xcd5d75);}})['catch'](handleError(_0x368167,null));};exports['getCustomerAvatar']=function(_0x4f3b00,_0xa072d5){var _0x226e5f=path['join'](config[_0x695b('0x6e')],_0x695b('0x7c'));var _0x4fdb52={'where':{'id':_0x4f3b00['params']['id']},'attributes':['id',_0x695b('0x6a'),_0x695b('0x7d')],'raw':!![]};return db[_0x695b('0x34')][_0x695b('0x57')](_0x4fdb52)[_0x695b('0x16')](handleEntityNotFound(_0xa072d5,null))[_0x695b('0x16')](function(_0x10e62d){if(_0x10e62d){if(!_[_0x695b('0x78')](_0x10e62d[_0x695b('0x6a')])){if(fs[_0x695b('0x7a')](path[_0x695b('0x73')](config['root'],_0x695b('0x7b'),_0x10e62d[_0x695b('0x6a')]))&&_0x10e62d[_0x695b('0x7d')]){_0x226e5f=path[_0x695b('0x73')](config['root'],_0x695b('0x7b'),_0x10e62d[_0x695b('0x6a')]);}}return _0xa072d5[_0x695b('0x75')](_0x226e5f);}})[_0x695b('0x20')](handleError(_0xa072d5,null));};exports[_0x695b('0x7e')]=function(_0x3e88e0,_0x2a01df){var _0x4e8c55=path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0x7f'));var _0xd237fa={'where':{'id':_0x3e88e0[_0x695b('0x4b')]['id']},'attributes':['id',_0x695b('0x6c')],'raw':!![]};return db['ChatWebsite'][_0x695b('0x57')](_0xd237fa)[_0x695b('0x16')](handleEntityNotFound(_0x2a01df,null))[_0x695b('0x16')](function(_0x51e1e7){if(_0x51e1e7){if(!_[_0x695b('0x78')](_0x51e1e7[_0x695b('0x6c')])){if(fs[_0x695b('0x7a')](path['join'](config[_0x695b('0x6e')],_0x695b('0x7b'),_0x51e1e7[_0x695b('0x6c')]))){_0x4e8c55=path['join'](config[_0x695b('0x6e')],_0x695b('0x7b'),_0x51e1e7[_0x695b('0x6c')]);}}return _0x2a01df[_0x695b('0x75')](_0x4e8c55);}})[_0x695b('0x20')](handleError(_0x2a01df,null));};exports[_0x695b('0x80')]=function(_0x1d0317,_0x11cde9){var _0x53be05=require(_0x695b('0x81'));var _0xaa5bcd=new _0x53be05();var _0x53ab26=_0xaa5bcd['setUA'](_0x1d0317[_0x695b('0x82')][_0x695b('0x83')])[_0x695b('0x84')]();var _0x4a6254={'body':_0x1d0317[_0x695b('0x50')],'channel':'chat'};var _0x937e4f=[];var _0x1418b9=[];var _0xe619af={};var _0x3a90f7=![];return db[_0x695b('0x85')][_0x695b('0x58')]()['then'](function(_0x5a1b6e){if(!_0x5a1b6e){throw new db[(_0x695b('0x86'))]['ValidationError'](_0x695b('0x87'));}_0x937e4f=_['difference'](_[_0x695b('0x4c')](_0x5a1b6e),[_0x695b('0x88'),'updatedAt']);_0x1418b9=_['difference'](_[_0x695b('0x4c')](_0x5a1b6e),[_0x695b('0x88'),_0x695b('0x89'),_0x695b('0x8a'),_0x695b('0x8b')]);if(_0x1d0317[_0x695b('0x50')]['id']){delete _0x1d0317[_0x695b('0x50')]['id'];}if(_[_0x695b('0x78')](_0x1d0317[_0x695b('0x50')][_0x695b('0x8c')])){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x8e'));}if(_[_0x695b('0x78')](_0x1d0317[_0x695b('0x50')][_0x695b('0x50')])||_0x1d0317['body'][_0x695b('0x50')]===''){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x8f'));}if(_['isNil'](_0x1d0317['body']['mapKey'])){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x90')+_0x1418b9);}if(!_[_0x695b('0x91')](_0x1418b9,_0x1d0317[_0x695b('0x50')]['mapKey'])){throw new db[(_0x695b('0x86'))]['ValidationError'](_0x695b('0x92')+_0x1418b9);}_0xe619af[_0x1d0317[_0x695b('0x50')][_0x695b('0x93')]]=_0x1d0317['body'][_0x695b('0x8c')];})[_0x695b('0x16')](function(){return db[_0x695b('0x34')]['find']({'where':{'id':_0x1d0317[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x94')],'as':'List','include':[{'model':db[_0x695b('0x85')],'as':_0x695b('0x95'),'where':_0xe619af,'limit':0x1,'order':[[_0x695b('0x89'),_0x695b('0x96')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x695b('0x16')](handleEntityNotFound(_0x11cde9,null))[_0x695b('0x16')](function(_0x15feeb){if(_0x15feeb&&_0x15feeb['List']){_0x4a6254[_0x695b('0x97')]=_0x15feeb;_0x4a6254['applications']=_0x15feeb['Applications'];_0x4a6254[_0x695b('0x98')]=_0x15feeb[_0x695b('0x99')];_0x4a6254[_0x695b('0x9a')]=_[_0x695b('0x9b')](_0x4a6254[_0x695b('0x9a')],[_0x695b('0x9c')],[_0x695b('0x9d')]);if(_0x4a6254[_0x695b('0x97')]['Applications']){delete _0x4a6254[_0x695b('0x97')]['Applications'];}if(_0x4a6254[_0x695b('0x97')][_0x695b('0x99')]&&_0x4a6254[_0x695b('0x97')][_0x695b('0x99')]['Contacts'][_0x695b('0x5d')]){return _0x4a6254[_0x695b('0x97')][_0x695b('0x99')][_0x695b('0x95')][0x0];}var _0x1819a2=_[_0x695b('0xd')](_0x1d0317['body'],{'firstName':_0x1d0317[_0x695b('0x50')][_0x695b('0x8c')],'ListId':_0x15feeb[_0x695b('0x8b')]});_0x1819a2[_0x1d0317[_0x695b('0x50')][_0x695b('0x93')]]=_0x1d0317[_0x695b('0x50')][_0x695b('0x8c')];return db['CmContact'][_0x695b('0x4f')](_0x1819a2,{'fields':_0x937e4f,'raw':!![]});}})[_0x695b('0x16')](handleEntityNotFound(_0x11cde9,null))['then'](function(_0x2f3b43){_0x4a6254[_0x695b('0x9e')]=_0x2f3b43;var _0x254c4f=_0x1d0317['body']['customerIp'];if(_0x1d0317[_0x695b('0x82')][_0x695b('0x9f')]){_0x254c4f=_0x1d0317[_0x695b('0x82')][_0x695b('0x9f')];}else if(_0x1d0317['headers'][_0x695b('0xa0')]){_0x254c4f=_[_0x695b('0xa1')](_0x1d0317[_0x695b('0x82')][_0x695b('0xa0')][_0x695b('0xa2')](','));}if(_0x2f3b43){var _0x1ca6cc={'ContactId':_0x2f3b43['id'],'ChatWebsiteId':_0x1d0317[_0x695b('0x4b')]['id'],'from':(_0x2f3b43[_0x695b('0xa3')]||'')+'\x20'+(_0x2f3b43['lastName']||''),'customerIp':_0x254c4f,'customerPort':_0x1d0317[_0x695b('0x82')][_0x695b('0xa4')]?_0x1d0317[_0x695b('0x82')]['x-real-port']:null,'referer':_0x1d0317['body'][_0x695b('0xa5')],'browserName':_0x53ab26[_0x695b('0xa6')]['name']&&_0x53ab26[_0x695b('0xa6')]['version']?util[_0x695b('0xa7')]('%s\x20%s',_0x53ab26['browser']['name'],_0x53ab26[_0x695b('0xa6')]['version']):_0x695b('0xa8'),'browserVersion':_0x53ab26[_0x695b('0xa6')][_0x695b('0xa9')]||'unknown','osName':util[_0x695b('0xa7')](_0x695b('0xaa'),_0x53ab26['os'][_0x695b('0x2f')],_0x53ab26['os']['version']),'osVersion':_0x53ab26['os'][_0x695b('0xa9')],'deviceModel':_0x53ab26[_0x695b('0xab')][_0x695b('0x37')]&&_0x53ab26[_0x695b('0xab')][_0x695b('0xac')]?util[_0x695b('0xa7')](_0x695b('0xad'),_0x53ab26[_0x695b('0xab')]['model'],_0x53ab26[_0x695b('0xab')][_0x695b('0xac')],_0x53ab26[_0x695b('0xab')][_0x695b('0x35')]):null,'deviceVendor':_0x53ab26['device'][_0x695b('0xac')],'deviceType':_0x53ab26['device'][_0x695b('0x35')],'formData':JSON[_0x695b('0xae')](_0x1d0317[_0x695b('0x50')])};var _0x4c1b9b={'ChatWebsiteId':_0x1d0317['params']['id'],'closed':![]};if(_0x1d0317['body']['threadId']){_0x4c1b9b[_0x695b('0xaf')]=_0x1d0317[_0x695b('0x50')][_0x695b('0xaf')];return db['ChatInteraction'][_0x695b('0x57')]({'where':_0x4c1b9b})['then'](function(_0x423044){if(_0x423044){return[_0x423044,![]];}_0x1ca6cc[_0x695b('0xaf')]=_0x1d0317['body'][_0x695b('0xaf')];_0x1ca6cc['externalUrl']=_0x1d0317[_0x695b('0x50')]['externalUrl'];return db['ChatInteraction'][_0x695b('0x4f')](_0x1ca6cc)[_0x695b('0x16')](function(_0x3bb880){return[_0x3bb880,!![]];});});}_0x4c1b9b[_0x695b('0xb0')]=_0x2f3b43['id'];if(_0x1d0317['body']['interaction']&&_0x1d0317[_0x695b('0x50')][_0x695b('0xb1')]['id']){_0x4c1b9b['id']=_0x1d0317[_0x695b('0x50')][_0x695b('0xb1')]['id'];return db['ChatInteraction'][_0x695b('0x57')]({'where':_0x4c1b9b})[_0x695b('0x16')](function(_0x7bf4c6){if(_0x7bf4c6){return[_0x7bf4c6,![]];}return db[_0x695b('0xb2')][_0x695b('0x4f')](_0x1ca6cc)[_0x695b('0x16')](function(_0x253dc1){return[_0x253dc1,!![]];});});}return db[_0x695b('0xb2')][_0x695b('0x4f')](_0x1ca6cc)[_0x695b('0x16')](function(_0x5e0b67){return[_0x5e0b67,!![]];});}})[_0x695b('0xb3')](function(_0x5962d2,_0x13ba4d){if(_0x5962d2){_0x3a90f7=_0x13ba4d;if(!_0x13ba4d){var _0x46096b={'from':(_0x4a6254[_0x695b('0x9e')][_0x695b('0xa3')]||'')+'\x20'+(_0x4a6254[_0x695b('0x9e')][_0x695b('0xb4')]||'')};if(_0x1d0317[_0x695b('0x50')]['threadId']&&_0x1d0317['body'][_0x695b('0xb5')]&&_0x1d0317['body']['threadId']!=_0x1d0317[_0x695b('0x50')]['messageId']){_0x46096b[_0x695b('0xaf')]=_0x1d0317['body'][_0x695b('0xb5')];}return _0x5962d2[_0x695b('0x2a')](_0x46096b);}else{return _0x5962d2;}}})[_0x695b('0x16')](function(_0x81455e){_0x4a6254[_0x695b('0xb1')]=_0x81455e['get']({'plain':!![]});_0x4a6254[_0x695b('0xb1')][_0x695b('0xb6')]=_0x3a90f7;if(_0x4a6254[_0x695b('0xb1')][_0x695b('0xb6')]){if(_0x4a6254[_0x695b('0x97')][_0x695b('0xb7')]){_0x4a6254[_0x695b('0x9a')][_0x695b('0xb8')]({'id':0x0,'priority':_0x4a6254[_0x695b('0x9a')][_0x695b('0x5d')]+0x1,'app':_0x695b('0xb9'),'appdata':'unmanaged','interval':_0x695b('0xba')});}}return db[_0x695b('0xbb')][_0x695b('0x4f')]({'body':_0x1d0317[_0x695b('0x50')][_0x695b('0x50')],'ChatWebsiteId':_0x1d0317['params']['id'],'ChatInteractionId':_0x81455e['id'],'direction':'in','ContactId':_0x4a6254[_0x695b('0x9e')]['id'],'AttachmentId':_0x1d0317['body'][_0x695b('0xbc')]});})[_0x695b('0x16')](function(_0x58f198){_0x4a6254[_0x695b('0x1e')]=_0x58f198;if(_0x4a6254[_0x695b('0xb1')][_0x695b('0xbd')]){return db[_0x695b('0xbe')][_0x695b('0x57')]({'attributes':['id',_0x695b('0x2f')],'where':{'id':_0x4a6254['interaction'][_0x695b('0xbd')]}})['then'](function(_0x5ad216){if(_0x5ad216){_0x4a6254[_0x695b('0x9a')][_0x695b('0xbf')]({'id':0x0,'priority':0x0,'app':_0x695b('0xc0'),'appdata':_0x5ad216['name']+','+(_0x4a6254[_0x695b('0x97')][_0x695b('0xc1')]||0xa),'interval':_0x695b('0xba')});_0x4a6254['forcedOwnership']=!![];}return respondWithRpcPromise(_0x695b('0xc2'),_0x695b('0xc3'),_0x4a6254);});}return respondWithRpcPromise('Start',_0x695b('0xc3'),_0x4a6254);})['then'](function(_0x3952e1){respondWithRpcPromise('EventManager',_0x695b('0xc4'),{'event':_0x695b('0x80'),'message':_0x3952e1},client9002);return _0x3952e1;})[_0x695b('0x16')](respondWithResult(_0x11cde9,null))[_0x695b('0x20')](handleError(_0x11cde9,null));};exports['offline']=function(_0x47c763,_0x1c913c){var _0x91c4e5,_0x3d8361,_0x51de58;var _0x5712bc=[];var _0x3babf7={};var _0x3f01fe=_0x47c763[_0x695b('0xc5')]||[];var _0x37c31c=[];var _0x3b4d4f;return db[_0x695b('0x85')]['describe']()['then'](function(_0x51165b){if(!_0x51165b){throw new db[(_0x695b('0x86'))][(_0x695b('0x8d'))]('no\x20available\x20attributes');}_0x5712bc=_[_0x695b('0xc6')](_[_0x695b('0x4c')](_0x51165b),[_0x695b('0x88'),'updatedAt',_0x695b('0x8a'),'ListId']);if(_0x47c763[_0x695b('0x50')]['id']){delete _0x47c763['body']['id'];}if(_[_0x695b('0x78')](_0x47c763['body'][_0x695b('0x8c')])){throw _0x1c913c[_0x695b('0x22')](0x1f4)[_0x695b('0x30')](new db[(_0x695b('0x86'))][(_0x695b('0x8d'))]('from\x20is\x20mandatory'));}if(_[_0x695b('0x78')](_0x47c763[_0x695b('0x50')]['body'])||_0x47c763[_0x695b('0x50')][_0x695b('0x50')]===''){throw _0x1c913c[_0x695b('0x22')](0x1f4)[_0x695b('0x30')](new db[(_0x695b('0x86'))][(_0x695b('0x8d'))](_0x695b('0x8f')));}if(_['isNil'](_0x47c763[_0x695b('0x50')][_0x695b('0xc7')])){throw _0x1c913c['status'](0x1f4)[_0x695b('0x30')](new db[(_0x695b('0x86'))][(_0x695b('0x8d'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5712bc));}if(!_[_0x695b('0x91')](_0x5712bc,_0x47c763[_0x695b('0x50')][_0x695b('0xc7')])){throw _0x1c913c[_0x695b('0x22')](0x1f4)['send'](new db['Sequelize'][(_0x695b('0x8d'))](_0x695b('0xc8')+_0x5712bc));}_0x3babf7[_0x47c763['body'][_0x695b('0xc7')]]=_0x47c763[_0x695b('0x50')][_0x695b('0x8c')];})[_0x695b('0x16')](function(){return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x47c763[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x94')],'as':_0x695b('0x99')},{'model':db['MailAccount'],'as':_0x695b('0xc9')}]});})[_0x695b('0x16')](handleEntityNotFound(_0x1c913c,null))[_0x695b('0x16')](function(_0x5a0ef5){if(_0x5a0ef5&&_0x5a0ef5['List']){_0x3d8361=_0x5a0ef5;var _0x541e45=_[_0x695b('0xd')](_0x47c763[_0x695b('0x50')],{'firstName':_0x47c763['body'][_0x695b('0x8c')],'phone':_0x47c763[_0x695b('0x50')][_0x695b('0x8c')],'ListId':_0x5a0ef5[_0x695b('0x8b')]});_0x541e45[_0x47c763['body'][_0x695b('0xc7')]]=_0x47c763['body'][_0x695b('0x8c')];return db[_0x695b('0x85')][_0x695b('0xca')]({'where':_0x3babf7,'defaults':_0x541e45});}})[_0x695b('0xb3')](function(_0xcf7387){if(_0xcf7387){_0x51de58=_0xcf7387;var _0x2f0a61=fs['readFileSync'](path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0xcb')),_0x695b('0xcc'));var _0xae9b92=ejs['render'](_0x2f0a61,{'body':_[_0x695b('0xcd')](_0x47c763[_0x695b('0x50')]['body']),'bodyTitle':_0x3d8361[_0x695b('0xce')]});return db[_0x695b('0xcf')][_0x695b('0x4f')]({'body':_0xae9b92,'plainBody':htmlToText[_0x695b('0xd0')](_0xae9b92),'ContactId':_0xcf7387['id'],'ChatWebsiteId':_0x3d8361['id']});}})[_0x695b('0x16')](function(_0x18cf5){_0x3b4d4f=_0x18cf5;if(_0x3f01fe[_0x695b('0x5d')]){var _0x1c0e82=_0x3f01fe[_0x695b('0x38')](function(_0x1426f6){return{'name':_0x1426f6['originalname'],'basename':_0x1426f6['filename'],'type':_0x1426f6[_0x695b('0xd1')],'ChatOfflineMessageId':_0x18cf5['id']};});_0x37c31c=_0x1c0e82['map'](_0x174818=>{var _0x29c3b2={'filename':_0x174818[_0x695b('0x2f')],'path':path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0xd2'),_0x695b('0xc5'),_0x695b('0xd3'),'offline-chat',_0x174818[_0x695b('0xd4')])};return _0x29c3b2;});if(!_0x3d8361[_0x695b('0xd5')]){return db[_0x695b('0xd6')][_0x695b('0xd7')](function(_0x6484da){return db[_0x695b('0xd8')][_0x695b('0xd9')](_0x1c0e82,{'transaction':_0x6484da});});}}})['then'](function(){if(_0x3b4d4f){_0x91c4e5=_0x3b4d4f;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x695b('0xda')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x695b('0xdb')],'as':_0x695b('0xdb'),'raw':!![]}]}]});}})[_0x695b('0x16')](function(_0x6ddac6){if(_0x6ddac6&&_0x6ddac6['Smtp']&&_0x3d8361[_0x695b('0xdc')]&&_0x3d8361[_0x695b('0xdd')]){var _0x3a5575=_0x6ddac6['getSmtpOptions']();return respondWithRpcPromise(_0x695b('0xde'),_0x695b('0xdf'),{'account':_0x3a5575,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x6ddac6[_0x695b('0x2f')],_0x6ddac6[_0x695b('0xe0')]||_0x6ddac6[_0x695b('0xe1')]['user']),'to':_0x3d8361[_0x695b('0xdd')],'subject':_0x3d8361[_0x695b('0xe2')],'html':_0x91c4e5[_0x695b('0x50')],'attachments':_0x37c31c}},client9003)[_0x695b('0x16')](function(){return _0x91c4e5;})[_0x695b('0x20')](function(_0x49311e){logger[_0x695b('0x1c')](_0x49311e);});}})[_0x695b('0x16')](function(){if(_0x3d8361&&_0x3d8361[_0x695b('0xd5')]&&_0x3d8361[_0x695b('0xe3')]){var _0x1a8df4=[];if(_0x3f01fe['length']){_0x1a8df4=_0x3f01fe[_0x695b('0x38')](function(_0x24f29d){return{'name':_0x24f29d['originalname'],'basename':_0x24f29d['filename'],'type':_0x24f29d[_0x695b('0xd1')],'ChatOfflineMessageId':_0x3b4d4f['id']};});}var _0x19d1a6;if(!_[_0x695b('0x78')](_0x3d8361[_0x695b('0xe4')])){var _0x41dbc0=_[_0x695b('0x38')](_0x47c763[_0x695b('0x50')],function(_0x2af248){return _0x2af248;});var _0x315d57=_[_0x695b('0xe5')](_0x41dbc0)[0x0];var _0x2c06f1=_['mapValues'](_0x315d57,function(_0x52f281){return _0x52f281;});_0x19d1a6=_0x2c06f1[0x1][_0x3d8361[_0x695b('0xe4')]];}var _0x58a56e={'from':_0x51de58[_0x695b('0xe0')],'firstName':_0x51de58[_0x695b('0xa3')],'lastName':_0x51de58[_0x695b('0xb4')],'mapKey':_0x695b('0xe0'),'message':{'from':_0x51de58[_0x695b('0xe0')],'to':_0x3d8361[_0x695b('0xc9')][_0x695b('0xe0')],'cc':'','subject':_[_0x695b('0x78')](_0x19d1a6)?_0x3d8361[_0x695b('0xe2')]:_0x19d1a6,'messageId':'','sentAt':new Date(),'attach':_0x1a8df4[_0x695b('0x5d')],'attachments':_0x1a8df4,'originChannel':_0x695b('0xe6'),'ChatWebsiteId':_0x3d8361['id'],'ChatOfflineMessageId':_0x91c4e5['id'],'originTo':_0x3d8361[_0x695b('0xc9')][_0x695b('0xe0')]},'body':_0x91c4e5[_0x695b('0x50')]};var _0x511095={'account':{'id':_0x3d8361['MailAccountId']},'body':_0x58a56e,'log':_0x695b('0xe7')};return respondWithRpcPromise(_0x695b('0xe7'),_0x695b('0xe8'),_0x511095,client9001)['then'](function(){return _0x91c4e5;})[_0x695b('0x20')](function(_0x2fdccc){logger[_0x695b('0x1c')](_0x2fdccc);});}return;})[_0x695b('0x16')](function(){if(_0x91c4e5){return _0x91c4e5;}})['then'](respondWithResult(_0x1c913c,null))[_0x695b('0x20')](function(_0x2a2dc7){logger['error'](_0x695b('0x20'),_0x2a2dc7);for(var _0xa8cb31 of _0x3f01fe){var _0x269a9e=path[_0x695b('0x73')](config[_0x695b('0x6e')],_0x695b('0xd2'),_0x695b('0xc5'),_0x695b('0xd3'),_0x695b('0xe9'),_0xa8cb31[_0x695b('0x66')]);fs_extra[_0x695b('0xea')](_0x269a9e)[_0x695b('0x20')](function(_0xac5cf2){logger[_0x695b('0x1c')](_0x695b('0xeb'),_0x269a9e,_0xac5cf2);});}});};exports[_0x695b('0xec')]=function(_0x5b42a2,_0x5da510){return db[_0x695b('0xb2')][_0x695b('0x57')]({'where':{'id':_0x5b42a2[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x5da510,null))[_0x695b('0x16')](function(_0x4e1ce3){if(_0x4e1ce3){return _0x4e1ce3[_0x695b('0xec')](_0x5b42a2[_0x695b('0x50')][_0x695b('0x60')],_[_0x695b('0xed')](_0x5b42a2[_0x695b('0x50')],['ids','id'])||{});}})['then'](respondWithResult(_0x5da510,null))[_0x695b('0x20')](handleError(_0x5da510,null));};exports[_0x695b('0xee')]=function(_0x1f3264,_0x43f9ba){var _0x25f421={'raw':![],'where':{}};var _0x50a788={};var _0x3e0ff1={'count':0x0,'rows':[]};return db[_0x695b('0x34')]['findOne']({'where':{'id':_0x1f3264[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x43f9ba,null))[_0x695b('0x16')](function(_0x5dff7a){if(_0x5dff7a){_0x50a788[_0x695b('0x37')]=_['keys'](db[_0x695b('0xb2')][_0x695b('0x4d')]);_0x50a788[_0x695b('0x39')]=_[_0x695b('0x4c')](_0x1f3264['query']);_0x50a788[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x50a788['model'],_0x50a788[_0x695b('0x39')]);_0x25f421[_0x695b('0x3c')]=_['intersection'](_0x50a788[_0x695b('0x37')],qs[_0x695b('0x3d')](_0x1f3264[_0x695b('0x39')]['fields']));_0x25f421['attributes']=_0x25f421[_0x695b('0x3c')][_0x695b('0x5d')]?_0x25f421[_0x695b('0x3c')]:_0x50a788[_0x695b('0x37')];if(!_0x1f3264[_0x695b('0x39')][_0x695b('0x3e')]('nolimit')){_0x25f421[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x1f3264[_0x695b('0x39')][_0x695b('0x28')]);_0x25f421['offset']=qs[_0x695b('0x27')](_0x1f3264[_0x695b('0x39')][_0x695b('0x27')]);}_0x25f421[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x1f3264[_0x695b('0x39')][_0x695b('0x41')]);_0x25f421[_0x695b('0x42')]=qs['filters'](_[_0x695b('0x43')](_0x1f3264[_0x695b('0x39')],_0x50a788[_0x695b('0x3a')]));_0x25f421[_0x695b('0x42')][_0x695b('0x5e')]=_0x5dff7a['id'];if(_0x1f3264['query']['filter']){_0x25f421[_0x695b('0x42')]=_[_0x695b('0x46')](_0x25f421[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x25f421[_0x695b('0x3c')],function(_0x2800c2){var _0x5d7501={};_0x5d7501[_0x2800c2]={'$like':'%'+_0x1f3264['query'][_0x695b('0x44')]+'%'};return _0x5d7501;})});}_0x25f421=_[_0x695b('0x46')]({},_0x25f421,_0x1f3264[_0x695b('0x47')]);return db[_0x695b('0xb2')][_0x695b('0x26')]({'where':_0x25f421['where']})[_0x695b('0x16')](function(_0x116352){_0x3e0ff1[_0x695b('0x26')]=_0x116352;if(_0x1f3264[_0x695b('0x39')][_0x695b('0x48')]){_0x25f421['include']=[{'model':db[_0x695b('0x85')],'as':'Contact','required':![]},{'model':db[_0x695b('0xbe')],'as':_0x695b('0xef'),'attributes':[_0x695b('0x2f'),'fullname',_0x695b('0xf0')],'required':![]},{'model':db[_0x695b('0xf1')],'as':_0x695b('0xf2'),'attributes':['id','name',_0x695b('0xf3')],'where':_0x1f3264['query'][_0x695b('0xf4')]?{'id':_0x1f3264[_0x695b('0x39')][_0x695b('0xf4')]}:undefined,'required':_0x1f3264['query'][_0x695b('0xf4')]?!![]:![]}];}return db[_0x695b('0xb2')]['findAll'](_0x25f421);})[_0x695b('0x16')](function(_0x3507e0){_0x3e0ff1['rows']=_0x3507e0;return _0x3e0ff1;});}})['then'](respondWithFilteredResult(_0x43f9ba,_0x25f421))['catch'](handleError(_0x43f9ba,null));};function iftimePromise(_0x288474,_0xdf18f0){return respondWithRpcPromise(_0x695b('0xf5'),'getSnippet',{'command':_0xdf18f0[_0x695b('0xf6')]?util[_0x695b('0xa7')](_0x695b('0xf7'),_0x288474[_0x695b('0xf8')],_0xdf18f0['timezone']):util[_0x695b('0xa7')](_0x695b('0xf9'),_0x288474['interval'])},client9002)[_0x695b('0x16')](function(_0x575881){var _0x14a25b=_0x575881&&_0x575881[_0x695b('0xfa')](_0x695b('0xfb'))>=0x0?!![]:![];logger[_0x695b('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xdf18f0['id'],_0x288474['id'],_0x288474[_0x695b('0xf8')],_0x14a25b?_0x695b('0xfc'):'OFFLINE',_0xdf18f0[_0x695b('0xf6')]?_0xdf18f0['timezone']:'No\x20timezone');return _0x14a25b;})[_0x695b('0x20')](function(_0x253d87){logger[_0x695b('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xdf18f0['id'],_0x288474['id'],_0x288474[_0x695b('0xf8')],util[_0x695b('0xfd')](_0x253d87,{'showHidden':![],'depth':null}),_0xdf18f0['timezone']?_0xdf18f0[_0x695b('0xf6')]:_0x695b('0xfe'));return![];});}exports[_0x695b('0xff')]=function(_0x35a7cf,_0x4ca8c8){var _0x32f940=0x0;var _0x292cec=0x0;var _0x29f2b8=![];var _0x4b485f;var _0x3deedf;return db[_0x695b('0x34')][_0x695b('0x57')]({'where':{'id':_0x35a7cf[_0x695b('0x4b')]['id']},'include':[{'model':db[_0x695b('0x100')],'as':_0x695b('0x100'),'include':[{'model':db[_0x695b('0x100')],'as':'Intervals','attributes':['id',_0x695b('0xf8')],'raw':!![]}]}]})[_0x695b('0x16')](handleEntityNotFound(_0x4ca8c8,null))['then'](function(_0x448d7d){if(_0x448d7d){_0x4b485f=_0x448d7d;return _0x448d7d[_0x695b('0x101')]({'raw':!![]});}})[_0x695b('0x16')](function(_0x236569){if(_0x4b485f){if(_0x236569){_0x3deedf=_0x236569;}}return require(_0x695b('0x70'))[_0x695b('0x71')]();})[_0x695b('0x16')](function(_0x15ea98){if(_0x15ea98){_0x292cec=_0x15ea98[_0x695b('0x102')];_0x29f2b8=_0x15ea98[_0x695b('0x72')];}})[_0x695b('0x16')](function(){return db[_0x695b('0xb2')][_0x695b('0x26')]({'where':{'closed':![]}});})[_0x695b('0x16')](function(_0x334c7b){_0x32f940=_0x334c7b;if(_0x292cec&&_0x334c7b>_0x292cec){return db[_0x695b('0x103')][_0x695b('0x5c')]({'where':{'id':0x1}})[_0x695b('0x16')](function(_0x540b44){if(_0x540b44){_0x540b44[_0x695b('0x104')]('chatLicenseExceeded');}});}})[_0x695b('0x16')](function(){if(_0x4b485f[_0x695b('0x100')]&&_0x4b485f[_0x695b('0x100')][_0x695b('0x105')]){var _0x39d369=[];for(var _0x268a24=0x0;_0x268a24<_0x4b485f[_0x695b('0x100')][_0x695b('0x105')][_0x695b('0x5d')];_0x268a24++){var _0x1f0cf2=_0x4b485f[_0x695b('0x100')][_0x695b('0x105')][_0x268a24][_0x695b('0x2c')]({'plain':!![]});_0x39d369['push'](iftimePromise(_0x1f0cf2,_0x4b485f));}return BPromise['all'](_0x39d369)[_0x695b('0x16')](function(_0x2e4eb9){return _['some'](_0x2e4eb9);});}else{return!![];}})[_0x695b('0x16')](function(_0x11643f){var _0x45bd98=fs[_0x695b('0x106')](path[_0x695b('0x73')](config[_0x695b('0x6e')],'server/files/chat/iframe.ejs'),'utf8');var _0x36496a={'remote':_0x4b485f[_0x695b('0x107')],'query':querystring[_0x695b('0xae')](_[_0x695b('0x46')](_0x4b485f[_0x695b('0x2c')]({'plain':!![]}),{'customerIp':_0x35a7cf[_0x695b('0x82')]['x-forwarded-for']||_0x35a7cf[_0x695b('0x82')][_0x695b('0x108')]||_0x35a7cf['connection'][_0x695b('0x109')]||_0x35a7cf['ip'],'referer':_0x35a7cf[_0x695b('0x82')][_0x695b('0xa5')],'openedInteractions':_0x32f940,'maxInteractions':_0x292cec,'virtual':_0x29f2b8[_0x695b('0x102')],'online':_0x11643f,'custom':_0x29f2b8}))[_0x695b('0x10a')](/'/g,'\x5c\x27')};_0x4ca8c8['send'](ejs[_0x695b('0x10b')](Mustache['render'](_0x45bd98,_0x36496a),{'proactiveActions':_0x3deedf,'alignment':_0x4b485f[_0x695b('0x10c')],'verticalAlignment':_0x4b485f[_0x695b('0x10d')],'div_color':_0x4b485f['color'],'labelText':_0x4b485f[_0x695b('0x10e')],'text_color':_0x4b485f['textColor'],'text_button_color':_0x4b485f[_0x695b('0x10f')],'button_color':_0x4b485f[_0x695b('0x110')],'background_color':_0x4b485f[_0x695b('0x111')],'hideWhenOffline':_0x4b485f[_0x695b('0x112')],'interval':_0x4b485f[_0x695b('0x113')]}));})[_0x695b('0x20')](handleError(_0x4ca8c8,null));};exports[_0x695b('0x114')]=function(_0x3bd97c,_0x20b7fb){var _0x31a0d6=_0x3bd97c[_0x695b('0x4b')]['id'];var _0x15fce2=_0x3bd97c[_0x695b('0x50')];var _0x2a9f25=0xc8;var _0x15fb59=null;return db[_0x695b('0xd6')]['transaction']({'isolationLevel':db[_0x695b('0xd6')]['Transaction'][_0x695b('0x115')][_0x695b('0x116')]},function(_0x3732ef){return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x31a0d6},'transaction':_0x3732ef})[_0x695b('0x16')](function(_0x4b555d){if(_0x4b555d){return db[_0x695b('0x117')][_0x695b('0x2b')]({'where':{'ChatWebsiteId':_0x31a0d6},'transaction':_0x3732ef})[_0x695b('0x16')](function(){var _0x4d152e=_['map'](_0x15fce2,function(_0x29b92f){_0x29b92f[_0x695b('0x5e')]=_0x31a0d6;return _0x29b92f;});return db['ChatApplication'][_0x695b('0xd9')](_0x4d152e,{'transaction':_0x3732ef});});}else{_0x2a9f25=0x194;_0x15fb59=[];}});})[_0x695b('0x16')](function(){if(_0x2a9f25!==0x194){return db[_0x695b('0x117')][_0x695b('0x118')]({'where':{'ChatWebsiteId':_0x31a0d6},'order':'priority'})[_0x695b('0x16')](function(_0x5d7406){_0x15fb59=_0x5d7406;});}})[_0x695b('0x20')](function(_0x198b27){_0x2a9f25=0x1f4;logger[_0x695b('0x1c')](_0x198b27[_0x695b('0x119')]);if(_0x198b27[_0x695b('0x2f')]){delete _0x198b27[_0x695b('0x2f')];}_0x15fb59=_0x198b27;})[_0x695b('0x11a')](function(){if(_0x15fb59===null){_0x20b7fb['sendStatus'](_0x2a9f25);}else{if(_0x2a9f25===0x1f4){_0x20b7fb[_0x695b('0x22')](_0x2a9f25)['send'](_0x15fb59);}else{_0x20b7fb[_0x695b('0x22')](_0x2a9f25)[_0x695b('0x24')](_0x15fb59);}}});};exports[_0x695b('0x11b')]=function(_0x2c10a8,_0x4f1494){var _0x5b8151={};var _0x41d525={};var _0x2e376a;var _0x456af8;return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x2c10a8['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x4f1494,null))[_0x695b('0x16')](function(_0x39edc9){if(_0x39edc9){_0x2e376a=_0x39edc9;_0x41d525[_0x695b('0x37')]=_['keys'](db[_0x695b('0x117')][_0x695b('0x4d')]);_0x41d525['query']=_[_0x695b('0x4c')](_0x2c10a8[_0x695b('0x39')]);_0x41d525[_0x695b('0x3a')]=_[_0x695b('0x3b')](_0x41d525[_0x695b('0x37')],_0x41d525[_0x695b('0x39')]);_0x5b8151[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x41d525[_0x695b('0x37')],qs['fields'](_0x2c10a8[_0x695b('0x39')]['fields']));_0x5b8151[_0x695b('0x3c')]=_0x5b8151[_0x695b('0x3c')][_0x695b('0x5d')]?_0x5b8151[_0x695b('0x3c')]:_0x41d525[_0x695b('0x37')];_0x5b8151[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x2c10a8['query'][_0x695b('0x41')]);_0x5b8151[_0x695b('0x42')]=qs[_0x695b('0x3a')](_['pick'](_0x2c10a8[_0x695b('0x39')],_0x41d525['filters']));if(_0x2c10a8[_0x695b('0x39')][_0x695b('0x44')]){_0x5b8151[_0x695b('0x42')]=_[_0x695b('0x46')](_0x5b8151[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x5b8151[_0x695b('0x3c')],function(_0x543dad){var _0x5e0613={};_0x5e0613[_0x543dad]={'$like':'%'+_0x2c10a8[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x5e0613;})});}_0x5b8151=_[_0x695b('0x46')]({},_0x5b8151,_0x2c10a8['options']);return _0x2e376a[_0x695b('0x11b')](_0x5b8151);}})[_0x695b('0x16')](function(_0x328b2a){if(_0x328b2a){_0x456af8=_0x328b2a['length'];if(!_0x2c10a8[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x5b8151[_0x695b('0x28')]=qs['limit'](_0x2c10a8[_0x695b('0x39')][_0x695b('0x28')]);_0x5b8151[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x2c10a8['query'][_0x695b('0x27')]);}return _0x2e376a[_0x695b('0x11b')](_0x5b8151);}})[_0x695b('0x16')](function(_0x2d2e14){if(_0x2d2e14){return _0x2d2e14?{'count':_0x456af8,'rows':_0x2d2e14}:null;}})[_0x695b('0x16')](respondWithResult(_0x4f1494,null))[_0x695b('0x20')](handleError(_0x4f1494,null));};exports[_0x695b('0x11c')]=function(_0x4dc607,_0x52b126){return db[_0x695b('0x11d')][_0x695b('0x57')]({'where':{'id':_0x4dc607['params']['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x52b126,null))['then'](function(_0x27a671){if(_0x27a671){return _0x27a671[_0x695b('0x11c')](_0x4dc607['body'][_0x695b('0x60')],_[_0x695b('0xed')](_0x4dc607[_0x695b('0x50')],['ids','id'])||{});}})[_0x695b('0x16')](respondWithResult(_0x52b126,null))[_0x695b('0x20')](handleError(_0x52b126,null));};exports[_0x695b('0x101')]=function(_0x55b487,_0x5a7a96){var _0x513a71={};var _0x3b54a0={};var _0x43f26f;var _0x446d27;return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x55b487[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7a96,null))[_0x695b('0x16')](function(_0x1f08d2){if(_0x1f08d2){_0x43f26f=_0x1f08d2;_0x3b54a0[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0x11e')][_0x695b('0x4d')]);_0x3b54a0[_0x695b('0x39')]=_[_0x695b('0x4c')](_0x55b487['query']);_0x3b54a0[_0x695b('0x3a')]=_['intersection'](_0x3b54a0[_0x695b('0x37')],_0x3b54a0[_0x695b('0x39')]);_0x513a71[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x3b54a0[_0x695b('0x37')],qs['fields'](_0x55b487[_0x695b('0x39')]['fields']));_0x513a71['attributes']=_0x513a71['attributes']['length']?_0x513a71[_0x695b('0x3c')]:_0x3b54a0[_0x695b('0x37')];_0x513a71[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x55b487[_0x695b('0x39')][_0x695b('0x41')]);_0x513a71[_0x695b('0x42')]=qs[_0x695b('0x3a')](_[_0x695b('0x43')](_0x55b487[_0x695b('0x39')],_0x3b54a0[_0x695b('0x3a')]));if(_0x55b487['query'][_0x695b('0x44')]){_0x513a71['where']=_['merge'](_0x513a71[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x513a71[_0x695b('0x3c')],function(_0x4516a3){var _0x312b06={};_0x312b06[_0x4516a3]={'$like':'%'+_0x55b487['query']['filter']+'%'};return _0x312b06;})});}_0x513a71=_['merge']({},_0x513a71,_0x55b487[_0x695b('0x47')]);return _0x43f26f[_0x695b('0x101')](_0x513a71);}})['then'](function(_0x514a77){if(_0x514a77){_0x446d27=_0x514a77[_0x695b('0x5d')];if(!_0x55b487[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x513a71[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x55b487[_0x695b('0x39')]['limit']);_0x513a71['offset']=qs[_0x695b('0x27')](_0x55b487[_0x695b('0x39')][_0x695b('0x27')]);}return _0x43f26f[_0x695b('0x101')](_0x513a71);}})[_0x695b('0x16')](function(_0x414f64){if(_0x414f64){return _0x414f64?{'count':_0x446d27,'rows':_0x414f64}:null;}})[_0x695b('0x16')](respondWithResult(_0x5a7a96,null))[_0x695b('0x20')](handleError(_0x5a7a96,null));};exports[_0x695b('0x11f')]=function(_0x19def8,_0x40a385){var _0x5e8710=_0x19def8[_0x695b('0x39')]['online']==='false'?_0x695b('0x120'):'onlineForm';return db[_0x695b('0x34')][_0x695b('0x57')]({'attributes':['id',_0x5e8710],'where':{'id':_0x19def8[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x40a385,null))['then'](function(_0x2ad7f9){if(_0x2ad7f9){var _0x3d3353=_0x2ad7f9[_0x5e8710];var _0x2f1b2f=_0x3d3353&&_0x3d3353[_0x695b('0x121')]?_0x3d3353[_0x695b('0x121')]:[];_0x40a385[_0x695b('0x30')]({'fromKey':_[_0x695b('0x78')](_0x3d3353[_0x695b('0x122')])?undefined:_0x3d3353[_0x695b('0x122')],'count':_0x2f1b2f[_0x695b('0x5d')],'rows':_0x2f1b2f});}})['catch'](handleError(_0x40a385,null));};exports['getOfflineMessages']=function(_0x1dbba0,_0xcad2b9){var _0x16a1e9={'raw':![],'where':{}};var _0x3ad505={};var _0x5acee5={'count':0x0,'rows':[]};return db[_0x695b('0x34')]['findOne']({'where':{'id':_0x1dbba0[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0xcad2b9,null))[_0x695b('0x16')](function(_0x2e7294){if(_0x2e7294){_0x3ad505[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0xcf')]['rawAttributes']);_0x3ad505[_0x695b('0x39')]=_[_0x695b('0x4c')](_0x1dbba0[_0x695b('0x39')]);_0x3ad505[_0x695b('0x3a')]=_['intersection'](_0x3ad505['model'],_0x3ad505['query']);_0x16a1e9[_0x695b('0x3c')]=_['intersection'](_0x3ad505['model'],qs[_0x695b('0x3d')](_0x1dbba0['query']['fields']));_0x16a1e9[_0x695b('0x3c')]=_0x16a1e9[_0x695b('0x3c')][_0x695b('0x5d')]?_0x16a1e9[_0x695b('0x3c')]:_0x3ad505[_0x695b('0x37')];if(!_0x1dbba0[_0x695b('0x39')][_0x695b('0x3e')]('nolimit')){_0x16a1e9['limit']=qs[_0x695b('0x28')](_0x1dbba0[_0x695b('0x39')][_0x695b('0x28')]);_0x16a1e9[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x1dbba0['query'][_0x695b('0x27')]);}_0x16a1e9[_0x695b('0x40')]=qs[_0x695b('0x41')](_0x1dbba0[_0x695b('0x39')][_0x695b('0x41')]);_0x16a1e9[_0x695b('0x42')]=qs[_0x695b('0x3a')](_[_0x695b('0x43')](_0x1dbba0[_0x695b('0x39')],_0x3ad505[_0x695b('0x3a')]));_0x16a1e9[_0x695b('0x42')][_0x695b('0x5e')]=_0x2e7294['id'];if(_0x1dbba0[_0x695b('0x39')]['filter']){_0x16a1e9['where']=_[_0x695b('0x46')](_0x16a1e9['where'],{'$or':_[_0x695b('0x38')](_0x16a1e9[_0x695b('0x3c')],function(_0x3fa8a7){var _0x345739={};_0x345739[_0x3fa8a7]={'$like':'%'+_0x1dbba0[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x345739;})});}_0x16a1e9=_[_0x695b('0x46')]({},_0x16a1e9,_0x1dbba0[_0x695b('0x47')]);return db[_0x695b('0xcf')][_0x695b('0x26')]({'where':_0x16a1e9['where']})['then'](function(_0x362d49){_0x5acee5[_0x695b('0x26')]=_0x362d49;if(_0x1dbba0[_0x695b('0x39')][_0x695b('0x48')]){_0x16a1e9[_0x695b('0x4e')]=[{'all':!![]}];}else{_0x16a1e9[_0x695b('0x4e')]=[{'model':db[_0x695b('0x85')],'as':'Contact','required':![]},{'model':db[_0x695b('0xd8')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x695b('0x62')](_0x16a1e9);})[_0x695b('0x16')](function(_0xa8b1fe){_0x5acee5[_0x695b('0x49')]=_0xa8b1fe;return _0x5acee5;});}})[_0x695b('0x16')](respondWithFilteredResult(_0xcad2b9,_0x16a1e9))[_0x695b('0x20')](handleError(_0xcad2b9,null));};exports[_0x695b('0x123')]=function(_0x40176c,_0x38493d){return db['ChatWebsite']['find']({'where':{'id':_0x40176c[_0x695b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38493d,null))[_0x695b('0x16')](function(_0x26053c){if(_0x26053c){return _0x26053c['addAgents'](_0x40176c['body'][_0x695b('0x60')],_[_0x695b('0xed')](_0x40176c['body'],[_0x695b('0x60'),'id'])||{})[_0x695b('0xb3')](function(_0x15ae05){for(var _0x3b9aac=0x0;_0x3b9aac<_0x40176c[_0x695b('0x50')][_0x695b('0x60')][_0x695b('0x5d')];_0x3b9aac+=0x1){socket[_0x695b('0x124')](_0x695b('0x125'),{'UserId':Number(_0x40176c[_0x695b('0x50')][_0x695b('0x60')][_0x3b9aac]),'ChatWebsiteId':Number(_0x40176c['params']['id'])});}return _0x15ae05;});}})[_0x695b('0x16')](respondWithResult(_0x38493d,null))['catch'](handleError(_0x38493d,null));};exports[_0x695b('0x126')]=function(_0x533541,_0x2dd705){return db['ChatWebsite'][_0x695b('0x57')]({'where':{'id':_0x533541[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x2dd705,null))[_0x695b('0x16')](function(_0x3edda8){if(_0x3edda8){return _0x3edda8['removeAgents'](_0x533541[_0x695b('0x39')]['ids'])[_0x695b('0x16')](function(){if(_[_0x695b('0x127')](_0x533541['query'][_0x695b('0x60')])){for(var _0x5e1ae8=0x0;_0x5e1ae8<_0x533541['query'][_0x695b('0x60')][_0x695b('0x5d')];_0x5e1ae8+=0x1){socket[_0x695b('0x124')](_0x695b('0x128'),{'UserId':Number(_0x533541[_0x695b('0x39')][_0x695b('0x60')][_0x5e1ae8]),'ChatWebsiteId':Number(_0x533541[_0x695b('0x4b')]['id'])});}}else{socket[_0x695b('0x124')](_0x695b('0x128'),{'UserId':Number(_0x533541['query'][_0x695b('0x60')]),'ChatWebsiteId':Number(_0x533541['params']['id'])});}});}})[_0x695b('0x16')](respondWithStatusCode(_0x2dd705,null))['catch'](handleError(_0x2dd705,null));};exports[_0x695b('0x129')]=function(_0x4bd1eb,_0x475971){var _0x498b68={};var _0x30f557={};var _0x47cadf;var _0x2f43ba;return db[_0x695b('0x34')][_0x695b('0x5c')]({'where':{'id':_0x4bd1eb[_0x695b('0x4b')]['id']}})[_0x695b('0x16')](handleEntityNotFound(_0x475971,null))['then'](function(_0x267bc7){if(_0x267bc7){_0x47cadf=_0x267bc7;_0x30f557[_0x695b('0x37')]=_[_0x695b('0x4c')](db[_0x695b('0xbe')][_0x695b('0x4d')]);_0x30f557['query']=_['keys'](_0x4bd1eb[_0x695b('0x39')]);_0x30f557['filters']=_['intersection'](_0x30f557[_0x695b('0x37')],_0x30f557[_0x695b('0x39')]);_0x498b68[_0x695b('0x3c')]=_[_0x695b('0x3b')](_0x30f557[_0x695b('0x37')],qs['fields'](_0x4bd1eb[_0x695b('0x39')][_0x695b('0x3d')]));_0x498b68[_0x695b('0x3c')]=_0x498b68[_0x695b('0x3c')][_0x695b('0x5d')]?_0x498b68[_0x695b('0x3c')]:_0x30f557['model'];_0x498b68[_0x695b('0x40')]=qs['sort'](_0x4bd1eb['query'][_0x695b('0x41')]);_0x498b68[_0x695b('0x42')]=qs['filters'](_[_0x695b('0x43')](_0x4bd1eb['query'],_0x30f557['filters']));if(_0x4bd1eb[_0x695b('0x39')][_0x695b('0x44')]){_0x498b68[_0x695b('0x42')]=_[_0x695b('0x46')](_0x498b68[_0x695b('0x42')],{'$or':_[_0x695b('0x38')](_0x498b68['attributes'],function(_0x3cd903){var _0x2d30e6={};_0x2d30e6[_0x3cd903]={'$like':'%'+_0x4bd1eb[_0x695b('0x39')][_0x695b('0x44')]+'%'};return _0x2d30e6;})});}_0x498b68=_[_0x695b('0x46')]({},_0x498b68,_0x4bd1eb['options']);return _0x47cadf[_0x695b('0x129')](_0x498b68);}})['then'](function(_0x12d802){if(_0x12d802){_0x2f43ba=_0x12d802['length'];if(!_0x4bd1eb[_0x695b('0x39')][_0x695b('0x3e')](_0x695b('0x3f'))){_0x498b68[_0x695b('0x28')]=qs[_0x695b('0x28')](_0x4bd1eb['query'][_0x695b('0x28')]);_0x498b68[_0x695b('0x27')]=qs[_0x695b('0x27')](_0x4bd1eb[_0x695b('0x39')][_0x695b('0x27')]);}return _0x47cadf[_0x695b('0x129')](_0x498b68);}})[_0x695b('0x16')](function(_0x43bad4){if(_0x43bad4){return _0x43bad4?{'count':_0x2f43ba,'rows':_0x43bad4}:null;}})['then'](respondWithResult(_0x475971,null))['catch'](handleError(_0x475971,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 16fad90..554bc83 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 _0xc090=['update','remove','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x1d1bfb,_0x59f312){var _0x1369d1=function(_0x26cb60){while(--_0x26cb60){_0x1d1bfb['push'](_0x1d1bfb['shift']());}};_0x1369d1(++_0x59f312);}(_0xc090,0x112));var _0x0c09=function(_0x3b78a3,_0x518f44){_0x3b78a3=_0x3b78a3-0x0;var _0x1db25c=_0xc090[_0x3b78a3];return _0x1db25c;};'use strict';var EventEmitter=require(_0x0c09('0x0'));var ChatWebsite=require(_0x0c09('0x1'))['db'][_0x0c09('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0c09('0x3')](0x0);var events={'afterCreate':_0x0c09('0x4'),'afterUpdate':_0x0c09('0x5'),'afterDestroy':_0x0c09('0x6')};function emitEvent(_0x260c36){return function(_0x11984f,_0x487f03,_0x2e968b){ChatWebsiteEvents[_0x0c09('0x7')](_0x260c36+':'+_0x11984f['id'],_0x11984f);ChatWebsiteEvents['emit'](_0x260c36,_0x11984f);_0x2e968b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0c09('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa41a=['remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update'];(function(_0xe3390b,_0x1daddd){var _0x22658c=function(_0x1bd38f){while(--_0x1bd38f){_0xe3390b['push'](_0xe3390b['shift']());}};_0x22658c(++_0x1daddd);}(_0xa41a,0x6b));var _0xaa41=function(_0x40879b,_0x65ac13){_0x40879b=_0x40879b-0x0;var _0x581594=_0xa41a[_0x40879b];return _0x581594;};'use strict';var EventEmitter=require(_0xaa41('0x0'));var ChatWebsite=require(_0xaa41('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xaa41('0x2')](0x0);var events={'afterCreate':_0xaa41('0x3'),'afterUpdate':_0xaa41('0x4'),'afterDestroy':_0xaa41('0x5')};function emitEvent(_0x37c7a1){return function(_0x3168be,_0x42896b,_0x251efa){ChatWebsiteEvents['emit'](_0x37c7a1+':'+_0x3168be['id'],_0x3168be);ChatWebsiteEvents[_0xaa41('0x6')](_0x37c7a1,_0x3168be);_0x251efa(null);};}for(var e in events){if(events[_0xaa41('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index d045435..af97716 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 _0x4735=['api','moment','bluebird','path','rimraf','./chatWebsite.attributes','define','chat_websites','util'];(function(_0x38d64b,_0x56a8ac){var _0x58868c=function(_0x4a06e0){while(--_0x4a06e0){_0x38d64b['push'](_0x38d64b['shift']());}};_0x58868c(++_0x56a8ac);}(_0x4735,0xb3));var _0x5473=function(_0x4b32dc,_0x2e8345){_0x4b32dc=_0x4b32dc-0x0;var _0x3643f2=_0x4735[_0x4b32dc];return _0x3643f2;};'use strict';var _=require('lodash');var util=require(_0x5473('0x0'));var logger=require('../../config/logger')(_0x5473('0x1'));var moment=require(_0x5473('0x2'));var BPromise=require(_0x5473('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5473('0x4'));var rimraf=require(_0x5473('0x5'));var config=require('../../config/environment');var attributes=require(_0x5473('0x6'));module['exports']=function(_0x503b15,_0x3927ec){return _0x503b15[_0x5473('0x7')]('ChatWebsite',attributes,{'tableName':_0x5473('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7e3=['rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x49057a,_0x4c6add){var _0x54b2d0=function(_0x37e906){while(--_0x37e906){_0x49057a['push'](_0x49057a['shift']());}};_0x54b2d0(++_0x4c6add);}(_0xa7e3,0x19e));var _0x3a7e=function(_0x12b944,_0x3f2c46){_0x12b944=_0x12b944-0x0;var _0xa542bf=_0xa7e3[_0x12b944];return _0xa542bf;};'use strict';var _=require('lodash');var util=require(_0x3a7e('0x0'));var logger=require(_0x3a7e('0x1'))('api');var moment=require(_0x3a7e('0x2'));var BPromise=require(_0x3a7e('0x3'));var rp=require(_0x3a7e('0x4'));var fs=require('fs');var path=require(_0x3a7e('0x5'));var rimraf=require(_0x3a7e('0x6'));var config=require('../../config/environment');var attributes=require(_0x3a7e('0x7'));module[_0x3a7e('0x8')]=function(_0x375637,_0x43b9fe){return _0x375637[_0x3a7e('0x9')](_0x3a7e('0xa'),attributes,{'tableName':_0x3a7e('0xb'),'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 729ed98..341cb25 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 _0x16b2=['rpc','jayson/promise','client','http','defaults','redis','localhost','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x16b2,0x13f));var _0x216b=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x16b2[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x216b('0x0'));var util=require(_0x216b('0x1'));var moment=require(_0x216b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x216b('0x3'));var db=require(_0x216b('0x4'))['db'];var utils=require(_0x216b('0x5'));var logger=require('../../config/logger')(_0x216b('0x6'));var config=require('../../config/environment');var jayson=require(_0x216b('0x7'));var client=jayson[_0x216b('0x8')][_0x216b('0x9')]({'port':0x232a});config['redis']=_[_0x216b('0xa')](config[_0x216b('0xb')],{'host':_0x216b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5db6ef,_0xeb068a,_0x44b8d5){return new BPromise(function(_0x203994,_0x26b328){return client[_0x216b('0xd')](_0x5db6ef,_0x44b8d5)[_0x216b('0xe')](function(_0x142884){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xeb068a,_0x216b('0xf'));logger[_0x216b('0x10')](_0x216b('0x11'),_0xeb068a,_0x216b('0xf'),JSON[_0x216b('0x12')](_0x142884));if(_0x142884[_0x216b('0x13')]){if(_0x142884[_0x216b('0x13')][_0x216b('0x14')]===0x1f4){logger['error'](_0x216b('0x15'),_0xeb068a,_0x142884[_0x216b('0x13')][_0x216b('0x16')]);return _0x26b328(_0x142884['error'][_0x216b('0x16')]);}logger[_0x216b('0x13')](_0x216b('0x15'),_0xeb068a,_0x142884['error'][_0x216b('0x16')]);return _0x203994(_0x142884['error'][_0x216b('0x16')]);}else{logger[_0x216b('0x17')](_0x216b('0x15'),_0xeb068a,_0x216b('0xf'));_0x203994(_0x142884[_0x216b('0x18')][_0x216b('0x16')]);}})['catch'](function(_0x250ea8){logger[_0x216b('0x13')](_0x216b('0x15'),_0xeb068a,_0x250ea8);_0x26b328(_0x250ea8);});});}
\ No newline at end of file
+var _0x2ee1=['socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x34882f,_0x601a99){var _0x455929=function(_0x463c7c){while(--_0x463c7c){_0x34882f['push'](_0x34882f['shift']());}};_0x455929(++_0x601a99);}(_0x2ee1,0xee));var _0x12ee=function(_0xfe3abe,_0x2a0817){_0xfe3abe=_0xfe3abe-0x0;var _0x4935d7=_0x2ee1[_0xfe3abe];return _0x4935d7;};'use strict';var _=require(_0x12ee('0x0'));var util=require(_0x12ee('0x1'));var moment=require('moment');var BPromise=require(_0x12ee('0x2'));var rs=require(_0x12ee('0x3'));var fs=require('fs');var Redis=require(_0x12ee('0x4'));var db=require(_0x12ee('0x5'))['db'];var utils=require(_0x12ee('0x6'));var logger=require('../../config/logger')(_0x12ee('0x7'));var config=require(_0x12ee('0x8'));var jayson=require(_0x12ee('0x9'));var client=jayson[_0x12ee('0xa')][_0x12ee('0xb')]({'port':0x232a});config[_0x12ee('0xc')]=_[_0x12ee('0xd')](config[_0x12ee('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x12ee('0xe'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x12ee('0xf')](socket);function respondWithRpcPromise(_0x54fc48,_0x494690,_0x4ce6be){return new BPromise(function(_0x4b1e9c,_0x1be7b8){return client[_0x12ee('0x10')](_0x54fc48,_0x4ce6be)[_0x12ee('0x11')](function(_0x26f509){logger['info'](_0x12ee('0x12'),_0x494690,_0x12ee('0x13'));logger[_0x12ee('0x14')](_0x12ee('0x15'),_0x494690,_0x12ee('0x13'),JSON[_0x12ee('0x16')](_0x26f509));if(_0x26f509[_0x12ee('0x17')]){if(_0x26f509[_0x12ee('0x17')][_0x12ee('0x18')]===0x1f4){logger[_0x12ee('0x17')](_0x12ee('0x12'),_0x494690,_0x26f509[_0x12ee('0x17')][_0x12ee('0x19')]);return _0x1be7b8(_0x26f509[_0x12ee('0x17')][_0x12ee('0x19')]);}logger[_0x12ee('0x17')](_0x12ee('0x12'),_0x494690,_0x26f509[_0x12ee('0x17')]['message']);return _0x4b1e9c(_0x26f509[_0x12ee('0x17')][_0x12ee('0x19')]);}else{logger[_0x12ee('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x494690,_0x12ee('0x13'));_0x4b1e9c(_0x26f509['result'][_0x12ee('0x19')]);}})[_0x12ee('0x1b')](function(_0x5d82ae){logger['error'](_0x12ee('0x12'),_0x494690,_0x5d82ae);_0x1be7b8(_0x5d82ae);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 075fb22..b782bce 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 _0x97c8=['update','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x97c8,0x138));var _0x897c=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0x97c8[_0x366e51];return _0x4e23e3;};'use strict';var ChatWebsiteEvents=require(_0x897c('0x0'));var events=[_0x897c('0x1'),_0x897c('0x2'),_0x897c('0x3')];function createListener(_0x3d4412,_0x2b483d){return function(_0x5cc6bf){_0x2b483d['emit'](_0x3d4412,_0x5cc6bf);};}function removeListener(_0x508370,_0x26410c){return function(){ChatWebsiteEvents['removeListener'](_0x508370,_0x26410c);};}exports[_0x897c('0x4')]=function(_0x178536){for(var _0x22babf=0x0,_0x150ef1=events[_0x897c('0x5')];_0x22babf<_0x150ef1;_0x22babf++){var _0x50c84c=events[_0x22babf];var _0x5ea341=createListener(_0x897c('0x6')+_0x50c84c,_0x178536);ChatWebsiteEvents['on'](_0x50c84c,_0x5ea341);}};
\ No newline at end of file
+var _0x4870=['register','chatWebsite:','remove','update','emit'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4870,0xc0));var _0x0487=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4870[_0x1203f];return _0x365f0a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x0487('0x0'),_0x0487('0x1')];function createListener(_0x122aa9,_0x183e62){return function(_0x4c5719){_0x183e62[_0x0487('0x2')](_0x122aa9,_0x4c5719);};}function removeListener(_0x843e2e,_0x237fed){return function(){ChatWebsiteEvents['removeListener'](_0x843e2e,_0x237fed);};}exports[_0x0487('0x3')]=function(_0x27fb54){for(var _0x5b149d=0x0,_0x20f637=events['length'];_0x5b149d<_0x20f637;_0x5b149d++){var _0x240d38=events[_0x5b149d];var _0x3088b9=createListener(_0x0487('0x4')+_0x240d38,_0x27fb54);ChatWebsiteEvents['on'](_0x240d38,_0x3088b9);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 8baee32..1f4f4ae 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 _0x786d=['attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','single','server/files/images/avatars/','file','addAvatar','originalname','/:id/customer_avatar','notify','server/files'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x786d,0x94));var _0xd786=function(_0x51edb1,_0xaf0da4){_0x51edb1=_0x51edb1-0x0;var _0x1f3772=_0x786d[_0x51edb1];return _0x1f3772;};'use strict';var multer=require('multer');var util=require(_0xd786('0x0'));var path=require(_0xd786('0x1'));var timeout=require(_0xd786('0x2'));var express=require(_0xd786('0x3'));var router=express['Router']();var fs_extra=require(_0xd786('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd786('0x5'));var config=require(_0xd786('0x6'));var controller=require('./chatWebsite.controller');router[_0xd786('0x7')]('/',auth[_0xd786('0x8')](),controller[_0xd786('0x9')]);router['get'](_0xd786('0xa'),auth[_0xd786('0x8')](),controller[_0xd786('0xb')]);router[_0xd786('0x7')](_0xd786('0xc'),auth[_0xd786('0x8')](),controller[_0xd786('0xd')]);router[_0xd786('0x7')](_0xd786('0xe'),auth[_0xd786('0x8')](),controller[_0xd786('0xf')]);router['get'](_0xd786('0x10'),auth[_0xd786('0x8')](),controller[_0xd786('0x11')]);router['get']('/:id/logo',controller['getLogo']);router[_0xd786('0x7')](_0xd786('0x12'),controller[_0xd786('0x13')]);router[_0xd786('0x7')]('/:id/customer_avatar',controller[_0xd786('0x14')]);router['get'](_0xd786('0x15'),controller[_0xd786('0x16')]);router['get'](_0xd786('0x17'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xd786('0x18'),controller['getSnippet']);router[_0xd786('0x7')](_0xd786('0x19'),auth['isAuthenticated'](),controller[_0xd786('0x1a')]);router['get']('/:id/proactive_actions',auth[_0xd786('0x8')](),controller[_0xd786('0x1b')]);router['get']('/:id/fields',controller['getFields']);router[_0xd786('0x7')]('/:id/offline_messages',auth[_0xd786('0x8')](),controller[_0xd786('0x1c')]);router[_0xd786('0x7')](_0xd786('0x1d'),auth[_0xd786('0x8')](),controller[_0xd786('0x1e')]);router['post']('/',auth[_0xd786('0x8')](),controller[_0xd786('0x1f')]);router[_0xd786('0x20')](_0xd786('0xe'),auth['isAuthenticated'](),controller[_0xd786('0x21')]);router[_0xd786('0x20')](_0xd786('0x10'),auth[_0xd786('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x38a6d1,_0x4cabcd,_0x120ae6){_0x120ae6(null,path[_0xd786('0x23')](config[_0xd786('0x24')],_0xd786('0x25')));},'filename':function(_0x17b9b6,_0x36a818,_0x41e2ba){_0x41e2ba(null,util[_0xd786('0x26')](_0xd786('0x27'),Date[_0xd786('0x28')](),_0x36a818['originalname']));}})});router[_0xd786('0x20')](_0xd786('0x29'),upload[_0xd786('0x2a')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x2a2d1c,_0x1daa49,_0x516415){_0x516415(null,path['join'](config['root'],_0xd786('0x2b')));},'filename':function(_0x50c512,_0x46fef5,_0x4398f2){_0x4398f2(null,util[_0xd786('0x26')](_0xd786('0x27'),Date[_0xd786('0x28')](),_0x46fef5['originalname']));}})});router[_0xd786('0x20')](_0xd786('0x12'),upload[_0xd786('0x2a')](_0xd786('0x2c')),controller[_0xd786('0x2d')]);var upload=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x278199,_0x2ad61e,_0x31230a){_0x31230a(null,path[_0xd786('0x23')](config[_0xd786('0x24')],'server/files/images/avatars/'));},'filename':function(_0x4d18c9,_0x3c27ad,_0x218194){_0x218194(null,util[_0xd786('0x26')](_0xd786('0x27'),Date[_0xd786('0x28')](),_0x3c27ad[_0xd786('0x2e')]));}})});router[_0xd786('0x20')](_0xd786('0x2f'),upload['single'](_0xd786('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x59cc00,_0x22901e,_0x40ef72){_0x40ef72(null,path[_0xd786('0x23')](config[_0xd786('0x24')],_0xd786('0x2b')));},'filename':function(_0x14755c,_0x2e53bc,_0x14310e){_0x14310e(null,util[_0xd786('0x26')]('%s-%s',Date[_0xd786('0x28')](),_0x2e53bc[_0xd786('0x2e')]));}})});router['post']('/:id/system_avatar',upload[_0xd786('0x2a')](_0xd786('0x2c')),controller['addSystemAvatar']);router[_0xd786('0x20')]('/:id/notify',controller[_0xd786('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0xd786('0x22')]({'destination':function(_0x324d11,_0x354197,_0x5cf29e){const _0x8a4e29=path['join'](config[_0xd786('0x24')],_0xd786('0x31'),_0xd786('0x32'),_0xd786('0x33'));fs_extra[_0xd786('0x34')](_0x8a4e29,function(){_0x5cf29e(null,_0x8a4e29);});},'filename':function(_0x329f29,_0x1f5ca1,_0x3aa306){const _0x6deb63=_0x1f5ca1[_0xd786('0x2e')][_0xd786('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xbabc11=path['extname'](_0x6deb63);const _0xad831a=Date[_0xd786('0x28')]()+'-'+_0x6deb63[_0xd786('0x35')](_0xbabc11,'')+_0xbabc11;_0x3aa306(null,_0xad831a);}})});router[_0xd786('0x20')](_0xd786('0x36'),offlineUploadMulter[_0xd786('0x37')](),controller[_0xd786('0x38')]);router[_0xd786('0x20')]('/:id/interactions',auth[_0xd786('0x8')](),controller[_0xd786('0x39')]);router[_0xd786('0x20')](_0xd786('0x19'),auth[_0xd786('0x8')](),controller[_0xd786('0x3a')]);router[_0xd786('0x20')](_0xd786('0x3b'),auth['isAuthenticated'](),controller[_0xd786('0x3c')]);router[_0xd786('0x20')]('/:id/users',auth[_0xd786('0x8')](),controller[_0xd786('0x3d')]);router['put'](_0xd786('0xc'),auth[_0xd786('0x8')](),controller[_0xd786('0x3e')]);router[_0xd786('0x3f')]('/:id',auth[_0xd786('0x8')](),controller[_0xd786('0x40')]);router[_0xd786('0x3f')](_0xd786('0xe'),auth[_0xd786('0x8')](),controller[_0xd786('0x41')]);router[_0xd786('0x3f')](_0xd786('0x10'),auth[_0xd786('0x8')](),controller['removeAnswers']);router['delete'](_0xd786('0x1d'),auth[_0xd786('0x8')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7c79=['/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','server/files/images/avatars/','now','single','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','/:id/offline','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','destroy','/:id/dispositions','removeDispositions','delete','removeAnswers','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7c79,0x177));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x97c7('0x0'));var util=require(_0x97c7('0x1'));var path=require(_0x97c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x97c7('0x3'));var router=express[_0x97c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x97c7('0x5'));var config=require(_0x97c7('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x97c7('0x7')](),controller[_0x97c7('0x8')]);router[_0x97c7('0x9')]('/describe',auth[_0x97c7('0x7')](),controller[_0x97c7('0xa')]);router[_0x97c7('0x9')](_0x97c7('0xb'),auth[_0x97c7('0x7')](),controller['show']);router[_0x97c7('0x9')]('/:id/dispositions',auth[_0x97c7('0x7')](),controller[_0x97c7('0xc')]);router['get'](_0x97c7('0xd'),auth[_0x97c7('0x7')](),controller[_0x97c7('0xe')]);router[_0x97c7('0x9')](_0x97c7('0xf'),controller[_0x97c7('0x10')]);router['get']('/:id/avatar',controller[_0x97c7('0x11')]);router['get'](_0x97c7('0x12'),controller['getCustomerAvatar']);router[_0x97c7('0x9')](_0x97c7('0x13'),controller[_0x97c7('0x14')]);router['get']('/:id/interactions',auth[_0x97c7('0x7')](),controller[_0x97c7('0x15')]);router['get']('/:id/snippet',controller[_0x97c7('0x16')]);router['get'](_0x97c7('0x17'),auth['isAuthenticated'](),controller[_0x97c7('0x18')]);router[_0x97c7('0x9')](_0x97c7('0x19'),auth['isAuthenticated'](),controller[_0x97c7('0x1a')]);router['get'](_0x97c7('0x1b'),controller[_0x97c7('0x1c')]);router[_0x97c7('0x9')]('/:id/offline_messages',auth[_0x97c7('0x7')](),controller[_0x97c7('0x1d')]);router[_0x97c7('0x9')](_0x97c7('0x1e'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x1f')]);router[_0x97c7('0x20')]('/',auth['isAuthenticated'](),controller[_0x97c7('0x21')]);router[_0x97c7('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x97c7('0x22')]);router[_0x97c7('0x20')]('/:id/canned_answers',auth[_0x97c7('0x7')](),controller[_0x97c7('0x23')]);var upload=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x9ba20f,_0x525c26,_0x8b9744){_0x8b9744(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x27')));},'filename':function(_0x145674,_0x26165a,_0x564f23){_0x564f23(null,util[_0x97c7('0x28')](_0x97c7('0x29'),Date['now'](),_0x26165a[_0x97c7('0x2a')]));}})});router[_0x97c7('0x20')](_0x97c7('0xf'),upload['single'](_0x97c7('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x2b7e46,_0x70aa3b,_0x655608){_0x655608(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x2c')));},'filename':function(_0xaf1b91,_0x2bba89,_0x4a7a7b){_0x4a7a7b(null,util[_0x97c7('0x28')](_0x97c7('0x29'),Date[_0x97c7('0x2d')](),_0x2bba89[_0x97c7('0x2a')]));}})});router[_0x97c7('0x20')]('/:id/avatar',upload[_0x97c7('0x2e')]('file'),controller[_0x97c7('0x2f')]);var upload=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x1face4,_0x52bb57,_0x3e3aed){_0x3e3aed(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x2c')));},'filename':function(_0x2b6f98,_0x3a4662,_0x283212){_0x283212(null,util[_0x97c7('0x28')]('%s-%s',Date[_0x97c7('0x2d')](),_0x3a4662[_0x97c7('0x2a')]));}})});router[_0x97c7('0x20')]('/:id/customer_avatar',upload['single']('file'),controller[_0x97c7('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5790de,_0x3e4f44,_0x150bca){_0x150bca(null,path[_0x97c7('0x25')](config[_0x97c7('0x26')],_0x97c7('0x2c')));},'filename':function(_0x6dfcd2,_0x3a8608,_0x9077bf){_0x9077bf(null,util[_0x97c7('0x28')](_0x97c7('0x29'),Date['now'](),_0x3a8608['originalname']));}})});router[_0x97c7('0x20')](_0x97c7('0x13'),upload[_0x97c7('0x2e')](_0x97c7('0x2b')),controller[_0x97c7('0x31')]);router[_0x97c7('0x20')](_0x97c7('0x32'),controller[_0x97c7('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x97c7('0x24')]({'destination':function(_0x1f4036,_0xeddad9,_0x5017e){const _0x4ae10f=path[_0x97c7('0x25')](config['root'],_0x97c7('0x34'),_0x97c7('0x35'),_0x97c7('0x36'));fs_extra['ensureDir'](_0x4ae10f,function(){_0x5017e(null,_0x4ae10f);});},'filename':function(_0x8f06de,_0x58aefe,_0x431162){const _0x28e4b8=_0x58aefe[_0x97c7('0x2a')][_0x97c7('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x346812=path['extname'](_0x28e4b8);const _0x2d5149=Date['now']()+'-'+_0x28e4b8[_0x97c7('0x37')](_0x346812,'')+_0x346812;_0x431162(null,_0x2d5149);}})});router[_0x97c7('0x20')](_0x97c7('0x38'),offlineUploadMulter['any'](),controller[_0x97c7('0x39')]);router[_0x97c7('0x20')](_0x97c7('0x3a'),auth[_0x97c7('0x7')](),controller['addInteraction']);router[_0x97c7('0x20')](_0x97c7('0x17'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3b')]);router[_0x97c7('0x20')](_0x97c7('0x19'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3c')]);router[_0x97c7('0x20')](_0x97c7('0x1e'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3d')]);router['put'](_0x97c7('0xb'),auth[_0x97c7('0x7')](),controller['update']);router['delete'](_0x97c7('0xb'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x3e')]);router['delete'](_0x97c7('0x3f'),auth[_0x97c7('0x7')](),controller[_0x97c7('0x40')]);router[_0x97c7('0x41')](_0x97c7('0xd'),auth['isAuthenticated'](),controller[_0x97c7('0x42')]);router[_0x97c7('0x41')](_0x97c7('0x1e'),auth[_0x97c7('0x7')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 5738b12..bec9723 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1049=['expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x6ea93d,_0x245219){var _0x40763f=function(_0x42552b){while(--_0x42552b){_0x6ea93d['push'](_0x6ea93d['shift']());}};_0x40763f(++_0x245219);}(_0x1049,0x65));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};var beaverLogger=require('beaver-logger/server');var express=require(_0x9104('0x0'));var auth=require(_0x9104('0x1'));var config=require(_0x9104('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x118010,_0x3bf187,_0x28f83b){var _0x56510d=_0x118010[_0x9104('0x3')][_0x9104('0x4')](_0x9104('0x5'));if(!_0x56510d){throw new Error(_0x9104('0x6'));}return beaverLogger[_0x9104('0x7')]({'uri':_0x9104('0x8'),'logger':_0x56510d,'enableCors':!isProduction})(_0x118010,_0x3bf187,_0x28f83b);}router[_0x9104('0x9')](auth[_0x9104('0xa')](),clientSideLogs);module[_0x9104('0xb')]=router;
\ No newline at end of file
+var _0xa78d=['Router','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x5f46ac,_0x4aed0a){var _0xbe5805=function(_0x308582){while(--_0x308582){_0x5f46ac['push'](_0x5f46ac['shift']());}};_0xbe5805(++_0x4aed0a);}(_0xa78d,0x1ca));var _0xda78=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa78d[_0x2aea9e];return _0x430b92;};var beaverLogger=require(_0xda78('0x0'));var express=require(_0xda78('0x1'));var auth=require(_0xda78('0x2'));var config=require(_0xda78('0x3'));var router=express[_0xda78('0x4')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x481043,_0x52b72e,_0x295ac4){var _0x45f794=_0x481043[_0xda78('0x5')][_0xda78('0x6')](_0xda78('0x7'));if(!_0x45f794){throw new Error(_0xda78('0x8'));}return beaverLogger[_0xda78('0x9')]({'uri':_0xda78('0xa'),'logger':_0x45f794,'enableCors':!isProduction})(_0x481043,_0x52b72e,_0x295ac4);}router[_0xda78('0xb')](auth[_0xda78('0xc')](),clientSideLogs);module[_0xda78('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 1dd3c1c..320ae46 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 _0xd0ba=['exports','STRING','Google','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize'];(function(_0x13fd59,_0x2e05b1){var _0x2e6ce7=function(_0x519a4b){while(--_0x519a4b){_0x13fd59['push'](_0x13fd59['shift']());}};_0x2e6ce7(++_0x2e05b1);}(_0xd0ba,0xa7));var _0xad0b=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xd0ba[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0xad0b('0x0'));module[_0xad0b('0x1')]={'name':{'type':Sequelize[_0xad0b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xad0b('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad0b('0x4')](_0xad0b('0x5'),_0xad0b('0x6'))},'data1':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0x7')},'data2':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0x8')},'data3':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0x9')},'data4':{'type':Sequelize[_0xad0b('0x2')],'comment':_0xad0b('0xa')},'data5':{'type':Sequelize[_0xad0b('0xb')],'comment':_0xad0b('0xc')},'data6':{'type':Sequelize[_0xad0b('0xb')],'comment':_0xad0b('0xd')},'data7':{'type':Sequelize[_0xad0b('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x88b0=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x4723d1,_0x515d2e){var _0x335b7f=function(_0x559134){while(--_0x559134){_0x4723d1['push'](_0x4723d1['shift']());}};_0x335b7f(++_0x515d2e);}(_0x88b0,0x1e0));var _0x088b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x88b0[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x088b('0x0'));module[_0x088b('0x1')]={'name':{'type':Sequelize[_0x088b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x088b('0x3')](_0x088b('0x4'),_0x088b('0x5'),_0x088b('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x088b('0x3')](_0x088b('0x7'),_0x088b('0x8'))},'data1':{'type':Sequelize[_0x088b('0x2')],'comment':_0x088b('0x9')},'data2':{'type':Sequelize[_0x088b('0x2')],'comment':_0x088b('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x088b('0xb')},'data4':{'type':Sequelize[_0x088b('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x088b('0xc')],'comment':_0x088b('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index a324fa2..91e207c 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 _0x2493=['pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','keys','rawAttributes','find','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','from','state','base64','ascii','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','set','then','destroy','end','name','send','slice','index','map','CloudProvider','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x1621dd,_0x172229){var _0x3b0046=function(_0x53ab32){while(--_0x53ab32){_0x1621dd['push'](_0x1621dd['shift']());}};_0x3b0046(++_0x172229);}(_0x2493,0x18e));var _0x3249=function(_0x288020,_0x973011){_0x288020=_0x288020-0x0;var _0x16a4bc=_0x2493[_0x288020];return _0x16a4bc;};'use strict';var _=require(_0x3249('0x0'));var Redis=require(_0x3249('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x3249('0x2'));var logger=require(_0x3249('0x3'))(_0x3249('0x4'));var db=require(_0x3249('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_['defaults'](config[_0x3249('0x6')],{'host':_0x3249('0x7'),'port':0x18eb});var socket=require(_0x3249('0x8'))(new Redis(config[_0x3249('0x6')]));var redis=new Redis(config[_0x3249('0x6')]);function respondWithStatusCode(_0x372d45,_0x35ac25){_0x35ac25=_0x35ac25||0xcc;return function(_0x35550f){if(_0x35550f){return _0x372d45[_0x3249('0x9')](_0x35ac25);}return _0x372d45[_0x3249('0xa')](_0x35ac25)['end']();};}function respondWithResult(_0x35a052,_0x33238a){_0x33238a=_0x33238a||0xc8;return function(_0x26a23a){if(_0x26a23a){return _0x35a052[_0x3249('0xa')](_0x33238a)[_0x3249('0xb')](_0x26a23a);}};}function respondWithFilteredResult(_0xa80327,_0x2fe825){return function(_0x560305){if(_0x560305){var _0x105582=typeof _0x2fe825[_0x3249('0xc')]===_0x3249('0xd')&&typeof _0x2fe825[_0x3249('0xe')]==='undefined';var _0x2a0ea1=_0x560305['count'];var _0x4259d6=_0x105582?0x0:_0x2fe825[_0x3249('0xc')];var _0x1ce809=_0x105582?_0x560305['count']:_0x2fe825[_0x3249('0xc')]+_0x2fe825[_0x3249('0xe')];var _0xdd32a;if(_0x1ce809>=_0x2a0ea1){_0x1ce809=_0x2a0ea1;_0xdd32a=0xc8;}else{_0xdd32a=0xce;}_0xa80327['status'](_0xdd32a);return _0xa80327[_0x3249('0xf')]('Content-Range',_0x4259d6+'-'+_0x1ce809+'/'+_0x2a0ea1)[_0x3249('0xb')](_0x560305);}return null;};}function saveUpdates(_0xf8e12b){return function(_0x3036ca){if(_0x3036ca){return _0x3036ca['update'](_0xf8e12b)[_0x3249('0x10')](function(_0x1b0c8a){return _0x1b0c8a;});}return null;};}function removeEntity(_0x225bf0){return function(_0x2a06e0){if(_0x2a06e0){return _0x2a06e0[_0x3249('0x11')]()['then'](function(){_0x225bf0[_0x3249('0xa')](0xcc)[_0x3249('0x12')]();});}};}function handleEntityNotFound(_0x53077e){return function(_0x445882){if(!_0x445882){_0x53077e[_0x3249('0x9')](0x194);}return _0x445882;};}function handleError(_0x386f38,_0x220742){_0x220742=_0x220742||0x1f4;return function(_0x50ecd7){logger['error'](_0x50ecd7['stack']);if(_0x50ecd7['name']){delete _0x50ecd7[_0x3249('0x13')];}_0x386f38['status'](_0x220742)[_0x3249('0x14')](_0x50ecd7);};}function maskClientSecret(_0x1591c){return _['padEnd'](_0x1591c[_0x3249('0x15')](0x0,0x3),0x14,'*');}exports[_0x3249('0x16')]=function(_0x254de8,_0x4f546e){var _0x5692e5={},_0x41a914={},_0x337c55={'count':0x0,'rows':[]};var _0x39b256=_[_0x3249('0x17')](db[_0x3249('0x18')]['rawAttributes'],function(_0x544bfa){return{'name':_0x544bfa[_0x3249('0x19')],'type':_0x544bfa['type']['key']};});_0x41a914[_0x3249('0x1a')]=_['map'](_0x39b256,'name');_0x41a914[_0x3249('0x1b')]=_['keys'](_0x254de8['query']);_0x41a914[_0x3249('0x1c')]=_[_0x3249('0x1d')](_0x41a914[_0x3249('0x1a')],_0x41a914[_0x3249('0x1b')]);_0x5692e5[_0x3249('0x1e')]=_[_0x3249('0x1d')](_0x41a914[_0x3249('0x1a')],qs['fields'](_0x254de8['query'][_0x3249('0x1f')]));_0x5692e5[_0x3249('0x1e')]=_0x5692e5[_0x3249('0x1e')][_0x3249('0x20')]?_0x5692e5[_0x3249('0x1e')]:_0x41a914[_0x3249('0x1a')];if(!_0x254de8[_0x3249('0x1b')][_0x3249('0x21')](_0x3249('0x22'))){_0x5692e5[_0x3249('0xe')]=qs['limit'](_0x254de8[_0x3249('0x1b')]['limit']);_0x5692e5[_0x3249('0xc')]=qs[_0x3249('0xc')](_0x254de8[_0x3249('0x1b')][_0x3249('0xc')]);}_0x5692e5['order']=qs[_0x3249('0x23')](_0x254de8[_0x3249('0x1b')]['sort']);_0x5692e5[_0x3249('0x24')]=qs[_0x3249('0x1c')](_[_0x3249('0x25')](_0x254de8['query'],_0x41a914[_0x3249('0x1c')]),_0x39b256);if(_0x254de8[_0x3249('0x1b')][_0x3249('0x26')]){_0x5692e5[_0x3249('0x24')]=_[_0x3249('0x27')](_0x5692e5[_0x3249('0x24')],{'$or':_[_0x3249('0x17')](_0x39b256,function(_0x18ecbc){if(_0x18ecbc[_0x3249('0x28')]!==_0x3249('0x29')){var _0x2b8527={};_0x2b8527[_0x18ecbc['name']]={'$like':'%'+_0x254de8[_0x3249('0x1b')][_0x3249('0x26')]+'%'};return _0x2b8527;}})});}_0x5692e5=_[_0x3249('0x27')]({},_0x5692e5,_0x254de8[_0x3249('0x2a')]);var _0x559da6={'where':_0x5692e5[_0x3249('0x24')]};return db[_0x3249('0x18')][_0x3249('0x2b')](_0x559da6)[_0x3249('0x10')](function(_0x58b252){_0x337c55[_0x3249('0x2b')]=_0x58b252;if(_0x254de8[_0x3249('0x1b')]['includeAll']){_0x5692e5[_0x3249('0x2c')]=[{'all':!![]}];}return db[_0x3249('0x18')][_0x3249('0x2d')](_0x5692e5);})['then'](function(_0x2408c5){_0x337c55[_0x3249('0x2e')]=_['map'](_0x2408c5,function(_0x412623){if(_0x412623[_0x3249('0x2f')]===_0x3249('0x30')){var _0x508af7=encryptor[_0x3249('0x31')](_0x412623[_0x3249('0x32')]);_0x412623[_0x3249('0x32')]=maskClientSecret(_0x508af7);}return _0x412623;});return _0x337c55;})['then'](respondWithFilteredResult(_0x4f546e,_0x5692e5))[_0x3249('0x33')](handleError(_0x4f546e,null));};exports['show']=function(_0x8608d8,_0x57cdda){var _0x326832={'raw':!![],'where':{'id':_0x8608d8[_0x3249('0x34')]['id']}},_0x599ae5={};_0x599ae5[_0x3249('0x1a')]=_[_0x3249('0x35')](db[_0x3249('0x18')][_0x3249('0x36')]);_0x599ae5[_0x3249('0x1b')]=_['keys'](_0x8608d8['query']);_0x599ae5[_0x3249('0x1c')]=_['intersection'](_0x599ae5['model'],_0x599ae5[_0x3249('0x1b')]);_0x326832[_0x3249('0x1e')]=_['intersection'](_0x599ae5[_0x3249('0x1a')],qs[_0x3249('0x1f')](_0x8608d8[_0x3249('0x1b')][_0x3249('0x1f')]));_0x326832[_0x3249('0x1e')]=_0x326832[_0x3249('0x1e')]['length']?_0x326832['attributes']:_0x599ae5[_0x3249('0x1a')];if(_0x8608d8[_0x3249('0x1b')]['includeAll']){_0x326832[_0x3249('0x2c')]=[{'all':!![]}];}_0x326832=_[_0x3249('0x27')]({},_0x326832,_0x8608d8[_0x3249('0x2a')]);return db[_0x3249('0x18')][_0x3249('0x37')](_0x326832)['then'](handleEntityNotFound(_0x57cdda,null))[_0x3249('0x10')](function(_0x4778ee){if(_0x4778ee[_0x3249('0x2f')]==='MicrosoftAzure'){var _0x5d37df=encryptor[_0x3249('0x31')](_0x4778ee[_0x3249('0x32')]);_0x4778ee[_0x3249('0x32')]=maskClientSecret(_0x5d37df);}return _0x4778ee;})[_0x3249('0x10')](respondWithResult(_0x57cdda,null))['catch'](handleError(_0x57cdda,null));};exports['create']=function(_0x526b5a,_0x3c8a1d){if(!_0x526b5a[_0x3249('0x38')][_0x3249('0x13')])throw new Error(_0x3249('0x39'));if(!_0x526b5a[_0x3249('0x38')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3722c1=db['CloudProvider'][_0x3249('0x36')][_0x3249('0x2f')]['values'];if(!_0x3722c1[_0x3249('0x3a')](_0x526b5a[_0x3249('0x38')][_0x3249('0x2f')]))throw new Error(_0x3249('0x3b')+_0x3722c1[_0x3249('0x3c')](',\x20'));if(_0x526b5a[_0x3249('0x38')][_0x3249('0x2f')]===_0x3249('0x30')&&_0x526b5a[_0x3249('0x38')]['data3']){_0x526b5a[_0x3249('0x38')]['data3']=encryptor['encryptString'](_0x526b5a[_0x3249('0x38')][_0x3249('0x32')]);}return db[_0x3249('0x18')]['create'](_0x526b5a['body'],{})[_0x3249('0x10')](respondWithResult(_0x3c8a1d,0xc9))[_0x3249('0x33')](handleError(_0x3c8a1d,null));};exports[_0x3249('0x3d')]=function(_0x40ff45,_0x13426d){if(_0x40ff45[_0x3249('0x38')]['id']){delete _0x40ff45[_0x3249('0x38')]['id'];}return db[_0x3249('0x18')][_0x3249('0x37')]({'where':{'id':_0x40ff45[_0x3249('0x34')]['id']}})[_0x3249('0x10')](handleEntityNotFound(_0x13426d,null))[_0x3249('0x10')](function(_0x4f6166){if(_0x4f6166[_0x3249('0x2f')]===_0x3249('0x30')&&_0x40ff45[_0x3249('0x38')][_0x3249('0x32')]){_0x40ff45['body'][_0x3249('0x32')]=encryptor['encryptString'](_0x40ff45[_0x3249('0x38')][_0x3249('0x32')]);}return _0x4f6166;})[_0x3249('0x10')](saveUpdates(_0x40ff45[_0x3249('0x38')],null))[_0x3249('0x10')](respondWithResult(_0x13426d,null))[_0x3249('0x33')](handleError(_0x13426d,null));};exports[_0x3249('0x11')]=function(_0x360b38,_0x370d72){return db[_0x3249('0x18')][_0x3249('0x37')]({'where':{'id':_0x360b38[_0x3249('0x34')]['id']}})['then'](handleEntityNotFound(_0x370d72,null))['then'](removeEntity(_0x370d72,null))[_0x3249('0x33')](handleError(_0x370d72,null));};exports[_0x3249('0x3e')]=function(_0x36f0cc,_0x430944){return db[_0x3249('0x18')][_0x3249('0x3f')]({'where':{'id':_0x36f0cc[_0x3249('0x34')]['id']},'raw':!![]})['then'](function(_0x10d203){if(!_0x10d203)return _0x430944[_0x3249('0x9')](0x194);return{'url':oauth[_0x3249('0x40')](_0x10d203,_0x36f0cc[_0x3249('0x41')]['id'])};})[_0x3249('0x10')](respondWithResult(_0x430944,null))[_0x3249('0x33')](handleError(_0x430944,null));};exports[_0x3249('0x42')]=function(_0x2e280a,_0x21bfcb){var _0x15ba03=_0x2e280a[_0x3249('0x38')];var _0x5a54d6;var _0x40ab67;if(_0x15ba03[_0x3249('0x43')])throw _0x15ba03;redis[_0x3249('0x44')](_0x15ba03['state'])[_0x3249('0x10')](function(_0xa3b4cc){if(!_0xa3b4cc)throw new Error(_0x3249('0x45'));_0x5a54d6=JSON['parse'](_0xa3b4cc);var _0x474029=Buffer[_0x3249('0x46')](_0x15ba03[_0x3249('0x47')],_0x3249('0x48'))['toString'](_0x3249('0x49'));_0x40ab67=JSON['parse'](_0x474029);if(!oauth['isValidIdToken'](_0x15ba03['id_token'],_0x5a54d6['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x3249('0x4a')](_0x15ba03[_0x3249('0x47')]);return oauth[_0x3249('0x4b')](_0x15ba03['code'],_0x5a54d6);})[_0x3249('0x10')](function(_0xc58014){_0x5a54d6[_0x3249('0x4c')]=_0xc58014[_0x3249('0x4d')];_0x5a54d6[_0x3249('0x4e')]=_0xc58014[_0x3249('0x4f')];return db[_0x3249('0x18')][_0x3249('0x3d')]({'data5':_0x5a54d6[_0x3249('0x4c')],'data6':_0x5a54d6[_0x3249('0x4e')]},{'where':{'id':_0x5a54d6['id']}});})[_0x3249('0x10')](function(){oauth[_0x3249('0x50')](_0x5a54d6);socket[_0x3249('0x51')](_0x3249('0x52'),{'id':_0x40ab67['id']});return;})[_0x3249('0x10')](respondWithStatusCode(_0x21bfcb,null))['catch'](function(_0x6e9812){if(_0x40ab67){socket[_0x3249('0x51')]('microsoftAuthorization:error',{'id':_0x40ab67['id']});}if(!_0x5a54d6){logger[_0x3249('0x43')](_0x3249('0x53'),_0x6e9812);return _0x21bfcb[_0x3249('0xa')](0x1f4)[_0x3249('0x14')](_0x6e9812[_0x3249('0x54')]);}logger[_0x3249('0x43')](_0x3249('0x55'),_0x5a54d6['id'],JSON[_0x3249('0x56')](_0x6e9812));});};
\ No newline at end of file
+var _0x3dda=['count','limit','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','padEnd','slice','index','map','CloudProvider','fieldName','type','key','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','rawAttributes','keys','fields','include','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','params','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','get','state','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end','json','offset','undefined'];(function(_0x5351d4,_0x9fad72){var _0x158dd6=function(_0x21c0b4){while(--_0x21c0b4){_0x5351d4['push'](_0x5351d4['shift']());}};_0x158dd6(++_0x9fad72);}(_0x3dda,0x17a));var _0xa3dd=function(_0xfb073a,_0x248d58){_0xfb073a=_0xfb073a-0x0;var _0x4a0cd=_0x3dda[_0xfb073a];return _0x4a0cd;};'use strict';var _=require(_0xa3dd('0x0'));var Redis=require(_0xa3dd('0x1'));var qs=require(_0xa3dd('0x2'));var encryptor=require(_0xa3dd('0x3'));var config=require('../../config/environment');var logger=require(_0xa3dd('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xa3dd('0x5'));config[_0xa3dd('0x6')]=_[_0xa3dd('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa3dd('0x8'))(new Redis(config[_0xa3dd('0x6')]));var redis=new Redis(config[_0xa3dd('0x6')]);function respondWithStatusCode(_0x37bbbe,_0x5c8361){_0x5c8361=_0x5c8361||0xcc;return function(_0x4b699c){if(_0x4b699c){return _0x37bbbe['sendStatus'](_0x5c8361);}return _0x37bbbe[_0xa3dd('0x9')](_0x5c8361)[_0xa3dd('0xa')]();};}function respondWithResult(_0x2070e2,_0x3d67e9){_0x3d67e9=_0x3d67e9||0xc8;return function(_0x5d639e){if(_0x5d639e){return _0x2070e2[_0xa3dd('0x9')](_0x3d67e9)[_0xa3dd('0xb')](_0x5d639e);}};}function respondWithFilteredResult(_0x35705a,_0x2ea143){return function(_0x209c89){if(_0x209c89){var _0x3cc43c=typeof _0x2ea143[_0xa3dd('0xc')]==='undefined'&&typeof _0x2ea143['limit']===_0xa3dd('0xd');var _0x14279d=_0x209c89[_0xa3dd('0xe')];var _0xc3df35=_0x3cc43c?0x0:_0x2ea143[_0xa3dd('0xc')];var _0x451e43=_0x3cc43c?_0x209c89['count']:_0x2ea143[_0xa3dd('0xc')]+_0x2ea143[_0xa3dd('0xf')];var _0x29b6ce;if(_0x451e43>=_0x14279d){_0x451e43=_0x14279d;_0x29b6ce=0xc8;}else{_0x29b6ce=0xce;}_0x35705a['status'](_0x29b6ce);return _0x35705a[_0xa3dd('0x10')](_0xa3dd('0x11'),_0xc3df35+'-'+_0x451e43+'/'+_0x14279d)[_0xa3dd('0xb')](_0x209c89);}return null;};}function saveUpdates(_0x3c4d9f){return function(_0x23ee1f){if(_0x23ee1f){return _0x23ee1f[_0xa3dd('0x12')](_0x3c4d9f)['then'](function(_0x18f7e0){return _0x18f7e0;});}return null;};}function removeEntity(_0x945e79){return function(_0x3a5b8a){if(_0x3a5b8a){return _0x3a5b8a[_0xa3dd('0x13')]()[_0xa3dd('0x14')](function(){_0x945e79[_0xa3dd('0x9')](0xcc)[_0xa3dd('0xa')]();});}};}function handleEntityNotFound(_0x4afb7f){return function(_0xcf56e4){if(!_0xcf56e4){_0x4afb7f[_0xa3dd('0x15')](0x194);}return _0xcf56e4;};}function handleError(_0x243037,_0x2b19a5){_0x2b19a5=_0x2b19a5||0x1f4;return function(_0x552f1b){logger[_0xa3dd('0x16')](_0x552f1b[_0xa3dd('0x17')]);if(_0x552f1b[_0xa3dd('0x18')]){delete _0x552f1b[_0xa3dd('0x18')];}_0x243037[_0xa3dd('0x9')](_0x2b19a5)['send'](_0x552f1b);};}function maskClientSecret(_0x6040bd){return _[_0xa3dd('0x19')](_0x6040bd[_0xa3dd('0x1a')](0x0,0x3),0x14,'*');}exports[_0xa3dd('0x1b')]=function(_0x37eb39,_0x2119fb){var _0x19de62={},_0x14ef41={},_0x47fb61={'count':0x0,'rows':[]};var _0x411f90=_[_0xa3dd('0x1c')](db[_0xa3dd('0x1d')]['rawAttributes'],function(_0x20ee1f){return{'name':_0x20ee1f[_0xa3dd('0x1e')],'type':_0x20ee1f[_0xa3dd('0x1f')][_0xa3dd('0x20')]};});_0x14ef41[_0xa3dd('0x21')]=_[_0xa3dd('0x1c')](_0x411f90,_0xa3dd('0x18'));_0x14ef41[_0xa3dd('0x22')]=_['keys'](_0x37eb39[_0xa3dd('0x22')]);_0x14ef41[_0xa3dd('0x23')]=_['intersection'](_0x14ef41[_0xa3dd('0x21')],_0x14ef41[_0xa3dd('0x22')]);_0x19de62[_0xa3dd('0x24')]=_[_0xa3dd('0x25')](_0x14ef41[_0xa3dd('0x21')],qs['fields'](_0x37eb39['query']['fields']));_0x19de62[_0xa3dd('0x24')]=_0x19de62[_0xa3dd('0x24')]['length']?_0x19de62[_0xa3dd('0x24')]:_0x14ef41[_0xa3dd('0x21')];if(!_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x26')](_0xa3dd('0x27'))){_0x19de62[_0xa3dd('0xf')]=qs[_0xa3dd('0xf')](_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0xf')]);_0x19de62[_0xa3dd('0xc')]=qs[_0xa3dd('0xc')](_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0xc')]);}_0x19de62[_0xa3dd('0x28')]=qs[_0xa3dd('0x29')](_0x37eb39['query']['sort']);_0x19de62[_0xa3dd('0x2a')]=qs[_0xa3dd('0x23')](_[_0xa3dd('0x2b')](_0x37eb39[_0xa3dd('0x22')],_0x14ef41['filters']),_0x411f90);if(_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x2c')]){_0x19de62['where']=_[_0xa3dd('0x2d')](_0x19de62[_0xa3dd('0x2a')],{'$or':_['map'](_0x411f90,function(_0x3a8521){if(_0x3a8521['type']!==_0xa3dd('0x2e')){var _0x4c1e8c={};_0x4c1e8c[_0x3a8521[_0xa3dd('0x18')]]={'$like':'%'+_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x2c')]+'%'};return _0x4c1e8c;}})});}_0x19de62=_[_0xa3dd('0x2d')]({},_0x19de62,_0x37eb39[_0xa3dd('0x2f')]);var _0x454ce8={'where':_0x19de62['where']};return db['CloudProvider']['count'](_0x454ce8)[_0xa3dd('0x14')](function(_0x8dd7d0){_0x47fb61[_0xa3dd('0xe')]=_0x8dd7d0;if(_0x37eb39[_0xa3dd('0x22')][_0xa3dd('0x30')]){_0x19de62['include']=[{'all':!![]}];}return db['CloudProvider'][_0xa3dd('0x31')](_0x19de62);})[_0xa3dd('0x14')](function(_0x48b6b4){_0x47fb61['rows']=_[_0xa3dd('0x1c')](_0x48b6b4,function(_0xda0977){if(_0xda0977[_0xa3dd('0x32')]===_0xa3dd('0x33')){var _0x31cb65=encryptor[_0xa3dd('0x34')](_0xda0977['data3']);_0xda0977[_0xa3dd('0x35')]=maskClientSecret(_0x31cb65);}return _0xda0977;});return _0x47fb61;})[_0xa3dd('0x14')](respondWithFilteredResult(_0x2119fb,_0x19de62))[_0xa3dd('0x36')](handleError(_0x2119fb,null));};exports[_0xa3dd('0x37')]=function(_0x240465,_0x5614e0){var _0x1b464b={'raw':!![],'where':{'id':_0x240465['params']['id']}},_0x1c2f4e={};_0x1c2f4e[_0xa3dd('0x21')]=_['keys'](db[_0xa3dd('0x1d')][_0xa3dd('0x38')]);_0x1c2f4e[_0xa3dd('0x22')]=_[_0xa3dd('0x39')](_0x240465[_0xa3dd('0x22')]);_0x1c2f4e[_0xa3dd('0x23')]=_[_0xa3dd('0x25')](_0x1c2f4e[_0xa3dd('0x21')],_0x1c2f4e[_0xa3dd('0x22')]);_0x1b464b[_0xa3dd('0x24')]=_[_0xa3dd('0x25')](_0x1c2f4e[_0xa3dd('0x21')],qs['fields'](_0x240465[_0xa3dd('0x22')][_0xa3dd('0x3a')]));_0x1b464b[_0xa3dd('0x24')]=_0x1b464b[_0xa3dd('0x24')]['length']?_0x1b464b[_0xa3dd('0x24')]:_0x1c2f4e[_0xa3dd('0x21')];if(_0x240465[_0xa3dd('0x22')][_0xa3dd('0x30')]){_0x1b464b[_0xa3dd('0x3b')]=[{'all':!![]}];}_0x1b464b=_[_0xa3dd('0x2d')]({},_0x1b464b,_0x240465[_0xa3dd('0x2f')]);return db['CloudProvider'][_0xa3dd('0x3c')](_0x1b464b)[_0xa3dd('0x14')](handleEntityNotFound(_0x5614e0,null))[_0xa3dd('0x14')](function(_0x210f75){if(_0x210f75[_0xa3dd('0x32')]==='MicrosoftAzure'){var _0x9b0ee0=encryptor['decryptString'](_0x210f75['data3']);_0x210f75['data3']=maskClientSecret(_0x9b0ee0);}return _0x210f75;})[_0xa3dd('0x14')](respondWithResult(_0x5614e0,null))[_0xa3dd('0x36')](handleError(_0x5614e0,null));};exports['create']=function(_0xf968aa,_0x123e82){if(!_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x18')])throw new Error(_0xa3dd('0x3e'));if(!_0xf968aa['body'][_0xa3dd('0x32')])throw new Error(_0xa3dd('0x3f'));var _0x2cd603=db[_0xa3dd('0x1d')][_0xa3dd('0x38')][_0xa3dd('0x32')][_0xa3dd('0x40')];if(!_0x2cd603[_0xa3dd('0x41')](_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x32')]))throw new Error(_0xa3dd('0x42')+_0x2cd603[_0xa3dd('0x43')](',\x20'));if(_0xf968aa[_0xa3dd('0x3d')]['service']===_0xa3dd('0x33')&&_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x35')]){_0xf968aa[_0xa3dd('0x3d')][_0xa3dd('0x35')]=encryptor[_0xa3dd('0x44')](_0xf968aa['body'][_0xa3dd('0x35')]);}return db[_0xa3dd('0x1d')][_0xa3dd('0x45')](_0xf968aa['body'],{})['then'](respondWithResult(_0x123e82,0xc9))[_0xa3dd('0x36')](handleError(_0x123e82,null));};exports[_0xa3dd('0x12')]=function(_0x74f826,_0x244beb){if(_0x74f826[_0xa3dd('0x3d')]['id']){delete _0x74f826[_0xa3dd('0x3d')]['id'];}return db[_0xa3dd('0x1d')][_0xa3dd('0x3c')]({'where':{'id':_0x74f826[_0xa3dd('0x46')]['id']}})[_0xa3dd('0x14')](handleEntityNotFound(_0x244beb,null))[_0xa3dd('0x14')](function(_0x4c50eb){if(_0x4c50eb[_0xa3dd('0x32')]===_0xa3dd('0x33')&&_0x74f826[_0xa3dd('0x3d')][_0xa3dd('0x35')]){_0x74f826[_0xa3dd('0x3d')][_0xa3dd('0x35')]=encryptor[_0xa3dd('0x44')](_0x74f826['body'][_0xa3dd('0x35')]);}return _0x4c50eb;})['then'](saveUpdates(_0x74f826[_0xa3dd('0x3d')],null))[_0xa3dd('0x14')](respondWithResult(_0x244beb,null))[_0xa3dd('0x36')](handleError(_0x244beb,null));};exports[_0xa3dd('0x13')]=function(_0x309fda,_0x3f7285){return db[_0xa3dd('0x1d')][_0xa3dd('0x3c')]({'where':{'id':_0x309fda['params']['id']}})[_0xa3dd('0x14')](handleEntityNotFound(_0x3f7285,null))[_0xa3dd('0x14')](removeEntity(_0x3f7285,null))['catch'](handleError(_0x3f7285,null));};exports[_0xa3dd('0x47')]=function(_0x31f029,_0x3c6ffb){return db[_0xa3dd('0x1d')][_0xa3dd('0x48')]({'where':{'id':_0x31f029['params']['id']},'raw':!![]})[_0xa3dd('0x14')](function(_0x510598){if(!_0x510598)return _0x3c6ffb[_0xa3dd('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x510598,_0x31f029['user']['id'])};})[_0xa3dd('0x14')](respondWithResult(_0x3c6ffb,null))[_0xa3dd('0x36')](handleError(_0x3c6ffb,null));};exports[_0xa3dd('0x49')]=function(_0x13f1b0,_0x5e303a){var _0x16a445=_0x13f1b0[_0xa3dd('0x3d')];var _0x3d54f0;var _0x1c8a1c;if(_0x16a445['error'])throw _0x16a445;redis[_0xa3dd('0x4a')](_0x16a445[_0xa3dd('0x4b')])[_0xa3dd('0x14')](function(_0x4beff3){if(!_0x4beff3)throw new Error('Invalid\x20state\x20parameter');_0x3d54f0=JSON[_0xa3dd('0x4c')](_0x4beff3);var _0x1c7bf4=Buffer[_0xa3dd('0x4d')](_0x16a445['state'],'base64')[_0xa3dd('0x4e')](_0xa3dd('0x4f'));_0x1c8a1c=JSON['parse'](_0x1c7bf4);if(!oauth[_0xa3dd('0x50')](_0x16a445[_0xa3dd('0x51')],_0x3d54f0[_0xa3dd('0x52')]))throw new Error(_0xa3dd('0x53'));redis[_0xa3dd('0x54')](_0x16a445[_0xa3dd('0x4b')]);return oauth[_0xa3dd('0x55')](_0x16a445['code'],_0x3d54f0);})['then'](function(_0x271398){_0x3d54f0[_0xa3dd('0x56')]=_0x271398[_0xa3dd('0x57')];_0x3d54f0['data6']=_0x271398[_0xa3dd('0x58')];return db[_0xa3dd('0x1d')][_0xa3dd('0x12')]({'data5':_0x3d54f0[_0xa3dd('0x56')],'data6':_0x3d54f0[_0xa3dd('0x59')]},{'where':{'id':_0x3d54f0['id']}});})[_0xa3dd('0x14')](function(){oauth[_0xa3dd('0x5a')](_0x3d54f0);socket[_0xa3dd('0x5b')](_0xa3dd('0x5c'),{'id':_0x1c8a1c['id']});return;})['then'](respondWithStatusCode(_0x5e303a,null))['catch'](function(_0x1cb1a3){if(_0x1c8a1c){socket[_0xa3dd('0x5b')](_0xa3dd('0x5d'),{'id':_0x1c8a1c['id']});}if(!_0x3d54f0){logger[_0xa3dd('0x16')](_0xa3dd('0x5e'),_0x1cb1a3);return _0x5e303a[_0xa3dd('0x9')](0x1f4)[_0xa3dd('0x5f')](_0x1cb1a3['message']);}logger[_0xa3dd('0x16')](_0xa3dd('0x60'),_0x3d54f0['id'],JSON[_0xa3dd('0x61')](_0x1cb1a3));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f49a424..2f05ecc 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 _0x52cb=['cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x53fc13,_0x5e225d){var _0x5e5a5e=function(_0x4410bf){while(--_0x4410bf){_0x53fc13['push'](_0x53fc13['shift']());}};_0x5e5a5e(++_0x5e225d);}(_0x52cb,0x115));var _0xb52c=function(_0x3f765d,_0x1a42f0){_0x3f765d=_0x3f765d-0x0;var _0x2861e0=_0x52cb[_0x3f765d];return _0x2861e0;};'use strict';var _=require(_0xb52c('0x0'));var util=require(_0xb52c('0x1'));var logger=require(_0xb52c('0x2'))('api');var moment=require(_0xb52c('0x3'));var BPromise=require(_0xb52c('0x4'));var rp=require(_0xb52c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb52c('0x6'));var attributes=require(_0xb52c('0x7'));module[_0xb52c('0x8')]=function(_0x551b65,_0x4770aa){return _0x551b65[_0xb52c('0x9')](_0xb52c('0xa'),attributes,{'tableName':_0xb52c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9b8=['exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x523b92,_0x25d6b8){var _0x1a5e3b=function(_0x4e594e){while(--_0x4e594e){_0x523b92['push'](_0x523b92['shift']());}};_0x1a5e3b(++_0x25d6b8);}(_0xa9b8,0x12e));var _0x8a9b=function(_0x36af9a,_0x17b203){_0x36af9a=_0x36af9a-0x0;var _0x40abc9=_0xa9b8[_0x36af9a];return _0x40abc9;};'use strict';var _=require(_0x8a9b('0x0'));var util=require(_0x8a9b('0x1'));var logger=require(_0x8a9b('0x2'))(_0x8a9b('0x3'));var moment=require(_0x8a9b('0x4'));var BPromise=require(_0x8a9b('0x5'));var rp=require(_0x8a9b('0x6'));var fs=require('fs');var path=require(_0x8a9b('0x7'));var rimraf=require(_0x8a9b('0x8'));var config=require(_0x8a9b('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x8a9b('0xa')]=function(_0x5b9a79,_0x517925){return _0x5b9a79['define'](_0x8a9b('0xb'),attributes,{'tableName':_0x8a9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index c85fbcf..14038dd 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5994=['data1','redirect_uri','data4','form_post','scope','nonce','prompt','map','value','replace','oauth2/','set','payload','iss','audience','isAfter','unix','exp','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','then','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','/.default','join','Outlook365','data7','data2','id_token','stringify','toString','base64','randomBytes','hex','client_id'];(function(_0x215fde,_0x222c24){var _0x16a010=function(_0x1a024f){while(--_0x1a024f){_0x215fde['push'](_0x215fde['shift']());}};_0x16a010(++_0x222c24);}(_0x5994,0xba));var _0x4599=function(_0x1e3846,_0x494be8){_0x1e3846=_0x1e3846-0x0;var _0x538e67=_0x5994[_0x1e3846];return _0x538e67;};'use strict';var _=require('lodash');var crypto=require(_0x4599('0x0'));var jwt=require('jsonwebtoken');var moment=require(_0x4599('0x1'));var Redis=require(_0x4599('0x2'));var rp=require(_0x4599('0x3'));var util=require(_0x4599('0x4'));var encryptor=require(_0x4599('0x5'));var config=require(_0x4599('0x6'));var logger=require(_0x4599('0x7'))('api');var schedule=require(_0x4599('0x8'));var db=require(_0x4599('0x9'))['db'];config[_0x4599('0xa')]=_[_0x4599('0xb')](config[_0x4599('0xa')],{'host':_0x4599('0xc'),'port':0x18eb});var redis=new Redis(config[_0x4599('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x4599('0xd'),_0x4599('0xe'),_0x4599('0xf'),_0x4599('0x10'),_0x4599('0x11'),_0x4599('0x12'),_0x4599('0x13')],'Dynamics365':[_0x4599('0xd'),_0x4599('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x4599('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3a6eb0){var _0x261d7b=_['map'](AZURE_AUTH_SCOPES[_0x3a6eb0[_0x4599('0x15')]]);if(_0x3a6eb0[_0x4599('0x15')]===_0x4599('0x16'))_0x261d7b[_0x4599('0x17')](_0x3a6eb0['data7']+_0x4599('0x18'));return _0x261d7b[_0x4599('0x19')]('\x20');}function getAccessTokenScope(_0x2888db){if(_0x2888db[_0x4599('0x15')]===_0x4599('0x1a'))return _0x4599('0x11');if(_0x2888db['type']===_0x4599('0x16'))return _0x2888db[_0x4599('0x1b')]+_0x4599('0x18');}function generateMicrosoftAuthorizationUrl(_0x153e93,_0x7816bd){var _0x3ab011=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x153e93[_0x4599('0x1c')]);var _0x1d4cd1=['code',_0x4599('0x1d')];var _0x2a1db6=Buffer['from'](JSON[_0x4599('0x1e')]({'id':_0x7816bd}))[_0x4599('0x1f')](_0x4599('0x20'));var _0x188404=crypto[_0x4599('0x21')](0x10)[_0x4599('0x1f')](_0x4599('0x22'));var _0x5a1fc0=getAuthorizationScopes(_0x153e93);var _0x7217cc=[{'key':_0x4599('0x23'),'value':_0x153e93[_0x4599('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x1d4cd1['join']('\x20'))},{'key':_0x4599('0x25'),'value':_0x153e93[_0x4599('0x26')]},{'key':'response_mode','value':_0x4599('0x27')},{'key':_0x4599('0x28'),'value':encodeURIComponent(_0x5a1fc0)},{'key':'state','value':_0x2a1db6},{'key':_0x4599('0x29'),'value':_0x188404},{'key':_0x4599('0x2a'),'value':'login'}];var _0x59b67e=_0x3ab011+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4599('0x2b')](_0x7217cc,function(_0x96cfb5){return _0x96cfb5['key']+'='+_0x96cfb5[_0x4599('0x2c')];})[_0x4599('0x19')]('&');_0x153e93['oauth2Claims']={'issuer':_0x3ab011[_0x4599('0x2d')](_0x4599('0x2e'),''),'audience':_0x153e93[_0x4599('0x24')],'state':_0x2a1db6,'nonce':_0x188404};redis[_0x4599('0x2f')](_0x2a1db6,JSON['stringify'](_0x153e93));return _0x59b67e;}function isValidIdToken(_0x332942,_0x357b4b){try{var _0x5bd01d=jwt['decode'](_0x332942,{'complete':!![]});var _0x2d392c=_0x5bd01d[_0x4599('0x30')];if(_0x2d392c[_0x4599('0x31')]!==_0x357b4b['issuer'])return![];if(_0x2d392c['aud']!==_0x357b4b[_0x4599('0x32')])return![];if(_0x2d392c['nonce']!==_0x357b4b[_0x4599('0x29')])return![];if(moment()[_0x4599('0x33')](moment[_0x4599('0x34')](_0x2d392c[_0x4599('0x35')])))return![];return!![];}catch(_0x3191d3){throw _0x3191d3;}}function refreshOauth2MicrosoftAccessToken(_0x584379){return Promise['resolve']()['then'](function(){if(_0x584379[_0x4599('0x36')])return _0x584379;return db[_0x4599('0x37')][_0x4599('0x38')]({'where':{'id':_0x584379['id']},'raw':!![]});})['then'](function(_0xd776ad){var _0x522758={'grant_type':_0x4599('0x39'),'refresh_token':_0xd776ad[_0x4599('0x3a')],'scope':getAccessTokenScope(_0xd776ad),'redirect_uri':_0xd776ad[_0x4599('0x26')],'client_id':_0xd776ad['data1'],'client_secret':encryptor[_0x4599('0x3b')](_0xd776ad['data3'])};var _0x1d2acc={'method':_0x4599('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x4599('0x2d')](_0x4599('0x3d'),_0xd776ad['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x522758,'json':!![]};return rp(_0x1d2acc);})[_0x4599('0x3e')](function(_0x2d1dc9){_0x584379[_0x4599('0x3f')]=_0x2d1dc9['access_token'];_0x584379[_0x4599('0x3a')]=_0x2d1dc9['refresh_token'];return db[_0x4599('0x37')][_0x4599('0x40')]({'data5':_0x584379[_0x4599('0x3f')],'data6':_0x584379[_0x4599('0x3a')]},{'where':{'id':_0x584379['id']}});})[_0x4599('0x3e')](function(){return _0x584379;})[_0x4599('0x41')](function(_0x25cd53){logger[_0x4599('0x42')](_0x4599('0x43'),_0x584379['id'],_0x25cd53);});}function getOauth2MicrosoftAccessToken(_0xebb46e,_0x30c7f0){var _0x3cc16e={'grant_type':'authorization_code','code':_0xebb46e,'scope':getAccessTokenScope(_0x30c7f0),'redirect_uri':_0x30c7f0['data4'],'client_id':_0x30c7f0['data1'],'client_secret':encryptor[_0x4599('0x3b')](_0x30c7f0[_0x4599('0x36')])};var _0x53dbba={'method':_0x4599('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x4599('0x2d')]('{TENANT_ID}',_0x30c7f0[_0x4599('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3cc16e,'json':!![]};return rp(_0x53dbba);}function startRefreshInterval(_0x4e7042){var _0x578631=schedule[_0x4599('0x44')];if(_0x578631[_0x4e7042['id']])clearInterval(_0x578631[_0x4e7042['id']]);_0x578631[_0x4e7042['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4599('0x45')](this,{'id':_0x4e7042['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4599('0x44')]=_0x578631;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x4599('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4599('0x3e')](function(_0x237249){var _0x135c48=_0x237249[_0x4599('0x2b')](function(_0x5161c3){return refreshOauth2MicrosoftAccessToken(_0x5161c3)[_0x4599('0x3e')](function(_0x2b9704){startRefreshInterval(_0x2b9704);});});return Promise[_0x4599('0x47')](_0x135c48);})[_0x4599('0x41')](function(_0x5f51d4){var _0x14ba79=_0x5f51d4?util[_0x4599('0x48')](_0x5f51d4,{'showHidden':![],'depth':null}):'';logger[_0x4599('0x42')](_0x4599('0x49'),_0x14ba79);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xbad1=['POST','{TENANT_ID}','data2','data5','access_token','update','catch','error','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','openid','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','join','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','oauth2Claims','data1','decode','payload','iss','issuer','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString'];(function(_0x3ba57e,_0x2e6810){var _0x5d95cf=function(_0x8017a0){while(--_0x8017a0){_0x3ba57e['push'](_0x3ba57e['shift']());}};_0x5d95cf(++_0x2e6810);}(_0xbad1,0x1e3));var _0x1bad=function(_0x2049d1,_0x32a702){_0x2049d1=_0x2049d1-0x0;var _0x2f4f35=_0xbad1[_0x2049d1];return _0x2f4f35;};'use strict';var _=require(_0x1bad('0x0'));var crypto=require(_0x1bad('0x1'));var jwt=require(_0x1bad('0x2'));var moment=require('moment');var Redis=require(_0x1bad('0x3'));var rp=require('request-promise');var util=require(_0x1bad('0x4'));var encryptor=require(_0x1bad('0x5'));var config=require('../../config/environment');var logger=require(_0x1bad('0x6'))(_0x1bad('0x7'));var schedule=require(_0x1bad('0x8'));var db=require(_0x1bad('0x9'))['db'];config['redis']=_[_0x1bad('0xa')](config[_0x1bad('0xb')],{'host':_0x1bad('0xc'),'port':0x18eb});var redis=new Redis(config[_0x1bad('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x1bad('0xd'),_0x1bad('0xe'),'email',_0x1bad('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x1bad('0x10'),_0x1bad('0x11')],'Dynamics365':['openid',_0x1bad('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x1bad('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x1bad('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1a78af){var _0x4193fc=_[_0x1bad('0x14')](AZURE_AUTH_SCOPES[_0x1a78af['type']]);if(_0x1a78af[_0x1bad('0x15')]===_0x1bad('0x16'))_0x4193fc['push'](_0x1a78af[_0x1bad('0x17')]+_0x1bad('0x18'));return _0x4193fc['join']('\x20');}function getAccessTokenScope(_0x2a67ec){if(_0x2a67ec[_0x1bad('0x15')]===_0x1bad('0x19'))return _0x1bad('0x1a');if(_0x2a67ec['type']===_0x1bad('0x16'))return _0x2a67ec['data7']+_0x1bad('0x18');}function generateMicrosoftAuthorizationUrl(_0x4013d7,_0x2180e7){var _0x3be3f7=MICROSOFT_AUTH_URL[_0x1bad('0x1b')]('{TENANT_ID}',_0x4013d7['data2']);var _0x4b0cec=[_0x1bad('0x1c'),_0x1bad('0x1d')];var _0x34bfa9=Buffer[_0x1bad('0x1e')](JSON[_0x1bad('0x1f')]({'id':_0x2180e7}))[_0x1bad('0x20')]('base64');var _0x124fb1=crypto[_0x1bad('0x21')](0x10)['toString'](_0x1bad('0x22'));var _0x41f0ad=getAuthorizationScopes(_0x4013d7);var _0x1f0ec8=[{'key':_0x1bad('0x23'),'value':_0x4013d7['data1']},{'key':_0x1bad('0x24'),'value':encodeURIComponent(_0x4b0cec[_0x1bad('0x25')]('\x20'))},{'key':_0x1bad('0x26'),'value':_0x4013d7[_0x1bad('0x27')]},{'key':_0x1bad('0x28'),'value':_0x1bad('0x29')},{'key':'scope','value':encodeURIComponent(_0x41f0ad)},{'key':_0x1bad('0x2a'),'value':_0x34bfa9},{'key':_0x1bad('0x2b'),'value':_0x124fb1},{'key':_0x1bad('0x2c'),'value':_0x1bad('0x2d')}];var _0x257cdc=_0x3be3f7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1bad('0x14')](_0x1f0ec8,function(_0x14f023){return _0x14f023['key']+'='+_0x14f023['value'];})[_0x1bad('0x25')]('&');_0x4013d7[_0x1bad('0x2e')]={'issuer':_0x3be3f7[_0x1bad('0x1b')]('oauth2/',''),'audience':_0x4013d7[_0x1bad('0x2f')],'state':_0x34bfa9,'nonce':_0x124fb1};redis['set'](_0x34bfa9,JSON[_0x1bad('0x1f')](_0x4013d7));return _0x257cdc;}function isValidIdToken(_0x3fb048,_0x53959c){try{var _0x5216e7=jwt[_0x1bad('0x30')](_0x3fb048,{'complete':!![]});var _0x17fdde=_0x5216e7[_0x1bad('0x31')];if(_0x17fdde[_0x1bad('0x32')]!==_0x53959c[_0x1bad('0x33')])return![];if(_0x17fdde[_0x1bad('0x34')]!==_0x53959c['audience'])return![];if(_0x17fdde[_0x1bad('0x2b')]!==_0x53959c[_0x1bad('0x2b')])return![];if(moment()['isAfter'](moment[_0x1bad('0x35')](_0x17fdde[_0x1bad('0x36')])))return![];return!![];}catch(_0x2633b0){throw _0x2633b0;}}function refreshOauth2MicrosoftAccessToken(_0x20d85f){return Promise[_0x1bad('0x37')]()[_0x1bad('0x38')](function(){if(_0x20d85f[_0x1bad('0x39')])return _0x20d85f;return db[_0x1bad('0x3a')][_0x1bad('0x3b')]({'where':{'id':_0x20d85f['id']},'raw':!![]});})[_0x1bad('0x38')](function(_0x1963f4){var _0x193a77={'grant_type':_0x1bad('0x3c'),'refresh_token':_0x1963f4[_0x1bad('0x3d')],'scope':getAccessTokenScope(_0x1963f4),'redirect_uri':_0x1963f4[_0x1bad('0x27')],'client_id':_0x1963f4[_0x1bad('0x2f')],'client_secret':encryptor[_0x1bad('0x3e')](_0x1963f4[_0x1bad('0x39')])};var _0x1e54d8={'method':_0x1bad('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x1bad('0x1b')](_0x1bad('0x40'),_0x1963f4[_0x1bad('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x193a77,'json':!![]};return rp(_0x1e54d8);})['then'](function(_0x2de0e4){_0x20d85f[_0x1bad('0x42')]=_0x2de0e4[_0x1bad('0x43')];_0x20d85f[_0x1bad('0x3d')]=_0x2de0e4['refresh_token'];return db[_0x1bad('0x3a')][_0x1bad('0x44')]({'data5':_0x20d85f[_0x1bad('0x42')],'data6':_0x20d85f['data6']},{'where':{'id':_0x20d85f['id']}});})[_0x1bad('0x38')](function(){return _0x20d85f;})[_0x1bad('0x45')](function(_0x575f7f){logger[_0x1bad('0x46')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x20d85f['id'],_0x575f7f);});}function getOauth2MicrosoftAccessToken(_0x260ee6,_0x56d4b5){var _0x55fb46={'grant_type':_0x1bad('0x47'),'code':_0x260ee6,'scope':getAccessTokenScope(_0x56d4b5),'redirect_uri':_0x56d4b5[_0x1bad('0x27')],'client_id':_0x56d4b5[_0x1bad('0x2f')],'client_secret':encryptor[_0x1bad('0x3e')](_0x56d4b5[_0x1bad('0x39')])};var _0x570c12={'method':_0x1bad('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x1bad('0x1b')](_0x1bad('0x40'),_0x56d4b5[_0x1bad('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55fb46,'json':!![]};return rp(_0x570c12);}function startRefreshInterval(_0x50b6a8){var _0x43fb37=schedule[_0x1bad('0x48')];if(_0x43fb37[_0x50b6a8['id']])clearInterval(_0x43fb37[_0x50b6a8['id']]);_0x43fb37[_0x50b6a8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1bad('0x49')](this,{'id':_0x50b6a8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x1bad('0x48')]=_0x43fb37;}function startAllRefreshIntervals(){return db[_0x1bad('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1bad('0x38')](function(_0x5b15b7){var _0x4d677b=_0x5b15b7['map'](function(_0x495290){return refreshOauth2MicrosoftAccessToken(_0x495290)[_0x1bad('0x38')](function(_0x1903fe){startRefreshInterval(_0x1903fe);});});return Promise[_0x1bad('0x4a')](_0x4d677b);})['catch'](function(_0x4d0e07){var _0x18c229=_0x4d0e07?util[_0x1bad('0x4b')](_0x4d0e07,{'showHidden':![],'depth':null}):'';logger['error'](_0x1bad('0x4c'),_0x18c229);});}module[_0x1bad('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index b6f2358..ee3789b 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 _0x566f=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x53de3f,_0xcbed3){var _0x251907=function(_0x24db88){while(--_0x24db88){_0x53de3f['push'](_0x53de3f['shift']());}};_0x251907(++_0xcbed3);}(_0x566f,0x124));var _0xf566=function(_0x16a1f9,_0x356c7d){_0x16a1f9=_0x16a1f9-0x0;var _0x1000dd=_0x566f[_0x16a1f9];return _0x1000dd;};'use strict';var _=require(_0xf566('0x0'));var util=require(_0xf566('0x1'));var moment=require(_0xf566('0x2'));var BPromise=require(_0xf566('0x3'));var rs=require(_0xf566('0x4'));var fs=require('fs');var Redis=require(_0xf566('0x5'));var db=require(_0xf566('0x6'))['db'];var utils=require(_0xf566('0x7'));var logger=require('../../config/logger')(_0xf566('0x8'));var config=require(_0xf566('0x9'));var jayson=require(_0xf566('0xa'));var client=jayson[_0xf566('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xacfc48,_0x354e78,_0x3af552){return new BPromise(function(_0x1e33fa,_0x588e82){return client[_0xf566('0xc')](_0xacfc48,_0x3af552)['then'](function(_0x112610){logger[_0xf566('0xd')](_0xf566('0xe'),_0x354e78,_0xf566('0xf'));logger['debug'](_0xf566('0x10'),_0x354e78,_0xf566('0xf'),JSON[_0xf566('0x11')](_0x112610));if(_0x112610[_0xf566('0x12')]){if(_0x112610[_0xf566('0x12')][_0xf566('0x13')]===0x1f4){logger[_0xf566('0x12')](_0xf566('0xe'),_0x354e78,_0x112610['error'][_0xf566('0x14')]);return _0x588e82(_0x112610[_0xf566('0x12')][_0xf566('0x14')]);}logger[_0xf566('0x12')]('CloudProvider,\x20%s,\x20%s',_0x354e78,_0x112610[_0xf566('0x12')]['message']);return _0x1e33fa(_0x112610['error'][_0xf566('0x14')]);}else{logger[_0xf566('0xd')]('CloudProvider,\x20%s,\x20%s',_0x354e78,_0xf566('0xf'));_0x1e33fa(_0x112610[_0xf566('0x15')]['message']);}})[_0xf566('0x16')](function(_0x5e208d){logger[_0xf566('0x12')]('CloudProvider,\x20%s,\x20%s',_0x354e78,_0x5e208d);_0x588e82(_0x5e208d);});});}
\ No newline at end of file
+var _0x160c=['error','code','message','result','catch','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x160c,0x181));var _0xc160=function(_0x2e938d,_0x888278){_0x2e938d=_0x2e938d-0x0;var _0x2ea295=_0x160c[_0x2e938d];return _0x2ea295;};'use strict';var _=require('lodash');var util=require(_0xc160('0x0'));var moment=require(_0xc160('0x1'));var BPromise=require(_0xc160('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc160('0x3'));var logger=require('../../config/logger')(_0xc160('0x4'));var config=require(_0xc160('0x5'));var jayson=require(_0xc160('0x6'));var client=jayson['client'][_0xc160('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5dfb45,_0x26e1f4,_0x549651){return new BPromise(function(_0x359ac9,_0x30c90e){return client['request'](_0x5dfb45,_0x549651)[_0xc160('0x8')](function(_0x208643){logger['info'](_0xc160('0x9'),_0x26e1f4,_0xc160('0xa'));logger[_0xc160('0xb')](_0xc160('0xc'),_0x26e1f4,_0xc160('0xa'),JSON[_0xc160('0xd')](_0x208643));if(_0x208643[_0xc160('0xe')]){if(_0x208643[_0xc160('0xe')][_0xc160('0xf')]===0x1f4){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x30c90e(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}logger[_0xc160('0xe')]('CloudProvider,\x20%s,\x20%s',_0x26e1f4,_0x208643[_0xc160('0xe')]['message']);return _0x359ac9(_0x208643[_0xc160('0xe')][_0xc160('0x10')]);}else{logger['info'](_0xc160('0x9'),_0x26e1f4,'request\x20sent');_0x359ac9(_0x208643[_0xc160('0x11')][_0xc160('0x10')]);}})[_0xc160('0x12')](function(_0x5bb074){logger['error'](_0xc160('0x9'),_0x26e1f4,_0x5bb074);_0x30c90e(_0x5bb074);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f69b4f9..ada28a5 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x58dbba,_0x52ea0b){var _0x3eba0c=function(_0x4028b6){while(--_0x4028b6){_0x58dbba['push'](_0x58dbba['shift']());}};_0x3eba0c(++_0x52ea0b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x197e88,_0x542f13){var _0x541669=function(_0x3f3672){while(--_0x3f3672){_0x197e88['push'](_0x197e88['shift']());}};_0x541669(++_0x542f13);}(_0x2ef3,0xba));var _0x32ef=function(_0x48162f,_0x598996){_0x48162f=_0x48162f-0x0;var _0x216f76=_0x2ef3[_0x48162f];return _0x216f76;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 0a3a485..8128207 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 _0xc439=['sequelize','exports','STRING','name'];(function(_0x5b7f7b,_0x373769){var _0x17f284=function(_0x44667a){while(--_0x44667a){_0x5b7f7b['push'](_0x5b7f7b['shift']());}};_0x17f284(++_0x373769);}(_0xc439,0x174));var _0x9c43=function(_0x8e0a54,_0xe5fd1b){_0x8e0a54=_0x8e0a54-0x0;var _0x30a731=_0xc439[_0x8e0a54];return _0x30a731;};'use strict';var Sequelize=require(_0x9c43('0x0'));module[_0x9c43('0x1')]={'name':{'type':Sequelize[_0x9c43('0x2')],'unique':_0x9c43('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9c43('0x2')]},'companyId':{'type':Sequelize[_0x9c43('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9c43('0x2')]},'type':{'type':Sequelize[_0x9c43('0x2')]},'street':{'type':Sequelize[_0x9c43('0x2')]},'postalCode':{'type':Sequelize[_0x9c43('0x2')]},'city':{'type':Sequelize[_0x9c43('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9c43('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9c43('0x2')]},'sStreet':{'type':Sequelize[_0x9c43('0x2')]},'sPostalCode':{'type':Sequelize[_0x9c43('0x2')]},'sCity':{'type':Sequelize[_0x9c43('0x2')]},'sCountry':{'type':Sequelize[_0x9c43('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7f47=['STRING','name','sequelize','exports'];(function(_0x25762d,_0x45830d){var _0x2300d0=function(_0x172f7b){while(--_0x172f7b){_0x25762d['push'](_0x25762d['shift']());}};_0x2300d0(++_0x45830d);}(_0x7f47,0x12e));var _0x77f4=function(_0x872f6f,_0x5efe7b){_0x872f6f=_0x872f6f-0x0;var _0x59a5f4=_0x7f47[_0x872f6f];return _0x59a5f4;};'use strict';var Sequelize=require(_0x77f4('0x0'));module[_0x77f4('0x1')]={'name':{'type':Sequelize[_0x77f4('0x2')],'unique':_0x77f4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x77f4('0x2')]},'companyId':{'type':Sequelize[_0x77f4('0x2')]},'website':{'type':Sequelize[_0x77f4('0x2')]},'phone':{'type':Sequelize[_0x77f4('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x77f4('0x2')]},'street':{'type':Sequelize[_0x77f4('0x2')]},'postalCode':{'type':Sequelize[_0x77f4('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x77f4('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x77f4('0x2')]},'sStreet':{'type':Sequelize[_0x77f4('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x77f4('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77f4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index bd705aa..04aa5fe 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 _0xe28d=['findOne','rawAttributes','order','eml-format','rimraf','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','options','count','includeAll','include','catch','params','keys','merge','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts'];(function(_0x3938b4,_0x30826c){var _0x3a2e10=function(_0x203029){while(--_0x203029){_0x3938b4['push'](_0x3938b4['shift']());}};_0x3a2e10(++_0x30826c);}(_0xe28d,0x1c0));var _0xde28=function(_0x3d2b19,_0x349a5b){_0x3d2b19=_0x3d2b19-0x0;var _0x29769b=_0xe28d[_0x3d2b19];return _0x29769b;};'use strict';var emlformat=require(_0xde28('0x0'));var rimraf=require(_0xde28('0x1'));var zipdir=require(_0xde28('0x2'));var jsonpatch=require(_0xde28('0x3'));var rp=require(_0xde28('0x4'));var moment=require(_0xde28('0x5'));var BPromise=require(_0xde28('0x6'));var Mustache=require(_0xde28('0x7'));var util=require('util');var path=require(_0xde28('0x8'));var sox=require(_0xde28('0x9'));var csv=require(_0xde28('0xa'));var ejs=require(_0xde28('0xb'));var fs=require('fs');var fs_extra=require(_0xde28('0xc'));var _=require(_0xde28('0xd'));var squel=require(_0xde28('0xe'));var crypto=require(_0xde28('0xf'));var jsforce=require(_0xde28('0x10'));var deskjs=require(_0xde28('0x11'));var toCsv=require(_0xde28('0xa'));var querystring=require(_0xde28('0x12'));var Papa=require(_0xde28('0x13'));var Redis=require('ioredis');var authService=require(_0xde28('0x14'));var qs=require(_0xde28('0x15'));var as=require(_0xde28('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde28('0x17'));var utils=require(_0xde28('0x18'));var config=require(_0xde28('0x19'));var licenseUtil=require(_0xde28('0x1a'));var db=require(_0xde28('0x1b'))['db'];function respondWithStatusCode(_0x415549,_0x2ebe23){_0x2ebe23=_0x2ebe23||0xcc;return function(_0x2e7188){if(_0x2e7188){return _0x415549['sendStatus'](_0x2ebe23);}return _0x415549['status'](_0x2ebe23)[_0xde28('0x1c')]();};}function respondWithResult(_0x5bfb22,_0x4a66ef){_0x4a66ef=_0x4a66ef||0xc8;return function(_0x3c06c8){if(_0x3c06c8){return _0x5bfb22[_0xde28('0x1d')](_0x4a66ef)['json'](_0x3c06c8);}};}function respondWithFilteredResult(_0x3ec902,_0x4a9cb3){return function(_0x3e246e){if(_0x3e246e){var _0x593878=typeof _0x4a9cb3[_0xde28('0x1e')]===_0xde28('0x1f')&&typeof _0x4a9cb3[_0xde28('0x20')]===_0xde28('0x1f');var _0x2a35db=_0x3e246e['count'];var _0x34910e=_0x593878?0x0:_0x4a9cb3[_0xde28('0x1e')];var _0x444789=_0x593878?_0x3e246e['count']:_0x4a9cb3[_0xde28('0x1e')]+_0x4a9cb3[_0xde28('0x20')];var _0x1b7584;if(_0x444789>=_0x2a35db){_0x444789=_0x2a35db;_0x1b7584=0xc8;}else{_0x1b7584=0xce;}_0x3ec902[_0xde28('0x1d')](_0x1b7584);return _0x3ec902[_0xde28('0x21')](_0xde28('0x22'),_0x34910e+'-'+_0x444789+'/'+_0x2a35db)['json'](_0x3e246e);}return null;};}function patchUpdates(_0x2af901){return function(_0x2bca13){try{jsonpatch[_0xde28('0x23')](_0x2bca13,_0x2af901,!![]);}catch(_0x186c81){return BPromise[_0xde28('0x24')](_0x186c81);}return _0x2bca13[_0xde28('0x25')]();};}function saveUpdates(_0x1b27e5,_0x263e2e){return function(_0x51ee8e){if(_0x51ee8e){return _0x51ee8e[_0xde28('0x26')](_0x1b27e5)['then'](function(_0x56e835){return _0x56e835;});}return null;};}function removeEntity(_0x5d135c,_0x185089){return function(_0x41aa9d){if(_0x41aa9d){return _0x41aa9d[_0xde28('0x27')]()[_0xde28('0x28')](function(){var _0x43f6f3=_0x41aa9d['get']({'plain':!![]});var _0x28eb4e=_0xde28('0x29');return db[_0xde28('0x2a')]['destroy']({'where':{'type':_0x28eb4e,'resourceId':_0x43f6f3['id']}})[_0xde28('0x28')](function(){return _0x41aa9d;});})[_0xde28('0x28')](function(){_0x5d135c[_0xde28('0x1d')](0xcc)[_0xde28('0x1c')]();});}};}function handleEntityNotFound(_0x4287b7,_0x3b2410){return function(_0x3240d8){if(!_0x3240d8){_0x4287b7[_0xde28('0x2b')](0x194);}return _0x3240d8;};}function handleError(_0x37f358,_0x9e8628){_0x9e8628=_0x9e8628||0x1f4;return function(_0x2bdd88){logger[_0xde28('0x2c')](_0x2bdd88[_0xde28('0x2d')]);if(_0x2bdd88[_0xde28('0x2e')]){delete _0x2bdd88[_0xde28('0x2e')];}_0x37f358[_0xde28('0x1d')](_0x9e8628)[_0xde28('0x2f')](_0x2bdd88);};}exports[_0xde28('0x30')]=function(_0xffc753,_0xcfa853){var _0x50d6ae={},_0x459d1c={},_0x53862f={'count':0x0,'rows':[]};return db[_0xde28('0x31')][_0xde28('0x32')]()[_0xde28('0x28')](function(_0x2e0214){_0x459d1c[_0xde28('0x33')]=_['keys'](_0x2e0214);_0x459d1c[_0xde28('0x34')]=_['keys'](_0xffc753['query']);_0x459d1c[_0xde28('0x35')]=_[_0xde28('0x36')](_0x459d1c['model'],_0x459d1c[_0xde28('0x34')]);_0x50d6ae[_0xde28('0x37')]=_['intersection'](_0x459d1c[_0xde28('0x33')],qs[_0xde28('0x38')](_0xffc753[_0xde28('0x34')][_0xde28('0x38')]));_0x50d6ae[_0xde28('0x37')]=_0x50d6ae[_0xde28('0x37')][_0xde28('0x39')]?_0x50d6ae[_0xde28('0x37')]:_0x459d1c[_0xde28('0x33')];if(!_0xffc753[_0xde28('0x34')][_0xde28('0x3a')](_0xde28('0x3b'))){_0x50d6ae[_0xde28('0x20')]=qs[_0xde28('0x20')](_0xffc753[_0xde28('0x34')][_0xde28('0x20')]);_0x50d6ae[_0xde28('0x1e')]=qs['offset'](_0xffc753['query'][_0xde28('0x1e')]);}_0x50d6ae['order']=qs[_0xde28('0x3c')](_0xffc753[_0xde28('0x34')][_0xde28('0x3c')]);_0x50d6ae[_0xde28('0x3d')]=qs[_0xde28('0x35')](_[_0xde28('0x3e')](_0xffc753[_0xde28('0x34')],_0x459d1c[_0xde28('0x35')]),_0x2e0214);if(_0xffc753[_0xde28('0x34')][_0xde28('0x3f')]){_0x50d6ae[_0xde28('0x3d')]=_['merge'](_0x50d6ae[_0xde28('0x3d')],{'$or':_[_0xde28('0x40')](_0x50d6ae['attributes'],function(_0x555e48){var _0x5d3016={};_0x5d3016[_0x555e48]={'$like':'%'+_0xffc753[_0xde28('0x34')][_0xde28('0x3f')]+'%'};return _0x5d3016;})});}_0x50d6ae=_['merge']({},_0x50d6ae,_0xffc753[_0xde28('0x41')]);var _0x3e0cc1={'where':_0x50d6ae[_0xde28('0x3d')]};return db[_0xde28('0x31')][_0xde28('0x42')](_0x3e0cc1)[_0xde28('0x28')](function(_0x515f28){_0x53862f[_0xde28('0x42')]=_0x515f28;if(_0xffc753[_0xde28('0x34')][_0xde28('0x43')]){_0x50d6ae[_0xde28('0x44')]=[{'all':!![]}];}return db[_0xde28('0x31')]['findAll'](_0x50d6ae);})[_0xde28('0x28')](function(_0x5891ff){_0x53862f['rows']=_0x5891ff;return _0x53862f;})['then'](respondWithFilteredResult(_0xcfa853,_0x50d6ae))['catch'](handleError(_0xcfa853,null));})[_0xde28('0x45')](handleError(_0xcfa853,null));};exports['show']=function(_0x288a9c,_0x4be8a8){var _0x2346bb={'raw':![],'where':{'id':_0x288a9c[_0xde28('0x46')]['id']}},_0x304daa={};_0x304daa[_0xde28('0x33')]=_[_0xde28('0x47')](db[_0xde28('0x31')]['rawAttributes']);_0x304daa[_0xde28('0x34')]=_[_0xde28('0x47')](_0x288a9c[_0xde28('0x34')]);_0x304daa[_0xde28('0x35')]=_[_0xde28('0x36')](_0x304daa[_0xde28('0x33')],_0x304daa[_0xde28('0x34')]);_0x2346bb[_0xde28('0x37')]=_[_0xde28('0x36')](_0x304daa[_0xde28('0x33')],qs['fields'](_0x288a9c[_0xde28('0x34')][_0xde28('0x38')]));_0x2346bb['attributes']=_0x2346bb[_0xde28('0x37')][_0xde28('0x39')]?_0x2346bb['attributes']:_0x304daa[_0xde28('0x33')];if(_0x288a9c[_0xde28('0x34')][_0xde28('0x43')]){_0x2346bb[_0xde28('0x44')]=[{'all':!![]}];}_0x2346bb=_[_0xde28('0x48')]({},_0x2346bb,_0x288a9c[_0xde28('0x41')]);return db[_0xde28('0x31')][_0xde28('0x49')](_0x2346bb)['then'](handleEntityNotFound(_0x4be8a8,null))[_0xde28('0x28')](respondWithResult(_0x4be8a8,null))[_0xde28('0x45')](handleError(_0x4be8a8,null));};exports[_0xde28('0x4a')]=function(_0x2d6db2,_0x266e7d){return db[_0xde28('0x31')]['create'](_0x2d6db2['body'],{})['then'](function(_0x229d69){var _0x2d029e=_0x2d6db2[_0xde28('0x4b')][_0xde28('0x4c')]({'plain':!![]});if(!_0x2d029e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d029e['role']===_0xde28('0x4b')){var _0x4ee41f=_0x229d69[_0xde28('0x4c')]({'plain':!![]});var _0x5a5b6b=_0xde28('0x29');return db[_0xde28('0x4d')][_0xde28('0x49')]({'where':{'name':_0x5a5b6b,'userProfileId':_0x2d029e[_0xde28('0x4e')]},'raw':!![]})[_0xde28('0x28')](function(_0x2d4403){if(_0x2d4403&&_0x2d4403[_0xde28('0x4f')]===0x0){return db['UserProfileResource'][_0xde28('0x4a')]({'name':_0x4ee41f[_0xde28('0x2e')],'resourceId':_0x4ee41f['id'],'type':_0x2d4403[_0xde28('0x2e')],'sectionId':_0x2d4403['id']},{})[_0xde28('0x28')](function(){return _0x229d69;});}else{return _0x229d69;}})[_0xde28('0x45')](function(_0x56d1e7){logger[_0xde28('0x2c')](_0xde28('0x50'),_0x56d1e7);throw _0x56d1e7;});}return _0x229d69;})['then'](respondWithResult(_0x266e7d,0xc9))[_0xde28('0x45')](handleError(_0x266e7d,null));};exports['update']=function(_0x5c46ee,_0x383194){if(_0x5c46ee[_0xde28('0x51')]['id']){delete _0x5c46ee[_0xde28('0x51')]['id'];}return db['CmCompany'][_0xde28('0x49')]({'where':{'id':_0x5c46ee[_0xde28('0x46')]['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x383194,null))['then'](saveUpdates(_0x5c46ee['body'],null))[_0xde28('0x28')](respondWithResult(_0x383194,null))['catch'](handleError(_0x383194,null));};exports[_0xde28('0x27')]=function(_0x2e73f4,_0x37fced){return db['CmCompany']['find']({'where':{'id':_0x2e73f4[_0xde28('0x46')]['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x37fced,null))['then'](removeEntity(_0x37fced,null))['catch'](handleError(_0x37fced,null));};exports['describe']=function(_0x3b21f5,_0xc716f2){return db[_0xde28('0x31')][_0xde28('0x32')]()[_0xde28('0x28')](respondWithResult(_0xc716f2,null))[_0xde28('0x45')](handleError(_0xc716f2,null));};exports[_0xde28('0x52')]=function(_0x304afa,_0x2ac507,_0xc5005){return db[_0xde28('0x53')]['find']({'where':{'id':_0x304afa['params']['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x2ac507,null))[_0xde28('0x28')](function(_0x1298a1){if(_0x1298a1){return _0x1298a1[_0xde28('0x52')](_0x304afa[_0xde28('0x51')][_0xde28('0x54')],_['omit'](_0x304afa[_0xde28('0x51')],[_0xde28('0x54'),'id'])||{});}})[_0xde28('0x28')](respondWithResult(_0x2ac507,null))[_0xde28('0x45')](handleError(_0x2ac507,null));};exports[_0xde28('0x55')]=function(_0x4c2718,_0x210097,_0x4e47c3){var _0x7594ab={};var _0xeaf52={};var _0x25f35f;var _0x36936f;return db['CmCompany'][_0xde28('0x56')]({'where':{'id':_0x4c2718[_0xde28('0x46')]['id']}})[_0xde28('0x28')](handleEntityNotFound(_0x210097,null))[_0xde28('0x28')](function(_0x56f76d){if(_0x56f76d){_0x25f35f=_0x56f76d;_0xeaf52[_0xde28('0x33')]=_[_0xde28('0x47')](db[_0xde28('0x53')][_0xde28('0x57')]);_0xeaf52[_0xde28('0x34')]=_[_0xde28('0x47')](_0x4c2718[_0xde28('0x34')]);_0xeaf52[_0xde28('0x35')]=_['intersection'](_0xeaf52['model'],_0xeaf52[_0xde28('0x34')]);_0x7594ab[_0xde28('0x37')]=_[_0xde28('0x36')](_0xeaf52[_0xde28('0x33')],qs[_0xde28('0x38')](_0x4c2718['query'][_0xde28('0x38')]));_0x7594ab[_0xde28('0x37')]=_0x7594ab[_0xde28('0x37')][_0xde28('0x39')]?_0x7594ab[_0xde28('0x37')]:_0xeaf52['model'];_0x7594ab[_0xde28('0x58')]=qs[_0xde28('0x3c')](_0x4c2718[_0xde28('0x34')][_0xde28('0x3c')]);_0x7594ab[_0xde28('0x3d')]=qs[_0xde28('0x35')](_['pick'](_0x4c2718[_0xde28('0x34')],_0xeaf52['filters']));if(_0x4c2718[_0xde28('0x34')][_0xde28('0x3f')]){_0x7594ab[_0xde28('0x3d')]=_[_0xde28('0x48')](_0x7594ab[_0xde28('0x3d')],{'$or':_['map'](_0x7594ab['attributes'],function(_0x364097){var _0x231615={};_0x231615[_0x364097]={'$like':'%'+_0x4c2718[_0xde28('0x34')][_0xde28('0x3f')]+'%'};return _0x231615;})});}_0x7594ab=_['merge']({},_0x7594ab,_0x4c2718[_0xde28('0x41')]);return _0x25f35f[_0xde28('0x55')](_0x7594ab);}})[_0xde28('0x28')](function(_0xfe7fb2){if(_0xfe7fb2){_0x36936f=_0xfe7fb2[_0xde28('0x39')];if(!_0x4c2718['query']['hasOwnProperty'](_0xde28('0x3b'))){_0x7594ab[_0xde28('0x20')]=qs[_0xde28('0x20')](_0x4c2718[_0xde28('0x34')]['limit']);_0x7594ab[_0xde28('0x1e')]=qs[_0xde28('0x1e')](_0x4c2718[_0xde28('0x34')][_0xde28('0x1e')]);}return _0x25f35f['getContacts'](_0x7594ab);}})[_0xde28('0x28')](function(_0x252f60){if(_0x252f60){return _0x252f60?{'count':_0x36936f,'rows':_0x252f60}:null;}})[_0xde28('0x28')](respondWithResult(_0x210097,null))[_0xde28('0x45')](handleError(_0x210097,null));};
\ No newline at end of file
+var _0xc554=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','CmContact','addContacts','ids','omit','findOne','filter','getContacts','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5adf6c,_0x43aded){var _0x54535f=function(_0xe03640){while(--_0xe03640){_0x5adf6c['push'](_0x5adf6c['shift']());}};_0x54535f(++_0x43aded);}(_0xc554,0x142));var _0x4c55=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc554[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4c55('0x0'));var jsonpatch=require(_0x4c55('0x1'));var rp=require(_0x4c55('0x2'));var moment=require(_0x4c55('0x3'));var BPromise=require(_0x4c55('0x4'));var Mustache=require('mustache');var util=require(_0x4c55('0x5'));var path=require('path');var sox=require(_0x4c55('0x6'));var csv=require(_0x4c55('0x7'));var ejs=require(_0x4c55('0x8'));var fs=require('fs');var fs_extra=require(_0x4c55('0x9'));var _=require(_0x4c55('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c55('0xb'));var toCsv=require(_0x4c55('0x7'));var querystring=require(_0x4c55('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4c55('0xd'));var qs=require(_0x4c55('0xe'));var as=require(_0x4c55('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4c55('0x10'));var utils=require(_0x4c55('0x11'));var config=require(_0x4c55('0x12'));var licenseUtil=require(_0x4c55('0x13'));var db=require(_0x4c55('0x14'))['db'];function respondWithStatusCode(_0x5918d2,_0x26b645){_0x26b645=_0x26b645||0xcc;return function(_0x55b87d){if(_0x55b87d){return _0x5918d2[_0x4c55('0x15')](_0x26b645);}return _0x5918d2[_0x4c55('0x16')](_0x26b645)[_0x4c55('0x17')]();};}function respondWithResult(_0x50f3e3,_0xbb2cfd){_0xbb2cfd=_0xbb2cfd||0xc8;return function(_0x6e3319){if(_0x6e3319){return _0x50f3e3[_0x4c55('0x16')](_0xbb2cfd)[_0x4c55('0x18')](_0x6e3319);}};}function respondWithFilteredResult(_0x15fd7d,_0x509b53){return function(_0x4a47a8){if(_0x4a47a8){var _0x912b74=typeof _0x509b53[_0x4c55('0x19')]===_0x4c55('0x1a')&&typeof _0x509b53[_0x4c55('0x1b')]===_0x4c55('0x1a');var _0x56edff=_0x4a47a8[_0x4c55('0x1c')];var _0x4956c1=_0x912b74?0x0:_0x509b53['offset'];var _0x373b3d=_0x912b74?_0x4a47a8['count']:_0x509b53['offset']+_0x509b53['limit'];var _0xb05ec4;if(_0x373b3d>=_0x56edff){_0x373b3d=_0x56edff;_0xb05ec4=0xc8;}else{_0xb05ec4=0xce;}_0x15fd7d[_0x4c55('0x16')](_0xb05ec4);return _0x15fd7d[_0x4c55('0x1d')](_0x4c55('0x1e'),_0x4956c1+'-'+_0x373b3d+'/'+_0x56edff)[_0x4c55('0x18')](_0x4a47a8);}return null;};}function patchUpdates(_0x50c810){return function(_0x52b567){try{jsonpatch[_0x4c55('0x1f')](_0x52b567,_0x50c810,!![]);}catch(_0x9ed2fc){return BPromise[_0x4c55('0x20')](_0x9ed2fc);}return _0x52b567[_0x4c55('0x21')]();};}function saveUpdates(_0x482a5c,_0x415154){return function(_0x55c924){if(_0x55c924){return _0x55c924[_0x4c55('0x22')](_0x482a5c)[_0x4c55('0x23')](function(_0x41af07){return _0x41af07;});}return null;};}function removeEntity(_0x2a5d16,_0x912a2e){return function(_0x3dc057){if(_0x3dc057){return _0x3dc057[_0x4c55('0x24')]()['then'](function(){var _0x38b85f=_0x3dc057[_0x4c55('0x25')]({'plain':!![]});var _0x103d57=_0x4c55('0x26');return db[_0x4c55('0x27')][_0x4c55('0x24')]({'where':{'type':_0x103d57,'resourceId':_0x38b85f['id']}})[_0x4c55('0x23')](function(){return _0x3dc057;});})[_0x4c55('0x23')](function(){_0x2a5d16[_0x4c55('0x16')](0xcc)[_0x4c55('0x17')]();});}};}function handleEntityNotFound(_0x6934d1,_0x4e2e99){return function(_0x3ed9b0){if(!_0x3ed9b0){_0x6934d1[_0x4c55('0x15')](0x194);}return _0x3ed9b0;};}function handleError(_0x18a30a,_0xe14066){_0xe14066=_0xe14066||0x1f4;return function(_0x2936c0){logger[_0x4c55('0x28')](_0x2936c0[_0x4c55('0x29')]);if(_0x2936c0[_0x4c55('0x2a')]){delete _0x2936c0[_0x4c55('0x2a')];}_0x18a30a[_0x4c55('0x16')](_0xe14066)[_0x4c55('0x2b')](_0x2936c0);};}exports['index']=function(_0x5bf367,_0x389ae2){var _0x123059={},_0x20cec5={},_0x2df10a={'count':0x0,'rows':[]};return db[_0x4c55('0x2c')]['describe']()[_0x4c55('0x23')](function(_0x548e4d){_0x20cec5[_0x4c55('0x2d')]=_['keys'](_0x548e4d);_0x20cec5[_0x4c55('0x2e')]=_[_0x4c55('0x2f')](_0x5bf367['query']);_0x20cec5['filters']=_[_0x4c55('0x30')](_0x20cec5['model'],_0x20cec5[_0x4c55('0x2e')]);_0x123059[_0x4c55('0x31')]=_[_0x4c55('0x30')](_0x20cec5[_0x4c55('0x2d')],qs['fields'](_0x5bf367['query'][_0x4c55('0x32')]));_0x123059['attributes']=_0x123059[_0x4c55('0x31')][_0x4c55('0x33')]?_0x123059[_0x4c55('0x31')]:_0x20cec5[_0x4c55('0x2d')];if(!_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x34')](_0x4c55('0x35'))){_0x123059[_0x4c55('0x1b')]=qs[_0x4c55('0x1b')](_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x1b')]);_0x123059[_0x4c55('0x19')]=qs['offset'](_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x19')]);}_0x123059[_0x4c55('0x36')]=qs[_0x4c55('0x37')](_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x37')]);_0x123059[_0x4c55('0x38')]=qs[_0x4c55('0x39')](_[_0x4c55('0x3a')](_0x5bf367['query'],_0x20cec5[_0x4c55('0x39')]),_0x548e4d);if(_0x5bf367['query']['filter']){_0x123059[_0x4c55('0x38')]=_['merge'](_0x123059[_0x4c55('0x38')],{'$or':_['map'](_0x123059[_0x4c55('0x31')],function(_0x5f3f66){var _0xf5a651={};_0xf5a651[_0x5f3f66]={'$like':'%'+_0x5bf367[_0x4c55('0x2e')]['filter']+'%'};return _0xf5a651;})});}_0x123059=_[_0x4c55('0x3b')]({},_0x123059,_0x5bf367['options']);var _0x180001={'where':_0x123059['where']};return db[_0x4c55('0x2c')][_0x4c55('0x1c')](_0x180001)[_0x4c55('0x23')](function(_0x17679a){_0x2df10a[_0x4c55('0x1c')]=_0x17679a;if(_0x5bf367[_0x4c55('0x2e')][_0x4c55('0x3c')]){_0x123059['include']=[{'all':!![]}];}return db[_0x4c55('0x2c')][_0x4c55('0x3d')](_0x123059);})[_0x4c55('0x23')](function(_0xbc7755){_0x2df10a[_0x4c55('0x3e')]=_0xbc7755;return _0x2df10a;})[_0x4c55('0x23')](respondWithFilteredResult(_0x389ae2,_0x123059))[_0x4c55('0x3f')](handleError(_0x389ae2,null));})[_0x4c55('0x3f')](handleError(_0x389ae2,null));};exports[_0x4c55('0x40')]=function(_0x125eab,_0xa00154){var _0x41698d={'raw':![],'where':{'id':_0x125eab[_0x4c55('0x41')]['id']}},_0x5d54eb={};_0x5d54eb[_0x4c55('0x2d')]=_[_0x4c55('0x2f')](db[_0x4c55('0x2c')][_0x4c55('0x42')]);_0x5d54eb[_0x4c55('0x2e')]=_[_0x4c55('0x2f')](_0x125eab[_0x4c55('0x2e')]);_0x5d54eb[_0x4c55('0x39')]=_[_0x4c55('0x30')](_0x5d54eb[_0x4c55('0x2d')],_0x5d54eb[_0x4c55('0x2e')]);_0x41698d[_0x4c55('0x31')]=_[_0x4c55('0x30')](_0x5d54eb[_0x4c55('0x2d')],qs[_0x4c55('0x32')](_0x125eab[_0x4c55('0x2e')][_0x4c55('0x32')]));_0x41698d['attributes']=_0x41698d[_0x4c55('0x31')]['length']?_0x41698d[_0x4c55('0x31')]:_0x5d54eb[_0x4c55('0x2d')];if(_0x125eab[_0x4c55('0x2e')][_0x4c55('0x3c')]){_0x41698d[_0x4c55('0x43')]=[{'all':!![]}];}_0x41698d=_['merge']({},_0x41698d,_0x125eab[_0x4c55('0x44')]);return db['CmCompany'][_0x4c55('0x45')](_0x41698d)['then'](handleEntityNotFound(_0xa00154,null))['then'](respondWithResult(_0xa00154,null))[_0x4c55('0x3f')](handleError(_0xa00154,null));};exports['create']=function(_0x11db4a,_0x36e82b){return db[_0x4c55('0x2c')][_0x4c55('0x46')](_0x11db4a[_0x4c55('0x47')],{})[_0x4c55('0x23')](function(_0x5f344a){var _0x12f1a7=_0x11db4a[_0x4c55('0x48')]['get']({'plain':!![]});if(!_0x12f1a7)throw new Error(_0x4c55('0x49'));if(_0x12f1a7[_0x4c55('0x4a')]===_0x4c55('0x48')){var _0x14ccc3=_0x5f344a[_0x4c55('0x25')]({'plain':!![]});var _0x2770b6='Companies';return db[_0x4c55('0x4b')][_0x4c55('0x45')]({'where':{'name':_0x2770b6,'userProfileId':_0x12f1a7['userProfileId']},'raw':!![]})['then'](function(_0x3ba594){if(_0x3ba594&&_0x3ba594[_0x4c55('0x4c')]===0x0){return db[_0x4c55('0x27')]['create']({'name':_0x14ccc3[_0x4c55('0x2a')],'resourceId':_0x14ccc3['id'],'type':_0x3ba594[_0x4c55('0x2a')],'sectionId':_0x3ba594['id']},{})[_0x4c55('0x23')](function(){return _0x5f344a;});}else{return _0x5f344a;}})[_0x4c55('0x3f')](function(_0x2e092b){logger[_0x4c55('0x28')](_0x4c55('0x4d'),_0x2e092b);throw _0x2e092b;});}return _0x5f344a;})[_0x4c55('0x23')](respondWithResult(_0x36e82b,0xc9))[_0x4c55('0x3f')](handleError(_0x36e82b,null));};exports[_0x4c55('0x22')]=function(_0x420573,_0x308284){if(_0x420573['body']['id']){delete _0x420573[_0x4c55('0x47')]['id'];}return db['CmCompany'][_0x4c55('0x45')]({'where':{'id':_0x420573[_0x4c55('0x41')]['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x308284,null))[_0x4c55('0x23')](saveUpdates(_0x420573[_0x4c55('0x47')],null))[_0x4c55('0x23')](respondWithResult(_0x308284,null))[_0x4c55('0x3f')](handleError(_0x308284,null));};exports[_0x4c55('0x24')]=function(_0x44e5f1,_0x39ec29){return db[_0x4c55('0x2c')]['find']({'where':{'id':_0x44e5f1[_0x4c55('0x41')]['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x39ec29,null))[_0x4c55('0x23')](removeEntity(_0x39ec29,null))[_0x4c55('0x3f')](handleError(_0x39ec29,null));};exports[_0x4c55('0x4e')]=function(_0x30678c,_0x4f996c){return db[_0x4c55('0x2c')][_0x4c55('0x4e')]()[_0x4c55('0x23')](respondWithResult(_0x4f996c,null))[_0x4c55('0x3f')](handleError(_0x4f996c,null));};exports['addContacts']=function(_0x1a483e,_0x2c3b9c,_0x355f06){return db[_0x4c55('0x4f')][_0x4c55('0x45')]({'where':{'id':_0x1a483e[_0x4c55('0x41')]['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x2c3b9c,null))['then'](function(_0x4eb2a2){if(_0x4eb2a2){return _0x4eb2a2[_0x4c55('0x50')](_0x1a483e[_0x4c55('0x47')][_0x4c55('0x51')],_[_0x4c55('0x52')](_0x1a483e[_0x4c55('0x47')],[_0x4c55('0x51'),'id'])||{});}})[_0x4c55('0x23')](respondWithResult(_0x2c3b9c,null))['catch'](handleError(_0x2c3b9c,null));};exports['getContacts']=function(_0xcf3413,_0x343b12,_0x40a1cb){var _0x27fb34={};var _0x8782af={};var _0x3c57f7;var _0x360e48;return db[_0x4c55('0x2c')][_0x4c55('0x53')]({'where':{'id':_0xcf3413['params']['id']}})[_0x4c55('0x23')](handleEntityNotFound(_0x343b12,null))[_0x4c55('0x23')](function(_0x2af24b){if(_0x2af24b){_0x3c57f7=_0x2af24b;_0x8782af[_0x4c55('0x2d')]=_['keys'](db[_0x4c55('0x4f')][_0x4c55('0x42')]);_0x8782af[_0x4c55('0x2e')]=_[_0x4c55('0x2f')](_0xcf3413['query']);_0x8782af[_0x4c55('0x39')]=_[_0x4c55('0x30')](_0x8782af['model'],_0x8782af[_0x4c55('0x2e')]);_0x27fb34[_0x4c55('0x31')]=_[_0x4c55('0x30')](_0x8782af[_0x4c55('0x2d')],qs[_0x4c55('0x32')](_0xcf3413[_0x4c55('0x2e')][_0x4c55('0x32')]));_0x27fb34['attributes']=_0x27fb34[_0x4c55('0x31')][_0x4c55('0x33')]?_0x27fb34[_0x4c55('0x31')]:_0x8782af[_0x4c55('0x2d')];_0x27fb34['order']=qs[_0x4c55('0x37')](_0xcf3413[_0x4c55('0x2e')]['sort']);_0x27fb34[_0x4c55('0x38')]=qs[_0x4c55('0x39')](_[_0x4c55('0x3a')](_0xcf3413[_0x4c55('0x2e')],_0x8782af['filters']));if(_0xcf3413[_0x4c55('0x2e')]['filter']){_0x27fb34['where']=_[_0x4c55('0x3b')](_0x27fb34[_0x4c55('0x38')],{'$or':_['map'](_0x27fb34['attributes'],function(_0x694deb){var _0x31c813={};_0x31c813[_0x694deb]={'$like':'%'+_0xcf3413[_0x4c55('0x2e')][_0x4c55('0x54')]+'%'};return _0x31c813;})});}_0x27fb34=_[_0x4c55('0x3b')]({},_0x27fb34,_0xcf3413['options']);return _0x3c57f7['getContacts'](_0x27fb34);}})[_0x4c55('0x23')](function(_0x40beb0){if(_0x40beb0){_0x360e48=_0x40beb0[_0x4c55('0x33')];if(!_0xcf3413[_0x4c55('0x2e')][_0x4c55('0x34')](_0x4c55('0x35'))){_0x27fb34[_0x4c55('0x1b')]=qs['limit'](_0xcf3413['query'][_0x4c55('0x1b')]);_0x27fb34['offset']=qs[_0x4c55('0x19')](_0xcf3413['query'][_0x4c55('0x19')]);}return _0x3c57f7[_0x4c55('0x55')](_0x27fb34);}})['then'](function(_0x59c169){if(_0x59c169){return _0x59c169?{'count':_0x360e48,'rows':_0x59c169}:null;}})['then'](respondWithResult(_0x343b12,null))[_0x4c55('0x3f')](handleError(_0x343b12,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 4d53a7b..ab05b5e 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 _0x694d=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x57e12f,_0x4d11e3){var _0x2b8c6c=function(_0x30b011){while(--_0x30b011){_0x57e12f['push'](_0x57e12f['shift']());}};_0x2b8c6c(++_0x4d11e3);}(_0x694d,0x160));var _0xd694=function(_0x37c66f,_0x24838a){_0x37c66f=_0x37c66f-0x0;var _0x46ba0e=_0x694d[_0x37c66f];return _0x46ba0e;};'use strict';var _=require(_0xd694('0x0'));var util=require(_0xd694('0x1'));var logger=require(_0xd694('0x2'))(_0xd694('0x3'));var moment=require(_0xd694('0x4'));var BPromise=require(_0xd694('0x5'));var rp=require(_0xd694('0x6'));var fs=require('fs');var path=require(_0xd694('0x7'));var rimraf=require('rimraf');var config=require(_0xd694('0x8'));var attributes=require(_0xd694('0x9'));module['exports']=function(_0x51b766,_0x3bdd71){return _0x51b766[_0xd694('0xa')](_0xd694('0xb'),attributes,{'tableName':_0xd694('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb577=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0xcb67f,_0x512990){var _0x1884d2=function(_0x42a682){while(--_0x42a682){_0xcb67f['push'](_0xcb67f['shift']());}};_0x1884d2(++_0x512990);}(_0xb577,0x1dd));var _0x7b57=function(_0x512178,_0x109489){_0x512178=_0x512178-0x0;var _0xae37b5=_0xb577[_0x512178];return _0xae37b5;};'use strict';var _=require(_0x7b57('0x0'));var util=require(_0x7b57('0x1'));var logger=require(_0x7b57('0x2'))(_0x7b57('0x3'));var moment=require(_0x7b57('0x4'));var BPromise=require(_0x7b57('0x5'));var rp=require(_0x7b57('0x6'));var fs=require('fs');var path=require(_0x7b57('0x7'));var rimraf=require(_0x7b57('0x8'));var config=require(_0x7b57('0x9'));var attributes=require(_0x7b57('0xa'));module[_0x7b57('0xb')]=function(_0x557531,_0x1cd83c){return _0x557531[_0x7b57('0xc')](_0x7b57('0xd'),attributes,{'tableName':_0x7b57('0xe'),'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 e496799..0ba4d1a 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 _0x7d33=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7d33,0x118));var _0x37d3=function(_0x4dcf1d,_0x491ea1){_0x4dcf1d=_0x4dcf1d-0x0;var _0x773104=_0x7d33[_0x4dcf1d];return _0x773104;};'use strict';var _=require(_0x37d3('0x0'));var util=require(_0x37d3('0x1'));var moment=require(_0x37d3('0x2'));var BPromise=require(_0x37d3('0x3'));var rs=require(_0x37d3('0x4'));var fs=require('fs');var Redis=require(_0x37d3('0x5'));var db=require(_0x37d3('0x6'))['db'];var utils=require(_0x37d3('0x7'));var logger=require(_0x37d3('0x8'))('rpc');var config=require(_0x37d3('0x9'));var jayson=require(_0x37d3('0xa'));var client=jayson[_0x37d3('0xb')][_0x37d3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x417e7e,_0x5adff8,_0x4e7d22){return new BPromise(function(_0xd032de,_0x5b5f05){return client[_0x37d3('0xd')](_0x417e7e,_0x4e7d22)[_0x37d3('0xe')](function(_0x3b55ec){logger[_0x37d3('0xf')](_0x37d3('0x10'),_0x5adff8,_0x37d3('0x11'));logger[_0x37d3('0x12')](_0x37d3('0x13'),_0x5adff8,_0x37d3('0x11'),JSON['stringify'](_0x3b55ec));if(_0x3b55ec['error']){if(_0x3b55ec[_0x37d3('0x14')][_0x37d3('0x15')]===0x1f4){logger[_0x37d3('0x14')](_0x37d3('0x10'),_0x5adff8,_0x3b55ec[_0x37d3('0x14')][_0x37d3('0x16')]);return _0x5b5f05(_0x3b55ec[_0x37d3('0x14')][_0x37d3('0x16')]);}logger[_0x37d3('0x14')](_0x37d3('0x10'),_0x5adff8,_0x3b55ec['error'][_0x37d3('0x16')]);return _0xd032de(_0x3b55ec['error'][_0x37d3('0x16')]);}else{logger[_0x37d3('0xf')](_0x37d3('0x10'),_0x5adff8,'request\x20sent');_0xd032de(_0x3b55ec[_0x37d3('0x17')][_0x37d3('0x16')]);}})[_0x37d3('0x18')](function(_0x1e2733){logger[_0x37d3('0x14')](_0x37d3('0x10'),_0x5adff8,_0x1e2733);_0x5b5f05(_0x1e2733);});});}
\ No newline at end of file
+var _0x1199=['code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1199,0x129));var _0x9119=function(_0x55841f,_0x487812){_0x55841f=_0x55841f-0x0;var _0x4c5ccf=_0x1199[_0x55841f];return _0x4c5ccf;};'use strict';var _=require(_0x9119('0x0'));var util=require('util');var moment=require(_0x9119('0x1'));var BPromise=require('bluebird');var rs=require(_0x9119('0x2'));var fs=require('fs');var Redis=require(_0x9119('0x3'));var db=require(_0x9119('0x4'))['db'];var utils=require(_0x9119('0x5'));var logger=require('../../config/logger')(_0x9119('0x6'));var config=require(_0x9119('0x7'));var jayson=require(_0x9119('0x8'));var client=jayson[_0x9119('0x9')][_0x9119('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x364b66,_0x3ac1ae,_0x314b6e){return new BPromise(function(_0x23dec1,_0x5e2cf0){return client[_0x9119('0xb')](_0x364b66,_0x314b6e)[_0x9119('0xc')](function(_0x44272f){logger[_0x9119('0xd')](_0x9119('0xe'),_0x3ac1ae,'request\x20sent');logger['debug'](_0x9119('0xf'),_0x3ac1ae,_0x9119('0x10'),JSON['stringify'](_0x44272f));if(_0x44272f['error']){if(_0x44272f[_0x9119('0x11')][_0x9119('0x12')]===0x1f4){logger[_0x9119('0x11')]('CmCompany,\x20%s,\x20%s',_0x3ac1ae,_0x44272f[_0x9119('0x11')][_0x9119('0x13')]);return _0x5e2cf0(_0x44272f[_0x9119('0x11')]['message']);}logger[_0x9119('0x11')]('CmCompany,\x20%s,\x20%s',_0x3ac1ae,_0x44272f[_0x9119('0x11')][_0x9119('0x13')]);return _0x23dec1(_0x44272f['error'][_0x9119('0x13')]);}else{logger[_0x9119('0xd')](_0x9119('0xe'),_0x3ac1ae,'request\x20sent');_0x23dec1(_0x44272f['result'][_0x9119('0x13')]);}})[_0x9119('0x14')](function(_0x2e0990){logger[_0x9119('0x11')](_0x9119('0xe'),_0x3ac1ae,_0x2e0990);_0x5e2cf0(_0x2e0990);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ad3b187..b7d6a66 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 _0xbf8f=['../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','show','/:id/contacts','getContacts','create','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x170c59,_0x3fc75e){var _0x4eccd8=function(_0x56b71f){while(--_0x56b71f){_0x170c59['push'](_0x170c59['shift']());}};_0x4eccd8(++_0x3fc75e);}(_0xbf8f,0xb8));var _0xfbf8=function(_0x462b4e,_0x3d2257){_0x462b4e=_0x462b4e-0x0;var _0x455d8c=_0xbf8f[_0x462b4e];return _0x455d8c;};'use strict';var multer=require(_0xfbf8('0x0'));var util=require(_0xfbf8('0x1'));var path=require(_0xfbf8('0x2'));var timeout=require(_0xfbf8('0x3'));var express=require(_0xfbf8('0x4'));var router=express[_0xfbf8('0x5')]();var fs_extra=require(_0xfbf8('0x6'));var auth=require(_0xfbf8('0x7'));var interaction=require(_0xfbf8('0x8'));var config=require(_0xfbf8('0x9'));var controller=require(_0xfbf8('0xa'));router[_0xfbf8('0xb')]('/',auth[_0xfbf8('0xc')](),controller['index']);router[_0xfbf8('0xb')](_0xfbf8('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfbf8('0xe'),auth[_0xfbf8('0xc')](),controller[_0xfbf8('0xf')]);router[_0xfbf8('0xb')](_0xfbf8('0x10'),auth['isAuthenticated'](),controller[_0xfbf8('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfbf8('0x12')]);router[_0xfbf8('0x13')]('/:id/contacts',auth[_0xfbf8('0xc')](),controller['addContacts']);router[_0xfbf8('0x14')](_0xfbf8('0xe'),auth[_0xfbf8('0xc')](),controller[_0xfbf8('0x15')]);router['delete'](_0xfbf8('0xe'),auth[_0xfbf8('0xc')](),controller[_0xfbf8('0x16')]);module[_0xfbf8('0x17')]=router;
\ No newline at end of file
+var _0x1059=['/:id','show','/:id/contacts','post','put','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','isAuthenticated','describe','get'];(function(_0x4d1800,_0x2138d7){var _0x6ac748=function(_0x279259){while(--_0x279259){_0x4d1800['push'](_0x4d1800['shift']());}};_0x6ac748(++_0x2138d7);}(_0x1059,0x1aa));var _0x9105=function(_0x50baeb,_0x26431a){_0x50baeb=_0x50baeb-0x0;var _0x494366=_0x1059[_0x50baeb];return _0x494366;};'use strict';var multer=require(_0x9105('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9105('0x1'));var router=express[_0x9105('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9105('0x3'));var interaction=require(_0x9105('0x4'));var config=require(_0x9105('0x5'));var controller=require(_0x9105('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9105('0x7')]);router['get']('/describe',auth[_0x9105('0x8')](),controller[_0x9105('0x9')]);router[_0x9105('0xa')](_0x9105('0xb'),auth[_0x9105('0x8')](),controller[_0x9105('0xc')]);router[_0x9105('0xa')](_0x9105('0xd'),auth[_0x9105('0x8')](),controller['getContacts']);router[_0x9105('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9105('0xe')](_0x9105('0xd'),auth[_0x9105('0x8')](),controller['addContacts']);router[_0x9105('0xf')](_0x9105('0xb'),auth['isAuthenticated'](),controller[_0x9105('0x10')]);router[_0x9105('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9105('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3167418..685d9fc 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 _0xa509=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xa509,0x1e7));var _0x9a50=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa509[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9a50('0x0'));var Sequelize=require('sequelize');module[_0x9a50('0x1')]={'firstName':{'type':Sequelize[_0x9a50('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9a50('0x2')]},'street':{'type':Sequelize[_0x9a50('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9a50('0x2')]},'country':{'type':Sequelize[_0x9a50('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9a50('0x2')]},'description':{'type':Sequelize[_0x9a50('0x3')]},'phone':{'type':Sequelize[_0x9a50('0x2')]},'mobile':{'type':Sequelize[_0x9a50('0x2')]},'fax':{'type':Sequelize[_0x9a50('0x2')]},'email':{'type':Sequelize[_0x9a50('0x2')]},'url':{'type':Sequelize[_0x9a50('0x2')]},'facebook':{'type':Sequelize[_0x9a50('0x2')]},'fb_data':{'type':Sequelize[_0x9a50('0x2')]},'twitter':{'type':Sequelize[_0x9a50('0x2')]},'skype':{'type':Sequelize[_0x9a50('0x2')]},'teams':{'type':Sequelize[_0x9a50('0x2')]},'viber':{'type':Sequelize[_0x9a50('0x2')]},'line':{'type':Sequelize[_0x9a50('0x2')]},'wechat':{'type':Sequelize[_0x9a50('0x2')]},'telegram':{'type':Sequelize[_0x9a50('0x2')]},'UserId':{'type':Sequelize[_0x9a50('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x9a50('0x2')]},'priority':{'type':Sequelize[_0x9a50('0x4')](0x2)[_0x9a50('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9a50('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x9a50('0x2')]},'utcOffset':{'type':Sequelize[_0x9a50('0x4')]}};
\ No newline at end of file
+var _0x4293=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x23f7f0,_0x1548a0){var _0x445c99=function(_0x339f94){while(--_0x339f94){_0x23f7f0['push'](_0x23f7f0['shift']());}};_0x445c99(++_0x1548a0);}(_0x4293,0x11a));var _0x3429=function(_0x407135,_0x2c22d4){_0x407135=_0x407135-0x0;var _0x17c45b=_0x4293[_0x407135];return _0x17c45b;};'use strict';var _=require(_0x3429('0x0'));var Sequelize=require(_0x3429('0x1'));module[_0x3429('0x2')]={'firstName':{'type':Sequelize[_0x3429('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3429('0x3')]},'street':{'type':Sequelize[_0x3429('0x3')]},'postalCode':{'type':Sequelize[_0x3429('0x3')]},'city':{'type':Sequelize[_0x3429('0x3')]},'country':{'type':Sequelize[_0x3429('0x3')]},'dateOfBirth':{'type':Sequelize[_0x3429('0x3')]},'description':{'type':Sequelize[_0x3429('0x4')]},'phone':{'type':Sequelize[_0x3429('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3429('0x3')]},'email':{'type':Sequelize[_0x3429('0x3')]},'url':{'type':Sequelize[_0x3429('0x3')]},'facebook':{'type':Sequelize[_0x3429('0x3')]},'fb_data':{'type':Sequelize[_0x3429('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x3429('0x3')]},'teams':{'type':Sequelize[_0x3429('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x3429('0x3')]},'wechat':{'type':Sequelize[_0x3429('0x3')]},'telegram':{'type':Sequelize[_0x3429('0x3')]},'UserId':{'type':Sequelize[_0x3429('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x3429('0x3')]},'priority':{'type':Sequelize[_0x3429('0x5')](0x2)[_0x3429('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3429('0x7')],'defaultValue':Sequelize[_0x3429('0x8')]},'dialTimezone':{'type':Sequelize[_0x3429('0x3')]},'utcOffset':{'type':Sequelize[_0x3429('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 0bb0aa4..71d0cc4 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 _0xefff=['nolimit','order','pick','select','field','color','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','buildExpression','text','start','isNil','Contact','push','forEach','ListId','where','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','resolve','user','role','agent','some','getLists','isEmpty','c.ListId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','c.firstName','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','columnName','displayName','analytics','CmCustomField','alias','custom','values','body','findAll','get','mergeWith','isArray','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','dialTimezone','timezones','utcOffset','each','duplicates','$or','findOrCreate','spread','additionalPhones','contact','show','find','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','table','toParam','CmHopper','phone','getTags','rawAttributes','sort','filter','options','setTags','ids','setAdditionalPhones','item_types','items','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','bulkCreate','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','includeAll','include','getHopperHistories','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','exit','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC','findAndCountAll','fullname','startCase','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','Owner','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','threadId','Interaction','flatten','sortBy','reverse','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','localhost','./cmContact.socket','register','status','json','offset','undefined','limit','set','Content-Range','destroy','sendStatus','error','stack','name','send','index','CmContact','describe','then','length','keys','startsWith','cf_','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x40fc45,_0x5518bc){var _0x179e2d=function(_0x584129){while(--_0x584129){_0x40fc45['push'](_0x40fc45['shift']());}};_0x179e2d(++_0x5518bc);}(_0xefff,0x114));var _0xfeff=function(_0x59dafd,_0x2c2bb0){_0x59dafd=_0x59dafd-0x0;var _0x528e42=_0xefff[_0x59dafd];return _0x528e42;};'use strict';var moment=require(_0xfeff('0x0'));var BPromise=require('bluebird');var util=require(_0xfeff('0x1'));var path=require(_0xfeff('0x2'));var fs=require('fs');var _=require(_0xfeff('0x3'));var squel=require(_0xfeff('0x4'));var Papa=require(_0xfeff('0x5'));var Redis=require(_0xfeff('0x6'));var qs=require(_0xfeff('0x7'));var as=require(_0xfeff('0x8'));var logger=require(_0xfeff('0x9'))('api');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require(_0xfeff('0xa'))['db'];config['redis']=_['defaults'](config[_0xfeff('0xb')],{'host':_0xfeff('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfeff('0xb')]));require(_0xfeff('0xd'))[_0xfeff('0xe')](socket);function respondWithResult(_0x5100c5,_0x1cd79e){_0x1cd79e=_0x1cd79e||0xc8;return function(_0x14ba05){if(_0x14ba05){return _0x5100c5[_0xfeff('0xf')](_0x1cd79e)[_0xfeff('0x10')](_0x14ba05);}};}function respondWithFilteredResult(_0x156d9a,_0x3f8ee0){return function(_0x121e47){if(_0x121e47){var _0x8a74e3=typeof _0x3f8ee0[_0xfeff('0x11')]===_0xfeff('0x12')&&typeof _0x3f8ee0[_0xfeff('0x13')]===_0xfeff('0x12');var _0x25a209=_0x121e47['count'];var _0x5bfa8c=_0x8a74e3?0x0:_0x3f8ee0['offset'];var _0x4ba232=_0x8a74e3?_0x121e47['count']:_0x3f8ee0[_0xfeff('0x11')]+_0x3f8ee0[_0xfeff('0x13')];var _0x1110df;if(_0x4ba232>=_0x25a209){_0x4ba232=_0x25a209;_0x1110df=0xc8;}else{_0x1110df=0xce;}_0x156d9a[_0xfeff('0xf')](_0x1110df);return _0x156d9a[_0xfeff('0x14')](_0xfeff('0x15'),_0x5bfa8c+'-'+_0x4ba232+'/'+_0x25a209)[_0xfeff('0x10')](_0x121e47);}return null;};}function saveUpdates(_0x4a6951){return function(_0x1a97e6){if(_0x1a97e6){return _0x1a97e6['update'](_0x4a6951)['then'](function(_0x427773){return _0x427773;});}return null;};}function removeEntity(_0x408cea){return function(_0x3624aa){if(_0x3624aa){return _0x3624aa[_0xfeff('0x16')]()['then'](function(){_0x408cea[_0xfeff('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168f6b){return function(_0x116782){if(!_0x116782){_0x168f6b[_0xfeff('0x17')](0x194);}return _0x116782;};}function handleError(_0x160382,_0x268aa1){_0x268aa1=_0x268aa1||0x1f4;return function(_0x476de9){logger[_0xfeff('0x18')](_0x476de9[_0xfeff('0x19')]);if(_0x476de9[_0xfeff('0x1a')]){delete _0x476de9[_0xfeff('0x1a')];}_0x160382[_0xfeff('0xf')](_0x268aa1)[_0xfeff('0x1b')](_0x476de9);};}exports[_0xfeff('0x1c')]=function(_0x355826,_0x2b2031){var _0x5a6c94={},_0x5c2396={},_0x41ac76={'count':0x0,'rows':[]};return db[_0xfeff('0x1d')][_0xfeff('0x1e')]()[_0xfeff('0x1f')](function(_0x4446b9){var _0x1ecf32=[];for(var _0x361b85=0x0;_0x361b85
','Attachments','Title','Data','auth=Bearer\x20','utf-8','toString','base64','lodash','path','util','email','head','value','address','generate','@xcally.com','name'];(function(_0x5e1ced,_0x1ca067){var _0x36ea9d=function(_0x57e1c7){while(--_0x57e1c7){_0x5e1ced['push'](_0x5e1ced['shift']());}};_0x36ea9d(++_0x1ca067);}(_0x9726,0x1a0));var _0x6972=function(_0x44a85f,_0x1ee66a){_0x44a85f=_0x44a85f-0x0;var _0xa4a6e8=_0x9726[_0x44a85f];return _0xa4a6e8;};'use strict';var _=require(_0x6972('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x6972('0x1'));var util=require(_0x6972('0x2'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x6972('0x3'));var config=require('../../../config/environment');function getAddress(_0x19fff0){var _0x29318a=_[_0x6972('0x4')](_0x19fff0[_0x6972('0x5')]);return _0x29318a&&_0x29318a[_0x6972('0x6')]?_0x29318a[_0x6972('0x6')]:'anonymous'+random[_0x6972('0x7')](0x6)+_0x6972('0x8');}function getFirstName(_0x5a83bf){var _0x208c2a=_[_0x6972('0x4')](_0x5a83bf[_0x6972('0x5')]);if(_0x208c2a&&_0x208c2a['name']){if(_0x208c2a[_0x6972('0x9')]==_0x208c2a['address']){return _0x208c2a[_0x6972('0x9')][_0x6972('0xa')](0x0,_0x208c2a[_0x6972('0x9')]['indexOf']('@'));}var _0x119c91=_0x208c2a[_0x6972('0x9')][_0x6972('0xb')](/\s+/);return _0x119c91[_0x6972('0xc')]>0x1?_0x119c91[_0x6972('0xd')](0x0,-0x1)[_0x6972('0xe')]('\x20'):_0x208c2a[_0x6972('0x9')];}return _0x6972('0xf');}function getLastName(_0x3882fd){var _0x333d4d=_[_0x6972('0x4')](_0x3882fd[_0x6972('0x5')]);if(_0x333d4d&&_0x333d4d[_0x6972('0x9')]){var _0x32cf51=_0x333d4d[_0x6972('0x9')][_0x6972('0xb')](/\s+/);return _0x32cf51[_0x6972('0xc')]>0x1?_0x32cf51[_0x6972('0x10')]():'';}return'';}function getMails(_0x3e154a,_0x5e41e8){var _0x83cd3e='';for(var _0x38ea03=0x0;_0x38ea03<_0x5e41e8[_0x6972('0x5')]['length'];_0x38ea03+=0x1){if(_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x6')]!==_0x3e154a){if(!_['isEmpty'](_0x83cd3e)){_0x83cd3e+=',';}_0x83cd3e+=_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x9')]||_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x6')]||'';_0x83cd3e+='\x20<';_0x83cd3e+=_0x5e41e8[_0x6972('0x5')][_0x38ea03][_0x6972('0x6')]?_0x5e41e8[_0x6972('0x5')][_0x38ea03]['address']:_0x6972('0x11')+random[_0x6972('0x7')](0x6)+_0x6972('0x8');_0x83cd3e+='>';}}return _0x83cd3e;}function parseEmail(_0x369a15,_0x3abb6d,_0x1905a5){if(_0x3abb6d[_0x6972('0x12')]){var _0x5a0af3=/