From: support
Date: Tue, 27 Dec 2022 14:07:27 +0000 (+0000)
Subject: Built motion from commit 44b1f254.|2.6.26
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=9f23224471ca9250625aa7d60802d5afd88a7b67;p=motion2.git
Built motion from commit 44b1f254.|2.6.26
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index b3a0837..17b1628 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-12-27T13:41:03.147Z",
+ "time": "2022-12-27T13:58:36.124Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 63d0801..be2c67e 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-27T13:41:03.147Z",
+ "time": "2022-12-27T13:58:36.124Z",
"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 5821ae8..0298244 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 _0x8679=['VIRTUAL','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x8679,0x19e));var _0x9867=function(_0x272935,_0x51709e){_0x272935=_0x272935-0x0;var _0x45151d=_0x8679[_0x272935];return _0x45151d;};'use strict';var Sequelize=require(_0x9867('0x0'));module[_0x9867('0x1')]={'name':{'type':Sequelize[_0x9867('0x2')],'get':function(_0x41cbf0){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x9867('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9867('0x4'),_0x9867('0x5'),_0x9867('0x6'),'jscripty',_0x9867('0x7'),_0x9867('0x8'),_0x9867('0x9'),_0x9867('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x9867('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x9867('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x9867('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[_0x9867('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x9867('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x9867('0x3')],'comments':_0x9867('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x47d4=['motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','contactManager','integration'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x47d4,0xfe));var _0x447d=function(_0x384998,_0x5f4964){_0x384998=_0x384998-0x0;var _0x48d50b=_0x47d4[_0x384998];return _0x48d50b;};'use strict';var Sequelize=require('sequelize');module[_0x447d('0x0')]={'name':{'type':Sequelize[_0x447d('0x1')],'get':function(_0x1d7c6b){return this[_0x447d('0x2')](_0x447d('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x447d('0x4'),_0x447d('0x5'),_0x447d('0x6'),_0x447d('0x7'),_0x447d('0x8'),'browser',_0x447d('0x9'),_0x447d('0xa')]],'msg':_0x447d('0xb')}},'comment':_0x447d('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x447d('0xc')](0x1000),'comment':_0x447d('0xd')},'data3':{'type':Sequelize[_0x447d('0xc')](0x1000),'comment':_0x447d('0xe')},'data4':{'type':Sequelize[_0x447d('0xc')](0x1000),'comments':_0x447d('0xf')},'data5':{'type':Sequelize[_0x447d('0xc')](0x1000),'comments':_0x447d('0x10')},'data6':{'type':Sequelize[_0x447d('0xc')],'comments':_0x447d('0x11')},'data7':{'type':Sequelize[_0x447d('0x12')],'comments':_0x447d('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index b3f8e5b..ea19f1f 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 _0x7042=['lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','name','send','body','Action','params','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x28a31b,_0xddc270){var _0x4f9173=function(_0x5b9b92){while(--_0x5b9b92){_0x28a31b['push'](_0x28a31b['shift']());}};_0x4f9173(++_0xddc270);}(_0x7042,0xdd));var _0x2704=function(_0xdee814,_0x401c80){_0xdee814=_0xdee814-0x0;var _0x346394=_0x7042[_0xdee814];return _0x346394;};'use strict';var emlformat=require(_0x2704('0x0'));var rimraf=require(_0x2704('0x1'));var zipdir=require(_0x2704('0x2'));var jsonpatch=require(_0x2704('0x3'));var rp=require(_0x2704('0x4'));var moment=require(_0x2704('0x5'));var BPromise=require(_0x2704('0x6'));var Mustache=require(_0x2704('0x7'));var util=require(_0x2704('0x8'));var path=require(_0x2704('0x9'));var sox=require(_0x2704('0xa'));var csv=require(_0x2704('0xb'));var ejs=require(_0x2704('0xc'));var fs=require('fs');var fs_extra=require(_0x2704('0xd'));var _=require(_0x2704('0xe'));var squel=require(_0x2704('0xf'));var crypto=require(_0x2704('0x10'));var jsforce=require(_0x2704('0x11'));var deskjs=require(_0x2704('0x12'));var toCsv=require(_0x2704('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2704('0x13'));var authService=require(_0x2704('0x14'));var qs=require(_0x2704('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2704('0x16'));var logger=require('../../config/logger')(_0x2704('0x17'));var utils=require(_0x2704('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2704('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36dd84,_0x26a9d3){_0x26a9d3=_0x26a9d3||0xcc;return function(_0x32994e){if(_0x32994e){return _0x36dd84['sendStatus'](_0x26a9d3);}return _0x36dd84[_0x2704('0x1a')](_0x26a9d3)['end']();};}function respondWithResult(_0x19d70e,_0x2fe777){_0x2fe777=_0x2fe777||0xc8;return function(_0x3a151f){if(_0x3a151f){return _0x19d70e[_0x2704('0x1a')](_0x2fe777)[_0x2704('0x1b')](_0x3a151f);}};}function respondWithFilteredResult(_0x500608,_0x21d51c){return function(_0xadf24){if(_0xadf24){var _0x43871f=typeof _0x21d51c[_0x2704('0x1c')]==='undefined'&&typeof _0x21d51c[_0x2704('0x1d')]==='undefined';var _0x5c425a=_0xadf24[_0x2704('0x1e')];var _0x347c05=_0x43871f?0x0:_0x21d51c['offset'];var _0x3e0b2f=_0x43871f?_0xadf24[_0x2704('0x1e')]:_0x21d51c[_0x2704('0x1c')]+_0x21d51c['limit'];var _0x32fe21;if(_0x3e0b2f>=_0x5c425a){_0x3e0b2f=_0x5c425a;_0x32fe21=0xc8;}else{_0x32fe21=0xce;}_0x500608[_0x2704('0x1a')](_0x32fe21);return _0x500608[_0x2704('0x1f')]('Content-Range',_0x347c05+'-'+_0x3e0b2f+'/'+_0x5c425a)[_0x2704('0x1b')](_0xadf24);}return null;};}function patchUpdates(_0xc88163){return function(_0x3fa018){try{jsonpatch[_0x2704('0x20')](_0x3fa018,_0xc88163,!![]);}catch(_0x579686){return BPromise[_0x2704('0x21')](_0x579686);}return _0x3fa018[_0x2704('0x22')]();};}function saveUpdates(_0x202c24,_0x22343d){return function(_0x49f1ee){if(_0x49f1ee){return _0x49f1ee[_0x2704('0x23')](_0x202c24)[_0x2704('0x24')](function(_0x3a9789){return _0x3a9789;});}return null;};}function removeEntity(_0x4da1bb,_0x47a54f){return function(_0x4d89af){if(_0x4d89af){return _0x4d89af[_0x2704('0x25')]()[_0x2704('0x24')](function(){_0x4da1bb[_0x2704('0x1a')](0xcc)[_0x2704('0x26')]();});}};}function handleEntityNotFound(_0x4f4544,_0x4d96af){return function(_0x42b708){if(!_0x42b708){_0x4f4544[_0x2704('0x27')](0x194);}return _0x42b708;};}function handleError(_0x212ff1,_0x5b0e71){_0x5b0e71=_0x5b0e71||0x1f4;return function(_0x1c45f8){logger['error'](_0x1c45f8['stack']);if(_0x1c45f8[_0x2704('0x28')]){delete _0x1c45f8['name'];}_0x212ff1['status'](_0x5b0e71)[_0x2704('0x29')](_0x1c45f8);};}exports[_0x2704('0x23')]=function(_0xd93088,_0x161af3){if(_0xd93088[_0x2704('0x2a')]['id']){delete _0xd93088[_0x2704('0x2a')]['id'];}return db[_0x2704('0x2b')]['find']({'where':{'id':_0xd93088[_0x2704('0x2c')]['id']}})[_0x2704('0x24')](handleEntityNotFound(_0x161af3,null))['then'](saveUpdates(_0xd93088[_0x2704('0x2a')],null))[_0x2704('0x24')](respondWithResult(_0x161af3,null))['catch'](handleError(_0x161af3,null));};exports[_0x2704('0x25')]=function(_0x4e4a52,_0x25f8c1){return db[_0x2704('0x2b')][_0x2704('0x2d')]({'where':{'id':_0x4e4a52['params']['id']}})[_0x2704('0x24')](handleEntityNotFound(_0x25f8c1,null))[_0x2704('0x24')](removeEntity(_0x25f8c1,null))[_0x2704('0x2e')](handleError(_0x25f8c1,null));};
\ No newline at end of file
+var _0x55d9=['zip-dir','request-promise','moment','bluebird','path','sox','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','name','send','body','Action','find','catch','params','eml-format','rimraf'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x55d9,0x12b));var _0x955d=function(_0x31acc7,_0x168431){_0x31acc7=_0x31acc7-0x0;var _0x10d549=_0x55d9[_0x31acc7];return _0x10d549;};'use strict';var emlformat=require(_0x955d('0x0'));var rimraf=require(_0x955d('0x1'));var zipdir=require(_0x955d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x955d('0x3'));var moment=require(_0x955d('0x4'));var BPromise=require(_0x955d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x955d('0x6'));var sox=require(_0x955d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x955d('0x8'));var crypto=require('crypto');var jsforce=require(_0x955d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x955d('0xa'));var querystring=require(_0x955d('0xb'));var Papa=require(_0x955d('0xc'));var Redis=require('ioredis');var authService=require(_0x955d('0xd'));var qs=require(_0x955d('0xe'));var as=require(_0x955d('0xf'));var hardwareService=require(_0x955d('0x10'));var logger=require(_0x955d('0x11'))(_0x955d('0x12'));var utils=require('../../config/utils');var config=require(_0x955d('0x13'));var licenseUtil=require(_0x955d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37352d,_0x4e2817){_0x4e2817=_0x4e2817||0xcc;return function(_0x1fb4e6){if(_0x1fb4e6){return _0x37352d[_0x955d('0x15')](_0x4e2817);}return _0x37352d[_0x955d('0x16')](_0x4e2817)[_0x955d('0x17')]();};}function respondWithResult(_0x57cf5f,_0x361f39){_0x361f39=_0x361f39||0xc8;return function(_0x4e2873){if(_0x4e2873){return _0x57cf5f['status'](_0x361f39)[_0x955d('0x18')](_0x4e2873);}};}function respondWithFilteredResult(_0x39bd0a,_0x43a233){return function(_0x41edb0){if(_0x41edb0){var _0x1a3a41=typeof _0x43a233[_0x955d('0x19')]===_0x955d('0x1a')&&typeof _0x43a233[_0x955d('0x1b')]===_0x955d('0x1a');var _0x1ffffb=_0x41edb0[_0x955d('0x1c')];var _0x588e8d=_0x1a3a41?0x0:_0x43a233[_0x955d('0x19')];var _0x27f073=_0x1a3a41?_0x41edb0['count']:_0x43a233[_0x955d('0x19')]+_0x43a233['limit'];var _0x3732c4;if(_0x27f073>=_0x1ffffb){_0x27f073=_0x1ffffb;_0x3732c4=0xc8;}else{_0x3732c4=0xce;}_0x39bd0a[_0x955d('0x16')](_0x3732c4);return _0x39bd0a['set'](_0x955d('0x1d'),_0x588e8d+'-'+_0x27f073+'/'+_0x1ffffb)[_0x955d('0x18')](_0x41edb0);}return null;};}function patchUpdates(_0x50440d){return function(_0x18d43e){try{jsonpatch[_0x955d('0x1e')](_0x18d43e,_0x50440d,!![]);}catch(_0x69f8b4){return BPromise[_0x955d('0x1f')](_0x69f8b4);}return _0x18d43e[_0x955d('0x20')]();};}function saveUpdates(_0x3ea433,_0x221eb6){return function(_0x4c7618){if(_0x4c7618){return _0x4c7618[_0x955d('0x21')](_0x3ea433)['then'](function(_0x3f14bc){return _0x3f14bc;});}return null;};}function removeEntity(_0x2e1d21,_0x297068){return function(_0xacdf41){if(_0xacdf41){return _0xacdf41[_0x955d('0x22')]()[_0x955d('0x23')](function(){_0x2e1d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1e3e3,_0x4496b5){return function(_0x590a4d){if(!_0x590a4d){_0xc1e3e3[_0x955d('0x15')](0x194);}return _0x590a4d;};}function handleError(_0x512e02,_0x2d9746){_0x2d9746=_0x2d9746||0x1f4;return function(_0x1d607b){logger['error'](_0x1d607b['stack']);if(_0x1d607b[_0x955d('0x24')]){delete _0x1d607b[_0x955d('0x24')];}_0x512e02[_0x955d('0x16')](_0x2d9746)[_0x955d('0x25')](_0x1d607b);};}exports[_0x955d('0x21')]=function(_0x4e2446,_0x16168a){if(_0x4e2446['body']['id']){delete _0x4e2446[_0x955d('0x26')]['id'];}return db[_0x955d('0x27')][_0x955d('0x28')]({'where':{'id':_0x4e2446['params']['id']}})[_0x955d('0x23')](handleEntityNotFound(_0x16168a,null))[_0x955d('0x23')](saveUpdates(_0x4e2446[_0x955d('0x26')],null))[_0x955d('0x23')](respondWithResult(_0x16168a,null))[_0x955d('0x29')](handleError(_0x16168a,null));};exports['destroy']=function(_0x5ccd49,_0x4f94a0){return db[_0x955d('0x27')][_0x955d('0x28')]({'where':{'id':_0x5ccd49[_0x955d('0x2a')]['id']}})[_0x955d('0x23')](handleEntityNotFound(_0x4f94a0,null))[_0x955d('0x23')](removeEntity(_0x4f94a0,null))[_0x955d('0x29')](handleError(_0x4f94a0,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index f7dfa3f..7cc8422 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 _0x7590=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x15d2c4,_0x4c65b2){var _0x4c9641=function(_0x3f73f3){while(--_0x3f73f3){_0x15d2c4['push'](_0x15d2c4['shift']());}};_0x4c9641(++_0x4c65b2);}(_0x7590,0x1c6));var _0x0759=function(_0x1bbe1a,_0xf961fd){_0x1bbe1a=_0x1bbe1a-0x0;var _0x492f96=_0x7590[_0x1bbe1a];return _0x492f96;};'use strict';var _=require('lodash');var util=require(_0x0759('0x0'));var logger=require(_0x0759('0x1'))(_0x0759('0x2'));var moment=require(_0x0759('0x3'));var BPromise=require(_0x0759('0x4'));var rp=require(_0x0759('0x5'));var fs=require('fs');var path=require(_0x0759('0x6'));var rimraf=require('rimraf');var config=require(_0x0759('0x7'));var attributes=require('./action.attributes');module[_0x0759('0x8')]=function(_0x4dfe42,_0x234acf){return _0x4dfe42[_0x0759('0x9')](_0x0759('0xa'),attributes,{'tableName':_0x0759('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe33=['path','rimraf','./action.attributes','exports','define','Action','tools_actions','../../config/logger','moment','request-promise'];(function(_0x391af7,_0x4f4ce8){var _0x3ebba8=function(_0x37933d){while(--_0x37933d){_0x391af7['push'](_0x391af7['shift']());}};_0x3ebba8(++_0x4f4ce8);}(_0xbe33,0x183));var _0x3be3=function(_0x44ec14,_0x8a1bb6){_0x44ec14=_0x44ec14-0x0;var _0x2ffa38=_0xbe33[_0x44ec14];return _0x2ffa38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3be3('0x0'))('api');var moment=require(_0x3be3('0x1'));var BPromise=require('bluebird');var rp=require(_0x3be3('0x2'));var fs=require('fs');var path=require(_0x3be3('0x3'));var rimraf=require(_0x3be3('0x4'));var config=require('../../config/environment');var attributes=require(_0x3be3('0x5'));module[_0x3be3('0x6')]=function(_0x137169,_0x698c4c){return _0x137169[_0x3be3('0x7')](_0x3be3('0x8'),attributes,{'tableName':_0x3be3('0x9'),'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 9dd35e4..6d0449d 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 _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(_0x2c49b8,_0x3b9017){var _0x446126=function(_0x5cc1f9){while(--_0x5cc1f9){_0x2c49b8['push'](_0x2c49b8['shift']());}};_0x446126(++_0x3b9017);}(_0x326f,0xd1));var _0xf326=function(_0x35035f,_0xf847ed){_0x35035f=_0x35035f-0x0;var _0x2558b2=_0x326f[_0x35035f];return _0x2558b2;};'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
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x486c3b,_0x4aeb79){var _0x4ed294=function(_0xdc628c){while(--_0xdc628c){_0x486c3b['push'](_0x486c3b['shift']());}};_0x4ed294(++_0x4aeb79);}(_0xabce,0x103));var _0xeabc=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xabce[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ac71749..b93909e 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 _0xdc21=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xdc21,0x7a));var _0x1dc2=function(_0x5c2027,_0x74e81c){_0x5c2027=_0x5c2027-0x0;var _0xefc748=_0xdc21[_0x5c2027];return _0xefc748;};'use strict';var multer=require(_0x1dc2('0x0'));var util=require(_0x1dc2('0x1'));var path=require(_0x1dc2('0x2'));var timeout=require(_0x1dc2('0x3'));var express=require(_0x1dc2('0x4'));var router=express[_0x1dc2('0x5')]();var fs_extra=require(_0x1dc2('0x6'));var auth=require(_0x1dc2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1dc2('0x8'));var controller=require(_0x1dc2('0x9'));router[_0x1dc2('0xa')](_0x1dc2('0xb'),auth[_0x1dc2('0xc')](),controller[_0x1dc2('0xd')]);router[_0x1dc2('0xe')](_0x1dc2('0xb'),auth[_0x1dc2('0xc')](),controller[_0x1dc2('0xf')]);module[_0x1dc2('0x10')]=router;
\ No newline at end of file
+var _0xa113=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','update','/:id','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x11c894,_0x2b69de){var _0x24dc88=function(_0x3b8602){while(--_0x3b8602){_0x11c894['push'](_0x11c894['shift']());}};_0x24dc88(++_0x2b69de);}(_0xa113,0xfd));var _0x3a11=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0xa113[_0x39fd11];return _0x302799;};'use strict';var multer=require(_0x3a11('0x0'));var util=require(_0x3a11('0x1'));var path=require(_0x3a11('0x2'));var timeout=require(_0x3a11('0x3'));var express=require(_0x3a11('0x4'));var router=express[_0x3a11('0x5')]();var fs_extra=require(_0x3a11('0x6'));var auth=require(_0x3a11('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3a11('0x8'));var controller=require(_0x3a11('0x9'));router[_0x3a11('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3a11('0xb')]);router['delete'](_0x3a11('0xc'),auth[_0x3a11('0xd')](),controller[_0x3a11('0xe')]);module[_0x3a11('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index bb324b7..f488d33 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x345e68,_0x45757c){var _0xb0411a=function(_0x2bf0d7){while(--_0x2bf0d7){_0x345e68['push'](_0x345e68['shift']());}};_0xb0411a(++_0x45757c);}(_0x31f0,0xb7));var _0x031f=function(_0x2228dc,_0x4973aa){_0x2228dc=_0x2228dc-0x0;var _0x58c52a=_0x31f0[_0x2228dc];return _0x58c52a;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
+var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x565aa4,_0x1a5a32){var _0x4de3ea=function(_0x28dc46){while(--_0x28dc46){_0x565aa4['push'](_0x565aa4['shift']());}};_0x4de3ea(++_0x1a5a32);}(_0xeff8,0x186));var _0x8eff=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xeff8[_0x490be3];return _0x3f5140;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 55c78f9..4104ce7 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 _0x4546=['rows','catch','show','length','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','function','format','replace','groupBy','orderBy','DESC','field','joins','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','join','left_join','AnalyticMetric','metric','clone','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','select','COUNT(*)','QueryTypes','SELECT','runReport','UNIX_TIMESTAMP(%s)','alias','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','CustomReports','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x4546,0x10a));var _0x6454=function(_0x543590,_0x5577bb){_0x543590=_0x543590-0x0;var _0x4bae6b=_0x4546[_0x543590];return _0x4bae6b;};'use strict';var emlformat=require(_0x6454('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6454('0x1'));var jsonpatch=require(_0x6454('0x2'));var rp=require(_0x6454('0x3'));var moment=require('moment');var BPromise=require(_0x6454('0x4'));var Mustache=require(_0x6454('0x5'));var util=require(_0x6454('0x6'));var path=require(_0x6454('0x7'));var sox=require(_0x6454('0x8'));var csv=require(_0x6454('0x9'));var ejs=require(_0x6454('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6454('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6454('0xc'));var deskjs=require(_0x6454('0xd'));var toCsv=require(_0x6454('0x9'));var querystring=require('querystring');var Papa=require(_0x6454('0xe'));var Redis=require(_0x6454('0xf'));var authService=require(_0x6454('0x10'));var qs=require(_0x6454('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6454('0x12'));var logger=require(_0x6454('0x13'))(_0x6454('0x14'));var utils=require(_0x6454('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6454('0x16'));var db=require(_0x6454('0x17'))['db'];var dbH=require('../../mysqldb')[_0x6454('0x18')];function respondWithStatusCode(_0x6dea1b,_0x3909cf){_0x3909cf=_0x3909cf||0xcc;return function(_0x4d071d){if(_0x4d071d){return _0x6dea1b[_0x6454('0x19')](_0x3909cf);}return _0x6dea1b[_0x6454('0x1a')](_0x3909cf)[_0x6454('0x1b')]();};}function respondWithResult(_0x10518d,_0x5864ab){_0x5864ab=_0x5864ab||0xc8;return function(_0x3d63be){if(_0x3d63be){return _0x10518d[_0x6454('0x1a')](_0x5864ab)[_0x6454('0x1c')](_0x3d63be);}};}function respondWithFilteredResult(_0x53b1bb,_0x19c440){return function(_0x30f587){if(_0x30f587){var _0x122a53=typeof _0x19c440['offset']==='undefined'&&typeof _0x19c440['limit']===_0x6454('0x1d');var _0x56f82e=_0x30f587[_0x6454('0x1e')];var _0x29e1b2=_0x122a53?0x0:_0x19c440[_0x6454('0x1f')];var _0x396b18=_0x122a53?_0x30f587['count']:_0x19c440[_0x6454('0x1f')]+_0x19c440[_0x6454('0x20')];var _0x11fe9b;if(_0x396b18>=_0x56f82e){_0x396b18=_0x56f82e;_0x11fe9b=0xc8;}else{_0x11fe9b=0xce;}_0x53b1bb[_0x6454('0x1a')](_0x11fe9b);return _0x53b1bb[_0x6454('0x21')](_0x6454('0x22'),_0x29e1b2+'-'+_0x396b18+'/'+_0x56f82e)[_0x6454('0x1c')](_0x30f587);}return null;};}function patchUpdates(_0x58ce86){return function(_0x3e31f8){try{jsonpatch[_0x6454('0x23')](_0x3e31f8,_0x58ce86,!![]);}catch(_0x11d20c){return BPromise[_0x6454('0x24')](_0x11d20c);}return _0x3e31f8['save']();};}function saveUpdates(_0x4d12c1,_0x373a62){return function(_0x448937){if(_0x448937){return _0x448937[_0x6454('0x25')](_0x4d12c1)['then'](function(_0x18a493){return _0x18a493;});}return null;};}function removeEntity(_0x5bfaf8,_0x9396aa){return function(_0x29c251){if(_0x29c251){return _0x29c251[_0x6454('0x26')]()[_0x6454('0x27')](function(){var _0x2c3f93=_0x29c251[_0x6454('0x28')]({'plain':!![]});var _0x258f36=_0x6454('0x29');return db[_0x6454('0x2a')]['destroy']({'where':{'type':_0x258f36,'resourceId':_0x2c3f93['id']}})[_0x6454('0x27')](function(){return _0x29c251;});})[_0x6454('0x27')](function(){_0x5bfaf8[_0x6454('0x1a')](0xcc)[_0x6454('0x1b')]();});}};}function handleEntityNotFound(_0x254386,_0x51cc06){return function(_0x4bb049){if(!_0x4bb049){_0x254386[_0x6454('0x19')](0x194);}return _0x4bb049;};}function handleError(_0x10e785,_0x4404c8){_0x4404c8=_0x4404c8||0x1f4;return function(_0x4b7646){logger['error'](_0x4b7646[_0x6454('0x2b')]);if(_0x4b7646[_0x6454('0x2c')]){delete _0x4b7646['name'];}_0x10e785['status'](_0x4404c8)[_0x6454('0x2d')](_0x4b7646);};}exports[_0x6454('0x2e')]=function(_0x398a5e,_0x4ddc74){var _0x3bd610={},_0x5ad63e={},_0x22abb3={'count':0x0,'rows':[]};var _0x25c177=_[_0x6454('0x2f')](db[_0x6454('0x30')][_0x6454('0x31')],function(_0x18c127){return{'name':_0x18c127[_0x6454('0x32')],'type':_0x18c127[_0x6454('0x33')][_0x6454('0x34')]};});_0x5ad63e[_0x6454('0x35')]=_[_0x6454('0x2f')](_0x25c177,_0x6454('0x2c'));_0x5ad63e[_0x6454('0x36')]=_[_0x6454('0x37')](_0x398a5e['query']);_0x5ad63e['filters']=_[_0x6454('0x38')](_0x5ad63e['model'],_0x5ad63e['query']);_0x3bd610[_0x6454('0x39')]=_['intersection'](_0x5ad63e[_0x6454('0x35')],qs[_0x6454('0x3a')](_0x398a5e[_0x6454('0x36')][_0x6454('0x3a')]));_0x3bd610[_0x6454('0x39')]=_0x3bd610['attributes']['length']?_0x3bd610[_0x6454('0x39')]:_0x5ad63e[_0x6454('0x35')];if(!_0x398a5e[_0x6454('0x36')][_0x6454('0x3b')](_0x6454('0x3c'))){_0x3bd610[_0x6454('0x20')]=qs[_0x6454('0x20')](_0x398a5e[_0x6454('0x36')]['limit']);_0x3bd610[_0x6454('0x1f')]=qs[_0x6454('0x1f')](_0x398a5e['query'][_0x6454('0x1f')]);}_0x3bd610[_0x6454('0x3d')]=qs['sort'](_0x398a5e[_0x6454('0x36')]['sort']);_0x3bd610[_0x6454('0x3e')]=qs[_0x6454('0x3f')](_[_0x6454('0x40')](_0x398a5e[_0x6454('0x36')],_0x5ad63e[_0x6454('0x3f')]),_0x25c177);if(_0x398a5e[_0x6454('0x36')]['filter']){_0x3bd610[_0x6454('0x3e')]=_[_0x6454('0x41')](_0x3bd610[_0x6454('0x3e')],{'$or':_[_0x6454('0x2f')](_0x25c177,function(_0x2bfc9a){if(_0x2bfc9a[_0x6454('0x33')]!==_0x6454('0x42')){var _0x3ee83c={};_0x3ee83c[_0x2bfc9a[_0x6454('0x2c')]]={'$like':'%'+_0x398a5e[_0x6454('0x36')]['filter']+'%'};return _0x3ee83c;}})});}_0x3bd610=_[_0x6454('0x41')]({},_0x3bd610,_0x398a5e['options']);var _0x4b4626={'where':_0x3bd610['where']};return db[_0x6454('0x30')][_0x6454('0x1e')](_0x4b4626)[_0x6454('0x27')](function(_0x1726b1){_0x22abb3[_0x6454('0x1e')]=_0x1726b1;if(_0x398a5e['query'][_0x6454('0x43')]){_0x3bd610[_0x6454('0x44')]=[{'all':!![]}];}return db[_0x6454('0x30')][_0x6454('0x45')](_0x3bd610);})[_0x6454('0x27')](function(_0x2bf106){_0x22abb3[_0x6454('0x46')]=_0x2bf106;return _0x22abb3;})['then'](respondWithFilteredResult(_0x4ddc74,_0x3bd610))[_0x6454('0x47')](handleError(_0x4ddc74,null));};exports[_0x6454('0x48')]=function(_0x481e54,_0x41aad0){var _0x1d2757={'raw':![],'where':{'id':_0x481e54['params']['id']}},_0x4b70cc={};_0x4b70cc[_0x6454('0x35')]=_[_0x6454('0x37')](db[_0x6454('0x30')]['rawAttributes']);_0x4b70cc[_0x6454('0x36')]=_[_0x6454('0x37')](_0x481e54[_0x6454('0x36')]);_0x4b70cc[_0x6454('0x3f')]=_['intersection'](_0x4b70cc['model'],_0x4b70cc[_0x6454('0x36')]);_0x1d2757[_0x6454('0x39')]=_[_0x6454('0x38')](_0x4b70cc[_0x6454('0x35')],qs[_0x6454('0x3a')](_0x481e54['query'][_0x6454('0x3a')]));_0x1d2757[_0x6454('0x39')]=_0x1d2757[_0x6454('0x39')][_0x6454('0x49')]?_0x1d2757[_0x6454('0x39')]:_0x4b70cc[_0x6454('0x35')];if(_0x481e54['query'][_0x6454('0x43')]){_0x1d2757[_0x6454('0x44')]=[{'all':!![]}];}_0x1d2757=_[_0x6454('0x41')]({},_0x1d2757,_0x481e54['options']);return db[_0x6454('0x30')][_0x6454('0x4a')](_0x1d2757)[_0x6454('0x27')](handleEntityNotFound(_0x41aad0,null))[_0x6454('0x27')](respondWithResult(_0x41aad0,null))[_0x6454('0x47')](handleError(_0x41aad0,null));};exports[_0x6454('0x4b')]=function(_0x15da21,_0x304c50){return db[_0x6454('0x30')][_0x6454('0x4b')](_0x15da21[_0x6454('0x4c')],{})['then'](function(_0x3d471d){var _0x16224d=_0x15da21[_0x6454('0x4d')][_0x6454('0x28')]({'plain':!![]});if(!_0x16224d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16224d[_0x6454('0x4e')]===_0x6454('0x4d')){var _0x3ee75a=_0x3d471d[_0x6454('0x28')]({'plain':!![]});var _0x5d88e3=_0x6454('0x4f');return db[_0x6454('0x50')]['find']({'where':{'name':_0x5d88e3,'userProfileId':_0x16224d[_0x6454('0x51')]},'raw':!![]})[_0x6454('0x27')](function(_0x5f1021){if(_0x5f1021&&_0x5f1021[_0x6454('0x52')]===0x0){return db[_0x6454('0x2a')][_0x6454('0x4b')]({'name':_0x3ee75a[_0x6454('0x2c')],'resourceId':_0x3ee75a['id'],'type':_0x6454('0x29'),'sectionId':_0x5f1021['id']},{})['then'](function(){return _0x3d471d;});}else{return _0x3d471d;}})['catch'](function(_0x58162b){logger[_0x6454('0x53')](_0x6454('0x54'),_0x58162b);throw _0x58162b;});}return _0x3d471d;})[_0x6454('0x27')](respondWithResult(_0x304c50,0xc9))['catch'](handleError(_0x304c50,null));};exports[_0x6454('0x25')]=function(_0x4fcc3e,_0x57ac51){if(_0x4fcc3e[_0x6454('0x4c')]['id']){delete _0x4fcc3e[_0x6454('0x4c')]['id'];}return db[_0x6454('0x30')][_0x6454('0x4a')]({'where':{'id':_0x4fcc3e[_0x6454('0x55')]['id']}})[_0x6454('0x27')](handleEntityNotFound(_0x57ac51,null))['then'](saveUpdates(_0x4fcc3e['body'],null))[_0x6454('0x27')](respondWithResult(_0x57ac51,null))[_0x6454('0x47')](handleError(_0x57ac51,null));};exports['destroy']=function(_0x1f5cf2,_0x3dfb2b){return db[_0x6454('0x30')]['find']({'where':{'id':_0x1f5cf2[_0x6454('0x55')]['id']}})['then'](handleEntityNotFound(_0x3dfb2b,null))[_0x6454('0x27')](removeEntity(_0x3dfb2b,null))[_0x6454('0x47')](handleError(_0x3dfb2b,null));};exports['preview']=function(_0x250802,_0x2c02eb){var _0x3555dd=0xa;var _0x3815ea=['join','left_join',_0x6454('0x56'),_0x6454('0x57')];var _0x589192={'SUM':_0x6454('0x58'),'COUNT':_0x6454('0x59'),'COUNT DISTINCT':_0x6454('0x5a'),'MAX':_0x6454('0x5b'),'MIN':_0x6454('0x5c'),'AVG':_0x6454('0x5d'),'GROUP_CONCAT':_0x6454('0x5e'),'GROUP_CONCAT ASC':_0x6454('0x5f'),'GROUP_CONCAT DESC':_0x6454('0x60')};var _0x54f951={'SEC_TO_TIME':_0x6454('0x61'),'DATE':_0x6454('0x62'),'HOUR':_0x6454('0x63'),'ROUND':_0x6454('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1aa911=function(_0x40e5bb){return!_['includes']([_0x6454('0x65'),_0x6454('0x66'),_0x6454('0x67'),_0x6454('0x68')],_0x40e5bb);};var _0xcc2877=function(_0x106846){if(!_0x106846||!_0x106846[_0x6454('0x69')]['length']){return'';}for(var _0x2156b1='(',_0x9058d4=0x0;_0x9058d4<_0x106846['rules'][_0x6454('0x49')];_0x9058d4+=0x1){_0x9058d4>0x0&&(_0x2156b1+='\x20'+_0x106846[_0x6454('0x6a')]+'\x20');_0x2156b1+=_0x106846[_0x6454('0x69')][_0x9058d4][_0x6454('0x6b')]?_0xcc2877(_0x106846[_0x6454('0x69')][_0x9058d4][_0x6454('0x6b')]):_0x106846[_0x6454('0x69')][_0x9058d4]['field']+'\x20'+_0x106846['rules'][_0x9058d4][_0x6454('0x6c')]+(_0x1aa911(_0x106846[_0x6454('0x69')][_0x9058d4][_0x6454('0x6c')])?'\x20'+_0x106846['rules'][_0x9058d4][_0x6454('0x6d')]:'');}return _0x2156b1+')';};var _0x5ddf91={'where':{'id':_0x250802[_0x6454('0x55')]['id']}},_0x5519f1,_0xe8a89f,_0x345376,_0x743c71,_0x79fda5;_0x5ddf91=_[_0x6454('0x41')]({},_0x5ddf91,_0x250802[_0x6454('0x6e')]);return db[_0x6454('0x30')][_0x6454('0x4a')](_0x5ddf91)[_0x6454('0x27')](function(_0x15ee8f){if(_0x15ee8f){_0x5519f1=_0x15ee8f;return _0x15ee8f[_0x6454('0x6f')]();}return null;})['then'](function(_0x18448f){if(_0x18448f){if(!_0x18448f[_0x6454('0x49')]){throw new db[(_0x6454('0x70'))][(_0x6454('0x71'))](_0x6454('0x72'),0x193);}_0xe8a89f=_0x18448f;return db['AnalyticMetric'][_0x6454('0x45')]({'raw':!![]});}return null;})['then'](function(_0x181208){if(_0x181208){_0x345376=_[_0x6454('0x73')](_0x181208,'id');var _0x36680c;var _0x209445=squel['select']();_0x209445[_0x6454('0x74')](_0x5519f1[_0x6454('0x75')]);for(var _0x24c6fc=0x0;_0x24c6fc<_0xe8a89f['length'];_0x24c6fc+=0x1){_0x36680c=_0xe8a89f[_0x24c6fc]['MetricId']?_0x345376[_0xe8a89f[_0x24c6fc][_0x6454('0x76')]]['metric']:_0xe8a89f[_0x24c6fc]['field'];_0x36680c=_0xe8a89f[_0x24c6fc][_0x6454('0x77')]?_['replace'](_0x589192[_0xe8a89f[_0x24c6fc]['function']],'%s',_0x36680c):_0x36680c;_0x36680c=_0xe8a89f[_0x24c6fc][_0x6454('0x78')]?_[_0x6454('0x79')](_0x54f951[_0xe8a89f[_0x24c6fc][_0x6454('0x78')]],'%s',_0x36680c):_0x36680c;if(_0xe8a89f[_0x24c6fc][_0x6454('0x7a')]){_0x209445[_0x6454('0x6b')](_0x36680c);}_0xe8a89f[_0x24c6fc][_0x6454('0x7b')]&&_0x209445[_0x6454('0x3d')](_0x36680c,_0xe8a89f[_0x24c6fc][_0x6454('0x7b')]===_0x6454('0x7c')?![]:!![]);_0x209445[_0x6454('0x7d')](_0x36680c,_0xe8a89f[_0x24c6fc]['alias']||_0x36680c);}if(_0x5519f1['joins']){_0x5519f1[_0x6454('0x7e')]=JSON['parse'](_0x5519f1[_0x6454('0x7e')]);for(var _0x880110=0x0;_0x880110<_0x5519f1[_0x6454('0x7e')][_0x6454('0x49')];_0x880110+=0x1){if(_0x5519f1['joins'][_0x880110][_0x6454('0x33')]&&_[_0x6454('0x7f')](_0x3815ea,_0x5519f1[_0x6454('0x7e')][_0x880110]['type'])&&_0x5519f1['joins'][_0x880110]['parentKey']&&_0x5519f1['joins'][_0x880110][_0x6454('0x80')]&&_0x5519f1['joins'][_0x880110][_0x6454('0x81')]){_0x209445[_0x5519f1['joins'][_0x880110]['type']](_0x5519f1['joins'][_0x880110][_0x6454('0x80')],null,util[_0x6454('0x78')](_0x6454('0x82'),_0x5519f1[_0x6454('0x75')],_0x5519f1[_0x6454('0x7e')][_0x880110][_0x6454('0x83')],_0x5519f1[_0x6454('0x7e')][_0x880110][_0x6454('0x80')],_0x5519f1[_0x6454('0x7e')][_0x880110]['foreignKey']));}}}if(_0x5519f1[_0x6454('0x84')]){_0x5519f1[_0x6454('0x84')]=JSON[_0x6454('0x85')](_0x5519f1[_0x6454('0x84')]);_0x209445[_0x6454('0x3e')](_0xcc2877(_0x5519f1['conditions'][_0x6454('0x6b')]));}_0x79fda5=_0x209445['clone']();_0x209445[_0x6454('0x20')](_0x3555dd);_0x209445[_0x6454('0x1f')](0x0);logger[_0x6454('0x86')](_0x6454('0x87'),_0x209445[_0x6454('0x88')]());return dbH[_0x6454('0x89')][_0x6454('0x36')](_0x209445[_0x6454('0x88')](),{'type':dbH[_0x6454('0x89')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x2c02eb,null))[_0x6454('0x47')](handleError(_0x2c02eb,null));};function runReport(_0x2495b3,_0x469033,_0x990271){var _0x4b9341=_0x469033[_0x6454('0x2c')];var _0x47ce28=0xa;var _0x711b23=[_0x6454('0x8a'),_0x6454('0x8b'),'right_join','cross_join'];var _0x57fc1f={'SUM':_0x6454('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6454('0x5a'),'MAX':'MAX(%s)','MIN':_0x6454('0x5c'),'AVG':_0x6454('0x5d'),'GROUP_CONCAT':_0x6454('0x5e'),'GROUP_CONCAT ASC':_0x6454('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5742ac={'SEC_TO_TIME':_0x6454('0x61'),'DATE':_0x6454('0x62'),'HOUR':_0x6454('0x63'),'ROUND':_0x6454('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1591ef=function(_0x21d0f7){return!_[_0x6454('0x7f')]([_0x6454('0x65'),_0x6454('0x66'),'IS\x20EMPTY',_0x6454('0x68')],_0x21d0f7);};var _0x5a551b=function(_0x2156fa){if(!_0x2156fa||!_0x2156fa[_0x6454('0x69')][_0x6454('0x49')]){return'';}for(var _0x325047='(',_0x3ce406=0x0;_0x3ce406<_0x2156fa['rules'][_0x6454('0x49')];_0x3ce406+=0x1){_0x3ce406>0x0&&(_0x325047+='\x20'+_0x2156fa['operator']+'\x20');_0x325047+=_0x2156fa[_0x6454('0x69')][_0x3ce406]['group']?_0x5a551b(_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x6b')]):_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x7d')]+'\x20'+_0x2156fa[_0x6454('0x69')][_0x3ce406]['condition']+(_0x1591ef(_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x6c')])?'\x20'+_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x6d')]:'');}return _0x325047+')';};var _0x4b59={'where':{'id':_0x2495b3['id']}},_0x2aea6a,_0x4a8ec0,_0x26ffc8,_0x537beb,_0x55158a;_0x4b59=_[_0x6454('0x41')]({},_0x4b59,_0x990271);return db[_0x6454('0x30')][_0x6454('0x4a')](_0x4b59)['then'](function(_0x25d5df){if(_0x25d5df){_0x2aea6a=_0x25d5df;return _0x25d5df[_0x6454('0x6f')]();}return null;})[_0x6454('0x27')](function(_0x30ce7e){if(_0x30ce7e){if(!_0x30ce7e[_0x6454('0x49')]){throw new db['Sequelize'][(_0x6454('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4a8ec0=_0x30ce7e;return db[_0x6454('0x8c')][_0x6454('0x45')]({'raw':!![]});}return null;})[_0x6454('0x27')](function(_0x4450ef){if(_0x4450ef){_0x26ffc8=_[_0x6454('0x73')](_0x4450ef,'id');var _0x9d2a5e;var _0x2d5760=squel['select']();_0x2d5760['from'](_0x2aea6a[_0x6454('0x75')]);for(var _0x246cf1=0x0;_0x246cf1<_0x4a8ec0[_0x6454('0x49')];_0x246cf1+=0x1){_0x9d2a5e=_0x4a8ec0[_0x246cf1]['MetricId']?_0x26ffc8[_0x4a8ec0[_0x246cf1][_0x6454('0x76')]][_0x6454('0x8d')]:_0x4a8ec0[_0x246cf1]['field'];_0x9d2a5e=_0x4a8ec0[_0x246cf1]['function']?_['replace'](_0x57fc1f[_0x4a8ec0[_0x246cf1][_0x6454('0x77')]],'%s',_0x9d2a5e):_0x9d2a5e;_0x9d2a5e=_0x4a8ec0[_0x246cf1][_0x6454('0x78')]?_[_0x6454('0x79')](_0x5742ac[_0x4a8ec0[_0x246cf1]['format']],'%s',_0x9d2a5e):_0x9d2a5e;if(_0x4a8ec0[_0x246cf1]['groupBy']){_0x2d5760[_0x6454('0x6b')](_0x9d2a5e);}_0x4a8ec0[_0x246cf1][_0x6454('0x7b')]&&_0x2d5760[_0x6454('0x3d')](_0x9d2a5e,_0x4a8ec0[_0x246cf1][_0x6454('0x7b')]===_0x6454('0x7c')?![]:!![]);_0x2d5760[_0x6454('0x7d')](_0x9d2a5e,_0x4a8ec0[_0x246cf1]['alias']||_0x9d2a5e);}if(_0x2aea6a[_0x6454('0x7e')]){_0x2aea6a['joins']=JSON[_0x6454('0x85')](_0x2aea6a[_0x6454('0x7e')]);for(var _0x47a568=0x0;_0x47a568<_0x2aea6a[_0x6454('0x7e')][_0x6454('0x49')];_0x47a568+=0x1){if(_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x33')]&&_['includes'](_0x711b23,_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x33')])&&_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x83')]&&_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x80')]&&_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x81')]){_0x2d5760[_0x2aea6a[_0x6454('0x7e')][_0x47a568]['type']](_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x80')],null,util[_0x6454('0x78')](_0x6454('0x82'),_0x2aea6a[_0x6454('0x75')],_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x83')],_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x80')],_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x81')]));}}}if(_0x2aea6a[_0x6454('0x84')]){_0x2aea6a[_0x6454('0x84')]=JSON[_0x6454('0x85')](_0x2aea6a[_0x6454('0x84')]);_0x2d5760['where'](_0x5a551b(_0x2aea6a[_0x6454('0x84')][_0x6454('0x6b')]));}_0x55158a=_0x2d5760[_0x6454('0x8e')]();_0x2d5760[_0x6454('0x20')](_0x47ce28);_0x2d5760[_0x6454('0x1f')](0x0);return;}})[_0x6454('0x27')](function(){if(_0x469033[_0x6454('0x8f')]===_0x6454('0x90')){return null;}var _0x56d925=_[_0x6454('0x41')](_0x469033,{'name':_0x469033[_0x6454('0x91')]||_0x469033[_0x6454('0x2c')]||_0x2aea6a[_0x6454('0x2c')],'basename':_0x4b9341,'savename':util[_0x6454('0x78')]('%s-%s.%s',_0x469033['name']||_0x2aea6a[_0x6454('0x2c')],require(_0x6454('0x92'))[_0x6454('0x93')](0x4),_0x469033[_0x6454('0x8f')]||_0x6454('0x94')),'reportId':_0x2aea6a['id'],'reportType':_0x6454('0x95')});return db[_0x6454('0x96')][_0x6454('0x4b')](_0x56d925,{'raw':!![]});})[_0x6454('0x27')](function(_0x3da583){if(_0x2aea6a[_0x6454('0x75')]===_0x6454('0x97')){_0x55158a[_0x6454('0x3e')](_0x2aea6a[_0x6454('0x75')]+_0x6454('0x98'),_0x469033[_0x6454('0x99')],_0x469033['endDate']);}else{_0x55158a['where'](_0x2aea6a[_0x6454('0x75')]+_0x6454('0x9a'),_0x469033[_0x6454('0x99')],_0x469033[_0x6454('0x9b')]);}if(_0x3da583){logger[_0x6454('0x9c')](_0x6454('0x9d'),_0x55158a[_0x6454('0x88')]());require(_0x6454('0x9e'))['fork'](path[_0x6454('0x8a')](__dirname,_0x6454('0x9f'),_0x3da583['output']),[_0x3da583['id'],_0x55158a[_0x6454('0x88')](),path[_0x6454('0x8a')](__dirname,_0x6454('0xa0'),_0x3da583['savename']),_0x4b9341]);return _0x3da583;}else{var _0x1b7d9b=squel[_0x6454('0xa1')]();_0x1b7d9b[_0x6454('0x74')]('('+_0x55158a['toString']()+')','countTable');_0x1b7d9b[_0x6454('0x7d')](_0x6454('0xa2'),_0x6454('0x1e'));_0x55158a[_0x6454('0x20')](_0x469033[_0x6454('0x20')]||_0x47ce28);_0x55158a[_0x6454('0x1f')](_0x469033['offset']||0x0);return dbH[_0x6454('0x89')]['query'](_0x1b7d9b[_0x6454('0x88')](),{'type':dbH[_0x6454('0x89')][_0x6454('0xa3')]['SELECT']})[_0x6454('0x27')](function(_0x165919){if(!_0x165919[_0x6454('0x49')]){_0x537beb=0x0;}else{_0x537beb=_0x165919[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x55158a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x6454('0xa4')]});})['then'](function(_0x46c318){return{'rows':_0x46c318||[],'count':_0x537beb};});}});}exports['run']=function(_0x8a3e23,_0x568b57){return runReport(_0x8a3e23[_0x6454('0x55')],_0x8a3e23[_0x6454('0x36')],_0x8a3e23[_0x6454('0x6e')])[_0x6454('0x27')](respondWithResult(_0x568b57,null))[_0x6454('0x47')](handleError(_0x568b57,null));};exports[_0x6454('0xa5')]=runReport;exports['query']=function(_0x426d65,_0x42fa20){var _0x5087c3=0xa;var _0x8948b8=[_0x6454('0x8a'),_0x6454('0x8b'),_0x6454('0x56'),_0x6454('0x57')];var _0x1d180e={'SUM':'SUM(%s)','COUNT':_0x6454('0x59'),'COUNT DISTINCT':_0x6454('0x5a'),'MAX':_0x6454('0x5b'),'MIN':_0x6454('0x5c'),'AVG':_0x6454('0x5d'),'GROUP_CONCAT':_0x6454('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6454('0x60')};var _0x47cb53={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6454('0x62'),'HOUR':_0x6454('0x63'),'ROUND':_0x6454('0x64'),'UNIX_TIMESTAMP':_0x6454('0xa6')};var _0x5d8c61=function(_0x4a4db6){return!_['includes'](['IS\x20NULL',_0x6454('0x66'),_0x6454('0x67'),_0x6454('0x68')],_0x4a4db6);};var _0x103e31=function(_0x4d26ec){if(!_0x4d26ec||!_0x4d26ec['rules'][_0x6454('0x49')]){return'';}for(var _0x187a5c='(',_0x970c99=0x0;_0x970c99<_0x4d26ec[_0x6454('0x69')]['length'];_0x970c99+=0x1){_0x970c99>0x0&&(_0x187a5c+='\x20'+_0x4d26ec['operator']+'\x20');_0x187a5c+=_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6b')]?_0x103e31(_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6b')]):_0x4d26ec[_0x6454('0x69')][_0x970c99]['field']+'\x20'+_0x4d26ec[_0x6454('0x69')][_0x970c99]['condition']+(_0x5d8c61(_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6c')])?'\x20'+_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6d')]:'');}return _0x187a5c+')';};var _0x29472b={'where':{'id':_0x426d65[_0x6454('0x55')]['id']}},_0x364749,_0x24bd06,_0x2919a4,_0x4664f1,_0x4aefd3;_0x29472b=_[_0x6454('0x41')]({},_0x29472b,_0x426d65[_0x6454('0x6e')]);return db[_0x6454('0x30')]['find'](_0x29472b)[_0x6454('0x27')](function(_0x15a988){if(_0x15a988){_0x364749=_0x15a988;return _0x15a988['getFields']();}return null;})[_0x6454('0x27')](function(_0x345d7c){if(_0x345d7c){if(!_0x345d7c[_0x6454('0x49')]){throw new db[(_0x6454('0x70'))]['ValidationErrorItem'](_0x6454('0x72'),0x193);}_0x24bd06=_0x345d7c;return db['AnalyticMetric'][_0x6454('0x45')]({'raw':!![]});}return null;})[_0x6454('0x27')](function(_0x170cd5){if(_0x170cd5){_0x2919a4=_['keyBy'](_0x170cd5,'id');var _0x1be96b;var _0x33fb42=squel[_0x6454('0xa1')]();_0x33fb42[_0x6454('0x74')](_0x364749[_0x6454('0x75')]);for(var _0x1e303b=0x0;_0x1e303b<_0x24bd06[_0x6454('0x49')];_0x1e303b+=0x1){_0x1be96b=_0x24bd06[_0x1e303b][_0x6454('0x76')]?_0x2919a4[_0x24bd06[_0x1e303b][_0x6454('0x76')]][_0x6454('0x8d')]:_0x24bd06[_0x1e303b][_0x6454('0x7d')];_0x1be96b=_0x24bd06[_0x1e303b][_0x6454('0x77')]?_[_0x6454('0x79')](_0x1d180e[_0x24bd06[_0x1e303b]['function']],'%s',_0x1be96b):_0x1be96b;_0x1be96b=_0x24bd06[_0x1e303b][_0x6454('0x78')]?_[_0x6454('0x79')](_0x47cb53[_0x24bd06[_0x1e303b][_0x6454('0x78')]],'%s',_0x1be96b):_0x1be96b;if(_0x24bd06[_0x1e303b][_0x6454('0x7a')]){_0x33fb42[_0x6454('0x6b')](_0x1be96b);}_0x24bd06[_0x1e303b][_0x6454('0x7b')]&&_0x33fb42['order'](_0x1be96b,_0x24bd06[_0x1e303b]['orderBy']===_0x6454('0x7c')?![]:!![]);_0x33fb42[_0x6454('0x7d')](_0x1be96b,_0x24bd06[_0x1e303b][_0x6454('0xa7')]||_0x1be96b);}if(_0x364749[_0x6454('0x7e')]){_0x364749[_0x6454('0x7e')]=JSON[_0x6454('0x85')](_0x364749[_0x6454('0x7e')]);for(var _0x52779e=0x0;_0x52779e<_0x364749[_0x6454('0x7e')][_0x6454('0x49')];_0x52779e+=0x1){if(_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x33')]&&_[_0x6454('0x7f')](_0x8948b8,_0x364749[_0x6454('0x7e')][_0x52779e]['type'])&&_0x364749[_0x6454('0x7e')][_0x52779e]['parentKey']&&_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x80')]&&_0x364749[_0x6454('0x7e')][_0x52779e]['foreignKey']){_0x33fb42[_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x33')]](_0x364749['joins'][_0x52779e][_0x6454('0x80')],null,util[_0x6454('0x78')](_0x6454('0x82'),_0x364749[_0x6454('0x75')],_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x83')],_0x364749[_0x6454('0x7e')][_0x52779e]['foreignTable'],_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x81')]));}}}if(_0x364749[_0x6454('0x84')]){_0x364749[_0x6454('0x84')]=JSON[_0x6454('0x85')](_0x364749[_0x6454('0x84')]);_0x33fb42[_0x6454('0x3e')](_0x103e31(_0x364749[_0x6454('0x84')][_0x6454('0x6b')]));}_0x4aefd3=_0x33fb42['clone']();_0x33fb42[_0x6454('0x20')](_0x5087c3);_0x33fb42[_0x6454('0x1f')](0x0);logger['debug'](_0x6454('0x87'),_0x33fb42[_0x6454('0x88')]());return dbH[_0x6454('0x89')][_0x6454('0x36')](_0x33fb42[_0x6454('0x88')](),{'type':dbH[_0x6454('0x89')][_0x6454('0xa3')][_0x6454('0xa4')]});}})[_0x6454('0x27')](function(){return{'sql':_0x4aefd3[_0x6454('0x88')]()};})[_0x6454('0x27')](respondWithResult(_0x42fa20,null))['catch'](handleError(_0x42fa20,null));};
\ No newline at end of file
+var _0x98ee=['mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','include','params','keys','fields','length','includeAll','merge','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','table','MetricId','function','replace','format','groupBy','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','join','COUNT(%s)','IS\x20NOT\x20EMPTY','getFields','metric','orderBy','alias','clone','output','web','fullPath','%s-%s.%s','generate','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','select','countTable','COUNT(*)','QueryTypes','SELECT','run','runReport','SUM(%s)','DATE(%s)','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3472c6,_0x24af4c){var _0x5b85e8=function(_0x43eb06){while(--_0x43eb06){_0x3472c6['push'](_0x3472c6['shift']());}};_0x5b85e8(++_0x24af4c);}(_0x98ee,0x131));var _0xe98e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x98ee[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xe98e('0x0'));var rimraf=require(_0xe98e('0x1'));var zipdir=require(_0xe98e('0x2'));var jsonpatch=require(_0xe98e('0x3'));var rp=require(_0xe98e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe98e('0x5'));var util=require(_0xe98e('0x6'));var path=require(_0xe98e('0x7'));var sox=require(_0xe98e('0x8'));var csv=require(_0xe98e('0x9'));var ejs=require(_0xe98e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe98e('0xb'));var squel=require('squel');var crypto=require(_0xe98e('0xc'));var jsforce=require(_0xe98e('0xd'));var deskjs=require(_0xe98e('0xe'));var toCsv=require(_0xe98e('0x9'));var querystring=require('querystring');var Papa=require(_0xe98e('0xf'));var Redis=require('ioredis');var authService=require(_0xe98e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe98e('0x11'));var hardwareService=require(_0xe98e('0x12'));var logger=require(_0xe98e('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe98e('0x14'));var db=require(_0xe98e('0x15'))['db'];var dbH=require('../../mysqldb')[_0xe98e('0x16')];function respondWithStatusCode(_0x26553d,_0x3c9d12){_0x3c9d12=_0x3c9d12||0xcc;return function(_0x2c8521){if(_0x2c8521){return _0x26553d[_0xe98e('0x17')](_0x3c9d12);}return _0x26553d[_0xe98e('0x18')](_0x3c9d12)[_0xe98e('0x19')]();};}function respondWithResult(_0x44f80e,_0x4d6e5c){_0x4d6e5c=_0x4d6e5c||0xc8;return function(_0x429f24){if(_0x429f24){return _0x44f80e['status'](_0x4d6e5c)[_0xe98e('0x1a')](_0x429f24);}};}function respondWithFilteredResult(_0x3735b1,_0x1549a1){return function(_0x2afe98){if(_0x2afe98){var _0x5b7c7b=typeof _0x1549a1[_0xe98e('0x1b')]===_0xe98e('0x1c')&&typeof _0x1549a1[_0xe98e('0x1d')]===_0xe98e('0x1c');var _0x1eacdb=_0x2afe98['count'];var _0x27fe66=_0x5b7c7b?0x0:_0x1549a1[_0xe98e('0x1b')];var _0x213bbe=_0x5b7c7b?_0x2afe98[_0xe98e('0x1e')]:_0x1549a1[_0xe98e('0x1b')]+_0x1549a1['limit'];var _0x5afe6d;if(_0x213bbe>=_0x1eacdb){_0x213bbe=_0x1eacdb;_0x5afe6d=0xc8;}else{_0x5afe6d=0xce;}_0x3735b1[_0xe98e('0x18')](_0x5afe6d);return _0x3735b1['set']('Content-Range',_0x27fe66+'-'+_0x213bbe+'/'+_0x1eacdb)['json'](_0x2afe98);}return null;};}function patchUpdates(_0x3057d6){return function(_0x12398a){try{jsonpatch['apply'](_0x12398a,_0x3057d6,!![]);}catch(_0x12b1b3){return BPromise[_0xe98e('0x1f')](_0x12b1b3);}return _0x12398a[_0xe98e('0x20')]();};}function saveUpdates(_0x389812,_0x2823e3){return function(_0x1f051e){if(_0x1f051e){return _0x1f051e[_0xe98e('0x21')](_0x389812)[_0xe98e('0x22')](function(_0x519162){return _0x519162;});}return null;};}function removeEntity(_0xd33468,_0x995f8c){return function(_0x35b6cf){if(_0x35b6cf){return _0x35b6cf[_0xe98e('0x23')]()['then'](function(){var _0x22fad5=_0x35b6cf[_0xe98e('0x24')]({'plain':!![]});var _0x3ad40b=_0xe98e('0x25');return db[_0xe98e('0x26')]['destroy']({'where':{'type':_0x3ad40b,'resourceId':_0x22fad5['id']}})[_0xe98e('0x22')](function(){return _0x35b6cf;});})['then'](function(){_0xd33468[_0xe98e('0x18')](0xcc)[_0xe98e('0x19')]();});}};}function handleEntityNotFound(_0x25d04d,_0x5c1e66){return function(_0x5bd850){if(!_0x5bd850){_0x25d04d[_0xe98e('0x17')](0x194);}return _0x5bd850;};}function handleError(_0x566858,_0x57438c){_0x57438c=_0x57438c||0x1f4;return function(_0xd3b22e){logger[_0xe98e('0x27')](_0xd3b22e[_0xe98e('0x28')]);if(_0xd3b22e['name']){delete _0xd3b22e[_0xe98e('0x29')];}_0x566858[_0xe98e('0x18')](_0x57438c)[_0xe98e('0x2a')](_0xd3b22e);};}exports[_0xe98e('0x2b')]=function(_0xe380d9,_0x513e16){var _0x26590c={},_0x248de1={},_0x288452={'count':0x0,'rows':[]};var _0x4a8143=_[_0xe98e('0x2c')](db[_0xe98e('0x2d')]['rawAttributes'],function(_0x3645a5){return{'name':_0x3645a5['fieldName'],'type':_0x3645a5['type']['key']};});_0x248de1[_0xe98e('0x2e')]=_[_0xe98e('0x2c')](_0x4a8143,_0xe98e('0x29'));_0x248de1[_0xe98e('0x2f')]=_['keys'](_0xe380d9[_0xe98e('0x2f')]);_0x248de1[_0xe98e('0x30')]=_['intersection'](_0x248de1['model'],_0x248de1[_0xe98e('0x2f')]);_0x26590c[_0xe98e('0x31')]=_[_0xe98e('0x32')](_0x248de1[_0xe98e('0x2e')],qs['fields'](_0xe380d9[_0xe98e('0x2f')]['fields']));_0x26590c[_0xe98e('0x31')]=_0x26590c[_0xe98e('0x31')]['length']?_0x26590c[_0xe98e('0x31')]:_0x248de1[_0xe98e('0x2e')];if(!_0xe380d9[_0xe98e('0x2f')][_0xe98e('0x33')](_0xe98e('0x34'))){_0x26590c['limit']=qs[_0xe98e('0x1d')](_0xe380d9['query'][_0xe98e('0x1d')]);_0x26590c[_0xe98e('0x1b')]=qs[_0xe98e('0x1b')](_0xe380d9[_0xe98e('0x2f')][_0xe98e('0x1b')]);}_0x26590c[_0xe98e('0x35')]=qs[_0xe98e('0x36')](_0xe380d9[_0xe98e('0x2f')]['sort']);_0x26590c[_0xe98e('0x37')]=qs[_0xe98e('0x30')](_['pick'](_0xe380d9[_0xe98e('0x2f')],_0x248de1[_0xe98e('0x30')]),_0x4a8143);if(_0xe380d9[_0xe98e('0x2f')][_0xe98e('0x38')]){_0x26590c[_0xe98e('0x37')]=_['merge'](_0x26590c['where'],{'$or':_[_0xe98e('0x2c')](_0x4a8143,function(_0x75476d){if(_0x75476d['type']!==_0xe98e('0x39')){var _0x22245b={};_0x22245b[_0x75476d[_0xe98e('0x29')]]={'$like':'%'+_0xe380d9[_0xe98e('0x2f')]['filter']+'%'};return _0x22245b;}})});}_0x26590c=_['merge']({},_0x26590c,_0xe380d9['options']);var _0x3f8fed={'where':_0x26590c[_0xe98e('0x37')]};return db['AnalyticCustomReport'][_0xe98e('0x1e')](_0x3f8fed)[_0xe98e('0x22')](function(_0x1c0bda){_0x288452[_0xe98e('0x1e')]=_0x1c0bda;if(_0xe380d9['query']['includeAll']){_0x26590c[_0xe98e('0x3a')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x26590c);})[_0xe98e('0x22')](function(_0x5c5ae9){_0x288452['rows']=_0x5c5ae9;return _0x288452;})[_0xe98e('0x22')](respondWithFilteredResult(_0x513e16,_0x26590c))['catch'](handleError(_0x513e16,null));};exports['show']=function(_0x227f53,_0x54d4e5){var _0x519416={'raw':![],'where':{'id':_0x227f53[_0xe98e('0x3b')]['id']}},_0x495928={};_0x495928['model']=_[_0xe98e('0x3c')](db['AnalyticCustomReport']['rawAttributes']);_0x495928[_0xe98e('0x2f')]=_['keys'](_0x227f53[_0xe98e('0x2f')]);_0x495928['filters']=_[_0xe98e('0x32')](_0x495928[_0xe98e('0x2e')],_0x495928[_0xe98e('0x2f')]);_0x519416['attributes']=_[_0xe98e('0x32')](_0x495928[_0xe98e('0x2e')],qs['fields'](_0x227f53[_0xe98e('0x2f')][_0xe98e('0x3d')]));_0x519416[_0xe98e('0x31')]=_0x519416[_0xe98e('0x31')][_0xe98e('0x3e')]?_0x519416[_0xe98e('0x31')]:_0x495928[_0xe98e('0x2e')];if(_0x227f53[_0xe98e('0x2f')][_0xe98e('0x3f')]){_0x519416[_0xe98e('0x3a')]=[{'all':!![]}];}_0x519416=_[_0xe98e('0x40')]({},_0x519416,_0x227f53[_0xe98e('0x41')]);return db['AnalyticCustomReport'][_0xe98e('0x42')](_0x519416)['then'](handleEntityNotFound(_0x54d4e5,null))[_0xe98e('0x22')](respondWithResult(_0x54d4e5,null))[_0xe98e('0x43')](handleError(_0x54d4e5,null));};exports['create']=function(_0x5627e4,_0x489344){return db[_0xe98e('0x2d')][_0xe98e('0x44')](_0x5627e4[_0xe98e('0x45')],{})[_0xe98e('0x22')](function(_0x43103c){var _0x935800=_0x5627e4['user'][_0xe98e('0x24')]({'plain':!![]});if(!_0x935800)throw new Error(_0xe98e('0x46'));if(_0x935800['role']==='user'){var _0x241507=_0x43103c[_0xe98e('0x24')]({'plain':!![]});var _0x34332d='Reports';return db[_0xe98e('0x47')][_0xe98e('0x42')]({'where':{'name':_0x34332d,'userProfileId':_0x935800['userProfileId']},'raw':!![]})[_0xe98e('0x22')](function(_0x3e036e){if(_0x3e036e&&_0x3e036e[_0xe98e('0x48')]===0x0){return db[_0xe98e('0x26')]['create']({'name':_0x241507[_0xe98e('0x29')],'resourceId':_0x241507['id'],'type':_0xe98e('0x25'),'sectionId':_0x3e036e['id']},{})[_0xe98e('0x22')](function(){return _0x43103c;});}else{return _0x43103c;}})['catch'](function(_0x420491){logger[_0xe98e('0x27')](_0xe98e('0x49'),_0x420491);throw _0x420491;});}return _0x43103c;})[_0xe98e('0x22')](respondWithResult(_0x489344,0xc9))[_0xe98e('0x43')](handleError(_0x489344,null));};exports[_0xe98e('0x21')]=function(_0x4d0144,_0x4159ff){if(_0x4d0144['body']['id']){delete _0x4d0144['body']['id'];}return db[_0xe98e('0x2d')][_0xe98e('0x42')]({'where':{'id':_0x4d0144[_0xe98e('0x3b')]['id']}})[_0xe98e('0x22')](handleEntityNotFound(_0x4159ff,null))[_0xe98e('0x22')](saveUpdates(_0x4d0144[_0xe98e('0x45')],null))[_0xe98e('0x22')](respondWithResult(_0x4159ff,null))[_0xe98e('0x43')](handleError(_0x4159ff,null));};exports[_0xe98e('0x23')]=function(_0x235caf,_0x5d8108){return db[_0xe98e('0x2d')]['find']({'where':{'id':_0x235caf['params']['id']}})[_0xe98e('0x22')](handleEntityNotFound(_0x5d8108,null))[_0xe98e('0x22')](removeEntity(_0x5d8108,null))['catch'](handleError(_0x5d8108,null));};exports[_0xe98e('0x4a')]=function(_0x29725c,_0x5192a9){var _0x52712d=0xa;var _0x2baa81=['join',_0xe98e('0x4b'),_0xe98e('0x4c'),_0xe98e('0x4d')];var _0x5bf7ab={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe98e('0x4e'),'MAX':_0xe98e('0x4f'),'MIN':_0xe98e('0x50'),'AVG':_0xe98e('0x51'),'GROUP_CONCAT':_0xe98e('0x52'),'GROUP_CONCAT ASC':_0xe98e('0x53'),'GROUP_CONCAT DESC':_0xe98e('0x54')};var _0x152975={'SEC_TO_TIME':_0xe98e('0x55'),'DATE':'DATE(%s)','HOUR':_0xe98e('0x56'),'ROUND':_0xe98e('0x57'),'UNIX_TIMESTAMP':_0xe98e('0x58')};var _0x3e0a20=function(_0x109fd7){return!_[_0xe98e('0x59')]([_0xe98e('0x5a'),_0xe98e('0x5b'),_0xe98e('0x5c'),'IS\x20NOT\x20EMPTY'],_0x109fd7);};var _0x127363=function(_0x5c1117){if(!_0x5c1117||!_0x5c1117['rules'][_0xe98e('0x3e')]){return'';}for(var _0x426431='(',_0x5c1f8e=0x0;_0x5c1f8e<_0x5c1117[_0xe98e('0x5d')][_0xe98e('0x3e')];_0x5c1f8e+=0x1){_0x5c1f8e>0x0&&(_0x426431+='\x20'+_0x5c1117[_0xe98e('0x5e')]+'\x20');_0x426431+=_0x5c1117['rules'][_0x5c1f8e][_0xe98e('0x5f')]?_0x127363(_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e]['group']):_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e][_0xe98e('0x60')]+'\x20'+_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e][_0xe98e('0x61')]+(_0x3e0a20(_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e]['condition'])?'\x20'+_0x5c1117['rules'][_0x5c1f8e][_0xe98e('0x62')]:'');}return _0x426431+')';};var _0x573666={'where':{'id':_0x29725c[_0xe98e('0x3b')]['id']}},_0x383248,_0x4ecd11,_0x33cb2f,_0x1e01b8,_0x3140b3;_0x573666=_[_0xe98e('0x40')]({},_0x573666,_0x29725c['options']);return db[_0xe98e('0x2d')][_0xe98e('0x42')](_0x573666)[_0xe98e('0x22')](function(_0xa0cb19){if(_0xa0cb19){_0x383248=_0xa0cb19;return _0xa0cb19['getFields']();}return null;})['then'](function(_0x475dc1){if(_0x475dc1){if(!_0x475dc1[_0xe98e('0x3e')]){throw new db[(_0xe98e('0x63'))][(_0xe98e('0x64'))](_0xe98e('0x65'),0x193);}_0x4ecd11=_0x475dc1;return db[_0xe98e('0x66')][_0xe98e('0x67')]({'raw':!![]});}return null;})[_0xe98e('0x22')](function(_0x12e2ce){if(_0x12e2ce){_0x33cb2f=_[_0xe98e('0x68')](_0x12e2ce,'id');var _0x478987;var _0x4617cf=squel['select']();_0x4617cf[_0xe98e('0x69')](_0x383248[_0xe98e('0x6a')]);for(var _0x443721=0x0;_0x443721<_0x4ecd11[_0xe98e('0x3e')];_0x443721+=0x1){_0x478987=_0x4ecd11[_0x443721][_0xe98e('0x6b')]?_0x33cb2f[_0x4ecd11[_0x443721][_0xe98e('0x6b')]]['metric']:_0x4ecd11[_0x443721][_0xe98e('0x60')];_0x478987=_0x4ecd11[_0x443721][_0xe98e('0x6c')]?_[_0xe98e('0x6d')](_0x5bf7ab[_0x4ecd11[_0x443721][_0xe98e('0x6c')]],'%s',_0x478987):_0x478987;_0x478987=_0x4ecd11[_0x443721][_0xe98e('0x6e')]?_['replace'](_0x152975[_0x4ecd11[_0x443721][_0xe98e('0x6e')]],'%s',_0x478987):_0x478987;if(_0x4ecd11[_0x443721][_0xe98e('0x6f')]){_0x4617cf[_0xe98e('0x5f')](_0x478987);}_0x4ecd11[_0x443721]['orderBy']&&_0x4617cf[_0xe98e('0x35')](_0x478987,_0x4ecd11[_0x443721]['orderBy']==='DESC'?![]:!![]);_0x4617cf[_0xe98e('0x60')](_0x478987,_0x4ecd11[_0x443721]['alias']||_0x478987);}if(_0x383248[_0xe98e('0x70')]){_0x383248[_0xe98e('0x70')]=JSON[_0xe98e('0x71')](_0x383248[_0xe98e('0x70')]);for(var _0x35792a=0x0;_0x35792a<_0x383248[_0xe98e('0x70')]['length'];_0x35792a+=0x1){if(_0x383248[_0xe98e('0x70')][_0x35792a]['type']&&_['includes'](_0x2baa81,_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x72')])&&_0x383248['joins'][_0x35792a][_0xe98e('0x73')]&&_0x383248['joins'][_0x35792a][_0xe98e('0x74')]&&_0x383248['joins'][_0x35792a][_0xe98e('0x75')]){_0x4617cf[_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x72')]](_0x383248[_0xe98e('0x70')][_0x35792a]['foreignTable'],null,util[_0xe98e('0x6e')](_0xe98e('0x76'),_0x383248[_0xe98e('0x6a')],_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x73')],_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x74')],_0x383248['joins'][_0x35792a][_0xe98e('0x75')]));}}}if(_0x383248[_0xe98e('0x77')]){_0x383248[_0xe98e('0x77')]=JSON[_0xe98e('0x71')](_0x383248[_0xe98e('0x77')]);_0x4617cf[_0xe98e('0x37')](_0x127363(_0x383248[_0xe98e('0x77')][_0xe98e('0x5f')]));}_0x3140b3=_0x4617cf['clone']();_0x4617cf[_0xe98e('0x1d')](_0x52712d);_0x4617cf['offset'](0x0);logger[_0xe98e('0x78')](_0xe98e('0x79'),_0x4617cf[_0xe98e('0x7a')]());return dbH[_0xe98e('0x7b')]['query'](_0x4617cf[_0xe98e('0x7a')](),{'type':dbH[_0xe98e('0x7b')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x5192a9,null))[_0xe98e('0x43')](handleError(_0x5192a9,null));};function runReport(_0x28d7e3,_0x204830,_0x56716a){var _0x3e6352=_0x204830[_0xe98e('0x29')];var _0x1512a4=0xa;var _0xd09344=[_0xe98e('0x7c'),'left_join','right_join',_0xe98e('0x4d')];var _0x507c98={'SUM':'SUM(%s)','COUNT':_0xe98e('0x7d'),'COUNT DISTINCT':_0xe98e('0x4e'),'MAX':_0xe98e('0x4f'),'MIN':_0xe98e('0x50'),'AVG':_0xe98e('0x51'),'GROUP_CONCAT':_0xe98e('0x52'),'GROUP_CONCAT ASC':_0xe98e('0x53'),'GROUP_CONCAT DESC':_0xe98e('0x54')};var _0x186ca0={'SEC_TO_TIME':_0xe98e('0x55'),'DATE':'DATE(%s)','HOUR':_0xe98e('0x56'),'ROUND':_0xe98e('0x57'),'UNIX_TIMESTAMP':_0xe98e('0x58')};var _0x3c9a96=function(_0x28dc14){return!_[_0xe98e('0x59')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe98e('0x5c'),_0xe98e('0x7e')],_0x28dc14);};var _0x3edd86=function(_0x3d1cb5){if(!_0x3d1cb5||!_0x3d1cb5['rules'][_0xe98e('0x3e')]){return'';}for(var _0x428be1='(',_0x5b330f=0x0;_0x5b330f<_0x3d1cb5[_0xe98e('0x5d')][_0xe98e('0x3e')];_0x5b330f+=0x1){_0x5b330f>0x0&&(_0x428be1+='\x20'+_0x3d1cb5[_0xe98e('0x5e')]+'\x20');_0x428be1+=_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f]['group']?_0x3edd86(_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f][_0xe98e('0x5f')]):_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f]['field']+'\x20'+_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f][_0xe98e('0x61')]+(_0x3c9a96(_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f][_0xe98e('0x61')])?'\x20'+_0x3d1cb5['rules'][_0x5b330f][_0xe98e('0x62')]:'');}return _0x428be1+')';};var _0x30477c={'where':{'id':_0x28d7e3['id']}},_0x3120be,_0x19ee16,_0x21a732,_0x15471b,_0x4a4ab2;_0x30477c=_[_0xe98e('0x40')]({},_0x30477c,_0x56716a);return db[_0xe98e('0x2d')]['find'](_0x30477c)['then'](function(_0x22715b){if(_0x22715b){_0x3120be=_0x22715b;return _0x22715b[_0xe98e('0x7f')]();}return null;})[_0xe98e('0x22')](function(_0x2d9997){if(_0x2d9997){if(!_0x2d9997[_0xe98e('0x3e')]){throw new db[(_0xe98e('0x63'))][(_0xe98e('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x19ee16=_0x2d9997;return db[_0xe98e('0x66')][_0xe98e('0x67')]({'raw':!![]});}return null;})[_0xe98e('0x22')](function(_0x2e9b50){if(_0x2e9b50){_0x21a732=_['keyBy'](_0x2e9b50,'id');var _0x20a44a;var _0x3b256f=squel['select']();_0x3b256f[_0xe98e('0x69')](_0x3120be[_0xe98e('0x6a')]);for(var _0x225eb0=0x0;_0x225eb0<_0x19ee16['length'];_0x225eb0+=0x1){_0x20a44a=_0x19ee16[_0x225eb0][_0xe98e('0x6b')]?_0x21a732[_0x19ee16[_0x225eb0][_0xe98e('0x6b')]][_0xe98e('0x80')]:_0x19ee16[_0x225eb0][_0xe98e('0x60')];_0x20a44a=_0x19ee16[_0x225eb0][_0xe98e('0x6c')]?_['replace'](_0x507c98[_0x19ee16[_0x225eb0][_0xe98e('0x6c')]],'%s',_0x20a44a):_0x20a44a;_0x20a44a=_0x19ee16[_0x225eb0][_0xe98e('0x6e')]?_['replace'](_0x186ca0[_0x19ee16[_0x225eb0][_0xe98e('0x6e')]],'%s',_0x20a44a):_0x20a44a;if(_0x19ee16[_0x225eb0]['groupBy']){_0x3b256f[_0xe98e('0x5f')](_0x20a44a);}_0x19ee16[_0x225eb0][_0xe98e('0x81')]&&_0x3b256f['order'](_0x20a44a,_0x19ee16[_0x225eb0][_0xe98e('0x81')]==='DESC'?![]:!![]);_0x3b256f[_0xe98e('0x60')](_0x20a44a,_0x19ee16[_0x225eb0][_0xe98e('0x82')]||_0x20a44a);}if(_0x3120be['joins']){_0x3120be[_0xe98e('0x70')]=JSON[_0xe98e('0x71')](_0x3120be[_0xe98e('0x70')]);for(var _0x582617=0x0;_0x582617<_0x3120be[_0xe98e('0x70')][_0xe98e('0x3e')];_0x582617+=0x1){if(_0x3120be['joins'][_0x582617]['type']&&_[_0xe98e('0x59')](_0xd09344,_0x3120be['joins'][_0x582617][_0xe98e('0x72')])&&_0x3120be['joins'][_0x582617][_0xe98e('0x73')]&&_0x3120be[_0xe98e('0x70')][_0x582617]['foreignTable']&&_0x3120be[_0xe98e('0x70')][_0x582617][_0xe98e('0x75')]){_0x3b256f[_0x3120be[_0xe98e('0x70')][_0x582617]['type']](_0x3120be[_0xe98e('0x70')][_0x582617][_0xe98e('0x74')],null,util['format'](_0xe98e('0x76'),_0x3120be[_0xe98e('0x6a')],_0x3120be[_0xe98e('0x70')][_0x582617]['parentKey'],_0x3120be[_0xe98e('0x70')][_0x582617][_0xe98e('0x74')],_0x3120be['joins'][_0x582617]['foreignKey']));}}}if(_0x3120be[_0xe98e('0x77')]){_0x3120be[_0xe98e('0x77')]=JSON[_0xe98e('0x71')](_0x3120be[_0xe98e('0x77')]);_0x3b256f[_0xe98e('0x37')](_0x3edd86(_0x3120be[_0xe98e('0x77')][_0xe98e('0x5f')]));}_0x4a4ab2=_0x3b256f[_0xe98e('0x83')]();_0x3b256f[_0xe98e('0x1d')](_0x1512a4);_0x3b256f[_0xe98e('0x1b')](0x0);return;}})[_0xe98e('0x22')](function(){if(_0x204830[_0xe98e('0x84')]===_0xe98e('0x85')){return null;}var _0x3e3934=_[_0xe98e('0x40')](_0x204830,{'name':_0x204830[_0xe98e('0x86')]||_0x204830[_0xe98e('0x29')]||_0x3120be[_0xe98e('0x29')],'basename':_0x3e6352,'savename':util[_0xe98e('0x6e')](_0xe98e('0x87'),_0x204830[_0xe98e('0x29')]||_0x3120be[_0xe98e('0x29')],require('randomstring')[_0xe98e('0x88')](0x4),_0x204830['output']||'csv'),'reportId':_0x3120be['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xe98e('0x44')](_0x3e3934,{'raw':!![]});})[_0xe98e('0x22')](function(_0x55ca63){if(_0x3120be[_0xe98e('0x6a')]===_0xe98e('0x89')){_0x4a4ab2[_0xe98e('0x37')](_0x3120be[_0xe98e('0x6a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x204830[_0xe98e('0x8a')],_0x204830[_0xe98e('0x8b')]);}else{_0x4a4ab2[_0xe98e('0x37')](_0x3120be[_0xe98e('0x6a')]+_0xe98e('0x8c'),_0x204830[_0xe98e('0x8a')],_0x204830[_0xe98e('0x8b')]);}if(_0x55ca63){logger[_0xe98e('0x8d')]('Run\x20Query:',_0x4a4ab2[_0xe98e('0x7a')]());require(_0xe98e('0x8e'))[_0xe98e('0x8f')](path[_0xe98e('0x7c')](__dirname,'../../components/export/',_0x55ca63[_0xe98e('0x84')]),[_0x55ca63['id'],_0x4a4ab2[_0xe98e('0x7a')](),path[_0xe98e('0x7c')](__dirname,_0xe98e('0x90'),_0x55ca63['savename']),_0x3e6352]);return _0x55ca63;}else{var _0x2e00de=squel[_0xe98e('0x91')]();_0x2e00de[_0xe98e('0x69')]('('+_0x4a4ab2['toString']()+')',_0xe98e('0x92'));_0x2e00de[_0xe98e('0x60')](_0xe98e('0x93'),_0xe98e('0x1e'));_0x4a4ab2['limit'](_0x204830[_0xe98e('0x1d')]||_0x1512a4);_0x4a4ab2['offset'](_0x204830['offset']||0x0);return dbH[_0xe98e('0x7b')][_0xe98e('0x2f')](_0x2e00de[_0xe98e('0x7a')](),{'type':dbH[_0xe98e('0x7b')][_0xe98e('0x94')][_0xe98e('0x95')]})[_0xe98e('0x22')](function(_0x54c1a8){if(!_0x54c1a8[_0xe98e('0x3e')]){_0x15471b=0x0;}else{_0x15471b=_0x54c1a8[0x0][_0xe98e('0x1e')]||0x0;}return dbH[_0xe98e('0x7b')][_0xe98e('0x2f')](_0x4a4ab2[_0xe98e('0x7a')](),{'type':dbH[_0xe98e('0x7b')]['QueryTypes'][_0xe98e('0x95')]});})['then'](function(_0xa165cf){return{'rows':_0xa165cf||[],'count':_0x15471b};});}});}exports[_0xe98e('0x96')]=function(_0x3d9f3f,_0x51b47b){return runReport(_0x3d9f3f[_0xe98e('0x3b')],_0x3d9f3f[_0xe98e('0x2f')],_0x3d9f3f[_0xe98e('0x41')])[_0xe98e('0x22')](respondWithResult(_0x51b47b,null))['catch'](handleError(_0x51b47b,null));};exports[_0xe98e('0x97')]=runReport;exports[_0xe98e('0x2f')]=function(_0x11d570,_0x5c452f){var _0x306bae=0xa;var _0x1978cc=[_0xe98e('0x7c'),_0xe98e('0x4b'),'right_join',_0xe98e('0x4d')];var _0x22e991={'SUM':_0xe98e('0x98'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe98e('0x4e'),'MAX':_0xe98e('0x4f'),'MIN':_0xe98e('0x50'),'AVG':_0xe98e('0x51'),'GROUP_CONCAT':_0xe98e('0x52'),'GROUP_CONCAT ASC':_0xe98e('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x54718b={'SEC_TO_TIME':_0xe98e('0x55'),'DATE':_0xe98e('0x99'),'HOUR':_0xe98e('0x56'),'ROUND':_0xe98e('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a5039=function(_0xac35){return!_['includes']([_0xe98e('0x5a'),_0xe98e('0x5b'),_0xe98e('0x5c'),_0xe98e('0x7e')],_0xac35);};var _0x12979c=function(_0x418dae){if(!_0x418dae||!_0x418dae[_0xe98e('0x5d')][_0xe98e('0x3e')]){return'';}for(var _0x26166a='(',_0x35e346=0x0;_0x35e346<_0x418dae[_0xe98e('0x5d')]['length'];_0x35e346+=0x1){_0x35e346>0x0&&(_0x26166a+='\x20'+_0x418dae[_0xe98e('0x5e')]+'\x20');_0x26166a+=_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x5f')]?_0x12979c(_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x5f')]):_0x418dae[_0xe98e('0x5d')][_0x35e346]['field']+'\x20'+_0x418dae[_0xe98e('0x5d')][_0x35e346]['condition']+(_0x5a5039(_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x61')])?'\x20'+_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x62')]:'');}return _0x26166a+')';};var _0x2c1828={'where':{'id':_0x11d570[_0xe98e('0x3b')]['id']}},_0x106046,_0x35e003,_0x5cc834,_0x299a22,_0x4a9138;_0x2c1828=_[_0xe98e('0x40')]({},_0x2c1828,_0x11d570[_0xe98e('0x41')]);return db[_0xe98e('0x2d')][_0xe98e('0x42')](_0x2c1828)[_0xe98e('0x22')](function(_0x11b8ef){if(_0x11b8ef){_0x106046=_0x11b8ef;return _0x11b8ef[_0xe98e('0x7f')]();}return null;})['then'](function(_0x132c35){if(_0x132c35){if(!_0x132c35['length']){throw new db[(_0xe98e('0x63'))]['ValidationErrorItem'](_0xe98e('0x65'),0x193);}_0x35e003=_0x132c35;return db[_0xe98e('0x66')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2916dd){if(_0x2916dd){_0x5cc834=_['keyBy'](_0x2916dd,'id');var _0x4f9159;var _0x3c3164=squel['select']();_0x3c3164[_0xe98e('0x69')](_0x106046[_0xe98e('0x6a')]);for(var _0xbb36e=0x0;_0xbb36e<_0x35e003[_0xe98e('0x3e')];_0xbb36e+=0x1){_0x4f9159=_0x35e003[_0xbb36e][_0xe98e('0x6b')]?_0x5cc834[_0x35e003[_0xbb36e][_0xe98e('0x6b')]]['metric']:_0x35e003[_0xbb36e][_0xe98e('0x60')];_0x4f9159=_0x35e003[_0xbb36e]['function']?_[_0xe98e('0x6d')](_0x22e991[_0x35e003[_0xbb36e][_0xe98e('0x6c')]],'%s',_0x4f9159):_0x4f9159;_0x4f9159=_0x35e003[_0xbb36e][_0xe98e('0x6e')]?_[_0xe98e('0x6d')](_0x54718b[_0x35e003[_0xbb36e][_0xe98e('0x6e')]],'%s',_0x4f9159):_0x4f9159;if(_0x35e003[_0xbb36e][_0xe98e('0x6f')]){_0x3c3164['group'](_0x4f9159);}_0x35e003[_0xbb36e][_0xe98e('0x81')]&&_0x3c3164[_0xe98e('0x35')](_0x4f9159,_0x35e003[_0xbb36e][_0xe98e('0x81')]===_0xe98e('0x9a')?![]:!![]);_0x3c3164[_0xe98e('0x60')](_0x4f9159,_0x35e003[_0xbb36e][_0xe98e('0x82')]||_0x4f9159);}if(_0x106046[_0xe98e('0x70')]){_0x106046[_0xe98e('0x70')]=JSON[_0xe98e('0x71')](_0x106046['joins']);for(var _0x5b16a7=0x0;_0x5b16a7<_0x106046['joins']['length'];_0x5b16a7+=0x1){if(_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x72')]&&_[_0xe98e('0x59')](_0x1978cc,_0x106046['joins'][_0x5b16a7][_0xe98e('0x72')])&&_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x73')]&&_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x74')]&&_0x106046['joins'][_0x5b16a7][_0xe98e('0x75')]){_0x3c3164[_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x72')]](_0x106046['joins'][_0x5b16a7][_0xe98e('0x74')],null,util[_0xe98e('0x6e')]('%s.%s\x20=\x20%s.%s',_0x106046[_0xe98e('0x6a')],_0x106046['joins'][_0x5b16a7]['parentKey'],_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x74')],_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x75')]));}}}if(_0x106046[_0xe98e('0x77')]){_0x106046['conditions']=JSON['parse'](_0x106046[_0xe98e('0x77')]);_0x3c3164[_0xe98e('0x37')](_0x12979c(_0x106046[_0xe98e('0x77')][_0xe98e('0x5f')]));}_0x4a9138=_0x3c3164['clone']();_0x3c3164[_0xe98e('0x1d')](_0x306bae);_0x3c3164[_0xe98e('0x1b')](0x0);logger[_0xe98e('0x78')](_0xe98e('0x79'),_0x3c3164[_0xe98e('0x7a')]());return dbH[_0xe98e('0x7b')]['query'](_0x3c3164['toString'](),{'type':dbH[_0xe98e('0x7b')][_0xe98e('0x94')]['SELECT']});}})[_0xe98e('0x22')](function(){return{'sql':_0x4a9138[_0xe98e('0x7a')]()};})[_0xe98e('0x22')](respondWithResult(_0x5c452f,null))[_0xe98e('0x43')](handleError(_0x5c452f,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 97eb51b..4972b9c 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 _0x5619=['AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5619,0x160));var _0x9561=function(_0x458ca2,_0x2f21b2){_0x458ca2=_0x458ca2-0x0;var _0xc2c061=_0x5619[_0x458ca2];return _0xc2c061;};'use strict';var _=require(_0x9561('0x0'));var util=require(_0x9561('0x1'));var logger=require(_0x9561('0x2'))(_0x9561('0x3'));var moment=require(_0x9561('0x4'));var BPromise=require(_0x9561('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9561('0x6'));var rimraf=require(_0x9561('0x7'));var config=require(_0x9561('0x8'));var attributes=require(_0x9561('0x9'));module[_0x9561('0xa')]=function(_0x32dc88,_0x1730dd){return _0x32dc88[_0x9561('0xb')](_0x9561('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf980=['bluebird','request-promise','path','rimraf','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x3bc8c2,_0x45e0f7){var _0x471d7a=function(_0x2d3afa){while(--_0x2d3afa){_0x3bc8c2['push'](_0x3bc8c2['shift']());}};_0x471d7a(++_0x45e0f7);}(_0xf980,0xd9));var _0x0f98=function(_0x42a571,_0x57321c){_0x42a571=_0x42a571-0x0;var _0x32afaf=_0xf980[_0x42a571];return _0x32afaf;};'use strict';var _=require(_0x0f98('0x0'));var util=require(_0x0f98('0x1'));var logger=require(_0x0f98('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f98('0x3'));var rp=require(_0x0f98('0x4'));var fs=require('fs');var path=require(_0x0f98('0x5'));var rimraf=require(_0x0f98('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x0f98('0x7')]=function(_0x150f5f,_0x220eb4){return _0x150f5f['define'](_0x0f98('0x8'),attributes,{'tableName':_0x0f98('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 d0c552b..d783d8a 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 _0x81ad=['code','AnalyticCustomReport,\x20%s,\x20%s','message','info','request\x20sent','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a7f3a,_0x272a49){var _0x22b597=function(_0x17eaaf){while(--_0x17eaaf){_0x2a7f3a['push'](_0x2a7f3a['shift']());}};_0x22b597(++_0x272a49);}(_0x81ad,0x1ea));var _0xd81a=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x81ad[_0x4c7b20];return _0x4872bd;};'use strict';var _=require(_0xd81a('0x0'));var util=require(_0xd81a('0x1'));var moment=require(_0xd81a('0x2'));var BPromise=require(_0xd81a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd81a('0x4'))['db'];var utils=require(_0xd81a('0x5'));var logger=require(_0xd81a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd81a('0x7'));var client=jayson[_0xd81a('0x8')][_0xd81a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d822f,_0x5738e1,_0x134b66){return new BPromise(function(_0x1c95c7,_0x316888){return client[_0xd81a('0xa')](_0x3d822f,_0x134b66)[_0xd81a('0xb')](function(_0x15d5a7){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5738e1,'request\x20sent');logger[_0xd81a('0xc')](_0xd81a('0xd'),_0x5738e1,'request\x20sent',JSON[_0xd81a('0xe')](_0x15d5a7));if(_0x15d5a7[_0xd81a('0xf')]){if(_0x15d5a7['error'][_0xd81a('0x10')]===0x1f4){logger[_0xd81a('0xf')](_0xd81a('0x11'),_0x5738e1,_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);return _0x316888(_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);}logger[_0xd81a('0xf')](_0xd81a('0x11'),_0x5738e1,_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);return _0x1c95c7(_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);}else{logger[_0xd81a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5738e1,_0xd81a('0x14'));_0x1c95c7(_0x15d5a7['result'][_0xd81a('0x12')]);}})[_0xd81a('0x15')](function(_0x42a293){logger[_0xd81a('0xf')](_0xd81a('0x11'),_0x5738e1,_0x42a293);_0x316888(_0x42a293);});});}
\ No newline at end of file
+var _0xfe16=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe16,0x17e));var _0x6fe1=function(_0x2a9734,_0x3a1363){_0x2a9734=_0x2a9734-0x0;var _0x59d0d7=_0xfe16[_0x2a9734];return _0x59d0d7;};'use strict';var _=require(_0x6fe1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6fe1('0x1'));var rs=require(_0x6fe1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fe1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fe1('0x4'))(_0x6fe1('0x5'));var config=require(_0x6fe1('0x6'));var jayson=require(_0x6fe1('0x7'));var client=jayson[_0x6fe1('0x8')][_0x6fe1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c51d6,_0x32d5f1,_0x5568af){return new BPromise(function(_0x446971,_0x5bdc67){return client[_0x6fe1('0xa')](_0x4c51d6,_0x5568af)[_0x6fe1('0xb')](function(_0x39f6d7){logger[_0x6fe1('0xc')](_0x6fe1('0xd'),_0x32d5f1,_0x6fe1('0xe'));logger[_0x6fe1('0xf')](_0x6fe1('0x10'),_0x32d5f1,_0x6fe1('0xe'),JSON[_0x6fe1('0x11')](_0x39f6d7));if(_0x39f6d7['error']){if(_0x39f6d7[_0x6fe1('0x12')][_0x6fe1('0x13')]===0x1f4){logger[_0x6fe1('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x32d5f1,_0x39f6d7[_0x6fe1('0x12')][_0x6fe1('0x14')]);return _0x5bdc67(_0x39f6d7['error'][_0x6fe1('0x14')]);}logger[_0x6fe1('0x12')](_0x6fe1('0xd'),_0x32d5f1,_0x39f6d7[_0x6fe1('0x12')]['message']);return _0x446971(_0x39f6d7[_0x6fe1('0x12')][_0x6fe1('0x14')]);}else{logger['info'](_0x6fe1('0xd'),_0x32d5f1,_0x6fe1('0xe'));_0x446971(_0x39f6d7[_0x6fe1('0x15')]['message']);}})[_0x6fe1('0x16')](function(_0x525995){logger[_0x6fe1('0x12')](_0x6fe1('0xd'),_0x32d5f1,_0x525995);_0x5bdc67(_0x525995);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index da84c45..0778a4a 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 _0xf14c=['run','/:id/query','query','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','preview','/:id/run'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xf14c,0x15b));var _0xcf14=function(_0x5a4f06,_0xc6e3f){_0x5a4f06=_0x5a4f06-0x0;var _0x4e2417=_0xf14c[_0x5a4f06];return _0x4e2417;};'use strict';var multer=require(_0xcf14('0x0'));var util=require(_0xcf14('0x1'));var path=require(_0xcf14('0x2'));var timeout=require(_0xcf14('0x3'));var express=require(_0xcf14('0x4'));var router=express[_0xcf14('0x5')]();var fs_extra=require(_0xcf14('0x6'));var auth=require(_0xcf14('0x7'));var interaction=require(_0xcf14('0x8'));var config=require(_0xcf14('0x9'));var controller=require(_0xcf14('0xa'));router[_0xcf14('0xb')]('/',auth[_0xcf14('0xc')](),controller['index']);router[_0xcf14('0xb')](_0xcf14('0xd'),auth[_0xcf14('0xc')](),controller[_0xcf14('0xe')]);router['get']('/:id/preview',auth[_0xcf14('0xc')](),controller[_0xcf14('0xf')]);router['get'](_0xcf14('0x10'),auth[_0xcf14('0xc')](),controller[_0xcf14('0x11')]);router[_0xcf14('0xb')](_0xcf14('0x12'),auth[_0xcf14('0xc')](),controller[_0xcf14('0x13')]);router[_0xcf14('0x14')]('/',auth[_0xcf14('0xc')](),controller[_0xcf14('0x15')]);router[_0xcf14('0x16')](_0xcf14('0xd'),auth[_0xcf14('0xc')](),controller['update']);router[_0xcf14('0x17')](_0xcf14('0xd'),auth[_0xcf14('0xc')](),controller[_0xcf14('0x18')]);module[_0xcf14('0x19')]=router;
\ No newline at end of file
+var _0xfa19=['destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','run','/:id/query','put','delete'];(function(_0x45ac0c,_0x2f8a58){var _0x4b4074=function(_0x1ddc53){while(--_0x1ddc53){_0x45ac0c['push'](_0x45ac0c['shift']());}};_0x4b4074(++_0x2f8a58);}(_0xfa19,0x73));var _0x9fa1=function(_0x221743,_0x186de6){_0x221743=_0x221743-0x0;var _0x38caa8=_0xfa19[_0x221743];return _0x38caa8;};'use strict';var multer=require(_0x9fa1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9fa1('0x1'));var express=require(_0x9fa1('0x2'));var router=express[_0x9fa1('0x3')]();var fs_extra=require(_0x9fa1('0x4'));var auth=require(_0x9fa1('0x5'));var interaction=require(_0x9fa1('0x6'));var config=require('../../config/environment');var controller=require(_0x9fa1('0x7'));router[_0x9fa1('0x8')]('/',auth[_0x9fa1('0x9')](),controller[_0x9fa1('0xa')]);router[_0x9fa1('0x8')](_0x9fa1('0xb'),auth[_0x9fa1('0x9')](),controller[_0x9fa1('0xc')]);router[_0x9fa1('0x8')](_0x9fa1('0xd'),auth[_0x9fa1('0x9')](),controller['preview']);router[_0x9fa1('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x9fa1('0xe')]);router[_0x9fa1('0x8')](_0x9fa1('0xf'),auth[_0x9fa1('0x9')](),controller['query']);router['post']('/',auth[_0x9fa1('0x9')](),controller['create']);router[_0x9fa1('0x10')](_0x9fa1('0xb'),auth[_0x9fa1('0x9')](),controller['update']);router[_0x9fa1('0x11')](_0x9fa1('0xb'),auth[_0x9fa1('0x9')](),controller[_0x9fa1('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index dab4bce..379aeca 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x1ae78f,_0x122ed2){var _0x5baf80=function(_0x28a303){while(--_0x28a303){_0x1ae78f['push'](_0x1ae78f['shift']());}};_0x5baf80(++_0x122ed2);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xfdbd[_0x4f1da5];return _0xe972a8;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x55a787,_0x1466a3){var _0x5d90a0=function(_0x5405fb){while(--_0x5405fb){_0x55a787['push'](_0x55a787['shift']());}};_0x5d90a0(++_0x1466a3);}(_0x5fab,0x177));var _0xb5fa=function(_0xd98def,_0x19ebc7){_0xd98def=_0xd98def-0x0;var _0x55b182=_0x5fab[_0xd98def];return _0x55b182;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index bf8266e..d031a33 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x7a54,0x106));var _0x47a5=function(_0xb14868,_0x3d56d3){_0xb14868=_0xb14868-0x0;var _0x1b1c55=_0x7a54[_0xb14868];return _0x1b1c55;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
+var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x5b226b,_0x39b2e9){var _0x75cfba=function(_0x4a1686){while(--_0x4a1686){_0x5b226b['push'](_0x5b226b['shift']());}};_0x75cfba(++_0x39b2e9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x5fc3[_0x3ceb54];return _0x26d8a6;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 4601bcb..2d0bfab 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 _0x145a=['AnalyticDefaultReport','analytics_default_reports','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x1ad4cc,_0x4de4dd){var _0x4c81a0=function(_0x3a01a0){while(--_0x3a01a0){_0x1ad4cc['push'](_0x1ad4cc['shift']());}};_0x4c81a0(++_0x4de4dd);}(_0x145a,0x1e2));var _0xa145=function(_0x54e5c2,_0x60f1e8){_0x54e5c2=_0x54e5c2-0x0;var _0x2a8642=_0x145a[_0x54e5c2];return _0x2a8642;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa145('0x0'));var BPromise=require(_0xa145('0x1'));var rp=require(_0xa145('0x2'));var fs=require('fs');var path=require(_0xa145('0x3'));var rimraf=require('rimraf');var config=require(_0xa145('0x4'));var attributes=require(_0xa145('0x5'));module[_0xa145('0x6')]=function(_0x2247cc,_0x399539){return _0x2247cc[_0xa145('0x7')](_0xa145('0x8'),attributes,{'tableName':_0xa145('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1cb=['path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','bluebird'];(function(_0x35bdab,_0x28a695){var _0xbe96b0=function(_0x425977){while(--_0x425977){_0x35bdab['push'](_0x35bdab['shift']());}};_0xbe96b0(++_0x28a695);}(_0xb1cb,0xa7));var _0xbb1c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb1cb[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xbb1c('0x0'));var util=require(_0xbb1c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbb1c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb1c('0x3'));var rimraf=require(_0xbb1c('0x4'));var config=require('../../config/environment');var attributes=require(_0xbb1c('0x5'));module[_0xbb1c('0x6')]=function(_0x1f49c2,_0x4844a7){return _0x1f49c2[_0xbb1c('0x7')](_0xbb1c('0x8'),attributes,{'tableName':_0xbb1c('0x9'),'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 ad815ba..41f90d9 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 _0x742d=['message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2fcd6e,_0xc2f135){var _0x7789a3=function(_0x2ea41b){while(--_0x2ea41b){_0x2fcd6e['push'](_0x2fcd6e['shift']());}};_0x7789a3(++_0xc2f135);}(_0x742d,0x192));var _0xd742=function(_0x408142,_0x90850c){_0x408142=_0x408142-0x0;var _0x3565ef=_0x742d[_0x408142];return _0x3565ef;};'use strict';var _=require(_0xd742('0x0'));var util=require('util');var moment=require(_0xd742('0x1'));var BPromise=require(_0xd742('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd742('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd742('0x4'));var logger=require(_0xd742('0x5'))(_0xd742('0x6'));var config=require(_0xd742('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd742('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ac896,_0x26ecbc,_0x4ebb5a){return new BPromise(function(_0x8b25e8,_0x1fd6e2){return client['request'](_0x4ac896,_0x4ebb5a)[_0xd742('0x9')](function(_0x388fb3){logger[_0xd742('0xa')](_0xd742('0xb'),_0x26ecbc,_0xd742('0xc'));logger[_0xd742('0xd')](_0xd742('0xe'),_0x26ecbc,_0xd742('0xc'),JSON[_0xd742('0xf')](_0x388fb3));if(_0x388fb3[_0xd742('0x10')]){if(_0x388fb3['error'][_0xd742('0x11')]===0x1f4){logger[_0xd742('0x10')](_0xd742('0xb'),_0x26ecbc,_0x388fb3['error'][_0xd742('0x12')]);return _0x1fd6e2(_0x388fb3[_0xd742('0x10')][_0xd742('0x12')]);}logger[_0xd742('0x10')](_0xd742('0xb'),_0x26ecbc,_0x388fb3['error'][_0xd742('0x12')]);return _0x8b25e8(_0x388fb3[_0xd742('0x10')][_0xd742('0x12')]);}else{logger[_0xd742('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26ecbc,_0xd742('0xc'));_0x8b25e8(_0x388fb3[_0xd742('0x13')][_0xd742('0x12')]);}})[_0xd742('0x14')](function(_0x2c518d){logger[_0xd742('0x10')](_0xd742('0xb'),_0x26ecbc,_0x2c518d);_0x1fd6e2(_0x2c518d);});});}
\ No newline at end of file
+var _0x7351=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3073e3,_0xf6dc21){var _0x5ab70b=function(_0x5820ed){while(--_0x5820ed){_0x3073e3['push'](_0x3073e3['shift']());}};_0x5ab70b(++_0xf6dc21);}(_0x7351,0x100));var _0x1735=function(_0xae6725,_0x325d12){_0xae6725=_0xae6725-0x0;var _0x2d5212=_0x7351[_0xae6725];return _0x2d5212;};'use strict';var _=require(_0x1735('0x0'));var util=require(_0x1735('0x1'));var moment=require(_0x1735('0x2'));var BPromise=require(_0x1735('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1735('0x4'));var db=require(_0x1735('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1735('0x6'))(_0x1735('0x7'));var config=require(_0x1735('0x8'));var jayson=require(_0x1735('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcf49a1,_0x4ea5f1,_0x119e83){return new BPromise(function(_0x217f72,_0x5c21e9){return client[_0x1735('0xa')](_0xcf49a1,_0x119e83)['then'](function(_0x423736){logger[_0x1735('0xb')](_0x1735('0xc'),_0x4ea5f1,_0x1735('0xd'));logger['debug'](_0x1735('0xe'),_0x4ea5f1,_0x1735('0xd'),JSON[_0x1735('0xf')](_0x423736));if(_0x423736[_0x1735('0x10')]){if(_0x423736[_0x1735('0x10')]['code']===0x1f4){logger[_0x1735('0x10')](_0x1735('0xc'),_0x4ea5f1,_0x423736[_0x1735('0x10')][_0x1735('0x11')]);return _0x5c21e9(_0x423736[_0x1735('0x10')][_0x1735('0x11')]);}logger[_0x1735('0x10')](_0x1735('0xc'),_0x4ea5f1,_0x423736[_0x1735('0x10')][_0x1735('0x11')]);return _0x217f72(_0x423736[_0x1735('0x10')][_0x1735('0x11')]);}else{logger[_0x1735('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ea5f1,_0x1735('0xd'));_0x217f72(_0x423736[_0x1735('0x12')][_0x1735('0x11')]);}})[_0x1735('0x13')](function(_0xe5a137){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ea5f1,_0xe5a137);_0x5c21e9(_0xe5a137);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a5e93d4..7bbef41 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 _0x0b6e=['show','preview','get','/:id/run','run','/:id/query','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','index','isAuthenticated'];(function(_0xf0ab7c,_0x23bbc2){var _0x198144=function(_0x1c3a40){while(--_0x1c3a40){_0xf0ab7c['push'](_0xf0ab7c['shift']());}};_0x198144(++_0x23bbc2);}(_0x0b6e,0x11f));var _0xe0b6=function(_0x4b9958,_0x8d7a2a){_0x4b9958=_0x4b9958-0x0;var _0x89ed74=_0x0b6e[_0x4b9958];return _0x89ed74;};'use strict';var multer=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var path=require(_0xe0b6('0x2'));var timeout=require(_0xe0b6('0x3'));var express=require(_0xe0b6('0x4'));var router=express[_0xe0b6('0x5')]();var fs_extra=require(_0xe0b6('0x6'));var auth=require(_0xe0b6('0x7'));var interaction=require(_0xe0b6('0x8'));var config=require('../../config/environment');var controller=require(_0xe0b6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe0b6('0xa')]);router['get']('/:id',auth[_0xe0b6('0xb')](),controller[_0xe0b6('0xc')]);router['get']('/:id/preview',auth[_0xe0b6('0xb')](),controller[_0xe0b6('0xd')]);router[_0xe0b6('0xe')](_0xe0b6('0xf'),auth['isAuthenticated'](),controller[_0xe0b6('0x10')]);router['get'](_0xe0b6('0x11'),auth[_0xe0b6('0xb')](),controller['query']);router['post']('/',auth[_0xe0b6('0xb')](),controller[_0xe0b6('0x12')]);router['put'](_0xe0b6('0x13'),auth['isAuthenticated'](),controller[_0xe0b6('0x14')]);router[_0xe0b6('0x15')](_0xe0b6('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xe0b6('0x16')]=router;
\ No newline at end of file
+var _0x07e5=['/:id/run','run','/:id/query','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview'];(function(_0x4ad46d,_0xcd05ed){var _0x5dc091=function(_0x3e6ebf){while(--_0x3e6ebf){_0x4ad46d['push'](_0x4ad46d['shift']());}};_0x5dc091(++_0xcd05ed);}(_0x07e5,0x133));var _0x507e=function(_0x51107b,_0x1db2ba){_0x51107b=_0x51107b-0x0;var _0x141a58=_0x07e5[_0x51107b];return _0x141a58;};'use strict';var multer=require(_0x507e('0x0'));var util=require(_0x507e('0x1'));var path=require(_0x507e('0x2'));var timeout=require(_0x507e('0x3'));var express=require('express');var router=express[_0x507e('0x4')]();var fs_extra=require(_0x507e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x507e('0x6'));router[_0x507e('0x7')]('/',auth[_0x507e('0x8')](),controller[_0x507e('0x9')]);router[_0x507e('0x7')](_0x507e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x507e('0x7')](_0x507e('0xb'),auth['isAuthenticated'](),controller[_0x507e('0xc')]);router[_0x507e('0x7')](_0x507e('0xd'),auth['isAuthenticated'](),controller[_0x507e('0xe')]);router['get'](_0x507e('0xf'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x507e('0x8')](),controller[_0x507e('0x10')]);router[_0x507e('0x11')](_0x507e('0xa'),auth[_0x507e('0x8')](),controller['update']);router[_0x507e('0x12')](_0x507e('0xa'),auth[_0x507e('0x8')](),controller[_0x507e('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 7b70aed..923f9f8 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 _0x76c6=['manual','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','Loading','scheduled'];(function(_0xc63188,_0xd51f21){var _0x5990b0=function(_0x1dc48d){while(--_0x1dc48d){_0xc63188['push'](_0xc63188['shift']());}};_0x5990b0(++_0xd51f21);}(_0x76c6,0x18d));var _0x676c=function(_0x256530,_0x5bed82){_0x256530=_0x256530-0x0;var _0x5865f3=_0x76c6[_0x256530];return _0x5865f3;};'use strict';var Sequelize=require(_0x676c('0x0'));var moment=require(_0x676c('0x1'));module[_0x676c('0x2')]={'name':{'type':Sequelize[_0x676c('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x676c('0x4')](_0x676c('0x5'),'pdf',_0x676c('0x6')),'allowNull':![],'defaultValue':_0x676c('0x5')},'savename':{'type':Sequelize[_0x676c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x676c('0x7')]},'endDate':{'type':Sequelize[_0x676c('0x7')]},'status':{'type':Sequelize[_0x676c('0x3')],'defaultValue':_0x676c('0x8')},'type':{'type':Sequelize[_0x676c('0x4')]('manual',_0x676c('0x9')),'allowNull':![],'defaultValue':_0x676c('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x676c('0x3')]}};
\ No newline at end of file
+var _0x83dd=['INTEGER','sequelize','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled'];(function(_0x46d58d,_0x131a3e){var _0x2d3ccf=function(_0x49c550){while(--_0x49c550){_0x46d58d['push'](_0x46d58d['shift']());}};_0x2d3ccf(++_0x131a3e);}(_0x83dd,0xb5));var _0xd83d=function(_0x5c46a9,_0x2548c7){_0x5c46a9=_0x5c46a9-0x0;var _0x250852=_0x83dd[_0x5c46a9];return _0x250852;};'use strict';var Sequelize=require(_0xd83d('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xd83d('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd83d('0x2')](_0xd83d('0x3'),_0xd83d('0x4'),_0xd83d('0x5')),'allowNull':![],'defaultValue':_0xd83d('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xd83d('0x6')]},'status':{'type':Sequelize[_0xd83d('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0xd83d('0x7'),_0xd83d('0x8')),'allowNull':![],'defaultValue':_0xd83d('0x7')},'reportId':{'type':Sequelize[_0xd83d('0x9')](0xb)['UNSIGNED']},'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 8e54669..e2f892b 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 _0x0887=['../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','update','destroy','get','ExtractedReports','UserProfileResource','then','error','name','send','AnalyticExtractedReport','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x12de48,_0x4913c7){var _0x2201ca=function(_0x278bd2){while(--_0x278bd2){_0x12de48['push'](_0x12de48['shift']());}};_0x2201ca(++_0x4913c7);}(_0x0887,0x1c1));var _0x7088=function(_0x511b17,_0xe6b453){_0x511b17=_0x511b17-0x0;var _0x4fa333=_0x0887[_0x511b17];return _0x4fa333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7088('0x0'));var zipdir=require(_0x7088('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7088('0x2'));var moment=require('moment');var BPromise=require(_0x7088('0x3'));var Mustache=require('mustache');var util=require(_0x7088('0x4'));var path=require(_0x7088('0x5'));var sox=require(_0x7088('0x6'));var csv=require(_0x7088('0x7'));var ejs=require(_0x7088('0x8'));var fs=require('fs');var fs_extra=require(_0x7088('0x9'));var _=require('lodash');var squel=require(_0x7088('0xa'));var crypto=require(_0x7088('0xb'));var jsforce=require(_0x7088('0xc'));var deskjs=require(_0x7088('0xd'));var toCsv=require(_0x7088('0x7'));var querystring=require(_0x7088('0xe'));var Papa=require(_0x7088('0xf'));var Redis=require('ioredis');var authService=require(_0x7088('0x10'));var qs=require(_0x7088('0x11'));var as=require(_0x7088('0x12'));var hardwareService=require(_0x7088('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7088('0x14'));var config=require(_0x7088('0x15'));var licenseUtil=require(_0x7088('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4132cb,_0x58ac71){_0x58ac71=_0x58ac71||0xcc;return function(_0x3c600a){if(_0x3c600a){return _0x4132cb[_0x7088('0x17')](_0x58ac71);}return _0x4132cb[_0x7088('0x18')](_0x58ac71)[_0x7088('0x19')]();};}function respondWithResult(_0x3a6137,_0x291819){_0x291819=_0x291819||0xc8;return function(_0x1949ba){if(_0x1949ba){return _0x3a6137[_0x7088('0x18')](_0x291819)[_0x7088('0x1a')](_0x1949ba);}};}function respondWithFilteredResult(_0x1a624d,_0x1cec73){return function(_0x5a385d){if(_0x5a385d){var _0x50592a=typeof _0x1cec73['offset']===_0x7088('0x1b')&&typeof _0x1cec73[_0x7088('0x1c')]==='undefined';var _0x1aaaba=_0x5a385d['count'];var _0x1f9d6b=_0x50592a?0x0:_0x1cec73[_0x7088('0x1d')];var _0x299a78=_0x50592a?_0x5a385d[_0x7088('0x1e')]:_0x1cec73['offset']+_0x1cec73['limit'];var _0x873a18;if(_0x299a78>=_0x1aaaba){_0x299a78=_0x1aaaba;_0x873a18=0xc8;}else{_0x873a18=0xce;}_0x1a624d['status'](_0x873a18);return _0x1a624d['set']('Content-Range',_0x1f9d6b+'-'+_0x299a78+'/'+_0x1aaaba)['json'](_0x5a385d);}return null;};}function patchUpdates(_0xcda5a7){return function(_0x2c3d3f){try{jsonpatch[_0x7088('0x1f')](_0x2c3d3f,_0xcda5a7,!![]);}catch(_0x9da8eb){return BPromise[_0x7088('0x20')](_0x9da8eb);}return _0x2c3d3f['save']();};}function saveUpdates(_0x1d2d1d,_0x6a860f){return function(_0x443b8d){if(_0x443b8d){return _0x443b8d[_0x7088('0x21')](_0x1d2d1d)['then'](function(_0xd3f7cb){return _0xd3f7cb;});}return null;};}function removeEntity(_0x4116e4,_0x5360c3){return function(_0xab9951){if(_0xab9951){return _0xab9951[_0x7088('0x22')]()['then'](function(){var _0x9a23e7=_0xab9951[_0x7088('0x23')]({'plain':!![]});var _0x17e9be=_0x7088('0x24');return db[_0x7088('0x25')][_0x7088('0x22')]({'where':{'type':_0x17e9be,'resourceId':_0x9a23e7['id']}})[_0x7088('0x26')](function(){return _0xab9951;});})[_0x7088('0x26')](function(){_0x4116e4[_0x7088('0x18')](0xcc)[_0x7088('0x19')]();});}};}function handleEntityNotFound(_0xd8aa99,_0x5dadb8){return function(_0x11ecbb){if(!_0x11ecbb){_0xd8aa99[_0x7088('0x17')](0x194);}return _0x11ecbb;};}function handleError(_0x5d1fab,_0x3b65dd){_0x3b65dd=_0x3b65dd||0x1f4;return function(_0x114109){logger[_0x7088('0x27')](_0x114109['stack']);if(_0x114109[_0x7088('0x28')]){delete _0x114109[_0x7088('0x28')];}_0x5d1fab[_0x7088('0x18')](_0x3b65dd)[_0x7088('0x29')](_0x114109);};}exports['index']=function(_0x4f8702,_0x5d32dd){var _0x1d33cf={},_0x30f23b={},_0x5d8bd3={'count':0x0,'rows':[]};var _0x346792=_['map'](db[_0x7088('0x2a')]['rawAttributes'],function(_0x17afdc){return{'name':_0x17afdc[_0x7088('0x2b')],'type':_0x17afdc[_0x7088('0x2c')][_0x7088('0x2d')]};});_0x30f23b[_0x7088('0x2e')]=_[_0x7088('0x2f')](_0x346792,_0x7088('0x28'));_0x30f23b['query']=_[_0x7088('0x30')](_0x4f8702[_0x7088('0x31')]);_0x30f23b['filters']=_['intersection'](_0x30f23b[_0x7088('0x2e')],_0x30f23b[_0x7088('0x31')]);_0x1d33cf[_0x7088('0x32')]=_[_0x7088('0x33')](_0x30f23b['model'],qs[_0x7088('0x34')](_0x4f8702[_0x7088('0x31')][_0x7088('0x34')]));_0x1d33cf[_0x7088('0x32')]=_0x1d33cf[_0x7088('0x32')][_0x7088('0x35')]?_0x1d33cf[_0x7088('0x32')]:_0x30f23b[_0x7088('0x2e')];if(!_0x4f8702[_0x7088('0x31')][_0x7088('0x36')](_0x7088('0x37'))){_0x1d33cf[_0x7088('0x1c')]=qs[_0x7088('0x1c')](_0x4f8702[_0x7088('0x31')]['limit']);_0x1d33cf[_0x7088('0x1d')]=qs[_0x7088('0x1d')](_0x4f8702[_0x7088('0x31')][_0x7088('0x1d')]);}_0x1d33cf[_0x7088('0x38')]=qs[_0x7088('0x39')](_0x4f8702[_0x7088('0x31')]['sort']);_0x1d33cf[_0x7088('0x3a')]=qs[_0x7088('0x3b')](_['pick'](_0x4f8702['query'],_0x30f23b[_0x7088('0x3b')]),_0x346792);if(_0x4f8702[_0x7088('0x31')]['filter']){_0x1d33cf[_0x7088('0x3a')]=_[_0x7088('0x3c')](_0x1d33cf[_0x7088('0x3a')],{'$or':_[_0x7088('0x2f')](_0x346792,function(_0x42da3b){if(_0x42da3b[_0x7088('0x2c')]!=='VIRTUAL'){var _0x231c9c={};_0x231c9c[_0x42da3b[_0x7088('0x28')]]={'$like':'%'+_0x4f8702[_0x7088('0x31')][_0x7088('0x3d')]+'%'};return _0x231c9c;}})});}_0x1d33cf=_['merge']({},_0x1d33cf,_0x4f8702[_0x7088('0x3e')]);var _0x27c499={'where':_0x1d33cf['where']};return db[_0x7088('0x2a')][_0x7088('0x1e')](_0x27c499)[_0x7088('0x26')](function(_0x4f6504){_0x5d8bd3[_0x7088('0x1e')]=_0x4f6504;if(_0x4f8702[_0x7088('0x31')][_0x7088('0x3f')]){_0x1d33cf['include']=[{'all':!![]}];}return db[_0x7088('0x2a')][_0x7088('0x40')](_0x1d33cf);})[_0x7088('0x26')](function(_0x3a5ddd){_0x5d8bd3[_0x7088('0x41')]=_0x3a5ddd;return _0x5d8bd3;})[_0x7088('0x26')](respondWithFilteredResult(_0x5d32dd,_0x1d33cf))[_0x7088('0x42')](handleError(_0x5d32dd,null));};exports[_0x7088('0x43')]=function(_0x18af69,_0x3e43cc){var _0x48bda3={'raw':!![],'where':{'id':_0x18af69[_0x7088('0x44')]['id']}},_0x39a9d7={};_0x39a9d7['model']=_[_0x7088('0x30')](db['AnalyticExtractedReport']['rawAttributes']);_0x39a9d7['query']=_[_0x7088('0x30')](_0x18af69[_0x7088('0x31')]);_0x39a9d7[_0x7088('0x3b')]=_['intersection'](_0x39a9d7[_0x7088('0x2e')],_0x39a9d7[_0x7088('0x31')]);_0x48bda3['attributes']=_[_0x7088('0x33')](_0x39a9d7[_0x7088('0x2e')],qs[_0x7088('0x34')](_0x18af69[_0x7088('0x31')][_0x7088('0x34')]));_0x48bda3[_0x7088('0x32')]=_0x48bda3[_0x7088('0x32')][_0x7088('0x35')]?_0x48bda3['attributes']:_0x39a9d7[_0x7088('0x2e')];if(_0x18af69[_0x7088('0x31')][_0x7088('0x3f')]){_0x48bda3[_0x7088('0x45')]=[{'all':!![]}];}_0x48bda3=_[_0x7088('0x3c')]({},_0x48bda3,_0x18af69[_0x7088('0x3e')]);return db['AnalyticExtractedReport']['find'](_0x48bda3)[_0x7088('0x26')](handleEntityNotFound(_0x3e43cc,null))[_0x7088('0x26')](respondWithResult(_0x3e43cc,null))['catch'](handleError(_0x3e43cc,null));};exports[_0x7088('0x46')]=function(_0x4f8b77,_0xe7094f){return db[_0x7088('0x2a')]['create'](_0x4f8b77[_0x7088('0x47')],{})[_0x7088('0x26')](function(_0x296c3b){var _0x3bd31f=_0x4f8b77[_0x7088('0x48')][_0x7088('0x23')]({'plain':!![]});if(!_0x3bd31f)throw new Error(_0x7088('0x49'));if(_0x3bd31f[_0x7088('0x4a')]==='user'){var _0x5c5318=_0x296c3b[_0x7088('0x23')]({'plain':!![]});var _0x146757='ExtractedReports';return db[_0x7088('0x4b')][_0x7088('0x4c')]({'where':{'name':_0x146757,'userProfileId':_0x3bd31f[_0x7088('0x4d')]},'raw':!![]})[_0x7088('0x26')](function(_0x55f453){if(_0x55f453&&_0x55f453['autoAssociation']===0x0){return db[_0x7088('0x25')]['create']({'name':_0x5c5318['name'],'resourceId':_0x5c5318['id'],'type':_0x55f453[_0x7088('0x28')],'sectionId':_0x55f453['id']},{})['then'](function(){return _0x296c3b;});}else{return _0x296c3b;}})[_0x7088('0x42')](function(_0x16643b){logger['error'](_0x7088('0x4e'),_0x16643b);throw _0x16643b;});}return _0x296c3b;})[_0x7088('0x26')](respondWithResult(_0xe7094f,0xc9))[_0x7088('0x42')](handleError(_0xe7094f,null));};exports[_0x7088('0x21')]=function(_0x1b7fd5,_0xe1bec9){if(_0x1b7fd5['body']['id']){delete _0x1b7fd5[_0x7088('0x47')]['id'];}return db[_0x7088('0x2a')][_0x7088('0x4c')]({'where':{'id':_0x1b7fd5['params']['id']}})[_0x7088('0x26')](handleEntityNotFound(_0xe1bec9,null))[_0x7088('0x26')](saveUpdates(_0x1b7fd5[_0x7088('0x47')],null))[_0x7088('0x26')](respondWithResult(_0xe1bec9,null))[_0x7088('0x42')](handleError(_0xe1bec9,null));};exports[_0x7088('0x22')]=function(_0xaea270,_0x1164c6){return db[_0x7088('0x2a')][_0x7088('0x4c')]({'where':{'id':_0xaea270[_0x7088('0x44')]['id']}})['then'](handleEntityNotFound(_0x1164c6,null))['then'](removeEntity(_0x1164c6,null))[_0x7088('0x42')](handleError(_0x1164c6,null));};exports[_0x7088('0x4f')]=function(_0x3bc0bf,_0x1ef473,_0x1d392e){return db[_0x7088('0x2a')][_0x7088('0x4c')]({'where':{'id':_0x3bc0bf[_0x7088('0x44')]['id']},'attributes':[_0x7088('0x28'),_0x7088('0x50'),'savename',_0x7088('0x51')],'raw':!![]})[_0x7088('0x26')](handleEntityNotFound(_0x1ef473,null))[_0x7088('0x26')](function(_0x4dd331){if(_0x4dd331){if(!fs[_0x7088('0x52')](path[_0x7088('0x53')](config[_0x7088('0x54')],_0x7088('0x55'),_0x4dd331[_0x7088('0x56')]))){throw new db[(_0x7088('0x57'))][(_0x7088('0x58'))](_0x7088('0x59'));}if(_0x3bc0bf['query'][_0x7088('0x5a')]){return _0x1ef473['sendStatus'](0xc8);}return _0x1ef473['download'](path[_0x7088('0x53')](config[_0x7088('0x54')],_0x7088('0x55'),_0x4dd331[_0x7088('0x56')]),util[_0x7088('0x5b')](_0x7088('0x5c'),_0x4dd331['basename']||_0x4dd331[_0x7088('0x28')],_0x4dd331[_0x7088('0x51')][_0x7088('0x5d')]()));}})[_0x7088('0x42')](handleError(_0x1ef473,null));};
\ No newline at end of file
+var _0xe56e=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','find','create','body','user','get','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation'];(function(_0x2cea8b,_0x530338){var _0x2a98cb=function(_0x5593e4){while(--_0x5593e4){_0x2cea8b['push'](_0x2cea8b['shift']());}};_0x2a98cb(++_0x530338);}(_0xe56e,0x13d));var _0xee56=function(_0x520dac,_0x82ab00){_0x520dac=_0x520dac-0x0;var _0x418fc9=_0xe56e[_0x520dac];return _0x418fc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee56('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee56('0x1'));var rp=require('request-promise');var moment=require(_0xee56('0x2'));var BPromise=require(_0xee56('0x3'));var Mustache=require(_0xee56('0x4'));var util=require(_0xee56('0x5'));var path=require(_0xee56('0x6'));var sox=require(_0xee56('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee56('0x8'));var _=require(_0xee56('0x9'));var squel=require(_0xee56('0xa'));var crypto=require(_0xee56('0xb'));var jsforce=require(_0xee56('0xc'));var deskjs=require(_0xee56('0xd'));var toCsv=require(_0xee56('0xe'));var querystring=require(_0xee56('0xf'));var Papa=require(_0xee56('0x10'));var Redis=require(_0xee56('0x11'));var authService=require(_0xee56('0x12'));var qs=require(_0xee56('0x13'));var as=require(_0xee56('0x14'));var hardwareService=require(_0xee56('0x15'));var logger=require('../../config/logger')(_0xee56('0x16'));var utils=require(_0xee56('0x17'));var config=require(_0xee56('0x18'));var licenseUtil=require(_0xee56('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x359edd,_0x4983ee){_0x4983ee=_0x4983ee||0xcc;return function(_0xdc7a8f){if(_0xdc7a8f){return _0x359edd[_0xee56('0x1a')](_0x4983ee);}return _0x359edd['status'](_0x4983ee)['end']();};}function respondWithResult(_0x2fa0d9,_0x46816c){_0x46816c=_0x46816c||0xc8;return function(_0x5348a6){if(_0x5348a6){return _0x2fa0d9['status'](_0x46816c)[_0xee56('0x1b')](_0x5348a6);}};}function respondWithFilteredResult(_0x14fa34,_0xdac875){return function(_0xdc69){if(_0xdc69){var _0x10d9c6=typeof _0xdac875[_0xee56('0x1c')]===_0xee56('0x1d')&&typeof _0xdac875[_0xee56('0x1e')]===_0xee56('0x1d');var _0x462f7b=_0xdc69[_0xee56('0x1f')];var _0x500fed=_0x10d9c6?0x0:_0xdac875[_0xee56('0x1c')];var _0x20df68=_0x10d9c6?_0xdc69[_0xee56('0x1f')]:_0xdac875[_0xee56('0x1c')]+_0xdac875['limit'];var _0x58b965;if(_0x20df68>=_0x462f7b){_0x20df68=_0x462f7b;_0x58b965=0xc8;}else{_0x58b965=0xce;}_0x14fa34[_0xee56('0x20')](_0x58b965);return _0x14fa34[_0xee56('0x21')](_0xee56('0x22'),_0x500fed+'-'+_0x20df68+'/'+_0x462f7b)['json'](_0xdc69);}return null;};}function patchUpdates(_0x25376d){return function(_0x261240){try{jsonpatch[_0xee56('0x23')](_0x261240,_0x25376d,!![]);}catch(_0x234f5f){return BPromise[_0xee56('0x24')](_0x234f5f);}return _0x261240[_0xee56('0x25')]();};}function saveUpdates(_0x21ff3a,_0x3c179a){return function(_0x4d3fa8){if(_0x4d3fa8){return _0x4d3fa8[_0xee56('0x26')](_0x21ff3a)['then'](function(_0x31ab64){return _0x31ab64;});}return null;};}function removeEntity(_0x51ac99,_0x5cd65c){return function(_0x54f58a){if(_0x54f58a){return _0x54f58a[_0xee56('0x27')]()[_0xee56('0x28')](function(){var _0x2dfb8e=_0x54f58a['get']({'plain':!![]});var _0x24ef2c='ExtractedReports';return db['UserProfileResource'][_0xee56('0x27')]({'where':{'type':_0x24ef2c,'resourceId':_0x2dfb8e['id']}})['then'](function(){return _0x54f58a;});})[_0xee56('0x28')](function(){_0x51ac99[_0xee56('0x20')](0xcc)[_0xee56('0x29')]();});}};}function handleEntityNotFound(_0x3974b3,_0x4edfb8){return function(_0x14d3e7){if(!_0x14d3e7){_0x3974b3[_0xee56('0x1a')](0x194);}return _0x14d3e7;};}function handleError(_0x328429,_0x52ec58){_0x52ec58=_0x52ec58||0x1f4;return function(_0x32a7bd){logger[_0xee56('0x2a')](_0x32a7bd[_0xee56('0x2b')]);if(_0x32a7bd['name']){delete _0x32a7bd[_0xee56('0x2c')];}_0x328429[_0xee56('0x20')](_0x52ec58)[_0xee56('0x2d')](_0x32a7bd);};}exports['index']=function(_0x5eea95,_0x48ce66){var _0x37249d={},_0x29ca7e={},_0x223413={'count':0x0,'rows':[]};var _0x2f6831=_['map'](db[_0xee56('0x2e')][_0xee56('0x2f')],function(_0x2550f4){return{'name':_0x2550f4[_0xee56('0x30')],'type':_0x2550f4[_0xee56('0x31')][_0xee56('0x32')]};});_0x29ca7e['model']=_[_0xee56('0x33')](_0x2f6831,_0xee56('0x2c'));_0x29ca7e['query']=_[_0xee56('0x34')](_0x5eea95[_0xee56('0x35')]);_0x29ca7e[_0xee56('0x36')]=_['intersection'](_0x29ca7e[_0xee56('0x37')],_0x29ca7e[_0xee56('0x35')]);_0x37249d[_0xee56('0x38')]=_[_0xee56('0x39')](_0x29ca7e[_0xee56('0x37')],qs[_0xee56('0x3a')](_0x5eea95['query'][_0xee56('0x3a')]));_0x37249d[_0xee56('0x38')]=_0x37249d[_0xee56('0x38')][_0xee56('0x3b')]?_0x37249d[_0xee56('0x38')]:_0x29ca7e[_0xee56('0x37')];if(!_0x5eea95[_0xee56('0x35')][_0xee56('0x3c')](_0xee56('0x3d'))){_0x37249d[_0xee56('0x1e')]=qs[_0xee56('0x1e')](_0x5eea95[_0xee56('0x35')][_0xee56('0x1e')]);_0x37249d[_0xee56('0x1c')]=qs[_0xee56('0x1c')](_0x5eea95['query'][_0xee56('0x1c')]);}_0x37249d['order']=qs[_0xee56('0x3e')](_0x5eea95[_0xee56('0x35')][_0xee56('0x3e')]);_0x37249d[_0xee56('0x3f')]=qs[_0xee56('0x36')](_['pick'](_0x5eea95[_0xee56('0x35')],_0x29ca7e[_0xee56('0x36')]),_0x2f6831);if(_0x5eea95[_0xee56('0x35')][_0xee56('0x40')]){_0x37249d['where']=_['merge'](_0x37249d[_0xee56('0x3f')],{'$or':_[_0xee56('0x33')](_0x2f6831,function(_0x4f82d9){if(_0x4f82d9[_0xee56('0x31')]!==_0xee56('0x41')){var _0x4fdf65={};_0x4fdf65[_0x4f82d9['name']]={'$like':'%'+_0x5eea95[_0xee56('0x35')][_0xee56('0x40')]+'%'};return _0x4fdf65;}})});}_0x37249d=_['merge']({},_0x37249d,_0x5eea95[_0xee56('0x42')]);var _0x122608={'where':_0x37249d[_0xee56('0x3f')]};return db[_0xee56('0x2e')][_0xee56('0x1f')](_0x122608)[_0xee56('0x28')](function(_0x4e5f5a){_0x223413['count']=_0x4e5f5a;if(_0x5eea95[_0xee56('0x35')][_0xee56('0x43')]){_0x37249d[_0xee56('0x44')]=[{'all':!![]}];}return db[_0xee56('0x2e')][_0xee56('0x45')](_0x37249d);})[_0xee56('0x28')](function(_0x2b85cc){_0x223413['rows']=_0x2b85cc;return _0x223413;})['then'](respondWithFilteredResult(_0x48ce66,_0x37249d))[_0xee56('0x46')](handleError(_0x48ce66,null));};exports['show']=function(_0x1909de,_0x22f361){var _0xd79901={'raw':!![],'where':{'id':_0x1909de[_0xee56('0x47')]['id']}},_0x6bf165={};_0x6bf165['model']=_[_0xee56('0x34')](db[_0xee56('0x2e')][_0xee56('0x2f')]);_0x6bf165['query']=_['keys'](_0x1909de[_0xee56('0x35')]);_0x6bf165[_0xee56('0x36')]=_[_0xee56('0x39')](_0x6bf165[_0xee56('0x37')],_0x6bf165[_0xee56('0x35')]);_0xd79901[_0xee56('0x38')]=_['intersection'](_0x6bf165[_0xee56('0x37')],qs[_0xee56('0x3a')](_0x1909de[_0xee56('0x35')]['fields']));_0xd79901[_0xee56('0x38')]=_0xd79901['attributes']['length']?_0xd79901[_0xee56('0x38')]:_0x6bf165[_0xee56('0x37')];if(_0x1909de[_0xee56('0x35')][_0xee56('0x43')]){_0xd79901[_0xee56('0x44')]=[{'all':!![]}];}_0xd79901=_[_0xee56('0x48')]({},_0xd79901,_0x1909de['options']);return db['AnalyticExtractedReport'][_0xee56('0x49')](_0xd79901)['then'](handleEntityNotFound(_0x22f361,null))[_0xee56('0x28')](respondWithResult(_0x22f361,null))[_0xee56('0x46')](handleError(_0x22f361,null));};exports['create']=function(_0x4170bf,_0x4c2855){return db[_0xee56('0x2e')][_0xee56('0x4a')](_0x4170bf[_0xee56('0x4b')],{})[_0xee56('0x28')](function(_0x2a57cd){var _0x1642dd=_0x4170bf[_0xee56('0x4c')][_0xee56('0x4d')]({'plain':!![]});if(!_0x1642dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1642dd[_0xee56('0x4e')]===_0xee56('0x4c')){var _0x4612f9=_0x2a57cd[_0xee56('0x4d')]({'plain':!![]});var _0x123837=_0xee56('0x4f');return db[_0xee56('0x50')][_0xee56('0x49')]({'where':{'name':_0x123837,'userProfileId':_0x1642dd[_0xee56('0x51')]},'raw':!![]})['then'](function(_0x545215){if(_0x545215&&_0x545215[_0xee56('0x52')]===0x0){return db[_0xee56('0x53')][_0xee56('0x4a')]({'name':_0x4612f9['name'],'resourceId':_0x4612f9['id'],'type':_0x545215[_0xee56('0x2c')],'sectionId':_0x545215['id']},{})[_0xee56('0x28')](function(){return _0x2a57cd;});}else{return _0x2a57cd;}})[_0xee56('0x46')](function(_0x478d32){logger[_0xee56('0x2a')](_0xee56('0x54'),_0x478d32);throw _0x478d32;});}return _0x2a57cd;})[_0xee56('0x28')](respondWithResult(_0x4c2855,0xc9))['catch'](handleError(_0x4c2855,null));};exports[_0xee56('0x26')]=function(_0x247e1d,_0x186981){if(_0x247e1d['body']['id']){delete _0x247e1d[_0xee56('0x4b')]['id'];}return db[_0xee56('0x2e')]['find']({'where':{'id':_0x247e1d[_0xee56('0x47')]['id']}})[_0xee56('0x28')](handleEntityNotFound(_0x186981,null))[_0xee56('0x28')](saveUpdates(_0x247e1d['body'],null))['then'](respondWithResult(_0x186981,null))[_0xee56('0x46')](handleError(_0x186981,null));};exports[_0xee56('0x27')]=function(_0x17f801,_0x1724d7){return db[_0xee56('0x2e')][_0xee56('0x49')]({'where':{'id':_0x17f801[_0xee56('0x47')]['id']}})[_0xee56('0x28')](handleEntityNotFound(_0x1724d7,null))[_0xee56('0x28')](removeEntity(_0x1724d7,null))[_0xee56('0x46')](handleError(_0x1724d7,null));};exports['download']=function(_0x15ee75,_0x4ed42d,_0x3d10cc){return db[_0xee56('0x2e')][_0xee56('0x49')]({'where':{'id':_0x15ee75['params']['id']},'attributes':[_0xee56('0x2c'),_0xee56('0x55'),_0xee56('0x56'),_0xee56('0x57')],'raw':!![]})[_0xee56('0x28')](handleEntityNotFound(_0x4ed42d,null))[_0xee56('0x28')](function(_0x3216ea){if(_0x3216ea){if(!fs[_0xee56('0x58')](path[_0xee56('0x59')](config[_0xee56('0x5a')],_0xee56('0x5b'),_0x3216ea['savename']))){throw new db[(_0xee56('0x5c'))][(_0xee56('0x5d'))](_0xee56('0x5e'));}if(_0x15ee75[_0xee56('0x35')][_0xee56('0x5f')]){return _0x4ed42d['sendStatus'](0xc8);}return _0x4ed42d[_0xee56('0x60')](path[_0xee56('0x59')](config['root'],_0xee56('0x5b'),_0x3216ea[_0xee56('0x56')]),util[_0xee56('0x61')](_0xee56('0x62'),_0x3216ea[_0xee56('0x55')]||_0x3216ea[_0xee56('0x2c')],_0x3216ea[_0xee56('0x57')][_0xee56('0x63')]()));}})[_0xee56('0x46')](handleError(_0x4ed42d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 13f423c..d8a4a06 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 _0x6597=['../../config/logger','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x17ed21,_0x101669){var _0x4c0a91=function(_0x5e2b4d){while(--_0x5e2b4d){_0x17ed21['push'](_0x17ed21['shift']());}};_0x4c0a91(++_0x101669);}(_0x6597,0x170));var _0x7659=function(_0x18897,_0x3be3f9){_0x18897=_0x18897-0x0;var _0x158a47=_0x6597[_0x18897];return _0x158a47;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var logger=require(_0x7659('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7659('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7659('0x4'));var config=require('../../config/environment');var attributes=require(_0x7659('0x5'));module[_0x7659('0x6')]=function(_0xe078d9,_0x17d582){return _0xe078d9[_0x7659('0x7')](_0x7659('0x8'),attributes,{'tableName':_0x7659('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8952=['./analyticExtractedReport.attributes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5e7a56,_0x5e9d15){var _0x968c99=function(_0x4e69e){while(--_0x4e69e){_0x5e7a56['push'](_0x5e7a56['shift']());}};_0x968c99(++_0x5e9d15);}(_0x8952,0xe2));var _0x2895=function(_0x1d6647,_0x19121a){_0x1d6647=_0x1d6647-0x0;var _0x5d3cd9=_0x8952[_0x1d6647];return _0x5d3cd9;};'use strict';var _=require(_0x2895('0x0'));var util=require(_0x2895('0x1'));var logger=require(_0x2895('0x2'))(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require(_0x2895('0x5'));var rp=require(_0x2895('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2895('0x7'));var config=require('../../config/environment');var attributes=require(_0x2895('0x8'));module['exports']=function(_0x33fa97,_0x5cdef5){return _0x33fa97['define']('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','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 5988734..e82f460 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 _0xdadf=['client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2cbc96,_0xe213d8){var _0x4bd542=function(_0x3a49c7){while(--_0x3a49c7){_0x2cbc96['push'](_0x2cbc96['shift']());}};_0x4bd542(++_0xe213d8);}(_0xdadf,0x175));var _0xfdad=function(_0x10cb06,_0x33a6c9){_0x10cb06=_0x10cb06-0x0;var _0x3e598=_0xdadf[_0x10cb06];return _0x3e598;};'use strict';var _=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var moment=require('moment');var BPromise=require(_0xfdad('0x2'));var rs=require(_0xfdad('0x3'));var fs=require('fs');var Redis=require(_0xfdad('0x4'));var db=require(_0xfdad('0x5'))['db'];var utils=require(_0xfdad('0x6'));var logger=require(_0xfdad('0x7'))(_0xfdad('0x8'));var config=require(_0xfdad('0x9'));var jayson=require(_0xfdad('0xa'));var client=jayson[_0xfdad('0xb')][_0xfdad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc9af68,_0x199da6,_0x3bb44e){return new BPromise(function(_0x7ccc23,_0x364d98){return client[_0xfdad('0xd')](_0xc9af68,_0x3bb44e)[_0xfdad('0xe')](function(_0x432263){logger[_0xfdad('0xf')](_0xfdad('0x10'),_0x199da6,_0xfdad('0x11'));logger[_0xfdad('0x12')](_0xfdad('0x13'),_0x199da6,_0xfdad('0x11'),JSON[_0xfdad('0x14')](_0x432263));if(_0x432263[_0xfdad('0x15')]){if(_0x432263[_0xfdad('0x15')][_0xfdad('0x16')]===0x1f4){logger[_0xfdad('0x15')](_0xfdad('0x10'),_0x199da6,_0x432263['error'][_0xfdad('0x17')]);return _0x364d98(_0x432263['error'][_0xfdad('0x17')]);}logger[_0xfdad('0x15')](_0xfdad('0x10'),_0x199da6,_0x432263[_0xfdad('0x15')][_0xfdad('0x17')]);return _0x7ccc23(_0x432263[_0xfdad('0x15')][_0xfdad('0x17')]);}else{logger[_0xfdad('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x199da6,_0xfdad('0x11'));_0x7ccc23(_0x432263['result']['message']);}})['catch'](function(_0x2842b8){logger[_0xfdad('0x15')](_0xfdad('0x10'),_0x199da6,_0x2842b8);_0x364d98(_0x2842b8);});});}
\ No newline at end of file
+var _0xfe73=['../../config/utils','../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x392a7d,_0x1bfe73){var _0x1a9de0=function(_0x507152){while(--_0x507152){_0x392a7d['push'](_0x392a7d['shift']());}};_0x1a9de0(++_0x1bfe73);}(_0xfe73,0x185));var _0x3fe7=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xfe73[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x3fe7('0x0'));var util=require(_0x3fe7('0x1'));var moment=require(_0x3fe7('0x2'));var BPromise=require(_0x3fe7('0x3'));var rs=require(_0x3fe7('0x4'));var fs=require('fs');var Redis=require(_0x3fe7('0x5'));var db=require(_0x3fe7('0x6'))['db'];var utils=require(_0x3fe7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3fe7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3fe7('0x9')][_0x3fe7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5643fb,_0x1a56f1,_0x5728c3){return new BPromise(function(_0x466c36,_0xccb96b){return client['request'](_0x5643fb,_0x5728c3)[_0x3fe7('0xb')](function(_0xf2182d){logger[_0x3fe7('0xc')](_0x3fe7('0xd'),_0x1a56f1,'request\x20sent');logger[_0x3fe7('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1a56f1,_0x3fe7('0xf'),JSON[_0x3fe7('0x10')](_0xf2182d));if(_0xf2182d[_0x3fe7('0x11')]){if(_0xf2182d[_0x3fe7('0x11')][_0x3fe7('0x12')]===0x1f4){logger[_0x3fe7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a56f1,_0xf2182d['error'][_0x3fe7('0x13')]);return _0xccb96b(_0xf2182d[_0x3fe7('0x11')][_0x3fe7('0x13')]);}logger[_0x3fe7('0x11')](_0x3fe7('0xd'),_0x1a56f1,_0xf2182d[_0x3fe7('0x11')]['message']);return _0x466c36(_0xf2182d[_0x3fe7('0x11')][_0x3fe7('0x13')]);}else{logger[_0x3fe7('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a56f1,_0x3fe7('0xf'));_0x466c36(_0xf2182d[_0x3fe7('0x14')][_0x3fe7('0x13')]);}})[_0x3fe7('0x15')](function(_0x295355){logger['error'](_0x3fe7('0xd'),_0x1a56f1,_0x295355);_0xccb96b(_0x295355);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c29fd17..40eff92 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 _0x1e85=['/:id/download','download','post','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','show'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x1e85,0x1aa));var _0x51e8=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0x1e85[_0x599c94];return _0x34e215;};'use strict';var multer=require(_0x51e8('0x0'));var util=require('util');var path=require(_0x51e8('0x1'));var timeout=require(_0x51e8('0x2'));var express=require(_0x51e8('0x3'));var router=express[_0x51e8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x51e8('0x5'));var interaction=require(_0x51e8('0x6'));var config=require('../../config/environment');var controller=require(_0x51e8('0x7'));router[_0x51e8('0x8')]('/',auth[_0x51e8('0x9')](),controller['index']);router[_0x51e8('0x8')]('/:id',auth[_0x51e8('0x9')](),controller[_0x51e8('0xa')]);router['get'](_0x51e8('0xb'),auth['isAuthenticated'](),controller[_0x51e8('0xc')]);router[_0x51e8('0xd')]('/',auth[_0x51e8('0x9')](),controller[_0x51e8('0xe')]);router[_0x51e8('0xf')](_0x51e8('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x51e8('0x10'),auth[_0x51e8('0x9')](),controller[_0x51e8('0x11')]);module[_0x51e8('0x12')]=router;
\ No newline at end of file
+var _0xdd3c=['put','/:id','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','show','/:id/download','download','post','isAuthenticated'];(function(_0x278280,_0x16f8ad){var _0x49d587=function(_0x4751c8){while(--_0x4751c8){_0x278280['push'](_0x278280['shift']());}};_0x49d587(++_0x16f8ad);}(_0xdd3c,0x1bb));var _0xcdd3=function(_0x273e73,_0x3b07e3){_0x273e73=_0x273e73-0x0;var _0x1d3a2e=_0xdd3c[_0x273e73];return _0x1d3a2e;};'use strict';var multer=require(_0xcdd3('0x0'));var util=require('util');var path=require(_0xcdd3('0x1'));var timeout=require(_0xcdd3('0x2'));var express=require(_0xcdd3('0x3'));var router=express[_0xcdd3('0x4')]();var fs_extra=require(_0xcdd3('0x5'));var auth=require(_0xcdd3('0x6'));var interaction=require(_0xcdd3('0x7'));var config=require(_0xcdd3('0x8'));var controller=require(_0xcdd3('0x9'));router[_0xcdd3('0xa')]('/',auth['isAuthenticated'](),controller[_0xcdd3('0xb')]);router[_0xcdd3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xcdd3('0xc')]);router[_0xcdd3('0xa')](_0xcdd3('0xd'),auth['isAuthenticated'](),controller[_0xcdd3('0xe')]);router[_0xcdd3('0xf')]('/',auth[_0xcdd3('0x10')](),controller['create']);router[_0xcdd3('0x11')](_0xcdd3('0x12'),auth[_0xcdd3('0x10')](),controller['update']);router['delete'](_0xcdd3('0x12'),auth[_0xcdd3('0x10')](),controller['destroy']);module[_0xcdd3('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 472d174..0e75e6a 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 _0xb914=['STRING','BOOLEAN','sequelize','exports'];(function(_0x48233d,_0x512075){var _0x12ed53=function(_0x2c5aca){while(--_0x2c5aca){_0x48233d['push'](_0x48233d['shift']());}};_0x12ed53(++_0x512075);}(_0xb914,0xf2));var _0x4b91=function(_0x221b75,_0xd8389f){_0x221b75=_0x221b75-0x0;var _0x1fd01e=_0xb914[_0x221b75];return _0x1fd01e;};'use strict';var Sequelize=require(_0x4b91('0x0'));module[_0x4b91('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x4b91('0x2')]},'format':{'type':Sequelize[_0x4b91('0x2')]},'groupBy':{'type':Sequelize[_0x4b91('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4b91('0x2')]},'custom':{'type':Sequelize[_0x4b91('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xefc7=['TEXT','STRING','BOOLEAN','exports'];(function(_0x27edbd,_0x9206ea){var _0x2f88a7=function(_0x15e465){while(--_0x15e465){_0x27edbd['push'](_0x27edbd['shift']());}};_0x2f88a7(++_0x9206ea);}(_0xefc7,0x1db));var _0x7efc=function(_0x3839be,_0x43296c){_0x3839be=_0x3839be-0x0;var _0x435631=_0xefc7[_0x3839be];return _0x435631;};'use strict';var Sequelize=require('sequelize');module[_0x7efc('0x0')]={'field':{'type':Sequelize[_0x7efc('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7efc('0x2')]},'groupBy':{'type':Sequelize[_0x7efc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7efc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index df793f8..a735382 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 _0x1b4e=['merge','options','AnalyticFieldReport','include','findAll','rows','catch','show','includeAll','find','create','body','bulkCreate','params','bulkDestroy','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x3057b6,_0x389d5b){var _0x3019f2=function(_0x4d0072){while(--_0x4d0072){_0x3057b6['push'](_0x3057b6['shift']());}};_0x3019f2(++_0x389d5b);}(_0x1b4e,0x158));var _0xe1b4=function(_0x50200b,_0x584e9e){_0x50200b=_0x50200b-0x0;var _0x468a05=_0x1b4e[_0x50200b];return _0x468a05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe1b4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1b4('0x1'));var moment=require(_0xe1b4('0x2'));var BPromise=require(_0xe1b4('0x3'));var Mustache=require(_0xe1b4('0x4'));var util=require(_0xe1b4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe1b4('0x6'));var ejs=require(_0xe1b4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1b4('0x8'));var squel=require(_0xe1b4('0x9'));var crypto=require(_0xe1b4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe1b4('0xb'));var toCsv=require(_0xe1b4('0x6'));var querystring=require(_0xe1b4('0xc'));var Papa=require('papaparse');var Redis=require(_0xe1b4('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe1b4('0xe'));var hardwareService=require(_0xe1b4('0xf'));var logger=require(_0xe1b4('0x10'))(_0xe1b4('0x11'));var utils=require(_0xe1b4('0x12'));var config=require(_0xe1b4('0x13'));var licenseUtil=require(_0xe1b4('0x14'));var db=require(_0xe1b4('0x15'))['db'];function respondWithStatusCode(_0xd5afa,_0x2b86b4){_0x2b86b4=_0x2b86b4||0xcc;return function(_0x5ed345){if(_0x5ed345){return _0xd5afa[_0xe1b4('0x16')](_0x2b86b4);}return _0xd5afa[_0xe1b4('0x17')](_0x2b86b4)['end']();};}function respondWithResult(_0x4a01f8,_0x2ca7c1){_0x2ca7c1=_0x2ca7c1||0xc8;return function(_0x43c9ab){if(_0x43c9ab){return _0x4a01f8[_0xe1b4('0x17')](_0x2ca7c1)[_0xe1b4('0x18')](_0x43c9ab);}};}function respondWithFilteredResult(_0x21c02b,_0x4b061b){return function(_0x271ede){if(_0x271ede){var _0x55e4d0=typeof _0x4b061b['offset']===_0xe1b4('0x19')&&typeof _0x4b061b[_0xe1b4('0x1a')]===_0xe1b4('0x19');var _0x2c72b2=_0x271ede[_0xe1b4('0x1b')];var _0xce0724=_0x55e4d0?0x0:_0x4b061b['offset'];var _0x282b33=_0x55e4d0?_0x271ede[_0xe1b4('0x1b')]:_0x4b061b[_0xe1b4('0x1c')]+_0x4b061b[_0xe1b4('0x1a')];var _0x5293e6;if(_0x282b33>=_0x2c72b2){_0x282b33=_0x2c72b2;_0x5293e6=0xc8;}else{_0x5293e6=0xce;}_0x21c02b[_0xe1b4('0x17')](_0x5293e6);return _0x21c02b[_0xe1b4('0x1d')]('Content-Range',_0xce0724+'-'+_0x282b33+'/'+_0x2c72b2)['json'](_0x271ede);}return null;};}function patchUpdates(_0x3fe027){return function(_0x1ee215){try{jsonpatch[_0xe1b4('0x1e')](_0x1ee215,_0x3fe027,!![]);}catch(_0x4ada5f){return BPromise[_0xe1b4('0x1f')](_0x4ada5f);}return _0x1ee215[_0xe1b4('0x20')]();};}function saveUpdates(_0x2b4209,_0x2870a1){return function(_0x552c4c){if(_0x552c4c){return _0x552c4c[_0xe1b4('0x21')](_0x2b4209)[_0xe1b4('0x22')](function(_0x1ae7af){return _0x1ae7af;});}return null;};}function removeEntity(_0xb4749b,_0x54c7ec){return function(_0x5d0ae7){if(_0x5d0ae7){return _0x5d0ae7[_0xe1b4('0x23')]()[_0xe1b4('0x22')](function(){_0xb4749b[_0xe1b4('0x17')](0xcc)[_0xe1b4('0x24')]();});}};}function handleEntityNotFound(_0x42c9f0,_0x1ae427){return function(_0x4ab3b8){if(!_0x4ab3b8){_0x42c9f0[_0xe1b4('0x16')](0x194);}return _0x4ab3b8;};}function handleError(_0x53ba43,_0xe53d0b){_0xe53d0b=_0xe53d0b||0x1f4;return function(_0x4fc8cb){logger[_0xe1b4('0x25')](_0x4fc8cb[_0xe1b4('0x26')]);if(_0x4fc8cb[_0xe1b4('0x27')]){delete _0x4fc8cb[_0xe1b4('0x27')];}_0x53ba43['status'](_0xe53d0b)[_0xe1b4('0x28')](_0x4fc8cb);};}exports[_0xe1b4('0x29')]=function(_0x16a849,_0x2b138d){var _0x20f61b={},_0x383494={},_0x1aa79c={'count':0x0,'rows':[]};var _0x35c4e1=_[_0xe1b4('0x2a')](db['AnalyticFieldReport'][_0xe1b4('0x2b')],function(_0x2a8023){return{'name':_0x2a8023['fieldName'],'type':_0x2a8023[_0xe1b4('0x2c')][_0xe1b4('0x2d')]};});_0x383494[_0xe1b4('0x2e')]=_[_0xe1b4('0x2a')](_0x35c4e1,_0xe1b4('0x27'));_0x383494[_0xe1b4('0x2f')]=_[_0xe1b4('0x30')](_0x16a849[_0xe1b4('0x2f')]);_0x383494['filters']=_[_0xe1b4('0x31')](_0x383494[_0xe1b4('0x2e')],_0x383494[_0xe1b4('0x2f')]);_0x20f61b[_0xe1b4('0x32')]=_['intersection'](_0x383494[_0xe1b4('0x2e')],qs[_0xe1b4('0x33')](_0x16a849['query'][_0xe1b4('0x33')]));_0x20f61b[_0xe1b4('0x32')]=_0x20f61b[_0xe1b4('0x32')][_0xe1b4('0x34')]?_0x20f61b[_0xe1b4('0x32')]:_0x383494[_0xe1b4('0x2e')];if(!_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x35')](_0xe1b4('0x36'))){_0x20f61b[_0xe1b4('0x1a')]=qs[_0xe1b4('0x1a')](_0x16a849[_0xe1b4('0x2f')]['limit']);_0x20f61b[_0xe1b4('0x1c')]=qs[_0xe1b4('0x1c')](_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x1c')]);}_0x20f61b[_0xe1b4('0x37')]=qs[_0xe1b4('0x38')](_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x38')]);_0x20f61b[_0xe1b4('0x39')]=qs['filters'](_[_0xe1b4('0x3a')](_0x16a849[_0xe1b4('0x2f')],_0x383494['filters']),_0x35c4e1);if(_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x3b')]){_0x20f61b[_0xe1b4('0x39')]=_['merge'](_0x20f61b[_0xe1b4('0x39')],{'$or':_['map'](_0x35c4e1,function(_0x95ca0d){if(_0x95ca0d[_0xe1b4('0x2c')]!==_0xe1b4('0x3c')){var _0x5d32c6={};_0x5d32c6[_0x95ca0d[_0xe1b4('0x27')]]={'$like':'%'+_0x16a849[_0xe1b4('0x2f')]['filter']+'%'};return _0x5d32c6;}})});}_0x20f61b=_[_0xe1b4('0x3d')]({},_0x20f61b,_0x16a849[_0xe1b4('0x3e')]);var _0x34b830={'where':_0x20f61b[_0xe1b4('0x39')]};return db[_0xe1b4('0x3f')][_0xe1b4('0x1b')](_0x34b830)[_0xe1b4('0x22')](function(_0x23a35d){_0x1aa79c[_0xe1b4('0x1b')]=_0x23a35d;if(_0x16a849[_0xe1b4('0x2f')]['includeAll']){_0x20f61b[_0xe1b4('0x40')]=[{'all':!![]}];}return db[_0xe1b4('0x3f')][_0xe1b4('0x41')](_0x20f61b);})[_0xe1b4('0x22')](function(_0x1fafb8){_0x1aa79c[_0xe1b4('0x42')]=_0x1fafb8;return _0x1aa79c;})[_0xe1b4('0x22')](respondWithFilteredResult(_0x2b138d,_0x20f61b))[_0xe1b4('0x43')](handleError(_0x2b138d,null));};exports[_0xe1b4('0x44')]=function(_0x3a3df8,_0x330f7f){var _0xd3da01={'raw':![],'where':{'id':_0x3a3df8['params']['id']}},_0x20288b={};_0x20288b[_0xe1b4('0x2e')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x20288b[_0xe1b4('0x2f')]=_['keys'](_0x3a3df8[_0xe1b4('0x2f')]);_0x20288b['filters']=_[_0xe1b4('0x31')](_0x20288b[_0xe1b4('0x2e')],_0x20288b[_0xe1b4('0x2f')]);_0xd3da01[_0xe1b4('0x32')]=_[_0xe1b4('0x31')](_0x20288b[_0xe1b4('0x2e')],qs[_0xe1b4('0x33')](_0x3a3df8['query'][_0xe1b4('0x33')]));_0xd3da01[_0xe1b4('0x32')]=_0xd3da01[_0xe1b4('0x32')]['length']?_0xd3da01['attributes']:_0x20288b['model'];if(_0x3a3df8[_0xe1b4('0x2f')][_0xe1b4('0x45')]){_0xd3da01['include']=[{'all':!![]}];}_0xd3da01=_[_0xe1b4('0x3d')]({},_0xd3da01,_0x3a3df8[_0xe1b4('0x3e')]);return db[_0xe1b4('0x3f')][_0xe1b4('0x46')](_0xd3da01)[_0xe1b4('0x22')](handleEntityNotFound(_0x330f7f,null))[_0xe1b4('0x22')](respondWithResult(_0x330f7f,null))['catch'](handleError(_0x330f7f,null));};exports[_0xe1b4('0x47')]=function(_0x3de057,_0x2ebed5){return db[_0xe1b4('0x3f')][_0xe1b4('0x47')](_0x3de057[_0xe1b4('0x48')],{})[_0xe1b4('0x22')](respondWithResult(_0x2ebed5,0xc9))[_0xe1b4('0x43')](handleError(_0x2ebed5,null));};exports[_0xe1b4('0x49')]=function(_0xbe0a06,_0x34ccc7){return db[_0xe1b4('0x3f')][_0xe1b4('0x49')](_0xbe0a06[_0xe1b4('0x48')],{'raw':![],'individualHooks':!![]})[_0xe1b4('0x22')](respondWithResult(_0x34ccc7,0xc9))[_0xe1b4('0x43')](handleError(_0x34ccc7,null));};exports['update']=function(_0x45eab2,_0x11446b){if(_0x45eab2[_0xe1b4('0x48')]['id']){delete _0x45eab2[_0xe1b4('0x48')]['id'];}return db[_0xe1b4('0x3f')][_0xe1b4('0x46')]({'where':{'id':_0x45eab2['params']['id']}})['then'](handleEntityNotFound(_0x11446b,null))[_0xe1b4('0x22')](saveUpdates(_0x45eab2[_0xe1b4('0x48')],null))[_0xe1b4('0x22')](respondWithResult(_0x11446b,null))['catch'](handleError(_0x11446b,null));};exports[_0xe1b4('0x23')]=function(_0x51a0ce,_0x3c1176){return db[_0xe1b4('0x3f')][_0xe1b4('0x46')]({'where':{'id':_0x51a0ce[_0xe1b4('0x4a')]['id']}})[_0xe1b4('0x22')](handleEntityNotFound(_0x3c1176,null))[_0xe1b4('0x22')](removeEntity(_0x3c1176,null))['catch'](handleError(_0x3c1176,null));};exports[_0xe1b4('0x4b')]=function(_0x4faa81,_0x65b56d){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4faa81[_0xe1b4('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xe1b4('0x22')](respondWithResult(_0x65b56d,0xcc))[_0xe1b4('0x43')](handleError(_0x65b56d,null));};exports['addFields']=function(_0x506eb5,_0x1363f2,_0x4e4da5){return db[_0xe1b4('0x4c')][_0xe1b4('0x4d')]({'where':{'id':_0x506eb5[_0xe1b4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1363f2,null))['then'](function(_0x2d64c3){if(_0x2d64c3){return db[_0xe1b4('0x4e')][_0xe1b4('0x4f')](function(_0x2daa55){return db[_0xe1b4('0x3f')][_0xe1b4('0x23')]({'where':{'CustomReportId':_0x506eb5[_0xe1b4('0x4a')]['id']},'transaction':_0x2daa55})['then'](function(_0x4abac3){var _0x12c959=_['map'](_0x506eb5[_0xe1b4('0x48')],function(_0x538839){delete _0x538839['id'];_0x538839[_0xe1b4('0x50')]=_0x506eb5[_0xe1b4('0x4a')]['id'];return _0x538839;});return db['AnalyticFieldReport'][_0xe1b4('0x49')](_0x12c959,{'transaction':_0x2daa55});});})[_0xe1b4('0x22')](function(){return db[_0xe1b4('0x3f')][_0xe1b4('0x41')]({'where':{'CustomReportId':_0x506eb5[_0xe1b4('0x4a')]['id']}});});}})[_0xe1b4('0x22')](respondWithResult(_0x1363f2,null))['catch'](handleError(_0x1363f2,null));};
\ No newline at end of file
+var _0x7513=['keys','intersection','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','query','filters','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','then','includeAll','findAll','rows','catch','params'];(function(_0x4d6387,_0x59f34b){var _0x4f9761=function(_0x498b5e){while(--_0x498b5e){_0x4d6387['push'](_0x4d6387['shift']());}};_0x4f9761(++_0x59f34b);}(_0x7513,0x101));var _0x3751=function(_0x24182f,_0x5b066b){_0x24182f=_0x24182f-0x0;var _0x479194=_0x7513[_0x24182f];return _0x479194;};'use strict';var emlformat=require(_0x3751('0x0'));var rimraf=require(_0x3751('0x1'));var zipdir=require(_0x3751('0x2'));var jsonpatch=require(_0x3751('0x3'));var rp=require(_0x3751('0x4'));var moment=require(_0x3751('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3751('0x6'));var util=require('util');var path=require(_0x3751('0x7'));var sox=require('sox');var csv=require(_0x3751('0x8'));var ejs=require(_0x3751('0x9'));var fs=require('fs');var fs_extra=require(_0x3751('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3751('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3751('0xc'));var toCsv=require(_0x3751('0x8'));var querystring=require('querystring');var Papa=require(_0x3751('0xd'));var Redis=require('ioredis');var authService=require(_0x3751('0xe'));var qs=require(_0x3751('0xf'));var as=require(_0x3751('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3751('0x11'))('api');var utils=require(_0x3751('0x12'));var config=require(_0x3751('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3751('0x14'))['db'];function respondWithStatusCode(_0x3f930e,_0x18f8df){_0x18f8df=_0x18f8df||0xcc;return function(_0x6cb632){if(_0x6cb632){return _0x3f930e[_0x3751('0x15')](_0x18f8df);}return _0x3f930e['status'](_0x18f8df)[_0x3751('0x16')]();};}function respondWithResult(_0x2c08ad,_0x1e18d6){_0x1e18d6=_0x1e18d6||0xc8;return function(_0x30f326){if(_0x30f326){return _0x2c08ad[_0x3751('0x17')](_0x1e18d6)[_0x3751('0x18')](_0x30f326);}};}function respondWithFilteredResult(_0x16e0d7,_0x4ecac2){return function(_0x1a0b7d){if(_0x1a0b7d){var _0x294623=typeof _0x4ecac2[_0x3751('0x19')]===_0x3751('0x1a')&&typeof _0x4ecac2[_0x3751('0x1b')]==='undefined';var _0x450482=_0x1a0b7d[_0x3751('0x1c')];var _0x2e14b3=_0x294623?0x0:_0x4ecac2[_0x3751('0x19')];var _0x13d803=_0x294623?_0x1a0b7d[_0x3751('0x1c')]:_0x4ecac2[_0x3751('0x19')]+_0x4ecac2['limit'];var _0x2a1deb;if(_0x13d803>=_0x450482){_0x13d803=_0x450482;_0x2a1deb=0xc8;}else{_0x2a1deb=0xce;}_0x16e0d7[_0x3751('0x17')](_0x2a1deb);return _0x16e0d7[_0x3751('0x1d')](_0x3751('0x1e'),_0x2e14b3+'-'+_0x13d803+'/'+_0x450482)[_0x3751('0x18')](_0x1a0b7d);}return null;};}function patchUpdates(_0xefd3d4){return function(_0x5ccb6f){try{jsonpatch[_0x3751('0x1f')](_0x5ccb6f,_0xefd3d4,!![]);}catch(_0x76e71){return BPromise[_0x3751('0x20')](_0x76e71);}return _0x5ccb6f['save']();};}function saveUpdates(_0x175dc1,_0x463514){return function(_0x465dd0){if(_0x465dd0){return _0x465dd0[_0x3751('0x21')](_0x175dc1)['then'](function(_0x2b964c){return _0x2b964c;});}return null;};}function removeEntity(_0x4411d6,_0x2bec5f){return function(_0x2815a5){if(_0x2815a5){return _0x2815a5[_0x3751('0x22')]()['then'](function(){_0x4411d6['status'](0xcc)[_0x3751('0x16')]();});}};}function handleEntityNotFound(_0x7c54a1,_0x294b29){return function(_0x3225fe){if(!_0x3225fe){_0x7c54a1[_0x3751('0x15')](0x194);}return _0x3225fe;};}function handleError(_0x100451,_0x181b90){_0x181b90=_0x181b90||0x1f4;return function(_0x38d2a9){logger[_0x3751('0x23')](_0x38d2a9[_0x3751('0x24')]);if(_0x38d2a9[_0x3751('0x25')]){delete _0x38d2a9[_0x3751('0x25')];}_0x100451[_0x3751('0x17')](_0x181b90)[_0x3751('0x26')](_0x38d2a9);};}exports[_0x3751('0x27')]=function(_0x39fe17,_0x374238){var _0x37ff8b={},_0x2fe930={},_0x1c1c3d={'count':0x0,'rows':[]};var _0x265674=_['map'](db[_0x3751('0x28')][_0x3751('0x29')],function(_0x5c5909){return{'name':_0x5c5909[_0x3751('0x2a')],'type':_0x5c5909[_0x3751('0x2b')]['key']};});_0x2fe930[_0x3751('0x2c')]=_[_0x3751('0x2d')](_0x265674,_0x3751('0x25'));_0x2fe930[_0x3751('0x2e')]=_['keys'](_0x39fe17[_0x3751('0x2e')]);_0x2fe930[_0x3751('0x2f')]=_['intersection'](_0x2fe930[_0x3751('0x2c')],_0x2fe930[_0x3751('0x2e')]);_0x37ff8b['attributes']=_['intersection'](_0x2fe930[_0x3751('0x2c')],qs[_0x3751('0x30')](_0x39fe17[_0x3751('0x2e')][_0x3751('0x30')]));_0x37ff8b['attributes']=_0x37ff8b['attributes'][_0x3751('0x31')]?_0x37ff8b[_0x3751('0x32')]:_0x2fe930[_0x3751('0x2c')];if(!_0x39fe17[_0x3751('0x2e')][_0x3751('0x33')](_0x3751('0x34'))){_0x37ff8b[_0x3751('0x1b')]=qs[_0x3751('0x1b')](_0x39fe17[_0x3751('0x2e')][_0x3751('0x1b')]);_0x37ff8b[_0x3751('0x19')]=qs[_0x3751('0x19')](_0x39fe17['query'][_0x3751('0x19')]);}_0x37ff8b[_0x3751('0x35')]=qs[_0x3751('0x36')](_0x39fe17[_0x3751('0x2e')][_0x3751('0x36')]);_0x37ff8b['where']=qs[_0x3751('0x2f')](_[_0x3751('0x37')](_0x39fe17[_0x3751('0x2e')],_0x2fe930[_0x3751('0x2f')]),_0x265674);if(_0x39fe17[_0x3751('0x2e')]['filter']){_0x37ff8b[_0x3751('0x38')]=_[_0x3751('0x39')](_0x37ff8b[_0x3751('0x38')],{'$or':_[_0x3751('0x2d')](_0x265674,function(_0x3bb7d1){if(_0x3bb7d1[_0x3751('0x2b')]!==_0x3751('0x3a')){var _0x11e934={};_0x11e934[_0x3bb7d1['name']]={'$like':'%'+_0x39fe17[_0x3751('0x2e')][_0x3751('0x3b')]+'%'};return _0x11e934;}})});}_0x37ff8b=_['merge']({},_0x37ff8b,_0x39fe17[_0x3751('0x3c')]);var _0x4aaa15={'where':_0x37ff8b[_0x3751('0x38')]};return db['AnalyticFieldReport'][_0x3751('0x1c')](_0x4aaa15)[_0x3751('0x3d')](function(_0x5addc4){_0x1c1c3d[_0x3751('0x1c')]=_0x5addc4;if(_0x39fe17[_0x3751('0x2e')][_0x3751('0x3e')]){_0x37ff8b['include']=[{'all':!![]}];}return db[_0x3751('0x28')][_0x3751('0x3f')](_0x37ff8b);})[_0x3751('0x3d')](function(_0x392062){_0x1c1c3d[_0x3751('0x40')]=_0x392062;return _0x1c1c3d;})[_0x3751('0x3d')](respondWithFilteredResult(_0x374238,_0x37ff8b))[_0x3751('0x41')](handleError(_0x374238,null));};exports['show']=function(_0x3e2a26,_0x1544c7){var _0x13854b={'raw':![],'where':{'id':_0x3e2a26[_0x3751('0x42')]['id']}},_0x5247a8={};_0x5247a8[_0x3751('0x2c')]=_[_0x3751('0x43')](db[_0x3751('0x28')][_0x3751('0x29')]);_0x5247a8['query']=_[_0x3751('0x43')](_0x3e2a26['query']);_0x5247a8[_0x3751('0x2f')]=_[_0x3751('0x44')](_0x5247a8[_0x3751('0x2c')],_0x5247a8[_0x3751('0x2e')]);_0x13854b[_0x3751('0x32')]=_[_0x3751('0x44')](_0x5247a8['model'],qs[_0x3751('0x30')](_0x3e2a26[_0x3751('0x2e')][_0x3751('0x30')]));_0x13854b[_0x3751('0x32')]=_0x13854b[_0x3751('0x32')]['length']?_0x13854b[_0x3751('0x32')]:_0x5247a8[_0x3751('0x2c')];if(_0x3e2a26[_0x3751('0x2e')][_0x3751('0x3e')]){_0x13854b['include']=[{'all':!![]}];}_0x13854b=_[_0x3751('0x39')]({},_0x13854b,_0x3e2a26[_0x3751('0x3c')]);return db[_0x3751('0x28')][_0x3751('0x45')](_0x13854b)['then'](handleEntityNotFound(_0x1544c7,null))[_0x3751('0x3d')](respondWithResult(_0x1544c7,null))[_0x3751('0x41')](handleError(_0x1544c7,null));};exports[_0x3751('0x46')]=function(_0x4eb0bd,_0x56370a){return db['AnalyticFieldReport']['create'](_0x4eb0bd[_0x3751('0x47')],{})[_0x3751('0x3d')](respondWithResult(_0x56370a,0xc9))[_0x3751('0x41')](handleError(_0x56370a,null));};exports[_0x3751('0x48')]=function(_0x1ba4bb,_0x570ada){return db[_0x3751('0x28')][_0x3751('0x48')](_0x1ba4bb[_0x3751('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x570ada,0xc9))[_0x3751('0x41')](handleError(_0x570ada,null));};exports['update']=function(_0x457cf6,_0x599796){if(_0x457cf6[_0x3751('0x47')]['id']){delete _0x457cf6['body']['id'];}return db[_0x3751('0x28')][_0x3751('0x45')]({'where':{'id':_0x457cf6[_0x3751('0x42')]['id']}})[_0x3751('0x3d')](handleEntityNotFound(_0x599796,null))[_0x3751('0x3d')](saveUpdates(_0x457cf6['body'],null))['then'](respondWithResult(_0x599796,null))['catch'](handleError(_0x599796,null));};exports[_0x3751('0x22')]=function(_0x5b0be5,_0x31aa28){return db[_0x3751('0x28')][_0x3751('0x45')]({'where':{'id':_0x5b0be5[_0x3751('0x42')]['id']}})[_0x3751('0x3d')](handleEntityNotFound(_0x31aa28,null))[_0x3751('0x3d')](removeEntity(_0x31aa28,null))[_0x3751('0x41')](handleError(_0x31aa28,null));};exports[_0x3751('0x49')]=function(_0x5575c1,_0x378fba){return db[_0x3751('0x28')]['destroy']({'where':{'id':_0x5575c1[_0x3751('0x2e')][_0x3751('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x378fba,0xcc))[_0x3751('0x41')](handleError(_0x378fba,null));};exports[_0x3751('0x4b')]=function(_0x37f714,_0x2ee2a7,_0x5b814d){return db[_0x3751('0x4c')][_0x3751('0x4d')]({'where':{'id':_0x37f714[_0x3751('0x42')]['id']}})[_0x3751('0x3d')](handleEntityNotFound(_0x2ee2a7,null))['then'](function(_0x22b829){if(_0x22b829){return db[_0x3751('0x4e')][_0x3751('0x4f')](function(_0x2da871){return db['AnalyticFieldReport'][_0x3751('0x22')]({'where':{'CustomReportId':_0x37f714[_0x3751('0x42')]['id']},'transaction':_0x2da871})[_0x3751('0x3d')](function(_0x534b25){var _0x1eefbb=_[_0x3751('0x2d')](_0x37f714[_0x3751('0x47')],function(_0x3995ec){delete _0x3995ec['id'];_0x3995ec[_0x3751('0x50')]=_0x37f714[_0x3751('0x42')]['id'];return _0x3995ec;});return db[_0x3751('0x28')][_0x3751('0x48')](_0x1eefbb,{'transaction':_0x2da871});});})[_0x3751('0x3d')](function(){return db[_0x3751('0x28')][_0x3751('0x3f')]({'where':{'CustomReportId':_0x37f714['params']['id']}});});}})[_0x3751('0x3d')](respondWithResult(_0x2ee2a7,null))['catch'](handleError(_0x2ee2a7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index a20b03e..f877be9 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 _0x3761=['moment','bluebird','request-promise','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','util','api'];(function(_0x59ed0e,_0x41a60f){var _0x9a8307=function(_0x1f4421){while(--_0x1f4421){_0x59ed0e['push'](_0x59ed0e['shift']());}};_0x9a8307(++_0x41a60f);}(_0x3761,0xed));var _0x1376=function(_0x1dc3ef,_0x440625){_0x1dc3ef=_0x1dc3ef-0x0;var _0xe54c21=_0x3761[_0x1dc3ef];return _0xe54c21;};'use strict';var _=require(_0x1376('0x0'));var util=require(_0x1376('0x1'));var logger=require('../../config/logger')(_0x1376('0x2'));var moment=require(_0x1376('0x3'));var BPromise=require(_0x1376('0x4'));var rp=require(_0x1376('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1376('0x6'));var config=require('../../config/environment');var attributes=require(_0x1376('0x7'));module[_0x1376('0x8')]=function(_0x504304,_0x55fe01){return _0x504304['define'](_0x1376('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3df0=['bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','../../config/logger','moment'];(function(_0x44030a,_0x581291){var _0x3139a3=function(_0x55b8bd){while(--_0x55b8bd){_0x44030a['push'](_0x44030a['shift']());}};_0x3139a3(++_0x581291);}(_0x3df0,0x16f));var _0x03df=function(_0x5d89fe,_0x38bd7f){_0x5d89fe=_0x5d89fe-0x0;var _0xcdff77=_0x3df0[_0x5d89fe];return _0xcdff77;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x03df('0x0'))('api');var moment=require(_0x03df('0x1'));var BPromise=require(_0x03df('0x2'));var rp=require(_0x03df('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x03df('0x4'));var attributes=require(_0x03df('0x5'));module[_0x03df('0x6')]=function(_0x44de9c,_0xd1c8e0){return _0x44de9c[_0x03df('0x7')](_0x03df('0x8'),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 9f3a2d8..3793c21 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 _0xaa27=['jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaa27,0x115));var _0x7aa2=function(_0x45b47b,_0x33dcc0){_0x45b47b=_0x45b47b-0x0;var _0x7530f1=_0xaa27[_0x45b47b];return _0x7530f1;};'use strict';var _=require(_0x7aa2('0x0'));var util=require(_0x7aa2('0x1'));var moment=require(_0x7aa2('0x2'));var BPromise=require(_0x7aa2('0x3'));var rs=require(_0x7aa2('0x4'));var fs=require('fs');var Redis=require(_0x7aa2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7aa2('0x6'));var logger=require(_0x7aa2('0x7'))('rpc');var config=require(_0x7aa2('0x8'));var jayson=require(_0x7aa2('0x9'));var client=jayson[_0x7aa2('0xa')][_0x7aa2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9c46b5,_0x561ced,_0x10dd48){return new BPromise(function(_0x44cc40,_0x4594a7){return client[_0x7aa2('0xc')](_0x9c46b5,_0x10dd48)[_0x7aa2('0xd')](function(_0x47a12b){logger[_0x7aa2('0xe')](_0x7aa2('0xf'),_0x561ced,_0x7aa2('0x10'));logger[_0x7aa2('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x561ced,_0x7aa2('0x10'),JSON[_0x7aa2('0x12')](_0x47a12b));if(_0x47a12b[_0x7aa2('0x13')]){if(_0x47a12b[_0x7aa2('0x13')]['code']===0x1f4){logger[_0x7aa2('0x13')](_0x7aa2('0xf'),_0x561ced,_0x47a12b[_0x7aa2('0x13')][_0x7aa2('0x14')]);return _0x4594a7(_0x47a12b['error'][_0x7aa2('0x14')]);}logger['error'](_0x7aa2('0xf'),_0x561ced,_0x47a12b[_0x7aa2('0x13')][_0x7aa2('0x14')]);return _0x44cc40(_0x47a12b['error'][_0x7aa2('0x14')]);}else{logger[_0x7aa2('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x561ced,'request\x20sent');_0x44cc40(_0x47a12b[_0x7aa2('0x15')][_0x7aa2('0x14')]);}})['catch'](function(_0x4ce299){logger[_0x7aa2('0x13')](_0x7aa2('0xf'),_0x561ced,_0x4ce299);_0x4594a7(_0x4ce299);});});}
\ No newline at end of file
+var _0xaa83=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0xaa83,0xf3));var _0x3aa8=function(_0x1b3fb0,_0x49325a){_0x1b3fb0=_0x1b3fb0-0x0;var _0x5eb66e=_0xaa83[_0x1b3fb0];return _0x5eb66e;};'use strict';var _=require(_0x3aa8('0x0'));var util=require(_0x3aa8('0x1'));var moment=require(_0x3aa8('0x2'));var BPromise=require(_0x3aa8('0x3'));var rs=require(_0x3aa8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3aa8('0x5'))['db'];var utils=require(_0x3aa8('0x6'));var logger=require('../../config/logger')(_0x3aa8('0x7'));var config=require(_0x3aa8('0x8'));var jayson=require(_0x3aa8('0x9'));var client=jayson[_0x3aa8('0xa')][_0x3aa8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x113559,_0x2b378b,_0x226ecf){return new BPromise(function(_0x4dc365,_0x583156){return client[_0x3aa8('0xc')](_0x113559,_0x226ecf)[_0x3aa8('0xd')](function(_0x5514bd){logger[_0x3aa8('0xe')](_0x3aa8('0xf'),_0x2b378b,_0x3aa8('0x10'));logger[_0x3aa8('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2b378b,_0x3aa8('0x10'),JSON[_0x3aa8('0x12')](_0x5514bd));if(_0x5514bd[_0x3aa8('0x13')]){if(_0x5514bd['error'][_0x3aa8('0x14')]===0x1f4){logger[_0x3aa8('0x13')](_0x3aa8('0xf'),_0x2b378b,_0x5514bd[_0x3aa8('0x13')][_0x3aa8('0x15')]);return _0x583156(_0x5514bd[_0x3aa8('0x13')][_0x3aa8('0x15')]);}logger[_0x3aa8('0x13')](_0x3aa8('0xf'),_0x2b378b,_0x5514bd['error'][_0x3aa8('0x15')]);return _0x4dc365(_0x5514bd[_0x3aa8('0x13')][_0x3aa8('0x15')]);}else{logger[_0x3aa8('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2b378b,_0x3aa8('0x10'));_0x4dc365(_0x5514bd[_0x3aa8('0x16')][_0x3aa8('0x15')]);}})[_0x3aa8('0x17')](function(_0x2d0563){logger[_0x3aa8('0x13')](_0x3aa8('0xf'),_0x2b378b,_0x2d0563);_0x583156(_0x2d0563);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index ea66d6b..b0e3925 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(_0x81031b,_0x1d3b77){var _0xe5ba4a=function(_0x182416){while(--_0x182416){_0x81031b['push'](_0x81031b['shift']());}};_0xe5ba4a(++_0x1d3b77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x36ccd0,_0x4d6767){var _0xf50b90=function(_0x363f5d){while(--_0x363f5d){_0x36ccd0['push'](_0x36ccd0['shift']());}};_0xf50b90(++_0x4d6767);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 b031f0a..954d809 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 _0x9af1=['sequelize','exports','STRING','TEXT'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x9af1,0x68));var _0x19af=function(_0x30056a,_0x4b6322){_0x30056a=_0x30056a-0x0;var _0x2f0799=_0x9af1[_0x30056a];return _0x2f0799;};'use strict';var Sequelize=require(_0x19af('0x0'));module[_0x19af('0x1')]={'name':{'type':Sequelize[_0x19af('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x19af('0x2')]},'metric':{'type':Sequelize[_0x19af('0x3')]},'description':{'type':Sequelize[_0x19af('0x2')]}};
\ No newline at end of file
+var _0x93ed=['STRING','name','sequelize','exports'];(function(_0x31906e,_0x3bcb9d){var _0xd7353=function(_0x4cfba4){while(--_0x4cfba4){_0x31906e['push'](_0x31906e['shift']());}};_0xd7353(++_0x3bcb9d);}(_0x93ed,0xfe));var _0xd93e=function(_0x1428a1,_0x342a4c){_0x1428a1=_0x1428a1-0x0;var _0x56cd58=_0x93ed[_0x1428a1];return _0x56cd58;};'use strict';var Sequelize=require(_0xd93e('0x0'));module[_0xd93e('0x1')]={'name':{'type':Sequelize[_0xd93e('0x2')],'allowNull':![],'unique':_0xd93e('0x3')},'table':{'type':Sequelize[_0xd93e('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xd93e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ca188e9..a91e87b 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 _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(_0x242f71,_0x37747b){var _0x2c5568=function(_0x14c26b){while(--_0x14c26b){_0x242f71['push'](_0x242f71['shift']());}};_0x2c5568(++_0x37747b);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x40193b,_0x101a6d){_0x40193b=_0x40193b-0x0;var _0x2d19d1=_0xd6d6[_0x40193b];return _0x2d19d1;};'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
+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(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x7da7,0x10d));var _0x77da=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x7da7[_0x38ced4];return _0x547c07;};'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
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index da1e626..772e50e 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 _0x158f=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x158f,0x137));var _0xf158=function(_0x2c022a,_0x1ea7ba){_0x2c022a=_0x2c022a-0x0;var _0x422073=_0x158f[_0x2c022a];return _0x422073;};'use strict';var _=require('lodash');var util=require(_0xf158('0x0'));var logger=require(_0xf158('0x1'))(_0xf158('0x2'));var moment=require(_0xf158('0x3'));var BPromise=require(_0xf158('0x4'));var rp=require(_0xf158('0x5'));var fs=require('fs');var path=require(_0xf158('0x6'));var rimraf=require('rimraf');var config=require(_0xf158('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xf158('0x8')]=function(_0xb84ee0,_0x178e85){return _0xb84ee0[_0xf158('0x9')](_0xf158('0xa'),attributes,{'tableName':_0xf158('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6075=['path','rimraf','../../config/environment','exports','analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x6075,0x191));var _0x5607=function(_0x28fc5b,_0x50a44c){_0x28fc5b=_0x28fc5b-0x0;var _0x1894c6=_0x6075[_0x28fc5b];return _0x1894c6;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var logger=require(_0x5607('0x1'))(_0x5607('0x2'));var moment=require(_0x5607('0x3'));var BPromise=require(_0x5607('0x4'));var rp=require(_0x5607('0x5'));var fs=require('fs');var path=require(_0x5607('0x6'));var rimraf=require(_0x5607('0x7'));var config=require(_0x5607('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x5607('0x9')]=function(_0xabf691,_0x14b9f4){return _0xabf691['define']('AnalyticMetric',attributes,{'tableName':_0x5607('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 5648fdc..4ee22c6 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 _0x8a99=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x8a99,0x1d8));var _0x98a9=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x8a99[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x98a9('0x0'));var util=require(_0x98a9('0x1'));var moment=require(_0x98a9('0x2'));var BPromise=require(_0x98a9('0x3'));var rs=require(_0x98a9('0x4'));var fs=require('fs');var Redis=require(_0x98a9('0x5'));var db=require(_0x98a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x98a9('0x7'))('rpc');var config=require(_0x98a9('0x8'));var jayson=require(_0x98a9('0x9'));var client=jayson['client'][_0x98a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110e08,_0x2beb61,_0x4871f1){return new BPromise(function(_0x4dc2be,_0x5e2119){return client['request'](_0x110e08,_0x4871f1)[_0x98a9('0xb')](function(_0x321e8f){logger['info'](_0x98a9('0xc'),_0x2beb61,_0x98a9('0xd'));logger[_0x98a9('0xe')](_0x98a9('0xf'),_0x2beb61,_0x98a9('0xd'),JSON[_0x98a9('0x10')](_0x321e8f));if(_0x321e8f[_0x98a9('0x11')]){if(_0x321e8f[_0x98a9('0x11')]['code']===0x1f4){logger[_0x98a9('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x2beb61,_0x321e8f[_0x98a9('0x11')][_0x98a9('0x12')]);return _0x5e2119(_0x321e8f[_0x98a9('0x11')][_0x98a9('0x12')]);}logger[_0x98a9('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x2beb61,_0x321e8f['error'][_0x98a9('0x12')]);return _0x4dc2be(_0x321e8f[_0x98a9('0x11')][_0x98a9('0x12')]);}else{logger[_0x98a9('0x13')](_0x98a9('0xc'),_0x2beb61,_0x98a9('0xd'));_0x4dc2be(_0x321e8f[_0x98a9('0x14')][_0x98a9('0x12')]);}})[_0x98a9('0x15')](function(_0x5616d4){logger[_0x98a9('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x2beb61,_0x5616d4);_0x5e2119(_0x5616d4);});});}
\ No newline at end of file
+var _0x3cee=['AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x3e1305,_0x4f0c6d){var _0x478ad7=function(_0x316365){while(--_0x316365){_0x3e1305['push'](_0x3e1305['shift']());}};_0x478ad7(++_0x4f0c6d);}(_0x3cee,0x1e8));var _0xe3ce=function(_0x5d7902,_0x322d12){_0x5d7902=_0x5d7902-0x0;var _0x261cda=_0x3cee[_0x5d7902];return _0x261cda;};'use strict';var _=require(_0xe3ce('0x0'));var util=require(_0xe3ce('0x1'));var moment=require(_0xe3ce('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe3ce('0x4'));var logger=require(_0xe3ce('0x5'))('rpc');var config=require(_0xe3ce('0x6'));var jayson=require(_0xe3ce('0x7'));var client=jayson['client'][_0xe3ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29e429,_0x490663,_0x239342){return new BPromise(function(_0x4c2e7d,_0x358078){return client[_0xe3ce('0x9')](_0x29e429,_0x239342)[_0xe3ce('0xa')](function(_0x3be359){logger[_0xe3ce('0xb')](_0xe3ce('0xc'),_0x490663,'request\x20sent');logger[_0xe3ce('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x490663,_0xe3ce('0xe'),JSON[_0xe3ce('0xf')](_0x3be359));if(_0x3be359[_0xe3ce('0x10')]){if(_0x3be359['error']['code']===0x1f4){logger[_0xe3ce('0x10')](_0xe3ce('0xc'),_0x490663,_0x3be359[_0xe3ce('0x10')][_0xe3ce('0x11')]);return _0x358078(_0x3be359[_0xe3ce('0x10')]['message']);}logger[_0xe3ce('0x10')](_0xe3ce('0xc'),_0x490663,_0x3be359[_0xe3ce('0x10')][_0xe3ce('0x11')]);return _0x4c2e7d(_0x3be359['error'][_0xe3ce('0x11')]);}else{logger['info'](_0xe3ce('0xc'),_0x490663,_0xe3ce('0xe'));_0x4c2e7d(_0x3be359[_0xe3ce('0x12')][_0xe3ce('0x11')]);}})[_0xe3ce('0x13')](function(_0x93ea58){logger[_0xe3ce('0x10')](_0xe3ce('0xc'),_0x490663,_0x93ea58);_0x358078(_0x93ea58);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 10789ca..86b0beb 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 _0x0619=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x31206e,_0x38ab39){var _0x5c171c=function(_0x82aa8e){while(--_0x82aa8e){_0x31206e['push'](_0x31206e['shift']());}};_0x5c171c(++_0x38ab39);}(_0x0619,0x90));var _0x9061=function(_0x17bfb2,_0x3cbd05){_0x17bfb2=_0x17bfb2-0x0;var _0x3829d3=_0x0619[_0x17bfb2];return _0x3829d3;};'use strict';var multer=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var path=require(_0x9061('0x2'));var timeout=require(_0x9061('0x3'));var express=require('express');var router=express[_0x9061('0x4')]();var fs_extra=require(_0x9061('0x5'));var auth=require(_0x9061('0x6'));var interaction=require(_0x9061('0x7'));var config=require(_0x9061('0x8'));var controller=require(_0x9061('0x9'));router[_0x9061('0xa')]('/',auth[_0x9061('0xb')](),controller[_0x9061('0xc')]);router[_0x9061('0xa')](_0x9061('0xd'),auth['isAuthenticated'](),controller[_0x9061('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9061('0xf')]);router[_0x9061('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9061('0x11')]);router[_0x9061('0x12')](_0x9061('0xd'),auth[_0x9061('0xb')](),controller[_0x9061('0x13')]);module[_0x9061('0x14')]=router;
\ No newline at end of file
+var _0xbbbd=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbbbd,0x86));var _0xdbbb=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xbbbd[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var path=require(_0xdbbb('0x2'));var timeout=require(_0xdbbb('0x3'));var express=require(_0xdbbb('0x4'));var router=express[_0xdbbb('0x5')]();var fs_extra=require(_0xdbbb('0x6'));var auth=require(_0xdbbb('0x7'));var interaction=require(_0xdbbb('0x8'));var config=require(_0xdbbb('0x9'));var controller=require(_0xdbbb('0xa'));router[_0xdbbb('0xb')]('/',auth['isAuthenticated'](),controller[_0xdbbb('0xc')]);router[_0xdbbb('0xb')](_0xdbbb('0xd'),auth[_0xdbbb('0xe')](),controller[_0xdbbb('0xf')]);router[_0xdbbb('0x10')]('/',auth[_0xdbbb('0xe')](),controller[_0xdbbb('0x11')]);router[_0xdbbb('0x12')](_0xdbbb('0xd'),auth['isAuthenticated'](),controller[_0xdbbb('0x13')]);router['delete'](_0xdbbb('0xd'),auth['isAuthenticated'](),controller[_0xdbbb('0x14')]);module[_0xdbbb('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 7305b71..cf49db9 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 _0x45ec=['exports','TEXT','sequelize'];(function(_0x59605c,_0x3efc27){var _0x40fb19=function(_0x2832d5){while(--_0x2832d5){_0x59605c['push'](_0x59605c['shift']());}};_0x40fb19(++_0x3efc27);}(_0x45ec,0x191));var _0xc45e=function(_0x59b498,_0x4c2a1e){_0x59b498=_0x59b498-0x0;var _0x391e6c=_0x45ec[_0x59b498];return _0x391e6c;};'use strict';var Sequelize=require(_0xc45e('0x0'));module[_0xc45e('0x1')]={'tree':{'type':Sequelize[_0xc45e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7fcd=['TEXT','sequelize'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7fcd,0x1cf));var _0xd7fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7fcd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7fc('0x0'));module['exports']={'tree':{'type':Sequelize[_0xd7fc('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 69654ba..a5253b6 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 _0xf924=['key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','show','params','merge','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type'];(function(_0x5cdbf5,_0x347499){var _0xe585e=function(_0x4bd265){while(--_0x4bd265){_0x5cdbf5['push'](_0x5cdbf5['shift']());}};_0xe585e(++_0x347499);}(_0xf924,0xa9));var _0x4f92=function(_0x3b0999,_0x3c9835){_0x3b0999=_0x3b0999-0x0;var _0x585226=_0xf924[_0x3b0999];return _0x585226;};'use strict';var emlformat=require(_0x4f92('0x0'));var rimraf=require(_0x4f92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f92('0x2'));var rp=require('request-promise');var moment=require(_0x4f92('0x3'));var BPromise=require(_0x4f92('0x4'));var Mustache=require('mustache');var util=require(_0x4f92('0x5'));var path=require(_0x4f92('0x6'));var sox=require('sox');var csv=require(_0x4f92('0x7'));var ejs=require(_0x4f92('0x8'));var fs=require('fs');var fs_extra=require(_0x4f92('0x9'));var _=require(_0x4f92('0xa'));var squel=require(_0x4f92('0xb'));var crypto=require('crypto');var jsforce=require(_0x4f92('0xc'));var deskjs=require(_0x4f92('0xd'));var toCsv=require(_0x4f92('0x7'));var querystring=require(_0x4f92('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4f92('0xf'));var hardwareService=require(_0x4f92('0x10'));var logger=require('../../config/logger')(_0x4f92('0x11'));var utils=require(_0x4f92('0x12'));var config=require(_0x4f92('0x13'));var licenseUtil=require(_0x4f92('0x14'));var db=require(_0x4f92('0x15'))['db'];function respondWithStatusCode(_0x8b6b02,_0x1c90b3){_0x1c90b3=_0x1c90b3||0xcc;return function(_0x4a5a6c){if(_0x4a5a6c){return _0x8b6b02['sendStatus'](_0x1c90b3);}return _0x8b6b02[_0x4f92('0x16')](_0x1c90b3)[_0x4f92('0x17')]();};}function respondWithResult(_0x57ed89,_0x4138bb){_0x4138bb=_0x4138bb||0xc8;return function(_0x5f0139){if(_0x5f0139){return _0x57ed89[_0x4f92('0x16')](_0x4138bb)[_0x4f92('0x18')](_0x5f0139);}};}function respondWithFilteredResult(_0x414304,_0x1fa7fa){return function(_0x249328){if(_0x249328){var _0x2f5309=typeof _0x1fa7fa['offset']==='undefined'&&typeof _0x1fa7fa['limit']==='undefined';var _0x127c72=_0x249328[_0x4f92('0x19')];var _0xa7e608=_0x2f5309?0x0:_0x1fa7fa[_0x4f92('0x1a')];var _0x74fb45=_0x2f5309?_0x249328[_0x4f92('0x19')]:_0x1fa7fa[_0x4f92('0x1a')]+_0x1fa7fa[_0x4f92('0x1b')];var _0x101174;if(_0x74fb45>=_0x127c72){_0x74fb45=_0x127c72;_0x101174=0xc8;}else{_0x101174=0xce;}_0x414304[_0x4f92('0x16')](_0x101174);return _0x414304[_0x4f92('0x1c')](_0x4f92('0x1d'),_0xa7e608+'-'+_0x74fb45+'/'+_0x127c72)[_0x4f92('0x18')](_0x249328);}return null;};}function patchUpdates(_0x495693){return function(_0x4ebf9c){try{jsonpatch[_0x4f92('0x1e')](_0x4ebf9c,_0x495693,!![]);}catch(_0x27c5e7){return BPromise[_0x4f92('0x1f')](_0x27c5e7);}return _0x4ebf9c[_0x4f92('0x20')]();};}function saveUpdates(_0x458b0e,_0x4de228){return function(_0x1f3a35){if(_0x1f3a35){return _0x1f3a35[_0x4f92('0x21')](_0x458b0e)[_0x4f92('0x22')](function(_0x4a4864){return _0x4a4864;});}return null;};}function removeEntity(_0x23c357,_0x504b20){return function(_0x792235){if(_0x792235){return _0x792235[_0x4f92('0x23')]()[_0x4f92('0x22')](function(){_0x23c357[_0x4f92('0x16')](0xcc)[_0x4f92('0x17')]();});}};}function handleEntityNotFound(_0x209946,_0x2e4838){return function(_0x1002c4){if(!_0x1002c4){_0x209946[_0x4f92('0x24')](0x194);}return _0x1002c4;};}function handleError(_0x19e1a9,_0x3eca38){_0x3eca38=_0x3eca38||0x1f4;return function(_0x50f51c){logger[_0x4f92('0x25')](_0x50f51c[_0x4f92('0x26')]);if(_0x50f51c[_0x4f92('0x27')]){delete _0x50f51c[_0x4f92('0x27')];}_0x19e1a9['status'](_0x3eca38)[_0x4f92('0x28')](_0x50f51c);};}exports['index']=function(_0x5db022,_0x4437a7){var _0x280fa8={},_0x1cd192={},_0x1f35fc={'count':0x0,'rows':[]};var _0x4b9b5c=_[_0x4f92('0x29')](db['AnalyticTreeReport'][_0x4f92('0x2a')],function(_0x851b7b){return{'name':_0x851b7b['fieldName'],'type':_0x851b7b[_0x4f92('0x2b')][_0x4f92('0x2c')]};});_0x1cd192[_0x4f92('0x2d')]=_['map'](_0x4b9b5c,'name');_0x1cd192['query']=_[_0x4f92('0x2e')](_0x5db022[_0x4f92('0x2f')]);_0x1cd192[_0x4f92('0x30')]=_[_0x4f92('0x31')](_0x1cd192[_0x4f92('0x2d')],_0x1cd192['query']);_0x280fa8[_0x4f92('0x32')]=_['intersection'](_0x1cd192[_0x4f92('0x2d')],qs[_0x4f92('0x33')](_0x5db022[_0x4f92('0x2f')]['fields']));_0x280fa8[_0x4f92('0x32')]=_0x280fa8[_0x4f92('0x32')][_0x4f92('0x34')]?_0x280fa8[_0x4f92('0x32')]:_0x1cd192['model'];if(!_0x5db022[_0x4f92('0x2f')]['hasOwnProperty'](_0x4f92('0x35'))){_0x280fa8['limit']=qs['limit'](_0x5db022[_0x4f92('0x2f')][_0x4f92('0x1b')]);_0x280fa8[_0x4f92('0x1a')]=qs['offset'](_0x5db022['query'][_0x4f92('0x1a')]);}_0x280fa8[_0x4f92('0x36')]=qs['sort'](_0x5db022['query']['sort']);_0x280fa8['where']=qs[_0x4f92('0x30')](_[_0x4f92('0x37')](_0x5db022[_0x4f92('0x2f')],_0x1cd192[_0x4f92('0x30')]),_0x4b9b5c);if(_0x5db022[_0x4f92('0x2f')][_0x4f92('0x38')]){_0x280fa8[_0x4f92('0x39')]=_['merge'](_0x280fa8['where'],{'$or':_[_0x4f92('0x29')](_0x4b9b5c,function(_0x32adbd){if(_0x32adbd[_0x4f92('0x2b')]!==_0x4f92('0x3a')){var _0x562c0d={};_0x562c0d[_0x32adbd[_0x4f92('0x27')]]={'$like':'%'+_0x5db022['query'][_0x4f92('0x38')]+'%'};return _0x562c0d;}})});}_0x280fa8=_['merge']({},_0x280fa8,_0x5db022[_0x4f92('0x3b')]);var _0x3658cd={'where':_0x280fa8[_0x4f92('0x39')]};return db[_0x4f92('0x3c')][_0x4f92('0x19')](_0x3658cd)[_0x4f92('0x22')](function(_0x5bde0e){_0x1f35fc[_0x4f92('0x19')]=_0x5bde0e;if(_0x5db022[_0x4f92('0x2f')][_0x4f92('0x3d')]){_0x280fa8[_0x4f92('0x3e')]=[{'all':!![]}];}return db[_0x4f92('0x3c')][_0x4f92('0x3f')](_0x280fa8);})['then'](function(_0x5f1401){_0x1f35fc['rows']=_0x5f1401;return _0x1f35fc;})[_0x4f92('0x22')](respondWithFilteredResult(_0x4437a7,_0x280fa8))[_0x4f92('0x40')](handleError(_0x4437a7,null));};exports[_0x4f92('0x41')]=function(_0x1876ba,_0x14acfa){var _0x570328={'raw':!![],'where':{'id':_0x1876ba[_0x4f92('0x42')]['id']}},_0x421964={};_0x421964[_0x4f92('0x2d')]=_[_0x4f92('0x2e')](db[_0x4f92('0x3c')]['rawAttributes']);_0x421964[_0x4f92('0x2f')]=_['keys'](_0x1876ba['query']);_0x421964[_0x4f92('0x30')]=_['intersection'](_0x421964[_0x4f92('0x2d')],_0x421964[_0x4f92('0x2f')]);_0x570328[_0x4f92('0x32')]=_[_0x4f92('0x31')](_0x421964[_0x4f92('0x2d')],qs[_0x4f92('0x33')](_0x1876ba[_0x4f92('0x2f')]['fields']));_0x570328[_0x4f92('0x32')]=_0x570328['attributes'][_0x4f92('0x34')]?_0x570328[_0x4f92('0x32')]:_0x421964[_0x4f92('0x2d')];if(_0x1876ba['query'][_0x4f92('0x3d')]){_0x570328[_0x4f92('0x3e')]=[{'all':!![]}];}_0x570328=_[_0x4f92('0x43')]({},_0x570328,_0x1876ba[_0x4f92('0x3b')]);return db[_0x4f92('0x3c')][_0x4f92('0x44')](_0x570328)[_0x4f92('0x22')](handleEntityNotFound(_0x14acfa,null))[_0x4f92('0x22')](respondWithResult(_0x14acfa,null))['catch'](handleError(_0x14acfa,null));};exports[_0x4f92('0x45')]=function(_0x3fe4cc,_0x104d7b){return db[_0x4f92('0x3c')][_0x4f92('0x45')](_0x3fe4cc['body'],{})[_0x4f92('0x22')](respondWithResult(_0x104d7b,0xc9))[_0x4f92('0x40')](handleError(_0x104d7b,null));};exports['update']=function(_0x3d2d2c,_0x639508){if(_0x3d2d2c['body']['id']){delete _0x3d2d2c[_0x4f92('0x46')]['id'];}return db[_0x4f92('0x3c')]['find']({'where':{'id':_0x3d2d2c[_0x4f92('0x42')]['id']}})[_0x4f92('0x22')](handleEntityNotFound(_0x639508,null))['then'](saveUpdates(_0x3d2d2c[_0x4f92('0x46')],null))[_0x4f92('0x22')](respondWithResult(_0x639508,null))[_0x4f92('0x40')](handleError(_0x639508,null));};exports[_0x4f92('0x23')]=function(_0x4b8c31,_0x2e883c){return db[_0x4f92('0x3c')][_0x4f92('0x44')]({'where':{'id':_0x4b8c31[_0x4f92('0x42')]['id']}})[_0x4f92('0x22')](handleEntityNotFound(_0x2e883c,null))[_0x4f92('0x22')](removeEntity(_0x2e883c,null))[_0x4f92('0x40')](handleError(_0x2e883c,null));};
\ No newline at end of file
+var _0xba43=['body','eml-format','rimraf','zip-dir','request-promise','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create'];(function(_0x4bd59b,_0x33dd08){var _0x40382b=function(_0x303c65){while(--_0x303c65){_0x4bd59b['push'](_0x4bd59b['shift']());}};_0x40382b(++_0x33dd08);}(_0xba43,0x91));var _0x3ba4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xba43[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x3ba4('0x0'));var rimraf=require(_0x3ba4('0x1'));var zipdir=require(_0x3ba4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ba4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3ba4('0x4'));var path=require('path');var sox=require(_0x3ba4('0x5'));var csv=require('to-csv');var ejs=require(_0x3ba4('0x6'));var fs=require('fs');var fs_extra=require(_0x3ba4('0x7'));var _=require(_0x3ba4('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ba4('0x9'));var deskjs=require(_0x3ba4('0xa'));var toCsv=require(_0x3ba4('0xb'));var querystring=require('querystring');var Papa=require(_0x3ba4('0xc'));var Redis=require(_0x3ba4('0xd'));var authService=require(_0x3ba4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3ba4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ba4('0x10'))(_0x3ba4('0x11'));var utils=require(_0x3ba4('0x12'));var config=require(_0x3ba4('0x13'));var licenseUtil=require(_0x3ba4('0x14'));var db=require(_0x3ba4('0x15'))['db'];function respondWithStatusCode(_0x4b02be,_0x1b9a46){_0x1b9a46=_0x1b9a46||0xcc;return function(_0x5b6351){if(_0x5b6351){return _0x4b02be[_0x3ba4('0x16')](_0x1b9a46);}return _0x4b02be[_0x3ba4('0x17')](_0x1b9a46)[_0x3ba4('0x18')]();};}function respondWithResult(_0x352ea0,_0x5d5f85){_0x5d5f85=_0x5d5f85||0xc8;return function(_0x46958f){if(_0x46958f){return _0x352ea0[_0x3ba4('0x17')](_0x5d5f85)[_0x3ba4('0x19')](_0x46958f);}};}function respondWithFilteredResult(_0x1fba1c,_0x2eb98a){return function(_0x537367){if(_0x537367){var _0x5bec86=typeof _0x2eb98a['offset']===_0x3ba4('0x1a')&&typeof _0x2eb98a[_0x3ba4('0x1b')]===_0x3ba4('0x1a');var _0x495be2=_0x537367[_0x3ba4('0x1c')];var _0x58bcdc=_0x5bec86?0x0:_0x2eb98a[_0x3ba4('0x1d')];var _0x3187bb=_0x5bec86?_0x537367[_0x3ba4('0x1c')]:_0x2eb98a['offset']+_0x2eb98a[_0x3ba4('0x1b')];var _0x359496;if(_0x3187bb>=_0x495be2){_0x3187bb=_0x495be2;_0x359496=0xc8;}else{_0x359496=0xce;}_0x1fba1c[_0x3ba4('0x17')](_0x359496);return _0x1fba1c[_0x3ba4('0x1e')](_0x3ba4('0x1f'),_0x58bcdc+'-'+_0x3187bb+'/'+_0x495be2)[_0x3ba4('0x19')](_0x537367);}return null;};}function patchUpdates(_0x521975){return function(_0x355aba){try{jsonpatch['apply'](_0x355aba,_0x521975,!![]);}catch(_0xdd1270){return BPromise[_0x3ba4('0x20')](_0xdd1270);}return _0x355aba[_0x3ba4('0x21')]();};}function saveUpdates(_0x4e7bbf,_0x36bf75){return function(_0x44c6e0){if(_0x44c6e0){return _0x44c6e0[_0x3ba4('0x22')](_0x4e7bbf)[_0x3ba4('0x23')](function(_0x3bb4f0){return _0x3bb4f0;});}return null;};}function removeEntity(_0x117480,_0x2c07a8){return function(_0x59cd85){if(_0x59cd85){return _0x59cd85[_0x3ba4('0x24')]()[_0x3ba4('0x23')](function(){_0x117480[_0x3ba4('0x17')](0xcc)[_0x3ba4('0x18')]();});}};}function handleEntityNotFound(_0x428388,_0x291ed2){return function(_0x208887){if(!_0x208887){_0x428388[_0x3ba4('0x16')](0x194);}return _0x208887;};}function handleError(_0x454f05,_0xd84db6){_0xd84db6=_0xd84db6||0x1f4;return function(_0x5c2a15){logger[_0x3ba4('0x25')](_0x5c2a15['stack']);if(_0x5c2a15[_0x3ba4('0x26')]){delete _0x5c2a15['name'];}_0x454f05[_0x3ba4('0x17')](_0xd84db6)[_0x3ba4('0x27')](_0x5c2a15);};}exports[_0x3ba4('0x28')]=function(_0xee5db6,_0x34fdff){var _0x4dbefa={},_0x16c5af={},_0x5033d8={'count':0x0,'rows':[]};var _0x1ed403=_[_0x3ba4('0x29')](db[_0x3ba4('0x2a')][_0x3ba4('0x2b')],function(_0x48c37f){return{'name':_0x48c37f[_0x3ba4('0x2c')],'type':_0x48c37f[_0x3ba4('0x2d')][_0x3ba4('0x2e')]};});_0x16c5af[_0x3ba4('0x2f')]=_[_0x3ba4('0x29')](_0x1ed403,'name');_0x16c5af['query']=_[_0x3ba4('0x30')](_0xee5db6[_0x3ba4('0x31')]);_0x16c5af[_0x3ba4('0x32')]=_[_0x3ba4('0x33')](_0x16c5af['model'],_0x16c5af[_0x3ba4('0x31')]);_0x4dbefa['attributes']=_[_0x3ba4('0x33')](_0x16c5af['model'],qs['fields'](_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x34')]));_0x4dbefa[_0x3ba4('0x35')]=_0x4dbefa[_0x3ba4('0x35')][_0x3ba4('0x36')]?_0x4dbefa[_0x3ba4('0x35')]:_0x16c5af[_0x3ba4('0x2f')];if(!_0xee5db6['query'][_0x3ba4('0x37')]('nolimit')){_0x4dbefa[_0x3ba4('0x1b')]=qs[_0x3ba4('0x1b')](_0xee5db6[_0x3ba4('0x31')]['limit']);_0x4dbefa[_0x3ba4('0x1d')]=qs[_0x3ba4('0x1d')](_0xee5db6[_0x3ba4('0x31')]['offset']);}_0x4dbefa[_0x3ba4('0x38')]=qs[_0x3ba4('0x39')](_0xee5db6[_0x3ba4('0x31')]['sort']);_0x4dbefa[_0x3ba4('0x3a')]=qs[_0x3ba4('0x32')](_[_0x3ba4('0x3b')](_0xee5db6[_0x3ba4('0x31')],_0x16c5af['filters']),_0x1ed403);if(_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x3c')]){_0x4dbefa['where']=_[_0x3ba4('0x3d')](_0x4dbefa['where'],{'$or':_['map'](_0x1ed403,function(_0x34bbfa){if(_0x34bbfa[_0x3ba4('0x2d')]!==_0x3ba4('0x3e')){var _0x1e01c3={};_0x1e01c3[_0x34bbfa[_0x3ba4('0x26')]]={'$like':'%'+_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x3c')]+'%'};return _0x1e01c3;}})});}_0x4dbefa=_['merge']({},_0x4dbefa,_0xee5db6[_0x3ba4('0x3f')]);var _0x1d783f={'where':_0x4dbefa[_0x3ba4('0x3a')]};return db[_0x3ba4('0x2a')]['count'](_0x1d783f)[_0x3ba4('0x23')](function(_0x26a5b7){_0x5033d8['count']=_0x26a5b7;if(_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x40')]){_0x4dbefa['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3ba4('0x41')](_0x4dbefa);})['then'](function(_0x1468e8){_0x5033d8['rows']=_0x1468e8;return _0x5033d8;})[_0x3ba4('0x23')](respondWithFilteredResult(_0x34fdff,_0x4dbefa))[_0x3ba4('0x42')](handleError(_0x34fdff,null));};exports[_0x3ba4('0x43')]=function(_0x35eb51,_0x24466e){var _0x468cee={'raw':!![],'where':{'id':_0x35eb51[_0x3ba4('0x44')]['id']}},_0x315bfa={};_0x315bfa[_0x3ba4('0x2f')]=_[_0x3ba4('0x30')](db[_0x3ba4('0x2a')][_0x3ba4('0x2b')]);_0x315bfa[_0x3ba4('0x31')]=_[_0x3ba4('0x30')](_0x35eb51[_0x3ba4('0x31')]);_0x315bfa[_0x3ba4('0x32')]=_['intersection'](_0x315bfa[_0x3ba4('0x2f')],_0x315bfa[_0x3ba4('0x31')]);_0x468cee['attributes']=_[_0x3ba4('0x33')](_0x315bfa[_0x3ba4('0x2f')],qs[_0x3ba4('0x34')](_0x35eb51[_0x3ba4('0x31')][_0x3ba4('0x34')]));_0x468cee[_0x3ba4('0x35')]=_0x468cee[_0x3ba4('0x35')]['length']?_0x468cee['attributes']:_0x315bfa[_0x3ba4('0x2f')];if(_0x35eb51[_0x3ba4('0x31')][_0x3ba4('0x40')]){_0x468cee['include']=[{'all':!![]}];}_0x468cee=_[_0x3ba4('0x3d')]({},_0x468cee,_0x35eb51[_0x3ba4('0x3f')]);return db[_0x3ba4('0x2a')][_0x3ba4('0x45')](_0x468cee)[_0x3ba4('0x23')](handleEntityNotFound(_0x24466e,null))[_0x3ba4('0x23')](respondWithResult(_0x24466e,null))[_0x3ba4('0x42')](handleError(_0x24466e,null));};exports[_0x3ba4('0x46')]=function(_0x4323f0,_0x39fe2f){return db[_0x3ba4('0x2a')][_0x3ba4('0x46')](_0x4323f0[_0x3ba4('0x47')],{})['then'](respondWithResult(_0x39fe2f,0xc9))[_0x3ba4('0x42')](handleError(_0x39fe2f,null));};exports[_0x3ba4('0x22')]=function(_0xafef8e,_0x54443c){if(_0xafef8e['body']['id']){delete _0xafef8e[_0x3ba4('0x47')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0xafef8e[_0x3ba4('0x44')]['id']}})[_0x3ba4('0x23')](handleEntityNotFound(_0x54443c,null))[_0x3ba4('0x23')](saveUpdates(_0xafef8e[_0x3ba4('0x47')],null))[_0x3ba4('0x23')](respondWithResult(_0x54443c,null))[_0x3ba4('0x42')](handleError(_0x54443c,null));};exports['destroy']=function(_0x2b9c4e,_0x431389){return db[_0x3ba4('0x2a')][_0x3ba4('0x45')]({'where':{'id':_0x2b9c4e[_0x3ba4('0x44')]['id']}})[_0x3ba4('0x23')](handleEntityNotFound(_0x431389,null))['then'](removeEntity(_0x431389,null))[_0x3ba4('0x42')](handleError(_0x431389,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index dedfa5a..88f1e48 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 _0x88a2=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes'];(function(_0xda312b,_0x21427b){var _0x3b5434=function(_0x1bc9be){while(--_0x1bc9be){_0xda312b['push'](_0xda312b['shift']());}};_0x3b5434(++_0x21427b);}(_0x88a2,0x64));var _0x288a=function(_0x531664,_0x723a7b){_0x531664=_0x531664-0x0;var _0x118f52=_0x88a2[_0x531664];return _0x118f52;};'use strict';var _=require(_0x288a('0x0'));var util=require(_0x288a('0x1'));var logger=require(_0x288a('0x2'))(_0x288a('0x3'));var moment=require(_0x288a('0x4'));var BPromise=require(_0x288a('0x5'));var rp=require(_0x288a('0x6'));var fs=require('fs');var path=require(_0x288a('0x7'));var rimraf=require(_0x288a('0x8'));var config=require('../../config/environment');var attributes=require(_0x288a('0x9'));module['exports']=function(_0x49e5a7,_0x3d4897){return _0x49e5a7[_0x288a('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1fd=['util','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xd1fd,0xe3));var _0xdd1f=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xd1fd[_0x470bfb];return _0x2f5d97;};'use strict';var _=require(_0xdd1f('0x0'));var util=require(_0xdd1f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdd1f('0x2'));var BPromise=require(_0xdd1f('0x3'));var rp=require(_0xdd1f('0x4'));var fs=require('fs');var path=require(_0xdd1f('0x5'));var rimraf=require(_0xdd1f('0x6'));var config=require('../../config/environment');var attributes=require(_0xdd1f('0x7'));module[_0xdd1f('0x8')]=function(_0x4059ae,_0x40a35a){return _0x4059ae[_0xdd1f('0x9')](_0xdd1f('0xa'),attributes,{'tableName':_0xdd1f('0xb'),'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 8f3935d..ac89f8e 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 _0x7a54=['info','AnalyticTreeReport,\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(_0x268436,_0x174f08){_0x268436=_0x268436-0x0;var _0x25327f=_0x7a54[_0x268436];return _0x25327f;};'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')]('AnalyticTreeReport,\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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2fdd6a,_0x512f37){var _0x33945f=function(_0x554881){while(--_0x554881){_0x2fdd6a['push'](_0x2fdd6a['shift']());}};_0x33945f(++_0x512f37);}(_0x1261,0x144));var _0x1126=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x1261[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 8868901..0dcbe92 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 _0xc59d=['fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','util','path','connect-timeout','Router'];(function(_0x5c07bb,_0x34ef41){var _0x3965c8=function(_0x189f3a){while(--_0x189f3a){_0x5c07bb['push'](_0x5c07bb['shift']());}};_0x3965c8(++_0x34ef41);}(_0xc59d,0x1c7));var _0xdc59=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc59d[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xdc59('0x0'));var path=require(_0xdc59('0x1'));var timeout=require(_0xdc59('0x2'));var express=require('express');var router=express[_0xdc59('0x3')]();var fs_extra=require(_0xdc59('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdc59('0x5'));var config=require(_0xdc59('0x6'));var controller=require(_0xdc59('0x7'));router[_0xdc59('0x8')]('/',auth[_0xdc59('0x9')](),controller['index']);router[_0xdc59('0x8')](_0xdc59('0xa'),auth['isAuthenticated'](),controller[_0xdc59('0xb')]);router[_0xdc59('0xc')]('/',auth[_0xdc59('0x9')](),controller[_0xdc59('0xd')]);router['put'](_0xdc59('0xa'),auth[_0xdc59('0x9')](),controller[_0xdc59('0xe')]);router['delete'](_0xdc59('0xa'),auth[_0xdc59('0x9')](),controller[_0xdc59('0xf')]);module[_0xdc59('0x10')]=router;
\ No newline at end of file
+var _0xd979=['show','create','update','delete','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','./analyticTreeReport.controller','index','get','isAuthenticated'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xd979,0x1c7));var _0x9d97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd979[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9d97('0x0'));var path=require(_0x9d97('0x1'));var timeout=require(_0x9d97('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9d97('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9d97('0x4'));var controller=require(_0x9d97('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x9d97('0x6')]);router[_0x9d97('0x7')]('/:id',auth[_0x9d97('0x8')](),controller[_0x9d97('0x9')]);router['post']('/',auth[_0x9d97('0x8')](),controller[_0x9d97('0xa')]);router['put']('/:id',auth[_0x9d97('0x8')](),controller[_0x9d97('0xb')]);router[_0x9d97('0xc')](_0x9d97('0xd'),auth[_0x9d97('0x8')](),controller[_0x9d97('0xe')]);module[_0x9d97('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index dcb4355..2f2b642 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 _0x39a9=['exports','STRING','sequelize'];(function(_0x371eb8,_0x11409b){var _0x224438=function(_0x2c6fc){while(--_0x2c6fc){_0x371eb8['push'](_0x371eb8['shift']());}};_0x224438(++_0x11409b);}(_0x39a9,0x1d0));var _0x939a=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x39a9[_0x3a2a3c];return _0x50ac9a;};'use strict';var Sequelize=require(_0x939a('0x0'));module[_0x939a('0x1')]={'name':{'type':Sequelize[_0x939a('0x2')]},'basename':{'type':Sequelize[_0x939a('0x2')]},'type':{'type':Sequelize[_0x939a('0x2')]}};
\ No newline at end of file
+var _0xcb18=['STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcb18,0x159));var _0x8cb1=function(_0x53cdd2,_0x22f364){_0x53cdd2=_0x53cdd2-0x0;var _0x2420ea=_0xcb18[_0x53cdd2];return _0x2420ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8cb1('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8cb1('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 48e830f..6955189 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 _0xe654=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','model','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','Attachment','findAll','catch','show','params','keys','intersection','options','find','clone','get','omit','createdAt','updatedAt','body','create','file','filename','download','ChatOfflineMessageId','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x54ff7d,_0x27c0a6){var _0x3dfeac=function(_0x473272){while(--_0x473272){_0x54ff7d['push'](_0x54ff7d['shift']());}};_0x3dfeac(++_0x27c0a6);}(_0xe654,0x9d));var _0x4e65=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe654[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x4e65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e65('0x1'));var jsonpatch=require(_0x4e65('0x2'));var rp=require(_0x4e65('0x3'));var moment=require(_0x4e65('0x4'));var BPromise=require(_0x4e65('0x5'));var Mustache=require('mustache');var util=require(_0x4e65('0x6'));var path=require(_0x4e65('0x7'));var sox=require('sox');var csv=require(_0x4e65('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e65('0x9'));var _=require(_0x4e65('0xa'));var squel=require(_0x4e65('0xb'));var crypto=require(_0x4e65('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e65('0x8'));var querystring=require(_0x4e65('0xd'));var Papa=require('papaparse');var Redis=require(_0x4e65('0xe'));var authService=require(_0x4e65('0xf'));var qs=require(_0x4e65('0x10'));var as=require(_0x4e65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e65('0x12'))(_0x4e65('0x13'));var utils=require(_0x4e65('0x14'));var config=require(_0x4e65('0x15'));var licenseUtil=require(_0x4e65('0x16'));var db=require(_0x4e65('0x17'))['db'];function respondWithStatusCode(_0x1b7ac8,_0x10181d){_0x10181d=_0x10181d||0xcc;return function(_0x33c3b4){if(_0x33c3b4){return _0x1b7ac8[_0x4e65('0x18')](_0x10181d);}return _0x1b7ac8[_0x4e65('0x19')](_0x10181d)[_0x4e65('0x1a')]();};}function respondWithResult(_0x92bd7f,_0x1894d6){_0x1894d6=_0x1894d6||0xc8;return function(_0x1be010){if(_0x1be010){return _0x92bd7f[_0x4e65('0x19')](_0x1894d6)[_0x4e65('0x1b')](_0x1be010);}};}function respondWithFilteredResult(_0x4f98e0,_0xb0bcdd){return function(_0x4e1d0c){if(_0x4e1d0c){var _0x28e1ca=typeof _0xb0bcdd[_0x4e65('0x1c')]===_0x4e65('0x1d')&&typeof _0xb0bcdd[_0x4e65('0x1e')]==='undefined';var _0x35d51b=_0x4e1d0c['count'];var _0x3a41da=_0x28e1ca?0x0:_0xb0bcdd[_0x4e65('0x1c')];var _0x5812c4=_0x28e1ca?_0x4e1d0c[_0x4e65('0x1f')]:_0xb0bcdd[_0x4e65('0x1c')]+_0xb0bcdd['limit'];var _0x43c1c4;if(_0x5812c4>=_0x35d51b){_0x5812c4=_0x35d51b;_0x43c1c4=0xc8;}else{_0x43c1c4=0xce;}_0x4f98e0[_0x4e65('0x19')](_0x43c1c4);return _0x4f98e0[_0x4e65('0x20')]('Content-Range',_0x3a41da+'-'+_0x5812c4+'/'+_0x35d51b)[_0x4e65('0x1b')](_0x4e1d0c);}return null;};}function patchUpdates(_0x27556d){return function(_0x344671){try{jsonpatch[_0x4e65('0x21')](_0x344671,_0x27556d,!![]);}catch(_0x4eeb78){return BPromise[_0x4e65('0x22')](_0x4eeb78);}return _0x344671[_0x4e65('0x23')]();};}function saveUpdates(_0x402cc8,_0x55fd5d){return function(_0x4654cc){if(_0x4654cc){return _0x4654cc[_0x4e65('0x24')](_0x402cc8)[_0x4e65('0x25')](function(_0x217c24){return _0x217c24;});}return null;};}function removeEntity(_0xca4999,_0x5c54f9){return function(_0x1b3b1b){if(_0x1b3b1b){return _0x1b3b1b[_0x4e65('0x26')]()[_0x4e65('0x25')](function(){_0xca4999[_0x4e65('0x19')](0xcc)[_0x4e65('0x1a')]();});}};}function handleEntityNotFound(_0x61addd,_0x39b360){return function(_0x2627b9){if(!_0x2627b9){_0x61addd[_0x4e65('0x18')](0x194);}return _0x2627b9;};}function handleError(_0x361e16,_0x1b8279){_0x1b8279=_0x1b8279||0x1f4;return function(_0x51daa4){logger[_0x4e65('0x27')](_0x51daa4[_0x4e65('0x28')]);if(_0x51daa4[_0x4e65('0x29')]){delete _0x51daa4[_0x4e65('0x29')];}_0x361e16[_0x4e65('0x19')](_0x1b8279)[_0x4e65('0x2a')](_0x51daa4);};}exports[_0x4e65('0x2b')]=function(_0x114178,_0xfc2ead){var _0x2dfa75={},_0x2ab001={},_0x4ff2de={'count':0x0,'rows':[]};var _0x5b7380=_[_0x4e65('0x2c')](db['Attachment'][_0x4e65('0x2d')],function(_0x29cc0b){return{'name':_0x29cc0b[_0x4e65('0x2e')],'type':_0x29cc0b['type'][_0x4e65('0x2f')]};});_0x2ab001['model']=_[_0x4e65('0x2c')](_0x5b7380,_0x4e65('0x29'));_0x2ab001[_0x4e65('0x30')]=_['keys'](_0x114178['query']);_0x2ab001[_0x4e65('0x31')]=_['intersection'](_0x2ab001[_0x4e65('0x32')],_0x2ab001[_0x4e65('0x30')]);_0x2dfa75[_0x4e65('0x33')]=_['intersection'](_0x2ab001[_0x4e65('0x32')],qs[_0x4e65('0x34')](_0x114178[_0x4e65('0x30')][_0x4e65('0x34')]));_0x2dfa75[_0x4e65('0x33')]=_0x2dfa75[_0x4e65('0x33')][_0x4e65('0x35')]?_0x2dfa75[_0x4e65('0x33')]:_0x2ab001[_0x4e65('0x32')];if(!_0x114178[_0x4e65('0x30')]['hasOwnProperty'](_0x4e65('0x36'))){_0x2dfa75['limit']=qs[_0x4e65('0x1e')](_0x114178[_0x4e65('0x30')][_0x4e65('0x1e')]);_0x2dfa75[_0x4e65('0x1c')]=qs[_0x4e65('0x1c')](_0x114178[_0x4e65('0x30')]['offset']);}_0x2dfa75['order']=qs[_0x4e65('0x37')](_0x114178[_0x4e65('0x30')][_0x4e65('0x37')]);_0x2dfa75[_0x4e65('0x38')]=qs[_0x4e65('0x31')](_[_0x4e65('0x39')](_0x114178[_0x4e65('0x30')],_0x2ab001[_0x4e65('0x31')]),_0x5b7380);if(_0x114178[_0x4e65('0x30')]['filter']){_0x2dfa75[_0x4e65('0x38')]=_[_0x4e65('0x3a')](_0x2dfa75[_0x4e65('0x38')],{'$or':_['map'](_0x5b7380,function(_0x19eb78){if(_0x19eb78[_0x4e65('0x3b')]!==_0x4e65('0x3c')){var _0x23591f={};_0x23591f[_0x19eb78[_0x4e65('0x29')]]={'$like':'%'+_0x114178[_0x4e65('0x30')][_0x4e65('0x3d')]+'%'};return _0x23591f;}})});}_0x2dfa75=_[_0x4e65('0x3a')]({},_0x2dfa75,_0x114178['options']);var _0x61aa8c={'where':_0x2dfa75[_0x4e65('0x38')]};return db['Attachment'][_0x4e65('0x1f')](_0x61aa8c)[_0x4e65('0x25')](function(_0x1f591a){_0x4ff2de['count']=_0x1f591a;if(_0x114178['query'][_0x4e65('0x3e')]){_0x2dfa75[_0x4e65('0x3f')]=[{'all':!![]}];}return db[_0x4e65('0x40')][_0x4e65('0x41')](_0x2dfa75);})[_0x4e65('0x25')](function(_0x50d2fd){_0x4ff2de['rows']=_0x50d2fd;return _0x4ff2de;})[_0x4e65('0x25')](respondWithFilteredResult(_0xfc2ead,_0x2dfa75))[_0x4e65('0x42')](handleError(_0xfc2ead,null));};exports[_0x4e65('0x43')]=function(_0x315300,_0x714302){var _0x1934e5={'raw':!![],'where':{'id':_0x315300[_0x4e65('0x44')]['id']}},_0x2550ee={};_0x2550ee[_0x4e65('0x32')]=_[_0x4e65('0x45')](db[_0x4e65('0x40')]['rawAttributes']);_0x2550ee[_0x4e65('0x30')]=_[_0x4e65('0x45')](_0x315300['query']);_0x2550ee['filters']=_[_0x4e65('0x46')](_0x2550ee['model'],_0x2550ee['query']);_0x1934e5[_0x4e65('0x33')]=_[_0x4e65('0x46')](_0x2550ee[_0x4e65('0x32')],qs[_0x4e65('0x34')](_0x315300['query']['fields']));_0x1934e5[_0x4e65('0x33')]=_0x1934e5['attributes'][_0x4e65('0x35')]?_0x1934e5[_0x4e65('0x33')]:_0x2550ee[_0x4e65('0x32')];if(_0x315300[_0x4e65('0x30')][_0x4e65('0x3e')]){_0x1934e5[_0x4e65('0x3f')]=[{'all':!![]}];}_0x1934e5=_[_0x4e65('0x3a')]({},_0x1934e5,_0x315300[_0x4e65('0x47')]);return db[_0x4e65('0x40')][_0x4e65('0x48')](_0x1934e5)[_0x4e65('0x25')](handleEntityNotFound(_0x714302,null))[_0x4e65('0x25')](respondWithResult(_0x714302,null))[_0x4e65('0x42')](handleError(_0x714302,null));};exports[_0x4e65('0x49')]=function(_0x48d26f,_0x1942a6){var _0x40dbe0={'where':{'id':_0x48d26f[_0x4e65('0x44')]['id']}},_0x2c7b43={};_0x2c7b43[_0x4e65('0x32')]=_['keys'](db['Attachment'][_0x4e65('0x2d')]);_0x40dbe0[_0x4e65('0x33')]=_[_0x4e65('0x46')](_0x2c7b43[_0x4e65('0x32')],qs[_0x4e65('0x34')](_0x48d26f[_0x4e65('0x30')][_0x4e65('0x34')]));_0x40dbe0[_0x4e65('0x33')]=_0x40dbe0['attributes'][_0x4e65('0x35')]?_0x40dbe0[_0x4e65('0x33')]:_0x2c7b43['model'];if(_0x48d26f[_0x4e65('0x30')][_0x4e65('0x3e')]){_0x40dbe0['include']=[{'all':!![]}];}_0x40dbe0=_[_0x4e65('0x3a')]({},_0x40dbe0,_0x48d26f[_0x4e65('0x47')]);return db[_0x4e65('0x40')][_0x4e65('0x48')](_0x40dbe0)[_0x4e65('0x25')](handleEntityNotFound(_0x1942a6,null))['then'](function(_0x56f410){if(_0x56f410){var _0x537cb5=_0x56f410[_0x4e65('0x4a')]({'plain':!![]});_0x537cb5=qs[_0x4e65('0x4b')](_0x537cb5,['id',_0x4e65('0x4c'),_0x4e65('0x4d')]);_0x48d26f[_0x4e65('0x4e')]=_[_0x4e65('0x4b')](_0x48d26f[_0x4e65('0x4e')],['id','createdAt',_0x4e65('0x4d')]);return db[_0x4e65('0x40')][_0x4e65('0x4f')](_[_0x4e65('0x3a')](_0x537cb5,_0x48d26f['body']),{'include':_0x48d26f['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x4e65('0x25')](respondWithResult(_0x1942a6,0xc9))[_0x4e65('0x42')](handleError(_0x1942a6,null));};exports['update']=function(_0x31b0f3,_0x4127f6){if(_0x31b0f3['body']['id']){delete _0x31b0f3['body']['id'];}return db[_0x4e65('0x40')][_0x4e65('0x48')]({'where':{'id':_0x31b0f3[_0x4e65('0x44')]['id']}})[_0x4e65('0x25')](handleEntityNotFound(_0x4127f6,null))[_0x4e65('0x25')](saveUpdates(_0x31b0f3[_0x4e65('0x4e')],null))[_0x4e65('0x25')](respondWithResult(_0x4127f6,null))['catch'](handleError(_0x4127f6,null));};exports[_0x4e65('0x26')]=function(_0x587fa6,_0x29f5de){return db['Attachment']['find']({'where':{'id':_0x587fa6[_0x4e65('0x44')]['id']}})['then'](handleEntityNotFound(_0x29f5de,null))[_0x4e65('0x25')](removeEntity(_0x29f5de,null))['catch'](handleError(_0x29f5de,null));};exports[_0x4e65('0x4f')]=function(_0x5da4e7,_0x132346,_0x17199a){_0x5da4e7[_0x4e65('0x4e')][_0x4e65('0x29')]=_0x5da4e7[_0x4e65('0x50')]['originalname'];_0x5da4e7['body']['basename']=_0x5da4e7[_0x4e65('0x50')][_0x4e65('0x51')];_0x5da4e7[_0x4e65('0x4e')][_0x4e65('0x3b')]=_0x5da4e7[_0x4e65('0x50')]['mimetype'];return db[_0x4e65('0x40')][_0x4e65('0x4f')](_0x5da4e7[_0x4e65('0x4e')])[_0x4e65('0x25')](respondWithResult(_0x132346,0xc9))['catch'](handleError(_0x132346,null));};exports[_0x4e65('0x52')]=function(_0x275613,_0x31e890,_0x1cb5c2){return db[_0x4e65('0x40')]['findOne']({'where':{'id':_0x275613[_0x4e65('0x44')]['id']},'raw':!![]})[_0x4e65('0x25')](handleEntityNotFound(_0x31e890,null))[_0x4e65('0x25')](function(_0x2e7f6d){if(_0x2e7f6d){var _0x5adafa=_0x2e7f6d[_0x4e65('0x53')]!==null;var _0x4258d6=path[_0x4e65('0x54')](config[_0x4e65('0x55')],'server/files/attachments/');if(_0x5adafa){_0x4258d6=path[_0x4e65('0x54')](_0x4258d6,_0x4e65('0x56'));}var _0x57809a=path['join'](_0x4258d6,_0x2e7f6d['basename']);return _0x31e890[_0x4e65('0x52')](_0x57809a);}})['catch'](handleError(_0x31e890,null));};
\ No newline at end of file
+var _0x2112=['undefined','count','offset','set','Content-Range','reject','then','end','error','stack','name','send','map','Attachment','rawAttributes','key','model','keys','intersection','attributes','fields','query','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','includeAll','find','catch','clone','params','get','createdAt','updatedAt','body','omit','create','update','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit'];(function(_0x48e798,_0x351684){var _0x1bbc7d=function(_0x24d583){while(--_0x24d583){_0x48e798['push'](_0x48e798['shift']());}};_0x1bbc7d(++_0x351684);}(_0x2112,0x149));var _0x2211=function(_0x40ca61,_0x8ccae6){_0x40ca61=_0x40ca61-0x0;var _0x485cd4=_0x2112[_0x40ca61];return _0x485cd4;};'use strict';var emlformat=require(_0x2211('0x0'));var rimraf=require(_0x2211('0x1'));var zipdir=require(_0x2211('0x2'));var jsonpatch=require(_0x2211('0x3'));var rp=require(_0x2211('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2211('0x5'));var path=require(_0x2211('0x6'));var sox=require(_0x2211('0x7'));var csv=require(_0x2211('0x8'));var ejs=require(_0x2211('0x9'));var fs=require('fs');var fs_extra=require(_0x2211('0xa'));var _=require(_0x2211('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2211('0xc'));var deskjs=require(_0x2211('0xd'));var toCsv=require(_0x2211('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2211('0xe'));var authService=require(_0x2211('0xf'));var qs=require(_0x2211('0x10'));var as=require(_0x2211('0x11'));var hardwareService=require(_0x2211('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2211('0x13'));var config=require(_0x2211('0x14'));var licenseUtil=require(_0x2211('0x15'));var db=require(_0x2211('0x16'))['db'];function respondWithStatusCode(_0x1c9724,_0x42d376){_0x42d376=_0x42d376||0xcc;return function(_0x15bba7){if(_0x15bba7){return _0x1c9724[_0x2211('0x17')](_0x42d376);}return _0x1c9724[_0x2211('0x18')](_0x42d376)['end']();};}function respondWithResult(_0x472726,_0x2c4fcd){_0x2c4fcd=_0x2c4fcd||0xc8;return function(_0x2a7455){if(_0x2a7455){return _0x472726[_0x2211('0x18')](_0x2c4fcd)[_0x2211('0x19')](_0x2a7455);}};}function respondWithFilteredResult(_0x457ac4,_0x22d9df){return function(_0x23350b){if(_0x23350b){var _0x1ee42c=typeof _0x22d9df['offset']==='undefined'&&typeof _0x22d9df[_0x2211('0x1a')]===_0x2211('0x1b');var _0x283a4a=_0x23350b[_0x2211('0x1c')];var _0x10be9b=_0x1ee42c?0x0:_0x22d9df[_0x2211('0x1d')];var _0x2a7a1a=_0x1ee42c?_0x23350b[_0x2211('0x1c')]:_0x22d9df[_0x2211('0x1d')]+_0x22d9df[_0x2211('0x1a')];var _0x2b1c96;if(_0x2a7a1a>=_0x283a4a){_0x2a7a1a=_0x283a4a;_0x2b1c96=0xc8;}else{_0x2b1c96=0xce;}_0x457ac4[_0x2211('0x18')](_0x2b1c96);return _0x457ac4[_0x2211('0x1e')](_0x2211('0x1f'),_0x10be9b+'-'+_0x2a7a1a+'/'+_0x283a4a)['json'](_0x23350b);}return null;};}function patchUpdates(_0x57fd95){return function(_0x1fe0de){try{jsonpatch['apply'](_0x1fe0de,_0x57fd95,!![]);}catch(_0x42bc1f){return BPromise[_0x2211('0x20')](_0x42bc1f);}return _0x1fe0de['save']();};}function saveUpdates(_0x198772,_0x32c0ce){return function(_0x415b50){if(_0x415b50){return _0x415b50['update'](_0x198772)[_0x2211('0x21')](function(_0xa637ea){return _0xa637ea;});}return null;};}function removeEntity(_0x43a41f,_0x401746){return function(_0x104408){if(_0x104408){return _0x104408['destroy']()[_0x2211('0x21')](function(){_0x43a41f[_0x2211('0x18')](0xcc)[_0x2211('0x22')]();});}};}function handleEntityNotFound(_0x536a60,_0x4de501){return function(_0x9053e9){if(!_0x9053e9){_0x536a60[_0x2211('0x17')](0x194);}return _0x9053e9;};}function handleError(_0x236ed4,_0x3e621f){_0x3e621f=_0x3e621f||0x1f4;return function(_0x2c671a){logger[_0x2211('0x23')](_0x2c671a[_0x2211('0x24')]);if(_0x2c671a[_0x2211('0x25')]){delete _0x2c671a[_0x2211('0x25')];}_0x236ed4[_0x2211('0x18')](_0x3e621f)[_0x2211('0x26')](_0x2c671a);};}exports['index']=function(_0x4efd54,_0x920430){var _0x403a21={},_0x5b3747={},_0xcf7cee={'count':0x0,'rows':[]};var _0x2f5064=_[_0x2211('0x27')](db[_0x2211('0x28')][_0x2211('0x29')],function(_0x25f4a0){return{'name':_0x25f4a0['fieldName'],'type':_0x25f4a0['type'][_0x2211('0x2a')]};});_0x5b3747[_0x2211('0x2b')]=_[_0x2211('0x27')](_0x2f5064,_0x2211('0x25'));_0x5b3747['query']=_[_0x2211('0x2c')](_0x4efd54['query']);_0x5b3747['filters']=_[_0x2211('0x2d')](_0x5b3747[_0x2211('0x2b')],_0x5b3747['query']);_0x403a21[_0x2211('0x2e')]=_[_0x2211('0x2d')](_0x5b3747[_0x2211('0x2b')],qs[_0x2211('0x2f')](_0x4efd54[_0x2211('0x30')][_0x2211('0x2f')]));_0x403a21[_0x2211('0x2e')]=_0x403a21[_0x2211('0x2e')][_0x2211('0x31')]?_0x403a21[_0x2211('0x2e')]:_0x5b3747[_0x2211('0x2b')];if(!_0x4efd54[_0x2211('0x30')]['hasOwnProperty'](_0x2211('0x32'))){_0x403a21[_0x2211('0x1a')]=qs['limit'](_0x4efd54[_0x2211('0x30')]['limit']);_0x403a21[_0x2211('0x1d')]=qs[_0x2211('0x1d')](_0x4efd54[_0x2211('0x30')][_0x2211('0x1d')]);}_0x403a21[_0x2211('0x33')]=qs['sort'](_0x4efd54[_0x2211('0x30')][_0x2211('0x34')]);_0x403a21[_0x2211('0x35')]=qs[_0x2211('0x36')](_[_0x2211('0x37')](_0x4efd54[_0x2211('0x30')],_0x5b3747[_0x2211('0x36')]),_0x2f5064);if(_0x4efd54['query']['filter']){_0x403a21[_0x2211('0x35')]=_[_0x2211('0x38')](_0x403a21[_0x2211('0x35')],{'$or':_[_0x2211('0x27')](_0x2f5064,function(_0x2723f3){if(_0x2723f3[_0x2211('0x39')]!==_0x2211('0x3a')){var _0x56c100={};_0x56c100[_0x2723f3[_0x2211('0x25')]]={'$like':'%'+_0x4efd54[_0x2211('0x30')][_0x2211('0x3b')]+'%'};return _0x56c100;}})});}_0x403a21=_['merge']({},_0x403a21,_0x4efd54[_0x2211('0x3c')]);var _0xa77a94={'where':_0x403a21[_0x2211('0x35')]};return db[_0x2211('0x28')][_0x2211('0x1c')](_0xa77a94)[_0x2211('0x21')](function(_0x18e765){_0xcf7cee[_0x2211('0x1c')]=_0x18e765;if(_0x4efd54[_0x2211('0x30')]['includeAll']){_0x403a21[_0x2211('0x3d')]=[{'all':!![]}];}return db[_0x2211('0x28')][_0x2211('0x3e')](_0x403a21);})[_0x2211('0x21')](function(_0x50ba6d){_0xcf7cee[_0x2211('0x3f')]=_0x50ba6d;return _0xcf7cee;})[_0x2211('0x21')](respondWithFilteredResult(_0x920430,_0x403a21))['catch'](handleError(_0x920430,null));};exports['show']=function(_0x201426,_0x39cd57){var _0x35d143={'raw':!![],'where':{'id':_0x201426['params']['id']}},_0x549561={};_0x549561['model']=_[_0x2211('0x2c')](db['Attachment'][_0x2211('0x29')]);_0x549561['query']=_[_0x2211('0x2c')](_0x201426[_0x2211('0x30')]);_0x549561[_0x2211('0x36')]=_[_0x2211('0x2d')](_0x549561[_0x2211('0x2b')],_0x549561[_0x2211('0x30')]);_0x35d143['attributes']=_[_0x2211('0x2d')](_0x549561[_0x2211('0x2b')],qs[_0x2211('0x2f')](_0x201426[_0x2211('0x30')][_0x2211('0x2f')]));_0x35d143['attributes']=_0x35d143[_0x2211('0x2e')][_0x2211('0x31')]?_0x35d143[_0x2211('0x2e')]:_0x549561[_0x2211('0x2b')];if(_0x201426[_0x2211('0x30')][_0x2211('0x40')]){_0x35d143['include']=[{'all':!![]}];}_0x35d143=_[_0x2211('0x38')]({},_0x35d143,_0x201426[_0x2211('0x3c')]);return db[_0x2211('0x28')][_0x2211('0x41')](_0x35d143)[_0x2211('0x21')](handleEntityNotFound(_0x39cd57,null))[_0x2211('0x21')](respondWithResult(_0x39cd57,null))[_0x2211('0x42')](handleError(_0x39cd57,null));};exports[_0x2211('0x43')]=function(_0x1967d9,_0x1d208a){var _0xe46381={'where':{'id':_0x1967d9[_0x2211('0x44')]['id']}},_0x2e6375={};_0x2e6375['model']=_[_0x2211('0x2c')](db['Attachment']['rawAttributes']);_0xe46381[_0x2211('0x2e')]=_[_0x2211('0x2d')](_0x2e6375[_0x2211('0x2b')],qs['fields'](_0x1967d9[_0x2211('0x30')]['fields']));_0xe46381[_0x2211('0x2e')]=_0xe46381[_0x2211('0x2e')][_0x2211('0x31')]?_0xe46381[_0x2211('0x2e')]:_0x2e6375[_0x2211('0x2b')];if(_0x1967d9[_0x2211('0x30')][_0x2211('0x40')]){_0xe46381[_0x2211('0x3d')]=[{'all':!![]}];}_0xe46381=_[_0x2211('0x38')]({},_0xe46381,_0x1967d9[_0x2211('0x3c')]);return db[_0x2211('0x28')][_0x2211('0x41')](_0xe46381)[_0x2211('0x21')](handleEntityNotFound(_0x1d208a,null))[_0x2211('0x21')](function(_0x305d5a){if(_0x305d5a){var _0x20ac1b=_0x305d5a[_0x2211('0x45')]({'plain':!![]});_0x20ac1b=qs['omit'](_0x20ac1b,['id',_0x2211('0x46'),_0x2211('0x47')]);_0x1967d9[_0x2211('0x48')]=_[_0x2211('0x49')](_0x1967d9[_0x2211('0x48')],['id','createdAt','updatedAt']);return db['Attachment'][_0x2211('0x4a')](_['merge'](_0x20ac1b,_0x1967d9[_0x2211('0x48')]),{'include':_0x1967d9[_0x2211('0x30')][_0x2211('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1d208a,0xc9))['catch'](handleError(_0x1d208a,null));};exports[_0x2211('0x4b')]=function(_0x54ff67,_0x583244){if(_0x54ff67[_0x2211('0x48')]['id']){delete _0x54ff67[_0x2211('0x48')]['id'];}return db['Attachment'][_0x2211('0x41')]({'where':{'id':_0x54ff67['params']['id']}})['then'](handleEntityNotFound(_0x583244,null))[_0x2211('0x21')](saveUpdates(_0x54ff67[_0x2211('0x48')],null))[_0x2211('0x21')](respondWithResult(_0x583244,null))[_0x2211('0x42')](handleError(_0x583244,null));};exports[_0x2211('0x4c')]=function(_0xb02044,_0x57f499){return db[_0x2211('0x28')][_0x2211('0x41')]({'where':{'id':_0xb02044[_0x2211('0x44')]['id']}})[_0x2211('0x21')](handleEntityNotFound(_0x57f499,null))[_0x2211('0x21')](removeEntity(_0x57f499,null))[_0x2211('0x42')](handleError(_0x57f499,null));};exports[_0x2211('0x4a')]=function(_0x365c18,_0x4b52e6,_0x568279){_0x365c18['body'][_0x2211('0x25')]=_0x365c18[_0x2211('0x4d')][_0x2211('0x4e')];_0x365c18['body'][_0x2211('0x4f')]=_0x365c18[_0x2211('0x4d')][_0x2211('0x50')];_0x365c18[_0x2211('0x48')][_0x2211('0x39')]=_0x365c18['file'][_0x2211('0x51')];return db[_0x2211('0x28')][_0x2211('0x4a')](_0x365c18[_0x2211('0x48')])['then'](respondWithResult(_0x4b52e6,0xc9))['catch'](handleError(_0x4b52e6,null));};exports[_0x2211('0x52')]=function(_0x19fd30,_0x2f2720,_0x4fdcd7){return db[_0x2211('0x28')][_0x2211('0x53')]({'where':{'id':_0x19fd30['params']['id']},'raw':!![]})[_0x2211('0x21')](handleEntityNotFound(_0x2f2720,null))['then'](function(_0x3d34ea){if(_0x3d34ea){var _0x54c2bf=_0x3d34ea[_0x2211('0x54')]!==null;var _0x15df2d=path[_0x2211('0x55')](config[_0x2211('0x56')],_0x2211('0x57'));if(_0x54c2bf){_0x15df2d=path[_0x2211('0x55')](_0x15df2d,_0x2211('0x58'));}var _0x8c65b3=path['join'](_0x15df2d,_0x3d34ea[_0x2211('0x4f')]);return _0x2f2720[_0x2211('0x52')](_0x8c65b3);}})[_0x2211('0x42')](handleError(_0x2f2720,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b0dbe6f..4b5cf73 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 _0x804f=['attachments','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./attachment.attributes','exports','Attachment'];(function(_0xace29b,_0x529a09){var _0x373b71=function(_0x50748d){while(--_0x50748d){_0xace29b['push'](_0xace29b['shift']());}};_0x373b71(++_0x529a09);}(_0x804f,0x1b9));var _0xf804=function(_0x576267,_0x2906cf){_0x576267=_0x576267-0x0;var _0x22f0bd=_0x804f[_0x576267];return _0x22f0bd;};'use strict';var _=require(_0xf804('0x0'));var util=require(_0xf804('0x1'));var logger=require(_0xf804('0x2'))(_0xf804('0x3'));var moment=require(_0xf804('0x4'));var BPromise=require(_0xf804('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf804('0x6'));var config=require('../../config/environment');var attributes=require(_0xf804('0x7'));module[_0xf804('0x8')]=function(_0xb4631d,_0x1dcc81){return _0xb4631d['define'](_0xf804('0x9'),attributes,{'tableName':_0xf804('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4011=['path','../../config/environment','exports','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x4011,0x1bd));var _0x1401=function(_0x141fdf,_0x243c24){_0x141fdf=_0x141fdf-0x0;var _0x24cad9=_0x4011[_0x141fdf];return _0x24cad9;};'use strict';var _=require('lodash');var util=require(_0x1401('0x0'));var logger=require(_0x1401('0x1'))(_0x1401('0x2'));var moment=require(_0x1401('0x3'));var BPromise=require(_0x1401('0x4'));var rp=require(_0x1401('0x5'));var fs=require('fs');var path=require(_0x1401('0x6'));var rimraf=require('rimraf');var config=require(_0x1401('0x7'));var attributes=require('./attachment.attributes');module[_0x1401('0x8')]=function(_0x19ce30,_0xbe2dd){return _0x19ce30['define'](_0x1401('0x9'),attributes,{'tableName':_0x1401('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 4103dab..707b742 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 _0x9f94=['rpc','jayson/promise','client','http','Attachment,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2377ba,_0x32fdd9){var _0x39ec68=function(_0x2cb7e6){while(--_0x2cb7e6){_0x2377ba['push'](_0x2377ba['shift']());}};_0x39ec68(++_0x32fdd9);}(_0x9f94,0x1e7));var _0x49f9=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9f94[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});}exports[_0x49f9('0x14')]=function(_0x509610){var _0x3cc45e=this;return new Promise(function(_0x359d48,_0x32568b){return db[_0x49f9('0x15')][_0x49f9('0x16')](_0x509610[_0x49f9('0x17')],{'raw':_0x509610[_0x49f9('0x18')]?_0x509610[_0x49f9('0x18')][_0x49f9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f0bc9){logger[_0x49f9('0x11')]('CreateAttachment',_0x509610);logger[_0x49f9('0xd')]('CreateAttachment',_0x509610,JSON['stringify'](_0x4f0bc9));_0x359d48(_0x4f0bc9);})[_0x49f9('0x13')](function(_0xde1383){logger['error'](_0x49f9('0x14'),_0xde1383['message'],_0x509610);_0x32568b(_0x3cc45e['error'](0x1f4,_0xde1383[_0x49f9('0x10')]));});});};
\ No newline at end of file
+var _0xf290=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateAttachment','create','body','options','raw','util','bluebird','ioredis'];(function(_0x3b39af,_0x1878df){var _0x25f1ea=function(_0x493c27){while(--_0x493c27){_0x3b39af['push'](_0x3b39af['shift']());}};_0x25f1ea(++_0x1878df);}(_0xf290,0xde));var _0x0f29=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xf290[_0x685346];return _0x52e15b;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('Attachment,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});}exports[_0x0f29('0x14')]=function(_0x5d72a5){var _0x17b994=this;return new Promise(function(_0x4ca5e8,_0x5ddc74){return db['Attachment'][_0x0f29('0x15')](_0x5d72a5[_0x0f29('0x16')],{'raw':_0x5d72a5[_0x0f29('0x17')]?_0x5d72a5[_0x0f29('0x17')][_0x0f29('0x18')]===undefined?!![]:![]:!![]})[_0x0f29('0xa')](function(_0x150271){logger['info'](_0x0f29('0x14'),_0x5d72a5);logger['debug']('CreateAttachment',_0x5d72a5,JSON['stringify'](_0x150271));_0x4ca5e8(_0x150271);})['catch'](function(_0x38a1ce){logger[_0x0f29('0x10')]('CreateAttachment',_0x38a1ce[_0x0f29('0x12')],_0x5d72a5);_0x5ddc74(_0x17b994[_0x0f29('0x10')](0x1f4,_0x38a1ce[_0x0f29('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a3d7827..5975e62 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 _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(_0x189c31,_0x35b3d4){var _0x3bd2b5=function(_0x1ad22c){while(--_0x1ad22c){_0x189c31['push'](_0x189c31['shift']());}};_0x3bd2b5(++_0x35b3d4);}(_0xadb5,0xad));var _0x5adb=function(_0x48c6d0,_0x35e51c){_0x48c6d0=_0x48c6d0-0x0;var _0x440b7b=_0xadb5[_0x48c6d0];return _0x440b7b;};'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
+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(_0x569f1b,_0x28f4ae){var _0x56981f=function(_0x32dd9a){while(--_0x32dd9a){_0x569f1b['push'](_0x569f1b['shift']());}};_0x56981f(++_0x28f4ae);}(_0x2032,0xd9));var _0x2203=function(_0x3cbccd,_0x5606fd){_0x3cbccd=_0x3cbccd-0x0;var _0x532cd9=_0x2032[_0x3cbccd];return _0x532cd9;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index c31b4d0..3f5411f 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 _0xaaea=['getLicense','catch','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','password','User','passport','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','online','admin','user','blockDuration','minutes','clearBlockUser'];(function(_0x328090,_0x5a7215){var _0x114776=function(_0x4bc712){while(--_0x4bc712){_0x328090['push'](_0x328090['shift']());}};_0x114776(++_0x5a7215);}(_0xaaea,0xc1));var _0xaaae=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xaaea[_0x17d9e3];return _0x14192d;};'use strict';var passport=require(_0xaaae('0x0'));var LocalStrategy=require(_0xaaae('0x1'))[_0xaaae('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xaaae('0x3'));var BPromise=require(_0xaaae('0x4'));var util=require('util');var db=require(_0xaaae('0x5'))['db'];var authService=require(_0xaaae('0x6'));var utils=require(_0xaaae('0x7'));var config=require('../../config/environment');var logger=require(_0xaaae('0x8'))(_0xaaae('0x9'));function isActiveDirectoryConfigured(_0x25e775){var _0x4c972a=![];if(typeof _0x25e775[_0xaaae('0xa')]!=='undefined'){_0x4c972a=_0x25e775['activedirectory'][_0xaaae('0xb')]&&_0x25e775[_0xaaae('0xa')][_0xaaae('0xc')]&&_0x25e775['activedirectory'][_0xaaae('0xd')];}return _0x4c972a;}function adAuthenticate(_0x367b14,_0x394441,_0x45b3e3){return new BPromise(function(_0x445670,_0x1a6476){try{var _0x2e9536=new ActiveDirectory(_0x367b14);_0x2e9536['authenticate'](_0x394441,_0x45b3e3,function(_0x23dfe3,_0x424b6f){if(_0x23dfe3){logger[_0xaaae('0xe')](_0xaaae('0xf'),_0x394441,util[_0xaaae('0x10')](_0x23dfe3,{'showHidden':![],'depth':null}));_0x1a6476(_0xaaae('0x11'));}else if(!_0x424b6f){logger[_0xaaae('0xe')](_0xaaae('0x12'),_0x394441);_0x1a6476(_0xaaae('0x11'));}else{_0x445670(_0x424b6f);}});}catch(_0x455081){_0x1a6476(_0x455081);}});}function ActiveDirectoryAuthenticate(_0x95fb1c,_0x53056c,_0x4d0bc7,_0x3f1476){var _0x483971,_0x298df7;if(!isActiveDirectoryConfigured(config)){logger[_0xaaae('0xe')](_0xaaae('0x13'),_0x53056c);return _0x3f1476(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xaaae('0x14')][_0xaaae('0x15')]({'where':{'id':0x1},'attributes':[_0xaaae('0x16'),'blockDuration'],'raw':!![]})[_0xaaae('0x17')](function(_0x58fd67){_0x483971=_0x58fd67;if(!_0x483971[_0xaaae('0x16')]){logger[_0xaaae('0xe')](_0xaaae('0x18'),_0x53056c);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x95fb1c[_0xaaae('0x15')]({'attributes':['id',_0xaaae('0x19'),'password',_0xaaae('0x1a'),_0xaaae('0x1b'),_0xaaae('0x1c'),_0xaaae('0x1d'),_0xaaae('0x1e'),_0xaaae('0x1f')],'where':{'name':_0x53056c,'role':{'$or':[_0xaaae('0x20'),_0xaaae('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0xaaae('0x17')](function(_0x649671){if(!_0x649671||_0x649671&&_0x649671[_0xaaae('0x19')]!==_0x53056c){throw new Error(_0xaaae('0x11'));}_0x298df7=_0x649671;var _0x46a5b4=_0x298df7[_0xaaae('0x19')]+'@'+config['activedirectory'][_0xaaae('0xd')];return adAuthenticate(config[_0xaaae('0xa')],_0x46a5b4,_0x4d0bc7);})[_0xaaae('0x17')](function(_0x4e7a24){if(_0x298df7['disabled']){throw new Error(_0xaaae('0x11'));}if(_0x483971[_0xaaae('0x22')]>0x0){if(_0x298df7[_0xaaae('0x1d')]){if(moment(_0x298df7[_0xaaae('0x1e')])['add'](_0x483971['blockDuration'],_0xaaae('0x23'))>moment()){throw new Error(_0xaaae('0x11'));}return utils[_0xaaae('0x24')](_0x298df7,0x0,![],null)['then'](function(){return utils['getLicense'](_0x298df7);})[_0xaaae('0x17')](function(){return _0x3f1476(null,_0x298df7);});}else{return utils[_0xaaae('0x25')](_0x298df7)[_0xaaae('0x17')](function(){return _0x3f1476(null,_0x298df7);});}}else{return utils[_0xaaae('0x25')](_0x298df7)['then'](function(){return _0x3f1476(null,_0x298df7);});}})[_0xaaae('0x26')](function(_0x2e38df){return _0x3f1476(null,![],_0x2e38df);});}function handleError(_0x333fd9,_0x1c5d9e,_0xdbb26e){return _0x333fd9['status'](_0x1c5d9e||0x1f4)[_0xaaae('0x27')]({'message':_0xdbb26e?_0xdbb26e['message']||_0xdbb26e:''});}exports['login']=function(_0x3b8454,_0x4be37f,_0x4f4dca){passport['authenticate'](_0xaaae('0x28'),function(_0x3ad94f,_0x516ce1,_0x188888){var _0x18e653=_0x3ad94f||_0x188888;if(_0x18e653){return handleError(_0x4be37f,0x191,_0x18e653);}if(!_0x516ce1){return handleError(_0x4be37f,0x194,{'message':_0xaaae('0x29')});}else{var _0x4a5fcd={'payload':{'id':_0x516ce1['id'],'role':_0x516ce1['role']},'options':{'expiresIn':0x15180}};return authService[_0xaaae('0x2a')](_0x4a5fcd)['then'](function(_0x1aa006){_0x4be37f[_0xaaae('0x2b')]({'id':_0x516ce1['id'],'token':_0x1aa006,'statusCall':'','isAlreadyLogged':_0x516ce1[_0xaaae('0x1f')]});});}})(_0x3b8454,_0x4be37f,_0x4f4dca);};passport['use'](_0xaaae('0x28'),new LocalStrategy({'usernameField':_0xaaae('0x19'),'passwordField':_0xaaae('0x2c')},function(_0x48ac6e,_0x37d3bd,_0x4cf8d9){return ActiveDirectoryAuthenticate(db[_0xaaae('0x2d')],_0x48ac6e,_0x37d3bd,_0x4cf8d9);}));
\ No newline at end of file
+var _0xdcbc=['disabled','minutes','getLicense','catch','status','send','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','password','User','passport','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','Error\x20authenticate\x20%s:\x20%s','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','blocked','blockedAt','online','admin','user','agent'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xdcbc,0x16c));var _0xcdcb=function(_0x1b7e31,_0x230644){_0x1b7e31=_0x1b7e31-0x0;var _0x2220d5=_0xdcbc[_0x1b7e31];return _0x2220d5;};'use strict';var passport=require(_0xcdcb('0x0'));var LocalStrategy=require(_0xcdcb('0x1'))[_0xcdcb('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xcdcb('0x3'));var BPromise=require(_0xcdcb('0x4'));var util=require('util');var db=require(_0xcdcb('0x5'))['db'];var authService=require(_0xcdcb('0x6'));var utils=require('../../config/utils');var config=require(_0xcdcb('0x7'));var logger=require('../../config/logger')(_0xcdcb('0x8'));function isActiveDirectoryConfigured(_0x4ebdf1){var _0x21b62e=![];if(typeof _0x4ebdf1[_0xcdcb('0x9')]!==_0xcdcb('0xa')){_0x21b62e=_0x4ebdf1[_0xcdcb('0x9')][_0xcdcb('0xb')]&&_0x4ebdf1[_0xcdcb('0x9')][_0xcdcb('0xc')]&&_0x4ebdf1[_0xcdcb('0x9')][_0xcdcb('0xd')];}return _0x21b62e;}function adAuthenticate(_0x57d81d,_0x57e6d0,_0x1accb6){return new BPromise(function(_0x105844,_0x71bf06){try{var _0x2781e1=new ActiveDirectory(_0x57d81d);_0x2781e1['authenticate'](_0x57e6d0,_0x1accb6,function(_0x40ee2,_0x925488){if(_0x40ee2){logger['error'](_0xcdcb('0xe'),_0x57e6d0,util['inspect'](_0x40ee2,{'showHidden':![],'depth':null}));_0x71bf06('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x925488){logger[_0xcdcb('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x57e6d0);_0x71bf06(_0xcdcb('0x10'));}else{_0x105844(_0x925488);}});}catch(_0x4bfcb1){_0x71bf06(_0x4bfcb1);}});}function ActiveDirectoryAuthenticate(_0x5b891c,_0x5f285a,_0xed035,_0x53f7bc){var _0x2074c5,_0x288402;if(!isActiveDirectoryConfigured(config)){logger[_0xcdcb('0xf')](_0xcdcb('0x11'),_0x5f285a);return _0x53f7bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xcdcb('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xcdcb('0x13'),_0xcdcb('0x14')],'raw':!![]})[_0xcdcb('0x15')](function(_0x3e6913){_0x2074c5=_0x3e6913;if(!_0x2074c5[_0xcdcb('0x13')]){logger[_0xcdcb('0xf')](_0xcdcb('0x16'),_0x5f285a);throw new Error(_0xcdcb('0x10'));}return _0x5b891c['findOne']({'attributes':['id',_0xcdcb('0x17'),'password',_0xcdcb('0x18'),_0xcdcb('0x19'),'disabled',_0xcdcb('0x1a'),_0xcdcb('0x1b'),_0xcdcb('0x1c')],'where':{'name':_0x5f285a,'role':{'$or':[_0xcdcb('0x1d'),_0xcdcb('0x1e'),_0xcdcb('0x1f')]},'adSsoEnabled':!![]}});})[_0xcdcb('0x15')](function(_0x15306b){if(!_0x15306b||_0x15306b&&_0x15306b[_0xcdcb('0x17')]!==_0x5f285a){throw new Error(_0xcdcb('0x10'));}_0x288402=_0x15306b;var _0x400810=_0x288402[_0xcdcb('0x17')]+'@'+config[_0xcdcb('0x9')][_0xcdcb('0xd')];return adAuthenticate(config[_0xcdcb('0x9')],_0x400810,_0xed035);})[_0xcdcb('0x15')](function(_0x4905aa){if(_0x288402[_0xcdcb('0x20')]){throw new Error(_0xcdcb('0x10'));}if(_0x2074c5[_0xcdcb('0x14')]>0x0){if(_0x288402[_0xcdcb('0x1a')]){if(moment(_0x288402['blockedAt'])['add'](_0x2074c5[_0xcdcb('0x14')],_0xcdcb('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x288402,0x0,![],null)[_0xcdcb('0x15')](function(){return utils[_0xcdcb('0x22')](_0x288402);})[_0xcdcb('0x15')](function(){return _0x53f7bc(null,_0x288402);});}else{return utils['getLicense'](_0x288402)['then'](function(){return _0x53f7bc(null,_0x288402);});}}else{return utils[_0xcdcb('0x22')](_0x288402)['then'](function(){return _0x53f7bc(null,_0x288402);});}})[_0xcdcb('0x23')](function(_0xb5d770){return _0x53f7bc(null,![],_0xb5d770);});}function handleError(_0xc43b03,_0x2c5fb1,_0x23ad93){return _0xc43b03[_0xcdcb('0x24')](_0x2c5fb1||0x1f4)[_0xcdcb('0x25')]({'message':_0x23ad93?_0x23ad93['message']||_0x23ad93:''});}exports[_0xcdcb('0x26')]=function(_0x334b40,_0x1ac462,_0x4eedfa){passport[_0xcdcb('0x27')](_0xcdcb('0x28'),function(_0x4834fd,_0x39d7db,_0x1284e9){var _0x58f89f=_0x4834fd||_0x1284e9;if(_0x58f89f){return handleError(_0x1ac462,0x191,_0x58f89f);}if(!_0x39d7db){return handleError(_0x1ac462,0x194,{'message':_0xcdcb('0x29')});}else{var _0x4c951b={'payload':{'id':_0x39d7db['id'],'role':_0x39d7db[_0xcdcb('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4c951b)[_0xcdcb('0x15')](function(_0x4e90d5){_0x1ac462['json']({'id':_0x39d7db['id'],'token':_0x4e90d5,'statusCall':'','isAlreadyLogged':_0x39d7db['online']});});}})(_0x334b40,_0x1ac462,_0x4eedfa);};passport['use'](_0xcdcb('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0xcdcb('0x2a')},function(_0x59270d,_0x2a2a31,_0x24924e){return ActiveDirectoryAuthenticate(db[_0xcdcb('0x2b')],_0x59270d,_0x2a2a31,_0x24924e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 3949440..bb153d7 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 _0x0690=['Router','./authActiveDirectory.controller','login','exports','express'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x0690,0x1d5));var _0x0069=function(_0x43f5ef,_0x1cb570){_0x43f5ef=_0x43f5ef-0x0;var _0x1cbff7=_0x0690[_0x43f5ef];return _0x1cbff7;};'use strict';var express=require(_0x0069('0x0'));var router=express[_0x0069('0x1')]();var controller=require(_0x0069('0x2'));router['post']('/',controller[_0x0069('0x3')]);module[_0x0069('0x4')]=router;
\ No newline at end of file
+var _0x5a47=['express','./authActiveDirectory.controller','post','exports'];(function(_0x62360d,_0x5a06f2){var _0x1fea1d=function(_0x32939b){while(--_0x32939b){_0x62360d['push'](_0x62360d['shift']());}};_0x1fea1d(++_0x5a06f2);}(_0x5a47,0x124));var _0x75a4=function(_0xf4a467,_0x3d2b5e){_0xf4a467=_0xf4a467-0x0;var _0x22c3bf=_0x5a47[_0xf4a467];return _0x22c3bf;};'use strict';var express=require(_0x75a4('0x0'));var router=express['Router']();var controller=require(_0x75a4('0x1'));router[_0x75a4('0x2')]('/',controller['login']);module[_0x75a4('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 5bebf13..e5508a3 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x37f6e3,_0x157758){var _0x15a502=function(_0x19e4d0){while(--_0x19e4d0){_0x37f6e3['push'](_0x37f6e3['shift']());}};_0x15a502(++_0x157758);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ 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(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x7a54,0x106));var _0x47a5=function(_0x424242,_0x1a3ff1){_0x424242=_0x424242-0x0;var _0x5b2342=_0x7a54[_0x424242];return _0x5b2342;};'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 fe9dab4..161832f 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 _0xdb13=['callback','isMiddleware','login','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback'];(function(_0x59d15a,_0x194286){var _0xbe0075=function(_0x1d8c75){while(--_0x1d8c75){_0x59d15a['push'](_0x59d15a['shift']());}};_0xbe0075(++_0x194286);}(_0xdb13,0x10c));var _0x3db1=function(_0x3dfee5,_0x5ab75e){_0x3dfee5=_0x3dfee5-0x0;var _0x116981=_0xdb13[_0x3dfee5];return _0x116981;};'use strict';var express=require('express');var passport=require(_0x3db1('0x0'));var router=express[_0x3db1('0x1')]();var controller=require(_0x3db1('0x2'));var userController=require(_0x3db1('0x3'));var authService=require(_0x3db1('0x4'));router[_0x3db1('0x5')]('/',controller['login']);router[_0x3db1('0x5')](_0x3db1('0x6'),controller[_0x3db1('0x7')],authService[_0x3db1('0x8')],userController[_0x3db1('0x9')],authService['setTokenCookie']);module[_0x3db1('0xa')]=router;
\ No newline at end of file
+var _0x447b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','express','passport'];(function(_0x1a30ea,_0x22bf39){var _0x36b8f2=function(_0x32fbbb){while(--_0x32fbbb){_0x1a30ea['push'](_0x1a30ea['shift']());}};_0x36b8f2(++_0x22bf39);}(_0x447b,0xe4));var _0xb447=function(_0x49a2b4,_0x44b9ab){_0x49a2b4=_0x49a2b4-0x0;var _0x4c0ca4=_0x447b[_0x49a2b4];return _0x4c0ca4;};'use strict';var express=require(_0xb447('0x0'));var passport=require(_0xb447('0x1'));var router=express['Router']();var controller=require(_0xb447('0x2'));var userController=require(_0xb447('0x3'));var authService=require(_0xb447('0x4'));router[_0xb447('0x5')]('/',controller[_0xb447('0x6')]);router[_0xb447('0x5')](_0xb447('0x7'),controller[_0xb447('0x8')],authService[_0xb447('0x9')],userController[_0xb447('0x6')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 98409be..09e2a83 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 _0x4c6d=['stringify','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','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','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','catch','use','util','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','clearBlockUser','then','minutes','getLicense','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x28019c,_0x67743){var _0x48ca39=function(_0x4c161e){while(--_0x4c161e){_0x28019c['push'](_0x28019c['shift']());}};_0x48ca39(++_0x67743);}(_0x4c6d,0x1d5));var _0xd4c6=function(_0x29ebb8,_0x51d0d8){_0x29ebb8=_0x29ebb8-0x0;var _0x10c623=_0x4c6d[_0x29ebb8];return _0x10c623;};'use strict';var util=require(_0xd4c6('0x0'));var passport=require('passport');var LocalStrategy=require(_0xd4c6('0x1'))[_0xd4c6('0x2')];var jayson=require('jayson/promise');var _=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var moment=require('moment');var db=require(_0xd4c6('0x5'))['db'];var authService=require(_0xd4c6('0x6'));var utils=require(_0xd4c6('0x7'));var client=jayson[_0xd4c6('0x8')][_0xd4c6('0x9')]({'port':0x232b});function localAuthenticate(_0x93f47f,_0x5d009e,_0x158328,_0x5b5654){var _0x2229f7,_0x49eaa2;return db[_0xd4c6('0xa')][_0xd4c6('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd4c6('0xc')],'raw':!![]})['then'](function(_0x507b32){_0x2229f7=_0x507b32;return _0x93f47f['findOne']({'attributes':['id',_0xd4c6('0xd'),_0xd4c6('0xe'),_0xd4c6('0xf'),_0xd4c6('0x10'),_0xd4c6('0x11'),_0xd4c6('0x12'),_0xd4c6('0x13'),'loginAttempts'],'where':{'name':_0x5d009e,'role':{'$or':[_0xd4c6('0x14'),'user',_0xd4c6('0x15')]}}});})['then'](function(_0x5a0855){if(!_0x5a0855||_0x5a0855&&_0x5a0855[_0xd4c6('0xd')]!==_0x5d009e){throw new Error(_0xd4c6('0x16'));}else{_0x49eaa2=_0x5a0855;return _0x49eaa2;}})['then'](function(){_0x49eaa2[_0xd4c6('0x17')](_0x158328,function(_0x302462,_0x78812c){var _0x1cf110=_0x49eaa2['loginAttempts']+0x1;if(_0x302462){return _0x5b5654(_0x302462);}else if(!_0x78812c){if(_0x49eaa2['disabled']){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else if(_0x2229f7[_0xd4c6('0x18')]>0x0){if(_0x49eaa2[_0xd4c6('0x12')]){if(_0x2229f7[_0xd4c6('0xc')]>0x0){if(moment(_0x49eaa2['blockedAt'])['add'](_0x2229f7[_0xd4c6('0xc')],'minutes')>moment()){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else{return utils[_0xd4c6('0x19')](_0x49eaa2,_0x1cf110,![],null)[_0xd4c6('0x1a')](function(){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});});}}else{return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}}else{if(_0x1cf110>=_0x2229f7['allowedLoginAttempts']){return utils[_0xd4c6('0x19')](_0x49eaa2,0x0,!![],moment())['then'](function(){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});});}else{return utils[_0xd4c6('0x19')](_0x49eaa2,_0x1cf110,![],null)[_0xd4c6('0x1a')](function(){return _0x5b5654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}}else{if(_0x49eaa2['disabled']){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else if(_0x2229f7[_0xd4c6('0x18')]>0x0){if(_0x49eaa2[_0xd4c6('0x12')]){if(_0x2229f7[_0xd4c6('0xc')]>0x0){if(moment(_0x49eaa2[_0xd4c6('0x13')])['add'](_0x2229f7['blockDuration'],_0xd4c6('0x1b'))>moment()){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else{return utils[_0xd4c6('0x19')](_0x49eaa2,0x0,![],null)[_0xd4c6('0x1a')](function(){return utils[_0xd4c6('0x1c')](_0x49eaa2);})[_0xd4c6('0x1a')](function(){return _0x5b5654(null,_0x49eaa2);});}}else{return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}}else{return utils[_0xd4c6('0x19')](_0x49eaa2,0x0,![],null)[_0xd4c6('0x1a')](function(){return utils[_0xd4c6('0x1c')](_0x49eaa2);})[_0xd4c6('0x1a')](function(){return _0x5b5654(null,_0x49eaa2);})['catch'](function(_0x4cfac3){return _0x5b5654(null,![],_0x4cfac3);});}}else{if(_0x49eaa2['blocked']){return _0x5b5654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xd4c6('0x1c')](_0x49eaa2)[_0xd4c6('0x1a')](function(){return _0x5b5654(null,_0x49eaa2);});}}}});})['catch'](function(_0x35f6aa){return _0x5b5654(null,![],_0x35f6aa);});}function sendServiceMail(_0x2b67e9){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xd4c6('0xd'),'email'],'include':[{'model':db[_0xd4c6('0x1d')],'as':_0xd4c6('0x1e'),'include':[{'model':db[_0xd4c6('0x1f')],'as':'CloudProvider'}]}]})['then'](function(_0x5d6090){if(!_0x5d6090){throw new Error(_0xd4c6('0x20'));}var _0x12d9fa=_0x5d6090[_0xd4c6('0x21')]();var _0x19e3e7={'account':_0x12d9fa,'message':_[_0xd4c6('0x22')]({'from':util[_0xd4c6('0x23')]('\x22%s\x22\x20<%s>',_0x5d6090[_0xd4c6('0xd')],_0x5d6090['email']||_0x5d6090['Smtp'][_0xd4c6('0x24')])},_0x2b67e9)};return client[_0xd4c6('0x25')](_0xd4c6('0x26'),_0x19e3e7);})[_0xd4c6('0x1a')](function(_0x153762){if(_0x153762[_0xd4c6('0x27')]){throw new Error(util[_0xd4c6('0x23')](_0xd4c6('0x28'),_0x153762['error']['message']||JSON[_0xd4c6('0x29')](_0x153762['error'])));}return!![];});}function handleError(_0x5f366c,_0x41b608,_0x1489f0){return _0x5f366c['status'](_0x41b608||0x1f4)['send']({'message':_0x1489f0?_0x1489f0[_0xd4c6('0x2a')]||_0x1489f0:''});}exports[_0xd4c6('0x2b')]=function(_0x3ebe85,_0x54fbf7,_0x3ec4b1){passport[_0xd4c6('0x17')](_0xd4c6('0x2c'),function(_0x4fe21a,_0x3a4baa,_0x2ae29e){var _0x26992d=_0x4fe21a||_0x2ae29e;if(_0x26992d){return handleError(_0x54fbf7,0x191,_0x26992d);}if(!_0x3a4baa){return handleError(_0x54fbf7,0x194,{'message':_0xd4c6('0x2d')});}else{var _0x5871a6={'payload':{'id':_0x3a4baa['id'],'role':_0x3a4baa[_0xd4c6('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xd4c6('0x2e')](_0x5871a6)['then'](function(_0x92d5f9){_0x54fbf7[_0xd4c6('0x2f')]({'id':_0x3a4baa['id'],'token':_0x92d5f9,'statusCall':'','isAlreadyLogged':_0x3a4baa[_0xd4c6('0x30')]});});}})(_0x3ebe85,_0x54fbf7,_0x3ec4b1);};exports['forgot']=function(_0x3cab44,_0x466509){if(!_0x3cab44['body'][_0xd4c6('0x31')]){return handleError(_0x466509,0x1f4,{'message':_0xd4c6('0x32')});}var _0x3165a9=rs[_0xd4c6('0x33')]();_0x3cab44[_0xd4c6('0x34')][_0xd4c6('0x31')]=_0x3cab44[_0xd4c6('0x34')][_0xd4c6('0x31')][_0xd4c6('0x35')]()[_0xd4c6('0x36')]();var _0x193d21;return db[_0xd4c6('0xa')][_0xd4c6('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd4c6('0xc')],'raw':!![]})['then'](function(_0x34bb56){_0x193d21=_0x34bb56;return db['User'][_0xd4c6('0x37')]({'where':{'email':_0x3cab44['body'][_0xd4c6('0x31')]}});})[_0xd4c6('0x1a')](function(_0x934911){if(!_0x934911){throw new Error(_0xd4c6('0x38'));}if(_0x934911[_0xd4c6('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x934911[_0xd4c6('0x12')]){if(moment(_0x934911[_0xd4c6('0x13')])[_0xd4c6('0x39')](_0x193d21['blockDuration'],_0xd4c6('0x1b'))>moment()){throw new Error(_0xd4c6('0x3a'));}else{_0x934911[_0xd4c6('0x12')]=![];_0x934911['blockedAt']=null;}}_0x934911[_0xd4c6('0x3b')]=_0x3165a9;_0x934911[_0xd4c6('0x3c')]=Date[_0xd4c6('0x3d')]()+0x36ee80;return _0x934911[_0xd4c6('0x3e')]();})['then'](function(){return sendServiceMail({'to':_0x3cab44['body'][_0xd4c6('0x31')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd4c6('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xd4c6('0x40')+_0x3cab44[_0xd4c6('0x41')][_0xd4c6('0x42')]+_0xd4c6('0x43')+_0x3165a9+'\x0a\x0a'+_0xd4c6('0x44')});})['then'](function(){_0x466509['status'](0xc8)[_0xd4c6('0x45')]({'message':_0xd4c6('0x46')});})['catch'](function(_0x13e15f){return handleError(_0x466509,0x1f4,_0x13e15f);});};exports[_0xd4c6('0x47')]=function(_0x446b4e,_0x4b79d0){return db[_0xd4c6('0x48')][_0xd4c6('0x37')]({'where':{'resetPasswordToken':_0x446b4e[_0xd4c6('0x49')][_0xd4c6('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xd4c6('0x3d')]()}}})[_0xd4c6('0x1a')](function(_0x347293){if(!_0x347293){throw new Error(_0xd4c6('0x4b'));}return db[_0xd4c6('0xa')][_0xd4c6('0xb')]({'attributes':['id','securePassword',_0xd4c6('0x4c'),_0xd4c6('0x4d')]})[_0xd4c6('0x1a')](function(_0x3aa821){if(_0x3aa821[_0xd4c6('0x4e')])authService[_0xd4c6('0x4f')](_0x446b4e[_0xd4c6('0x34')][_0xd4c6('0xe')]);if(!_0x3aa821[_0xd4c6('0x4c')]||!_0x347293[_0xd4c6('0x50')])return _0x347293;authService[_0xd4c6('0x51')](_0x446b4e[_0xd4c6('0x34')][_0xd4c6('0xe')],_0x347293['previousPasswords'],_0x3aa821[_0xd4c6('0x4d')]);return _0x347293;})['then'](function(){_0x347293[_0xd4c6('0xe')]=_0x446b4e['body']['password'];_0x347293[_0xd4c6('0x3b')]=null;_0x347293[_0xd4c6('0x3c')]=null;return _0x347293[_0xd4c6('0x3e')]();});})[_0xd4c6('0x1a')](function(){_0x4b79d0['status'](0xc8)[_0xd4c6('0x45')]({'message':_0xd4c6('0x52')});})[_0xd4c6('0x53')](function(_0x4cf124){return handleError(_0x4b79d0,0x1f4,_0x4cf124);});};passport[_0xd4c6('0x54')](_0xd4c6('0x2c'),new LocalStrategy({'usernameField':_0xd4c6('0xd'),'passwordField':_0xd4c6('0xe')},function(_0xdbc573,_0x1a0015,_0x1803d7){return localAuthenticate(db['User'],_0xdbc573,_0x1a0015,_0x1803d7);}));
\ No newline at end of file
+var _0xd0ea=['salt','role','disabled','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockDuration','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','randomstring','../../components/auth/service','../../config/utils','client','http','findOne','then','name'];(function(_0x264d8e,_0x19ba32){var _0x4e04ee=function(_0x28c532){while(--_0x28c532){_0x264d8e['push'](_0x264d8e['shift']());}};_0x4e04ee(++_0x19ba32);}(_0xd0ea,0xe7));var _0xad0e=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xd0ea[_0x29dda1];return _0x21b0ef;};'use strict';var util=require(_0xad0e('0x0'));var passport=require(_0xad0e('0x1'));var LocalStrategy=require(_0xad0e('0x2'))[_0xad0e('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xad0e('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xad0e('0x5'));var utils=require(_0xad0e('0x6'));var client=jayson[_0xad0e('0x7')][_0xad0e('0x8')]({'port':0x232b});function localAuthenticate(_0x1f0d71,_0x3e3e55,_0x22e6b9,_0x201e29){var _0x16bc25,_0x32d8fd;return db['Setting'][_0xad0e('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xad0e('0xa')](function(_0x1dd9c7){_0x16bc25=_0x1dd9c7;return _0x1f0d71['findOne']({'attributes':['id',_0xad0e('0xb'),'password',_0xad0e('0xc'),_0xad0e('0xd'),_0xad0e('0xe'),'blocked',_0xad0e('0xf'),_0xad0e('0x10')],'where':{'name':_0x3e3e55,'role':{'$or':['admin',_0xad0e('0x11'),_0xad0e('0x12')]}}});})[_0xad0e('0xa')](function(_0xbed350){if(!_0xbed350||_0xbed350&&_0xbed350[_0xad0e('0xb')]!==_0x3e3e55){throw new Error(_0xad0e('0x13'));}else{_0x32d8fd=_0xbed350;return _0x32d8fd;}})['then'](function(){_0x32d8fd['authenticate'](_0x22e6b9,function(_0x9989bb,_0x840f13){var _0x3b8e27=_0x32d8fd[_0xad0e('0x10')]+0x1;if(_0x9989bb){return _0x201e29(_0x9989bb);}else if(!_0x840f13){if(_0x32d8fd[_0xad0e('0xe')]){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else if(_0x16bc25['allowedLoginAttempts']>0x0){if(_0x32d8fd[_0xad0e('0x14')]){if(_0x16bc25[_0xad0e('0x15')]>0x0){if(moment(_0x32d8fd[_0xad0e('0xf')])[_0xad0e('0x16')](_0x16bc25[_0xad0e('0x15')],_0xad0e('0x17'))>moment()){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else{return utils[_0xad0e('0x18')](_0x32d8fd,_0x3b8e27,![],null)[_0xad0e('0xa')](function(){return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3b8e27>=_0x16bc25[_0xad0e('0x19')]){return utils[_0xad0e('0x18')](_0x32d8fd,0x0,!![],moment())[_0xad0e('0xa')](function(){return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xad0e('0x18')](_0x32d8fd,_0x3b8e27,![],null)[_0xad0e('0xa')](function(){return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x201e29(null,![],{'message':_0xad0e('0x13')});}}else{if(_0x32d8fd[_0xad0e('0xe')]){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else if(_0x16bc25[_0xad0e('0x19')]>0x0){if(_0x32d8fd[_0xad0e('0x14')]){if(_0x16bc25['blockDuration']>0x0){if(moment(_0x32d8fd[_0xad0e('0xf')])['add'](_0x16bc25[_0xad0e('0x15')],'minutes')>moment()){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else{return utils['clearBlockUser'](_0x32d8fd,0x0,![],null)[_0xad0e('0xa')](function(){return utils[_0xad0e('0x1a')](_0x32d8fd);})[_0xad0e('0xa')](function(){return _0x201e29(null,_0x32d8fd);});}}else{return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xad0e('0x18')](_0x32d8fd,0x0,![],null)[_0xad0e('0xa')](function(){return utils[_0xad0e('0x1a')](_0x32d8fd);})[_0xad0e('0xa')](function(){return _0x201e29(null,_0x32d8fd);})[_0xad0e('0x1b')](function(_0x19b2b3){return _0x201e29(null,![],_0x19b2b3);});}}else{if(_0x32d8fd[_0xad0e('0x14')]){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else{return utils[_0xad0e('0x1a')](_0x32d8fd)['then'](function(){return _0x201e29(null,_0x32d8fd);});}}}});})[_0xad0e('0x1b')](function(_0x5261db){return _0x201e29(null,![],_0x5261db);});}function sendServiceMail(_0x5710e8){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xad0e('0xb'),_0xad0e('0x1c')],'include':[{'model':db[_0xad0e('0x1d')],'as':'Smtp','include':[{'model':db[_0xad0e('0x1e')],'as':'CloudProvider'}]}]})[_0xad0e('0xa')](function(_0x2ba2da){if(!_0x2ba2da){throw new Error(_0xad0e('0x1f'));}var _0x49bca7=_0x2ba2da[_0xad0e('0x20')]();var _0x377412={'account':_0x49bca7,'message':_[_0xad0e('0x21')]({'from':util['format'](_0xad0e('0x22'),_0x2ba2da[_0xad0e('0xb')],_0x2ba2da[_0xad0e('0x1c')]||_0x2ba2da['Smtp'][_0xad0e('0x11')])},_0x5710e8)};return client[_0xad0e('0x23')](_0xad0e('0x24'),_0x377412);})[_0xad0e('0xa')](function(_0x1a9db6){if(_0x1a9db6[_0xad0e('0x25')]){throw new Error(util[_0xad0e('0x26')](_0xad0e('0x27'),_0x1a9db6['error'][_0xad0e('0x28')]||JSON[_0xad0e('0x29')](_0x1a9db6[_0xad0e('0x25')])));}return!![];});}function handleError(_0x24ee7c,_0x34b901,_0x42005e){return _0x24ee7c['status'](_0x34b901||0x1f4)[_0xad0e('0x2a')]({'message':_0x42005e?_0x42005e[_0xad0e('0x28')]||_0x42005e:''});}exports[_0xad0e('0x2b')]=function(_0x177dbb,_0x45504b,_0x1d8c61){passport[_0xad0e('0x2c')](_0xad0e('0x2d'),function(_0x4cab4f,_0x291c83,_0x2f0937){var _0x2805be=_0x4cab4f||_0x2f0937;if(_0x2805be){return handleError(_0x45504b,0x191,_0x2805be);}if(!_0x291c83){return handleError(_0x45504b,0x194,{'message':_0xad0e('0x2e')});}else{var _0x4ebe9a={'payload':{'id':_0x291c83['id'],'role':_0x291c83[_0xad0e('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xad0e('0x2f')](_0x4ebe9a)['then'](function(_0x36166a){_0x45504b[_0xad0e('0x30')]({'id':_0x291c83['id'],'token':_0x36166a,'statusCall':'','isAlreadyLogged':_0x291c83[_0xad0e('0x31')]});});}})(_0x177dbb,_0x45504b,_0x1d8c61);};exports['forgot']=function(_0x449210,_0x32ae33){if(!_0x449210[_0xad0e('0x32')][_0xad0e('0x1c')]){return handleError(_0x32ae33,0x1f4,{'message':_0xad0e('0x33')});}var _0xef2c70=rs[_0xad0e('0x34')]();_0x449210[_0xad0e('0x32')]['email']=_0x449210[_0xad0e('0x32')][_0xad0e('0x1c')][_0xad0e('0x35')]()[_0xad0e('0x36')]();var _0xb91e5e;return db[_0xad0e('0x37')][_0xad0e('0x9')]({'where':{'id':0x1},'attributes':[_0xad0e('0x19'),'blockDuration'],'raw':!![]})[_0xad0e('0xa')](function(_0x588111){_0xb91e5e=_0x588111;return db[_0xad0e('0x38')][_0xad0e('0x39')]({'where':{'email':_0x449210['body']['email']}});})[_0xad0e('0xa')](function(_0x4e66bb){if(!_0x4e66bb){throw new Error(_0xad0e('0x3a'));}if(_0x4e66bb[_0xad0e('0xe')]){throw new Error(_0xad0e('0x3b'));}if(_0x4e66bb['blocked']){if(moment(_0x4e66bb['blockedAt'])[_0xad0e('0x16')](_0xb91e5e[_0xad0e('0x15')],_0xad0e('0x17'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4e66bb[_0xad0e('0x14')]=![];_0x4e66bb['blockedAt']=null;}}_0x4e66bb[_0xad0e('0x3c')]=_0xef2c70;_0x4e66bb['resetPasswordExpires']=Date[_0xad0e('0x3d')]()+0x36ee80;return _0x4e66bb['save']();})[_0xad0e('0xa')](function(){return sendServiceMail({'to':_0x449210[_0xad0e('0x32')][_0xad0e('0x1c')],'subject':_0xad0e('0x3e'),'text':'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://'+_0x449210[_0xad0e('0x3f')][_0xad0e('0x40')]+_0xad0e('0x41')+_0xef2c70+'\x0a\x0a'+_0xad0e('0x42')});})[_0xad0e('0xa')](function(){_0x32ae33[_0xad0e('0x43')](0xc8)[_0xad0e('0x2a')]({'message':'Reset\x20Email\x20sent!'});})[_0xad0e('0x1b')](function(_0x42d322){return handleError(_0x32ae33,0x1f4,_0x42d322);});};exports['reset']=function(_0x184a7b,_0x407b92){return db['User'][_0xad0e('0x39')]({'where':{'resetPasswordToken':_0x184a7b[_0xad0e('0x44')][_0xad0e('0x45')],'resetPasswordExpires':{'$gt':Date[_0xad0e('0x3d')]()}}})[_0xad0e('0xa')](function(_0xcc8e83){if(!_0xcc8e83){throw new Error(_0xad0e('0x46'));}return db[_0xad0e('0x37')]['findOne']({'attributes':['id',_0xad0e('0x47'),'enforcePasswordHistory',_0xad0e('0x48')]})[_0xad0e('0xa')](function(_0x314e9e){if(_0x314e9e[_0xad0e('0x47')])authService[_0xad0e('0x49')](_0x184a7b['body'][_0xad0e('0x4a')]);if(!_0x314e9e[_0xad0e('0x4b')]||!_0xcc8e83[_0xad0e('0x4c')])return _0xcc8e83;authService[_0xad0e('0x4d')](_0x184a7b[_0xad0e('0x32')]['password'],_0xcc8e83['previousPasswords'],_0x314e9e[_0xad0e('0x48')]);return _0xcc8e83;})['then'](function(){_0xcc8e83['password']=_0x184a7b['body'][_0xad0e('0x4a')];_0xcc8e83['resetPasswordToken']=null;_0xcc8e83[_0xad0e('0x4e')]=null;return _0xcc8e83['save']();});})['then'](function(){_0x407b92[_0xad0e('0x43')](0xc8)[_0xad0e('0x2a')]({'message':_0xad0e('0x4f')});})[_0xad0e('0x1b')](function(_0x576c2a){return handleError(_0x407b92,0x1f4,_0x576c2a);});};passport[_0xad0e('0x50')](_0xad0e('0x2d'),new LocalStrategy({'usernameField':_0xad0e('0xb'),'passwordField':'password'},function(_0x4d36bd,_0x3ddd08,_0x2bcc77){return localAuthenticate(db['User'],_0x4d36bd,_0x3ddd08,_0x2bcc77);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 0345e77..83737e9 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 _0x5c67=['/forgot','forgot','exports','express','Router','./authLocal.controller','post','login'];(function(_0x50ea7f,_0x5322bd){var _0x4aab5a=function(_0x4b9517){while(--_0x4b9517){_0x50ea7f['push'](_0x50ea7f['shift']());}};_0x4aab5a(++_0x5322bd);}(_0x5c67,0x173));var _0x75c6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5c67[_0x397e5f];return _0x5302b8;};'use strict';var express=require(_0x75c6('0x0'));var router=express[_0x75c6('0x1')]();var controller=require(_0x75c6('0x2'));router[_0x75c6('0x3')]('/',controller[_0x75c6('0x4')]);router[_0x75c6('0x3')](_0x75c6('0x5'),controller[_0x75c6('0x6')]);router[_0x75c6('0x3')]('/reset/:token',controller['reset']);module[_0x75c6('0x7')]=router;
\ No newline at end of file
+var _0x83f6=['forgot','/reset/:token','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x83f6,0x17b));var _0x683f=function(_0x870b62,_0x2143f9){_0x870b62=_0x870b62-0x0;var _0x2dcb39=_0x83f6[_0x870b62];return _0x2dcb39;};'use strict';var express=require(_0x683f('0x0'));var router=express[_0x683f('0x1')]();var controller=require(_0x683f('0x2'));router[_0x683f('0x3')]('/',controller['login']);router[_0x683f('0x3')](_0x683f('0x4'),controller[_0x683f('0x5')]);router[_0x683f('0x3')](_0x683f('0x6'),controller['reset']);module[_0x683f('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 971d553..7a3e80b 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 _0x4860=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4860,0x1bf));var _0x0486=function(_0x269e7d,_0x88b7f8){_0x269e7d=_0x269e7d-0x0;var _0x4fc9f2=_0x4860[_0x269e7d];return _0x4fc9f2;};'use strict';var Sequelize=require(_0x0486('0x0'));module[_0x0486('0x1')]={'name':{'type':Sequelize[_0x0486('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0486('0x2')]},'description':{'type':Sequelize[_0x0486('0x2')]},'status':{'type':Sequelize[_0x0486('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0486('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3a50=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x313df1,_0x5e46df){var _0x20ecb5=function(_0x45a453){while(--_0x45a453){_0x313df1['push'](_0x313df1['shift']());}};_0x20ecb5(++_0x5e46df);}(_0x3a50,0x18f));var _0x03a5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3a50[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x03a5('0x0'));module[_0x03a5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x03a5('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x03a5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x03a5('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 29317cb..4ac54ee 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 _0xee87=['sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','addConditions','Condition','ids','getConditions','addActions','Action','omit','getActions','findOne','keys','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','Content-Range','save','update','then','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order'];(function(_0x26f081,_0x4277f3){var _0x4bf032=function(_0x1e49d8){while(--_0x1e49d8){_0x26f081['push'](_0x26f081['shift']());}};_0x4bf032(++_0x4277f3);}(_0xee87,0x17a));var _0x7ee8=function(_0x3cdac1,_0x57c6eb){_0x3cdac1=_0x3cdac1-0x0;var _0x2e7a09=_0xee87[_0x3cdac1];return _0x2e7a09;};'use strict';var emlformat=require(_0x7ee8('0x0'));var rimraf=require(_0x7ee8('0x1'));var zipdir=require(_0x7ee8('0x2'));var jsonpatch=require(_0x7ee8('0x3'));var rp=require(_0x7ee8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7ee8('0x5'));var util=require(_0x7ee8('0x6'));var path=require(_0x7ee8('0x7'));var sox=require(_0x7ee8('0x8'));var csv=require(_0x7ee8('0x9'));var ejs=require(_0x7ee8('0xa'));var fs=require('fs');var fs_extra=require(_0x7ee8('0xb'));var _=require(_0x7ee8('0xc'));var squel=require(_0x7ee8('0xd'));var crypto=require(_0x7ee8('0xe'));var jsforce=require(_0x7ee8('0xf'));var deskjs=require(_0x7ee8('0x10'));var toCsv=require(_0x7ee8('0x9'));var querystring=require(_0x7ee8('0x11'));var Papa=require(_0x7ee8('0x12'));var Redis=require(_0x7ee8('0x13'));var authService=require(_0x7ee8('0x14'));var qs=require(_0x7ee8('0x15'));var as=require(_0x7ee8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7ee8('0x17'));var utils=require(_0x7ee8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7ee8('0x19'));var db=require(_0x7ee8('0x1a'))['db'];function respondWithStatusCode(_0x28e51e,_0x2fc833){_0x2fc833=_0x2fc833||0xcc;return function(_0x558093){if(_0x558093){return _0x28e51e['sendStatus'](_0x2fc833);}return _0x28e51e[_0x7ee8('0x1b')](_0x2fc833)[_0x7ee8('0x1c')]();};}function respondWithResult(_0x3d275c,_0x1f4132){_0x1f4132=_0x1f4132||0xc8;return function(_0x143af9){if(_0x143af9){return _0x3d275c[_0x7ee8('0x1b')](_0x1f4132)[_0x7ee8('0x1d')](_0x143af9);}};}function respondWithFilteredResult(_0x37a00e,_0x4eecd5){return function(_0x5cab2c){if(_0x5cab2c){var _0x12c5ac=typeof _0x4eecd5[_0x7ee8('0x1e')]==='undefined'&&typeof _0x4eecd5[_0x7ee8('0x1f')]==='undefined';var _0x4be85f=_0x5cab2c[_0x7ee8('0x20')];var _0x16e536=_0x12c5ac?0x0:_0x4eecd5[_0x7ee8('0x1e')];var _0x367bd3=_0x12c5ac?_0x5cab2c['count']:_0x4eecd5['offset']+_0x4eecd5['limit'];var _0x32c8f0;if(_0x367bd3>=_0x4be85f){_0x367bd3=_0x4be85f;_0x32c8f0=0xc8;}else{_0x32c8f0=0xce;}_0x37a00e[_0x7ee8('0x1b')](_0x32c8f0);return _0x37a00e['set'](_0x7ee8('0x21'),_0x16e536+'-'+_0x367bd3+'/'+_0x4be85f)[_0x7ee8('0x1d')](_0x5cab2c);}return null;};}function patchUpdates(_0x3a915c){return function(_0x867e22){try{jsonpatch['apply'](_0x867e22,_0x3a915c,!![]);}catch(_0x22279e){return BPromise['reject'](_0x22279e);}return _0x867e22[_0x7ee8('0x22')]();};}function saveUpdates(_0x3c1c1f,_0x480d32){return function(_0x2644eb){if(_0x2644eb){return _0x2644eb[_0x7ee8('0x23')](_0x3c1c1f)[_0x7ee8('0x24')](function(_0x432925){return _0x432925;});}return null;};}function removeEntity(_0x5d8818,_0x1da333){return function(_0x5ed31a){if(_0x5ed31a){return _0x5ed31a['destroy']()['then'](function(){_0x5d8818[_0x7ee8('0x1b')](0xcc)[_0x7ee8('0x1c')]();});}};}function handleEntityNotFound(_0x336539,_0x34eb01){return function(_0x35d3cd){if(!_0x35d3cd){_0x336539[_0x7ee8('0x25')](0x194);}return _0x35d3cd;};}function handleError(_0x524af7,_0x3f89d5){_0x3f89d5=_0x3f89d5||0x1f4;return function(_0x549517){logger[_0x7ee8('0x26')](_0x549517[_0x7ee8('0x27')]);if(_0x549517[_0x7ee8('0x28')]){delete _0x549517[_0x7ee8('0x28')];}_0x524af7[_0x7ee8('0x1b')](_0x3f89d5)[_0x7ee8('0x29')](_0x549517);};}exports[_0x7ee8('0x2a')]=function(_0x708b77,_0x42cb86){var _0x7416de={},_0x359394={},_0x1ca5e5={'count':0x0,'rows':[]};var _0x347729=_[_0x7ee8('0x2b')](db[_0x7ee8('0x2c')][_0x7ee8('0x2d')],function(_0x4aea4e){return{'name':_0x4aea4e[_0x7ee8('0x2e')],'type':_0x4aea4e['type'][_0x7ee8('0x2f')]};});_0x359394[_0x7ee8('0x30')]=_[_0x7ee8('0x2b')](_0x347729,_0x7ee8('0x28'));_0x359394[_0x7ee8('0x31')]=_['keys'](_0x708b77['query']);_0x359394['filters']=_[_0x7ee8('0x32')](_0x359394[_0x7ee8('0x30')],_0x359394[_0x7ee8('0x31')]);_0x7416de['attributes']=_[_0x7ee8('0x32')](_0x359394[_0x7ee8('0x30')],qs[_0x7ee8('0x33')](_0x708b77[_0x7ee8('0x31')]['fields']));_0x7416de['attributes']=_0x7416de['attributes'][_0x7ee8('0x34')]?_0x7416de[_0x7ee8('0x35')]:_0x359394[_0x7ee8('0x30')];if(!_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x36')](_0x7ee8('0x37'))){_0x7416de[_0x7ee8('0x1f')]=qs[_0x7ee8('0x1f')](_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x1f')]);_0x7416de[_0x7ee8('0x1e')]=qs[_0x7ee8('0x1e')](_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x1e')]);}_0x7416de[_0x7ee8('0x38')]=qs['sort'](_0x708b77['query'][_0x7ee8('0x39')]);_0x7416de[_0x7ee8('0x3a')]=qs[_0x7ee8('0x3b')](_[_0x7ee8('0x3c')](_0x708b77[_0x7ee8('0x31')],_0x359394[_0x7ee8('0x3b')]),_0x347729);if(_0x708b77[_0x7ee8('0x31')]['filter']){_0x7416de['where']=_[_0x7ee8('0x3d')](_0x7416de[_0x7ee8('0x3a')],{'$or':_[_0x7ee8('0x2b')](_0x347729,function(_0x4a27f5){if(_0x4a27f5[_0x7ee8('0x3e')]!==_0x7ee8('0x3f')){var _0x3cd395={};_0x3cd395[_0x4a27f5[_0x7ee8('0x28')]]={'$like':'%'+_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x40')]+'%'};return _0x3cd395;}})});}_0x7416de=_[_0x7ee8('0x3d')]({},_0x7416de,_0x708b77[_0x7ee8('0x41')]);var _0x410a39={'where':_0x7416de[_0x7ee8('0x3a')]};return db[_0x7ee8('0x2c')][_0x7ee8('0x20')](_0x410a39)[_0x7ee8('0x24')](function(_0xc22c0){_0x1ca5e5[_0x7ee8('0x20')]=_0xc22c0;if(_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x42')]){_0x7416de[_0x7ee8('0x43')]=[{'all':!![]}];}return db[_0x7ee8('0x2c')][_0x7ee8('0x44')](_0x7416de);})[_0x7ee8('0x24')](function(_0x4e9164){_0x1ca5e5[_0x7ee8('0x45')]=_0x4e9164;return _0x1ca5e5;})[_0x7ee8('0x24')](respondWithFilteredResult(_0x42cb86,_0x7416de))[_0x7ee8('0x46')](handleError(_0x42cb86,null));};exports[_0x7ee8('0x47')]=function(_0x3a30eb,_0x27f66f){var _0x37e24f={'raw':![],'where':{'id':_0x3a30eb[_0x7ee8('0x48')]['id']}},_0x21cc0a={};_0x21cc0a[_0x7ee8('0x30')]=_['keys'](db[_0x7ee8('0x2c')][_0x7ee8('0x2d')]);_0x21cc0a['query']=_['keys'](_0x3a30eb[_0x7ee8('0x31')]);_0x21cc0a[_0x7ee8('0x3b')]=_[_0x7ee8('0x32')](_0x21cc0a[_0x7ee8('0x30')],_0x21cc0a[_0x7ee8('0x31')]);_0x37e24f[_0x7ee8('0x35')]=_[_0x7ee8('0x32')](_0x21cc0a['model'],qs['fields'](_0x3a30eb[_0x7ee8('0x31')][_0x7ee8('0x33')]));_0x37e24f[_0x7ee8('0x35')]=_0x37e24f['attributes']['length']?_0x37e24f[_0x7ee8('0x35')]:_0x21cc0a[_0x7ee8('0x30')];if(_0x3a30eb[_0x7ee8('0x31')][_0x7ee8('0x42')]){_0x37e24f[_0x7ee8('0x43')]=[{'all':!![]}];}_0x37e24f=_[_0x7ee8('0x3d')]({},_0x37e24f,_0x3a30eb['options']);return db[_0x7ee8('0x2c')][_0x7ee8('0x49')](_0x37e24f)[_0x7ee8('0x24')](handleEntityNotFound(_0x27f66f,null))['then'](respondWithResult(_0x27f66f,null))[_0x7ee8('0x46')](handleError(_0x27f66f,null));};exports[_0x7ee8('0x4a')]=function(_0x5caa07,_0x52bac1){return db[_0x7ee8('0x2c')][_0x7ee8('0x4a')](_0x5caa07[_0x7ee8('0x4b')],{})[_0x7ee8('0x24')](respondWithResult(_0x52bac1,0xc9))[_0x7ee8('0x46')](handleError(_0x52bac1,null));};exports[_0x7ee8('0x23')]=function(_0x94bd6e,_0x447737){if(_0x94bd6e[_0x7ee8('0x4b')]['id']){delete _0x94bd6e[_0x7ee8('0x4b')]['id'];}return db[_0x7ee8('0x2c')][_0x7ee8('0x49')]({'where':{'id':_0x94bd6e['params']['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x447737,null))[_0x7ee8('0x24')](saveUpdates(_0x94bd6e[_0x7ee8('0x4b')],null))['then'](respondWithResult(_0x447737,null))[_0x7ee8('0x46')](handleError(_0x447737,null));};exports[_0x7ee8('0x4c')]=function(_0x69fdd0,_0x4c1132){return db[_0x7ee8('0x2c')][_0x7ee8('0x49')]({'where':{'id':_0x69fdd0[_0x7ee8('0x48')]['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x4c1132,null))[_0x7ee8('0x24')](removeEntity(_0x4c1132,null))['catch'](handleError(_0x4c1132,null));};exports[_0x7ee8('0x4d')]=function(_0x300eb7,_0x2cd750,_0xf8844a){return db[_0x7ee8('0x4e')][_0x7ee8('0x49')]({'where':{'id':_0x300eb7[_0x7ee8('0x48')]['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x2cd750,null))['then'](function(_0x5b8e3e){if(_0x5b8e3e){return _0x5b8e3e['addConditions'](_0x300eb7[_0x7ee8('0x4b')][_0x7ee8('0x4f')],_['omit'](_0x300eb7[_0x7ee8('0x4b')],['ids','id'])||{});}})[_0x7ee8('0x24')](respondWithResult(_0x2cd750,null))['catch'](handleError(_0x2cd750,null));};exports[_0x7ee8('0x50')]=function(_0x4fbce9,_0x40fb6d,_0x326dbe){var _0x488520={};var _0xf34b78={};var _0x103ac5;var _0x464939;return db[_0x7ee8('0x2c')]['findOne']({'where':{'id':_0x4fbce9['params']['id']}})['then'](handleEntityNotFound(_0x40fb6d,null))['then'](function(_0x16e1ec){if(_0x16e1ec){_0x103ac5=_0x16e1ec;_0xf34b78[_0x7ee8('0x30')]=_['keys'](db[_0x7ee8('0x4e')][_0x7ee8('0x2d')]);_0xf34b78[_0x7ee8('0x31')]=_['keys'](_0x4fbce9[_0x7ee8('0x31')]);_0xf34b78[_0x7ee8('0x3b')]=_[_0x7ee8('0x32')](_0xf34b78[_0x7ee8('0x30')],_0xf34b78[_0x7ee8('0x31')]);_0x488520[_0x7ee8('0x35')]=_['intersection'](_0xf34b78[_0x7ee8('0x30')],qs[_0x7ee8('0x33')](_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x33')]));_0x488520[_0x7ee8('0x35')]=_0x488520['attributes'][_0x7ee8('0x34')]?_0x488520[_0x7ee8('0x35')]:_0xf34b78[_0x7ee8('0x30')];_0x488520['order']=qs[_0x7ee8('0x39')](_0x4fbce9['query'][_0x7ee8('0x39')]);_0x488520['where']=qs['filters'](_[_0x7ee8('0x3c')](_0x4fbce9[_0x7ee8('0x31')],_0xf34b78[_0x7ee8('0x3b')]));if(_0x4fbce9['query'][_0x7ee8('0x40')]){_0x488520[_0x7ee8('0x3a')]=_[_0x7ee8('0x3d')](_0x488520['where'],{'$or':_['map'](_0x488520['attributes'],function(_0x3de67b){var _0x26bfd2={};_0x26bfd2[_0x3de67b]={'$like':'%'+_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x40')]+'%'};return _0x26bfd2;})});}_0x488520=_['merge']({},_0x488520,_0x4fbce9[_0x7ee8('0x41')]);return _0x103ac5['getConditions'](_0x488520);}})[_0x7ee8('0x24')](function(_0x3b01ab){if(_0x3b01ab){_0x464939=_0x3b01ab[_0x7ee8('0x34')];if(!_0x4fbce9[_0x7ee8('0x31')]['hasOwnProperty'](_0x7ee8('0x37'))){_0x488520[_0x7ee8('0x1f')]=qs[_0x7ee8('0x1f')](_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x1f')]);_0x488520[_0x7ee8('0x1e')]=qs['offset'](_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x1e')]);}return _0x103ac5['getConditions'](_0x488520);}})['then'](function(_0x2b7887){if(_0x2b7887){return _0x2b7887?{'count':_0x464939,'rows':_0x2b7887}:null;}})[_0x7ee8('0x24')](respondWithResult(_0x40fb6d,null))['catch'](handleError(_0x40fb6d,null));};exports[_0x7ee8('0x51')]=function(_0x2d957d,_0x12c513,_0x1c31ce){return db[_0x7ee8('0x52')][_0x7ee8('0x49')]({'where':{'id':_0x2d957d[_0x7ee8('0x48')]['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x12c513,null))[_0x7ee8('0x24')](function(_0x58cf9d){if(_0x58cf9d){return _0x58cf9d[_0x7ee8('0x51')](_0x2d957d[_0x7ee8('0x4b')][_0x7ee8('0x4f')],_[_0x7ee8('0x53')](_0x2d957d[_0x7ee8('0x4b')],[_0x7ee8('0x4f'),'id'])||{});}})[_0x7ee8('0x24')](respondWithResult(_0x12c513,null))[_0x7ee8('0x46')](handleError(_0x12c513,null));};exports[_0x7ee8('0x54')]=function(_0x4cbf7f,_0x1aabcc,_0xd75c97){var _0x2d81b1={};var _0x421c7b={};var _0x185d6d;var _0x206a45;return db[_0x7ee8('0x2c')][_0x7ee8('0x55')]({'where':{'id':_0x4cbf7f[_0x7ee8('0x48')]['id']}})['then'](handleEntityNotFound(_0x1aabcc,null))[_0x7ee8('0x24')](function(_0x18d3d8){if(_0x18d3d8){_0x185d6d=_0x18d3d8;_0x421c7b[_0x7ee8('0x30')]=_['keys'](db[_0x7ee8('0x52')][_0x7ee8('0x2d')]);_0x421c7b['query']=_[_0x7ee8('0x56')](_0x4cbf7f[_0x7ee8('0x31')]);_0x421c7b['filters']=_[_0x7ee8('0x32')](_0x421c7b[_0x7ee8('0x30')],_0x421c7b['query']);_0x2d81b1[_0x7ee8('0x35')]=_[_0x7ee8('0x32')](_0x421c7b[_0x7ee8('0x30')],qs[_0x7ee8('0x33')](_0x4cbf7f[_0x7ee8('0x31')]['fields']));_0x2d81b1['attributes']=_0x2d81b1[_0x7ee8('0x35')][_0x7ee8('0x34')]?_0x2d81b1[_0x7ee8('0x35')]:_0x421c7b[_0x7ee8('0x30')];_0x2d81b1['order']=qs[_0x7ee8('0x39')](_0x4cbf7f[_0x7ee8('0x31')][_0x7ee8('0x39')]);_0x2d81b1[_0x7ee8('0x3a')]=qs[_0x7ee8('0x3b')](_[_0x7ee8('0x3c')](_0x4cbf7f[_0x7ee8('0x31')],_0x421c7b[_0x7ee8('0x3b')]));if(_0x4cbf7f['query'][_0x7ee8('0x40')]){_0x2d81b1[_0x7ee8('0x3a')]=_[_0x7ee8('0x3d')](_0x2d81b1['where'],{'$or':_['map'](_0x2d81b1['attributes'],function(_0x52813c){var _0x467ec6={};_0x467ec6[_0x52813c]={'$like':'%'+_0x4cbf7f[_0x7ee8('0x31')]['filter']+'%'};return _0x467ec6;})});}_0x2d81b1=_[_0x7ee8('0x3d')]({},_0x2d81b1,_0x4cbf7f[_0x7ee8('0x41')]);return _0x185d6d['getActions'](_0x2d81b1);}})[_0x7ee8('0x24')](function(_0x4c646a){if(_0x4c646a){_0x206a45=_0x4c646a['length'];if(!_0x4cbf7f[_0x7ee8('0x31')][_0x7ee8('0x36')]('nolimit')){_0x2d81b1['limit']=qs[_0x7ee8('0x1f')](_0x4cbf7f['query'][_0x7ee8('0x1f')]);_0x2d81b1[_0x7ee8('0x1e')]=qs[_0x7ee8('0x1e')](_0x4cbf7f[_0x7ee8('0x31')][_0x7ee8('0x1e')]);}return _0x185d6d['getActions'](_0x2d81b1);}})['then'](function(_0x281d2a){if(_0x281d2a){return _0x281d2a?{'count':_0x206a45,'rows':_0x281d2a}:null;}})[_0x7ee8('0x24')](respondWithResult(_0x1aabcc,null))['catch'](handleError(_0x1aabcc,null));};
\ No newline at end of file
+var _0x3c20=['include','findAll','rows','catch','show','params','keys','create','body','Condition','ids','omit','findOne','filter','getConditions','addActions','Action','find','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','map','Automation','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x3c20,0x66));var _0x03c2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3c20[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x03c2('0x0'));var rimraf=require(_0x03c2('0x1'));var zipdir=require(_0x03c2('0x2'));var jsonpatch=require(_0x03c2('0x3'));var rp=require(_0x03c2('0x4'));var moment=require(_0x03c2('0x5'));var BPromise=require(_0x03c2('0x6'));var Mustache=require(_0x03c2('0x7'));var util=require(_0x03c2('0x8'));var path=require('path');var sox=require(_0x03c2('0x9'));var csv=require('to-csv');var ejs=require(_0x03c2('0xa'));var fs=require('fs');var fs_extra=require(_0x03c2('0xb'));var _=require(_0x03c2('0xc'));var squel=require('squel');var crypto=require(_0x03c2('0xd'));var jsforce=require(_0x03c2('0xe'));var deskjs=require(_0x03c2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03c2('0x10'));var Redis=require(_0x03c2('0x11'));var authService=require(_0x03c2('0x12'));var qs=require(_0x03c2('0x13'));var as=require(_0x03c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03c2('0x15'))(_0x03c2('0x16'));var utils=require(_0x03c2('0x17'));var config=require(_0x03c2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x03c2('0x19'))['db'];function respondWithStatusCode(_0x36afd5,_0x81c504){_0x81c504=_0x81c504||0xcc;return function(_0x373343){if(_0x373343){return _0x36afd5[_0x03c2('0x1a')](_0x81c504);}return _0x36afd5[_0x03c2('0x1b')](_0x81c504)[_0x03c2('0x1c')]();};}function respondWithResult(_0x42ea50,_0x15d9ef){_0x15d9ef=_0x15d9ef||0xc8;return function(_0x560525){if(_0x560525){return _0x42ea50[_0x03c2('0x1b')](_0x15d9ef)[_0x03c2('0x1d')](_0x560525);}};}function respondWithFilteredResult(_0x13f525,_0x5c4e64){return function(_0x5cd51f){if(_0x5cd51f){var _0x1f600e=typeof _0x5c4e64[_0x03c2('0x1e')]===_0x03c2('0x1f')&&typeof _0x5c4e64[_0x03c2('0x20')]===_0x03c2('0x1f');var _0x3d733c=_0x5cd51f[_0x03c2('0x21')];var _0x3c8568=_0x1f600e?0x0:_0x5c4e64[_0x03c2('0x1e')];var _0xd12cd=_0x1f600e?_0x5cd51f[_0x03c2('0x21')]:_0x5c4e64['offset']+_0x5c4e64[_0x03c2('0x20')];var _0x382bf7;if(_0xd12cd>=_0x3d733c){_0xd12cd=_0x3d733c;_0x382bf7=0xc8;}else{_0x382bf7=0xce;}_0x13f525[_0x03c2('0x1b')](_0x382bf7);return _0x13f525['set'](_0x03c2('0x22'),_0x3c8568+'-'+_0xd12cd+'/'+_0x3d733c)[_0x03c2('0x1d')](_0x5cd51f);}return null;};}function patchUpdates(_0x3e6fb1){return function(_0x383037){try{jsonpatch[_0x03c2('0x23')](_0x383037,_0x3e6fb1,!![]);}catch(_0x47a700){return BPromise[_0x03c2('0x24')](_0x47a700);}return _0x383037['save']();};}function saveUpdates(_0x2ce82b,_0x43274d){return function(_0x102adc){if(_0x102adc){return _0x102adc[_0x03c2('0x25')](_0x2ce82b)[_0x03c2('0x26')](function(_0x347af2){return _0x347af2;});}return null;};}function removeEntity(_0x238e07,_0x590c6b){return function(_0x1a0061){if(_0x1a0061){return _0x1a0061[_0x03c2('0x27')]()[_0x03c2('0x26')](function(){_0x238e07[_0x03c2('0x1b')](0xcc)[_0x03c2('0x1c')]();});}};}function handleEntityNotFound(_0x4b7f18,_0x3b1b69){return function(_0x4532dd){if(!_0x4532dd){_0x4b7f18[_0x03c2('0x1a')](0x194);}return _0x4532dd;};}function handleError(_0x117f72,_0x4fae76){_0x4fae76=_0x4fae76||0x1f4;return function(_0x5ea7be){logger[_0x03c2('0x28')](_0x5ea7be['stack']);if(_0x5ea7be[_0x03c2('0x29')]){delete _0x5ea7be[_0x03c2('0x29')];}_0x117f72['status'](_0x4fae76)['send'](_0x5ea7be);};}exports['index']=function(_0xe5ae38,_0x20d7a3){var _0x20d032={},_0x2d4742={},_0x323711={'count':0x0,'rows':[]};var _0x9387b8=_[_0x03c2('0x2a')](db[_0x03c2('0x2b')][_0x03c2('0x2c')],function(_0x1e7884){return{'name':_0x1e7884['fieldName'],'type':_0x1e7884[_0x03c2('0x2d')][_0x03c2('0x2e')]};});_0x2d4742[_0x03c2('0x2f')]=_[_0x03c2('0x2a')](_0x9387b8,'name');_0x2d4742[_0x03c2('0x30')]=_['keys'](_0xe5ae38[_0x03c2('0x30')]);_0x2d4742[_0x03c2('0x31')]=_[_0x03c2('0x32')](_0x2d4742[_0x03c2('0x2f')],_0x2d4742[_0x03c2('0x30')]);_0x20d032[_0x03c2('0x33')]=_[_0x03c2('0x32')](_0x2d4742[_0x03c2('0x2f')],qs[_0x03c2('0x34')](_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x34')]));_0x20d032[_0x03c2('0x33')]=_0x20d032[_0x03c2('0x33')][_0x03c2('0x35')]?_0x20d032[_0x03c2('0x33')]:_0x2d4742['model'];if(!_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x36')](_0x03c2('0x37'))){_0x20d032[_0x03c2('0x20')]=qs[_0x03c2('0x20')](_0xe5ae38[_0x03c2('0x30')]['limit']);_0x20d032[_0x03c2('0x1e')]=qs[_0x03c2('0x1e')](_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x1e')]);}_0x20d032[_0x03c2('0x38')]=qs[_0x03c2('0x39')](_0xe5ae38['query']['sort']);_0x20d032[_0x03c2('0x3a')]=qs[_0x03c2('0x31')](_[_0x03c2('0x3b')](_0xe5ae38[_0x03c2('0x30')],_0x2d4742[_0x03c2('0x31')]),_0x9387b8);if(_0xe5ae38[_0x03c2('0x30')]['filter']){_0x20d032[_0x03c2('0x3a')]=_['merge'](_0x20d032[_0x03c2('0x3a')],{'$or':_['map'](_0x9387b8,function(_0x5be70a){if(_0x5be70a[_0x03c2('0x2d')]!==_0x03c2('0x3c')){var _0x50a76c={};_0x50a76c[_0x5be70a[_0x03c2('0x29')]]={'$like':'%'+_0xe5ae38[_0x03c2('0x30')]['filter']+'%'};return _0x50a76c;}})});}_0x20d032=_[_0x03c2('0x3d')]({},_0x20d032,_0xe5ae38[_0x03c2('0x3e')]);var _0x188a42={'where':_0x20d032[_0x03c2('0x3a')]};return db[_0x03c2('0x2b')][_0x03c2('0x21')](_0x188a42)[_0x03c2('0x26')](function(_0x560dc0){_0x323711['count']=_0x560dc0;if(_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x3f')]){_0x20d032[_0x03c2('0x40')]=[{'all':!![]}];}return db[_0x03c2('0x2b')][_0x03c2('0x41')](_0x20d032);})['then'](function(_0x54c807){_0x323711[_0x03c2('0x42')]=_0x54c807;return _0x323711;})[_0x03c2('0x26')](respondWithFilteredResult(_0x20d7a3,_0x20d032))[_0x03c2('0x43')](handleError(_0x20d7a3,null));};exports[_0x03c2('0x44')]=function(_0x94cb72,_0x3d8517){var _0x1ec097={'raw':![],'where':{'id':_0x94cb72[_0x03c2('0x45')]['id']}},_0x17252f={};_0x17252f[_0x03c2('0x2f')]=_[_0x03c2('0x46')](db[_0x03c2('0x2b')][_0x03c2('0x2c')]);_0x17252f[_0x03c2('0x30')]=_[_0x03c2('0x46')](_0x94cb72[_0x03c2('0x30')]);_0x17252f[_0x03c2('0x31')]=_['intersection'](_0x17252f['model'],_0x17252f[_0x03c2('0x30')]);_0x1ec097[_0x03c2('0x33')]=_[_0x03c2('0x32')](_0x17252f[_0x03c2('0x2f')],qs[_0x03c2('0x34')](_0x94cb72[_0x03c2('0x30')]['fields']));_0x1ec097['attributes']=_0x1ec097[_0x03c2('0x33')][_0x03c2('0x35')]?_0x1ec097[_0x03c2('0x33')]:_0x17252f[_0x03c2('0x2f')];if(_0x94cb72[_0x03c2('0x30')][_0x03c2('0x3f')]){_0x1ec097[_0x03c2('0x40')]=[{'all':!![]}];}_0x1ec097=_['merge']({},_0x1ec097,_0x94cb72['options']);return db[_0x03c2('0x2b')]['find'](_0x1ec097)[_0x03c2('0x26')](handleEntityNotFound(_0x3d8517,null))[_0x03c2('0x26')](respondWithResult(_0x3d8517,null))[_0x03c2('0x43')](handleError(_0x3d8517,null));};exports[_0x03c2('0x47')]=function(_0x5409a9,_0x18af52){return db['Automation'][_0x03c2('0x47')](_0x5409a9['body'],{})[_0x03c2('0x26')](respondWithResult(_0x18af52,0xc9))['catch'](handleError(_0x18af52,null));};exports[_0x03c2('0x25')]=function(_0x84daba,_0xb4e4c0){if(_0x84daba[_0x03c2('0x48')]['id']){delete _0x84daba[_0x03c2('0x48')]['id'];}return db[_0x03c2('0x2b')]['find']({'where':{'id':_0x84daba['params']['id']}})[_0x03c2('0x26')](handleEntityNotFound(_0xb4e4c0,null))[_0x03c2('0x26')](saveUpdates(_0x84daba[_0x03c2('0x48')],null))['then'](respondWithResult(_0xb4e4c0,null))['catch'](handleError(_0xb4e4c0,null));};exports[_0x03c2('0x27')]=function(_0x361b55,_0x2667a3){return db[_0x03c2('0x2b')]['find']({'where':{'id':_0x361b55[_0x03c2('0x45')]['id']}})[_0x03c2('0x26')](handleEntityNotFound(_0x2667a3,null))['then'](removeEntity(_0x2667a3,null))[_0x03c2('0x43')](handleError(_0x2667a3,null));};exports['addConditions']=function(_0x22644b,_0x5e6ef5,_0x2353c5){return db[_0x03c2('0x49')]['find']({'where':{'id':_0x22644b['params']['id']}})['then'](handleEntityNotFound(_0x5e6ef5,null))[_0x03c2('0x26')](function(_0x3072a9){if(_0x3072a9){return _0x3072a9['addConditions'](_0x22644b[_0x03c2('0x48')][_0x03c2('0x4a')],_[_0x03c2('0x4b')](_0x22644b[_0x03c2('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x5e6ef5,null))['catch'](handleError(_0x5e6ef5,null));};exports['getConditions']=function(_0x581688,_0x2a1129,_0x233643){var _0x148279={};var _0x2efadc={};var _0x3df497;var _0x215ab9;return db[_0x03c2('0x2b')][_0x03c2('0x4c')]({'where':{'id':_0x581688[_0x03c2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a1129,null))[_0x03c2('0x26')](function(_0x5cf33d){if(_0x5cf33d){_0x3df497=_0x5cf33d;_0x2efadc['model']=_['keys'](db[_0x03c2('0x49')]['rawAttributes']);_0x2efadc[_0x03c2('0x30')]=_[_0x03c2('0x46')](_0x581688[_0x03c2('0x30')]);_0x2efadc['filters']=_[_0x03c2('0x32')](_0x2efadc[_0x03c2('0x2f')],_0x2efadc[_0x03c2('0x30')]);_0x148279['attributes']=_[_0x03c2('0x32')](_0x2efadc[_0x03c2('0x2f')],qs['fields'](_0x581688[_0x03c2('0x30')][_0x03c2('0x34')]));_0x148279[_0x03c2('0x33')]=_0x148279[_0x03c2('0x33')][_0x03c2('0x35')]?_0x148279[_0x03c2('0x33')]:_0x2efadc[_0x03c2('0x2f')];_0x148279[_0x03c2('0x38')]=qs[_0x03c2('0x39')](_0x581688[_0x03c2('0x30')][_0x03c2('0x39')]);_0x148279['where']=qs[_0x03c2('0x31')](_['pick'](_0x581688[_0x03c2('0x30')],_0x2efadc['filters']));if(_0x581688['query'][_0x03c2('0x4d')]){_0x148279['where']=_[_0x03c2('0x3d')](_0x148279[_0x03c2('0x3a')],{'$or':_[_0x03c2('0x2a')](_0x148279[_0x03c2('0x33')],function(_0x1c2d35){var _0x1f6667={};_0x1f6667[_0x1c2d35]={'$like':'%'+_0x581688[_0x03c2('0x30')][_0x03c2('0x4d')]+'%'};return _0x1f6667;})});}_0x148279=_[_0x03c2('0x3d')]({},_0x148279,_0x581688[_0x03c2('0x3e')]);return _0x3df497[_0x03c2('0x4e')](_0x148279);}})[_0x03c2('0x26')](function(_0x4d02b5){if(_0x4d02b5){_0x215ab9=_0x4d02b5['length'];if(!_0x581688[_0x03c2('0x30')][_0x03c2('0x36')]('nolimit')){_0x148279[_0x03c2('0x20')]=qs[_0x03c2('0x20')](_0x581688[_0x03c2('0x30')][_0x03c2('0x20')]);_0x148279[_0x03c2('0x1e')]=qs['offset'](_0x581688['query'][_0x03c2('0x1e')]);}return _0x3df497['getConditions'](_0x148279);}})['then'](function(_0x476d5c){if(_0x476d5c){return _0x476d5c?{'count':_0x215ab9,'rows':_0x476d5c}:null;}})['then'](respondWithResult(_0x2a1129,null))['catch'](handleError(_0x2a1129,null));};exports[_0x03c2('0x4f')]=function(_0x4d1f38,_0x4b07ad,_0x31d321){return db[_0x03c2('0x50')][_0x03c2('0x51')]({'where':{'id':_0x4d1f38[_0x03c2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b07ad,null))[_0x03c2('0x26')](function(_0x233c3c){if(_0x233c3c){return _0x233c3c[_0x03c2('0x4f')](_0x4d1f38['body'][_0x03c2('0x4a')],_[_0x03c2('0x4b')](_0x4d1f38[_0x03c2('0x48')],['ids','id'])||{});}})[_0x03c2('0x26')](respondWithResult(_0x4b07ad,null))[_0x03c2('0x43')](handleError(_0x4b07ad,null));};exports[_0x03c2('0x52')]=function(_0x2a7c4b,_0x535cfd,_0x57bd08){var _0x505dd4={};var _0x59f1d5={};var _0x947826;var _0x3d93bc;return db[_0x03c2('0x2b')][_0x03c2('0x4c')]({'where':{'id':_0x2a7c4b[_0x03c2('0x45')]['id']}})[_0x03c2('0x26')](handleEntityNotFound(_0x535cfd,null))[_0x03c2('0x26')](function(_0x24b112){if(_0x24b112){_0x947826=_0x24b112;_0x59f1d5['model']=_['keys'](db[_0x03c2('0x50')][_0x03c2('0x2c')]);_0x59f1d5[_0x03c2('0x30')]=_[_0x03c2('0x46')](_0x2a7c4b[_0x03c2('0x30')]);_0x59f1d5['filters']=_[_0x03c2('0x32')](_0x59f1d5[_0x03c2('0x2f')],_0x59f1d5[_0x03c2('0x30')]);_0x505dd4[_0x03c2('0x33')]=_[_0x03c2('0x32')](_0x59f1d5[_0x03c2('0x2f')],qs[_0x03c2('0x34')](_0x2a7c4b['query'][_0x03c2('0x34')]));_0x505dd4['attributes']=_0x505dd4[_0x03c2('0x33')]['length']?_0x505dd4['attributes']:_0x59f1d5[_0x03c2('0x2f')];_0x505dd4[_0x03c2('0x38')]=qs[_0x03c2('0x39')](_0x2a7c4b[_0x03c2('0x30')][_0x03c2('0x39')]);_0x505dd4[_0x03c2('0x3a')]=qs[_0x03c2('0x31')](_[_0x03c2('0x3b')](_0x2a7c4b[_0x03c2('0x30')],_0x59f1d5[_0x03c2('0x31')]));if(_0x2a7c4b[_0x03c2('0x30')]['filter']){_0x505dd4['where']=_[_0x03c2('0x3d')](_0x505dd4[_0x03c2('0x3a')],{'$or':_[_0x03c2('0x2a')](_0x505dd4[_0x03c2('0x33')],function(_0x246d62){var _0x3a02bc={};_0x3a02bc[_0x246d62]={'$like':'%'+_0x2a7c4b[_0x03c2('0x30')][_0x03c2('0x4d')]+'%'};return _0x3a02bc;})});}_0x505dd4=_[_0x03c2('0x3d')]({},_0x505dd4,_0x2a7c4b[_0x03c2('0x3e')]);return _0x947826[_0x03c2('0x52')](_0x505dd4);}})['then'](function(_0x208000){if(_0x208000){_0x3d93bc=_0x208000[_0x03c2('0x35')];if(!_0x2a7c4b['query']['hasOwnProperty']('nolimit')){_0x505dd4[_0x03c2('0x20')]=qs[_0x03c2('0x20')](_0x2a7c4b['query'][_0x03c2('0x20')]);_0x505dd4[_0x03c2('0x1e')]=qs[_0x03c2('0x1e')](_0x2a7c4b[_0x03c2('0x30')][_0x03c2('0x1e')]);}return _0x947826[_0x03c2('0x52')](_0x505dd4);}})[_0x03c2('0x26')](function(_0x3c1208){if(_0x3c1208){return _0x3c1208?{'count':_0x3d93bc,'rows':_0x3c1208}:null;}})[_0x03c2('0x26')](respondWithResult(_0x535cfd,null))[_0x03c2('0x43')](handleError(_0x535cfd,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 4fd512d..fefbfac 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 _0x50a8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0xb4bd72,_0x51c0c9){var _0xd35be6=function(_0x424b2f){while(--_0x424b2f){_0xb4bd72['push'](_0xb4bd72['shift']());}};_0xd35be6(++_0x51c0c9);}(_0x50a8,0xe9));var _0x850a=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x50a8[_0x30abff];return _0x4c571e;};'use strict';var _=require(_0x850a('0x0'));var util=require(_0x850a('0x1'));var logger=require(_0x850a('0x2'))(_0x850a('0x3'));var moment=require(_0x850a('0x4'));var BPromise=require(_0x850a('0x5'));var rp=require(_0x850a('0x6'));var fs=require('fs');var path=require(_0x850a('0x7'));var rimraf=require(_0x850a('0x8'));var config=require(_0x850a('0x9'));var attributes=require(_0x850a('0xa'));module['exports']=function(_0x340115,_0x2b60a6){return _0x340115[_0x850a('0xb')]('Automation',attributes,{'tableName':_0x850a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3394=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./automation.attributes','exports','define'];(function(_0x63f0f5,_0x3bcb73){var _0x497e6f=function(_0x3a48d1){while(--_0x3a48d1){_0x63f0f5['push'](_0x63f0f5['shift']());}};_0x497e6f(++_0x3bcb73);}(_0x3394,0x19e));var _0x4339=function(_0x327322,_0x3cb679){_0x327322=_0x327322-0x0;var _0x5a199b=_0x3394[_0x327322];return _0x5a199b;};'use strict';var _=require(_0x4339('0x0'));var util=require(_0x4339('0x1'));var logger=require(_0x4339('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4339('0x3'));var rp=require(_0x4339('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4339('0x5'));var attributes=require(_0x4339('0x6'));module[_0x4339('0x7')]=function(_0x488227,_0x118cca){return _0x488227[_0x4339('0x8')]('Automation',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 108873a..0d6b377 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 _0xb8a0=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x2e7eaa,_0x1702d9){_0x2e7eaa=_0x2e7eaa-0x0;var _0x33e095=_0xb8a0[_0x2e7eaa];return _0x33e095;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b8a('0x0'));var BPromise=require(_0x0b8a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b8a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0b8a('0x3'));var jayson=require(_0x0b8a('0x4'));var client=jayson[_0x0b8a('0x5')][_0x0b8a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3527dd,_0x4039c2,_0x33a5bd){return new BPromise(function(_0x463015,_0x29ebdc){return client[_0x0b8a('0x7')](_0x3527dd,_0x33a5bd)[_0x0b8a('0x8')](function(_0x478492){logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,_0x0b8a('0xb'));logger[_0x0b8a('0xc')](_0x0b8a('0xd'),_0x4039c2,_0x0b8a('0xb'),JSON[_0x0b8a('0xe')](_0x478492));if(_0x478492[_0x0b8a('0xf')]){if(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x10')]===0x1f4){logger['error'](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x29ebdc(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);}logger[_0x0b8a('0xf')](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x463015(_0x478492['error'][_0x0b8a('0x11')]);}else{logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,'request\x20sent');_0x463015(_0x478492[_0x0b8a('0x12')][_0x0b8a('0x11')]);}})[_0x0b8a('0x13')](function(_0x5a2623){logger['error']('Automation,\x20%s,\x20%s',_0x4039c2,_0x5a2623);_0x29ebdc(_0x5a2623);});});}
\ No newline at end of file
+var _0x2fe5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','message','Automation,\x20%s,\x20%s','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x2fe5,0x14b));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x52fe('0x2'));var fs=require('fs');var Redis=require(_0x52fe('0x3'));var db=require(_0x52fe('0x4'))['db'];var utils=require(_0x52fe('0x5'));var logger=require(_0x52fe('0x6'))('rpc');var config=require(_0x52fe('0x7'));var jayson=require(_0x52fe('0x8'));var client=jayson['client'][_0x52fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x157c5a,_0x2b3f41,_0x31b5dd){return new BPromise(function(_0x408cef,_0x49f7d9){return client[_0x52fe('0xa')](_0x157c5a,_0x31b5dd)[_0x52fe('0xb')](function(_0xe73ece){logger['info']('Automation,\x20%s,\x20%s',_0x2b3f41,_0x52fe('0xc'));logger[_0x52fe('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x2b3f41,_0x52fe('0xc'),JSON[_0x52fe('0xe')](_0xe73ece));if(_0xe73ece[_0x52fe('0xf')]){if(_0xe73ece[_0x52fe('0xf')]['code']===0x1f4){logger[_0x52fe('0xf')]('Automation,\x20%s,\x20%s',_0x2b3f41,_0xe73ece[_0x52fe('0xf')]['message']);return _0x49f7d9(_0xe73ece[_0x52fe('0xf')][_0x52fe('0x10')]);}logger[_0x52fe('0xf')](_0x52fe('0x11'),_0x2b3f41,_0xe73ece['error'][_0x52fe('0x10')]);return _0x408cef(_0xe73ece[_0x52fe('0xf')][_0x52fe('0x10')]);}else{logger[_0x52fe('0x12')](_0x52fe('0x11'),_0x2b3f41,_0x52fe('0xc'));_0x408cef(_0xe73ece[_0x52fe('0x13')][_0x52fe('0x10')]);}})[_0x52fe('0x14')](function(_0x33ab22){logger['error']('Automation,\x20%s,\x20%s',_0x2b3f41,_0x33ab22);_0x49f7d9(_0x33ab22);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index e6fc785..a3d253f 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 _0x899a=['/:id/conditions','getConditions','/:id/actions','getActions','addConditions','post','addActions','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x899a,0x1b6));var _0xa899=function(_0x58290b,_0x147b41){_0x58290b=_0x58290b-0x0;var _0x461cd2=_0x899a[_0x58290b];return _0x461cd2;};'use strict';var multer=require(_0xa899('0x0'));var util=require(_0xa899('0x1'));var path=require('path');var timeout=require(_0xa899('0x2'));var express=require(_0xa899('0x3'));var router=express['Router']();var fs_extra=require(_0xa899('0x4'));var auth=require(_0xa899('0x5'));var interaction=require(_0xa899('0x6'));var config=require(_0xa899('0x7'));var controller=require('./automation.controller');router[_0xa899('0x8')]('/',auth[_0xa899('0x9')](),controller[_0xa899('0xa')]);router[_0xa899('0x8')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0xb')]);router[_0xa899('0x8')](_0xa899('0xc'),auth[_0xa899('0x9')](),controller[_0xa899('0xd')]);router[_0xa899('0x8')](_0xa899('0xe'),auth[_0xa899('0x9')](),controller[_0xa899('0xf')]);router['post']('/',auth[_0xa899('0x9')](),controller['create']);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xa899('0x10')]);router[_0xa899('0x11')](_0xa899('0xe'),auth['isAuthenticated'](),controller[_0xa899('0x12')]);router[_0xa899('0x13')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0x14')]);router[_0xa899('0x15')](_0xa899('0x16'),auth['isAuthenticated'](),controller[_0xa899('0x17')]);module[_0xa899('0x18')]=router;
\ No newline at end of file
+var _0x04de=['getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','/:id','isAuthenticated','show','get','/:id/conditions','getConditions'];(function(_0x376b10,_0x3a5cd0){var _0xb187e8=function(_0x3c75ee){while(--_0x3c75ee){_0x376b10['push'](_0x376b10['shift']());}};_0xb187e8(++_0x3a5cd0);}(_0x04de,0x107));var _0xe04d=function(_0x210ee7,_0x5eb15b){_0x210ee7=_0x210ee7-0x0;var _0x4bd246=_0x04de[_0x210ee7];return _0x4bd246;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0xd')]);router[_0xe04d('0xe')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x10')]);router[_0xe04d('0xe')]('/:id/actions',auth[_0xe04d('0xc')](),controller[_0xe04d('0x11')]);router[_0xe04d('0x12')]('/',auth[_0xe04d('0xc')](),controller[_0xe04d('0x13')]);router[_0xe04d('0x12')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x14')]);router['post'](_0xe04d('0x15'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x16')]);router[_0xe04d('0x17')](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x18')]);router[_0xe04d('0x19')](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x1a')]);module[_0xe04d('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 3fc10da..fd8dd23 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 _0x0f48=['UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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\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','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.'];(function(_0x3c7c93,_0x205471){var _0x1967f7=function(_0x3504e2){while(--_0x3504e2){_0x3c7c93['push'](_0x3c7c93['shift']());}};_0x1967f7(++_0x205471);}(_0x0f48,0x1be));var _0x80f4=function(_0xe8cf51,_0x4ef81b){_0xe8cf51=_0xe8cf51-0x0;var _0x268f06=_0x0f48[_0xe8cf51];return _0x268f06;};'use strict';var Sequelize=require(_0x80f4('0x0'));module[_0x80f4('0x1')]={'name':{'type':Sequelize[_0x80f4('0x2')],'unique':_0x80f4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x80f4('0x4')](_0x80f4('0x5')),'allowNull':![],'defaultValue':_0x80f4('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x80f4('0x6')},'limitCalls':{'type':Sequelize[_0x80f4('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x80f4('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x80f4('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x80f4('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'comment':_0x80f4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x80f4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x80f4('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x80f4('0x4')](_0x80f4('0xf'),_0x80f4('0x10'),_0x80f4('0x11')),'defaultValue':_0x80f4('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x80f4('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x80f4('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x80f4('0x7')](0x9)[_0x80f4('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x80f4('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x80f4('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x80f4('0x7')](0x9)[_0x80f4('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x80f4('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x80f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x80f4('0x7')](0x9)[_0x80f4('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x80f4('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x80f4('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x80f4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x80f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x80f4('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x80f4('0x19'),_0x80f4('0x1a')),'defaultValue':_0x80f4('0x19')},'dialPrefix':{'type':Sequelize[_0x80f4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x80f4('0x1b')},'dialCutDigit':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x80f4('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x22')}};
\ No newline at end of file
+var _0xafcd=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','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\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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)'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xafcd,0x157));var _0xdafc=function(_0x348ea7,_0x591405){_0x348ea7=_0x348ea7-0x0;var _0x5eafdf=_0xafcd[_0x348ea7];return _0x5eafdf;};'use strict';var Sequelize=require(_0xdafc('0x0'));module[_0xdafc('0x1')]={'name':{'type':Sequelize[_0xdafc('0x2')],'unique':_0xdafc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xdafc('0x4')](_0xdafc('0x5')),'allowNull':![],'defaultValue':_0xdafc('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xdafc('0x6')],'defaultValue':0x0,'comment':_0xdafc('0x7')},'limitCalls':{'type':Sequelize[_0xdafc('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdafc('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdafc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdafc('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'comment':_0xdafc('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xdafc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xdafc('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xdafc('0x4')](_0xdafc('0x12'),_0xdafc('0x13'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xdafc('0x6')],'defaultValue':0x0,'comment':_0xdafc('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xdafc('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdafc('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdafc('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdafc('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdafc('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdafc('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdafc('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdafc('0x4')](_0xdafc('0x1a'),_0xdafc('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xdafc('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdafc('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdafc('0x1c')},'dialCutDigit':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdafc('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4a1bc56..d160a1d 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 _0xfef3=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','IvrCampaigns','UserProfileResource','then','error','stack','name','send','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','omit','userProfileId','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','NOW()','OrderBy','h.id','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x14b41,_0x2ee4dc){var _0x2cd213=function(_0x5147be){while(--_0x5147be){_0x14b41['push'](_0x14b41['shift']());}};_0x2cd213(++_0x2ee4dc);}(_0xfef3,0x118));var _0x3fef=function(_0x4b92f0,_0x5255d3){_0x4b92f0=_0x4b92f0-0x0;var _0x1626a3=_0xfef3[_0x4b92f0];return _0x1626a3;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x4c4a47,_0x2c99ff){_0x2c99ff=_0x2c99ff||0xcc;return function(_0x3d2c2d){if(_0x3d2c2d){return _0x4c4a47[_0x3fef('0x19')](_0x2c99ff);}return _0x4c4a47['status'](_0x2c99ff)[_0x3fef('0x1a')]();};}function respondWithResult(_0x4be62f,_0x15b757){_0x15b757=_0x15b757||0xc8;return function(_0x14c053){if(_0x14c053){return _0x4be62f['status'](_0x15b757)[_0x3fef('0x1b')](_0x14c053);}};}function respondWithFilteredResult(_0x177e28,_0x40b479){return function(_0x79b617){if(_0x79b617){var _0x395df0=typeof _0x40b479[_0x3fef('0x1c')]==='undefined'&&typeof _0x40b479[_0x3fef('0x1d')]===_0x3fef('0x1e');var _0x1ec282=_0x79b617[_0x3fef('0x1f')];var _0x1613ad=_0x395df0?0x0:_0x40b479[_0x3fef('0x1c')];var _0x53d993=_0x395df0?_0x79b617[_0x3fef('0x1f')]:_0x40b479[_0x3fef('0x1c')]+_0x40b479['limit'];var _0x2c7f36;if(_0x53d993>=_0x1ec282){_0x53d993=_0x1ec282;_0x2c7f36=0xc8;}else{_0x2c7f36=0xce;}_0x177e28[_0x3fef('0x20')](_0x2c7f36);return _0x177e28[_0x3fef('0x21')](_0x3fef('0x22'),_0x1613ad+'-'+_0x53d993+'/'+_0x1ec282)[_0x3fef('0x1b')](_0x79b617);}return null;};}function patchUpdates(_0x2b5226){return function(_0x451d11){try{jsonpatch[_0x3fef('0x23')](_0x451d11,_0x2b5226,!![]);}catch(_0x124e7c){return BPromise[_0x3fef('0x24')](_0x124e7c);}return _0x451d11[_0x3fef('0x25')]();};}function saveUpdates(_0x3bb110,_0x2eb578){return function(_0x39a8ea){if(_0x39a8ea){return _0x39a8ea[_0x3fef('0x26')](_0x3bb110)['then'](function(_0x5b56de){return _0x5b56de;});}return null;};}function removeEntity(_0x50025f,_0x378b03){return function(_0x3ba38d){if(_0x3ba38d){return _0x3ba38d[_0x3fef('0x27')]()['then'](function(){var _0x4d462c=_0x3ba38d['get']({'plain':!![]});var _0x45464b=_0x3fef('0x28');return db[_0x3fef('0x29')][_0x3fef('0x27')]({'where':{'type':_0x45464b,'resourceId':_0x4d462c['id']}})[_0x3fef('0x2a')](function(){return _0x3ba38d;});})['then'](function(){_0x50025f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x121ff0,_0x3baa52){return function(_0x4ea2ab){if(!_0x4ea2ab){_0x121ff0[_0x3fef('0x19')](0x194);}return _0x4ea2ab;};}function handleError(_0x6d08cd,_0x4e08d8){_0x4e08d8=_0x4e08d8||0x1f4;return function(_0x30a954){logger[_0x3fef('0x2b')](_0x30a954[_0x3fef('0x2c')]);if(_0x30a954[_0x3fef('0x2d')]){delete _0x30a954[_0x3fef('0x2d')];}_0x6d08cd[_0x3fef('0x20')](_0x4e08d8)[_0x3fef('0x2e')](_0x30a954);};}exports['index']=function(_0x34576a,_0xc20ce5){var _0x21aad4={},_0x11bd40={},_0x5dbbc0={'count':0x0,'rows':[]};var _0xcd635d=_['map'](db[_0x3fef('0x2f')][_0x3fef('0x30')],function(_0x16009a){return{'name':_0x16009a[_0x3fef('0x31')],'type':_0x16009a[_0x3fef('0x32')][_0x3fef('0x33')]};});_0x11bd40[_0x3fef('0x34')]=_[_0x3fef('0x35')](_0xcd635d,_0x3fef('0x2d'));_0x11bd40[_0x3fef('0x36')]=_['keys'](_0x34576a['query']);_0x11bd40[_0x3fef('0x37')]=_['intersection'](_0x11bd40[_0x3fef('0x34')],_0x11bd40[_0x3fef('0x36')]);_0x21aad4[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x11bd40[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x21aad4[_0x3fef('0x38')]=_0x21aad4[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x21aad4[_0x3fef('0x38')]:_0x11bd40[_0x3fef('0x34')];if(!_0x34576a[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x21aad4[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x21aad4[_0x3fef('0x1c')]=qs['offset'](_0x34576a['query'][_0x3fef('0x1c')]);}_0x21aad4[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x21aad4[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x34576a[_0x3fef('0x36')],_0x11bd40[_0x3fef('0x37')]),_0xcd635d);if(_0x34576a[_0x3fef('0x36')]['filter']){_0x21aad4[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x21aad4['where'],{'$or':_['map'](_0xcd635d,function(_0x37c4af){if(_0x37c4af[_0x3fef('0x32')]!==_0x3fef('0x42')){var _0x21c531={};_0x21c531[_0x37c4af[_0x3fef('0x2d')]]={'$like':'%'+_0x34576a[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x21c531;}})});}_0x21aad4=_[_0x3fef('0x41')]({},_0x21aad4,_0x34576a['options']);var _0x107d42={'where':_0x21aad4[_0x3fef('0x3f')]};return db[_0x3fef('0x2f')][_0x3fef('0x1f')](_0x107d42)[_0x3fef('0x2a')](function(_0x2143ec){_0x5dbbc0[_0x3fef('0x1f')]=_0x2143ec;if(_0x34576a[_0x3fef('0x36')][_0x3fef('0x44')]){_0x21aad4[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x2f')][_0x3fef('0x46')](_0x21aad4);})[_0x3fef('0x2a')](function(_0x15d2c7){_0x5dbbc0[_0x3fef('0x47')]=_0x15d2c7;return _0x5dbbc0;})['then'](respondWithFilteredResult(_0xc20ce5,_0x21aad4))[_0x3fef('0x48')](handleError(_0xc20ce5,null));};exports[_0x3fef('0x49')]=function(_0x421fd1,_0x2120fd){var _0x1879c1={'raw':![],'where':{'id':_0x421fd1['params']['id']}},_0x33b145={};_0x33b145[_0x3fef('0x34')]=_['keys'](db[_0x3fef('0x2f')][_0x3fef('0x30')]);_0x33b145['query']=_[_0x3fef('0x4a')](_0x421fd1['query']);_0x33b145[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],_0x33b145[_0x3fef('0x36')]);_0x1879c1[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x421fd1[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x1879c1[_0x3fef('0x38')]=_0x1879c1[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x1879c1['attributes']:_0x33b145[_0x3fef('0x34')];if(_0x421fd1[_0x3fef('0x36')]['includeAll']){_0x1879c1[_0x3fef('0x45')]=[{'all':!![]}];}_0x1879c1=_[_0x3fef('0x41')]({},_0x1879c1,_0x421fd1[_0x3fef('0x4b')]);return db['Campaign'][_0x3fef('0x4c')](_0x1879c1)[_0x3fef('0x2a')](handleEntityNotFound(_0x2120fd,null))['then'](respondWithResult(_0x2120fd,null))[_0x3fef('0x48')](handleError(_0x2120fd,null));};exports['create']=function(_0x48322c,_0x15fb2c){return db['Campaign'][_0x3fef('0x4d')](_0x48322c[_0x3fef('0x4e')],{})['then'](function(_0x4535e8){var _0x2823f4=_0x48322c[_0x3fef('0x4f')]['get']({'plain':!![]});if(!_0x2823f4)throw new Error(_0x3fef('0x50'));if(_0x2823f4[_0x3fef('0x51')]===_0x3fef('0x4f')){var _0x5b1acb=_0x4535e8[_0x3fef('0x52')]({'plain':!![]});var _0x154311=_0x3fef('0x28');return db[_0x3fef('0x53')][_0x3fef('0x4c')]({'where':{'name':_0x154311,'userProfileId':_0x2823f4['userProfileId']},'raw':!![]})[_0x3fef('0x2a')](function(_0xbbf255){if(_0xbbf255&&_0xbbf255[_0x3fef('0x54')]===0x0){return db[_0x3fef('0x29')][_0x3fef('0x4d')]({'name':_0x5b1acb[_0x3fef('0x2d')],'resourceId':_0x5b1acb['id'],'type':_0xbbf255[_0x3fef('0x2d')],'sectionId':_0xbbf255['id']},{})[_0x3fef('0x2a')](function(){return _0x4535e8;});}else{return _0x4535e8;}})[_0x3fef('0x48')](function(_0x4862a5){logger['error'](_0x3fef('0x55'),_0x4862a5);throw _0x4862a5;});}return _0x4535e8;})[_0x3fef('0x2a')](respondWithResult(_0x15fb2c,0xc9))[_0x3fef('0x48')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x56')]=function(_0xd57af2,_0x192f91){var _0xbc9e81={'where':{'id':_0xd57af2[_0x3fef('0x57')]['id']}},_0x17e188={};_0x17e188[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x2f')]['rawAttributes']);_0xbc9e81[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x17e188[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0xd57af2['query'][_0x3fef('0x3a')]));_0xbc9e81[_0x3fef('0x38')]=_0xbc9e81[_0x3fef('0x38')][_0x3fef('0x3b')]?_0xbc9e81['attributes']:_0x17e188[_0x3fef('0x34')];if(_0xd57af2[_0x3fef('0x36')][_0x3fef('0x44')]){_0xbc9e81['include']=[{'all':!![]}];}_0xbc9e81=_['merge']({},_0xbc9e81,_0xd57af2[_0x3fef('0x4b')]);return db[_0x3fef('0x2f')][_0x3fef('0x4c')](_0xbc9e81)[_0x3fef('0x2a')](handleEntityNotFound(_0x192f91,null))['then'](function(_0x3073da){if(_0x3073da){var _0x4824d0=_0x3073da[_0x3fef('0x52')]({'plain':!![]});_0x4824d0=qs['omit'](_0x4824d0,['id',_0x3fef('0x58'),'updatedAt']);_0xd57af2[_0x3fef('0x4e')]=_[_0x3fef('0x59')](_0xd57af2[_0x3fef('0x4e')],['id','createdAt','updatedAt']);return db[_0x3fef('0x2f')][_0x3fef('0x4d')](_[_0x3fef('0x41')](_0x4824d0,_0xd57af2[_0x3fef('0x4e')]),{'include':_0xd57af2[_0x3fef('0x36')][_0x3fef('0x44')]?[{'all':!![]}]:undefined})[_0x3fef('0x2a')](function(_0x2b9a5e){var _0x5493a8=_0xd57af2[_0x3fef('0x4f')]['get']({'plain':!![]});if(!_0x5493a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5493a8[_0x3fef('0x51')]===_0x3fef('0x4f')){var _0xd01ee6=_0x2b9a5e[_0x3fef('0x52')]({'plain':!![]});var _0x14db4d=_0x3fef('0x28');return db[_0x3fef('0x53')][_0x3fef('0x4c')]({'where':{'name':_0x14db4d,'userProfileId':_0x5493a8[_0x3fef('0x5a')]},'raw':!![]})['then'](function(_0x2d36fd){if(_0x2d36fd&&_0x2d36fd['autoAssociation']===0x0){return db[_0x3fef('0x29')][_0x3fef('0x4d')]({'name':_0xd01ee6[_0x3fef('0x2d')],'resourceId':_0xd01ee6['id'],'type':_0x2d36fd[_0x3fef('0x2d')],'sectionId':_0x2d36fd['id']},{})[_0x3fef('0x2a')](function(){return _0x2b9a5e;});}else{return _0x2b9a5e;}})[_0x3fef('0x48')](function(_0x4a4631){logger[_0x3fef('0x2b')](_0x3fef('0x55'),_0x4a4631);throw _0x4a4631;});}return _0x2b9a5e;});}})[_0x3fef('0x2a')](respondWithResult(_0x192f91,0xc9))[_0x3fef('0x48')](handleError(_0x192f91,null));};exports[_0x3fef('0x26')]=function(_0x40bd7e,_0x10b869){if(_0x40bd7e[_0x3fef('0x4e')]['id']){delete _0x40bd7e[_0x3fef('0x4e')]['id'];}return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x40bd7e['params']['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x10b869,null))['then'](saveUpdates(_0x40bd7e['body'],null))['then'](respondWithResult(_0x10b869,null))[_0x3fef('0x48')](handleError(_0x10b869,null));};exports['destroy']=function(_0x3d89b1,_0x19daae){return db[_0x3fef('0x2f')]['find']({'where':{'id':_0x3d89b1[_0x3fef('0x57')]['id']}})['then'](handleEntityNotFound(_0x19daae,null))[_0x3fef('0x2a')](removeEntity(_0x19daae,null))[_0x3fef('0x48')](handleError(_0x19daae,null));};exports['getHoppers']=function(_0x1d0ae0,_0x458583,_0x10bf8e){var _0x134bea={'raw':!![],'where':{}};var _0xb68294={};var _0x2237f8={'count':0x0,'rows':[]};return db[_0x3fef('0x2f')][_0x3fef('0x5b')]({'where':{'id':_0x1d0ae0['params']['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x458583,null))[_0x3fef('0x2a')](function(_0x3c5ae9){if(_0x3c5ae9){_0xb68294[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x5c')][_0x3fef('0x30')]);_0xb68294[_0x3fef('0x36')]=_[_0x3fef('0x4a')](_0x1d0ae0[_0x3fef('0x36')]);_0xb68294[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0xb68294[_0x3fef('0x34')],_0xb68294[_0x3fef('0x36')]);_0x134bea['attributes']=_[_0x3fef('0x39')](_0xb68294[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x1d0ae0['query']['fields']));_0x134bea['attributes']=_0x134bea[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x134bea[_0x3fef('0x38')]:_0xb68294[_0x3fef('0x34')];if(!_0x1d0ae0['query'][_0x3fef('0x5d')](_0x3fef('0x3c'))){_0x134bea[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x1d0ae0['query'][_0x3fef('0x1d')]);_0x134bea[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0x134bea['order']=qs[_0x3fef('0x3e')](_0x1d0ae0['query'][_0x3fef('0x3e')]);_0x134bea['where']=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x1d0ae0[_0x3fef('0x36')],_0xb68294[_0x3fef('0x37')]));_0x134bea[_0x3fef('0x3f')][_0x3fef('0x5e')]=_0x3c5ae9['id'];if(_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x43')]){_0x134bea[_0x3fef('0x3f')]=_['merge'](_0x134bea[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x134bea[_0x3fef('0x38')],function(_0x1515fb){var _0x4d8a00={};_0x4d8a00[_0x1515fb]={'$like':'%'+_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x4d8a00;})});}_0x134bea=_[_0x3fef('0x41')]({},_0x134bea,_0x1d0ae0[_0x3fef('0x4b')]);return db[_0x3fef('0x5c')][_0x3fef('0x1f')]({'where':_0x134bea['where']})[_0x3fef('0x2a')](function(_0x3ddfc6){_0x2237f8[_0x3fef('0x1f')]=_0x3ddfc6;if(_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x44')]){_0x134bea[_0x3fef('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0x3fef('0x46')](_0x134bea);})[_0x3fef('0x2a')](function(_0x177a09){_0x2237f8[_0x3fef('0x47')]=_0x177a09;return _0x2237f8;});}})[_0x3fef('0x2a')](respondWithFilteredResult(_0x458583,_0x134bea))['catch'](handleError(_0x458583,null));};exports[_0x3fef('0x5f')]=function(_0x196d67,_0x34d9ca,_0x4cf064){var _0x18159c={'raw':!![],'where':{}};var _0x2dc963={};var _0x406afb={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x196d67[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x34d9ca,null))[_0x3fef('0x2a')](function(_0x25914c){if(_0x25914c){_0x2dc963['model']=_[_0x3fef('0x4a')](db[_0x3fef('0x60')][_0x3fef('0x30')]);_0x2dc963['query']=_[_0x3fef('0x4a')](_0x196d67[_0x3fef('0x36')]);_0x2dc963[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x2dc963[_0x3fef('0x34')],_0x2dc963[_0x3fef('0x36')]);_0x18159c[_0x3fef('0x38')]=_['intersection'](_0x2dc963['model'],qs[_0x3fef('0x3a')](_0x196d67['query'][_0x3fef('0x3a')]));_0x18159c[_0x3fef('0x38')]=_0x18159c[_0x3fef('0x38')]['length']?_0x18159c[_0x3fef('0x38')]:_0x2dc963['model'];if(!_0x196d67[_0x3fef('0x36')]['hasOwnProperty']('nolimit')){_0x18159c['limit']=qs[_0x3fef('0x1d')](_0x196d67[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x18159c[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x196d67[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0x18159c['order']=qs[_0x3fef('0x3e')](_0x196d67[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x18159c['where']=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x196d67[_0x3fef('0x36')],_0x2dc963[_0x3fef('0x37')]));_0x18159c['where'][_0x3fef('0x5e')]=_0x25914c['id'];if(_0x196d67['query'][_0x3fef('0x43')]){_0x18159c[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x18159c[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x18159c[_0x3fef('0x38')],function(_0x3100c3){var _0x1f7227={};_0x1f7227[_0x3100c3]={'$like':'%'+_0x196d67['query'][_0x3fef('0x43')]+'%'};return _0x1f7227;})});}_0x18159c=_['merge']({},_0x18159c,_0x196d67['options']);return db[_0x3fef('0x60')][_0x3fef('0x1f')]({'where':_0x18159c[_0x3fef('0x3f')]})[_0x3fef('0x2a')](function(_0x47ceb7){_0x406afb[_0x3fef('0x1f')]=_0x47ceb7;if(_0x196d67[_0x3fef('0x36')][_0x3fef('0x44')]){_0x18159c[_0x3fef('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3fef('0x46')](_0x18159c);})[_0x3fef('0x2a')](function(_0x236567){_0x406afb[_0x3fef('0x47')]=_0x236567;return _0x406afb;});}})[_0x3fef('0x2a')](respondWithFilteredResult(_0x34d9ca,_0x18159c))['catch'](handleError(_0x34d9ca,null));};exports[_0x3fef('0x61')]=function(_0x23907f,_0x2be8cb,_0x1eb92c){var _0x14e142={'raw':!![],'where':{}};var _0x5894f5={};var _0xe6a6b7={'count':0x0,'rows':[]};return db[_0x3fef('0x2f')][_0x3fef('0x5b')]({'where':{'id':_0x23907f[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x2be8cb,null))['then'](function(_0x281fbd){if(_0x281fbd){_0x5894f5[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x62')][_0x3fef('0x30')]);_0x5894f5[_0x3fef('0x36')]=_['keys'](_0x23907f['query']);_0x5894f5['filters']=_['intersection'](_0x5894f5['model'],_0x5894f5[_0x3fef('0x36')]);_0x14e142[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x5894f5[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x23907f['query'][_0x3fef('0x3a')]));_0x14e142[_0x3fef('0x38')]=_0x14e142[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x14e142[_0x3fef('0x38')]:_0x5894f5[_0x3fef('0x34')];if(!_0x23907f[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x14e142['limit']=qs[_0x3fef('0x1d')](_0x23907f[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x14e142[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x23907f[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0x14e142['order']=qs['sort'](_0x23907f['query']['sort']);_0x14e142[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x23907f[_0x3fef('0x36')],_0x5894f5[_0x3fef('0x37')]));_0x14e142['where'][_0x3fef('0x5e')]=_0x281fbd['id'];if(_0x23907f[_0x3fef('0x36')][_0x3fef('0x43')]){_0x14e142['where']=_[_0x3fef('0x41')](_0x14e142[_0x3fef('0x3f')],{'$or':_['map'](_0x14e142['attributes'],function(_0x3c3978){var _0x50eb66={};_0x50eb66[_0x3c3978]={'$like':'%'+_0x23907f[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x50eb66;})});}_0x14e142=_['merge']({},_0x14e142,_0x23907f[_0x3fef('0x4b')]);return db[_0x3fef('0x62')][_0x3fef('0x1f')]({'where':_0x14e142['where']})[_0x3fef('0x2a')](function(_0x1d0fc8){_0xe6a6b7['count']=_0x1d0fc8;if(_0x23907f[_0x3fef('0x36')][_0x3fef('0x44')]){_0x14e142[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x62')]['findAll'](_0x14e142);})['then'](function(_0x91a872){_0xe6a6b7['rows']=_0x91a872;return _0xe6a6b7;});}})[_0x3fef('0x2a')](respondWithFilteredResult(_0x2be8cb,_0x14e142))[_0x3fef('0x48')](handleError(_0x2be8cb,null));};exports[_0x3fef('0x63')]=function(_0x2296ae,_0x4e4a3c,_0x21447f){var _0xb24519={'raw':!![],'where':{}};var _0x2fd355={};var _0x102808={'count':0x0,'rows':[]};return db['Campaign'][_0x3fef('0x5b')]({'where':{'id':_0x2296ae['params']['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x4e4a3c,null))[_0x3fef('0x2a')](function(_0x578303){if(_0x578303){_0x2fd355['model']=_[_0x3fef('0x4a')](db[_0x3fef('0x64')]['rawAttributes']);_0x2fd355[_0x3fef('0x36')]=_[_0x3fef('0x4a')](_0x2296ae['query']);_0x2fd355['filters']=_[_0x3fef('0x39')](_0x2fd355[_0x3fef('0x34')],_0x2fd355['query']);_0xb24519[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x2fd355[_0x3fef('0x34')],qs['fields'](_0x2296ae[_0x3fef('0x36')][_0x3fef('0x3a')]));_0xb24519[_0x3fef('0x38')]=_0xb24519[_0x3fef('0x38')][_0x3fef('0x3b')]?_0xb24519['attributes']:_0x2fd355[_0x3fef('0x34')];if(!_0x2296ae[_0x3fef('0x36')][_0x3fef('0x5d')]('nolimit')){_0xb24519[_0x3fef('0x1d')]=qs['limit'](_0x2296ae['query'][_0x3fef('0x1d')]);_0xb24519[_0x3fef('0x1c')]=qs['offset'](_0x2296ae[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0xb24519['order']=qs['sort'](_0x2296ae[_0x3fef('0x36')][_0x3fef('0x3e')]);_0xb24519[_0x3fef('0x3f')]=qs['filters'](_[_0x3fef('0x40')](_0x2296ae[_0x3fef('0x36')],_0x2fd355[_0x3fef('0x37')]));_0xb24519[_0x3fef('0x3f')][_0x3fef('0x5e')]=_0x578303['id'];if(_0x2296ae[_0x3fef('0x36')][_0x3fef('0x43')]){_0xb24519[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0xb24519[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0xb24519['attributes'],function(_0x778837){var _0x1aca6d={};_0x1aca6d[_0x778837]={'$like':'%'+_0x2296ae[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x1aca6d;})});}_0xb24519=_['merge']({},_0xb24519,_0x2296ae[_0x3fef('0x4b')]);return db[_0x3fef('0x64')][_0x3fef('0x1f')]({'where':_0xb24519[_0x3fef('0x3f')]})['then'](function(_0x4a8291){_0x102808[_0x3fef('0x1f')]=_0x4a8291;if(_0x2296ae[_0x3fef('0x36')][_0x3fef('0x44')]){_0xb24519[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x64')]['findAll'](_0xb24519);})[_0x3fef('0x2a')](function(_0x2aa67e){_0x102808['rows']=_0x2aa67e;return _0x102808;});}})['then'](respondWithFilteredResult(_0x4e4a3c,_0xb24519))[_0x3fef('0x48')](handleError(_0x4e4a3c,null));};exports[_0x3fef('0x65')]=function(_0x7efffe,_0x7211b3,_0xe29f79){var _0x3ee841={};var _0x50d888={};var _0x55f1ba;var _0xc625bf;return db['Campaign'][_0x3fef('0x5b')]({'where':{'id':_0x7efffe[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x7211b3,null))['then'](function(_0x203b84){if(_0x203b84){_0x55f1ba=_0x203b84;_0x50d888[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x66')]['rawAttributes']);_0x50d888[_0x3fef('0x36')]=_[_0x3fef('0x4a')](_0x7efffe[_0x3fef('0x36')]);_0x50d888[_0x3fef('0x37')]=_['intersection'](_0x50d888[_0x3fef('0x34')],_0x50d888[_0x3fef('0x36')]);_0x3ee841[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x50d888[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x7efffe[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x3ee841[_0x3fef('0x38')]=_0x3ee841['attributes']['length']?_0x3ee841[_0x3fef('0x38')]:_0x50d888[_0x3fef('0x34')];_0x3ee841[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x7efffe['query'][_0x3fef('0x3e')]);_0x3ee841[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_['pick'](_0x7efffe[_0x3fef('0x36')],_0x50d888['filters']));if(_0x7efffe['query'][_0x3fef('0x43')]){_0x3ee841[_0x3fef('0x3f')]=_['merge'](_0x3ee841[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x3ee841[_0x3fef('0x38')],function(_0x1bcdd9){var _0x5b788c={};_0x5b788c[_0x1bcdd9]={'$like':'%'+_0x7efffe[_0x3fef('0x36')]['filter']+'%'};return _0x5b788c;})});}_0x3ee841=_['merge']({},_0x3ee841,_0x7efffe[_0x3fef('0x4b')]);return _0x55f1ba[_0x3fef('0x65')](_0x3ee841);}})[_0x3fef('0x2a')](function(_0x4cd6a3){if(_0x4cd6a3){_0xc625bf=_0x4cd6a3[_0x3fef('0x3b')];if(!_0x7efffe['query'][_0x3fef('0x5d')](_0x3fef('0x3c'))){_0x3ee841[_0x3fef('0x1d')]=qs['limit'](_0x7efffe[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x3ee841['offset']=qs[_0x3fef('0x1c')](_0x7efffe[_0x3fef('0x36')][_0x3fef('0x1c')]);}return _0x55f1ba['getLists'](_0x3ee841);}})[_0x3fef('0x2a')](function(_0x3a5177){if(_0x3a5177){return _0x3a5177?{'count':_0xc625bf,'rows':_0x3a5177}:null;}})[_0x3fef('0x2a')](respondWithResult(_0x7211b3,null))['catch'](handleError(_0x7211b3,null));};exports[_0x3fef('0x67')]=function(_0x1cc284,_0x3c92d0,_0x257d78){var _0x51a02e,_0x22dd20;var _0x547a21=[];var _0x21ab99=moment()[_0x3fef('0x68')](_0x3fef('0x69'));return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x1cc284[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x3c92d0,null))['then'](function(_0x419a8d){if(_0x419a8d){_0x22dd20=_0x419a8d;return _0x419a8d[_0x3fef('0x67')](_0x1cc284['body'][_0x3fef('0x6a')],_[_0x3fef('0x59')](_0x1cc284[_0x3fef('0x4e')],['ids','id'])||{});}return null;})['spread'](function(_0x518162){var _0x57fce9;var _0x2dd846;_0x51a02e=_0x518162||[];var _0x4b984c=[];if(_0x518162){for(var _0x102572=0x0;_0x102572<_0x518162['length'];_0x102572+=0x1){var _0x2bd5eb=_0x518162[_0x102572][_0x3fef('0x52')]({'plain':!![]});_0x22dd20[_0x3fef('0x6b')]=_0x1cc284[_0x3fef('0x4e')]['dialCheckDuplicateType']?_0x1cc284[_0x3fef('0x4e')][_0x3fef('0x6b')]:_0x22dd20[_0x3fef('0x6b')];switch(_0x22dd20[_0x3fef('0x6b')]){case'always':_0x57fce9=squel[_0x3fef('0x6c')]()[_0x3fef('0x6d')](_0x3fef('0x6e'))[_0x3fef('0x6f')]([_0x3fef('0x70'),_0x3fef('0x71'),'ContactId',_0x3fef('0x72'),'CampaignId',_0x3fef('0x58'),_0x3fef('0x73')],squel['select']()[_0x3fef('0x74')](_0x3fef('0x70'),_0x3fef('0x70'))[_0x3fef('0x74')]('NOW()',_0x3fef('0x71'))[_0x3fef('0x74')]('id',_0x3fef('0x75'))[_0x3fef('0x74')](_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')](),_0x3fef('0x72'))['field'](_0x1cc284['params']['id']['toString'](),'CampaignId')[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))['field']('\x27'+_0x21ab99+'\x27',_0x3fef('0x73'))[_0x3fef('0x78')](_0x3fef('0x79'))[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')](_0x3fef('0x7b'),_0x2bd5eb[_0x3fef('0x76')]['toString']())[_0x3fef('0x3f')](_0x3fef('0x7c'))[_0x3fef('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3fef('0x7d')]()[_0x3fef('0x74')](_0x3fef('0x7e'))[_0x3fef('0x78')](_0x3fef('0x7f'))[_0x3fef('0x3f')]('CampaignId\x20=\x20?',_0x1cc284['params']['id'][_0x3fef('0x77')]()))[_0x3fef('0x3f')](_0x3fef('0x80'),squel['select']()['field'](_0x3fef('0x81'))[_0x3fef('0x78')]('cm_hopper')[_0x3fef('0x3f')](_0x3fef('0x82'),_0x1cc284[_0x3fef('0x57')]['id']['toString']())))[_0x3fef('0x77')]();break;case _0x3fef('0x83'):_0x57fce9=squel[_0x3fef('0x6c')]()[_0x3fef('0x6d')](_0x3fef('0x6e'))[_0x3fef('0x6f')]([_0x3fef('0x70'),'scheduledAt',_0x3fef('0x75'),_0x3fef('0x72'),'CampaignId','createdAt',_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field'](_0x3fef('0x70'),'phone')['field'](_0x3fef('0x84'),_0x3fef('0x71'))['field']('id',_0x3fef('0x75'))[_0x3fef('0x74')](_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')](),_0x3fef('0x72'))[_0x3fef('0x74')](_0x1cc284[_0x3fef('0x57')]['id'][_0x3fef('0x77')](),_0x3fef('0x5e'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x73'))['from']('cm_contacts')[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')]('ListId\x20=\x20?',_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')]())[_0x3fef('0x3f')](_0x3fef('0x7c'))[_0x3fef('0x3f')](_0x3fef('0x80'),squel[_0x3fef('0x7d')]()[_0x3fef('0x74')](_0x3fef('0x81'))[_0x3fef('0x78')](_0x3fef('0x6e'))[_0x3fef('0x3f')]('CampaignId\x20=\x20?',_0x1cc284[_0x3fef('0x57')]['id'][_0x3fef('0x77')]())))[_0x3fef('0x77')]();break;default:_0x57fce9=squel[_0x3fef('0x6c')]()[_0x3fef('0x6d')](_0x3fef('0x6e'))[_0x3fef('0x6f')]([_0x3fef('0x70'),_0x3fef('0x71'),_0x3fef('0x75'),'ListId',_0x3fef('0x5e'),_0x3fef('0x58'),_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field'](_0x3fef('0x70'),_0x3fef('0x70'))[_0x3fef('0x74')](_0x3fef('0x84'),_0x3fef('0x71'))[_0x3fef('0x74')]('id','ContactId')[_0x3fef('0x74')](_0x2bd5eb['CmListId']['toString'](),_0x3fef('0x72'))[_0x3fef('0x74')](_0x1cc284[_0x3fef('0x57')]['id'][_0x3fef('0x77')](),'CampaignId')[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x73'))[_0x3fef('0x78')](_0x3fef('0x79'))[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')](_0x3fef('0x7b'),_0x2bd5eb['CmListId'][_0x3fef('0x77')]())[_0x3fef('0x3f')](_0x3fef('0x7c')))[_0x3fef('0x77')]();}_0x2dd846=squel['insert']()[_0x3fef('0x6d')]('cm_hopper_additional_phones')[_0x3fef('0x6f')](['cmHopperId','scheduledAt',_0x3fef('0x70'),_0x3fef('0x85'),_0x3fef('0x58'),_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field'](_0x3fef('0x86'),'id')[_0x3fef('0x74')](_0x3fef('0x84'),'scheduledAt')[_0x3fef('0x74')]('ci.item',_0x3fef('0x70'))[_0x3fef('0x74')]('ci.OrderBY',_0x3fef('0x85'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27','updatedAt')[_0x3fef('0x78')]('cm_contact_has_items','ci')['join'](_0x3fef('0x6e'),'h',_0x3fef('0x87'))[_0x3fef('0x3f')](_0x3fef('0x88'),_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')]())[_0x3fef('0x3f')]('h.CampaignId=?',_0x1cc284[_0x3fef('0x57')]['id']['toString']())[_0x3fef('0x3f')](_0x3fef('0x89'),_0x21ab99))[_0x3fef('0x77')]();_0x4b984c[_0x3fef('0x8a')](db[_0x3fef('0x8b')][_0x3fef('0x36')](_0x57fce9));_0x547a21[_0x3fef('0x8a')](db[_0x3fef('0x8b')][_0x3fef('0x36')](_0x2dd846));}return BPromise[_0x3fef('0x8c')](_0x4b984c);}})[_0x3fef('0x2a')](function(){return BPromise[_0x3fef('0x8c')](_0x547a21);})['then'](function(){return _0x51a02e;})[_0x3fef('0x2a')](respondWithResult(_0x3c92d0,null))[_0x3fef('0x48')](handleError(_0x3c92d0,null));};exports[_0x3fef('0x8d')]=function(_0x4897e7,_0x170afd,_0x477884){return db[_0x3fef('0x2f')]['find']({'where':{'id':_0x4897e7[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x170afd,null))['then'](function(_0x5a1144){if(_0x5a1144){return _0x5a1144['removeLists'](_0x4897e7[_0x3fef('0x36')][_0x3fef('0x6a')]);}})[_0x3fef('0x2a')](function(_0x546f63){if(_0x546f63){return db[_0x3fef('0x5c')][_0x3fef('0x27')]({'where':{'ListId':_0x4897e7[_0x3fef('0x36')]['ids'],'CampaignId':_0x4897e7[_0x3fef('0x57')]['id']}})['then'](function(){return _0x546f63;});}})[_0x3fef('0x2a')](respondWithStatusCode(_0x170afd,null))['catch'](handleError(_0x170afd,null));};exports[_0x3fef('0x8e')]=function(_0x2fb0dc,_0x57e857,_0x120a19){var _0x107346={};var _0x13c2fd={};var _0x31a97e;var _0x2c0e0c;return db[_0x3fef('0x2f')][_0x3fef('0x5b')]({'where':{'id':_0x2fb0dc['params']['id']}})['then'](handleEntityNotFound(_0x57e857,null))['then'](function(_0xcad35){if(_0xcad35){_0x31a97e=_0xcad35;_0x13c2fd[_0x3fef('0x34')]=_['keys'](db[_0x3fef('0x66')][_0x3fef('0x30')]);_0x13c2fd[_0x3fef('0x36')]=_['keys'](_0x2fb0dc[_0x3fef('0x36')]);_0x13c2fd[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x13c2fd[_0x3fef('0x34')],_0x13c2fd['query']);_0x107346['attributes']=_['intersection'](_0x13c2fd[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x2fb0dc['query'][_0x3fef('0x3a')]));_0x107346[_0x3fef('0x38')]=_0x107346[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x107346[_0x3fef('0x38')]:_0x13c2fd[_0x3fef('0x34')];_0x107346[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x2fb0dc[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x107346['where']=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x2fb0dc['query'],_0x13c2fd[_0x3fef('0x37')]));if(_0x2fb0dc[_0x3fef('0x36')]['filter']){_0x107346[_0x3fef('0x3f')]=_['merge'](_0x107346[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x107346['attributes'],function(_0x185c77){var _0x4eee08={};_0x4eee08[_0x185c77]={'$like':'%'+_0x2fb0dc['query'][_0x3fef('0x43')]+'%'};return _0x4eee08;})});}_0x107346=_['merge']({},_0x107346,_0x2fb0dc[_0x3fef('0x4b')]);return _0x31a97e['getBlackLists'](_0x107346);}})['then'](function(_0x2104e4){if(_0x2104e4){_0x2c0e0c=_0x2104e4[_0x3fef('0x3b')];if(!_0x2fb0dc[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x107346[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x2fb0dc['query']['limit']);_0x107346['offset']=qs['offset'](_0x2fb0dc['query'][_0x3fef('0x1c')]);}return _0x31a97e['getBlackLists'](_0x107346);}})['then'](function(_0x37c791){if(_0x37c791){return _0x37c791?{'count':_0x2c0e0c,'rows':_0x37c791}:null;}})[_0x3fef('0x2a')](respondWithResult(_0x57e857,null))['catch'](handleError(_0x57e857,null));};exports[_0x3fef('0x8f')]=function(_0x3ab10d,_0x2c60bc,_0x44fe61){var _0x2cf8fd,_0x516cb7;var _0x2a9bca=[];var _0x319d92=moment()[_0x3fef('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x3ab10d[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x2c60bc,null))[_0x3fef('0x2a')](function(_0x265403){if(_0x265403){_0x516cb7=_0x265403;return _0x265403[_0x3fef('0x8f')](_0x3ab10d[_0x3fef('0x4e')][_0x3fef('0x6a')],_[_0x3fef('0x59')](_0x3ab10d[_0x3fef('0x4e')],[_0x3fef('0x6a'),'id'])||{});}return null;})['spread'](function(_0x4d1069){var _0x4e1a55;var _0x5bd354;_0x2cf8fd=_0x4d1069||[];var _0x474a9c=[];if(_0x4d1069){for(var _0x231e98=0x0;_0x231e98<_0x4d1069[_0x3fef('0x3b')];_0x231e98+=0x1){var _0x3096f9=_0x4d1069[_0x231e98][_0x3fef('0x52')]({'plain':!![]});_0x4e1a55=squel['insert']()[_0x3fef('0x6d')](_0x3fef('0x90'))[_0x3fef('0x6f')]([_0x3fef('0x70'),_0x3fef('0x75'),_0x3fef('0x72'),_0x3fef('0x5e'),_0x3fef('0x58'),_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field']('phone',_0x3fef('0x70'))[_0x3fef('0x74')]('id',_0x3fef('0x75'))[_0x3fef('0x74')](_0x3096f9['CmListId'][_0x3fef('0x77')](),'ListId')['field'](_0x3ab10d[_0x3fef('0x57')]['id'][_0x3fef('0x77')](),'CampaignId')[_0x3fef('0x74')](_0x3fef('0x84'),'createdAt')[_0x3fef('0x74')]('NOW()',_0x3fef('0x73'))['from'](_0x3fef('0x79'))[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')](_0x3fef('0x7b'),_0x3096f9[_0x3fef('0x76')][_0x3fef('0x77')]())[_0x3fef('0x3f')](_0x3fef('0x7c')))[_0x3fef('0x77')]();_0x474a9c['push'](db[_0x3fef('0x8b')]['query'](_0x4e1a55));}return BPromise['all'](_0x474a9c);}})['then'](function(){return _0x2cf8fd;})['then'](respondWithResult(_0x2c60bc,null))['catch'](handleError(_0x2c60bc,null));};exports[_0x3fef('0x91')]=function(_0x5cbc4a,_0x119a9c,_0x568bc7){return db[_0x3fef('0x2f')]['find']({'where':{'id':_0x5cbc4a[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x119a9c,null))[_0x3fef('0x2a')](function(_0xb88a01){if(_0xb88a01){return _0xb88a01[_0x3fef('0x91')](_0x5cbc4a[_0x3fef('0x36')]['ids']);}})[_0x3fef('0x2a')](function(_0x2d07f6){if(_0x2d07f6){return db[_0x3fef('0x64')][_0x3fef('0x27')]({'where':{'ListId':_0x5cbc4a[_0x3fef('0x36')]['ids'],'CampaignId':_0x5cbc4a['params']['id']}})[_0x3fef('0x2a')](function(){return _0x2d07f6;});}})[_0x3fef('0x2a')](respondWithStatusCode(_0x119a9c,null))['catch'](handleError(_0x119a9c,null));};
\ No newline at end of file
+var _0x18a9=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','createdAt','field','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','scheduledAt','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','type','key','model','map','query','keys','filters'];(function(_0x4f1a1c,_0x58251a){var _0x1abeeb=function(_0x3de157){while(--_0x3de157){_0x4f1a1c['push'](_0x4f1a1c['shift']());}};_0x1abeeb(++_0x58251a);}(_0x18a9,0x17e));var _0x918a=function(_0x365cf4,_0x54cd92){_0x365cf4=_0x365cf4-0x0;var _0x4f5059=_0x18a9[_0x365cf4];return _0x4f5059;};'use strict';var emlformat=require(_0x918a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x918a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x918a('0x2'));var moment=require(_0x918a('0x3'));var BPromise=require(_0x918a('0x4'));var Mustache=require(_0x918a('0x5'));var util=require(_0x918a('0x6'));var path=require(_0x918a('0x7'));var sox=require(_0x918a('0x8'));var csv=require(_0x918a('0x9'));var ejs=require(_0x918a('0xa'));var fs=require('fs');var fs_extra=require(_0x918a('0xb'));var _=require('lodash');var squel=require(_0x918a('0xc'));var crypto=require('crypto');var jsforce=require(_0x918a('0xd'));var deskjs=require(_0x918a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x918a('0xf'));var Papa=require('papaparse');var Redis=require(_0x918a('0x10'));var authService=require(_0x918a('0x11'));var qs=require(_0x918a('0x12'));var as=require(_0x918a('0x13'));var hardwareService=require(_0x918a('0x14'));var logger=require('../../config/logger')(_0x918a('0x15'));var utils=require(_0x918a('0x16'));var config=require(_0x918a('0x17'));var licenseUtil=require(_0x918a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b8a42,_0x3f02af){_0x3f02af=_0x3f02af||0xcc;return function(_0x316b36){if(_0x316b36){return _0x1b8a42['sendStatus'](_0x3f02af);}return _0x1b8a42[_0x918a('0x19')](_0x3f02af)[_0x918a('0x1a')]();};}function respondWithResult(_0xb72115,_0x53f115){_0x53f115=_0x53f115||0xc8;return function(_0x41e8b0){if(_0x41e8b0){return _0xb72115[_0x918a('0x19')](_0x53f115)['json'](_0x41e8b0);}};}function respondWithFilteredResult(_0x543a84,_0x149566){return function(_0xf6ef2b){if(_0xf6ef2b){var _0x3ec709=typeof _0x149566['offset']===_0x918a('0x1b')&&typeof _0x149566[_0x918a('0x1c')]==='undefined';var _0x3912bc=_0xf6ef2b[_0x918a('0x1d')];var _0x3b5f4b=_0x3ec709?0x0:_0x149566['offset'];var _0x124804=_0x3ec709?_0xf6ef2b[_0x918a('0x1d')]:_0x149566['offset']+_0x149566[_0x918a('0x1c')];var _0x4b7458;if(_0x124804>=_0x3912bc){_0x124804=_0x3912bc;_0x4b7458=0xc8;}else{_0x4b7458=0xce;}_0x543a84['status'](_0x4b7458);return _0x543a84['set'](_0x918a('0x1e'),_0x3b5f4b+'-'+_0x124804+'/'+_0x3912bc)[_0x918a('0x1f')](_0xf6ef2b);}return null;};}function patchUpdates(_0x5e2cb0){return function(_0x1cc225){try{jsonpatch[_0x918a('0x20')](_0x1cc225,_0x5e2cb0,!![]);}catch(_0x34f0c2){return BPromise[_0x918a('0x21')](_0x34f0c2);}return _0x1cc225[_0x918a('0x22')]();};}function saveUpdates(_0xa9110d,_0x1c5f9b){return function(_0x18bdac){if(_0x18bdac){return _0x18bdac[_0x918a('0x23')](_0xa9110d)[_0x918a('0x24')](function(_0x3d090c){return _0x3d090c;});}return null;};}function removeEntity(_0x5a4d87,_0x186fb5){return function(_0x4e4399){if(_0x4e4399){return _0x4e4399[_0x918a('0x25')]()[_0x918a('0x24')](function(){var _0x55256a=_0x4e4399[_0x918a('0x26')]({'plain':!![]});var _0x2ac566=_0x918a('0x27');return db[_0x918a('0x28')]['destroy']({'where':{'type':_0x2ac566,'resourceId':_0x55256a['id']}})[_0x918a('0x24')](function(){return _0x4e4399;});})[_0x918a('0x24')](function(){_0x5a4d87['status'](0xcc)[_0x918a('0x1a')]();});}};}function handleEntityNotFound(_0x1604fd,_0x4cd551){return function(_0x2fe4e7){if(!_0x2fe4e7){_0x1604fd[_0x918a('0x29')](0x194);}return _0x2fe4e7;};}function handleError(_0x24e49c,_0x52a57b){_0x52a57b=_0x52a57b||0x1f4;return function(_0x3a2fe2){logger[_0x918a('0x2a')](_0x3a2fe2[_0x918a('0x2b')]);if(_0x3a2fe2['name']){delete _0x3a2fe2[_0x918a('0x2c')];}_0x24e49c['status'](_0x52a57b)[_0x918a('0x2d')](_0x3a2fe2);};}exports[_0x918a('0x2e')]=function(_0x52969e,_0xd21ff3){var _0x3e02c0={},_0x2b9d34={},_0x9d9a98={'count':0x0,'rows':[]};var _0x1c2e2f=_['map'](db[_0x918a('0x2f')][_0x918a('0x30')],function(_0x41aa2f){return{'name':_0x41aa2f['fieldName'],'type':_0x41aa2f[_0x918a('0x31')][_0x918a('0x32')]};});_0x2b9d34[_0x918a('0x33')]=_[_0x918a('0x34')](_0x1c2e2f,_0x918a('0x2c'));_0x2b9d34[_0x918a('0x35')]=_[_0x918a('0x36')](_0x52969e['query']);_0x2b9d34[_0x918a('0x37')]=_[_0x918a('0x38')](_0x2b9d34[_0x918a('0x33')],_0x2b9d34[_0x918a('0x35')]);_0x3e02c0[_0x918a('0x39')]=_[_0x918a('0x38')](_0x2b9d34[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x52969e[_0x918a('0x35')][_0x918a('0x3a')]));_0x3e02c0[_0x918a('0x39')]=_0x3e02c0['attributes'][_0x918a('0x3b')]?_0x3e02c0['attributes']:_0x2b9d34[_0x918a('0x33')];if(!_0x52969e[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x3e02c0[_0x918a('0x1c')]=qs[_0x918a('0x1c')](_0x52969e['query'][_0x918a('0x1c')]);_0x3e02c0[_0x918a('0x3e')]=qs['offset'](_0x52969e[_0x918a('0x35')][_0x918a('0x3e')]);}_0x3e02c0[_0x918a('0x3f')]=qs[_0x918a('0x40')](_0x52969e[_0x918a('0x35')][_0x918a('0x40')]);_0x3e02c0[_0x918a('0x41')]=qs[_0x918a('0x37')](_['pick'](_0x52969e[_0x918a('0x35')],_0x2b9d34['filters']),_0x1c2e2f);if(_0x52969e[_0x918a('0x35')][_0x918a('0x42')]){_0x3e02c0['where']=_[_0x918a('0x43')](_0x3e02c0[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x1c2e2f,function(_0x138a6c){if(_0x138a6c[_0x918a('0x31')]!==_0x918a('0x44')){var _0x4b3c5a={};_0x4b3c5a[_0x138a6c[_0x918a('0x2c')]]={'$like':'%'+_0x52969e['query'][_0x918a('0x42')]+'%'};return _0x4b3c5a;}})});}_0x3e02c0=_[_0x918a('0x43')]({},_0x3e02c0,_0x52969e[_0x918a('0x45')]);var _0x30e7b3={'where':_0x3e02c0[_0x918a('0x41')]};return db[_0x918a('0x2f')]['count'](_0x30e7b3)[_0x918a('0x24')](function(_0xf91204){_0x9d9a98['count']=_0xf91204;if(_0x52969e[_0x918a('0x35')]['includeAll']){_0x3e02c0[_0x918a('0x46')]=[{'all':!![]}];}return db['Campaign'][_0x918a('0x47')](_0x3e02c0);})[_0x918a('0x24')](function(_0x463fa0){_0x9d9a98[_0x918a('0x48')]=_0x463fa0;return _0x9d9a98;})[_0x918a('0x24')](respondWithFilteredResult(_0xd21ff3,_0x3e02c0))[_0x918a('0x49')](handleError(_0xd21ff3,null));};exports[_0x918a('0x4a')]=function(_0x53913d,_0x53de1c){var _0x58af7e={'raw':![],'where':{'id':_0x53913d[_0x918a('0x4b')]['id']}},_0x1b8298={};_0x1b8298['model']=_[_0x918a('0x36')](db[_0x918a('0x2f')]['rawAttributes']);_0x1b8298[_0x918a('0x35')]=_[_0x918a('0x36')](_0x53913d['query']);_0x1b8298['filters']=_[_0x918a('0x38')](_0x1b8298[_0x918a('0x33')],_0x1b8298['query']);_0x58af7e[_0x918a('0x39')]=_[_0x918a('0x38')](_0x1b8298['model'],qs[_0x918a('0x3a')](_0x53913d[_0x918a('0x35')][_0x918a('0x3a')]));_0x58af7e[_0x918a('0x39')]=_0x58af7e['attributes'][_0x918a('0x3b')]?_0x58af7e[_0x918a('0x39')]:_0x1b8298[_0x918a('0x33')];if(_0x53913d[_0x918a('0x35')][_0x918a('0x4c')]){_0x58af7e['include']=[{'all':!![]}];}_0x58af7e=_[_0x918a('0x43')]({},_0x58af7e,_0x53913d[_0x918a('0x45')]);return db[_0x918a('0x2f')][_0x918a('0x4d')](_0x58af7e)['then'](handleEntityNotFound(_0x53de1c,null))['then'](respondWithResult(_0x53de1c,null))[_0x918a('0x49')](handleError(_0x53de1c,null));};exports[_0x918a('0x4e')]=function(_0xb991d1,_0x248313){return db['Campaign'][_0x918a('0x4e')](_0xb991d1['body'],{})['then'](function(_0x49fde2){var _0x51d3c6=_0xb991d1[_0x918a('0x4f')][_0x918a('0x26')]({'plain':!![]});if(!_0x51d3c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51d3c6[_0x918a('0x50')]===_0x918a('0x4f')){var _0x13f1fa=_0x49fde2['get']({'plain':!![]});var _0x4360cc='IvrCampaigns';return db[_0x918a('0x51')][_0x918a('0x4d')]({'where':{'name':_0x4360cc,'userProfileId':_0x51d3c6[_0x918a('0x52')]},'raw':!![]})[_0x918a('0x24')](function(_0x496c45){if(_0x496c45&&_0x496c45[_0x918a('0x53')]===0x0){return db[_0x918a('0x28')]['create']({'name':_0x13f1fa[_0x918a('0x2c')],'resourceId':_0x13f1fa['id'],'type':_0x496c45[_0x918a('0x2c')],'sectionId':_0x496c45['id']},{})[_0x918a('0x24')](function(){return _0x49fde2;});}else{return _0x49fde2;}})[_0x918a('0x49')](function(_0x19a8cb){logger[_0x918a('0x2a')](_0x918a('0x54'),_0x19a8cb);throw _0x19a8cb;});}return _0x49fde2;})[_0x918a('0x24')](respondWithResult(_0x248313,0xc9))['catch'](handleError(_0x248313,null));};exports['clone']=function(_0x14e64d,_0x298998){var _0x1047e5={'where':{'id':_0x14e64d[_0x918a('0x4b')]['id']}},_0x4cb14e={};_0x4cb14e[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x2f')][_0x918a('0x30')]);_0x1047e5[_0x918a('0x39')]=_[_0x918a('0x38')](_0x4cb14e[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x14e64d['query'][_0x918a('0x3a')]));_0x1047e5['attributes']=_0x1047e5[_0x918a('0x39')][_0x918a('0x3b')]?_0x1047e5[_0x918a('0x39')]:_0x4cb14e[_0x918a('0x33')];if(_0x14e64d[_0x918a('0x35')]['includeAll']){_0x1047e5['include']=[{'all':!![]}];}_0x1047e5=_[_0x918a('0x43')]({},_0x1047e5,_0x14e64d[_0x918a('0x45')]);return db[_0x918a('0x2f')][_0x918a('0x4d')](_0x1047e5)[_0x918a('0x24')](handleEntityNotFound(_0x298998,null))[_0x918a('0x24')](function(_0x9e1378){if(_0x9e1378){var _0x4c36a1=_0x9e1378[_0x918a('0x26')]({'plain':!![]});_0x4c36a1=qs[_0x918a('0x55')](_0x4c36a1,['id','createdAt',_0x918a('0x56')]);_0x14e64d[_0x918a('0x57')]=_['omit'](_0x14e64d[_0x918a('0x57')],['id','createdAt',_0x918a('0x56')]);return db[_0x918a('0x2f')]['create'](_[_0x918a('0x43')](_0x4c36a1,_0x14e64d[_0x918a('0x57')]),{'include':_0x14e64d[_0x918a('0x35')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2be04c){var _0x4a8523=_0x14e64d[_0x918a('0x4f')][_0x918a('0x26')]({'plain':!![]});if(!_0x4a8523)throw new Error(_0x918a('0x58'));if(_0x4a8523[_0x918a('0x50')]===_0x918a('0x4f')){var _0x5d0a98=_0x2be04c[_0x918a('0x26')]({'plain':!![]});var _0x3676e0=_0x918a('0x27');return db[_0x918a('0x51')][_0x918a('0x4d')]({'where':{'name':_0x3676e0,'userProfileId':_0x4a8523[_0x918a('0x52')]},'raw':!![]})['then'](function(_0x20ea01){if(_0x20ea01&&_0x20ea01[_0x918a('0x53')]===0x0){return db[_0x918a('0x28')][_0x918a('0x4e')]({'name':_0x5d0a98[_0x918a('0x2c')],'resourceId':_0x5d0a98['id'],'type':_0x20ea01[_0x918a('0x2c')],'sectionId':_0x20ea01['id']},{})[_0x918a('0x24')](function(){return _0x2be04c;});}else{return _0x2be04c;}})[_0x918a('0x49')](function(_0x4a28a0){logger[_0x918a('0x2a')](_0x918a('0x54'),_0x4a28a0);throw _0x4a28a0;});}return _0x2be04c;});}})['then'](respondWithResult(_0x298998,0xc9))[_0x918a('0x49')](handleError(_0x298998,null));};exports['update']=function(_0x50f24f,_0x13c541){if(_0x50f24f[_0x918a('0x57')]['id']){delete _0x50f24f[_0x918a('0x57')]['id'];}return db['Campaign'][_0x918a('0x4d')]({'where':{'id':_0x50f24f[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x13c541,null))[_0x918a('0x24')](saveUpdates(_0x50f24f[_0x918a('0x57')],null))[_0x918a('0x24')](respondWithResult(_0x13c541,null))[_0x918a('0x49')](handleError(_0x13c541,null));};exports[_0x918a('0x25')]=function(_0x316857,_0x2c7b66){return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x316857[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x2c7b66,null))[_0x918a('0x24')](removeEntity(_0x2c7b66,null))['catch'](handleError(_0x2c7b66,null));};exports[_0x918a('0x59')]=function(_0xaeb91d,_0x5984cc,_0x3fdd9b){var _0x4a7c9c={'raw':!![],'where':{}};var _0x2871ff={};var _0x50a108={'count':0x0,'rows':[]};return db['Campaign'][_0x918a('0x5a')]({'where':{'id':_0xaeb91d['params']['id']}})['then'](handleEntityNotFound(_0x5984cc,null))['then'](function(_0x53a938){if(_0x53a938){_0x2871ff[_0x918a('0x33')]=_['keys'](db[_0x918a('0x5b')]['rawAttributes']);_0x2871ff[_0x918a('0x35')]=_[_0x918a('0x36')](_0xaeb91d['query']);_0x2871ff[_0x918a('0x37')]=_[_0x918a('0x38')](_0x2871ff['model'],_0x2871ff[_0x918a('0x35')]);_0x4a7c9c[_0x918a('0x39')]=_[_0x918a('0x38')](_0x2871ff['model'],qs[_0x918a('0x3a')](_0xaeb91d['query'][_0x918a('0x3a')]));_0x4a7c9c[_0x918a('0x39')]=_0x4a7c9c['attributes'][_0x918a('0x3b')]?_0x4a7c9c[_0x918a('0x39')]:_0x2871ff[_0x918a('0x33')];if(!_0xaeb91d[_0x918a('0x35')][_0x918a('0x3c')]('nolimit')){_0x4a7c9c[_0x918a('0x1c')]=qs[_0x918a('0x1c')](_0xaeb91d[_0x918a('0x35')][_0x918a('0x1c')]);_0x4a7c9c[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0xaeb91d[_0x918a('0x35')][_0x918a('0x3e')]);}_0x4a7c9c[_0x918a('0x3f')]=qs['sort'](_0xaeb91d['query'][_0x918a('0x40')]);_0x4a7c9c[_0x918a('0x41')]=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0xaeb91d[_0x918a('0x35')],_0x2871ff[_0x918a('0x37')]));_0x4a7c9c[_0x918a('0x41')][_0x918a('0x5d')]=_0x53a938['id'];if(_0xaeb91d[_0x918a('0x35')][_0x918a('0x42')]){_0x4a7c9c[_0x918a('0x41')]=_[_0x918a('0x43')](_0x4a7c9c[_0x918a('0x41')],{'$or':_['map'](_0x4a7c9c['attributes'],function(_0x1737d6){var _0x987a4a={};_0x987a4a[_0x1737d6]={'$like':'%'+_0xaeb91d['query'][_0x918a('0x42')]+'%'};return _0x987a4a;})});}_0x4a7c9c=_[_0x918a('0x43')]({},_0x4a7c9c,_0xaeb91d[_0x918a('0x45')]);return db['CmHopper'][_0x918a('0x1d')]({'where':_0x4a7c9c[_0x918a('0x41')]})[_0x918a('0x24')](function(_0x3afd72){_0x50a108[_0x918a('0x1d')]=_0x3afd72;if(_0xaeb91d[_0x918a('0x35')][_0x918a('0x4c')]){_0x4a7c9c[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x5b')][_0x918a('0x47')](_0x4a7c9c);})[_0x918a('0x24')](function(_0x53e2c1){_0x50a108['rows']=_0x53e2c1;return _0x50a108;});}})[_0x918a('0x24')](respondWithFilteredResult(_0x5984cc,_0x4a7c9c))[_0x918a('0x49')](handleError(_0x5984cc,null));};exports[_0x918a('0x5e')]=function(_0xcdb8d6,_0x55ffb5,_0x4eafa6){var _0x1639d={'raw':!![],'where':{}};var _0x2698ef={};var _0x323d94={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xcdb8d6['params']['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x55ffb5,null))[_0x918a('0x24')](function(_0x5d0965){if(_0x5d0965){_0x2698ef[_0x918a('0x33')]=_['keys'](db[_0x918a('0x5f')][_0x918a('0x30')]);_0x2698ef['query']=_['keys'](_0xcdb8d6[_0x918a('0x35')]);_0x2698ef['filters']=_['intersection'](_0x2698ef['model'],_0x2698ef[_0x918a('0x35')]);_0x1639d[_0x918a('0x39')]=_[_0x918a('0x38')](_0x2698ef[_0x918a('0x33')],qs[_0x918a('0x3a')](_0xcdb8d6[_0x918a('0x35')][_0x918a('0x3a')]));_0x1639d[_0x918a('0x39')]=_0x1639d[_0x918a('0x39')][_0x918a('0x3b')]?_0x1639d[_0x918a('0x39')]:_0x2698ef[_0x918a('0x33')];if(!_0xcdb8d6['query'][_0x918a('0x3c')](_0x918a('0x3d'))){_0x1639d['limit']=qs['limit'](_0xcdb8d6[_0x918a('0x35')][_0x918a('0x1c')]);_0x1639d['offset']=qs['offset'](_0xcdb8d6[_0x918a('0x35')][_0x918a('0x3e')]);}_0x1639d['order']=qs[_0x918a('0x40')](_0xcdb8d6['query'][_0x918a('0x40')]);_0x1639d[_0x918a('0x41')]=qs[_0x918a('0x37')](_['pick'](_0xcdb8d6[_0x918a('0x35')],_0x2698ef[_0x918a('0x37')]));_0x1639d[_0x918a('0x41')][_0x918a('0x5d')]=_0x5d0965['id'];if(_0xcdb8d6[_0x918a('0x35')][_0x918a('0x42')]){_0x1639d[_0x918a('0x41')]=_['merge'](_0x1639d[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x1639d[_0x918a('0x39')],function(_0xb47646){var _0x5722d0={};_0x5722d0[_0xb47646]={'$like':'%'+_0xcdb8d6[_0x918a('0x35')][_0x918a('0x42')]+'%'};return _0x5722d0;})});}_0x1639d=_[_0x918a('0x43')]({},_0x1639d,_0xcdb8d6['options']);return db[_0x918a('0x5f')]['count']({'where':_0x1639d[_0x918a('0x41')]})[_0x918a('0x24')](function(_0x420a76){_0x323d94[_0x918a('0x1d')]=_0x420a76;if(_0xcdb8d6[_0x918a('0x35')]['includeAll']){_0x1639d[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x5f')][_0x918a('0x47')](_0x1639d);})[_0x918a('0x24')](function(_0x495dee){_0x323d94[_0x918a('0x48')]=_0x495dee;return _0x323d94;});}})[_0x918a('0x24')](respondWithFilteredResult(_0x55ffb5,_0x1639d))['catch'](handleError(_0x55ffb5,null));};exports[_0x918a('0x60')]=function(_0x15646f,_0xeebdfc,_0x3be5ba){var _0x17fad2={'raw':!![],'where':{}};var _0x8647b1={};var _0x10c2a7={'count':0x0,'rows':[]};return db['Campaign'][_0x918a('0x5a')]({'where':{'id':_0x15646f[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0xeebdfc,null))['then'](function(_0xf2109){if(_0xf2109){_0x8647b1['model']=_[_0x918a('0x36')](db[_0x918a('0x61')][_0x918a('0x30')]);_0x8647b1[_0x918a('0x35')]=_['keys'](_0x15646f['query']);_0x8647b1[_0x918a('0x37')]=_['intersection'](_0x8647b1[_0x918a('0x33')],_0x8647b1[_0x918a('0x35')]);_0x17fad2[_0x918a('0x39')]=_['intersection'](_0x8647b1[_0x918a('0x33')],qs['fields'](_0x15646f[_0x918a('0x35')]['fields']));_0x17fad2[_0x918a('0x39')]=_0x17fad2['attributes'][_0x918a('0x3b')]?_0x17fad2[_0x918a('0x39')]:_0x8647b1[_0x918a('0x33')];if(!_0x15646f[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x17fad2[_0x918a('0x1c')]=qs['limit'](_0x15646f[_0x918a('0x35')][_0x918a('0x1c')]);_0x17fad2[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0x15646f[_0x918a('0x35')][_0x918a('0x3e')]);}_0x17fad2[_0x918a('0x3f')]=qs[_0x918a('0x40')](_0x15646f[_0x918a('0x35')][_0x918a('0x40')]);_0x17fad2[_0x918a('0x41')]=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x15646f[_0x918a('0x35')],_0x8647b1[_0x918a('0x37')]));_0x17fad2[_0x918a('0x41')]['CampaignId']=_0xf2109['id'];if(_0x15646f[_0x918a('0x35')][_0x918a('0x42')]){_0x17fad2[_0x918a('0x41')]=_[_0x918a('0x43')](_0x17fad2[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x17fad2['attributes'],function(_0x56480a){var _0x246b5b={};_0x246b5b[_0x56480a]={'$like':'%'+_0x15646f[_0x918a('0x35')][_0x918a('0x42')]+'%'};return _0x246b5b;})});}_0x17fad2=_[_0x918a('0x43')]({},_0x17fad2,_0x15646f[_0x918a('0x45')]);return db[_0x918a('0x61')][_0x918a('0x1d')]({'where':_0x17fad2[_0x918a('0x41')]})[_0x918a('0x24')](function(_0x18e9f8){_0x10c2a7[_0x918a('0x1d')]=_0x18e9f8;if(_0x15646f[_0x918a('0x35')]['includeAll']){_0x17fad2[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x61')][_0x918a('0x47')](_0x17fad2);})[_0x918a('0x24')](function(_0x1caa29){_0x10c2a7[_0x918a('0x48')]=_0x1caa29;return _0x10c2a7;});}})[_0x918a('0x24')](respondWithFilteredResult(_0xeebdfc,_0x17fad2))[_0x918a('0x49')](handleError(_0xeebdfc,null));};exports['getHopperBlacks']=function(_0x4ec4ce,_0x46ef36,_0x18cf89){var _0x53c6dd={'raw':!![],'where':{}};var _0x26689b={};var _0x485c0b={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4ec4ce[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x46ef36,null))[_0x918a('0x24')](function(_0x22b925){if(_0x22b925){_0x26689b[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x62')][_0x918a('0x30')]);_0x26689b['query']=_[_0x918a('0x36')](_0x4ec4ce[_0x918a('0x35')]);_0x26689b[_0x918a('0x37')]=_['intersection'](_0x26689b['model'],_0x26689b['query']);_0x53c6dd['attributes']=_[_0x918a('0x38')](_0x26689b[_0x918a('0x33')],qs['fields'](_0x4ec4ce[_0x918a('0x35')][_0x918a('0x3a')]));_0x53c6dd[_0x918a('0x39')]=_0x53c6dd[_0x918a('0x39')]['length']?_0x53c6dd[_0x918a('0x39')]:_0x26689b[_0x918a('0x33')];if(!_0x4ec4ce[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x53c6dd['limit']=qs[_0x918a('0x1c')](_0x4ec4ce['query'][_0x918a('0x1c')]);_0x53c6dd[_0x918a('0x3e')]=qs['offset'](_0x4ec4ce[_0x918a('0x35')]['offset']);}_0x53c6dd[_0x918a('0x3f')]=qs[_0x918a('0x40')](_0x4ec4ce['query'][_0x918a('0x40')]);_0x53c6dd[_0x918a('0x41')]=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x4ec4ce[_0x918a('0x35')],_0x26689b[_0x918a('0x37')]));_0x53c6dd['where'][_0x918a('0x5d')]=_0x22b925['id'];if(_0x4ec4ce[_0x918a('0x35')][_0x918a('0x42')]){_0x53c6dd[_0x918a('0x41')]=_['merge'](_0x53c6dd[_0x918a('0x41')],{'$or':_['map'](_0x53c6dd[_0x918a('0x39')],function(_0xe1717c){var _0x1a8334={};_0x1a8334[_0xe1717c]={'$like':'%'+_0x4ec4ce['query'][_0x918a('0x42')]+'%'};return _0x1a8334;})});}_0x53c6dd=_[_0x918a('0x43')]({},_0x53c6dd,_0x4ec4ce[_0x918a('0x45')]);return db['CmHopperBlack']['count']({'where':_0x53c6dd['where']})['then'](function(_0x4cad29){_0x485c0b[_0x918a('0x1d')]=_0x4cad29;if(_0x4ec4ce[_0x918a('0x35')][_0x918a('0x4c')]){_0x53c6dd[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x62')][_0x918a('0x47')](_0x53c6dd);})[_0x918a('0x24')](function(_0x5a1098){_0x485c0b[_0x918a('0x48')]=_0x5a1098;return _0x485c0b;});}})[_0x918a('0x24')](respondWithFilteredResult(_0x46ef36,_0x53c6dd))['catch'](handleError(_0x46ef36,null));};exports['getLists']=function(_0x3de307,_0x30bcfd,_0x1f5a9c){var _0x15f5d6={};var _0x4cb9aa={};var _0x53f040;var _0x10640d;return db[_0x918a('0x2f')][_0x918a('0x5a')]({'where':{'id':_0x3de307[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x30bcfd,null))[_0x918a('0x24')](function(_0x4669d8){if(_0x4669d8){_0x53f040=_0x4669d8;_0x4cb9aa[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x63')]['rawAttributes']);_0x4cb9aa['query']=_[_0x918a('0x36')](_0x3de307[_0x918a('0x35')]);_0x4cb9aa[_0x918a('0x37')]=_['intersection'](_0x4cb9aa[_0x918a('0x33')],_0x4cb9aa[_0x918a('0x35')]);_0x15f5d6['attributes']=_['intersection'](_0x4cb9aa[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x3de307['query']['fields']));_0x15f5d6[_0x918a('0x39')]=_0x15f5d6[_0x918a('0x39')][_0x918a('0x3b')]?_0x15f5d6[_0x918a('0x39')]:_0x4cb9aa['model'];_0x15f5d6['order']=qs[_0x918a('0x40')](_0x3de307['query'][_0x918a('0x40')]);_0x15f5d6['where']=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x3de307[_0x918a('0x35')],_0x4cb9aa[_0x918a('0x37')]));if(_0x3de307['query']['filter']){_0x15f5d6['where']=_['merge'](_0x15f5d6[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x15f5d6[_0x918a('0x39')],function(_0x1d4a3e){var _0x1e9c2f={};_0x1e9c2f[_0x1d4a3e]={'$like':'%'+_0x3de307[_0x918a('0x35')]['filter']+'%'};return _0x1e9c2f;})});}_0x15f5d6=_[_0x918a('0x43')]({},_0x15f5d6,_0x3de307[_0x918a('0x45')]);return _0x53f040[_0x918a('0x64')](_0x15f5d6);}})['then'](function(_0x1d15a8){if(_0x1d15a8){_0x10640d=_0x1d15a8['length'];if(!_0x3de307[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x15f5d6[_0x918a('0x1c')]=qs['limit'](_0x3de307[_0x918a('0x35')][_0x918a('0x1c')]);_0x15f5d6[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0x3de307['query'][_0x918a('0x3e')]);}return _0x53f040['getLists'](_0x15f5d6);}})['then'](function(_0x20075c){if(_0x20075c){return _0x20075c?{'count':_0x10640d,'rows':_0x20075c}:null;}})[_0x918a('0x24')](respondWithResult(_0x30bcfd,null))['catch'](handleError(_0x30bcfd,null));};exports[_0x918a('0x65')]=function(_0x3fffed,_0xe31374,_0x3599be){var _0x2c5130,_0x2eab1c;var _0x189d92=[];var _0x2e70ab=moment()[_0x918a('0x66')](_0x918a('0x67'));return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x3fffed[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0xe31374,null))['then'](function(_0xe23009){if(_0xe23009){_0x2eab1c=_0xe23009;return _0xe23009[_0x918a('0x65')](_0x3fffed[_0x918a('0x57')][_0x918a('0x68')],_[_0x918a('0x55')](_0x3fffed[_0x918a('0x57')],[_0x918a('0x68'),'id'])||{});}return null;})[_0x918a('0x69')](function(_0x16e805){var _0x50af09;var _0x4ae4b2;_0x2c5130=_0x16e805||[];var _0xd5ec6e=[];if(_0x16e805){for(var _0x581d17=0x0;_0x581d17<_0x16e805[_0x918a('0x3b')];_0x581d17+=0x1){var _0xb5dcb8=_0x16e805[_0x581d17][_0x918a('0x26')]({'plain':!![]});_0x2eab1c['dialCheckDuplicateType']=_0x3fffed[_0x918a('0x57')][_0x918a('0x6a')]?_0x3fffed['body']['dialCheckDuplicateType']:_0x2eab1c['dialCheckDuplicateType'];switch(_0x2eab1c['dialCheckDuplicateType']){case _0x918a('0x6b'):_0x50af09=squel[_0x918a('0x6c')]()[_0x918a('0x6d')]('cm_hopper')[_0x918a('0x6e')]([_0x918a('0x6f'),'scheduledAt',_0x918a('0x70'),'ListId',_0x918a('0x5d'),_0x918a('0x71'),'updatedAt'],squel['select']()[_0x918a('0x72')](_0x918a('0x6f'),_0x918a('0x6f'))[_0x918a('0x72')](_0x918a('0x73'),'scheduledAt')[_0x918a('0x72')]('id',_0x918a('0x70'))[_0x918a('0x72')](_0xb5dcb8[_0x918a('0x74')][_0x918a('0x75')](),_0x918a('0x76'))[_0x918a('0x72')](_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')](),_0x918a('0x5d'))['field']('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x56'))[_0x918a('0x77')](_0x918a('0x78'))[_0x918a('0x41')](_0x918a('0x79'))[_0x918a('0x41')](_0x918a('0x7a'),_0xb5dcb8[_0x918a('0x74')][_0x918a('0x75')]())['where'](_0x918a('0x7b'))[_0x918a('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x918a('0x7c')]()['field'](_0x918a('0x7d'))[_0x918a('0x77')](_0x918a('0x7e'))[_0x918a('0x41')](_0x918a('0x7f'),_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x918a('0x7c')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x918a('0x80'))[_0x918a('0x41')](_0x918a('0x7f'),_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')]())))[_0x918a('0x75')]();break;case'onlyIfOpen':_0x50af09=squel[_0x918a('0x6c')]()['into']('cm_hopper')[_0x918a('0x6e')]([_0x918a('0x6f'),_0x918a('0x81'),_0x918a('0x70'),_0x918a('0x76'),_0x918a('0x5d'),_0x918a('0x71'),'updatedAt'],squel['select']()[_0x918a('0x72')]('phone',_0x918a('0x6f'))['field']('NOW()',_0x918a('0x81'))['field']('id','ContactId')['field'](_0xb5dcb8[_0x918a('0x74')]['toString'](),_0x918a('0x76'))[_0x918a('0x72')](_0x3fffed['params']['id'][_0x918a('0x75')](),_0x918a('0x5d'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27','updatedAt')[_0x918a('0x77')](_0x918a('0x78'))[_0x918a('0x41')](_0x918a('0x79'))[_0x918a('0x41')](_0x918a('0x7a'),_0xb5dcb8['CmListId'][_0x918a('0x75')]())[_0x918a('0x41')](_0x918a('0x7b'))[_0x918a('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x918a('0x7c')]()[_0x918a('0x72')](_0x918a('0x82'))[_0x918a('0x77')](_0x918a('0x80'))['where'](_0x918a('0x7f'),_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')]())))[_0x918a('0x75')]();break;default:_0x50af09=squel['insert']()[_0x918a('0x6d')]('cm_hopper')[_0x918a('0x6e')]([_0x918a('0x6f'),_0x918a('0x81'),_0x918a('0x70'),'ListId','CampaignId',_0x918a('0x71'),'updatedAt'],squel['select']()['field'](_0x918a('0x6f'),'phone')[_0x918a('0x72')](_0x918a('0x73'),_0x918a('0x81'))['field']('id',_0x918a('0x70'))[_0x918a('0x72')](_0xb5dcb8['CmListId'][_0x918a('0x75')](),'ListId')[_0x918a('0x72')](_0x3fffed[_0x918a('0x4b')]['id']['toString'](),_0x918a('0x5d'))['field']('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x56'))['from'](_0x918a('0x78'))['where'](_0x918a('0x79'))[_0x918a('0x41')]('ListId\x20=\x20?',_0xb5dcb8[_0x918a('0x74')]['toString']())[_0x918a('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x918a('0x75')]();}_0x4ae4b2=squel[_0x918a('0x6c')]()[_0x918a('0x6d')](_0x918a('0x83'))[_0x918a('0x6e')]([_0x918a('0x84'),_0x918a('0x81'),'phone',_0x918a('0x85'),'createdAt','updatedAt'],squel[_0x918a('0x7c')]()[_0x918a('0x72')](_0x918a('0x86'),'id')['field'](_0x918a('0x73'),_0x918a('0x81'))[_0x918a('0x72')]('ci.item','phone')[_0x918a('0x72')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x56'))[_0x918a('0x77')](_0x918a('0x87'),'ci')['join'](_0x918a('0x80'),'h',_0x918a('0x88'))[_0x918a('0x41')](_0x918a('0x89'),_0xb5dcb8[_0x918a('0x74')][_0x918a('0x75')]())['where'](_0x918a('0x8a'),_0x3fffed['params']['id'][_0x918a('0x75')]())[_0x918a('0x41')]('h.createdAt\x20=\x20?',_0x2e70ab))[_0x918a('0x75')]();_0xd5ec6e[_0x918a('0x8b')](db['sequelize']['query'](_0x50af09));_0x189d92[_0x918a('0x8b')](db[_0x918a('0x8c')]['query'](_0x4ae4b2));}return BPromise[_0x918a('0x8d')](_0xd5ec6e);}})[_0x918a('0x24')](function(){return BPromise[_0x918a('0x8d')](_0x189d92);})[_0x918a('0x24')](function(){return _0x2c5130;})[_0x918a('0x24')](respondWithResult(_0xe31374,null))['catch'](handleError(_0xe31374,null));};exports[_0x918a('0x8e')]=function(_0x505efd,_0x1677ea,_0xd7fc11){return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x505efd[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x1677ea,null))[_0x918a('0x24')](function(_0x38bf23){if(_0x38bf23){return _0x38bf23[_0x918a('0x8e')](_0x505efd['query'][_0x918a('0x68')]);}})[_0x918a('0x24')](function(_0x159735){if(_0x159735){return db['CmHopper'][_0x918a('0x25')]({'where':{'ListId':_0x505efd['query'][_0x918a('0x68')],'CampaignId':_0x505efd[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](function(){return _0x159735;});}})['then'](respondWithStatusCode(_0x1677ea,null))[_0x918a('0x49')](handleError(_0x1677ea,null));};exports[_0x918a('0x8f')]=function(_0x36f84c,_0x4c1fc9,_0x3d5ec8){var _0x4ea36d={};var _0xcdbc95={};var _0x1973c6;var _0x332ac5;return db[_0x918a('0x2f')][_0x918a('0x5a')]({'where':{'id':_0x36f84c[_0x918a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c1fc9,null))[_0x918a('0x24')](function(_0x3f8949){if(_0x3f8949){_0x1973c6=_0x3f8949;_0xcdbc95[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x63')][_0x918a('0x30')]);_0xcdbc95[_0x918a('0x35')]=_[_0x918a('0x36')](_0x36f84c[_0x918a('0x35')]);_0xcdbc95[_0x918a('0x37')]=_[_0x918a('0x38')](_0xcdbc95[_0x918a('0x33')],_0xcdbc95[_0x918a('0x35')]);_0x4ea36d[_0x918a('0x39')]=_[_0x918a('0x38')](_0xcdbc95[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x36f84c[_0x918a('0x35')][_0x918a('0x3a')]));_0x4ea36d[_0x918a('0x39')]=_0x4ea36d[_0x918a('0x39')]['length']?_0x4ea36d[_0x918a('0x39')]:_0xcdbc95[_0x918a('0x33')];_0x4ea36d[_0x918a('0x3f')]=qs['sort'](_0x36f84c['query']['sort']);_0x4ea36d['where']=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x36f84c[_0x918a('0x35')],_0xcdbc95[_0x918a('0x37')]));if(_0x36f84c[_0x918a('0x35')][_0x918a('0x42')]){_0x4ea36d['where']=_[_0x918a('0x43')](_0x4ea36d[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x4ea36d[_0x918a('0x39')],function(_0x46fdf1){var _0x28458f={};_0x28458f[_0x46fdf1]={'$like':'%'+_0x36f84c[_0x918a('0x35')][_0x918a('0x42')]+'%'};return _0x28458f;})});}_0x4ea36d=_[_0x918a('0x43')]({},_0x4ea36d,_0x36f84c[_0x918a('0x45')]);return _0x1973c6['getBlackLists'](_0x4ea36d);}})[_0x918a('0x24')](function(_0x549bcd){if(_0x549bcd){_0x332ac5=_0x549bcd[_0x918a('0x3b')];if(!_0x36f84c[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x4ea36d[_0x918a('0x1c')]=qs[_0x918a('0x1c')](_0x36f84c[_0x918a('0x35')][_0x918a('0x1c')]);_0x4ea36d[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0x36f84c[_0x918a('0x35')][_0x918a('0x3e')]);}return _0x1973c6[_0x918a('0x8f')](_0x4ea36d);}})[_0x918a('0x24')](function(_0xe9e553){if(_0xe9e553){return _0xe9e553?{'count':_0x332ac5,'rows':_0xe9e553}:null;}})[_0x918a('0x24')](respondWithResult(_0x4c1fc9,null))[_0x918a('0x49')](handleError(_0x4c1fc9,null));};exports['addBlackLists']=function(_0x1cd0c4,_0xe8e0e7,_0x5e7624){var _0x58bb2e,_0x8845f1;var _0x142839=[];var _0x451834=moment()['format'](_0x918a('0x67'));return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x1cd0c4[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0xe8e0e7,null))[_0x918a('0x24')](function(_0x15a827){if(_0x15a827){_0x8845f1=_0x15a827;return _0x15a827[_0x918a('0x90')](_0x1cd0c4['body'][_0x918a('0x68')],_[_0x918a('0x55')](_0x1cd0c4[_0x918a('0x57')],['ids','id'])||{});}return null;})['spread'](function(_0x559ea7){var _0x912ace;var _0x5b03cd;_0x58bb2e=_0x559ea7||[];var _0x775ab5=[];if(_0x559ea7){for(var _0x589a11=0x0;_0x589a11<_0x559ea7[_0x918a('0x3b')];_0x589a11+=0x1){var _0x4a5711=_0x559ea7[_0x589a11]['get']({'plain':!![]});_0x912ace=squel[_0x918a('0x6c')]()['into']('cm_hopper_black')[_0x918a('0x6e')](['phone','ContactId',_0x918a('0x76'),'CampaignId',_0x918a('0x71'),_0x918a('0x56')],squel['select']()[_0x918a('0x72')](_0x918a('0x6f'),'phone')[_0x918a('0x72')]('id',_0x918a('0x70'))[_0x918a('0x72')](_0x4a5711['CmListId'][_0x918a('0x75')](),'ListId')[_0x918a('0x72')](_0x1cd0c4[_0x918a('0x4b')]['id']['toString'](),_0x918a('0x5d'))['field'](_0x918a('0x73'),'createdAt')[_0x918a('0x72')](_0x918a('0x73'),_0x918a('0x56'))[_0x918a('0x77')](_0x918a('0x78'))['where'](_0x918a('0x79'))[_0x918a('0x41')](_0x918a('0x7a'),_0x4a5711['CmListId']['toString']())[_0x918a('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x918a('0x75')]();_0x775ab5['push'](db['sequelize'][_0x918a('0x35')](_0x912ace));}return BPromise[_0x918a('0x8d')](_0x775ab5);}})['then'](function(){return _0x58bb2e;})[_0x918a('0x24')](respondWithResult(_0xe8e0e7,null))[_0x918a('0x49')](handleError(_0xe8e0e7,null));};exports[_0x918a('0x91')]=function(_0x178e56,_0x386ae1,_0x44552a){return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x178e56[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x386ae1,null))[_0x918a('0x24')](function(_0x430e38){if(_0x430e38){return _0x430e38['removeBlackLists'](_0x178e56[_0x918a('0x35')][_0x918a('0x68')]);}})[_0x918a('0x24')](function(_0x213c38){if(_0x213c38){return db[_0x918a('0x62')][_0x918a('0x25')]({'where':{'ListId':_0x178e56[_0x918a('0x35')]['ids'],'CampaignId':_0x178e56[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](function(){return _0x213c38;});}})[_0x918a('0x24')](respondWithStatusCode(_0x386ae1,null))[_0x918a('0x49')](handleError(_0x386ae1,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 4b30fc1..ae9ef1d 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','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 42980f7..38e67b0 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 _0x89fe=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x70579e,_0x492e0c){var _0x53291c=function(_0xfb7134){while(--_0xfb7134){_0x70579e['push'](_0x70579e['shift']());}};_0x53291c(++_0x492e0c);}(_0x89fe,0x83));var _0xe89f=function(_0x51f54b,_0x11d336){_0x51f54b=_0x51f54b-0x0;var _0x37f35c=_0x89fe[_0x51f54b];return _0x37f35c;};'use strict';var _=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var moment=require(_0xe89f('0x2'));var BPromise=require(_0xe89f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe89f('0x4'));var db=require(_0xe89f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe89f('0x6'))(_0xe89f('0x7'));var config=require(_0xe89f('0x8'));var jayson=require(_0xe89f('0x9'));var client=jayson[_0xe89f('0xa')][_0xe89f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24358f,_0x5427d2,_0x4639f0){return new BPromise(function(_0x3e9998,_0x7043f3){return client[_0xe89f('0xc')](_0x24358f,_0x4639f0)[_0xe89f('0xd')](function(_0x4fa2fa){logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));logger[_0xe89f('0x11')](_0xe89f('0x12'),_0x5427d2,_0xe89f('0x10'),JSON[_0xe89f('0x13')](_0x4fa2fa));if(_0x4fa2fa[_0xe89f('0x14')]){if(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x15')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error']['message']);return _0x7043f3(_0x4fa2fa['error'][_0xe89f('0x16')]);}logger[_0xe89f('0x14')]('Campaign,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error'][_0xe89f('0x16')]);return _0x3e9998(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x16')]);}else{logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));_0x3e9998(_0x4fa2fa[_0xe89f('0x17')][_0xe89f('0x16')]);}})[_0xe89f('0x18')](function(_0x16bfe0){logger['error'](_0xe89f('0xf'),_0x5427d2,_0x16bfe0);_0x7043f3(_0x16bfe0);});});}exports[_0xe89f('0x19')]=function(_0x510e6e){var _0x5106e4=this;return new Promise(function(_0x11e5e1,_0x127517){return db[_0xe89f('0x1a')][_0xe89f('0x1b')]({'raw':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e['options']['raw']===undefined?!![]:![]:!![],'where':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e['options'][_0xe89f('0x1d')]||null:null,'attributes':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e[_0xe89f('0x1c')][_0xe89f('0x1e')]||null:null,'limit':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e[_0xe89f('0x1c')][_0xe89f('0x1f')]||null:null,'include':_0x510e6e['options']?_0x510e6e[_0xe89f('0x1c')][_0xe89f('0x20')]?_['map'](_0x510e6e['options'][_0xe89f('0x20')],function(_0x5b548d){return{'model':db[_0x5b548d[_0xe89f('0x21')]],'as':_0x5b548d['as'],'attributes':_0x5b548d[_0xe89f('0x1e')],'include':_0x5b548d['include']?_[_0xe89f('0x22')](_0x5b548d[_0xe89f('0x20')],function(_0x5b3135){return{'model':db[_0x5b3135['model']],'as':_0x5b3135['as'],'attributes':_0x5b3135[_0xe89f('0x1e')],'include':_0x5b3135[_0xe89f('0x20')]?_[_0xe89f('0x22')](_0x5b3135[_0xe89f('0x20')],function(_0x288d8f){return{'model':db[_0x288d8f[_0xe89f('0x21')]],'as':_0x288d8f['as'],'attributes':_0x288d8f[_0xe89f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x557bcb){logger[_0xe89f('0xe')](_0xe89f('0x19'),_0x510e6e);logger[_0xe89f('0x11')](_0xe89f('0x19'),_0x510e6e,JSON[_0xe89f('0x13')](_0x557bcb));_0x11e5e1(_0x557bcb);})['catch'](function(_0x3c773c){logger[_0xe89f('0x14')](_0xe89f('0x19'),_0x3c773c[_0xe89f('0x16')],_0x510e6e);_0x127517(_0x5106e4[_0xe89f('0x14')](0x1f4,_0x3c773c[_0xe89f('0x16')]));});});};
\ No newline at end of file
+var _0x3299=['Campaign,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCampaign','findAll','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug'];(function(_0x3be7fe,_0x315935){var _0x3b3cfa=function(_0x1134ba){while(--_0x1134ba){_0x3be7fe['push'](_0x3be7fe['shift']());}};_0x3b3cfa(++_0x315935);}(_0x3299,0x1bc));var _0x9329=function(_0x33847b,_0x31e38b){_0x33847b=_0x33847b-0x0;var _0x352058=_0x3299[_0x33847b];return _0x352058;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['Campaign'][_0x9329('0x1a')]({'raw':_0x1b5eed['options']?_0x1b5eed[_0x9329('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]||null:null,'attributes':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1d')]||null:null,'limit':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')]['limit']||null:null,'include':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x1b5eed[_0x9329('0x1b')]['include'],function(_0x22caa4){return{'model':db[_0x22caa4[_0x9329('0x20')]],'as':_0x22caa4['as'],'attributes':_0x22caa4['attributes'],'include':_0x22caa4[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x22caa4[_0x9329('0x1e')],function(_0x2da39d){return{'model':db[_0x2da39d['model']],'as':_0x2da39d['as'],'attributes':_0x2da39d['attributes'],'include':_0x2da39d[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x2da39d[_0x9329('0x1e')],function(_0x4f5fbf){return{'model':db[_0x4f5fbf[_0x9329('0x20')]],'as':_0x4f5fbf['as'],'attributes':_0x4f5fbf['attributes']};}):[]};}):[]};}):[]:[]})[_0x9329('0xe')](function(_0x192d0a){logger[_0x9329('0xf')]('GetCampaign',_0x1b5eed);logger['debug'](_0x9329('0x19'),_0x1b5eed,JSON['stringify'](_0x192d0a));_0x41db73(_0x192d0a);})[_0x9329('0x18')](function(_0x4a5d27){logger[_0x9329('0x13')]('GetCampaign',_0x4a5d27[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x4a5d27['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index c9ce345..0a5d519 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 _0xed01=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','update','delete','destroy','removeLists','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0xed01,0x111));var _0x1ed0=function(_0x508af7,_0x3341cd){_0x508af7=_0x508af7-0x0;var _0x5733e8=_0xed01[_0x508af7];return _0x5733e8;};'use strict';var multer=require(_0x1ed0('0x0'));var util=require(_0x1ed0('0x1'));var path=require('path');var timeout=require(_0x1ed0('0x2'));var express=require(_0x1ed0('0x3'));var router=express[_0x1ed0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1ed0('0x5'));var config=require(_0x1ed0('0x6'));var controller=require(_0x1ed0('0x7'));router[_0x1ed0('0x8')]('/',auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xa')]);router[_0x1ed0('0x8')](_0x1ed0('0xb'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xc')]);router['get'](_0x1ed0('0xd'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xe')]);router['get']('/:id/hopper_histories',auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xf')]);router[_0x1ed0('0x8')]('/:id/hopper_finals',auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x10')]);router[_0x1ed0('0x8')](_0x1ed0('0x11'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x12')]);router[_0x1ed0('0x8')](_0x1ed0('0x13'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x14')]);router[_0x1ed0('0x8')](_0x1ed0('0x15'),auth['isAuthenticated'](),controller[_0x1ed0('0x16')]);router[_0x1ed0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1ed0('0x17')](_0x1ed0('0x18'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x19')]);router[_0x1ed0('0x17')](_0x1ed0('0x13'),auth[_0x1ed0('0x9')](),controller['addLists']);router[_0x1ed0('0x17')](_0x1ed0('0x15'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x1a')]);router[_0x1ed0('0x1b')](_0x1ed0('0xb'),auth['isAuthenticated'](),controller[_0x1ed0('0x1c')]);router[_0x1ed0('0x1d')](_0x1ed0('0xb'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x1e')]);router['delete'](_0x1ed0('0x13'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x1f')]);router[_0x1ed0('0x1d')](_0x1ed0('0x15'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0xa7cf=['getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','/:id','update','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','getHoppers'];(function(_0x59fb16,_0x45c22a){var _0x774d8e=function(_0x12400a){while(--_0x12400a){_0x59fb16['push'](_0x59fb16['shift']());}};_0x774d8e(++_0x45c22a);}(_0xa7cf,0xf9));var _0xfa7c=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0xa7cf[_0x12d951];return _0x44de17;};'use strict';var multer=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var path=require(_0xfa7c('0x2'));var timeout=require(_0xfa7c('0x3'));var express=require(_0xfa7c('0x4'));var router=express[_0xfa7c('0x5')]();var fs_extra=require(_0xfa7c('0x6'));var auth=require(_0xfa7c('0x7'));var interaction=require(_0xfa7c('0x8'));var config=require('../../config/environment');var controller=require(_0xfa7c('0x9'));router[_0xfa7c('0xa')]('/',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0xc')]);router[_0xfa7c('0xa')]('/:id',auth[_0xfa7c('0xb')](),controller['show']);router[_0xfa7c('0xa')](_0xfa7c('0xd'),auth['isAuthenticated'](),controller[_0xfa7c('0xe')]);router[_0xfa7c('0xa')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xfa7c('0xf')]);router[_0xfa7c('0xa')](_0xfa7c('0x10'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x11')]);router[_0xfa7c('0xa')](_0xfa7c('0x12'),auth[_0xfa7c('0xb')](),controller['getHopperBlacks']);router[_0xfa7c('0xa')](_0xfa7c('0x13'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x14')]);router['get'](_0xfa7c('0x15'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x16')]);router[_0xfa7c('0x17')]('/',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x18')]);router[_0xfa7c('0x17')](_0xfa7c('0x19'),auth[_0xfa7c('0xb')](),controller['clone']);router['post']('/:id/lists',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x1a')]);router[_0xfa7c('0x17')](_0xfa7c('0x15'),auth['isAuthenticated'](),controller[_0xfa7c('0x1b')]);router['put'](_0xfa7c('0x1c'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x1d')]);router[_0xfa7c('0x1e')](_0xfa7c('0x1c'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xfa7c('0x13'),auth['isAuthenticated'](),controller['removeLists']);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xfa7c('0x1f')]);module[_0xfa7c('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 86c1a2d..23ef757 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 _0xf348=['STRING','getDataValue','exports'];(function(_0x1a3075,_0x3a861b){var _0x59843e=function(_0x258697){while(--_0x258697){_0x1a3075['push'](_0x1a3075['shift']());}};_0x59843e(++_0x3a861b);}(_0xf348,0xd1));var _0x8f34=function(_0x480039,_0x9668a0){_0x480039=_0x480039-0x0;var _0x21512f=_0xf348[_0x480039];return _0x21512f;};'use strict';var Sequelize=require('sequelize');module[_0x8f34('0x0')]={'key':{'type':Sequelize[_0x8f34('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x8f34('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8f34('0x2')]('key');}}};
\ No newline at end of file
+var _0x5263=['TEXT','medium','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x458c52,_0x5e3fb4){var _0x43f43b=function(_0x5cdfeb){while(--_0x5cdfeb){_0x458c52['push'](_0x458c52['shift']());}};_0x43f43b(++_0x5e3fb4);}(_0x5263,0x141));var _0x3526=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x5263[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0x3526('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3526('0x1')],'length':_0x3526('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3526('0x3')]},'name':{'type':Sequelize[_0x3526('0x4')],'get':function(){return this[_0x3526('0x5')](_0x3526('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f322ed4..2968b4a 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 _0xd403=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','show','params','intersection','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key'];(function(_0x33f5f2,_0x568494){var _0x53c022=function(_0x1b69b2){while(--_0x1b69b2){_0x33f5f2['push'](_0x33f5f2['shift']());}};_0x53c022(++_0x568494);}(_0xd403,0x1d2));var _0x3d40=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xd403[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x3d40('0x0'));var rimraf=require(_0x3d40('0x1'));var zipdir=require(_0x3d40('0x2'));var jsonpatch=require(_0x3d40('0x3'));var rp=require('request-promise');var moment=require(_0x3d40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d40('0x5'));var util=require(_0x3d40('0x6'));var path=require(_0x3d40('0x7'));var sox=require('sox');var csv=require(_0x3d40('0x8'));var ejs=require(_0x3d40('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3d40('0xa'));var crypto=require(_0x3d40('0xb'));var jsforce=require(_0x3d40('0xc'));var deskjs=require(_0x3d40('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3d40('0xe'));var Papa=require(_0x3d40('0xf'));var Redis=require(_0x3d40('0x10'));var authService=require(_0x3d40('0x11'));var qs=require(_0x3d40('0x12'));var as=require(_0x3d40('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3d40('0x14'));var utils=require(_0x3d40('0x15'));var config=require(_0x3d40('0x16'));var licenseUtil=require(_0x3d40('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f353d,_0xaf462){_0xaf462=_0xaf462||0xcc;return function(_0x34e65f){if(_0x34e65f){return _0x2f353d[_0x3d40('0x18')](_0xaf462);}return _0x2f353d[_0x3d40('0x19')](_0xaf462)['end']();};}function respondWithResult(_0x41bde9,_0x577806){_0x577806=_0x577806||0xc8;return function(_0x38543a){if(_0x38543a){return _0x41bde9[_0x3d40('0x19')](_0x577806)['json'](_0x38543a);}};}function respondWithFilteredResult(_0x4f629e,_0x3e4457){return function(_0x3c33cd){if(_0x3c33cd){var _0xcda9b9=typeof _0x3e4457['offset']==='undefined'&&typeof _0x3e4457['limit']==='undefined';var _0x1fd8af=_0x3c33cd['count'];var _0x22df40=_0xcda9b9?0x0:_0x3e4457['offset'];var _0x1daf6c=_0xcda9b9?_0x3c33cd['count']:_0x3e4457['offset']+_0x3e4457[_0x3d40('0x1a')];var _0x57135e;if(_0x1daf6c>=_0x1fd8af){_0x1daf6c=_0x1fd8af;_0x57135e=0xc8;}else{_0x57135e=0xce;}_0x4f629e['status'](_0x57135e);return _0x4f629e['set'](_0x3d40('0x1b'),_0x22df40+'-'+_0x1daf6c+'/'+_0x1fd8af)[_0x3d40('0x1c')](_0x3c33cd);}return null;};}function patchUpdates(_0x3d205b){return function(_0x24aa9c){try{jsonpatch[_0x3d40('0x1d')](_0x24aa9c,_0x3d205b,!![]);}catch(_0x3b0a27){return BPromise['reject'](_0x3b0a27);}return _0x24aa9c[_0x3d40('0x1e')]();};}function saveUpdates(_0x1eb9c9,_0x449e3d){return function(_0x2832a2){if(_0x2832a2){return _0x2832a2[_0x3d40('0x1f')](_0x1eb9c9)[_0x3d40('0x20')](function(_0x41595c){return _0x41595c;});}return null;};}function removeEntity(_0x5b7307,_0x23a184){return function(_0x2cc654){if(_0x2cc654){return _0x2cc654['destroy']()['then'](function(){var _0x15d1eb=_0x2cc654['get']({'plain':!![]});var _0x3bf59d='CannedAnswers';return db['UserProfileResource'][_0x3d40('0x21')]({'where':{'type':_0x3bf59d,'resourceId':_0x15d1eb['id']}})[_0x3d40('0x20')](function(){return _0x2cc654;});})[_0x3d40('0x20')](function(){_0x5b7307[_0x3d40('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14435d,_0x4afbe2){return function(_0x2b78e1){if(!_0x2b78e1){_0x14435d['sendStatus'](0x194);}return _0x2b78e1;};}function handleError(_0x55ab23,_0x419f31){_0x419f31=_0x419f31||0x1f4;return function(_0x2dada9){logger[_0x3d40('0x22')](_0x2dada9[_0x3d40('0x23')]);if(_0x2dada9[_0x3d40('0x24')]){delete _0x2dada9[_0x3d40('0x24')];}_0x55ab23[_0x3d40('0x19')](_0x419f31)[_0x3d40('0x25')](_0x2dada9);};}exports[_0x3d40('0x26')]=function(_0x12596a,_0x2015ab){var _0xf4927f={},_0x1c5af4={},_0x2eaa4c={'count':0x0,'rows':[]};var _0xd79948=_[_0x3d40('0x27')](db[_0x3d40('0x28')][_0x3d40('0x29')],function(_0x6259e4){return{'name':_0x6259e4[_0x3d40('0x2a')],'type':_0x6259e4['type'][_0x3d40('0x2b')]};});_0x1c5af4['model']=_[_0x3d40('0x27')](_0xd79948,_0x3d40('0x24'));_0x1c5af4[_0x3d40('0x2c')]=_[_0x3d40('0x2d')](_0x12596a[_0x3d40('0x2c')]);_0x1c5af4[_0x3d40('0x2e')]=_['intersection'](_0x1c5af4[_0x3d40('0x2f')],_0x1c5af4[_0x3d40('0x2c')]);_0xf4927f[_0x3d40('0x30')]=_['intersection'](_0x1c5af4[_0x3d40('0x2f')],qs[_0x3d40('0x31')](_0x12596a[_0x3d40('0x2c')]['fields']));_0xf4927f[_0x3d40('0x30')]=_0xf4927f[_0x3d40('0x30')][_0x3d40('0x32')]?_0xf4927f[_0x3d40('0x30')]:_0x1c5af4[_0x3d40('0x2f')];if(!_0x12596a['query'][_0x3d40('0x33')](_0x3d40('0x34'))){_0xf4927f['limit']=qs[_0x3d40('0x1a')](_0x12596a['query'][_0x3d40('0x1a')]);_0xf4927f[_0x3d40('0x35')]=qs[_0x3d40('0x35')](_0x12596a['query'][_0x3d40('0x35')]);}_0xf4927f[_0x3d40('0x36')]=qs[_0x3d40('0x37')](_0x12596a[_0x3d40('0x2c')]['sort']);_0xf4927f['where']=qs[_0x3d40('0x2e')](_[_0x3d40('0x38')](_0x12596a[_0x3d40('0x2c')],_0x1c5af4[_0x3d40('0x2e')]),_0xd79948);if(_0x12596a[_0x3d40('0x2c')][_0x3d40('0x39')]){_0xf4927f[_0x3d40('0x3a')]=_[_0x3d40('0x3b')](_0xf4927f[_0x3d40('0x3a')],{'$or':[{'key':{'$like':'%'+_0x12596a[_0x3d40('0x2c')]['filter']+'%'}},{'value':{'$like':'%'+_0x12596a[_0x3d40('0x2c')][_0x3d40('0x39')]+'%'}}]});}_0xf4927f=_['merge']({},_0xf4927f,_0x12596a[_0x3d40('0x3c')]);var _0x16dc68={'where':_0xf4927f['where']};return db[_0x3d40('0x28')][_0x3d40('0x3d')](_0x16dc68)['then'](function(_0x45e9b5){_0x2eaa4c[_0x3d40('0x3d')]=_0x45e9b5;if(_0x12596a[_0x3d40('0x2c')][_0x3d40('0x3e')]){_0xf4927f[_0x3d40('0x3f')]=[{'all':!![]}];}return db[_0x3d40('0x28')][_0x3d40('0x40')](_0xf4927f);})[_0x3d40('0x20')](function(_0x4e7ebb){_0x2eaa4c['rows']=_0x4e7ebb;return _0x2eaa4c;})[_0x3d40('0x20')](respondWithFilteredResult(_0x2015ab,_0xf4927f))['catch'](handleError(_0x2015ab,null));};exports[_0x3d40('0x41')]=function(_0x12e9cf,_0xe46573){var _0xc037a6={'raw':!![],'where':{'id':_0x12e9cf[_0x3d40('0x42')]['id']}},_0x4eb6bb={};_0x4eb6bb[_0x3d40('0x2f')]=_[_0x3d40('0x2d')](db[_0x3d40('0x28')]['rawAttributes']);_0x4eb6bb[_0x3d40('0x2c')]=_[_0x3d40('0x2d')](_0x12e9cf[_0x3d40('0x2c')]);_0x4eb6bb[_0x3d40('0x2e')]=_[_0x3d40('0x43')](_0x4eb6bb[_0x3d40('0x2f')],_0x4eb6bb['query']);_0xc037a6[_0x3d40('0x30')]=_['intersection'](_0x4eb6bb[_0x3d40('0x2f')],qs['fields'](_0x12e9cf[_0x3d40('0x2c')]['fields']));_0xc037a6[_0x3d40('0x30')]=_0xc037a6['attributes'][_0x3d40('0x32')]?_0xc037a6[_0x3d40('0x30')]:_0x4eb6bb[_0x3d40('0x2f')];if(_0x12e9cf[_0x3d40('0x2c')][_0x3d40('0x3e')]){_0xc037a6['include']=[{'all':!![]}];}_0xc037a6=_['merge']({},_0xc037a6,_0x12e9cf[_0x3d40('0x3c')]);return db['CannedAnswer'][_0x3d40('0x44')](_0xc037a6)[_0x3d40('0x20')](handleEntityNotFound(_0xe46573,null))[_0x3d40('0x20')](respondWithResult(_0xe46573,null))[_0x3d40('0x45')](handleError(_0xe46573,null));};exports[_0x3d40('0x1f')]=function(_0x25f0df,_0xcf588){if(_0x25f0df[_0x3d40('0x46')]['id']){delete _0x25f0df['body']['id'];}return db[_0x3d40('0x28')][_0x3d40('0x44')]({'where':{'id':_0x25f0df['params']['id']}})[_0x3d40('0x20')](handleEntityNotFound(_0xcf588,null))[_0x3d40('0x20')](saveUpdates(_0x25f0df['body'],null))[_0x3d40('0x20')](respondWithResult(_0xcf588,null))['catch'](handleError(_0xcf588,null));};exports[_0x3d40('0x21')]=function(_0x23c6af,_0x19df1d){return db[_0x3d40('0x28')]['find']({'where':{'id':_0x23c6af['params']['id']}})[_0x3d40('0x20')](handleEntityNotFound(_0x19df1d,null))[_0x3d40('0x20')](removeEntity(_0x19df1d,null))[_0x3d40('0x45')](handleError(_0x19df1d,null));};exports[_0x3d40('0x47')]=function(_0x517db1,_0x3f9e6e){var _0x57ca91={'key':_0x517db1[_0x3d40('0x46')][_0x3d40('0x2b')]};if(_0x517db1[_0x3d40('0x46')][_0x3d40('0x48')]){_0x57ca91[_0x3d40('0x48')]=_0x517db1[_0x3d40('0x46')][_0x3d40('0x48')];}else if(_0x517db1[_0x3d40('0x46')]['SmsAccountId']){_0x57ca91[_0x3d40('0x49')]=_0x517db1['body'][_0x3d40('0x49')];}else if(_0x517db1[_0x3d40('0x46')]['OpenchannelAccountId']){_0x57ca91[_0x3d40('0x4a')]=_0x517db1[_0x3d40('0x46')][_0x3d40('0x4a')];}else if(_0x517db1[_0x3d40('0x46')][_0x3d40('0x4b')]){_0x57ca91[_0x3d40('0x4b')]=_0x517db1[_0x3d40('0x46')][_0x3d40('0x4b')];}return db[_0x3d40('0x28')]['find']({'where':_0x57ca91})['then'](function(_0x586252){if(_0x586252){throw new db['Sequelize'][(_0x3d40('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x3d40('0x28')][_0x3d40('0x47')](_0x517db1[_0x3d40('0x46')]);})['then'](function(_0x1fbc56){var _0x5e6518=_0x517db1[_0x3d40('0x4d')][_0x3d40('0x4e')]({'plain':!![]});if(!_0x5e6518)throw new Error(_0x3d40('0x4f'));if(_0x5e6518[_0x3d40('0x50')]==='user'){var _0x5a0827=_0x1fbc56['get']({'plain':!![]});return db[_0x3d40('0x51')][_0x3d40('0x44')]({'where':{'name':_0x3d40('0x52'),'userProfileId':_0x5e6518[_0x3d40('0x53')]},'raw':!![]})[_0x3d40('0x20')](function(_0x49946e){if(_0x49946e&&_0x49946e['autoAssociation']===0x0){return db['UserProfileResource'][_0x3d40('0x47')]({'name':_0x5a0827[_0x3d40('0x24')],'resourceId':_0x5a0827['id'],'type':_0x49946e[_0x3d40('0x24')],'sectionId':_0x49946e['id']},{})[_0x3d40('0x20')](function(){return _0x1fbc56;});}else{return _0x1fbc56;}})['catch'](function(_0x2ff88f){logger['error'](_0x3d40('0x54'),_0x2ff88f);throw _0x2ff88f;});}return _0x1fbc56;})[_0x3d40('0x20')](respondWithResult(_0x3f9e6e,0xc9))[_0x3d40('0x45')](handleError(_0x3f9e6e,null));};
\ No newline at end of file
+var _0xbd34=['query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','options','findAll','catch','show','params','intersection','length','includeAll','include','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../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','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','type','key','model','map'];(function(_0x3149ef,_0x12dc71){var _0x535e72=function(_0x2e351d){while(--_0x2e351d){_0x3149ef['push'](_0x3149ef['shift']());}};_0x535e72(++_0x12dc71);}(_0xbd34,0x189));var _0x4bd3=function(_0x423a85,_0x59e206){_0x423a85=_0x423a85-0x0;var _0x5bb0dc=_0xbd34[_0x423a85];return _0x5bb0dc;};'use strict';var emlformat=require(_0x4bd3('0x0'));var rimraf=require(_0x4bd3('0x1'));var zipdir=require(_0x4bd3('0x2'));var jsonpatch=require(_0x4bd3('0x3'));var rp=require(_0x4bd3('0x4'));var moment=require(_0x4bd3('0x5'));var BPromise=require(_0x4bd3('0x6'));var Mustache=require(_0x4bd3('0x7'));var util=require('util');var path=require(_0x4bd3('0x8'));var sox=require(_0x4bd3('0x9'));var csv=require(_0x4bd3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bd3('0xb'));var squel=require('squel');var crypto=require(_0x4bd3('0xc'));var jsforce=require(_0x4bd3('0xd'));var deskjs=require(_0x4bd3('0xe'));var toCsv=require(_0x4bd3('0xa'));var querystring=require(_0x4bd3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4bd3('0x10'));var qs=require(_0x4bd3('0x11'));var as=require(_0x4bd3('0x12'));var hardwareService=require(_0x4bd3('0x13'));var logger=require(_0x4bd3('0x14'))(_0x4bd3('0x15'));var utils=require(_0x4bd3('0x16'));var config=require(_0x4bd3('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9d0e,_0x2dac95){_0x2dac95=_0x2dac95||0xcc;return function(_0x128d47){if(_0x128d47){return _0x1d9d0e['sendStatus'](_0x2dac95);}return _0x1d9d0e[_0x4bd3('0x18')](_0x2dac95)[_0x4bd3('0x19')]();};}function respondWithResult(_0x22afd6,_0x3f68c6){_0x3f68c6=_0x3f68c6||0xc8;return function(_0x5dcb9d){if(_0x5dcb9d){return _0x22afd6[_0x4bd3('0x18')](_0x3f68c6)[_0x4bd3('0x1a')](_0x5dcb9d);}};}function respondWithFilteredResult(_0x1f6565,_0x508342){return function(_0x5290db){if(_0x5290db){var _0x22fa57=typeof _0x508342[_0x4bd3('0x1b')]===_0x4bd3('0x1c')&&typeof _0x508342[_0x4bd3('0x1d')]==='undefined';var _0x52af2e=_0x5290db[_0x4bd3('0x1e')];var _0x15515e=_0x22fa57?0x0:_0x508342['offset'];var _0x1447c6=_0x22fa57?_0x5290db['count']:_0x508342[_0x4bd3('0x1b')]+_0x508342[_0x4bd3('0x1d')];var _0x48a395;if(_0x1447c6>=_0x52af2e){_0x1447c6=_0x52af2e;_0x48a395=0xc8;}else{_0x48a395=0xce;}_0x1f6565[_0x4bd3('0x18')](_0x48a395);return _0x1f6565[_0x4bd3('0x1f')](_0x4bd3('0x20'),_0x15515e+'-'+_0x1447c6+'/'+_0x52af2e)[_0x4bd3('0x1a')](_0x5290db);}return null;};}function patchUpdates(_0x29efd2){return function(_0x434d90){try{jsonpatch[_0x4bd3('0x21')](_0x434d90,_0x29efd2,!![]);}catch(_0x354507){return BPromise[_0x4bd3('0x22')](_0x354507);}return _0x434d90['save']();};}function saveUpdates(_0x30027c,_0x2c34c6){return function(_0x5eaccd){if(_0x5eaccd){return _0x5eaccd[_0x4bd3('0x23')](_0x30027c)[_0x4bd3('0x24')](function(_0x3c9909){return _0x3c9909;});}return null;};}function removeEntity(_0x220f65,_0x33ea49){return function(_0x381a57){if(_0x381a57){return _0x381a57[_0x4bd3('0x25')]()[_0x4bd3('0x24')](function(){var _0x50e15f=_0x381a57[_0x4bd3('0x26')]({'plain':!![]});var _0x5e373d=_0x4bd3('0x27');return db['UserProfileResource'][_0x4bd3('0x25')]({'where':{'type':_0x5e373d,'resourceId':_0x50e15f['id']}})['then'](function(){return _0x381a57;});})[_0x4bd3('0x24')](function(){_0x220f65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c2934,_0x5ef90d){return function(_0x59f57a){if(!_0x59f57a){_0x3c2934[_0x4bd3('0x28')](0x194);}return _0x59f57a;};}function handleError(_0x11570c,_0x32e73b){_0x32e73b=_0x32e73b||0x1f4;return function(_0x36a7bc){logger[_0x4bd3('0x29')](_0x36a7bc[_0x4bd3('0x2a')]);if(_0x36a7bc['name']){delete _0x36a7bc[_0x4bd3('0x2b')];}_0x11570c[_0x4bd3('0x18')](_0x32e73b)[_0x4bd3('0x2c')](_0x36a7bc);};}exports[_0x4bd3('0x2d')]=function(_0x538452,_0x4e6f71){var _0x316653={},_0x173f21={},_0x558dce={'count':0x0,'rows':[]};var _0x47e97c=_['map'](db[_0x4bd3('0x2e')][_0x4bd3('0x2f')],function(_0x274982){return{'name':_0x274982['fieldName'],'type':_0x274982[_0x4bd3('0x30')][_0x4bd3('0x31')]};});_0x173f21[_0x4bd3('0x32')]=_[_0x4bd3('0x33')](_0x47e97c,'name');_0x173f21[_0x4bd3('0x34')]=_[_0x4bd3('0x35')](_0x538452[_0x4bd3('0x34')]);_0x173f21['filters']=_['intersection'](_0x173f21[_0x4bd3('0x32')],_0x173f21[_0x4bd3('0x34')]);_0x316653[_0x4bd3('0x36')]=_['intersection'](_0x173f21[_0x4bd3('0x32')],qs[_0x4bd3('0x37')](_0x538452['query'][_0x4bd3('0x37')]));_0x316653[_0x4bd3('0x36')]=_0x316653[_0x4bd3('0x36')]['length']?_0x316653[_0x4bd3('0x36')]:_0x173f21[_0x4bd3('0x32')];if(!_0x538452[_0x4bd3('0x34')][_0x4bd3('0x38')](_0x4bd3('0x39'))){_0x316653[_0x4bd3('0x1d')]=qs[_0x4bd3('0x1d')](_0x538452[_0x4bd3('0x34')][_0x4bd3('0x1d')]);_0x316653['offset']=qs[_0x4bd3('0x1b')](_0x538452['query']['offset']);}_0x316653[_0x4bd3('0x3a')]=qs[_0x4bd3('0x3b')](_0x538452[_0x4bd3('0x34')][_0x4bd3('0x3b')]);_0x316653['where']=qs[_0x4bd3('0x3c')](_[_0x4bd3('0x3d')](_0x538452[_0x4bd3('0x34')],_0x173f21[_0x4bd3('0x3c')]),_0x47e97c);if(_0x538452[_0x4bd3('0x34')]['filter']){_0x316653[_0x4bd3('0x3e')]=_[_0x4bd3('0x3f')](_0x316653[_0x4bd3('0x3e')],{'$or':[{'key':{'$like':'%'+_0x538452['query']['filter']+'%'}},{'value':{'$like':'%'+_0x538452[_0x4bd3('0x34')]['filter']+'%'}}]});}_0x316653=_['merge']({},_0x316653,_0x538452[_0x4bd3('0x40')]);var _0x542639={'where':_0x316653[_0x4bd3('0x3e')]};return db[_0x4bd3('0x2e')][_0x4bd3('0x1e')](_0x542639)[_0x4bd3('0x24')](function(_0x1420d1){_0x558dce[_0x4bd3('0x1e')]=_0x1420d1;if(_0x538452[_0x4bd3('0x34')]['includeAll']){_0x316653['include']=[{'all':!![]}];}return db[_0x4bd3('0x2e')][_0x4bd3('0x41')](_0x316653);})['then'](function(_0x53827f){_0x558dce['rows']=_0x53827f;return _0x558dce;})[_0x4bd3('0x24')](respondWithFilteredResult(_0x4e6f71,_0x316653))[_0x4bd3('0x42')](handleError(_0x4e6f71,null));};exports[_0x4bd3('0x43')]=function(_0x55c020,_0x5c16ed){var _0x11c5d7={'raw':!![],'where':{'id':_0x55c020[_0x4bd3('0x44')]['id']}},_0x371ec5={};_0x371ec5[_0x4bd3('0x32')]=_[_0x4bd3('0x35')](db[_0x4bd3('0x2e')][_0x4bd3('0x2f')]);_0x371ec5[_0x4bd3('0x34')]=_['keys'](_0x55c020['query']);_0x371ec5[_0x4bd3('0x3c')]=_[_0x4bd3('0x45')](_0x371ec5['model'],_0x371ec5['query']);_0x11c5d7[_0x4bd3('0x36')]=_[_0x4bd3('0x45')](_0x371ec5[_0x4bd3('0x32')],qs['fields'](_0x55c020[_0x4bd3('0x34')][_0x4bd3('0x37')]));_0x11c5d7[_0x4bd3('0x36')]=_0x11c5d7[_0x4bd3('0x36')][_0x4bd3('0x46')]?_0x11c5d7[_0x4bd3('0x36')]:_0x371ec5[_0x4bd3('0x32')];if(_0x55c020[_0x4bd3('0x34')][_0x4bd3('0x47')]){_0x11c5d7[_0x4bd3('0x48')]=[{'all':!![]}];}_0x11c5d7=_[_0x4bd3('0x3f')]({},_0x11c5d7,_0x55c020[_0x4bd3('0x40')]);return db[_0x4bd3('0x2e')]['find'](_0x11c5d7)['then'](handleEntityNotFound(_0x5c16ed,null))['then'](respondWithResult(_0x5c16ed,null))[_0x4bd3('0x42')](handleError(_0x5c16ed,null));};exports['update']=function(_0xe4b018,_0xe3d653){if(_0xe4b018['body']['id']){delete _0xe4b018[_0x4bd3('0x49')]['id'];}return db[_0x4bd3('0x2e')][_0x4bd3('0x4a')]({'where':{'id':_0xe4b018[_0x4bd3('0x44')]['id']}})[_0x4bd3('0x24')](handleEntityNotFound(_0xe3d653,null))[_0x4bd3('0x24')](saveUpdates(_0xe4b018['body'],null))[_0x4bd3('0x24')](respondWithResult(_0xe3d653,null))[_0x4bd3('0x42')](handleError(_0xe3d653,null));};exports[_0x4bd3('0x25')]=function(_0x2e6a6a,_0x31cf72){return db[_0x4bd3('0x2e')]['find']({'where':{'id':_0x2e6a6a[_0x4bd3('0x44')]['id']}})['then'](handleEntityNotFound(_0x31cf72,null))[_0x4bd3('0x24')](removeEntity(_0x31cf72,null))[_0x4bd3('0x42')](handleError(_0x31cf72,null));};exports[_0x4bd3('0x4b')]=function(_0x4f6926,_0x535321){var _0xa3f6ae={'key':_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x31')]};if(_0x4f6926[_0x4bd3('0x49')]['MailAccountId']){_0xa3f6ae[_0x4bd3('0x4c')]=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4c')];}else if(_0x4f6926['body']['SmsAccountId']){_0xa3f6ae[_0x4bd3('0x4d')]=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4d')];}else if(_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4e')]){_0xa3f6ae[_0x4bd3('0x4e')]=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4e')];}else if(_0x4f6926['body'][_0x4bd3('0x4f')]){_0xa3f6ae['ChatWebsiteId']=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4f')];}return db[_0x4bd3('0x2e')][_0x4bd3('0x4a')]({'where':_0xa3f6ae})[_0x4bd3('0x24')](function(_0x1a7280){if(_0x1a7280){throw new db[(_0x4bd3('0x50'))][(_0x4bd3('0x51'))](_0x4bd3('0x52'));}return db[_0x4bd3('0x2e')]['create'](_0x4f6926[_0x4bd3('0x49')]);})[_0x4bd3('0x24')](function(_0x2846cf){var _0x9ed4fa=_0x4f6926[_0x4bd3('0x53')][_0x4bd3('0x26')]({'plain':!![]});if(!_0x9ed4fa)throw new Error(_0x4bd3('0x54'));if(_0x9ed4fa['role']===_0x4bd3('0x53')){var _0x4713e5=_0x2846cf['get']({'plain':!![]});return db[_0x4bd3('0x55')][_0x4bd3('0x4a')]({'where':{'name':_0x4bd3('0x27'),'userProfileId':_0x9ed4fa[_0x4bd3('0x56')]},'raw':!![]})[_0x4bd3('0x24')](function(_0x2c89da){if(_0x2c89da&&_0x2c89da['autoAssociation']===0x0){return db[_0x4bd3('0x57')][_0x4bd3('0x4b')]({'name':_0x4713e5[_0x4bd3('0x2b')],'resourceId':_0x4713e5['id'],'type':_0x2c89da['name'],'sectionId':_0x2c89da['id']},{})[_0x4bd3('0x24')](function(){return _0x2846cf;});}else{return _0x2846cf;}})[_0x4bd3('0x42')](function(_0x11cee6){logger[_0x4bd3('0x29')](_0x4bd3('0x58'),_0x11cee6);throw _0x11cee6;});}return _0x2846cf;})[_0x4bd3('0x24')](respondWithResult(_0x535321,0xc9))[_0x4bd3('0x42')](handleError(_0x535321,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 351402e..50e3934 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 _0x22c5=['./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','api','request-promise','rimraf','../../config/environment'];(function(_0xf53fe1,_0x2b2f62){var _0x1b1888=function(_0x5c9ba9){while(--_0x5c9ba9){_0xf53fe1['push'](_0xf53fe1['shift']());}};_0x1b1888(++_0x2b2f62);}(_0x22c5,0xc1));var _0x522c=function(_0x56876e,_0x4dec10){_0x56876e=_0x56876e-0x0;var _0xa92dd9=_0x22c5[_0x56876e];return _0xa92dd9;};'use strict';var _=require('lodash');var util=require(_0x522c('0x0'));var logger=require('../../config/logger')(_0x522c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x522c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x522c('0x3'));var config=require(_0x522c('0x4'));var attributes=require(_0x522c('0x5'));module['exports']=function(_0x39ec34,_0x17b225){return _0x39ec34[_0x522c('0x6')](_0x522c('0x7'),attributes,{'tableName':_0x522c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x522c('0x9'),'collate':_0x522c('0xa')});};
\ No newline at end of file
+var _0x0922=['../../config/logger','api','bluebird','request-promise','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xea55c2,_0x2443b9){var _0x2c372d=function(_0x3a4e1b){while(--_0x3a4e1b){_0xea55c2['push'](_0xea55c2['shift']());}};_0x2c372d(++_0x2443b9);}(_0x0922,0x77));var _0x2092=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0x0922[_0x4ded65];return _0x5864fb;};'use strict';var _=require(_0x2092('0x0'));var util=require(_0x2092('0x1'));var logger=require(_0x2092('0x2'))(_0x2092('0x3'));var moment=require('moment');var BPromise=require(_0x2092('0x4'));var rp=require(_0x2092('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2092('0x6'));module[_0x2092('0x7')]=function(_0x40aebe,_0x14fab7){return _0x40aebe['define'](_0x2092('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2092('0x9'),'collate':_0x2092('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 36c373f..2dacd0e 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(_0x5168b6,_0x59c707){var _0x57fcd7=function(_0x2ace4a){while(--_0x2ace4a){_0x5168b6['push'](_0x5168b6['shift']());}};_0x57fcd7(++_0x59c707);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x5e7220,_0x12961d){var _0x1d2dfe=function(_0x551a00){while(--_0x551a00){_0x5e7220['push'](_0x5e7220['shift']());}};_0x1d2dfe(++_0x12961d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 b33e9fc..2f25f67 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 _0x53a2=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x43d68f,_0x53a5a9){var _0x3fcee2=function(_0x1bc5bb){while(--_0x1bc5bb){_0x43d68f['push'](_0x43d68f['shift']());}};_0x3fcee2(++_0x53a5a9);}(_0x53a2,0x1b4));var _0x253a=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x53a2[_0x28d18d];return _0x470640;};'use strict';var multer=require('multer');var util=require(_0x253a('0x0'));var path=require(_0x253a('0x1'));var timeout=require(_0x253a('0x2'));var express=require(_0x253a('0x3'));var router=express[_0x253a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x253a('0x5'));var interaction=require(_0x253a('0x6'));var config=require(_0x253a('0x7'));var controller=require(_0x253a('0x8'));router[_0x253a('0x9')]('/',auth[_0x253a('0xa')](),controller[_0x253a('0xb')]);router[_0x253a('0x9')](_0x253a('0xc'),auth[_0x253a('0xa')](),controller['show']);router[_0x253a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x253a('0xe')]('/:id',auth[_0x253a('0xa')](),controller['update']);router[_0x253a('0xf')]('/:id',auth[_0x253a('0xa')](),controller['destroy']);module[_0x253a('0x10')]=router;
\ No newline at end of file
+var _0x40f5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','exports','multer','util'];(function(_0x3fa2c8,_0x2de01e){var _0x1b0f3e=function(_0xd6cde){while(--_0xd6cde){_0x3fa2c8['push'](_0x3fa2c8['shift']());}};_0x1b0f3e(++_0x2de01e);}(_0x40f5,0x1a0));var _0x540f=function(_0x20c512,_0x36c198){_0x20c512=_0x20c512-0x0;var _0x25236e=_0x40f5[_0x20c512];return _0x25236e;};'use strict';var multer=require(_0x540f('0x0'));var util=require(_0x540f('0x1'));var path=require(_0x540f('0x2'));var timeout=require('connect-timeout');var express=require(_0x540f('0x3'));var router=express[_0x540f('0x4')]();var fs_extra=require(_0x540f('0x5'));var auth=require(_0x540f('0x6'));var interaction=require(_0x540f('0x7'));var config=require('../../config/environment');var controller=require(_0x540f('0x8'));router[_0x540f('0x9')]('/',auth[_0x540f('0xa')](),controller[_0x540f('0xb')]);router[_0x540f('0x9')]('/:id',auth[_0x540f('0xa')](),controller[_0x540f('0xc')]);router[_0x540f('0xd')]('/',auth[_0x540f('0xa')](),controller[_0x540f('0xe')]);router['put']('/:id',auth[_0x540f('0xa')](),controller[_0x540f('0xf')]);router[_0x540f('0x10')](_0x540f('0x11'),auth[_0x540f('0xa')](),controller['destroy']);module[_0x540f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 37199a4..014df62 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 _0xae88=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x20cc97,_0x5c23c6){var _0x9daa05=function(_0x5dd734){while(--_0x5dd734){_0x20cc97['push'](_0x20cc97['shift']());}};_0x9daa05(++_0x5c23c6);}(_0xae88,0xa1));var _0x8ae8=function(_0x252bfe,_0x373c22){_0x252bfe=_0x252bfe-0x0;var _0x6b39ab=_0xae88[_0x252bfe];return _0x6b39ab;};'use strict';var Sequelize=require(_0x8ae8('0x0'));module[_0x8ae8('0x1')]={'calldate':{'type':Sequelize[_0x8ae8('0x2')],'allowNull':![],'defaultValue':_0x8ae8('0x3')},'clid':{'type':Sequelize[_0x8ae8('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8ae8('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8ae8('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x8ae8('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8ae8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8ae8('0x4')]},'amaflags':{'type':Sequelize[_0x8ae8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x8ae8('0x4')]},'uniqueid':{'type':Sequelize[_0x8ae8('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8ae8('0x4')]},'peeraccount':{'type':Sequelize[_0x8ae8('0x4')]},'type':{'type':Sequelize[_0x8ae8('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xde9f=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x596c2e,_0x1f49e0){var _0x10ff6c=function(_0x712f24){while(--_0x712f24){_0x596c2e['push'](_0x596c2e['shift']());}};_0x10ff6c(++_0x1f49e0);}(_0xde9f,0x16d));var _0xfde9=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0xde9f[_0x484cac];return _0x1d6e77;};'use strict';var Sequelize=require(_0xfde9('0x0'));module[_0xfde9('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xfde9('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xfde9('0x3')]},'dst':{'type':Sequelize[_0xfde9('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfde9('0x3')]},'dstchannel':{'type':Sequelize[_0xfde9('0x3')]},'lastapp':{'type':Sequelize[_0xfde9('0x3')]},'lastdata':{'type':Sequelize[_0xfde9('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfde9('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfde9('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfde9('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xfde9('0x3')]},'peeraccount':{'type':Sequelize[_0xfde9('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xfde9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 4870d77..9ccb573 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 _0xfd20=['map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','create','body','find','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','then','end','error','stack','name','send'];(function(_0x3452d0,_0x378e17){var _0x568b78=function(_0x5184c3){while(--_0x5184c3){_0x3452d0['push'](_0x3452d0['shift']());}};_0x568b78(++_0x378e17);}(_0xfd20,0x66));var _0x0fd2=function(_0x3c29a7,_0x1bec88){_0x3c29a7=_0x3c29a7-0x0;var _0x1482db=_0xfd20[_0x3c29a7];return _0x1482db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];function respondWithStatusCode(_0xdf592d,_0x3504cf){_0x3504cf=_0x3504cf||0xcc;return function(_0x1f7a6e){if(_0x1f7a6e){return _0xdf592d[_0x0fd2('0x16')](_0x3504cf);}return _0xdf592d['status'](_0x3504cf)['end']();};}function respondWithResult(_0x1a9acb,_0x99de24){_0x99de24=_0x99de24||0xc8;return function(_0x21dcc5){if(_0x21dcc5){return _0x1a9acb[_0x0fd2('0x17')](_0x99de24)['json'](_0x21dcc5);}};}function respondWithFilteredResult(_0x280253,_0x4f074a){return function(_0x50b723){if(_0x50b723){var _0x2b6254=typeof _0x4f074a['offset']===_0x0fd2('0x18')&&typeof _0x4f074a['limit']===_0x0fd2('0x18');var _0x4cd2bf=_0x50b723[_0x0fd2('0x19')];var _0x15c9de=_0x2b6254?0x0:_0x4f074a['offset'];var _0x2b25d2=_0x2b6254?_0x50b723['count']:_0x4f074a[_0x0fd2('0x1a')]+_0x4f074a[_0x0fd2('0x1b')];var _0x3fb07e;if(_0x2b25d2>=_0x4cd2bf){_0x2b25d2=_0x4cd2bf;_0x3fb07e=0xc8;}else{_0x3fb07e=0xce;}_0x280253[_0x0fd2('0x17')](_0x3fb07e);return _0x280253[_0x0fd2('0x1c')](_0x0fd2('0x1d'),_0x15c9de+'-'+_0x2b25d2+'/'+_0x4cd2bf)[_0x0fd2('0x1e')](_0x50b723);}return null;};}function patchUpdates(_0x1a72ca){return function(_0x1b848d){try{jsonpatch[_0x0fd2('0x1f')](_0x1b848d,_0x1a72ca,!![]);}catch(_0x5c50ad){return BPromise['reject'](_0x5c50ad);}return _0x1b848d['save']();};}function saveUpdates(_0x4156d2,_0x36072a){return function(_0x53ab17){if(_0x53ab17){return _0x53ab17['update'](_0x4156d2)[_0x0fd2('0x20')](function(_0x25563c){return _0x25563c;});}return null;};}function removeEntity(_0x6be8d8,_0x29398f){return function(_0x25cdd2){if(_0x25cdd2){return _0x25cdd2['destroy']()[_0x0fd2('0x20')](function(){_0x6be8d8[_0x0fd2('0x17')](0xcc)[_0x0fd2('0x21')]();});}};}function handleEntityNotFound(_0x54cce1,_0x4c77a8){return function(_0x11bb10){if(!_0x11bb10){_0x54cce1[_0x0fd2('0x16')](0x194);}return _0x11bb10;};}function handleError(_0x4d0924,_0x400133){_0x400133=_0x400133||0x1f4;return function(_0x429fef){logger[_0x0fd2('0x22')](_0x429fef[_0x0fd2('0x23')]);if(_0x429fef[_0x0fd2('0x24')]){delete _0x429fef[_0x0fd2('0x24')];}_0x4d0924[_0x0fd2('0x17')](_0x400133)[_0x0fd2('0x25')](_0x429fef);};}exports['index']=function(_0x37d519,_0x434018){var _0x235c90={},_0x1ca259={},_0x33cf1a={'count':0x0,'rows':[]};var _0x564419=_[_0x0fd2('0x26')](db[_0x0fd2('0x27')][_0x0fd2('0x28')],function(_0x1a7a98){return{'name':_0x1a7a98[_0x0fd2('0x29')],'type':_0x1a7a98[_0x0fd2('0x2a')][_0x0fd2('0x2b')]};});_0x1ca259[_0x0fd2('0x2c')]=_['map'](_0x564419,_0x0fd2('0x24'));_0x1ca259['query']=_['keys'](_0x37d519[_0x0fd2('0x2d')]);_0x1ca259['filters']=_[_0x0fd2('0x2e')](_0x1ca259['model'],_0x1ca259[_0x0fd2('0x2d')]);_0x235c90['attributes']=_['intersection'](_0x1ca259[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x37d519[_0x0fd2('0x2d')]['fields']));_0x235c90['attributes']=_0x235c90[_0x0fd2('0x30')]['length']?_0x235c90[_0x0fd2('0x30')]:_0x1ca259[_0x0fd2('0x2c')];if(!_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x31')](_0x0fd2('0x32'))){_0x235c90[_0x0fd2('0x1b')]=qs[_0x0fd2('0x1b')](_0x37d519['query'][_0x0fd2('0x1b')]);_0x235c90[_0x0fd2('0x1a')]=qs['offset'](_0x37d519['query'][_0x0fd2('0x1a')]);}_0x235c90['order']=qs['sort'](_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x33')]);_0x235c90[_0x0fd2('0x34')]=qs[_0x0fd2('0x35')](_[_0x0fd2('0x36')](_0x37d519[_0x0fd2('0x2d')],_0x1ca259[_0x0fd2('0x35')]),_0x564419);if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]){_0x235c90[_0x0fd2('0x34')]=_[_0x0fd2('0x38')](_0x235c90[_0x0fd2('0x34')],{'$or':_[_0x0fd2('0x26')](_0x564419,function(_0x3a3986){if(_0x3a3986[_0x0fd2('0x2a')]!==_0x0fd2('0x39')){var _0x50643e={};_0x50643e[_0x3a3986[_0x0fd2('0x24')]]={'$like':'%'+_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]+'%'};return _0x50643e;}})});}_0x235c90=_[_0x0fd2('0x38')]({},_0x235c90,_0x37d519['options']);var _0x286543={'where':_0x235c90['where']};return db[_0x0fd2('0x27')][_0x0fd2('0x19')](_0x286543)['then'](function(_0x43e585){_0x33cf1a[_0x0fd2('0x19')]=_0x43e585;if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x3a')]){_0x235c90[_0x0fd2('0x3b')]=[{'all':!![]}];}return db[_0x0fd2('0x27')]['findAll'](_0x235c90);})[_0x0fd2('0x20')](function(_0x409321){_0x33cf1a[_0x0fd2('0x3c')]=_0x409321;return _0x33cf1a;})[_0x0fd2('0x20')](respondWithFilteredResult(_0x434018,_0x235c90))[_0x0fd2('0x3d')](handleError(_0x434018,null));};exports['show']=function(_0x258569,_0x2e804d){var _0x554476={'raw':!![],'where':{'id':_0x258569[_0x0fd2('0x3e')]['id']}},_0x252fb1={};_0x252fb1[_0x0fd2('0x2c')]=_[_0x0fd2('0x3f')](db[_0x0fd2('0x27')][_0x0fd2('0x28')]);_0x252fb1[_0x0fd2('0x2d')]=_[_0x0fd2('0x3f')](_0x258569['query']);_0x252fb1['filters']=_[_0x0fd2('0x2e')](_0x252fb1[_0x0fd2('0x2c')],_0x252fb1['query']);_0x554476[_0x0fd2('0x30')]=_['intersection'](_0x252fb1[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x258569[_0x0fd2('0x2d')][_0x0fd2('0x2f')]));_0x554476[_0x0fd2('0x30')]=_0x554476[_0x0fd2('0x30')]['length']?_0x554476['attributes']:_0x252fb1[_0x0fd2('0x2c')];if(_0x258569['query'][_0x0fd2('0x3a')]){_0x554476[_0x0fd2('0x3b')]=[{'all':!![]}];}_0x554476=_[_0x0fd2('0x38')]({},_0x554476,_0x258569[_0x0fd2('0x40')]);return db[_0x0fd2('0x27')]['find'](_0x554476)[_0x0fd2('0x20')](handleEntityNotFound(_0x2e804d,null))['then'](respondWithResult(_0x2e804d,null))[_0x0fd2('0x3d')](handleError(_0x2e804d,null));};exports[_0x0fd2('0x41')]=function(_0x5352cc,_0x337daa){return db['Cdr']['create'](_0x5352cc[_0x0fd2('0x42')],{})[_0x0fd2('0x20')](respondWithResult(_0x337daa,0xc9))[_0x0fd2('0x3d')](handleError(_0x337daa,null));};exports['update']=function(_0x30ac02,_0x119e21){if(_0x30ac02[_0x0fd2('0x42')]['id']){delete _0x30ac02[_0x0fd2('0x42')]['id'];}return db['Cdr'][_0x0fd2('0x43')]({'where':{'id':_0x30ac02[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x119e21,null))[_0x0fd2('0x20')](saveUpdates(_0x30ac02[_0x0fd2('0x42')],null))[_0x0fd2('0x20')](respondWithResult(_0x119e21,null))[_0x0fd2('0x3d')](handleError(_0x119e21,null));};exports[_0x0fd2('0x44')]=function(_0x2377bd,_0x4322b4){return db[_0x0fd2('0x27')]['find']({'where':{'id':_0x2377bd[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x4322b4,null))['then'](removeEntity(_0x4322b4,null))[_0x0fd2('0x3d')](handleError(_0x4322b4,null));};exports['describe']=function(_0x19650c,_0x5193b7){return db[_0x0fd2('0x27')][_0x0fd2('0x45')]()[_0x0fd2('0x20')](respondWithResult(_0x5193b7,null))['catch'](handleError(_0x5193b7,null));};
\ No newline at end of file
+var _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x85d0,0x164));var _0x085d=function(_0x4a0223,_0x2d8972){_0x4a0223=_0x4a0223-0x0;var _0x5e3335=_0x85d0[_0x4a0223];return _0x5e3335;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['Cdr'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['Cdr'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['Cdr'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index c834cbe..8468e43 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x341951,_0x57e851){var _0x577e2a=function(_0x1b15d0){while(--_0x1b15d0){_0x341951['push'](_0x341951['shift']());}};_0x577e2a(++_0x57e851);}(_0x7a54,0x106));var _0x47a5=function(_0x45169d,_0x102c83){_0x45169d=_0x45169d-0x0;var _0x3049ef=_0x7a54[_0x45169d];return _0x3049ef;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4dadeb,_0x4f99b9){var _0x39d793=function(_0x513e3e){while(--_0x513e3e){_0x4dadeb['push'](_0x4dadeb['shift']());}};_0x39d793(++_0x4f99b9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 81d9df7..38d0b25 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 _0x2ffa=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xf903ea,_0x3cf8c2){var _0xe37d4b=function(_0x338ffa){while(--_0x338ffa){_0xf903ea['push'](_0xf903ea['shift']());}};_0xe37d4b(++_0x3cf8c2);}(_0x2ffa,0xac));var _0xa2ff=function(_0x5401e4,_0x520fff){_0x5401e4=_0x5401e4-0x0;var _0x4699c2=_0x2ffa[_0x5401e4];return _0x4699c2;};'use strict';var _=require(_0xa2ff('0x0'));var util=require(_0xa2ff('0x1'));var moment=require(_0xa2ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xa2ff('0x3'));var fs=require('fs');var Redis=require(_0xa2ff('0x4'));var db=require(_0xa2ff('0x5'))['db'];var utils=require(_0xa2ff('0x6'));var logger=require(_0xa2ff('0x7'))(_0xa2ff('0x8'));var config=require(_0xa2ff('0x9'));var jayson=require(_0xa2ff('0xa'));var client=jayson['client'][_0xa2ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec8fc,_0x53225a,_0x35b849){return new BPromise(function(_0x2b7de2,_0x1f3cf9){return client[_0xa2ff('0xc')](_0x3ec8fc,_0x35b849)[_0xa2ff('0xd')](function(_0x3ce434){logger[_0xa2ff('0xe')](_0xa2ff('0xf'),_0x53225a,_0xa2ff('0x10'));logger[_0xa2ff('0x11')](_0xa2ff('0x12'),_0x53225a,_0xa2ff('0x10'),JSON[_0xa2ff('0x13')](_0x3ce434));if(_0x3ce434[_0xa2ff('0x14')]){if(_0x3ce434[_0xa2ff('0x14')][_0xa2ff('0x15')]===0x1f4){logger[_0xa2ff('0x14')](_0xa2ff('0xf'),_0x53225a,_0x3ce434['error'][_0xa2ff('0x16')]);return _0x1f3cf9(_0x3ce434['error'][_0xa2ff('0x16')]);}logger[_0xa2ff('0x14')](_0xa2ff('0xf'),_0x53225a,_0x3ce434[_0xa2ff('0x14')]['message']);return _0x2b7de2(_0x3ce434[_0xa2ff('0x14')][_0xa2ff('0x16')]);}else{logger['info'](_0xa2ff('0xf'),_0x53225a,_0xa2ff('0x10'));_0x2b7de2(_0x3ce434[_0xa2ff('0x17')]['message']);}})[_0xa2ff('0x18')](function(_0x4aacd8){logger[_0xa2ff('0x14')]('Cdr,\x20%s,\x20%s',_0x53225a,_0x4aacd8);_0x1f3cf9(_0x4aacd8);});});}
\ No newline at end of file
+var _0xe4c0=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20f33f,_0xc3d779){var _0x3c0f3a=function(_0x563ae2){while(--_0x563ae2){_0x20f33f['push'](_0x20f33f['shift']());}};_0x3c0f3a(++_0xc3d779);}(_0xe4c0,0x195));var _0x0e4c=function(_0x19ef2b,_0x354f66){_0x19ef2b=_0x19ef2b-0x0;var _0x4df537=_0xe4c0[_0x19ef2b];return _0x4df537;};'use strict';var _=require(_0x0e4c('0x0'));var util=require('util');var moment=require(_0x0e4c('0x1'));var BPromise=require(_0x0e4c('0x2'));var rs=require(_0x0e4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e4c('0x4'))['db'];var utils=require(_0x0e4c('0x5'));var logger=require(_0x0e4c('0x6'))(_0x0e4c('0x7'));var config=require(_0x0e4c('0x8'));var jayson=require(_0x0e4c('0x9'));var client=jayson[_0x0e4c('0xa')][_0x0e4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e465d,_0x56983c,_0x3cb9f0){return new BPromise(function(_0x441ad8,_0x44d2f3){return client[_0x0e4c('0xc')](_0x5e465d,_0x3cb9f0)[_0x0e4c('0xd')](function(_0x197e40){logger[_0x0e4c('0xe')](_0x0e4c('0xf'),_0x56983c,_0x0e4c('0x10'));logger[_0x0e4c('0x11')](_0x0e4c('0x12'),_0x56983c,'request\x20sent',JSON[_0x0e4c('0x13')](_0x197e40));if(_0x197e40[_0x0e4c('0x14')]){if(_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x15')]===0x1f4){logger['error'](_0x0e4c('0xf'),_0x56983c,_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x16')]);return _0x44d2f3(_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x16')]);}logger[_0x0e4c('0x14')](_0x0e4c('0xf'),_0x56983c,_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x16')]);return _0x441ad8(_0x197e40['error'][_0x0e4c('0x16')]);}else{logger[_0x0e4c('0xe')](_0x0e4c('0xf'),_0x56983c,_0x0e4c('0x10'));_0x441ad8(_0x197e40[_0x0e4c('0x17')][_0x0e4c('0x16')]);}})[_0x0e4c('0x18')](function(_0x3a5251){logger[_0x0e4c('0x14')]('Cdr,\x20%s,\x20%s',_0x56983c,_0x3a5251);_0x44d2f3(_0x3a5251);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 9788d3c..d4973fe 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(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 9aa3e5e..1e9ea1f 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 _0xb179=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x506344,_0x21aa82){var _0x2d6d80=function(_0x532f2c){while(--_0x532f2c){_0x506344['push'](_0x506344['shift']());}};_0x2d6d80(++_0x21aa82);}(_0xb179,0xfc));var _0x9b17=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb179[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9b17('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9b17('0x1')],'allowNull':![],'defaultValue':_0x9b17('0x2')},'appdata':{'type':Sequelize[_0x9b17('0x3')]()},'description':{'type':Sequelize[_0x9b17('0x1')]},'interval':{'type':Sequelize[_0x9b17('0x1')],'defaultValue':_0x9b17('0x4')}};
\ No newline at end of file
+var _0x758a=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x758a,0x1d1));var _0xa758=function(_0x4d955c,_0x2e8a78){_0x4d955c=_0x4d955c-0x0;var _0x46e26d=_0x758a[_0x4d955c];return _0x46e26d;};'use strict';var Sequelize=require(_0xa758('0x0'));module[_0xa758('0x1')]={'priority':{'type':Sequelize[_0xa758('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa758('0x3')],'allowNull':![],'defaultValue':_0xa758('0x4')},'appdata':{'type':Sequelize[_0xa758('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 7bc6823..97e3eac 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 _0xa0bc=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','ChatApplication','body','find','catch','rimraf','zip-dir','request-promise'];(function(_0x14df77,_0x4741e7){var _0x4d6e7d=function(_0x200bd4){while(--_0x200bd4){_0x14df77['push'](_0x14df77['shift']());}};_0x4d6e7d(++_0x4741e7);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0b('0x0'));var zipdir=require(_0xca0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca0b('0x2'));var moment=require(_0xca0b('0x3'));var BPromise=require(_0xca0b('0x4'));var Mustache=require(_0xca0b('0x5'));var util=require(_0xca0b('0x6'));var path=require(_0xca0b('0x7'));var sox=require(_0xca0b('0x8'));var csv=require(_0xca0b('0x9'));var ejs=require(_0xca0b('0xa'));var fs=require('fs');var fs_extra=require(_0xca0b('0xb'));var _=require(_0xca0b('0xc'));var squel=require(_0xca0b('0xd'));var crypto=require(_0xca0b('0xe'));var jsforce=require(_0xca0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca0b('0x9'));var querystring=require(_0xca0b('0x10'));var Papa=require(_0xca0b('0x11'));var Redis=require(_0xca0b('0x12'));var authService=require(_0xca0b('0x13'));var qs=require(_0xca0b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca0b('0x15'));var logger=require(_0xca0b('0x16'))(_0xca0b('0x17'));var utils=require(_0xca0b('0x18'));var config=require(_0xca0b('0x19'));var licenseUtil=require(_0xca0b('0x1a'));var db=require(_0xca0b('0x1b'))['db'];function respondWithStatusCode(_0x3a2e25,_0x22ca9d){_0x22ca9d=_0x22ca9d||0xcc;return function(_0x2ce366){if(_0x2ce366){return _0x3a2e25['sendStatus'](_0x22ca9d);}return _0x3a2e25[_0xca0b('0x1c')](_0x22ca9d)[_0xca0b('0x1d')]();};}function respondWithResult(_0x358972,_0x5da205){_0x5da205=_0x5da205||0xc8;return function(_0x106ed6){if(_0x106ed6){return _0x358972[_0xca0b('0x1c')](_0x5da205)[_0xca0b('0x1e')](_0x106ed6);}};}function respondWithFilteredResult(_0x2beba9,_0x42b68e){return function(_0x404c6d){if(_0x404c6d){var _0x4d7620=typeof _0x42b68e[_0xca0b('0x1f')]===_0xca0b('0x20')&&typeof _0x42b68e['limit']===_0xca0b('0x20');var _0x5db810=_0x404c6d[_0xca0b('0x21')];var _0x5050b7=_0x4d7620?0x0:_0x42b68e[_0xca0b('0x1f')];var _0x32eff7=_0x4d7620?_0x404c6d[_0xca0b('0x21')]:_0x42b68e['offset']+_0x42b68e[_0xca0b('0x22')];var _0x2c0c53;if(_0x32eff7>=_0x5db810){_0x32eff7=_0x5db810;_0x2c0c53=0xc8;}else{_0x2c0c53=0xce;}_0x2beba9['status'](_0x2c0c53);return _0x2beba9[_0xca0b('0x23')](_0xca0b('0x24'),_0x5050b7+'-'+_0x32eff7+'/'+_0x5db810)[_0xca0b('0x1e')](_0x404c6d);}return null;};}function patchUpdates(_0x59bda9){return function(_0x865393){try{jsonpatch[_0xca0b('0x25')](_0x865393,_0x59bda9,!![]);}catch(_0x484e26){return BPromise[_0xca0b('0x26')](_0x484e26);}return _0x865393[_0xca0b('0x27')]();};}function saveUpdates(_0x2ae93b,_0x49e695){return function(_0x119589){if(_0x119589){return _0x119589[_0xca0b('0x28')](_0x2ae93b)[_0xca0b('0x29')](function(_0x504d91){return _0x504d91;});}return null;};}function removeEntity(_0x54fb03,_0x11f5c3){return function(_0x428459){if(_0x428459){return _0x428459[_0xca0b('0x2a')]()[_0xca0b('0x29')](function(){_0x54fb03[_0xca0b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe122e8,_0x10b5f3){return function(_0x131c0e){if(!_0x131c0e){_0xe122e8[_0xca0b('0x2b')](0x194);}return _0x131c0e;};}function handleError(_0x15478d,_0x48e172){_0x48e172=_0x48e172||0x1f4;return function(_0x4d2d1a){logger['error'](_0x4d2d1a[_0xca0b('0x2c')]);if(_0x4d2d1a[_0xca0b('0x2d')]){delete _0x4d2d1a[_0xca0b('0x2d')];}_0x15478d[_0xca0b('0x1c')](_0x48e172)[_0xca0b('0x2e')](_0x4d2d1a);};}exports['show']=function(_0x23af62,_0xbfcb5f){var _0x3b73ff={'raw':!![],'where':{'id':_0x23af62[_0xca0b('0x2f')]['id']}},_0x20f0d5={};_0x20f0d5[_0xca0b('0x30')]=_[_0xca0b('0x31')](db['ChatApplication'][_0xca0b('0x32')]);_0x20f0d5[_0xca0b('0x33')]=_[_0xca0b('0x31')](_0x23af62[_0xca0b('0x33')]);_0x20f0d5['filters']=_[_0xca0b('0x34')](_0x20f0d5[_0xca0b('0x30')],_0x20f0d5[_0xca0b('0x33')]);_0x3b73ff[_0xca0b('0x35')]=_[_0xca0b('0x34')](_0x20f0d5[_0xca0b('0x30')],qs[_0xca0b('0x36')](_0x23af62[_0xca0b('0x33')][_0xca0b('0x36')]));_0x3b73ff[_0xca0b('0x35')]=_0x3b73ff[_0xca0b('0x35')][_0xca0b('0x37')]?_0x3b73ff[_0xca0b('0x35')]:_0x20f0d5[_0xca0b('0x30')];if(_0x23af62[_0xca0b('0x33')]['includeAll']){_0x3b73ff[_0xca0b('0x38')]=[{'all':!![]}];}_0x3b73ff=_[_0xca0b('0x39')]({},_0x3b73ff,_0x23af62[_0xca0b('0x3a')]);return db[_0xca0b('0x3b')]['find'](_0x3b73ff)[_0xca0b('0x29')](handleEntityNotFound(_0xbfcb5f,null))[_0xca0b('0x29')](respondWithResult(_0xbfcb5f,null))['catch'](handleError(_0xbfcb5f,null));};exports[_0xca0b('0x28')]=function(_0x146f82,_0xe7f5f5){if(_0x146f82[_0xca0b('0x3c')]['id']){delete _0x146f82[_0xca0b('0x3c')]['id'];}return db[_0xca0b('0x3b')][_0xca0b('0x3d')]({'where':{'id':_0x146f82[_0xca0b('0x2f')]['id']}})['then'](handleEntityNotFound(_0xe7f5f5,null))['then'](saveUpdates(_0x146f82[_0xca0b('0x3c')],null))[_0xca0b('0x29')](respondWithResult(_0xe7f5f5,null))[_0xca0b('0x3e')](handleError(_0xe7f5f5,null));};exports[_0xca0b('0x2a')]=function(_0x351f5a,_0x246edf){return db[_0xca0b('0x3b')][_0xca0b('0x3d')]({'where':{'id':_0x351f5a[_0xca0b('0x2f')]['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x246edf,null))[_0xca0b('0x29')](removeEntity(_0x246edf,null))[_0xca0b('0x3e')](handleError(_0x246edf,null));};
\ No newline at end of file
+var _0x9173=['ChatApplication','find','then','update','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','error','stack','send','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','fields','length','include','merge','options'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x9173,0xb4));var _0x3917=function(_0x1af7fd,_0x53876f){_0x1af7fd=_0x1af7fd-0x0;var _0x187916=_0x9173[_0x1af7fd];return _0x187916;};'use strict';var emlformat=require(_0x3917('0x0'));var rimraf=require(_0x3917('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3917('0x2'));var rp=require(_0x3917('0x3'));var moment=require(_0x3917('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3917('0x5'));var util=require('util');var path=require(_0x3917('0x6'));var sox=require(_0x3917('0x7'));var csv=require(_0x3917('0x8'));var ejs=require(_0x3917('0x9'));var fs=require('fs');var fs_extra=require(_0x3917('0xa'));var _=require('lodash');var squel=require(_0x3917('0xb'));var crypto=require(_0x3917('0xc'));var jsforce=require(_0x3917('0xd'));var deskjs=require(_0x3917('0xe'));var toCsv=require(_0x3917('0x8'));var querystring=require(_0x3917('0xf'));var Papa=require('papaparse');var Redis=require(_0x3917('0x10'));var authService=require(_0x3917('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3917('0x12'));var hardwareService=require(_0x3917('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3917('0x14'));var licenseUtil=require(_0x3917('0x15'));var db=require(_0x3917('0x16'))['db'];function respondWithStatusCode(_0x351db3,_0x3b3b40){_0x3b3b40=_0x3b3b40||0xcc;return function(_0xc0902d){if(_0xc0902d){return _0x351db3['sendStatus'](_0x3b3b40);}return _0x351db3[_0x3917('0x17')](_0x3b3b40)[_0x3917('0x18')]();};}function respondWithResult(_0x3268eb,_0x1d19bc){_0x1d19bc=_0x1d19bc||0xc8;return function(_0x4d7f6c){if(_0x4d7f6c){return _0x3268eb[_0x3917('0x17')](_0x1d19bc)[_0x3917('0x19')](_0x4d7f6c);}};}function respondWithFilteredResult(_0x36b162,_0x291147){return function(_0x23821c){if(_0x23821c){var _0x483e45=typeof _0x291147[_0x3917('0x1a')]==='undefined'&&typeof _0x291147['limit']===_0x3917('0x1b');var _0x42b9d4=_0x23821c[_0x3917('0x1c')];var _0x509b2b=_0x483e45?0x0:_0x291147[_0x3917('0x1a')];var _0x504934=_0x483e45?_0x23821c['count']:_0x291147[_0x3917('0x1a')]+_0x291147['limit'];var _0x1f91a5;if(_0x504934>=_0x42b9d4){_0x504934=_0x42b9d4;_0x1f91a5=0xc8;}else{_0x1f91a5=0xce;}_0x36b162[_0x3917('0x17')](_0x1f91a5);return _0x36b162[_0x3917('0x1d')](_0x3917('0x1e'),_0x509b2b+'-'+_0x504934+'/'+_0x42b9d4)[_0x3917('0x19')](_0x23821c);}return null;};}function patchUpdates(_0x2f9f7d){return function(_0x1d4e33){try{jsonpatch[_0x3917('0x1f')](_0x1d4e33,_0x2f9f7d,!![]);}catch(_0x15e00f){return BPromise[_0x3917('0x20')](_0x15e00f);}return _0x1d4e33[_0x3917('0x21')]();};}function saveUpdates(_0x4cc295,_0x1e3d24){return function(_0x1adbe4){if(_0x1adbe4){return _0x1adbe4['update'](_0x4cc295)['then'](function(_0xc3397){return _0xc3397;});}return null;};}function removeEntity(_0x52f027,_0x127ab5){return function(_0x337aba){if(_0x337aba){return _0x337aba[_0x3917('0x22')]()['then'](function(){_0x52f027[_0x3917('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x454b17,_0x1bc725){return function(_0x22f3e7){if(!_0x22f3e7){_0x454b17['sendStatus'](0x194);}return _0x22f3e7;};}function handleError(_0x1a79c2,_0x36892d){_0x36892d=_0x36892d||0x1f4;return function(_0x103729){logger[_0x3917('0x23')](_0x103729[_0x3917('0x24')]);if(_0x103729['name']){delete _0x103729['name'];}_0x1a79c2[_0x3917('0x17')](_0x36892d)[_0x3917('0x25')](_0x103729);};}exports[_0x3917('0x26')]=function(_0x29eb9b,_0x12302d){var _0x4060a8={'raw':!![],'where':{'id':_0x29eb9b[_0x3917('0x27')]['id']}},_0x2e80ca={};_0x2e80ca[_0x3917('0x28')]=_[_0x3917('0x29')](db['ChatApplication'][_0x3917('0x2a')]);_0x2e80ca['query']=_[_0x3917('0x29')](_0x29eb9b['query']);_0x2e80ca[_0x3917('0x2b')]=_[_0x3917('0x2c')](_0x2e80ca['model'],_0x2e80ca[_0x3917('0x2d')]);_0x4060a8[_0x3917('0x2e')]=_[_0x3917('0x2c')](_0x2e80ca[_0x3917('0x28')],qs['fields'](_0x29eb9b[_0x3917('0x2d')][_0x3917('0x2f')]));_0x4060a8[_0x3917('0x2e')]=_0x4060a8[_0x3917('0x2e')][_0x3917('0x30')]?_0x4060a8[_0x3917('0x2e')]:_0x2e80ca[_0x3917('0x28')];if(_0x29eb9b[_0x3917('0x2d')]['includeAll']){_0x4060a8[_0x3917('0x31')]=[{'all':!![]}];}_0x4060a8=_[_0x3917('0x32')]({},_0x4060a8,_0x29eb9b[_0x3917('0x33')]);return db[_0x3917('0x34')][_0x3917('0x35')](_0x4060a8)['then'](handleEntityNotFound(_0x12302d,null))[_0x3917('0x36')](respondWithResult(_0x12302d,null))['catch'](handleError(_0x12302d,null));};exports[_0x3917('0x37')]=function(_0x476630,_0x5c96f3){if(_0x476630[_0x3917('0x38')]['id']){delete _0x476630[_0x3917('0x38')]['id'];}return db[_0x3917('0x34')][_0x3917('0x35')]({'where':{'id':_0x476630[_0x3917('0x27')]['id']}})[_0x3917('0x36')](handleEntityNotFound(_0x5c96f3,null))[_0x3917('0x36')](saveUpdates(_0x476630[_0x3917('0x38')],null))[_0x3917('0x36')](respondWithResult(_0x5c96f3,null))[_0x3917('0x39')](handleError(_0x5c96f3,null));};exports[_0x3917('0x22')]=function(_0x404325,_0x48c22f){return db[_0x3917('0x34')][_0x3917('0x35')]({'where':{'id':_0x404325[_0x3917('0x27')]['id']}})[_0x3917('0x36')](handleEntityNotFound(_0x48c22f,null))[_0x3917('0x36')](removeEntity(_0x48c22f,null))['catch'](handleError(_0x48c22f,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7e4c3aa..437b7c2 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 _0xb4cd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x30e445,_0x3a0148){var _0x4fe98d=function(_0x5da324){while(--_0x5da324){_0x30e445['push'](_0x30e445['shift']());}};_0x4fe98d(++_0x3a0148);}(_0xb4cd,0x11b));var _0xdb4c=function(_0x23db46,_0x133949){_0x23db46=_0x23db46-0x0;var _0xbaed6b=_0xb4cd[_0x23db46];return _0xbaed6b;};'use strict';var _=require(_0xdb4c('0x0'));var util=require(_0xdb4c('0x1'));var logger=require(_0xdb4c('0x2'))(_0xdb4c('0x3'));var moment=require(_0xdb4c('0x4'));var BPromise=require(_0xdb4c('0x5'));var rp=require(_0xdb4c('0x6'));var fs=require('fs');var path=require(_0xdb4c('0x7'));var rimraf=require(_0xdb4c('0x8'));var config=require('../../config/environment');var attributes=require(_0xdb4c('0x9'));module['exports']=function(_0x14e9a4,_0x3495da){return _0x14e9a4[_0xdb4c('0xa')](_0xdb4c('0xb'),attributes,{'tableName':_0xdb4c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb4c('0xd'),'collate':_0xdb4c('0xe')});};
\ No newline at end of file
+var _0xc7ad=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment'];(function(_0x5124cf,_0x455717){var _0x41c979=function(_0x2d4efc){while(--_0x2d4efc){_0x5124cf['push'](_0x5124cf['shift']());}};_0x41c979(++_0x455717);}(_0xc7ad,0xca));var _0xdc7a=function(_0x162291,_0x92062b){_0x162291=_0x162291-0x0;var _0x3fc840=_0xc7ad[_0x162291];return _0x3fc840;};'use strict';var _=require(_0xdc7a('0x0'));var util=require(_0xdc7a('0x1'));var logger=require(_0xdc7a('0x2'))('api');var moment=require(_0xdc7a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc7a('0x4'));var rimraf=require('rimraf');var config=require(_0xdc7a('0x5'));var attributes=require(_0xdc7a('0x6'));module[_0xdc7a('0x7')]=function(_0x1eb79d,_0x45161c){return _0x1eb79d[_0xdc7a('0x8')](_0xdc7a('0x9'),attributes,{'tableName':_0xdc7a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc7a('0xb'),'collate':_0xdc7a('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 28797a5..84c0953 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 _0x6de1=['ChatApplication,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','error'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x6de1,0x1f1));var _0x16de=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x6de1[_0x1b892b];return _0xa99e57;};'use strict';var _=require(_0x16de('0x0'));var util=require(_0x16de('0x1'));var moment=require('moment');var BPromise=require(_0x16de('0x2'));var rs=require(_0x16de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x16de('0x5'))(_0x16de('0x6'));var config=require('../../config/environment');var jayson=require(_0x16de('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4322e5,_0x44a9a7,_0x1b091f){return new BPromise(function(_0x55c616,_0xf5f41f){return client[_0x16de('0x8')](_0x4322e5,_0x1b091f)[_0x16de('0x9')](function(_0x10dc6c){logger['info']('ChatApplication,\x20%s,\x20%s',_0x44a9a7,_0x16de('0xa'));logger[_0x16de('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x44a9a7,_0x16de('0xa'),JSON['stringify'](_0x10dc6c));if(_0x10dc6c[_0x16de('0xc')]){if(_0x10dc6c[_0x16de('0xc')]['code']===0x1f4){logger[_0x16de('0xc')](_0x16de('0xd'),_0x44a9a7,_0x10dc6c[_0x16de('0xc')][_0x16de('0xe')]);return _0xf5f41f(_0x10dc6c['error'][_0x16de('0xe')]);}logger[_0x16de('0xc')]('ChatApplication,\x20%s,\x20%s',_0x44a9a7,_0x10dc6c[_0x16de('0xc')][_0x16de('0xe')]);return _0x55c616(_0x10dc6c['error'][_0x16de('0xe')]);}else{logger[_0x16de('0xf')](_0x16de('0xd'),_0x44a9a7,_0x16de('0xa'));_0x55c616(_0x10dc6c[_0x16de('0x10')]['message']);}})['catch'](function(_0x1e1ab4){logger[_0x16de('0xc')](_0x16de('0xd'),_0x44a9a7,_0x1e1ab4);_0xf5f41f(_0x1e1ab4);});});}
\ No newline at end of file
+var _0x4596=['rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2a9c81,_0x434c00){var _0xf92bb3=function(_0xe0560a){while(--_0xe0560a){_0x2a9c81['push'](_0x2a9c81['shift']());}};_0xf92bb3(++_0x434c00);}(_0x4596,0xf5));var _0x6459=function(_0x2f2b47,_0x27fd21){_0x2f2b47=_0x2f2b47-0x0;var _0x279bf8=_0x4596[_0x2f2b47];return _0x279bf8;};'use strict';var _=require(_0x6459('0x0'));var util=require(_0x6459('0x1'));var moment=require(_0x6459('0x2'));var BPromise=require(_0x6459('0x3'));var rs=require(_0x6459('0x4'));var fs=require('fs');var Redis=require(_0x6459('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6459('0x6'));var logger=require(_0x6459('0x7'))(_0x6459('0x8'));var config=require(_0x6459('0x9'));var jayson=require(_0x6459('0xa'));var client=jayson['client'][_0x6459('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5173e7,_0x6b7e66,_0x110b5e){return new BPromise(function(_0x4a7404,_0x26bc6a){return client[_0x6459('0xc')](_0x5173e7,_0x110b5e)[_0x6459('0xd')](function(_0x170b96){logger[_0x6459('0xe')](_0x6459('0xf'),_0x6b7e66,_0x6459('0x10'));logger[_0x6459('0x11')](_0x6459('0x12'),_0x6b7e66,_0x6459('0x10'),JSON['stringify'](_0x170b96));if(_0x170b96[_0x6459('0x13')]){if(_0x170b96[_0x6459('0x13')][_0x6459('0x14')]===0x1f4){logger[_0x6459('0x13')](_0x6459('0xf'),_0x6b7e66,_0x170b96[_0x6459('0x13')][_0x6459('0x15')]);return _0x26bc6a(_0x170b96[_0x6459('0x13')][_0x6459('0x15')]);}logger[_0x6459('0x13')](_0x6459('0xf'),_0x6b7e66,_0x170b96[_0x6459('0x13')][_0x6459('0x15')]);return _0x4a7404(_0x170b96['error'][_0x6459('0x15')]);}else{logger[_0x6459('0xe')](_0x6459('0xf'),_0x6b7e66,_0x6459('0x10'));_0x4a7404(_0x170b96['result']['message']);}})[_0x6459('0x16')](function(_0x496d11){logger['error'](_0x6459('0xf'),_0x6b7e66,_0x496d11);_0x26bc6a(_0x496d11);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index df56057..2380a7f 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 _0xb62b=['util','path','connect-timeout','express','Router','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','multer'];(function(_0x50313d,_0x533f0b){var _0x1b8f00=function(_0x2c1599){while(--_0x2c1599){_0x50313d['push'](_0x50313d['shift']());}};_0x1b8f00(++_0x533f0b);}(_0xb62b,0x158));var _0xbb62=function(_0x180b37,_0x1d24c6){_0x180b37=_0x180b37-0x0;var _0x59a09b=_0xb62b[_0x180b37];return _0x59a09b;};'use strict';var multer=require(_0xbb62('0x0'));var util=require(_0xbb62('0x1'));var path=require(_0xbb62('0x2'));var timeout=require(_0xbb62('0x3'));var express=require(_0xbb62('0x4'));var router=express[_0xbb62('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbb62('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb62('0x7'));router[_0xbb62('0x8')](_0xbb62('0x9'),auth[_0xbb62('0xa')](),controller[_0xbb62('0xb')]);router[_0xbb62('0xc')](_0xbb62('0x9'),auth[_0xbb62('0xa')](),controller[_0xbb62('0xd')]);router['delete'](_0xbb62('0x9'),auth[_0xbb62('0xa')](),controller[_0xbb62('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x9537=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x9537,0x1ce));var _0x7953=function(_0x23525c,_0x17b6ee){_0x23525c=_0x23525c-0x0;var _0x3eaeb9=_0x9537[_0x23525c];return _0x3eaeb9;};'use strict';var multer=require('multer');var util=require(_0x7953('0x0'));var path=require('path');var timeout=require(_0x7953('0x1'));var express=require(_0x7953('0x2'));var router=express[_0x7953('0x3')]();var fs_extra=require(_0x7953('0x4'));var auth=require(_0x7953('0x5'));var interaction=require(_0x7953('0x6'));var config=require(_0x7953('0x7'));var controller=require(_0x7953('0x8'));router[_0x7953('0x9')](_0x7953('0xa'),auth[_0x7953('0xb')](),controller[_0x7953('0xc')]);router[_0x7953('0xd')](_0x7953('0xa'),auth[_0x7953('0xb')](),controller[_0x7953('0xe')]);router['delete'](_0x7953('0xa'),auth[_0x7953('0xb')](),controller[_0x7953('0xf')]);module[_0x7953('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 d89b3e0..542dfa0 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 _0x222a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x222a,0xb3));var _0xa222=function(_0x488695,_0x1d612f){_0x488695=_0x488695-0x0;var _0x375732=_0x222a[_0x488695];return _0x375732;};'use strict';var Sequelize=require(_0xa222('0x0'));module[_0xa222('0x1')]={'name':{'type':Sequelize[_0xa222('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa222('0x2')]},'write':{'type':Sequelize[_0xa222('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbf25=['BOOLEAN','sequelize','exports','STRING'];(function(_0x230f58,_0x1f8377){var _0x3fdd2c=function(_0x4fb155){while(--_0x4fb155){_0x230f58['push'](_0x230f58['shift']());}};_0x3fdd2c(++_0x1f8377);}(_0xbf25,0x12d));var _0x5bf2=function(_0x10fb80,_0x5936f2){_0x10fb80=_0x10fb80-0x0;var _0x2dc53b=_0xbf25[_0x10fb80];return _0x2dc53b;};'use strict';var Sequelize=require(_0x5bf2('0x0'));module[_0x5bf2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5bf2('0x2')]},'write':{'type':Sequelize[_0x5bf2('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 49e528f..9f10206 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 _0x4324=['getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','stack','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','ids','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatGroupId'];(function(_0x1e9519,_0x4a3445){var _0x5e9690=function(_0x3a2256){while(--_0x3a2256){_0x1e9519['push'](_0x1e9519['shift']());}};_0x5e9690(++_0x4a3445);}(_0x4324,0x12b));var _0x4432=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0x4324[_0x3227c1];return _0x31fd48;};'use strict';var emlformat=require(_0x4432('0x0'));var rimraf=require(_0x4432('0x1'));var zipdir=require(_0x4432('0x2'));var jsonpatch=require(_0x4432('0x3'));var rp=require(_0x4432('0x4'));var moment=require(_0x4432('0x5'));var BPromise=require(_0x4432('0x6'));var Mustache=require(_0x4432('0x7'));var util=require(_0x4432('0x8'));var path=require(_0x4432('0x9'));var sox=require('sox');var csv=require(_0x4432('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4432('0xb'));var _=require('lodash');var squel=require(_0x4432('0xc'));var crypto=require(_0x4432('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4432('0xa'));var querystring=require(_0x4432('0xe'));var Papa=require(_0x4432('0xf'));var Redis=require(_0x4432('0x10'));var authService=require(_0x4432('0x11'));var qs=require(_0x4432('0x12'));var as=require(_0x4432('0x13'));var hardwareService=require(_0x4432('0x14'));var logger=require(_0x4432('0x15'))('api');var utils=require(_0x4432('0x16'));var config=require(_0x4432('0x17'));var licenseUtil=require(_0x4432('0x18'));var db=require(_0x4432('0x19'))['db'];config[_0x4432('0x1a')]=_[_0x4432('0x1b')](config['redis'],{'host':_0x4432('0x1c'),'port':0x18eb});var socket=require(_0x4432('0x1d'))(new Redis(config[_0x4432('0x1a')]));require(_0x4432('0x1e'))['register'](socket);function respondWithStatusCode(_0x3ceb3e,_0x3f7a76){_0x3f7a76=_0x3f7a76||0xcc;return function(_0xb0cbe9){if(_0xb0cbe9){return _0x3ceb3e[_0x4432('0x1f')](_0x3f7a76);}return _0x3ceb3e[_0x4432('0x20')](_0x3f7a76)[_0x4432('0x21')]();};}function respondWithResult(_0x7d18fe,_0x7aac86){_0x7aac86=_0x7aac86||0xc8;return function(_0x20c011){if(_0x20c011){return _0x7d18fe[_0x4432('0x20')](_0x7aac86)[_0x4432('0x22')](_0x20c011);}};}function respondWithFilteredResult(_0x4fb53e,_0x397bd8){return function(_0x226e13){if(_0x226e13){var _0x544b34=typeof _0x397bd8['offset']==='undefined'&&typeof _0x397bd8[_0x4432('0x23')]==='undefined';var _0x32b9df=_0x226e13[_0x4432('0x24')];var _0x30bab2=_0x544b34?0x0:_0x397bd8[_0x4432('0x25')];var _0x320b00=_0x544b34?_0x226e13[_0x4432('0x24')]:_0x397bd8[_0x4432('0x25')]+_0x397bd8[_0x4432('0x23')];var _0x3e93a4;if(_0x320b00>=_0x32b9df){_0x320b00=_0x32b9df;_0x3e93a4=0xc8;}else{_0x3e93a4=0xce;}_0x4fb53e[_0x4432('0x20')](_0x3e93a4);return _0x4fb53e[_0x4432('0x26')](_0x4432('0x27'),_0x30bab2+'-'+_0x320b00+'/'+_0x32b9df)['json'](_0x226e13);}return null;};}function patchUpdates(_0x18f83c){return function(_0x351592){try{jsonpatch[_0x4432('0x28')](_0x351592,_0x18f83c,!![]);}catch(_0x1fd61f){return BPromise[_0x4432('0x29')](_0x1fd61f);}return _0x351592[_0x4432('0x2a')]();};}function saveUpdates(_0x44408e,_0x4c4cbf){return function(_0x3271c1){if(_0x3271c1){return _0x3271c1['update'](_0x44408e)[_0x4432('0x2b')](function(_0x4ec975){return _0x4ec975;});}return null;};}function removeEntity(_0x467c9d,_0x42e649){return function(_0x214b52){if(_0x214b52){return _0x214b52['destroy']()['then'](function(){_0x467c9d['status'](0xcc)[_0x4432('0x21')]();});}};}function handleEntityNotFound(_0x474248,_0x29c117){return function(_0x2be347){if(!_0x2be347){_0x474248[_0x4432('0x1f')](0x194);}return _0x2be347;};}function handleError(_0xea663e,_0x41cf48){_0x41cf48=_0x41cf48||0x1f4;return function(_0x40c57d){logger['error'](_0x40c57d[_0x4432('0x2c')]);if(_0x40c57d[_0x4432('0x2d')]){delete _0x40c57d['name'];}_0xea663e[_0x4432('0x20')](_0x41cf48)[_0x4432('0x2e')](_0x40c57d);};}exports[_0x4432('0x2f')]=function(_0xe48d32,_0x1e4d70){var _0x29524f={},_0x2ce81a={},_0x421285={'count':0x0,'rows':[]};var _0x18a6c9=_['map'](db[_0x4432('0x30')][_0x4432('0x31')],function(_0x200ade){return{'name':_0x200ade[_0x4432('0x32')],'type':_0x200ade['type'][_0x4432('0x33')]};});_0x2ce81a[_0x4432('0x34')]=_[_0x4432('0x35')](_0x18a6c9,_0x4432('0x2d'));_0x2ce81a['query']=_[_0x4432('0x36')](_0xe48d32[_0x4432('0x37')]);_0x2ce81a[_0x4432('0x38')]=_[_0x4432('0x39')](_0x2ce81a[_0x4432('0x34')],_0x2ce81a[_0x4432('0x37')]);_0x29524f['attributes']=_[_0x4432('0x39')](_0x2ce81a[_0x4432('0x34')],qs[_0x4432('0x3a')](_0xe48d32[_0x4432('0x37')][_0x4432('0x3a')]));_0x29524f[_0x4432('0x3b')]=_0x29524f[_0x4432('0x3b')]['length']?_0x29524f['attributes']:_0x2ce81a['model'];if(!_0xe48d32[_0x4432('0x37')]['hasOwnProperty'](_0x4432('0x3c'))){_0x29524f[_0x4432('0x23')]=qs[_0x4432('0x23')](_0xe48d32[_0x4432('0x37')][_0x4432('0x23')]);_0x29524f['offset']=qs[_0x4432('0x25')](_0xe48d32[_0x4432('0x37')][_0x4432('0x25')]);}_0x29524f[_0x4432('0x3d')]=qs[_0x4432('0x3e')](_0xe48d32[_0x4432('0x37')][_0x4432('0x3e')]);_0x29524f[_0x4432('0x3f')]=qs['filters'](_[_0x4432('0x40')](_0xe48d32['query'],_0x2ce81a['filters']),_0x18a6c9);if(_0xe48d32[_0x4432('0x37')]['filter']){_0x29524f[_0x4432('0x3f')]=_[_0x4432('0x41')](_0x29524f[_0x4432('0x3f')],{'$or':_[_0x4432('0x35')](_0x18a6c9,function(_0x1db267){if(_0x1db267['type']!==_0x4432('0x42')){var _0xc862af={};_0xc862af[_0x1db267[_0x4432('0x2d')]]={'$like':'%'+_0xe48d32['query'][_0x4432('0x43')]+'%'};return _0xc862af;}})});}_0x29524f=_[_0x4432('0x41')]({},_0x29524f,_0xe48d32[_0x4432('0x44')]);var _0x7a085f={'where':_0x29524f[_0x4432('0x3f')]};return db[_0x4432('0x30')][_0x4432('0x24')](_0x7a085f)[_0x4432('0x2b')](function(_0x1f0f03){_0x421285[_0x4432('0x24')]=_0x1f0f03;if(_0xe48d32[_0x4432('0x37')][_0x4432('0x45')]){_0x29524f[_0x4432('0x46')]=[{'all':!![]}];}return db[_0x4432('0x30')][_0x4432('0x47')](_0x29524f);})[_0x4432('0x2b')](function(_0x300472){_0x421285[_0x4432('0x48')]=_0x300472;return _0x421285;})[_0x4432('0x2b')](respondWithFilteredResult(_0x1e4d70,_0x29524f))[_0x4432('0x49')](handleError(_0x1e4d70,null));};exports[_0x4432('0x4a')]=function(_0x2beef0,_0x276ad4){var _0xbd1ea9={'raw':!![],'where':{'id':_0x2beef0[_0x4432('0x4b')]['id']}},_0x18a1d8={};_0x18a1d8[_0x4432('0x34')]=_[_0x4432('0x36')](db[_0x4432('0x30')][_0x4432('0x31')]);_0x18a1d8[_0x4432('0x37')]=_['keys'](_0x2beef0[_0x4432('0x37')]);_0x18a1d8[_0x4432('0x38')]=_[_0x4432('0x39')](_0x18a1d8[_0x4432('0x34')],_0x18a1d8[_0x4432('0x37')]);_0xbd1ea9[_0x4432('0x3b')]=_[_0x4432('0x39')](_0x18a1d8[_0x4432('0x34')],qs[_0x4432('0x3a')](_0x2beef0[_0x4432('0x37')][_0x4432('0x3a')]));_0xbd1ea9[_0x4432('0x3b')]=_0xbd1ea9['attributes'][_0x4432('0x4c')]?_0xbd1ea9[_0x4432('0x3b')]:_0x18a1d8['model'];if(_0x2beef0[_0x4432('0x37')][_0x4432('0x45')]){_0xbd1ea9['include']=[{'all':!![]}];}_0xbd1ea9=_[_0x4432('0x41')]({},_0xbd1ea9,_0x2beef0['options']);return db[_0x4432('0x30')][_0x4432('0x4d')](_0xbd1ea9)['then'](handleEntityNotFound(_0x276ad4,null))[_0x4432('0x2b')](respondWithResult(_0x276ad4,null))[_0x4432('0x49')](handleError(_0x276ad4,null));};exports[_0x4432('0x4e')]=function(_0x1c0f4d,_0xbf535b){return db[_0x4432('0x30')][_0x4432('0x4e')](_0x1c0f4d[_0x4432('0x4f')],{})['then'](respondWithResult(_0xbf535b,0xc9))[_0x4432('0x49')](handleError(_0xbf535b,null));};exports['update']=function(_0x14c871,_0x41bf10){if(_0x14c871['body']['id']){delete _0x14c871[_0x4432('0x4f')]['id'];}return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0x14c871[_0x4432('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41bf10,null))['then'](saveUpdates(_0x14c871[_0x4432('0x4f')],null))[_0x4432('0x2b')](respondWithResult(_0x41bf10,null))[_0x4432('0x49')](handleError(_0x41bf10,null));};exports[_0x4432('0x50')]=function(_0x4eaac3,_0x3853a2){return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0x4eaac3[_0x4432('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3853a2,null))['then'](removeEntity(_0x3853a2,null))['catch'](handleError(_0x3853a2,null));};exports['describe']=function(_0x5a03eb,_0x3cdc2b){return db[_0x4432('0x30')][_0x4432('0x51')]()[_0x4432('0x2b')](respondWithResult(_0x3cdc2b,null))[_0x4432('0x49')](handleError(_0x3cdc2b,null));};exports[_0x4432('0x52')]=function(_0x562d40,_0x6e2b9e,_0x1e35db){return db[_0x4432('0x53')][_0x4432('0x24')]({'where':{'ChatGroupId':_0x562d40[_0x4432('0x4b')]['id'],'ToId':_0x562d40[_0x4432('0x54')]['id'],'read':![]}})['then'](function(_0x58bc63){return{'id':_[_0x4432('0x55')](_0x562d40[_0x4432('0x4b')]['id']),'count':_0x58bc63};})[_0x4432('0x2b')](respondWithResult(_0x6e2b9e,null))[_0x4432('0x49')](handleError(_0x6e2b9e,null));};exports['addMembers']=function(_0x3457cb,_0x200ef7,_0x8f92f0){return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0x3457cb[_0x4432('0x4b')]['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x200ef7,null))[_0x4432('0x2b')](function(_0x31ce71){if(_0x31ce71){return _0x31ce71['addMembers'](_0x3457cb[_0x4432('0x4f')]['ids'],_['omit'](_0x3457cb[_0x4432('0x4f')],[_0x4432('0x56'),'id'])||{});}})['then'](respondWithResult(_0x200ef7,null))['catch'](handleError(_0x200ef7,null));};exports[_0x4432('0x57')]=function(_0xaaf6ea,_0x5d7a44,_0x486e83){var _0x4dc276={};var _0x19dc76={};var _0x153f7f;var _0x517d8e;return db[_0x4432('0x30')][_0x4432('0x58')]({'where':{'id':_0xaaf6ea['params']['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x5d7a44,null))['then'](function(_0x380e0d){if(_0x380e0d){_0x153f7f=_0x380e0d;_0x19dc76['model']=_[_0x4432('0x36')](db[_0x4432('0x59')]['rawAttributes']);_0x19dc76[_0x4432('0x37')]=_[_0x4432('0x36')](_0xaaf6ea['query']);_0x19dc76[_0x4432('0x38')]=_[_0x4432('0x39')](_0x19dc76[_0x4432('0x34')],_0x19dc76[_0x4432('0x37')]);_0x4dc276[_0x4432('0x3b')]=_[_0x4432('0x39')](_0x19dc76[_0x4432('0x34')],qs[_0x4432('0x3a')](_0xaaf6ea[_0x4432('0x37')]['fields']));_0x4dc276[_0x4432('0x3b')]=_0x4dc276[_0x4432('0x3b')]['length']?_0x4dc276[_0x4432('0x3b')]:_0x19dc76[_0x4432('0x34')];_0x4dc276[_0x4432('0x3d')]=qs[_0x4432('0x3e')](_0xaaf6ea[_0x4432('0x37')]['sort']);_0x4dc276[_0x4432('0x3f')]=qs[_0x4432('0x38')](_[_0x4432('0x40')](_0xaaf6ea['query'],_0x19dc76[_0x4432('0x38')]));if(_0xaaf6ea['query'][_0x4432('0x43')]){_0x4dc276[_0x4432('0x3f')]=_[_0x4432('0x41')](_0x4dc276[_0x4432('0x3f')],{'$or':_[_0x4432('0x35')](_0x4dc276[_0x4432('0x3b')],function(_0x18a44b){var _0x28e1d8={};_0x28e1d8[_0x18a44b]={'$like':'%'+_0xaaf6ea['query']['filter']+'%'};return _0x28e1d8;})});}_0x4dc276=_[_0x4432('0x41')]({},_0x4dc276,_0xaaf6ea[_0x4432('0x44')]);return _0x153f7f['getMembers'](_0x4dc276);}})[_0x4432('0x2b')](function(_0x37e4cb){if(_0x37e4cb){_0x517d8e=_0x37e4cb['length'];if(!_0xaaf6ea[_0x4432('0x37')][_0x4432('0x5a')](_0x4432('0x3c'))){_0x4dc276[_0x4432('0x23')]=qs[_0x4432('0x23')](_0xaaf6ea[_0x4432('0x37')][_0x4432('0x23')]);_0x4dc276[_0x4432('0x25')]=qs[_0x4432('0x25')](_0xaaf6ea[_0x4432('0x37')][_0x4432('0x25')]);}return _0x153f7f[_0x4432('0x57')](_0x4dc276);}})[_0x4432('0x2b')](function(_0x362a78){if(_0x362a78){return _0x362a78?{'count':_0x517d8e,'rows':_0x362a78}:null;}})[_0x4432('0x2b')](respondWithResult(_0x5d7a44,null))[_0x4432('0x49')](handleError(_0x5d7a44,null));};exports[_0x4432('0x5b')]=function(_0xd92065,_0x87e160,_0x3ac8af){return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0xd92065[_0x4432('0x4b')]['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x87e160,null))[_0x4432('0x2b')](function(_0x25cb67){if(_0x25cb67){return _0x25cb67['removeMembers'](_0xd92065[_0x4432('0x37')][_0x4432('0x56')]);}})['then'](respondWithStatusCode(_0x87e160,null))[_0x4432('0x49')](handleError(_0x87e160,null));};exports['addMessage']=function(_0x6cfd3d,_0x1a8bf9,_0x55d223){if(_0x6cfd3d[_0x4432('0x4f')]['id']){delete _0x6cfd3d[_0x4432('0x4f')]['id'];}return db['ChatGroup'][_0x4432('0x4d')]({'where':{'id':_0x6cfd3d['params']['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x1a8bf9,null))[_0x4432('0x2b')](function(_0x3a3105){if(_0x3a3105){_0x6cfd3d['body'][_0x4432('0x5c')]=_0x3a3105['id'];return db[_0x4432('0x53')][_0x4432('0x4e')](_0x6cfd3d[_0x4432('0x4f')]);}})[_0x4432('0x2b')](respondWithResult(_0x1a8bf9,null))[_0x4432('0x49')](handleError(_0x1a8bf9,null));};exports[_0x4432('0x5d')]=function(_0x17b08b,_0xc7497a,_0x5df26d){var _0x315c69={};var _0x3a4599={};var _0x25af9e;var _0x1e6651;return db[_0x4432('0x30')]['findOne']({'where':{'id':_0x17b08b[_0x4432('0x4b')]['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0xc7497a,null))['then'](function(_0x1a5402){if(_0x1a5402){_0x25af9e=_0x1a5402;_0x3a4599[_0x4432('0x34')]=_[_0x4432('0x36')](db[_0x4432('0x53')][_0x4432('0x31')]);_0x3a4599[_0x4432('0x37')]=_['keys'](_0x17b08b['query']);_0x3a4599[_0x4432('0x38')]=_['intersection'](_0x3a4599['model'],_0x3a4599['query']);_0x315c69['attributes']=_[_0x4432('0x39')](_0x3a4599[_0x4432('0x34')],qs[_0x4432('0x3a')](_0x17b08b['query'][_0x4432('0x3a')]));_0x315c69['attributes']=_0x315c69['attributes'][_0x4432('0x4c')]?_0x315c69[_0x4432('0x3b')]:_0x3a4599[_0x4432('0x34')];_0x315c69[_0x4432('0x3d')]=qs[_0x4432('0x3e')](_0x17b08b[_0x4432('0x37')][_0x4432('0x3e')]);_0x315c69[_0x4432('0x3f')]=qs[_0x4432('0x38')](_[_0x4432('0x40')](_0x17b08b[_0x4432('0x37')],_0x3a4599[_0x4432('0x38')]));if(_0x17b08b[_0x4432('0x37')]['filter']){_0x315c69['where']=_['merge'](_0x315c69[_0x4432('0x3f')],{'$or':_[_0x4432('0x35')](_0x315c69['attributes'],function(_0x308eaf){var _0xd1d37={};_0xd1d37[_0x308eaf]={'$like':'%'+_0x17b08b[_0x4432('0x37')][_0x4432('0x43')]+'%'};return _0xd1d37;})});}if(_0x17b08b[_0x4432('0x37')][_0x4432('0x5e')]){var _0x3fd186=_0x17b08b[_0x4432('0x37')][_0x4432('0x5e')][_0x4432('0x5f')](',');var _0x351540={};_0x351540[_0x3fd186[0x0]]={'$gte':moment(_0x3fd186[0x1])[_0x4432('0x60')](_0x4432('0x61'))};_0x315c69[_0x4432('0x3f')]=_[_0x4432('0x41')](_0x315c69[_0x4432('0x3f')],_0x351540);}_0x315c69=_['merge']({},_0x315c69,_0x17b08b[_0x4432('0x44')]);return _0x25af9e[_0x4432('0x5d')](_0x315c69);}})['then'](function(_0x10022b){if(_0x10022b){_0x1e6651=_0x10022b[_0x4432('0x4c')];if(!_0x17b08b[_0x4432('0x37')][_0x4432('0x5a')](_0x4432('0x3c'))){_0x315c69['limit']=qs[_0x4432('0x23')](_0x17b08b[_0x4432('0x37')][_0x4432('0x23')]);_0x315c69[_0x4432('0x25')]=qs[_0x4432('0x25')](_0x17b08b[_0x4432('0x37')][_0x4432('0x25')]);}return _0x25af9e['getMessages'](_0x315c69);}})[_0x4432('0x2b')](function(_0x5604f1){if(_0x5604f1){return _0x5604f1?{'count':_0x1e6651,'rows':_0x5604f1}:null;}})[_0x4432('0x2b')](respondWithResult(_0xc7497a,null))[_0x4432('0x49')](handleError(_0xc7497a,null));};
\ No newline at end of file
+var _0x5b6c=['length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','update','params','describe','getUnread','toInteger','addMembers','omit','ids','getMembers','findOne','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','format','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','query','filters','intersection','fields','attributes'];(function(_0x2e9e80,_0x34cf78){var _0x13ccc4=function(_0x3222a5){while(--_0x3222a5){_0x2e9e80['push'](_0x2e9e80['shift']());}};_0x13ccc4(++_0x34cf78);}(_0x5b6c,0x1a6));var _0xc5b6=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x5b6c[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0xc5b6('0x0'));var rimraf=require(_0xc5b6('0x1'));var zipdir=require(_0xc5b6('0x2'));var jsonpatch=require(_0xc5b6('0x3'));var rp=require('request-promise');var moment=require(_0xc5b6('0x4'));var BPromise=require(_0xc5b6('0x5'));var Mustache=require(_0xc5b6('0x6'));var util=require(_0xc5b6('0x7'));var path=require(_0xc5b6('0x8'));var sox=require(_0xc5b6('0x9'));var csv=require(_0xc5b6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5b6('0xb'));var _=require('lodash');var squel=require(_0xc5b6('0xc'));var crypto=require(_0xc5b6('0xd'));var jsforce=require(_0xc5b6('0xe'));var deskjs=require(_0xc5b6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc5b6('0x10'));var Redis=require(_0xc5b6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5b6('0x12'));var hardwareService=require(_0xc5b6('0x13'));var logger=require(_0xc5b6('0x14'))(_0xc5b6('0x15'));var utils=require(_0xc5b6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc5b6('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5b6('0x18')]=_['defaults'](config[_0xc5b6('0x18')],{'host':_0xc5b6('0x19'),'port':0x18eb});var socket=require(_0xc5b6('0x1a'))(new Redis(config[_0xc5b6('0x18')]));require('./chatGroup.socket')[_0xc5b6('0x1b')](socket);function respondWithStatusCode(_0x5c1164,_0x26b013){_0x26b013=_0x26b013||0xcc;return function(_0x42b2ef){if(_0x42b2ef){return _0x5c1164['sendStatus'](_0x26b013);}return _0x5c1164[_0xc5b6('0x1c')](_0x26b013)[_0xc5b6('0x1d')]();};}function respondWithResult(_0xe70f97,_0x4b8066){_0x4b8066=_0x4b8066||0xc8;return function(_0x5793d1){if(_0x5793d1){return _0xe70f97[_0xc5b6('0x1c')](_0x4b8066)['json'](_0x5793d1);}};}function respondWithFilteredResult(_0x3058fe,_0x4382e2){return function(_0x536f25){if(_0x536f25){var _0x116474=typeof _0x4382e2[_0xc5b6('0x1e')]===_0xc5b6('0x1f')&&typeof _0x4382e2[_0xc5b6('0x20')]==='undefined';var _0x45e86a=_0x536f25[_0xc5b6('0x21')];var _0x3a1e8b=_0x116474?0x0:_0x4382e2[_0xc5b6('0x1e')];var _0x5db647=_0x116474?_0x536f25[_0xc5b6('0x21')]:_0x4382e2['offset']+_0x4382e2['limit'];var _0x58445f;if(_0x5db647>=_0x45e86a){_0x5db647=_0x45e86a;_0x58445f=0xc8;}else{_0x58445f=0xce;}_0x3058fe['status'](_0x58445f);return _0x3058fe[_0xc5b6('0x22')](_0xc5b6('0x23'),_0x3a1e8b+'-'+_0x5db647+'/'+_0x45e86a)[_0xc5b6('0x24')](_0x536f25);}return null;};}function patchUpdates(_0x32f178){return function(_0x1fae0f){try{jsonpatch[_0xc5b6('0x25')](_0x1fae0f,_0x32f178,!![]);}catch(_0x181fd3){return BPromise[_0xc5b6('0x26')](_0x181fd3);}return _0x1fae0f[_0xc5b6('0x27')]();};}function saveUpdates(_0xfa2254,_0x567064){return function(_0x2194ef){if(_0x2194ef){return _0x2194ef['update'](_0xfa2254)[_0xc5b6('0x28')](function(_0x11a823){return _0x11a823;});}return null;};}function removeEntity(_0x377a92,_0x4bc731){return function(_0x3f4f0f){if(_0x3f4f0f){return _0x3f4f0f[_0xc5b6('0x29')]()['then'](function(){_0x377a92['status'](0xcc)[_0xc5b6('0x1d')]();});}};}function handleEntityNotFound(_0x503fc1,_0x3ec673){return function(_0x2ad1a7){if(!_0x2ad1a7){_0x503fc1[_0xc5b6('0x2a')](0x194);}return _0x2ad1a7;};}function handleError(_0x5cc3ce,_0x5edb79){_0x5edb79=_0x5edb79||0x1f4;return function(_0x3385b1){logger['error'](_0x3385b1[_0xc5b6('0x2b')]);if(_0x3385b1[_0xc5b6('0x2c')]){delete _0x3385b1['name'];}_0x5cc3ce[_0xc5b6('0x1c')](_0x5edb79)[_0xc5b6('0x2d')](_0x3385b1);};}exports[_0xc5b6('0x2e')]=function(_0x44f038,_0x5a0679){var _0x129721={},_0x20ebe5={},_0x21d1c7={'count':0x0,'rows':[]};var _0x177508=_[_0xc5b6('0x2f')](db[_0xc5b6('0x30')]['rawAttributes'],function(_0x31ec03){return{'name':_0x31ec03[_0xc5b6('0x31')],'type':_0x31ec03[_0xc5b6('0x32')][_0xc5b6('0x33')]};});_0x20ebe5[_0xc5b6('0x34')]=_[_0xc5b6('0x2f')](_0x177508,_0xc5b6('0x2c'));_0x20ebe5[_0xc5b6('0x35')]=_['keys'](_0x44f038[_0xc5b6('0x35')]);_0x20ebe5[_0xc5b6('0x36')]=_[_0xc5b6('0x37')](_0x20ebe5[_0xc5b6('0x34')],_0x20ebe5[_0xc5b6('0x35')]);_0x129721['attributes']=_['intersection'](_0x20ebe5[_0xc5b6('0x34')],qs['fields'](_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x38')]));_0x129721[_0xc5b6('0x39')]=_0x129721[_0xc5b6('0x39')][_0xc5b6('0x3a')]?_0x129721[_0xc5b6('0x39')]:_0x20ebe5[_0xc5b6('0x34')];if(!_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x3b')]('nolimit')){_0x129721[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x20')]);_0x129721[_0xc5b6('0x1e')]=qs[_0xc5b6('0x1e')](_0x44f038[_0xc5b6('0x35')]['offset']);}_0x129721[_0xc5b6('0x3c')]=qs[_0xc5b6('0x3d')](_0x44f038[_0xc5b6('0x35')]['sort']);_0x129721[_0xc5b6('0x3e')]=qs['filters'](_[_0xc5b6('0x3f')](_0x44f038[_0xc5b6('0x35')],_0x20ebe5[_0xc5b6('0x36')]),_0x177508);if(_0x44f038['query']['filter']){_0x129721[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x129721[_0xc5b6('0x3e')],{'$or':_[_0xc5b6('0x2f')](_0x177508,function(_0x3e11fe){if(_0x3e11fe[_0xc5b6('0x32')]!==_0xc5b6('0x41')){var _0x1cafa4={};_0x1cafa4[_0x3e11fe[_0xc5b6('0x2c')]]={'$like':'%'+_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x42')]+'%'};return _0x1cafa4;}})});}_0x129721=_[_0xc5b6('0x40')]({},_0x129721,_0x44f038[_0xc5b6('0x43')]);var _0x33f7f1={'where':_0x129721[_0xc5b6('0x3e')]};return db['ChatGroup'][_0xc5b6('0x21')](_0x33f7f1)[_0xc5b6('0x28')](function(_0x3a26cf){_0x21d1c7[_0xc5b6('0x21')]=_0x3a26cf;if(_0x44f038['query'][_0xc5b6('0x44')]){_0x129721[_0xc5b6('0x45')]=[{'all':!![]}];}return db['ChatGroup'][_0xc5b6('0x46')](_0x129721);})[_0xc5b6('0x28')](function(_0x1bd72f){_0x21d1c7[_0xc5b6('0x47')]=_0x1bd72f;return _0x21d1c7;})[_0xc5b6('0x28')](respondWithFilteredResult(_0x5a0679,_0x129721))[_0xc5b6('0x48')](handleError(_0x5a0679,null));};exports['show']=function(_0x3970ed,_0xfb4883){var _0x55e1ce={'raw':!![],'where':{'id':_0x3970ed['params']['id']}},_0x2c7381={};_0x2c7381[_0xc5b6('0x34')]=_[_0xc5b6('0x49')](db[_0xc5b6('0x30')][_0xc5b6('0x4a')]);_0x2c7381['query']=_[_0xc5b6('0x49')](_0x3970ed[_0xc5b6('0x35')]);_0x2c7381[_0xc5b6('0x36')]=_[_0xc5b6('0x37')](_0x2c7381[_0xc5b6('0x34')],_0x2c7381[_0xc5b6('0x35')]);_0x55e1ce[_0xc5b6('0x39')]=_[_0xc5b6('0x37')](_0x2c7381[_0xc5b6('0x34')],qs[_0xc5b6('0x38')](_0x3970ed[_0xc5b6('0x35')]['fields']));_0x55e1ce[_0xc5b6('0x39')]=_0x55e1ce[_0xc5b6('0x39')]['length']?_0x55e1ce[_0xc5b6('0x39')]:_0x2c7381[_0xc5b6('0x34')];if(_0x3970ed[_0xc5b6('0x35')]['includeAll']){_0x55e1ce[_0xc5b6('0x45')]=[{'all':!![]}];}_0x55e1ce=_[_0xc5b6('0x40')]({},_0x55e1ce,_0x3970ed[_0xc5b6('0x43')]);return db[_0xc5b6('0x30')][_0xc5b6('0x4b')](_0x55e1ce)[_0xc5b6('0x28')](handleEntityNotFound(_0xfb4883,null))[_0xc5b6('0x28')](respondWithResult(_0xfb4883,null))[_0xc5b6('0x48')](handleError(_0xfb4883,null));};exports['create']=function(_0x4e8714,_0x4b326f){return db['ChatGroup'][_0xc5b6('0x4c')](_0x4e8714[_0xc5b6('0x4d')],{})['then'](respondWithResult(_0x4b326f,0xc9))[_0xc5b6('0x48')](handleError(_0x4b326f,null));};exports[_0xc5b6('0x4e')]=function(_0x504487,_0x21e2a1){if(_0x504487['body']['id']){delete _0x504487[_0xc5b6('0x4d')]['id'];}return db[_0xc5b6('0x30')][_0xc5b6('0x4b')]({'where':{'id':_0x504487[_0xc5b6('0x4f')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x21e2a1,null))[_0xc5b6('0x28')](saveUpdates(_0x504487[_0xc5b6('0x4d')],null))[_0xc5b6('0x28')](respondWithResult(_0x21e2a1,null))[_0xc5b6('0x48')](handleError(_0x21e2a1,null));};exports['destroy']=function(_0x64116f,_0x390267){return db['ChatGroup'][_0xc5b6('0x4b')]({'where':{'id':_0x64116f[_0xc5b6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x390267,null))[_0xc5b6('0x28')](removeEntity(_0x390267,null))[_0xc5b6('0x48')](handleError(_0x390267,null));};exports[_0xc5b6('0x50')]=function(_0x52e160,_0x326fab){return db[_0xc5b6('0x30')]['describe']()[_0xc5b6('0x28')](respondWithResult(_0x326fab,null))[_0xc5b6('0x48')](handleError(_0x326fab,null));};exports[_0xc5b6('0x51')]=function(_0x490730,_0xbcb902,_0x50f95b){return db['ChatInternalMessage'][_0xc5b6('0x21')]({'where':{'ChatGroupId':_0x490730[_0xc5b6('0x4f')]['id'],'ToId':_0x490730['user']['id'],'read':![]}})['then'](function(_0x13ac11){return{'id':_[_0xc5b6('0x52')](_0x490730[_0xc5b6('0x4f')]['id']),'count':_0x13ac11};})[_0xc5b6('0x28')](respondWithResult(_0xbcb902,null))[_0xc5b6('0x48')](handleError(_0xbcb902,null));};exports[_0xc5b6('0x53')]=function(_0x841779,_0x57260e,_0x436582){return db[_0xc5b6('0x30')][_0xc5b6('0x4b')]({'where':{'id':_0x841779[_0xc5b6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57260e,null))['then'](function(_0x35d575){if(_0x35d575){return _0x35d575[_0xc5b6('0x53')](_0x841779['body']['ids'],_[_0xc5b6('0x54')](_0x841779['body'],[_0xc5b6('0x55'),'id'])||{});}})[_0xc5b6('0x28')](respondWithResult(_0x57260e,null))[_0xc5b6('0x48')](handleError(_0x57260e,null));};exports[_0xc5b6('0x56')]=function(_0x5e3e78,_0x53a593,_0x4a7f72){var _0x4e42c0={};var _0x410291={};var _0x1589de;var _0x157942;return db[_0xc5b6('0x30')][_0xc5b6('0x57')]({'where':{'id':_0x5e3e78[_0xc5b6('0x4f')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x53a593,null))[_0xc5b6('0x28')](function(_0x5e064f){if(_0x5e064f){_0x1589de=_0x5e064f;_0x410291[_0xc5b6('0x34')]=_[_0xc5b6('0x49')](db['User'][_0xc5b6('0x4a')]);_0x410291['query']=_[_0xc5b6('0x49')](_0x5e3e78[_0xc5b6('0x35')]);_0x410291['filters']=_[_0xc5b6('0x37')](_0x410291['model'],_0x410291[_0xc5b6('0x35')]);_0x4e42c0[_0xc5b6('0x39')]=_[_0xc5b6('0x37')](_0x410291['model'],qs['fields'](_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x38')]));_0x4e42c0[_0xc5b6('0x39')]=_0x4e42c0[_0xc5b6('0x39')]['length']?_0x4e42c0[_0xc5b6('0x39')]:_0x410291[_0xc5b6('0x34')];_0x4e42c0[_0xc5b6('0x3c')]=qs[_0xc5b6('0x3d')](_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x3d')]);_0x4e42c0['where']=qs['filters'](_['pick'](_0x5e3e78[_0xc5b6('0x35')],_0x410291['filters']));if(_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x42')]){_0x4e42c0[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x4e42c0[_0xc5b6('0x3e')],{'$or':_[_0xc5b6('0x2f')](_0x4e42c0[_0xc5b6('0x39')],function(_0x82c86d){var _0x338fdd={};_0x338fdd[_0x82c86d]={'$like':'%'+_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x42')]+'%'};return _0x338fdd;})});}_0x4e42c0=_['merge']({},_0x4e42c0,_0x5e3e78[_0xc5b6('0x43')]);return _0x1589de['getMembers'](_0x4e42c0);}})[_0xc5b6('0x28')](function(_0x5e34c8){if(_0x5e34c8){_0x157942=_0x5e34c8[_0xc5b6('0x3a')];if(!_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x3b')](_0xc5b6('0x58'))){_0x4e42c0[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x5e3e78['query']['limit']);_0x4e42c0[_0xc5b6('0x1e')]=qs[_0xc5b6('0x1e')](_0x5e3e78['query']['offset']);}return _0x1589de[_0xc5b6('0x56')](_0x4e42c0);}})['then'](function(_0x3daeda){if(_0x3daeda){return _0x3daeda?{'count':_0x157942,'rows':_0x3daeda}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x53a593,null))[_0xc5b6('0x48')](handleError(_0x53a593,null));};exports[_0xc5b6('0x59')]=function(_0x8e5c0f,_0x59b5c1,_0x255bd4){return db[_0xc5b6('0x30')][_0xc5b6('0x4b')]({'where':{'id':_0x8e5c0f['params']['id']}})['then'](handleEntityNotFound(_0x59b5c1,null))[_0xc5b6('0x28')](function(_0x2d1007){if(_0x2d1007){return _0x2d1007[_0xc5b6('0x59')](_0x8e5c0f[_0xc5b6('0x35')]['ids']);}})[_0xc5b6('0x28')](respondWithStatusCode(_0x59b5c1,null))[_0xc5b6('0x48')](handleError(_0x59b5c1,null));};exports[_0xc5b6('0x5a')]=function(_0x19b665,_0x5f06fc,_0x53dda4){if(_0x19b665[_0xc5b6('0x4d')]['id']){delete _0x19b665['body']['id'];}return db['ChatGroup'][_0xc5b6('0x4b')]({'where':{'id':_0x19b665[_0xc5b6('0x4f')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x5f06fc,null))[_0xc5b6('0x28')](function(_0xe6f006){if(_0xe6f006){_0x19b665[_0xc5b6('0x4d')][_0xc5b6('0x5b')]=_0xe6f006['id'];return db[_0xc5b6('0x5c')]['create'](_0x19b665[_0xc5b6('0x4d')]);}})[_0xc5b6('0x28')](respondWithResult(_0x5f06fc,null))[_0xc5b6('0x48')](handleError(_0x5f06fc,null));};exports['getMessages']=function(_0x798c3e,_0x5aa850,_0x2c48d2){var _0x57f63b={};var _0x1b9ffd={};var _0x48f1c0;var _0x257f89;return db[_0xc5b6('0x30')][_0xc5b6('0x57')]({'where':{'id':_0x798c3e['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x5aa850,null))['then'](function(_0x167a0c){if(_0x167a0c){_0x48f1c0=_0x167a0c;_0x1b9ffd['model']=_[_0xc5b6('0x49')](db[_0xc5b6('0x5c')][_0xc5b6('0x4a')]);_0x1b9ffd[_0xc5b6('0x35')]=_[_0xc5b6('0x49')](_0x798c3e['query']);_0x1b9ffd[_0xc5b6('0x36')]=_[_0xc5b6('0x37')](_0x1b9ffd[_0xc5b6('0x34')],_0x1b9ffd[_0xc5b6('0x35')]);_0x57f63b[_0xc5b6('0x39')]=_[_0xc5b6('0x37')](_0x1b9ffd[_0xc5b6('0x34')],qs[_0xc5b6('0x38')](_0x798c3e[_0xc5b6('0x35')]['fields']));_0x57f63b[_0xc5b6('0x39')]=_0x57f63b[_0xc5b6('0x39')][_0xc5b6('0x3a')]?_0x57f63b['attributes']:_0x1b9ffd[_0xc5b6('0x34')];_0x57f63b[_0xc5b6('0x3c')]=qs[_0xc5b6('0x3d')](_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x3d')]);_0x57f63b[_0xc5b6('0x3e')]=qs[_0xc5b6('0x36')](_[_0xc5b6('0x3f')](_0x798c3e['query'],_0x1b9ffd[_0xc5b6('0x36')]));if(_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x42')]){_0x57f63b[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x57f63b[_0xc5b6('0x3e')],{'$or':_[_0xc5b6('0x2f')](_0x57f63b[_0xc5b6('0x39')],function(_0x19d6dd){var _0x38c4ec={};_0x38c4ec[_0x19d6dd]={'$like':'%'+_0x798c3e['query'][_0xc5b6('0x42')]+'%'};return _0x38c4ec;})});}if(_0x798c3e['query'][_0xc5b6('0x5d')]){var _0x4d6fb6=_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x5d')]['split'](',');var _0x1ec341={};_0x1ec341[_0x4d6fb6[0x0]]={'$gte':moment(_0x4d6fb6[0x1])[_0xc5b6('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x57f63b[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x57f63b[_0xc5b6('0x3e')],_0x1ec341);}_0x57f63b=_[_0xc5b6('0x40')]({},_0x57f63b,_0x798c3e[_0xc5b6('0x43')]);return _0x48f1c0[_0xc5b6('0x5f')](_0x57f63b);}})[_0xc5b6('0x28')](function(_0x37528c){if(_0x37528c){_0x257f89=_0x37528c['length'];if(!_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x3b')](_0xc5b6('0x58'))){_0x57f63b['limit']=qs['limit'](_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x20')]);_0x57f63b[_0xc5b6('0x1e')]=qs[_0xc5b6('0x1e')](_0x798c3e[_0xc5b6('0x35')]['offset']);}return _0x48f1c0['getMessages'](_0x57f63b);}})[_0xc5b6('0x28')](function(_0x124f6d){if(_0x124f6d){return _0x124f6d?{'count':_0x257f89,'rows':_0x124f6d}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x5aa850,null))[_0xc5b6('0x48')](handleError(_0x5aa850,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index f7092ef..8087cfe 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 _0x3504=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x3504,0xce));var _0x4350=function(_0x3ce2d0,_0x230d91){_0x3ce2d0=_0x3ce2d0-0x0;var _0x369790=_0x3504[_0x3ce2d0];return _0x369790;};'use strict';var EventEmitter=require(_0x4350('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4350('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4350('0x2'),'afterDestroy':_0x4350('0x3')};function emitEvent(_0x568470){return function(_0x1b5485,_0x3b0f42,_0x5aa5a3){ChatGroupEvents[_0x4350('0x4')](_0x568470+':'+_0x1b5485['id'],_0x1b5485);ChatGroupEvents[_0x4350('0x4')](_0x568470,_0x1b5485);_0x5aa5a3(null);};}for(var e in events){if(events[_0x4350('0x5')](e)){var event=events[e];ChatGroup[_0x4350('0x6')](e,emitEvent(event));}}module[_0x4350('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0xb422=['emit','hasOwnProperty','hook','setMaxListeners','remove'];(function(_0x17ebd1,_0x5bc2e3){var _0x3fe498=function(_0x202150){while(--_0x202150){_0x17ebd1['push'](_0x17ebd1['shift']());}};_0x3fe498(++_0x5bc2e3);}(_0xb422,0x85));var _0x2b42=function(_0x332933,_0x3f58df){_0x332933=_0x332933-0x0;var _0x34fb7b=_0xb422[_0x332933];return _0x34fb7b;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2b42('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2b42('0x1')};function emitEvent(_0x5a42d2){return function(_0x14330f,_0x5df2d3,_0x1b469f){ChatGroupEvents['emit'](_0x5a42d2+':'+_0x14330f['id'],_0x14330f);ChatGroupEvents[_0x2b42('0x2')](_0x5a42d2,_0x14330f);_0x1b469f(null);};}for(var e in events){if(events[_0x2b42('0x3')](e)){var event=events[e];ChatGroup[_0x2b42('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index b81a6c9..368766f 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 _0x1e7f=['moment','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','../../config/logger','api'];(function(_0x25fb18,_0x5837bc){var _0x1a2625=function(_0x2be3f2){while(--_0x2be3f2){_0x25fb18['push'](_0x25fb18['shift']());}};_0x1a2625(++_0x5837bc);}(_0x1e7f,0x173));var _0xf1e7=function(_0x2bf9ed,_0x4e2de7){_0x2bf9ed=_0x2bf9ed-0x0;var _0x508979=_0x1e7f[_0x2bf9ed];return _0x508979;};'use strict';var _=require(_0xf1e7('0x0'));var util=require('util');var logger=require(_0xf1e7('0x1'))(_0xf1e7('0x2'));var moment=require(_0xf1e7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf1e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1e7('0x5'));var config=require(_0xf1e7('0x6'));var attributes=require(_0xf1e7('0x7'));module[_0xf1e7('0x8')]=function(_0x4b3b6e,_0x18df32){return _0x4b3b6e[_0xf1e7('0x9')]('ChatGroup',attributes,{'tableName':_0xf1e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea39=['./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xea39,0x1a8));var _0x9ea3=function(_0x4b27dc,_0x3f7afb){_0x4b27dc=_0x4b27dc-0x0;var _0x1a37f2=_0xea39[_0x4b27dc];return _0x1a37f2;};'use strict';var _=require(_0x9ea3('0x0'));var util=require(_0x9ea3('0x1'));var logger=require(_0x9ea3('0x2'))(_0x9ea3('0x3'));var moment=require(_0x9ea3('0x4'));var BPromise=require(_0x9ea3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ea3('0x6'));var rimraf=require(_0x9ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ea3('0x8'));module[_0x9ea3('0x9')]=function(_0x4b7aaf,_0xf5e61a){return _0x4b7aaf[_0x9ea3('0xa')]('ChatGroup',attributes,{'tableName':_0x9ea3('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 e9ea356..3d76203 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 _0x51f2=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5cdede,_0x5287a5){var _0x274b8d=function(_0x539ce8){while(--_0x539ce8){_0x5cdede['push'](_0x5cdede['shift']());}};_0x274b8d(++_0x5287a5);}(_0x51f2,0xeb));var _0x251f=function(_0x1dd28a,_0x82c27d){_0x1dd28a=_0x1dd28a-0x0;var _0x47c8bf=_0x51f2[_0x1dd28a];return _0x47c8bf;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var moment=require(_0x251f('0x2'));var BPromise=require(_0x251f('0x3'));var rs=require(_0x251f('0x4'));var fs=require('fs');var Redis=require(_0x251f('0x5'));var db=require(_0x251f('0x6'))['db'];var utils=require(_0x251f('0x7'));var logger=require(_0x251f('0x8'))('rpc');var config=require(_0x251f('0x9'));var jayson=require(_0x251f('0xa'));var client=jayson[_0x251f('0xb')][_0x251f('0xc')]({'port':0x232a});config[_0x251f('0xd')]=_['defaults'](config[_0x251f('0xd')],{'host':_0x251f('0xe'),'port':0x18eb});var socket=require(_0x251f('0xf'))(new Redis(config[_0x251f('0xd')]));require('./chatGroup.socket')[_0x251f('0x10')](socket);function respondWithRpcPromise(_0x2ca056,_0x863651,_0x35694d){return new BPromise(function(_0x5aedae,_0x12e9f7){return client[_0x251f('0x11')](_0x2ca056,_0x35694d)[_0x251f('0x12')](function(_0x1c851f){logger['info'](_0x251f('0x13'),_0x863651,_0x251f('0x14'));logger[_0x251f('0x15')](_0x251f('0x16'),_0x863651,_0x251f('0x14'),JSON[_0x251f('0x17')](_0x1c851f));if(_0x1c851f[_0x251f('0x18')]){if(_0x1c851f[_0x251f('0x18')][_0x251f('0x19')]===0x1f4){logger[_0x251f('0x18')](_0x251f('0x13'),_0x863651,_0x1c851f['error'][_0x251f('0x1a')]);return _0x12e9f7(_0x1c851f[_0x251f('0x18')]['message']);}logger[_0x251f('0x18')](_0x251f('0x13'),_0x863651,_0x1c851f[_0x251f('0x18')][_0x251f('0x1a')]);return _0x5aedae(_0x1c851f[_0x251f('0x18')]['message']);}else{logger['info'](_0x251f('0x13'),_0x863651,_0x251f('0x14'));_0x5aedae(_0x1c851f[_0x251f('0x1b')][_0x251f('0x1a')]);}})[_0x251f('0x1c')](function(_0x49d2eb){logger[_0x251f('0x18')](_0x251f('0x13'),_0x863651,_0x49d2eb);_0x12e9f7(_0x49d2eb);});});}
\ No newline at end of file
+var _0x3f19=['info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1e2f07,_0x4da21b){var _0x42d8c1=function(_0x466378){while(--_0x466378){_0x1e2f07['push'](_0x1e2f07['shift']());}};_0x42d8c1(++_0x4da21b);}(_0x3f19,0x1f1));var _0x93f1=function(_0x1d6eb4,_0x2a20d7){_0x1d6eb4=_0x1d6eb4-0x0;var _0x1277f0=_0x3f19[_0x1d6eb4];return _0x1277f0;};'use strict';var _=require('lodash');var util=require(_0x93f1('0x0'));var moment=require('moment');var BPromise=require(_0x93f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93f1('0x2'));var db=require(_0x93f1('0x3'))['db'];var utils=require(_0x93f1('0x4'));var logger=require(_0x93f1('0x5'))(_0x93f1('0x6'));var config=require(_0x93f1('0x7'));var jayson=require(_0x93f1('0x8'));var client=jayson[_0x93f1('0x9')][_0x93f1('0xa')]({'port':0x232a});config[_0x93f1('0xb')]=_[_0x93f1('0xc')](config[_0x93f1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x93f1('0xd'))(new Redis(config['redis']));require(_0x93f1('0xe'))[_0x93f1('0xf')](socket);function respondWithRpcPromise(_0x4052b4,_0x45d171,_0x30fed4){return new BPromise(function(_0x5c8cda,_0x4a6776){return client[_0x93f1('0x10')](_0x4052b4,_0x30fed4)['then'](function(_0x3eb625){logger['info'](_0x93f1('0x11'),_0x45d171,_0x93f1('0x12'));logger['debug'](_0x93f1('0x13'),_0x45d171,_0x93f1('0x12'),JSON['stringify'](_0x3eb625));if(_0x3eb625[_0x93f1('0x14')]){if(_0x3eb625[_0x93f1('0x14')][_0x93f1('0x15')]===0x1f4){logger[_0x93f1('0x14')](_0x93f1('0x11'),_0x45d171,_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);return _0x4a6776(_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x45d171,_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);return _0x5c8cda(_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);}else{logger[_0x93f1('0x17')]('ChatGroup,\x20%s,\x20%s',_0x45d171,_0x93f1('0x12'));_0x5c8cda(_0x3eb625[_0x93f1('0x18')][_0x93f1('0x16')]);}})[_0x93f1('0x19')](function(_0x31f4d9){logger[_0x93f1('0x14')](_0x93f1('0x11'),_0x45d171,_0x31f4d9);_0x4a6776(_0x31f4d9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 148961a..63bfc51 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 _0x3979=['remove','emit','save'];(function(_0x1e3d1f,_0x2e6703){var _0xa955a7=function(_0x4c6b13){while(--_0x4c6b13){_0x1e3d1f['push'](_0x1e3d1f['shift']());}};_0xa955a7(++_0x2e6703);}(_0x3979,0xe6));var _0x9397=function(_0x29d170,_0x35bf92){_0x29d170=_0x29d170-0x0;var _0x5b0ada=_0x3979[_0x29d170];return _0x5b0ada;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9397('0x0'),_0x9397('0x1'),'update'];function createListener(_0x36cf38,_0xd81e42){return function(_0x46030e){_0xd81e42[_0x9397('0x2')](_0x36cf38,_0x46030e);};}function removeListener(_0x12be69,_0x57d172){return function(){ChatGroupEvents['removeListener'](_0x12be69,_0x57d172);};}exports['register']=function(_0x2d61bf){for(var _0x4c4230=0x0,_0xd5cd4c=events['length'];_0x4c4230<_0xd5cd4c;_0x4c4230++){var _0x5da763=events[_0x4c4230];var _0x1bb436=createListener('chatGroup:'+_0x5da763,_0x2d61bf);ChatGroupEvents['on'](_0x5da763,_0x1bb436);}};
\ No newline at end of file
+var _0xc5f3=['save','update','emit','removeListener','length','chatGroup:'];(function(_0x15443e,_0x5d70c1){var _0x4b93d7=function(_0x15586b){while(--_0x15586b){_0x15443e['push'](_0x15443e['shift']());}};_0x4b93d7(++_0x5d70c1);}(_0xc5f3,0x162));var _0x3c5f=function(_0x4ba811,_0x4428f2){_0x4ba811=_0x4ba811-0x0;var _0x3b616f=_0xc5f3[_0x4ba811];return _0x3b616f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x3c5f('0x0'),'remove',_0x3c5f('0x1')];function createListener(_0x56b973,_0x487b0e){return function(_0x2956d9){_0x487b0e[_0x3c5f('0x2')](_0x56b973,_0x2956d9);};}function removeListener(_0x3dac93,_0x273b6e){return function(){ChatGroupEvents[_0x3c5f('0x3')](_0x3dac93,_0x273b6e);};}exports['register']=function(_0x5334b9){for(var _0x3a2a57=0x0,_0x27548c=events[_0x3c5f('0x4')];_0x3a2a57<_0x27548c;_0x3a2a57++){var _0x53181e=events[_0x3a2a57];var _0x11dfa7=createListener(_0x3c5f('0x5')+_0x53181e,_0x5334b9);ChatGroupEvents['on'](_0x53181e,_0x11dfa7);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 54bd127..940fb75 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 _0x758d=['getMessages','create','post','addMembers','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getUnread','/:id/members','/:id/messages'];(function(_0x3ed984,_0x465732){var _0x2ef7a9=function(_0x562086){while(--_0x562086){_0x3ed984['push'](_0x3ed984['shift']());}};_0x2ef7a9(++_0x465732);}(_0x758d,0x103));var _0xd758=function(_0x18ea27,_0x1eae6a){_0x18ea27=_0x18ea27-0x0;var _0x44cb1e=_0x758d[_0x18ea27];return _0x44cb1e;};'use strict';var multer=require(_0xd758('0x0'));var util=require(_0xd758('0x1'));var path=require(_0xd758('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd758('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd758('0x4'));var interaction=require(_0xd758('0x5'));var config=require(_0xd758('0x6'));var controller=require('./chatGroup.controller');router[_0xd758('0x7')]('/',auth[_0xd758('0x8')](),controller[_0xd758('0x9')]);router[_0xd758('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd758('0xa')]);router['get'](_0xd758('0xb'),auth[_0xd758('0x8')](),controller[_0xd758('0xc')]);router[_0xd758('0x7')]('/:id/unread',auth[_0xd758('0x8')](),controller[_0xd758('0xd')]);router[_0xd758('0x7')](_0xd758('0xe'),auth[_0xd758('0x8')](),controller['getMembers']);router[_0xd758('0x7')](_0xd758('0xf'),auth[_0xd758('0x8')](),controller[_0xd758('0x10')]);router['post']('/',auth[_0xd758('0x8')](),controller[_0xd758('0x11')]);router[_0xd758('0x12')](_0xd758('0xe'),auth['isAuthenticated'](),controller[_0xd758('0x13')]);router[_0xd758('0x12')](_0xd758('0xf'),auth[_0xd758('0x8')](),controller['addMessage']);router[_0xd758('0x14')](_0xd758('0xb'),auth[_0xd758('0x8')](),controller[_0xd758('0x15')]);router[_0xd758('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd758('0x17')]);router[_0xd758('0x16')](_0xd758('0xe'),auth[_0xd758('0x8')](),controller['removeMembers']);module[_0xd758('0x18')]=router;
\ No newline at end of file
+var _0xdcb7=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','get','/:id','/:id/unread','getUnread','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','connect-timeout'];(function(_0xc140f6,_0x295d7f){var _0x2d4f70=function(_0x173f49){while(--_0x173f49){_0xc140f6['push'](_0xc140f6['shift']());}};_0x2d4f70(++_0x295d7f);}(_0xdcb7,0x10c));var _0x7dcb=function(_0x337c60,_0x52db2a){_0x337c60=_0x337c60-0x0;var _0xea2304=_0xdcb7[_0x337c60];return _0xea2304;};'use strict';var multer=require(_0x7dcb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7dcb('0x1'));var express=require(_0x7dcb('0x2'));var router=express['Router']();var fs_extra=require(_0x7dcb('0x3'));var auth=require(_0x7dcb('0x4'));var interaction=require(_0x7dcb('0x5'));var config=require(_0x7dcb('0x6'));var controller=require(_0x7dcb('0x7'));router['get']('/',auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x9')]);router['get'](_0x7dcb('0xa'),auth[_0x7dcb('0x8')](),controller['describe']);router[_0x7dcb('0xb')](_0x7dcb('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7dcb('0xd'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0xe')]);router[_0x7dcb('0xb')]('/:id/members',auth[_0x7dcb('0x8')](),controller['getMembers']);router[_0x7dcb('0xb')](_0x7dcb('0xf'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x10')]);router[_0x7dcb('0x11')]('/',auth[_0x7dcb('0x8')](),controller['create']);router[_0x7dcb('0x11')](_0x7dcb('0x12'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x13')]);router[_0x7dcb('0x11')](_0x7dcb('0xf'),auth['isAuthenticated'](),controller[_0x7dcb('0x14')]);router[_0x7dcb('0x15')](_0x7dcb('0xc'),auth['isAuthenticated'](),controller[_0x7dcb('0x16')]);router[_0x7dcb('0x17')]('/:id',auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x18')]);router[_0x7dcb('0x17')](_0x7dcb('0x12'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x19')]);module[_0x7dcb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index b7402d1..59511dc 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 _0xd3b6=['BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','exports'];(function(_0x4c5b52,_0x1a945a){var _0x24fce3=function(_0x5be371){while(--_0x5be371){_0x4c5b52['push'](_0x4c5b52['shift']());}};_0x24fce3(++_0x1a945a);}(_0xd3b6,0x136));var _0x6d3b=function(_0x34126c,_0x25b6e0){_0x34126c=_0x34126c-0x0;var _0x5c3852=_0xd3b6[_0x34126c];return _0x5c3852;};'use strict';var Sequelize=require(_0x6d3b('0x0'));module[_0x6d3b('0x1')]={'closed':{'type':Sequelize[_0x6d3b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6d3b('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x6d3b('0x4'),_0x6d3b('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x6d3b('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6d3b('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6d3b('0x8')]},'disposition':{'type':Sequelize[_0x6d3b('0x7')]},'secondDisposition':{'type':Sequelize[_0x6d3b('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6d3b('0x7')]},'browserName':{'type':Sequelize[_0x6d3b('0x7')]},'browserVersion':{'type':Sequelize[_0x6d3b('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x6d3b('0x7')]},'deviceVendor':{'type':Sequelize[_0x6d3b('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6d3b('0x6')]},'customerIp':{'type':Sequelize[_0x6d3b('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x6d3b('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6d3b('0xa')]('in',_0x6d3b('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x6d3b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x6d3b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x6d3b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x274a=['BOOLEAN','ENUM','star','TEXT','STRING','DATE','long','out','exports'];(function(_0x57041d,_0x3c34ad){var _0x5c5372=function(_0x248f05){while(--_0x248f05){_0x57041d['push'](_0x57041d['shift']());}};_0x5c5372(++_0x3c34ad);}(_0x274a,0x1ca));var _0xa274=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x274a[_0x264b9b];return _0x4c7a0e;};'use strict';var Sequelize=require('sequelize');module[_0xa274('0x0')]={'closed':{'type':Sequelize[_0xa274('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa274('0x2')](_0xa274('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xa274('0x4')]},'pathTranscript':{'type':Sequelize[_0xa274('0x4')]},'mailTranscript':{'type':Sequelize[_0xa274('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa274('0x6')]},'disposition':{'type':Sequelize[_0xa274('0x5')]},'secondDisposition':{'type':Sequelize[_0xa274('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa274('0x5')]},'browserName':{'type':Sequelize[_0xa274('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa274('0x5')]},'deviceModel':{'type':Sequelize[_0xa274('0x5')]},'deviceVendor':{'type':Sequelize[_0xa274('0x5')]},'deviceType':{'type':Sequelize[_0xa274('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa274('0x5')]},'formData':{'type':Sequelize[_0xa274('0x4')](_0xa274('0x7'))},'read1stAt':{'type':Sequelize[_0xa274('0x6')]},'lastMsgAt':{'type':Sequelize[_0xa274('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa274('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa274('0x5')]},'customerPort':{'type':Sequelize[_0xa274('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xa274('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xa274('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a92cb54..740d87e 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 _0xb0ac=['pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','ids','getMessages','length','hasOwnProperty','order','sort','where','filters','pick','ChatInteractionId','filter','map','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','includeAgent','push','include','addTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','toString','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','Owner','mkdirSync','Chat','Account','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','destroy','stack','name','send','render','body','contact','agent','interaction','account','index','ChatInteraction','rawAttributes','type','key','getOptions','findAll','chat','query','user','show','params','keys','intersection','model','attributes','fields','includeAll','merge','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','follow','isNull','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','file','basename','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','server/files/chat/upload/','format','transcript-%s.txt','now'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xb0ac,0x12c));var _0xcb0a=function(_0x20fdfb,_0x3e2839){_0x20fdfb=_0x20fdfb-0x0;var _0x3e7a2b=_0xb0ac[_0x20fdfb];return _0x3e7a2b;};'use strict';var rimraf=require(_0xcb0a('0x0'));var zipdir=require('zip-dir');var rp=require(_0xcb0a('0x1'));var moment=require(_0xcb0a('0x2'));var BPromise=require(_0xcb0a('0x3'));var Mustache=require(_0xcb0a('0x4'));var util=require('util');var path=require(_0xcb0a('0x5'));var ejs=require(_0xcb0a('0x6'));var fs=require('fs');var _=require(_0xcb0a('0x7'));var Redis=require(_0xcb0a('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xcb0a('0x9'));var pdf=require(_0xcb0a('0xa'));var logger=require(_0xcb0a('0xb'))(_0xcb0a('0xc'));var config=require(_0xcb0a('0xd'));var db=require(_0xcb0a('0xe'))['db'];config[_0xcb0a('0xf')]=_[_0xcb0a('0x10')](config[_0xcb0a('0xf')],{'host':_0xcb0a('0x11'),'port':0x18eb});var socket=require(_0xcb0a('0x12'))(new Redis(config[_0xcb0a('0xf')]));require('./chatInteraction.socket')[_0xcb0a('0x13')](socket);var jayson=require(_0xcb0a('0x14'));var client=jayson[_0xcb0a('0x15')][_0xcb0a('0x16')]({'port':0x232b});var client9004=jayson[_0xcb0a('0x15')][_0xcb0a('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x5653ac,_0x46f890,_0x5a9d65,_0x24d13b){return new BPromise(function(_0x1dcb9e,_0x55d1c9){var _0x37cc0b=_0x24d13b||client;return _0x37cc0b[_0xcb0a('0x17')](_0x5653ac,_0x5a9d65)[_0xcb0a('0x18')](function(_0x3f6baf){logger['info'](_0xcb0a('0x19'),_0x46f890,_0xcb0a('0x1a'));logger[_0xcb0a('0x1b')](_0xcb0a('0x1c'),_0x46f890,_0xcb0a('0x1a'),JSON[_0xcb0a('0x1d')](_0x3f6baf));if(_0x3f6baf[_0xcb0a('0x1e')]){if(_0x3f6baf[_0xcb0a('0x1e')]['code']===0x1f4){logger[_0xcb0a('0x1e')](_0xcb0a('0x19'),_0x46f890,_0x3f6baf[_0xcb0a('0x1e')][_0xcb0a('0x1f')]);return _0x55d1c9(_0x3f6baf[_0xcb0a('0x1e')][_0xcb0a('0x1f')]);}logger['error'](_0xcb0a('0x19'),_0x46f890,_0x3f6baf[_0xcb0a('0x1e')]['message']);return _0x1dcb9e(_0x3f6baf[_0xcb0a('0x1e')][_0xcb0a('0x1f')]);}else{logger[_0xcb0a('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x46f890,'request\x20sent');_0x1dcb9e(_0x3f6baf[_0xcb0a('0x21')][_0xcb0a('0x1f')]);}})[_0xcb0a('0x22')](function(_0x43e59e){logger['error'](_0xcb0a('0x19'),_0x46f890,_0x43e59e);_0x55d1c9(_0x43e59e);});});}function respondWithStatusCode(_0x2ee73c,_0x54306f){_0x54306f=_0x54306f||0xcc;return function(_0x13e694){if(_0x13e694){return _0x2ee73c[_0xcb0a('0x23')](_0x54306f);}return _0x2ee73c[_0xcb0a('0x24')](_0x54306f)[_0xcb0a('0x25')]();};}function respondWithResult(_0xd1c59e,_0x4674f7){_0x4674f7=_0x4674f7||0xc8;return function(_0x538bf5){if(_0x538bf5){return _0xd1c59e[_0xcb0a('0x24')](_0x4674f7)[_0xcb0a('0x26')](_0x538bf5);}};}function respondWithFilteredResult(_0x508e75,_0x590350){return function(_0x302807){if(_0x302807){var _0x4956e9=typeof _0x590350['offset']===_0xcb0a('0x27')&&typeof _0x590350['limit']===_0xcb0a('0x27');var _0x4639a3=_0x302807['count'];var _0x125a63=_0x4956e9?0x0:_0x590350[_0xcb0a('0x28')];var _0xa6283e=_0x4956e9?_0x302807[_0xcb0a('0x29')]:_0x590350[_0xcb0a('0x28')]+_0x590350[_0xcb0a('0x2a')];var _0x16f7c8;if(_0xa6283e>=_0x4639a3){_0xa6283e=_0x4639a3;_0x16f7c8=0xc8;}else{_0x16f7c8=0xce;}_0x508e75[_0xcb0a('0x24')](_0x16f7c8);return _0x508e75[_0xcb0a('0x2b')](_0xcb0a('0x2c'),_0x125a63+'-'+_0xa6283e+'/'+_0x4639a3)[_0xcb0a('0x26')](_0x302807);}return null;};}function saveUpdates(_0x1ec3f5){return function(_0xa8487f){if(_0xa8487f){return _0xa8487f[_0xcb0a('0x2d')](_0x1ec3f5)[_0xcb0a('0x18')](function(_0x7a2659){return _0x7a2659;});}return null;};}function removeEntity(_0x2d20de){return function(_0x2bfa0d){if(_0x2bfa0d){return _0x2bfa0d[_0xcb0a('0x2e')]()[_0xcb0a('0x18')](function(){_0x2d20de[_0xcb0a('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a9dd){return function(_0x59d5b4){if(!_0x59d5b4){_0x59a9dd[_0xcb0a('0x23')](0x194);}return _0x59d5b4;};}function handleError(_0x554c3f,_0x4fc43e){_0x4fc43e=_0x4fc43e||0x1f4;return function(_0x26e17b){logger['error'](_0x26e17b[_0xcb0a('0x2f')]);if(_0x26e17b[_0xcb0a('0x30')]){delete _0x26e17b[_0xcb0a('0x30')];}_0x554c3f[_0xcb0a('0x24')](_0x4fc43e)[_0xcb0a('0x31')](_0x26e17b);};}function getMustacheRender(_0x431f0e,_0x42a90e){return Mustache[_0xcb0a('0x32')](_0x431f0e,_['merge'](_0x42a90e[_0xcb0a('0x33')],{'contact':_0x42a90e[_0xcb0a('0x34')],'message':_0x42a90e[_0xcb0a('0x1f')],'agent':_0x42a90e[_0xcb0a('0x35')],'interaction':_0x42a90e[_0xcb0a('0x36')],'account':_0x42a90e[_0xcb0a('0x37')]}))||'';}exports[_0xcb0a('0x38')]=function(_0x5d25b5,_0x329746){var _0x423413={};var _0x1aa7f6=_['map'](db[_0xcb0a('0x39')][_0xcb0a('0x3a')],function(_0xaa5ca4){return{'name':_0xaa5ca4['fieldName'],'type':_0xaa5ca4[_0xcb0a('0x3b')][_0xcb0a('0x3c')]};});_0x423413=qs[_0xcb0a('0x3d')](_0x1aa7f6,_0x5d25b5);return interaction[_0xcb0a('0x3e')](_0xcb0a('0x3f'),_0x5d25b5[_0xcb0a('0x40')],_0x5d25b5[_0xcb0a('0x41')],_0x423413,_0x1aa7f6)[_0xcb0a('0x18')](respondWithFilteredResult(_0x329746,_0x423413))[_0xcb0a('0x22')](handleError(_0x329746,null));};exports[_0xcb0a('0x42')]=function(_0x100c5f,_0x145afb){var _0x292771={'raw':![],'where':{'id':_0x100c5f[_0xcb0a('0x43')]['id']}},_0x1e9b7c={};_0x1e9b7c['model']=_['keys'](db[_0xcb0a('0x39')][_0xcb0a('0x3a')]);_0x1e9b7c[_0xcb0a('0x40')]=_[_0xcb0a('0x44')](_0x100c5f['query']);_0x1e9b7c['filters']=_[_0xcb0a('0x45')](_0x1e9b7c[_0xcb0a('0x46')],_0x1e9b7c['query']);_0x292771[_0xcb0a('0x47')]=_[_0xcb0a('0x45')](_0x1e9b7c[_0xcb0a('0x46')],qs[_0xcb0a('0x48')](_0x100c5f[_0xcb0a('0x40')]['fields']));_0x292771['attributes']=_0x292771['attributes']['length']?_0x292771['attributes']:_0x1e9b7c['model'];if(_0x100c5f['query'][_0xcb0a('0x49')]){_0x292771['include']=[{'all':!![]}];}_0x292771=_[_0xcb0a('0x4a')]({},_0x292771,_0x100c5f[_0xcb0a('0x4b')]);return db[_0xcb0a('0x39')][_0xcb0a('0x4c')](_0x292771)['then'](handleEntityNotFound(_0x145afb,null))[_0xcb0a('0x18')](respondWithResult(_0x145afb,null))[_0xcb0a('0x22')](handleError(_0x145afb,null));};exports[_0xcb0a('0x4d')]=function(_0x3bf934,_0x538cfd){return db[_0xcb0a('0x39')][_0xcb0a('0x4d')](_0x3bf934[_0xcb0a('0x33')],{})[_0xcb0a('0x18')](respondWithResult(_0x538cfd,0xc9))[_0xcb0a('0x22')](handleError(_0x538cfd,null));};exports[_0xcb0a('0x2d')]=function(_0x39a403,_0x2f3e68){if(_0x39a403[_0xcb0a('0x33')]['id']){delete _0x39a403[_0xcb0a('0x33')]['id'];}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x39a403[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x2f3e68,null))['then'](saveUpdates(_0x39a403[_0xcb0a('0x33')],null))['then'](respondWithResult(_0x2f3e68,null))['catch'](handleError(_0x2f3e68,null));};exports[_0xcb0a('0x2e')]=function(_0x11bca7,_0x42bd04){return db['ChatInteraction'][_0xcb0a('0x4c')]({'where':{'id':_0x11bca7[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x42bd04,null))['then'](removeEntity(_0x42bd04,null))['catch'](handleError(_0x42bd04,null));};exports[_0xcb0a('0x4e')]=function(_0x2f7482,_0x44a065){return db[_0xcb0a('0x39')][_0xcb0a('0x4e')]()[_0xcb0a('0x18')](respondWithResult(_0x44a065,null))['catch'](handleError(_0x44a065,null));};exports['createVidaooSession']=function(_0x561abc,_0x12cf60){var _0x1bc01d=_0x561abc['params']['id'];var _0x152b3e;var _0x527e1d;var _0x5c8237;return db[_0xcb0a('0x39')][_0xcb0a('0x4f')]({'where':{'id':_0x1bc01d}})[_0xcb0a('0x18')](function(_0x3c1b0e){_0x152b3e=_0x3c1b0e;return db[_0xcb0a('0x50')][_0xcb0a('0x4f')]({'where':{'id':_0x3c1b0e[_0xcb0a('0x51')]},'attributes':['id',_0xcb0a('0x52'),'vidaooEscalation','vidaooTopic',_0xcb0a('0x53'),_0xcb0a('0x54')],'raw':!![]});})[_0xcb0a('0x18')](function(_0x5ceca9){if(_0x5ceca9&&_0x5ceca9[_0xcb0a('0x52')]&&_0x5ceca9[_0xcb0a('0x55')]){_0x527e1d=_0x5ceca9;var _0x16bf23={'interaction':{'id':_0x1bc01d},'agent':{'id':_0x561abc[_0xcb0a('0x41')]['id'],'name':_0x561abc['user']['name'],'fullname':_0x561abc[_0xcb0a('0x41')]['fullname'],'email':_0x561abc[_0xcb0a('0x41')]['email']},'contact':_0x561abc[_0xcb0a('0x33')][_0xcb0a('0x34')],'account':_0x561abc[_0xcb0a('0x33')][_0xcb0a('0x37')]};var _0x148af1={'rejectUnauthorized':![],'method':_0xcb0a('0x56'),'url':_0xcb0a('0x57'),'headers':{'X-APIKEY':_0x5ceca9[_0xcb0a('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x561abc[_0xcb0a('0x41')][_0xcb0a('0x58')]],'buttons':null,'topic':_0x527e1d[_0xcb0a('0x59')],'note':_['isNull'](_0x527e1d[_0xcb0a('0x53')])?null:getMustacheRender(_0x527e1d[_0xcb0a('0x53')],_0x16bf23),'metadata':null},'redirect':_0xcb0a('0x5a'),'json':!![]};try{if(!_[_0xcb0a('0x5b')](_0x527e1d[_0xcb0a('0x54')])){var _0x3dcb43=getMustacheRender(_0x527e1d['vidaooMetadata'],_0x16bf23);var _0x4b73bd=JSON[_0xcb0a('0x5c')](_0x3dcb43);_0x148af1[_0xcb0a('0x33')]['metadata']=_0x4b73bd;}}catch(_0xff2f92){throw new db[(_0xcb0a('0x5d'))][(_0xcb0a('0x5e'))](_0xcb0a('0x5f'));}return rp(_0x148af1);}else{throw new db[(_0xcb0a('0x5d'))][(_0xcb0a('0x5e'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xcb0a('0x18')](function(_0x44e874){_0x5c8237=_0x44e874;if(_0x5c8237['id']){var _0x8beee4={'body':_0x5c8237['join_url'],'ChatWebsiteId':_0x527e1d['id'],'ChatInteractionId':_0x152b3e['id'],'direction':_0xcb0a('0x60'),'UserId':_0x561abc[_0xcb0a('0x41')]['id']};return db[_0xcb0a('0x61')][_0xcb0a('0x4d')](_0x8beee4,{});}else{throw new db['Sequelize'][(_0xcb0a('0x5e'))](_0xcb0a('0x62'));}})[_0xcb0a('0x18')](function(){return _0x152b3e[_0xcb0a('0x63')]({'vidaooSessionId':_0x5c8237['id']});})[_0xcb0a('0x18')](respondWithResult(_0x12cf60,null))['catch'](handleError(_0x12cf60,null));};exports[_0xcb0a('0x64')]=function(_0x341720,_0x4000b0){if(_0x341720[_0xcb0a('0x33')]['id']){delete _0x341720['body']['id'];}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x341720[_0xcb0a('0x43')]['id']},'include':[{'model':db['CmContact'],'as':_0xcb0a('0x65')}]})[_0xcb0a('0x18')](handleEntityNotFound(_0x4000b0,null))[_0xcb0a('0x18')](saveUpdates(_0x341720[_0xcb0a('0x33')],null))['then'](respondWithResult(_0x4000b0,null))['catch'](handleError(_0x4000b0,null));};exports[_0xcb0a('0x66')]=function(_0x42f465,_0x3f8ccc){if(_0x42f465[_0xcb0a('0x33')]['id']){delete _0x42f465[_0xcb0a('0x33')]['id'];}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x42f465[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](function(_0x49576c){if(!_0x49576c){logger[_0xcb0a('0x1e')](_0xcb0a('0x67'),_0xcb0a('0x66'),0x194,_0xcb0a('0x68'));_0x3f8ccc[_0xcb0a('0x23')](0x194);}else{if(_0x49576c[_0xcb0a('0x69')]){throw new db[(_0xcb0a('0x5d'))][(_0xcb0a('0x5e'))]('Interaction\x20already\x20assigned');}}return _0x49576c;})['then'](function(_0x413ab0){if(_0x413ab0){return _0x413ab0[_0xcb0a('0x2d')]({'closed':_0x42f465['body'][_0xcb0a('0x6a')],'disposition':_0x42f465[_0xcb0a('0x33')][_0xcb0a('0x6b')]})[_0xcb0a('0x18')](function(_0x37ad3b){return _0x37ad3b;});}})[_0xcb0a('0x18')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x42f465[_0xcb0a('0x33')],client9004);})[_0xcb0a('0x18')](respondWithResult(_0x3f8ccc,null))[_0xcb0a('0x22')](handleError(_0x3f8ccc,null));};exports['attachmentUpload']=function(_0x58c981,_0x45a9d0){_0x58c981[_0xcb0a('0x33')][_0xcb0a('0x30')]=_0x58c981[_0xcb0a('0x6c')]['originalname'];_0x58c981[_0xcb0a('0x33')][_0xcb0a('0x6d')]=_0x58c981[_0xcb0a('0x6c')]['filename'];_0x58c981[_0xcb0a('0x33')]['type']=_0x58c981['file'][_0xcb0a('0x6e')];return db[_0xcb0a('0x6f')][_0xcb0a('0x4d')](_0x58c981['body'])[_0xcb0a('0x18')](respondWithResult(_0x45a9d0,0xc9))[_0xcb0a('0x22')](handleError(_0x45a9d0,null));};exports[_0xcb0a('0x70')]=function(_0x2402f7,_0x196242){return db[_0xcb0a('0x39')]['findOne']({'where':{'id':_0x2402f7['params']['id']},'raw':!![]})[_0xcb0a('0x18')](handleEntityNotFound(_0x196242,null))[_0xcb0a('0x18')](function(_0x364431){if(_0x364431){if(_0x364431[_0xcb0a('0x6a')]){return _0x196242[_0xcb0a('0x24')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xcb0a('0x6f')][_0xcb0a('0x4f')]({'where':{'id':_0x2402f7[_0xcb0a('0x40')]['attachId']},'raw':!![]})[_0xcb0a('0x18')](handleEntityNotFound(_0x196242,null));}})[_0xcb0a('0x18')](function(_0x5db9e6){if(_0x5db9e6){var _0x2c21d6=_0x5db9e6[_0xcb0a('0x71')]!==null;var _0x2205b8=path['join'](config[_0xcb0a('0x72')],_0xcb0a('0x73'));if(_0x2c21d6){_0x2205b8=path['join'](_0x2205b8,_0xcb0a('0x74'));}var _0x4a90a9=path[_0xcb0a('0x75')](_0x2205b8,_0x5db9e6[_0xcb0a('0x6d')]);return _0x196242[_0xcb0a('0x76')](_0x4a90a9);}})[_0xcb0a('0x22')](handleError(_0x196242,null));};exports[_0xcb0a('0x77')]=function(_0x674d20,_0x3b4d17){var _0xe4cbcb=null;var _0x18df8f=null;var _0x36d222=null;if(_0x674d20[_0xcb0a('0x33')]['id']){delete _0x674d20[_0xcb0a('0x33')]['id'];}if(_0x674d20[_0xcb0a('0x33')]['mailTranscript']){_0x36d222=path[_0xcb0a('0x75')](config[_0xcb0a('0x72')],_0xcb0a('0x78'),util[_0xcb0a('0x79')](_0xcb0a('0x7a'),Date[_0xcb0a('0x7b')]()));_0x674d20[_0xcb0a('0x33')][_0xcb0a('0x7c')]=_0x36d222;}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x674d20['params']['id']},'include':[{'model':db[_0xcb0a('0x61')],'as':_0xcb0a('0x7d'),'include':[{'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0x7e')}]}]})[_0xcb0a('0x18')](handleEntityNotFound(_0x3b4d17,null))[_0xcb0a('0x18')](saveUpdates(_0x674d20['body'],null))[_0xcb0a('0x18')](function(_0x30e049){if(_0x30e049){_0xe4cbcb=_0x30e049;return db[_0xcb0a('0x50')][_0xcb0a('0x4c')]({'where':{'id':_0xe4cbcb['ChatWebsiteId']}});}})[_0xcb0a('0x18')](function(_0x85b249){if(_0x85b249){_0x18df8f=_0x85b249;return db[_0xcb0a('0x7f')][_0xcb0a('0x4c')]({'where':{'id':_0xe4cbcb[_0xcb0a('0x80')]}});}})['then'](function(_0x426730){if(_0x426730){if(_0x36d222){var _0x10279a=null;for(var _0x519ffd=0x1;_0x519ffd<_0xe4cbcb[_0xcb0a('0x7d')]['length'];++_0x519ffd){_0x10279a=_0xe4cbcb[_0xcb0a('0x7d')][_0x519ffd];var _0x3924fe=_0x10279a['UserId']?util[_0xcb0a('0x79')](_0xcb0a('0x81'),_0x18df8f[_0xcb0a('0x82')],_0x10279a[_0xcb0a('0x69')]):_0xcb0a('0x83');var _0x10a84d=_0x674d20['body'][_0xcb0a('0x84')]||util[_0xcb0a('0x79')](_0xcb0a('0x81'),_0xcb0a('0x85'),_0x10279a[_0xcb0a('0x80')]);switch(_0x18df8f[_0xcb0a('0x86')]){case _0xcb0a('0x87'):_0x3924fe=_0x10279a[_0xcb0a('0x69')]?util['format'](_0xcb0a('0x81'),_0x18df8f[_0xcb0a('0x82')],_0x10279a[_0xcb0a('0x69')]):'System';break;case _0xcb0a('0x88'):_0x3924fe=_0x10279a[_0xcb0a('0x69')]?_0x10279a[_0xcb0a('0x7e')]['alias']||_0x10279a['User'][_0xcb0a('0x89')]:'System';break;case'agent_fullname':_0x3924fe=_0x10279a[_0xcb0a('0x69')]?_0x10279a[_0xcb0a('0x7e')][_0xcb0a('0x89')]:_0xcb0a('0x83');break;default:_0x3924fe=_0x10279a['UserId']?util['format']('%s%d',_0x18df8f[_0xcb0a('0x82')],_0x10279a[_0xcb0a('0x69')]):'System';}var _0x46ea5c=util[_0xcb0a('0x79')](_0xcb0a('0x8a'),moment(_0x10279a[_0xcb0a('0x8b')])[_0xcb0a('0x79')](_0xcb0a('0x8c')),_0x10279a[_0xcb0a('0x8d')]==='in'?_0x10a84d:_0x3924fe,_0x10279a[_0xcb0a('0x33')]);if(!_0x10279a[_0xcb0a('0x8e')]){fs[_0xcb0a('0x8f')](_0x36d222,_0x46ea5c);}}return db[_0xcb0a('0x90')][_0xcb0a('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0xcb0a('0x91')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xcb0a('0x92')],'as':_0xcb0a('0x92'),'raw':!![]}]}]});}}})[_0xcb0a('0x18')](function(_0x106e01){if(!_0x106e01||!_0x106e01[_0xcb0a('0x93')]||!_0x674d20[_0xcb0a('0x33')])return _0xe4cbcb;var _0x5e43aa=_0x106e01[_0xcb0a('0x94')]();return respondWithRpcPromise(_0xcb0a('0x95'),'sendMail',{'account':_0x5e43aa,'message':{'from':util[_0xcb0a('0x79')](_0xcb0a('0x96'),_0x106e01[_0xcb0a('0x30')],_0x106e01[_0xcb0a('0x58')]||_0x106e01[_0xcb0a('0x93')]['user']),'to':_0x674d20['body'][_0xcb0a('0x97')],'subject':_0xcb0a('0x98'),'text':util[_0xcb0a('0x79')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x674d20[_0xcb0a('0x33')][_0xcb0a('0x97')]),'attachments':[{'path':_0x36d222}]}})[_0xcb0a('0x18')](function(){return _0xe4cbcb;})[_0xcb0a('0x22')](function(_0x21cab7){logger['error'](_0x21cab7);});})['then'](respondWithStatusCode(_0x3b4d17,0xc8))[_0xcb0a('0x22')](handleError(_0x3b4d17,null));};exports[_0xcb0a('0x99')]=function(_0x785847,_0x589003){return db[_0xcb0a('0x61')][_0xcb0a('0x4c')]({'where':{'id':_0x785847['params']['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x589003,null))[_0xcb0a('0x18')](function(_0x212a87){if(_0x212a87){return _0x212a87[_0xcb0a('0x99')](_0x785847[_0xcb0a('0x33')]['ids'],_['omit'](_0x785847[_0xcb0a('0x33')],[_0xcb0a('0x9a'),'id'])||{});}})[_0xcb0a('0x18')](respondWithResult(_0x589003,null))['catch'](handleError(_0x589003,null));};exports[_0xcb0a('0x9b')]=function(_0x58a0f0,_0x16e99b){var _0x2ec876={'raw':![],'where':{}};var _0x4d4716={};var _0x45a042={'count':0x0,'rows':[]};return db[_0xcb0a('0x39')][_0xcb0a('0x4f')]({'where':{'id':_0x58a0f0[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x16e99b,null))[_0xcb0a('0x18')](function(_0x356c04){if(_0x356c04){_0x4d4716[_0xcb0a('0x46')]=_[_0xcb0a('0x44')](db[_0xcb0a('0x61')][_0xcb0a('0x3a')]);_0x4d4716['query']=_[_0xcb0a('0x44')](_0x58a0f0[_0xcb0a('0x40')]);_0x4d4716['filters']=_[_0xcb0a('0x45')](_0x4d4716[_0xcb0a('0x46')],_0x4d4716[_0xcb0a('0x40')]);_0x2ec876[_0xcb0a('0x47')]=_[_0xcb0a('0x45')](_0x4d4716['model'],qs[_0xcb0a('0x48')](_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0x48')]));_0x2ec876[_0xcb0a('0x47')]=_0x2ec876['attributes'][_0xcb0a('0x9c')]?_0x2ec876[_0xcb0a('0x47')]:_0x4d4716['model'];if(!_0x58a0f0['query'][_0xcb0a('0x9d')]('nolimit')){_0x2ec876[_0xcb0a('0x2a')]=qs[_0xcb0a('0x2a')](_0x58a0f0['query'][_0xcb0a('0x2a')]);_0x2ec876[_0xcb0a('0x28')]=qs['offset'](_0x58a0f0['query'][_0xcb0a('0x28')]);}_0x2ec876[_0xcb0a('0x9e')]=qs[_0xcb0a('0x9f')](_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0x9f')]);_0x2ec876[_0xcb0a('0xa0')]=qs[_0xcb0a('0xa1')](_[_0xcb0a('0xa2')](_0x58a0f0[_0xcb0a('0x40')],_0x4d4716['filters']));_0x2ec876[_0xcb0a('0xa0')][_0xcb0a('0xa3')]=_0x356c04['id'];if(_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0xa4')]){_0x2ec876[_0xcb0a('0xa0')]=_['merge'](_0x2ec876[_0xcb0a('0xa0')],{'$or':_[_0xcb0a('0xa5')](_0x2ec876['attributes'],function(_0x5aa244){var _0x42e001={};_0x42e001[_0x5aa244]={'$like':'%'+_0x58a0f0['query'][_0xcb0a('0xa4')]+'%'};return _0x42e001;})});}if(_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0xa6')]){var _0x3b5e10=_0x58a0f0[_0xcb0a('0x40')]['$gte']['split'](',');var _0x588478={};_0x588478[_0x3b5e10[0x0]]={'$gte':moment(_0x3b5e10[0x1])[_0xcb0a('0x79')](_0xcb0a('0xa7'))};_0x2ec876[_0xcb0a('0xa0')]=_[_0xcb0a('0x4a')](_0x2ec876[_0xcb0a('0xa0')],_0x588478);}_0x2ec876=_[_0xcb0a('0x4a')]({},_0x2ec876,_0x58a0f0[_0xcb0a('0x4b')]);return db[_0xcb0a('0x61')][_0xcb0a('0x29')]({'where':_0x2ec876[_0xcb0a('0xa0')]})[_0xcb0a('0x18')](function(_0x2ce46f){_0x45a042[_0xcb0a('0x29')]=_0x2ce46f;if(_0x58a0f0[_0xcb0a('0x40')]['includeAll']){_0x2ec876['include']=[{'all':!![]}];}return db[_0xcb0a('0x61')][_0xcb0a('0x3e')](_0x2ec876);})['then'](function(_0x190daf){_0x45a042[_0xcb0a('0xa8')]=_0x190daf;return _0x45a042;});}})[_0xcb0a('0x18')](respondWithFilteredResult(_0x16e99b,_0x2ec876))[_0xcb0a('0x22')](handleError(_0x16e99b,null));};exports[_0xcb0a('0xa9')]=function(_0x22c589,_0x1cb38c){var _0x3c45f9={'where':{}},_0x599bb1={},_0x261699={'count':0x0,'rows':[]};return db[_0xcb0a('0x39')][_0xcb0a('0x4f')]({'where':{'id':_0x22c589[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x1cb38c,null))[_0xcb0a('0x18')](function(_0x51329e){if(_0x51329e){_0x599bb1[_0xcb0a('0x46')]=_[_0xcb0a('0x44')](db['ChatMessage'][_0xcb0a('0x3a')]);_0x599bb1[_0xcb0a('0x40')]=_['keys'](_0x22c589[_0xcb0a('0x40')]);_0x599bb1[_0xcb0a('0xa1')]=_[_0xcb0a('0x45')](_0x599bb1['model'],_0x599bb1[_0xcb0a('0x40')]);_0x3c45f9[_0xcb0a('0x47')]=_['intersection'](_0x599bb1[_0xcb0a('0x46')],qs[_0xcb0a('0x48')](_0x22c589[_0xcb0a('0x40')]['fields']));_0x3c45f9[_0xcb0a('0x47')]=_0x3c45f9[_0xcb0a('0x47')]['length']?_0x3c45f9[_0xcb0a('0x47')]:_0x599bb1[_0xcb0a('0x46')];if(!_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x9d')](_0xcb0a('0xaa'))){_0x3c45f9[_0xcb0a('0x2a')]=qs[_0xcb0a('0x2a')](_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x2a')]);_0x3c45f9[_0xcb0a('0x28')]=qs[_0xcb0a('0x28')](_0x22c589[_0xcb0a('0x40')]['offset']);}_0x3c45f9['order']=qs[_0xcb0a('0x9f')](_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x9f')]);_0x3c45f9[_0xcb0a('0xa0')]=qs[_0xcb0a('0xa1')](_[_0xcb0a('0xa2')](_0x22c589[_0xcb0a('0x40')],_0x599bb1['filters']));_0x3c45f9['where'][_0xcb0a('0xa3')]=_0x51329e['id'];if(_0x22c589['query']['filter']){_0x3c45f9['where']=_[_0xcb0a('0x4a')](_0x3c45f9[_0xcb0a('0xa0')],{'$or':_[_0xcb0a('0xa5')](_0x3c45f9['attributes'],function(_0x55b695){var _0x440a3d={};_0x440a3d[_0x55b695]={'$like':'%'+_0x22c589[_0xcb0a('0x40')][_0xcb0a('0xa4')]+'%'};return _0x440a3d;})});}_0x3c45f9[_0xcb0a('0xa0')][_0xcb0a('0x8e')]=![];if(_0x22c589[_0xcb0a('0x40')]['id']){_0x3c45f9['where']['id']={'$gt':_0x22c589[_0xcb0a('0x40')]['id']};}_0x3c45f9=_['merge']({},_0x3c45f9,_0x22c589[_0xcb0a('0x4b')]);return db[_0xcb0a('0x61')][_0xcb0a('0x29')]({'where':_0x3c45f9[_0xcb0a('0xa0')]})[_0xcb0a('0x18')](function(_0x11854d){_0x261699[_0xcb0a('0x29')]=_0x11854d;_0x3c45f9['include']=[];if(_0x22c589[_0xcb0a('0x40')][_0xcb0a('0xab')]){_0x3c45f9['include'][_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0x7e'),'attributes':['id','fullname','alias']});}if(_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x49')]){_0x3c45f9[_0xcb0a('0xad')]=[{'all':!![]}];}return db[_0xcb0a('0x61')]['findAll'](_0x3c45f9);})[_0xcb0a('0x18')](function(_0x4d37bf){_0x261699[_0xcb0a('0xa8')]=_0x4d37bf;return _0x261699;});}})['then'](respondWithFilteredResult(_0x1cb38c,_0x3c45f9))[_0xcb0a('0x22')](handleError(_0x1cb38c,null));};exports[_0xcb0a('0xae')]=function(_0x42416a,_0x11f547){return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x42416a[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x11f547,null))[_0xcb0a('0x18')](function(_0xa42248){if(_0xa42248){return _0xa42248['setTags'](_0x42416a[_0xcb0a('0x33')][_0xcb0a('0x9a')],_[_0xcb0a('0xaf')](_0x42416a[_0xcb0a('0x33')],['ids','id'])||{})[_0xcb0a('0xb0')](function(){return db[_0xcb0a('0xb1')][_0xcb0a('0x3e')]({'attributes':['id',_0xcb0a('0x30'),_0xcb0a('0xb2')],'where':{'id':_0x42416a[_0xcb0a('0x33')][_0xcb0a('0x9a')]}});})[_0xcb0a('0x18')](function(_0x8eebaf){socket[_0xcb0a('0xb3')](_0xcb0a('0xb4'),{'id':Number(_0x42416a[_0xcb0a('0x43')]['id']),'tags':_0x8eebaf||[]});return{'id':Number(_0x42416a[_0xcb0a('0x43')]['id']),'tags':_0x8eebaf||[]};});}})[_0xcb0a('0x18')](respondWithResult(_0x11f547,null))[_0xcb0a('0x22')](handleError(_0x11f547,null));};exports[_0xcb0a('0xb5')]=function(_0xd747e9,_0x5f4905){return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0xd747e9['params']['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x5f4905,null))[_0xcb0a('0x18')](function(_0x1844fa){if(_0x1844fa){return _0x1844fa[_0xcb0a('0xb5')](_0xd747e9['query'][_0xcb0a('0x9a')]);}})['then'](respondWithStatusCode(_0x5f4905,null))['catch'](handleError(_0x5f4905,null));};exports[_0xcb0a('0x76')]=function(_0x1873b8,_0x2df513){var _0x3be652=moment()['unix']()[_0xcb0a('0xb6')]();var _0x3aab83=path[_0xcb0a('0x75')](config[_0xcb0a('0x72')],'server',_0xcb0a('0xb7'),_0xcb0a('0xb8'));var _0x4c6a7c=path[_0xcb0a('0x75')](config[_0xcb0a('0x72')],_0xcb0a('0xb9'),'files',_0xcb0a('0xba'));var _0xfc2c45=path[_0xcb0a('0x75')](_0x3aab83,_0x3be652);var _0x264535=util[_0xcb0a('0x79')](_0xcb0a('0xbb'),_0x1873b8[_0xcb0a('0x43')]['id'],_0x3be652);var _0x1ca39a=path['join'](_0x3aab83,_0x264535);var _0x4c459c=[];_0x4c459c[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0x7e'),'attributes':['id',_0xcb0a('0x89')],'raw':!![]});_0x4c459c[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7f')],'as':_0xcb0a('0x65'),'attributes':['id',_0xcb0a('0xbc'),_0xcb0a('0xbd')],'raw':!![]});if(_0x1873b8[_0xcb0a('0x40')][_0xcb0a('0xba')]){_0x4c459c[_0xcb0a('0xac')]({'model':db['Attachment'],'as':_0xcb0a('0x6f'),'raw':!![]});}var _0x597a27=[{'model':db[_0xcb0a('0x61')],'as':_0xcb0a('0x7d'),'attributes':['id',_0xcb0a('0x33'),_0xcb0a('0x8b'),_0xcb0a('0x8d'),_0xcb0a('0x8e'),_0xcb0a('0xbe')],'include':_0x4c459c}];_0x597a27[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x50')],'as':'Account','attributes':['id',_0xcb0a('0x30')]});_0x597a27[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0xbf'),'attributes':['id',_0xcb0a('0x89')]});return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x1873b8[_0xcb0a('0x43')]['id']},'include':_0x597a27})[_0xcb0a('0x18')](handleEntityNotFound(_0x2df513,null))[_0xcb0a('0x18')](function(_0x48c42e){if(_0x48c42e){var _0x55bdce=_0x48c42e['get']({'plain':!![]});fs[_0xcb0a('0xc0')](_0xfc2c45);var _0x3d8515={'channel':_0xcb0a('0xc1'),'account':_0x55bdce[_0xcb0a('0xc2')][_0xcb0a('0x30')],'agent':_0x55bdce[_0xcb0a('0xbf')]?_0x55bdce[_0xcb0a('0xbf')][_0xcb0a('0x89')]:_0xcb0a('0xc3'),'createdAt':moment(_0x55bdce['createdAt'])[_0xcb0a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcb0a('0xb6')](),'closedAt':_0x55bdce['closed']?moment(_0x55bdce['closedAt'])[_0xcb0a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcb0a('0xb6')]():'','disposition':_0x55bdce[_0xcb0a('0x6b')],'chatInfo':{'browser':_0x55bdce[_0xcb0a('0xc4')],'os':_0x55bdce[_0xcb0a('0xc5')],'referer':_0x55bdce[_0xcb0a('0xc6')],'customerIp':_0x55bdce[_0xcb0a('0xc7')],'customerPort':_0x55bdce[_0xcb0a('0xc8')]?_0x55bdce['customerPort']:_0xcb0a('0xc3')},'messages':_(_0x55bdce['Messages'])[_0xcb0a('0xc9')]()['filter']({'secret':![]})['map'](function(_0x13e174){if(_0x13e174[_0xcb0a('0x6f')]){var _0x2e05f3=path[_0xcb0a('0x75')](_0x4c6a7c,_0x13e174[_0xcb0a('0x6f')][_0xcb0a('0x6d')]);if(fs[_0xcb0a('0xca')](_0x2e05f3)){fs['createReadStream'](_0x2e05f3)[_0xcb0a('0xcb')](fs[_0xcb0a('0xcc')](path[_0xcb0a('0x75')](_0xfc2c45,_0x13e174[_0xcb0a('0x6f')][_0xcb0a('0x6d')])));}}return{'date':moment(_0x13e174[_0xcb0a('0x8b')])[_0xcb0a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x13e174['direction']===_0xcb0a('0x60')?_0x13e174[_0xcb0a('0x7e')]?_0x13e174[_0xcb0a('0x7e')]['fullname']:_0xcb0a('0x83'):_0x13e174['Contact'][_0xcb0a('0xbc')]+(_0x13e174[_0xcb0a('0x65')][_0xcb0a('0xbd')]?'\x20'+_0x13e174['Contact'][_0xcb0a('0xbd')]:''),'body':_0x13e174[_0xcb0a('0x6f')]?_0x13e174[_0xcb0a('0x6f')][_0xcb0a('0x6d')]:_0x13e174[_0xcb0a('0x33')],'direction':_0x13e174[_0xcb0a('0x8d')]===_0xcb0a('0x60')?'A':'C','secret':_0x13e174['secret'],'read':_0x13e174[_0xcb0a('0xbe')],'attachment':_0x13e174[_0xcb0a('0x6f')]};})['value']()};return ejs[_0xcb0a('0xcd')](path[_0xcb0a('0x75')](config['root'],_0xcb0a('0xb9'),_0xcb0a('0xce'),_0xcb0a('0xcf')),{'interaction':_0x3d8515})[_0xcb0a('0x18')](function(_0x454233){var _0x17cdcd=path[_0xcb0a('0x75')](_0xfc2c45,_0xcb0a('0xd0')+_0x55bdce['id']+'-'+_0x3be652+_0xcb0a('0xd1'));var _0x4c546d={'path':_0x17cdcd,'channel':_0xcb0a('0xc1'),'interactionId':_0x55bdce['id']};return pdf[_0xcb0a('0xd2')](_0x454233,_0x4c546d);})['then'](function(){return new Promise(function(_0x595aba,_0x3e7c08){zipdir(_0xfc2c45,{'saveTo':_0x1ca39a},function(_0x55256e,_0x31495a){if(_0x55256e)return _0x3e7c08(_0x55256e);return _0x595aba(_0x31495a);});})['then'](function(){return new BPromise(function(_0xc0338f,_0x1fad0d){rimraf(_0xfc2c45,function(_0x12b8e7){if(_0x12b8e7)_0x1fad0d(_0x12b8e7);return _0xc0338f();});});})[_0xcb0a('0x18')](function(){return _0x2df513[_0xcb0a('0x76')](_0x1ca39a,_0x264535,function(_0x454d68){if(_0x454d68){logger['error']('err',_0x454d68);}else{fs[_0xcb0a('0xd3')](_0x1ca39a);}});});});}else{return _0x2df513[_0xcb0a('0x23')](0xc8);}})[_0xcb0a('0x22')](handleError(_0x2df513,null));};
\ No newline at end of file
+var _0xbb9f=['sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','options','includeAgent','push','addTags','setTags','spread','color','emit','chatInteractionTags:save','download','toString','server','files','tmp','attachments','CmContact','firstName','lastName','read','Account','Chat','Owner','N.A.','closedAt','browserName','customerIp','customerPort','existsSync','createReadStream','pipe','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../mysqldb','redis','localhost','register','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','render','merge','body','contact','agent','account','map','ChatInteraction','type','key','getOptions','user','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','describe','createVidaooSession','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','mailTranscript','root','server/files/chat/upload/','format','Messages','User','ChatWebsite','ContactId','%s%d','System','customer','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xbb9f,0x1c7));var _0xfbb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb9f[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xfbb9('0x0'));var zipdir=require(_0xfbb9('0x1'));var rp=require(_0xfbb9('0x2'));var moment=require(_0xfbb9('0x3'));var BPromise=require(_0xfbb9('0x4'));var Mustache=require(_0xfbb9('0x5'));var util=require(_0xfbb9('0x6'));var path=require(_0xfbb9('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfbb9('0x8'));var Redis=require(_0xfbb9('0x9'));var interaction=require(_0xfbb9('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0xfbb9('0xb'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xfbb9('0xc'))['db'];config[_0xfbb9('0xd')]=_['defaults'](config[_0xfbb9('0xd')],{'host':_0xfbb9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbb9('0xd')]));require('./chatInteraction.socket')[_0xfbb9('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfbb9('0x10')][_0xfbb9('0x11')]({'port':0x232b});var client9004=jayson[_0xfbb9('0x10')][_0xfbb9('0x11')]({'port':0x232c});function respondWithRpcPromise(_0xcb9c56,_0x3f6753,_0x251484,_0x3505b2){return new BPromise(function(_0x4d44ef,_0xf3c4bd){var _0x4b65ac=_0x3505b2||client;return _0x4b65ac[_0xfbb9('0x12')](_0xcb9c56,_0x251484)['then'](function(_0x29f3a9){logger['info'](_0xfbb9('0x13'),_0x3f6753,_0xfbb9('0x14'));logger[_0xfbb9('0x15')](_0xfbb9('0x16'),_0x3f6753,_0xfbb9('0x14'),JSON[_0xfbb9('0x17')](_0x29f3a9));if(_0x29f3a9[_0xfbb9('0x18')]){if(_0x29f3a9[_0xfbb9('0x18')][_0xfbb9('0x19')]===0x1f4){logger[_0xfbb9('0x18')](_0xfbb9('0x13'),_0x3f6753,_0x29f3a9['error'][_0xfbb9('0x1a')]);return _0xf3c4bd(_0x29f3a9[_0xfbb9('0x18')]['message']);}logger[_0xfbb9('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x3f6753,_0x29f3a9['error'][_0xfbb9('0x1a')]);return _0x4d44ef(_0x29f3a9[_0xfbb9('0x18')][_0xfbb9('0x1a')]);}else{logger[_0xfbb9('0x1b')](_0xfbb9('0x13'),_0x3f6753,_0xfbb9('0x14'));_0x4d44ef(_0x29f3a9['result'][_0xfbb9('0x1a')]);}})[_0xfbb9('0x1c')](function(_0x15bc33){logger[_0xfbb9('0x18')](_0xfbb9('0x13'),_0x3f6753,_0x15bc33);_0xf3c4bd(_0x15bc33);});});}function respondWithStatusCode(_0x4aec49,_0x13f4df){_0x13f4df=_0x13f4df||0xcc;return function(_0x2ec282){if(_0x2ec282){return _0x4aec49[_0xfbb9('0x1d')](_0x13f4df);}return _0x4aec49[_0xfbb9('0x1e')](_0x13f4df)[_0xfbb9('0x1f')]();};}function respondWithResult(_0x46cc4e,_0x9ac921){_0x9ac921=_0x9ac921||0xc8;return function(_0x3c4b4c){if(_0x3c4b4c){return _0x46cc4e[_0xfbb9('0x1e')](_0x9ac921)[_0xfbb9('0x20')](_0x3c4b4c);}};}function respondWithFilteredResult(_0x48cb8f,_0x47e001){return function(_0x2cd645){if(_0x2cd645){var _0x349742=typeof _0x47e001[_0xfbb9('0x21')]===_0xfbb9('0x22')&&typeof _0x47e001[_0xfbb9('0x23')]===_0xfbb9('0x22');var _0xa9f413=_0x2cd645[_0xfbb9('0x24')];var _0x2862e6=_0x349742?0x0:_0x47e001[_0xfbb9('0x21')];var _0x33afdd=_0x349742?_0x2cd645[_0xfbb9('0x24')]:_0x47e001[_0xfbb9('0x21')]+_0x47e001[_0xfbb9('0x23')];var _0x4fb1a1;if(_0x33afdd>=_0xa9f413){_0x33afdd=_0xa9f413;_0x4fb1a1=0xc8;}else{_0x4fb1a1=0xce;}_0x48cb8f[_0xfbb9('0x1e')](_0x4fb1a1);return _0x48cb8f[_0xfbb9('0x25')](_0xfbb9('0x26'),_0x2862e6+'-'+_0x33afdd+'/'+_0xa9f413)[_0xfbb9('0x20')](_0x2cd645);}return null;};}function saveUpdates(_0x3d99fe){return function(_0x7bfe73){if(_0x7bfe73){return _0x7bfe73[_0xfbb9('0x27')](_0x3d99fe)[_0xfbb9('0x28')](function(_0x2a9ce1){return _0x2a9ce1;});}return null;};}function removeEntity(_0x1183c6){return function(_0x1f9901){if(_0x1f9901){return _0x1f9901[_0xfbb9('0x29')]()[_0xfbb9('0x28')](function(){_0x1183c6[_0xfbb9('0x1e')](0xcc)[_0xfbb9('0x1f')]();});}};}function handleEntityNotFound(_0x30d3cd){return function(_0x3ebb43){if(!_0x3ebb43){_0x30d3cd[_0xfbb9('0x1d')](0x194);}return _0x3ebb43;};}function handleError(_0xf1164e,_0x1ef65b){_0x1ef65b=_0x1ef65b||0x1f4;return function(_0xf49d08){logger[_0xfbb9('0x18')](_0xf49d08[_0xfbb9('0x2a')]);if(_0xf49d08[_0xfbb9('0x2b')]){delete _0xf49d08[_0xfbb9('0x2b')];}_0xf1164e['status'](_0x1ef65b)[_0xfbb9('0x2c')](_0xf49d08);};}function getMustacheRender(_0x486372,_0x3c2da6){return Mustache[_0xfbb9('0x2d')](_0x486372,_[_0xfbb9('0x2e')](_0x3c2da6[_0xfbb9('0x2f')],{'contact':_0x3c2da6[_0xfbb9('0x30')],'message':_0x3c2da6[_0xfbb9('0x1a')],'agent':_0x3c2da6[_0xfbb9('0x31')],'interaction':_0x3c2da6['interaction'],'account':_0x3c2da6[_0xfbb9('0x32')]}))||'';}exports['index']=function(_0x4f2c4b,_0x2188dc){var _0x139689={};var _0x440cd3=_[_0xfbb9('0x33')](db[_0xfbb9('0x34')]['rawAttributes'],function(_0x271a5e){return{'name':_0x271a5e['fieldName'],'type':_0x271a5e[_0xfbb9('0x35')][_0xfbb9('0x36')]};});_0x139689=qs[_0xfbb9('0x37')](_0x440cd3,_0x4f2c4b);return interaction['findAll']('chat',_0x4f2c4b['query'],_0x4f2c4b[_0xfbb9('0x38')],_0x139689,_0x440cd3)[_0xfbb9('0x28')](respondWithFilteredResult(_0x2188dc,_0x139689))[_0xfbb9('0x1c')](handleError(_0x2188dc,null));};exports[_0xfbb9('0x39')]=function(_0x8d9af3,_0x2cd18e){var _0x5b6dc6={'raw':![],'where':{'id':_0x8d9af3[_0xfbb9('0x3a')]['id']}},_0x554e8b={};_0x554e8b[_0xfbb9('0x3b')]=_['keys'](db[_0xfbb9('0x34')][_0xfbb9('0x3c')]);_0x554e8b[_0xfbb9('0x3d')]=_[_0xfbb9('0x3e')](_0x8d9af3['query']);_0x554e8b[_0xfbb9('0x3f')]=_[_0xfbb9('0x40')](_0x554e8b[_0xfbb9('0x3b')],_0x554e8b['query']);_0x5b6dc6[_0xfbb9('0x41')]=_[_0xfbb9('0x40')](_0x554e8b['model'],qs[_0xfbb9('0x42')](_0x8d9af3['query']['fields']));_0x5b6dc6['attributes']=_0x5b6dc6[_0xfbb9('0x41')][_0xfbb9('0x43')]?_0x5b6dc6[_0xfbb9('0x41')]:_0x554e8b['model'];if(_0x8d9af3[_0xfbb9('0x3d')][_0xfbb9('0x44')]){_0x5b6dc6[_0xfbb9('0x45')]=[{'all':!![]}];}_0x5b6dc6=_[_0xfbb9('0x2e')]({},_0x5b6dc6,_0x8d9af3['options']);return db[_0xfbb9('0x34')][_0xfbb9('0x46')](_0x5b6dc6)[_0xfbb9('0x28')](handleEntityNotFound(_0x2cd18e,null))[_0xfbb9('0x28')](respondWithResult(_0x2cd18e,null))['catch'](handleError(_0x2cd18e,null));};exports[_0xfbb9('0x47')]=function(_0x533ae4,_0x377a9b){return db[_0xfbb9('0x34')][_0xfbb9('0x47')](_0x533ae4[_0xfbb9('0x2f')],{})[_0xfbb9('0x28')](respondWithResult(_0x377a9b,0xc9))[_0xfbb9('0x1c')](handleError(_0x377a9b,null));};exports[_0xfbb9('0x27')]=function(_0x5c51e3,_0x880b10){if(_0x5c51e3[_0xfbb9('0x2f')]['id']){delete _0x5c51e3['body']['id'];}return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x5c51e3['params']['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x880b10,null))[_0xfbb9('0x28')](saveUpdates(_0x5c51e3[_0xfbb9('0x2f')],null))['then'](respondWithResult(_0x880b10,null))[_0xfbb9('0x1c')](handleError(_0x880b10,null));};exports[_0xfbb9('0x29')]=function(_0x38d7db,_0x29f113){return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x38d7db[_0xfbb9('0x3a')]['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x29f113,null))['then'](removeEntity(_0x29f113,null))[_0xfbb9('0x1c')](handleError(_0x29f113,null));};exports[_0xfbb9('0x48')]=function(_0x942455,_0x8166d7){return db[_0xfbb9('0x34')][_0xfbb9('0x48')]()[_0xfbb9('0x28')](respondWithResult(_0x8166d7,null))['catch'](handleError(_0x8166d7,null));};exports[_0xfbb9('0x49')]=function(_0x373233,_0x39a177){var _0x776d87=_0x373233[_0xfbb9('0x3a')]['id'];var _0x114811;var _0x12a3ab;var _0x1d843e;return db[_0xfbb9('0x34')]['findOne']({'where':{'id':_0x776d87}})['then'](function(_0x1e5e2c){_0x114811=_0x1e5e2c;return db['ChatWebsite']['findOne']({'where':{'id':_0x1e5e2c[_0xfbb9('0x4a')]},'attributes':['id',_0xfbb9('0x4b'),_0xfbb9('0x4c'),_0xfbb9('0x4d'),'vidaooNote',_0xfbb9('0x4e')],'raw':!![]});})[_0xfbb9('0x28')](function(_0x533d37){if(_0x533d37&&_0x533d37['vidaooApiKey']&&_0x533d37['vidaooEscalation']){_0x12a3ab=_0x533d37;var _0x1de93c={'interaction':{'id':_0x776d87},'agent':{'id':_0x373233[_0xfbb9('0x38')]['id'],'name':_0x373233[_0xfbb9('0x38')][_0xfbb9('0x2b')],'fullname':_0x373233['user'][_0xfbb9('0x4f')],'email':_0x373233['user']['email']},'contact':_0x373233['body'][_0xfbb9('0x30')],'account':_0x373233[_0xfbb9('0x2f')][_0xfbb9('0x32')]};var _0x1f5b71={'rejectUnauthorized':![],'method':'POST','url':_0xfbb9('0x50'),'headers':{'X-APIKEY':_0x533d37['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x373233['user']['email']],'buttons':null,'topic':_0x12a3ab['vidaooTopic'],'note':_[_0xfbb9('0x51')](_0x12a3ab[_0xfbb9('0x52')])?null:getMustacheRender(_0x12a3ab[_0xfbb9('0x52')],_0x1de93c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x12a3ab[_0xfbb9('0x4e')])){var _0x137c61=getMustacheRender(_0x12a3ab['vidaooMetadata'],_0x1de93c);var _0x499eac=JSON[_0xfbb9('0x53')](_0x137c61);_0x1f5b71[_0xfbb9('0x2f')][_0xfbb9('0x54')]=_0x499eac;}}catch(_0x3142f1){throw new db[(_0xfbb9('0x55'))]['ValidationError'](_0xfbb9('0x56'));}return rp(_0x1f5b71);}else{throw new db[(_0xfbb9('0x55'))][(_0xfbb9('0x57'))](_0xfbb9('0x58'));}})['then'](function(_0x53c925){_0x1d843e=_0x53c925;if(_0x1d843e['id']){var _0x1c6fab={'body':_0x1d843e['join_url'],'ChatWebsiteId':_0x12a3ab['id'],'ChatInteractionId':_0x114811['id'],'direction':_0xfbb9('0x59'),'UserId':_0x373233['user']['id']};return db[_0xfbb9('0x5a')]['create'](_0x1c6fab,{});}else{throw new db['Sequelize'][(_0xfbb9('0x57'))](_0xfbb9('0x5b'));}})[_0xfbb9('0x28')](function(){return _0x114811[_0xfbb9('0x5c')]({'vidaooSessionId':_0x1d843e['id']});})[_0xfbb9('0x28')](respondWithResult(_0x39a177,null))[_0xfbb9('0x1c')](handleError(_0x39a177,null));};exports[_0xfbb9('0x5d')]=function(_0x379c46,_0x104dfb){if(_0x379c46[_0xfbb9('0x2f')]['id']){delete _0x379c46['body']['id'];}return db['ChatInteraction'][_0xfbb9('0x46')]({'where':{'id':_0x379c46[_0xfbb9('0x3a')]['id']},'include':[{'model':db['CmContact'],'as':_0xfbb9('0x5e')}]})[_0xfbb9('0x28')](handleEntityNotFound(_0x104dfb,null))[_0xfbb9('0x28')](saveUpdates(_0x379c46['body'],null))[_0xfbb9('0x28')](respondWithResult(_0x104dfb,null))[_0xfbb9('0x1c')](handleError(_0x104dfb,null));};exports[_0xfbb9('0x5f')]=function(_0x37adea,_0x3e5626){if(_0x37adea[_0xfbb9('0x2f')]['id']){delete _0x37adea[_0xfbb9('0x2f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x37adea[_0xfbb9('0x3a')]['id']}})['then'](function(_0x1b5a48){if(!_0x1b5a48){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfbb9('0x5f'),0x194,_0xfbb9('0x60'));_0x3e5626[_0xfbb9('0x1d')](0x194);}else{if(_0x1b5a48[_0xfbb9('0x61')]){throw new db[(_0xfbb9('0x55'))][(_0xfbb9('0x57'))](_0xfbb9('0x62'));}}return _0x1b5a48;})[_0xfbb9('0x28')](function(_0x8f4d90){if(_0x8f4d90){return _0x8f4d90[_0xfbb9('0x27')]({'closed':_0x37adea[_0xfbb9('0x2f')]['closed'],'disposition':_0x37adea[_0xfbb9('0x2f')][_0xfbb9('0x63')]})[_0xfbb9('0x28')](function(_0x207f6f){return _0x207f6f;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0xfbb9('0x5f'),_0x37adea[_0xfbb9('0x2f')],client9004);})['then'](respondWithResult(_0x3e5626,null))[_0xfbb9('0x1c')](handleError(_0x3e5626,null));};exports['attachmentUpload']=function(_0x36bcf0,_0xa565de){_0x36bcf0[_0xfbb9('0x2f')][_0xfbb9('0x2b')]=_0x36bcf0[_0xfbb9('0x64')][_0xfbb9('0x65')];_0x36bcf0[_0xfbb9('0x2f')][_0xfbb9('0x66')]=_0x36bcf0[_0xfbb9('0x64')][_0xfbb9('0x67')];_0x36bcf0[_0xfbb9('0x2f')]['type']=_0x36bcf0['file'][_0xfbb9('0x68')];return db[_0xfbb9('0x69')]['create'](_0x36bcf0[_0xfbb9('0x2f')])[_0xfbb9('0x28')](respondWithResult(_0xa565de,0xc9))[_0xfbb9('0x1c')](handleError(_0xa565de,null));};exports[_0xfbb9('0x6a')]=function(_0x102b50,_0x337c64){return db['ChatInteraction']['findOne']({'where':{'id':_0x102b50['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x337c64,null))[_0xfbb9('0x28')](function(_0x139c7d){if(_0x139c7d){if(_0x139c7d[_0xfbb9('0x6b')]){return _0x337c64[_0xfbb9('0x1e')](0x193)[_0xfbb9('0x20')]({'status':0x193,'message':_0xfbb9('0x6c')});}return db[_0xfbb9('0x69')][_0xfbb9('0x6d')]({'where':{'id':_0x102b50[_0xfbb9('0x3d')][_0xfbb9('0x6e')]},'raw':!![]})[_0xfbb9('0x28')](handleEntityNotFound(_0x337c64,null));}})[_0xfbb9('0x28')](function(_0x26ac6c){if(_0x26ac6c){var _0x2e98c4=_0x26ac6c['ChatOfflineMessageId']!==null;var _0x58c861=path[_0xfbb9('0x6f')](config['root'],_0xfbb9('0x70'));if(_0x2e98c4){_0x58c861=path[_0xfbb9('0x6f')](_0x58c861,_0xfbb9('0x71'));}var _0x335d27=path[_0xfbb9('0x6f')](_0x58c861,_0x26ac6c[_0xfbb9('0x66')]);return _0x337c64['download'](_0x335d27);}})[_0xfbb9('0x1c')](handleError(_0x337c64,null));};exports['close']=function(_0x4b8ef1,_0x13c42f){var _0x11baaa=null;var _0x364128=null;var _0x20d69f=null;if(_0x4b8ef1[_0xfbb9('0x2f')]['id']){delete _0x4b8ef1[_0xfbb9('0x2f')]['id'];}if(_0x4b8ef1['body'][_0xfbb9('0x72')]){_0x20d69f=path['join'](config[_0xfbb9('0x73')],_0xfbb9('0x74'),util[_0xfbb9('0x75')]('transcript-%s.txt',Date['now']()));_0x4b8ef1['body']['pathTranscript']=_0x20d69f;}return db['ChatInteraction'][_0xfbb9('0x46')]({'where':{'id':_0x4b8ef1[_0xfbb9('0x3a')]['id']},'include':[{'model':db[_0xfbb9('0x5a')],'as':_0xfbb9('0x76'),'include':[{'model':db[_0xfbb9('0x77')],'as':'User'}]}]})[_0xfbb9('0x28')](handleEntityNotFound(_0x13c42f,null))['then'](saveUpdates(_0x4b8ef1['body'],null))[_0xfbb9('0x28')](function(_0x2dce65){if(_0x2dce65){_0x11baaa=_0x2dce65;return db[_0xfbb9('0x78')][_0xfbb9('0x46')]({'where':{'id':_0x11baaa[_0xfbb9('0x4a')]}});}})[_0xfbb9('0x28')](function(_0x4e539e){if(_0x4e539e){_0x364128=_0x4e539e;return db['CmContact'][_0xfbb9('0x46')]({'where':{'id':_0x11baaa[_0xfbb9('0x79')]}});}})['then'](function(_0x43efba){if(_0x43efba){if(_0x20d69f){var _0xaabb3f=null;for(var _0x483b9d=0x1;_0x483b9d<_0x11baaa['Messages'][_0xfbb9('0x43')];++_0x483b9d){_0xaabb3f=_0x11baaa['Messages'][_0x483b9d];var _0x57d701=_0xaabb3f[_0xfbb9('0x61')]?util[_0xfbb9('0x75')](_0xfbb9('0x7a'),_0x364128['agentAlias'],_0xaabb3f['UserId']):_0xfbb9('0x7b');var _0x47074d=_0x4b8ef1[_0xfbb9('0x2f')][_0xfbb9('0x7c')]||util[_0xfbb9('0x75')]('%s%d','Visitor',_0xaabb3f[_0xfbb9('0x79')]);switch(_0x364128[_0xfbb9('0x7d')]){case _0xfbb9('0x7e'):_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?util['format'](_0xfbb9('0x7a'),_0x364128[_0xfbb9('0x7f')],_0xaabb3f[_0xfbb9('0x61')]):_0xfbb9('0x7b');break;case _0xfbb9('0x80'):_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?_0xaabb3f['User'][_0xfbb9('0x81')]||_0xaabb3f[_0xfbb9('0x77')][_0xfbb9('0x4f')]:_0xfbb9('0x7b');break;case _0xfbb9('0x82'):_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?_0xaabb3f[_0xfbb9('0x77')][_0xfbb9('0x4f')]:_0xfbb9('0x7b');break;default:_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?util['format'](_0xfbb9('0x7a'),_0x364128['agentAlias'],_0xaabb3f['UserId']):_0xfbb9('0x7b');}var _0x12e6b8=util[_0xfbb9('0x75')](_0xfbb9('0x83'),moment(_0xaabb3f[_0xfbb9('0x84')])[_0xfbb9('0x75')](_0xfbb9('0x85')),_0xaabb3f[_0xfbb9('0x86')]==='in'?_0x47074d:_0x57d701,_0xaabb3f[_0xfbb9('0x2f')]);if(!_0xaabb3f[_0xfbb9('0x87')]){fs[_0xfbb9('0x88')](_0x20d69f,_0x12e6b8);}}return db[_0xfbb9('0x89')][_0xfbb9('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0xfbb9('0x8a')],'as':_0xfbb9('0x8b'),'raw':!![],'include':[{'model':db[_0xfbb9('0x8c')],'as':_0xfbb9('0x8c'),'raw':!![]}]}]});}}})[_0xfbb9('0x28')](function(_0x3b58e3){if(!_0x3b58e3||!_0x3b58e3[_0xfbb9('0x8b')]||!_0x4b8ef1[_0xfbb9('0x2f')])return _0x11baaa;var _0x223d4a=_0x3b58e3[_0xfbb9('0x8d')]();return respondWithRpcPromise(_0xfbb9('0x8e'),_0xfbb9('0x8f'),{'account':_0x223d4a,'message':{'from':util['format'](_0xfbb9('0x90'),_0x3b58e3['name'],_0x3b58e3[_0xfbb9('0x91')]||_0x3b58e3[_0xfbb9('0x8b')][_0xfbb9('0x38')]),'to':_0x4b8ef1[_0xfbb9('0x2f')][_0xfbb9('0x72')],'subject':_0xfbb9('0x92'),'text':util[_0xfbb9('0x75')](_0xfbb9('0x93'),_0x4b8ef1[_0xfbb9('0x2f')]['mailTranscript']),'attachments':[{'path':_0x20d69f}]}})['then'](function(){return _0x11baaa;})['catch'](function(_0x3475d2){logger[_0xfbb9('0x18')](_0x3475d2);});})['then'](respondWithStatusCode(_0x13c42f,0xc8))['catch'](handleError(_0x13c42f,null));};exports[_0xfbb9('0x94')]=function(_0x500578,_0x18cd0e){return db['ChatMessage'][_0xfbb9('0x46')]({'where':{'id':_0x500578[_0xfbb9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x18cd0e,null))[_0xfbb9('0x28')](function(_0x411bd8){if(_0x411bd8){return _0x411bd8[_0xfbb9('0x94')](_0x500578[_0xfbb9('0x2f')][_0xfbb9('0x95')],_[_0xfbb9('0x96')](_0x500578[_0xfbb9('0x2f')],[_0xfbb9('0x95'),'id'])||{});}})[_0xfbb9('0x28')](respondWithResult(_0x18cd0e,null))[_0xfbb9('0x1c')](handleError(_0x18cd0e,null));};exports['getMessages']=function(_0x3efac8,_0x188ce1){var _0x40aada={'raw':![],'where':{}};var _0x362b57={};var _0x680500={'count':0x0,'rows':[]};return db[_0xfbb9('0x34')][_0xfbb9('0x6d')]({'where':{'id':_0x3efac8[_0xfbb9('0x3a')]['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x188ce1,null))[_0xfbb9('0x28')](function(_0x4ed886){if(_0x4ed886){_0x362b57[_0xfbb9('0x3b')]=_[_0xfbb9('0x3e')](db['ChatMessage'][_0xfbb9('0x3c')]);_0x362b57['query']=_[_0xfbb9('0x3e')](_0x3efac8['query']);_0x362b57[_0xfbb9('0x3f')]=_[_0xfbb9('0x40')](_0x362b57[_0xfbb9('0x3b')],_0x362b57[_0xfbb9('0x3d')]);_0x40aada[_0xfbb9('0x41')]=_['intersection'](_0x362b57[_0xfbb9('0x3b')],qs[_0xfbb9('0x42')](_0x3efac8['query'][_0xfbb9('0x42')]));_0x40aada[_0xfbb9('0x41')]=_0x40aada[_0xfbb9('0x41')][_0xfbb9('0x43')]?_0x40aada[_0xfbb9('0x41')]:_0x362b57[_0xfbb9('0x3b')];if(!_0x3efac8['query'][_0xfbb9('0x97')](_0xfbb9('0x98'))){_0x40aada[_0xfbb9('0x23')]=qs[_0xfbb9('0x23')](_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x23')]);_0x40aada[_0xfbb9('0x21')]=qs[_0xfbb9('0x21')](_0x3efac8[_0xfbb9('0x3d')]['offset']);}_0x40aada[_0xfbb9('0x99')]=qs[_0xfbb9('0x9a')](_0x3efac8[_0xfbb9('0x3d')]['sort']);_0x40aada[_0xfbb9('0x9b')]=qs[_0xfbb9('0x3f')](_['pick'](_0x3efac8[_0xfbb9('0x3d')],_0x362b57[_0xfbb9('0x3f')]));_0x40aada[_0xfbb9('0x9b')][_0xfbb9('0x9c')]=_0x4ed886['id'];if(_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9d')]){_0x40aada[_0xfbb9('0x9b')]=_[_0xfbb9('0x2e')](_0x40aada['where'],{'$or':_['map'](_0x40aada[_0xfbb9('0x41')],function(_0x45a37d){var _0x453c74={};_0x453c74[_0x45a37d]={'$like':'%'+_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9d')]+'%'};return _0x453c74;})});}if(_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9e')]){var _0x3500cd=_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9e')][_0xfbb9('0x9f')](',');var _0x3c3104={};_0x3c3104[_0x3500cd[0x0]]={'$gte':moment(_0x3500cd[0x1])[_0xfbb9('0x75')](_0xfbb9('0xa0'))};_0x40aada[_0xfbb9('0x9b')]=_[_0xfbb9('0x2e')](_0x40aada['where'],_0x3c3104);}_0x40aada=_[_0xfbb9('0x2e')]({},_0x40aada,_0x3efac8['options']);return db[_0xfbb9('0x5a')][_0xfbb9('0x24')]({'where':_0x40aada[_0xfbb9('0x9b')]})[_0xfbb9('0x28')](function(_0x5c411c){_0x680500[_0xfbb9('0x24')]=_0x5c411c;if(_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x44')]){_0x40aada['include']=[{'all':!![]}];}return db[_0xfbb9('0x5a')][_0xfbb9('0xa1')](_0x40aada);})['then'](function(_0x708c84){_0x680500[_0xfbb9('0xa2')]=_0x708c84;return _0x680500;});}})[_0xfbb9('0x28')](respondWithFilteredResult(_0x188ce1,_0x40aada))[_0xfbb9('0x1c')](handleError(_0x188ce1,null));};exports[_0xfbb9('0xa3')]=function(_0x1b7a3f,_0x314296){var _0x2a8976={'where':{}},_0x344def={},_0x441631={'count':0x0,'rows':[]};return db[_0xfbb9('0x34')][_0xfbb9('0x6d')]({'where':{'id':_0x1b7a3f[_0xfbb9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x314296,null))[_0xfbb9('0x28')](function(_0x2ffeb7){if(_0x2ffeb7){_0x344def['model']=_['keys'](db[_0xfbb9('0x5a')]['rawAttributes']);_0x344def[_0xfbb9('0x3d')]=_['keys'](_0x1b7a3f['query']);_0x344def[_0xfbb9('0x3f')]=_[_0xfbb9('0x40')](_0x344def[_0xfbb9('0x3b')],_0x344def['query']);_0x2a8976[_0xfbb9('0x41')]=_['intersection'](_0x344def[_0xfbb9('0x3b')],qs[_0xfbb9('0x42')](_0x1b7a3f['query'][_0xfbb9('0x42')]));_0x2a8976[_0xfbb9('0x41')]=_0x2a8976['attributes'][_0xfbb9('0x43')]?_0x2a8976[_0xfbb9('0x41')]:_0x344def[_0xfbb9('0x3b')];if(!_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x97')](_0xfbb9('0x98'))){_0x2a8976[_0xfbb9('0x23')]=qs['limit'](_0x1b7a3f['query']['limit']);_0x2a8976[_0xfbb9('0x21')]=qs[_0xfbb9('0x21')](_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x21')]);}_0x2a8976[_0xfbb9('0x99')]=qs[_0xfbb9('0x9a')](_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x9a')]);_0x2a8976['where']=qs[_0xfbb9('0x3f')](_[_0xfbb9('0xa4')](_0x1b7a3f[_0xfbb9('0x3d')],_0x344def[_0xfbb9('0x3f')]));_0x2a8976[_0xfbb9('0x9b')][_0xfbb9('0x9c')]=_0x2ffeb7['id'];if(_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x9d')]){_0x2a8976[_0xfbb9('0x9b')]=_[_0xfbb9('0x2e')](_0x2a8976[_0xfbb9('0x9b')],{'$or':_[_0xfbb9('0x33')](_0x2a8976[_0xfbb9('0x41')],function(_0x358c57){var _0x20a755={};_0x20a755[_0x358c57]={'$like':'%'+_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x9d')]+'%'};return _0x20a755;})});}_0x2a8976[_0xfbb9('0x9b')][_0xfbb9('0x87')]=![];if(_0x1b7a3f[_0xfbb9('0x3d')]['id']){_0x2a8976['where']['id']={'$gt':_0x1b7a3f['query']['id']};}_0x2a8976=_['merge']({},_0x2a8976,_0x1b7a3f[_0xfbb9('0xa5')]);return db[_0xfbb9('0x5a')][_0xfbb9('0x24')]({'where':_0x2a8976[_0xfbb9('0x9b')]})[_0xfbb9('0x28')](function(_0x28ed93){_0x441631[_0xfbb9('0x24')]=_0x28ed93;_0x2a8976[_0xfbb9('0x45')]=[];if(_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0xa6')]){_0x2a8976['include'][_0xfbb9('0xa7')]({'model':db[_0xfbb9('0x77')],'as':'User','attributes':['id',_0xfbb9('0x4f'),_0xfbb9('0x81')]});}if(_0x1b7a3f['query']['includeAll']){_0x2a8976[_0xfbb9('0x45')]=[{'all':!![]}];}return db[_0xfbb9('0x5a')]['findAll'](_0x2a8976);})['then'](function(_0x14f55e){_0x441631[_0xfbb9('0xa2')]=_0x14f55e;return _0x441631;});}})['then'](respondWithFilteredResult(_0x314296,_0x2a8976))[_0xfbb9('0x1c')](handleError(_0x314296,null));};exports[_0xfbb9('0xa8')]=function(_0x4b76d1,_0x540706){return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x4b76d1[_0xfbb9('0x3a')]['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x540706,null))[_0xfbb9('0x28')](function(_0x877837){if(_0x877837){return _0x877837[_0xfbb9('0xa9')](_0x4b76d1[_0xfbb9('0x2f')][_0xfbb9('0x95')],_['omit'](_0x4b76d1[_0xfbb9('0x2f')],[_0xfbb9('0x95'),'id'])||{})[_0xfbb9('0xaa')](function(){return db['Tag'][_0xfbb9('0xa1')]({'attributes':['id',_0xfbb9('0x2b'),_0xfbb9('0xab')],'where':{'id':_0x4b76d1[_0xfbb9('0x2f')][_0xfbb9('0x95')]}});})[_0xfbb9('0x28')](function(_0x1efde0){socket[_0xfbb9('0xac')](_0xfbb9('0xad'),{'id':Number(_0x4b76d1['params']['id']),'tags':_0x1efde0||[]});return{'id':Number(_0x4b76d1[_0xfbb9('0x3a')]['id']),'tags':_0x1efde0||[]};});}})[_0xfbb9('0x28')](respondWithResult(_0x540706,null))[_0xfbb9('0x1c')](handleError(_0x540706,null));};exports['removeTags']=function(_0x469b24,_0x449e5f){return db[_0xfbb9('0x34')]['find']({'where':{'id':_0x469b24[_0xfbb9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x449e5f,null))['then'](function(_0x1e1332){if(_0x1e1332){return _0x1e1332['removeTags'](_0x469b24[_0xfbb9('0x3d')]['ids']);}})[_0xfbb9('0x28')](respondWithStatusCode(_0x449e5f,null))['catch'](handleError(_0x449e5f,null));};exports[_0xfbb9('0xae')]=function(_0x5d09ba,_0xae875b){var _0x21c908=moment()['unix']()[_0xfbb9('0xaf')]();var _0x4ebb17=path[_0xfbb9('0x6f')](config[_0xfbb9('0x73')],_0xfbb9('0xb0'),_0xfbb9('0xb1'),_0xfbb9('0xb2'));var _0x5c7e0a=path[_0xfbb9('0x6f')](config['root'],_0xfbb9('0xb0'),_0xfbb9('0xb1'),_0xfbb9('0xb3'));var _0x5e11e3=path['join'](_0x4ebb17,_0x21c908);var _0x409a4c=util[_0xfbb9('0x75')]('transcript-%d-%s.zip',_0x5d09ba[_0xfbb9('0x3a')]['id'],_0x21c908);var _0x39c35d=path['join'](_0x4ebb17,_0x409a4c);var _0x36deaf=[];_0x36deaf[_0xfbb9('0xa7')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x36deaf[_0xfbb9('0xa7')]({'model':db[_0xfbb9('0xb4')],'as':'Contact','attributes':['id',_0xfbb9('0xb5'),_0xfbb9('0xb6')],'raw':!![]});if(_0x5d09ba[_0xfbb9('0x3d')]['attachments']){_0x36deaf[_0xfbb9('0xa7')]({'model':db[_0xfbb9('0x69')],'as':_0xfbb9('0x69'),'raw':!![]});}var _0x494da5=[{'model':db['ChatMessage'],'as':_0xfbb9('0x76'),'attributes':['id',_0xfbb9('0x2f'),_0xfbb9('0x84'),_0xfbb9('0x86'),'secret',_0xfbb9('0xb7')],'include':_0x36deaf}];_0x494da5[_0xfbb9('0xa7')]({'model':db['ChatWebsite'],'as':_0xfbb9('0xb8'),'attributes':['id',_0xfbb9('0x2b')]});_0x494da5[_0xfbb9('0xa7')]({'model':db[_0xfbb9('0x77')],'as':'Owner','attributes':['id',_0xfbb9('0x4f')]});return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x5d09ba[_0xfbb9('0x3a')]['id']},'include':_0x494da5})[_0xfbb9('0x28')](handleEntityNotFound(_0xae875b,null))[_0xfbb9('0x28')](function(_0x523051){if(_0x523051){var _0x57141b=_0x523051['get']({'plain':!![]});fs['mkdirSync'](_0x5e11e3);var _0x28fdc2={'channel':_0xfbb9('0xb9'),'account':_0x57141b['Account']['name'],'agent':_0x57141b['Owner']?_0x57141b[_0xfbb9('0xba')]['fullname']:_0xfbb9('0xbb'),'createdAt':moment(_0x57141b['createdAt'])[_0xfbb9('0x75')](_0xfbb9('0xa0'))[_0xfbb9('0xaf')](),'closedAt':_0x57141b[_0xfbb9('0x6b')]?moment(_0x57141b[_0xfbb9('0xbc')])[_0xfbb9('0x75')](_0xfbb9('0xa0'))[_0xfbb9('0xaf')]():'','disposition':_0x57141b[_0xfbb9('0x63')],'chatInfo':{'browser':_0x57141b[_0xfbb9('0xbd')],'os':_0x57141b['osName'],'referer':_0x57141b['referer'],'customerIp':_0x57141b[_0xfbb9('0xbe')],'customerPort':_0x57141b[_0xfbb9('0xbf')]?_0x57141b[_0xfbb9('0xbf')]:'N.A.'},'messages':_(_0x57141b[_0xfbb9('0x76')])['tail']()[_0xfbb9('0x9d')]({'secret':![]})['map'](function(_0x28c870){if(_0x28c870[_0xfbb9('0x69')]){var _0x214696=path[_0xfbb9('0x6f')](_0x5c7e0a,_0x28c870[_0xfbb9('0x69')][_0xfbb9('0x66')]);if(fs[_0xfbb9('0xc0')](_0x214696)){fs[_0xfbb9('0xc1')](_0x214696)[_0xfbb9('0xc2')](fs['createWriteStream'](path['join'](_0x5e11e3,_0x28c870[_0xfbb9('0x69')]['basename'])));}}return{'date':moment(_0x28c870[_0xfbb9('0x84')])[_0xfbb9('0x75')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfbb9('0xaf')](),'sender':_0x28c870['direction']===_0xfbb9('0x59')?_0x28c870['User']?_0x28c870[_0xfbb9('0x77')][_0xfbb9('0x4f')]:_0xfbb9('0x7b'):_0x28c870[_0xfbb9('0x5e')][_0xfbb9('0xb5')]+(_0x28c870[_0xfbb9('0x5e')][_0xfbb9('0xb6')]?'\x20'+_0x28c870[_0xfbb9('0x5e')][_0xfbb9('0xb6')]:''),'body':_0x28c870['Attachment']?_0x28c870[_0xfbb9('0x69')][_0xfbb9('0x66')]:_0x28c870[_0xfbb9('0x2f')],'direction':_0x28c870['direction']===_0xfbb9('0x59')?'A':'C','secret':_0x28c870[_0xfbb9('0x87')],'read':_0x28c870[_0xfbb9('0xb7')],'attachment':_0x28c870[_0xfbb9('0x69')]};})[_0xfbb9('0xc3')]()};return ejs[_0xfbb9('0xc4')](path[_0xfbb9('0x6f')](config['root'],'server',_0xfbb9('0xc5'),_0xfbb9('0xc6')),{'interaction':_0x28fdc2})[_0xfbb9('0x28')](function(_0x811392){var _0x4ae59c=path[_0xfbb9('0x6f')](_0x5e11e3,'transcript-'+_0x57141b['id']+'-'+_0x21c908+_0xfbb9('0xc7'));var _0x399b9a={'path':_0x4ae59c,'channel':'Chat','interactionId':_0x57141b['id']};return pdf[_0xfbb9('0xc8')](_0x811392,_0x399b9a);})['then'](function(){return new Promise(function(_0x4cecde,_0x4a3114){zipdir(_0x5e11e3,{'saveTo':_0x39c35d},function(_0x106737,_0x5dbe3c){if(_0x106737)return _0x4a3114(_0x106737);return _0x4cecde(_0x5dbe3c);});})[_0xfbb9('0x28')](function(){return new BPromise(function(_0x53208e,_0x256f6c){rimraf(_0x5e11e3,function(_0x2dbd34){if(_0x2dbd34)_0x256f6c(_0x2dbd34);return _0x53208e();});});})[_0xfbb9('0x28')](function(){return _0xae875b[_0xfbb9('0xae')](_0x39c35d,_0x409a4c,function(_0x5dd0b2){if(_0x5dd0b2){logger[_0xfbb9('0x18')](_0xfbb9('0xc9'),_0x5dd0b2);}else{fs[_0xfbb9('0xca')](_0x39c35d);}});});});}else{return _0xae875b[_0xfbb9('0x1d')](0xc8);}})['catch'](handleError(_0xae875b,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 959730a..1560322 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 _0x822f=['Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','save','update','remove','then','setDataValue'];(function(_0x406739,_0x2d91cb){var _0x251490=function(_0x39de53){while(--_0x39de53){_0x406739['push'](_0x406739['shift']());}};_0x251490(++_0x2d91cb);}(_0x822f,0x17f));var _0xf822=function(_0x514410,_0x1c7b26){_0x514410=_0x514410-0x0;var _0x2c5ee2=_0x822f[_0x514410];return _0x2c5ee2;};'use strict';var EventEmitter=require(_0xf822('0x0'));var ChatInteraction=require(_0xf822('0x1'))['db'][_0xf822('0x2')];var ChatMessage=require(_0xf822('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf822('0x3'),'afterUpdate':_0xf822('0x4'),'afterDestroy':_0xf822('0x5')};function emitEvent(_0x56bcd0){return function(_0x49b9b7,_0x10a181,_0x385176){_0x49b9b7['getUsers']({'attributes':['id'],'raw':!![]})[_0xf822('0x6')](function(_0x375cc2){_0x49b9b7[_0xf822('0x7')](_0xf822('0x8'),_0x375cc2[_0xf822('0x9')](function(_0x4bcbf3){return{'id':_0x4bcbf3['id']};}));return ChatMessage[_0xf822('0xa')]({'where':{'ChatInteractionId':_0x49b9b7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf822('0x6')](function(_0x8e3f1f){_0x49b9b7[_0xf822('0x7')](_0xf822('0xb'),_0x8e3f1f[_0xf822('0xc')]);ChatInteractionEvents[_0xf822('0xd')](_0x56bcd0+':'+_0x49b9b7['id'],_0x49b9b7);ChatInteractionEvents[_0xf822('0xd')](_0x56bcd0,_0x49b9b7);_0x385176(null);})['catch'](_0x385176(null));};}for(var e in events){if(events[_0xf822('0xe')](e)){var event=events[e];ChatInteraction[_0xf822('0xf')](e,emitEvent(event));}}module[_0xf822('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x5cd4=['then','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll'];(function(_0x474653,_0x223a06){var _0x184990=function(_0x43af56){while(--_0x43af56){_0x474653['push'](_0x474653['shift']());}};_0x184990(++_0x223a06);}(_0x5cd4,0xd3));var _0x45cd=function(_0x7107de,_0x1be6e9){_0x7107de=_0x7107de-0x0;var _0x3b0349=_0x5cd4[_0x7107de];return _0x3b0349;};'use strict';var EventEmitter=require(_0x45cd('0x0'));var ChatInteraction=require(_0x45cd('0x1'))['db'][_0x45cd('0x2')];var ChatMessage=require(_0x45cd('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x45cd('0x3')](0x0);var events={'afterCreate':_0x45cd('0x4'),'afterUpdate':'update','afterDestroy':_0x45cd('0x5')};function emitEvent(_0x2f2774){return function(_0x544c57,_0x22f019,_0x4afaf9){_0x544c57[_0x45cd('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4bc763){_0x544c57[_0x45cd('0x7')](_0x45cd('0x8'),_0x4bc763['map'](function(_0x497a5c){return{'id':_0x497a5c['id']};}));return ChatMessage[_0x45cd('0x9')]({'where':{'ChatInteractionId':_0x544c57['id'],'direction':'in','read':![]},'raw':!![]});})[_0x45cd('0xa')](function(_0x2bbd30){_0x544c57[_0x45cd('0x7')](_0x45cd('0xb'),_0x2bbd30[_0x45cd('0xc')]);ChatInteractionEvents['emit'](_0x2f2774+':'+_0x544c57['id'],_0x544c57);ChatInteractionEvents['emit'](_0x2f2774,_0x544c57);_0x4afaf9(null);})[_0x45cd('0xd')](_0x4afaf9(null));};}for(var e in events){if(events[_0x45cd('0xe')](e)){var event=events[e];ChatInteraction[_0x45cd('0xf')](e,emitEvent(event));}}module[_0x45cd('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index ccc6010..e3119c2 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 _0xdba3=['ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdba3,0x14c));var _0x3dba=function(_0x17986f,_0x3584bc){_0x17986f=_0x17986f-0x0;var _0x25699f=_0xdba3[_0x17986f];return _0x25699f;};'use strict';var _=require(_0x3dba('0x0'));var util=require(_0x3dba('0x1'));var logger=require('../../config/logger')(_0x3dba('0x2'));var moment=require(_0x3dba('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dba('0x4'));var fs=require('fs');var path=require(_0x3dba('0x5'));var rimraf=require(_0x3dba('0x6'));var config=require(_0x3dba('0x7'));var attributes=require(_0x3dba('0x8'));module['exports']=function(_0xe4945d,_0x2e67c6){return _0xe4945d[_0x3dba('0x9')](_0x3dba('0xa'),attributes,{'tableName':_0x3dba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19f649,_0x229f0d,_0x4236c6){if(_0x19f649['changed'](_0x3dba('0xc'))){_0x19f649[_0x3dba('0xd')]=moment()[_0x3dba('0xe')](_0x3dba('0xf'));}_0x4236c6(null,_0x19f649);}},'charset':_0x3dba('0x10'),'collate':_0x3dba('0x11')});};
\ No newline at end of file
+var _0xc9e2=['ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports'];(function(_0x3f3f75,_0x5e215f){var _0x322635=function(_0x1ff524){while(--_0x1ff524){_0x3f3f75['push'](_0x3f3f75['shift']());}};_0x322635(++_0x5e215f);}(_0xc9e2,0xf8));var _0x2c9e=function(_0x45c767,_0x8800d5){_0x45c767=_0x45c767-0x0;var _0x3e1344=_0xc9e2[_0x45c767];return _0x3e1344;};'use strict';var _=require('lodash');var util=require(_0x2c9e('0x0'));var logger=require(_0x2c9e('0x1'))(_0x2c9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2c9e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c9e('0x4'));var config=require(_0x2c9e('0x5'));var attributes=require('./chatInteraction.attributes');module[_0x2c9e('0x6')]=function(_0x14f479,_0x4ecc30){return _0x14f479['define'](_0x2c9e('0x7'),attributes,{'tableName':_0x2c9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5741e5,_0xcea004,_0x4f9d3f){if(_0x5741e5[_0x2c9e('0x9')](_0x2c9e('0xa'))){_0x5741e5[_0x2c9e('0xb')]=moment()[_0x2c9e('0xc')](_0x2c9e('0xd'));}_0x4f9d3f(null,_0x5741e5);}},'charset':_0x2c9e('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e72c7fb..ded7462 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 _0x9880=['spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','attributes','limit','AddTagsToChatInteraction','find','then','addTags','body'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x9880,0x173));var _0x0988=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x9880[_0x483102];return _0x5cc885;};'use strict';var _=require(_0x0988('0x0'));var util=require(_0x0988('0x1'));var moment=require(_0x0988('0x2'));var BPromise=require(_0x0988('0x3'));var rs=require(_0x0988('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0988('0x5'))['db'];var utils=require(_0x0988('0x6'));var logger=require('../../config/logger')(_0x0988('0x7'));var config=require('../../config/environment');var jayson=require(_0x0988('0x8'));var client=jayson[_0x0988('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0988('0xa')](config[_0x0988('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0988('0xc'))(new Redis(config['redis']));require(_0x0988('0xd'))[_0x0988('0xe')](socket);function respondWithRpcPromise(_0x475214,_0x1a0dd8,_0x394d34){return new BPromise(function(_0x259e98,_0x336798){return client[_0x0988('0xf')](_0x475214,_0x394d34)['then'](function(_0x313385){logger[_0x0988('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x1a0dd8,_0x0988('0x11'));logger[_0x0988('0x12')](_0x0988('0x13'),_0x1a0dd8,_0x0988('0x11'),JSON[_0x0988('0x14')](_0x313385));if(_0x313385[_0x0988('0x15')]){if(_0x313385[_0x0988('0x15')][_0x0988('0x16')]===0x1f4){logger[_0x0988('0x15')](_0x0988('0x17'),_0x1a0dd8,_0x313385[_0x0988('0x15')][_0x0988('0x18')]);return _0x336798(_0x313385[_0x0988('0x15')][_0x0988('0x18')]);}logger[_0x0988('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x1a0dd8,_0x313385[_0x0988('0x15')][_0x0988('0x18')]);return _0x259e98(_0x313385[_0x0988('0x15')][_0x0988('0x18')]);}else{logger[_0x0988('0x10')](_0x0988('0x17'),_0x1a0dd8,_0x0988('0x11'));_0x259e98(_0x313385[_0x0988('0x19')]['message']);}})[_0x0988('0x1a')](function(_0x4ae282){logger[_0x0988('0x15')](_0x0988('0x17'),_0x1a0dd8,_0x4ae282);_0x336798(_0x4ae282);});});}exports[_0x0988('0x1b')]=function(_0x5af572){var _0x564a3f=this;return new Promise(function(_0x206c2b,_0x2dc580){return db[_0x0988('0x1c')][_0x0988('0x1d')](_0x5af572['body'],{'raw':_0x5af572['options']?_0x5af572[_0x0988('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5af572[_0x0988('0x1e')]?_0x5af572[_0x0988('0x1e')][_0x0988('0x1f')]||null:null,'attributes':_0x5af572[_0x0988('0x1e')]?_0x5af572['options'][_0x0988('0x20')]||null:null,'limit':_0x5af572[_0x0988('0x1e')]?_0x5af572[_0x0988('0x1e')][_0x0988('0x21')]||null:null})['then'](function(_0x131897){logger[_0x0988('0x10')](_0x0988('0x1b'),_0x5af572);logger[_0x0988('0x12')](_0x0988('0x1b'),_0x5af572,JSON[_0x0988('0x14')](_0x131897));_0x206c2b(_0x131897);})[_0x0988('0x1a')](function(_0x2143bf){logger['error'](_0x0988('0x1b'),_0x2143bf[_0x0988('0x18')],_0x5af572);_0x2dc580(_0x564a3f[_0x0988('0x15')](0x1f4,_0x2143bf[_0x0988('0x18')]));});});};exports[_0x0988('0x22')]=function(_0x3374a3){return new Promise(function(_0x1e5345,_0x310441){return db[_0x0988('0x1c')][_0x0988('0x23')]({'where':_0x3374a3[_0x0988('0x1e')]?_0x3374a3[_0x0988('0x1e')][_0x0988('0x1f')]||null:null})[_0x0988('0x24')](function(_0x2e32fb){if(_0x2e32fb){return _0x2e32fb[_0x0988('0x25')](_0x3374a3[_0x0988('0x26')]['ids'],_['omit'](_0x3374a3[_0x0988('0x26')],['ids','id'])||{});}})[_0x0988('0x27')](function(_0x58831f){logger[_0x0988('0x10')](_0x0988('0x28'),_0x3374a3);logger[_0x0988('0x12')](_0x0988('0x28'),_0x3374a3,JSON['stringify'](_0x58831f));_0x1e5345(_0x58831f);})[_0x0988('0x1a')](function(_0x5ba770){logger[_0x0988('0x15')]('AddTags',_0x5ba770[_0x0988('0x18')],_0x3374a3);_0x310441(_this[_0x0988('0x15')](0x1f4,_0x5ba770[_0x0988('0x18')]));});});};
\ No newline at end of file
+var _0xc474=['./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','raw','options','where','limit','stringify','find','addTags','body','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5a5879,_0xa14804){var _0x4fa85e=function(_0x3a4461){while(--_0x3a4461){_0x5a5879['push'](_0x5a5879['shift']());}};_0x4fa85e(++_0xa14804);}(_0xc474,0x15b));var _0x4c47=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xc474[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x4c47('0x0'));var moment=require(_0x4c47('0x1'));var BPromise=require(_0x4c47('0x2'));var rs=require(_0x4c47('0x3'));var fs=require('fs');var Redis=require(_0x4c47('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c47('0x5'));var logger=require(_0x4c47('0x6'))(_0x4c47('0x7'));var config=require(_0x4c47('0x8'));var jayson=require(_0x4c47('0x9'));var client=jayson[_0x4c47('0xa')][_0x4c47('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4c47('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4c47('0xd'))['register'](socket);function respondWithRpcPromise(_0x14f03,_0x56351b,_0x415d4e){return new BPromise(function(_0x363105,_0x596d97){return client[_0x4c47('0xe')](_0x14f03,_0x415d4e)[_0x4c47('0xf')](function(_0x412f7f){logger[_0x4c47('0x10')](_0x4c47('0x11'),_0x56351b,_0x4c47('0x12'));logger[_0x4c47('0x13')](_0x4c47('0x14'),_0x56351b,'request\x20sent',JSON['stringify'](_0x412f7f));if(_0x412f7f[_0x4c47('0x15')]){if(_0x412f7f[_0x4c47('0x15')][_0x4c47('0x16')]===0x1f4){logger['error'](_0x4c47('0x11'),_0x56351b,_0x412f7f['error'][_0x4c47('0x17')]);return _0x596d97(_0x412f7f[_0x4c47('0x15')][_0x4c47('0x17')]);}logger[_0x4c47('0x15')](_0x4c47('0x11'),_0x56351b,_0x412f7f[_0x4c47('0x15')][_0x4c47('0x17')]);return _0x363105(_0x412f7f['error'][_0x4c47('0x17')]);}else{logger[_0x4c47('0x10')](_0x4c47('0x11'),_0x56351b,_0x4c47('0x12'));_0x363105(_0x412f7f[_0x4c47('0x18')]['message']);}})[_0x4c47('0x19')](function(_0x4bdec5){logger[_0x4c47('0x15')](_0x4c47('0x11'),_0x56351b,_0x4bdec5);_0x596d97(_0x4bdec5);});});}exports[_0x4c47('0x1a')]=function(_0x2d3578){var _0x17c0f2=this;return new Promise(function(_0x5e1000,_0x4e794b){return db[_0x4c47('0x1b')][_0x4c47('0x1c')](_0x2d3578['body'],{'raw':_0x2d3578['options']?_0x2d3578['options'][_0x4c47('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d3578['options']?_0x2d3578[_0x4c47('0x1e')][_0x4c47('0x1f')]||null:null,'attributes':_0x2d3578[_0x4c47('0x1e')]?_0x2d3578[_0x4c47('0x1e')]['attributes']||null:null,'limit':_0x2d3578[_0x4c47('0x1e')]?_0x2d3578[_0x4c47('0x1e')][_0x4c47('0x20')]||null:null})[_0x4c47('0xf')](function(_0x20a47a){logger[_0x4c47('0x10')](_0x4c47('0x1a'),_0x2d3578);logger[_0x4c47('0x13')]('UpdateChatInteraction',_0x2d3578,JSON[_0x4c47('0x21')](_0x20a47a));_0x5e1000(_0x20a47a);})[_0x4c47('0x19')](function(_0x126733){logger[_0x4c47('0x15')](_0x4c47('0x1a'),_0x126733[_0x4c47('0x17')],_0x2d3578);_0x4e794b(_0x17c0f2[_0x4c47('0x15')](0x1f4,_0x126733[_0x4c47('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x1751a5){return new Promise(function(_0x14c8da,_0x5cc2f8){return db[_0x4c47('0x1b')][_0x4c47('0x22')]({'where':_0x1751a5[_0x4c47('0x1e')]?_0x1751a5[_0x4c47('0x1e')][_0x4c47('0x1f')]||null:null})['then'](function(_0x5e51d8){if(_0x5e51d8){return _0x5e51d8[_0x4c47('0x23')](_0x1751a5[_0x4c47('0x24')]['ids'],_[_0x4c47('0x25')](_0x1751a5[_0x4c47('0x24')],['ids','id'])||{});}})[_0x4c47('0x26')](function(_0x1aa752){logger[_0x4c47('0x10')]('AddTags',_0x1751a5);logger['debug']('AddTags',_0x1751a5,JSON['stringify'](_0x1aa752));_0x14c8da(_0x1aa752);})[_0x4c47('0x19')](function(_0x1c6b9d){logger['error'](_0x4c47('0x27'),_0x1c6b9d[_0x4c47('0x17')],_0x1751a5);_0x5cc2f8(_this[_0x4c47('0x15')](0x1f4,_0x1c6b9d['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b6d06ae..9f38d22 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 _0x4bb7=['save','remove','update','register','length'];(function(_0x405657,_0x5d2317){var _0x5e3e84=function(_0x55d8f2){while(--_0x55d8f2){_0x405657['push'](_0x405657['shift']());}};_0x5e3e84(++_0x5d2317);}(_0x4bb7,0xe6));var _0x74bb=function(_0x2e486d,_0x47d57a){_0x2e486d=_0x2e486d-0x0;var _0x29efca=_0x4bb7[_0x2e486d];return _0x29efca;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x74bb('0x0'),_0x74bb('0x1'),_0x74bb('0x2')];function createListener(_0x51fefd,_0x5b7233){return function(_0x3b4128){_0x5b7233['emit'](_0x51fefd,_0x3b4128);};}function removeListener(_0x44dbf2,_0x49ffce){return function(){ChatInteractionEvents['removeListener'](_0x44dbf2,_0x49ffce);};}exports[_0x74bb('0x3')]=function(_0x733469){for(var _0x2d97b1=0x0,_0x2c624f=events[_0x74bb('0x4')];_0x2d97b1<_0x2c624f;_0x2d97b1++){var _0x4125fb=events[_0x2d97b1];var _0x27ab86=createListener('chatInteraction:'+_0x4125fb,_0x733469);ChatInteractionEvents['on'](_0x4125fb,_0x27ab86);}};
\ No newline at end of file
+var _0x453a=['save','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x453a,0x8b));var _0xa453=function(_0x57de35,_0x2ef99a){_0x57de35=_0x57de35-0x0;var _0x2a94eb=_0x453a[_0x57de35];return _0x2a94eb;};'use strict';var ChatInteractionEvents=require(_0xa453('0x0'));var events=[_0xa453('0x1'),'remove','update'];function createListener(_0x964877,_0x382b33){return function(_0x3e09ea){_0x382b33[_0xa453('0x2')](_0x964877,_0x3e09ea);};}function removeListener(_0x24d284,_0x1d24a9){return function(){ChatInteractionEvents[_0xa453('0x3')](_0x24d284,_0x1d24a9);};}exports[_0xa453('0x4')]=function(_0x5bf452){for(var _0x394f72=0x0,_0xd21183=events[_0xa453('0x5')];_0x394f72<_0xd21183;_0x394f72++){var _0x4f83de=events[_0x394f72];var _0xa06651=createListener(_0xa453('0x6')+_0x4f83de,_0x5bf452);ChatInteractionEvents['on'](_0x4f83de,_0xa06651);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 05be906..c28d2e1 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 _0x5e6c=['format','%s-%s','now','replace','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/'];(function(_0x21315c,_0x2f7590){var _0x139461=function(_0x46d949){while(--_0x46d949){_0x21315c['push'](_0x21315c['shift']());}};_0x139461(++_0x2f7590);}(_0x5e6c,0x142));var _0xc5e6=function(_0x422fd1,_0x44ee23){_0x422fd1=_0x422fd1-0x0;var _0x147b15=_0x5e6c[_0x422fd1];return _0x147b15;};'use strict';var multer=require(_0xc5e6('0x0'));var util=require(_0xc5e6('0x1'));var path=require(_0xc5e6('0x2'));var timeout=require(_0xc5e6('0x3'));var express=require(_0xc5e6('0x4'));var router=express['Router']();var fs_extra=require(_0xc5e6('0x5'));var auth=require(_0xc5e6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc5e6('0x7'));var controller=require(_0xc5e6('0x8'));router[_0xc5e6('0x9')]('/',auth[_0xc5e6('0xa')](),controller[_0xc5e6('0xb')]);router[_0xc5e6('0x9')](_0xc5e6('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc5e6('0x9')](_0xc5e6('0xd'),auth[_0xc5e6('0xe')](),controller['show']);router[_0xc5e6('0x9')](_0xc5e6('0xf'),auth[_0xc5e6('0xe')](),controller['attachmentDownload']);router[_0xc5e6('0x9')](_0xc5e6('0x10'),auth[_0xc5e6('0xa')](),controller[_0xc5e6('0x11')]);router[_0xc5e6('0x9')](_0xc5e6('0x12'),auth[_0xc5e6('0xe')](),controller[_0xc5e6('0x13')]);router['get']('/:id/download',auth[_0xc5e6('0xa')](),controller[_0xc5e6('0x14')]);router[_0xc5e6('0x15')]('/',auth['isAuthenticated'](),controller[_0xc5e6('0x16')]);router[_0xc5e6('0x15')](_0xc5e6('0x17'),auth[_0xc5e6('0xa')](),controller[_0xc5e6('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55af87,_0x2b021a,_0x558d82){_0x558d82(null,path[_0xc5e6('0x19')](config[_0xc5e6('0x1a')],_0xc5e6('0x1b')));},'filename':function(_0x4c92b4,_0x2fe772,_0x550d81){_0x550d81(null,util[_0xc5e6('0x1c')](_0xc5e6('0x1d'),Date[_0xc5e6('0x1e')](),_0x2fe772['originalname'][_0xc5e6('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0xc5e6('0x20')),controller[_0xc5e6('0x21')]);router[_0xc5e6('0x15')](_0xc5e6('0x10'),auth[_0xc5e6('0xe')](),controller[_0xc5e6('0x22')]);router[_0xc5e6('0x15')](_0xc5e6('0x23'),auth['isAuthenticated'](),interaction[_0xc5e6('0x24')](_0xc5e6('0x25'),_0xc5e6('0x26')),controller[_0xc5e6('0x27')]);router['put'](_0xc5e6('0xd'),auth[_0xc5e6('0xa')](),interaction[_0xc5e6('0x24')](_0xc5e6('0x25'),'chatinteraction:update'),controller['update']);router[_0xc5e6('0x28')](_0xc5e6('0x29'),controller[_0xc5e6('0x2a')]);router[_0xc5e6('0x28')](_0xc5e6('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xc5e6('0x2c')]);router[_0xc5e6('0x28')](_0xc5e6('0x2d'),controller[_0xc5e6('0x2e')]);router[_0xc5e6('0x2f')]('/:id',auth[_0xc5e6('0xa')](),interaction[_0xc5e6('0x24')](_0xc5e6('0x25'),'chatinteraction:destroy'),controller[_0xc5e6('0x30')]);router[_0xc5e6('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0xc5e6('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xb8d6=['chat','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','index','get','isAuthenticated','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','post','/:id/messages','/:id/tags','chatinteraction:addtags','addTags','put','/:id','tracked'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xb8d6,0x70));var _0x6b8d=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xb8d6[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require(_0x6b8d('0x0'));var path=require(_0x6b8d('0x1'));var timeout=require('connect-timeout');var express=require(_0x6b8d('0x2'));var router=express[_0x6b8d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6b8d('0x4'));var interaction=require(_0x6b8d('0x5'));var config=require('../../config/environment');var controller=require(_0x6b8d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b8d('0x7')]);router[_0x6b8d('0x8')]('/describe',auth[_0x6b8d('0x9')](),controller['describe']);router[_0x6b8d('0x8')]('/:id',auth[_0x6b8d('0xa')](),controller[_0x6b8d('0xb')]);router[_0x6b8d('0x8')](_0x6b8d('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x6b8d('0xd')]);router[_0x6b8d('0x8')]('/:id/messages',auth[_0x6b8d('0x9')](),controller[_0x6b8d('0xe')]);router[_0x6b8d('0x8')](_0x6b8d('0xf'),auth[_0x6b8d('0xa')](),controller[_0x6b8d('0x10')]);router[_0x6b8d('0x8')](_0x6b8d('0x11'),auth[_0x6b8d('0x9')](),controller[_0x6b8d('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b8d('0x13')]);router['post'](_0x6b8d('0x14'),auth[_0x6b8d('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x6b8d('0x15')]({'destination':function(_0x307292,_0x657d45,_0x517745){_0x517745(null,path[_0x6b8d('0x16')](config[_0x6b8d('0x17')],_0x6b8d('0x18')));},'filename':function(_0x587d21,_0x422f29,_0x181fe4){_0x181fe4(null,util[_0x6b8d('0x19')](_0x6b8d('0x1a'),Date[_0x6b8d('0x1b')](),_0x422f29[_0x6b8d('0x1c')][_0x6b8d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x6b8d('0x1e'),upload[_0x6b8d('0x1f')]('file'),controller[_0x6b8d('0x20')]);router[_0x6b8d('0x21')](_0x6b8d('0x22'),auth[_0x6b8d('0xa')](),controller['addMessage']);router[_0x6b8d('0x21')](_0x6b8d('0x23'),auth[_0x6b8d('0x9')](),interaction['tracked']('chat',_0x6b8d('0x24')),controller[_0x6b8d('0x25')]);router[_0x6b8d('0x26')](_0x6b8d('0x27'),auth[_0x6b8d('0x9')](),interaction[_0x6b8d('0x28')](_0x6b8d('0x29'),'chatinteraction:update'),controller['update']);router[_0x6b8d('0x26')]('/:id/custom_update',controller[_0x6b8d('0x2a')]);router[_0x6b8d('0x26')](_0x6b8d('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x6b8d('0x2c')]);router[_0x6b8d('0x26')](_0x6b8d('0x2d'),controller[_0x6b8d('0x2e')]);router[_0x6b8d('0x2f')](_0x6b8d('0x27'),auth[_0x6b8d('0x9')](),interaction[_0x6b8d('0x28')](_0x6b8d('0x29'),'chatinteraction:destroy'),controller[_0x6b8d('0x30')]);router[_0x6b8d('0x2f')]('/:id/tags',auth[_0x6b8d('0x9')](),controller[_0x6b8d('0x31')]);module[_0x6b8d('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index f4f23a4..70594a7 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 _0x9449=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0x5e4cac,_0x3837d4){var _0x41c450=function(_0x5702be){while(--_0x5702be){_0x5e4cac['push'](_0x5e4cac['shift']());}};_0x41c450(++_0x3837d4);}(_0x9449,0x119));var _0x9944=function(_0x171b10,_0xaada95){_0x171b10=_0x171b10-0x0;var _0x369be0=_0x9449[_0x171b10];return _0x369be0;};'use strict';var Sequelize=require('sequelize');module[_0x9944('0x0')]={'body':{'type':Sequelize[_0x9944('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9944('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9944('0x3')]}};
\ No newline at end of file
+var _0x8669=['TEXT','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x8669,0x99));var _0x9866=function(_0x43e372,_0x1cc703){_0x43e372=_0x43e372-0x0;var _0x29d492=_0x8669[_0x43e372];return _0x29d492;};'use strict';var Sequelize=require(_0x9866('0x0'));module[_0x9866('0x1')]={'body':{'type':Sequelize[_0x9866('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9866('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9866('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index f5e3266..e797cf4 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 _0x6e72=['get','UserProfileSection','autoAssociation','UserProfileResource','findAll','length','resourceId','push','messages','user','FromId','read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','rows','catch','show','params','find','create','body','describe','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues'];(function(_0x345728,_0x30017c){var _0x3dbe1f=function(_0x5f7147){while(--_0x5f7147){_0x345728['push'](_0x345728['shift']());}};_0x3dbe1f(++_0x30017c);}(_0x6e72,0xe9));var _0x26e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e72[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x26e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26e7('0x1'));var jsonpatch=require(_0x26e7('0x2'));var rp=require(_0x26e7('0x3'));var moment=require(_0x26e7('0x4'));var BPromise=require(_0x26e7('0x5'));var Mustache=require(_0x26e7('0x6'));var util=require(_0x26e7('0x7'));var path=require(_0x26e7('0x8'));var sox=require(_0x26e7('0x9'));var csv=require(_0x26e7('0xa'));var ejs=require(_0x26e7('0xb'));var fs=require('fs');var fs_extra=require(_0x26e7('0xc'));var _=require('lodash');var squel=require(_0x26e7('0xd'));var crypto=require(_0x26e7('0xe'));var jsforce=require(_0x26e7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x26e7('0xa'));var querystring=require(_0x26e7('0x10'));var Papa=require(_0x26e7('0x11'));var Redis=require('ioredis');var authService=require(_0x26e7('0x12'));var qs=require(_0x26e7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e7('0x14'));var logger=require('../../config/logger')(_0x26e7('0x15'));var utils=require(_0x26e7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x26e7('0x17'));var db=require(_0x26e7('0x18'))['db'];config['redis']=_[_0x26e7('0x19')](config[_0x26e7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x26e7('0x1b'))(new Redis(config[_0x26e7('0x1a')]));require(_0x26e7('0x1c'))[_0x26e7('0x1d')](socket);function respondWithStatusCode(_0x37ec41,_0x4a356b){_0x4a356b=_0x4a356b||0xcc;return function(_0x279469){if(_0x279469){return _0x37ec41[_0x26e7('0x1e')](_0x4a356b);}return _0x37ec41[_0x26e7('0x1f')](_0x4a356b)['end']();};}function respondWithResult(_0x50c543,_0x481c0e){_0x481c0e=_0x481c0e||0xc8;return function(_0x5136b7){if(_0x5136b7){return _0x50c543[_0x26e7('0x1f')](_0x481c0e)[_0x26e7('0x20')](_0x5136b7);}};}function respondWithFilteredResult(_0x4636f5,_0x45489e){return function(_0x1745bd){if(_0x1745bd){var _0x58fc7d=typeof _0x45489e[_0x26e7('0x21')]===_0x26e7('0x22')&&typeof _0x45489e['limit']===_0x26e7('0x22');var _0x305542=_0x1745bd[_0x26e7('0x23')];var _0x372fce=_0x58fc7d?0x0:_0x45489e['offset'];var _0x9b9d68=_0x58fc7d?_0x1745bd['count']:_0x45489e[_0x26e7('0x21')]+_0x45489e['limit'];var _0x47d5b6;if(_0x9b9d68>=_0x305542){_0x9b9d68=_0x305542;_0x47d5b6=0xc8;}else{_0x47d5b6=0xce;}_0x4636f5[_0x26e7('0x1f')](_0x47d5b6);return _0x4636f5['set'](_0x26e7('0x24'),_0x372fce+'-'+_0x9b9d68+'/'+_0x305542)[_0x26e7('0x20')](_0x1745bd);}return null;};}function patchUpdates(_0x586350){return function(_0x366e40){try{jsonpatch[_0x26e7('0x25')](_0x366e40,_0x586350,!![]);}catch(_0x33fb1b){return BPromise[_0x26e7('0x26')](_0x33fb1b);}return _0x366e40[_0x26e7('0x27')]();};}function saveUpdates(_0x2f9324,_0x5a2ae3){return function(_0x1181e5){if(_0x1181e5){return _0x1181e5[_0x26e7('0x28')](_0x2f9324)[_0x26e7('0x29')](function(_0x223e1e){return _0x223e1e;});}return null;};}function removeEntity(_0x14d6a1,_0x4032e8){return function(_0x24201a){if(_0x24201a){return _0x24201a[_0x26e7('0x2a')]()[_0x26e7('0x29')](function(){_0x14d6a1['status'](0xcc)[_0x26e7('0x2b')]();});}};}function handleEntityNotFound(_0x5ced9b,_0x5d349f){return function(_0x1254c1){if(!_0x1254c1){_0x5ced9b['sendStatus'](0x194);}return _0x1254c1;};}function handleError(_0x3510d9,_0x242670){_0x242670=_0x242670||0x1f4;return function(_0x2cb860){logger['error'](_0x2cb860[_0x26e7('0x2c')]);if(_0x2cb860['name']){delete _0x2cb860['name'];}_0x3510d9[_0x26e7('0x1f')](_0x242670)['send'](_0x2cb860);};}exports[_0x26e7('0x2d')]=function(_0x565af0,_0x50d522){var _0x52170d={},_0x842d08={},_0x377572={'count':0x0,'rows':[]};var _0x401cfe=_[_0x26e7('0x2e')](db['ChatInternalMessage'][_0x26e7('0x2f')],function(_0x4ec1ab){return{'name':_0x4ec1ab[_0x26e7('0x30')],'type':_0x4ec1ab[_0x26e7('0x31')][_0x26e7('0x32')]};});_0x842d08[_0x26e7('0x33')]=_['map'](_0x401cfe,_0x26e7('0x34'));_0x842d08[_0x26e7('0x35')]=_[_0x26e7('0x36')](_0x565af0[_0x26e7('0x35')]);_0x842d08['filters']=_[_0x26e7('0x37')](_0x842d08[_0x26e7('0x33')],_0x842d08[_0x26e7('0x35')]);_0x52170d['attributes']=_['intersection'](_0x842d08['model'],qs['fields'](_0x565af0['query'][_0x26e7('0x38')]));_0x52170d[_0x26e7('0x39')]=_0x52170d['attributes']['length']?_0x52170d[_0x26e7('0x39')]:_0x842d08['model'];if(!_0x565af0[_0x26e7('0x35')][_0x26e7('0x3a')](_0x26e7('0x3b'))){_0x52170d[_0x26e7('0x3c')]=qs['limit'](_0x565af0[_0x26e7('0x35')][_0x26e7('0x3c')]);_0x52170d[_0x26e7('0x21')]=qs['offset'](_0x565af0[_0x26e7('0x35')][_0x26e7('0x21')]);}_0x52170d[_0x26e7('0x3d')]=qs[_0x26e7('0x3e')](_0x565af0[_0x26e7('0x35')][_0x26e7('0x3e')]);_0x52170d[_0x26e7('0x3f')]=qs[_0x26e7('0x40')](_[_0x26e7('0x41')](_0x565af0[_0x26e7('0x35')],_0x842d08[_0x26e7('0x40')]),_0x401cfe);if(_0x565af0[_0x26e7('0x35')][_0x26e7('0x42')]){_0x52170d[_0x26e7('0x3f')]=_[_0x26e7('0x43')](_0x52170d[_0x26e7('0x3f')],{'$or':_[_0x26e7('0x2e')](_0x401cfe,function(_0x190b0c){if(_0x190b0c['type']!==_0x26e7('0x44')){var _0x457f23={};_0x457f23[_0x190b0c[_0x26e7('0x34')]]={'$like':'%'+_0x565af0[_0x26e7('0x35')][_0x26e7('0x42')]+'%'};return _0x457f23;}})});}_0x52170d=_['merge']({},_0x52170d,_0x565af0[_0x26e7('0x45')]);var _0x291a85={'where':_0x52170d[_0x26e7('0x3f')]};return db[_0x26e7('0x46')][_0x26e7('0x23')](_0x291a85)[_0x26e7('0x29')](function(_0x2ead4d){_0x377572[_0x26e7('0x23')]=_0x2ead4d;if(_0x565af0['query'][_0x26e7('0x47')]){_0x52170d[_0x26e7('0x48')]=[{'all':!![]}];}return db[_0x26e7('0x46')]['findAll'](_0x52170d);})[_0x26e7('0x29')](function(_0x2f500c){_0x377572[_0x26e7('0x49')]=_0x2f500c;return _0x377572;})[_0x26e7('0x29')](respondWithFilteredResult(_0x50d522,_0x52170d))[_0x26e7('0x4a')](handleError(_0x50d522,null));};exports[_0x26e7('0x4b')]=function(_0x58a763,_0x148d2f){var _0x2176a6={'raw':!![],'where':{'id':_0x58a763[_0x26e7('0x4c')]['id']}},_0xc082e7={};_0xc082e7[_0x26e7('0x33')]=_[_0x26e7('0x36')](db[_0x26e7('0x46')]['rawAttributes']);_0xc082e7[_0x26e7('0x35')]=_['keys'](_0x58a763[_0x26e7('0x35')]);_0xc082e7[_0x26e7('0x40')]=_[_0x26e7('0x37')](_0xc082e7['model'],_0xc082e7[_0x26e7('0x35')]);_0x2176a6['attributes']=_[_0x26e7('0x37')](_0xc082e7['model'],qs[_0x26e7('0x38')](_0x58a763[_0x26e7('0x35')][_0x26e7('0x38')]));_0x2176a6[_0x26e7('0x39')]=_0x2176a6['attributes']['length']?_0x2176a6[_0x26e7('0x39')]:_0xc082e7[_0x26e7('0x33')];if(_0x58a763[_0x26e7('0x35')]['includeAll']){_0x2176a6['include']=[{'all':!![]}];}_0x2176a6=_[_0x26e7('0x43')]({},_0x2176a6,_0x58a763[_0x26e7('0x45')]);return db[_0x26e7('0x46')][_0x26e7('0x4d')](_0x2176a6)[_0x26e7('0x29')](handleEntityNotFound(_0x148d2f,null))[_0x26e7('0x29')](respondWithResult(_0x148d2f,null))[_0x26e7('0x4a')](handleError(_0x148d2f,null));};exports[_0x26e7('0x4e')]=function(_0x22d28d,_0x2f9506){return db[_0x26e7('0x46')][_0x26e7('0x4e')](_0x22d28d[_0x26e7('0x4f')],{})[_0x26e7('0x29')](respondWithResult(_0x2f9506,0xc9))['catch'](handleError(_0x2f9506,null));};exports[_0x26e7('0x28')]=function(_0x1f17e,_0x1d26c5){if(_0x1f17e[_0x26e7('0x4f')]['id']){delete _0x1f17e[_0x26e7('0x4f')]['id'];}return db[_0x26e7('0x46')]['find']({'where':{'id':_0x1f17e[_0x26e7('0x4c')]['id']}})[_0x26e7('0x29')](handleEntityNotFound(_0x1d26c5,null))[_0x26e7('0x29')](saveUpdates(_0x1f17e[_0x26e7('0x4f')],null))[_0x26e7('0x29')](respondWithResult(_0x1d26c5,null))[_0x26e7('0x4a')](handleError(_0x1d26c5,null));};exports['destroy']=function(_0xd6124c,_0x23848c){return db[_0x26e7('0x46')][_0x26e7('0x4d')]({'where':{'id':_0xd6124c['params']['id']}})[_0x26e7('0x29')](handleEntityNotFound(_0x23848c,null))[_0x26e7('0x29')](removeEntity(_0x23848c,null))[_0x26e7('0x4a')](handleError(_0x23848c,null));};exports['describe']=function(_0x154db6,_0x3f68e7){return db[_0x26e7('0x46')][_0x26e7('0x50')]()[_0x26e7('0x29')](respondWithResult(_0x3f68e7,null))['catch'](handleError(_0x3f68e7,null));};function wrapUser(_0x1c7714){return function(_0x345556){var _0x25ce1c=_0x1c7714['get']({'plain':!![]});_0x25ce1c['messages']=[];if(_0x345556){_0x25ce1c[_0x26e7('0x51')]=_0x345556[_0x26e7('0x52')];_0x25ce1c['lastMessage']=_0x345556;}else{_0x25ce1c[_0x26e7('0x51')]=moment(0x0)[_0x26e7('0x53')](_0x26e7('0x54'));_0x25ce1c[_0x26e7('0x55')]={};}return _0x25ce1c;};}exports['getUsers']=function(_0x450ba8,_0x40a363,_0x54e6ac){var _0x5650f1=[];return db[_0x26e7('0x56')]['findAll']({'where':{'role':[_0x26e7('0x57'),'admin','user']},'attributes':['id',_0x26e7('0x58'),_0x26e7('0x34'),_0x26e7('0x59'),_0x26e7('0x5a'),'internal',_0x26e7('0x5b'),_0x26e7('0x5c'),_0x26e7('0x5d'),_0x26e7('0x5e')],'order':qs[_0x26e7('0x3e')](_0x26e7('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0x26e7('0x60'),'attributes':['id',_0x26e7('0x34'),_0x26e7('0x31')],'through':{'attributes':[]}}]})[_0x26e7('0x29')](function(_0x379b05){if(_0x379b05){var _0xa483ae=_0x450ba8['user'][_0x26e7('0x61')]({'plain':!![]});if(!_0xa483ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa483ae[_0x26e7('0x59')]==='user'){return db[_0x26e7('0x62')][_0x26e7('0x4d')]({'where':{'name':'Agents','userProfileId':_0xa483ae['userProfileId']},'raw':!![]})['then'](function(_0x9613a){if(_0x9613a){if(_0x9613a[_0x26e7('0x63')]===0x0){return db[_0x26e7('0x64')][_0x26e7('0x65')]({'where':{'sectionId':_0x9613a['id']},'raw':!![]})[_0x26e7('0x29')](function(_0x525f18){var _0x2cdfb5=[];if(_['isEmpty'](_0x525f18)){_0x2cdfb5=_[_0x26e7('0x42')](_0x379b05,function(_0x575339){if(_0x575339[_0x26e7('0x59')]!=='agent'){return _0x575339;}});return _0x2cdfb5;}else{for(var _0x4bc97d=0x0;_0x4bc97d<_0x379b05[_0x26e7('0x66')];_0x4bc97d++){var _0x1ce9c8=_0x379b05[_0x4bc97d];if(_0x1ce9c8[_0x26e7('0x59')]===_0x26e7('0x57')){var _0x259ae6=_[_0x26e7('0x4d')](_0x525f18,function(_0x5dfb0d){return _0x5dfb0d[_0x26e7('0x67')]===_0x1ce9c8['id'];});if(_0x259ae6)_0x2cdfb5['push'](_0x1ce9c8);}else{_0x2cdfb5[_0x26e7('0x68')](_0x1ce9c8);}}return _0x2cdfb5;}});}else{return _0x379b05;}}else{var _0x3f9323=_[_0x26e7('0x42')](_0x379b05,function(_0x2875ef){if(_0x2875ef[_0x26e7('0x59')]!==_0x26e7('0x57')){return _0x2875ef;}});return _0x3f9323;}});}else{return _0x379b05;}}})[_0x26e7('0x29')](function(_0x2a31b4){var _0x5094ad=[];if(_0x2a31b4){_0x5650f1=_0x2a31b4;for(var _0x5718a8=0x0;_0x5718a8<_0x2a31b4[_0x26e7('0x66')];_0x5718a8+=0x1){_0x5650f1[_0x5718a8][_0x26e7('0x69')]=[];_0x5094ad[_0x26e7('0x68')](db[_0x26e7('0x46')][_0x26e7('0x4d')]({'where':{'FromId':[_0x450ba8[_0x26e7('0x6a')]['id'],_0x2a31b4[_0x5718a8]['id']],'ToId':[_0x450ba8['user']['id'],_0x2a31b4[_0x5718a8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x26e7('0x6b'),'ToId',_0x26e7('0x6c'),_0x26e7('0x4f')],'order':qs[_0x26e7('0x3e')](_0x26e7('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x26e7('0x29')](wrapUser(_0x2a31b4[_0x5718a8])));}return BPromise['all'](_0x5094ad);}return[];})['then'](function(_0x31e16f){return{'rows':_0x31e16f,'count':_0x31e16f[_0x26e7('0x66')]};})['then'](respondWithResult(_0x40a363,null))[_0x26e7('0x4a')](handleError(_0x40a363,null));};
\ No newline at end of file
+var _0xbc18=['Agents','userProfileId','UserProfileResource','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbc18,0x7e));var _0x8bc1=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xbc18[_0xdeac17];return _0x33aabd;};'use strict';var emlformat=require(_0x8bc1('0x0'));var rimraf=require(_0x8bc1('0x1'));var zipdir=require(_0x8bc1('0x2'));var jsonpatch=require(_0x8bc1('0x3'));var rp=require(_0x8bc1('0x4'));var moment=require(_0x8bc1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bc1('0x6'));var util=require(_0x8bc1('0x7'));var path=require(_0x8bc1('0x8'));var sox=require(_0x8bc1('0x9'));var csv=require(_0x8bc1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bc1('0xb'));var _=require(_0x8bc1('0xc'));var squel=require(_0x8bc1('0xd'));var crypto=require(_0x8bc1('0xe'));var jsforce=require(_0x8bc1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8bc1('0x10'));var Papa=require(_0x8bc1('0x11'));var Redis=require(_0x8bc1('0x12'));var authService=require(_0x8bc1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8bc1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bc1('0x15'))(_0x8bc1('0x16'));var utils=require(_0x8bc1('0x17'));var config=require(_0x8bc1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bc1('0x19'))['db'];config[_0x8bc1('0x1a')]=_[_0x8bc1('0x1b')](config['redis'],{'host':_0x8bc1('0x1c'),'port':0x18eb});var socket=require(_0x8bc1('0x1d'))(new Redis(config[_0x8bc1('0x1a')]));require(_0x8bc1('0x1e'))[_0x8bc1('0x1f')](socket);function respondWithStatusCode(_0x1fad03,_0x1dec5e){_0x1dec5e=_0x1dec5e||0xcc;return function(_0x1c484c){if(_0x1c484c){return _0x1fad03[_0x8bc1('0x20')](_0x1dec5e);}return _0x1fad03[_0x8bc1('0x21')](_0x1dec5e)[_0x8bc1('0x22')]();};}function respondWithResult(_0x268cd3,_0x5f444d){_0x5f444d=_0x5f444d||0xc8;return function(_0x546335){if(_0x546335){return _0x268cd3[_0x8bc1('0x21')](_0x5f444d)['json'](_0x546335);}};}function respondWithFilteredResult(_0x6eaede,_0x52e946){return function(_0x3d769e){if(_0x3d769e){var _0x44822b=typeof _0x52e946[_0x8bc1('0x23')]===_0x8bc1('0x24')&&typeof _0x52e946[_0x8bc1('0x25')]==='undefined';var _0x2b4811=_0x3d769e[_0x8bc1('0x26')];var _0xf6c417=_0x44822b?0x0:_0x52e946[_0x8bc1('0x23')];var _0x34302d=_0x44822b?_0x3d769e['count']:_0x52e946['offset']+_0x52e946[_0x8bc1('0x25')];var _0xb05f29;if(_0x34302d>=_0x2b4811){_0x34302d=_0x2b4811;_0xb05f29=0xc8;}else{_0xb05f29=0xce;}_0x6eaede[_0x8bc1('0x21')](_0xb05f29);return _0x6eaede[_0x8bc1('0x27')](_0x8bc1('0x28'),_0xf6c417+'-'+_0x34302d+'/'+_0x2b4811)[_0x8bc1('0x29')](_0x3d769e);}return null;};}function patchUpdates(_0x2d19ce){return function(_0x500307){try{jsonpatch['apply'](_0x500307,_0x2d19ce,!![]);}catch(_0x2c6fdd){return BPromise[_0x8bc1('0x2a')](_0x2c6fdd);}return _0x500307['save']();};}function saveUpdates(_0x187aa6,_0x19d309){return function(_0x1b13ec){if(_0x1b13ec){return _0x1b13ec[_0x8bc1('0x2b')](_0x187aa6)[_0x8bc1('0x2c')](function(_0x2a6e68){return _0x2a6e68;});}return null;};}function removeEntity(_0x19aaf0,_0x1cf4eb){return function(_0x56ee5c){if(_0x56ee5c){return _0x56ee5c[_0x8bc1('0x2d')]()[_0x8bc1('0x2c')](function(){_0x19aaf0[_0x8bc1('0x21')](0xcc)[_0x8bc1('0x22')]();});}};}function handleEntityNotFound(_0x1e75c9,_0x3f94f3){return function(_0x5e4404){if(!_0x5e4404){_0x1e75c9[_0x8bc1('0x20')](0x194);}return _0x5e4404;};}function handleError(_0x12922b,_0x498931){_0x498931=_0x498931||0x1f4;return function(_0x1e3173){logger['error'](_0x1e3173[_0x8bc1('0x2e')]);if(_0x1e3173['name']){delete _0x1e3173[_0x8bc1('0x2f')];}_0x12922b[_0x8bc1('0x21')](_0x498931)[_0x8bc1('0x30')](_0x1e3173);};}exports[_0x8bc1('0x31')]=function(_0x34be12,_0x16ccd4){var _0x14bf96={},_0x481227={},_0x526d75={'count':0x0,'rows':[]};var _0xa47735=_[_0x8bc1('0x32')](db[_0x8bc1('0x33')]['rawAttributes'],function(_0x32982b){return{'name':_0x32982b[_0x8bc1('0x34')],'type':_0x32982b[_0x8bc1('0x35')][_0x8bc1('0x36')]};});_0x481227[_0x8bc1('0x37')]=_[_0x8bc1('0x32')](_0xa47735,_0x8bc1('0x2f'));_0x481227[_0x8bc1('0x38')]=_[_0x8bc1('0x39')](_0x34be12[_0x8bc1('0x38')]);_0x481227[_0x8bc1('0x3a')]=_['intersection'](_0x481227['model'],_0x481227[_0x8bc1('0x38')]);_0x14bf96[_0x8bc1('0x3b')]=_[_0x8bc1('0x3c')](_0x481227[_0x8bc1('0x37')],qs[_0x8bc1('0x3d')](_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x3d')]));_0x14bf96['attributes']=_0x14bf96[_0x8bc1('0x3b')][_0x8bc1('0x3e')]?_0x14bf96[_0x8bc1('0x3b')]:_0x481227[_0x8bc1('0x37')];if(!_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x3f')](_0x8bc1('0x40'))){_0x14bf96[_0x8bc1('0x25')]=qs['limit'](_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x25')]);_0x14bf96[_0x8bc1('0x23')]=qs['offset'](_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x23')]);}_0x14bf96['order']=qs[_0x8bc1('0x41')](_0x34be12['query'][_0x8bc1('0x41')]);_0x14bf96[_0x8bc1('0x42')]=qs[_0x8bc1('0x3a')](_[_0x8bc1('0x43')](_0x34be12[_0x8bc1('0x38')],_0x481227[_0x8bc1('0x3a')]),_0xa47735);if(_0x34be12[_0x8bc1('0x38')]['filter']){_0x14bf96[_0x8bc1('0x42')]=_[_0x8bc1('0x44')](_0x14bf96[_0x8bc1('0x42')],{'$or':_[_0x8bc1('0x32')](_0xa47735,function(_0x42af36){if(_0x42af36[_0x8bc1('0x35')]!==_0x8bc1('0x45')){var _0x245012={};_0x245012[_0x42af36[_0x8bc1('0x2f')]]={'$like':'%'+_0x34be12['query'][_0x8bc1('0x46')]+'%'};return _0x245012;}})});}_0x14bf96=_['merge']({},_0x14bf96,_0x34be12[_0x8bc1('0x47')]);var _0x8c7c58={'where':_0x14bf96[_0x8bc1('0x42')]};return db[_0x8bc1('0x33')]['count'](_0x8c7c58)[_0x8bc1('0x2c')](function(_0x485793){_0x526d75['count']=_0x485793;if(_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x48')]){_0x14bf96[_0x8bc1('0x49')]=[{'all':!![]}];}return db[_0x8bc1('0x33')][_0x8bc1('0x4a')](_0x14bf96);})[_0x8bc1('0x2c')](function(_0x24b522){_0x526d75[_0x8bc1('0x4b')]=_0x24b522;return _0x526d75;})['then'](respondWithFilteredResult(_0x16ccd4,_0x14bf96))[_0x8bc1('0x4c')](handleError(_0x16ccd4,null));};exports[_0x8bc1('0x4d')]=function(_0x233d7b,_0x393ff8){var _0x28f26e={'raw':!![],'where':{'id':_0x233d7b[_0x8bc1('0x4e')]['id']}},_0x3ef639={};_0x3ef639[_0x8bc1('0x37')]=_[_0x8bc1('0x39')](db[_0x8bc1('0x33')]['rawAttributes']);_0x3ef639['query']=_['keys'](_0x233d7b['query']);_0x3ef639[_0x8bc1('0x3a')]=_[_0x8bc1('0x3c')](_0x3ef639[_0x8bc1('0x37')],_0x3ef639[_0x8bc1('0x38')]);_0x28f26e[_0x8bc1('0x3b')]=_['intersection'](_0x3ef639['model'],qs['fields'](_0x233d7b[_0x8bc1('0x38')][_0x8bc1('0x3d')]));_0x28f26e[_0x8bc1('0x3b')]=_0x28f26e[_0x8bc1('0x3b')][_0x8bc1('0x3e')]?_0x28f26e[_0x8bc1('0x3b')]:_0x3ef639[_0x8bc1('0x37')];if(_0x233d7b[_0x8bc1('0x38')][_0x8bc1('0x48')]){_0x28f26e['include']=[{'all':!![]}];}_0x28f26e=_[_0x8bc1('0x44')]({},_0x28f26e,_0x233d7b[_0x8bc1('0x47')]);return db[_0x8bc1('0x33')][_0x8bc1('0x4f')](_0x28f26e)[_0x8bc1('0x2c')](handleEntityNotFound(_0x393ff8,null))[_0x8bc1('0x2c')](respondWithResult(_0x393ff8,null))['catch'](handleError(_0x393ff8,null));};exports[_0x8bc1('0x50')]=function(_0x5c5622,_0x183790){return db[_0x8bc1('0x33')][_0x8bc1('0x50')](_0x5c5622['body'],{})[_0x8bc1('0x2c')](respondWithResult(_0x183790,0xc9))[_0x8bc1('0x4c')](handleError(_0x183790,null));};exports[_0x8bc1('0x2b')]=function(_0x118fc4,_0x4f676b){if(_0x118fc4[_0x8bc1('0x51')]['id']){delete _0x118fc4[_0x8bc1('0x51')]['id'];}return db['ChatInternalMessage'][_0x8bc1('0x4f')]({'where':{'id':_0x118fc4[_0x8bc1('0x4e')]['id']}})[_0x8bc1('0x2c')](handleEntityNotFound(_0x4f676b,null))[_0x8bc1('0x2c')](saveUpdates(_0x118fc4[_0x8bc1('0x51')],null))[_0x8bc1('0x2c')](respondWithResult(_0x4f676b,null))['catch'](handleError(_0x4f676b,null));};exports[_0x8bc1('0x2d')]=function(_0x4c99e6,_0x5dad7a){return db['ChatInternalMessage'][_0x8bc1('0x4f')]({'where':{'id':_0x4c99e6['params']['id']}})[_0x8bc1('0x2c')](handleEntityNotFound(_0x5dad7a,null))[_0x8bc1('0x2c')](removeEntity(_0x5dad7a,null))[_0x8bc1('0x4c')](handleError(_0x5dad7a,null));};exports[_0x8bc1('0x52')]=function(_0x1eb8f4,_0x514e44){return db[_0x8bc1('0x33')][_0x8bc1('0x52')]()[_0x8bc1('0x2c')](respondWithResult(_0x514e44,null))['catch'](handleError(_0x514e44,null));};function wrapUser(_0x151f8f){return function(_0x2a9efe){var _0x352866=_0x151f8f[_0x8bc1('0x53')]({'plain':!![]});_0x352866[_0x8bc1('0x54')]=[];if(_0x2a9efe){_0x352866[_0x8bc1('0x55')]=_0x2a9efe[_0x8bc1('0x56')];_0x352866[_0x8bc1('0x57')]=_0x2a9efe;}else{_0x352866[_0x8bc1('0x55')]=moment(0x0)[_0x8bc1('0x58')](_0x8bc1('0x59'));_0x352866[_0x8bc1('0x57')]={};}return _0x352866;};}exports[_0x8bc1('0x5a')]=function(_0x224be4,_0x3a07ba,_0xd4975c){var _0x1275d7=[];return db[_0x8bc1('0x5b')]['findAll']({'where':{'role':['agent',_0x8bc1('0x5c'),_0x8bc1('0x5d')]},'attributes':['id',_0x8bc1('0x5e'),'name',_0x8bc1('0x5f'),_0x8bc1('0x60'),_0x8bc1('0x61'),_0x8bc1('0x62'),_0x8bc1('0x63'),_0x8bc1('0x64'),'showWebBar'],'order':qs['sort'](_0x8bc1('0x65')),'include':[{'model':db[_0x8bc1('0x66')],'as':_0x8bc1('0x67'),'attributes':['id',_0x8bc1('0x2f'),_0x8bc1('0x35')],'through':{'attributes':[]}}]})[_0x8bc1('0x2c')](function(_0x2a21df){if(_0x2a21df){var _0x5ab56b=_0x224be4['user']['get']({'plain':!![]});if(!_0x5ab56b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ab56b['role']===_0x8bc1('0x5d')){return db['UserProfileSection'][_0x8bc1('0x4f')]({'where':{'name':_0x8bc1('0x68'),'userProfileId':_0x5ab56b[_0x8bc1('0x69')]},'raw':!![]})[_0x8bc1('0x2c')](function(_0x41b576){if(_0x41b576){if(_0x41b576['autoAssociation']===0x0){return db[_0x8bc1('0x6a')][_0x8bc1('0x4a')]({'where':{'sectionId':_0x41b576['id']},'raw':!![]})[_0x8bc1('0x2c')](function(_0x360517){var _0x4e2ed=[];if(_['isEmpty'](_0x360517)){_0x4e2ed=_[_0x8bc1('0x46')](_0x2a21df,function(_0x2c01da){if(_0x2c01da[_0x8bc1('0x5f')]!==_0x8bc1('0x6b')){return _0x2c01da;}});return _0x4e2ed;}else{for(var _0x17cb21=0x0;_0x17cb21<_0x2a21df[_0x8bc1('0x3e')];_0x17cb21++){var _0x4c07e2=_0x2a21df[_0x17cb21];if(_0x4c07e2['role']===_0x8bc1('0x6b')){var _0x39fc0e=_['find'](_0x360517,function(_0x1ba0d5){return _0x1ba0d5[_0x8bc1('0x6c')]===_0x4c07e2['id'];});if(_0x39fc0e)_0x4e2ed['push'](_0x4c07e2);}else{_0x4e2ed[_0x8bc1('0x6d')](_0x4c07e2);}}return _0x4e2ed;}});}else{return _0x2a21df;}}else{var _0x5143d6=_['filter'](_0x2a21df,function(_0x1bd191){if(_0x1bd191[_0x8bc1('0x5f')]!=='agent'){return _0x1bd191;}});return _0x5143d6;}});}else{return _0x2a21df;}}})[_0x8bc1('0x2c')](function(_0x1bdb98){var _0x7447ef=[];if(_0x1bdb98){_0x1275d7=_0x1bdb98;for(var _0x102396=0x0;_0x102396<_0x1bdb98[_0x8bc1('0x3e')];_0x102396+=0x1){_0x1275d7[_0x102396][_0x8bc1('0x54')]=[];_0x7447ef[_0x8bc1('0x6d')](db[_0x8bc1('0x33')][_0x8bc1('0x4f')]({'where':{'FromId':[_0x224be4[_0x8bc1('0x5d')]['id'],_0x1bdb98[_0x102396]['id']],'ToId':[_0x224be4[_0x8bc1('0x5d')]['id'],_0x1bdb98[_0x102396]['id']],'ChatGroupId':null},'attributes':['id',_0x8bc1('0x56'),_0x8bc1('0x6e'),_0x8bc1('0x6f'),_0x8bc1('0x70'),_0x8bc1('0x51')],'order':qs[_0x8bc1('0x41')](_0x8bc1('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8bc1('0x2c')](wrapUser(_0x1bdb98[_0x102396])));}return BPromise[_0x8bc1('0x72')](_0x7447ef);}return[];})[_0x8bc1('0x2c')](function(_0x3c555b){return{'rows':_0x3c555b,'count':_0x3c555b[_0x8bc1('0x3e')]};})[_0x8bc1('0x2c')](respondWithResult(_0x3a07ba,null))[_0x8bc1('0x4c')](handleError(_0x3a07ba,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index d076f9a..4856fa7 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 _0xc5a5=['setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x2237a7,_0x5b6bca){var _0x96b057=function(_0x2e59a7){while(--_0x2e59a7){_0x2237a7['push'](_0x2237a7['shift']());}};_0x96b057(++_0x5b6bca);}(_0xc5a5,0x1b1));var _0x5c5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5a5[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x5c5a('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5c5a('0x1')](0x0);var events={'afterCreate':_0x5c5a('0x2'),'afterUpdate':_0x5c5a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x294e12){return function(_0x2cce17,_0xb17644,_0x1b18ab){ChatInternalMessageEvents[_0x5c5a('0x4')](_0x294e12+':'+_0x2cce17['id'],_0x2cce17);ChatInternalMessageEvents[_0x5c5a('0x4')](_0x294e12,_0x2cce17);_0x1b18ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x5c5a('0x5')](e,emitEvent(event));}}module[_0x5c5a('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xd993=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4d1667,_0x44ff2e){var _0x6a267f=function(_0x1269a0){while(--_0x1269a0){_0x4d1667['push'](_0x4d1667['shift']());}};_0x6a267f(++_0x44ff2e);}(_0xd993,0x19e));var _0x3d99=function(_0x1cca23,_0x228d03){_0x1cca23=_0x1cca23-0x0;var _0x38b568=_0xd993[_0x1cca23];return _0x38b568;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3d99('0x0'))['db'][_0x3d99('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3d99('0x2')](0x0);var events={'afterCreate':_0x3d99('0x3'),'afterUpdate':_0x3d99('0x4'),'afterDestroy':_0x3d99('0x5')};function emitEvent(_0x1efa42){return function(_0x4ad11a,_0x104559,_0x5ec2d6){ChatInternalMessageEvents[_0x3d99('0x6')](_0x1efa42+':'+_0x4ad11a['id'],_0x4ad11a);ChatInternalMessageEvents[_0x3d99('0x6')](_0x1efa42,_0x4ad11a);_0x5ec2d6(null);};}for(var e in events){if(events[_0x3d99('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3d99('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 9c2e810..44cd292 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 _0x69c4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x69c4,0x161));var _0x469c=function(_0x1a5abe,_0x38b592){_0x1a5abe=_0x1a5abe-0x0;var _0x1948a7=_0x69c4[_0x1a5abe];return _0x1948a7;};'use strict';var _=require(_0x469c('0x0'));var util=require(_0x469c('0x1'));var logger=require(_0x469c('0x2'))(_0x469c('0x3'));var moment=require(_0x469c('0x4'));var BPromise=require(_0x469c('0x5'));var rp=require(_0x469c('0x6'));var fs=require('fs');var path=require(_0x469c('0x7'));var rimraf=require(_0x469c('0x8'));var config=require(_0x469c('0x9'));var attributes=require(_0x469c('0xa'));module[_0x469c('0xb')]=function(_0x37ddc4,_0x1778ce){return _0x37ddc4[_0x469c('0xc')](_0x469c('0xd'),attributes,{'tableName':_0x469c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x469c('0xf'),'collate':_0x469c('0x10')});};
\ No newline at end of file
+var _0x2a8f=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x2a8f,0xe9));var _0xf2a8=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x2a8f[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0xf2a8('0x0'));var util=require('util');var logger=require(_0xf2a8('0x1'))(_0xf2a8('0x2'));var moment=require('moment');var BPromise=require(_0xf2a8('0x3'));var rp=require(_0xf2a8('0x4'));var fs=require('fs');var path=require(_0xf2a8('0x5'));var rimraf=require(_0xf2a8('0x6'));var config=require(_0xf2a8('0x7'));var attributes=require(_0xf2a8('0x8'));module[_0xf2a8('0x9')]=function(_0x571d78,_0xe063ad){return _0x571d78[_0xf2a8('0xa')](_0xf2a8('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2a8('0xc'),'collate':_0xf2a8('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9ee0c81..642ae23 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 _0x8e52=['request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x14f33d,_0x22315a){var _0x52ea7a=function(_0x27ca92){while(--_0x27ca92){_0x14f33d['push'](_0x14f33d['shift']());}};_0x52ea7a(++_0x22315a);}(_0x8e52,0x1c6));var _0x28e5=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x8e52[_0x5f3905];return _0x2923b1;};'use strict';var _=require('lodash');var util=require(_0x28e5('0x0'));var moment=require(_0x28e5('0x1'));var BPromise=require(_0x28e5('0x2'));var rs=require(_0x28e5('0x3'));var fs=require('fs');var Redis=require(_0x28e5('0x4'));var db=require(_0x28e5('0x5'))['db'];var utils=require(_0x28e5('0x6'));var logger=require(_0x28e5('0x7'))(_0x28e5('0x8'));var config=require(_0x28e5('0x9'));var jayson=require(_0x28e5('0xa'));var client=jayson[_0x28e5('0xb')][_0x28e5('0xc')]({'port':0x232a});config[_0x28e5('0xd')]=_[_0x28e5('0xe')](config['redis'],{'host':_0x28e5('0xf'),'port':0x18eb});var socket=require(_0x28e5('0x10'))(new Redis(config['redis']));require(_0x28e5('0x11'))['register'](socket);function respondWithRpcPromise(_0x43306d,_0xd9be8d,_0x33d9bd){return new BPromise(function(_0x9f21e5,_0x26d60a){return client['request'](_0x43306d,_0x33d9bd)['then'](function(_0x50a50d){logger[_0x28e5('0x12')](_0x28e5('0x13'),_0xd9be8d,'request\x20sent');logger[_0x28e5('0x14')](_0x28e5('0x15'),_0xd9be8d,_0x28e5('0x16'),JSON['stringify'](_0x50a50d));if(_0x50a50d[_0x28e5('0x17')]){if(_0x50a50d['error'][_0x28e5('0x18')]===0x1f4){logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);return _0x26d60a(_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);}logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);return _0x9f21e5(_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xd9be8d,_0x28e5('0x16'));_0x9f21e5(_0x50a50d[_0x28e5('0x1a')][_0x28e5('0x19')]);}})[_0x28e5('0x1b')](function(_0x151a8b){logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x151a8b);_0x26d60a(_0x151a8b);});});}
\ No newline at end of file
+var _0xac21=['localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xac21,0x1af));var _0x1ac2=function(_0x471ce7,_0x23b291){_0x471ce7=_0x471ce7-0x0;var _0x3591ff=_0xac21[_0x471ce7];return _0x3591ff;};'use strict';var _=require('lodash');var util=require(_0x1ac2('0x0'));var moment=require(_0x1ac2('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ac2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ac2('0x3'))['db'];var utils=require(_0x1ac2('0x4'));var logger=require('../../config/logger')(_0x1ac2('0x5'));var config=require('../../config/environment');var jayson=require(_0x1ac2('0x6'));var client=jayson[_0x1ac2('0x7')][_0x1ac2('0x8')]({'port':0x232a});config[_0x1ac2('0x9')]=_[_0x1ac2('0xa')](config[_0x1ac2('0x9')],{'host':_0x1ac2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ac2('0x9')]));require(_0x1ac2('0xc'))[_0x1ac2('0xd')](socket);function respondWithRpcPromise(_0x2ea4e1,_0x2f0079,_0x4a264a){return new BPromise(function(_0x50a79f,_0x469363){return client[_0x1ac2('0xe')](_0x2ea4e1,_0x4a264a)[_0x1ac2('0xf')](function(_0x225c01){logger[_0x1ac2('0x10')](_0x1ac2('0x11'),_0x2f0079,'request\x20sent');logger[_0x1ac2('0x12')](_0x1ac2('0x13'),_0x2f0079,_0x1ac2('0x14'),JSON[_0x1ac2('0x15')](_0x225c01));if(_0x225c01[_0x1ac2('0x16')]){if(_0x225c01[_0x1ac2('0x16')][_0x1ac2('0x17')]===0x1f4){logger[_0x1ac2('0x16')](_0x1ac2('0x11'),_0x2f0079,_0x225c01['error'][_0x1ac2('0x18')]);return _0x469363(_0x225c01[_0x1ac2('0x16')][_0x1ac2('0x18')]);}logger[_0x1ac2('0x16')](_0x1ac2('0x11'),_0x2f0079,_0x225c01[_0x1ac2('0x16')][_0x1ac2('0x18')]);return _0x50a79f(_0x225c01[_0x1ac2('0x16')]['message']);}else{logger[_0x1ac2('0x10')](_0x1ac2('0x11'),_0x2f0079,'request\x20sent');_0x50a79f(_0x225c01[_0x1ac2('0x19')][_0x1ac2('0x18')]);}})['catch'](function(_0x3c0300){logger['error'](_0x1ac2('0x11'),_0x2f0079,_0x3c0300);_0x469363(_0x3c0300);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5d28eb2..c442b32 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 _0x559d=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x58202b,_0x2d63e1){var _0x1b85d6=function(_0x3d86ce){while(--_0x3d86ce){_0x58202b['push'](_0x58202b['shift']());}};_0x1b85d6(++_0x2d63e1);}(_0x559d,0x195));var _0xd559=function(_0x4e3b9c,_0x4d76a3){_0x4e3b9c=_0x4e3b9c-0x0;var _0x358b13=_0x559d[_0x4e3b9c];return _0x358b13;};'use strict';var ChatInternalMessageEvents=require(_0xd559('0x0'));var events=[_0xd559('0x1'),'remove',_0xd559('0x2')];function createListener(_0x1fc935,_0x2f2016){return function(_0x3bf044){_0x2f2016[_0xd559('0x3')](_0x1fc935,_0x3bf044);};}function removeListener(_0x59c516,_0xd41692){return function(){ChatInternalMessageEvents[_0xd559('0x4')](_0x59c516,_0xd41692);};}exports[_0xd559('0x5')]=function(_0x287363){for(var _0x4d5e2c=0x0,_0x4c2f1f=events[_0xd559('0x6')];_0x4d5e2c<_0x4c2f1f;_0x4d5e2c++){var _0xd3f317=events[_0x4d5e2c];var _0x3392bc=createListener(_0xd559('0x7')+_0xd3f317,_0x287363);ChatInternalMessageEvents['on'](_0xd3f317,_0x3392bc);}};
\ No newline at end of file
+var _0x29aa=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x29aa,0x10e));var _0xa29a=function(_0x45d1bb,_0x35d9b4){_0x45d1bb=_0x45d1bb-0x0;var _0x4cdcba=_0x29aa[_0x45d1bb];return _0x4cdcba;};'use strict';var ChatInternalMessageEvents=require(_0xa29a('0x0'));var events=[_0xa29a('0x1'),_0xa29a('0x2'),_0xa29a('0x3')];function createListener(_0xcc3432,_0x1cb410){return function(_0x445902){_0x1cb410[_0xa29a('0x4')](_0xcc3432,_0x445902);};}function removeListener(_0x2dc5a5,_0x5b4053){return function(){ChatInternalMessageEvents[_0xa29a('0x5')](_0x2dc5a5,_0x5b4053);};}exports[_0xa29a('0x6')]=function(_0x5be15f){for(var _0x30a1b2=0x0,_0x48046c=events[_0xa29a('0x7')];_0x30a1b2<_0x48046c;_0x30a1b2++){var _0xf8165a=events[_0x30a1b2];var _0x50ba7c=createListener('chatInternalMessage:'+_0xf8165a,_0x5be15f);ChatInternalMessageEvents['on'](_0xf8165a,_0x50ba7c);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7470267..d83804c 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 _0x2771=['getUsers','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','describe','/users'];(function(_0x58a0d0,_0x5510a7){var _0x31f808=function(_0x147be8){while(--_0x147be8){_0x58a0d0['push'](_0x58a0d0['shift']());}};_0x31f808(++_0x5510a7);}(_0x2771,0x12d));var _0x1277=function(_0x2da854,_0xb44978){_0x2da854=_0x2da854-0x0;var _0x44bf04=_0x2771[_0x2da854];return _0x44bf04;};'use strict';var multer=require(_0x1277('0x0'));var util=require(_0x1277('0x1'));var path=require(_0x1277('0x2'));var timeout=require(_0x1277('0x3'));var express=require(_0x1277('0x4'));var router=express[_0x1277('0x5')]();var fs_extra=require(_0x1277('0x6'));var auth=require(_0x1277('0x7'));var interaction=require(_0x1277('0x8'));var config=require('../../config/environment');var controller=require(_0x1277('0x9'));router[_0x1277('0xa')]('/',auth[_0x1277('0xb')](),controller['index']);router[_0x1277('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x1277('0xc')]);router[_0x1277('0xa')](_0x1277('0xd'),auth['isAuthenticated'](),controller[_0x1277('0xe')]);router[_0x1277('0xa')](_0x1277('0xf'),auth[_0x1277('0xb')](),controller[_0x1277('0x10')]);router['post']('/',auth[_0x1277('0xb')](),controller['create']);router[_0x1277('0x11')](_0x1277('0xf'),controller[_0x1277('0x12')]);router['delete'](_0x1277('0xf'),auth['isAuthenticated'](),controller[_0x1277('0x13')]);module[_0x1277('0x14')]=router;
\ No newline at end of file
+var _0x299d=['/describe','getUsers','/:id','post','put','delete','destroy','exports','path','connect-timeout','express','Router','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x299d,0x168));var _0xd299=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x299d[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd299('0x0'));var timeout=require(_0xd299('0x1'));var express=require(_0xd299('0x2'));var router=express[_0xd299('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd299('0x4'));router[_0xd299('0x5')]('/',auth[_0xd299('0x6')](),controller[_0xd299('0x7')]);router[_0xd299('0x5')](_0xd299('0x8'),auth[_0xd299('0x6')](),controller['describe']);router[_0xd299('0x5')]('/users',auth[_0xd299('0x6')](),controller[_0xd299('0x9')]);router[_0xd299('0x5')](_0xd299('0xa'),auth[_0xd299('0x6')](),controller['show']);router[_0xd299('0xb')]('/',auth[_0xd299('0x6')](),controller['create']);router[_0xd299('0xc')](_0xd299('0xa'),controller['update']);router[_0xd299('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd299('0xe')]);module[_0xd299('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 3a8c4d0..55c44da 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 _0x215d=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x509b2a,_0xf91802){var _0x59ff9e=function(_0x5af97a){while(--_0x5af97a){_0x509b2a['push'](_0x509b2a['shift']());}};_0x59ff9e(++_0xf91802);}(_0x215d,0x187));var _0xd215=function(_0x4eacb8,_0x912ea){_0x4eacb8=_0x4eacb8-0x0;var _0x2ae0db=_0x215d[_0x4eacb8];return _0x2ae0db;};'use strict';var Sequelize=require(_0xd215('0x0'));module['exports']={'body':{'type':Sequelize[_0xd215('0x1')](_0xd215('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd215('0x4')]('in',_0xd215('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xd215('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd215('0x1')]}};
\ No newline at end of file
+var _0xc584=['BOOLEAN','out','DATE','exports','TEXT'];(function(_0x4a5faf,_0x12de1c){var _0x208bb6=function(_0x2b1fd7){while(--_0x2b1fd7){_0x4a5faf['push'](_0x4a5faf['shift']());}};_0x208bb6(++_0x12de1c);}(_0xc584,0xa8));var _0x4c58=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0xc584[_0x1c8cc6];return _0x522936;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'body':{'type':Sequelize[_0x4c58('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x4c58('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4c58('0x3')),'defaultValue':_0x4c58('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4c58('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4c58('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index e3129ac..173c874 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 _0xbc9a=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','catch','show','params','create','body','update','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','User','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1b8699,_0x40d2f6){var _0x3dafee=function(_0x959584){while(--_0x959584){_0x1b8699['push'](_0x1b8699['shift']());}};_0x3dafee(++_0x40d2f6);}(_0xbc9a,0x185));var _0xabc9=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0xbc9a[_0x2a558d];return _0xa7bc9c;};'use strict';var emlformat=require(_0xabc9('0x0'));var rimraf=require(_0xabc9('0x1'));var zipdir=require(_0xabc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabc9('0x3'));var moment=require(_0xabc9('0x4'));var BPromise=require(_0xabc9('0x5'));var Mustache=require(_0xabc9('0x6'));var util=require(_0xabc9('0x7'));var path=require('path');var sox=require(_0xabc9('0x8'));var csv=require('to-csv');var ejs=require(_0xabc9('0x9'));var fs=require('fs');var fs_extra=require(_0xabc9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xabc9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabc9('0xc'));var toCsv=require(_0xabc9('0xd'));var querystring=require('querystring');var Papa=require(_0xabc9('0xe'));var Redis=require(_0xabc9('0xf'));var authService=require(_0xabc9('0x10'));var qs=require(_0xabc9('0x11'));var as=require(_0xabc9('0x12'));var hardwareService=require(_0xabc9('0x13'));var logger=require(_0xabc9('0x14'))(_0xabc9('0x15'));var utils=require(_0xabc9('0x16'));var config=require(_0xabc9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xabc9('0x18'))['db'];config['redis']=_[_0xabc9('0x19')](config[_0xabc9('0x1a')],{'host':_0xabc9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabc9('0x1a')]));require(_0xabc9('0x1c'))[_0xabc9('0x1d')](socket);var jayson=require(_0xabc9('0x1e'));var client=jayson[_0xabc9('0x1f')][_0xabc9('0x20')]({'port':0x232c});var client9002=jayson[_0xabc9('0x1f')][_0xabc9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5d5377,_0x2aa7cf,_0x29c44a,_0x5e9b1a){return new BPromise(function(_0x5f3785,_0x227a77){var _0x581c0a=_0x5e9b1a||client;return _0x581c0a[_0xabc9('0x21')](_0x5d5377,_0x29c44a)[_0xabc9('0x22')](function(_0x22ab8f){logger[_0xabc9('0x23')](_0xabc9('0x24'),_0x2aa7cf,_0xabc9('0x25'));logger[_0xabc9('0x26')](_0xabc9('0x27'),_0x2aa7cf,_0xabc9('0x25'),JSON[_0xabc9('0x28')](_0x22ab8f));if(_0x22ab8f[_0xabc9('0x29')]){if(_0x22ab8f['error'][_0xabc9('0x2a')]===0x1f4){logger[_0xabc9('0x29')](_0xabc9('0x24'),_0x2aa7cf,_0x22ab8f[_0xabc9('0x29')]['message']);return _0x227a77(_0x22ab8f[_0xabc9('0x29')][_0xabc9('0x2b')]);}logger[_0xabc9('0x29')]('ChatMessage,\x20%s,\x20%s',_0x2aa7cf,_0x22ab8f[_0xabc9('0x29')][_0xabc9('0x2b')]);return _0x5f3785(_0x22ab8f[_0xabc9('0x29')]['message']);}else{logger[_0xabc9('0x23')]('ChatMessage,\x20%s,\x20%s',_0x2aa7cf,'request\x20sent');_0x5f3785(_0x22ab8f[_0xabc9('0x2c')][_0xabc9('0x2b')]);}})['catch'](function(_0x10196a){logger[_0xabc9('0x29')]('ChatMessage,\x20%s,\x20%s',_0x2aa7cf,_0x10196a);_0x227a77(_0x10196a);});});}function respondWithStatusCode(_0x59613f,_0x4046be){_0x4046be=_0x4046be||0xcc;return function(_0x5478ac){if(_0x5478ac){return _0x59613f[_0xabc9('0x2d')](_0x4046be);}return _0x59613f[_0xabc9('0x2e')](_0x4046be)[_0xabc9('0x2f')]();};}function respondWithResult(_0x3eeb6f,_0x3babfe){_0x3babfe=_0x3babfe||0xc8;return function(_0x22cead){if(_0x22cead){return _0x3eeb6f[_0xabc9('0x2e')](_0x3babfe)['json'](_0x22cead);}};}function respondWithFilteredResult(_0x3c98c8,_0x59b388){return function(_0x3db835){if(_0x3db835){var _0x2cec75=typeof _0x59b388[_0xabc9('0x30')]===_0xabc9('0x31')&&typeof _0x59b388[_0xabc9('0x32')]===_0xabc9('0x31');var _0x277096=_0x3db835[_0xabc9('0x33')];var _0x203479=_0x2cec75?0x0:_0x59b388[_0xabc9('0x30')];var _0x558289=_0x2cec75?_0x3db835['count']:_0x59b388[_0xabc9('0x30')]+_0x59b388[_0xabc9('0x32')];var _0x237a38;if(_0x558289>=_0x277096){_0x558289=_0x277096;_0x237a38=0xc8;}else{_0x237a38=0xce;}_0x3c98c8['status'](_0x237a38);return _0x3c98c8[_0xabc9('0x34')](_0xabc9('0x35'),_0x203479+'-'+_0x558289+'/'+_0x277096)['json'](_0x3db835);}return null;};}function patchUpdates(_0x58f799){return function(_0xbb8800){try{jsonpatch[_0xabc9('0x36')](_0xbb8800,_0x58f799,!![]);}catch(_0x4c26ee){return BPromise[_0xabc9('0x37')](_0x4c26ee);}return _0xbb8800[_0xabc9('0x38')]();};}function saveUpdates(_0x174eef,_0x483a63){return function(_0x38eb0c){if(_0x38eb0c){return _0x38eb0c['update'](_0x174eef)[_0xabc9('0x22')](function(_0x1bfc40){return _0x1bfc40;});}return null;};}function removeEntity(_0x4d325a,_0x1b9e5d){return function(_0x301f66){if(_0x301f66){return _0x301f66[_0xabc9('0x39')]()[_0xabc9('0x22')](function(){_0x4d325a['status'](0xcc)[_0xabc9('0x2f')]();});}};}function handleEntityNotFound(_0x5c8063,_0x48032b){return function(_0x175d8e){if(!_0x175d8e){_0x5c8063[_0xabc9('0x2d')](0x194);}return _0x175d8e;};}function handleError(_0x11a3fe,_0x3cd636){_0x3cd636=_0x3cd636||0x1f4;return function(_0x36de2e){logger['error'](_0x36de2e[_0xabc9('0x3a')]);if(_0x36de2e[_0xabc9('0x3b')]){delete _0x36de2e[_0xabc9('0x3b')];}_0x11a3fe[_0xabc9('0x2e')](_0x3cd636)[_0xabc9('0x3c')](_0x36de2e);};}exports['index']=function(_0x17f607,_0x53bcb9){var _0x189afc={},_0x2f9b10={},_0x34d660={'count':0x0,'rows':[]};var _0x5398ea=_['map'](db['ChatMessage'][_0xabc9('0x3d')],function(_0x2a5dd1){return{'name':_0x2a5dd1['fieldName'],'type':_0x2a5dd1[_0xabc9('0x3e')]['key']};});_0x2f9b10[_0xabc9('0x3f')]=_[_0xabc9('0x40')](_0x5398ea,'name');_0x2f9b10['query']=_[_0xabc9('0x41')](_0x17f607[_0xabc9('0x42')]);_0x2f9b10[_0xabc9('0x43')]=_[_0xabc9('0x44')](_0x2f9b10[_0xabc9('0x3f')],_0x2f9b10[_0xabc9('0x42')]);_0x189afc[_0xabc9('0x45')]=_[_0xabc9('0x44')](_0x2f9b10[_0xabc9('0x3f')],qs['fields'](_0x17f607[_0xabc9('0x42')][_0xabc9('0x46')]));_0x189afc[_0xabc9('0x45')]=_0x189afc[_0xabc9('0x45')][_0xabc9('0x47')]?_0x189afc[_0xabc9('0x45')]:_0x2f9b10['model'];if(!_0x17f607[_0xabc9('0x42')][_0xabc9('0x48')](_0xabc9('0x49'))){_0x189afc[_0xabc9('0x32')]=qs[_0xabc9('0x32')](_0x17f607[_0xabc9('0x42')][_0xabc9('0x32')]);_0x189afc[_0xabc9('0x30')]=qs[_0xabc9('0x30')](_0x17f607[_0xabc9('0x42')]['offset']);}_0x189afc['order']=qs[_0xabc9('0x4a')](_0x17f607['query'][_0xabc9('0x4a')]);_0x189afc[_0xabc9('0x4b')]=qs[_0xabc9('0x43')](_[_0xabc9('0x4c')](_0x17f607[_0xabc9('0x42')],_0x2f9b10[_0xabc9('0x43')]),_0x5398ea);if(_0x17f607[_0xabc9('0x42')][_0xabc9('0x4d')]){_0x189afc[_0xabc9('0x4b')]=_[_0xabc9('0x4e')](_0x189afc['where'],{'$or':_[_0xabc9('0x40')](_0x5398ea,function(_0x18b9d8){if(_0x18b9d8['type']!==_0xabc9('0x4f')){var _0xbee613={};_0xbee613[_0x18b9d8['name']]={'$like':'%'+_0x17f607[_0xabc9('0x42')]['filter']+'%'};return _0xbee613;}})});}_0x189afc=_['merge']({},_0x189afc,_0x17f607[_0xabc9('0x50')]);var _0x320939={'where':_0x189afc[_0xabc9('0x4b')]};return db[_0xabc9('0x51')][_0xabc9('0x33')](_0x320939)[_0xabc9('0x22')](function(_0x49cea0){_0x34d660['count']=_0x49cea0;if(_0x17f607[_0xabc9('0x42')][_0xabc9('0x52')]){_0x189afc[_0xabc9('0x53')]=[{'all':!![]}];}return db[_0xabc9('0x51')][_0xabc9('0x54')](_0x189afc);})[_0xabc9('0x22')](function(_0x3ed930){_0x34d660[_0xabc9('0x55')]=_0x3ed930;return _0x34d660;})[_0xabc9('0x22')](respondWithFilteredResult(_0x53bcb9,_0x189afc))[_0xabc9('0x56')](handleError(_0x53bcb9,null));};exports[_0xabc9('0x57')]=function(_0x14682f,_0x466813){var _0x5bad92={'raw':!![],'where':{'id':_0x14682f[_0xabc9('0x58')]['id']}},_0x132b30={};_0x132b30[_0xabc9('0x3f')]=_[_0xabc9('0x41')](db[_0xabc9('0x51')][_0xabc9('0x3d')]);_0x132b30[_0xabc9('0x42')]=_[_0xabc9('0x41')](_0x14682f[_0xabc9('0x42')]);_0x132b30[_0xabc9('0x43')]=_[_0xabc9('0x44')](_0x132b30['model'],_0x132b30['query']);_0x5bad92[_0xabc9('0x45')]=_[_0xabc9('0x44')](_0x132b30[_0xabc9('0x3f')],qs['fields'](_0x14682f[_0xabc9('0x42')][_0xabc9('0x46')]));_0x5bad92[_0xabc9('0x45')]=_0x5bad92[_0xabc9('0x45')][_0xabc9('0x47')]?_0x5bad92[_0xabc9('0x45')]:_0x132b30[_0xabc9('0x3f')];if(_0x14682f['query']['includeAll']){_0x5bad92[_0xabc9('0x53')]=[{'all':!![]}];}_0x5bad92=_[_0xabc9('0x4e')]({},_0x5bad92,_0x14682f[_0xabc9('0x50')]);return db['ChatMessage']['find'](_0x5bad92)[_0xabc9('0x22')](handleEntityNotFound(_0x466813,null))[_0xabc9('0x22')](respondWithResult(_0x466813,null))[_0xabc9('0x56')](handleError(_0x466813,null));};exports[_0xabc9('0x59')]=function(_0x291d7d,_0xd44c79){return db[_0xabc9('0x51')]['create'](_0x291d7d[_0xabc9('0x5a')],{})[_0xabc9('0x22')](respondWithResult(_0xd44c79,0xc9))['catch'](handleError(_0xd44c79,null));};exports[_0xabc9('0x5b')]=function(_0x3665c9,_0x538993){if(_0x3665c9[_0xabc9('0x5a')]['id']){delete _0x3665c9[_0xabc9('0x5a')]['id'];}return db[_0xabc9('0x51')]['find']({'where':{'id':_0x3665c9['params']['id']}})[_0xabc9('0x22')](handleEntityNotFound(_0x538993,null))[_0xabc9('0x22')](saveUpdates(_0x3665c9[_0xabc9('0x5a')],null))[_0xabc9('0x22')](respondWithResult(_0x538993,null))[_0xabc9('0x56')](handleError(_0x538993,null));};exports[_0xabc9('0x39')]=function(_0x53ac58,_0x245c2b){return db['ChatMessage']['find']({'where':{'id':_0x53ac58[_0xabc9('0x58')]['id']}})[_0xabc9('0x22')](handleEntityNotFound(_0x245c2b,null))['then'](removeEntity(_0x245c2b,null))[_0xabc9('0x56')](handleError(_0x245c2b,null));};exports['describe']=function(_0x25dcac,_0x2ac54d){return db['ChatMessage'][_0xabc9('0x5c')]()[_0xabc9('0x22')](respondWithResult(_0x2ac54d,null))[_0xabc9('0x56')](handleError(_0x2ac54d,null));};var interaction_log=require(_0xabc9('0x14'))('chat-interactions');exports[_0xabc9('0x5d')]=function(_0x1c0027,_0xf3031b,_0x244b50){var _0x2264ec={'agent':{},'channel':_0xabc9('0x5e')};if(_0x1c0027['body']['id']){delete _0x1c0027['body']['id'];}_0x1c0027[_0xabc9('0x5a')][_0xabc9('0x5f')]=!![];_0x1c0027[_0xabc9('0x5a')][_0xabc9('0x60')]=moment()[_0xabc9('0x61')](_0xabc9('0x62'));_0x1c0027[_0xabc9('0x5a')]['UserId']=_0x1c0027[_0xabc9('0x5a')][_0xabc9('0x63')]||_0x1c0027[_0xabc9('0x64')]['id'];_0x2264ec['agent']['id']=_0x1c0027[_0xabc9('0x5a')]['UserId'];return db[_0xabc9('0x51')][_0xabc9('0x65')]({'where':{'id':_0x1c0027[_0xabc9('0x58')]['id'],'UserId':null}})[_0xabc9('0x22')](handleEntityNotFound(_0xf3031b,null))[_0xabc9('0x22')](saveUpdates(_0x1c0027[_0xabc9('0x5a')],null))['then'](function(_0x4d2527){if(_0x4d2527){_0x2264ec[_0xabc9('0x2b')]=_0x4d2527[_0xabc9('0x66')]({'plain':!![]});return db[_0xabc9('0x67')][_0xabc9('0x65')]({'where':{'id':_0x4d2527[_0xabc9('0x68')]}});}return null;})[_0xabc9('0x22')](handleEntityNotFound(_0xf3031b,null))['then'](function(_0x362da0){if(_0x362da0){return _0x362da0[_0xabc9('0x5b')]({'UserId':_0x1c0027[_0xabc9('0x5a')]['UserId'],'read1stAt':_[_0xabc9('0x69')](_0x362da0[_0xabc9('0x6a')])?moment()[_0xabc9('0x61')](_0xabc9('0x62')):undefined});}return null;})[_0xabc9('0x22')](function(_0x3bf637){if(_0x3bf637){_0x2264ec[_0xabc9('0x6b')]=_0x3bf637[_0xabc9('0x66')]({'plain':!![]});interaction_log[_0xabc9('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c0027['user']['id'],_0x1c0027['user'][_0xabc9('0x3b')],_0x1c0027[_0xabc9('0x64')]['role'],_0x2264ec[_0xabc9('0x6b')]['id'],_0x1c0027[_0xabc9('0x5a')]?JSON[_0xabc9('0x28')](_0x1c0027[_0xabc9('0x5a')]):_0xabc9('0x6c'));return respondWithRpcPromise(_0xabc9('0x6d'),_0xabc9('0x6e'),_0x2264ec);}return null;})[_0xabc9('0x22')](function(_0x393281){var _0x5dcc49=_0xabc9('0x6f')+_0x393281[_0xabc9('0x2b')][_0xabc9('0x70')];return db[_0xabc9('0x71')][_0xabc9('0x42')](_0x5dcc49,{'type':db[_0xabc9('0x72')][_0xabc9('0x73')][_0xabc9('0x74')],'raw':!![]})[_0xabc9('0x22')](function(_0x995f16){return _0x995f16;});})[_0xabc9('0x22')](function(_0xc33c17){if(_0xc33c17){_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x75')]=_0xc33c17[0x0];if(!_0x1c0027['body']['UserId'])return;return db['User'][_0xabc9('0x65')]({'where':{'id':_0x1c0027[_0xabc9('0x5a')]['UserId'],'role':_0xabc9('0x76')},'attributes':['id',_0xabc9('0x3b'),_0xabc9('0x77'),'email',_0xabc9('0x78')],'raw':!![]});}return null;})['then'](function(_0x1da167){if(!_0x1da167)return null;_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x76')]=_0x1da167;return _0x2264ec;})[_0xabc9('0x22')](function(_0x583a8a){if(_0x583a8a){if(_0x1c0027['body']['manual']){_0x2264ec['message'][_0xabc9('0x79')]=util[_0xabc9('0x61')](_0xabc9('0x7a'),_0x1c0027['user']['name']);_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x7b')]=_0x2264ec[_0xabc9('0x7b')];_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x7c')]=_0x2264ec[_0xabc9('0x7b')];_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x7d')]='accept';return respondWithRpcPromise('EventManager',_0xabc9('0x7e'),{'event':_0xabc9('0x7f'),'message':_[_0xabc9('0x4e')](_0x2264ec[_0xabc9('0x2b')],JSON[_0xabc9('0x80')](_0x2264ec[_0xabc9('0x6b')]['formData']))},client9002)[_0xabc9('0x22')](function(){return _0x2264ec;});}return _0x2264ec;}return null;})[_0xabc9('0x22')](respondWithResult(_0xf3031b,null))[_0xabc9('0x56')](handleError(_0xf3031b,null));};var interaction_log=require('../../config/logger')(_0xabc9('0x81'));exports[_0xabc9('0x37')]=function(_0x336879,_0x562d07,_0x2394a9){var _0x113d46={'agent':{},'channel':'chat'};if(_0x336879[_0xabc9('0x5a')]['id']){delete _0x336879['body']['id'];}_0x336879['body']['UserId']=_0x336879['body'][_0xabc9('0x63')]||_0x336879['user']['id'];_0x113d46[_0xabc9('0x76')]['id']=_0x336879[_0xabc9('0x5a')][_0xabc9('0x63')];return db[_0xabc9('0x51')][_0xabc9('0x65')]({'where':{'id':_0x336879[_0xabc9('0x58')]['id'],'UserId':null}})[_0xabc9('0x22')](handleEntityNotFound(_0x562d07,null))[_0xabc9('0x22')](function(_0x49959b){if(_0x49959b){_0x113d46['message']=_0x49959b[_0xabc9('0x66')]({'plain':!![]});return db[_0xabc9('0x67')][_0xabc9('0x65')]({'where':{'id':_0x49959b[_0xabc9('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x562d07,null))[_0xabc9('0x22')](function(_0x3893cd){if(_0x3893cd){_0x113d46['interaction']=_0x3893cd[_0xabc9('0x66')]({'plain':!![]});interaction_log[_0xabc9('0x23')](_0xabc9('0x82'),_0x336879['user']['id'],_0x336879[_0xabc9('0x64')][_0xabc9('0x3b')],_0x336879[_0xabc9('0x64')][_0xabc9('0x83')],_0x113d46[_0xabc9('0x6b')]['id'],_0x336879[_0xabc9('0x5a')]?JSON[_0xabc9('0x28')](_0x336879[_0xabc9('0x5a')]):'null');return respondWithRpcPromise(_0xabc9('0x84'),_0xabc9('0x85'),_0x113d46);}return null;})[_0xabc9('0x22')](function(_0x93981b){var _0x51657c=_0xabc9('0x6f')+_0x93981b['message'][_0xabc9('0x70')];return db[_0xabc9('0x71')]['query'](_0x51657c,{'type':db[_0xabc9('0x72')][_0xabc9('0x73')][_0xabc9('0x74')],'raw':!![]})[_0xabc9('0x22')](function(_0x24de3e){return _0x24de3e;});})[_0xabc9('0x22')](function(_0x33989e){if(_0x33989e){_0x113d46[_0xabc9('0x2b')][_0xabc9('0x75')]=_0x33989e[0x0];if(!_0x336879[_0xabc9('0x5a')][_0xabc9('0x63')])return;return db[_0xabc9('0x86')][_0xabc9('0x65')]({'where':{'id':_0x336879[_0xabc9('0x5a')][_0xabc9('0x63')],'role':_0xabc9('0x76')},'attributes':['id',_0xabc9('0x3b'),_0xabc9('0x77'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x25a315){if(!_0x25a315)return null;_0x113d46[_0xabc9('0x2b')]['agent']=_0x25a315;return _0x113d46;})[_0xabc9('0x22')](function(_0x5e4ea3){if(_0x5e4ea3){_0x5e4ea3['message'][_0xabc9('0x79')]=util[_0xabc9('0x61')](_0xabc9('0x7a'),_0x336879[_0xabc9('0x64')][_0xabc9('0x3b')]);_0x5e4ea3[_0xabc9('0x2b')][_0xabc9('0x7b')]=_0x113d46[_0xabc9('0x7b')];_0x5e4ea3[_0xabc9('0x2b')][_0xabc9('0x7c')]=_0x113d46['channel'];_0x5e4ea3[_0xabc9('0x2b')][_0xabc9('0x7d')]=_0xabc9('0x37');respondWithRpcPromise(_0xabc9('0x7e'),_0xabc9('0x7e'),{'event':_0xabc9('0x87'),'message':_[_0xabc9('0x4e')](_0x113d46[_0xabc9('0x2b')],JSON[_0xabc9('0x80')](_0x113d46[_0xabc9('0x6b')]['formData']))},client9002);return _0x113d46;}return null;})[_0xabc9('0x22')](respondWithResult(_0x562d07,null))['catch'](handleError(_0x562d07,null));};
\ No newline at end of file
+var _0xb306=['params','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','manual','interface','SIP/%s','motionChannel','channel','event','acceptmessage','parse','formData','reject','ChatInteraction','role','RejectMessage','Sequelize','fullname','EventManager','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show'];(function(_0x19bd2f,_0xc0fce){var _0x51ed84=function(_0x5d9479){while(--_0x5d9479){_0x19bd2f['push'](_0x19bd2f['shift']());}};_0x51ed84(++_0xc0fce);}(_0xb306,0x132));var _0x6b30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb306[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b30('0x0'));var zipdir=require(_0x6b30('0x1'));var jsonpatch=require(_0x6b30('0x2'));var rp=require(_0x6b30('0x3'));var moment=require(_0x6b30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6b30('0x5'));var util=require(_0x6b30('0x6'));var path=require(_0x6b30('0x7'));var sox=require(_0x6b30('0x8'));var csv=require('to-csv');var ejs=require(_0x6b30('0x9'));var fs=require('fs');var fs_extra=require(_0x6b30('0xa'));var _=require(_0x6b30('0xb'));var squel=require(_0x6b30('0xc'));var crypto=require(_0x6b30('0xd'));var jsforce=require(_0x6b30('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6b30('0xf'));var querystring=require(_0x6b30('0x10'));var Papa=require(_0x6b30('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6b30('0x12'));var as=require(_0x6b30('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b30('0x14'))(_0x6b30('0x15'));var utils=require('../../config/utils');var config=require(_0x6b30('0x16'));var licenseUtil=require(_0x6b30('0x17'));var db=require('../../mysqldb')['db'];config[_0x6b30('0x18')]=_['defaults'](config[_0x6b30('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b30('0x19'))(new Redis(config[_0x6b30('0x18')]));require(_0x6b30('0x1a'))[_0x6b30('0x1b')](socket);var jayson=require(_0x6b30('0x1c'));var client=jayson[_0x6b30('0x1d')][_0x6b30('0x1e')]({'port':0x232c});var client9002=jayson[_0x6b30('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x476006,_0x5dd1b3,_0x12a48f,_0x59ac4d){return new BPromise(function(_0x1d270d,_0x58f593){var _0x525898=_0x59ac4d||client;return _0x525898[_0x6b30('0x1f')](_0x476006,_0x12a48f)[_0x6b30('0x20')](function(_0x208236){logger[_0x6b30('0x21')]('ChatMessage,\x20%s,\x20%s',_0x5dd1b3,_0x6b30('0x22'));logger[_0x6b30('0x23')](_0x6b30('0x24'),_0x5dd1b3,_0x6b30('0x22'),JSON[_0x6b30('0x25')](_0x208236));if(_0x208236[_0x6b30('0x26')]){if(_0x208236[_0x6b30('0x26')][_0x6b30('0x27')]===0x1f4){logger[_0x6b30('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5dd1b3,_0x208236[_0x6b30('0x26')]['message']);return _0x58f593(_0x208236[_0x6b30('0x26')][_0x6b30('0x28')]);}logger[_0x6b30('0x26')](_0x6b30('0x29'),_0x5dd1b3,_0x208236[_0x6b30('0x26')][_0x6b30('0x28')]);return _0x1d270d(_0x208236[_0x6b30('0x26')][_0x6b30('0x28')]);}else{logger[_0x6b30('0x21')]('ChatMessage,\x20%s,\x20%s',_0x5dd1b3,'request\x20sent');_0x1d270d(_0x208236[_0x6b30('0x2a')][_0x6b30('0x28')]);}})[_0x6b30('0x2b')](function(_0x43f2a4){logger[_0x6b30('0x26')](_0x6b30('0x29'),_0x5dd1b3,_0x43f2a4);_0x58f593(_0x43f2a4);});});}function respondWithStatusCode(_0x259580,_0x57d8c7){_0x57d8c7=_0x57d8c7||0xcc;return function(_0x13e2d6){if(_0x13e2d6){return _0x259580[_0x6b30('0x2c')](_0x57d8c7);}return _0x259580[_0x6b30('0x2d')](_0x57d8c7)[_0x6b30('0x2e')]();};}function respondWithResult(_0x428114,_0x1a49c9){_0x1a49c9=_0x1a49c9||0xc8;return function(_0x324e21){if(_0x324e21){return _0x428114['status'](_0x1a49c9)['json'](_0x324e21);}};}function respondWithFilteredResult(_0x28a523,_0x2c0cc4){return function(_0x403d3a){if(_0x403d3a){var _0x1d5478=typeof _0x2c0cc4[_0x6b30('0x2f')]===_0x6b30('0x30')&&typeof _0x2c0cc4[_0x6b30('0x31')]===_0x6b30('0x30');var _0x5128b5=_0x403d3a[_0x6b30('0x32')];var _0x5aa7c5=_0x1d5478?0x0:_0x2c0cc4[_0x6b30('0x2f')];var _0x13877a=_0x1d5478?_0x403d3a[_0x6b30('0x32')]:_0x2c0cc4[_0x6b30('0x2f')]+_0x2c0cc4['limit'];var _0x7b7631;if(_0x13877a>=_0x5128b5){_0x13877a=_0x5128b5;_0x7b7631=0xc8;}else{_0x7b7631=0xce;}_0x28a523[_0x6b30('0x2d')](_0x7b7631);return _0x28a523[_0x6b30('0x33')](_0x6b30('0x34'),_0x5aa7c5+'-'+_0x13877a+'/'+_0x5128b5)[_0x6b30('0x35')](_0x403d3a);}return null;};}function patchUpdates(_0x4680c4){return function(_0x276d22){try{jsonpatch[_0x6b30('0x36')](_0x276d22,_0x4680c4,!![]);}catch(_0x19fdb3){return BPromise['reject'](_0x19fdb3);}return _0x276d22[_0x6b30('0x37')]();};}function saveUpdates(_0x5e9841,_0x11602e){return function(_0x28581e){if(_0x28581e){return _0x28581e[_0x6b30('0x38')](_0x5e9841)[_0x6b30('0x20')](function(_0x1c0288){return _0x1c0288;});}return null;};}function removeEntity(_0x2181d1,_0x359189){return function(_0x2849de){if(_0x2849de){return _0x2849de[_0x6b30('0x39')]()[_0x6b30('0x20')](function(){_0x2181d1[_0x6b30('0x2d')](0xcc)[_0x6b30('0x2e')]();});}};}function handleEntityNotFound(_0x4866df,_0x5a772c){return function(_0x58db64){if(!_0x58db64){_0x4866df[_0x6b30('0x2c')](0x194);}return _0x58db64;};}function handleError(_0x5d9178,_0x17d877){_0x17d877=_0x17d877||0x1f4;return function(_0xf1a0a0){logger[_0x6b30('0x26')](_0xf1a0a0[_0x6b30('0x3a')]);if(_0xf1a0a0[_0x6b30('0x3b')]){delete _0xf1a0a0['name'];}_0x5d9178[_0x6b30('0x2d')](_0x17d877)['send'](_0xf1a0a0);};}exports[_0x6b30('0x3c')]=function(_0x6944ec,_0x1ba7ab){var _0x462e1a={},_0x4b77d5={},_0x21d1ad={'count':0x0,'rows':[]};var _0x104595=_[_0x6b30('0x3d')](db[_0x6b30('0x3e')][_0x6b30('0x3f')],function(_0x33f521){return{'name':_0x33f521['fieldName'],'type':_0x33f521[_0x6b30('0x40')]['key']};});_0x4b77d5[_0x6b30('0x41')]=_[_0x6b30('0x3d')](_0x104595,_0x6b30('0x3b'));_0x4b77d5[_0x6b30('0x42')]=_[_0x6b30('0x43')](_0x6944ec[_0x6b30('0x42')]);_0x4b77d5[_0x6b30('0x44')]=_[_0x6b30('0x45')](_0x4b77d5[_0x6b30('0x41')],_0x4b77d5[_0x6b30('0x42')]);_0x462e1a[_0x6b30('0x46')]=_['intersection'](_0x4b77d5[_0x6b30('0x41')],qs[_0x6b30('0x47')](_0x6944ec[_0x6b30('0x42')][_0x6b30('0x47')]));_0x462e1a[_0x6b30('0x46')]=_0x462e1a[_0x6b30('0x46')][_0x6b30('0x48')]?_0x462e1a['attributes']:_0x4b77d5['model'];if(!_0x6944ec[_0x6b30('0x42')][_0x6b30('0x49')](_0x6b30('0x4a'))){_0x462e1a['limit']=qs[_0x6b30('0x31')](_0x6944ec[_0x6b30('0x42')][_0x6b30('0x31')]);_0x462e1a[_0x6b30('0x2f')]=qs[_0x6b30('0x2f')](_0x6944ec[_0x6b30('0x42')][_0x6b30('0x2f')]);}_0x462e1a[_0x6b30('0x4b')]=qs[_0x6b30('0x4c')](_0x6944ec['query'][_0x6b30('0x4c')]);_0x462e1a[_0x6b30('0x4d')]=qs[_0x6b30('0x44')](_[_0x6b30('0x4e')](_0x6944ec[_0x6b30('0x42')],_0x4b77d5[_0x6b30('0x44')]),_0x104595);if(_0x6944ec['query'][_0x6b30('0x4f')]){_0x462e1a[_0x6b30('0x4d')]=_['merge'](_0x462e1a[_0x6b30('0x4d')],{'$or':_[_0x6b30('0x3d')](_0x104595,function(_0x36ded7){if(_0x36ded7[_0x6b30('0x40')]!==_0x6b30('0x50')){var _0x4992da={};_0x4992da[_0x36ded7['name']]={'$like':'%'+_0x6944ec[_0x6b30('0x42')][_0x6b30('0x4f')]+'%'};return _0x4992da;}})});}_0x462e1a=_[_0x6b30('0x51')]({},_0x462e1a,_0x6944ec[_0x6b30('0x52')]);var _0x3a6688={'where':_0x462e1a[_0x6b30('0x4d')]};return db[_0x6b30('0x3e')][_0x6b30('0x32')](_0x3a6688)[_0x6b30('0x20')](function(_0x4bf99c){_0x21d1ad[_0x6b30('0x32')]=_0x4bf99c;if(_0x6944ec['query'][_0x6b30('0x53')]){_0x462e1a[_0x6b30('0x54')]=[{'all':!![]}];}return db[_0x6b30('0x3e')][_0x6b30('0x55')](_0x462e1a);})[_0x6b30('0x20')](function(_0x23ab07){_0x21d1ad['rows']=_0x23ab07;return _0x21d1ad;})['then'](respondWithFilteredResult(_0x1ba7ab,_0x462e1a))[_0x6b30('0x2b')](handleError(_0x1ba7ab,null));};exports[_0x6b30('0x56')]=function(_0x74bd2d,_0x47e099){var _0x454b5c={'raw':!![],'where':{'id':_0x74bd2d[_0x6b30('0x57')]['id']}},_0x28c688={};_0x28c688['model']=_['keys'](db[_0x6b30('0x3e')]['rawAttributes']);_0x28c688[_0x6b30('0x42')]=_[_0x6b30('0x43')](_0x74bd2d[_0x6b30('0x42')]);_0x28c688[_0x6b30('0x44')]=_[_0x6b30('0x45')](_0x28c688[_0x6b30('0x41')],_0x28c688['query']);_0x454b5c[_0x6b30('0x46')]=_[_0x6b30('0x45')](_0x28c688['model'],qs[_0x6b30('0x47')](_0x74bd2d['query'][_0x6b30('0x47')]));_0x454b5c[_0x6b30('0x46')]=_0x454b5c[_0x6b30('0x46')][_0x6b30('0x48')]?_0x454b5c[_0x6b30('0x46')]:_0x28c688[_0x6b30('0x41')];if(_0x74bd2d['query'][_0x6b30('0x53')]){_0x454b5c[_0x6b30('0x54')]=[{'all':!![]}];}_0x454b5c=_['merge']({},_0x454b5c,_0x74bd2d[_0x6b30('0x52')]);return db[_0x6b30('0x3e')][_0x6b30('0x58')](_0x454b5c)[_0x6b30('0x20')](handleEntityNotFound(_0x47e099,null))[_0x6b30('0x20')](respondWithResult(_0x47e099,null))[_0x6b30('0x2b')](handleError(_0x47e099,null));};exports[_0x6b30('0x59')]=function(_0xd8828,_0x4ca664){return db['ChatMessage']['create'](_0xd8828[_0x6b30('0x5a')],{})[_0x6b30('0x20')](respondWithResult(_0x4ca664,0xc9))[_0x6b30('0x2b')](handleError(_0x4ca664,null));};exports[_0x6b30('0x38')]=function(_0x4b5664,_0x2f2548){if(_0x4b5664['body']['id']){delete _0x4b5664[_0x6b30('0x5a')]['id'];}return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x4b5664[_0x6b30('0x57')]['id']}})[_0x6b30('0x20')](handleEntityNotFound(_0x2f2548,null))[_0x6b30('0x20')](saveUpdates(_0x4b5664[_0x6b30('0x5a')],null))[_0x6b30('0x20')](respondWithResult(_0x2f2548,null))[_0x6b30('0x2b')](handleError(_0x2f2548,null));};exports[_0x6b30('0x39')]=function(_0x43ce19,_0x100581){return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x43ce19['params']['id']}})['then'](handleEntityNotFound(_0x100581,null))['then'](removeEntity(_0x100581,null))[_0x6b30('0x2b')](handleError(_0x100581,null));};exports['describe']=function(_0x5b379f,_0x299c7d){return db[_0x6b30('0x3e')][_0x6b30('0x5b')]()[_0x6b30('0x20')](respondWithResult(_0x299c7d,null))['catch'](handleError(_0x299c7d,null));};var interaction_log=require('../../config/logger')(_0x6b30('0x5c'));exports[_0x6b30('0x5d')]=function(_0x10791a,_0x1c8101,_0x51b9d9){var _0x4d26bb={'agent':{},'channel':_0x6b30('0x5e')};if(_0x10791a[_0x6b30('0x5a')]['id']){delete _0x10791a[_0x6b30('0x5a')]['id'];}_0x10791a[_0x6b30('0x5a')][_0x6b30('0x5f')]=!![];_0x10791a[_0x6b30('0x5a')]['readAt']=moment()[_0x6b30('0x60')](_0x6b30('0x61'));_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')]=_0x10791a[_0x6b30('0x5a')]['UserId']||_0x10791a[_0x6b30('0x63')]['id'];_0x4d26bb[_0x6b30('0x64')]['id']=_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')];return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x10791a[_0x6b30('0x57')]['id'],'UserId':null}})[_0x6b30('0x20')](handleEntityNotFound(_0x1c8101,null))[_0x6b30('0x20')](saveUpdates(_0x10791a[_0x6b30('0x5a')],null))[_0x6b30('0x20')](function(_0x580416){if(_0x580416){_0x4d26bb[_0x6b30('0x28')]=_0x580416[_0x6b30('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x6b30('0x58')]({'where':{'id':_0x580416[_0x6b30('0x66')]}});}return null;})[_0x6b30('0x20')](handleEntityNotFound(_0x1c8101,null))[_0x6b30('0x20')](function(_0x432524){if(_0x432524){return _0x432524[_0x6b30('0x38')]({'UserId':_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')],'read1stAt':_[_0x6b30('0x67')](_0x432524['read1stAt'])?moment()[_0x6b30('0x60')](_0x6b30('0x61')):undefined});}return null;})[_0x6b30('0x20')](function(_0x18b2e2){if(_0x18b2e2){_0x4d26bb[_0x6b30('0x68')]=_0x18b2e2[_0x6b30('0x65')]({'plain':!![]});interaction_log[_0x6b30('0x21')](_0x6b30('0x69'),_0x10791a[_0x6b30('0x63')]['id'],_0x10791a[_0x6b30('0x63')][_0x6b30('0x3b')],_0x10791a[_0x6b30('0x63')]['role'],_0x4d26bb['interaction']['id'],_0x10791a['body']?JSON[_0x6b30('0x25')](_0x10791a['body']):_0x6b30('0x6a'));return respondWithRpcPromise(_0x6b30('0x6b'),_0x6b30('0x6c'),_0x4d26bb);}return null;})[_0x6b30('0x20')](function(_0x20aae9){var _0x46244f=_0x6b30('0x6d')+_0x20aae9[_0x6b30('0x28')][_0x6b30('0x6e')];return db['sequelize'][_0x6b30('0x42')](_0x46244f,{'type':db['Sequelize'][_0x6b30('0x6f')][_0x6b30('0x70')],'raw':!![]})['then'](function(_0x1de2b7){return _0x1de2b7;});})[_0x6b30('0x20')](function(_0x1c2b4c){if(_0x1c2b4c){_0x4d26bb[_0x6b30('0x28')][_0x6b30('0x71')]=_0x1c2b4c[0x0];if(!_0x10791a['body'][_0x6b30('0x62')])return;return db[_0x6b30('0x72')][_0x6b30('0x58')]({'where':{'id':_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')],'role':_0x6b30('0x64')},'attributes':['id',_0x6b30('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0xb0aa24){if(!_0xb0aa24)return null;_0x4d26bb['message'][_0x6b30('0x64')]=_0xb0aa24;return _0x4d26bb;})[_0x6b30('0x20')](function(_0x3d4547){if(_0x3d4547){if(_0x10791a[_0x6b30('0x5a')][_0x6b30('0x73')]){_0x4d26bb['message'][_0x6b30('0x74')]=util[_0x6b30('0x60')](_0x6b30('0x75'),_0x10791a[_0x6b30('0x63')][_0x6b30('0x3b')]);_0x4d26bb[_0x6b30('0x28')]['channel']=_0x4d26bb['channel'];_0x4d26bb[_0x6b30('0x28')][_0x6b30('0x76')]=_0x4d26bb[_0x6b30('0x77')];_0x4d26bb[_0x6b30('0x28')][_0x6b30('0x78')]=_0x6b30('0x5d');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x6b30('0x79'),'message':_[_0x6b30('0x51')](_0x4d26bb[_0x6b30('0x28')],JSON[_0x6b30('0x7a')](_0x4d26bb['interaction'][_0x6b30('0x7b')]))},client9002)[_0x6b30('0x20')](function(){return _0x4d26bb;});}return _0x4d26bb;}return null;})[_0x6b30('0x20')](respondWithResult(_0x1c8101,null))['catch'](handleError(_0x1c8101,null));};var interaction_log=require(_0x6b30('0x14'))('chat-interactions');exports[_0x6b30('0x7c')]=function(_0x10f4ed,_0x24387a,_0x305062){var _0x4380df={'agent':{},'channel':'chat'};if(_0x10f4ed[_0x6b30('0x5a')]['id']){delete _0x10f4ed[_0x6b30('0x5a')]['id'];}_0x10f4ed[_0x6b30('0x5a')]['UserId']=_0x10f4ed[_0x6b30('0x5a')][_0x6b30('0x62')]||_0x10f4ed[_0x6b30('0x63')]['id'];_0x4380df['agent']['id']=_0x10f4ed[_0x6b30('0x5a')][_0x6b30('0x62')];return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x10f4ed[_0x6b30('0x57')]['id'],'UserId':null}})[_0x6b30('0x20')](handleEntityNotFound(_0x24387a,null))[_0x6b30('0x20')](function(_0x430c28){if(_0x430c28){_0x4380df[_0x6b30('0x28')]=_0x430c28['get']({'plain':!![]});return db[_0x6b30('0x7d')][_0x6b30('0x58')]({'where':{'id':_0x430c28[_0x6b30('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x24387a,null))['then'](function(_0x32a973){if(_0x32a973){_0x4380df['interaction']=_0x32a973[_0x6b30('0x65')]({'plain':!![]});interaction_log[_0x6b30('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10f4ed['user']['id'],_0x10f4ed[_0x6b30('0x63')]['name'],_0x10f4ed['user'][_0x6b30('0x7e')],_0x4380df[_0x6b30('0x68')]['id'],_0x10f4ed[_0x6b30('0x5a')]?JSON[_0x6b30('0x25')](_0x10f4ed[_0x6b30('0x5a')]):_0x6b30('0x6a'));return respondWithRpcPromise(_0x6b30('0x7f'),'rejectMessage',_0x4380df);}return null;})[_0x6b30('0x20')](function(_0xc29b89){var _0x112964=_0x6b30('0x6d')+_0xc29b89['message'][_0x6b30('0x6e')];return db['sequelize'][_0x6b30('0x42')](_0x112964,{'type':db[_0x6b30('0x80')]['QueryTypes'][_0x6b30('0x70')],'raw':!![]})[_0x6b30('0x20')](function(_0x5075dc){return _0x5075dc;});})[_0x6b30('0x20')](function(_0xffd2a6){if(_0xffd2a6){_0x4380df[_0x6b30('0x28')][_0x6b30('0x71')]=_0xffd2a6[0x0];if(!_0x10f4ed[_0x6b30('0x5a')][_0x6b30('0x62')])return;return db[_0x6b30('0x72')][_0x6b30('0x58')]({'where':{'id':_0x10f4ed['body'][_0x6b30('0x62')],'role':_0x6b30('0x64')},'attributes':['id',_0x6b30('0x3b'),_0x6b30('0x81'),'email','internal'],'raw':!![]});}return null;})[_0x6b30('0x20')](function(_0x12224e){if(!_0x12224e)return null;_0x4380df['message'][_0x6b30('0x64')]=_0x12224e;return _0x4380df;})['then'](function(_0x26a9c4){if(_0x26a9c4){_0x26a9c4[_0x6b30('0x28')][_0x6b30('0x74')]=util[_0x6b30('0x60')](_0x6b30('0x75'),_0x10f4ed[_0x6b30('0x63')][_0x6b30('0x3b')]);_0x26a9c4[_0x6b30('0x28')][_0x6b30('0x77')]=_0x4380df[_0x6b30('0x77')];_0x26a9c4[_0x6b30('0x28')][_0x6b30('0x76')]=_0x4380df[_0x6b30('0x77')];_0x26a9c4['message'][_0x6b30('0x78')]=_0x6b30('0x7c');respondWithRpcPromise(_0x6b30('0x82'),_0x6b30('0x82'),{'event':'rejectmessage','message':_['merge'](_0x4380df[_0x6b30('0x28')],JSON['parse'](_0x4380df[_0x6b30('0x68')][_0x6b30('0x7b')]))},client9002);return _0x4380df;}return null;})[_0x6b30('0x20')](respondWithResult(_0x24387a,null))['catch'](handleError(_0x24387a,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a579110..c4e73a4 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 _0xd8b0=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x449158,_0x44e1b0){var _0x1f3c3a=function(_0x5f1053){while(--_0x5f1053){_0x449158['push'](_0x449158['shift']());}};_0x1f3c3a(++_0x44e1b0);}(_0xd8b0,0x108));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0d8b('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0d8b('0x1')](0x0);var events={'afterCreate':_0x0d8b('0x2'),'afterUpdate':_0x0d8b('0x3'),'afterDestroy':_0x0d8b('0x4')};function emitEvent(_0x391b44){return function(_0xd9ccbe,_0x1688a9,_0x544507){ChatMessageEvents[_0x0d8b('0x5')](_0x391b44+':'+_0xd9ccbe['id'],_0xd9ccbe);ChatMessageEvents['emit'](_0x391b44,_0xd9ccbe);_0x544507(null);};}for(var e in events){if(events[_0x0d8b('0x6')](e)){var event=events[e];ChatMessage[_0x0d8b('0x7')](e,emitEvent(event));}}module[_0x0d8b('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x689b=['save','update','remove','hook','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x39bf45,_0x2d3553){var _0xf3f2b6=function(_0x1c5bb2){while(--_0x1c5bb2){_0x39bf45['push'](_0x39bf45['shift']());}};_0xf3f2b6(++_0x2d3553);}(_0x689b,0x10c));var _0xb689=function(_0x472455,_0xd1931e){_0x472455=_0x472455-0x0;var _0x338b67=_0x689b[_0x472455];return _0x338b67;};'use strict';var EventEmitter=require(_0xb689('0x0'));var ChatMessage=require(_0xb689('0x1'))['db'][_0xb689('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb689('0x3')](0x0);var events={'afterCreate':_0xb689('0x4'),'afterUpdate':_0xb689('0x5'),'afterDestroy':_0xb689('0x6')};function emitEvent(_0x49d31f){return function(_0x394957,_0x4fb7fd,_0x3f1e7c){ChatMessageEvents['emit'](_0x49d31f+':'+_0x394957['id'],_0x394957);ChatMessageEvents['emit'](_0x49d31f,_0x394957);_0x3f1e7c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb689('0x7')](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 6291268..d7cc13b 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 _0x1d99=['bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x35d114,_0x3ae2ec){var _0x1a2c9b=function(_0x559618){while(--_0x559618){_0x35d114['push'](_0x35d114['shift']());}};_0x1a2c9b(++_0x3ae2ec);}(_0x1d99,0xaa));var _0x91d9=function(_0x427100,_0x5815c5){_0x427100=_0x427100-0x0;var _0x473b2a=_0x1d99[_0x427100];return _0x473b2a;};'use strict';var _=require(_0x91d9('0x0'));var util=require(_0x91d9('0x1'));var logger=require(_0x91d9('0x2'))('api');var moment=require(_0x91d9('0x3'));var BPromise=require(_0x91d9('0x4'));var rp=require(_0x91d9('0x5'));var fs=require('fs');var path=require(_0x91d9('0x6'));var rimraf=require(_0x91d9('0x7'));var config=require('../../config/environment');var attributes=require(_0x91d9('0x8'));module[_0x91d9('0x9')]=function(_0x10f31b,_0x57a450){return _0x10f31b[_0x91d9('0xa')](_0x91d9('0xb'),attributes,{'tableName':_0x91d9('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x91d9('0xd')],'type':_0x91d9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32403e,_0x46dc9c,_0x2a1db4){var _0x3a2b11=_0x10f31b[_0x91d9('0xf')];var _0x15c926=_0x32403e[_0x91d9('0x10')]({'plain':!![]});if(_0x15c926[_0x91d9('0x11')][_0x91d9('0x12')]()==='in'||_0x15c926[_0x91d9('0x11')][_0x91d9('0x12')]()===_0x91d9('0x13')&&!_0x15c926['secret']&&!_[_0x91d9('0x14')](_0x15c926[_0x91d9('0x15')])){_0x3a2b11[_0x91d9('0x16')][_0x91d9('0x17')]({'where':{'id':_0x15c926['ChatInteractionId']}})[_0x91d9('0x18')](function(_0x33545e){if(_0x33545e){_0x33545e[_0x91d9('0x19')]({'lastMsgAt':_0x15c926['createdAt'],'lastMsgDirection':_0x15c926[_0x91d9('0x11')][_0x91d9('0x12')]()});}})['catch'](function(_0x3716bf){console[_0x91d9('0x1a')](_0x3716bf);});}_0x2a1db4();}},'charset':_0x91d9('0x1b'),'collate':_0x91d9('0x1c')});};
\ No newline at end of file
+var _0xd2df=['secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x238148,_0x5b1614){var _0x173093=function(_0x4b0708){while(--_0x4b0708){_0x238148['push'](_0x238148['shift']());}};_0x173093(++_0x5b1614);}(_0xd2df,0x1ea));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var logger=require(_0xfd2d('0x2'))(_0xfd2d('0x3'));var moment=require(_0xfd2d('0x4'));var BPromise=require(_0xfd2d('0x5'));var rp=require(_0xfd2d('0x6'));var fs=require('fs');var path=require(_0xfd2d('0x7'));var rimraf=require('rimraf');var config=require(_0xfd2d('0x8'));var attributes=require(_0xfd2d('0x9'));module[_0xfd2d('0xa')]=function(_0x527e96,_0x2e0208){return _0x527e96[_0xfd2d('0xb')](_0xfd2d('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xfd2d('0xd'),'fields':['body'],'type':_0xfd2d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x502f3d,_0x5ea753,_0x2fe79c){var _0x33c46e=_0x527e96[_0xfd2d('0xf')];var _0x5f4ee3=_0x502f3d[_0xfd2d('0x10')]({'plain':!![]});if(_0x5f4ee3[_0xfd2d('0x11')]['toLowerCase']()==='in'||_0x5f4ee3[_0xfd2d('0x11')][_0xfd2d('0x12')]()===_0xfd2d('0x13')&&!_0x5f4ee3[_0xfd2d('0x14')]&&!_[_0xfd2d('0x15')](_0x5f4ee3[_0xfd2d('0x16')])){_0x33c46e[_0xfd2d('0x17')][_0xfd2d('0x18')]({'where':{'id':_0x5f4ee3['ChatInteractionId']}})[_0xfd2d('0x19')](function(_0x2b86c0){if(_0x2b86c0){_0x2b86c0[_0xfd2d('0x1a')]({'lastMsgAt':_0x5f4ee3[_0xfd2d('0x1b')],'lastMsgDirection':_0x5f4ee3[_0xfd2d('0x11')]['toLowerCase']()});}})['catch'](function(_0x44cdc3){console['error'](_0x44cdc3);});}_0x2fe79c();}},'charset':_0xfd2d('0x1c'),'collate':_0xfd2d('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 032e8b6..d1696e7 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 _0x88cf=['stringify','error','message','catch','create','body','options','CreateChatMessage','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4ef534,_0x47a7d0){var _0x8fffbb=function(_0x2ae897){while(--_0x2ae897){_0x4ef534['push'](_0x4ef534['shift']());}};_0x8fffbb(++_0x47a7d0);}(_0x88cf,0x1a9));var _0xf88c=function(_0x2df52e,_0x36a22a){_0x2df52e=_0x2df52e-0x0;var _0x4b7122=_0x88cf[_0x2df52e];return _0x4b7122;};'use strict';var _=require(_0xf88c('0x0'));var util=require(_0xf88c('0x1'));var moment=require(_0xf88c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf88c('0x3'));var fs=require('fs');var Redis=require(_0xf88c('0x4'));var db=require(_0xf88c('0x5'))['db'];var utils=require(_0xf88c('0x6'));var logger=require(_0xf88c('0x7'))(_0xf88c('0x8'));var config=require(_0xf88c('0x9'));var jayson=require(_0xf88c('0xa'));var client=jayson[_0xf88c('0xb')][_0xf88c('0xc')]({'port':0x232a});config['redis']=_[_0xf88c('0xd')](config[_0xf88c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf88c('0xf'))(new Redis(config[_0xf88c('0xe')]));require('./chatMessage.socket')[_0xf88c('0x10')](socket);function respondWithRpcPromise(_0x208254,_0x523faf,_0x6501b2){return new BPromise(function(_0x2565ef,_0x381803){return client[_0xf88c('0x11')](_0x208254,_0x6501b2)[_0xf88c('0x12')](function(_0x55cdbc){logger[_0xf88c('0x13')](_0xf88c('0x14'),_0x523faf,_0xf88c('0x15'));logger['debug'](_0xf88c('0x16'),_0x523faf,'request\x20sent',JSON[_0xf88c('0x17')](_0x55cdbc));if(_0x55cdbc[_0xf88c('0x18')]){if(_0x55cdbc[_0xf88c('0x18')]['code']===0x1f4){logger['error'](_0xf88c('0x14'),_0x523faf,_0x55cdbc[_0xf88c('0x18')]['message']);return _0x381803(_0x55cdbc[_0xf88c('0x18')][_0xf88c('0x19')]);}logger['error'](_0xf88c('0x14'),_0x523faf,_0x55cdbc[_0xf88c('0x18')]['message']);return _0x2565ef(_0x55cdbc['error'][_0xf88c('0x19')]);}else{logger['info'](_0xf88c('0x14'),_0x523faf,_0xf88c('0x15'));_0x2565ef(_0x55cdbc['result'][_0xf88c('0x19')]);}})[_0xf88c('0x1a')](function(_0x321bad){logger[_0xf88c('0x18')](_0xf88c('0x14'),_0x523faf,_0x321bad);_0x381803(_0x321bad);});});}exports['CreateChatMessage']=function(_0x8dbb60){var _0x143a98=this;return new Promise(function(_0x36b945,_0x535aa){return db['ChatMessage'][_0xf88c('0x1b')](_0x8dbb60[_0xf88c('0x1c')],{'raw':_0x8dbb60[_0xf88c('0x1d')]?_0x8dbb60['options']['raw']===undefined?!![]:![]:!![]})[_0xf88c('0x12')](function(_0x834a6a){logger[_0xf88c('0x13')](_0xf88c('0x1e'),_0x8dbb60);logger[_0xf88c('0x1f')](_0xf88c('0x1e'),_0x8dbb60,JSON[_0xf88c('0x17')](_0x834a6a));_0x36b945(_0x834a6a);})[_0xf88c('0x1a')](function(_0x44e68c){logger[_0xf88c('0x18')](_0xf88c('0x1e'),_0x44e68c[_0xf88c('0x19')],_0x8dbb60);_0x535aa(_0x143a98[_0xf88c('0x18')](0x1f4,_0x44e68c[_0xf88c('0x19')]));});});};
\ No newline at end of file
+var _0x5203=['./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost'];(function(_0xa1b6,_0x22e95e){var _0x5e789b=function(_0x533b58){while(--_0x533b58){_0xa1b6['push'](_0xa1b6['shift']());}};_0x5e789b(++_0x22e95e);}(_0x5203,0x12a));var _0x3520=function(_0x70049e,_0x52c59b){_0x70049e=_0x70049e-0x0;var _0x1691b0=_0x5203[_0x70049e];return _0x1691b0;};'use strict';var _=require('lodash');var util=require(_0x3520('0x0'));var moment=require(_0x3520('0x1'));var BPromise=require('bluebird');var rs=require(_0x3520('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3520('0x3'))(_0x3520('0x4'));var config=require(_0x3520('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3520('0x6')]['http']({'port':0x232a});config[_0x3520('0x7')]=_[_0x3520('0x8')](config['redis'],{'host':_0x3520('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3520('0x7')]));require(_0x3520('0xa'))['register'](socket);function respondWithRpcPromise(_0x56015e,_0x313ddd,_0x8e6318){return new BPromise(function(_0x2b425d,_0x352b08){return client[_0x3520('0xb')](_0x56015e,_0x8e6318)[_0x3520('0xc')](function(_0x4f51b9){logger[_0x3520('0xd')](_0x3520('0xe'),_0x313ddd,_0x3520('0xf'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x313ddd,_0x3520('0xf'),JSON[_0x3520('0x10')](_0x4f51b9));if(_0x4f51b9[_0x3520('0x11')]){if(_0x4f51b9[_0x3520('0x11')]['code']===0x1f4){logger[_0x3520('0x11')]('ChatMessage,\x20%s,\x20%s',_0x313ddd,_0x4f51b9['error'][_0x3520('0x12')]);return _0x352b08(_0x4f51b9['error']['message']);}logger[_0x3520('0x11')](_0x3520('0xe'),_0x313ddd,_0x4f51b9[_0x3520('0x11')][_0x3520('0x12')]);return _0x2b425d(_0x4f51b9[_0x3520('0x11')][_0x3520('0x12')]);}else{logger['info'](_0x3520('0xe'),_0x313ddd,_0x3520('0xf'));_0x2b425d(_0x4f51b9[_0x3520('0x13')][_0x3520('0x12')]);}})[_0x3520('0x14')](function(_0x32c534){logger[_0x3520('0x11')](_0x3520('0xe'),_0x313ddd,_0x32c534);_0x352b08(_0x32c534);});});}exports[_0x3520('0x15')]=function(_0x579c42){var _0x53cbfb=this;return new Promise(function(_0x16bfce,_0x120c65){return db[_0x3520('0x16')][_0x3520('0x17')](_0x579c42[_0x3520('0x18')],{'raw':_0x579c42[_0x3520('0x19')]?_0x579c42[_0x3520('0x19')][_0x3520('0x1a')]===undefined?!![]:![]:!![]})[_0x3520('0xc')](function(_0x4aa64c){logger['info']('CreateChatMessage',_0x579c42);logger[_0x3520('0x1b')]('CreateChatMessage',_0x579c42,JSON[_0x3520('0x10')](_0x4aa64c));_0x16bfce(_0x4aa64c);})[_0x3520('0x14')](function(_0x45d2eb){logger['error'](_0x3520('0x15'),_0x45d2eb[_0x3520('0x12')],_0x579c42);_0x120c65(_0x53cbfb[_0x3520('0x11')](0x1f4,_0x45d2eb[_0x3520('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 9d8d5e6..5349f65 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 _0x5a2a=['removeListener','register','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x302d39,_0x463596){var _0x3efb40=function(_0xcb50eb){while(--_0xcb50eb){_0x302d39['push'](_0x302d39['shift']());}};_0x3efb40(++_0x463596);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x5a0bc6,_0x954bbe){_0x5a0bc6=_0x5a0bc6-0x0;var _0x22c3b6=_0x5a2a[_0x5a0bc6];return _0x22c3b6;};'use strict';var ChatMessageEvents=require(_0xa5a2('0x0'));var events=[_0xa5a2('0x1'),_0xa5a2('0x2'),_0xa5a2('0x3')];function createListener(_0x5d3456,_0x525e94){return function(_0x48308f){_0x525e94[_0xa5a2('0x4')](_0x5d3456,_0x48308f);};}function removeListener(_0x2cf196,_0x479d0a){return function(){ChatMessageEvents[_0xa5a2('0x5')](_0x2cf196,_0x479d0a);};}exports[_0xa5a2('0x6')]=function(_0x2e97d3){for(var _0x55728b=0x0,_0x179722=events['length'];_0x55728b<_0x179722;_0x55728b++){var _0x38a5fe=events[_0x55728b];var _0x97f75c=createListener(_0xa5a2('0x7')+_0x38a5fe,_0x2e97d3);ChatMessageEvents['on'](_0x38a5fe,_0x97f75c);}};
\ No newline at end of file
+var _0xfb65=['emit','removeListener','register','length','save','remove'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xfb65,0x82));var _0x5fb6=function(_0x211ee1,_0x2eb0a3){_0x211ee1=_0x211ee1-0x0;var _0x3d1c69=_0xfb65[_0x211ee1];return _0x3d1c69;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5fb6('0x0'),_0x5fb6('0x1'),'update'];function createListener(_0x860687,_0x54af6d){return function(_0x194bac){_0x54af6d[_0x5fb6('0x2')](_0x860687,_0x194bac);};}function removeListener(_0xca6345,_0xb5f7c4){return function(){ChatMessageEvents[_0x5fb6('0x3')](_0xca6345,_0xb5f7c4);};}exports[_0x5fb6('0x4')]=function(_0x4dec8f){for(var _0x50782b=0x0,_0x238914=events[_0x5fb6('0x5')];_0x50782b<_0x238914;_0x50782b++){var _0x1f99b8=events[_0x50782b];var _0x840390=createListener('chatMessage:'+_0x1f99b8,_0x4dec8f);ChatMessageEvents['on'](_0x1f99b8,_0x840390);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 139f218..76f04e1 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 _0x3a5a=['chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked'];(function(_0x3efd98,_0x5a231a){var _0x3d99b7=function(_0x5d8a4e){while(--_0x5d8a4e){_0x3efd98['push'](_0x3efd98['shift']());}};_0x3d99b7(++_0x5a231a);}(_0x3a5a,0xb8));var _0xa3a5=function(_0x51c560,_0x4e6c0e){_0x51c560=_0x51c560-0x0;var _0x594579=_0x3a5a[_0x51c560];return _0x594579;};'use strict';var multer=require('multer');var util=require(_0xa3a5('0x0'));var path=require(_0xa3a5('0x1'));var timeout=require(_0xa3a5('0x2'));var express=require(_0xa3a5('0x3'));var router=express[_0xa3a5('0x4')]();var fs_extra=require(_0xa3a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa3a5('0x6'));var config=require(_0xa3a5('0x7'));var controller=require(_0xa3a5('0x8'));router[_0xa3a5('0x9')]('/',auth[_0xa3a5('0xa')](),controller[_0xa3a5('0xb')]);router[_0xa3a5('0x9')]('/describe',auth[_0xa3a5('0xa')](),controller['describe']);router[_0xa3a5('0x9')](_0xa3a5('0xc'),auth[_0xa3a5('0xa')](),controller[_0xa3a5('0xd')]);router[_0xa3a5('0xe')]('/',auth[_0xa3a5('0xa')](),interaction[_0xa3a5('0xf')](_0xa3a5('0x10'),_0xa3a5('0x11')),controller[_0xa3a5('0x12')]);router['put']('/:id',controller['update']);router[_0xa3a5('0x13')](_0xa3a5('0x14'),auth[_0xa3a5('0xa')](),controller[_0xa3a5('0x15')]);router[_0xa3a5('0x13')](_0xa3a5('0x16'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xa3a5('0xc'),auth[_0xa3a5('0xa')](),controller[_0xa3a5('0x17')]);module[_0xa3a5('0x18')]=router;
\ No newline at end of file
+var _0xf631=['put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf631,0x1a7));var _0x1f63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf631[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1f63('0x0'));var util=require(_0x1f63('0x1'));var path=require('path');var timeout=require(_0x1f63('0x2'));var express=require('express');var router=express[_0x1f63('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f63('0x4'));var interaction=require(_0x1f63('0x5'));var config=require(_0x1f63('0x6'));var controller=require('./chatMessage.controller');router[_0x1f63('0x7')]('/',auth[_0x1f63('0x8')](),controller[_0x1f63('0x9')]);router['get'](_0x1f63('0xa'),auth[_0x1f63('0x8')](),controller[_0x1f63('0xb')]);router[_0x1f63('0x7')](_0x1f63('0xc'),auth[_0x1f63('0x8')](),controller[_0x1f63('0xd')]);router[_0x1f63('0xe')]('/',auth[_0x1f63('0x8')](),interaction[_0x1f63('0xf')](_0x1f63('0x10'),_0x1f63('0x11')),controller[_0x1f63('0x12')]);router[_0x1f63('0x13')](_0x1f63('0xc'),controller[_0x1f63('0x14')]);router[_0x1f63('0x13')](_0x1f63('0x15'),auth['isAuthenticated'](),controller[_0x1f63('0x16')]);router[_0x1f63('0x13')](_0x1f63('0x17'),auth[_0x1f63('0x8')](),controller['reject']);router['delete'](_0x1f63('0xc'),auth[_0x1f63('0x8')](),controller[_0x1f63('0x18')]);module[_0x1f63('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 3b426d6..1fa7aa7 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x3461f2,_0x1e93f9){var _0x59f44a=function(_0x509c86){while(--_0x509c86){_0x3461f2['push'](_0x3461f2['shift']());}};_0x59f44a(++_0x1e93f9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x190690,_0x2885ea){_0x190690=_0x190690-0x0;var _0x362375=_0x5f2f[_0x190690];return _0x362375;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x1528fe,_0x23836f){var _0x3241ee=function(_0x241b06){while(--_0x241b06){_0x1528fe['push'](_0x1528fe['shift']());}};_0x3241ee(++_0x23836f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('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 960fce8..9523fdb 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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x5b860c,_0x296311){_0x5b860c=_0x5b860c-0x0;var _0x32b630=_0x7a54[_0x5b860c];return _0x32b630;};'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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x47a443,_0x1c1b3f){var _0x2848c0=function(_0x2314d1){while(--_0x2314d1){_0x47a443['push'](_0x47a443['shift']());}};_0x2848c0(++_0x1c1b3f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 6eee19d..eb991cc 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 _0x4e50=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','remove'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x4e50,0xdc));var _0x04e5=function(_0x448f50,_0x5587ba){_0x448f50=_0x448f50-0x0;var _0x2af4c3=_0x4e50[_0x448f50];return _0x2af4c3;};'use strict';var EventEmitter=require(_0x04e5('0x0'));var ChatOfflineMessage=require(_0x04e5('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x04e5('0x2'),'afterUpdate':'update','afterDestroy':_0x04e5('0x3')};function emitEvent(_0x1bd796){return function(_0x36b094,_0x48b2bd,_0x10a33d){ChatOfflineMessageEvents[_0x04e5('0x4')](_0x1bd796+':'+_0x36b094['id'],_0x36b094);ChatOfflineMessageEvents['emit'](_0x1bd796,_0x36b094);_0x10a33d(null);};}for(var e in events){if(events[_0x04e5('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x04e5('0x6')](e,emitEvent(event));}}module[_0x04e5('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x5ee2=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0xe14c69,_0x5a8843){var _0x32641e=function(_0x49f343){while(--_0x49f343){_0xe14c69['push'](_0xe14c69['shift']());}};_0x32641e(++_0x5a8843);}(_0x5ee2,0x1b3));var _0x25ee=function(_0x1c81c6,_0x154f45){_0x1c81c6=_0x1c81c6-0x0;var _0x178c1b=_0x5ee2[_0x1c81c6];return _0x178c1b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x25ee('0x0'))['db'][_0x25ee('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x25ee('0x2')](0x0);var events={'afterCreate':_0x25ee('0x3'),'afterUpdate':_0x25ee('0x4'),'afterDestroy':_0x25ee('0x5')};function emitEvent(_0x4a70da){return function(_0x1df61c,_0x5aeab4,_0x5d6b1c){ChatOfflineMessageEvents[_0x25ee('0x6')](_0x4a70da+':'+_0x1df61c['id'],_0x1df61c);ChatOfflineMessageEvents[_0x25ee('0x6')](_0x4a70da,_0x1df61c);_0x5d6b1c(null);};}for(var e in events){if(events[_0x25ee('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x25ee('0x8')](e,emitEvent(event));}}module[_0x25ee('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f21dea6..389d851 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 _0x663d=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0xe32be3,_0x328dd7){var _0x3764d1=function(_0x58fd51){while(--_0x58fd51){_0xe32be3['push'](_0xe32be3['shift']());}};_0x3764d1(++_0x328dd7);}(_0x663d,0x10c));var _0xd663=function(_0x4ef8fc,_0x583a22){_0x4ef8fc=_0x4ef8fc-0x0;var _0x1a753c=_0x663d[_0x4ef8fc];return _0x1a753c;};'use strict';var attributes=require(_0xd663('0x0'));module[_0xd663('0x1')]=function(_0x2ad2c2){return _0x2ad2c2[_0xd663('0x2')](_0xd663('0x3'),attributes,{'tableName':_0xd663('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd663('0x5'),'collate':_0xd663('0x6')});};
\ No newline at end of file
+var _0x99dc=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x99dc,0x9a));var _0xc99d=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x99dc[_0x5c6299];return _0x23b564;};'use strict';var attributes=require(_0xc99d('0x0'));module[_0xc99d('0x1')]=function(_0x18202b){return _0x18202b[_0xc99d('0x2')](_0xc99d('0x3'),attributes,{'tableName':_0xc99d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc99d('0x5'),'collate':_0xc99d('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f2ec268..eb42b09 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 _0xb6aa=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','debug'];(function(_0x4b8d84,_0x347c3c){var _0xe15825=function(_0x52954f){while(--_0x52954f){_0x4b8d84['push'](_0x4b8d84['shift']());}};_0xe15825(++_0x347c3c);}(_0xb6aa,0x10b));var _0xab6a=function(_0x312df2,_0x2e1d03){_0x312df2=_0x312df2-0x0;var _0x52b45a=_0xb6aa[_0x312df2];return _0x52b45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab6a('0x0'));var BPromise=require(_0xab6a('0x1'));var rs=require(_0xab6a('0x2'));var fs=require('fs');var Redis=require(_0xab6a('0x3'));var db=require(_0xab6a('0x4'))['db'];var utils=require(_0xab6a('0x5'));var logger=require(_0xab6a('0x6'))(_0xab6a('0x7'));var config=require('../../config/environment');var jayson=require(_0xab6a('0x8'));var client=jayson['client'][_0xab6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f2ab9,_0x554c88,_0x15df84){return new BPromise(function(_0x2c6d33,_0x57697c){return client['request'](_0x2f2ab9,_0x15df84)['then'](function(_0xf8166c){logger[_0xab6a('0xa')](_0xab6a('0xb'),_0x554c88,'request\x20sent');logger[_0xab6a('0xc')](_0xab6a('0xd'),_0x554c88,_0xab6a('0xe'),JSON[_0xab6a('0xf')](_0xf8166c));if(_0xf8166c[_0xab6a('0x10')]){if(_0xf8166c[_0xab6a('0x10')]['code']===0x1f4){logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0xf8166c['error']['message']);return _0x57697c(_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);}logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);return _0x2c6d33(_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);}else{logger[_0xab6a('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x554c88,_0xab6a('0xe'));_0x2c6d33(_0xf8166c[_0xab6a('0x12')][_0xab6a('0x11')]);}})[_0xab6a('0x13')](function(_0x579096){logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0x579096);_0x57697c(_0x579096);});});}
\ No newline at end of file
+var _0x83b4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83b4,0x1a7));var _0x483b=function(_0xdd8706,_0x5f1e86){_0xdd8706=_0xdd8706-0x0;var _0x2b2843=_0x83b4[_0xdd8706];return _0x2b2843;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x483b('0x0'));var BPromise=require(_0x483b('0x1'));var rs=require(_0x483b('0x2'));var fs=require('fs');var Redis=require(_0x483b('0x3'));var db=require(_0x483b('0x4'))['db'];var utils=require(_0x483b('0x5'));var logger=require(_0x483b('0x6'))(_0x483b('0x7'));var config=require(_0x483b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x483b('0x9')][_0x483b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1065f8,_0x303de0,_0x440e98){return new BPromise(function(_0x989b7f,_0x155398){return client[_0x483b('0xb')](_0x1065f8,_0x440e98)[_0x483b('0xc')](function(_0x4befb7){logger[_0x483b('0xd')](_0x483b('0xe'),_0x303de0,'request\x20sent');logger['debug'](_0x483b('0xf'),_0x303de0,_0x483b('0x10'),JSON['stringify'](_0x4befb7));if(_0x4befb7[_0x483b('0x11')]){if(_0x4befb7[_0x483b('0x11')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x303de0,_0x4befb7[_0x483b('0x11')][_0x483b('0x12')]);return _0x155398(_0x4befb7['error'][_0x483b('0x12')]);}logger['error'](_0x483b('0xe'),_0x303de0,_0x4befb7[_0x483b('0x11')][_0x483b('0x12')]);return _0x989b7f(_0x4befb7[_0x483b('0x11')][_0x483b('0x12')]);}else{logger['info'](_0x483b('0xe'),_0x303de0,_0x483b('0x10'));_0x989b7f(_0x4befb7[_0x483b('0x13')][_0x483b('0x12')]);}})[_0x483b('0x14')](function(_0x20181a){logger[_0x483b('0x11')](_0x483b('0xe'),_0x303de0,_0x20181a);_0x155398(_0x20181a);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 098fc95..6707e96 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 _0xbe7b=['describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated'];(function(_0xb096ef,_0x20ebdf){var _0x5ac5b=function(_0x11b4be){while(--_0x11b4be){_0xb096ef['push'](_0xb096ef['shift']());}};_0x5ac5b(++_0x20ebdf);}(_0xbe7b,0x1ac));var _0xbbe7=function(_0x4d3a9b,_0x20b47d){_0x4d3a9b=_0x4d3a9b-0x0;var _0x1b5471=_0xbe7b[_0x4d3a9b];return _0x1b5471;};'use strict';var multer=require(_0xbbe7('0x0'));var util=require('util');var path=require(_0xbbe7('0x1'));var timeout=require(_0xbbe7('0x2'));var express=require(_0xbbe7('0x3'));var router=express[_0xbbe7('0x4')]();var fs_extra=require(_0xbbe7('0x5'));var auth=require(_0xbbe7('0x6'));var interaction=require(_0xbbe7('0x7'));var config=require(_0xbbe7('0x8'));var controller=require(_0xbbe7('0x9'));router[_0xbbe7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbbe7('0xa')](_0xbbe7('0xb'),auth[_0xbbe7('0xc')](),controller[_0xbbe7('0xd')]);router[_0xbbe7('0xa')](_0xbbe7('0xe'),auth[_0xbbe7('0xc')](),controller[_0xbbe7('0xf')]);router[_0xbbe7('0x10')]('/',auth[_0xbbe7('0xc')](),controller[_0xbbe7('0x11')]);router['put'](_0xbbe7('0xe'),auth[_0xbbe7('0xc')](),controller[_0xbbe7('0x12')]);router[_0xbbe7('0x13')]('/:id',auth[_0xbbe7('0xc')](),controller['destroy']);module[_0xbbe7('0x14')]=router;
\ No newline at end of file
+var _0x7579=['../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/:id','post','create','put','destroy','exports','multer','express','Router','fs-extra'];(function(_0x3d7181,_0x2027f1){var _0x4fdf6c=function(_0x1a5a35){while(--_0x1a5a35){_0x3d7181['push'](_0x3d7181['shift']());}};_0x4fdf6c(++_0x2027f1);}(_0x7579,0x10a));var _0x9757=function(_0x276ec7,_0x3bc9f9){_0x276ec7=_0x276ec7-0x0;var _0xffa130=_0x7579[_0x276ec7];return _0xffa130;};'use strict';var multer=require(_0x9757('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9757('0x1'));var router=express[_0x9757('0x2')]();var fs_extra=require(_0x9757('0x3'));var auth=require(_0x9757('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9757('0x5'));var controller=require(_0x9757('0x6'));router[_0x9757('0x7')]('/',auth[_0x9757('0x8')](),controller['index']);router['get']('/describe',auth[_0x9757('0x8')](),controller['describe']);router['get'](_0x9757('0x9'),auth[_0x9757('0x8')](),controller['show']);router[_0x9757('0xa')]('/',auth[_0x9757('0x8')](),controller[_0x9757('0xb')]);router[_0x9757('0xc')](_0x9757('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9757('0x9'),auth[_0x9757('0x8')](),controller[_0x9757('0xd')]);module[_0x9757('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 0afc9b9..7a86cc5 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 _0x5f2f=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x5f2f,0x1c2));var _0xf5f2=function(_0x327d37,_0x89de5e){_0x327d37=_0x327d37-0x0;var _0x10a776=_0x5f2f[_0x327d37];return _0x10a776;};'use strict';var Sequelize=require('sequelize');module[_0xf5f2('0x0')]={'name':{'type':Sequelize[_0xf5f2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3'),_0xf5f2('0x4')),'defaultValue':_0xf5f2('0x3')},'selector':{'type':Sequelize[_0xf5f2('0x1')]},'timeout':{'type':Sequelize[_0xf5f2('0x5')]}};
\ No newline at end of file
+var _0xcfd1=['INTEGER','sequelize','exports','ENUM','mouseOver'];(function(_0x51db38,_0x1f8778){var _0x21db64=function(_0x3276f5){while(--_0x3276f5){_0x51db38['push'](_0x51db38['shift']());}};_0x21db64(++_0x1f8778);}(_0xcfd1,0x150));var _0x1cfd=function(_0x5ced50,_0x3f8d27){_0x5ced50=_0x5ced50-0x0;var _0x50a749=_0xcfd1[_0x5ced50];return _0x50a749;};'use strict';var Sequelize=require(_0x1cfd('0x0'));module[_0x1cfd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1cfd('0x2')](_0x1cfd('0x3'),'timeout'),'defaultValue':_0x1cfd('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1cfd('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 228c60b..913ee24 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 _0x0686=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x5c0919,_0x13b252){var _0x457116=function(_0x4d58e7){while(--_0x4d58e7){_0x5c0919['push'](_0x5c0919['shift']());}};_0x457116(++_0x13b252);}(_0x0686,0x123));var _0x6068=function(_0xf52cca,_0x134bba){_0xf52cca=_0xf52cca-0x0;var _0x11d19c=_0x0686[_0xf52cca];return _0x11d19c;};'use strict';var emlformat=require(_0x6068('0x0'));var rimraf=require(_0x6068('0x1'));var zipdir=require(_0x6068('0x2'));var jsonpatch=require(_0x6068('0x3'));var rp=require(_0x6068('0x4'));var moment=require(_0x6068('0x5'));var BPromise=require(_0x6068('0x6'));var Mustache=require('mustache');var util=require(_0x6068('0x7'));var path=require(_0x6068('0x8'));var sox=require(_0x6068('0x9'));var csv=require(_0x6068('0xa'));var ejs=require(_0x6068('0xb'));var fs=require('fs');var fs_extra=require(_0x6068('0xc'));var _=require(_0x6068('0xd'));var squel=require(_0x6068('0xe'));var crypto=require(_0x6068('0xf'));var jsforce=require(_0x6068('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6068('0xa'));var querystring=require(_0x6068('0x11'));var Papa=require(_0x6068('0x12'));var Redis=require(_0x6068('0x13'));var authService=require(_0x6068('0x14'));var qs=require(_0x6068('0x15'));var as=require(_0x6068('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6068('0x17'))(_0x6068('0x18'));var utils=require(_0x6068('0x19'));var config=require(_0x6068('0x1a'));var licenseUtil=require(_0x6068('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f8918,_0x3a67ec){_0x3a67ec=_0x3a67ec||0xcc;return function(_0x5eba85){if(_0x5eba85){return _0x1f8918[_0x6068('0x1c')](_0x3a67ec);}return _0x1f8918[_0x6068('0x1d')](_0x3a67ec)[_0x6068('0x1e')]();};}function respondWithResult(_0x31b190,_0x1257b2){_0x1257b2=_0x1257b2||0xc8;return function(_0x1eb53c){if(_0x1eb53c){return _0x31b190[_0x6068('0x1d')](_0x1257b2)[_0x6068('0x1f')](_0x1eb53c);}};}function respondWithFilteredResult(_0xcb09de,_0x5d50c5){return function(_0x45a455){if(_0x45a455){var _0x1416b7=typeof _0x5d50c5['offset']===_0x6068('0x20')&&typeof _0x5d50c5[_0x6068('0x21')]===_0x6068('0x20');var _0x321d80=_0x45a455['count'];var _0x47e38a=_0x1416b7?0x0:_0x5d50c5[_0x6068('0x22')];var _0x1f0e7e=_0x1416b7?_0x45a455[_0x6068('0x23')]:_0x5d50c5[_0x6068('0x22')]+_0x5d50c5['limit'];var _0x4d5a09;if(_0x1f0e7e>=_0x321d80){_0x1f0e7e=_0x321d80;_0x4d5a09=0xc8;}else{_0x4d5a09=0xce;}_0xcb09de[_0x6068('0x1d')](_0x4d5a09);return _0xcb09de[_0x6068('0x24')](_0x6068('0x25'),_0x47e38a+'-'+_0x1f0e7e+'/'+_0x321d80)[_0x6068('0x1f')](_0x45a455);}return null;};}function patchUpdates(_0x247c2d){return function(_0x149512){try{jsonpatch[_0x6068('0x26')](_0x149512,_0x247c2d,!![]);}catch(_0x4ee2eb){return BPromise['reject'](_0x4ee2eb);}return _0x149512['save']();};}function saveUpdates(_0x3fea81,_0x138946){return function(_0x1b4f91){if(_0x1b4f91){return _0x1b4f91[_0x6068('0x27')](_0x3fea81)[_0x6068('0x28')](function(_0xa6c2a0){return _0xa6c2a0;});}return null;};}function removeEntity(_0x1046f3,_0x132793){return function(_0x5cf58c){if(_0x5cf58c){return _0x5cf58c[_0x6068('0x29')]()[_0x6068('0x28')](function(){_0x1046f3['status'](0xcc)[_0x6068('0x1e')]();});}};}function handleEntityNotFound(_0x57783a,_0x11f226){return function(_0x464999){if(!_0x464999){_0x57783a[_0x6068('0x1c')](0x194);}return _0x464999;};}function handleError(_0x59cfeb,_0x26b754){_0x26b754=_0x26b754||0x1f4;return function(_0x5a880b){logger[_0x6068('0x2a')](_0x5a880b[_0x6068('0x2b')]);if(_0x5a880b[_0x6068('0x2c')]){delete _0x5a880b[_0x6068('0x2c')];}_0x59cfeb[_0x6068('0x1d')](_0x26b754)[_0x6068('0x2d')](_0x5a880b);};}exports[_0x6068('0x2e')]=function(_0x360ffc,_0x20fc70){var _0xcdc594={'raw':!![],'where':{'id':_0x360ffc[_0x6068('0x2f')]['id']}},_0x49adb6={};_0x49adb6[_0x6068('0x30')]=_[_0x6068('0x31')](db[_0x6068('0x32')][_0x6068('0x33')]);_0x49adb6[_0x6068('0x34')]=_[_0x6068('0x31')](_0x360ffc[_0x6068('0x34')]);_0x49adb6['filters']=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],_0x49adb6[_0x6068('0x34')]);_0xcdc594[_0x6068('0x36')]=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],qs[_0x6068('0x37')](_0x360ffc[_0x6068('0x34')]['fields']));_0xcdc594[_0x6068('0x36')]=_0xcdc594[_0x6068('0x36')][_0x6068('0x38')]?_0xcdc594[_0x6068('0x36')]:_0x49adb6[_0x6068('0x30')];if(_0x360ffc[_0x6068('0x34')]['includeAll']){_0xcdc594['include']=[{'all':!![]}];}_0xcdc594=_[_0x6068('0x39')]({},_0xcdc594,_0x360ffc['options']);return db['ChatProactiveAction'][_0x6068('0x3a')](_0xcdc594)[_0x6068('0x28')](handleEntityNotFound(_0x20fc70,null))['then'](respondWithResult(_0x20fc70,null))[_0x6068('0x3b')](handleError(_0x20fc70,null));};exports[_0x6068('0x3c')]=function(_0x22aadb,_0x44abfd){return db[_0x6068('0x32')][_0x6068('0x3c')](_0x22aadb['body'],{})[_0x6068('0x28')](respondWithResult(_0x44abfd,0xc9))[_0x6068('0x3b')](handleError(_0x44abfd,null));};exports[_0x6068('0x27')]=function(_0x2d8674,_0x10e384){if(_0x2d8674[_0x6068('0x3d')]['id']){delete _0x2d8674[_0x6068('0x3d')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x2d8674[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x10e384,null))[_0x6068('0x28')](saveUpdates(_0x2d8674[_0x6068('0x3d')],null))[_0x6068('0x28')](respondWithResult(_0x10e384,null))[_0x6068('0x3b')](handleError(_0x10e384,null));};exports[_0x6068('0x29')]=function(_0x4f1dd0,_0x2c350d){return db[_0x6068('0x32')]['find']({'where':{'id':_0x4f1dd0[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2c350d,null))['then'](removeEntity(_0x2c350d,null))[_0x6068('0x3b')](handleError(_0x2c350d,null));};
\ No newline at end of file
+var _0x68f5=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','show','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x68f5,0x11a));var _0x568f=function(_0x32904d,_0x28b13c){_0x32904d=_0x32904d-0x0;var _0x252bd9=_0x68f5[_0x32904d];return _0x252bd9;};'use strict';var emlformat=require(_0x568f('0x0'));var rimraf=require(_0x568f('0x1'));var zipdir=require(_0x568f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x568f('0x3'));var moment=require(_0x568f('0x4'));var BPromise=require(_0x568f('0x5'));var Mustache=require(_0x568f('0x6'));var util=require(_0x568f('0x7'));var path=require('path');var sox=require(_0x568f('0x8'));var csv=require(_0x568f('0x9'));var ejs=require(_0x568f('0xa'));var fs=require('fs');var fs_extra=require(_0x568f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x568f('0xc'));var jsforce=require(_0x568f('0xd'));var deskjs=require(_0x568f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x568f('0xf'));var Papa=require('papaparse');var Redis=require(_0x568f('0x10'));var authService=require(_0x568f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x568f('0x12'));var hardwareService=require(_0x568f('0x13'));var logger=require(_0x568f('0x14'))(_0x568f('0x15'));var utils=require(_0x568f('0x16'));var config=require(_0x568f('0x17'));var licenseUtil=require(_0x568f('0x18'));var db=require(_0x568f('0x19'))['db'];function respondWithStatusCode(_0x200172,_0x4acf24){_0x4acf24=_0x4acf24||0xcc;return function(_0x341cde){if(_0x341cde){return _0x200172[_0x568f('0x1a')](_0x4acf24);}return _0x200172[_0x568f('0x1b')](_0x4acf24)[_0x568f('0x1c')]();};}function respondWithResult(_0x55fc40,_0x87b903){_0x87b903=_0x87b903||0xc8;return function(_0x53c270){if(_0x53c270){return _0x55fc40['status'](_0x87b903)[_0x568f('0x1d')](_0x53c270);}};}function respondWithFilteredResult(_0x15a4e5,_0x47316e){return function(_0x25e488){if(_0x25e488){var _0xcd73a2=typeof _0x47316e[_0x568f('0x1e')]===_0x568f('0x1f')&&typeof _0x47316e[_0x568f('0x20')]===_0x568f('0x1f');var _0x3d9645=_0x25e488[_0x568f('0x21')];var _0x49b64e=_0xcd73a2?0x0:_0x47316e[_0x568f('0x1e')];var _0x5cc7e2=_0xcd73a2?_0x25e488[_0x568f('0x21')]:_0x47316e[_0x568f('0x1e')]+_0x47316e[_0x568f('0x20')];var _0x1f4912;if(_0x5cc7e2>=_0x3d9645){_0x5cc7e2=_0x3d9645;_0x1f4912=0xc8;}else{_0x1f4912=0xce;}_0x15a4e5[_0x568f('0x1b')](_0x1f4912);return _0x15a4e5[_0x568f('0x22')](_0x568f('0x23'),_0x49b64e+'-'+_0x5cc7e2+'/'+_0x3d9645)[_0x568f('0x1d')](_0x25e488);}return null;};}function patchUpdates(_0x1a09a9){return function(_0x22c4e0){try{jsonpatch[_0x568f('0x24')](_0x22c4e0,_0x1a09a9,!![]);}catch(_0x2c65c6){return BPromise[_0x568f('0x25')](_0x2c65c6);}return _0x22c4e0[_0x568f('0x26')]();};}function saveUpdates(_0x3eb76d,_0x2afe66){return function(_0x2c61ea){if(_0x2c61ea){return _0x2c61ea[_0x568f('0x27')](_0x3eb76d)[_0x568f('0x28')](function(_0x4a248e){return _0x4a248e;});}return null;};}function removeEntity(_0xa2225a,_0x4590a8){return function(_0x20daca){if(_0x20daca){return _0x20daca[_0x568f('0x29')]()['then'](function(){_0xa2225a['status'](0xcc)[_0x568f('0x1c')]();});}};}function handleEntityNotFound(_0x45826b,_0x67f06c){return function(_0x6bb377){if(!_0x6bb377){_0x45826b['sendStatus'](0x194);}return _0x6bb377;};}function handleError(_0x51d57f,_0x3de8ce){_0x3de8ce=_0x3de8ce||0x1f4;return function(_0x577ca6){logger['error'](_0x577ca6['stack']);if(_0x577ca6[_0x568f('0x2a')]){delete _0x577ca6['name'];}_0x51d57f[_0x568f('0x1b')](_0x3de8ce)['send'](_0x577ca6);};}exports[_0x568f('0x2b')]=function(_0x2ff19b,_0x182a1f){var _0x52acac={'raw':!![],'where':{'id':_0x2ff19b[_0x568f('0x2c')]['id']}},_0x209db2={};_0x209db2['model']=_[_0x568f('0x2d')](db['ChatProactiveAction'][_0x568f('0x2e')]);_0x209db2['query']=_['keys'](_0x2ff19b[_0x568f('0x2f')]);_0x209db2[_0x568f('0x30')]=_[_0x568f('0x31')](_0x209db2[_0x568f('0x32')],_0x209db2[_0x568f('0x2f')]);_0x52acac[_0x568f('0x33')]=_[_0x568f('0x31')](_0x209db2[_0x568f('0x32')],qs['fields'](_0x2ff19b[_0x568f('0x2f')][_0x568f('0x34')]));_0x52acac[_0x568f('0x33')]=_0x52acac[_0x568f('0x33')]['length']?_0x52acac[_0x568f('0x33')]:_0x209db2[_0x568f('0x32')];if(_0x2ff19b[_0x568f('0x2f')][_0x568f('0x35')]){_0x52acac[_0x568f('0x36')]=[{'all':!![]}];}_0x52acac=_[_0x568f('0x37')]({},_0x52acac,_0x2ff19b[_0x568f('0x38')]);return db['ChatProactiveAction'][_0x568f('0x39')](_0x52acac)[_0x568f('0x28')](handleEntityNotFound(_0x182a1f,null))[_0x568f('0x28')](respondWithResult(_0x182a1f,null))[_0x568f('0x3a')](handleError(_0x182a1f,null));};exports[_0x568f('0x3b')]=function(_0x4b6608,_0x57c011){return db[_0x568f('0x3c')][_0x568f('0x3b')](_0x4b6608[_0x568f('0x3d')],{})[_0x568f('0x28')](respondWithResult(_0x57c011,0xc9))[_0x568f('0x3a')](handleError(_0x57c011,null));};exports['update']=function(_0x2f78f3,_0x3ca904){if(_0x2f78f3[_0x568f('0x3d')]['id']){delete _0x2f78f3[_0x568f('0x3d')]['id'];}return db[_0x568f('0x3c')][_0x568f('0x39')]({'where':{'id':_0x2f78f3[_0x568f('0x2c')]['id']}})[_0x568f('0x28')](handleEntityNotFound(_0x3ca904,null))[_0x568f('0x28')](saveUpdates(_0x2f78f3[_0x568f('0x3d')],null))[_0x568f('0x28')](respondWithResult(_0x3ca904,null))[_0x568f('0x3a')](handleError(_0x3ca904,null));};exports[_0x568f('0x29')]=function(_0x3e7212,_0x3a2772){return db['ChatProactiveAction'][_0x568f('0x39')]({'where':{'id':_0x3e7212['params']['id']}})['then'](handleEntityNotFound(_0x3a2772,null))[_0x568f('0x28')](removeEntity(_0x3a2772,null))['catch'](handleError(_0x3a2772,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index d0017df..c06ef71 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 _0x0e33=['rimraf','../../config/environment','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x414d9f,_0x11b943){var _0xa4f0de=function(_0xad3c83){while(--_0xad3c83){_0x414d9f['push'](_0x414d9f['shift']());}};_0xa4f0de(++_0x11b943);}(_0x0e33,0xec));var _0x30e3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0e33[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x30e3('0x0'));var util=require(_0x30e3('0x1'));var logger=require(_0x30e3('0x2'))(_0x30e3('0x3'));var moment=require('moment');var BPromise=require(_0x30e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30e3('0x5'));var rimraf=require(_0x30e3('0x6'));var config=require(_0x30e3('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x30e3('0x8')]=function(_0x57ade1,_0xeef9cf){return _0x57ade1[_0x30e3('0x9')](_0x30e3('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x013b=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api','moment'];(function(_0x53b6aa,_0x175561){var _0x4160f8=function(_0x4fe530){while(--_0x4fe530){_0x53b6aa['push'](_0x53b6aa['shift']());}};_0x4160f8(++_0x175561);}(_0x013b,0x99));var _0xb013=function(_0x2f88bf,_0x761a0e){_0x2f88bf=_0x2f88bf-0x0;var _0x1b451e=_0x013b[_0x2f88bf];return _0x1b451e;};'use strict';var _=require('lodash');var util=require(_0xb013('0x0'));var logger=require('../../config/logger')(_0xb013('0x1'));var moment=require(_0xb013('0x2'));var BPromise=require('bluebird');var rp=require(_0xb013('0x3'));var fs=require('fs');var path=require(_0xb013('0x4'));var rimraf=require(_0xb013('0x5'));var config=require(_0xb013('0x6'));var attributes=require(_0xb013('0x7'));module[_0xb013('0x8')]=function(_0x16fa4c,_0x411d3e){return _0x16fa4c[_0xb013('0x9')](_0xb013('0xa'),attributes,{'tableName':_0xb013('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 edf38b4..6986bcd 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 _0xd10e=['code','message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xd10e,0x1e3));var _0xed10=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xd10e[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0xed10('0x0'));var util=require(_0xed10('0x1'));var moment=require(_0xed10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed10('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xed10('0x4'));var logger=require(_0xed10('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xed10('0x6'));var client=jayson[_0xed10('0x7')][_0xed10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x111746,_0x4a9cd2,_0x541b32){return new BPromise(function(_0x4a4819,_0x22a649){return client[_0xed10('0x9')](_0x111746,_0x541b32)[_0xed10('0xa')](function(_0x1889c6){logger[_0xed10('0xb')](_0xed10('0xc'),_0x4a9cd2,_0xed10('0xd'));logger['debug'](_0xed10('0xe'),_0x4a9cd2,'request\x20sent',JSON[_0xed10('0xf')](_0x1889c6));if(_0x1889c6[_0xed10('0x10')]){if(_0x1889c6[_0xed10('0x10')][_0xed10('0x11')]===0x1f4){logger[_0xed10('0x10')](_0xed10('0xc'),_0x4a9cd2,_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);return _0x22a649(_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);}logger[_0xed10('0x10')](_0xed10('0xc'),_0x4a9cd2,_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);return _0x4a4819(_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);}else{logger[_0xed10('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x4a9cd2,'request\x20sent');_0x4a4819(_0x1889c6['result'][_0xed10('0x12')]);}})[_0xed10('0x13')](function(_0x155af2){logger[_0xed10('0x10')](_0xed10('0xc'),_0x4a9cd2,_0x155af2);_0x22a649(_0x155af2);});});}
\ No newline at end of file
+var _0x1169=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x1169,0x1f2));var _0x9116=function(_0x29b956,_0x1d62d7){_0x29b956=_0x29b956-0x0;var _0xbacdb1=_0x1169[_0x29b956];return _0xbacdb1;};'use strict';var _=require(_0x9116('0x0'));var util=require(_0x9116('0x1'));var moment=require(_0x9116('0x2'));var BPromise=require(_0x9116('0x3'));var rs=require(_0x9116('0x4'));var fs=require('fs');var Redis=require(_0x9116('0x5'));var db=require(_0x9116('0x6'))['db'];var utils=require(_0x9116('0x7'));var logger=require(_0x9116('0x8'))(_0x9116('0x9'));var config=require('../../config/environment');var jayson=require(_0x9116('0xa'));var client=jayson[_0x9116('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497a09,_0x592c9f,_0x34f8f1){return new BPromise(function(_0x3db7b8,_0x291e6e){return client[_0x9116('0xc')](_0x497a09,_0x34f8f1)['then'](function(_0x469f64){logger[_0x9116('0xd')](_0x9116('0xe'),_0x592c9f,_0x9116('0xf'));logger[_0x9116('0x10')](_0x9116('0x11'),_0x592c9f,_0x9116('0xf'),JSON[_0x9116('0x12')](_0x469f64));if(_0x469f64[_0x9116('0x13')]){if(_0x469f64[_0x9116('0x13')][_0x9116('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x592c9f,_0x469f64[_0x9116('0x13')][_0x9116('0x15')]);return _0x291e6e(_0x469f64[_0x9116('0x13')][_0x9116('0x15')]);}logger[_0x9116('0x13')](_0x9116('0xe'),_0x592c9f,_0x469f64[_0x9116('0x13')][_0x9116('0x15')]);return _0x3db7b8(_0x469f64['error'][_0x9116('0x15')]);}else{logger['info'](_0x9116('0xe'),_0x592c9f,_0x9116('0xf'));_0x3db7b8(_0x469f64[_0x9116('0x16')][_0x9116('0x15')]);}})[_0x9116('0x17')](function(_0x184388){logger[_0x9116('0x13')](_0x9116('0xe'),_0x592c9f,_0x184388);_0x291e6e(_0x184388);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 00f8960..907db19 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0xa89c7b,_0x1c4674){var _0x365802=function(_0x593675){while(--_0x593675){_0xa89c7b['push'](_0xa89c7b['shift']());}};_0x365802(++_0x1c4674);}(_0x032e,0x124));var _0xe032=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x032e[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x3de2b3,_0x5cb745){var _0x4ba243=function(_0x4a84c2){while(--_0x4a84c2){_0x3de2b3['push'](_0x3de2b3['shift']());}};_0x4ba243(++_0x5cb745);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x29c1c1,_0x34e6b4){_0x29c1c1=_0x29c1c1-0x0;var _0x3e72a0=_0xdbf5[_0x29c1c1];return _0x3e72a0;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index cc26add..8adbc32 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 _0xfa9c=['INTEGER','ENUM','rrmemory','exports','STRING','name'];(function(_0xce44ee,_0x387d70){var _0xf97a49=function(_0x3ceab0){while(--_0x3ceab0){_0xce44ee['push'](_0xce44ee['shift']());}};_0xf97a49(++_0x387d70);}(_0xfa9c,0x75));var _0xcfa9=function(_0x4ce00c,_0x1738ab){_0x4ce00c=_0x4ce00c-0x0;var _0x1b7d60=_0xfa9c[_0x4ce00c];return _0x1b7d60;};'use strict';var Sequelize=require('sequelize');module[_0xcfa9('0x0')]={'name':{'type':Sequelize[_0xcfa9('0x1')],'unique':_0xcfa9('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xcfa9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcfa9('0x4')](_0xcfa9('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0x0609=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x534e29,_0x44e544){var _0x12a7c8=function(_0xb3e7e9){while(--_0xb3e7e9){_0x534e29['push'](_0x534e29['shift']());}};_0x12a7c8(++_0x44e544);}(_0x0609,0x90));var _0x9060=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0609[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x9060('0x0'));module[_0x9060('0x1')]={'name':{'type':Sequelize[_0x9060('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9060('0x2')]},'timeout':{'type':Sequelize[_0x9060('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9060('0x4')](_0x9060('0x5'),_0x9060('0x6'),_0x9060('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 77a3104..7cffcb7 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 _0xe147=['findOrCreate','forEach','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ut.UserId\x20=\x20?','push','toString','QueryTypes','all','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','findAll','show','params','model','keys','query','intersection','attributes','fields','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','length','nolimit','sort','pick','filter','User','UserId','agent','chatPause','createdAt','rows','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe147,0x93));var _0x7e14=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe147[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0x7e14('0x0'));var util=require(_0x7e14('0x1'));var _=require(_0x7e14('0x2'));var squel=require(_0x7e14('0x3'));var Redis=require(_0x7e14('0x4'));var qs=require(_0x7e14('0x5'));var logger=require('../../config/logger')(_0x7e14('0x6'));var config=require(_0x7e14('0x7'));var db=require(_0x7e14('0x8'))['db'];config[_0x7e14('0x9')]=_[_0x7e14('0xa')](config[_0x7e14('0x9')],{'host':_0x7e14('0xb'),'port':0x18eb});var socket=require(_0x7e14('0xc'))(new Redis(config['redis']));require(_0x7e14('0xd'))['register'](socket);function respondWithStatusCode(_0x23c2c5,_0x594e7f){_0x594e7f=_0x594e7f||0xcc;return function(_0x485a0f){if(_0x485a0f){return _0x23c2c5[_0x7e14('0xe')](_0x594e7f);}return _0x23c2c5[_0x7e14('0xf')](_0x594e7f)[_0x7e14('0x10')]();};}function respondWithResult(_0x42de97,_0x256a20){_0x256a20=_0x256a20||0xc8;return function(_0x41e482){if(_0x41e482){return _0x42de97[_0x7e14('0xf')](_0x256a20)[_0x7e14('0x11')](_0x41e482);}};}function respondWithFilteredResult(_0x279ad4,_0x1ce2a0){return function(_0x1d549e){if(_0x1d549e){var _0x2953b4=typeof _0x1ce2a0[_0x7e14('0x12')]===_0x7e14('0x13')&&typeof _0x1ce2a0['limit']==='undefined';var _0x225183=_0x1d549e[_0x7e14('0x14')];var _0x54a7ef=_0x2953b4?0x0:_0x1ce2a0[_0x7e14('0x12')];var _0x21efe8=_0x2953b4?_0x1d549e[_0x7e14('0x14')]:_0x1ce2a0[_0x7e14('0x12')]+_0x1ce2a0[_0x7e14('0x15')];var _0x2b6bd2;if(_0x21efe8>=_0x225183){_0x21efe8=_0x225183;_0x2b6bd2=0xc8;}else{_0x2b6bd2=0xce;}_0x279ad4[_0x7e14('0xf')](_0x2b6bd2);return _0x279ad4[_0x7e14('0x16')](_0x7e14('0x17'),_0x54a7ef+'-'+_0x21efe8+'/'+_0x225183)['json'](_0x1d549e);}return null;};}function saveUpdates(_0x4a3953){return function(_0x32671d){if(_0x32671d){return _0x32671d[_0x7e14('0x18')](_0x4a3953)[_0x7e14('0x19')](function(_0xae8ddf){return _0xae8ddf;});}return null;};}function removeEntity(_0x5d8582){return function(_0x51995b){if(_0x51995b){return _0x51995b[_0x7e14('0x1a')]()[_0x7e14('0x19')](function(){var _0x36ba8d=_0x51995b[_0x7e14('0x1b')]({'plain':!![]});var _0x543759=_0x7e14('0x1c');return db[_0x7e14('0x1d')]['destroy']({'where':{'type':_0x543759,'resourceId':_0x36ba8d['id']}})[_0x7e14('0x19')](function(){return _0x51995b;});})[_0x7e14('0x19')](function(){_0x5d8582[_0x7e14('0xf')](0xcc)[_0x7e14('0x10')]();});}};}function handleEntityNotFound(_0x7f802){return function(_0x1a4ac8){if(!_0x1a4ac8){_0x7f802[_0x7e14('0xe')](0x194);}return _0x1a4ac8;};}function handleError(_0x2fab9f,_0xf8788a){_0xf8788a=_0xf8788a||0x1f4;return function(_0x19112d){logger[_0x7e14('0x1e')](_0x19112d[_0x7e14('0x1f')]);if(_0x19112d['name']){delete _0x19112d[_0x7e14('0x20')];}_0x2fab9f['status'](_0xf8788a)[_0x7e14('0x21')](_0x19112d);};}exports[_0x7e14('0x22')]=function(_0x35b2ab,_0xc38132){var _0x14f574={};var _0xf2c04c={'count':0x0,'rows':[]};var _0x1ffb31=_[_0x7e14('0x23')](db['ChatQueue'][_0x7e14('0x24')],function(_0x4b3e2c){return{'name':_0x4b3e2c[_0x7e14('0x25')],'type':_0x4b3e2c[_0x7e14('0x26')][_0x7e14('0x27')]};});_0x14f574=qs[_0x7e14('0x28')](_0x1ffb31,_0x35b2ab);var _0x3fa64b={'where':_0x14f574[_0x7e14('0x29')]};return db[_0x7e14('0x2a')][_0x7e14('0x14')](_0x3fa64b)[_0x7e14('0x19')](function(_0x4e3f80){_0xf2c04c['count']=_0x4e3f80;_0x14f574[_0x7e14('0x2b')]=qs[_0x7e14('0x2b')](_0x35b2ab['query']);return db[_0x7e14('0x2a')][_0x7e14('0x2c')](_0x14f574);})[_0x7e14('0x19')](function(_0x1003e8){_0xf2c04c['rows']=_0x1003e8;return _0xf2c04c;})['then'](respondWithFilteredResult(_0xc38132,_0x14f574))['catch'](handleError(_0xc38132,null));};exports[_0x7e14('0x2d')]=function(_0x1e2520,_0x2eba18){var _0x3bebc4={'raw':!![],'where':{'id':_0x1e2520[_0x7e14('0x2e')]['id']}},_0x232c0a={};_0x232c0a[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db['ChatQueue'][_0x7e14('0x24')]);_0x232c0a['query']=_[_0x7e14('0x30')](_0x1e2520[_0x7e14('0x31')]);_0x232c0a['filters']=_[_0x7e14('0x32')](_0x232c0a[_0x7e14('0x2f')],_0x232c0a[_0x7e14('0x31')]);_0x3bebc4[_0x7e14('0x33')]=_[_0x7e14('0x32')](_0x232c0a[_0x7e14('0x2f')],qs[_0x7e14('0x34')](_0x1e2520[_0x7e14('0x31')][_0x7e14('0x34')]));_0x3bebc4[_0x7e14('0x33')]=_0x3bebc4['attributes']['length']?_0x3bebc4[_0x7e14('0x33')]:_0x232c0a[_0x7e14('0x2f')];if(_0x1e2520[_0x7e14('0x31')]['includeAll']){_0x3bebc4[_0x7e14('0x2b')]=[{'all':!![]}];}_0x3bebc4=_[_0x7e14('0x35')]({},_0x3bebc4,_0x1e2520[_0x7e14('0x36')]);return db[_0x7e14('0x2a')][_0x7e14('0x37')](_0x3bebc4)[_0x7e14('0x19')](handleEntityNotFound(_0x2eba18,null))[_0x7e14('0x19')](respondWithResult(_0x2eba18,null))[_0x7e14('0x38')](handleError(_0x2eba18,null));};exports[_0x7e14('0x39')]=function(_0x78c5af,_0x5a0507){return db[_0x7e14('0x2a')][_0x7e14('0x39')](_0x78c5af[_0x7e14('0x3a')],{})['then'](function(_0x1b50c6){var _0xd8cd7f=_0x78c5af[_0x7e14('0x3b')][_0x7e14('0x1b')]({'plain':!![]});if(!_0xd8cd7f)throw new Error(_0x7e14('0x3c'));if(_0xd8cd7f['role']===_0x7e14('0x3b')){var _0x17aa2e=_0x1b50c6[_0x7e14('0x1b')]({'plain':!![]});var _0x1f1801=_0x7e14('0x1c');return db[_0x7e14('0x3d')][_0x7e14('0x37')]({'where':{'name':_0x1f1801,'userProfileId':_0xd8cd7f[_0x7e14('0x3e')]},'raw':!![]})[_0x7e14('0x19')](function(_0x591636){if(_0x591636&&_0x591636[_0x7e14('0x3f')]===0x0){return db['UserProfileResource']['create']({'name':_0x17aa2e[_0x7e14('0x20')],'resourceId':_0x17aa2e['id'],'type':_0x591636[_0x7e14('0x20')],'sectionId':_0x591636['id']},{})[_0x7e14('0x19')](function(){return _0x1b50c6;});}else{return _0x1b50c6;}})[_0x7e14('0x38')](function(_0xa6e8f4){logger[_0x7e14('0x1e')](_0x7e14('0x40'),_0xa6e8f4);throw _0xa6e8f4;});}return _0x1b50c6;})[_0x7e14('0x19')](respondWithResult(_0x5a0507,0xc9))[_0x7e14('0x38')](handleError(_0x5a0507,null));};exports[_0x7e14('0x18')]=function(_0x2bf541,_0x265dae){if(_0x2bf541[_0x7e14('0x3a')]['id']){delete _0x2bf541[_0x7e14('0x3a')]['id'];}return db[_0x7e14('0x2a')]['find']({'where':{'id':_0x2bf541[_0x7e14('0x2e')]['id']}})['then'](handleEntityNotFound(_0x265dae,null))[_0x7e14('0x19')](saveUpdates(_0x2bf541['body'],null))[_0x7e14('0x19')](respondWithResult(_0x265dae,null))[_0x7e14('0x38')](handleError(_0x265dae,null));};exports[_0x7e14('0x1a')]=function(_0x261ec9,_0x28579c){return db['ChatQueue'][_0x7e14('0x37')]({'where':{'id':_0x261ec9[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x28579c,null))[_0x7e14('0x19')](removeEntity(_0x28579c,null))[_0x7e14('0x38')](handleError(_0x28579c,null));};exports[_0x7e14('0x41')]=function(_0x575f7a,_0x1fa6cf){return db[_0x7e14('0x2a')]['describe']()['then'](respondWithResult(_0x1fa6cf,null))['catch'](handleError(_0x1fa6cf,null));};exports[_0x7e14('0x42')]=function(_0x1a4542,_0x16c11f){var _0x169149={'raw':!![],'where':{}},_0x2bc5b9={},_0x42a366;return db[_0x7e14('0x2a')][_0x7e14('0x43')]({'where':{'id':_0x1a4542[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x16c11f,null))[_0x7e14('0x19')](function(_0x5541b2){if(_0x5541b2){_0x42a366=_0x5541b2[_0x7e14('0x1b')]({'plain':!![]});_0x2bc5b9[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db[_0x7e14('0x44')]['rawAttributes']);_0x2bc5b9['query']=_[_0x7e14('0x30')](_0x1a4542[_0x7e14('0x31')]);_0x2bc5b9[_0x7e14('0x45')]=_[_0x7e14('0x32')](_0x2bc5b9[_0x7e14('0x2f')],_0x2bc5b9[_0x7e14('0x31')]);_0x169149['attributes']=_[_0x7e14('0x32')](_0x2bc5b9[_0x7e14('0x2f')],qs[_0x7e14('0x34')](_0x1a4542[_0x7e14('0x31')][_0x7e14('0x34')]));_0x169149[_0x7e14('0x33')]=_0x169149['attributes'][_0x7e14('0x46')]?_0x169149[_0x7e14('0x33')]:_0x2bc5b9['model'];if(!_0x1a4542[_0x7e14('0x31')]['hasOwnProperty'](_0x7e14('0x47'))){_0x169149[_0x7e14('0x15')]=qs['limit'](_0x1a4542['query'][_0x7e14('0x15')]);_0x169149['offset']=qs[_0x7e14('0x12')](_0x1a4542[_0x7e14('0x31')]['offset']);}_0x169149['order']=qs[_0x7e14('0x48')](_0x1a4542[_0x7e14('0x31')][_0x7e14('0x48')]);_0x169149['where']=qs[_0x7e14('0x45')](_[_0x7e14('0x49')](_0x1a4542['query'],_0x2bc5b9[_0x7e14('0x45')]));_0x169149[_0x7e14('0x29')]['ChatQueueId']=_0x5541b2['id'];if(_0x1a4542[_0x7e14('0x31')][_0x7e14('0x4a')]){_0x169149[_0x7e14('0x29')]=_['merge'](_0x169149[_0x7e14('0x29')],{'$or':_['map'](_0x169149[_0x7e14('0x33')],function(_0xbc8420){var _0x5edf38={};_0x5edf38[_0xbc8420]={'$like':'%'+_0x1a4542[_0x7e14('0x31')][_0x7e14('0x4a')]+'%'};return _0x5edf38;})});}_0x169149=_[_0x7e14('0x35')]({},_0x169149,_0x1a4542[_0x7e14('0x36')]);return db[_0x7e14('0x44')][_0x7e14('0x2c')](_0x169149);}})[_0x7e14('0x19')](function(_0x396d7){if(_0x396d7){return db[_0x7e14('0x4b')]['findAndCountAll']({'where':{'id':_['map'](_0x396d7,_0x7e14('0x4c')),'role':_0x7e14('0x4d')},'attributes':['id',_0x7e14('0x20'),_0x7e14('0x4e'),'updatedAt',_0x7e14('0x4f')]});}})['then'](function(_0x76514c){if(_0x76514c){return{'count':_0x76514c['count'],'rows':_['map'](_0x76514c[_0x7e14('0x50')],function(_0x925824){return{'membername':_0x925824[_0x7e14('0x20')],'UserId':_0x925824['id'],'queue_name':_0x42a366[_0x7e14('0x20')],'ChatQueueId':_0x42a366['id'],'interface':util[_0x7e14('0x51')](_0x7e14('0x52'),_0x7e14('0x53'),_0x925824['name']),'penalty':0x0,'paused':_0x925824['chatPause'],'createdAt':_0x925824['createdAt'],'updatedAt':_0x925824['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7e14('0x19')](respondWithFilteredResult(_0x16c11f,_0x169149))[_0x7e14('0x38')](handleError(_0x16c11f,null));};exports[_0x7e14('0x54')]=function(_0x4e2242,_0x42a80b){var _0x492dd5={};var _0x5945b2={};var _0x2f10e0;var _0x55536c;return db[_0x7e14('0x2a')][_0x7e14('0x43')]({'where':{'id':_0x4e2242['params']['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x42a80b,null))['then'](function(_0x2d88e7){if(_0x2d88e7){_0x2f10e0=_0x2d88e7;_0x5945b2[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db[_0x7e14('0x55')][_0x7e14('0x24')]);_0x5945b2['query']=_[_0x7e14('0x30')](_0x4e2242[_0x7e14('0x31')]);_0x5945b2[_0x7e14('0x45')]=_[_0x7e14('0x32')](_0x5945b2[_0x7e14('0x2f')],_0x5945b2[_0x7e14('0x31')]);_0x492dd5[_0x7e14('0x33')]=_[_0x7e14('0x32')](_0x5945b2[_0x7e14('0x2f')],qs['fields'](_0x4e2242[_0x7e14('0x31')][_0x7e14('0x34')]));_0x492dd5['attributes']=_0x492dd5[_0x7e14('0x33')][_0x7e14('0x46')]?_0x492dd5[_0x7e14('0x33')]:_0x5945b2[_0x7e14('0x2f')];_0x492dd5[_0x7e14('0x56')]=qs['sort'](_0x4e2242['query'][_0x7e14('0x48')]);_0x492dd5['where']=qs[_0x7e14('0x45')](_['pick'](_0x4e2242['query'],_0x5945b2[_0x7e14('0x45')]));if(_0x4e2242[_0x7e14('0x31')][_0x7e14('0x4a')]){_0x492dd5[_0x7e14('0x29')]=_['merge'](_0x492dd5[_0x7e14('0x29')],{'$or':_[_0x7e14('0x23')](_0x492dd5['attributes'],function(_0x256525){var _0x539873={};_0x539873[_0x256525]={'$like':'%'+_0x4e2242['query'][_0x7e14('0x4a')]+'%'};return _0x539873;})});}_0x492dd5=_['merge']({},_0x492dd5,_0x4e2242['options']);return _0x2f10e0['getTeams'](_0x492dd5);}})['then'](function(_0x568c6a){if(_0x568c6a){_0x55536c=_0x568c6a[_0x7e14('0x46')];if(!_0x4e2242[_0x7e14('0x31')]['hasOwnProperty'](_0x7e14('0x47'))){_0x492dd5['limit']=qs[_0x7e14('0x15')](_0x4e2242[_0x7e14('0x31')][_0x7e14('0x15')]);_0x492dd5[_0x7e14('0x12')]=qs[_0x7e14('0x12')](_0x4e2242[_0x7e14('0x31')][_0x7e14('0x12')]);}return _0x2f10e0['getTeams'](_0x492dd5);}})[_0x7e14('0x19')](function(_0x24ab32){if(_0x24ab32){return _0x24ab32?{'count':_0x55536c,'rows':_0x24ab32}:null;}})[_0x7e14('0x19')](respondWithResult(_0x42a80b,null))['catch'](handleError(_0x42a80b,null));};exports[_0x7e14('0x57')]=function(_0x4146d3,_0x43702d){var _0x3f37c8=_0x4146d3['body'][_0x7e14('0x58')];return db[_0x7e14('0x55')]['findAll']({'where':{'id':_0x3f37c8},'attributes':['id'],'include':[{'model':db[_0x7e14('0x4b')],'as':_0x7e14('0x59'),'attributes':['id',_0x7e14('0x20'),_0x7e14('0x5a'),_0x7e14('0x5b'),_0x7e14('0x5c')],'raw':!![]}]})[_0x7e14('0x19')](function(_0x29dfbe){if(_0x29dfbe){var _0x413db0=_[_0x7e14('0x5d')](_0x29dfbe,function(_0x5ebdfe){var _0x558eee=_0x5ebdfe['get']({'plain':!![]});return _0x558eee[_0x7e14('0x59')];});return db[_0x7e14('0x2a')][_0x7e14('0x37')]({'where':{'id':_0x4146d3['params']['id']}})[_0x7e14('0x19')](function(_0x3443df){return db[_0x7e14('0x5e')][_0x7e14('0x5f')](function(_0x3eb1de){return _0x3443df['addTeams'](_0x3f37c8,{'transaction':_0x3eb1de})[_0x7e14('0x19')](function(){return BPromise[_0x7e14('0x60')](_0x413db0,function(_0x34b2b5){return db[_0x7e14('0x44')][_0x7e14('0x61')]({'where':{'UserId':_0x34b2b5['id'],'ChatQueueId':_0x4146d3[_0x7e14('0x2e')]['id']},'transaction':_0x3eb1de});});})[_0x7e14('0x19')](function(){_0x413db0[_0x7e14('0x62')](function(_0x30cdfa){socket[_0x7e14('0x63')](_0x7e14('0x64'),{'UserId':_0x30cdfa['id'],'ChatQueueId':_0x3443df['id']});});});});});}})['then'](respondWithStatusCode(_0x43702d,null))['catch'](handleError(_0x43702d,null));};exports['removeTeams']=function(_0x449a4e,_0x1beb79){return db[_0x7e14('0x55')][_0x7e14('0x2c')]({'where':{'id':_0x449a4e[_0x7e14('0x31')][_0x7e14('0x58')]},'attributes':['id'],'include':[{'model':db[_0x7e14('0x4b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7e14('0x19')](handleEntityNotFound(_0x1beb79,null))[_0x7e14('0x19')](function(_0x5f21fd){var _0x4cf273=_[_0x7e14('0x23')](_0x5f21fd,'id');var _0xb2e2f7=[];var _0x34ed7a=[];var _0x53df6e=squel['select']();_0x53df6e[_0x7e14('0x65')](_0x7e14('0x66'))[_0x7e14('0x67')](_0x7e14('0x68'),'tq')[_0x7e14('0x69')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x449a4e[_0x7e14('0x2e')]['id']);for(var _0x1a8dff=0x0;_0x1a8dff<_0x5f21fd[_0x7e14('0x46')];_0x1a8dff+=0x1){let _0x198d4f=_0x5f21fd[_0x1a8dff];for(var _0x23da0e=0x0;_0x23da0e<_0x198d4f['Agents'][_0x7e14('0x46')];_0x23da0e+=0x1){let _0x596ca3=_0x198d4f['Agents'][_0x23da0e];var _0x8060f0=_0x53df6e['clone']();_0x8060f0[_0x7e14('0x29')](_0x7e14('0x6a'),_0x596ca3['id']);_0x34ed7a[_0x7e14('0x6b')](db[_0x7e14('0x5e')][_0x7e14('0x31')](_0x8060f0[_0x7e14('0x6c')](),{'type':db[_0x7e14('0x5e')][_0x7e14('0x6d')]['SELECT']})['then'](function(_0x277821){if(_0x277821[_0x7e14('0x46')]===0x1){return _0x596ca3['id'];}else{var _0x25b4f0=_['every'](_[_0x7e14('0x23')](_0x277821,'TeamId'),function(_0xfa6f9f){return _['includes'](_0x4cf273,_0xfa6f9f);});if(_0x25b4f0){return _0x596ca3['id'];}}}));}}return BPromise[_0x7e14('0x6e')](_0x34ed7a)[_0x7e14('0x19')](function(_0x446cd8){_0xb2e2f7=_(_0xb2e2f7)['union'](_0x446cd8)['compact']()[_0x7e14('0x6f')]();return db[_0x7e14('0x2a')][_0x7e14('0x37')]({'where':{'id':_0x449a4e[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](function(_0x45defe){return db['sequelize']['transaction'](function(_0x168521){return _0x45defe[_0x7e14('0x70')](_0x449a4e[_0x7e14('0x31')][_0x7e14('0x58')],{'transaction':_0x168521})['then'](function(){if(!_[_0x7e14('0x71')](_0xb2e2f7)){return _0x45defe[_0x7e14('0x72')](_0xb2e2f7,{'transaction':_0x168521});}})[_0x7e14('0x19')](function(){_0xb2e2f7[_0x7e14('0x62')](function(_0x41b070){socket['emit'](_0x7e14('0x73'),{'UserId':_0x41b070,'ChatQueueId':_0x45defe['id']});});});});});});})[_0x7e14('0x19')](respondWithStatusCode(_0x1beb79,null))[_0x7e14('0x38')](handleError(_0x1beb79,null));};exports[_0x7e14('0x74')]=function(_0xe7ad54,_0x198ffc){return db['ChatQueue']['find']({'where':{'id':_0xe7ad54[_0x7e14('0x2e')]['id']}})['then'](handleEntityNotFound(_0x198ffc,null))['then'](function(_0x5b7187){if(_0x5b7187){return _0x5b7187[_0x7e14('0x74')](_0xe7ad54[_0x7e14('0x3a')][_0x7e14('0x58')],_[_0x7e14('0x75')](_0xe7ad54[_0x7e14('0x3a')],[_0x7e14('0x58'),'id'])||{})[_0x7e14('0x76')](function(_0x23a80e){for(var _0x353ab4=0x0;_0x353ab4<_0xe7ad54[_0x7e14('0x3a')]['ids'][_0x7e14('0x46')];_0x353ab4+=0x1){socket[_0x7e14('0x63')](_0x7e14('0x64'),{'UserId':Number(_0xe7ad54[_0x7e14('0x3a')][_0x7e14('0x58')][_0x353ab4]),'ChatQueueId':Number(_0xe7ad54[_0x7e14('0x2e')]['id'])});}return _0x23a80e;});}})[_0x7e14('0x19')](respondWithResult(_0x198ffc,null))[_0x7e14('0x38')](handleError(_0x198ffc,null));};exports[_0x7e14('0x72')]=function(_0x45312a,_0x2ee150){return db[_0x7e14('0x2a')][_0x7e14('0x37')]({'where':{'id':_0x45312a[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x2ee150,null))[_0x7e14('0x19')](function(_0xa2e659){if(_0xa2e659){return _0xa2e659[_0x7e14('0x72')](_0x45312a[_0x7e14('0x31')][_0x7e14('0x58')])['then'](function(){if(_[_0x7e14('0x77')](_0x45312a['query'][_0x7e14('0x58')])){for(var _0x256a27=0x0;_0x256a27<_0x45312a[_0x7e14('0x31')][_0x7e14('0x58')][_0x7e14('0x46')];_0x256a27+=0x1){socket[_0x7e14('0x63')]('userChatQueue:remove',{'UserId':Number(_0x45312a['query'][_0x7e14('0x58')][_0x256a27]),'ChatQueueId':Number(_0x45312a[_0x7e14('0x2e')]['id'])});}}else{socket[_0x7e14('0x63')](_0x7e14('0x73'),{'UserId':Number(_0x45312a[_0x7e14('0x31')][_0x7e14('0x58')]),'ChatQueueId':Number(_0x45312a[_0x7e14('0x2e')]['id'])});}});}})[_0x7e14('0x19')](respondWithStatusCode(_0x2ee150,null))[_0x7e14('0x38')](handleError(_0x2ee150,null));};exports[_0x7e14('0x78')]=function(_0x3b8afb,_0x551997){var _0x5647b6={};var _0x58fb8a={};var _0x3ff3e7;var _0x538937;return db[_0x7e14('0x2a')][_0x7e14('0x43')]({'where':{'id':_0x3b8afb[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x551997,null))[_0x7e14('0x19')](function(_0x14d73f){if(_0x14d73f){_0x3ff3e7=_0x14d73f;_0x58fb8a[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db[_0x7e14('0x4b')][_0x7e14('0x24')]);_0x58fb8a[_0x7e14('0x31')]=_[_0x7e14('0x30')](_0x3b8afb[_0x7e14('0x31')]);_0x58fb8a[_0x7e14('0x45')]=_[_0x7e14('0x32')](_0x58fb8a['model'],_0x58fb8a[_0x7e14('0x31')]);_0x5647b6['attributes']=_[_0x7e14('0x32')](_0x58fb8a[_0x7e14('0x2f')],qs[_0x7e14('0x34')](_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x34')]));_0x5647b6[_0x7e14('0x33')]=_0x5647b6[_0x7e14('0x33')][_0x7e14('0x46')]?_0x5647b6[_0x7e14('0x33')]:_0x58fb8a[_0x7e14('0x2f')];_0x5647b6[_0x7e14('0x56')]=qs[_0x7e14('0x48')](_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x48')]);_0x5647b6['where']=qs[_0x7e14('0x45')](_[_0x7e14('0x49')](_0x3b8afb[_0x7e14('0x31')],_0x58fb8a[_0x7e14('0x45')]));if(_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x4a')]){_0x5647b6[_0x7e14('0x29')]=_['merge'](_0x5647b6[_0x7e14('0x29')],{'$or':_['map'](_0x5647b6[_0x7e14('0x33')],function(_0x47293e){var _0x29a803={};_0x29a803[_0x47293e]={'$like':'%'+_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x4a')]+'%'};return _0x29a803;})});}_0x5647b6=_[_0x7e14('0x35')]({},_0x5647b6,_0x3b8afb[_0x7e14('0x36')]);return _0x3ff3e7['getAgents'](_0x5647b6);}})[_0x7e14('0x19')](function(_0x264f67){if(_0x264f67){_0x538937=_0x264f67[_0x7e14('0x46')];if(!_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x79')]('nolimit')){_0x5647b6[_0x7e14('0x15')]=qs[_0x7e14('0x15')](_0x3b8afb['query'][_0x7e14('0x15')]);_0x5647b6[_0x7e14('0x12')]=qs[_0x7e14('0x12')](_0x3b8afb['query']['offset']);}return _0x3ff3e7['getAgents'](_0x5647b6);}})['then'](function(_0x2a7046){if(_0x2a7046){return _0x2a7046?{'count':_0x538937,'rows':_0x2a7046}:null;}})['then'](respondWithResult(_0x551997,null))[_0x7e14('0x38')](handleError(_0x551997,null));};
\ No newline at end of file
+var _0xa986=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','set','Content-Range','json','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','getOptions','where','count','include','query','ChatQueue','findAll','catch','params','keys','filters','attributes','intersection','fields','length','model','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','limit','order','sort','pick','ChatQueueId','filter','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','ids','voicePause','interface','flatMap','Agents','sequelize','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','transaction','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','bluebird','util','squel','api','../../config/environment'];(function(_0x2ebe90,_0x2825d9){var _0x184e90=function(_0x1115a7){while(--_0x1115a7){_0x2ebe90['push'](_0x2ebe90['shift']());}};_0x184e90(++_0x2825d9);}(_0xa986,0x6f));var _0x6a98=function(_0x2bb675,_0x10e35c){_0x2bb675=_0x2bb675-0x0;var _0x606be5=_0xa986[_0x2bb675];return _0x606be5;};'use strict';var BPromise=require(_0x6a98('0x0'));var util=require(_0x6a98('0x1'));var _=require('lodash');var squel=require(_0x6a98('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6a98('0x3'));var config=require(_0x6a98('0x4'));var db=require('../../mysqldb')['db'];config[_0x6a98('0x5')]=_[_0x6a98('0x6')](config[_0x6a98('0x5')],{'host':_0x6a98('0x7'),'port':0x18eb});var socket=require(_0x6a98('0x8'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0xb58711,_0x214a79){_0x214a79=_0x214a79||0xcc;return function(_0x21283e){if(_0x21283e){return _0xb58711[_0x6a98('0x9')](_0x214a79);}return _0xb58711[_0x6a98('0xa')](_0x214a79)[_0x6a98('0xb')]();};}function respondWithResult(_0x59cb94,_0x442d70){_0x442d70=_0x442d70||0xc8;return function(_0x2f29a4){if(_0x2f29a4){return _0x59cb94[_0x6a98('0xa')](_0x442d70)['json'](_0x2f29a4);}};}function respondWithFilteredResult(_0xb96254,_0x3f6b7d){return function(_0x40c75f){if(_0x40c75f){var _0x389163=typeof _0x3f6b7d[_0x6a98('0xc')]===_0x6a98('0xd')&&typeof _0x3f6b7d['limit']==='undefined';var _0x3cbe2e=_0x40c75f['count'];var _0x19cdc5=_0x389163?0x0:_0x3f6b7d['offset'];var _0x3eded6=_0x389163?_0x40c75f['count']:_0x3f6b7d[_0x6a98('0xc')]+_0x3f6b7d['limit'];var _0x3c0630;if(_0x3eded6>=_0x3cbe2e){_0x3eded6=_0x3cbe2e;_0x3c0630=0xc8;}else{_0x3c0630=0xce;}_0xb96254[_0x6a98('0xa')](_0x3c0630);return _0xb96254[_0x6a98('0xe')](_0x6a98('0xf'),_0x19cdc5+'-'+_0x3eded6+'/'+_0x3cbe2e)[_0x6a98('0x10')](_0x40c75f);}return null;};}function saveUpdates(_0x598fd6){return function(_0x314211){if(_0x314211){return _0x314211['update'](_0x598fd6)[_0x6a98('0x11')](function(_0x5ae647){return _0x5ae647;});}return null;};}function removeEntity(_0xd375e9){return function(_0xe3c130){if(_0xe3c130){return _0xe3c130[_0x6a98('0x12')]()[_0x6a98('0x11')](function(){var _0x3ac12d=_0xe3c130[_0x6a98('0x13')]({'plain':!![]});var _0x321a5a=_0x6a98('0x14');return db[_0x6a98('0x15')][_0x6a98('0x12')]({'where':{'type':_0x321a5a,'resourceId':_0x3ac12d['id']}})[_0x6a98('0x11')](function(){return _0xe3c130;});})['then'](function(){_0xd375e9['status'](0xcc)[_0x6a98('0xb')]();});}};}function handleEntityNotFound(_0x3dbd05){return function(_0x20312d){if(!_0x20312d){_0x3dbd05[_0x6a98('0x9')](0x194);}return _0x20312d;};}function handleError(_0xc43b1c,_0x2ea573){_0x2ea573=_0x2ea573||0x1f4;return function(_0x1c3804){logger[_0x6a98('0x16')](_0x1c3804[_0x6a98('0x17')]);if(_0x1c3804[_0x6a98('0x18')]){delete _0x1c3804[_0x6a98('0x18')];}_0xc43b1c[_0x6a98('0xa')](_0x2ea573)['send'](_0x1c3804);};}exports[_0x6a98('0x19')]=function(_0x5a714c,_0x68cd46){var _0x53627f={};var _0x298fb0={'count':0x0,'rows':[]};var _0x5472fa=_['map'](db['ChatQueue'][_0x6a98('0x1a')],function(_0x3eb2ce){return{'name':_0x3eb2ce[_0x6a98('0x1b')],'type':_0x3eb2ce[_0x6a98('0x1c')]['key']};});_0x53627f=qs[_0x6a98('0x1d')](_0x5472fa,_0x5a714c);var _0x366048={'where':_0x53627f[_0x6a98('0x1e')]};return db['ChatQueue']['count'](_0x366048)['then'](function(_0x3d85b3){_0x298fb0[_0x6a98('0x1f')]=_0x3d85b3;_0x53627f[_0x6a98('0x20')]=qs[_0x6a98('0x20')](_0x5a714c[_0x6a98('0x21')]);return db[_0x6a98('0x22')][_0x6a98('0x23')](_0x53627f);})[_0x6a98('0x11')](function(_0x88bb1b){_0x298fb0['rows']=_0x88bb1b;return _0x298fb0;})['then'](respondWithFilteredResult(_0x68cd46,_0x53627f))[_0x6a98('0x24')](handleError(_0x68cd46,null));};exports['show']=function(_0x13dbbd,_0x1adb00){var _0x1ddce4={'raw':!![],'where':{'id':_0x13dbbd[_0x6a98('0x25')]['id']}},_0x386f75={};_0x386f75['model']=_[_0x6a98('0x26')](db[_0x6a98('0x22')]['rawAttributes']);_0x386f75[_0x6a98('0x21')]=_[_0x6a98('0x26')](_0x13dbbd[_0x6a98('0x21')]);_0x386f75[_0x6a98('0x27')]=_['intersection'](_0x386f75['model'],_0x386f75[_0x6a98('0x21')]);_0x1ddce4[_0x6a98('0x28')]=_[_0x6a98('0x29')](_0x386f75['model'],qs['fields'](_0x13dbbd[_0x6a98('0x21')][_0x6a98('0x2a')]));_0x1ddce4[_0x6a98('0x28')]=_0x1ddce4[_0x6a98('0x28')][_0x6a98('0x2b')]?_0x1ddce4[_0x6a98('0x28')]:_0x386f75[_0x6a98('0x2c')];if(_0x13dbbd[_0x6a98('0x21')]['includeAll']){_0x1ddce4['include']=[{'all':!![]}];}_0x1ddce4=_[_0x6a98('0x2d')]({},_0x1ddce4,_0x13dbbd[_0x6a98('0x2e')]);return db[_0x6a98('0x22')]['find'](_0x1ddce4)['then'](handleEntityNotFound(_0x1adb00,null))[_0x6a98('0x11')](respondWithResult(_0x1adb00,null))['catch'](handleError(_0x1adb00,null));};exports['create']=function(_0x50f91f,_0xbadb6b){return db[_0x6a98('0x22')][_0x6a98('0x2f')](_0x50f91f[_0x6a98('0x30')],{})[_0x6a98('0x11')](function(_0x178981){var _0x558876=_0x50f91f[_0x6a98('0x31')][_0x6a98('0x13')]({'plain':!![]});if(!_0x558876)throw new Error(_0x6a98('0x32'));if(_0x558876[_0x6a98('0x33')]===_0x6a98('0x31')){var _0x377af9=_0x178981[_0x6a98('0x13')]({'plain':!![]});var _0x4d553e=_0x6a98('0x14');return db[_0x6a98('0x34')][_0x6a98('0x35')]({'where':{'name':_0x4d553e,'userProfileId':_0x558876['userProfileId']},'raw':!![]})[_0x6a98('0x11')](function(_0x2d1859){if(_0x2d1859&&_0x2d1859[_0x6a98('0x36')]===0x0){return db['UserProfileResource'][_0x6a98('0x2f')]({'name':_0x377af9[_0x6a98('0x18')],'resourceId':_0x377af9['id'],'type':_0x2d1859[_0x6a98('0x18')],'sectionId':_0x2d1859['id']},{})['then'](function(){return _0x178981;});}else{return _0x178981;}})[_0x6a98('0x24')](function(_0x4c712f){logger[_0x6a98('0x16')](_0x6a98('0x37'),_0x4c712f);throw _0x4c712f;});}return _0x178981;})[_0x6a98('0x11')](respondWithResult(_0xbadb6b,0xc9))[_0x6a98('0x24')](handleError(_0xbadb6b,null));};exports[_0x6a98('0x38')]=function(_0xe728ee,_0x427790){if(_0xe728ee['body']['id']){delete _0xe728ee[_0x6a98('0x30')]['id'];}return db[_0x6a98('0x22')]['find']({'where':{'id':_0xe728ee[_0x6a98('0x25')]['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x427790,null))[_0x6a98('0x11')](saveUpdates(_0xe728ee[_0x6a98('0x30')],null))['then'](respondWithResult(_0x427790,null))['catch'](handleError(_0x427790,null));};exports['destroy']=function(_0xae6d9b,_0x2396f8){return db[_0x6a98('0x22')][_0x6a98('0x35')]({'where':{'id':_0xae6d9b[_0x6a98('0x25')]['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x2396f8,null))[_0x6a98('0x11')](removeEntity(_0x2396f8,null))['catch'](handleError(_0x2396f8,null));};exports['describe']=function(_0xa3c68f,_0x316e1a){return db['ChatQueue']['describe']()[_0x6a98('0x11')](respondWithResult(_0x316e1a,null))[_0x6a98('0x24')](handleError(_0x316e1a,null));};exports[_0x6a98('0x39')]=function(_0x347fcc,_0x1d08a8){var _0x3b108b={'raw':!![],'where':{}},_0x39039d={},_0x1ab3f0;return db[_0x6a98('0x22')][_0x6a98('0x3a')]({'where':{'id':_0x347fcc['params']['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x1d08a8,null))[_0x6a98('0x11')](function(_0xa05f74){if(_0xa05f74){_0x1ab3f0=_0xa05f74['get']({'plain':!![]});_0x39039d[_0x6a98('0x2c')]=_[_0x6a98('0x26')](db[_0x6a98('0x3b')]['rawAttributes']);_0x39039d['query']=_['keys'](_0x347fcc[_0x6a98('0x21')]);_0x39039d[_0x6a98('0x27')]=_['intersection'](_0x39039d[_0x6a98('0x2c')],_0x39039d[_0x6a98('0x21')]);_0x3b108b['attributes']=_[_0x6a98('0x29')](_0x39039d[_0x6a98('0x2c')],qs[_0x6a98('0x2a')](_0x347fcc['query'][_0x6a98('0x2a')]));_0x3b108b['attributes']=_0x3b108b[_0x6a98('0x28')][_0x6a98('0x2b')]?_0x3b108b[_0x6a98('0x28')]:_0x39039d['model'];if(!_0x347fcc[_0x6a98('0x21')][_0x6a98('0x3c')](_0x6a98('0x3d'))){_0x3b108b['limit']=qs['limit'](_0x347fcc[_0x6a98('0x21')][_0x6a98('0x3e')]);_0x3b108b[_0x6a98('0xc')]=qs[_0x6a98('0xc')](_0x347fcc['query'][_0x6a98('0xc')]);}_0x3b108b[_0x6a98('0x3f')]=qs['sort'](_0x347fcc['query'][_0x6a98('0x40')]);_0x3b108b['where']=qs[_0x6a98('0x27')](_[_0x6a98('0x41')](_0x347fcc[_0x6a98('0x21')],_0x39039d[_0x6a98('0x27')]));_0x3b108b[_0x6a98('0x1e')][_0x6a98('0x42')]=_0xa05f74['id'];if(_0x347fcc[_0x6a98('0x21')][_0x6a98('0x43')]){_0x3b108b['where']=_[_0x6a98('0x2d')](_0x3b108b[_0x6a98('0x1e')],{'$or':_[_0x6a98('0x44')](_0x3b108b[_0x6a98('0x28')],function(_0x59715f){var _0x41c0ba={};_0x41c0ba[_0x59715f]={'$like':'%'+_0x347fcc['query'][_0x6a98('0x43')]+'%'};return _0x41c0ba;})});}_0x3b108b=_['merge']({},_0x3b108b,_0x347fcc[_0x6a98('0x2e')]);return db[_0x6a98('0x3b')][_0x6a98('0x23')](_0x3b108b);}})[_0x6a98('0x11')](function(_0x4c1a2f){if(_0x4c1a2f){return db[_0x6a98('0x45')][_0x6a98('0x46')]({'where':{'id':_[_0x6a98('0x44')](_0x4c1a2f,_0x6a98('0x47')),'role':_0x6a98('0x48')},'attributes':['id',_0x6a98('0x18'),_0x6a98('0x49'),_0x6a98('0x4a'),_0x6a98('0x4b')]});}})['then'](function(_0x125977){if(_0x125977){return{'count':_0x125977[_0x6a98('0x1f')],'rows':_['map'](_0x125977['rows'],function(_0x321c93){return{'membername':_0x321c93['name'],'UserId':_0x321c93['id'],'queue_name':_0x1ab3f0['name'],'ChatQueueId':_0x1ab3f0['id'],'interface':util[_0x6a98('0x4c')]('%s/%s',_0x6a98('0x4d'),_0x321c93[_0x6a98('0x18')]),'penalty':0x0,'paused':_0x321c93[_0x6a98('0x49')],'createdAt':_0x321c93['createdAt'],'updatedAt':_0x321c93[_0x6a98('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d08a8,_0x3b108b))[_0x6a98('0x24')](handleError(_0x1d08a8,null));};exports[_0x6a98('0x4e')]=function(_0x53853e,_0x3b0b5b){var _0x36524a={};var _0x581206={};var _0x291747;var _0x1cdcc1;return db[_0x6a98('0x22')]['findOne']({'where':{'id':_0x53853e['params']['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x3b0b5b,null))[_0x6a98('0x11')](function(_0xa8ff64){if(_0xa8ff64){_0x291747=_0xa8ff64;_0x581206[_0x6a98('0x2c')]=_[_0x6a98('0x26')](db[_0x6a98('0x4f')][_0x6a98('0x1a')]);_0x581206[_0x6a98('0x21')]=_[_0x6a98('0x26')](_0x53853e[_0x6a98('0x21')]);_0x581206[_0x6a98('0x27')]=_[_0x6a98('0x29')](_0x581206['model'],_0x581206[_0x6a98('0x21')]);_0x36524a['attributes']=_['intersection'](_0x581206[_0x6a98('0x2c')],qs[_0x6a98('0x2a')](_0x53853e[_0x6a98('0x21')][_0x6a98('0x2a')]));_0x36524a[_0x6a98('0x28')]=_0x36524a['attributes'][_0x6a98('0x2b')]?_0x36524a[_0x6a98('0x28')]:_0x581206[_0x6a98('0x2c')];_0x36524a['order']=qs[_0x6a98('0x40')](_0x53853e[_0x6a98('0x21')][_0x6a98('0x40')]);_0x36524a[_0x6a98('0x1e')]=qs[_0x6a98('0x27')](_['pick'](_0x53853e['query'],_0x581206[_0x6a98('0x27')]));if(_0x53853e[_0x6a98('0x21')][_0x6a98('0x43')]){_0x36524a['where']=_[_0x6a98('0x2d')](_0x36524a[_0x6a98('0x1e')],{'$or':_[_0x6a98('0x44')](_0x36524a[_0x6a98('0x28')],function(_0x3f8e76){var _0x13936b={};_0x13936b[_0x3f8e76]={'$like':'%'+_0x53853e[_0x6a98('0x21')]['filter']+'%'};return _0x13936b;})});}_0x36524a=_[_0x6a98('0x2d')]({},_0x36524a,_0x53853e[_0x6a98('0x2e')]);return _0x291747[_0x6a98('0x4e')](_0x36524a);}})[_0x6a98('0x11')](function(_0x51fc78){if(_0x51fc78){_0x1cdcc1=_0x51fc78[_0x6a98('0x2b')];if(!_0x53853e[_0x6a98('0x21')][_0x6a98('0x3c')](_0x6a98('0x3d'))){_0x36524a[_0x6a98('0x3e')]=qs[_0x6a98('0x3e')](_0x53853e[_0x6a98('0x21')][_0x6a98('0x3e')]);_0x36524a[_0x6a98('0xc')]=qs[_0x6a98('0xc')](_0x53853e[_0x6a98('0x21')][_0x6a98('0xc')]);}return _0x291747[_0x6a98('0x4e')](_0x36524a);}})[_0x6a98('0x11')](function(_0x4c619c){if(_0x4c619c){return _0x4c619c?{'count':_0x1cdcc1,'rows':_0x4c619c}:null;}})['then'](respondWithResult(_0x3b0b5b,null))[_0x6a98('0x24')](handleError(_0x3b0b5b,null));};exports['addTeams']=function(_0x22f375,_0x529c3a){var _0x3ce51c=_0x22f375[_0x6a98('0x30')][_0x6a98('0x50')];return db['Team'][_0x6a98('0x23')]({'where':{'id':_0x3ce51c},'attributes':['id'],'include':[{'model':db[_0x6a98('0x45')],'as':'Agents','attributes':['id',_0x6a98('0x18'),'online',_0x6a98('0x51'),_0x6a98('0x52')],'raw':!![]}]})['then'](function(_0x51c5ce){if(_0x51c5ce){var _0x56aab9=_[_0x6a98('0x53')](_0x51c5ce,function(_0x4ba627){var _0x3b092e=_0x4ba627[_0x6a98('0x13')]({'plain':!![]});return _0x3b092e[_0x6a98('0x54')];});return db[_0x6a98('0x22')][_0x6a98('0x35')]({'where':{'id':_0x22f375['params']['id']}})[_0x6a98('0x11')](function(_0x2375b5){return db[_0x6a98('0x55')]['transaction'](function(_0x3f7ffc){return _0x2375b5[_0x6a98('0x56')](_0x3ce51c,{'transaction':_0x3f7ffc})['then'](function(){return BPromise[_0x6a98('0x57')](_0x56aab9,function(_0x3c943b){return db[_0x6a98('0x3b')][_0x6a98('0x58')]({'where':{'UserId':_0x3c943b['id'],'ChatQueueId':_0x22f375['params']['id']},'transaction':_0x3f7ffc});});})['then'](function(){_0x56aab9[_0x6a98('0x59')](function(_0x37ed1f){socket[_0x6a98('0x5a')](_0x6a98('0x5b'),{'UserId':_0x37ed1f['id'],'ChatQueueId':_0x2375b5['id']});});});});});}})[_0x6a98('0x11')](respondWithStatusCode(_0x529c3a,null))[_0x6a98('0x24')](handleError(_0x529c3a,null));};exports[_0x6a98('0x5c')]=function(_0x30f926,_0x4a5d1f){return db[_0x6a98('0x4f')]['findAll']({'where':{'id':_0x30f926['query'][_0x6a98('0x50')]},'attributes':['id'],'include':[{'model':db[_0x6a98('0x45')],'as':_0x6a98('0x54'),'attributes':['id'],'raw':!![]}]})[_0x6a98('0x11')](handleEntityNotFound(_0x4a5d1f,null))[_0x6a98('0x11')](function(_0x3d0ccf){var _0x35b2d8=_['map'](_0x3d0ccf,'id');var _0x50486d=[];var _0x1f3029=[];var _0x85944f=squel[_0x6a98('0x5d')]();_0x85944f['field'](_0x6a98('0x5e'))[_0x6a98('0x5f')](_0x6a98('0x60'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6a98('0x1e')](_0x6a98('0x61'),_0x30f926[_0x6a98('0x25')]['id']);for(var _0xce52da=0x0;_0xce52da<_0x3d0ccf[_0x6a98('0x2b')];_0xce52da+=0x1){let _0x4c5869=_0x3d0ccf[_0xce52da];for(var _0x4d8e48=0x0;_0x4d8e48<_0x4c5869[_0x6a98('0x54')][_0x6a98('0x2b')];_0x4d8e48+=0x1){let _0x5e4914=_0x4c5869['Agents'][_0x4d8e48];var _0x29d7b9=_0x85944f[_0x6a98('0x62')]();_0x29d7b9[_0x6a98('0x1e')](_0x6a98('0x63'),_0x5e4914['id']);_0x1f3029[_0x6a98('0x64')](db['sequelize'][_0x6a98('0x21')](_0x29d7b9['toString'](),{'type':db[_0x6a98('0x55')][_0x6a98('0x65')][_0x6a98('0x66')]})['then'](function(_0x47e85d){if(_0x47e85d['length']===0x1){return _0x5e4914['id'];}else{var _0x421b35=_[_0x6a98('0x67')](_[_0x6a98('0x44')](_0x47e85d,_0x6a98('0x68')),function(_0xfc9cd1){return _[_0x6a98('0x69')](_0x35b2d8,_0xfc9cd1);});if(_0x421b35){return _0x5e4914['id'];}}}));}}return BPromise['all'](_0x1f3029)[_0x6a98('0x11')](function(_0x69688c){_0x50486d=_(_0x50486d)[_0x6a98('0x6a')](_0x69688c)[_0x6a98('0x6b')]()['value']();return db[_0x6a98('0x22')]['find']({'where':{'id':_0x30f926[_0x6a98('0x25')]['id']}})['then'](function(_0x3d0228){return db['sequelize'][_0x6a98('0x6c')](function(_0x4dacb3){return _0x3d0228['removeTeams'](_0x30f926[_0x6a98('0x21')][_0x6a98('0x50')],{'transaction':_0x4dacb3})[_0x6a98('0x11')](function(){if(!_['isEmpty'](_0x50486d)){return _0x3d0228[_0x6a98('0x6d')](_0x50486d,{'transaction':_0x4dacb3});}})[_0x6a98('0x11')](function(){_0x50486d['forEach'](function(_0x235e57){socket[_0x6a98('0x5a')]('userChatQueue:remove',{'UserId':_0x235e57,'ChatQueueId':_0x3d0228['id']});});});});});});})[_0x6a98('0x11')](respondWithStatusCode(_0x4a5d1f,null))[_0x6a98('0x24')](handleError(_0x4a5d1f,null));};exports[_0x6a98('0x6e')]=function(_0x3826ea,_0x4bdb77){return db[_0x6a98('0x22')][_0x6a98('0x35')]({'where':{'id':_0x3826ea[_0x6a98('0x25')]['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x4bdb77,null))[_0x6a98('0x11')](function(_0x515110){if(_0x515110){return _0x515110[_0x6a98('0x6e')](_0x3826ea[_0x6a98('0x30')]['ids'],_[_0x6a98('0x6f')](_0x3826ea[_0x6a98('0x30')],[_0x6a98('0x50'),'id'])||{})[_0x6a98('0x70')](function(_0x455fb9){for(var _0x298a2b=0x0;_0x298a2b<_0x3826ea[_0x6a98('0x30')][_0x6a98('0x50')][_0x6a98('0x2b')];_0x298a2b+=0x1){socket[_0x6a98('0x5a')]('userChatQueue:save',{'UserId':Number(_0x3826ea[_0x6a98('0x30')][_0x6a98('0x50')][_0x298a2b]),'ChatQueueId':Number(_0x3826ea[_0x6a98('0x25')]['id'])});}return _0x455fb9;});}})[_0x6a98('0x11')](respondWithResult(_0x4bdb77,null))['catch'](handleError(_0x4bdb77,null));};exports[_0x6a98('0x6d')]=function(_0x332061,_0xac1919){return db['ChatQueue'][_0x6a98('0x35')]({'where':{'id':_0x332061[_0x6a98('0x25')]['id']}})['then'](handleEntityNotFound(_0xac1919,null))[_0x6a98('0x11')](function(_0x8189ad){if(_0x8189ad){return _0x8189ad[_0x6a98('0x6d')](_0x332061[_0x6a98('0x21')][_0x6a98('0x50')])[_0x6a98('0x11')](function(){if(_[_0x6a98('0x71')](_0x332061[_0x6a98('0x21')][_0x6a98('0x50')])){for(var _0x47ad7e=0x0;_0x47ad7e<_0x332061['query'][_0x6a98('0x50')][_0x6a98('0x2b')];_0x47ad7e+=0x1){socket[_0x6a98('0x5a')](_0x6a98('0x72'),{'UserId':Number(_0x332061[_0x6a98('0x21')][_0x6a98('0x50')][_0x47ad7e]),'ChatQueueId':Number(_0x332061[_0x6a98('0x25')]['id'])});}}else{socket[_0x6a98('0x5a')](_0x6a98('0x72'),{'UserId':Number(_0x332061['query'][_0x6a98('0x50')]),'ChatQueueId':Number(_0x332061[_0x6a98('0x25')]['id'])});}});}})[_0x6a98('0x11')](respondWithStatusCode(_0xac1919,null))[_0x6a98('0x24')](handleError(_0xac1919,null));};exports['getAgents']=function(_0x3a743b,_0x3c03be){var _0x5c8807={};var _0x43a44a={};var _0x40b000;var _0x34d52b;return db['ChatQueue']['findOne']({'where':{'id':_0x3a743b[_0x6a98('0x25')]['id']}})['then'](handleEntityNotFound(_0x3c03be,null))[_0x6a98('0x11')](function(_0x543534){if(_0x543534){_0x40b000=_0x543534;_0x43a44a['model']=_['keys'](db[_0x6a98('0x45')][_0x6a98('0x1a')]);_0x43a44a[_0x6a98('0x21')]=_[_0x6a98('0x26')](_0x3a743b['query']);_0x43a44a[_0x6a98('0x27')]=_[_0x6a98('0x29')](_0x43a44a[_0x6a98('0x2c')],_0x43a44a[_0x6a98('0x21')]);_0x5c8807[_0x6a98('0x28')]=_[_0x6a98('0x29')](_0x43a44a[_0x6a98('0x2c')],qs[_0x6a98('0x2a')](_0x3a743b['query'][_0x6a98('0x2a')]));_0x5c8807[_0x6a98('0x28')]=_0x5c8807[_0x6a98('0x28')][_0x6a98('0x2b')]?_0x5c8807[_0x6a98('0x28')]:_0x43a44a[_0x6a98('0x2c')];_0x5c8807[_0x6a98('0x3f')]=qs[_0x6a98('0x40')](_0x3a743b['query']['sort']);_0x5c8807[_0x6a98('0x1e')]=qs[_0x6a98('0x27')](_[_0x6a98('0x41')](_0x3a743b[_0x6a98('0x21')],_0x43a44a[_0x6a98('0x27')]));if(_0x3a743b['query'][_0x6a98('0x43')]){_0x5c8807[_0x6a98('0x1e')]=_[_0x6a98('0x2d')](_0x5c8807['where'],{'$or':_['map'](_0x5c8807[_0x6a98('0x28')],function(_0x2b486c){var _0x27bc6e={};_0x27bc6e[_0x2b486c]={'$like':'%'+_0x3a743b[_0x6a98('0x21')]['filter']+'%'};return _0x27bc6e;})});}_0x5c8807=_['merge']({},_0x5c8807,_0x3a743b[_0x6a98('0x2e')]);return _0x40b000[_0x6a98('0x73')](_0x5c8807);}})['then'](function(_0x560e76){if(_0x560e76){_0x34d52b=_0x560e76['length'];if(!_0x3a743b[_0x6a98('0x21')][_0x6a98('0x3c')](_0x6a98('0x3d'))){_0x5c8807['limit']=qs['limit'](_0x3a743b['query'][_0x6a98('0x3e')]);_0x5c8807['offset']=qs[_0x6a98('0xc')](_0x3a743b[_0x6a98('0x21')][_0x6a98('0xc')]);}return _0x40b000['getAgents'](_0x5c8807);}})[_0x6a98('0x11')](function(_0x41fff8){if(_0x41fff8){return _0x41fff8?{'count':_0x34d52b,'rows':_0x41fff8}:null;}})[_0x6a98('0x11')](respondWithResult(_0x3c03be,null))[_0x6a98('0x24')](handleError(_0x3c03be,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f5a9eb0..75ac84b 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 _0xb6d1=['exports','events','ChatQueue','update','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6d1,0x151));var _0x1b6d=function(_0x3544a4,_0x2b801c){_0x3544a4=_0x3544a4-0x0;var _0x3ad501=_0xb6d1[_0x3544a4];return _0x3ad501;};'use strict';var EventEmitter=require(_0x1b6d('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x1b6d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b6d('0x2'),'afterDestroy':_0x1b6d('0x3')};function emitEvent(_0x1ef620){return function(_0x3fcf8b,_0x3d5351,_0x2962f1){ChatQueueEvents['emit'](_0x1ef620+':'+_0x3fcf8b['id'],_0x3fcf8b);ChatQueueEvents[_0x1b6d('0x4')](_0x1ef620,_0x3fcf8b);_0x2962f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1b6d('0x5')](e,emitEvent(event));}}module[_0x1b6d('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x9246=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x5c418a,_0x5392ac){var _0x20f968=function(_0x4891b9){while(--_0x4891b9){_0x5c418a['push'](_0x5c418a['shift']());}};_0x20f968(++_0x5392ac);}(_0x9246,0x18a));var _0x6924=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x9246[_0x476bf4];return _0x788ffe;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x6924('0x0'))['db'][_0x6924('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6924('0x2'),'afterUpdate':_0x6924('0x3'),'afterDestroy':_0x6924('0x4')};function emitEvent(_0x1ecff7){return function(_0x7656fe,_0x47a87d,_0x441d72){ChatQueueEvents[_0x6924('0x5')](_0x1ecff7+':'+_0x7656fe['id'],_0x7656fe);ChatQueueEvents['emit'](_0x1ecff7,_0x7656fe);_0x441d72(null);};}for(var e in events){if(events[_0x6924('0x6')](e)){var event=events[e];ChatQueue[_0x6924('0x7')](e,emitEvent(event));}}module[_0x6924('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index e444e57..d74500f 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 _0xcf43=['moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x481674,_0x139f2d){var _0xecbabf=function(_0x377404){while(--_0x377404){_0x481674['push'](_0x481674['shift']());}};_0xecbabf(++_0x139f2d);}(_0xcf43,0x8d));var _0x3cf4=function(_0xfa514e,_0x2665aa){_0xfa514e=_0xfa514e-0x0;var _0x39d8b0=_0xcf43[_0xfa514e];return _0x39d8b0;};'use strict';var _=require(_0x3cf4('0x0'));var util=require('util');var logger=require(_0x3cf4('0x1'))('api');var moment=require(_0x3cf4('0x2'));var BPromise=require('bluebird');var rp=require(_0x3cf4('0x3'));var fs=require('fs');var path=require(_0x3cf4('0x4'));var rimraf=require(_0x3cf4('0x5'));var config=require(_0x3cf4('0x6'));var attributes=require('./chatQueue.attributes');module[_0x3cf4('0x7')]=function(_0x592077,_0xd7f82){return _0x592077[_0x3cf4('0x8')](_0x3cf4('0x9'),attributes,{'tableName':_0x3cf4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd6b=['request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0xcd6b,0x96));var _0xbcd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbcd6('0x0'));var util=require('util');var logger=require(_0xbcd6('0x1'))(_0xbcd6('0x2'));var moment=require('moment');var BPromise=require(_0xbcd6('0x3'));var rp=require(_0xbcd6('0x4'));var fs=require('fs');var path=require(_0xbcd6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbcd6('0x6'));module[_0xbcd6('0x7')]=function(_0xb21e55,_0x39f36f){return _0xb21e55[_0xbcd6('0x8')](_0xbcd6('0x9'),attributes,{'tableName':_0xbcd6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 0052d6c..35486fb 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 _0x0c8d=['error','code','ChatQueue,\x20%s,\x20%s','message','info','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','debug','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatQueue.socket','then','request\x20sent','stringify'];(function(_0x50c125,_0x17a7af){var _0x1c1f49=function(_0x1643fd){while(--_0x1643fd){_0x50c125['push'](_0x50c125['shift']());}};_0x1c1f49(++_0x17a7af);}(_0x0c8d,0x79));var _0xd0c8=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x0c8d[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var moment=require(_0xd0c8('0x1'));var BPromise=require(_0xd0c8('0x2'));var rs=require(_0xd0c8('0x3'));var fs=require('fs');var Redis=require(_0xd0c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd0c8('0x5'));var jayson=require(_0xd0c8('0x6'));var client=jayson[_0xd0c8('0x7')]['http']({'port':0x232a});config[_0xd0c8('0x8')]=_['defaults'](config[_0xd0c8('0x8')],{'host':_0xd0c8('0x9'),'port':0x18eb});var socket=require(_0xd0c8('0xa'))(new Redis(config[_0xd0c8('0x8')]));require(_0xd0c8('0xb'))['register'](socket);function respondWithRpcPromise(_0x82ca40,_0x22df4d,_0x3b9aed){return new BPromise(function(_0x1a38b9,_0x557607){return client['request'](_0x82ca40,_0x3b9aed)[_0xd0c8('0xc')](function(_0x10f4ea){logger['info']('ChatQueue,\x20%s,\x20%s',_0x22df4d,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x22df4d,_0xd0c8('0xd'),JSON[_0xd0c8('0xe')](_0x10f4ea));if(_0x10f4ea['error']){if(_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x10')]===0x1f4){logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);return _0x557607(_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);}logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);return _0x1a38b9(_0x10f4ea['error'][_0xd0c8('0x12')]);}else{logger[_0xd0c8('0x13')](_0xd0c8('0x11'),_0x22df4d,'request\x20sent');_0x1a38b9(_0x10f4ea['result'][_0xd0c8('0x12')]);}})['catch'](function(_0x5e797c){logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x5e797c);_0x557607(_0x5e797c);});});}exports['GetChatQueue']=function(_0x10c878){var _0x42ba67=this;return new Promise(function(_0x559ddd,_0x1a5a3d){return db[_0xd0c8('0x14')][_0xd0c8('0x15')]({'raw':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x17')]===undefined?!![]:![]:!![],'where':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x18')]||null:null,'attributes':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x19')]||null:null,'limit':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x1a')]||null:null,'include':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0x10c878['options']['include'],function(_0xc109ee){return{'model':db[_0xc109ee[_0xd0c8('0x1d')]],'as':_0xc109ee['as'],'attributes':_0xc109ee[_0xd0c8('0x19')],'include':_0xc109ee[_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0xc109ee[_0xd0c8('0x1b')],function(_0x39ec6d){return{'model':db[_0x39ec6d[_0xd0c8('0x1d')]],'as':_0x39ec6d['as'],'attributes':_0x39ec6d[_0xd0c8('0x19')],'include':_0x39ec6d['include']?_[_0xd0c8('0x1c')](_0x39ec6d[_0xd0c8('0x1b')],function(_0x160032){return{'model':db[_0x160032['model']],'as':_0x160032['as'],'attributes':_0x160032['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22e125){logger['info'](_0xd0c8('0x1e'),_0x10c878);logger['debug'](_0xd0c8('0x1e'),_0x10c878,JSON[_0xd0c8('0xe')](_0x22e125));_0x559ddd(_0x22e125);})['catch'](function(_0x30336a){logger[_0xd0c8('0xf')](_0xd0c8('0x1e'),_0x30336a['message'],_0x10c878);_0x1a5a3d(_0x42ba67[_0xd0c8('0xf')](0x1f4,_0x30336a[_0xd0c8('0x12')]));});});};exports[_0xd0c8('0x1f')]=function(_0x21d7fb){var _0x87f472=this;return new Promise(function(_0x1f4b11,_0x3cf0f1){return db[_0xd0c8('0x14')][_0xd0c8('0x20')]({'raw':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x21d7fb['options']?_0x21d7fb[_0xd0c8('0x16')]['where']||null:null,'attributes':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb['options'][_0xd0c8('0x19')]||null:null,'include':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb[_0xd0c8('0x16')][_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0x21d7fb[_0xd0c8('0x16')][_0xd0c8('0x1b')],function(_0x481cef){return{'model':db[_0x481cef[_0xd0c8('0x1d')]],'as':_0x481cef['as'],'attributes':_0x481cef[_0xd0c8('0x19')],'include':_0x481cef['include']?_[_0xd0c8('0x1c')](_0x481cef[_0xd0c8('0x1b')],function(_0x321fe7){return{'model':db[_0x321fe7[_0xd0c8('0x1d')]],'as':_0x321fe7['as'],'attributes':_0x321fe7[_0xd0c8('0x19')],'include':_0x321fe7[_0xd0c8('0x1b')]?_['map'](_0x321fe7[_0xd0c8('0x1b')],function(_0x17f58c){return{'model':db[_0x17f58c[_0xd0c8('0x1d')]],'as':_0x17f58c['as'],'attributes':_0x17f58c[_0xd0c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd0c8('0xc')](function(_0x3d533f){logger[_0xd0c8('0x13')]('ShowChatQueue',_0x21d7fb);logger[_0xd0c8('0x21')](_0xd0c8('0x1f'),_0x21d7fb,JSON[_0xd0c8('0xe')](_0x3d533f));_0x1f4b11(_0x3d533f);})['catch'](function(_0x265a4d){logger[_0xd0c8('0xf')](_0xd0c8('0x1f'),_0x265a4d[_0xd0c8('0x12')],_0x21d7fb);_0x3cf0f1(_0x87f472[_0xd0c8('0xf')](0x1f4,_0x265a4d[_0xd0c8('0x12')]));});});};
\ No newline at end of file
+var _0x1794=['GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1794,0x19d));var _0x4179=function(_0x3ff150,_0x228f06){_0x3ff150=_0x3ff150-0x0;var _0xb6ac18=_0x1794[_0x3ff150];return _0xb6ac18;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4179('0x0'));var BPromise=require(_0x4179('0x1'));var rs=require(_0x4179('0x2'));var fs=require('fs');var Redis=require(_0x4179('0x3'));var db=require(_0x4179('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4179('0x5'));var config=require(_0x4179('0x6'));var jayson=require(_0x4179('0x7'));var client=jayson[_0x4179('0x8')][_0x4179('0x9')]({'port':0x232a});config[_0x4179('0xa')]=_[_0x4179('0xb')](config[_0x4179('0xa')],{'host':_0x4179('0xc'),'port':0x18eb});var socket=require(_0x4179('0xd'))(new Redis(config['redis']));require(_0x4179('0xe'))[_0x4179('0xf')](socket);function respondWithRpcPromise(_0xa0bd21,_0x5ed1c6,_0x71c3df){return new BPromise(function(_0x591de5,_0x345270){return client['request'](_0xa0bd21,_0x71c3df)[_0x4179('0x10')](function(_0x5ad5e7){logger[_0x4179('0x11')](_0x4179('0x12'),_0x5ed1c6,_0x4179('0x13'));logger['debug'](_0x4179('0x14'),_0x5ed1c6,'request\x20sent',JSON[_0x4179('0x15')](_0x5ad5e7));if(_0x5ad5e7[_0x4179('0x16')]){if(_0x5ad5e7['error'][_0x4179('0x17')]===0x1f4){logger[_0x4179('0x16')]('ChatQueue,\x20%s,\x20%s',_0x5ed1c6,_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);return _0x345270(_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);}logger[_0x4179('0x16')](_0x4179('0x12'),_0x5ed1c6,_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);return _0x591de5(_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);}else{logger[_0x4179('0x11')](_0x4179('0x12'),_0x5ed1c6,_0x4179('0x13'));_0x591de5(_0x5ad5e7[_0x4179('0x19')]['message']);}})[_0x4179('0x1a')](function(_0x508074){logger[_0x4179('0x16')]('ChatQueue,\x20%s,\x20%s',_0x5ed1c6,_0x508074);_0x345270(_0x508074);});});}exports[_0x4179('0x1b')]=function(_0x2cdea0){var _0x55b04f=this;return new Promise(function(_0x5968ae,_0x3d3264){return db[_0x4179('0x1c')][_0x4179('0x1d')]({'raw':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x1f')]===undefined?!![]:![]:!![],'where':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x20')]||null:null,'attributes':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')]['attributes']||null:null,'limit':_0x2cdea0['options']?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x21')]||null:null,'include':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x22')]?_[_0x4179('0x23')](_0x2cdea0['options'][_0x4179('0x22')],function(_0x45cb7e){return{'model':db[_0x45cb7e[_0x4179('0x24')]],'as':_0x45cb7e['as'],'attributes':_0x45cb7e[_0x4179('0x25')],'include':_0x45cb7e['include']?_[_0x4179('0x23')](_0x45cb7e[_0x4179('0x22')],function(_0x230f53){return{'model':db[_0x230f53[_0x4179('0x24')]],'as':_0x230f53['as'],'attributes':_0x230f53[_0x4179('0x25')],'include':_0x230f53[_0x4179('0x22')]?_[_0x4179('0x23')](_0x230f53['include'],function(_0x5cbfb2){return{'model':db[_0x5cbfb2[_0x4179('0x24')]],'as':_0x5cbfb2['as'],'attributes':_0x5cbfb2[_0x4179('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38906d){logger['info']('GetChatQueue',_0x2cdea0);logger[_0x4179('0x26')](_0x4179('0x1b'),_0x2cdea0,JSON[_0x4179('0x15')](_0x38906d));_0x5968ae(_0x38906d);})[_0x4179('0x1a')](function(_0x194fd2){logger['error']('GetChatQueue',_0x194fd2[_0x4179('0x18')],_0x2cdea0);_0x3d3264(_0x55b04f['error'](0x1f4,_0x194fd2['message']));});});};exports[_0x4179('0x27')]=function(_0x123b36){var _0x63aa5a=this;return new Promise(function(_0x49bf5d,_0x40cbed){return db[_0x4179('0x1c')]['find']({'raw':_0x123b36[_0x4179('0x1e')]?_0x123b36['options'][_0x4179('0x1f')]===undefined?!![]:![]:!![],'where':_0x123b36[_0x4179('0x1e')]?_0x123b36['options'][_0x4179('0x20')]||null:null,'attributes':_0x123b36[_0x4179('0x1e')]?_0x123b36[_0x4179('0x1e')][_0x4179('0x25')]||null:null,'include':_0x123b36[_0x4179('0x1e')]?_0x123b36[_0x4179('0x1e')][_0x4179('0x22')]?_['map'](_0x123b36['options'][_0x4179('0x22')],function(_0x72d6f5){return{'model':db[_0x72d6f5['model']],'as':_0x72d6f5['as'],'attributes':_0x72d6f5[_0x4179('0x25')],'include':_0x72d6f5[_0x4179('0x22')]?_[_0x4179('0x23')](_0x72d6f5[_0x4179('0x22')],function(_0x27289c){return{'model':db[_0x27289c['model']],'as':_0x27289c['as'],'attributes':_0x27289c[_0x4179('0x25')],'include':_0x27289c[_0x4179('0x22')]?_[_0x4179('0x23')](_0x27289c['include'],function(_0x507a4a){return{'model':db[_0x507a4a[_0x4179('0x24')]],'as':_0x507a4a['as'],'attributes':_0x507a4a[_0x4179('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4179('0x10')](function(_0x394485){logger[_0x4179('0x11')]('ShowChatQueue',_0x123b36);logger['debug'](_0x4179('0x27'),_0x123b36,JSON[_0x4179('0x15')](_0x394485));_0x49bf5d(_0x394485);})[_0x4179('0x1a')](function(_0x37e838){logger['error'](_0x4179('0x27'),_0x37e838['message'],_0x123b36);_0x40cbed(_0x63aa5a[_0x4179('0x16')](0x1f4,_0x37e838['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index fc776b4..151bc17 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 _0x68fc=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0x68fc,0xa5));var _0xc68f=function(_0x165fb3,_0x42d4d6){_0x165fb3=_0x165fb3-0x0;var _0xf7b888=_0x68fc[_0x165fb3];return _0xf7b888;};'use strict';var ChatQueueEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){ChatQueueEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);ChatQueueEvents['on'](_0x9f2705,_0x2bf3fd);}};
\ No newline at end of file
+var _0x5c12=['removeListener','chatQueue:','save','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5c12,0x188));var _0x25c1=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0x5c12[_0x221b8c];return _0x3fab9f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x25c1('0x0'),_0x25c1('0x1'),'update'];function createListener(_0x44bc2e,_0x1991e5){return function(_0x4042fe){_0x1991e5[_0x25c1('0x2')](_0x44bc2e,_0x4042fe);};}function removeListener(_0x2c5df0,_0x21ec20){return function(){ChatQueueEvents[_0x25c1('0x3')](_0x2c5df0,_0x21ec20);};}exports['register']=function(_0x204287){for(var _0x42ac16=0x0,_0x382922=events['length'];_0x42ac16<_0x382922;_0x42ac16++){var _0x5c69b1=events[_0x42ac16];var _0x24981c=createListener(_0x25c1('0x4')+_0x5c69b1,_0x204287);ChatQueueEvents['on'](_0x5c69b1,_0x24981c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8120bbb..477ddf6 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 _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(_0x1a7938,_0x20527a){var _0x3f0f7d=function(_0x3d84f0){while(--_0x3d84f0){_0x1a7938['push'](_0x1a7938['shift']());}};_0x3f0f7d(++_0x20527a);}(_0x7217,0x19e));var _0x7721=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x7217[_0x2576d7];return _0x16a08c;};'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
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x30fbf5,_0x487ca){var _0x4babde=function(_0x11fda2){while(--_0x11fda2){_0x30fbf5['push'](_0x30fbf5['shift']());}};_0x4babde(++_0x487ca);}(_0x814b,0x1a2));var _0xb814=function(_0x5cf90e,_0x5df405){_0x5cf90e=_0x5cf90e-0x0;var _0xae958d=_0x814b[_0x5cf90e];return _0xae958d;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 6fab48d..e038191 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 _0xef6c=['moment','sequelize','exports','DATE','STRING'];(function(_0x2d9800,_0xf0f64b){var _0x291946=function(_0x14fa8c){while(--_0x14fa8c){_0x2d9800['push'](_0x2d9800['shift']());}};_0x291946(++_0xf0f64b);}(_0xef6c,0x10e));var _0xcef6=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xef6c[_0x151721];return _0x2deaa7;};'use strict';var moment=require(_0xcef6('0x0'));var Sequelize=require(_0xcef6('0x1'));module[_0xcef6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcef6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcef6('0x3')]},'reason':{'type':Sequelize[_0xcef6('0x4')]}};
\ No newline at end of file
+var _0x5c91=['sequelize','exports','STRING','DATE','moment'];(function(_0x1fc773,_0x299be7){var _0x2965cf=function(_0x33914d){while(--_0x33914d){_0x1fc773['push'](_0x1fc773['shift']());}};_0x2965cf(++_0x299be7);}(_0x5c91,0x1e9));var _0x15c9=function(_0xc706fd,_0x33ce12){_0xc706fd=_0xc706fd-0x0;var _0x8834e0=_0x5c91[_0xc706fd];return _0x8834e0;};'use strict';var moment=require(_0x15c9('0x0'));var Sequelize=require(_0x15c9('0x1'));module[_0x15c9('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x15c9('0x3')]},'joinAt':{'type':Sequelize[_0x15c9('0x4')]},'leaveAt':{'type':Sequelize[_0x15c9('0x4')]},'acceptAt':{'type':Sequelize[_0x15c9('0x4')]},'exitAt':{'type':Sequelize[_0x15c9('0x4')]},'reason':{'type':Sequelize[_0x15c9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 43bb500..0876b54 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 _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','ChatQueueReport','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x46ba68,_0x1a6d8e){var _0x53b37a=function(_0x37ab2c){while(--_0x37ab2c){_0x46ba68['push'](_0x46ba68['shift']());}};_0x53b37a(++_0x1a6d8e);}(_0x1261,0x144));var _0x1126=function(_0x315d84,_0x3dacc3){_0x315d84=_0x315d84-0x0;var _0x560da1=_0x1261[_0x315d84];return _0x560da1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['ChatQueueReport'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['ChatQueueReport']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));};
\ No newline at end of file
+var _0xbedb=['hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','ChatQueueReport','rawAttributes','fieldName','type','keys','query','model','intersection','fields','attributes','length'];(function(_0x8ef0c5,_0x1a3644){var _0x5d8249=function(_0x438ea7){while(--_0x438ea7){_0x8ef0c5['push'](_0x8ef0c5['shift']());}};_0x5d8249(++_0x1a3644);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbbed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbed('0x1'));var jsonpatch=require(_0xbbed('0x2'));var rp=require(_0xbbed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbbed('0x4'));var util=require(_0xbbed('0x5'));var path=require(_0xbbed('0x6'));var sox=require(_0xbbed('0x7'));var csv=require(_0xbbed('0x8'));var ejs=require(_0xbbed('0x9'));var fs=require('fs');var fs_extra=require(_0xbbed('0xa'));var _=require(_0xbbed('0xb'));var squel=require(_0xbbed('0xc'));var crypto=require(_0xbbed('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbed('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbbed('0xf'));var Redis=require(_0xbbed('0x10'));var authService=require(_0xbbed('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbed('0x12'));var logger=require(_0xbbed('0x13'))(_0xbbed('0x14'));var utils=require(_0xbbed('0x15'));var config=require(_0xbbed('0x16'));var licenseUtil=require(_0xbbed('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4324b5,_0x4ed197){_0x4ed197=_0x4ed197||0xcc;return function(_0x13e24e){if(_0x13e24e){return _0x4324b5[_0xbbed('0x18')](_0x4ed197);}return _0x4324b5[_0xbbed('0x19')](_0x4ed197)[_0xbbed('0x1a')]();};}function respondWithResult(_0xebc428,_0x194cea){_0x194cea=_0x194cea||0xc8;return function(_0x161bef){if(_0x161bef){return _0xebc428[_0xbbed('0x19')](_0x194cea)[_0xbbed('0x1b')](_0x161bef);}};}function respondWithFilteredResult(_0x286048,_0x5eb641){return function(_0x359469){if(_0x359469){var _0x5dfb44=typeof _0x5eb641[_0xbbed('0x1c')]===_0xbbed('0x1d')&&typeof _0x5eb641[_0xbbed('0x1e')]===_0xbbed('0x1d');var _0xe9dc82=_0x359469['count'];var _0x19e9ce=_0x5dfb44?0x0:_0x5eb641[_0xbbed('0x1c')];var _0x44fd74=_0x5dfb44?_0x359469[_0xbbed('0x1f')]:_0x5eb641[_0xbbed('0x1c')]+_0x5eb641[_0xbbed('0x1e')];var _0x31eea9;if(_0x44fd74>=_0xe9dc82){_0x44fd74=_0xe9dc82;_0x31eea9=0xc8;}else{_0x31eea9=0xce;}_0x286048[_0xbbed('0x19')](_0x31eea9);return _0x286048[_0xbbed('0x20')](_0xbbed('0x21'),_0x19e9ce+'-'+_0x44fd74+'/'+_0xe9dc82)[_0xbbed('0x1b')](_0x359469);}return null;};}function patchUpdates(_0xf166a4){return function(_0x8031d3){try{jsonpatch['apply'](_0x8031d3,_0xf166a4,!![]);}catch(_0x2b4ad0){return BPromise[_0xbbed('0x22')](_0x2b4ad0);}return _0x8031d3[_0xbbed('0x23')]();};}function saveUpdates(_0x493773,_0x40ce77){return function(_0xcc9f37){if(_0xcc9f37){return _0xcc9f37[_0xbbed('0x24')](_0x493773)[_0xbbed('0x25')](function(_0x4ebc1e){return _0x4ebc1e;});}return null;};}function removeEntity(_0x13c422,_0x479c81){return function(_0x163893){if(_0x163893){return _0x163893[_0xbbed('0x26')]()['then'](function(){_0x13c422[_0xbbed('0x19')](0xcc)[_0xbbed('0x1a')]();});}};}function handleEntityNotFound(_0x11ebcf,_0xe1993e){return function(_0x3a77c6){if(!_0x3a77c6){_0x11ebcf[_0xbbed('0x18')](0x194);}return _0x3a77c6;};}function handleError(_0x4fba6e,_0x1231ad){_0x1231ad=_0x1231ad||0x1f4;return function(_0x5dd187){logger[_0xbbed('0x27')](_0x5dd187['stack']);if(_0x5dd187[_0xbbed('0x28')]){delete _0x5dd187[_0xbbed('0x28')];}_0x4fba6e[_0xbbed('0x19')](_0x1231ad)[_0xbbed('0x29')](_0x5dd187);};}exports['index']=function(_0x1339b9,_0x45aff2){var _0x381cb8={},_0x446c21={},_0x565a82={'count':0x0,'rows':[]};var _0xb7fb6c=_['map'](db[_0xbbed('0x2a')][_0xbbed('0x2b')],function(_0x4e0137){return{'name':_0x4e0137[_0xbbed('0x2c')],'type':_0x4e0137[_0xbbed('0x2d')]['key']};});_0x446c21['model']=_['map'](_0xb7fb6c,'name');_0x446c21['query']=_[_0xbbed('0x2e')](_0x1339b9[_0xbbed('0x2f')]);_0x446c21['filters']=_['intersection'](_0x446c21[_0xbbed('0x30')],_0x446c21[_0xbbed('0x2f')]);_0x381cb8['attributes']=_[_0xbbed('0x31')](_0x446c21['model'],qs[_0xbbed('0x32')](_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x32')]));_0x381cb8['attributes']=_0x381cb8[_0xbbed('0x33')][_0xbbed('0x34')]?_0x381cb8[_0xbbed('0x33')]:_0x446c21[_0xbbed('0x30')];if(!_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x35')]('nolimit')){_0x381cb8[_0xbbed('0x1e')]=qs['limit'](_0x1339b9['query'][_0xbbed('0x1e')]);_0x381cb8['offset']=qs[_0xbbed('0x1c')](_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x1c')]);}_0x381cb8[_0xbbed('0x36')]=qs['sort'](_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x37')]);_0x381cb8['where']=qs['filters'](_['pick'](_0x1339b9[_0xbbed('0x2f')],_0x446c21[_0xbbed('0x38')]),_0xb7fb6c);if(_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x39')]){_0x381cb8[_0xbbed('0x3a')]=_[_0xbbed('0x3b')](_0x381cb8[_0xbbed('0x3a')],{'$or':_['map'](_0xb7fb6c,function(_0x2e62e8){if(_0x2e62e8[_0xbbed('0x2d')]!==_0xbbed('0x3c')){var _0xc50bb2={};_0xc50bb2[_0x2e62e8[_0xbbed('0x28')]]={'$like':'%'+_0x1339b9['query'][_0xbbed('0x39')]+'%'};return _0xc50bb2;}})});}_0x381cb8=_[_0xbbed('0x3b')]({},_0x381cb8,_0x1339b9['options']);var _0x1278d1={'where':_0x381cb8[_0xbbed('0x3a')]};return db[_0xbbed('0x2a')][_0xbbed('0x1f')](_0x1278d1)[_0xbbed('0x25')](function(_0x45f514){_0x565a82['count']=_0x45f514;if(_0x1339b9['query'][_0xbbed('0x3d')]){_0x381cb8['include']=[{'all':!![]}];}return db[_0xbbed('0x2a')]['findAll'](_0x381cb8);})[_0xbbed('0x25')](function(_0x2d9b79){_0x565a82[_0xbbed('0x3e')]=_0x2d9b79;return _0x565a82;})[_0xbbed('0x25')](respondWithFilteredResult(_0x45aff2,_0x381cb8))[_0xbbed('0x3f')](handleError(_0x45aff2,null));};exports[_0xbbed('0x40')]=function(_0x540903,_0x2caabb){var _0x515bd3={'raw':!![],'where':{'id':_0x540903[_0xbbed('0x41')]['id']}},_0x401344={};_0x401344[_0xbbed('0x30')]=_['keys'](db[_0xbbed('0x2a')]['rawAttributes']);_0x401344['query']=_[_0xbbed('0x2e')](_0x540903['query']);_0x401344['filters']=_[_0xbbed('0x31')](_0x401344[_0xbbed('0x30')],_0x401344[_0xbbed('0x2f')]);_0x515bd3['attributes']=_[_0xbbed('0x31')](_0x401344[_0xbbed('0x30')],qs['fields'](_0x540903[_0xbbed('0x2f')][_0xbbed('0x32')]));_0x515bd3[_0xbbed('0x33')]=_0x515bd3[_0xbbed('0x33')][_0xbbed('0x34')]?_0x515bd3[_0xbbed('0x33')]:_0x401344[_0xbbed('0x30')];if(_0x540903['query'][_0xbbed('0x3d')]){_0x515bd3[_0xbbed('0x42')]=[{'all':!![]}];}_0x515bd3=_[_0xbbed('0x3b')]({},_0x515bd3,_0x540903[_0xbbed('0x43')]);return db[_0xbbed('0x2a')][_0xbbed('0x44')](_0x515bd3)['then'](handleEntityNotFound(_0x2caabb,null))[_0xbbed('0x25')](respondWithResult(_0x2caabb,null))['catch'](handleError(_0x2caabb,null));};exports['create']=function(_0x3d5eeb,_0x42a655){return db['ChatQueueReport'][_0xbbed('0x45')](_0x3d5eeb[_0xbbed('0x46')],{})[_0xbbed('0x25')](respondWithResult(_0x42a655,0xc9))['catch'](handleError(_0x42a655,null));};exports[_0xbbed('0x24')]=function(_0x1f2e0b,_0x50168e){if(_0x1f2e0b[_0xbbed('0x46')]['id']){delete _0x1f2e0b[_0xbbed('0x46')]['id'];}return db[_0xbbed('0x2a')][_0xbbed('0x44')]({'where':{'id':_0x1f2e0b[_0xbbed('0x41')]['id']}})[_0xbbed('0x25')](handleEntityNotFound(_0x50168e,null))[_0xbbed('0x25')](saveUpdates(_0x1f2e0b[_0xbbed('0x46')],null))[_0xbbed('0x25')](respondWithResult(_0x50168e,null))[_0xbbed('0x3f')](handleError(_0x50168e,null));};exports[_0xbbed('0x26')]=function(_0x1bb0d6,_0x63d030){return db[_0xbbed('0x2a')][_0xbbed('0x44')]({'where':{'id':_0x1bb0d6[_0xbbed('0x41')]['id']}})[_0xbbed('0x25')](handleEntityNotFound(_0x63d030,null))[_0xbbed('0x25')](removeEntity(_0x63d030,null))[_0xbbed('0x3f')](handleError(_0x63d030,null));};exports['describe']=function(_0x256188,_0x5aff2e){return db['ChatQueueReport']['describe']()[_0xbbed('0x25')](respondWithResult(_0x5aff2e,null))['catch'](handleError(_0x5aff2e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index cfc816d..420714f 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x1c21fe,_0x3774a4){var _0x2532d9=function(_0x482a04){while(--_0x482a04){_0x1c21fe['push'](_0x1c21fe['shift']());}};_0x2532d9(++_0x3774a4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index bb6006e..272b465 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 _0x33ad=['request','info','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','body','options','raw','then','debug','UpdateChatQueueReport','ChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x7cb841,_0x49f5d4){var _0x52383f=function(_0x5c194a){while(--_0x5c194a){_0x7cb841['push'](_0x7cb841['shift']());}};_0x52383f(++_0x49f5d4);}(_0x33ad,0xb2));var _0xd33a=function(_0x50798e,_0x19c6fe){_0x50798e=_0x50798e-0x0;var _0x3c5939=_0x33ad[_0x50798e];return _0x3c5939;};'use strict';var _=require(_0xd33a('0x0'));var util=require(_0xd33a('0x1'));var moment=require(_0xd33a('0x2'));var BPromise=require(_0xd33a('0x3'));var rs=require(_0xd33a('0x4'));var fs=require('fs');var Redis=require(_0xd33a('0x5'));var db=require(_0xd33a('0x6'))['db'];var utils=require(_0xd33a('0x7'));var logger=require(_0xd33a('0x8'))(_0xd33a('0x9'));var config=require(_0xd33a('0xa'));var jayson=require(_0xd33a('0xb'));var client=jayson[_0xd33a('0xc')][_0xd33a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24bc45,_0x9a8fba,_0x5e7845){return new BPromise(function(_0x32f404,_0x11b37d){return client[_0xd33a('0xe')](_0x24bc45,_0x5e7845)['then'](function(_0x479c6b){logger[_0xd33a('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x9a8fba,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x9a8fba,_0xd33a('0x10'),JSON[_0xd33a('0x11')](_0x479c6b));if(_0x479c6b[_0xd33a('0x12')]){if(_0x479c6b[_0xd33a('0x12')]['code']===0x1f4){logger[_0xd33a('0x12')](_0xd33a('0x13'),_0x9a8fba,_0x479c6b[_0xd33a('0x12')][_0xd33a('0x14')]);return _0x11b37d(_0x479c6b[_0xd33a('0x12')]['message']);}logger[_0xd33a('0x12')](_0xd33a('0x13'),_0x9a8fba,_0x479c6b[_0xd33a('0x12')][_0xd33a('0x14')]);return _0x32f404(_0x479c6b['error'][_0xd33a('0x14')]);}else{logger[_0xd33a('0xf')](_0xd33a('0x13'),_0x9a8fba,_0xd33a('0x10'));_0x32f404(_0x479c6b[_0xd33a('0x15')]['message']);}})[_0xd33a('0x16')](function(_0x71e8ce){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x9a8fba,_0x71e8ce);_0x11b37d(_0x71e8ce);});});}exports[_0xd33a('0x17')]=function(_0x260d1c){var _0x2f1de8=this;return new Promise(function(_0xf12073,_0x445a7e){return db['ChatQueueReport'][_0xd33a('0x18')](_0x260d1c[_0xd33a('0x19')],{'raw':_0x260d1c[_0xd33a('0x1a')]?_0x260d1c[_0xd33a('0x1a')][_0xd33a('0x1b')]===undefined?!![]:![]:!![]})[_0xd33a('0x1c')](function(_0x10b21c){logger['info'](_0xd33a('0x17'),_0x260d1c);logger[_0xd33a('0x1d')](_0xd33a('0x17'),_0x260d1c,JSON[_0xd33a('0x11')](_0x10b21c));_0xf12073(_0x10b21c);})[_0xd33a('0x16')](function(_0x47ef70){logger['error'](_0xd33a('0x17'),_0x47ef70[_0xd33a('0x14')],_0x260d1c);_0x445a7e(_0x2f1de8['error'](0x1f4,_0x47ef70[_0xd33a('0x14')]));});});};exports[_0xd33a('0x1e')]=function(_0x5587d8){var _0x49ff23=this;return new Promise(function(_0xf50391,_0x2fc0a4){return db[_0xd33a('0x1f')]['update'](_0x5587d8['body'],{'raw':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8[_0xd33a('0x1a')][_0xd33a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8['options']['where']||null:null,'attributes':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8[_0xd33a('0x1a')]['attributes']||null:null,'limit':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8[_0xd33a('0x1a')]['limit']||null:null})[_0xd33a('0x1c')](function(_0x23b0da){logger[_0xd33a('0xf')]('UpdateChatQueueReport',_0x5587d8);logger[_0xd33a('0x1d')](_0xd33a('0x1e'),_0x5587d8,JSON['stringify'](_0x23b0da));_0xf50391(_0x23b0da);})['catch'](function(_0x130785){logger['error']('UpdateChatQueueReport',_0x130785[_0xd33a('0x14')],_0x5587d8);_0x2fc0a4(_0x49ff23[_0xd33a('0x12')](0x1f4,_0x130785[_0xd33a('0x14')]));});});};
\ No newline at end of file
+var _0xe3f5=['limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','ChatQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','where','attributes'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe3f5,0x118));var _0x5e3f=function(_0x31b75a,_0x383d5a){_0x31b75a=_0x31b75a-0x0;var _0x3328d2=_0xe3f5[_0x31b75a];return _0x3328d2;};'use strict';var _=require(_0x5e3f('0x0'));var util=require('util');var moment=require(_0x5e3f('0x1'));var BPromise=require(_0x5e3f('0x2'));var rs=require(_0x5e3f('0x3'));var fs=require('fs');var Redis=require(_0x5e3f('0x4'));var db=require(_0x5e3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e3f('0x6'))('rpc');var config=require(_0x5e3f('0x7'));var jayson=require(_0x5e3f('0x8'));var client=jayson['client'][_0x5e3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d06f,_0x259d81,_0x16b6bb){return new BPromise(function(_0x8fbf08,_0x25e080){return client['request'](_0x55d06f,_0x16b6bb)[_0x5e3f('0xa')](function(_0x1b4bfe){logger['info'](_0x5e3f('0xb'),_0x259d81,'request\x20sent');logger[_0x5e3f('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x259d81,'request\x20sent',JSON[_0x5e3f('0xd')](_0x1b4bfe));if(_0x1b4bfe[_0x5e3f('0xe')]){if(_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0xf')]===0x1f4){logger[_0x5e3f('0xe')](_0x5e3f('0xb'),_0x259d81,_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0x10')]);return _0x25e080(_0x1b4bfe['error'][_0x5e3f('0x10')]);}logger[_0x5e3f('0xe')](_0x5e3f('0xb'),_0x259d81,_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0x10')]);return _0x8fbf08(_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0x10')]);}else{logger[_0x5e3f('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x259d81,_0x5e3f('0x12'));_0x8fbf08(_0x1b4bfe[_0x5e3f('0x13')][_0x5e3f('0x10')]);}})['catch'](function(_0x14f830){logger[_0x5e3f('0xe')](_0x5e3f('0xb'),_0x259d81,_0x14f830);_0x25e080(_0x14f830);});});}exports[_0x5e3f('0x14')]=function(_0x5b84b9){var _0x244c5a=this;return new Promise(function(_0xda0686,_0x1b7fb9){return db[_0x5e3f('0x15')][_0x5e3f('0x16')](_0x5b84b9['body'],{'raw':_0x5b84b9['options']?_0x5b84b9[_0x5e3f('0x17')][_0x5e3f('0x18')]===undefined?!![]:![]:!![]})[_0x5e3f('0xa')](function(_0x3fa250){logger[_0x5e3f('0x11')](_0x5e3f('0x14'),_0x5b84b9);logger[_0x5e3f('0xc')](_0x5e3f('0x14'),_0x5b84b9,JSON['stringify'](_0x3fa250));_0xda0686(_0x3fa250);})[_0x5e3f('0x19')](function(_0x3a95d7){logger[_0x5e3f('0xe')]('CreateChatQueueReport',_0x3a95d7[_0x5e3f('0x10')],_0x5b84b9);_0x1b7fb9(_0x244c5a['error'](0x1f4,_0x3a95d7[_0x5e3f('0x10')]));});});};exports[_0x5e3f('0x1a')]=function(_0x1cbb21){var _0xcd1eda=this;return new Promise(function(_0x8d36c1,_0x2cc5cc){return db[_0x5e3f('0x15')][_0x5e3f('0x1b')](_0x1cbb21['body'],{'raw':_0x1cbb21[_0x5e3f('0x17')]?_0x1cbb21['options'][_0x5e3f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbb21[_0x5e3f('0x17')]?_0x1cbb21[_0x5e3f('0x17')][_0x5e3f('0x1c')]||null:null,'attributes':_0x1cbb21[_0x5e3f('0x17')]?_0x1cbb21[_0x5e3f('0x17')][_0x5e3f('0x1d')]||null:null,'limit':_0x1cbb21['options']?_0x1cbb21[_0x5e3f('0x17')][_0x5e3f('0x1e')]||null:null})[_0x5e3f('0xa')](function(_0x371425){logger['info'](_0x5e3f('0x1a'),_0x1cbb21);logger[_0x5e3f('0xc')](_0x5e3f('0x1a'),_0x1cbb21,JSON[_0x5e3f('0xd')](_0x371425));_0x8d36c1(_0x371425);})[_0x5e3f('0x19')](function(_0x2b73f5){logger[_0x5e3f('0xe')](_0x5e3f('0x1a'),_0x2b73f5[_0x5e3f('0x10')],_0x1cbb21);_0x2cc5cc(_0xcd1eda[_0x5e3f('0xe')](0x1f4,_0x2b73f5[_0x5e3f('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4af925a..6682a48 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 _0x14e7=['isAuthenticated','/:id','show','post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x14e7,0x1d4));var _0x714e=function(_0x185683,_0x3efc9a){_0x185683=_0x185683-0x0;var _0x3828f9=_0x14e7[_0x185683];return _0x3828f9;};'use strict';var multer=require('multer');var util=require(_0x714e('0x0'));var path=require('path');var timeout=require(_0x714e('0x1'));var express=require(_0x714e('0x2'));var router=express[_0x714e('0x3')]();var fs_extra=require(_0x714e('0x4'));var auth=require(_0x714e('0x5'));var interaction=require(_0x714e('0x6'));var config=require(_0x714e('0x7'));var controller=require(_0x714e('0x8'));router[_0x714e('0x9')]('/',auth['isAuthenticated'](),controller[_0x714e('0xa')]);router['get'](_0x714e('0xb'),auth[_0x714e('0xc')](),controller['describe']);router['get'](_0x714e('0xd'),auth[_0x714e('0xc')](),controller[_0x714e('0xe')]);router[_0x714e('0xf')]('/',auth['isAuthenticated'](),controller[_0x714e('0x10')]);router['put'](_0x714e('0xd'),auth[_0x714e('0xc')](),controller[_0x714e('0x11')]);router[_0x714e('0x12')]('/:id',auth[_0x714e('0xc')](),controller[_0x714e('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6136=['/describe','describe','show','create','put','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x35d8ad,_0x24b5f0){var _0x3fb9e0=function(_0x5bd58f){while(--_0x5bd58f){_0x35d8ad['push'](_0x35d8ad['shift']());}};_0x3fb9e0(++_0x24b5f0);}(_0x6136,0x105));var _0x6613=function(_0x543898,_0x1e504b){_0x543898=_0x543898-0x0;var _0x4ac0ae=_0x6136[_0x543898];return _0x4ac0ae;};'use strict';var multer=require(_0x6613('0x0'));var util=require('util');var path=require(_0x6613('0x1'));var timeout=require(_0x6613('0x2'));var express=require(_0x6613('0x3'));var router=express[_0x6613('0x4')]();var fs_extra=require(_0x6613('0x5'));var auth=require(_0x6613('0x6'));var interaction=require(_0x6613('0x7'));var config=require(_0x6613('0x8'));var controller=require(_0x6613('0x9'));router[_0x6613('0xa')]('/',auth[_0x6613('0xb')](),controller['index']);router['get'](_0x6613('0xc'),auth[_0x6613('0xb')](),controller[_0x6613('0xd')]);router[_0x6613('0xa')]('/:id',auth[_0x6613('0xb')](),controller[_0x6613('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6613('0xf')]);router[_0x6613('0x10')]('/:id',auth[_0x6613('0xb')](),controller[_0x6613('0x11')]);router[_0x6613('0x12')](_0x6613('0x13'),auth['isAuthenticated'](),controller[_0x6613('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 1a55a7b..1c6ff41 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2a0034,_0x51c1a1){var _0x55c1b0=function(_0x349508){while(--_0x349508){_0x2a0034['push'](_0x2a0034['shift']());}};_0x55c1b0(++_0x51c1a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0x008c,0x188));var _0xc008=function(_0xf3b3e7,_0x1b2afc){_0xf3b3e7=_0xf3b3e7-0x0;var _0x4a22a2=_0x008c[_0xf3b3e7];return _0x4a22a2;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index f552050..6ca7e92 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 _0x87f5=['sendStatus','status','end','json','limit','offset','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','rows','show','rawAttributes','fields','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87f5,0xc5));var _0x587f=function(_0x25667f,_0x57980b){_0x25667f=_0x25667f-0x0;var _0x39ad0e=_0x87f5[_0x25667f];return _0x39ad0e;};'use strict';var emlformat=require(_0x587f('0x0'));var rimraf=require(_0x587f('0x1'));var zipdir=require(_0x587f('0x2'));var jsonpatch=require(_0x587f('0x3'));var rp=require(_0x587f('0x4'));var moment=require(_0x587f('0x5'));var BPromise=require(_0x587f('0x6'));var Mustache=require('mustache');var util=require(_0x587f('0x7'));var path=require('path');var sox=require(_0x587f('0x8'));var csv=require(_0x587f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x587f('0xa'));var _=require(_0x587f('0xb'));var squel=require(_0x587f('0xc'));var crypto=require('crypto');var jsforce=require(_0x587f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x587f('0xe'));var Papa=require('papaparse');var Redis=require(_0x587f('0xf'));var authService=require(_0x587f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x587f('0x11'));var hardwareService=require(_0x587f('0x12'));var logger=require('../../config/logger')(_0x587f('0x13'));var utils=require(_0x587f('0x14'));var config=require(_0x587f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50765a,_0x40f98a){_0x40f98a=_0x40f98a||0xcc;return function(_0x21eac7){if(_0x21eac7){return _0x50765a[_0x587f('0x16')](_0x40f98a);}return _0x50765a[_0x587f('0x17')](_0x40f98a)[_0x587f('0x18')]();};}function respondWithResult(_0x9af2d8,_0x5119c7){_0x5119c7=_0x5119c7||0xc8;return function(_0x96f12c){if(_0x96f12c){return _0x9af2d8[_0x587f('0x17')](_0x5119c7)[_0x587f('0x19')](_0x96f12c);}};}function respondWithFilteredResult(_0x3a9faf,_0x124bf3){return function(_0x4bf832){if(_0x4bf832){var _0x10629d=typeof _0x124bf3['offset']==='undefined'&&typeof _0x124bf3[_0x587f('0x1a')]==='undefined';var _0x2bf8c6=_0x4bf832['count'];var _0xd3c399=_0x10629d?0x0:_0x124bf3[_0x587f('0x1b')];var _0x51002b=_0x10629d?_0x4bf832[_0x587f('0x1c')]:_0x124bf3[_0x587f('0x1b')]+_0x124bf3[_0x587f('0x1a')];var _0x5cb237;if(_0x51002b>=_0x2bf8c6){_0x51002b=_0x2bf8c6;_0x5cb237=0xc8;}else{_0x5cb237=0xce;}_0x3a9faf[_0x587f('0x17')](_0x5cb237);return _0x3a9faf[_0x587f('0x1d')](_0x587f('0x1e'),_0xd3c399+'-'+_0x51002b+'/'+_0x2bf8c6)[_0x587f('0x19')](_0x4bf832);}return null;};}function patchUpdates(_0x35f5c5){return function(_0x71294f){try{jsonpatch['apply'](_0x71294f,_0x35f5c5,!![]);}catch(_0xad18d){return BPromise[_0x587f('0x1f')](_0xad18d);}return _0x71294f[_0x587f('0x20')]();};}function saveUpdates(_0x91a9c2,_0x2c5bdb){return function(_0x9ae7f8){if(_0x9ae7f8){return _0x9ae7f8[_0x587f('0x21')](_0x91a9c2)['then'](function(_0x25f2da){return _0x25f2da;});}return null;};}function removeEntity(_0x339eeb,_0x4e2a84){return function(_0x3580d4){if(_0x3580d4){return _0x3580d4[_0x587f('0x22')]()[_0x587f('0x23')](function(){_0x339eeb['status'](0xcc)[_0x587f('0x18')]();});}};}function handleEntityNotFound(_0x17c8d5,_0x459874){return function(_0x1b62d4){if(!_0x1b62d4){_0x17c8d5[_0x587f('0x16')](0x194);}return _0x1b62d4;};}function handleError(_0x55a952,_0x34b6a2){_0x34b6a2=_0x34b6a2||0x1f4;return function(_0x58ad7b){logger[_0x587f('0x24')](_0x58ad7b[_0x587f('0x25')]);if(_0x58ad7b[_0x587f('0x26')]){delete _0x58ad7b[_0x587f('0x26')];}_0x55a952[_0x587f('0x17')](_0x34b6a2)[_0x587f('0x27')](_0x58ad7b);};}exports[_0x587f('0x28')]=function(_0x57a159,_0x1bfa92){var _0x57461a={},_0x57d813={},_0x2ed6b1={'count':0x0,'rows':[]};var _0x49f2f4=_[_0x587f('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x2388cf){return{'name':_0x2388cf[_0x587f('0x2a')],'type':_0x2388cf[_0x587f('0x2b')]['key']};});_0x57d813[_0x587f('0x2c')]=_[_0x587f('0x29')](_0x49f2f4,'name');_0x57d813[_0x587f('0x2d')]=_['keys'](_0x57a159[_0x587f('0x2d')]);_0x57d813[_0x587f('0x2e')]=_[_0x587f('0x2f')](_0x57d813[_0x587f('0x2c')],_0x57d813[_0x587f('0x2d')]);_0x57461a[_0x587f('0x30')]=_[_0x587f('0x2f')](_0x57d813[_0x587f('0x2c')],qs['fields'](_0x57a159[_0x587f('0x2d')]['fields']));_0x57461a[_0x587f('0x30')]=_0x57461a[_0x587f('0x30')][_0x587f('0x31')]?_0x57461a['attributes']:_0x57d813[_0x587f('0x2c')];if(!_0x57a159[_0x587f('0x2d')][_0x587f('0x32')](_0x587f('0x33'))){_0x57461a[_0x587f('0x1a')]=qs['limit'](_0x57a159[_0x587f('0x2d')][_0x587f('0x1a')]);_0x57461a[_0x587f('0x1b')]=qs['offset'](_0x57a159[_0x587f('0x2d')]['offset']);}_0x57461a[_0x587f('0x34')]=qs[_0x587f('0x35')](_0x57a159[_0x587f('0x2d')]['sort']);_0x57461a[_0x587f('0x36')]=qs[_0x587f('0x2e')](_[_0x587f('0x37')](_0x57a159[_0x587f('0x2d')],_0x57d813[_0x587f('0x2e')]),_0x49f2f4);if(_0x57a159[_0x587f('0x2d')][_0x587f('0x38')]){_0x57461a[_0x587f('0x36')]=_[_0x587f('0x39')](_0x57461a[_0x587f('0x36')],{'$or':_[_0x587f('0x29')](_0x49f2f4,function(_0x1576e8){if(_0x1576e8['type']!==_0x587f('0x3a')){var _0x38a223={};_0x38a223[_0x1576e8[_0x587f('0x26')]]={'$like':'%'+_0x57a159[_0x587f('0x2d')]['filter']+'%'};return _0x38a223;}})});}_0x57461a=_[_0x587f('0x39')]({},_0x57461a,_0x57a159[_0x587f('0x3b')]);var _0x41e765={'where':_0x57461a['where']};return db[_0x587f('0x3c')][_0x587f('0x1c')](_0x41e765)['then'](function(_0x38c510){_0x2ed6b1[_0x587f('0x1c')]=_0x38c510;if(_0x57a159[_0x587f('0x2d')][_0x587f('0x3d')]){_0x57461a[_0x587f('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x57461a);})[_0x587f('0x23')](function(_0x582b54){_0x2ed6b1[_0x587f('0x3f')]=_0x582b54;return _0x2ed6b1;})[_0x587f('0x23')](respondWithFilteredResult(_0x1bfa92,_0x57461a))['catch'](handleError(_0x1bfa92,null));};exports[_0x587f('0x40')]=function(_0x3cf4d0,_0x257a3e){var _0x5b52ee={'raw':!![],'where':{'id':_0x3cf4d0['params']['id']}},_0x406a5b={};_0x406a5b['model']=_['keys'](db[_0x587f('0x3c')][_0x587f('0x41')]);_0x406a5b[_0x587f('0x2d')]=_['keys'](_0x3cf4d0[_0x587f('0x2d')]);_0x406a5b[_0x587f('0x2e')]=_[_0x587f('0x2f')](_0x406a5b['model'],_0x406a5b[_0x587f('0x2d')]);_0x5b52ee['attributes']=_[_0x587f('0x2f')](_0x406a5b['model'],qs[_0x587f('0x42')](_0x3cf4d0[_0x587f('0x2d')][_0x587f('0x42')]));_0x5b52ee[_0x587f('0x30')]=_0x5b52ee[_0x587f('0x30')]['length']?_0x5b52ee[_0x587f('0x30')]:_0x406a5b[_0x587f('0x2c')];if(_0x3cf4d0[_0x587f('0x2d')][_0x587f('0x3d')]){_0x5b52ee[_0x587f('0x3e')]=[{'all':!![]}];}_0x5b52ee=_[_0x587f('0x39')]({},_0x5b52ee,_0x3cf4d0[_0x587f('0x3b')]);return db[_0x587f('0x3c')][_0x587f('0x43')](_0x5b52ee)[_0x587f('0x23')](handleEntityNotFound(_0x257a3e,null))[_0x587f('0x23')](respondWithResult(_0x257a3e,null))[_0x587f('0x44')](handleError(_0x257a3e,null));};exports[_0x587f('0x45')]=function(_0x594934,_0x360a36){return db[_0x587f('0x3c')][_0x587f('0x45')](_0x594934[_0x587f('0x46')],{})[_0x587f('0x23')](respondWithResult(_0x360a36,0xc9))['catch'](handleError(_0x360a36,null));};exports['update']=function(_0x29cded,_0x2155b6){if(_0x29cded[_0x587f('0x46')]['id']){delete _0x29cded[_0x587f('0x46')]['id'];}return db[_0x587f('0x3c')][_0x587f('0x43')]({'where':{'id':_0x29cded['params']['id']}})['then'](handleEntityNotFound(_0x2155b6,null))[_0x587f('0x23')](saveUpdates(_0x29cded[_0x587f('0x46')],null))[_0x587f('0x23')](respondWithResult(_0x2155b6,null))['catch'](handleError(_0x2155b6,null));};exports[_0x587f('0x22')]=function(_0x257960,_0x3033c1){return db['ChatTransferReport']['find']({'where':{'id':_0x257960[_0x587f('0x47')]['id']}})[_0x587f('0x23')](handleEntityNotFound(_0x3033c1,null))['then'](removeEntity(_0x3033c1,null))[_0x587f('0x44')](handleError(_0x3033c1,null));};exports[_0x587f('0x48')]=function(_0x2d7067,_0x51bdb1){return db[_0x587f('0x3c')][_0x587f('0x48')]()[_0x587f('0x23')](respondWithResult(_0x51bdb1,null))['catch'](handleError(_0x51bdb1,null));};
\ No newline at end of file
+var _0x8f01=['where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','keys','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','reject','save','update','then','end','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x8f01,0x147));var _0x18f0=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x8f01[_0x19f9e6];return _0x45c862;};'use strict';var emlformat=require(_0x18f0('0x0'));var rimraf=require(_0x18f0('0x1'));var zipdir=require(_0x18f0('0x2'));var jsonpatch=require(_0x18f0('0x3'));var rp=require(_0x18f0('0x4'));var moment=require('moment');var BPromise=require(_0x18f0('0x5'));var Mustache=require(_0x18f0('0x6'));var util=require(_0x18f0('0x7'));var path=require('path');var sox=require(_0x18f0('0x8'));var csv=require(_0x18f0('0x9'));var ejs=require(_0x18f0('0xa'));var fs=require('fs');var fs_extra=require(_0x18f0('0xb'));var _=require(_0x18f0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x18f0('0xd'));var deskjs=require(_0x18f0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x18f0('0xf'));var Papa=require(_0x18f0('0x10'));var Redis=require(_0x18f0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x18f0('0x12'));var hardwareService=require(_0x18f0('0x13'));var logger=require(_0x18f0('0x14'))(_0x18f0('0x15'));var utils=require(_0x18f0('0x16'));var config=require(_0x18f0('0x17'));var licenseUtil=require(_0x18f0('0x18'));var db=require(_0x18f0('0x19'))['db'];function respondWithStatusCode(_0x246213,_0x2f3188){_0x2f3188=_0x2f3188||0xcc;return function(_0x3edee3){if(_0x3edee3){return _0x246213[_0x18f0('0x1a')](_0x2f3188);}return _0x246213[_0x18f0('0x1b')](_0x2f3188)['end']();};}function respondWithResult(_0x4f0f1f,_0x4a976d){_0x4a976d=_0x4a976d||0xc8;return function(_0x1149af){if(_0x1149af){return _0x4f0f1f['status'](_0x4a976d)[_0x18f0('0x1c')](_0x1149af);}};}function respondWithFilteredResult(_0x2a1e84,_0x3ec71e){return function(_0x3c1a6f){if(_0x3c1a6f){var _0x5b81ec=typeof _0x3ec71e['offset']===_0x18f0('0x1d')&&typeof _0x3ec71e[_0x18f0('0x1e')]==='undefined';var _0x36883d=_0x3c1a6f['count'];var _0x2f36f3=_0x5b81ec?0x0:_0x3ec71e[_0x18f0('0x1f')];var _0x2ce895=_0x5b81ec?_0x3c1a6f[_0x18f0('0x20')]:_0x3ec71e[_0x18f0('0x1f')]+_0x3ec71e[_0x18f0('0x1e')];var _0x43ff81;if(_0x2ce895>=_0x36883d){_0x2ce895=_0x36883d;_0x43ff81=0xc8;}else{_0x43ff81=0xce;}_0x2a1e84[_0x18f0('0x1b')](_0x43ff81);return _0x2a1e84['set'](_0x18f0('0x21'),_0x2f36f3+'-'+_0x2ce895+'/'+_0x36883d)[_0x18f0('0x1c')](_0x3c1a6f);}return null;};}function patchUpdates(_0x29dc9c){return function(_0xd92e3f){try{jsonpatch['apply'](_0xd92e3f,_0x29dc9c,!![]);}catch(_0x5e5303){return BPromise[_0x18f0('0x22')](_0x5e5303);}return _0xd92e3f[_0x18f0('0x23')]();};}function saveUpdates(_0x4d4064,_0x128fa0){return function(_0x4cb7ba){if(_0x4cb7ba){return _0x4cb7ba[_0x18f0('0x24')](_0x4d4064)[_0x18f0('0x25')](function(_0x42fbf0){return _0x42fbf0;});}return null;};}function removeEntity(_0x3f5958,_0x55a6db){return function(_0x320226){if(_0x320226){return _0x320226['destroy']()['then'](function(){_0x3f5958[_0x18f0('0x1b')](0xcc)[_0x18f0('0x26')]();});}};}function handleEntityNotFound(_0x302ead,_0x2cfd8f){return function(_0xdc1c04){if(!_0xdc1c04){_0x302ead[_0x18f0('0x1a')](0x194);}return _0xdc1c04;};}function handleError(_0x4b03c6,_0x1d4575){_0x1d4575=_0x1d4575||0x1f4;return function(_0x36cea8){logger['error'](_0x36cea8['stack']);if(_0x36cea8['name']){delete _0x36cea8[_0x18f0('0x27')];}_0x4b03c6['status'](_0x1d4575)[_0x18f0('0x28')](_0x36cea8);};}exports[_0x18f0('0x29')]=function(_0x29c3b5,_0x36b718){var _0x32d879={},_0x5b6cfc={},_0x53bd7e={'count':0x0,'rows':[]};var _0x35e4d2=_['map'](db[_0x18f0('0x2a')][_0x18f0('0x2b')],function(_0x4a46b9){return{'name':_0x4a46b9[_0x18f0('0x2c')],'type':_0x4a46b9[_0x18f0('0x2d')][_0x18f0('0x2e')]};});_0x5b6cfc[_0x18f0('0x2f')]=_[_0x18f0('0x30')](_0x35e4d2,'name');_0x5b6cfc[_0x18f0('0x31')]=_['keys'](_0x29c3b5[_0x18f0('0x31')]);_0x5b6cfc['filters']=_[_0x18f0('0x32')](_0x5b6cfc[_0x18f0('0x2f')],_0x5b6cfc[_0x18f0('0x31')]);_0x32d879[_0x18f0('0x33')]=_['intersection'](_0x5b6cfc[_0x18f0('0x2f')],qs[_0x18f0('0x34')](_0x29c3b5['query'][_0x18f0('0x34')]));_0x32d879[_0x18f0('0x33')]=_0x32d879[_0x18f0('0x33')][_0x18f0('0x35')]?_0x32d879[_0x18f0('0x33')]:_0x5b6cfc[_0x18f0('0x2f')];if(!_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x36')](_0x18f0('0x37'))){_0x32d879[_0x18f0('0x1e')]=qs[_0x18f0('0x1e')](_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x1e')]);_0x32d879[_0x18f0('0x1f')]=qs[_0x18f0('0x1f')](_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x1f')]);}_0x32d879[_0x18f0('0x38')]=qs[_0x18f0('0x39')](_0x29c3b5['query']['sort']);_0x32d879[_0x18f0('0x3a')]=qs[_0x18f0('0x3b')](_[_0x18f0('0x3c')](_0x29c3b5[_0x18f0('0x31')],_0x5b6cfc[_0x18f0('0x3b')]),_0x35e4d2);if(_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x3d')]){_0x32d879['where']=_[_0x18f0('0x3e')](_0x32d879['where'],{'$or':_[_0x18f0('0x30')](_0x35e4d2,function(_0x5ac32e){if(_0x5ac32e[_0x18f0('0x2d')]!==_0x18f0('0x3f')){var _0x333dc6={};_0x333dc6[_0x5ac32e[_0x18f0('0x27')]]={'$like':'%'+_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x3d')]+'%'};return _0x333dc6;}})});}_0x32d879=_[_0x18f0('0x3e')]({},_0x32d879,_0x29c3b5['options']);var _0x4a3942={'where':_0x32d879[_0x18f0('0x3a')]};return db['ChatTransferReport'][_0x18f0('0x20')](_0x4a3942)[_0x18f0('0x25')](function(_0x40d94f){_0x53bd7e[_0x18f0('0x20')]=_0x40d94f;if(_0x29c3b5[_0x18f0('0x31')]['includeAll']){_0x32d879[_0x18f0('0x40')]=[{'all':!![]}];}return db[_0x18f0('0x2a')]['findAll'](_0x32d879);})[_0x18f0('0x25')](function(_0x200278){_0x53bd7e[_0x18f0('0x41')]=_0x200278;return _0x53bd7e;})[_0x18f0('0x25')](respondWithFilteredResult(_0x36b718,_0x32d879))[_0x18f0('0x42')](handleError(_0x36b718,null));};exports[_0x18f0('0x43')]=function(_0x4d915c,_0x24ef97){var _0x298583={'raw':!![],'where':{'id':_0x4d915c[_0x18f0('0x44')]['id']}},_0x14dbff={};_0x14dbff[_0x18f0('0x2f')]=_[_0x18f0('0x45')](db[_0x18f0('0x2a')][_0x18f0('0x2b')]);_0x14dbff['query']=_[_0x18f0('0x45')](_0x4d915c[_0x18f0('0x31')]);_0x14dbff[_0x18f0('0x3b')]=_[_0x18f0('0x32')](_0x14dbff['model'],_0x14dbff['query']);_0x298583[_0x18f0('0x33')]=_['intersection'](_0x14dbff[_0x18f0('0x2f')],qs[_0x18f0('0x34')](_0x4d915c['query']['fields']));_0x298583[_0x18f0('0x33')]=_0x298583[_0x18f0('0x33')][_0x18f0('0x35')]?_0x298583[_0x18f0('0x33')]:_0x14dbff['model'];if(_0x4d915c[_0x18f0('0x31')][_0x18f0('0x46')]){_0x298583[_0x18f0('0x40')]=[{'all':!![]}];}_0x298583=_[_0x18f0('0x3e')]({},_0x298583,_0x4d915c[_0x18f0('0x47')]);return db[_0x18f0('0x2a')][_0x18f0('0x48')](_0x298583)[_0x18f0('0x25')](handleEntityNotFound(_0x24ef97,null))[_0x18f0('0x25')](respondWithResult(_0x24ef97,null))[_0x18f0('0x42')](handleError(_0x24ef97,null));};exports[_0x18f0('0x49')]=function(_0x49cc40,_0x1e92e7){return db[_0x18f0('0x2a')]['create'](_0x49cc40[_0x18f0('0x4a')],{})[_0x18f0('0x25')](respondWithResult(_0x1e92e7,0xc9))['catch'](handleError(_0x1e92e7,null));};exports[_0x18f0('0x24')]=function(_0x18a6f2,_0x17e21a){if(_0x18a6f2['body']['id']){delete _0x18a6f2[_0x18f0('0x4a')]['id'];}return db[_0x18f0('0x2a')][_0x18f0('0x48')]({'where':{'id':_0x18a6f2[_0x18f0('0x44')]['id']}})[_0x18f0('0x25')](handleEntityNotFound(_0x17e21a,null))[_0x18f0('0x25')](saveUpdates(_0x18a6f2[_0x18f0('0x4a')],null))[_0x18f0('0x25')](respondWithResult(_0x17e21a,null))['catch'](handleError(_0x17e21a,null));};exports[_0x18f0('0x4b')]=function(_0x440eb2,_0x1b2e5e){return db['ChatTransferReport'][_0x18f0('0x48')]({'where':{'id':_0x440eb2['params']['id']}})['then'](handleEntityNotFound(_0x1b2e5e,null))[_0x18f0('0x25')](removeEntity(_0x1b2e5e,null))[_0x18f0('0x42')](handleError(_0x1b2e5e,null));};exports[_0x18f0('0x4c')]=function(_0x2dbb33,_0x2af8fd){return db[_0x18f0('0x2a')][_0x18f0('0x4c')]()['then'](respondWithResult(_0x2af8fd,null))[_0x18f0('0x42')](handleError(_0x2af8fd,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index d829a29..51a6d45 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 _0x4cd5=['api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x3ca314,_0x46c226){var _0x9e31d8=function(_0x30ba8d){while(--_0x30ba8d){_0x3ca314['push'](_0x3ca314['shift']());}};_0x9e31d8(++_0x46c226);}(_0x4cd5,0x76));var _0x54cd=function(_0x2313ec,_0x629664){_0x2313ec=_0x2313ec-0x0;var _0x2594f6=_0x4cd5[_0x2313ec];return _0x2594f6;};'use strict';var _=require('lodash');var util=require(_0x54cd('0x0'));var logger=require(_0x54cd('0x1'))(_0x54cd('0x2'));var moment=require(_0x54cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x54cd('0x4'));var fs=require('fs');var path=require(_0x54cd('0x5'));var rimraf=require(_0x54cd('0x6'));var config=require(_0x54cd('0x7'));var attributes=require(_0x54cd('0x8'));module['exports']=function(_0x5966c6,_0x1c66c0){return _0x5966c6['define'](_0x54cd('0x9'),attributes,{'tableName':_0x54cd('0xa'),'paranoid':![],'indexes':[{'name':_0x54cd('0xb'),'fields':[_0x54cd('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb9e8=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2faf2d,_0x272b51){var _0x2bbb8f=function(_0x52228e){while(--_0x52228e){_0x2faf2d['push'](_0x2faf2d['shift']());}};_0x2bbb8f(++_0x272b51);}(_0xb9e8,0x1a1));var _0x8b9e=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0xb9e8[_0x59145a];return _0xf04d7;};'use strict';var _=require(_0x8b9e('0x0'));var util=require(_0x8b9e('0x1'));var logger=require(_0x8b9e('0x2'))(_0x8b9e('0x3'));var moment=require(_0x8b9e('0x4'));var BPromise=require(_0x8b9e('0x5'));var rp=require(_0x8b9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b9e('0x7'));var config=require(_0x8b9e('0x8'));var attributes=require(_0x8b9e('0x9'));module[_0x8b9e('0xa')]=function(_0x43fbca,_0x3b3530){return _0x43fbca[_0x8b9e('0xb')]('ChatTransferReport',attributes,{'tableName':_0x8b9e('0xc'),'paranoid':![],'indexes':[{'name':_0x8b9e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 6e94fe7..7822b92 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 _0x9fec=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0x9fec,0x14e));var _0xc9fe=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x9fec[_0x3c51d4];return _0x53c45f;};'use strict';var _=require('lodash');var util=require(_0xc9fe('0x0'));var moment=require('moment');var BPromise=require(_0xc9fe('0x1'));var rs=require(_0xc9fe('0x2'));var fs=require('fs');var Redis=require(_0xc9fe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9fe('0x4'));var logger=require(_0xc9fe('0x5'))(_0xc9fe('0x6'));var config=require(_0xc9fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc9fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc0fdc5,_0xd2a574,_0x4591c1){return new BPromise(function(_0x1b8461,_0x2fb4b2){return client[_0xc9fe('0x9')](_0xc0fdc5,_0x4591c1)[_0xc9fe('0xa')](function(_0x40c738){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xd2a574,_0xc9fe('0xb'));logger[_0xc9fe('0xc')](_0xc9fe('0xd'),_0xd2a574,_0xc9fe('0xb'),JSON[_0xc9fe('0xe')](_0x40c738));if(_0x40c738[_0xc9fe('0xf')]){if(_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x10')]===0x1f4){logger['error'](_0xc9fe('0x11'),_0xd2a574,_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);return _0x2fb4b2(_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);}logger[_0xc9fe('0xf')](_0xc9fe('0x11'),_0xd2a574,_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);return _0x1b8461(_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);}else{logger[_0xc9fe('0x13')](_0xc9fe('0x11'),_0xd2a574,_0xc9fe('0xb'));_0x1b8461(_0x40c738[_0xc9fe('0x14')][_0xc9fe('0x12')]);}})[_0xc9fe('0x15')](function(_0xe8e4f2){logger['error'](_0xc9fe('0x11'),_0xd2a574,_0xe8e4f2);_0x2fb4b2(_0xe8e4f2);});});}
\ No newline at end of file
+var _0xe191=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util'];(function(_0x57fc31,_0x11fcc6){var _0x4640e6=function(_0x85a791){while(--_0x85a791){_0x57fc31['push'](_0x57fc31['shift']());}};_0x4640e6(++_0x11fcc6);}(_0xe191,0x8e));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e19('0x0'));var util=require(_0x1e19('0x1'));var moment=require(_0x1e19('0x2'));var BPromise=require(_0x1e19('0x3'));var rs=require(_0x1e19('0x4'));var fs=require('fs');var Redis=require(_0x1e19('0x5'));var db=require(_0x1e19('0x6'))['db'];var utils=require(_0x1e19('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1e19('0x8'));var jayson=require(_0x1e19('0x9'));var client=jayson[_0x1e19('0xa')][_0x1e19('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c9d86,_0x5d1468,_0x1a90b3){return new BPromise(function(_0x4f4647,_0xa9482b){return client['request'](_0x3c9d86,_0x1a90b3)[_0x1e19('0xc')](function(_0xa4636d){logger[_0x1e19('0xd')](_0x1e19('0xe'),_0x5d1468,_0x1e19('0xf'));logger[_0x1e19('0x10')](_0x1e19('0x11'),_0x5d1468,_0x1e19('0xf'),JSON[_0x1e19('0x12')](_0xa4636d));if(_0xa4636d['error']){if(_0xa4636d['error'][_0x1e19('0x13')]===0x1f4){logger[_0x1e19('0x14')](_0x1e19('0xe'),_0x5d1468,_0xa4636d['error'][_0x1e19('0x15')]);return _0xa9482b(_0xa4636d[_0x1e19('0x14')]['message']);}logger[_0x1e19('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x5d1468,_0xa4636d['error'][_0x1e19('0x15')]);return _0x4f4647(_0xa4636d[_0x1e19('0x14')][_0x1e19('0x15')]);}else{logger[_0x1e19('0xd')](_0x1e19('0xe'),_0x5d1468,_0x1e19('0xf'));_0x4f4647(_0xa4636d[_0x1e19('0x16')][_0x1e19('0x15')]);}})[_0x1e19('0x17')](function(_0x186014){logger[_0x1e19('0x14')](_0x1e19('0xe'),_0x5d1468,_0x186014);_0xa9482b(_0x186014);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 62dff95..0553207 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 _0x4a86=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','show','post','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x4a86,0x8d));var _0x64a8=function(_0x4b2df9,_0x11571e){_0x4b2df9=_0x4b2df9-0x0;var _0x4fcb0f=_0x4a86[_0x4b2df9];return _0x4fcb0f;};'use strict';var multer=require(_0x64a8('0x0'));var util=require(_0x64a8('0x1'));var path=require(_0x64a8('0x2'));var timeout=require(_0x64a8('0x3'));var express=require('express');var router=express[_0x64a8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x64a8('0x5'));var config=require(_0x64a8('0x6'));var controller=require(_0x64a8('0x7'));router['get']('/',auth[_0x64a8('0x8')](),controller[_0x64a8('0x9')]);router['get']('/describe',auth[_0x64a8('0x8')](),controller['describe']);router[_0x64a8('0xa')]('/:id',auth[_0x64a8('0x8')](),controller[_0x64a8('0xb')]);router[_0x64a8('0xc')]('/',auth[_0x64a8('0x8')](),controller['create']);router['put']('/:id',auth[_0x64a8('0x8')](),controller[_0x64a8('0xd')]);router[_0x64a8('0xe')](_0x64a8('0xf'),auth['isAuthenticated'](),controller[_0x64a8('0x10')]);module[_0x64a8('0x11')]=router;
\ No newline at end of file
+var _0x9b8e=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b8e,0x166));var _0xe9b8=function(_0x517171,_0x68eebb){_0x517171=_0x517171-0x0;var _0x5471af=_0x9b8e[_0x517171];return _0x5471af;};'use strict';var multer=require(_0xe9b8('0x0'));var util=require(_0xe9b8('0x1'));var path=require(_0xe9b8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9b8('0x3'));var router=express[_0xe9b8('0x4')]();var fs_extra=require(_0xe9b8('0x5'));var auth=require(_0xe9b8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe9b8('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe9b8('0x8')]);router[_0xe9b8('0x9')]('/describe',auth[_0xe9b8('0xa')](),controller[_0xe9b8('0xb')]);router[_0xe9b8('0x9')](_0xe9b8('0xc'),auth[_0xe9b8('0xa')](),controller['show']);router[_0xe9b8('0xd')]('/',auth[_0xe9b8('0xa')](),controller[_0xe9b8('0xe')]);router[_0xe9b8('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe9b8('0x10')]);router[_0xe9b8('0x11')]('/:id',auth[_0xe9b8('0xa')](),controller[_0xe9b8('0x12')]);module[_0xe9b8('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index f825a29..ce962ae 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 _0xee78=['squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','getDataValue','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x5a6dc3,_0x30c3fc){var _0x3cf73c=function(_0xe3b432){while(--_0xe3b432){_0x5a6dc3['push'](_0x5a6dc3['shift']());}};_0x3cf73c(++_0x30c3fc);}(_0xee78,0xc9));var _0x8ee7=function(_0x14c600,_0x3ae909){_0x14c600=_0x14c600-0x0;var _0x319da5=_0xee78[_0x14c600];return _0x319da5;};'use strict';var Sequelize=require(_0x8ee7('0x0'));var rs=require(_0x8ee7('0x1'));module['exports']={'name':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'unique':_0x8ee7('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x4')},'mapKeyOffline':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x4')},'key':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8ee7('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8ee7('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8ee7('0x2')]},'animation':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8ee7('0xa')]('rounded',_0x8ee7('0xb')),'defaultValue':_0x8ee7('0xc')},'header_online':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xd')},'start_chat_button':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xe')},'offline_chat_button':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xf')},'header_offline':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x13')},'noteTitle':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x14')},'placeholderMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xf')},'skipMessageButton':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x16')},'ratingType':{'type':Sequelize[_0x8ee7('0xa')](_0x8ee7('0x17'),_0x8ee7('0x18')),'defaultValue':_0x8ee7('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8ee7('0x19')],'defaultValue':function(){return JSON[_0x8ee7('0x1a')]({'items':[{'type':_0x8ee7('0x1b'),'variable':null,'config':{'placeholder':_0x8ee7('0x1c'),'type':_0x8ee7('0x1d'),'required':!![]},'props':{'title':_0x8ee7('0x1c'),'helpText':''}},{'type':_0x8ee7('0x1b'),'props':{'title':_0x8ee7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8ee7('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x8ee7('0x1e'))?JSON[_0x8ee7('0x1f')](this['getDataValue'](_0x8ee7('0x1e'))):{};},'set':function(_0x4a5f1e){return this[_0x8ee7('0x20')]('onlineForm',JSON[_0x8ee7('0x1a')](_0x4a5f1e));}},'offlineForm':{'type':Sequelize[_0x8ee7('0x19')],'defaultValue':function(){return JSON[_0x8ee7('0x1a')]({'items':[{'type':'input','props':{'title':_0x8ee7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8ee7('0x4'),'type':_0x8ee7('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x8ee7('0x21')},'props':{'title':_0x8ee7('0x21'),'helpText':_0x8ee7('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8ee7('0x23'))?JSON['parse'](this[_0x8ee7('0x24')](_0x8ee7('0x23'))):{};},'set':function(_0x344727){return this[_0x8ee7('0x20')](_0x8ee7('0x23'),JSON[_0x8ee7('0x1a')](_0x344727));}},'token':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8ee7('0x2')]},'waitingTitle':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x26')},'offlineMessageBody':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8ee7('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8ee7('0x29');}},'notificationSound':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8ee7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8ee7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x2b')},'verticalAlignment':{'type':Sequelize[_0x8ee7('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x2c')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8ee7('0x2')]},'customerAvatar':{'type':Sequelize[_0x8ee7('0x19')]},'showCustomerAvatar':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8ee7('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8ee7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0x2e')},'systemAvatar':{'type':Sequelize[_0x8ee7('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8ee7('0x8')],'comment':_0x8ee7('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8ee7('0x30'),'set':function(_0x3772b3){if(!_0x3772b3)this[_0x8ee7('0x20')](_0x8ee7('0x31'),null);this['setDataValue'](_0x8ee7('0x32'),_0x3772b3);}},'vidaooEscalation':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8ee7('0x2')]},'vidaooTopic':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x8ee7('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8ee7('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x720c=['email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','stringify','input','name','getDataValue','onlineForm','parse','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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.','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING'];(function(_0x263106,_0x30a27a){var _0x35dfca=function(_0x58f38d){while(--_0x58f38d){_0x263106['push'](_0x263106['shift']());}};_0x35dfca(++_0x30a27a);}(_0x720c,0x1be));var _0xc720=function(_0x1dcbc6,_0x219d61){_0x1dcbc6=_0x1dcbc6-0x0;var _0x1a0893=_0x720c[_0x1dcbc6];return _0x1a0893;};'use strict';var Sequelize=require(_0xc720('0x0'));var rs=require(_0xc720('0x1'));module[_0xc720('0x2')]={'name':{'type':Sequelize[_0xc720('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xc720('0x3')]},'mapKey':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x4')},'key':{'type':Sequelize[_0xc720('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x5')},'customerAlias':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc720('0x3')],'allowNull':![],'defaultValue':_0xc720('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc720('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc720('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc720('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc720('0x9')](_0xc720('0xa'),_0xc720('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xc')},'start_chat_button':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xd')},'offline_chat_button':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xe')},'header_offline':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x13')},'noteTitle':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x14')},'placeholderMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0xe')},'skipMessageButton':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x16')},'ratingType':{'type':Sequelize[_0xc720('0x9')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xc720('0x17')]({'items':[{'type':_0xc720('0x18'),'variable':null,'config':{'placeholder':_0xc720('0x19'),'type':'text','required':!![]},'props':{'title':_0xc720('0x19'),'helpText':''}},{'type':_0xc720('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc720('0x4'),'type':_0xc720('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc720('0x1a')](_0xc720('0x1b'))?JSON[_0xc720('0x1c')](this[_0xc720('0x1a')](_0xc720('0x1b'))):{};},'set':function(_0xce74ad){return this['setDataValue'](_0xc720('0x1b'),JSON[_0xc720('0x17')](_0xce74ad));}},'offlineForm':{'type':Sequelize[_0xc720('0x1d')],'defaultValue':function(){return JSON[_0xc720('0x17')]({'items':[{'type':_0xc720('0x18'),'props':{'title':_0xc720('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xc720('0x4'),'type':'email'},'variable':null},{'type':_0xc720('0x1e'),'config':{'placeholder':_0xc720('0x1f')},'props':{'title':_0xc720('0x1f'),'helpText':_0xc720('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xc720('0x1a')](_0xc720('0x21'))?JSON[_0xc720('0x1c')](this[_0xc720('0x1a')](_0xc720('0x21'))):{};},'set':function(_0x258a98){return this[_0xc720('0x22')](_0xc720('0x21'),JSON['stringify'](_0x258a98));}},'token':{'type':Sequelize[_0xc720('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc720('0x3')]},'forwardOffline':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc720('0x3')]},'waitingTitle':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x23')},'waitingMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x26')},'sendUnmanaged':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc720('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc720('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc720('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x28')},'verticalAlignment':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x29')},'messagesAlignment':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x2a')},'defaultTitle':{'type':Sequelize[_0xc720('0x3')]},'customerAvatar':{'type':Sequelize[_0xc720('0x1d')]},'showCustomerAvatar':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc720('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x2b')},'systemAvatar':{'type':Sequelize[_0xc720('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc720('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![],'comment':_0xc720('0x2d'),'set':function(_0x5793ff){if(!_0x5793ff)this[_0xc720('0x22')](_0xc720('0x2e'),null);this[_0xc720('0x22')](_0xc720('0x2f'),_0x5793ff);}},'vidaooEscalation':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc720('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc720('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xc720('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xc720('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc720('0x1d')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 7c7ca6c..02a548a 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 _0x4173=['get','ChatWebsites','destroy','stack','name','send','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','model','vendor','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','length','includeAll','include','find','create','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','testWildcardValidity','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','ifTime','mapKey','MapKey\x20is\x20mandatory','isEmpty','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','asc','list','List','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','spread','readFileSync','utf8','offlineMessageBody','fromString','originalname','mimetype','server','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','timezone','server/files/chat/iframe.ejs','replace','remote','stringify','connection','render','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','../../config/environment','../../errors/api','APIBadRequestError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','defaults','register','client','http','request','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','offset','undefined','limit','count','set','Content-Range','update'];(function(_0x387d8f,_0x54167a){var _0x189c53=function(_0x14a9d3){while(--_0x14a9d3){_0x387d8f['push'](_0x387d8f['shift']());}};_0x189c53(++_0x54167a);}(_0x4173,0x101));var _0x3417=function(_0x3c9a89,_0x378778){_0x3c9a89=_0x3c9a89-0x0;var _0x1eb47b=_0x4173[_0x3c9a89];return _0x1eb47b;};'use strict';var Mustache=require(_0x3417('0x0'));var util=require(_0x3417('0x1'));var path=require(_0x3417('0x2'));var ejs=require(_0x3417('0x3'));var fs=require('fs');var fs_extra=require(_0x3417('0x4'));var _=require(_0x3417('0x5'));var querystring=require('querystring');var htmlToText=require(_0x3417('0x6'));var Redis=require(_0x3417('0x7'));var jayson=require(_0x3417('0x8'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x3417('0x9'));var APIBadRequestError=require(_0x3417('0xa'))[_0x3417('0xb')];var APINotFoundError=require(_0x3417('0xa'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x3417('0xa'))['APIOutOfIntervalError'];var APIHandleError=require(_0x3417('0xa'))[_0x3417('0xc')];var APIConflictError=require(_0x3417('0xa'))[_0x3417('0xd')];var wildcardUtils=require(_0x3417('0xe'));var URL=require(_0x3417('0xf'))[_0x3417('0x10')];var db=require('../../mysqldb')['db'];config[_0x3417('0x11')]=_[_0x3417('0x12')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3417('0x11')]));require('./chatWebsite.socket')[_0x3417('0x13')](socket);var client=jayson[_0x3417('0x14')][_0x3417('0x15')]({'port':0x232c});var client9002=jayson[_0x3417('0x14')][_0x3417('0x15')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x3417('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x52cd91,_0x593a67,_0x505523,_0x59ea65){return new Promise(function(_0x5dd004,_0x2b60fc){var _0x408fdd=_0x59ea65||client;return _0x408fdd[_0x3417('0x16')](_0x52cd91,_0x505523)[_0x3417('0x17')](function(_0x4f1c93){logger[_0x3417('0x18')](_0x3417('0x19'),_0x593a67,_0x3417('0x1a'));logger[_0x3417('0x1b')](_0x3417('0x1c'),_0x593a67,_0x3417('0x1a'),JSON['stringify'](_0x4f1c93));if(_0x4f1c93[_0x3417('0x1d')]){if(_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1e')]===0x1f4){logger[_0x3417('0x1d')](_0x3417('0x19'),_0x593a67,_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1f')]);return _0x2b60fc(_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1f')]);}logger[_0x3417('0x1d')](_0x3417('0x19'),_0x593a67,_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1f')]);return _0x5dd004(_0x4f1c93['error'][_0x3417('0x1f')]);}else{logger[_0x3417('0x18')](_0x3417('0x19'),_0x593a67,_0x3417('0x1a'));_0x5dd004(_0x4f1c93[_0x3417('0x20')][_0x3417('0x1f')]);}})[_0x3417('0x21')](function(_0x3b2902){logger[_0x3417('0x1d')](_0x3417('0x19'),_0x593a67,_0x3b2902);_0x2b60fc(_0x3b2902);});});}function respondWithStatusCode(_0x8ed410,_0x30219b){_0x30219b=_0x30219b||0xcc;return function(_0xec0335){if(_0xec0335){return _0x8ed410[_0x3417('0x22')](_0x30219b);}return _0x8ed410[_0x3417('0x23')](_0x30219b)[_0x3417('0x24')]();};}function respondWithResult(_0x220ef5,_0x8052e7){_0x8052e7=_0x8052e7||0xc8;return function(_0x498127){if(_0x498127){return _0x220ef5[_0x3417('0x23')](_0x8052e7)[_0x3417('0x25')](_0x498127);}};}function respondWithFilteredResult(_0x67e516,_0x427adc){return function(_0x3013ef){if(_0x3013ef){var _0x30aecb=typeof _0x427adc[_0x3417('0x26')]===_0x3417('0x27')&&typeof _0x427adc[_0x3417('0x28')]==='undefined';var _0x443d14=_0x3013ef[_0x3417('0x29')];var _0x1ab2cf=_0x30aecb?0x0:_0x427adc[_0x3417('0x26')];var _0x11509a=_0x30aecb?_0x3013ef[_0x3417('0x29')]:_0x427adc[_0x3417('0x26')]+_0x427adc['limit'];var _0x56d318;if(_0x11509a>=_0x443d14){_0x11509a=_0x443d14;_0x56d318=0xc8;}else{_0x56d318=0xce;}_0x67e516[_0x3417('0x23')](_0x56d318);return _0x67e516[_0x3417('0x2a')](_0x3417('0x2b'),_0x1ab2cf+'-'+_0x11509a+'/'+_0x443d14)['json'](_0x3013ef);}return null;};}function saveUpdates(_0x5c80dc){return function(_0x45ae82){if(_0x45ae82){return _0x45ae82[_0x3417('0x2c')](_0x5c80dc)[_0x3417('0x17')](function(_0x7d30d1){return _0x7d30d1;});}return null;};}function removeEntity(_0x1053c4){return function(_0x40a070){if(_0x40a070){return _0x40a070['destroy']()[_0x3417('0x17')](function(){var _0x167bf4=_0x40a070[_0x3417('0x2d')]({'plain':!![]});var _0x5917d8=_0x3417('0x2e');return db['UserProfileResource'][_0x3417('0x2f')]({'where':{'type':_0x5917d8,'resourceId':_0x167bf4['id']}})[_0x3417('0x17')](function(){return _0x40a070;});})['then'](function(){_0x1053c4['status'](0xcc)[_0x3417('0x24')]();});}};}function handleEntityNotFound(_0x2f7362){return function(_0x4d30d7){if(!_0x4d30d7){_0x2f7362['sendStatus'](0x194);}return _0x4d30d7;};}function handleError(_0x58ffa8,_0x4c630d){_0x4c630d=_0x4c630d||0x1f4;return function(_0x18c675){logger[_0x3417('0x1d')](_0x18c675[_0x3417('0x30')]);if(_0x18c675[_0x3417('0x31')]){delete _0x18c675[_0x3417('0x31')];}_0x58ffa8[_0x3417('0x23')](_0x4c630d)[_0x3417('0x32')](_0x18c675);};}function createInteractionObject(_0x1212c6,_0x5d4dc1,_0xe95af5,_0x1fc47b){var _0x188977=require('user-agent-parser');var _0x5ada7d=new _0x188977();var _0x55f53e=_0x5ada7d[_0x3417('0x33')](_0xe95af5[_0x3417('0x34')])[_0x3417('0x35')]();var _0x5183cc=_0x5d4dc1[_0x3417('0x36')];if(_0xe95af5[_0x3417('0x37')]){_0x5183cc=_0xe95af5[_0x3417('0x37')];}else if(_0xe95af5[_0x3417('0x38')]){_0x5183cc=_[_0x3417('0x39')](_0xe95af5[_0x3417('0x38')][_0x3417('0x3a')](','));}return{'ContactId':_0x1fc47b['id'],'ChatWebsiteId':_0x1212c6,'from':(_0x1fc47b[_0x3417('0x3b')]||'')+'\x20'+(_0x1fc47b[_0x3417('0x3c')]||''),'customerIp':_0x5183cc,'customerPort':_0xe95af5[_0x3417('0x3d')]?_0xe95af5[_0x3417('0x3d')]:null,'referer':_0x5d4dc1[_0x3417('0x3e')],'browserName':_0x55f53e[_0x3417('0x3f')]['name']&&_0x55f53e['browser'][_0x3417('0x40')]?util[_0x3417('0x41')]('%s\x20%s',_0x55f53e[_0x3417('0x3f')][_0x3417('0x31')],_0x55f53e[_0x3417('0x3f')][_0x3417('0x40')]):_0x3417('0x42'),'browserVersion':_0x55f53e[_0x3417('0x3f')][_0x3417('0x40')]||_0x3417('0x42'),'osName':util[_0x3417('0x41')](_0x3417('0x43'),_0x55f53e['os'][_0x3417('0x31')],_0x55f53e['os'][_0x3417('0x40')]),'osVersion':_0x55f53e['os'][_0x3417('0x40')],'deviceModel':_0x55f53e[_0x3417('0x44')][_0x3417('0x45')]&&_0x55f53e[_0x3417('0x44')][_0x3417('0x46')]?util[_0x3417('0x41')]('%s\x20%s\x20%s',_0x55f53e[_0x3417('0x44')]['model'],_0x55f53e[_0x3417('0x44')][_0x3417('0x46')],_0x55f53e[_0x3417('0x44')][_0x3417('0x47')]):null,'deviceVendor':_0x55f53e[_0x3417('0x44')][_0x3417('0x46')],'deviceType':_0x55f53e[_0x3417('0x44')][_0x3417('0x47')],'formData':JSON['stringify'](_0x5d4dc1)};}exports[_0x3417('0x48')]=function(_0x575d23,_0x13f543){var _0x36338e={'include':[{'model':db[_0x3417('0x49')],'as':_0x3417('0x4a')}]},_0x678393={},_0x551f22={'count':0x0,'rows':[]};var _0x53c102=_[_0x3417('0x4b')](db[_0x3417('0x4c')][_0x3417('0x4d')],function(_0x399db9){return{'name':_0x399db9[_0x3417('0x4e')],'type':_0x399db9[_0x3417('0x47')][_0x3417('0x4f')]};});_0x678393['model']=_[_0x3417('0x4b')](_0x53c102,_0x3417('0x31'));_0x678393[_0x3417('0x50')]=_[_0x3417('0x51')](_0x575d23['query']);_0x678393[_0x3417('0x52')]=_[_0x3417('0x53')](_0x678393[_0x3417('0x45')],_0x678393[_0x3417('0x50')]);_0x36338e[_0x3417('0x54')]=_[_0x3417('0x53')](_0x678393[_0x3417('0x45')],qs['fields'](_0x575d23['query'][_0x3417('0x55')]));_0x36338e[_0x3417('0x54')]=_0x36338e[_0x3417('0x54')]['length']?_0x36338e['attributes']:_0x678393[_0x3417('0x45')];if(!_0x575d23[_0x3417('0x50')][_0x3417('0x56')]('nolimit')){_0x36338e[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x575d23[_0x3417('0x50')]['limit']);_0x36338e[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x575d23['query'][_0x3417('0x26')]);}_0x36338e[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x575d23[_0x3417('0x50')]['sort']);_0x36338e[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x575d23[_0x3417('0x50')],_0x678393[_0x3417('0x52')]),_0x53c102);if(_0x575d23[_0x3417('0x50')][_0x3417('0x5b')]){_0x36338e[_0x3417('0x59')]=_['merge'](_0x36338e[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0x53c102,function(_0x591d05){if(_0x591d05[_0x3417('0x47')]!==_0x3417('0x5c')){var _0x32021a={};_0x32021a[_0x591d05['name']]={'$like':'%'+_0x575d23[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x32021a;}})});}_0x36338e=_[_0x3417('0x5d')]({},_0x36338e,_0x575d23[_0x3417('0x5e')]);var _0x542b4b={'where':_0x36338e[_0x3417('0x59')]};return db['ChatWebsite'][_0x3417('0x29')](_0x542b4b)[_0x3417('0x17')](function(_0x639b2e){_0x551f22[_0x3417('0x29')]=_0x639b2e;if(_0x575d23[_0x3417('0x50')]['includeAll']){_0x36338e['include']=[{'all':!![]}];}return db['ChatWebsite'][_0x3417('0x5f')](_0x36338e);})[_0x3417('0x17')](function(_0x57026f){_0x551f22[_0x3417('0x60')]=_0x57026f;return _0x551f22;})[_0x3417('0x17')](respondWithFilteredResult(_0x13f543,_0x36338e))[_0x3417('0x21')](handleError(_0x13f543,null));};exports['show']=function(_0x1f6924,_0x2a3170){var _0x3c2cd5={'raw':![],'where':{'id':_0x1f6924['params']['id']},'include':[{'model':db[_0x3417('0x49')],'as':_0x3417('0x4a')}]},_0x281134={};_0x281134[_0x3417('0x45')]=_[_0x3417('0x51')](db['ChatWebsite'][_0x3417('0x4d')]);_0x281134['query']=_[_0x3417('0x51')](_0x1f6924[_0x3417('0x50')]);_0x281134[_0x3417('0x52')]=_[_0x3417('0x53')](_0x281134[_0x3417('0x45')],_0x281134[_0x3417('0x50')]);_0x3c2cd5[_0x3417('0x54')]=_['intersection'](_0x281134[_0x3417('0x45')],qs['fields'](_0x1f6924[_0x3417('0x50')][_0x3417('0x55')]));_0x3c2cd5[_0x3417('0x54')]=_0x3c2cd5[_0x3417('0x54')][_0x3417('0x61')]?_0x3c2cd5[_0x3417('0x54')]:_0x281134[_0x3417('0x45')];if(_0x1f6924['query'][_0x3417('0x62')]){_0x3c2cd5[_0x3417('0x63')]=[{'all':!![]}];}_0x3c2cd5=_[_0x3417('0x5d')]({},_0x3c2cd5,_0x1f6924[_0x3417('0x5e')]);return db['ChatWebsite'][_0x3417('0x64')](_0x3c2cd5)['then'](handleEntityNotFound(_0x2a3170,null))['then'](respondWithResult(_0x2a3170,null))[_0x3417('0x21')](handleError(_0x2a3170,null));};exports[_0x3417('0x65')]=function(_0x30d5ef,_0x3ad105){if(!wildcardUtils['testWildcardValidity'](_0x30d5ef[_0x3417('0x66')][_0x3417('0x67')])){return handleError(_0x3ad105,null)(new APIBadRequestError('\x22'+_0x30d5ef[_0x3417('0x66')]['address']+_0x3417('0x68')));}return db[_0x3417('0x4c')][_0x3417('0x65')](_0x30d5ef[_0x3417('0x66')],{})[_0x3417('0x17')](function(_0x1e2582){var _0x2892b8=_0x30d5ef['user'][_0x3417('0x2d')]({'plain':!![]});if(!_0x2892b8)throw new Error(_0x3417('0x69'));if(_0x2892b8[_0x3417('0x6a')]===_0x3417('0x6b')){var _0xaa1b62=_0x1e2582[_0x3417('0x2d')]({'plain':!![]});var _0x24eba6=_0x3417('0x2e');return db[_0x3417('0x6c')][_0x3417('0x64')]({'where':{'name':_0x24eba6,'userProfileId':_0x2892b8['userProfileId']},'raw':!![]})[_0x3417('0x17')](function(_0x5a42ea){if(_0x5a42ea&&_0x5a42ea[_0x3417('0x6d')]===0x0){return db[_0x3417('0x6e')][_0x3417('0x65')]({'name':_0xaa1b62[_0x3417('0x31')],'resourceId':_0xaa1b62['id'],'type':_0x5a42ea[_0x3417('0x31')],'sectionId':_0x5a42ea['id']},{})[_0x3417('0x17')](function(){return _0x1e2582;});}else{return _0x1e2582;}})[_0x3417('0x21')](function(_0x76925a){logger[_0x3417('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x76925a);throw _0x76925a;});}return _0x1e2582;})[_0x3417('0x17')](respondWithResult(_0x3ad105,0xc9))['catch'](handleError(_0x3ad105,null));};exports[_0x3417('0x2c')]=function(_0x386f32,_0x52ee89){if(!wildcardUtils[_0x3417('0x6f')](_0x386f32[_0x3417('0x66')][_0x3417('0x67')])){return handleError(_0x52ee89,null)(new APIBadRequestError('\x22'+_0x386f32[_0x3417('0x66')][_0x3417('0x67')]+_0x3417('0x68')));}if(_0x386f32['body']['id']){delete _0x386f32[_0x3417('0x66')]['id'];}return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x386f32[_0x3417('0x70')]['id']},'include':[{'model':db[_0x3417('0x49')],'as':'mandatoryDispositionPause'}]})[_0x3417('0x17')](handleEntityNotFound(_0x52ee89,null))[_0x3417('0x17')](saveUpdates(_0x386f32[_0x3417('0x66')],null))[_0x3417('0x17')](respondWithResult(_0x52ee89,null))['catch'](handleError(_0x52ee89,null));};exports[_0x3417('0x2f')]=function(_0x2be3c7,_0xdd055c){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x2be3c7[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0xdd055c,null))[_0x3417('0x17')](removeEntity(_0xdd055c,null))['catch'](handleError(_0xdd055c,null));};exports[_0x3417('0x71')]=function(_0x14febb,_0x1c1013){return db[_0x3417('0x4c')]['describe']()[_0x3417('0x17')](respondWithResult(_0x1c1013,null))['catch'](handleError(_0x1c1013,null));};exports['addDisposition']=function(_0x13b7c6,_0x3b5c5d){if(_0x13b7c6[_0x3417('0x66')]['id']){delete _0x13b7c6[_0x3417('0x66')]['id'];}return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x13b7c6[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x3b5c5d,null))[_0x3417('0x17')](function(_0x3a9d1c){if(_0x3a9d1c){_0x13b7c6[_0x3417('0x66')][_0x3417('0x72')]=_0x3a9d1c['id'];return db[_0x3417('0x73')][_0x3417('0x65')](_0x13b7c6[_0x3417('0x66')]);}})[_0x3417('0x17')](respondWithResult(_0x3b5c5d,null))['catch'](handleError(_0x3b5c5d,null));};exports[_0x3417('0x74')]=function(_0x1d990d,_0x1ad84a){var _0x5b7e25={'raw':![],'where':{}};var _0x3b9d56={};var _0x20bdca={'count':0x0,'rows':[]};return db[_0x3417('0x4c')][_0x3417('0x75')]({'where':{'id':_0x1d990d['params']['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x1ad84a,null))[_0x3417('0x17')](function(_0x386020){if(_0x386020){_0x3b9d56[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0x73')][_0x3417('0x4d')]);_0x3b9d56['query']=_[_0x3417('0x51')](_0x1d990d[_0x3417('0x50')]);_0x3b9d56[_0x3417('0x52')]=_[_0x3417('0x53')](_0x3b9d56[_0x3417('0x45')],_0x3b9d56[_0x3417('0x50')]);_0x5b7e25[_0x3417('0x54')]=_['intersection'](_0x3b9d56['model'],qs[_0x3417('0x55')](_0x1d990d['query'][_0x3417('0x55')]));_0x5b7e25[_0x3417('0x54')]=_0x5b7e25[_0x3417('0x54')][_0x3417('0x61')]?_0x5b7e25['attributes']:_0x3b9d56[_0x3417('0x45')];if(!_0x1d990d[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x5b7e25[_0x3417('0x28')]=qs['limit'](_0x1d990d['query']['limit']);_0x5b7e25['offset']=qs[_0x3417('0x26')](_0x1d990d[_0x3417('0x50')]['offset']);}_0x5b7e25[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x1d990d[_0x3417('0x50')]['sort']);_0x5b7e25[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x1d990d[_0x3417('0x50')],_0x3b9d56['filters']));_0x5b7e25[_0x3417('0x59')][_0x3417('0x72')]=_0x386020['id'];if(_0x1d990d[_0x3417('0x50')][_0x3417('0x5b')]){_0x5b7e25[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x5b7e25['where'],{'$or':_['map'](_0x5b7e25[_0x3417('0x54')],function(_0xd581b3){var _0x521c78={};_0x521c78[_0xd581b3]={'$like':'%'+_0x1d990d['query'][_0x3417('0x5b')]+'%'};return _0x521c78;})});}_0x5b7e25=_[_0x3417('0x5d')]({},_0x5b7e25,_0x1d990d[_0x3417('0x5e')]);return db[_0x3417('0x73')][_0x3417('0x29')]({'where':_0x5b7e25[_0x3417('0x59')]})[_0x3417('0x17')](function(_0x302685){_0x20bdca[_0x3417('0x29')]=_0x302685;if(_0x1d990d[_0x3417('0x50')][_0x3417('0x62')]){_0x5b7e25[_0x3417('0x63')]=[{'all':!![]}];}return db['Disposition'][_0x3417('0x5f')](_0x5b7e25);})[_0x3417('0x17')](function(_0x1a205b){_0x20bdca['rows']=_0x1a205b;return _0x20bdca;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x1ad84a,_0x5b7e25))[_0x3417('0x21')](handleError(_0x1ad84a,null));};exports[_0x3417('0x77')]=function(_0x2c2c37,_0x1b9b07){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x2c2c37[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x1b9b07,null))[_0x3417('0x17')](function(_0x19370d){if(_0x19370d){return _0x19370d[_0x3417('0x77')](_0x2c2c37[_0x3417('0x50')][_0x3417('0x78')]);}})['then'](respondWithStatusCode(_0x1b9b07,null))[_0x3417('0x21')](handleError(_0x1b9b07,null));};exports[_0x3417('0x79')]=function(_0x1b5c11,_0x48d0c5){if(_0x1b5c11['body']['id']){delete _0x1b5c11['body']['id'];}return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x1b5c11[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x48d0c5,null))['then'](function(_0x4cab53){if(_0x4cab53){_0x1b5c11[_0x3417('0x66')]['ChatWebsiteId']=_0x4cab53['id'];return db['CannedAnswer'][_0x3417('0x65')](_0x1b5c11['body']);}})[_0x3417('0x17')](respondWithResult(_0x48d0c5,null))[_0x3417('0x21')](handleError(_0x48d0c5,null));};exports[_0x3417('0x7a')]=function(_0x20aa81,_0x44e305){var _0x2d4b18={'raw':![],'where':{}};var _0x17e655={};var _0x15836c={'count':0x0,'rows':[]};return db[_0x3417('0x4c')]['findOne']({'where':{'id':_0x20aa81[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x44e305,null))[_0x3417('0x17')](function(_0x26d8f7){if(_0x26d8f7){_0x17e655['model']=_[_0x3417('0x51')](db[_0x3417('0x7b')]['rawAttributes']);_0x17e655[_0x3417('0x50')]=_['keys'](_0x20aa81[_0x3417('0x50')]);_0x17e655['filters']=_[_0x3417('0x53')](_0x17e655['model'],_0x17e655[_0x3417('0x50')]);_0x2d4b18[_0x3417('0x54')]=_[_0x3417('0x53')](_0x17e655['model'],qs[_0x3417('0x55')](_0x20aa81['query'][_0x3417('0x55')]));_0x2d4b18[_0x3417('0x54')]=_0x2d4b18[_0x3417('0x54')][_0x3417('0x61')]?_0x2d4b18[_0x3417('0x54')]:_0x17e655[_0x3417('0x45')];if(!_0x20aa81[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x2d4b18[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x20aa81['query'][_0x3417('0x28')]);_0x2d4b18['offset']=qs[_0x3417('0x26')](_0x20aa81['query'][_0x3417('0x26')]);}_0x2d4b18[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x20aa81['query']['sort']);_0x2d4b18['where']=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x20aa81[_0x3417('0x50')],_0x17e655['filters']));_0x2d4b18['where'][_0x3417('0x72')]=_0x26d8f7['id'];if(_0x20aa81['query'][_0x3417('0x5b')]){_0x2d4b18[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x2d4b18[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0x2d4b18['attributes'],function(_0x5030a6){var _0x74c1d1={};_0x74c1d1[_0x5030a6]={'$like':'%'+_0x20aa81[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x74c1d1;})});}_0x2d4b18=_[_0x3417('0x5d')]({},_0x2d4b18,_0x20aa81[_0x3417('0x5e')]);return db[_0x3417('0x7b')][_0x3417('0x29')]({'where':_0x2d4b18[_0x3417('0x59')]})[_0x3417('0x17')](function(_0x4f1916){_0x15836c[_0x3417('0x29')]=_0x4f1916;if(_0x20aa81[_0x3417('0x50')][_0x3417('0x62')]){_0x2d4b18[_0x3417('0x63')]=[{'all':!![]}];}return db[_0x3417('0x7b')][_0x3417('0x5f')](_0x2d4b18);})['then'](function(_0x5a7e63){_0x15836c[_0x3417('0x60')]=_0x5a7e63;return _0x15836c;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x44e305,_0x2d4b18))[_0x3417('0x21')](handleError(_0x44e305,null));};exports[_0x3417('0x7c')]=function(_0x357092,_0x28847f){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x357092[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x28847f,null))['then'](function(_0x3ee990){if(_0x3ee990){return _0x3ee990[_0x3417('0x7c')](_0x357092[_0x3417('0x50')][_0x3417('0x78')]);}})[_0x3417('0x17')](respondWithStatusCode(_0x28847f,null))['catch'](handleError(_0x28847f,null));};exports[_0x3417('0x7d')]=function(_0x44dd64,_0x32cdc4){_0x44dd64[_0x3417('0x66')][_0x3417('0x7e')]=_0x44dd64[_0x3417('0x7f')][_0x3417('0x80')];return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x44dd64[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x32cdc4,null))[_0x3417('0x17')](saveUpdates(_0x44dd64[_0x3417('0x66')],null))[_0x3417('0x17')](respondWithResult(_0x32cdc4,null))['catch'](handleError(_0x32cdc4,null));};exports['addAvatar']=function(_0x548c3a,_0x3d87d2){_0x548c3a[_0x3417('0x66')][_0x3417('0x81')]=_0x548c3a[_0x3417('0x7f')][_0x3417('0x80')];return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x548c3a[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x3d87d2,null))['then'](saveUpdates(_0x548c3a[_0x3417('0x66')],null))[_0x3417('0x17')](respondWithResult(_0x3d87d2,null))[_0x3417('0x21')](handleError(_0x3d87d2,null));};exports[_0x3417('0x82')]=function(_0x1d847f,_0x226e0d){_0x1d847f['body']['customerAvatar']=_0x1d847f[_0x3417('0x7f')][_0x3417('0x80')];return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x1d847f[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x226e0d,null))[_0x3417('0x17')](saveUpdates(_0x1d847f['body'],null))['then'](respondWithResult(_0x226e0d,null))['catch'](handleError(_0x226e0d,null));};exports[_0x3417('0x83')]=function(_0x3e70e9,_0xbac790){_0x3e70e9[_0x3417('0x66')][_0x3417('0x84')]=_0x3e70e9[_0x3417('0x7f')][_0x3417('0x80')];return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x3e70e9[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0xbac790,null))[_0x3417('0x17')](saveUpdates(_0x3e70e9['body'],null))[_0x3417('0x17')](respondWithResult(_0xbac790,null))[_0x3417('0x21')](handleError(_0xbac790,null));};exports[_0x3417('0x85')]=function(_0x2b2a28,_0x36e936){var _0x4dd3d8=path[_0x3417('0x86')](config['root'],'server/files/images/logos/default_logo.svg');var _0x4dcca1={'where':{'id':_0x2b2a28[_0x3417('0x70')]['id']},'attributes':['id',_0x3417('0x7e')],'raw':!![]};var _0x38be10=![];return require(_0x3417('0x87'))[_0x3417('0x88')]()['then'](function(_0x356073){if(_0x356073){_0x38be10=_0x356073[_0x3417('0x89')];}})[_0x3417('0x17')](function(){return db[_0x3417('0x4c')][_0x3417('0x64')](_0x4dcca1);})[_0x3417('0x17')](handleEntityNotFound(_0x36e936,null))[_0x3417('0x17')](function(_0x37dca2){if(_0x37dca2){if(!_[_0x3417('0x8a')](_0x37dca2[_0x3417('0x7e')])){if(fs[_0x3417('0x8b')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x8d'),_0x37dca2[_0x3417('0x7e')]))&&_0x38be10){_0x4dd3d8=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x8d'),_0x37dca2[_0x3417('0x7e')]);}}return _0x36e936[_0x3417('0x8e')](_0x4dd3d8);}})[_0x3417('0x21')](handleError(_0x36e936,null));};exports[_0x3417('0x8f')]=function(_0x2940c1,_0x3bd900){var _0x993fa7=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x90'));var _0x491b4c={'where':{'id':_0x2940c1[_0x3417('0x70')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x3417('0x4c')][_0x3417('0x64')](_0x491b4c)['then'](handleEntityNotFound(_0x3bd900,null))['then'](function(_0x58e45d){if(_0x58e45d){if(!_[_0x3417('0x8a')](_0x58e45d[_0x3417('0x81')])){if(fs[_0x3417('0x8b')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x58e45d['agentAvatar']))){_0x993fa7=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x58e45d[_0x3417('0x81')]);}}return _0x3bd900[_0x3417('0x8e')](_0x993fa7);}})[_0x3417('0x21')](handleError(_0x3bd900,null));};exports[_0x3417('0x92')]=function(_0x278ac6,_0x57a96d){var _0x59ed34=path[_0x3417('0x86')](config[_0x3417('0x8c')],'server/files/images/avatars/customer_avatar.png');var _0x37845d={'where':{'id':_0x278ac6[_0x3417('0x70')]['id']},'attributes':['id',_0x3417('0x93'),'showCustomerAvatar'],'raw':!![]};return db[_0x3417('0x4c')][_0x3417('0x64')](_0x37845d)[_0x3417('0x17')](handleEntityNotFound(_0x57a96d,null))[_0x3417('0x17')](function(_0x469529){if(_0x469529){if(!_[_0x3417('0x8a')](_0x469529[_0x3417('0x93')])){if(fs[_0x3417('0x8b')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x469529['customerAvatar']))&&_0x469529[_0x3417('0x94')]){_0x59ed34=path[_0x3417('0x86')](config['root'],_0x3417('0x91'),_0x469529[_0x3417('0x93')]);}}return _0x57a96d[_0x3417('0x8e')](_0x59ed34);}})['catch'](handleError(_0x57a96d,null));};exports[_0x3417('0x95')]=function(_0x4c3eec,_0x1aa3cd){var _0xbcd2de=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x96'));var _0x4eefe1={'where':{'id':_0x4c3eec[_0x3417('0x70')]['id']},'attributes':['id',_0x3417('0x84')],'raw':!![]};return db[_0x3417('0x4c')][_0x3417('0x64')](_0x4eefe1)[_0x3417('0x17')](handleEntityNotFound(_0x1aa3cd,null))[_0x3417('0x17')](function(_0x492b27){if(_0x492b27){if(!_[_0x3417('0x8a')](_0x492b27['systemAvatar'])){if(fs[_0x3417('0x8b')](path['join'](config[_0x3417('0x8c')],_0x3417('0x91'),_0x492b27['systemAvatar']))){_0xbcd2de=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x492b27[_0x3417('0x84')]);}}return _0x1aa3cd[_0x3417('0x8e')](_0xbcd2de);}})[_0x3417('0x21')](handleError(_0x1aa3cd,null));};function checkWebsiteInterval(_0x3c615d){var _0x1ef61=_0x3c615d[_0x3417('0x97')];if(!_0x1ef61){return Promise['resolve'](_0x3c615d);}var _0x2157e2=_0x3c615d['timezone']||undefined;return _0x1ef61[_0x3417('0x98')](_0x2157e2)[_0x3417('0x17')](function(_0x543846){if(!_0x543846){throw new APIOutOfIntervalError();}return _0x3c615d;});}exports['notify']=function(_0x1ae5d7,_0x18f3ad){var _0x1bc3c2={'body':_0x1ae5d7[_0x3417('0x66')],'channel':'chat'};var _0xbb8c34=[];var _0x249c53=[];var _0x314f6f={};var _0x4bd9a6=![];if(_0x1ae5d7[_0x3417('0x66')]['id']){delete _0x1ae5d7[_0x3417('0x66')]['id'];}if(_[_0x3417('0x8a')](_0x1ae5d7[_0x3417('0x66')]['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x3417('0x8a')](_0x1ae5d7[_0x3417('0x66')][_0x3417('0x99')])){throw new APIBadRequestError(_0x3417('0x9a'));}if(_[_0x3417('0x9b')](_0x1ae5d7[_0x3417('0x66')][_0x3417('0x66')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x48a1ba=_0x1ae5d7[_0x3417('0x66')]['customerIp']&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0x3e')];return db['CmContact'][_0x3417('0x71')]()['then'](function(_0x4c37f5){if(!_0x4c37f5){throw new Error(_0x3417('0x9c'));}_0xbb8c34=Object[_0x3417('0x51')](_0x4c37f5)[_0x3417('0x5b')](function(_0x5bf874){return![_0x3417('0x9d'),_0x3417('0x9e')]['includes'](_0x5bf874);});_0x249c53=Object['keys'](_0x4c37f5)[_0x3417('0x5b')](function(_0x4c29dd){return!['createdAt',_0x3417('0x9e'),_0x3417('0x9f'),_0x3417('0xa0')][_0x3417('0xa1')](_0x4c29dd);});if(!_['includes'](_0x249c53,_0x1ae5d7[_0x3417('0x66')][_0x3417('0x99')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x249c53['join'](',\x20'));}_0x314f6f[_0x1ae5d7[_0x3417('0x66')][_0x3417('0x99')]]=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xa2')];})[_0x3417('0x17')](function(){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x1ae5d7[_0x3417('0x70')]['id']},'include':[{'model':db[_0x3417('0xa3')],'as':'List','include':[{'model':db[_0x3417('0xa4')],'as':_0x3417('0xa5'),'where':_0x314f6f,'limit':0x1,'order':[[_0x3417('0x9e'),_0x3417('0xa6')]]}]},{'model':db[_0x3417('0xa7')],'as':_0x3417('0xa8')},{'model':db[_0x3417('0x97')],'as':'Interval','include':[{'model':db[_0x3417('0x97')],'as':_0x3417('0xa9'),'attributes':['id',_0x3417('0xaa')],'raw':!![]}]}]});})[_0x3417('0x17')](function(_0x5a953d){if(!_0x5a953d){throw new APINotFoundError(util[_0x3417('0x41')](_0x3417('0xab'),_0x1ae5d7[_0x3417('0x70')]['id']));}if(_0x48a1ba){return checkWebsiteInterval(_0x5a953d);}return _0x5a953d;})[_0x3417('0x17')](function(_0x2e098f){_0x1bc3c2[_0x3417('0xac')]=_0x2e098f;_0x1bc3c2[_0x3417('0xad')]=_[_0x3417('0xae')](_0x2e098f[_0x3417('0xa8')],['priority'],[_0x3417('0xaf')]);if(_0x1bc3c2[_0x3417('0xac')]['Applications']){delete _0x1bc3c2[_0x3417('0xac')][_0x3417('0xa8')];}_0x1bc3c2[_0x3417('0xb0')]=_0x2e098f[_0x3417('0xb1')]||{'id':_0x2e098f[_0x3417('0xa0')]};if(_0x1bc3c2[_0x3417('0xb0')]&&_0x1bc3c2['list'][_0x3417('0xa5')][_0x3417('0x61')]){return _0x1bc3c2[_0x3417('0xb0')][_0x3417('0xa5')][0x0];}var _0x5c621e=_[_0x3417('0x12')](_0x1ae5d7[_0x3417('0x66')],{'firstName':_0x1ae5d7[_0x3417('0x66')]['from'],'ListId':_0x2e098f[_0x3417('0xa0')]});_0x5c621e[_0x1ae5d7[_0x3417('0x66')]['mapKey']]=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xa2')];return db[_0x3417('0xa4')][_0x3417('0x65')](_0x5c621e,{'fields':_0xbb8c34,'raw':!![]});})[_0x3417('0x17')](function(_0x1ece3d){_0x1bc3c2[_0x3417('0xb2')]=_0x1ece3d;var _0x2232b1=createInteractionObject(_0x1ae5d7[_0x3417('0x70')]['id'],_0x1ae5d7[_0x3417('0x66')],_0x1ae5d7[_0x3417('0xb3')],_0x1ece3d);var _0x16c61d={'ChatWebsiteId':_0x1ae5d7[_0x3417('0x70')]['id']};if(_0x1ae5d7[_0x3417('0x66')]['threadId']){_0x16c61d[_0x3417('0xb4')]=_0x1ae5d7['body'][_0x3417('0xb4')];_0x16c61d[_0x3417('0xb5')]=![];return db[_0x3417('0xb6')][_0x3417('0x64')]({'where':_0x16c61d})[_0x3417('0x17')](function(_0x1233b1){if(_0x1233b1){_0x4bd9a6=!![];return _0x1233b1;}else if(!_0x48a1ba&&_0x1233b1&&_0x1233b1[_0x3417('0xb5')]){throw new APIConflictError(_0x3417('0xb7'));}_0x2232b1[_0x3417('0xb4')]=_0x1ae5d7[_0x3417('0x66')]['threadId'];_0x2232b1['externalUrl']=_0x1ae5d7[_0x3417('0x66')]['externalUrl'];return db[_0x3417('0xb6')]['create'](_0x2232b1);});}_0x16c61d[_0x3417('0xb8')]=_0x1ece3d['id'];if(_0x1ae5d7[_0x3417('0x66')]['interaction']&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb9')]['id']){_0x16c61d['id']=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb9')]['id'];return db[_0x3417('0xb6')][_0x3417('0x64')]({'where':_0x16c61d})['then'](function(_0x3ab6fb){var _0x4ebf0a=_0x1ae5d7[_0x3417('0x66')]['customerIp']&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0x3e')];if(!_0x4ebf0a&&_0x3ab6fb&&_0x3ab6fb[_0x3417('0xb5')]){throw new APIConflictError(_0x3417('0xb7'));}else if(_0x3ab6fb){_0x4bd9a6=!![];return _0x3ab6fb;}else{return db['ChatInteraction'][_0x3417('0x65')](_0x2232b1);}});}return db['ChatInteraction'][_0x3417('0x65')](_0x2232b1);})['then'](function(_0x3a6c45){if(!_0x4bd9a6){return _0x3a6c45;}var _0x2a144f={'from':(_0x1bc3c2[_0x3417('0xb2')]['firstName']||'')+'\x20'+(_0x1bc3c2[_0x3417('0xb2')][_0x3417('0x3c')]||'')};if(_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb4')]&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0xba')]&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb4')]!=_0x1ae5d7[_0x3417('0x66')]['messageId']){_0x2a144f['threadId']=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xba')];}return _0x3a6c45[_0x3417('0x2c')](_0x2a144f);})[_0x3417('0x17')](function(_0x38e149){_0x1bc3c2[_0x3417('0xb9')]=_0x38e149[_0x3417('0x2d')]({'plain':!![]});_0x1bc3c2['interaction'][_0x3417('0xbb')]=!_0x4bd9a6;if(_0x1bc3c2[_0x3417('0xb9')]['created']){if(_0x1bc3c2[_0x3417('0xac')][_0x3417('0xbc')]){_0x1bc3c2[_0x3417('0xad')][_0x3417('0xbd')]({'id':0x0,'priority':_0x1bc3c2['applications'][_0x3417('0x61')]+0x1,'app':_0x3417('0xbe'),'appdata':'unmanaged','interval':_0x3417('0xbf')});}}return db[_0x3417('0xc0')][_0x3417('0x65')]({'body':_0x1ae5d7[_0x3417('0x66')]['body'],'ChatWebsiteId':_0x1ae5d7[_0x3417('0x70')]['id'],'ChatInteractionId':_0x38e149['id'],'direction':'in','ContactId':_0x1bc3c2[_0x3417('0xb2')]['id'],'AttachmentId':_0x1ae5d7[_0x3417('0x66')][_0x3417('0xc1')]});})['then'](function(_0x3f68c6){_0x1bc3c2[_0x3417('0x1f')]=_0x3f68c6;if(!_0x1bc3c2[_0x3417('0xb9')][_0x3417('0xc2')]){return;}return db[_0x3417('0xc3')][_0x3417('0x64')]({'attributes':['id',_0x3417('0x31')],'where':{'id':_0x1bc3c2[_0x3417('0xb9')][_0x3417('0xc2')]}});})['then'](function(_0x401ccb){if(_0x401ccb){_0x1bc3c2[_0x3417('0xad')][_0x3417('0xc4')]({'id':0x0,'priority':0x0,'app':_0x3417('0xc5'),'appdata':_0x401ccb[_0x3417('0x31')]+','+(_0x1bc3c2[_0x3417('0xac')][_0x3417('0xc6')]||0xa),'interval':_0x3417('0xbf')});_0x1bc3c2[_0x3417('0xc7')]=!![];}if(!_0x1bc3c2['interaction']['queueId']){return;}return db[_0x3417('0xc8')][_0x3417('0x64')]({'attributes':['id',_0x3417('0x31')],'where':{'id':_0x1bc3c2[_0x3417('0xb9')][_0x3417('0xc9')]}});})[_0x3417('0x17')](function(_0x42cf7e){if(_0x42cf7e){_0x1bc3c2[_0x3417('0xad')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x42cf7e[_0x3417('0x31')]+','+(_0x1bc3c2[_0x3417('0xac')][_0x3417('0xca')]||0x12c),'interval':_0x3417('0xbf')});}return respondWithRpcPromise(_0x3417('0xcb'),_0x3417('0xcc'),_0x1bc3c2);})['then'](function(_0x434d24){respondWithRpcPromise('EventManager',_0x3417('0xcd'),{'event':_0x3417('0xce'),'message':_0x434d24},client9002);return _0x434d24;})[_0x3417('0x17')](respondWithResult(_0x18f3ad,null))[_0x3417('0x21')](APIHandleError(_0x18f3ad));};exports['offline']=function(_0x19834a,_0x3e5a38){var _0x388d8b,_0x378e1d,_0xaf54b8;var _0x3b2d64=[];var _0x4da1c5={};var _0x39b32f=_0x19834a[_0x3417('0xcf')]||[];var _0xc27193=[];var _0x12e05a;return db['CmContact'][_0x3417('0x71')]()['then'](function(_0x297b47){if(!_0x297b47){throw new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd2'));}_0x3b2d64=_[_0x3417('0xd3')](_[_0x3417('0x51')](_0x297b47),['createdAt','updatedAt','CompanyId',_0x3417('0xa0')]);if(_0x19834a[_0x3417('0x66')]['id']){delete _0x19834a[_0x3417('0x66')]['id'];}if(_['isNil'](_0x19834a[_0x3417('0x66')][_0x3417('0xa2')])){throw _0x3e5a38[_0x3417('0x23')](0x1f4)[_0x3417('0x32')](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd4')));}if(_[_0x3417('0x8a')](_0x19834a[_0x3417('0x66')][_0x3417('0x66')])||_0x19834a['body'][_0x3417('0x66')]===''){throw _0x3e5a38[_0x3417('0x23')](0x1f4)['send'](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd5')));}if(_['isNil'](_0x19834a[_0x3417('0x66')]['mapKeyOffline'])){throw _0x3e5a38[_0x3417('0x23')](0x1f4)['send'](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd6')+_0x3b2d64));}if(!_[_0x3417('0xa1')](_0x3b2d64,_0x19834a[_0x3417('0x66')]['mapKeyOffline'])){throw _0x3e5a38[_0x3417('0x23')](0x1f4)[_0x3417('0x32')](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b2d64));}_0x4da1c5[_0x19834a[_0x3417('0x66')][_0x3417('0xd7')]]=_0x19834a[_0x3417('0x66')][_0x3417('0xa2')];})[_0x3417('0x17')](function(){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x19834a[_0x3417('0x70')]['id']},'include':[{'model':db[_0x3417('0xa3')],'as':_0x3417('0xb1')},{'model':db[_0x3417('0xd8')],'as':_0x3417('0xd8')}]});})['then'](handleEntityNotFound(_0x3e5a38,null))['then'](function(_0x4a154b){if(_0x4a154b&&_0x4a154b['List']){_0x378e1d=_0x4a154b;var _0x142225=_[_0x3417('0x12')](_0x19834a[_0x3417('0x66')],{'firstName':_0x19834a[_0x3417('0x66')][_0x3417('0xa2')],'phone':_0x19834a[_0x3417('0x66')][_0x3417('0xa2')],'ListId':_0x4a154b['ListId']});_0x142225[_0x19834a[_0x3417('0x66')]['mapKeyOffline']]=_0x19834a[_0x3417('0x66')][_0x3417('0xa2')];return db[_0x3417('0xa4')]['findOrCreate']({'where':_0x4da1c5,'defaults':_0x142225});}})[_0x3417('0xd9')](function(_0x5cb569){if(_0x5cb569){_0xaf54b8=_0x5cb569;var _0x186960=fs[_0x3417('0xda')](path[_0x3417('0x86')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x3417('0xdb'));var _0x2fc255=ejs['render'](_0x186960,{'body':_['toPairs'](_0x19834a[_0x3417('0x66')]['body']),'bodyTitle':_0x378e1d[_0x3417('0xdc')]});return db['ChatOfflineMessage']['create']({'body':_0x2fc255,'plainBody':htmlToText[_0x3417('0xdd')](_0x2fc255),'ContactId':_0x5cb569['id'],'ChatWebsiteId':_0x378e1d['id']});}})[_0x3417('0x17')](function(_0xa3aa2a){_0x12e05a=_0xa3aa2a;if(_0x39b32f[_0x3417('0x61')]){var _0x49b8a6=_0x39b32f[_0x3417('0x4b')](function(_0x4895eb){return{'name':_0x4895eb[_0x3417('0xde')],'basename':_0x4895eb[_0x3417('0x80')],'type':_0x4895eb[_0x3417('0xdf')],'ChatOfflineMessageId':_0xa3aa2a['id']};});_0xc27193=_0x49b8a6[_0x3417('0x4b')](_0x5018d8=>{var _0x247300={'filename':_0x5018d8[_0x3417('0x31')],'path':path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0xe0'),_0x3417('0xcf'),_0x3417('0xe1'),'offline-chat',_0x5018d8[_0x3417('0xe2')])};return _0x247300;});if(!_0x378e1d['openNewInteraction']){return db[_0x3417('0xe3')][_0x3417('0xe4')](function(_0x207f61){return db[_0x3417('0xe5')][_0x3417('0xe6')](_0x49b8a6,{'transaction':_0x207f61});});}}})[_0x3417('0x17')](function(){if(_0x12e05a){_0x388d8b=_0x12e05a;return db[_0x3417('0xd8')][_0x3417('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0x3417('0xe7')],'as':_0x3417('0xe8'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x3417('0xe9'),'raw':!![]}]}]});}})['then'](function(_0x40c991){if(_0x40c991&&_0x40c991[_0x3417('0xe8')]&&_0x378e1d[_0x3417('0xea')]&&_0x378e1d['forwardOfflineAddress']){var _0x1b97c0=_0x40c991[_0x3417('0xeb')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1b97c0,'message':{'from':util[_0x3417('0x41')]('\x22%s\x22\x20<%s>',_0x40c991['name'],_0x40c991['email']||_0x40c991[_0x3417('0xe8')][_0x3417('0x6b')]),'to':_0x378e1d[_0x3417('0xec')],'subject':_0x378e1d[_0x3417('0xed')],'html':_0x388d8b[_0x3417('0x66')],'attachments':_0xc27193}},client9003)[_0x3417('0x17')](function(){return _0x388d8b;})[_0x3417('0x21')](function(_0x2bb8e2){logger[_0x3417('0x1d')](_0x2bb8e2);});}})[_0x3417('0x17')](function(){if(_0x378e1d&&_0x378e1d[_0x3417('0xee')]&&_0x378e1d[_0x3417('0xef')]){var _0x1ba490=[];if(_0x39b32f[_0x3417('0x61')]){_0x1ba490=_0x39b32f['map'](function(_0x534671){return{'name':_0x534671[_0x3417('0xde')],'basename':_0x534671[_0x3417('0x80')],'type':_0x534671[_0x3417('0xdf')],'ChatOfflineMessageId':_0x12e05a['id']};});}var _0x3889ac;if(!_[_0x3417('0x8a')](_0x378e1d[_0x3417('0xf0')])){var _0x23991d=_['map'](_0x19834a[_0x3417('0x66')],function(_0xd04d99){return _0xd04d99;});var _0x6e1236=_[_0x3417('0xf1')](_0x23991d)[0x0];var _0x11ae9b=_[_0x3417('0xf2')](_0x6e1236,function(_0x2abf7f){return _0x2abf7f;});_0x3889ac=_0x11ae9b[0x1][_0x378e1d[_0x3417('0xf0')]];}var _0x1c64e7={'from':_0xaf54b8['email'],'firstName':_0xaf54b8[_0x3417('0x3b')],'lastName':_0xaf54b8[_0x3417('0x3c')],'mapKey':_0x3417('0xf3'),'message':{'from':_0xaf54b8[_0x3417('0xf3')],'to':_0x378e1d[_0x3417('0xd8')][_0x3417('0xf3')],'cc':'','subject':_[_0x3417('0x8a')](_0x3889ac)?_0x378e1d[_0x3417('0xed')]:_0x3889ac,'messageId':'','sentAt':new Date(),'attach':_0x1ba490[_0x3417('0x61')],'attachments':_0x1ba490,'originChannel':'Chat','ChatWebsiteId':_0x378e1d['id'],'ChatOfflineMessageId':_0x388d8b['id'],'originTo':_0x378e1d[_0x3417('0xd8')][_0x3417('0xf3')]},'body':_0x388d8b[_0x3417('0x66')]};var _0x3b8492={'account':{'id':_0x378e1d['MailAccountId']},'body':_0x1c64e7,'log':_0x3417('0xf4')};return respondWithRpcPromise(_0x3417('0xf4'),_0x3417('0xf5'),_0x3b8492,client9001)['then'](function(){return _0x388d8b;})[_0x3417('0x21')](function(_0x4f152d){logger[_0x3417('0x1d')](_0x4f152d);});}return;})['then'](function(){if(_0x388d8b){return _0x388d8b;}})[_0x3417('0x17')](respondWithResult(_0x3e5a38,null))[_0x3417('0x21')](function(){for(var _0x2654dc of _0x39b32f){var _0x3167fa=path[_0x3417('0x86')](config[_0x3417('0x8c')],'server','files',_0x3417('0xe1'),'offline-chat',_0x2654dc[_0x3417('0x80')]);fs_extra[_0x3417('0xf6')](_0x3167fa)['catch'](function(_0x4cc9e2){logger[_0x3417('0x1d')](_0x3417('0xf7'),_0x3167fa,_0x4cc9e2);});}});};exports['addInteraction']=function(_0x5f3af6,_0x12b4f8){return db['ChatInteraction'][_0x3417('0x64')]({'where':{'id':_0x5f3af6[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x12b4f8,null))[_0x3417('0x17')](function(_0x1b3276){if(_0x1b3276){return _0x1b3276[_0x3417('0xf8')](_0x5f3af6[_0x3417('0x66')][_0x3417('0x78')],_[_0x3417('0xf9')](_0x5f3af6[_0x3417('0x66')],[_0x3417('0x78'),'id'])||{});}})[_0x3417('0x17')](respondWithResult(_0x12b4f8,null))[_0x3417('0x21')](handleError(_0x12b4f8,null));};exports[_0x3417('0xfa')]=function(_0x4a258f,_0x1c244c){var _0x52fd2a={'raw':![],'where':{}};var _0x3e6bf9={};var _0x3217cf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3417('0x75')]({'where':{'id':_0x4a258f[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x1c244c,null))[_0x3417('0x17')](function(_0x4a95c0){if(_0x4a95c0){_0x3e6bf9[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0xb6')][_0x3417('0x4d')]);_0x3e6bf9[_0x3417('0x50')]=_[_0x3417('0x51')](_0x4a258f[_0x3417('0x50')]);_0x3e6bf9[_0x3417('0x52')]=_[_0x3417('0x53')](_0x3e6bf9[_0x3417('0x45')],_0x3e6bf9[_0x3417('0x50')]);_0x52fd2a[_0x3417('0x54')]=_[_0x3417('0x53')](_0x3e6bf9[_0x3417('0x45')],qs['fields'](_0x4a258f[_0x3417('0x50')][_0x3417('0x55')]));_0x52fd2a[_0x3417('0x54')]=_0x52fd2a[_0x3417('0x54')]['length']?_0x52fd2a['attributes']:_0x3e6bf9[_0x3417('0x45')];if(!_0x4a258f['query'][_0x3417('0x56')]('nolimit')){_0x52fd2a[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x4a258f[_0x3417('0x50')][_0x3417('0x28')]);_0x52fd2a[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x4a258f[_0x3417('0x50')][_0x3417('0x26')]);}_0x52fd2a[_0x3417('0x57')]=qs['sort'](_0x4a258f[_0x3417('0x50')][_0x3417('0x58')]);_0x52fd2a['where']=qs['filters'](_[_0x3417('0x5a')](_0x4a258f[_0x3417('0x50')],_0x3e6bf9[_0x3417('0x52')]));_0x52fd2a[_0x3417('0x59')][_0x3417('0x72')]=_0x4a95c0['id'];if(_0x4a258f[_0x3417('0x50')][_0x3417('0x5b')]){_0x52fd2a[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x52fd2a[_0x3417('0x59')],{'$or':_['map'](_0x52fd2a['attributes'],function(_0x35a9f6){var _0x5f91b5={};_0x5f91b5[_0x35a9f6]={'$like':'%'+_0x4a258f[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x5f91b5;})});}_0x52fd2a=_[_0x3417('0x5d')]({},_0x52fd2a,_0x4a258f[_0x3417('0x5e')]);return db[_0x3417('0xb6')][_0x3417('0x29')]({'where':_0x52fd2a['where']})[_0x3417('0x17')](function(_0x2d0d52){_0x3217cf[_0x3417('0x29')]=_0x2d0d52;if(_0x4a258f[_0x3417('0x50')][_0x3417('0x62')]){_0x52fd2a[_0x3417('0x63')]=[{'model':db['CmContact'],'as':_0x3417('0xfb'),'required':![]},{'model':db[_0x3417('0xc3')],'as':_0x3417('0xfc'),'attributes':[_0x3417('0x31'),_0x3417('0xfd'),_0x3417('0xfe')],'required':![]},{'model':db['Tag'],'as':_0x3417('0xff'),'attributes':['id',_0x3417('0x31'),_0x3417('0x100')],'where':_0x4a258f['query'][_0x3417('0x101')]?{'id':_0x4a258f['query']['tag']}:undefined,'required':_0x4a258f[_0x3417('0x50')][_0x3417('0x101')]?!![]:![]}];}return db[_0x3417('0xb6')][_0x3417('0x5f')](_0x52fd2a);})['then'](function(_0x5cdf0c){_0x3217cf[_0x3417('0x60')]=_0x5cdf0c;return _0x3217cf;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x1c244c,_0x52fd2a))[_0x3417('0x21')](handleError(_0x1c244c,null));};exports[_0x3417('0x102')]=function(_0x28278c,_0x3a5272){var _0x51f9a2=0x0;var _0x2600bb=0x0;var _0x214a5b=![];var _0x2e9c6d;var _0x169abf;return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x28278c[_0x3417('0x70')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x3417('0x97')],'as':'Intervals','attributes':['id',_0x3417('0xaa')]}]}]})['then'](handleEntityNotFound(_0x3a5272,null))['then'](function(_0x516293){if(_0x516293){_0x2e9c6d=_0x516293;return _0x516293[_0x3417('0x103')]({'raw':!![]});}})[_0x3417('0x17')](function(_0x5519fa){if(_0x2e9c6d){if(_0x5519fa){_0x169abf=_0x5519fa;}}return require(_0x3417('0x87'))[_0x3417('0x88')]();})[_0x3417('0x17')](function(_0x43bb00){if(_0x43bb00){_0x2600bb=_0x43bb00[_0x3417('0x104')];_0x214a5b=_0x43bb00[_0x3417('0x89')];}})[_0x3417('0x17')](function(){return db[_0x3417('0xb6')][_0x3417('0x29')]({'where':{'closed':![]}});})[_0x3417('0x17')](function(_0x479da9){_0x51f9a2=_0x479da9;if(_0x2600bb&&_0x479da9>_0x2600bb){return db[_0x3417('0x105')][_0x3417('0x75')]({'where':{'id':0x1}})['then'](function(_0x556b25){if(_0x556b25){_0x556b25[_0x3417('0x106')](_0x3417('0x107'));}});}})['then'](function(){var _0x5904d7=_0x2e9c6d[_0x3417('0x97')];var _0x235604=_0x2e9c6d[_0x3417('0x108')]||undefined;return _0x5904d7?_0x5904d7[_0x3417('0x98')](_0x235604):!![];})['then'](function(_0x5ea15e){var _0x3f04a1=fs[_0x3417('0xda')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x109')),_0x3417('0xdb'));var _0x518db0='3.8.1';var _0x79a087=![];try{const _0x38a485=new URL(_0x2e9c6d['address']);_0x2e9c6d[_0x3417('0x67')]=_0x38a485['origin'];}catch(_0x41767d){}var _0x2404f6;if(_0x28278c[_0x3417('0xb3')]['referer']){_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')]=_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')][_0x3417('0x10a')](/\/$/,'');_0x2404f6=wildcardUtils['testWebsiteWithWildcard'](_0x2e9c6d[_0x3417('0x67')],_0x28278c['headers'][_0x3417('0x3e')]);}else{_0x28278c[_0x3417('0xb3')]['referer']=_0x2e9c6d[_0x3417('0x67')];_0x2404f6=!![];}var _0x53512c={'chatVersion':_0x518db0,'chatWebsiteAddressOrigin':_0x2404f6?_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')]:_0x2e9c6d['address'],'remote':_0x2e9c6d[_0x3417('0x10b')],'query':querystring[_0x3417('0x10c')](_[_0x3417('0x5d')](_0x2e9c6d['get']({'plain':!![]}),{'customerIp':_0x28278c[_0x3417('0xb3')][_0x3417('0x38')]||_0x28278c[_0x3417('0xb3')]['x-real-ip']||_0x28278c[_0x3417('0x10d')]['remoteAddress']||_0x28278c['ip'],'referer':_0x28278c['headers']['referer'],'openedInteractions':_0x51f9a2,'maxInteractions':_0x2600bb,'virtual':_0x214a5b[_0x3417('0x104')],'online':_0x5ea15e,'custom':_0x214a5b,'address':_0x2404f6?_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')]:null}))[_0x3417('0x10a')](/'/g,'\x5c\x27')};_0x3a5272[_0x3417('0x32')](ejs[_0x3417('0x10e')](Mustache['render'](_0x3f04a1,_0x53512c),{'proactiveActions':_0x169abf,'alignment':_0x2e9c6d['alignment'],'verticalAlignment':_0x2e9c6d[_0x3417('0x10f')],'div_color':_0x2e9c6d[_0x3417('0x100')],'labelText':_0x2e9c6d[_0x3417('0x110')],'text_color':_0x2e9c6d[_0x3417('0x111')],'text_button_color':_0x2e9c6d[_0x3417('0x112')],'button_color':_0x2e9c6d[_0x3417('0x113')],'background_color':_0x2e9c6d[_0x3417('0x114')],'hideWhenOffline':_0x2e9c6d['hideWhenOffline'],'intervalId':_0x2e9c6d[_0x3417('0x115')],'isDevelopment':_0x79a087,'chatVersion':_0x518db0}));})[_0x3417('0x21')](handleError(_0x3a5272,null));};exports['addApplications']=function(_0x1aad65,_0x1e46df){var _0x49c01d=_0x1aad65['params']['id'];var _0x34ca6b=_0x1aad65[_0x3417('0x66')];var _0x238b32=0xc8;var _0x111d2e=null;return db[_0x3417('0xe3')][_0x3417('0xe4')]({'isolationLevel':db[_0x3417('0xe3')][_0x3417('0x116')][_0x3417('0x117')][_0x3417('0x118')]},function(_0x1bd6e1){return db['ChatWebsite'][_0x3417('0x75')]({'where':{'id':_0x49c01d},'transaction':_0x1bd6e1})['then'](function(_0x2084ed){if(_0x2084ed){return db[_0x3417('0xa7')][_0x3417('0x2f')]({'where':{'ChatWebsiteId':_0x49c01d},'transaction':_0x1bd6e1})[_0x3417('0x17')](function(){var _0x1639cf=_[_0x3417('0x4b')](_0x34ca6b,function(_0x3e8d62){_0x3e8d62[_0x3417('0x72')]=_0x49c01d;return _0x3e8d62;});return db[_0x3417('0xa7')][_0x3417('0xe6')](_0x1639cf,{'transaction':_0x1bd6e1});});}else{_0x238b32=0x194;_0x111d2e=[];}});})['then'](function(){if(_0x238b32!==0x194){return db[_0x3417('0xa7')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x49c01d},'order':'priority'})['then'](function(_0x2f9731){_0x111d2e=_0x2f9731;});}})['catch'](function(_0x460992){_0x238b32=0x1f4;logger[_0x3417('0x1d')](_0x460992[_0x3417('0x30')]);if(_0x460992[_0x3417('0x31')]){delete _0x460992['name'];}_0x111d2e=_0x460992;})[_0x3417('0x119')](function(){if(_0x111d2e===null){_0x1e46df[_0x3417('0x22')](_0x238b32);}else{if(_0x238b32===0x1f4){_0x1e46df[_0x3417('0x23')](_0x238b32)[_0x3417('0x32')](_0x111d2e);}else{_0x1e46df['status'](_0x238b32)[_0x3417('0x25')](_0x111d2e);}}});};exports[_0x3417('0x11a')]=function(_0x2d88af,_0x16a88d){var _0x3e6cda={};var _0x426a53={};var _0x1e5b73;var _0x25279a;return db[_0x3417('0x4c')]['findOne']({'where':{'id':_0x2d88af[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x16a88d,null))[_0x3417('0x17')](function(_0x3f5906){if(_0x3f5906){_0x1e5b73=_0x3f5906;_0x426a53[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0xa7')][_0x3417('0x4d')]);_0x426a53[_0x3417('0x50')]=_[_0x3417('0x51')](_0x2d88af[_0x3417('0x50')]);_0x426a53[_0x3417('0x52')]=_['intersection'](_0x426a53[_0x3417('0x45')],_0x426a53[_0x3417('0x50')]);_0x3e6cda[_0x3417('0x54')]=_['intersection'](_0x426a53[_0x3417('0x45')],qs[_0x3417('0x55')](_0x2d88af[_0x3417('0x50')][_0x3417('0x55')]));_0x3e6cda[_0x3417('0x54')]=_0x3e6cda[_0x3417('0x54')][_0x3417('0x61')]?_0x3e6cda['attributes']:_0x426a53[_0x3417('0x45')];_0x3e6cda[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x2d88af[_0x3417('0x50')][_0x3417('0x58')]);_0x3e6cda[_0x3417('0x59')]=qs['filters'](_[_0x3417('0x5a')](_0x2d88af[_0x3417('0x50')],_0x426a53[_0x3417('0x52')]));if(_0x2d88af['query'][_0x3417('0x5b')]){_0x3e6cda[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x3e6cda[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0x3e6cda[_0x3417('0x54')],function(_0x48ecb7){var _0xa872cd={};_0xa872cd[_0x48ecb7]={'$like':'%'+_0x2d88af[_0x3417('0x50')]['filter']+'%'};return _0xa872cd;})});}_0x3e6cda=_[_0x3417('0x5d')]({},_0x3e6cda,_0x2d88af[_0x3417('0x5e')]);return _0x1e5b73[_0x3417('0x11a')](_0x3e6cda);}})[_0x3417('0x17')](function(_0x16e83f){if(_0x16e83f){_0x25279a=_0x16e83f[_0x3417('0x61')];if(!_0x2d88af[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x3e6cda[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x2d88af[_0x3417('0x50')][_0x3417('0x28')]);_0x3e6cda[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x2d88af[_0x3417('0x50')][_0x3417('0x26')]);}return _0x1e5b73['getApplications'](_0x3e6cda);}})[_0x3417('0x17')](function(_0x1e557c){if(_0x1e557c){return _0x1e557c?{'count':_0x25279a,'rows':_0x1e557c}:null;}})[_0x3417('0x17')](respondWithResult(_0x16a88d,null))[_0x3417('0x21')](handleError(_0x16a88d,null));};exports[_0x3417('0x11b')]=function(_0x4b103d,_0xe8d21f){return db[_0x3417('0x11c')][_0x3417('0x64')]({'where':{'id':_0x4b103d[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0xe8d21f,null))[_0x3417('0x17')](function(_0x542ccf){if(_0x542ccf){return _0x542ccf['addProactiveActions'](_0x4b103d[_0x3417('0x66')][_0x3417('0x78')],_[_0x3417('0xf9')](_0x4b103d[_0x3417('0x66')],[_0x3417('0x78'),'id'])||{});}})[_0x3417('0x17')](respondWithResult(_0xe8d21f,null))[_0x3417('0x21')](handleError(_0xe8d21f,null));};exports['getProactiveActions']=function(_0x2f6f85,_0x12b8ac){var _0xa533ae={};var _0x466ec5={};var _0x901f70;var _0x288e68;return db[_0x3417('0x4c')][_0x3417('0x75')]({'where':{'id':_0x2f6f85[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x12b8ac,null))[_0x3417('0x17')](function(_0x2e1e90){if(_0x2e1e90){_0x901f70=_0x2e1e90;_0x466ec5[_0x3417('0x45')]=_['keys'](db[_0x3417('0x11d')][_0x3417('0x4d')]);_0x466ec5[_0x3417('0x50')]=_[_0x3417('0x51')](_0x2f6f85[_0x3417('0x50')]);_0x466ec5[_0x3417('0x52')]=_[_0x3417('0x53')](_0x466ec5[_0x3417('0x45')],_0x466ec5['query']);_0xa533ae['attributes']=_[_0x3417('0x53')](_0x466ec5[_0x3417('0x45')],qs[_0x3417('0x55')](_0x2f6f85['query'][_0x3417('0x55')]));_0xa533ae[_0x3417('0x54')]=_0xa533ae[_0x3417('0x54')][_0x3417('0x61')]?_0xa533ae[_0x3417('0x54')]:_0x466ec5['model'];_0xa533ae[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x2f6f85[_0x3417('0x50')][_0x3417('0x58')]);_0xa533ae['where']=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x2f6f85[_0x3417('0x50')],_0x466ec5[_0x3417('0x52')]));if(_0x2f6f85[_0x3417('0x50')][_0x3417('0x5b')]){_0xa533ae['where']=_['merge'](_0xa533ae[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0xa533ae['attributes'],function(_0x59b31c){var _0x2cee7b={};_0x2cee7b[_0x59b31c]={'$like':'%'+_0x2f6f85[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x2cee7b;})});}_0xa533ae=_[_0x3417('0x5d')]({},_0xa533ae,_0x2f6f85[_0x3417('0x5e')]);return _0x901f70[_0x3417('0x103')](_0xa533ae);}})[_0x3417('0x17')](function(_0x58e639){if(_0x58e639){_0x288e68=_0x58e639[_0x3417('0x61')];if(!_0x2f6f85[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0xa533ae['limit']=qs[_0x3417('0x28')](_0x2f6f85['query'][_0x3417('0x28')]);_0xa533ae['offset']=qs[_0x3417('0x26')](_0x2f6f85[_0x3417('0x50')][_0x3417('0x26')]);}return _0x901f70[_0x3417('0x103')](_0xa533ae);}})[_0x3417('0x17')](function(_0x2a6aec){if(_0x2a6aec){return _0x2a6aec?{'count':_0x288e68,'rows':_0x2a6aec}:null;}})['then'](respondWithResult(_0x12b8ac,null))[_0x3417('0x21')](handleError(_0x12b8ac,null));};exports[_0x3417('0x11e')]=function(_0x519e6e,_0xd467e6){var _0x318634=_0x519e6e[_0x3417('0x50')][_0x3417('0x11f')]===_0x3417('0x120')?'offlineForm':_0x3417('0x121');return db[_0x3417('0x4c')][_0x3417('0x64')]({'attributes':['id',_0x318634],'where':{'id':_0x519e6e[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0xd467e6,null))[_0x3417('0x17')](function(_0x50d29a){if(_0x50d29a){var _0x517923=_0x50d29a[_0x318634];var _0x28371f=_0x517923&&_0x517923[_0x3417('0x122')]?_0x517923['items']:[];_0xd467e6[_0x3417('0x32')]({'fromKey':_[_0x3417('0x8a')](_0x517923[_0x3417('0x123')])?undefined:_0x517923['fromKey'],'count':_0x28371f['length'],'rows':_0x28371f});}})[_0x3417('0x21')](handleError(_0xd467e6,null));};exports[_0x3417('0x124')]=function(_0x8c4b91,_0x179e23){var _0x51bd82={'raw':![],'where':{}};var _0x39975a={};var _0x1e842f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3417('0x75')]({'where':{'id':_0x8c4b91[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x179e23,null))[_0x3417('0x17')](function(_0x4ad502){if(_0x4ad502){_0x39975a[_0x3417('0x45')]=_['keys'](db[_0x3417('0x125')][_0x3417('0x4d')]);_0x39975a[_0x3417('0x50')]=_[_0x3417('0x51')](_0x8c4b91[_0x3417('0x50')]);_0x39975a[_0x3417('0x52')]=_[_0x3417('0x53')](_0x39975a[_0x3417('0x45')],_0x39975a['query']);_0x51bd82['attributes']=_[_0x3417('0x53')](_0x39975a[_0x3417('0x45')],qs[_0x3417('0x55')](_0x8c4b91['query'][_0x3417('0x55')]));_0x51bd82[_0x3417('0x54')]=_0x51bd82[_0x3417('0x54')]['length']?_0x51bd82['attributes']:_0x39975a[_0x3417('0x45')];if(!_0x8c4b91[_0x3417('0x50')][_0x3417('0x56')]('nolimit')){_0x51bd82[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x8c4b91[_0x3417('0x50')][_0x3417('0x28')]);_0x51bd82[_0x3417('0x26')]=qs['offset'](_0x8c4b91[_0x3417('0x50')][_0x3417('0x26')]);}_0x51bd82[_0x3417('0x57')]=qs['sort'](_0x8c4b91[_0x3417('0x50')]['sort']);_0x51bd82[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x8c4b91[_0x3417('0x50')],_0x39975a[_0x3417('0x52')]));_0x51bd82[_0x3417('0x59')][_0x3417('0x72')]=_0x4ad502['id'];if(_0x8c4b91[_0x3417('0x50')]['filter']){_0x51bd82['where']=_['merge'](_0x51bd82['where'],{'$or':_[_0x3417('0x4b')](_0x51bd82[_0x3417('0x54')],function(_0x4825fc){var _0x49c83a={};_0x49c83a[_0x4825fc]={'$like':'%'+_0x8c4b91[_0x3417('0x50')]['filter']+'%'};return _0x49c83a;})});}_0x51bd82=_[_0x3417('0x5d')]({},_0x51bd82,_0x8c4b91['options']);return db[_0x3417('0x125')][_0x3417('0x29')]({'where':_0x51bd82['where']})[_0x3417('0x17')](function(_0x2eaf01){_0x1e842f[_0x3417('0x29')]=_0x2eaf01;if(_0x8c4b91[_0x3417('0x50')][_0x3417('0x62')]){_0x51bd82[_0x3417('0x63')]=[{'all':!![]}];}else{_0x51bd82[_0x3417('0x63')]=[{'model':db[_0x3417('0xa4')],'as':_0x3417('0xfb'),'required':![]},{'model':db[_0x3417('0xe5')],'as':_0x3417('0x126'),'required':![]}];}return db[_0x3417('0x125')][_0x3417('0x5f')](_0x51bd82);})[_0x3417('0x17')](function(_0x46f489){_0x1e842f[_0x3417('0x60')]=_0x46f489;return _0x1e842f;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x179e23,_0x51bd82))[_0x3417('0x21')](handleError(_0x179e23,null));};exports[_0x3417('0x127')]=function(_0x2edc53,_0x4d8f57){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x2edc53['params']['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x4d8f57,null))[_0x3417('0x17')](function(_0x1a344e){if(_0x1a344e){return _0x1a344e['addAgents'](_0x2edc53[_0x3417('0x66')]['ids'],_[_0x3417('0xf9')](_0x2edc53[_0x3417('0x66')],[_0x3417('0x78'),'id'])||{})[_0x3417('0xd9')](function(_0x2da7d6){for(var _0x5b6d02=0x0;_0x5b6d02<_0x2edc53[_0x3417('0x66')][_0x3417('0x78')][_0x3417('0x61')];_0x5b6d02+=0x1){socket[_0x3417('0x128')](_0x3417('0x129'),{'UserId':Number(_0x2edc53[_0x3417('0x66')]['ids'][_0x5b6d02]),'ChatWebsiteId':Number(_0x2edc53[_0x3417('0x70')]['id'])});}return _0x2da7d6;});}})[_0x3417('0x17')](respondWithResult(_0x4d8f57,null))['catch'](handleError(_0x4d8f57,null));};exports[_0x3417('0x12a')]=function(_0x41cd8b,_0x1dc61b){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x41cd8b[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x1dc61b,null))['then'](function(_0x1f5388){if(_0x1f5388){return _0x1f5388['removeAgents'](_0x41cd8b[_0x3417('0x50')]['ids'])['then'](function(){if(_[_0x3417('0x12b')](_0x41cd8b['query'][_0x3417('0x78')])){for(var _0x47ad23=0x0;_0x47ad23<_0x41cd8b[_0x3417('0x50')][_0x3417('0x78')][_0x3417('0x61')];_0x47ad23+=0x1){socket['emit'](_0x3417('0x12c'),{'UserId':Number(_0x41cd8b['query'][_0x3417('0x78')][_0x47ad23]),'ChatWebsiteId':Number(_0x41cd8b[_0x3417('0x70')]['id'])});}}else{socket['emit'](_0x3417('0x12c'),{'UserId':Number(_0x41cd8b[_0x3417('0x50')][_0x3417('0x78')]),'ChatWebsiteId':Number(_0x41cd8b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1dc61b,null))[_0x3417('0x21')](handleError(_0x1dc61b,null));};exports[_0x3417('0x12d')]=function(_0x15e769,_0x745465){var _0x276b90={};var _0x37551c={};var _0x28bcb0;var _0x324b2c;return db[_0x3417('0x4c')][_0x3417('0x75')]({'where':{'id':_0x15e769[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x745465,null))[_0x3417('0x17')](function(_0x36850c){if(_0x36850c){_0x28bcb0=_0x36850c;_0x37551c[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0xc3')][_0x3417('0x4d')]);_0x37551c[_0x3417('0x50')]=_[_0x3417('0x51')](_0x15e769[_0x3417('0x50')]);_0x37551c[_0x3417('0x52')]=_[_0x3417('0x53')](_0x37551c[_0x3417('0x45')],_0x37551c[_0x3417('0x50')]);_0x276b90[_0x3417('0x54')]=_[_0x3417('0x53')](_0x37551c[_0x3417('0x45')],qs[_0x3417('0x55')](_0x15e769[_0x3417('0x50')][_0x3417('0x55')]));_0x276b90['attributes']=_0x276b90[_0x3417('0x54')][_0x3417('0x61')]?_0x276b90['attributes']:_0x37551c['model'];_0x276b90[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x15e769[_0x3417('0x50')][_0x3417('0x58')]);_0x276b90[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x15e769[_0x3417('0x50')],_0x37551c[_0x3417('0x52')]));if(_0x15e769['query'][_0x3417('0x5b')]){_0x276b90['where']=_[_0x3417('0x5d')](_0x276b90['where'],{'$or':_[_0x3417('0x4b')](_0x276b90[_0x3417('0x54')],function(_0x1304e2){var _0x4e0529={};_0x4e0529[_0x1304e2]={'$like':'%'+_0x15e769[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x4e0529;})});}_0x276b90=_[_0x3417('0x5d')]({},_0x276b90,_0x15e769[_0x3417('0x5e')]);return _0x28bcb0[_0x3417('0x12d')](_0x276b90);}})['then'](function(_0xe927f6){if(_0xe927f6){_0x324b2c=_0xe927f6[_0x3417('0x61')];if(!_0x15e769[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x276b90['limit']=qs['limit'](_0x15e769['query'][_0x3417('0x28')]);_0x276b90[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x15e769[_0x3417('0x50')][_0x3417('0x26')]);}return _0x28bcb0['getAgents'](_0x276b90);}})[_0x3417('0x17')](function(_0x414181){if(_0x414181){return _0x414181?{'count':_0x324b2c,'rows':_0x414181}:null;}})[_0x3417('0x17')](respondWithResult(_0x745465,null))[_0x3417('0x21')](handleError(_0x745465,null));};
\ No newline at end of file
+var _0xc30f=['threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','no\x20available\x20attributes','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','toPairsIn','mapValues','email','firstName','Chat','MailAccountId','NotifyMailAccount','remove','omit','getInteractions','Contact','fullname','color','tag','getSnippet','../../config/license/util','virtual','License','chatLicenseExceeded','utf8','3.8.1','origin','replace','testWebsiteWithWildcard','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','ISOLATION_LEVELS','ChatApplication','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','user-agent','getResult','first','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','model','%s\x20%s\x20%s','vendor','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','testWildcardValidity','address','body','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','nolimit','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','systemAvatar','Interval','resolve','timezone','ifTime','notify','from','From\x20is\x20mandatory','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','customerIp','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','includes','mapKey','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','defaults','contact','headers'];(function(_0x1cc9cc,_0x1d7711){var _0x3dce09=function(_0x19a5b4){while(--_0x19a5b4){_0x1cc9cc['push'](_0x1cc9cc['shift']());}};_0x3dce09(++_0x1d7711);}(_0xc30f,0x75));var _0xfc30=function(_0x228d93,_0x5b5a75){_0x228d93=_0x228d93-0x0;var _0x11c8ad=_0xc30f[_0x228d93];return _0x11c8ad;};'use strict';var Mustache=require(_0xfc30('0x0'));var util=require('util');var path=require(_0xfc30('0x1'));var ejs=require(_0xfc30('0x2'));var fs=require('fs');var fs_extra=require(_0xfc30('0x3'));var _=require(_0xfc30('0x4'));var querystring=require('querystring');var htmlToText=require('html-to-text');var Redis=require(_0xfc30('0x5'));var jayson=require('jayson/promise');var qs=require(_0xfc30('0x6'));var logger=require(_0xfc30('0x7'))(_0xfc30('0x8'));var config=require(_0xfc30('0x9'));var APIBadRequestError=require(_0xfc30('0xa'))['APIBadRequestError'];var APINotFoundError=require(_0xfc30('0xa'))[_0xfc30('0xb')];var APIOutOfIntervalError=require(_0xfc30('0xa'))[_0xfc30('0xc')];var APIHandleError=require(_0xfc30('0xa'))[_0xfc30('0xd')];var APIConflictError=require('../../errors/api')['APIConflictError'];var wildcardUtils=require(_0xfc30('0xe'));var URL=require(_0xfc30('0xf'))['URL'];var db=require(_0xfc30('0x10'))['db'];config[_0xfc30('0x11')]=_['defaults'](config['redis'],{'host':_0xfc30('0x12'),'port':0x18eb});var socket=require(_0xfc30('0x13'))(new Redis(config['redis']));require(_0xfc30('0x14'))[_0xfc30('0x15')](socket);var client=jayson[_0xfc30('0x16')][_0xfc30('0x17')]({'port':0x232c});var client9002=jayson[_0xfc30('0x16')]['http']({'port':0x232a});var client9003=jayson[_0xfc30('0x16')]['http']({'port':0x232b});var client9001=jayson[_0xfc30('0x16')][_0xfc30('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2c598b,_0x228993,_0x109bad,_0x4784b5){return new Promise(function(_0x21b0db,_0x15b049){var _0x48c33f=_0x4784b5||client;return _0x48c33f[_0xfc30('0x18')](_0x2c598b,_0x109bad)[_0xfc30('0x19')](function(_0x4cd29b){logger[_0xfc30('0x1a')](_0xfc30('0x1b'),_0x228993,_0xfc30('0x1c'));logger[_0xfc30('0x1d')](_0xfc30('0x1e'),_0x228993,_0xfc30('0x1c'),JSON[_0xfc30('0x1f')](_0x4cd29b));if(_0x4cd29b['error']){if(_0x4cd29b[_0xfc30('0x20')]['code']===0x1f4){logger['error'](_0xfc30('0x1b'),_0x228993,_0x4cd29b[_0xfc30('0x20')][_0xfc30('0x21')]);return _0x15b049(_0x4cd29b[_0xfc30('0x20')]['message']);}logger['error'](_0xfc30('0x1b'),_0x228993,_0x4cd29b[_0xfc30('0x20')][_0xfc30('0x21')]);return _0x21b0db(_0x4cd29b[_0xfc30('0x20')][_0xfc30('0x21')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x228993,_0xfc30('0x1c'));_0x21b0db(_0x4cd29b[_0xfc30('0x22')]['message']);}})[_0xfc30('0x23')](function(_0x3e0928){logger[_0xfc30('0x20')](_0xfc30('0x1b'),_0x228993,_0x3e0928);_0x15b049(_0x3e0928);});});}function respondWithStatusCode(_0x293057,_0x49a935){_0x49a935=_0x49a935||0xcc;return function(_0x38d3a2){if(_0x38d3a2){return _0x293057[_0xfc30('0x24')](_0x49a935);}return _0x293057['status'](_0x49a935)[_0xfc30('0x25')]();};}function respondWithResult(_0x549e23,_0x1224ca){_0x1224ca=_0x1224ca||0xc8;return function(_0x2da686){if(_0x2da686){return _0x549e23[_0xfc30('0x26')](_0x1224ca)[_0xfc30('0x27')](_0x2da686);}};}function respondWithFilteredResult(_0x17b7df,_0x585952){return function(_0x3cc4f0){if(_0x3cc4f0){var _0xef0105=typeof _0x585952['offset']===_0xfc30('0x28')&&typeof _0x585952[_0xfc30('0x29')]===_0xfc30('0x28');var _0x4d0819=_0x3cc4f0[_0xfc30('0x2a')];var _0x19ea28=_0xef0105?0x0:_0x585952[_0xfc30('0x2b')];var _0x1cce6e=_0xef0105?_0x3cc4f0['count']:_0x585952[_0xfc30('0x2b')]+_0x585952[_0xfc30('0x29')];var _0x5e0763;if(_0x1cce6e>=_0x4d0819){_0x1cce6e=_0x4d0819;_0x5e0763=0xc8;}else{_0x5e0763=0xce;}_0x17b7df[_0xfc30('0x26')](_0x5e0763);return _0x17b7df['set'](_0xfc30('0x2c'),_0x19ea28+'-'+_0x1cce6e+'/'+_0x4d0819)['json'](_0x3cc4f0);}return null;};}function saveUpdates(_0x10a809){return function(_0xedea83){if(_0xedea83){return _0xedea83['update'](_0x10a809)[_0xfc30('0x19')](function(_0x2c566b){return _0x2c566b;});}return null;};}function removeEntity(_0x49a921){return function(_0x1c55a8){if(_0x1c55a8){return _0x1c55a8[_0xfc30('0x2d')]()[_0xfc30('0x19')](function(){var _0x290e42=_0x1c55a8[_0xfc30('0x2e')]({'plain':!![]});var _0x1e1b16=_0xfc30('0x2f');return db[_0xfc30('0x30')][_0xfc30('0x2d')]({'where':{'type':_0x1e1b16,'resourceId':_0x290e42['id']}})[_0xfc30('0x19')](function(){return _0x1c55a8;});})[_0xfc30('0x19')](function(){_0x49a921['status'](0xcc)[_0xfc30('0x25')]();});}};}function handleEntityNotFound(_0x3c1452){return function(_0x1e54b9){if(!_0x1e54b9){_0x3c1452[_0xfc30('0x24')](0x194);}return _0x1e54b9;};}function handleError(_0x45b4d6,_0xb4d412){_0xb4d412=_0xb4d412||0x1f4;return function(_0x2b0bc0){logger[_0xfc30('0x20')](_0x2b0bc0['stack']);if(_0x2b0bc0[_0xfc30('0x31')]){delete _0x2b0bc0[_0xfc30('0x31')];}_0x45b4d6[_0xfc30('0x26')](_0xb4d412)[_0xfc30('0x32')](_0x2b0bc0);};}function createInteractionObject(_0x397e3d,_0x1f180d,_0x575a99,_0x12d7d5){var _0x3e4dc2=require(_0xfc30('0x33'));var _0x3d0a9a=new _0x3e4dc2();var _0x15db7a=_0x3d0a9a[_0xfc30('0x34')](_0x575a99[_0xfc30('0x35')])[_0xfc30('0x36')]();var _0x3bd7df=_0x1f180d['customerIp'];if(_0x575a99['cf-connecting-ip']){_0x3bd7df=_0x575a99['cf-connecting-ip'];}else if(_0x575a99['x-forwarded-for']){_0x3bd7df=_[_0xfc30('0x37')](_0x575a99[_0xfc30('0x38')]['split'](','));}return{'ContactId':_0x12d7d5['id'],'ChatWebsiteId':_0x397e3d,'from':(_0x12d7d5['firstName']||'')+'\x20'+(_0x12d7d5[_0xfc30('0x39')]||''),'customerIp':_0x3bd7df,'customerPort':_0x575a99[_0xfc30('0x3a')]?_0x575a99[_0xfc30('0x3a')]:null,'referer':_0x1f180d[_0xfc30('0x3b')],'browserName':_0x15db7a[_0xfc30('0x3c')][_0xfc30('0x31')]&&_0x15db7a[_0xfc30('0x3c')][_0xfc30('0x3d')]?util[_0xfc30('0x3e')]('%s\x20%s',_0x15db7a[_0xfc30('0x3c')]['name'],_0x15db7a[_0xfc30('0x3c')]['version']):_0xfc30('0x3f'),'browserVersion':_0x15db7a[_0xfc30('0x3c')][_0xfc30('0x3d')]||_0xfc30('0x3f'),'osName':util[_0xfc30('0x3e')](_0xfc30('0x40'),_0x15db7a['os']['name'],_0x15db7a['os'][_0xfc30('0x3d')]),'osVersion':_0x15db7a['os']['version'],'deviceModel':_0x15db7a[_0xfc30('0x41')][_0xfc30('0x42')]&&_0x15db7a[_0xfc30('0x41')]['vendor']?util[_0xfc30('0x3e')](_0xfc30('0x43'),_0x15db7a[_0xfc30('0x41')]['model'],_0x15db7a[_0xfc30('0x41')][_0xfc30('0x44')],_0x15db7a['device'][_0xfc30('0x45')]):null,'deviceVendor':_0x15db7a[_0xfc30('0x41')]['vendor'],'deviceType':_0x15db7a['device']['type'],'formData':JSON[_0xfc30('0x1f')](_0x1f180d)};}exports[_0xfc30('0x46')]=function(_0x21c001,_0x28f175){var _0x254170={'include':[{'model':db[_0xfc30('0x47')],'as':_0xfc30('0x48')}]},_0x45b71b={},_0x38cfd7={'count':0x0,'rows':[]};var _0x50128=_[_0xfc30('0x49')](db[_0xfc30('0x4a')][_0xfc30('0x4b')],function(_0x57b660){return{'name':_0x57b660['fieldName'],'type':_0x57b660['type'][_0xfc30('0x4c')]};});_0x45b71b[_0xfc30('0x42')]=_['map'](_0x50128,'name');_0x45b71b[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x21c001[_0xfc30('0x4d')]);_0x45b71b['filters']=_[_0xfc30('0x4f')](_0x45b71b['model'],_0x45b71b['query']);_0x254170[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x45b71b[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x21c001[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x254170['attributes']=_0x254170[_0xfc30('0x50')][_0xfc30('0x52')]?_0x254170[_0xfc30('0x50')]:_0x45b71b['model'];if(!_0x21c001['query'][_0xfc30('0x53')]('nolimit')){_0x254170[_0xfc30('0x29')]=qs[_0xfc30('0x29')](_0x21c001[_0xfc30('0x4d')]['limit']);_0x254170[_0xfc30('0x2b')]=qs[_0xfc30('0x2b')](_0x21c001[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x254170[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x21c001[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x254170[_0xfc30('0x56')]=qs['filters'](_[_0xfc30('0x57')](_0x21c001['query'],_0x45b71b[_0xfc30('0x58')]),_0x50128);if(_0x21c001['query']['filter']){_0x254170[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x254170['where'],{'$or':_[_0xfc30('0x49')](_0x50128,function(_0x35a959){if(_0x35a959[_0xfc30('0x45')]!=='VIRTUAL'){var _0x23c626={};_0x23c626[_0x35a959[_0xfc30('0x31')]]={'$like':'%'+_0x21c001[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x23c626;}})});}_0x254170=_['merge']({},_0x254170,_0x21c001[_0xfc30('0x5b')]);var _0xa4e99c={'where':_0x254170[_0xfc30('0x56')]};return db[_0xfc30('0x4a')]['count'](_0xa4e99c)['then'](function(_0x53c515){_0x38cfd7[_0xfc30('0x2a')]=_0x53c515;if(_0x21c001[_0xfc30('0x4d')][_0xfc30('0x5c')]){_0x254170[_0xfc30('0x5d')]=[{'all':!![]}];}return db[_0xfc30('0x4a')][_0xfc30('0x5e')](_0x254170);})[_0xfc30('0x19')](function(_0x1c4743){_0x38cfd7[_0xfc30('0x5f')]=_0x1c4743;return _0x38cfd7;})[_0xfc30('0x19')](respondWithFilteredResult(_0x28f175,_0x254170))[_0xfc30('0x23')](handleError(_0x28f175,null));};exports[_0xfc30('0x60')]=function(_0x4d5506,_0xaf03a4){var _0x4fe49={'raw':![],'where':{'id':_0x4d5506[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0x47')],'as':_0xfc30('0x48')}]},_0x4800d5={};_0x4800d5[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db['ChatWebsite'][_0xfc30('0x4b')]);_0x4800d5[_0xfc30('0x4d')]=_['keys'](_0x4d5506[_0xfc30('0x4d')]);_0x4800d5[_0xfc30('0x58')]=_['intersection'](_0x4800d5['model'],_0x4800d5['query']);_0x4fe49[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x4800d5[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x4d5506['query'][_0xfc30('0x51')]));_0x4fe49['attributes']=_0x4fe49[_0xfc30('0x50')][_0xfc30('0x52')]?_0x4fe49[_0xfc30('0x50')]:_0x4800d5[_0xfc30('0x42')];if(_0x4d5506['query'][_0xfc30('0x5c')]){_0x4fe49[_0xfc30('0x5d')]=[{'all':!![]}];}_0x4fe49=_[_0xfc30('0x59')]({},_0x4fe49,_0x4d5506[_0xfc30('0x5b')]);return db['ChatWebsite'][_0xfc30('0x62')](_0x4fe49)[_0xfc30('0x19')](handleEntityNotFound(_0xaf03a4,null))['then'](respondWithResult(_0xaf03a4,null))[_0xfc30('0x23')](handleError(_0xaf03a4,null));};exports[_0xfc30('0x63')]=function(_0x4ed13d,_0x27315e){if(!wildcardUtils[_0xfc30('0x64')](_0x4ed13d['body'][_0xfc30('0x65')])){return handleError(_0x27315e,null)(new APIBadRequestError('\x22'+_0x4ed13d[_0xfc30('0x66')][_0xfc30('0x65')]+_0xfc30('0x67')));}return db[_0xfc30('0x4a')][_0xfc30('0x63')](_0x4ed13d[_0xfc30('0x66')],{})[_0xfc30('0x19')](function(_0x16d4ab){var _0x481ff6=_0x4ed13d[_0xfc30('0x68')][_0xfc30('0x2e')]({'plain':!![]});if(!_0x481ff6)throw new Error(_0xfc30('0x69'));if(_0x481ff6['role']==='user'){var _0x44da5a=_0x16d4ab[_0xfc30('0x2e')]({'plain':!![]});var _0x95f02a=_0xfc30('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x95f02a,'userProfileId':_0x481ff6[_0xfc30('0x6a')]},'raw':!![]})['then'](function(_0x1bda7c){if(_0x1bda7c&&_0x1bda7c[_0xfc30('0x6b')]===0x0){return db[_0xfc30('0x30')][_0xfc30('0x63')]({'name':_0x44da5a[_0xfc30('0x31')],'resourceId':_0x44da5a['id'],'type':_0x1bda7c[_0xfc30('0x31')],'sectionId':_0x1bda7c['id']},{})[_0xfc30('0x19')](function(){return _0x16d4ab;});}else{return _0x16d4ab;}})[_0xfc30('0x23')](function(_0x271b80){logger[_0xfc30('0x20')](_0xfc30('0x6c'),_0x271b80);throw _0x271b80;});}return _0x16d4ab;})[_0xfc30('0x19')](respondWithResult(_0x27315e,0xc9))[_0xfc30('0x23')](handleError(_0x27315e,null));};exports[_0xfc30('0x6d')]=function(_0x38001b,_0x1b9b00){if(!wildcardUtils[_0xfc30('0x64')](_0x38001b['body']['address'])){return handleError(_0x1b9b00,null)(new APIBadRequestError('\x22'+_0x38001b[_0xfc30('0x66')][_0xfc30('0x65')]+_0xfc30('0x67')));}if(_0x38001b[_0xfc30('0x66')]['id']){delete _0x38001b[_0xfc30('0x66')]['id'];}return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x38001b[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0x47')],'as':_0xfc30('0x48')}]})[_0xfc30('0x19')](handleEntityNotFound(_0x1b9b00,null))[_0xfc30('0x19')](saveUpdates(_0x38001b['body'],null))[_0xfc30('0x19')](respondWithResult(_0x1b9b00,null))[_0xfc30('0x23')](handleError(_0x1b9b00,null));};exports[_0xfc30('0x2d')]=function(_0xdcf3cd,_0x4e6ee3){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0xdcf3cd[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x4e6ee3,null))[_0xfc30('0x19')](removeEntity(_0x4e6ee3,null))[_0xfc30('0x23')](handleError(_0x4e6ee3,null));};exports[_0xfc30('0x6e')]=function(_0x4690a5,_0x15f243){return db[_0xfc30('0x4a')]['describe']()[_0xfc30('0x19')](respondWithResult(_0x15f243,null))[_0xfc30('0x23')](handleError(_0x15f243,null));};exports[_0xfc30('0x6f')]=function(_0x3c1496,_0x125be3){if(_0x3c1496[_0xfc30('0x66')]['id']){delete _0x3c1496[_0xfc30('0x66')]['id'];}return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x3c1496['params']['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x125be3,null))[_0xfc30('0x19')](function(_0x4eedc7){if(_0x4eedc7){_0x3c1496['body'][_0xfc30('0x70')]=_0x4eedc7['id'];return db['Disposition'][_0xfc30('0x63')](_0x3c1496[_0xfc30('0x66')]);}})[_0xfc30('0x19')](respondWithResult(_0x125be3,null))[_0xfc30('0x23')](handleError(_0x125be3,null));};exports[_0xfc30('0x71')]=function(_0x58bdae,_0x1ebdc1){var _0x2e45e1={'raw':![],'where':{}};var _0x4fed2a={};var _0x39f168={'count':0x0,'rows':[]};return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x58bdae[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x1ebdc1,null))[_0xfc30('0x19')](function(_0x3cefca){if(_0x3cefca){_0x4fed2a[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db['Disposition'][_0xfc30('0x4b')]);_0x4fed2a['query']=_[_0xfc30('0x4e')](_0x58bdae[_0xfc30('0x4d')]);_0x4fed2a[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x4fed2a[_0xfc30('0x42')],_0x4fed2a[_0xfc30('0x4d')]);_0x2e45e1[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x4fed2a['model'],qs['fields'](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x2e45e1[_0xfc30('0x50')]=_0x2e45e1[_0xfc30('0x50')][_0xfc30('0x52')]?_0x2e45e1[_0xfc30('0x50')]:_0x4fed2a[_0xfc30('0x42')];if(!_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0x2e45e1['limit']=qs[_0xfc30('0x29')](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x2e45e1[_0xfc30('0x2b')]=qs['offset'](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x2e45e1['order']=qs[_0xfc30('0x55')](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x2e45e1['where']=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x58bdae[_0xfc30('0x4d')],_0x4fed2a[_0xfc30('0x58')]));_0x2e45e1[_0xfc30('0x56')][_0xfc30('0x70')]=_0x3cefca['id'];if(_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x2e45e1['where']=_[_0xfc30('0x59')](_0x2e45e1[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x2e45e1[_0xfc30('0x50')],function(_0x588b23){var _0x40767a={};_0x40767a[_0x588b23]={'$like':'%'+_0x58bdae['query'][_0xfc30('0x5a')]+'%'};return _0x40767a;})});}_0x2e45e1=_['merge']({},_0x2e45e1,_0x58bdae[_0xfc30('0x5b')]);return db[_0xfc30('0x74')][_0xfc30('0x2a')]({'where':_0x2e45e1['where']})[_0xfc30('0x19')](function(_0x5b631a){_0x39f168[_0xfc30('0x2a')]=_0x5b631a;if(_0x58bdae[_0xfc30('0x4d')]['includeAll']){_0x2e45e1[_0xfc30('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0xfc30('0x5e')](_0x2e45e1);})[_0xfc30('0x19')](function(_0x3d489b){_0x39f168[_0xfc30('0x5f')]=_0x3d489b;return _0x39f168;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x1ebdc1,_0x2e45e1))[_0xfc30('0x23')](handleError(_0x1ebdc1,null));};exports[_0xfc30('0x75')]=function(_0x574d7a,_0x5803bb){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x574d7a[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x5803bb,null))[_0xfc30('0x19')](function(_0x4ac6e5){if(_0x4ac6e5){return _0x4ac6e5[_0xfc30('0x75')](_0x574d7a[_0xfc30('0x4d')][_0xfc30('0x76')]);}})[_0xfc30('0x19')](respondWithStatusCode(_0x5803bb,null))[_0xfc30('0x23')](handleError(_0x5803bb,null));};exports[_0xfc30('0x77')]=function(_0x36972e,_0x4296b3){if(_0x36972e[_0xfc30('0x66')]['id']){delete _0x36972e[_0xfc30('0x66')]['id'];}return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x36972e[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x4296b3,null))[_0xfc30('0x19')](function(_0x13dc0a){if(_0x13dc0a){_0x36972e[_0xfc30('0x66')]['ChatWebsiteId']=_0x13dc0a['id'];return db[_0xfc30('0x78')][_0xfc30('0x63')](_0x36972e['body']);}})[_0xfc30('0x19')](respondWithResult(_0x4296b3,null))[_0xfc30('0x23')](handleError(_0x4296b3,null));};exports[_0xfc30('0x79')]=function(_0x4cb0e0,_0x45faa7){var _0x1724b1={'raw':![],'where':{}};var _0x5439e2={};var _0x11e7df={'count':0x0,'rows':[]};return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x4cb0e0['params']['id']}})['then'](handleEntityNotFound(_0x45faa7,null))['then'](function(_0x25b221){if(_0x25b221){_0x5439e2['model']=_[_0xfc30('0x4e')](db[_0xfc30('0x78')][_0xfc30('0x4b')]);_0x5439e2[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x4cb0e0['query']);_0x5439e2[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x5439e2['model'],_0x5439e2[_0xfc30('0x4d')]);_0x1724b1[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x5439e2[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x1724b1[_0xfc30('0x50')]=_0x1724b1[_0xfc30('0x50')][_0xfc30('0x52')]?_0x1724b1[_0xfc30('0x50')]:_0x5439e2[_0xfc30('0x42')];if(!_0x4cb0e0['query'][_0xfc30('0x53')](_0xfc30('0x73'))){_0x1724b1['limit']=qs[_0xfc30('0x29')](_0x4cb0e0['query'][_0xfc30('0x29')]);_0x1724b1['offset']=qs[_0xfc30('0x2b')](_0x4cb0e0['query'][_0xfc30('0x2b')]);}_0x1724b1[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x1724b1['where']=qs[_0xfc30('0x58')](_['pick'](_0x4cb0e0[_0xfc30('0x4d')],_0x5439e2['filters']));_0x1724b1[_0xfc30('0x56')]['ChatWebsiteId']=_0x25b221['id'];if(_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x1724b1[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x1724b1['where'],{'$or':_[_0xfc30('0x49')](_0x1724b1[_0xfc30('0x50')],function(_0x4c81a8){var _0x165512={};_0x165512[_0x4c81a8]={'$like':'%'+_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x165512;})});}_0x1724b1=_[_0xfc30('0x59')]({},_0x1724b1,_0x4cb0e0['options']);return db['CannedAnswer'][_0xfc30('0x2a')]({'where':_0x1724b1[_0xfc30('0x56')]})[_0xfc30('0x19')](function(_0x5e4330){_0x11e7df[_0xfc30('0x2a')]=_0x5e4330;if(_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x5c')]){_0x1724b1[_0xfc30('0x5d')]=[{'all':!![]}];}return db[_0xfc30('0x78')]['findAll'](_0x1724b1);})[_0xfc30('0x19')](function(_0xf03fe4){_0x11e7df[_0xfc30('0x5f')]=_0xf03fe4;return _0x11e7df;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x45faa7,_0x1724b1))['catch'](handleError(_0x45faa7,null));};exports[_0xfc30('0x7a')]=function(_0x1dcc90,_0x2b8cf5){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x1dcc90['params']['id']}})['then'](handleEntityNotFound(_0x2b8cf5,null))[_0xfc30('0x19')](function(_0x172fda){if(_0x172fda){return _0x172fda[_0xfc30('0x7a')](_0x1dcc90[_0xfc30('0x4d')]['ids']);}})['then'](respondWithStatusCode(_0x2b8cf5,null))[_0xfc30('0x23')](handleError(_0x2b8cf5,null));};exports[_0xfc30('0x7b')]=function(_0x372769,_0x1a92b9){_0x372769[_0xfc30('0x66')][_0xfc30('0x7c')]=_0x372769[_0xfc30('0x7d')]['filename'];return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x372769[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x1a92b9,null))['then'](saveUpdates(_0x372769[_0xfc30('0x66')],null))[_0xfc30('0x19')](respondWithResult(_0x1a92b9,null))['catch'](handleError(_0x1a92b9,null));};exports[_0xfc30('0x7e')]=function(_0x2e34aa,_0x4433a4){_0x2e34aa[_0xfc30('0x66')][_0xfc30('0x7f')]=_0x2e34aa[_0xfc30('0x7d')][_0xfc30('0x80')];return db[_0xfc30('0x4a')]['find']({'where':{'id':_0x2e34aa[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x4433a4,null))[_0xfc30('0x19')](saveUpdates(_0x2e34aa[_0xfc30('0x66')],null))[_0xfc30('0x19')](respondWithResult(_0x4433a4,null))[_0xfc30('0x23')](handleError(_0x4433a4,null));};exports[_0xfc30('0x81')]=function(_0xe75982,_0x14f47c){_0xe75982[_0xfc30('0x66')]['customerAvatar']=_0xe75982[_0xfc30('0x7d')][_0xfc30('0x80')];return db[_0xfc30('0x4a')]['find']({'where':{'id':_0xe75982[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x14f47c,null))[_0xfc30('0x19')](saveUpdates(_0xe75982[_0xfc30('0x66')],null))['then'](respondWithResult(_0x14f47c,null))[_0xfc30('0x23')](handleError(_0x14f47c,null));};exports[_0xfc30('0x82')]=function(_0x3fdc25,_0x357e73){_0x3fdc25[_0xfc30('0x66')]['systemAvatar']=_0x3fdc25['file']['filename'];return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x3fdc25[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x357e73,null))[_0xfc30('0x19')](saveUpdates(_0x3fdc25['body'],null))[_0xfc30('0x19')](respondWithResult(_0x357e73,null))[_0xfc30('0x23')](handleError(_0x357e73,null));};exports[_0xfc30('0x83')]=function(_0x4e0f36,_0x5c2701){var _0x5b550a=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x86'));var _0x85e8ab={'where':{'id':_0x4e0f36[_0xfc30('0x61')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x31f566=![];return require('../../config/license/util')[_0xfc30('0x87')]()[_0xfc30('0x19')](function(_0x58c128){if(_0x58c128){_0x31f566=_0x58c128[_0xfc30('0x88')];}})[_0xfc30('0x19')](function(){return db[_0xfc30('0x4a')][_0xfc30('0x62')](_0x85e8ab);})[_0xfc30('0x19')](handleEntityNotFound(_0x5c2701,null))['then'](function(_0x47cb72){if(_0x47cb72){if(!_[_0xfc30('0x89')](_0x47cb72[_0xfc30('0x7c')])){if(fs[_0xfc30('0x8a')](path[_0xfc30('0x84')](config[_0xfc30('0x85')],'server/files/images/logos/',_0x47cb72[_0xfc30('0x7c')]))&&_0x31f566){_0x5b550a=path['join'](config[_0xfc30('0x85')],_0xfc30('0x8b'),_0x47cb72['sitepic']);}}return _0x5c2701[_0xfc30('0x8c')](_0x5b550a);}})[_0xfc30('0x23')](handleError(_0x5c2701,null));};exports[_0xfc30('0x8d')]=function(_0x432352,_0x2c73cc){var _0x43a5b1=path['join'](config[_0xfc30('0x85')],_0xfc30('0x8e'));var _0x44aa46={'where':{'id':_0x432352[_0xfc30('0x61')]['id']},'attributes':['id',_0xfc30('0x7f')],'raw':!![]};return db[_0xfc30('0x4a')][_0xfc30('0x62')](_0x44aa46)[_0xfc30('0x19')](handleEntityNotFound(_0x2c73cc,null))[_0xfc30('0x19')](function(_0x4dd29d){if(_0x4dd29d){if(!_[_0xfc30('0x89')](_0x4dd29d['agentAvatar'])){if(fs[_0xfc30('0x8a')](path['join'](config['root'],'server/files/images/avatars/',_0x4dd29d[_0xfc30('0x7f')]))){_0x43a5b1=path[_0xfc30('0x84')](config['root'],_0xfc30('0x8f'),_0x4dd29d[_0xfc30('0x7f')]);}}return _0x2c73cc[_0xfc30('0x8c')](_0x43a5b1);}})[_0xfc30('0x23')](handleError(_0x2c73cc,null));};exports[_0xfc30('0x90')]=function(_0x3af42d,_0xe67fa5){var _0x9a063d=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x91'));var _0x2f561d={'where':{'id':_0x3af42d[_0xfc30('0x61')]['id']},'attributes':['id',_0xfc30('0x92'),'showCustomerAvatar'],'raw':!![]};return db[_0xfc30('0x4a')][_0xfc30('0x62')](_0x2f561d)['then'](handleEntityNotFound(_0xe67fa5,null))[_0xfc30('0x19')](function(_0x449019){if(_0x449019){if(!_[_0xfc30('0x89')](_0x449019[_0xfc30('0x92')])){if(fs[_0xfc30('0x8a')](path['join'](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x449019[_0xfc30('0x92')]))&&_0x449019[_0xfc30('0x93')]){_0x9a063d=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x449019[_0xfc30('0x92')]);}}return _0xe67fa5[_0xfc30('0x8c')](_0x9a063d);}})[_0xfc30('0x23')](handleError(_0xe67fa5,null));};exports['getSystemAvatar']=function(_0x11745a,_0x59f133){var _0x4639ff=path[_0xfc30('0x84')](config[_0xfc30('0x85')],'server/files/images/avatars/system_avatar.png');var _0x4d175e={'where':{'id':_0x11745a[_0xfc30('0x61')]['id']},'attributes':['id',_0xfc30('0x94')],'raw':!![]};return db['ChatWebsite'][_0xfc30('0x62')](_0x4d175e)[_0xfc30('0x19')](handleEntityNotFound(_0x59f133,null))[_0xfc30('0x19')](function(_0x4fda34){if(_0x4fda34){if(!_[_0xfc30('0x89')](_0x4fda34['systemAvatar'])){if(fs[_0xfc30('0x8a')](path['join'](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x4fda34[_0xfc30('0x94')]))){_0x4639ff=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x4fda34['systemAvatar']);}}return _0x59f133['download'](_0x4639ff);}})[_0xfc30('0x23')](handleError(_0x59f133,null));};function checkWebsiteInterval(_0x536002){var _0x512723=_0x536002[_0xfc30('0x95')];if(!_0x512723){return Promise[_0xfc30('0x96')](_0x536002);}var _0x418c79=_0x536002[_0xfc30('0x97')]||undefined;return _0x512723[_0xfc30('0x98')](_0x418c79)['then'](function(_0x220206){if(!_0x220206){throw new APIOutOfIntervalError();}return _0x536002;});}exports[_0xfc30('0x99')]=function(_0x396d3e,_0x5928b8){var _0x71abfb={'body':_0x396d3e['body'],'channel':'chat'};var _0x176430=[];var _0x413415=[];var _0x519f65={};var _0xa0c526=![];if(_0x396d3e[_0xfc30('0x66')]['id']){delete _0x396d3e['body']['id'];}if(_[_0xfc30('0x89')](_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9a')])){throw new APIBadRequestError(_0xfc30('0x9b'));}if(_[_0xfc30('0x89')](_0x396d3e[_0xfc30('0x66')]['mapKey'])){throw new APIBadRequestError(_0xfc30('0x9c'));}if(_[_0xfc30('0x9d')](_0x396d3e[_0xfc30('0x66')][_0xfc30('0x66')])){throw new APIBadRequestError(_0xfc30('0x9e'));}var _0x844552=_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9f')]&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0x3b')];return db[_0xfc30('0xa0')][_0xfc30('0x6e')]()[_0xfc30('0x19')](function(_0x1e88bd){if(!_0x1e88bd){throw new Error(_0xfc30('0xa1'));}_0x176430=Object[_0xfc30('0x4e')](_0x1e88bd)[_0xfc30('0x5a')](function(_0x26212b){return![_0xfc30('0xa2'),_0xfc30('0xa3')]['includes'](_0x26212b);});_0x413415=Object[_0xfc30('0x4e')](_0x1e88bd)[_0xfc30('0x5a')](function(_0x7c57b){return![_0xfc30('0xa2'),'updatedAt',_0xfc30('0xa4'),'ListId']['includes'](_0x7c57b);});if(!_[_0xfc30('0xa5')](_0x413415,_0x396d3e[_0xfc30('0x66')][_0xfc30('0xa6')])){throw new APIBadRequestError(_0xfc30('0xa7')+_0x413415[_0xfc30('0x84')](',\x20'));}_0x519f65[_0x396d3e[_0xfc30('0x66')]['mapKey']]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9a')];})[_0xfc30('0x19')](function(){return db[_0xfc30('0x4a')]['find']({'where':{'id':_0x396d3e[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0xa8')],'as':_0xfc30('0xa9'),'include':[{'model':db[_0xfc30('0xa0')],'as':_0xfc30('0xaa'),'where':_0x519f65,'limit':0x1,'order':[[_0xfc30('0xa3'),_0xfc30('0xab')]]}]},{'model':db['ChatApplication'],'as':_0xfc30('0xac')},{'model':db['Interval'],'as':_0xfc30('0x95'),'include':[{'model':db[_0xfc30('0x95')],'as':_0xfc30('0xad'),'attributes':['id',_0xfc30('0xae')],'raw':!![]}]}]});})[_0xfc30('0x19')](function(_0x3dbe04){if(!_0x3dbe04){throw new APINotFoundError(util[_0xfc30('0x3e')](_0xfc30('0xaf'),_0x396d3e[_0xfc30('0x61')]['id']));}if(_0x844552){return checkWebsiteInterval(_0x3dbe04);}return _0x3dbe04;})['then'](function(_0x27da3f){_0x71abfb[_0xfc30('0xb0')]=_0x27da3f;_0x71abfb[_0xfc30('0xb1')]=_[_0xfc30('0xb2')](_0x27da3f[_0xfc30('0xac')],[_0xfc30('0xb3')],[_0xfc30('0xb4')]);if(_0x71abfb[_0xfc30('0xb0')][_0xfc30('0xac')]){delete _0x71abfb[_0xfc30('0xb0')][_0xfc30('0xac')];}_0x71abfb[_0xfc30('0xb5')]=_0x27da3f[_0xfc30('0xa9')]||{'id':_0x27da3f[_0xfc30('0xb6')]};if(_0x71abfb['list']&&_0x71abfb[_0xfc30('0xb5')]['Contacts']['length']){return _0x71abfb['list'][_0xfc30('0xaa')][0x0];}var _0x34a352=_[_0xfc30('0xb7')](_0x396d3e[_0xfc30('0x66')],{'firstName':_0x396d3e['body'][_0xfc30('0x9a')],'ListId':_0x27da3f[_0xfc30('0xb6')]});_0x34a352[_0x396d3e[_0xfc30('0x66')]['mapKey']]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9a')];return db[_0xfc30('0xa0')][_0xfc30('0x63')](_0x34a352,{'fields':_0x176430,'raw':!![]});})[_0xfc30('0x19')](function(_0x3f828f){_0x71abfb[_0xfc30('0xb8')]=_0x3f828f;var _0x1735d9=createInteractionObject(_0x396d3e[_0xfc30('0x61')]['id'],_0x396d3e[_0xfc30('0x66')],_0x396d3e[_0xfc30('0xb9')],_0x3f828f);var _0x558fac={'ChatWebsiteId':_0x396d3e['params']['id']};if(_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')]){_0x558fac['threadId']=_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')];_0x558fac[_0xfc30('0xbb')]=![];return db[_0xfc30('0xbc')]['find']({'where':_0x558fac})[_0xfc30('0x19')](function(_0x59a8f2){if(_0x59a8f2){_0xa0c526=!![];return _0x59a8f2;}else if(!_0x844552&&_0x59a8f2&&_0x59a8f2[_0xfc30('0xbb')]){throw new APIConflictError(_0xfc30('0xbd'));}_0x1735d9[_0xfc30('0xba')]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')];_0x1735d9[_0xfc30('0xbe')]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0xbe')];return db[_0xfc30('0xbc')][_0xfc30('0x63')](_0x1735d9);});}_0x558fac[_0xfc30('0xbf')]=_0x3f828f['id'];if(_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc0')]&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc0')]['id']){_0x558fac['id']=_0x396d3e['body'][_0xfc30('0xc0')]['id'];return db['ChatInteraction']['find']({'where':_0x558fac})[_0xfc30('0x19')](function(_0x25a638){var _0x1c313f=_0x396d3e['body']['customerIp']&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0x3b')];if(!_0x1c313f&&_0x25a638&&_0x25a638[_0xfc30('0xbb')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x25a638){_0xa0c526=!![];return _0x25a638;}else{return db['ChatInteraction'][_0xfc30('0x63')](_0x1735d9);}});}return db[_0xfc30('0xbc')][_0xfc30('0x63')](_0x1735d9);})[_0xfc30('0x19')](function(_0x4659d1){if(!_0xa0c526){return _0x4659d1;}var _0x2d56d2={'from':(_0x71abfb['contact']['firstName']||'')+'\x20'+(_0x71abfb['contact']['lastName']||'')};if(_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')]&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc1')]&&_0x396d3e[_0xfc30('0x66')]['threadId']!=_0x396d3e[_0xfc30('0x66')]['messageId']){_0x2d56d2[_0xfc30('0xba')]=_0x396d3e['body'][_0xfc30('0xc1')];}return _0x4659d1[_0xfc30('0x6d')](_0x2d56d2);})[_0xfc30('0x19')](function(_0x2a7952){_0x71abfb['interaction']=_0x2a7952['get']({'plain':!![]});_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xc2')]=!_0xa0c526;if(_0x71abfb[_0xfc30('0xc0')]['created']){if(_0x71abfb[_0xfc30('0xb0')][_0xfc30('0xc3')]){_0x71abfb[_0xfc30('0xb1')][_0xfc30('0xc4')]({'id':0x0,'priority':_0x71abfb[_0xfc30('0xb1')][_0xfc30('0x52')]+0x1,'app':_0xfc30('0xc5'),'appdata':_0xfc30('0xc6'),'interval':_0xfc30('0xc7')});}}return db[_0xfc30('0xc8')][_0xfc30('0x63')]({'body':_0x396d3e[_0xfc30('0x66')][_0xfc30('0x66')],'ChatWebsiteId':_0x396d3e[_0xfc30('0x61')]['id'],'ChatInteractionId':_0x2a7952['id'],'direction':'in','ContactId':_0x71abfb[_0xfc30('0xb8')]['id'],'AttachmentId':_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc9')]});})[_0xfc30('0x19')](function(_0x1db411){_0x71abfb[_0xfc30('0x21')]=_0x1db411;if(!_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xca')]){return;}return db[_0xfc30('0xcb')]['find']({'attributes':['id','name'],'where':{'id':_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xca')]}});})[_0xfc30('0x19')](function(_0x587da5){if(_0x587da5){_0x71abfb['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xfc30('0xcc'),'appdata':_0x587da5[_0xfc30('0x31')]+','+(_0x71abfb['account'][_0xfc30('0xcd')]||0xa),'interval':_0xfc30('0xc7')});_0x71abfb[_0xfc30('0xce')]=!![];}if(!_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xcf')]){return;}return db[_0xfc30('0xd0')]['find']({'attributes':['id','name'],'where':{'id':_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xcf')]}});})[_0xfc30('0x19')](function(_0x96eda9){if(_0x96eda9){_0x71abfb[_0xfc30('0xb1')][_0xfc30('0xd1')]({'id':0x0,'priority':0x1,'app':_0xfc30('0xd2'),'appdata':_0x96eda9[_0xfc30('0x31')]+','+(_0x71abfb[_0xfc30('0xb0')][_0xfc30('0xd3')]||0x12c),'interval':_0xfc30('0xc7')});}return respondWithRpcPromise(_0xfc30('0xd4'),_0xfc30('0xd5'),_0x71abfb);})[_0xfc30('0x19')](function(_0x160c27){respondWithRpcPromise('EventManager',_0xfc30('0xd6'),{'event':_0xfc30('0x99'),'message':_0x160c27},client9002);return _0x160c27;})[_0xfc30('0x19')](respondWithResult(_0x5928b8,null))[_0xfc30('0x23')](APIHandleError(_0x5928b8));};exports[_0xfc30('0xd7')]=function(_0x24a6f7,_0x2b5449){var _0x3038a1,_0xc1c6e7,_0x103296;var _0x307633=[];var _0x16a2d5={};var _0x1268f4=_0x24a6f7[_0xfc30('0xd8')]||[];var _0x240466=[];var _0x143221;return db[_0xfc30('0xa0')][_0xfc30('0x6e')]()[_0xfc30('0x19')](function(_0x508f5f){if(!_0x508f5f){throw new db[(_0xfc30('0xd9'))]['ValidationError'](_0xfc30('0xda'));}_0x307633=_['difference'](_['keys'](_0x508f5f),[_0xfc30('0xa2'),'updatedAt','CompanyId',_0xfc30('0xb6')]);if(_0x24a6f7['body']['id']){delete _0x24a6f7['body']['id'];}if(_[_0xfc30('0x89')](_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x9a')])){throw _0x2b5449[_0xfc30('0x26')](0x1f4)['send'](new db[(_0xfc30('0xd9'))][(_0xfc30('0xdb'))](_0xfc30('0xdc')));}if(_[_0xfc30('0x89')](_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x66')])||_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x66')]===''){throw _0x2b5449[_0xfc30('0x26')](0x1f4)[_0xfc30('0x32')](new db['Sequelize'][(_0xfc30('0xdb'))](_0xfc30('0xdd')));}if(_[_0xfc30('0x89')](_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')])){throw _0x2b5449[_0xfc30('0x26')](0x1f4)[_0xfc30('0x32')](new db[(_0xfc30('0xd9'))][(_0xfc30('0xdb'))](_0xfc30('0xdf')+_0x307633));}if(!_[_0xfc30('0xa5')](_0x307633,_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')])){throw _0x2b5449[_0xfc30('0x26')](0x1f4)['send'](new db[(_0xfc30('0xd9'))][(_0xfc30('0xdb'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x307633));}_0x16a2d5[_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')]]=_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x9a')];})[_0xfc30('0x19')](function(){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x24a6f7['params']['id']},'include':[{'model':db[_0xfc30('0xa8')],'as':'List'},{'model':db['MailAccount'],'as':_0xfc30('0xe0')}]});})['then'](handleEntityNotFound(_0x2b5449,null))[_0xfc30('0x19')](function(_0x40881b){if(_0x40881b&&_0x40881b['List']){_0xc1c6e7=_0x40881b;var _0x4cca52=_[_0xfc30('0xb7')](_0x24a6f7[_0xfc30('0x66')],{'firstName':_0x24a6f7['body'][_0xfc30('0x9a')],'phone':_0x24a6f7[_0xfc30('0x66')]['from'],'ListId':_0x40881b[_0xfc30('0xb6')]});_0x4cca52[_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')]]=_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x9a')];return db[_0xfc30('0xa0')][_0xfc30('0xe1')]({'where':_0x16a2d5,'defaults':_0x4cca52});}})['spread'](function(_0x9b9303){if(_0x9b9303){_0x103296=_0x9b9303;var _0x269cec=fs[_0xfc30('0xe2')](path['join'](config[_0xfc30('0x85')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x92203=ejs[_0xfc30('0xe3')](_0x269cec,{'body':_[_0xfc30('0xe4')](_0x24a6f7['body'][_0xfc30('0x66')]),'bodyTitle':_0xc1c6e7[_0xfc30('0xe5')]});return db[_0xfc30('0xe6')][_0xfc30('0x63')]({'body':_0x92203,'plainBody':htmlToText[_0xfc30('0xe7')](_0x92203),'ContactId':_0x9b9303['id'],'ChatWebsiteId':_0xc1c6e7['id']});}})[_0xfc30('0x19')](function(_0x108916){_0x143221=_0x108916;if(_0x1268f4[_0xfc30('0x52')]){var _0x376d70=_0x1268f4[_0xfc30('0x49')](function(_0x2a41c7){return{'name':_0x2a41c7[_0xfc30('0xe8')],'basename':_0x2a41c7[_0xfc30('0x80')],'type':_0x2a41c7[_0xfc30('0xe9')],'ChatOfflineMessageId':_0x108916['id']};});_0x240466=_0x376d70[_0xfc30('0x49')](_0x42a055=>{var _0x3ef026={'filename':_0x42a055[_0xfc30('0x31')],'path':path[_0xfc30('0x84')](config['root'],_0xfc30('0xea'),_0xfc30('0xd8'),_0xfc30('0xeb'),_0xfc30('0xec'),_0x42a055[_0xfc30('0xed')])};return _0x3ef026;});if(!_0xc1c6e7[_0xfc30('0xee')]){return db[_0xfc30('0xef')][_0xfc30('0xf0')](function(_0x1ad45d){return db[_0xfc30('0xf1')][_0xfc30('0xf2')](_0x376d70,{'transaction':_0x1ad45d});});}}})[_0xfc30('0x19')](function(){if(_0x143221){_0x3038a1=_0x143221;return db['MailAccount'][_0xfc30('0x72')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xfc30('0xf3'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xfc30('0xf4'),'raw':!![]}]}]});}})['then'](function(_0x48f72c){if(_0x48f72c&&_0x48f72c['Smtp']&&_0xc1c6e7['forwardOffline']&&_0xc1c6e7['forwardOfflineAddress']){var _0x43e422=_0x48f72c[_0xfc30('0xf5')]();return respondWithRpcPromise('SendMail',_0xfc30('0xf6'),{'account':_0x43e422,'message':{'from':util[_0xfc30('0x3e')](_0xfc30('0xf7'),_0x48f72c[_0xfc30('0x31')],_0x48f72c['email']||_0x48f72c[_0xfc30('0xf3')][_0xfc30('0x68')]),'to':_0xc1c6e7['forwardOfflineAddress'],'subject':_0xc1c6e7[_0xfc30('0xf8')],'html':_0x3038a1['body'],'attachments':_0x240466}},client9003)[_0xfc30('0x19')](function(){return _0x3038a1;})['catch'](function(_0x39544a){logger[_0xfc30('0x20')](_0x39544a);});}})[_0xfc30('0x19')](function(){if(_0xc1c6e7&&_0xc1c6e7[_0xfc30('0xee')]&&_0xc1c6e7['MailAccountId']){var _0x2a7c37=[];if(_0x1268f4['length']){_0x2a7c37=_0x1268f4[_0xfc30('0x49')](function(_0x54a6d5){return{'name':_0x54a6d5[_0xfc30('0xe8')],'basename':_0x54a6d5['filename'],'type':_0x54a6d5[_0xfc30('0xe9')],'ChatOfflineMessageId':_0x143221['id']};});}var _0x473a01;if(!_['isNil'](_0xc1c6e7['subjectOffline'])){var _0x508b31=_[_0xfc30('0x49')](_0x24a6f7[_0xfc30('0x66')],function(_0x5278fc){return _0x5278fc;});var _0x4b7128=_[_0xfc30('0xf9')](_0x508b31)[0x0];var _0x186dea=_[_0xfc30('0xfa')](_0x4b7128,function(_0xe19826){return _0xe19826;});_0x473a01=_0x186dea[0x1][_0xc1c6e7['subjectOffline']];}var _0x286608={'from':_0x103296[_0xfc30('0xfb')],'firstName':_0x103296[_0xfc30('0xfc')],'lastName':_0x103296[_0xfc30('0x39')],'mapKey':_0xfc30('0xfb'),'message':{'from':_0x103296['email'],'to':_0xc1c6e7[_0xfc30('0xe0')][_0xfc30('0xfb')],'cc':'','subject':_[_0xfc30('0x89')](_0x473a01)?_0xc1c6e7[_0xfc30('0xf8')]:_0x473a01,'messageId':'','sentAt':new Date(),'attach':_0x2a7c37[_0xfc30('0x52')],'attachments':_0x2a7c37,'originChannel':_0xfc30('0xfd'),'ChatWebsiteId':_0xc1c6e7['id'],'ChatOfflineMessageId':_0x3038a1['id'],'originTo':_0xc1c6e7[_0xfc30('0xe0')][_0xfc30('0xfb')]},'body':_0x3038a1[_0xfc30('0x66')]};var _0x46377a={'account':{'id':_0xc1c6e7[_0xfc30('0xfe')]},'body':_0x286608,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xfc30('0xff'),'notifyMail',_0x46377a,client9001)[_0xfc30('0x19')](function(){return _0x3038a1;})[_0xfc30('0x23')](function(_0x2285ab){logger[_0xfc30('0x20')](_0x2285ab);});}return;})[_0xfc30('0x19')](function(){if(_0x3038a1){return _0x3038a1;}})['then'](respondWithResult(_0x2b5449,null))[_0xfc30('0x23')](function(){for(var _0x11bbc3 of _0x1268f4){var _0x3e084b=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0xea'),_0xfc30('0xd8'),_0xfc30('0xeb'),_0xfc30('0xec'),_0x11bbc3[_0xfc30('0x80')]);fs_extra[_0xfc30('0x100')](_0x3e084b)[_0xfc30('0x23')](function(_0x4da83d){logger[_0xfc30('0x20')]('Could\x20not\x20remove\x20attachment\x20file',_0x3e084b,_0x4da83d);});}});};exports['addInteraction']=function(_0x329863,_0xfe439b){return db[_0xfc30('0xbc')][_0xfc30('0x62')]({'where':{'id':_0x329863[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0xfe439b,null))['then'](function(_0x4a7570){if(_0x4a7570){return _0x4a7570['addInteraction'](_0x329863['body'][_0xfc30('0x76')],_[_0xfc30('0x101')](_0x329863[_0xfc30('0x66')],[_0xfc30('0x76'),'id'])||{});}})[_0xfc30('0x19')](respondWithResult(_0xfe439b,null))[_0xfc30('0x23')](handleError(_0xfe439b,null));};exports[_0xfc30('0x102')]=function(_0x14e589,_0x63b746){var _0x2c689c={'raw':![],'where':{}};var _0x48f797={};var _0x442966={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfc30('0x72')]({'where':{'id':_0x14e589[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x63b746,null))['then'](function(_0x2d4f56){if(_0x2d4f56){_0x48f797[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db['ChatInteraction'][_0xfc30('0x4b')]);_0x48f797['query']=_[_0xfc30('0x4e')](_0x14e589[_0xfc30('0x4d')]);_0x48f797[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x48f797['model'],_0x48f797[_0xfc30('0x4d')]);_0x2c689c[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x48f797['model'],qs['fields'](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x2c689c[_0xfc30('0x50')]=_0x2c689c[_0xfc30('0x50')][_0xfc30('0x52')]?_0x2c689c[_0xfc30('0x50')]:_0x48f797[_0xfc30('0x42')];if(!_0x14e589[_0xfc30('0x4d')]['hasOwnProperty']('nolimit')){_0x2c689c['limit']=qs[_0xfc30('0x29')](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x2c689c[_0xfc30('0x2b')]=qs['offset'](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x2c689c[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x2c689c[_0xfc30('0x56')]=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x14e589[_0xfc30('0x4d')],_0x48f797[_0xfc30('0x58')]));_0x2c689c[_0xfc30('0x56')][_0xfc30('0x70')]=_0x2d4f56['id'];if(_0x14e589[_0xfc30('0x4d')]['filter']){_0x2c689c[_0xfc30('0x56')]=_['merge'](_0x2c689c[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x2c689c[_0xfc30('0x50')],function(_0x21b87e){var _0x1c0b20={};_0x1c0b20[_0x21b87e]={'$like':'%'+_0x14e589['query'][_0xfc30('0x5a')]+'%'};return _0x1c0b20;})});}_0x2c689c=_['merge']({},_0x2c689c,_0x14e589[_0xfc30('0x5b')]);return db[_0xfc30('0xbc')][_0xfc30('0x2a')]({'where':_0x2c689c[_0xfc30('0x56')]})['then'](function(_0x1918f7){_0x442966[_0xfc30('0x2a')]=_0x1918f7;if(_0x14e589['query'][_0xfc30('0x5c')]){_0x2c689c[_0xfc30('0x5d')]=[{'model':db['CmContact'],'as':_0xfc30('0x103'),'required':![]},{'model':db[_0xfc30('0xcb')],'as':'Owner','attributes':[_0xfc30('0x31'),_0xfc30('0x104'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfc30('0x31'),_0xfc30('0x105')],'where':_0x14e589['query'][_0xfc30('0x106')]?{'id':_0x14e589[_0xfc30('0x4d')][_0xfc30('0x106')]}:undefined,'required':_0x14e589['query'][_0xfc30('0x106')]?!![]:![]}];}return db['ChatInteraction'][_0xfc30('0x5e')](_0x2c689c);})[_0xfc30('0x19')](function(_0x5aa9f5){_0x442966[_0xfc30('0x5f')]=_0x5aa9f5;return _0x442966;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x63b746,_0x2c689c))['catch'](handleError(_0x63b746,null));};exports[_0xfc30('0x107')]=function(_0x4097fc,_0xfe7bc2){var _0x14d5b3=0x0;var _0x56786e=0x0;var _0x20f1d1=![];var _0x3fa802;var _0x5d93d9;return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x4097fc[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0x95')],'as':'Interval','include':[{'model':db[_0xfc30('0x95')],'as':'Intervals','attributes':['id','interval']}]}]})[_0xfc30('0x19')](handleEntityNotFound(_0xfe7bc2,null))[_0xfc30('0x19')](function(_0x56882a){if(_0x56882a){_0x3fa802=_0x56882a;return _0x56882a['getProactiveActions']({'raw':!![]});}})['then'](function(_0x530108){if(_0x3fa802){if(_0x530108){_0x5d93d9=_0x530108;}}return require(_0xfc30('0x108'))['getLicense']();})[_0xfc30('0x19')](function(_0x198ae7){if(_0x198ae7){_0x56786e=_0x198ae7[_0xfc30('0x109')];_0x20f1d1=_0x198ae7[_0xfc30('0x88')];}})[_0xfc30('0x19')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x5971fd){_0x14d5b3=_0x5971fd;if(_0x56786e&&_0x5971fd>_0x56786e){return db[_0xfc30('0x10a')][_0xfc30('0x72')]({'where':{'id':0x1}})[_0xfc30('0x19')](function(_0x49c078){if(_0x49c078){_0x49c078['increment'](_0xfc30('0x10b'));}});}})['then'](function(){var _0x8701f4=_0x3fa802[_0xfc30('0x95')];var _0x56f61f=_0x3fa802[_0xfc30('0x97')]||undefined;return _0x8701f4?_0x8701f4[_0xfc30('0x98')](_0x56f61f):!![];})[_0xfc30('0x19')](function(_0x4bdef5){var _0xccc47=fs[_0xfc30('0xe2')](path[_0xfc30('0x84')](config['root'],'server/files/chat/iframe.ejs'),_0xfc30('0x10c'));var _0x5ce529=_0xfc30('0x10d');var _0x74e72f=![];try{const _0x4c261d=new URL(_0x3fa802[_0xfc30('0x65')]);_0x3fa802[_0xfc30('0x65')]=_0x4c261d[_0xfc30('0x10e')];}catch(_0x2b8d21){}var _0xde49d0;if(_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')]){_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')]=_0x4097fc['headers'][_0xfc30('0x3b')][_0xfc30('0x10f')](/\/$/,'');_0xde49d0=wildcardUtils[_0xfc30('0x110')](_0x3fa802[_0xfc30('0x65')],_0x4097fc['headers'][_0xfc30('0x3b')]);}else{_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')]=_0x3fa802[_0xfc30('0x65')];_0xde49d0=!![];}var _0x5ef957={'chatVersion':_0x5ce529,'chatWebsiteAddressOrigin':_0xde49d0?_0x4097fc[_0xfc30('0xb9')]['referer']:_0x3fa802[_0xfc30('0x65')],'remote':_0x3fa802['remote'],'query':querystring[_0xfc30('0x1f')](_['merge'](_0x3fa802[_0xfc30('0x2e')]({'plain':!![]}),{'customerIp':_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x38')]||_0x4097fc[_0xfc30('0xb9')]['x-real-ip']||_0x4097fc['connection'][_0xfc30('0x111')]||_0x4097fc['ip'],'referer':_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')],'openedInteractions':_0x14d5b3,'maxInteractions':_0x56786e,'virtual':_0x20f1d1[_0xfc30('0x109')],'online':_0x4bdef5,'custom':_0x20f1d1,'address':_0xde49d0?_0x4097fc[_0xfc30('0xb9')]['referer']:null}))[_0xfc30('0x10f')](/'/g,'\x5c\x27')};_0xfe7bc2[_0xfc30('0x32')](ejs[_0xfc30('0xe3')](Mustache['render'](_0xccc47,_0x5ef957),{'proactiveActions':_0x5d93d9,'alignment':_0x3fa802[_0xfc30('0x112')],'verticalAlignment':_0x3fa802[_0xfc30('0x113')],'div_color':_0x3fa802[_0xfc30('0x105')],'labelText':_0x3fa802[_0xfc30('0x114')],'text_color':_0x3fa802[_0xfc30('0x115')],'text_button_color':_0x3fa802[_0xfc30('0x116')],'button_color':_0x3fa802[_0xfc30('0x117')],'background_color':_0x3fa802['backgroundColor'],'hideWhenOffline':_0x3fa802['hideWhenOffline'],'intervalId':_0x3fa802['IntervalId'],'isDevelopment':_0x74e72f,'chatVersion':_0x5ce529}));})[_0xfc30('0x23')](handleError(_0xfe7bc2,null));};exports['addApplications']=function(_0xd32274,_0x4aa431){var _0x2f0958=_0xd32274[_0xfc30('0x61')]['id'];var _0x493361=_0xd32274[_0xfc30('0x66')];var _0x11caa2=0xc8;var _0x11d220=null;return db[_0xfc30('0xef')][_0xfc30('0xf0')]({'isolationLevel':db[_0xfc30('0xef')]['Transaction'][_0xfc30('0x118')]['READ_COMMITTED']},function(_0x5a0661){return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x2f0958},'transaction':_0x5a0661})[_0xfc30('0x19')](function(_0x59aa06){if(_0x59aa06){return db[_0xfc30('0x119')][_0xfc30('0x2d')]({'where':{'ChatWebsiteId':_0x2f0958},'transaction':_0x5a0661})[_0xfc30('0x19')](function(){var _0x23851b=_['map'](_0x493361,function(_0x3435eb){_0x3435eb[_0xfc30('0x70')]=_0x2f0958;return _0x3435eb;});return db['ChatApplication'][_0xfc30('0xf2')](_0x23851b,{'transaction':_0x5a0661});});}else{_0x11caa2=0x194;_0x11d220=[];}});})[_0xfc30('0x19')](function(){if(_0x11caa2!==0x194){return db[_0xfc30('0x119')][_0xfc30('0x11a')]({'where':{'ChatWebsiteId':_0x2f0958},'order':_0xfc30('0xb3')})[_0xfc30('0x19')](function(_0x5035df){_0x11d220=_0x5035df;});}})[_0xfc30('0x23')](function(_0x21e58b){_0x11caa2=0x1f4;logger[_0xfc30('0x20')](_0x21e58b[_0xfc30('0x11b')]);if(_0x21e58b['name']){delete _0x21e58b[_0xfc30('0x31')];}_0x11d220=_0x21e58b;})[_0xfc30('0x11c')](function(){if(_0x11d220===null){_0x4aa431[_0xfc30('0x24')](_0x11caa2);}else{if(_0x11caa2===0x1f4){_0x4aa431[_0xfc30('0x26')](_0x11caa2)[_0xfc30('0x32')](_0x11d220);}else{_0x4aa431['status'](_0x11caa2)[_0xfc30('0x27')](_0x11d220);}}});};exports['getApplications']=function(_0x3391ef,_0x17800b){var _0x56be3a={};var _0x357c09={};var _0x25348c;var _0x3e1283;return db['ChatWebsite'][_0xfc30('0x72')]({'where':{'id':_0x3391ef[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x17800b,null))['then'](function(_0x432169){if(_0x432169){_0x25348c=_0x432169;_0x357c09[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db[_0xfc30('0x119')][_0xfc30('0x4b')]);_0x357c09['query']=_[_0xfc30('0x4e')](_0x3391ef[_0xfc30('0x4d')]);_0x357c09[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x357c09['model'],_0x357c09['query']);_0x56be3a[_0xfc30('0x50')]=_['intersection'](_0x357c09[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x3391ef['query']['fields']));_0x56be3a[_0xfc30('0x50')]=_0x56be3a['attributes'][_0xfc30('0x52')]?_0x56be3a['attributes']:_0x357c09[_0xfc30('0x42')];_0x56be3a['order']=qs[_0xfc30('0x55')](_0x3391ef['query']['sort']);_0x56be3a[_0xfc30('0x56')]=qs['filters'](_[_0xfc30('0x57')](_0x3391ef['query'],_0x357c09[_0xfc30('0x58')]));if(_0x3391ef[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x56be3a[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x56be3a['where'],{'$or':_[_0xfc30('0x49')](_0x56be3a['attributes'],function(_0x1e63dd){var _0x7242da={};_0x7242da[_0x1e63dd]={'$like':'%'+_0x3391ef[_0xfc30('0x4d')]['filter']+'%'};return _0x7242da;})});}_0x56be3a=_['merge']({},_0x56be3a,_0x3391ef[_0xfc30('0x5b')]);return _0x25348c[_0xfc30('0x11d')](_0x56be3a);}})[_0xfc30('0x19')](function(_0x3526c9){if(_0x3526c9){_0x3e1283=_0x3526c9['length'];if(!_0x3391ef[_0xfc30('0x4d')]['hasOwnProperty'](_0xfc30('0x73'))){_0x56be3a[_0xfc30('0x29')]=qs['limit'](_0x3391ef[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x56be3a['offset']=qs['offset'](_0x3391ef[_0xfc30('0x4d')][_0xfc30('0x2b')]);}return _0x25348c[_0xfc30('0x11d')](_0x56be3a);}})[_0xfc30('0x19')](function(_0x4cd855){if(_0x4cd855){return _0x4cd855?{'count':_0x3e1283,'rows':_0x4cd855}:null;}})[_0xfc30('0x19')](respondWithResult(_0x17800b,null))[_0xfc30('0x23')](handleError(_0x17800b,null));};exports[_0xfc30('0x11e')]=function(_0x1119e8,_0x2d72b6){return db[_0xfc30('0x11f')][_0xfc30('0x62')]({'where':{'id':_0x1119e8['params']['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x2d72b6,null))[_0xfc30('0x19')](function(_0x1112a7){if(_0x1112a7){return _0x1112a7[_0xfc30('0x11e')](_0x1119e8['body'][_0xfc30('0x76')],_[_0xfc30('0x101')](_0x1119e8[_0xfc30('0x66')],[_0xfc30('0x76'),'id'])||{});}})[_0xfc30('0x19')](respondWithResult(_0x2d72b6,null))['catch'](handleError(_0x2d72b6,null));};exports['getProactiveActions']=function(_0x5d1286,_0x2fc363){var _0x355022={};var _0x495cae={};var _0x214d9e;var _0x505c63;return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x5d1286['params']['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x2fc363,null))[_0xfc30('0x19')](function(_0x413e95){if(_0x413e95){_0x214d9e=_0x413e95;_0x495cae[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db[_0xfc30('0x120')][_0xfc30('0x4b')]);_0x495cae[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x5d1286['query']);_0x495cae[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x495cae[_0xfc30('0x42')],_0x495cae[_0xfc30('0x4d')]);_0x355022[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x495cae[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x5d1286['query'][_0xfc30('0x51')]));_0x355022[_0xfc30('0x50')]=_0x355022[_0xfc30('0x50')][_0xfc30('0x52')]?_0x355022[_0xfc30('0x50')]:_0x495cae[_0xfc30('0x42')];_0x355022[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x355022[_0xfc30('0x56')]=qs['filters'](_[_0xfc30('0x57')](_0x5d1286['query'],_0x495cae['filters']));if(_0x5d1286['query'][_0xfc30('0x5a')]){_0x355022['where']=_['merge'](_0x355022[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x355022['attributes'],function(_0x18efb5){var _0x1d3700={};_0x1d3700[_0x18efb5]={'$like':'%'+_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x1d3700;})});}_0x355022=_[_0xfc30('0x59')]({},_0x355022,_0x5d1286['options']);return _0x214d9e[_0xfc30('0x121')](_0x355022);}})[_0xfc30('0x19')](function(_0x3f1210){if(_0x3f1210){_0x505c63=_0x3f1210[_0xfc30('0x52')];if(!_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0x355022['limit']=qs[_0xfc30('0x29')](_0x5d1286[_0xfc30('0x4d')]['limit']);_0x355022[_0xfc30('0x2b')]=qs[_0xfc30('0x2b')](_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x2b')]);}return _0x214d9e[_0xfc30('0x121')](_0x355022);}})['then'](function(_0x35b9b6){if(_0x35b9b6){return _0x35b9b6?{'count':_0x505c63,'rows':_0x35b9b6}:null;}})[_0xfc30('0x19')](respondWithResult(_0x2fc363,null))[_0xfc30('0x23')](handleError(_0x2fc363,null));};exports[_0xfc30('0x122')]=function(_0x39e0ff,_0x53a976){var _0x24fff6=_0x39e0ff[_0xfc30('0x4d')][_0xfc30('0x123')]===_0xfc30('0x124')?'offlineForm':'onlineForm';return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'attributes':['id',_0x24fff6],'where':{'id':_0x39e0ff[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x53a976,null))[_0xfc30('0x19')](function(_0x8a14b1){if(_0x8a14b1){var _0x14e69e=_0x8a14b1[_0x24fff6];var _0x4fd953=_0x14e69e&&_0x14e69e[_0xfc30('0x125')]?_0x14e69e[_0xfc30('0x125')]:[];_0x53a976[_0xfc30('0x32')]({'fromKey':_['isNil'](_0x14e69e[_0xfc30('0x126')])?undefined:_0x14e69e[_0xfc30('0x126')],'count':_0x4fd953[_0xfc30('0x52')],'rows':_0x4fd953});}})[_0xfc30('0x23')](handleError(_0x53a976,null));};exports[_0xfc30('0x127')]=function(_0x2d18a8,_0x21f301){var _0x1359ba={'raw':![],'where':{}};var _0x2e48b8={};var _0x4c92e9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2d18a8[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x21f301,null))[_0xfc30('0x19')](function(_0x27ecdb){if(_0x27ecdb){_0x2e48b8['model']=_[_0xfc30('0x4e')](db['ChatOfflineMessage'][_0xfc30('0x4b')]);_0x2e48b8[_0xfc30('0x4d')]=_['keys'](_0x2d18a8[_0xfc30('0x4d')]);_0x2e48b8['filters']=_[_0xfc30('0x4f')](_0x2e48b8[_0xfc30('0x42')],_0x2e48b8['query']);_0x1359ba['attributes']=_[_0xfc30('0x4f')](_0x2e48b8[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x1359ba[_0xfc30('0x50')]=_0x1359ba[_0xfc30('0x50')][_0xfc30('0x52')]?_0x1359ba[_0xfc30('0x50')]:_0x2e48b8[_0xfc30('0x42')];if(!_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0x1359ba[_0xfc30('0x29')]=qs['limit'](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x1359ba['offset']=qs[_0xfc30('0x2b')](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x1359ba[_0xfc30('0x54')]=qs['sort'](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x1359ba[_0xfc30('0x56')]=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x2d18a8[_0xfc30('0x4d')],_0x2e48b8['filters']));_0x1359ba[_0xfc30('0x56')][_0xfc30('0x70')]=_0x27ecdb['id'];if(_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x1359ba[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x1359ba[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x1359ba['attributes'],function(_0x3a695c){var _0x2fa611={};_0x2fa611[_0x3a695c]={'$like':'%'+_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x2fa611;})});}_0x1359ba=_[_0xfc30('0x59')]({},_0x1359ba,_0x2d18a8['options']);return db[_0xfc30('0xe6')][_0xfc30('0x2a')]({'where':_0x1359ba[_0xfc30('0x56')]})['then'](function(_0x2bd1e6){_0x4c92e9[_0xfc30('0x2a')]=_0x2bd1e6;if(_0x2d18a8['query'][_0xfc30('0x5c')]){_0x1359ba[_0xfc30('0x5d')]=[{'all':!![]}];}else{_0x1359ba[_0xfc30('0x5d')]=[{'model':db[_0xfc30('0xa0')],'as':_0xfc30('0x103'),'required':![]},{'model':db['Attachment'],'as':_0xfc30('0x128'),'required':![]}];}return db[_0xfc30('0xe6')][_0xfc30('0x5e')](_0x1359ba);})['then'](function(_0x3d1ca4){_0x4c92e9[_0xfc30('0x5f')]=_0x3d1ca4;return _0x4c92e9;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x21f301,_0x1359ba))[_0xfc30('0x23')](handleError(_0x21f301,null));};exports[_0xfc30('0x129')]=function(_0x25551f,_0x27c2cb){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x25551f[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x27c2cb,null))[_0xfc30('0x19')](function(_0x18662a){if(_0x18662a){return _0x18662a[_0xfc30('0x129')](_0x25551f['body'][_0xfc30('0x76')],_[_0xfc30('0x101')](_0x25551f['body'],[_0xfc30('0x76'),'id'])||{})['spread'](function(_0x5eb9b9){for(var _0x1267b7=0x0;_0x1267b7<_0x25551f[_0xfc30('0x66')]['ids'][_0xfc30('0x52')];_0x1267b7+=0x1){socket[_0xfc30('0x12a')](_0xfc30('0x12b'),{'UserId':Number(_0x25551f[_0xfc30('0x66')][_0xfc30('0x76')][_0x1267b7]),'ChatWebsiteId':Number(_0x25551f[_0xfc30('0x61')]['id'])});}return _0x5eb9b9;});}})[_0xfc30('0x19')](respondWithResult(_0x27c2cb,null))[_0xfc30('0x23')](handleError(_0x27c2cb,null));};exports[_0xfc30('0x12c')]=function(_0x7a2fd1,_0x383db9){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x7a2fd1[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x383db9,null))['then'](function(_0x3b3a3c){if(_0x3b3a3c){return _0x3b3a3c['removeAgents'](_0x7a2fd1[_0xfc30('0x4d')]['ids'])[_0xfc30('0x19')](function(){if(_['isArray'](_0x7a2fd1[_0xfc30('0x4d')]['ids'])){for(var _0x5baa80=0x0;_0x5baa80<_0x7a2fd1[_0xfc30('0x4d')]['ids'][_0xfc30('0x52')];_0x5baa80+=0x1){socket[_0xfc30('0x12a')](_0xfc30('0x12d'),{'UserId':Number(_0x7a2fd1[_0xfc30('0x4d')][_0xfc30('0x76')][_0x5baa80]),'ChatWebsiteId':Number(_0x7a2fd1[_0xfc30('0x61')]['id'])});}}else{socket[_0xfc30('0x12a')](_0xfc30('0x12d'),{'UserId':Number(_0x7a2fd1['query'][_0xfc30('0x76')]),'ChatWebsiteId':Number(_0x7a2fd1[_0xfc30('0x61')]['id'])});}});}})[_0xfc30('0x19')](respondWithStatusCode(_0x383db9,null))[_0xfc30('0x23')](handleError(_0x383db9,null));};exports[_0xfc30('0x12e')]=function(_0x66f37d,_0x5bc155){var _0xdbee4b={};var _0x22c9f7={};var _0x1a6c55;var _0x73a15e;return db['ChatWebsite']['findOne']({'where':{'id':_0x66f37d['params']['id']}})['then'](handleEntityNotFound(_0x5bc155,null))[_0xfc30('0x19')](function(_0x27d6ca){if(_0x27d6ca){_0x1a6c55=_0x27d6ca;_0x22c9f7[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db[_0xfc30('0xcb')][_0xfc30('0x4b')]);_0x22c9f7[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x66f37d[_0xfc30('0x4d')]);_0x22c9f7[_0xfc30('0x58')]=_['intersection'](_0x22c9f7[_0xfc30('0x42')],_0x22c9f7['query']);_0xdbee4b[_0xfc30('0x50')]=_['intersection'](_0x22c9f7['model'],qs[_0xfc30('0x51')](_0x66f37d['query'][_0xfc30('0x51')]));_0xdbee4b[_0xfc30('0x50')]=_0xdbee4b[_0xfc30('0x50')][_0xfc30('0x52')]?_0xdbee4b['attributes']:_0x22c9f7['model'];_0xdbee4b[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x66f37d['query'][_0xfc30('0x55')]);_0xdbee4b[_0xfc30('0x56')]=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x66f37d[_0xfc30('0x4d')],_0x22c9f7[_0xfc30('0x58')]));if(_0x66f37d[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0xdbee4b[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0xdbee4b[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0xdbee4b['attributes'],function(_0x2f4379){var _0x55aeae={};_0x55aeae[_0x2f4379]={'$like':'%'+_0x66f37d['query'][_0xfc30('0x5a')]+'%'};return _0x55aeae;})});}_0xdbee4b=_[_0xfc30('0x59')]({},_0xdbee4b,_0x66f37d[_0xfc30('0x5b')]);return _0x1a6c55[_0xfc30('0x12e')](_0xdbee4b);}})[_0xfc30('0x19')](function(_0x24a208){if(_0x24a208){_0x73a15e=_0x24a208['length'];if(!_0x66f37d[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0xdbee4b[_0xfc30('0x29')]=qs[_0xfc30('0x29')](_0x66f37d['query'][_0xfc30('0x29')]);_0xdbee4b[_0xfc30('0x2b')]=qs[_0xfc30('0x2b')](_0x66f37d[_0xfc30('0x4d')][_0xfc30('0x2b')]);}return _0x1a6c55['getAgents'](_0xdbee4b);}})[_0xfc30('0x19')](function(_0x122204){if(_0x122204){return _0x122204?{'count':_0x73a15e,'rows':_0x122204}:null;}})[_0xfc30('0x19')](respondWithResult(_0x5bc155,null))['catch'](handleError(_0x5bc155,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 2227459..9a564fd 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 _0x3a5e=['save','update','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x37906a,_0xee412){var _0x512778=function(_0x4c25c8){while(--_0x4c25c8){_0x37906a['push'](_0x37906a['shift']());}};_0x512778(++_0xee412);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x40609f,_0xdbfb71){_0x40609f=_0x40609f-0x0;var _0xcf48a9=_0x3a5e[_0x40609f];return _0xcf48a9;};'use strict';var EventEmitter=require(_0xe3a5('0x0'));var ChatWebsite=require(_0xe3a5('0x1'))['db'][_0xe3a5('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe3a5('0x3')](0x0);var events={'afterCreate':_0xe3a5('0x4'),'afterUpdate':_0xe3a5('0x5'),'afterDestroy':'remove'};function emitEvent(_0xa86e6b){return function(_0x189d9c,_0x46dbe3,_0xff984c){ChatWebsiteEvents[_0xe3a5('0x6')](_0xa86e6b+':'+_0x189d9c['id'],_0x189d9c);ChatWebsiteEvents['emit'](_0xa86e6b,_0x189d9c);_0xff984c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xe3a5('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x0207=['remove','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x52bb1e,_0x47c818){var _0x15d57d=function(_0x551cd3){while(--_0x551cd3){_0x52bb1e['push'](_0x52bb1e['shift']());}};_0x15d57d(++_0x47c818);}(_0x0207,0x162));var _0x7020=function(_0x1848c0,_0xbe5c3){_0x1848c0=_0x1848c0-0x0;var _0x137cb5=_0x0207[_0x1848c0];return _0x137cb5;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x7020('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7020('0x1'),'afterUpdate':_0x7020('0x2'),'afterDestroy':_0x7020('0x3')};function emitEvent(_0x15db09){return function(_0x2e62fd,_0x25174b,_0x1066dd){ChatWebsiteEvents['emit'](_0x15db09+':'+_0x2e62fd['id'],_0x2e62fd);ChatWebsiteEvents['emit'](_0x15db09,_0x2e62fd);_0x1066dd(null);};}for(var e in events){if(events[_0x7020('0x4')](e)){var event=events[e];ChatWebsite[_0x7020('0x5')](e,emitEvent(event));}}module[_0x7020('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index c010f2c..5d22bc1 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 _0xa7da=['chat_websites','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa7da,0x151));var _0xaa7d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7da[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa7d('0x0'));var util=require(_0xaa7d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa7d('0x2'));var BPromise=require(_0xaa7d('0x3'));var rp=require(_0xaa7d('0x4'));var fs=require('fs');var path=require(_0xaa7d('0x5'));var rimraf=require(_0xaa7d('0x6'));var config=require(_0xaa7d('0x7'));var attributes=require(_0xaa7d('0x8'));module[_0xaa7d('0x9')]=function(_0x583cfd,_0x5f5751){return _0x583cfd[_0xaa7d('0xa')]('ChatWebsite',attributes,{'tableName':_0xaa7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc1a=['request-promise','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','moment','bluebird'];(function(_0x2ac060,_0x24b1c5){var _0x32174a=function(_0x369d12){while(--_0x369d12){_0x2ac060['push'](_0x2ac060['shift']());}};_0x32174a(++_0x24b1c5);}(_0xdc1a,0x1f0));var _0xadc1=function(_0x5c187a,_0x564285){_0x5c187a=_0x5c187a-0x0;var _0x109ed8=_0xdc1a[_0x5c187a];return _0x109ed8;};'use strict';var _=require(_0xadc1('0x0'));var util=require(_0xadc1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xadc1('0x2'));var BPromise=require(_0xadc1('0x3'));var rp=require(_0xadc1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadc1('0x5'));var config=require('../../config/environment');var attributes=require(_0xadc1('0x6'));module[_0xadc1('0x7')]=function(_0x52b0fd,_0x19e897){return _0x52b0fd[_0xadc1('0x8')]('ChatWebsite',attributes,{'tableName':_0xadc1('0x9'),'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 590793f..cf347e3 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 _0xfd79=['message','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0xfd79,0x7e));var _0x9fd7=function(_0x492140,_0x55c4f4){_0x492140=_0x492140-0x0;var _0x34e813=_0xfd79[_0x492140];return _0x34e813;};'use strict';var _=require(_0x9fd7('0x0'));var util=require(_0x9fd7('0x1'));var moment=require(_0x9fd7('0x2'));var BPromise=require(_0x9fd7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fd7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fd7('0x5'));var config=require(_0x9fd7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9fd7('0x7')][_0x9fd7('0x8')]({'port':0x232a});config['redis']=_[_0x9fd7('0x9')](config[_0x9fd7('0xa')],{'host':_0x9fd7('0xb'),'port':0x18eb});var socket=require(_0x9fd7('0xc'))(new Redis(config[_0x9fd7('0xa')]));require(_0x9fd7('0xd'))['register'](socket);function respondWithRpcPromise(_0x65d719,_0x1b2573,_0x8ea6bf){return new BPromise(function(_0x116e17,_0x2c47b0){return client[_0x9fd7('0xe')](_0x65d719,_0x8ea6bf)[_0x9fd7('0xf')](function(_0xd9e954){logger[_0x9fd7('0x10')](_0x9fd7('0x11'),_0x1b2573,_0x9fd7('0x12'));logger[_0x9fd7('0x13')](_0x9fd7('0x14'),_0x1b2573,'request\x20sent',JSON[_0x9fd7('0x15')](_0xd9e954));if(_0xd9e954['error']){if(_0xd9e954[_0x9fd7('0x16')][_0x9fd7('0x17')]===0x1f4){logger[_0x9fd7('0x16')](_0x9fd7('0x11'),_0x1b2573,_0xd9e954['error'][_0x9fd7('0x18')]);return _0x2c47b0(_0xd9e954['error']['message']);}logger[_0x9fd7('0x16')](_0x9fd7('0x11'),_0x1b2573,_0xd9e954[_0x9fd7('0x16')]['message']);return _0x116e17(_0xd9e954[_0x9fd7('0x16')][_0x9fd7('0x18')]);}else{logger[_0x9fd7('0x10')](_0x9fd7('0x11'),_0x1b2573,_0x9fd7('0x12'));_0x116e17(_0xd9e954['result'][_0x9fd7('0x18')]);}})['catch'](function(_0x3e60b3){logger[_0x9fd7('0x16')](_0x9fd7('0x11'),_0x1b2573,_0x3e60b3);_0x2c47b0(_0x3e60b3);});});}
\ No newline at end of file
+var _0xe44d=['moment','bluebird','randomstring','../../config/logger','client','http','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','util'];(function(_0x20b577,_0x38f6d1){var _0xf3e247=function(_0x3db409){while(--_0x3db409){_0x20b577['push'](_0x20b577['shift']());}};_0xf3e247(++_0x38f6d1);}(_0xe44d,0xfb));var _0xde44=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xe44d[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0xde44('0x0'));var moment=require(_0xde44('0x1'));var BPromise=require(_0xde44('0x2'));var rs=require(_0xde44('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xde44('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xde44('0x5')][_0xde44('0x6')]({'port':0x232a});config[_0xde44('0x7')]=_['defaults'](config[_0xde44('0x7')],{'host':_0xde44('0x8'),'port':0x18eb});var socket=require(_0xde44('0x9'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0xc8d5fb,_0x3a88f6,_0x486898){return new BPromise(function(_0x29b0c3,_0x3cf7da){return client[_0xde44('0xa')](_0xc8d5fb,_0x486898)[_0xde44('0xb')](function(_0x408e3c){logger[_0xde44('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x3a88f6,_0xde44('0xd'));logger[_0xde44('0xe')](_0xde44('0xf'),_0x3a88f6,'request\x20sent',JSON['stringify'](_0x408e3c));if(_0x408e3c[_0xde44('0x10')]){if(_0x408e3c[_0xde44('0x10')]['code']===0x1f4){logger[_0xde44('0x10')](_0xde44('0x11'),_0x3a88f6,_0x408e3c[_0xde44('0x10')][_0xde44('0x12')]);return _0x3cf7da(_0x408e3c[_0xde44('0x10')][_0xde44('0x12')]);}logger[_0xde44('0x10')](_0xde44('0x11'),_0x3a88f6,_0x408e3c['error']['message']);return _0x29b0c3(_0x408e3c[_0xde44('0x10')]['message']);}else{logger[_0xde44('0xc')](_0xde44('0x11'),_0x3a88f6,'request\x20sent');_0x29b0c3(_0x408e3c[_0xde44('0x13')]['message']);}})[_0xde44('0x14')](function(_0x222d83){logger['error'](_0xde44('0x11'),_0x3a88f6,_0x222d83);_0x3cf7da(_0x222d83);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a378c00..e129b99 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 _0x7b78=['chatWebsite:','./chatWebsite.events','save','remove','update','removeListener','register'];(function(_0x28286e,_0xd8c672){var _0x3a253e=function(_0x1830e7){while(--_0x1830e7){_0x28286e['push'](_0x28286e['shift']());}};_0x3a253e(++_0xd8c672);}(_0x7b78,0x151));var _0x87b7=function(_0x9e97b0,_0x299854){_0x9e97b0=_0x9e97b0-0x0;var _0x206495=_0x7b78[_0x9e97b0];return _0x206495;};'use strict';var ChatWebsiteEvents=require(_0x87b7('0x0'));var events=[_0x87b7('0x1'),_0x87b7('0x2'),_0x87b7('0x3')];function createListener(_0x691156,_0x328e0d){return function(_0x5ef5cf){_0x328e0d['emit'](_0x691156,_0x5ef5cf);};}function removeListener(_0x3ce43c,_0x46b141){return function(){ChatWebsiteEvents[_0x87b7('0x4')](_0x3ce43c,_0x46b141);};}exports[_0x87b7('0x5')]=function(_0x247627){for(var _0xad5a3c=0x0,_0x20fdcc=events['length'];_0xad5a3c<_0x20fdcc;_0xad5a3c++){var _0x4ce537=events[_0xad5a3c];var _0x5f1150=createListener(_0x87b7('0x6')+_0x4ce537,_0x247627);ChatWebsiteEvents['on'](_0x4ce537,_0x5f1150);}};
\ No newline at end of file
+var _0xbc7a=['update','emit','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xbc7a,0xdd));var _0xabc7=function(_0x2e9f8e,_0x3eafc1){_0x2e9f8e=_0x2e9f8e-0x0;var _0x2e7192=_0xbc7a[_0x2e9f8e];return _0x2e7192;};'use strict';var ChatWebsiteEvents=require(_0xabc7('0x0'));var events=[_0xabc7('0x1'),_0xabc7('0x2'),_0xabc7('0x3')];function createListener(_0x3c85d2,_0x3e53be){return function(_0x1d9e72){_0x3e53be[_0xabc7('0x4')](_0x3c85d2,_0x1d9e72);};}function removeListener(_0x168700,_0x5b750f){return function(){ChatWebsiteEvents['removeListener'](_0x168700,_0x5b750f);};}exports['register']=function(_0x3cd907){for(var _0x77f25d=0x0,_0x425321=events[_0xabc7('0x5')];_0x77f25d<_0x425321;_0x77f25d++){var _0x5d1b8b=events[_0x77f25d];var _0x170c23=createListener(_0xabc7('0x6')+_0x5d1b8b,_0x3cd907);ChatWebsiteEvents['on'](_0x5d1b8b,_0x170c23);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 8b4c704..ca076de 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x39cb=['test','replace','([\x5cw]+)','exports','escapeRegExp','url','localhost'];(function(_0x225c16,_0x58fef4){var _0x503a75=function(_0x4409c6){while(--_0x4409c6){_0x225c16['push'](_0x225c16['shift']());}};_0x503a75(++_0x58fef4);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};var escapeRegExp=require('../../../utils/misc')[_0xb39c('0x0')];var URL=require(_0xb39c('0x1'))['URL'];function testWildcardValidity(_0x266bb4){let _0x3aacb4=!![];try{new URL(_0x266bb4['replace']('*',_0xb39c('0x2')));}catch(_0x285eca){_0x3aacb4=![];}return _0x3aacb4&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xb39c('0x3')](_0x266bb4);}function testWebsiteWithWildcard(_0x2bca14,_0x8a0b3f){let _0x4ae4cf;const _0x32cdcd=escapeRegExp(_0x2bca14)[_0xb39c('0x4')]('\x5c*',_0xb39c('0x5'));try{new URL(_0x2bca14[_0xb39c('0x4')]('\x5c*','localhost'));_0x4ae4cf=new RegExp(_0x32cdcd)['test'](_0x8a0b3f);}catch(_0x41557b){_0x4ae4cf=![];}return _0x4ae4cf;}module[_0xb39c('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0xa4fb=['../../../utils/misc','escapeRegExp','url','URL','replace','localhost','([\x5cw]+)','test'];(function(_0x1528c6,_0x6d8317){var _0x149cb5=function(_0xfea5b3){while(--_0xfea5b3){_0x1528c6['push'](_0x1528c6['shift']());}};_0x149cb5(++_0x6d8317);}(_0xa4fb,0x150));var _0xba4f=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0xa4fb[_0xfb0cfd];return _0x2fd8aa;};var escapeRegExp=require(_0xba4f('0x0'))[_0xba4f('0x1')];var URL=require(_0xba4f('0x2'))[_0xba4f('0x3')];function testWildcardValidity(_0x569bf7){let _0x5d2269=!![];try{new URL(_0x569bf7[_0xba4f('0x4')]('*',_0xba4f('0x5')));}catch(_0x27a519){_0x5d2269=![];}return _0x5d2269&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x569bf7);}function testWebsiteWithWildcard(_0x413f97,_0x3dc285){let _0x379b0f;const _0x18baa8=escapeRegExp(_0x413f97)[_0xba4f('0x4')]('\x5c*',_0xba4f('0x6'));try{new URL(_0x413f97[_0xba4f('0x4')]('\x5c*',_0xba4f('0x5')));_0x379b0f=new RegExp(_0x18baa8)[_0xba4f('0x7')](_0x3dc285);}catch(_0x27f65a){_0x379b0f=![];}return _0x379b0f;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index a320534..e465df3 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 _0xb32f=['server/files','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','multer','util','path','express','Router','fs-extra','./chatWebsite.controller','get','index','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','join','format','now','originalname','file','diskStorage','root','server/files/images/avatars/','%s-%s','single','addAvatar','/:id/customer_avatar','/:id/notify'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb32f,0x1ee));var _0xfb32=function(_0x555786,_0x2770c5){_0x555786=_0x555786-0x0;var _0x5e594d=_0xb32f[_0x555786];return _0x5e594d;};'use strict';var multer=require(_0xfb32('0x0'));var util=require(_0xfb32('0x1'));var path=require(_0xfb32('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb32('0x3'));var router=express[_0xfb32('0x4')]();var fs_extra=require(_0xfb32('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb32('0x6'));router[_0xfb32('0x7')]('/',auth['isAuthenticated'](),controller[_0xfb32('0x8')]);router[_0xfb32('0x7')]('/describe',auth[_0xfb32('0x9')](),controller[_0xfb32('0xa')]);router['get']('/:id',auth[_0xfb32('0x9')](),controller[_0xfb32('0xb')]);router[_0xfb32('0x7')](_0xfb32('0xc'),auth[_0xfb32('0x9')](),controller[_0xfb32('0xd')]);router[_0xfb32('0x7')](_0xfb32('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xfb32('0x7')](_0xfb32('0xf'),controller[_0xfb32('0x10')]);router[_0xfb32('0x7')](_0xfb32('0x11'),controller[_0xfb32('0x12')]);router[_0xfb32('0x7')]('/:id/customer_avatar',controller[_0xfb32('0x13')]);router[_0xfb32('0x7')](_0xfb32('0x14'),controller[_0xfb32('0x15')]);router[_0xfb32('0x7')](_0xfb32('0x16'),auth['isAuthenticated'](),controller[_0xfb32('0x17')]);router[_0xfb32('0x7')]('/:id/snippet',controller[_0xfb32('0x18')]);router[_0xfb32('0x7')](_0xfb32('0x19'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x1a')]);router[_0xfb32('0x7')]('/:id/proactive_actions',auth[_0xfb32('0x9')](),controller[_0xfb32('0x1b')]);router[_0xfb32('0x7')]('/:id/fields',controller[_0xfb32('0x1c')]);router[_0xfb32('0x7')](_0xfb32('0x1d'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x1e')]);router[_0xfb32('0x7')](_0xfb32('0x1f'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x20')]);router['post']('/',auth[_0xfb32('0x9')](),controller[_0xfb32('0x21')]);router[_0xfb32('0x22')](_0xfb32('0xc'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x23')]);router['post'](_0xfb32('0xe'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x238055,_0x530b9c,_0x51d261){_0x51d261(null,path[_0xfb32('0x25')](config['root'],'server/files/images/logos/'));},'filename':function(_0x59fcfe,_0x4d5c56,_0x34f688){_0x34f688(null,util[_0xfb32('0x26')]('%s-%s',Date[_0xfb32('0x27')](),_0x4d5c56[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')](_0xfb32('0xf'),upload['single'](_0xfb32('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0xfb32('0x2a')]({'destination':function(_0x5f4c0e,_0x4237cb,_0x2e803d){_0x2e803d(null,path[_0xfb32('0x25')](config[_0xfb32('0x2b')],_0xfb32('0x2c')));},'filename':function(_0x1184a3,_0x396902,_0x5746e4){_0x5746e4(null,util['format'](_0xfb32('0x2d'),Date['now'](),_0x396902[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')]('/:id/avatar',upload[_0xfb32('0x2e')](_0xfb32('0x29')),controller[_0xfb32('0x2f')]);var upload=multer({'storage':multer[_0xfb32('0x2a')]({'destination':function(_0x5caaf3,_0x2863b1,_0x3f7090){_0x3f7090(null,path['join'](config[_0xfb32('0x2b')],_0xfb32('0x2c')));},'filename':function(_0x2f8818,_0x22dc63,_0x22d55c){_0x22d55c(null,util[_0xfb32('0x26')](_0xfb32('0x2d'),Date['now'](),_0x22dc63[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')](_0xfb32('0x30'),upload['single'](_0xfb32('0x29')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2df540,_0xf52ea9,_0x31cca7){_0x31cca7(null,path[_0xfb32('0x25')](config['root'],_0xfb32('0x2c')));},'filename':function(_0x123d22,_0x2b9455,_0x39ece0){_0x39ece0(null,util[_0xfb32('0x26')](_0xfb32('0x2d'),Date[_0xfb32('0x27')](),_0x2b9455[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')](_0xfb32('0x14'),upload[_0xfb32('0x2e')](_0xfb32('0x29')),controller['addSystemAvatar']);router[_0xfb32('0x22')](_0xfb32('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xfb32('0x2a')]({'destination':function(_0x5cb1cf,_0x112aee,_0x52b3ff){const _0x1bd11c=path[_0xfb32('0x25')](config[_0xfb32('0x2b')],_0xfb32('0x32'),'attachments','offline-chat');fs_extra[_0xfb32('0x33')](_0x1bd11c,function(){_0x52b3ff(null,_0x1bd11c);});},'filename':function(_0x197b97,_0x32734f,_0x43c739){const _0x11665b=_0x32734f[_0xfb32('0x28')][_0xfb32('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4aa4d6=path[_0xfb32('0x35')](_0x11665b);const _0x33562c=Date[_0xfb32('0x27')]()+'-'+_0x11665b[_0xfb32('0x34')](_0x4aa4d6,'')+_0x4aa4d6;_0x43c739(null,_0x33562c);}})});router[_0xfb32('0x22')](_0xfb32('0x36'),offlineUploadMulter[_0xfb32('0x37')](),controller[_0xfb32('0x38')]);router[_0xfb32('0x22')](_0xfb32('0x16'),auth[_0xfb32('0x9')](),controller['addInteraction']);router[_0xfb32('0x22')](_0xfb32('0x19'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x39')]);router['post'](_0xfb32('0x3a'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x3b')]);router[_0xfb32('0x22')](_0xfb32('0x1f'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x3c')]);router[_0xfb32('0x3d')](_0xfb32('0x3e'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x3f')]);router['delete']('/:id',auth[_0xfb32('0x9')](),controller[_0xfb32('0x40')]);router[_0xfb32('0x41')](_0xfb32('0xc'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x42')]);router['delete'](_0xfb32('0xe'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x43')]);router[_0xfb32('0x41')](_0xfb32('0x1f'),auth[_0xfb32('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x4777=['/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/users','getAgents','post','create','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','now','addAvatar','addCustomerAvatar'];(function(_0x47c8ef,_0x3395d5){var _0x4dd012=function(_0x2ee9b0){while(--_0x2ee9b0){_0x47c8ef['push'](_0x47c8ef['shift']());}};_0x4dd012(++_0x3395d5);}(_0x4777,0x18f));var _0x7477=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x4777[_0x903228];return _0xcec81d;};'use strict';var multer=require('multer');var util=require(_0x7477('0x0'));var path=require(_0x7477('0x1'));var timeout=require(_0x7477('0x2'));var express=require(_0x7477('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7477('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7477('0x5'));var controller=require(_0x7477('0x6'));router[_0x7477('0x7')]('/',auth[_0x7477('0x8')](),controller['index']);router['get'](_0x7477('0x9'),auth[_0x7477('0x8')](),controller[_0x7477('0xa')]);router[_0x7477('0x7')](_0x7477('0xb'),auth[_0x7477('0x8')](),controller[_0x7477('0xc')]);router['get'](_0x7477('0xd'),auth[_0x7477('0x8')](),controller[_0x7477('0xe')]);router[_0x7477('0x7')](_0x7477('0xf'),auth[_0x7477('0x8')](),controller[_0x7477('0x10')]);router[_0x7477('0x7')]('/:id/logo',controller[_0x7477('0x11')]);router[_0x7477('0x7')](_0x7477('0x12'),controller[_0x7477('0x13')]);router[_0x7477('0x7')](_0x7477('0x14'),controller[_0x7477('0x15')]);router[_0x7477('0x7')]('/:id/system_avatar',controller[_0x7477('0x16')]);router[_0x7477('0x7')](_0x7477('0x17'),auth['isAuthenticated'](),controller[_0x7477('0x18')]);router[_0x7477('0x7')](_0x7477('0x19'),controller[_0x7477('0x1a')]);router[_0x7477('0x7')](_0x7477('0x1b'),auth[_0x7477('0x8')](),controller[_0x7477('0x1c')]);router[_0x7477('0x7')](_0x7477('0x1d'),auth[_0x7477('0x8')](),controller[_0x7477('0x1e')]);router[_0x7477('0x7')](_0x7477('0x1f'),controller['getFields']);router[_0x7477('0x7')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router['get'](_0x7477('0x20'),auth[_0x7477('0x8')](),controller[_0x7477('0x21')]);router[_0x7477('0x22')]('/',auth[_0x7477('0x8')](),controller[_0x7477('0x23')]);router[_0x7477('0x22')](_0x7477('0xd'),auth[_0x7477('0x8')](),controller['addDisposition']);router[_0x7477('0x22')](_0x7477('0xf'),auth[_0x7477('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x7477('0x24')]({'destination':function(_0x1321ff,_0x3d8e3d,_0x2c43eb){_0x2c43eb(null,path[_0x7477('0x25')](config[_0x7477('0x26')],_0x7477('0x27')));},'filename':function(_0x5ab427,_0x594859,_0x79358d){_0x79358d(null,util[_0x7477('0x28')](_0x7477('0x29'),Date['now'](),_0x594859[_0x7477('0x2a')]));}})});router[_0x7477('0x22')](_0x7477('0x2b'),upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b607e,_0x94817c,_0x53783e){_0x53783e(null,path[_0x7477('0x25')](config[_0x7477('0x26')],_0x7477('0x2f')));},'filename':function(_0x56e815,_0x28f7e7,_0x2fab98){_0x2fab98(null,util['format'](_0x7477('0x29'),Date[_0x7477('0x30')](),_0x28f7e7[_0x7477('0x2a')]));}})});router[_0x7477('0x22')](_0x7477('0x12'),upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x31')]);var upload=multer({'storage':multer[_0x7477('0x24')]({'destination':function(_0x47032e,_0x56dcfd,_0x713230){_0x713230(null,path['join'](config['root'],_0x7477('0x2f')));},'filename':function(_0x491d54,_0x715956,_0x42a39){_0x42a39(null,util['format'](_0x7477('0x29'),Date[_0x7477('0x30')](),_0x715956['originalname']));}})});router[_0x7477('0x22')]('/:id/customer_avatar',upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x32')]);var upload=multer({'storage':multer[_0x7477('0x24')]({'destination':function(_0x5e355a,_0x415509,_0x2dad9c){_0x2dad9c(null,path[_0x7477('0x25')](config[_0x7477('0x26')],'server/files/images/avatars/'));},'filename':function(_0x3e7959,_0x3a33f3,_0x22ff31){_0x22ff31(null,util[_0x7477('0x28')](_0x7477('0x29'),Date['now'](),_0x3a33f3[_0x7477('0x2a')]));}})});router[_0x7477('0x22')](_0x7477('0x33'),upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x34')]);router[_0x7477('0x22')](_0x7477('0x35'),controller[_0x7477('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x13d777,_0x1cac2b,_0x2c1417){const _0x521f94=path['join'](config['root'],_0x7477('0x37'),_0x7477('0x38'),_0x7477('0x39'));fs_extra[_0x7477('0x3a')](_0x521f94,function(){_0x2c1417(null,_0x521f94);});},'filename':function(_0x4850c6,_0xe476c2,_0x284f66){const _0x140976=_0xe476c2[_0x7477('0x2a')][_0x7477('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3ca7e7=path[_0x7477('0x3c')](_0x140976);const _0x186ecd=Date[_0x7477('0x30')]()+'-'+_0x140976[_0x7477('0x3b')](_0x3ca7e7,'')+_0x3ca7e7;_0x284f66(null,_0x186ecd);}})});router[_0x7477('0x22')](_0x7477('0x3d'),offlineUploadMulter[_0x7477('0x3e')](),controller[_0x7477('0x3f')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x7477('0x40')]);router[_0x7477('0x22')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7477('0x41')]);router['post'](_0x7477('0x1d'),auth[_0x7477('0x8')](),controller[_0x7477('0x42')]);router[_0x7477('0x22')](_0x7477('0x20'),auth[_0x7477('0x8')](),controller[_0x7477('0x43')]);router[_0x7477('0x44')](_0x7477('0xb'),auth[_0x7477('0x8')](),controller[_0x7477('0x45')]);router[_0x7477('0x46')]('/:id',auth[_0x7477('0x8')](),controller[_0x7477('0x47')]);router['delete'](_0x7477('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x7477('0x46')]('/:id/canned_answers',auth[_0x7477('0x8')](),controller[_0x7477('0x48')]);router[_0x7477('0x46')](_0x7477('0x20'),auth['isAuthenticated'](),controller[_0x7477('0x49')]);module[_0x7477('0x4a')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index fef0cef..5e32e27 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 _0xfa56=['beaver-logger/server','express','../components/auth/service','Router','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','exports'];(function(_0x568ae7,_0x2b5fa3){var _0x257050=function(_0x43e8df){while(--_0x43e8df){_0x568ae7['push'](_0x568ae7['shift']());}};_0x257050(++_0x2b5fa3);}(_0xfa56,0x10e));var _0x6fa5=function(_0x38d759,_0x3a55b9){_0x38d759=_0x38d759-0x0;var _0x379e54=_0xfa56[_0x38d759];return _0x379e54;};var beaverLogger=require(_0x6fa5('0x0'));var express=require(_0x6fa5('0x1'));var auth=require(_0x6fa5('0x2'));var config=require('../config/environment');var router=express[_0x6fa5('0x3')]();var isProduction=config[_0x6fa5('0x4')]==='production'||![];function clientSideLogs(_0x2bb699,_0x3623b8,_0x4c77a8){var _0x57a36f=_0x2bb699['app'][_0x6fa5('0x5')](_0x6fa5('0x6'));if(!_0x57a36f){throw new Error(_0x6fa5('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x6fa5('0x8'),'logger':_0x57a36f,'enableCors':!isProduction})(_0x2bb699,_0x3623b8,_0x4c77a8);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x6fa5('0x9')]=router;
\ No newline at end of file
+var _0xb85f=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','env','production','get','client-side-logger'];(function(_0x4b420a,_0x37a42f){var _0x5e6392=function(_0x58c14e){while(--_0x58c14e){_0x4b420a['push'](_0x4b420a['shift']());}};_0x5e6392(++_0x37a42f);}(_0xb85f,0x10d));var _0xfb85=function(_0x444b29,_0x127582){_0x444b29=_0x444b29-0x0;var _0x428314=_0xb85f[_0x444b29];return _0x428314;};var beaverLogger=require(_0xfb85('0x0'));var express=require(_0xfb85('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0xfb85('0x2')]===_0xfb85('0x3')||![];function clientSideLogs(_0x25e064,_0x9dda23,_0x1494cd){var _0x5ada75=_0x25e064['app'][_0xfb85('0x4')](_0xfb85('0x5'));if(!_0x5ada75){throw new Error(_0xfb85('0x6'));}return beaverLogger[_0xfb85('0x7')]({'uri':_0xfb85('0x8'),'logger':_0x5ada75,'enableCors':!isProduction})(_0x25e064,_0x9dda23,_0x1494cd);}router[_0xfb85('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0xfb85('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index d2a70a3..5ffd190 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 _0x4357=['MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4357,0x105));var _0x7435=function(_0x200ced,_0x503efa){_0x200ced=_0x200ced-0x0;var _0x28e175=_0x4357[_0x200ced];return _0x28e175;};'use strict';var Sequelize=require(_0x7435('0x0'));module['exports']={'name':{'type':Sequelize[_0x7435('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7435('0x2')](_0x7435('0x3'),_0x7435('0x4'),_0x7435('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7435('0x2')](_0x7435('0x6'),_0x7435('0x7'))},'data1':{'type':Sequelize[_0x7435('0x1')],'comment':_0x7435('0x8')},'data2':{'type':Sequelize[_0x7435('0x1')],'comment':_0x7435('0x9')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7435('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x7435('0xa')],'comment':_0x7435('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x7435('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x4584=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','STRING'];(function(_0x1d53cb,_0x4cf3f1){var _0x1de5fe=function(_0x438bbf){while(--_0x438bbf){_0x1d53cb['push'](_0x1d53cb['shift']());}};_0x1de5fe(++_0x4cf3f1);}(_0x4584,0x18c));var _0x4458=function(_0x335e51,_0x3c63fb){_0x335e51=_0x335e51-0x0;var _0x11637f=_0x4584[_0x335e51];return _0x11637f;};'use strict';var Sequelize=require(_0x4458('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4458('0x1')](_0x4458('0x2'),_0x4458('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4458('0x1')](_0x4458('0x4'),_0x4458('0x5'))},'data1':{'type':Sequelize[_0x4458('0x6')],'comment':_0x4458('0x7')},'data2':{'type':Sequelize[_0x4458('0x6')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x4458('0x6')],'comment':_0x4458('0x8')},'data4':{'type':Sequelize[_0x4458('0x6')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x4458('0x9')],'comment':_0x4458('0xa')},'data6':{'type':Sequelize[_0x4458('0x9')],'comment':_0x4458('0xb')},'data7':{'type':Sequelize[_0x4458('0x9')],'comment':_0x4458('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 3e8b0d0..2b7253c 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 _0xcf4c=['sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','service','MicrosoftAzure','catch','show','params','keys','intersection','length','find','decryptString','data3','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','parse','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','stringify','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost'];(function(_0x3f2deb,_0x4df580){var _0x48760a=function(_0xae8d56){while(--_0xae8d56){_0x3f2deb['push'](_0x3f2deb['shift']());}};_0x48760a(++_0x4df580);}(_0xcf4c,0x1d6));var _0xccf4=function(_0xe7520a,_0x5c2098){_0xe7520a=_0xe7520a-0x0;var _0x54f45b=_0xcf4c[_0xe7520a];return _0x54f45b;};'use strict';var _=require('lodash');var Redis=require(_0xccf4('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xccf4('0x1'));var config=require(_0xccf4('0x2'));var logger=require(_0xccf4('0x3'))(_0xccf4('0x4'));var db=require(_0xccf4('0x5'))['db'];var oauth=require(_0xccf4('0x6'));config['redis']=_[_0xccf4('0x7')](config[_0xccf4('0x8')],{'host':_0xccf4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xccf4('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x117556,_0x5d51e4){_0x5d51e4=_0x5d51e4||0xcc;return function(_0x40f354){if(_0x40f354){return _0x117556[_0xccf4('0xa')](_0x5d51e4);}return _0x117556['status'](_0x5d51e4)[_0xccf4('0xb')]();};}function respondWithResult(_0x10f37b,_0x53b97e){_0x53b97e=_0x53b97e||0xc8;return function(_0x1dbacf){if(_0x1dbacf){return _0x10f37b[_0xccf4('0xc')](_0x53b97e)[_0xccf4('0xd')](_0x1dbacf);}};}function respondWithFilteredResult(_0x11dd5c,_0x499152){return function(_0x4624b1){if(_0x4624b1){var _0x345e2a=typeof _0x499152[_0xccf4('0xe')]==='undefined'&&typeof _0x499152[_0xccf4('0xf')]===_0xccf4('0x10');var _0x588833=_0x4624b1[_0xccf4('0x11')];var _0x50415e=_0x345e2a?0x0:_0x499152['offset'];var _0x30fa7a=_0x345e2a?_0x4624b1[_0xccf4('0x11')]:_0x499152[_0xccf4('0xe')]+_0x499152[_0xccf4('0xf')];var _0x356190;if(_0x30fa7a>=_0x588833){_0x30fa7a=_0x588833;_0x356190=0xc8;}else{_0x356190=0xce;}_0x11dd5c['status'](_0x356190);return _0x11dd5c[_0xccf4('0x12')](_0xccf4('0x13'),_0x50415e+'-'+_0x30fa7a+'/'+_0x588833)[_0xccf4('0xd')](_0x4624b1);}return null;};}function saveUpdates(_0xacb5fb){return function(_0x5ebafc){if(_0x5ebafc){return _0x5ebafc[_0xccf4('0x14')](_0xacb5fb)[_0xccf4('0x15')](function(_0x4e7500){return _0x4e7500;});}return null;};}function removeEntity(_0x55d766){return function(_0x1727c2){if(_0x1727c2){return _0x1727c2[_0xccf4('0x16')]()[_0xccf4('0x15')](function(){_0x55d766[_0xccf4('0xc')](0xcc)[_0xccf4('0xb')]();});}};}function handleEntityNotFound(_0x2c1f6){return function(_0x2c2bce){if(!_0x2c2bce){_0x2c1f6[_0xccf4('0xa')](0x194);}return _0x2c2bce;};}function handleError(_0x345c7c,_0x637fcd){_0x637fcd=_0x637fcd||0x1f4;return function(_0x75e4db){logger[_0xccf4('0x17')](_0x75e4db[_0xccf4('0x18')]);if(_0x75e4db[_0xccf4('0x19')]){delete _0x75e4db[_0xccf4('0x19')];}_0x345c7c['status'](_0x637fcd)['send'](_0x75e4db);};}function maskClientSecret(_0x386e90){return _[_0xccf4('0x1a')](_0x386e90['slice'](0x0,0x3),0x14,'*');}exports[_0xccf4('0x1b')]=function(_0x1275e6,_0x2d8a7d){var _0x18fe1e={},_0x463cec={},_0x2e2e48={'count':0x0,'rows':[]};var _0x24f608=_['map'](db[_0xccf4('0x1c')][_0xccf4('0x1d')],function(_0x3bb9ea){return{'name':_0x3bb9ea[_0xccf4('0x1e')],'type':_0x3bb9ea[_0xccf4('0x1f')][_0xccf4('0x20')]};});_0x463cec[_0xccf4('0x21')]=_[_0xccf4('0x22')](_0x24f608,_0xccf4('0x19'));_0x463cec[_0xccf4('0x23')]=_['keys'](_0x1275e6[_0xccf4('0x23')]);_0x463cec[_0xccf4('0x24')]=_['intersection'](_0x463cec[_0xccf4('0x21')],_0x463cec[_0xccf4('0x23')]);_0x18fe1e[_0xccf4('0x25')]=_['intersection'](_0x463cec[_0xccf4('0x21')],qs['fields'](_0x1275e6['query'][_0xccf4('0x26')]));_0x18fe1e[_0xccf4('0x25')]=_0x18fe1e['attributes']['length']?_0x18fe1e[_0xccf4('0x25')]:_0x463cec[_0xccf4('0x21')];if(!_0x1275e6[_0xccf4('0x23')][_0xccf4('0x27')](_0xccf4('0x28'))){_0x18fe1e['limit']=qs['limit'](_0x1275e6[_0xccf4('0x23')]['limit']);_0x18fe1e[_0xccf4('0xe')]=qs[_0xccf4('0xe')](_0x1275e6[_0xccf4('0x23')][_0xccf4('0xe')]);}_0x18fe1e[_0xccf4('0x29')]=qs['sort'](_0x1275e6[_0xccf4('0x23')][_0xccf4('0x2a')]);_0x18fe1e[_0xccf4('0x2b')]=qs[_0xccf4('0x24')](_[_0xccf4('0x2c')](_0x1275e6[_0xccf4('0x23')],_0x463cec[_0xccf4('0x24')]),_0x24f608);if(_0x1275e6[_0xccf4('0x23')][_0xccf4('0x2d')]){_0x18fe1e[_0xccf4('0x2b')]=_[_0xccf4('0x2e')](_0x18fe1e[_0xccf4('0x2b')],{'$or':_['map'](_0x24f608,function(_0x326f41){if(_0x326f41[_0xccf4('0x1f')]!==_0xccf4('0x2f')){var _0x26b7b4={};_0x26b7b4[_0x326f41[_0xccf4('0x19')]]={'$like':'%'+_0x1275e6['query'][_0xccf4('0x2d')]+'%'};return _0x26b7b4;}})});}_0x18fe1e=_[_0xccf4('0x2e')]({},_0x18fe1e,_0x1275e6[_0xccf4('0x30')]);var _0x47d43d={'where':_0x18fe1e[_0xccf4('0x2b')]};return db[_0xccf4('0x1c')]['count'](_0x47d43d)[_0xccf4('0x15')](function(_0x1e9659){_0x2e2e48['count']=_0x1e9659;if(_0x1275e6[_0xccf4('0x23')][_0xccf4('0x31')]){_0x18fe1e[_0xccf4('0x32')]=[{'all':!![]}];}return db[_0xccf4('0x1c')]['findAll'](_0x18fe1e);})['then'](function(_0x4ee9aa){_0x2e2e48[_0xccf4('0x33')]=_[_0xccf4('0x22')](_0x4ee9aa,function(_0x5c39a7){if(_0x5c39a7[_0xccf4('0x34')]===_0xccf4('0x35')){var _0x4f0bb0=encryptor['decryptString'](_0x5c39a7['data3']);_0x5c39a7['data3']=maskClientSecret(_0x4f0bb0);}return _0x5c39a7;});return _0x2e2e48;})[_0xccf4('0x15')](respondWithFilteredResult(_0x2d8a7d,_0x18fe1e))[_0xccf4('0x36')](handleError(_0x2d8a7d,null));};exports[_0xccf4('0x37')]=function(_0x2b8558,_0x489594){var _0x402630={'raw':!![],'where':{'id':_0x2b8558[_0xccf4('0x38')]['id']}},_0x2fdb1b={};_0x2fdb1b['model']=_[_0xccf4('0x39')](db['CloudProvider'][_0xccf4('0x1d')]);_0x2fdb1b[_0xccf4('0x23')]=_[_0xccf4('0x39')](_0x2b8558[_0xccf4('0x23')]);_0x2fdb1b[_0xccf4('0x24')]=_[_0xccf4('0x3a')](_0x2fdb1b[_0xccf4('0x21')],_0x2fdb1b[_0xccf4('0x23')]);_0x402630[_0xccf4('0x25')]=_[_0xccf4('0x3a')](_0x2fdb1b[_0xccf4('0x21')],qs['fields'](_0x2b8558['query']['fields']));_0x402630[_0xccf4('0x25')]=_0x402630['attributes'][_0xccf4('0x3b')]?_0x402630[_0xccf4('0x25')]:_0x2fdb1b[_0xccf4('0x21')];if(_0x2b8558[_0xccf4('0x23')]['includeAll']){_0x402630['include']=[{'all':!![]}];}_0x402630=_['merge']({},_0x402630,_0x2b8558[_0xccf4('0x30')]);return db[_0xccf4('0x1c')][_0xccf4('0x3c')](_0x402630)[_0xccf4('0x15')](handleEntityNotFound(_0x489594,null))[_0xccf4('0x15')](function(_0x500d43){if(_0x500d43['service']===_0xccf4('0x35')){var _0x53eb55=encryptor[_0xccf4('0x3d')](_0x500d43['data3']);_0x500d43[_0xccf4('0x3e')]=maskClientSecret(_0x53eb55);}return _0x500d43;})[_0xccf4('0x15')](respondWithResult(_0x489594,null))[_0xccf4('0x36')](handleError(_0x489594,null));};exports[_0xccf4('0x3f')]=function(_0x5449a8,_0xf44638){if(!_0x5449a8[_0xccf4('0x40')]['name'])throw new Error(_0xccf4('0x41'));if(!_0x5449a8[_0xccf4('0x40')][_0xccf4('0x34')])throw new Error(_0xccf4('0x42'));var _0x222411=db[_0xccf4('0x1c')][_0xccf4('0x1d')]['service']['values'];if(!_0x222411[_0xccf4('0x43')](_0x5449a8[_0xccf4('0x40')][_0xccf4('0x34')]))throw new Error(_0xccf4('0x44')+_0x222411[_0xccf4('0x45')](',\x20'));if(_0x5449a8['body']['service']===_0xccf4('0x35')&&_0x5449a8[_0xccf4('0x40')][_0xccf4('0x3e')]){_0x5449a8[_0xccf4('0x40')][_0xccf4('0x3e')]=encryptor['encryptString'](_0x5449a8[_0xccf4('0x40')][_0xccf4('0x3e')]);}return db[_0xccf4('0x1c')][_0xccf4('0x3f')](_0x5449a8[_0xccf4('0x40')],{})['then'](respondWithResult(_0xf44638,0xc9))[_0xccf4('0x36')](handleError(_0xf44638,null));};exports[_0xccf4('0x14')]=function(_0x2d4e09,_0x2f2c7d){if(_0x2d4e09[_0xccf4('0x40')]['id']){delete _0x2d4e09[_0xccf4('0x40')]['id'];}return db['CloudProvider'][_0xccf4('0x3c')]({'where':{'id':_0x2d4e09[_0xccf4('0x38')]['id']}})[_0xccf4('0x15')](handleEntityNotFound(_0x2f2c7d,null))['then'](function(_0x57e532){if(_0x57e532[_0xccf4('0x34')]===_0xccf4('0x35')&&_0x2d4e09[_0xccf4('0x40')][_0xccf4('0x3e')]){_0x2d4e09[_0xccf4('0x40')][_0xccf4('0x3e')]=encryptor[_0xccf4('0x46')](_0x2d4e09['body'][_0xccf4('0x3e')]);}return _0x57e532;})[_0xccf4('0x15')](saveUpdates(_0x2d4e09[_0xccf4('0x40')],null))['then'](respondWithResult(_0x2f2c7d,null))[_0xccf4('0x36')](handleError(_0x2f2c7d,null));};exports[_0xccf4('0x16')]=function(_0x308b8b,_0x1a5fab){return db[_0xccf4('0x1c')]['find']({'where':{'id':_0x308b8b[_0xccf4('0x38')]['id']}})[_0xccf4('0x15')](handleEntityNotFound(_0x1a5fab,null))[_0xccf4('0x15')](removeEntity(_0x1a5fab,null))['catch'](handleError(_0x1a5fab,null));};exports[_0xccf4('0x47')]=function(_0x42c859,_0x5827c2){return db[_0xccf4('0x1c')][_0xccf4('0x48')]({'where':{'id':_0x42c859[_0xccf4('0x38')]['id']},'raw':!![]})['then'](function(_0x520597){if(!_0x520597)return _0x5827c2[_0xccf4('0xa')](0x194);return{'url':oauth[_0xccf4('0x49')](_0x520597,_0x42c859[_0xccf4('0x4a')]['id'])};})[_0xccf4('0x15')](respondWithResult(_0x5827c2,null))[_0xccf4('0x36')](handleError(_0x5827c2,null));};exports[_0xccf4('0x4b')]=function(_0x16c8b6,_0x144586){var _0x38cd4e=_0x16c8b6[_0xccf4('0x40')];var _0x58f724;var _0x53ed6b;if(_0x38cd4e[_0xccf4('0x17')])throw _0x38cd4e;redis[_0xccf4('0x4c')](_0x38cd4e[_0xccf4('0x4d')])['then'](function(_0x774dd){if(!_0x774dd)throw new Error('Invalid\x20state\x20parameter');_0x58f724=JSON[_0xccf4('0x4e')](_0x774dd);var _0x38f5e0=Buffer['from'](_0x38cd4e[_0xccf4('0x4d')],_0xccf4('0x4f'))[_0xccf4('0x50')](_0xccf4('0x51'));_0x53ed6b=JSON['parse'](_0x38f5e0);if(!oauth['isValidIdToken'](_0x38cd4e[_0xccf4('0x52')],_0x58f724[_0xccf4('0x53')]))throw new Error(_0xccf4('0x54'));redis[_0xccf4('0x55')](_0x38cd4e[_0xccf4('0x4d')]);return oauth['getOauth2MicrosoftAccessToken'](_0x38cd4e[_0xccf4('0x56')],_0x58f724);})[_0xccf4('0x15')](function(_0x44f3ae){_0x58f724[_0xccf4('0x57')]=_0x44f3ae[_0xccf4('0x58')];_0x58f724[_0xccf4('0x59')]=_0x44f3ae[_0xccf4('0x5a')];return db[_0xccf4('0x1c')]['update']({'data5':_0x58f724[_0xccf4('0x57')],'data6':_0x58f724[_0xccf4('0x59')]},{'where':{'id':_0x58f724['id']}});})[_0xccf4('0x15')](function(){oauth[_0xccf4('0x5b')](_0x58f724);socket[_0xccf4('0x5c')](_0xccf4('0x5d'),{'id':_0x53ed6b['id']});return;})[_0xccf4('0x15')](respondWithStatusCode(_0x144586,null))[_0xccf4('0x36')](function(_0x362be9){if(_0x53ed6b){socket[_0xccf4('0x5c')](_0xccf4('0x5e'),{'id':_0x53ed6b['id']});}if(!_0x58f724){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x362be9);return _0x144586[_0xccf4('0xc')](0x1f4)['send'](_0x362be9['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x58f724['id'],JSON[_0xccf4('0x5f')](_0x362be9));});};
\ No newline at end of file
+var _0x4e61=['CloudProvider','count','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','catch','length','merge','data3','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','find','oauth2MicrosoftAuthorize','findOne','params','user','get','state','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','offset','undefined','limit','set','Content-Range','json','destroy','then','sendStatus','error','stack','send','padEnd','slice','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','VIRTUAL','filter','options'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0x4e61,0x19e));var _0x14e6=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0x4e61[_0x2bd1ec];return _0x2f7577;};'use strict';var _=require(_0x14e6('0x0'));var Redis=require('ioredis');var qs=require(_0x14e6('0x1'));var encryptor=require(_0x14e6('0x2'));var config=require('../../config/environment');var logger=require(_0x14e6('0x3'))(_0x14e6('0x4'));var db=require(_0x14e6('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x14e6('0x6')](config[_0x14e6('0x7')],{'host':_0x14e6('0x8'),'port':0x18eb});var socket=require(_0x14e6('0x9'))(new Redis(config[_0x14e6('0x7')]));var redis=new Redis(config[_0x14e6('0x7')]);function respondWithStatusCode(_0xf0bfb9,_0x5d2b78){_0x5d2b78=_0x5d2b78||0xcc;return function(_0x2ad943){if(_0x2ad943){return _0xf0bfb9['sendStatus'](_0x5d2b78);}return _0xf0bfb9[_0x14e6('0xa')](_0x5d2b78)[_0x14e6('0xb')]();};}function respondWithResult(_0x2a6b8d,_0x4eeddb){_0x4eeddb=_0x4eeddb||0xc8;return function(_0x213328){if(_0x213328){return _0x2a6b8d[_0x14e6('0xa')](_0x4eeddb)['json'](_0x213328);}};}function respondWithFilteredResult(_0x300bf9,_0xaed4aa){return function(_0x22a7d3){if(_0x22a7d3){var _0xb62a92=typeof _0xaed4aa[_0x14e6('0xc')]===_0x14e6('0xd')&&typeof _0xaed4aa[_0x14e6('0xe')]===_0x14e6('0xd');var _0x25615f=_0x22a7d3['count'];var _0x406a45=_0xb62a92?0x0:_0xaed4aa[_0x14e6('0xc')];var _0x450f06=_0xb62a92?_0x22a7d3['count']:_0xaed4aa['offset']+_0xaed4aa['limit'];var _0x470138;if(_0x450f06>=_0x25615f){_0x450f06=_0x25615f;_0x470138=0xc8;}else{_0x470138=0xce;}_0x300bf9[_0x14e6('0xa')](_0x470138);return _0x300bf9[_0x14e6('0xf')](_0x14e6('0x10'),_0x406a45+'-'+_0x450f06+'/'+_0x25615f)[_0x14e6('0x11')](_0x22a7d3);}return null;};}function saveUpdates(_0x5931ef){return function(_0x31607b){if(_0x31607b){return _0x31607b['update'](_0x5931ef)['then'](function(_0x2d1d4e){return _0x2d1d4e;});}return null;};}function removeEntity(_0x267f4){return function(_0x510628){if(_0x510628){return _0x510628[_0x14e6('0x12')]()[_0x14e6('0x13')](function(){_0x267f4[_0x14e6('0xa')](0xcc)[_0x14e6('0xb')]();});}};}function handleEntityNotFound(_0x5f26ce){return function(_0xb7d922){if(!_0xb7d922){_0x5f26ce[_0x14e6('0x14')](0x194);}return _0xb7d922;};}function handleError(_0x131f7c,_0x347764){_0x347764=_0x347764||0x1f4;return function(_0x4d4fad){logger[_0x14e6('0x15')](_0x4d4fad[_0x14e6('0x16')]);if(_0x4d4fad['name']){delete _0x4d4fad['name'];}_0x131f7c[_0x14e6('0xa')](_0x347764)[_0x14e6('0x17')](_0x4d4fad);};}function maskClientSecret(_0x359c9a){return _[_0x14e6('0x18')](_0x359c9a[_0x14e6('0x19')](0x0,0x3),0x14,'*');}exports[_0x14e6('0x1a')]=function(_0x3877d8,_0x3041a4){var _0x4ffc91={},_0x3de028={},_0x1a8037={'count':0x0,'rows':[]};var _0x467690=_[_0x14e6('0x1b')](db['CloudProvider'][_0x14e6('0x1c')],function(_0x34464d){return{'name':_0x34464d[_0x14e6('0x1d')],'type':_0x34464d[_0x14e6('0x1e')]['key']};});_0x3de028[_0x14e6('0x1f')]=_[_0x14e6('0x1b')](_0x467690,_0x14e6('0x20'));_0x3de028[_0x14e6('0x21')]=_[_0x14e6('0x22')](_0x3877d8[_0x14e6('0x21')]);_0x3de028[_0x14e6('0x23')]=_[_0x14e6('0x24')](_0x3de028[_0x14e6('0x1f')],_0x3de028[_0x14e6('0x21')]);_0x4ffc91[_0x14e6('0x25')]=_['intersection'](_0x3de028['model'],qs[_0x14e6('0x26')](_0x3877d8[_0x14e6('0x21')]['fields']));_0x4ffc91[_0x14e6('0x25')]=_0x4ffc91['attributes']['length']?_0x4ffc91[_0x14e6('0x25')]:_0x3de028['model'];if(!_0x3877d8['query']['hasOwnProperty']('nolimit')){_0x4ffc91[_0x14e6('0xe')]=qs[_0x14e6('0xe')](_0x3877d8[_0x14e6('0x21')][_0x14e6('0xe')]);_0x4ffc91['offset']=qs['offset'](_0x3877d8[_0x14e6('0x21')][_0x14e6('0xc')]);}_0x4ffc91[_0x14e6('0x27')]=qs[_0x14e6('0x28')](_0x3877d8['query']['sort']);_0x4ffc91[_0x14e6('0x29')]=qs[_0x14e6('0x23')](_[_0x14e6('0x2a')](_0x3877d8['query'],_0x3de028['filters']),_0x467690);if(_0x3877d8[_0x14e6('0x21')]['filter']){_0x4ffc91[_0x14e6('0x29')]=_['merge'](_0x4ffc91[_0x14e6('0x29')],{'$or':_[_0x14e6('0x1b')](_0x467690,function(_0x97ac3c){if(_0x97ac3c[_0x14e6('0x1e')]!==_0x14e6('0x2b')){var _0x41ab81={};_0x41ab81[_0x97ac3c['name']]={'$like':'%'+_0x3877d8[_0x14e6('0x21')][_0x14e6('0x2c')]+'%'};return _0x41ab81;}})});}_0x4ffc91=_['merge']({},_0x4ffc91,_0x3877d8[_0x14e6('0x2d')]);var _0x3e6c19={'where':_0x4ffc91[_0x14e6('0x29')]};return db[_0x14e6('0x2e')][_0x14e6('0x2f')](_0x3e6c19)[_0x14e6('0x13')](function(_0x54e5ac){_0x1a8037['count']=_0x54e5ac;if(_0x3877d8[_0x14e6('0x21')][_0x14e6('0x30')]){_0x4ffc91[_0x14e6('0x31')]=[{'all':!![]}];}return db['CloudProvider'][_0x14e6('0x32')](_0x4ffc91);})[_0x14e6('0x13')](function(_0x5d7c48){_0x1a8037[_0x14e6('0x33')]=_[_0x14e6('0x1b')](_0x5d7c48,function(_0x24a9e7){if(_0x24a9e7[_0x14e6('0x34')]===_0x14e6('0x35')){var _0x36cb69=encryptor[_0x14e6('0x36')](_0x24a9e7['data3']);_0x24a9e7['data3']=maskClientSecret(_0x36cb69);}return _0x24a9e7;});return _0x1a8037;})[_0x14e6('0x13')](respondWithFilteredResult(_0x3041a4,_0x4ffc91))[_0x14e6('0x37')](handleError(_0x3041a4,null));};exports['show']=function(_0x22845c,_0x75b342){var _0xfadc4e={'raw':!![],'where':{'id':_0x22845c['params']['id']}},_0xdf704f={};_0xdf704f[_0x14e6('0x1f')]=_[_0x14e6('0x22')](db[_0x14e6('0x2e')][_0x14e6('0x1c')]);_0xdf704f[_0x14e6('0x21')]=_[_0x14e6('0x22')](_0x22845c[_0x14e6('0x21')]);_0xdf704f['filters']=_['intersection'](_0xdf704f[_0x14e6('0x1f')],_0xdf704f['query']);_0xfadc4e['attributes']=_[_0x14e6('0x24')](_0xdf704f[_0x14e6('0x1f')],qs[_0x14e6('0x26')](_0x22845c[_0x14e6('0x21')][_0x14e6('0x26')]));_0xfadc4e[_0x14e6('0x25')]=_0xfadc4e[_0x14e6('0x25')][_0x14e6('0x38')]?_0xfadc4e[_0x14e6('0x25')]:_0xdf704f[_0x14e6('0x1f')];if(_0x22845c['query'][_0x14e6('0x30')]){_0xfadc4e['include']=[{'all':!![]}];}_0xfadc4e=_[_0x14e6('0x39')]({},_0xfadc4e,_0x22845c['options']);return db[_0x14e6('0x2e')]['find'](_0xfadc4e)['then'](handleEntityNotFound(_0x75b342,null))[_0x14e6('0x13')](function(_0x12054c){if(_0x12054c['service']===_0x14e6('0x35')){var _0x3dc717=encryptor[_0x14e6('0x36')](_0x12054c[_0x14e6('0x3a')]);_0x12054c['data3']=maskClientSecret(_0x3dc717);}return _0x12054c;})['then'](respondWithResult(_0x75b342,null))[_0x14e6('0x37')](handleError(_0x75b342,null));};exports[_0x14e6('0x3b')]=function(_0x21bf8d,_0x873f27){if(!_0x21bf8d[_0x14e6('0x3c')][_0x14e6('0x20')])throw new Error(_0x14e6('0x3d'));if(!_0x21bf8d['body'][_0x14e6('0x34')])throw new Error(_0x14e6('0x3e'));var _0xc11f1c=db[_0x14e6('0x2e')]['rawAttributes'][_0x14e6('0x34')]['values'];if(!_0xc11f1c['includes'](_0x21bf8d[_0x14e6('0x3c')]['service']))throw new Error(_0x14e6('0x3f')+_0xc11f1c[_0x14e6('0x40')](',\x20'));if(_0x21bf8d[_0x14e6('0x3c')]['service']===_0x14e6('0x35')&&_0x21bf8d[_0x14e6('0x3c')][_0x14e6('0x3a')]){_0x21bf8d[_0x14e6('0x3c')]['data3']=encryptor['encryptString'](_0x21bf8d[_0x14e6('0x3c')]['data3']);}return db['CloudProvider'][_0x14e6('0x3b')](_0x21bf8d[_0x14e6('0x3c')],{})['then'](respondWithResult(_0x873f27,0xc9))['catch'](handleError(_0x873f27,null));};exports[_0x14e6('0x41')]=function(_0x3c87b3,_0x307271){if(_0x3c87b3[_0x14e6('0x3c')]['id']){delete _0x3c87b3['body']['id'];}return db[_0x14e6('0x2e')][_0x14e6('0x42')]({'where':{'id':_0x3c87b3['params']['id']}})[_0x14e6('0x13')](handleEntityNotFound(_0x307271,null))[_0x14e6('0x13')](function(_0xba895d){if(_0xba895d['service']===_0x14e6('0x35')&&_0x3c87b3['body']['data3']){_0x3c87b3[_0x14e6('0x3c')][_0x14e6('0x3a')]=encryptor['encryptString'](_0x3c87b3[_0x14e6('0x3c')][_0x14e6('0x3a')]);}return _0xba895d;})[_0x14e6('0x13')](saveUpdates(_0x3c87b3[_0x14e6('0x3c')],null))[_0x14e6('0x13')](respondWithResult(_0x307271,null))[_0x14e6('0x37')](handleError(_0x307271,null));};exports[_0x14e6('0x12')]=function(_0x3c9e0b,_0x112aad){return db[_0x14e6('0x2e')][_0x14e6('0x42')]({'where':{'id':_0x3c9e0b['params']['id']}})[_0x14e6('0x13')](handleEntityNotFound(_0x112aad,null))[_0x14e6('0x13')](removeEntity(_0x112aad,null))['catch'](handleError(_0x112aad,null));};exports[_0x14e6('0x43')]=function(_0x3c10bc,_0xa42148){return db['CloudProvider'][_0x14e6('0x44')]({'where':{'id':_0x3c10bc[_0x14e6('0x45')]['id']},'raw':!![]})[_0x14e6('0x13')](function(_0x3ec93e){if(!_0x3ec93e)return _0xa42148[_0x14e6('0x14')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3ec93e,_0x3c10bc[_0x14e6('0x46')]['id'])};})[_0x14e6('0x13')](respondWithResult(_0xa42148,null))[_0x14e6('0x37')](handleError(_0xa42148,null));};exports['oauth2MicrosoftCallback']=function(_0x3b0d72,_0x3f7813){var _0x3a7cab=_0x3b0d72[_0x14e6('0x3c')];var _0x238437;var _0x443aa7;if(_0x3a7cab[_0x14e6('0x15')])throw _0x3a7cab;redis[_0x14e6('0x47')](_0x3a7cab[_0x14e6('0x48')])[_0x14e6('0x13')](function(_0x40b81d){if(!_0x40b81d)throw new Error('Invalid\x20state\x20parameter');_0x238437=JSON[_0x14e6('0x49')](_0x40b81d);var _0x3cd8de=Buffer['from'](_0x3a7cab[_0x14e6('0x48')],_0x14e6('0x4a'))[_0x14e6('0x4b')](_0x14e6('0x4c'));_0x443aa7=JSON['parse'](_0x3cd8de);if(!oauth[_0x14e6('0x4d')](_0x3a7cab[_0x14e6('0x4e')],_0x238437[_0x14e6('0x4f')]))throw new Error(_0x14e6('0x50'));redis['del'](_0x3a7cab[_0x14e6('0x48')]);return oauth[_0x14e6('0x51')](_0x3a7cab[_0x14e6('0x52')],_0x238437);})[_0x14e6('0x13')](function(_0x364d82){_0x238437[_0x14e6('0x53')]=_0x364d82[_0x14e6('0x54')];_0x238437[_0x14e6('0x55')]=_0x364d82[_0x14e6('0x56')];return db[_0x14e6('0x2e')][_0x14e6('0x41')]({'data5':_0x238437['data5'],'data6':_0x238437[_0x14e6('0x55')]},{'where':{'id':_0x238437['id']}});})[_0x14e6('0x13')](function(){oauth[_0x14e6('0x57')](_0x238437);socket['emit'](_0x14e6('0x58'),{'id':_0x443aa7['id']});return;})[_0x14e6('0x13')](respondWithStatusCode(_0x3f7813,null))[_0x14e6('0x37')](function(_0xf9c90d){if(_0x443aa7){socket[_0x14e6('0x59')]('microsoftAuthorization:error',{'id':_0x443aa7['id']});}if(!_0x238437){logger[_0x14e6('0x15')]('Invalid\x20authentication\x20state\x20parameter',_0xf9c90d);return _0x3f7813[_0x14e6('0xa')](0x1f4)[_0x14e6('0x17')](_0xf9c90d[_0x14e6('0x5a')]);}logger[_0x14e6('0x15')](_0x14e6('0x5b'),_0x238437['id'],JSON['stringify'](_0xf9c90d));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index c80f370..4816e90 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 _0x0369=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x0369,0x198));var _0x9036=function(_0x1d7503,_0x307723){_0x1d7503=_0x1d7503-0x0;var _0x16a0b2=_0x0369[_0x1d7503];return _0x16a0b2;};'use strict';var _=require(_0x9036('0x0'));var util=require(_0x9036('0x1'));var logger=require(_0x9036('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9036('0x3'));var rp=require(_0x9036('0x4'));var fs=require('fs');var path=require(_0x9036('0x5'));var rimraf=require(_0x9036('0x6'));var config=require(_0x9036('0x7'));var attributes=require(_0x9036('0x8'));module['exports']=function(_0x162dc9,_0x580165){return _0x162dc9[_0x9036('0x9')](_0x9036('0xa'),attributes,{'tableName':_0x9036('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf79=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaf79,0xe6));var _0x9af7=function(_0x1fe5f6,_0xd1e86b){_0x1fe5f6=_0x1fe5f6-0x0;var _0x501ac6=_0xaf79[_0x1fe5f6];return _0x501ac6;};'use strict';var _=require('lodash');var util=require(_0x9af7('0x0'));var logger=require(_0x9af7('0x1'))(_0x9af7('0x2'));var moment=require('moment');var BPromise=require(_0x9af7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9af7('0x4'));var config=require(_0x9af7('0x5'));var attributes=require(_0x9af7('0x6'));module['exports']=function(_0x4b6a2e,_0x5c7594){return _0x4b6a2e[_0x9af7('0x7')](_0x9af7('0x8'),attributes,{'tableName':_0x9af7('0x9'),'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 3b66134..e97f799 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 _0x70a5=['catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','code','id_token','from','stringify','base64','randomBytes','toString','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','oauth2Claims','set','payload','iss','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','data2','data5','refresh_token','update'];(function(_0x121f5e,_0x42d56a){var _0x391c11=function(_0x2564bf){while(--_0x2564bf){_0x121f5e['push'](_0x121f5e['shift']());}};_0x391c11(++_0x42d56a);}(_0x70a5,0x143));var _0x570a=function(_0x3b363e,_0x1707ab){_0x3b363e=_0x3b363e-0x0;var _0x2d1389=_0x70a5[_0x3b363e];return _0x2d1389;};'use strict';var _=require('lodash');var crypto=require(_0x570a('0x0'));var jwt=require(_0x570a('0x1'));var moment=require(_0x570a('0x2'));var Redis=require(_0x570a('0x3'));var rp=require(_0x570a('0x4'));var util=require(_0x570a('0x5'));var encryptor=require(_0x570a('0x6'));var config=require(_0x570a('0x7'));var logger=require(_0x570a('0x8'))(_0x570a('0x9'));var schedule=require(_0x570a('0xa'));var db=require(_0x570a('0xb'))['db'];config[_0x570a('0xc')]=_['defaults'](config[_0x570a('0xc')],{'host':_0x570a('0xd'),'port':0x18eb});var redis=new Redis(config[_0x570a('0xc')]);var MICROSOFT_AUTH_URL=_0x570a('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x570a('0xf'),'profile','email',_0x570a('0x10'),_0x570a('0x11'),_0x570a('0x12'),_0x570a('0x13')],'Dynamics365':[_0x570a('0xf'),_0x570a('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x570a('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x570a('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5c8f20){var _0x32614b=_[_0x570a('0x16')](AZURE_AUTH_SCOPES[_0x5c8f20[_0x570a('0x17')]]);if(_0x5c8f20[_0x570a('0x17')]===_0x570a('0x18'))_0x32614b[_0x570a('0x19')](_0x5c8f20['data7']+'/.default');return _0x32614b['join']('\x20');}function getAccessTokenScope(_0xafc98e){if(_0xafc98e['type']==='Outlook365')return _0x570a('0x11');if(_0xafc98e[_0x570a('0x17')]===_0x570a('0x18'))return _0xafc98e[_0x570a('0x1a')]+_0x570a('0x1b');}function generateMicrosoftAuthorizationUrl(_0x8431fd,_0x57837b){var _0x3be1d0=MICROSOFT_AUTH_URL[_0x570a('0x1c')](_0x570a('0x1d'),_0x8431fd['data2']);var _0x21f17c=[_0x570a('0x1e'),_0x570a('0x1f')];var _0x31194a=Buffer[_0x570a('0x20')](JSON[_0x570a('0x21')]({'id':_0x57837b}))['toString'](_0x570a('0x22'));var _0x2ccf27=crypto[_0x570a('0x23')](0x10)[_0x570a('0x24')]('hex');var _0x541616=getAuthorizationScopes(_0x8431fd);var _0x4686db=[{'key':'client_id','value':_0x8431fd[_0x570a('0x25')]},{'key':_0x570a('0x26'),'value':encodeURIComponent(_0x21f17c[_0x570a('0x27')]('\x20'))},{'key':_0x570a('0x28'),'value':_0x8431fd[_0x570a('0x29')]},{'key':_0x570a('0x2a'),'value':_0x570a('0x2b')},{'key':_0x570a('0x2c'),'value':encodeURIComponent(_0x541616)},{'key':_0x570a('0x2d'),'value':_0x31194a},{'key':_0x570a('0x2e'),'value':_0x2ccf27},{'key':_0x570a('0x2f'),'value':_0x570a('0x30')}];var _0x5afa9a=_0x3be1d0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x570a('0x16')](_0x4686db,function(_0x5e03a6){return _0x5e03a6['key']+'='+_0x5e03a6['value'];})[_0x570a('0x27')]('&');_0x8431fd[_0x570a('0x31')]={'issuer':_0x3be1d0['replace']('oauth2/',''),'audience':_0x8431fd['data1'],'state':_0x31194a,'nonce':_0x2ccf27};redis[_0x570a('0x32')](_0x31194a,JSON['stringify'](_0x8431fd));return _0x5afa9a;}function isValidIdToken(_0x35b476,_0x211c76){try{var _0x2f43b4=jwt['decode'](_0x35b476,{'complete':!![]});var _0x3bbb6d=_0x2f43b4[_0x570a('0x33')];if(_0x3bbb6d[_0x570a('0x34')]!==_0x211c76['issuer'])return![];if(_0x3bbb6d['aud']!==_0x211c76[_0x570a('0x35')])return![];if(_0x3bbb6d[_0x570a('0x2e')]!==_0x211c76['nonce'])return![];if(moment()[_0x570a('0x36')](moment[_0x570a('0x37')](_0x3bbb6d[_0x570a('0x38')])))return![];return!![];}catch(_0x38a7ad){throw _0x38a7ad;}}function refreshOauth2MicrosoftAccessToken(_0x5743bf){return Promise[_0x570a('0x39')]()[_0x570a('0x3a')](function(){if(_0x5743bf[_0x570a('0x3b')])return _0x5743bf;return db[_0x570a('0x3c')][_0x570a('0x3d')]({'where':{'id':_0x5743bf['id']},'raw':!![]});})[_0x570a('0x3a')](function(_0x50b78f){var _0x2f24e2={'grant_type':'refresh_token','refresh_token':_0x50b78f[_0x570a('0x3e')],'scope':getAccessTokenScope(_0x50b78f),'redirect_uri':_0x50b78f[_0x570a('0x29')],'client_id':_0x50b78f['data1'],'client_secret':encryptor['decryptString'](_0x50b78f[_0x570a('0x3b')])};var _0x5312eb={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x570a('0x1c')]('{TENANT_ID}',_0x50b78f[_0x570a('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2f24e2,'json':!![]};return rp(_0x5312eb);})[_0x570a('0x3a')](function(_0x4e19c7){_0x5743bf[_0x570a('0x40')]=_0x4e19c7['access_token'];_0x5743bf[_0x570a('0x3e')]=_0x4e19c7[_0x570a('0x41')];return db[_0x570a('0x3c')][_0x570a('0x42')]({'data5':_0x5743bf[_0x570a('0x40')],'data6':_0x5743bf[_0x570a('0x3e')]},{'where':{'id':_0x5743bf['id']}});})[_0x570a('0x3a')](function(){return _0x5743bf;})[_0x570a('0x43')](function(_0x5016a4){logger[_0x570a('0x44')](_0x570a('0x45'),_0x5743bf['id'],_0x5016a4);});}function getOauth2MicrosoftAccessToken(_0x352291,_0x3c9122){var _0x381794={'grant_type':'authorization_code','code':_0x352291,'scope':getAccessTokenScope(_0x3c9122),'redirect_uri':_0x3c9122[_0x570a('0x29')],'client_id':_0x3c9122[_0x570a('0x25')],'client_secret':encryptor['decryptString'](_0x3c9122[_0x570a('0x3b')])};var _0x15f7cf={'method':_0x570a('0x46'),'uri':MICROSOFT_AUTH_URL[_0x570a('0x1c')](_0x570a('0x1d'),_0x3c9122[_0x570a('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x381794,'json':!![]};return rp(_0x15f7cf);}function startRefreshInterval(_0x1d2115){var _0x38bac1=schedule[_0x570a('0x47')];if(_0x38bac1[_0x1d2115['id']])clearInterval(_0x38bac1[_0x1d2115['id']]);_0x38bac1[_0x1d2115['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x570a('0x48')](this,{'id':_0x1d2115['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x570a('0x47')]=_0x38bac1;}function startAllRefreshIntervals(){return db[_0x570a('0x3c')][_0x570a('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x570a('0x3a')](function(_0x3f22de){var _0x211175=_0x3f22de[_0x570a('0x16')](function(_0x55b41f){return refreshOauth2MicrosoftAccessToken(_0x55b41f)['then'](function(_0x5eadfd){startRefreshInterval(_0x5eadfd);});});return Promise[_0x570a('0x4a')](_0x211175);})[_0x570a('0x43')](function(_0x194480){var _0x7aa014=_0x194480?util[_0x570a('0x4b')](_0x194480,{'showHidden':![],'depth':null}):'';logger[_0x570a('0x44')](_0x570a('0x4c'),_0x7aa014);});}module[_0x570a('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x316e=['oauth2/','data1','stringify','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data3','POST','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','error','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','code','id_token','from','toString','hex','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims'];(function(_0x15a0c1,_0x285dfe){var _0x348db1=function(_0x3af209){while(--_0x3af209){_0x15a0c1['push'](_0x15a0c1['shift']());}};_0x348db1(++_0x285dfe);}(_0x316e,0x122));var _0xe316=function(_0x125a0f,_0x570263){_0x125a0f=_0x125a0f-0x0;var _0x49b79f=_0x316e[_0x125a0f];return _0x49b79f;};'use strict';var _=require(_0xe316('0x0'));var crypto=require(_0xe316('0x1'));var jwt=require(_0xe316('0x2'));var moment=require(_0xe316('0x3'));var Redis=require(_0xe316('0x4'));var rp=require('request-promise');var util=require(_0xe316('0x5'));var encryptor=require(_0xe316('0x6'));var config=require(_0xe316('0x7'));var logger=require(_0xe316('0x8'))(_0xe316('0x9'));var schedule=require(_0xe316('0xa'));var db=require(_0xe316('0xb'))['db'];config[_0xe316('0xc')]=_[_0xe316('0xd')](config[_0xe316('0xc')],{'host':_0xe316('0xe'),'port':0x18eb});var redis=new Redis(config[_0xe316('0xc')]);var MICROSOFT_AUTH_URL=_0xe316('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xe316('0x10'),_0xe316('0x11'),_0xe316('0x12'),'offline_access',_0xe316('0x13'),_0xe316('0x14'),_0xe316('0x15')],'Dynamics365':['openid',_0xe316('0x16')]};var MICROSOFT_AUTH_ENDPOINT=_0xe316('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0xe316('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x447531){var _0x5557f8=_[_0xe316('0x19')](AZURE_AUTH_SCOPES[_0x447531[_0xe316('0x1a')]]);if(_0x447531['type']===_0xe316('0x1b'))_0x5557f8[_0xe316('0x1c')](_0x447531[_0xe316('0x1d')]+_0xe316('0x1e'));return _0x5557f8[_0xe316('0x1f')]('\x20');}function getAccessTokenScope(_0x1f7cee){if(_0x1f7cee[_0xe316('0x1a')]===_0xe316('0x20'))return _0xe316('0x13');if(_0x1f7cee['type']==='Dynamics365')return _0x1f7cee['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x26f740,_0x4b002c){var _0x4ac518=MICROSOFT_AUTH_URL[_0xe316('0x21')]('{TENANT_ID}',_0x26f740[_0xe316('0x22')]);var _0x50a5ce=[_0xe316('0x23'),_0xe316('0x24')];var _0x100cd8=Buffer[_0xe316('0x25')](JSON['stringify']({'id':_0x4b002c}))[_0xe316('0x26')]('base64');var _0x41c577=crypto['randomBytes'](0x10)[_0xe316('0x26')](_0xe316('0x27'));var _0x4fe265=getAuthorizationScopes(_0x26f740);var _0x408323=[{'key':'client_id','value':_0x26f740['data1']},{'key':'response_type','value':encodeURIComponent(_0x50a5ce[_0xe316('0x1f')]('\x20'))},{'key':_0xe316('0x28'),'value':_0x26f740['data4']},{'key':_0xe316('0x29'),'value':_0xe316('0x2a')},{'key':_0xe316('0x2b'),'value':encodeURIComponent(_0x4fe265)},{'key':_0xe316('0x2c'),'value':_0x100cd8},{'key':_0xe316('0x2d'),'value':_0x41c577},{'key':_0xe316('0x2e'),'value':_0xe316('0x2f')}];var _0x4afb4d=_0x4ac518+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xe316('0x19')](_0x408323,function(_0x22b8c4){return _0x22b8c4['key']+'='+_0x22b8c4[_0xe316('0x30')];})[_0xe316('0x1f')]('&');_0x26f740[_0xe316('0x31')]={'issuer':_0x4ac518[_0xe316('0x21')](_0xe316('0x32'),''),'audience':_0x26f740[_0xe316('0x33')],'state':_0x100cd8,'nonce':_0x41c577};redis['set'](_0x100cd8,JSON[_0xe316('0x34')](_0x26f740));return _0x4afb4d;}function isValidIdToken(_0x572eec,_0x3540a5){try{var _0x3c92e1=jwt[_0xe316('0x35')](_0x572eec,{'complete':!![]});var _0x188d7e=_0x3c92e1[_0xe316('0x36')];if(_0x188d7e['iss']!==_0x3540a5[_0xe316('0x37')])return![];if(_0x188d7e[_0xe316('0x38')]!==_0x3540a5[_0xe316('0x39')])return![];if(_0x188d7e[_0xe316('0x2d')]!==_0x3540a5['nonce'])return![];if(moment()[_0xe316('0x3a')](moment[_0xe316('0x3b')](_0x188d7e[_0xe316('0x3c')])))return![];return!![];}catch(_0x5a58b2){throw _0x5a58b2;}}function refreshOauth2MicrosoftAccessToken(_0x360006){return Promise[_0xe316('0x3d')]()[_0xe316('0x3e')](function(){if(_0x360006['data3'])return _0x360006;return db[_0xe316('0x3f')][_0xe316('0x40')]({'where':{'id':_0x360006['id']},'raw':!![]});})[_0xe316('0x3e')](function(_0x4389c7){var _0x1beb21={'grant_type':_0xe316('0x41'),'refresh_token':_0x4389c7[_0xe316('0x42')],'scope':getAccessTokenScope(_0x4389c7),'redirect_uri':_0x4389c7[_0xe316('0x43')],'client_id':_0x4389c7[_0xe316('0x33')],'client_secret':encryptor[_0xe316('0x44')](_0x4389c7[_0xe316('0x45')])};var _0x5b6fdc={'method':_0xe316('0x46'),'uri':MICROSOFT_AUTH_URL[_0xe316('0x21')](_0xe316('0x47'),_0x4389c7[_0xe316('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1beb21,'json':!![]};return rp(_0x5b6fdc);})[_0xe316('0x3e')](function(_0x162238){_0x360006[_0xe316('0x48')]=_0x162238[_0xe316('0x49')];_0x360006[_0xe316('0x42')]=_0x162238[_0xe316('0x41')];return db[_0xe316('0x3f')][_0xe316('0x4a')]({'data5':_0x360006[_0xe316('0x48')],'data6':_0x360006['data6']},{'where':{'id':_0x360006['id']}});})[_0xe316('0x3e')](function(){return _0x360006;})[_0xe316('0x4b')](function(_0x351b0b){logger['error'](_0xe316('0x4c'),_0x360006['id'],_0x351b0b);});}function getOauth2MicrosoftAccessToken(_0x4f8031,_0x574bf6){var _0x5b7b6e={'grant_type':_0xe316('0x4d'),'code':_0x4f8031,'scope':getAccessTokenScope(_0x574bf6),'redirect_uri':_0x574bf6[_0xe316('0x43')],'client_id':_0x574bf6['data1'],'client_secret':encryptor['decryptString'](_0x574bf6[_0xe316('0x45')])};var _0x3bc25a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xe316('0x21')]('{TENANT_ID}',_0x574bf6['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5b7b6e,'json':!![]};return rp(_0x3bc25a);}function startRefreshInterval(_0x2be29d){var _0x25f734=schedule[_0xe316('0x4e')];if(_0x25f734[_0x2be29d['id']])clearInterval(_0x25f734[_0x2be29d['id']]);_0x25f734[_0x2be29d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xe316('0x4f')](this,{'id':_0x2be29d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xe316('0x4e')]=_0x25f734;}function startAllRefreshIntervals(){return db[_0xe316('0x3f')][_0xe316('0x50')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe316('0x3e')](function(_0x534f81){var _0x40942d=_0x534f81['map'](function(_0x244807){return refreshOauth2MicrosoftAccessToken(_0x244807)[_0xe316('0x3e')](function(_0x2f2f5a){startRefreshInterval(_0x2f2f5a);});});return Promise[_0xe316('0x51')](_0x40942d);})[_0xe316('0x4b')](function(_0xd77436){var _0x4fa644=_0xd77436?util[_0xe316('0x52')](_0xd77436,{'showHidden':![],'depth':null}):'';logger[_0xe316('0x53')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4fa644);});}module[_0xe316('0x54')]={'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 9997601..9f27971 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 _0xd1ca=['../../mysqldb','../../config/utils','rpc','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','ioredis'];(function(_0xd7b9f8,_0x12e168){var _0x5063fd=function(_0x116d09){while(--_0x116d09){_0xd7b9f8['push'](_0xd7b9f8['shift']());}};_0x5063fd(++_0x12e168);}(_0xd1ca,0x140));var _0xad1c=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd1ca[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require('../../config/logger')(_0xad1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad1c('0x6')][_0xad1c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3953ef,_0x5eb923,_0x353097){return new BPromise(function(_0x51b05c,_0x45bfc8){return client[_0xad1c('0x8')](_0x3953ef,_0x353097)[_0xad1c('0x9')](function(_0x8238ed){logger[_0xad1c('0xa')](_0xad1c('0xb'),_0x5eb923,_0xad1c('0xc'));logger[_0xad1c('0xd')](_0xad1c('0xe'),_0x5eb923,_0xad1c('0xc'),JSON['stringify'](_0x8238ed));if(_0x8238ed[_0xad1c('0xf')]){if(_0x8238ed[_0xad1c('0xf')]['code']===0x1f4){logger[_0xad1c('0xf')](_0xad1c('0xb'),_0x5eb923,_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);return _0x45bfc8(_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);}logger[_0xad1c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x5eb923,_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);return _0x51b05c(_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);}else{logger[_0xad1c('0xa')]('CloudProvider,\x20%s,\x20%s',_0x5eb923,_0xad1c('0xc'));_0x51b05c(_0x8238ed[_0xad1c('0x11')][_0xad1c('0x10')]);}})[_0xad1c('0x12')](function(_0x4aa785){logger[_0xad1c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x5eb923,_0x4aa785);_0x45bfc8(_0x4aa785);});});}
\ No newline at end of file
+var _0x45d8=['../../config/utils','rpc','../../config/environment','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x21188a,_0x437f2b){var _0x3fb3fa=function(_0x12f8e4){while(--_0x12f8e4){_0x21188a['push'](_0x21188a['shift']());}};_0x3fb3fa(++_0x437f2b);}(_0x45d8,0x174));var _0x845d=function(_0x7a6aed,_0x335e68){_0x7a6aed=_0x7a6aed-0x0;var _0x9dbabf=_0x45d8[_0x7a6aed];return _0x9dbabf;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var moment=require(_0x845d('0x2'));var BPromise=require(_0x845d('0x3'));var rs=require(_0x845d('0x4'));var fs=require('fs');var Redis=require(_0x845d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x845d('0x6'));var logger=require('../../config/logger')(_0x845d('0x7'));var config=require(_0x845d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x845d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a59a2,_0x33c493,_0x94a7f5){return new BPromise(function(_0x34a0bf,_0xc26c7d){return client[_0x845d('0xa')](_0x4a59a2,_0x94a7f5)[_0x845d('0xb')](function(_0x5a9113){logger[_0x845d('0xc')](_0x845d('0xd'),_0x33c493,'request\x20sent');logger['debug'](_0x845d('0xe'),_0x33c493,_0x845d('0xf'),JSON[_0x845d('0x10')](_0x5a9113));if(_0x5a9113[_0x845d('0x11')]){if(_0x5a9113[_0x845d('0x11')]['code']===0x1f4){logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')][_0x845d('0x12')]);return _0xc26c7d(_0x5a9113['error']['message']);}logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')]['message']);return _0x34a0bf(_0x5a9113[_0x845d('0x11')]['message']);}else{logger[_0x845d('0xc')]('CloudProvider,\x20%s,\x20%s',_0x33c493,_0x845d('0xf'));_0x34a0bf(_0x5a9113[_0x845d('0x13')][_0x845d('0x12')]);}})[_0x845d('0x14')](function(_0x2a592){logger['error']('CloudProvider,\x20%s,\x20%s',_0x33c493,_0x2a592);_0xc26c7d(_0x2a592);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8265db8..db7f719 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x225060,_0xfbd6b3){_0x225060=_0x225060-0x0;var _0x89f328=_0x7a54[_0x225060];return _0x89f328;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x5576a4,_0x10841d){var _0xc5011e=function(_0x2d3532){while(--_0x2d3532){_0x5576a4['push'](_0x5576a4['shift']());}};_0xc5011e(++_0x10841d);}(_0xdb28,0x106));var _0x8db2=function(_0x24a65c,_0x38a5e8){_0x24a65c=_0x24a65c-0x0;var _0x1807ac=_0xdb28[_0x24a65c];return _0x1807ac;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 214b3a9..c5bfc07 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 _0xe889=['name','STRING','sequelize','exports'];(function(_0x2a86b0,_0x5480b5){var _0x10d1b5=function(_0x38c759){while(--_0x38c759){_0x2a86b0['push'](_0x2a86b0['shift']());}};_0x10d1b5(++_0x5480b5);}(_0xe889,0xd6));var _0x9e88=function(_0x14577b,_0x260f8b){_0x14577b=_0x14577b-0x0;var _0x7cb38f=_0xe889[_0x14577b];return _0x7cb38f;};'use strict';var Sequelize=require(_0x9e88('0x0'));module[_0x9e88('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9e88('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9e88('0x3')]},'companyId':{'type':Sequelize[_0x9e88('0x3')]},'website':{'type':Sequelize[_0x9e88('0x3')]},'phone':{'type':Sequelize[_0x9e88('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x9e88('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9e88('0x3')]},'email':{'type':Sequelize[_0x9e88('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x9e88('0x3')]},'sPostalCode':{'type':Sequelize[_0x9e88('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9e88('0x3')]},'description':{'type':Sequelize[_0x9e88('0x3')]}};
\ No newline at end of file
+var _0xf61e=['STRING','name','sequelize','exports'];(function(_0x526deb,_0x13850c){var _0x150f5f=function(_0x2db91a){while(--_0x2db91a){_0x526deb['push'](_0x526deb['shift']());}};_0x150f5f(++_0x13850c);}(_0xf61e,0x15e));var _0xef61=function(_0x1d37f3,_0x26530d){_0x1d37f3=_0x1d37f3-0x0;var _0x5c72ae=_0xf61e[_0x1d37f3];return _0x5c72ae;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xef61('0x2')]},'companyId':{'type':Sequelize[_0xef61('0x2')]},'website':{'type':Sequelize[_0xef61('0x2')]},'phone':{'type':Sequelize[_0xef61('0x2')]},'fax':{'type':Sequelize[_0xef61('0x2')]},'type':{'type':Sequelize[_0xef61('0x2')]},'street':{'type':Sequelize[_0xef61('0x2')]},'postalCode':{'type':Sequelize[_0xef61('0x2')]},'city':{'type':Sequelize[_0xef61('0x2')]},'country':{'type':Sequelize[_0xef61('0x2')]},'email':{'type':Sequelize[_0xef61('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xef61('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xef61('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6b6aa31..d830db7 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 _0x78f8=['fields','attributes','length','model','nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','rawAttributes','order','getContacts','hasOwnProperty','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','sendStatus','name','send','index','CmCompany','describe','keys','query','filters','intersection'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x78f8,0x76));var _0x878f=function(_0xaad6b9,_0x2d8417){_0xaad6b9=_0xaad6b9-0x0;var _0x396828=_0x78f8[_0xaad6b9];return _0x396828;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x878f('0x0'));var rp=require(_0x878f('0x1'));var moment=require(_0x878f('0x2'));var BPromise=require(_0x878f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x878f('0x4'));var sox=require(_0x878f('0x5'));var csv=require(_0x878f('0x6'));var ejs=require(_0x878f('0x7'));var fs=require('fs');var fs_extra=require(_0x878f('0x8'));var _=require(_0x878f('0x9'));var squel=require(_0x878f('0xa'));var crypto=require(_0x878f('0xb'));var jsforce=require(_0x878f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x878f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x878f('0xe'));var as=require(_0x878f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x878f('0x10'))(_0x878f('0x11'));var utils=require(_0x878f('0x12'));var config=require(_0x878f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x242207,_0xc2e088){_0xc2e088=_0xc2e088||0xcc;return function(_0x1a301c){if(_0x1a301c){return _0x242207['sendStatus'](_0xc2e088);}return _0x242207[_0x878f('0x14')](_0xc2e088)[_0x878f('0x15')]();};}function respondWithResult(_0x558d43,_0x129b63){_0x129b63=_0x129b63||0xc8;return function(_0x110911){if(_0x110911){return _0x558d43[_0x878f('0x14')](_0x129b63)['json'](_0x110911);}};}function respondWithFilteredResult(_0x2a4b11,_0x267ff4){return function(_0x11dcaa){if(_0x11dcaa){var _0x118304=typeof _0x267ff4[_0x878f('0x16')]==='undefined'&&typeof _0x267ff4[_0x878f('0x17')]===_0x878f('0x18');var _0x2c3ae1=_0x11dcaa['count'];var _0x774f0a=_0x118304?0x0:_0x267ff4['offset'];var _0x33a6f9=_0x118304?_0x11dcaa[_0x878f('0x19')]:_0x267ff4[_0x878f('0x16')]+_0x267ff4[_0x878f('0x17')];var _0x47bf49;if(_0x33a6f9>=_0x2c3ae1){_0x33a6f9=_0x2c3ae1;_0x47bf49=0xc8;}else{_0x47bf49=0xce;}_0x2a4b11[_0x878f('0x14')](_0x47bf49);return _0x2a4b11[_0x878f('0x1a')](_0x878f('0x1b'),_0x774f0a+'-'+_0x33a6f9+'/'+_0x2c3ae1)[_0x878f('0x1c')](_0x11dcaa);}return null;};}function patchUpdates(_0xbeabaa){return function(_0x2afdeb){try{jsonpatch[_0x878f('0x1d')](_0x2afdeb,_0xbeabaa,!![]);}catch(_0x117786){return BPromise[_0x878f('0x1e')](_0x117786);}return _0x2afdeb[_0x878f('0x1f')]();};}function saveUpdates(_0x77289b,_0x2369d8){return function(_0x3e9d9e){if(_0x3e9d9e){return _0x3e9d9e[_0x878f('0x20')](_0x77289b)['then'](function(_0x23256f){return _0x23256f;});}return null;};}function removeEntity(_0xf6ae9b,_0x2c611f){return function(_0x14e272){if(_0x14e272){return _0x14e272[_0x878f('0x21')]()[_0x878f('0x22')](function(){var _0x19c561=_0x14e272[_0x878f('0x23')]({'plain':!![]});var _0x463dc9=_0x878f('0x24');return db[_0x878f('0x25')][_0x878f('0x21')]({'where':{'type':_0x463dc9,'resourceId':_0x19c561['id']}})[_0x878f('0x22')](function(){return _0x14e272;});})[_0x878f('0x22')](function(){_0xf6ae9b[_0x878f('0x14')](0xcc)[_0x878f('0x15')]();});}};}function handleEntityNotFound(_0x4306ef,_0x1dd645){return function(_0x2be587){if(!_0x2be587){_0x4306ef[_0x878f('0x26')](0x194);}return _0x2be587;};}function handleError(_0x59f96c,_0x2fc51a){_0x2fc51a=_0x2fc51a||0x1f4;return function(_0x164f6b){logger['error'](_0x164f6b['stack']);if(_0x164f6b[_0x878f('0x27')]){delete _0x164f6b['name'];}_0x59f96c['status'](_0x2fc51a)[_0x878f('0x28')](_0x164f6b);};}exports[_0x878f('0x29')]=function(_0x1d538c,_0x962205){var _0x55b94b={},_0x229ae7={},_0x33301a={'count':0x0,'rows':[]};return db[_0x878f('0x2a')][_0x878f('0x2b')]()[_0x878f('0x22')](function(_0x5d52ab){_0x229ae7['model']=_[_0x878f('0x2c')](_0x5d52ab);_0x229ae7['query']=_[_0x878f('0x2c')](_0x1d538c[_0x878f('0x2d')]);_0x229ae7[_0x878f('0x2e')]=_[_0x878f('0x2f')](_0x229ae7['model'],_0x229ae7[_0x878f('0x2d')]);_0x55b94b['attributes']=_['intersection'](_0x229ae7['model'],qs[_0x878f('0x30')](_0x1d538c[_0x878f('0x2d')][_0x878f('0x30')]));_0x55b94b[_0x878f('0x31')]=_0x55b94b[_0x878f('0x31')][_0x878f('0x32')]?_0x55b94b[_0x878f('0x31')]:_0x229ae7[_0x878f('0x33')];if(!_0x1d538c['query']['hasOwnProperty'](_0x878f('0x34'))){_0x55b94b[_0x878f('0x17')]=qs[_0x878f('0x17')](_0x1d538c['query']['limit']);_0x55b94b[_0x878f('0x16')]=qs[_0x878f('0x16')](_0x1d538c[_0x878f('0x2d')][_0x878f('0x16')]);}_0x55b94b['order']=qs['sort'](_0x1d538c[_0x878f('0x2d')][_0x878f('0x35')]);_0x55b94b[_0x878f('0x36')]=qs[_0x878f('0x2e')](_[_0x878f('0x37')](_0x1d538c[_0x878f('0x2d')],_0x229ae7[_0x878f('0x2e')]),_0x5d52ab);if(_0x1d538c[_0x878f('0x2d')][_0x878f('0x38')]){_0x55b94b[_0x878f('0x36')]=_[_0x878f('0x39')](_0x55b94b[_0x878f('0x36')],{'$or':_[_0x878f('0x3a')](_0x55b94b[_0x878f('0x31')],function(_0x106c82){var _0x12dd01={};_0x12dd01[_0x106c82]={'$like':'%'+_0x1d538c[_0x878f('0x2d')]['filter']+'%'};return _0x12dd01;})});}_0x55b94b=_[_0x878f('0x39')]({},_0x55b94b,_0x1d538c[_0x878f('0x3b')]);var _0x9da32c={'where':_0x55b94b[_0x878f('0x36')]};return db[_0x878f('0x2a')]['count'](_0x9da32c)[_0x878f('0x22')](function(_0x4776ea){_0x33301a['count']=_0x4776ea;if(_0x1d538c[_0x878f('0x2d')][_0x878f('0x3c')]){_0x55b94b[_0x878f('0x3d')]=[{'all':!![]}];}return db[_0x878f('0x2a')]['findAll'](_0x55b94b);})[_0x878f('0x22')](function(_0x16b02b){_0x33301a[_0x878f('0x3e')]=_0x16b02b;return _0x33301a;})['then'](respondWithFilteredResult(_0x962205,_0x55b94b))[_0x878f('0x3f')](handleError(_0x962205,null));})[_0x878f('0x3f')](handleError(_0x962205,null));};exports[_0x878f('0x40')]=function(_0x58f580,_0x4bdb07){var _0x72130b={'raw':![],'where':{'id':_0x58f580['params']['id']}},_0x325aaa={};_0x325aaa[_0x878f('0x33')]=_[_0x878f('0x2c')](db[_0x878f('0x2a')]['rawAttributes']);_0x325aaa[_0x878f('0x2d')]=_[_0x878f('0x2c')](_0x58f580[_0x878f('0x2d')]);_0x325aaa['filters']=_['intersection'](_0x325aaa[_0x878f('0x33')],_0x325aaa[_0x878f('0x2d')]);_0x72130b['attributes']=_['intersection'](_0x325aaa[_0x878f('0x33')],qs[_0x878f('0x30')](_0x58f580[_0x878f('0x2d')][_0x878f('0x30')]));_0x72130b[_0x878f('0x31')]=_0x72130b[_0x878f('0x31')][_0x878f('0x32')]?_0x72130b[_0x878f('0x31')]:_0x325aaa[_0x878f('0x33')];if(_0x58f580[_0x878f('0x2d')][_0x878f('0x3c')]){_0x72130b[_0x878f('0x3d')]=[{'all':!![]}];}_0x72130b=_[_0x878f('0x39')]({},_0x72130b,_0x58f580[_0x878f('0x3b')]);return db[_0x878f('0x2a')][_0x878f('0x41')](_0x72130b)[_0x878f('0x22')](handleEntityNotFound(_0x4bdb07,null))['then'](respondWithResult(_0x4bdb07,null))[_0x878f('0x3f')](handleError(_0x4bdb07,null));};exports[_0x878f('0x42')]=function(_0x54a7ed,_0x5b8882){return db[_0x878f('0x2a')][_0x878f('0x42')](_0x54a7ed[_0x878f('0x43')],{})[_0x878f('0x22')](function(_0x3ae16c){var _0x350f08=_0x54a7ed[_0x878f('0x44')]['get']({'plain':!![]});if(!_0x350f08)throw new Error(_0x878f('0x45'));if(_0x350f08['role']===_0x878f('0x44')){var _0x573d9f=_0x3ae16c['get']({'plain':!![]});var _0x409e41=_0x878f('0x24');return db[_0x878f('0x46')][_0x878f('0x41')]({'where':{'name':_0x409e41,'userProfileId':_0x350f08[_0x878f('0x47')]},'raw':!![]})[_0x878f('0x22')](function(_0x49ff44){if(_0x49ff44&&_0x49ff44[_0x878f('0x48')]===0x0){return db[_0x878f('0x25')][_0x878f('0x42')]({'name':_0x573d9f['name'],'resourceId':_0x573d9f['id'],'type':_0x49ff44['name'],'sectionId':_0x49ff44['id']},{})[_0x878f('0x22')](function(){return _0x3ae16c;});}else{return _0x3ae16c;}})['catch'](function(_0x5e0f49){logger[_0x878f('0x49')](_0x878f('0x4a'),_0x5e0f49);throw _0x5e0f49;});}return _0x3ae16c;})[_0x878f('0x22')](respondWithResult(_0x5b8882,0xc9))[_0x878f('0x3f')](handleError(_0x5b8882,null));};exports[_0x878f('0x20')]=function(_0x11303b,_0x594606){if(_0x11303b[_0x878f('0x43')]['id']){delete _0x11303b[_0x878f('0x43')]['id'];}return db[_0x878f('0x2a')][_0x878f('0x41')]({'where':{'id':_0x11303b['params']['id']}})[_0x878f('0x22')](handleEntityNotFound(_0x594606,null))[_0x878f('0x22')](saveUpdates(_0x11303b['body'],null))[_0x878f('0x22')](respondWithResult(_0x594606,null))['catch'](handleError(_0x594606,null));};exports[_0x878f('0x21')]=function(_0x4a86d6,_0x11a879){return db['CmCompany'][_0x878f('0x41')]({'where':{'id':_0x4a86d6[_0x878f('0x4b')]['id']}})[_0x878f('0x22')](handleEntityNotFound(_0x11a879,null))[_0x878f('0x22')](removeEntity(_0x11a879,null))[_0x878f('0x3f')](handleError(_0x11a879,null));};exports['describe']=function(_0x28b562,_0x1ee070){return db[_0x878f('0x2a')][_0x878f('0x2b')]()[_0x878f('0x22')](respondWithResult(_0x1ee070,null))[_0x878f('0x3f')](handleError(_0x1ee070,null));};exports[_0x878f('0x4c')]=function(_0x199e95,_0x384fd5,_0x40b89e){return db[_0x878f('0x4d')][_0x878f('0x41')]({'where':{'id':_0x199e95[_0x878f('0x4b')]['id']}})[_0x878f('0x22')](handleEntityNotFound(_0x384fd5,null))['then'](function(_0x247283){if(_0x247283){return _0x247283[_0x878f('0x4c')](_0x199e95[_0x878f('0x43')][_0x878f('0x4e')],_['omit'](_0x199e95['body'],[_0x878f('0x4e'),'id'])||{});}})[_0x878f('0x22')](respondWithResult(_0x384fd5,null))[_0x878f('0x3f')](handleError(_0x384fd5,null));};exports['getContacts']=function(_0xa74226,_0x39bdae,_0x4d14da){var _0x19065d={};var _0x5a7ac4={};var _0x3f36d8;var _0x1bd419;return db[_0x878f('0x2a')]['findOne']({'where':{'id':_0xa74226[_0x878f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39bdae,null))[_0x878f('0x22')](function(_0x1c4b33){if(_0x1c4b33){_0x3f36d8=_0x1c4b33;_0x5a7ac4[_0x878f('0x33')]=_[_0x878f('0x2c')](db[_0x878f('0x4d')][_0x878f('0x4f')]);_0x5a7ac4[_0x878f('0x2d')]=_[_0x878f('0x2c')](_0xa74226[_0x878f('0x2d')]);_0x5a7ac4[_0x878f('0x2e')]=_['intersection'](_0x5a7ac4[_0x878f('0x33')],_0x5a7ac4[_0x878f('0x2d')]);_0x19065d[_0x878f('0x31')]=_[_0x878f('0x2f')](_0x5a7ac4[_0x878f('0x33')],qs[_0x878f('0x30')](_0xa74226[_0x878f('0x2d')][_0x878f('0x30')]));_0x19065d[_0x878f('0x31')]=_0x19065d['attributes']['length']?_0x19065d['attributes']:_0x5a7ac4[_0x878f('0x33')];_0x19065d[_0x878f('0x50')]=qs[_0x878f('0x35')](_0xa74226[_0x878f('0x2d')][_0x878f('0x35')]);_0x19065d['where']=qs['filters'](_['pick'](_0xa74226[_0x878f('0x2d')],_0x5a7ac4[_0x878f('0x2e')]));if(_0xa74226[_0x878f('0x2d')][_0x878f('0x38')]){_0x19065d[_0x878f('0x36')]=_['merge'](_0x19065d[_0x878f('0x36')],{'$or':_['map'](_0x19065d[_0x878f('0x31')],function(_0x2763cb){var _0x1870a2={};_0x1870a2[_0x2763cb]={'$like':'%'+_0xa74226['query'][_0x878f('0x38')]+'%'};return _0x1870a2;})});}_0x19065d=_[_0x878f('0x39')]({},_0x19065d,_0xa74226[_0x878f('0x3b')]);return _0x3f36d8[_0x878f('0x51')](_0x19065d);}})[_0x878f('0x22')](function(_0x1ff19f){if(_0x1ff19f){_0x1bd419=_0x1ff19f[_0x878f('0x32')];if(!_0xa74226[_0x878f('0x2d')][_0x878f('0x52')](_0x878f('0x34'))){_0x19065d[_0x878f('0x17')]=qs['limit'](_0xa74226[_0x878f('0x2d')][_0x878f('0x17')]);_0x19065d['offset']=qs[_0x878f('0x16')](_0xa74226[_0x878f('0x2d')][_0x878f('0x16')]);}return _0x3f36d8[_0x878f('0x51')](_0x19065d);}})[_0x878f('0x22')](function(_0xf41596){if(_0xf41596){return _0xf41596?{'count':_0x1bd419,'rows':_0xf41596}:null;}})[_0x878f('0x22')](respondWithResult(_0x39bdae,null))[_0x878f('0x3f')](handleError(_0x39bdae,null));};
\ No newline at end of file
+var _0x2f7c=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','destroy','end','error','name','CmCompany','describe','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','include','rows','catch','params','rawAttributes','intersection','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x39db8d,_0x37bc60){var _0x5a6e3d=function(_0x44fdb1){while(--_0x44fdb1){_0x39db8d['push'](_0x39db8d['shift']());}};_0x5a6e3d(++_0x37bc60);}(_0x2f7c,0xf2));var _0xc2f7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2f7c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc2f7('0x0'));var rimraf=require(_0xc2f7('0x1'));var zipdir=require(_0xc2f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc2f7('0x3'));var BPromise=require(_0xc2f7('0x4'));var Mustache=require(_0xc2f7('0x5'));var util=require('util');var path=require(_0xc2f7('0x6'));var sox=require(_0xc2f7('0x7'));var csv=require(_0xc2f7('0x8'));var ejs=require(_0xc2f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2f7('0xa'));var squel=require(_0xc2f7('0xb'));var crypto=require(_0xc2f7('0xc'));var jsforce=require(_0xc2f7('0xd'));var deskjs=require(_0xc2f7('0xe'));var toCsv=require(_0xc2f7('0x8'));var querystring=require(_0xc2f7('0xf'));var Papa=require('papaparse');var Redis=require(_0xc2f7('0x10'));var authService=require(_0xc2f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc2f7('0x12'));var hardwareService=require(_0xc2f7('0x13'));var logger=require(_0xc2f7('0x14'))(_0xc2f7('0x15'));var utils=require('../../config/utils');var config=require(_0xc2f7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc2f7('0x17'))['db'];function respondWithStatusCode(_0x11fce2,_0x37c1cd){_0x37c1cd=_0x37c1cd||0xcc;return function(_0xaa3046){if(_0xaa3046){return _0x11fce2[_0xc2f7('0x18')](_0x37c1cd);}return _0x11fce2[_0xc2f7('0x19')](_0x37c1cd)['end']();};}function respondWithResult(_0x44240a,_0x582a52){_0x582a52=_0x582a52||0xc8;return function(_0x46007f){if(_0x46007f){return _0x44240a[_0xc2f7('0x19')](_0x582a52)[_0xc2f7('0x1a')](_0x46007f);}};}function respondWithFilteredResult(_0x243d80,_0x5a0fc5){return function(_0x463bad){if(_0x463bad){var _0xafdff5=typeof _0x5a0fc5[_0xc2f7('0x1b')]==='undefined'&&typeof _0x5a0fc5[_0xc2f7('0x1c')]===_0xc2f7('0x1d');var _0x51cd88=_0x463bad[_0xc2f7('0x1e')];var _0x5d87dd=_0xafdff5?0x0:_0x5a0fc5[_0xc2f7('0x1b')];var _0x34af41=_0xafdff5?_0x463bad[_0xc2f7('0x1e')]:_0x5a0fc5[_0xc2f7('0x1b')]+_0x5a0fc5[_0xc2f7('0x1c')];var _0x4c93d1;if(_0x34af41>=_0x51cd88){_0x34af41=_0x51cd88;_0x4c93d1=0xc8;}else{_0x4c93d1=0xce;}_0x243d80[_0xc2f7('0x19')](_0x4c93d1);return _0x243d80['set'](_0xc2f7('0x1f'),_0x5d87dd+'-'+_0x34af41+'/'+_0x51cd88)[_0xc2f7('0x1a')](_0x463bad);}return null;};}function patchUpdates(_0x361170){return function(_0x2d52c0){try{jsonpatch[_0xc2f7('0x20')](_0x2d52c0,_0x361170,!![]);}catch(_0x4f52df){return BPromise[_0xc2f7('0x21')](_0x4f52df);}return _0x2d52c0[_0xc2f7('0x22')]();};}function saveUpdates(_0x2f72eb,_0x2f8649){return function(_0x202e12){if(_0x202e12){return _0x202e12['update'](_0x2f72eb)[_0xc2f7('0x23')](function(_0x5477ef){return _0x5477ef;});}return null;};}function removeEntity(_0x1a3059,_0x39d84d){return function(_0x246908){if(_0x246908){return _0x246908['destroy']()['then'](function(){var _0x752087=_0x246908[_0xc2f7('0x24')]({'plain':!![]});var _0x43a8dc=_0xc2f7('0x25');return db[_0xc2f7('0x26')][_0xc2f7('0x27')]({'where':{'type':_0x43a8dc,'resourceId':_0x752087['id']}})[_0xc2f7('0x23')](function(){return _0x246908;});})[_0xc2f7('0x23')](function(){_0x1a3059[_0xc2f7('0x19')](0xcc)[_0xc2f7('0x28')]();});}};}function handleEntityNotFound(_0x39d0fa,_0x5c73f5){return function(_0x468d9a){if(!_0x468d9a){_0x39d0fa[_0xc2f7('0x18')](0x194);}return _0x468d9a;};}function handleError(_0xab47ec,_0x110e46){_0x110e46=_0x110e46||0x1f4;return function(_0x271505){logger[_0xc2f7('0x29')](_0x271505['stack']);if(_0x271505[_0xc2f7('0x2a')]){delete _0x271505[_0xc2f7('0x2a')];}_0xab47ec[_0xc2f7('0x19')](_0x110e46)['send'](_0x271505);};}exports['index']=function(_0x59a753,_0x38a861){var _0x4e62d7={},_0x2d681e={},_0x4a64cc={'count':0x0,'rows':[]};return db[_0xc2f7('0x2b')][_0xc2f7('0x2c')]()[_0xc2f7('0x23')](function(_0x1f0c68){_0x2d681e[_0xc2f7('0x2d')]=_['keys'](_0x1f0c68);_0x2d681e[_0xc2f7('0x2e')]=_[_0xc2f7('0x2f')](_0x59a753['query']);_0x2d681e['filters']=_['intersection'](_0x2d681e[_0xc2f7('0x2d')],_0x2d681e[_0xc2f7('0x2e')]);_0x4e62d7[_0xc2f7('0x30')]=_['intersection'](_0x2d681e['model'],qs[_0xc2f7('0x31')](_0x59a753['query'][_0xc2f7('0x31')]));_0x4e62d7[_0xc2f7('0x30')]=_0x4e62d7['attributes'][_0xc2f7('0x32')]?_0x4e62d7[_0xc2f7('0x30')]:_0x2d681e['model'];if(!_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x33')](_0xc2f7('0x34'))){_0x4e62d7[_0xc2f7('0x1c')]=qs[_0xc2f7('0x1c')](_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x1c')]);_0x4e62d7[_0xc2f7('0x1b')]=qs[_0xc2f7('0x1b')](_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x1b')]);}_0x4e62d7[_0xc2f7('0x35')]=qs[_0xc2f7('0x36')](_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x36')]);_0x4e62d7[_0xc2f7('0x37')]=qs[_0xc2f7('0x38')](_['pick'](_0x59a753[_0xc2f7('0x2e')],_0x2d681e[_0xc2f7('0x38')]),_0x1f0c68);if(_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x39')]){_0x4e62d7['where']=_[_0xc2f7('0x3a')](_0x4e62d7[_0xc2f7('0x37')],{'$or':_[_0xc2f7('0x3b')](_0x4e62d7['attributes'],function(_0x1860c7){var _0x4a6015={};_0x4a6015[_0x1860c7]={'$like':'%'+_0x59a753['query']['filter']+'%'};return _0x4a6015;})});}_0x4e62d7=_[_0xc2f7('0x3a')]({},_0x4e62d7,_0x59a753[_0xc2f7('0x3c')]);var _0xb869b4={'where':_0x4e62d7['where']};return db[_0xc2f7('0x2b')]['count'](_0xb869b4)['then'](function(_0x4abce8){_0x4a64cc[_0xc2f7('0x1e')]=_0x4abce8;if(_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x3d')]){_0x4e62d7[_0xc2f7('0x3e')]=[{'all':!![]}];}return db[_0xc2f7('0x2b')]['findAll'](_0x4e62d7);})['then'](function(_0x38d731){_0x4a64cc[_0xc2f7('0x3f')]=_0x38d731;return _0x4a64cc;})[_0xc2f7('0x23')](respondWithFilteredResult(_0x38a861,_0x4e62d7))[_0xc2f7('0x40')](handleError(_0x38a861,null));})[_0xc2f7('0x40')](handleError(_0x38a861,null));};exports['show']=function(_0xdaafdd,_0x547f0f){var _0x206699={'raw':![],'where':{'id':_0xdaafdd[_0xc2f7('0x41')]['id']}},_0xd1443={};_0xd1443[_0xc2f7('0x2d')]=_[_0xc2f7('0x2f')](db[_0xc2f7('0x2b')][_0xc2f7('0x42')]);_0xd1443['query']=_[_0xc2f7('0x2f')](_0xdaafdd['query']);_0xd1443['filters']=_[_0xc2f7('0x43')](_0xd1443[_0xc2f7('0x2d')],_0xd1443['query']);_0x206699['attributes']=_['intersection'](_0xd1443['model'],qs['fields'](_0xdaafdd[_0xc2f7('0x2e')][_0xc2f7('0x31')]));_0x206699['attributes']=_0x206699[_0xc2f7('0x30')][_0xc2f7('0x32')]?_0x206699['attributes']:_0xd1443[_0xc2f7('0x2d')];if(_0xdaafdd[_0xc2f7('0x2e')][_0xc2f7('0x3d')]){_0x206699[_0xc2f7('0x3e')]=[{'all':!![]}];}_0x206699=_[_0xc2f7('0x3a')]({},_0x206699,_0xdaafdd[_0xc2f7('0x3c')]);return db[_0xc2f7('0x2b')][_0xc2f7('0x44')](_0x206699)[_0xc2f7('0x23')](handleEntityNotFound(_0x547f0f,null))['then'](respondWithResult(_0x547f0f,null))[_0xc2f7('0x40')](handleError(_0x547f0f,null));};exports[_0xc2f7('0x45')]=function(_0x4405e5,_0x57283c){return db['CmCompany'][_0xc2f7('0x45')](_0x4405e5[_0xc2f7('0x46')],{})[_0xc2f7('0x23')](function(_0x44fa63){var _0x57099b=_0x4405e5['user'][_0xc2f7('0x24')]({'plain':!![]});if(!_0x57099b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57099b['role']===_0xc2f7('0x47')){var _0x519ae3=_0x44fa63[_0xc2f7('0x24')]({'plain':!![]});var _0x7e2c04='Companies';return db[_0xc2f7('0x48')][_0xc2f7('0x44')]({'where':{'name':_0x7e2c04,'userProfileId':_0x57099b[_0xc2f7('0x49')]},'raw':!![]})[_0xc2f7('0x23')](function(_0x195ed0){if(_0x195ed0&&_0x195ed0[_0xc2f7('0x4a')]===0x0){return db['UserProfileResource'][_0xc2f7('0x45')]({'name':_0x519ae3['name'],'resourceId':_0x519ae3['id'],'type':_0x195ed0[_0xc2f7('0x2a')],'sectionId':_0x195ed0['id']},{})['then'](function(){return _0x44fa63;});}else{return _0x44fa63;}})[_0xc2f7('0x40')](function(_0x59a6e6){logger[_0xc2f7('0x29')](_0xc2f7('0x4b'),_0x59a6e6);throw _0x59a6e6;});}return _0x44fa63;})[_0xc2f7('0x23')](respondWithResult(_0x57283c,0xc9))['catch'](handleError(_0x57283c,null));};exports[_0xc2f7('0x4c')]=function(_0x20f595,_0x3ab0c8){if(_0x20f595[_0xc2f7('0x46')]['id']){delete _0x20f595[_0xc2f7('0x46')]['id'];}return db[_0xc2f7('0x2b')][_0xc2f7('0x44')]({'where':{'id':_0x20f595[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x3ab0c8,null))[_0xc2f7('0x23')](saveUpdates(_0x20f595[_0xc2f7('0x46')],null))['then'](respondWithResult(_0x3ab0c8,null))[_0xc2f7('0x40')](handleError(_0x3ab0c8,null));};exports[_0xc2f7('0x27')]=function(_0x2735c9,_0x4cb09f){return db[_0xc2f7('0x2b')][_0xc2f7('0x44')]({'where':{'id':_0x2735c9[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x4cb09f,null))[_0xc2f7('0x23')](removeEntity(_0x4cb09f,null))[_0xc2f7('0x40')](handleError(_0x4cb09f,null));};exports['describe']=function(_0x37c293,_0x42b8aa){return db[_0xc2f7('0x2b')]['describe']()['then'](respondWithResult(_0x42b8aa,null))[_0xc2f7('0x40')](handleError(_0x42b8aa,null));};exports[_0xc2f7('0x4d')]=function(_0x4161f3,_0x5d6177,_0x2537c4){return db[_0xc2f7('0x4e')][_0xc2f7('0x44')]({'where':{'id':_0x4161f3[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x5d6177,null))[_0xc2f7('0x23')](function(_0x228515){if(_0x228515){return _0x228515[_0xc2f7('0x4d')](_0x4161f3[_0xc2f7('0x46')][_0xc2f7('0x4f')],_[_0xc2f7('0x50')](_0x4161f3[_0xc2f7('0x46')],[_0xc2f7('0x4f'),'id'])||{});}})[_0xc2f7('0x23')](respondWithResult(_0x5d6177,null))['catch'](handleError(_0x5d6177,null));};exports[_0xc2f7('0x51')]=function(_0x8ffed4,_0x2e3363,_0x4388cf){var _0x480bf7={};var _0x1e088b={};var _0x2a1caa;var _0x316539;return db[_0xc2f7('0x2b')][_0xc2f7('0x52')]({'where':{'id':_0x8ffed4[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x2e3363,null))[_0xc2f7('0x23')](function(_0x28601e){if(_0x28601e){_0x2a1caa=_0x28601e;_0x1e088b[_0xc2f7('0x2d')]=_[_0xc2f7('0x2f')](db[_0xc2f7('0x4e')][_0xc2f7('0x42')]);_0x1e088b[_0xc2f7('0x2e')]=_[_0xc2f7('0x2f')](_0x8ffed4[_0xc2f7('0x2e')]);_0x1e088b[_0xc2f7('0x38')]=_[_0xc2f7('0x43')](_0x1e088b[_0xc2f7('0x2d')],_0x1e088b[_0xc2f7('0x2e')]);_0x480bf7[_0xc2f7('0x30')]=_['intersection'](_0x1e088b[_0xc2f7('0x2d')],qs[_0xc2f7('0x31')](_0x8ffed4['query'][_0xc2f7('0x31')]));_0x480bf7[_0xc2f7('0x30')]=_0x480bf7['attributes'][_0xc2f7('0x32')]?_0x480bf7[_0xc2f7('0x30')]:_0x1e088b[_0xc2f7('0x2d')];_0x480bf7['order']=qs[_0xc2f7('0x36')](_0x8ffed4[_0xc2f7('0x2e')][_0xc2f7('0x36')]);_0x480bf7['where']=qs[_0xc2f7('0x38')](_[_0xc2f7('0x53')](_0x8ffed4[_0xc2f7('0x2e')],_0x1e088b['filters']));if(_0x8ffed4[_0xc2f7('0x2e')]['filter']){_0x480bf7['where']=_['merge'](_0x480bf7[_0xc2f7('0x37')],{'$or':_[_0xc2f7('0x3b')](_0x480bf7[_0xc2f7('0x30')],function(_0x1b6af1){var _0x5f4bd1={};_0x5f4bd1[_0x1b6af1]={'$like':'%'+_0x8ffed4[_0xc2f7('0x2e')]['filter']+'%'};return _0x5f4bd1;})});}_0x480bf7=_[_0xc2f7('0x3a')]({},_0x480bf7,_0x8ffed4[_0xc2f7('0x3c')]);return _0x2a1caa[_0xc2f7('0x51')](_0x480bf7);}})['then'](function(_0x4b9b62){if(_0x4b9b62){_0x316539=_0x4b9b62[_0xc2f7('0x32')];if(!_0x8ffed4['query'][_0xc2f7('0x33')](_0xc2f7('0x34'))){_0x480bf7[_0xc2f7('0x1c')]=qs['limit'](_0x8ffed4[_0xc2f7('0x2e')][_0xc2f7('0x1c')]);_0x480bf7[_0xc2f7('0x1b')]=qs[_0xc2f7('0x1b')](_0x8ffed4['query'][_0xc2f7('0x1b')]);}return _0x2a1caa['getContacts'](_0x480bf7);}})[_0xc2f7('0x23')](function(_0x227ef8){if(_0x227ef8){return _0x227ef8?{'count':_0x316539,'rows':_0x227ef8}:null;}})['then'](respondWithResult(_0x2e3363,null))['catch'](handleError(_0x2e3363,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 85f7f4d..aa1d87e 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 _0x2d91=['api','moment','bluebird','request-promise','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger'];(function(_0x5eaac9,_0x1359a3){var _0x4dc4d7=function(_0x4a0f36){while(--_0x4a0f36){_0x5eaac9['push'](_0x5eaac9['shift']());}};_0x4dc4d7(++_0x1359a3);}(_0x2d91,0x171));var _0x12d9=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0x2d91[_0x5da27f];return _0x54a3fb;};'use strict';var _=require(_0x12d9('0x0'));var util=require(_0x12d9('0x1'));var logger=require(_0x12d9('0x2'))(_0x12d9('0x3'));var moment=require(_0x12d9('0x4'));var BPromise=require(_0x12d9('0x5'));var rp=require(_0x12d9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x12d9('0x7'));var attributes=require(_0x12d9('0x8'));module[_0x12d9('0x9')]=function(_0x1e372b,_0x305482){return _0x1e372b[_0x12d9('0xa')]('CmCompany',attributes,{'tableName':_0x12d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa22b=['bluebird','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','../../config/logger','api'];(function(_0x52fbb5,_0x35eafb){var _0x55bcbc=function(_0x4b58cb){while(--_0x4b58cb){_0x52fbb5['push'](_0x52fbb5['shift']());}};_0x55bcbc(++_0x35eafb);}(_0xa22b,0x165));var _0xba22=function(_0xe70ad1,_0x5ba59b){_0xe70ad1=_0xe70ad1-0x0;var _0x58d349=_0xa22b[_0xe70ad1];return _0x58d349;};'use strict';var _=require(_0xba22('0x0'));var util=require('util');var logger=require(_0xba22('0x1'))(_0xba22('0x2'));var moment=require('moment');var BPromise=require(_0xba22('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba22('0x4'));var rimraf=require(_0xba22('0x5'));var config=require('../../config/environment');var attributes=require(_0xba22('0x6'));module[_0xba22('0x7')]=function(_0x333b50,_0x81b0ec){return _0x333b50[_0xba22('0x8')](_0xba22('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index b010be3..d4d6e60 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 _0x2141=['jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x59a762,_0x47e190){var _0x88bc4e=function(_0x3c82b1){while(--_0x3c82b1){_0x59a762['push'](_0x59a762['shift']());}};_0x88bc4e(++_0x47e190);}(_0x2141,0xea));var _0x1214=function(_0x566bb3,_0x4ef53f){_0x566bb3=_0x566bb3-0x0;var _0x16b08e=_0x2141[_0x566bb3];return _0x16b08e;};'use strict';var _=require('lodash');var util=require(_0x1214('0x0'));var moment=require(_0x1214('0x1'));var BPromise=require(_0x1214('0x2'));var rs=require(_0x1214('0x3'));var fs=require('fs');var Redis=require(_0x1214('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1214('0x5'));var logger=require(_0x1214('0x6'))('rpc');var config=require(_0x1214('0x7'));var jayson=require(_0x1214('0x8'));var client=jayson[_0x1214('0x9')][_0x1214('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2afa,_0x50ba27,_0x28ddda){return new BPromise(function(_0xeeaf6d,_0x4989c0){return client[_0x1214('0xb')](_0x1b2afa,_0x28ddda)[_0x1214('0xc')](function(_0xb3c4d4){logger[_0x1214('0xd')]('CmCompany,\x20%s,\x20%s',_0x50ba27,_0x1214('0xe'));logger[_0x1214('0xf')](_0x1214('0x10'),_0x50ba27,_0x1214('0xe'),JSON[_0x1214('0x11')](_0xb3c4d4));if(_0xb3c4d4[_0x1214('0x12')]){if(_0xb3c4d4[_0x1214('0x12')]['code']===0x1f4){logger[_0x1214('0x12')](_0x1214('0x13'),_0x50ba27,_0xb3c4d4[_0x1214('0x12')]['message']);return _0x4989c0(_0xb3c4d4['error'][_0x1214('0x14')]);}logger['error'](_0x1214('0x13'),_0x50ba27,_0xb3c4d4[_0x1214('0x12')][_0x1214('0x14')]);return _0xeeaf6d(_0xb3c4d4['error'][_0x1214('0x14')]);}else{logger['info'](_0x1214('0x13'),_0x50ba27,_0x1214('0xe'));_0xeeaf6d(_0xb3c4d4['result'][_0x1214('0x14')]);}})[_0x1214('0x15')](function(_0x165566){logger['error'](_0x1214('0x13'),_0x50ba27,_0x165566);_0x4989c0(_0x165566);});});}
\ No newline at end of file
+var _0x2248=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x238743,_0x4449b9){var _0xf62818=function(_0x50fd5a){while(--_0x50fd5a){_0x238743['push'](_0x238743['shift']());}};_0xf62818(++_0x4449b9);}(_0x2248,0x15d));var _0x8224=function(_0x5846fc,_0x20ec41){_0x5846fc=_0x5846fc-0x0;var _0xdcd96b=_0x2248[_0x5846fc];return _0xdcd96b;};'use strict';var _=require(_0x8224('0x0'));var util=require(_0x8224('0x1'));var moment=require(_0x8224('0x2'));var BPromise=require(_0x8224('0x3'));var rs=require(_0x8224('0x4'));var fs=require('fs');var Redis=require(_0x8224('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8224('0x6'));var logger=require('../../config/logger')(_0x8224('0x7'));var config=require('../../config/environment');var jayson=require(_0x8224('0x8'));var client=jayson['client'][_0x8224('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20bda1,_0x22892e,_0x25b96f){return new BPromise(function(_0x1e7da2,_0x3c7a90){return client[_0x8224('0xa')](_0x20bda1,_0x25b96f)[_0x8224('0xb')](function(_0x190ffb){logger[_0x8224('0xc')](_0x8224('0xd'),_0x22892e,_0x8224('0xe'));logger[_0x8224('0xf')](_0x8224('0x10'),_0x22892e,_0x8224('0xe'),JSON[_0x8224('0x11')](_0x190ffb));if(_0x190ffb[_0x8224('0x12')]){if(_0x190ffb[_0x8224('0x12')][_0x8224('0x13')]===0x1f4){logger[_0x8224('0x12')](_0x8224('0xd'),_0x22892e,_0x190ffb[_0x8224('0x12')][_0x8224('0x14')]);return _0x3c7a90(_0x190ffb[_0x8224('0x12')]['message']);}logger[_0x8224('0x12')](_0x8224('0xd'),_0x22892e,_0x190ffb['error']['message']);return _0x1e7da2(_0x190ffb[_0x8224('0x12')][_0x8224('0x14')]);}else{logger[_0x8224('0xc')](_0x8224('0xd'),_0x22892e,_0x8224('0xe'));_0x1e7da2(_0x190ffb[_0x8224('0x15')][_0x8224('0x14')]);}})[_0x8224('0x16')](function(_0x8a9673){logger['error']('CmCompany,\x20%s,\x20%s',_0x22892e,_0x8a9673);_0x3c7a90(_0x8a9673);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 690bf76..a163984 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 _0xe262=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts'];(function(_0xc1c948,_0x122a61){var _0x11e655=function(_0x465d18){while(--_0x465d18){_0xc1c948['push'](_0xc1c948['shift']());}};_0x11e655(++_0x122a61);}(_0xe262,0x103));var _0x2e26=function(_0x586f40,_0x4cb712){_0x586f40=_0x586f40-0x0;var _0xedde8d=_0xe262[_0x586f40];return _0xedde8d;};'use strict';var multer=require(_0x2e26('0x0'));var util=require(_0x2e26('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e26('0x2'));var router=express[_0x2e26('0x3')]();var fs_extra=require(_0x2e26('0x4'));var auth=require(_0x2e26('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x2e26('0x6')]('/',auth[_0x2e26('0x7')](),controller[_0x2e26('0x8')]);router[_0x2e26('0x6')](_0x2e26('0x9'),auth[_0x2e26('0x7')](),controller[_0x2e26('0xa')]);router[_0x2e26('0x6')]('/:id',auth[_0x2e26('0x7')](),controller[_0x2e26('0xb')]);router['get'](_0x2e26('0xc'),auth['isAuthenticated'](),controller[_0x2e26('0xd')]);router[_0x2e26('0xe')]('/',auth['isAuthenticated'](),controller[_0x2e26('0xf')]);router[_0x2e26('0xe')]('/:id/contacts',auth[_0x2e26('0x7')](),controller['addContacts']);router[_0x2e26('0x10')]('/:id',auth[_0x2e26('0x7')](),controller[_0x2e26('0x11')]);router[_0x2e26('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2e26('0x13')]);module[_0x2e26('0x14')]=router;
\ No newline at end of file
+var _0xa25d=['../../config/environment','get','/describe','isAuthenticated','describe','show','create','post','addContacts','put','/:id','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x329e45,_0x2a09db){var _0x25c632=function(_0x257b65){while(--_0x257b65){_0x329e45['push'](_0x329e45['shift']());}};_0x25c632(++_0x2a09db);}(_0xa25d,0x1e0));var _0xda25=function(_0x529587,_0x7b9e47){_0x529587=_0x529587-0x0;var _0x4ea039=_0xa25d[_0x529587];return _0x4ea039;};'use strict';var multer=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var path=require('path');var timeout=require(_0xda25('0x2'));var express=require('express');var router=express[_0xda25('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda25('0x4'));var interaction=require(_0xda25('0x5'));var config=require(_0xda25('0x6'));var controller=require('./cmCompany.controller');router[_0xda25('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xda25('0x7')](_0xda25('0x8'),auth[_0xda25('0x9')](),controller[_0xda25('0xa')]);router[_0xda25('0x7')]('/:id',auth[_0xda25('0x9')](),controller[_0xda25('0xb')]);router[_0xda25('0x7')]('/:id/contacts',auth[_0xda25('0x9')](),controller['getContacts']);router['post']('/',auth[_0xda25('0x9')](),controller[_0xda25('0xc')]);router[_0xda25('0xd')]('/:id/contacts',auth[_0xda25('0x9')](),controller[_0xda25('0xe')]);router[_0xda25('0xf')](_0xda25('0x10'),auth[_0xda25('0x9')](),controller['update']);router['delete'](_0xda25('0x10'),auth['isAuthenticated'](),controller[_0xda25('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index add9b62..3c4df86 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 _0x2fbc=['STRING','TEXT','INTEGER','DATE','lodash','sequelize'];(function(_0x555772,_0x5c34cf){var _0x427064=function(_0x4ba13e){while(--_0x4ba13e){_0x555772['push'](_0x555772['shift']());}};_0x427064(++_0x5c34cf);}(_0x2fbc,0xf4));var _0xc2fb=function(_0xd12f0f,_0x176947){_0xd12f0f=_0xd12f0f-0x0;var _0x5a0473=_0x2fbc[_0xd12f0f];return _0x5a0473;};'use strict';var _=require(_0xc2fb('0x0'));var Sequelize=require(_0xc2fb('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xc2fb('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc2fb('0x2')]},'street':{'type':Sequelize[_0xc2fb('0x2')]},'postalCode':{'type':Sequelize[_0xc2fb('0x2')]},'city':{'type':Sequelize[_0xc2fb('0x2')]},'country':{'type':Sequelize[_0xc2fb('0x2')]},'dateOfBirth':{'type':Sequelize[_0xc2fb('0x2')]},'description':{'type':Sequelize[_0xc2fb('0x3')]},'phone':{'type':Sequelize[_0xc2fb('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc2fb('0x2')]},'email':{'type':Sequelize[_0xc2fb('0x2')]},'url':{'type':Sequelize[_0xc2fb('0x2')]},'facebook':{'type':Sequelize[_0xc2fb('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xc2fb('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc2fb('0x2')]},'viber':{'type':Sequelize[_0xc2fb('0x2')]},'line':{'type':Sequelize[_0xc2fb('0x2')]},'wechat':{'type':Sequelize[_0xc2fb('0x2')]},'telegram':{'type':Sequelize[_0xc2fb('0x2')]},'UserId':{'type':Sequelize[_0xc2fb('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xc2fb('0x2')]},'priority':{'type':Sequelize[_0xc2fb('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc2fb('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xc2fb('0x4')]}};
\ No newline at end of file
+var _0x580f=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x580f,0x172));var _0xf580=function(_0x3a923c,_0x18c5e0){_0x3a923c=_0x3a923c-0x0;var _0x14096d=_0x580f[_0x3a923c];return _0x14096d;};'use strict';var _=require(_0xf580('0x0'));var Sequelize=require('sequelize');module[_0xf580('0x1')]={'firstName':{'type':Sequelize[_0xf580('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf580('0x2')]},'street':{'type':Sequelize[_0xf580('0x2')]},'postalCode':{'type':Sequelize[_0xf580('0x2')]},'city':{'type':Sequelize[_0xf580('0x2')]},'country':{'type':Sequelize[_0xf580('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf580('0x2')]},'description':{'type':Sequelize[_0xf580('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf580('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf580('0x2')]},'url':{'type':Sequelize[_0xf580('0x2')]},'facebook':{'type':Sequelize[_0xf580('0x2')]},'fb_data':{'type':Sequelize[_0xf580('0x2')]},'twitter':{'type':Sequelize[_0xf580('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf580('0x2')]},'viber':{'type':Sequelize[_0xf580('0x2')]},'line':{'type':Sequelize[_0xf580('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xf580('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xf580('0x2')]},'priority':{'type':Sequelize[_0xf580('0x4')](0x2)[_0xf580('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf580('0x6')],'defaultValue':Sequelize[_0xf580('0x7')]},'dialTimezone':{'type':Sequelize[_0xf580('0x2')]},'utcOffset':{'type':Sequelize[_0xf580('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index be619cd..477fd11 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 _0xc99f=['stringify','message','pid','exit','error\x20child\x20process','importUpdates','agent','binding','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','whatsapp','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','startCase','Website','Account','disposition','thirdDisposition','key','Owner','browserName','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','threadId','findAndCountAll','reverse','value','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','index','describe','getOptions','query','catch','find','params','CmContact','keys','length','cf_','columnName','displayName','analytics','CmCustomField','custom','type','info','hasOwnProperty','body','findAll','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','isNil','dialTimezone','utcOffset','timezones','additionalPhones','each','duplicates','where','ListId','findOrCreate','push','contact','Tag','Tags','color','tag','ContactItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','pickBy','startsWith','table','cm_contacts','setFields','id\x20=\x20?','toParam','values','phone','CmHopper','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','order','pick','filter','merge','options','nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','CmHopperId','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','sort','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','send','upload','createReadStream','meta','User','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2'];(function(_0xb38268,_0x4e101e){var _0x4963d0=function(_0xc9d95c){while(--_0xc9d95c){_0xb38268['push'](_0xb38268['shift']());}};_0x4963d0(++_0x4e101e);}(_0xc99f,0x139));var _0xfc99=function(_0x36ee10,_0x3e4e4b){_0x36ee10=_0x36ee10-0x0;var _0x1ae7e8=_0xc99f[_0x36ee10];return _0x1ae7e8;};'use strict';var moment=require(_0xfc99('0x0'));var BPromise=require(_0xfc99('0x1'));var util=require(_0xfc99('0x2'));var path=require(_0xfc99('0x3'));var fs=require('fs');var _=require(_0xfc99('0x4'));var squel=require(_0xfc99('0x5'));var Papa=require(_0xfc99('0x6'));var Redis=require(_0xfc99('0x7'));var contacts=require(_0xfc99('0x8'));var qs=require(_0xfc99('0x9'));var logger=require(_0xfc99('0xa'))(_0xfc99('0xb'));var config=require(_0xfc99('0xc'));var shared=require(_0xfc99('0xd'));var db=require('../../mysqldb')['db'];config[_0xfc99('0xe')]=_[_0xfc99('0xf')](config[_0xfc99('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc99('0x10'))(new Redis(config['redis']));require(_0xfc99('0x11'))[_0xfc99('0x12')](socket);function respondWithResult(_0x529c45,_0x39f1a2){_0x39f1a2=_0x39f1a2||0xc8;return function(_0x5e699c){if(_0x5e699c){return _0x529c45[_0xfc99('0x13')](_0x39f1a2)[_0xfc99('0x14')](_0x5e699c);}};}function respondWithFilteredResult(_0x331724,_0x31d44a){return function(_0xbecf0d){if(_0xbecf0d){var _0x5806c0=typeof _0x31d44a[_0xfc99('0x15')]===_0xfc99('0x16')&&typeof _0x31d44a[_0xfc99('0x17')]==='undefined';var _0x628625=_0xbecf0d[_0xfc99('0x18')];var _0x305da9=_0x5806c0?0x0:_0x31d44a['offset'];var _0x2ae414=_0x5806c0?_0xbecf0d[_0xfc99('0x18')]:_0x31d44a[_0xfc99('0x15')]+_0x31d44a[_0xfc99('0x17')];var _0x4d65d0;if(_0x2ae414>=_0x628625){_0x2ae414=_0x628625;_0x4d65d0=0xc8;}else{_0x4d65d0=0xce;}_0x331724[_0xfc99('0x13')](_0x4d65d0);return _0x331724[_0xfc99('0x19')](_0xfc99('0x1a'),_0x305da9+'-'+_0x2ae414+'/'+_0x628625)['json'](_0xbecf0d);}return null;};}function saveUpdates(_0x5b7fab){return function(_0x57fa8c){if(_0x57fa8c){return _0x57fa8c[_0xfc99('0x1b')](_0x5b7fab)[_0xfc99('0x1c')](function(_0x496061){return _0x496061;});}return null;};}function removeEntity(_0x5b5d9c){return function(_0x26162a){if(_0x26162a){return _0x26162a[_0xfc99('0x1d')]()['then'](function(){_0x5b5d9c[_0xfc99('0x13')](0xcc)[_0xfc99('0x1e')]();});}};}function handleEntityNotFound(_0x52095c){return function(_0x57301f){if(!_0x57301f){_0x52095c['sendStatus'](0x194);}return _0x57301f;};}function handleError(_0x5b927b,_0x4a94d4){_0x4a94d4=_0x4a94d4||0x1f4;return function(_0x40d088){logger[_0xfc99('0x1f')](_0x40d088[_0xfc99('0x20')]);if(_0x40d088[_0xfc99('0x21')]){delete _0x40d088[_0xfc99('0x21')];}_0x5b927b['status'](_0x4a94d4)['send'](_0x40d088);};}exports[_0xfc99('0x22')]=function(_0x1fc924,_0x4a314c){var _0x158784={};return contacts[_0xfc99('0x23')]()['then'](function(_0x142481){_0x158784=qs[_0xfc99('0x24')](_0x142481,_0x1fc924);return contacts['findAll'](_0x1fc924[_0xfc99('0x25')],_0x1fc924['user'],_0x158784,_0x142481);})[_0xfc99('0x1c')](respondWithFilteredResult(_0x4a314c,_0x158784))[_0xfc99('0x26')](handleError(_0x4a314c,null));};exports[_0xfc99('0x1d')]=function(_0x332c63,_0x59e1b8){return db['CmContact'][_0xfc99('0x27')]({'where':{'id':_0x332c63[_0xfc99('0x28')]['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x59e1b8,null))[_0xfc99('0x1c')](removeEntity(_0x59e1b8,null))[_0xfc99('0x26')](handleError(_0x59e1b8,null));};exports[_0xfc99('0x23')]=function(_0x1c4825,_0x5d9201){return db[_0xfc99('0x29')]['describe']()[_0xfc99('0x1c')](function(_0x443c83){delete _0x443c83['tags'];for(var _0xc86b72=0x0;_0xc86b72
','Attachments','Title','Data','generateXOAuth2Token','utf-8','toString','base64','lodash','path','../../../config/logger','email','head','value'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x3313,0x122));var _0x3331=function(_0x1accd6,_0x239330){_0x1accd6=_0x1accd6-0x0;var _0x3925f3=_0x3313[_0x1accd6];return _0x3925f3;};'use strict';var _=require(_0x3331('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x3331('0x1'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x3331('0x2'))(_0x3331('0x3'));var config=require('../../../config/environment');function getAddress(_0x353537){var _0x969b92=_[_0x3331('0x4')](_0x353537[_0x3331('0x5')]);return _0x969b92&&_0x969b92[_0x3331('0x6')]?_0x969b92['address']:_0x3331('0x7')+random[_0x3331('0x8')](0x6)+_0x3331('0x9');}function getFirstName(_0x94e325){var _0x3f29aa=_[_0x3331('0x4')](_0x94e325[_0x3331('0x5')]);if(_0x3f29aa&&_0x3f29aa[_0x3331('0xa')]){if(_0x3f29aa[_0x3331('0xa')]==_0x3f29aa[_0x3331('0x6')]){return _0x3f29aa[_0x3331('0xa')][_0x3331('0xb')](0x0,_0x3f29aa[_0x3331('0xa')]['indexOf']('@'));}var _0x37d1e5=_0x3f29aa[_0x3331('0xa')][_0x3331('0xc')](/\s+/);return _0x37d1e5[_0x3331('0xd')]>0x1?_0x37d1e5[_0x3331('0xe')](0x0,-0x1)[_0x3331('0xf')]('\x20'):_0x3f29aa[_0x3331('0xa')];}return _0x3331('0x10');}function getLastName(_0x25b261){var _0x2d56ae=_[_0x3331('0x4')](_0x25b261[_0x3331('0x5')]);if(_0x2d56ae&&_0x2d56ae['name']){var _0x16a134=_0x2d56ae[_0x3331('0xa')][_0x3331('0xc')](/\s+/);return _0x16a134[_0x3331('0xd')]>0x1?_0x16a134[_0x3331('0x11')]():'';}return'';}function getMails(_0x2df2de,_0x53a759){var _0xacf296='';for(var _0x1e9d81=0x0;_0x1e9d81<_0x53a759[_0x3331('0x5')][_0x3331('0xd')];_0x1e9d81+=0x1){if(_0x53a759['value'][_0x1e9d81][_0x3331('0x6')]!==_0x2df2de){if(!_[_0x3331('0x12')](_0xacf296)){_0xacf296+=',';}_0xacf296+=_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0xa')]||_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0x6')]||'';_0xacf296+='\x20<';_0xacf296+=_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0x6')]?_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0x6')]:_0x3331('0x7')+random['generate'](0x6)+_0x3331('0x9');_0xacf296+='>';}}return _0xacf296;}function parseEmail(_0x46c0e5,_0x147939,_0x4e9dc3){if(_0x147939[_0x3331('0x13')]){var _0x2723cb=/