From: Andrea Amorese
Date: Thu, 23 Sep 2021 07:44:07 +0000 (+0200)
Subject: Built motion from commit d770e63b.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22avatar.png/%22?a=commitdiff_plain;h=245230f09ad35afb5ef62905063b364d48d52205;p=motion2.git
Built motion from commit d770e63b.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 5724111..ee5266b 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-22T15:58:12.577Z",
+ "time": "2021-09-23T07:36:51.513Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9638f54..fe8d046 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-22T15:58:12.577Z",
+ "time": "2021-09-23T07:36:51.513Z",
"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 0d35d51..e071742 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 _0x7046=['sequelize','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]'];(function(_0x46e693,_0x44e957){var _0x50d528=function(_0x37009f){while(--_0x37009f){_0x46e693['push'](_0x46e693['shift']());}};_0x50d528(++_0x44e957);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x6704('0x0'));module[_0x6704('0x1')]={'name':{'type':Sequelize[_0x6704('0x2')],'get':function(_0x3e2b36){return this['getDataValue'](_0x6704('0x3'));}},'action':{'type':Sequelize[_0x6704('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6704('0x5'),'integration',_0x6704('0x6'),_0x6704('0x7'),_0x6704('0x8'),_0x6704('0x9'),_0x6704('0xa'),'script']],'msg':_0x6704('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6704('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x6704('0x4')](0x1000),'comment':_0x6704('0xd')},'data4':{'type':Sequelize[_0x6704('0x4')](0x1000),'comments':_0x6704('0xe')},'data5':{'type':Sequelize[_0x6704('0x4')](0x1000),'comments':_0x6704('0xf')},'data6':{'type':Sequelize[_0x6704('0x4')],'comments':_0x6704('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x6704('0x11')}};
\ No newline at end of file
+var _0x4317=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','bot'];(function(_0x436757,_0xc3de7d){var _0x343ac5=function(_0x10d715){while(--_0x10d715){_0x436757['push'](_0x436757['shift']());}};_0x343ac5(++_0xc3de7d);}(_0x4317,0x7c));var _0x7431=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4317[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'get':function(_0x1ad054){return this['getDataValue'](_0x7431('0x2'));}},'action':{'type':Sequelize[_0x7431('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6'),_0x7431('0x7'),'urlForward','browser',_0x7431('0x8'),_0x7431('0x9')]],'msg':_0x7431('0xa')}},'comment':_0x7431('0xa')},'data1':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xb')},'data2':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xc')},'data3':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xd')},'data4':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xe')},'data5':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xf')},'data6':{'type':Sequelize[_0x7431('0x3')],'comments':_0x7431('0x10')},'data7':{'type':Sequelize[_0x7431('0x11')],'comments':_0x7431('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 061df41..4c6990f 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 _0x6a67=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','update','body','find','catch','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6a67,0xe1));var _0x76a6=function(_0x1d6e56,_0x1959b9){_0x1d6e56=_0x1d6e56-0x0;var _0xef8e84=_0x6a67[_0x1d6e56];return _0xef8e84;};'use strict';var emlformat=require(_0x76a6('0x0'));var rimraf=require(_0x76a6('0x1'));var zipdir=require(_0x76a6('0x2'));var jsonpatch=require(_0x76a6('0x3'));var rp=require(_0x76a6('0x4'));var moment=require('moment');var BPromise=require(_0x76a6('0x5'));var Mustache=require(_0x76a6('0x6'));var util=require(_0x76a6('0x7'));var path=require(_0x76a6('0x8'));var sox=require(_0x76a6('0x9'));var csv=require(_0x76a6('0xa'));var ejs=require(_0x76a6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76a6('0xc'));var squel=require(_0x76a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x76a6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x76a6('0xf'));var Papa=require(_0x76a6('0x10'));var Redis=require(_0x76a6('0x11'));var authService=require(_0x76a6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x76a6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76a6('0x14'));var utils=require('../../config/utils');var config=require(_0x76a6('0x15'));var licenseUtil=require(_0x76a6('0x16'));var db=require(_0x76a6('0x17'))['db'];function respondWithStatusCode(_0x2f7204,_0x59216b){_0x59216b=_0x59216b||0xcc;return function(_0xeef77c){if(_0xeef77c){return _0x2f7204['sendStatus'](_0x59216b);}return _0x2f7204[_0x76a6('0x18')](_0x59216b)[_0x76a6('0x19')]();};}function respondWithResult(_0x557f3c,_0x5cb00d){_0x5cb00d=_0x5cb00d||0xc8;return function(_0x4ac0e9){if(_0x4ac0e9){return _0x557f3c['status'](_0x5cb00d)['json'](_0x4ac0e9);}};}function respondWithFilteredResult(_0x19ffe1,_0x3bd0c5){return function(_0x830641){if(_0x830641){var _0xaca3ba=typeof _0x3bd0c5[_0x76a6('0x1a')]===_0x76a6('0x1b')&&typeof _0x3bd0c5[_0x76a6('0x1c')]===_0x76a6('0x1b');var _0xef8340=_0x830641[_0x76a6('0x1d')];var _0x4b0234=_0xaca3ba?0x0:_0x3bd0c5[_0x76a6('0x1a')];var _0x59e0ae=_0xaca3ba?_0x830641[_0x76a6('0x1d')]:_0x3bd0c5[_0x76a6('0x1a')]+_0x3bd0c5[_0x76a6('0x1c')];var _0x5c7abf;if(_0x59e0ae>=_0xef8340){_0x59e0ae=_0xef8340;_0x5c7abf=0xc8;}else{_0x5c7abf=0xce;}_0x19ffe1[_0x76a6('0x18')](_0x5c7abf);return _0x19ffe1['set'](_0x76a6('0x1e'),_0x4b0234+'-'+_0x59e0ae+'/'+_0xef8340)[_0x76a6('0x1f')](_0x830641);}return null;};}function patchUpdates(_0x8a8129){return function(_0x337633){try{jsonpatch[_0x76a6('0x20')](_0x337633,_0x8a8129,!![]);}catch(_0x4f6a97){return BPromise[_0x76a6('0x21')](_0x4f6a97);}return _0x337633[_0x76a6('0x22')]();};}function saveUpdates(_0x4fe0e1,_0xda1b2f){return function(_0x5bb3ae){if(_0x5bb3ae){return _0x5bb3ae['update'](_0x4fe0e1)[_0x76a6('0x23')](function(_0x469fa1){return _0x469fa1;});}return null;};}function removeEntity(_0x1face9,_0x2fcbb5){return function(_0x5d36ad){if(_0x5d36ad){return _0x5d36ad[_0x76a6('0x24')]()[_0x76a6('0x23')](function(){_0x1face9[_0x76a6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57fa01,_0x23fc20){return function(_0x4b946e){if(!_0x4b946e){_0x57fa01[_0x76a6('0x25')](0x194);}return _0x4b946e;};}function handleError(_0x17a740,_0x4e7c14){_0x4e7c14=_0x4e7c14||0x1f4;return function(_0x34089e){logger[_0x76a6('0x26')](_0x34089e[_0x76a6('0x27')]);if(_0x34089e[_0x76a6('0x28')]){delete _0x34089e[_0x76a6('0x28')];}_0x17a740[_0x76a6('0x18')](_0x4e7c14)[_0x76a6('0x29')](_0x34089e);};}exports[_0x76a6('0x2a')]=function(_0xe7f1fe,_0x852151){if(_0xe7f1fe[_0x76a6('0x2b')]['id']){delete _0xe7f1fe[_0x76a6('0x2b')]['id'];}return db['Action'][_0x76a6('0x2c')]({'where':{'id':_0xe7f1fe['params']['id']}})[_0x76a6('0x23')](handleEntityNotFound(_0x852151,null))[_0x76a6('0x23')](saveUpdates(_0xe7f1fe[_0x76a6('0x2b')],null))[_0x76a6('0x23')](respondWithResult(_0x852151,null))[_0x76a6('0x2d')](handleError(_0x852151,null));};exports['destroy']=function(_0xaba9ce,_0x57958c){return db[_0x76a6('0x2e')][_0x76a6('0x2c')]({'where':{'id':_0xaba9ce[_0x76a6('0x2f')]['id']}})['then'](handleEntityNotFound(_0x57958c,null))[_0x76a6('0x23')](removeEntity(_0x57958c,null))[_0x76a6('0x2d')](handleError(_0x57958c,null));};
\ No newline at end of file
+var _0xd0b7=['Action','find','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','body'];(function(_0x4dcef2,_0x52845d){var _0xe80f33=function(_0x510b1c){while(--_0x510b1c){_0x4dcef2['push'](_0x4dcef2['shift']());}};_0xe80f33(++_0x52845d);}(_0xd0b7,0x15a));var _0x7d0b=function(_0xd7a1b3,_0x3a715f){_0xd7a1b3=_0xd7a1b3-0x0;var _0x2beb1b=_0xd0b7[_0xd7a1b3];return _0x2beb1b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d0b('0x0'));var jsonpatch=require(_0x7d0b('0x1'));var rp=require(_0x7d0b('0x2'));var moment=require(_0x7d0b('0x3'));var BPromise=require(_0x7d0b('0x4'));var Mustache=require(_0x7d0b('0x5'));var util=require(_0x7d0b('0x6'));var path=require(_0x7d0b('0x7'));var sox=require(_0x7d0b('0x8'));var csv=require(_0x7d0b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d0b('0xa'));var _=require(_0x7d0b('0xb'));var squel=require('squel');var crypto=require(_0x7d0b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7d0b('0xd'));var toCsv=require(_0x7d0b('0x9'));var querystring=require(_0x7d0b('0xe'));var Papa=require(_0x7d0b('0xf'));var Redis=require('ioredis');var authService=require(_0x7d0b('0x10'));var qs=require(_0x7d0b('0x11'));var as=require(_0x7d0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d0b('0x13'))(_0x7d0b('0x14'));var utils=require(_0x7d0b('0x15'));var config=require(_0x7d0b('0x16'));var licenseUtil=require(_0x7d0b('0x17'));var db=require(_0x7d0b('0x18'))['db'];function respondWithStatusCode(_0x227dca,_0xc6fea6){_0xc6fea6=_0xc6fea6||0xcc;return function(_0x4ad7bb){if(_0x4ad7bb){return _0x227dca[_0x7d0b('0x19')](_0xc6fea6);}return _0x227dca[_0x7d0b('0x1a')](_0xc6fea6)[_0x7d0b('0x1b')]();};}function respondWithResult(_0x3e6154,_0x7ee432){_0x7ee432=_0x7ee432||0xc8;return function(_0x3fda97){if(_0x3fda97){return _0x3e6154['status'](_0x7ee432)[_0x7d0b('0x1c')](_0x3fda97);}};}function respondWithFilteredResult(_0x494d3c,_0x3a594c){return function(_0x1513db){if(_0x1513db){var _0x19ae27=typeof _0x3a594c[_0x7d0b('0x1d')]==='undefined'&&typeof _0x3a594c['limit']===_0x7d0b('0x1e');var _0x25f924=_0x1513db['count'];var _0x2a7ab4=_0x19ae27?0x0:_0x3a594c[_0x7d0b('0x1d')];var _0x360c4a=_0x19ae27?_0x1513db[_0x7d0b('0x1f')]:_0x3a594c[_0x7d0b('0x1d')]+_0x3a594c[_0x7d0b('0x20')];var _0xf605f6;if(_0x360c4a>=_0x25f924){_0x360c4a=_0x25f924;_0xf605f6=0xc8;}else{_0xf605f6=0xce;}_0x494d3c[_0x7d0b('0x1a')](_0xf605f6);return _0x494d3c[_0x7d0b('0x21')](_0x7d0b('0x22'),_0x2a7ab4+'-'+_0x360c4a+'/'+_0x25f924)[_0x7d0b('0x1c')](_0x1513db);}return null;};}function patchUpdates(_0x29f497){return function(_0x333145){try{jsonpatch[_0x7d0b('0x23')](_0x333145,_0x29f497,!![]);}catch(_0x5cc3d7){return BPromise[_0x7d0b('0x24')](_0x5cc3d7);}return _0x333145[_0x7d0b('0x25')]();};}function saveUpdates(_0x2dab90,_0x3c227d){return function(_0x3e8ee1){if(_0x3e8ee1){return _0x3e8ee1[_0x7d0b('0x26')](_0x2dab90)['then'](function(_0x11ba9b){return _0x11ba9b;});}return null;};}function removeEntity(_0x1ed98d,_0x21fc99){return function(_0x4ab8ab){if(_0x4ab8ab){return _0x4ab8ab[_0x7d0b('0x27')]()[_0x7d0b('0x28')](function(){_0x1ed98d[_0x7d0b('0x1a')](0xcc)[_0x7d0b('0x1b')]();});}};}function handleEntityNotFound(_0x1cee6b,_0x5b6180){return function(_0x6ab149){if(!_0x6ab149){_0x1cee6b[_0x7d0b('0x19')](0x194);}return _0x6ab149;};}function handleError(_0x3c66c9,_0x3b6607){_0x3b6607=_0x3b6607||0x1f4;return function(_0x31e5ce){logger[_0x7d0b('0x29')](_0x31e5ce[_0x7d0b('0x2a')]);if(_0x31e5ce['name']){delete _0x31e5ce[_0x7d0b('0x2b')];}_0x3c66c9[_0x7d0b('0x1a')](_0x3b6607)[_0x7d0b('0x2c')](_0x31e5ce);};}exports[_0x7d0b('0x26')]=function(_0x3bd6d3,_0x30e694){if(_0x3bd6d3[_0x7d0b('0x2d')]['id']){delete _0x3bd6d3[_0x7d0b('0x2d')]['id'];}return db[_0x7d0b('0x2e')][_0x7d0b('0x2f')]({'where':{'id':_0x3bd6d3['params']['id']}})[_0x7d0b('0x28')](handleEntityNotFound(_0x30e694,null))[_0x7d0b('0x28')](saveUpdates(_0x3bd6d3[_0x7d0b('0x2d')],null))[_0x7d0b('0x28')](respondWithResult(_0x30e694,null))[_0x7d0b('0x30')](handleError(_0x30e694,null));};exports[_0x7d0b('0x27')]=function(_0x27afe6,_0x533336){return db[_0x7d0b('0x2e')]['find']({'where':{'id':_0x27afe6['params']['id']}})[_0x7d0b('0x28')](handleEntityNotFound(_0x533336,null))[_0x7d0b('0x28')](removeEntity(_0x533336,null))[_0x7d0b('0x30')](handleError(_0x533336,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 9b3409b..5a48b59 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 _0x065d=['../../config/environment','./action.attributes','define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x065d,0x1e5));var _0xd065=function(_0x11bffe,_0x3f704b){_0x11bffe=_0x11bffe-0x0;var _0x476ba6=_0x065d[_0x11bffe];return _0x476ba6;};'use strict';var _=require('lodash');var util=require(_0xd065('0x0'));var logger=require(_0xd065('0x1'))('api');var moment=require(_0xd065('0x2'));var BPromise=require(_0xd065('0x3'));var rp=require(_0xd065('0x4'));var fs=require('fs');var path=require(_0xd065('0x5'));var rimraf=require(_0xd065('0x6'));var config=require(_0xd065('0x7'));var attributes=require(_0xd065('0x8'));module['exports']=function(_0x3faa73,_0x18d5fb){return _0x3faa73[_0xd065('0x9')](_0xd065('0xa'),attributes,{'tableName':_0xd065('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5e7=['exports','define','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x536bb0,_0x32489e){var _0x152386=function(_0x23fbc3){while(--_0x23fbc3){_0x536bb0['push'](_0x536bb0['shift']());}};_0x152386(++_0x32489e);}(_0xb5e7,0x9f));var _0x7b5e=function(_0x214ab7,_0x5131ef){_0x214ab7=_0x214ab7-0x0;var _0xb29292=_0xb5e7[_0x214ab7];return _0xb29292;};'use strict';var _=require(_0x7b5e('0x0'));var util=require(_0x7b5e('0x1'));var logger=require(_0x7b5e('0x2'))(_0x7b5e('0x3'));var moment=require(_0x7b5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b5e('0x5'));var fs=require('fs');var path=require(_0x7b5e('0x6'));var rimraf=require(_0x7b5e('0x7'));var config=require(_0x7b5e('0x8'));var attributes=require(_0x7b5e('0x9'));module[_0x7b5e('0xa')]=function(_0x49be6e,_0x17df59){return _0x49be6e[_0x7b5e('0xb')]('Action',attributes,{'tableName':_0x7b5e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 68da481..c82e711 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xf494,0x1c6));var _0x4f49=function(_0x1ae33d,_0x16cd80){_0x1ae33d=_0x1ae33d-0x0;var _0xc51c8c=_0xf494[_0x1ae33d];return _0xc51c8c;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+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(_0x1ffb6c,_0x5bbe7c){var _0x1e4fdd=function(_0x39af89){while(--_0x39af89){_0x1ffb6c['push'](_0x1ffb6c['shift']());}};_0x1e4fdd(++_0x5bbe7c);}(_0xabce,0x103));var _0xeabc=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xabce[_0x55f8b4];return _0x2475f9;};'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 f915683..0936d28 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 _0x3e06=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x3e06,0x149));var _0x63e0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3e06[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x63e0('0x0'));var path=require(_0x63e0('0x1'));var timeout=require(_0x63e0('0x2'));var express=require(_0x63e0('0x3'));var router=express[_0x63e0('0x4')]();var fs_extra=require(_0x63e0('0x5'));var auth=require(_0x63e0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x63e0('0x7'));var controller=require('./action.controller');router[_0x63e0('0x8')](_0x63e0('0x9'),auth[_0x63e0('0xa')](),controller[_0x63e0('0xb')]);router[_0x63e0('0xc')](_0x63e0('0x9'),auth['isAuthenticated'](),controller[_0x63e0('0xd')]);module[_0x63e0('0xe')]=router;
\ No newline at end of file
+var _0x522d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x57a272,_0x2482d1){var _0x436b2d=function(_0x136cc5){while(--_0x136cc5){_0x57a272['push'](_0x57a272['shift']());}};_0x436b2d(++_0x2482d1);}(_0x522d,0x122));var _0xd522=function(_0x52cf5b,_0x394ded){_0x52cf5b=_0x52cf5b-0x0;var _0x42f1f7=_0x522d[_0x52cf5b];return _0x42f1f7;};'use strict';var multer=require(_0xd522('0x0'));var util=require(_0xd522('0x1'));var path=require(_0xd522('0x2'));var timeout=require(_0xd522('0x3'));var express=require(_0xd522('0x4'));var router=express[_0xd522('0x5')]();var fs_extra=require(_0xd522('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd522('0x7'));var config=require(_0xd522('0x8'));var controller=require(_0xd522('0x9'));router[_0xd522('0xa')](_0xd522('0xb'),auth[_0xd522('0xc')](),controller[_0xd522('0xd')]);router[_0xd522('0xe')](_0xd522('0xb'),auth[_0xd522('0xc')](),controller[_0xd522('0xf')]);module[_0xd522('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index afa6f19..701ba54 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x4a610f,_0x530785){var _0x3e4f77=function(_0x5f1812){while(--_0x5f1812){_0x4a610f['push'](_0x4a610f['shift']());}};_0x3e4f77(++_0x530785);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xdbf5=['exports','STRING','TEXT'];(function(_0x6eb2b6,_0x53ac72){var _0xc0cd55=function(_0x166c3f){while(--_0x166c3f){_0x6eb2b6['push'](_0x6eb2b6['shift']());}};_0xc0cd55(++_0x53ac72);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2828ad,_0x95a0){_0x2828ad=_0x2828ad-0x0;var _0x42c43f=_0xdbf5[_0x2828ad];return _0x42c43f;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 513bb64..2df4c75 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 _0x7039=['DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','toString','sequelize','QueryTypes','COUNT(%s)','AVG(%s)','IS\x20NULL','from','web','fullPath','%s-%s.%s','randomstring','output','csv','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','options','keyBy','Limited\x20Query:','SELECT','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','set','apply','update','destroy','then','get','CustomReports','UserProfileResource','end','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','order','sort','pick','filter','merge','type','VIRTUAL','where','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)'];(function(_0x41d9f9,_0x469db5){var _0x5bcb1e=function(_0x4180cf){while(--_0x4180cf){_0x41d9f9['push'](_0x41d9f9['shift']());}};_0x5bcb1e(++_0x469db5);}(_0x7039,0xe5));var _0x9703=function(_0x583b22,_0x589614){_0x583b22=_0x583b22-0x0;var _0x1252a6=_0x7039[_0x583b22];return _0x1252a6;};'use strict';var emlformat=require(_0x9703('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9703('0x1'));var moment=require(_0x9703('0x2'));var BPromise=require(_0x9703('0x3'));var Mustache=require(_0x9703('0x4'));var util=require(_0x9703('0x5'));var path=require(_0x9703('0x6'));var sox=require(_0x9703('0x7'));var csv=require(_0x9703('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9703('0x9'));var _=require(_0x9703('0xa'));var squel=require('squel');var crypto=require(_0x9703('0xb'));var jsforce=require(_0x9703('0xc'));var deskjs=require(_0x9703('0xd'));var toCsv=require(_0x9703('0x8'));var querystring=require('querystring');var Papa=require(_0x9703('0xe'));var Redis=require(_0x9703('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9703('0x10'));var as=require(_0x9703('0x11'));var hardwareService=require(_0x9703('0x12'));var logger=require(_0x9703('0x13'))(_0x9703('0x14'));var utils=require(_0x9703('0x15'));var config=require(_0x9703('0x16'));var licenseUtil=require(_0x9703('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9703('0x18'))[_0x9703('0x19')];function respondWithStatusCode(_0x52eae5,_0x28f037){_0x28f037=_0x28f037||0xcc;return function(_0x757d6f){if(_0x757d6f){return _0x52eae5[_0x9703('0x1a')](_0x28f037);}return _0x52eae5[_0x9703('0x1b')](_0x28f037)['end']();};}function respondWithResult(_0x1a0564,_0x550b0d){_0x550b0d=_0x550b0d||0xc8;return function(_0x4e2be0){if(_0x4e2be0){return _0x1a0564[_0x9703('0x1b')](_0x550b0d)[_0x9703('0x1c')](_0x4e2be0);}};}function respondWithFilteredResult(_0x293a74,_0x1b447d){return function(_0x73452a){if(_0x73452a){var _0x5629ab=typeof _0x1b447d[_0x9703('0x1d')]===_0x9703('0x1e')&&typeof _0x1b447d[_0x9703('0x1f')]===_0x9703('0x1e');var _0x283759=_0x73452a['count'];var _0xc051f0=_0x5629ab?0x0:_0x1b447d[_0x9703('0x1d')];var _0x2a855f=_0x5629ab?_0x73452a['count']:_0x1b447d['offset']+_0x1b447d[_0x9703('0x1f')];var _0x59a5d7;if(_0x2a855f>=_0x283759){_0x2a855f=_0x283759;_0x59a5d7=0xc8;}else{_0x59a5d7=0xce;}_0x293a74['status'](_0x59a5d7);return _0x293a74[_0x9703('0x20')]('Content-Range',_0xc051f0+'-'+_0x2a855f+'/'+_0x283759)[_0x9703('0x1c')](_0x73452a);}return null;};}function patchUpdates(_0x5c9dea){return function(_0x53eb3f){try{jsonpatch[_0x9703('0x21')](_0x53eb3f,_0x5c9dea,!![]);}catch(_0x4facae){return BPromise['reject'](_0x4facae);}return _0x53eb3f['save']();};}function saveUpdates(_0x178306,_0x15d3f8){return function(_0x786ae6){if(_0x786ae6){return _0x786ae6[_0x9703('0x22')](_0x178306)['then'](function(_0x3fe7ed){return _0x3fe7ed;});}return null;};}function removeEntity(_0x361934,_0x5d0cb3){return function(_0x4c0b27){if(_0x4c0b27){return _0x4c0b27[_0x9703('0x23')]()[_0x9703('0x24')](function(){var _0x4695b1=_0x4c0b27[_0x9703('0x25')]({'plain':!![]});var _0x5c1cc7=_0x9703('0x26');return db[_0x9703('0x27')]['destroy']({'where':{'type':_0x5c1cc7,'resourceId':_0x4695b1['id']}})['then'](function(){return _0x4c0b27;});})[_0x9703('0x24')](function(){_0x361934['status'](0xcc)[_0x9703('0x28')]();});}};}function handleEntityNotFound(_0x459ac0,_0x2a06f5){return function(_0x231782){if(!_0x231782){_0x459ac0[_0x9703('0x1a')](0x194);}return _0x231782;};}function handleError(_0x32887b,_0x45328c){_0x45328c=_0x45328c||0x1f4;return function(_0x4aab3c){logger[_0x9703('0x29')](_0x4aab3c['stack']);if(_0x4aab3c[_0x9703('0x2a')]){delete _0x4aab3c[_0x9703('0x2a')];}_0x32887b[_0x9703('0x1b')](_0x45328c)['send'](_0x4aab3c);};}exports['index']=function(_0x1503b0,_0x25d4f6){var _0x4ef584={},_0xeee02={},_0x9ba289={'count':0x0,'rows':[]};var _0x5411ac=_[_0x9703('0x2b')](db[_0x9703('0x2c')][_0x9703('0x2d')],function(_0x3285c4){return{'name':_0x3285c4[_0x9703('0x2e')],'type':_0x3285c4['type'][_0x9703('0x2f')]};});_0xeee02[_0x9703('0x30')]=_['map'](_0x5411ac,_0x9703('0x2a'));_0xeee02[_0x9703('0x31')]=_[_0x9703('0x32')](_0x1503b0[_0x9703('0x31')]);_0xeee02[_0x9703('0x33')]=_[_0x9703('0x34')](_0xeee02['model'],_0xeee02[_0x9703('0x31')]);_0x4ef584['attributes']=_['intersection'](_0xeee02['model'],qs[_0x9703('0x35')](_0x1503b0['query'][_0x9703('0x35')]));_0x4ef584['attributes']=_0x4ef584[_0x9703('0x36')]['length']?_0x4ef584[_0x9703('0x36')]:_0xeee02['model'];if(!_0x1503b0[_0x9703('0x31')]['hasOwnProperty']('nolimit')){_0x4ef584[_0x9703('0x1f')]=qs[_0x9703('0x1f')](_0x1503b0[_0x9703('0x31')][_0x9703('0x1f')]);_0x4ef584[_0x9703('0x1d')]=qs[_0x9703('0x1d')](_0x1503b0[_0x9703('0x31')]['offset']);}_0x4ef584[_0x9703('0x37')]=qs[_0x9703('0x38')](_0x1503b0[_0x9703('0x31')][_0x9703('0x38')]);_0x4ef584['where']=qs[_0x9703('0x33')](_[_0x9703('0x39')](_0x1503b0['query'],_0xeee02[_0x9703('0x33')]),_0x5411ac);if(_0x1503b0[_0x9703('0x31')][_0x9703('0x3a')]){_0x4ef584['where']=_[_0x9703('0x3b')](_0x4ef584['where'],{'$or':_[_0x9703('0x2b')](_0x5411ac,function(_0x347ecf){if(_0x347ecf[_0x9703('0x3c')]!==_0x9703('0x3d')){var _0x44d112={};_0x44d112[_0x347ecf[_0x9703('0x2a')]]={'$like':'%'+_0x1503b0[_0x9703('0x31')]['filter']+'%'};return _0x44d112;}})});}_0x4ef584=_[_0x9703('0x3b')]({},_0x4ef584,_0x1503b0['options']);var _0x34b251={'where':_0x4ef584[_0x9703('0x3e')]};return db['AnalyticCustomReport'][_0x9703('0x3f')](_0x34b251)['then'](function(_0x2ae367){_0x9ba289[_0x9703('0x3f')]=_0x2ae367;if(_0x1503b0[_0x9703('0x31')][_0x9703('0x40')]){_0x4ef584[_0x9703('0x41')]=[{'all':!![]}];}return db[_0x9703('0x2c')][_0x9703('0x42')](_0x4ef584);})[_0x9703('0x24')](function(_0x5b2158){_0x9ba289[_0x9703('0x43')]=_0x5b2158;return _0x9ba289;})['then'](respondWithFilteredResult(_0x25d4f6,_0x4ef584))[_0x9703('0x44')](handleError(_0x25d4f6,null));};exports[_0x9703('0x45')]=function(_0x30391f,_0xf61678){var _0x50ec30={'raw':![],'where':{'id':_0x30391f[_0x9703('0x46')]['id']}},_0xdb3929={};_0xdb3929[_0x9703('0x30')]=_[_0x9703('0x32')](db['AnalyticCustomReport'][_0x9703('0x2d')]);_0xdb3929['query']=_[_0x9703('0x32')](_0x30391f['query']);_0xdb3929[_0x9703('0x33')]=_['intersection'](_0xdb3929['model'],_0xdb3929['query']);_0x50ec30[_0x9703('0x36')]=_[_0x9703('0x34')](_0xdb3929[_0x9703('0x30')],qs['fields'](_0x30391f[_0x9703('0x31')]['fields']));_0x50ec30[_0x9703('0x36')]=_0x50ec30[_0x9703('0x36')][_0x9703('0x47')]?_0x50ec30[_0x9703('0x36')]:_0xdb3929[_0x9703('0x30')];if(_0x30391f[_0x9703('0x31')][_0x9703('0x40')]){_0x50ec30['include']=[{'all':!![]}];}_0x50ec30=_[_0x9703('0x3b')]({},_0x50ec30,_0x30391f['options']);return db['AnalyticCustomReport'][_0x9703('0x48')](_0x50ec30)[_0x9703('0x24')](handleEntityNotFound(_0xf61678,null))['then'](respondWithResult(_0xf61678,null))[_0x9703('0x44')](handleError(_0xf61678,null));};exports[_0x9703('0x49')]=function(_0x5df665,_0x43bdd1){return db[_0x9703('0x2c')][_0x9703('0x49')](_0x5df665[_0x9703('0x4a')],{})[_0x9703('0x24')](function(_0x69ee2c){var _0x52a1ae=_0x5df665['user'][_0x9703('0x25')]({'plain':!![]});if(!_0x52a1ae)throw new Error(_0x9703('0x4b'));if(_0x52a1ae['role']==='user'){var _0x429d4b=_0x69ee2c[_0x9703('0x25')]({'plain':!![]});var _0x51be49=_0x9703('0x4c');return db['UserProfileSection'][_0x9703('0x48')]({'where':{'name':_0x51be49,'userProfileId':_0x52a1ae[_0x9703('0x4d')]},'raw':!![]})[_0x9703('0x24')](function(_0x363290){if(_0x363290&&_0x363290[_0x9703('0x4e')]===0x0){return db[_0x9703('0x27')][_0x9703('0x49')]({'name':_0x429d4b[_0x9703('0x2a')],'resourceId':_0x429d4b['id'],'type':_0x9703('0x26'),'sectionId':_0x363290['id']},{})[_0x9703('0x24')](function(){return _0x69ee2c;});}else{return _0x69ee2c;}})[_0x9703('0x44')](function(_0x18b160){logger[_0x9703('0x29')](_0x9703('0x4f'),_0x18b160);throw _0x18b160;});}return _0x69ee2c;})[_0x9703('0x24')](respondWithResult(_0x43bdd1,0xc9))[_0x9703('0x44')](handleError(_0x43bdd1,null));};exports[_0x9703('0x22')]=function(_0x304608,_0x3773b2){if(_0x304608[_0x9703('0x4a')]['id']){delete _0x304608[_0x9703('0x4a')]['id'];}return db[_0x9703('0x2c')][_0x9703('0x48')]({'where':{'id':_0x304608[_0x9703('0x46')]['id']}})['then'](handleEntityNotFound(_0x3773b2,null))[_0x9703('0x24')](saveUpdates(_0x304608[_0x9703('0x4a')],null))[_0x9703('0x24')](respondWithResult(_0x3773b2,null))['catch'](handleError(_0x3773b2,null));};exports[_0x9703('0x23')]=function(_0x53fc57,_0xc3be06){return db[_0x9703('0x2c')][_0x9703('0x48')]({'where':{'id':_0x53fc57['params']['id']}})['then'](handleEntityNotFound(_0xc3be06,null))[_0x9703('0x24')](removeEntity(_0xc3be06,null))[_0x9703('0x44')](handleError(_0xc3be06,null));};exports[_0x9703('0x50')]=function(_0x427c6,_0x4ff4f9){var _0x1a6508=0xa;var _0x5c7483=[_0x9703('0x51'),_0x9703('0x52'),_0x9703('0x53'),_0x9703('0x54')];var _0x39a1ea={'SUM':_0x9703('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9703('0x56'),'MAX':_0x9703('0x57'),'MIN':_0x9703('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9703('0x59'),'GROUP_CONCAT ASC':_0x9703('0x5a'),'GROUP_CONCAT DESC':_0x9703('0x5b')};var _0x2ca455={'SEC_TO_TIME':_0x9703('0x5c'),'DATE':_0x9703('0x5d'),'HOUR':_0x9703('0x5e'),'ROUND':_0x9703('0x5f'),'UNIX_TIMESTAMP':_0x9703('0x60')};var _0x29ce0d=function(_0x43b2fd){return!_[_0x9703('0x61')](['IS\x20NULL',_0x9703('0x62'),_0x9703('0x63'),_0x9703('0x64')],_0x43b2fd);};var _0x562bfd=function(_0x290061){if(!_0x290061||!_0x290061[_0x9703('0x65')][_0x9703('0x47')]){return'';}for(var _0x1e10d9='(',_0xbbb2b8=0x0;_0xbbb2b8<_0x290061['rules'][_0x9703('0x47')];_0xbbb2b8+=0x1){_0xbbb2b8>0x0&&(_0x1e10d9+='\x20'+_0x290061[_0x9703('0x66')]+'\x20');_0x1e10d9+=_0x290061['rules'][_0xbbb2b8][_0x9703('0x67')]?_0x562bfd(_0x290061['rules'][_0xbbb2b8]['group']):_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x68')]+'\x20'+_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x69')]+(_0x29ce0d(_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x69')])?'\x20'+_0x290061[_0x9703('0x65')][_0xbbb2b8][_0x9703('0x6a')]:'');}return _0x1e10d9+')';};var _0x46fe3d={'where':{'id':_0x427c6[_0x9703('0x46')]['id']}},_0x3fec3c,_0x4e8423,_0x46b3e8,_0x22ca27,_0x52af26;_0x46fe3d=_[_0x9703('0x3b')]({},_0x46fe3d,_0x427c6['options']);return db[_0x9703('0x2c')][_0x9703('0x48')](_0x46fe3d)['then'](function(_0x3dd540){if(_0x3dd540){_0x3fec3c=_0x3dd540;return _0x3dd540[_0x9703('0x6b')]();}return null;})[_0x9703('0x24')](function(_0x6ecd57){if(_0x6ecd57){if(!_0x6ecd57[_0x9703('0x47')]){throw new db[(_0x9703('0x6c'))][(_0x9703('0x6d'))](_0x9703('0x6e'),0x193);}_0x4e8423=_0x6ecd57;return db[_0x9703('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5c3401){if(_0x5c3401){_0x46b3e8=_['keyBy'](_0x5c3401,'id');var _0x26ddf6;var _0x2ce9e5=squel[_0x9703('0x70')]();_0x2ce9e5['from'](_0x3fec3c[_0x9703('0x71')]);for(var _0x3ce7b0=0x0;_0x3ce7b0<_0x4e8423[_0x9703('0x47')];_0x3ce7b0+=0x1){_0x26ddf6=_0x4e8423[_0x3ce7b0][_0x9703('0x72')]?_0x46b3e8[_0x4e8423[_0x3ce7b0][_0x9703('0x72')]][_0x9703('0x73')]:_0x4e8423[_0x3ce7b0][_0x9703('0x68')];_0x26ddf6=_0x4e8423[_0x3ce7b0][_0x9703('0x74')]?_[_0x9703('0x75')](_0x39a1ea[_0x4e8423[_0x3ce7b0][_0x9703('0x74')]],'%s',_0x26ddf6):_0x26ddf6;_0x26ddf6=_0x4e8423[_0x3ce7b0][_0x9703('0x76')]?_[_0x9703('0x75')](_0x2ca455[_0x4e8423[_0x3ce7b0]['format']],'%s',_0x26ddf6):_0x26ddf6;if(_0x4e8423[_0x3ce7b0][_0x9703('0x77')]){_0x2ce9e5['group'](_0x26ddf6);}_0x4e8423[_0x3ce7b0][_0x9703('0x78')]&&_0x2ce9e5[_0x9703('0x37')](_0x26ddf6,_0x4e8423[_0x3ce7b0][_0x9703('0x78')]===_0x9703('0x79')?![]:!![]);_0x2ce9e5[_0x9703('0x68')](_0x26ddf6,_0x4e8423[_0x3ce7b0][_0x9703('0x7a')]||_0x26ddf6);}if(_0x3fec3c[_0x9703('0x7b')]){_0x3fec3c[_0x9703('0x7b')]=JSON['parse'](_0x3fec3c[_0x9703('0x7b')]);for(var _0x521166=0x0;_0x521166<_0x3fec3c[_0x9703('0x7b')][_0x9703('0x47')];_0x521166+=0x1){if(_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x3c')]&&_['includes'](_0x5c7483,_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x3c')])&&_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x7c')]&&_0x3fec3c['joins'][_0x521166]['foreignTable']&&_0x3fec3c['joins'][_0x521166][_0x9703('0x7d')]){_0x2ce9e5[_0x3fec3c[_0x9703('0x7b')][_0x521166]['type']](_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x7e')],null,util['format'](_0x9703('0x7f'),_0x3fec3c[_0x9703('0x71')],_0x3fec3c['joins'][_0x521166][_0x9703('0x7c')],_0x3fec3c[_0x9703('0x7b')][_0x521166][_0x9703('0x7e')],_0x3fec3c['joins'][_0x521166][_0x9703('0x7d')]));}}}if(_0x3fec3c[_0x9703('0x80')]){_0x3fec3c[_0x9703('0x80')]=JSON[_0x9703('0x81')](_0x3fec3c['conditions']);_0x2ce9e5[_0x9703('0x3e')](_0x562bfd(_0x3fec3c[_0x9703('0x80')][_0x9703('0x67')]));}_0x52af26=_0x2ce9e5[_0x9703('0x82')]();_0x2ce9e5[_0x9703('0x1f')](_0x1a6508);_0x2ce9e5[_0x9703('0x1d')](0x0);logger[_0x9703('0x83')]('Limited\x20Query:',_0x2ce9e5[_0x9703('0x84')]());return dbH[_0x9703('0x85')][_0x9703('0x31')](_0x2ce9e5[_0x9703('0x84')](),{'type':dbH[_0x9703('0x85')][_0x9703('0x86')]['SELECT']});}})[_0x9703('0x24')](respondWithResult(_0x4ff4f9,null))['catch'](handleError(_0x4ff4f9,null));};function runReport(_0x3a9df4,_0x11bc20,_0xf04172){var _0x236044=_0x11bc20[_0x9703('0x2a')];var _0x459a44=0xa;var _0x13edb1=[_0x9703('0x51'),_0x9703('0x52'),_0x9703('0x53'),'cross_join'];var _0x11f35f={'SUM':_0x9703('0x55'),'COUNT':_0x9703('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x9703('0x88'),'GROUP_CONCAT':_0x9703('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9703('0x5b')};var _0x414f19={'SEC_TO_TIME':_0x9703('0x5c'),'DATE':_0x9703('0x5d'),'HOUR':_0x9703('0x5e'),'ROUND':_0x9703('0x5f'),'UNIX_TIMESTAMP':_0x9703('0x60')};var _0x4e5050=function(_0x5af4ad){return!_[_0x9703('0x61')]([_0x9703('0x89'),_0x9703('0x62'),_0x9703('0x63'),'IS\x20NOT\x20EMPTY'],_0x5af4ad);};var _0x3fa8df=function(_0x1cba47){if(!_0x1cba47||!_0x1cba47[_0x9703('0x65')][_0x9703('0x47')]){return'';}for(var _0x5cf963='(',_0x2ccff4=0x0;_0x2ccff4<_0x1cba47[_0x9703('0x65')][_0x9703('0x47')];_0x2ccff4+=0x1){_0x2ccff4>0x0&&(_0x5cf963+='\x20'+_0x1cba47[_0x9703('0x66')]+'\x20');_0x5cf963+=_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x67')]?_0x3fa8df(_0x1cba47['rules'][_0x2ccff4][_0x9703('0x67')]):_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x68')]+'\x20'+_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x69')]+(_0x4e5050(_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x69')])?'\x20'+_0x1cba47[_0x9703('0x65')][_0x2ccff4][_0x9703('0x6a')]:'');}return _0x5cf963+')';};var _0x379caa={'where':{'id':_0x3a9df4['id']}},_0x659d66,_0x1db62b,_0x8c633b,_0x252781,_0x1eadf4;_0x379caa=_['merge']({},_0x379caa,_0xf04172);return db[_0x9703('0x2c')][_0x9703('0x48')](_0x379caa)[_0x9703('0x24')](function(_0x132638){if(_0x132638){_0x659d66=_0x132638;return _0x132638[_0x9703('0x6b')]();}return null;})['then'](function(_0x142442){if(_0x142442){if(!_0x142442[_0x9703('0x47')]){throw new db['Sequelize'][(_0x9703('0x6d'))](_0x9703('0x6e'),0x193);}_0x1db62b=_0x142442;return db[_0x9703('0x6f')][_0x9703('0x42')]({'raw':!![]});}return null;})[_0x9703('0x24')](function(_0x36f731){if(_0x36f731){_0x8c633b=_['keyBy'](_0x36f731,'id');var _0x5b148f;var _0x1ab27b=squel[_0x9703('0x70')]();_0x1ab27b[_0x9703('0x8a')](_0x659d66['table']);for(var _0xac692a=0x0;_0xac692a<_0x1db62b[_0x9703('0x47')];_0xac692a+=0x1){_0x5b148f=_0x1db62b[_0xac692a][_0x9703('0x72')]?_0x8c633b[_0x1db62b[_0xac692a][_0x9703('0x72')]][_0x9703('0x73')]:_0x1db62b[_0xac692a][_0x9703('0x68')];_0x5b148f=_0x1db62b[_0xac692a][_0x9703('0x74')]?_[_0x9703('0x75')](_0x11f35f[_0x1db62b[_0xac692a]['function']],'%s',_0x5b148f):_0x5b148f;_0x5b148f=_0x1db62b[_0xac692a][_0x9703('0x76')]?_['replace'](_0x414f19[_0x1db62b[_0xac692a][_0x9703('0x76')]],'%s',_0x5b148f):_0x5b148f;if(_0x1db62b[_0xac692a][_0x9703('0x77')]){_0x1ab27b[_0x9703('0x67')](_0x5b148f);}_0x1db62b[_0xac692a][_0x9703('0x78')]&&_0x1ab27b[_0x9703('0x37')](_0x5b148f,_0x1db62b[_0xac692a][_0x9703('0x78')]===_0x9703('0x79')?![]:!![]);_0x1ab27b[_0x9703('0x68')](_0x5b148f,_0x1db62b[_0xac692a]['alias']||_0x5b148f);}if(_0x659d66[_0x9703('0x7b')]){_0x659d66[_0x9703('0x7b')]=JSON['parse'](_0x659d66['joins']);for(var _0x51c6ae=0x0;_0x51c6ae<_0x659d66['joins'][_0x9703('0x47')];_0x51c6ae+=0x1){if(_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x3c')]&&_[_0x9703('0x61')](_0x13edb1,_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x3c')])&&_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x7c')]&&_0x659d66['joins'][_0x51c6ae][_0x9703('0x7e')]&&_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x7d')]){_0x1ab27b[_0x659d66[_0x9703('0x7b')][_0x51c6ae][_0x9703('0x3c')]](_0x659d66['joins'][_0x51c6ae][_0x9703('0x7e')],null,util[_0x9703('0x76')](_0x9703('0x7f'),_0x659d66[_0x9703('0x71')],_0x659d66['joins'][_0x51c6ae]['parentKey'],_0x659d66['joins'][_0x51c6ae][_0x9703('0x7e')],_0x659d66[_0x9703('0x7b')][_0x51c6ae]['foreignKey']));}}}if(_0x659d66[_0x9703('0x80')]){_0x659d66['conditions']=JSON[_0x9703('0x81')](_0x659d66[_0x9703('0x80')]);_0x1ab27b[_0x9703('0x3e')](_0x3fa8df(_0x659d66[_0x9703('0x80')]['group']));}_0x1eadf4=_0x1ab27b[_0x9703('0x82')]();_0x1ab27b[_0x9703('0x1f')](_0x459a44);_0x1ab27b['offset'](0x0);return;}})[_0x9703('0x24')](function(){if(_0x11bc20['output']===_0x9703('0x8b')){return null;}var _0x47c5ad=_[_0x9703('0x3b')](_0x11bc20,{'name':_0x11bc20[_0x9703('0x8c')]||_0x11bc20[_0x9703('0x2a')]||_0x659d66[_0x9703('0x2a')],'basename':_0x236044,'savename':util[_0x9703('0x76')](_0x9703('0x8d'),_0x11bc20[_0x9703('0x2a')]||_0x659d66['name'],require(_0x9703('0x8e'))['generate'](0x4),_0x11bc20[_0x9703('0x8f')]||_0x9703('0x90')),'reportId':_0x659d66['id'],'reportType':_0x9703('0x91')});return db[_0x9703('0x92')][_0x9703('0x49')](_0x47c5ad,{'raw':!![]});})['then'](function(_0x25a771){if(_0x659d66[_0x9703('0x71')]===_0x9703('0x93')){_0x1eadf4[_0x9703('0x3e')](_0x659d66[_0x9703('0x71')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x11bc20['startDate'],_0x11bc20[_0x9703('0x94')]);}else{_0x1eadf4[_0x9703('0x3e')](_0x659d66['table']+_0x9703('0x95'),_0x11bc20['startDate'],_0x11bc20[_0x9703('0x94')]);}if(_0x25a771){logger[_0x9703('0x96')]('Run\x20Query:',_0x1eadf4[_0x9703('0x84')]());require(_0x9703('0x97'))[_0x9703('0x98')](path[_0x9703('0x51')](__dirname,_0x9703('0x99'),_0x25a771[_0x9703('0x8f')]),[_0x25a771['id'],_0x1eadf4['toString'](),path['join'](__dirname,_0x9703('0x9a'),_0x25a771[_0x9703('0x9b')]),_0x236044]);return _0x25a771;}else{var _0x424ca2=squel[_0x9703('0x70')]();_0x424ca2[_0x9703('0x8a')]('('+_0x1eadf4['toString']()+')',_0x9703('0x9c'));_0x424ca2[_0x9703('0x68')]('COUNT(*)',_0x9703('0x3f'));_0x1eadf4[_0x9703('0x1f')](_0x11bc20[_0x9703('0x1f')]||_0x459a44);_0x1eadf4['offset'](_0x11bc20[_0x9703('0x1d')]||0x0);return dbH['sequelize'][_0x9703('0x31')](_0x424ca2['toString'](),{'type':dbH[_0x9703('0x85')]['QueryTypes']['SELECT']})['then'](function(_0x25f770){if(!_0x25f770[_0x9703('0x47')]){_0x252781=0x0;}else{_0x252781=_0x25f770[0x0][_0x9703('0x3f')]||0x0;}return dbH[_0x9703('0x85')][_0x9703('0x31')](_0x1eadf4[_0x9703('0x84')](),{'type':dbH[_0x9703('0x85')][_0x9703('0x86')]['SELECT']});})['then'](function(_0x305d7f){return{'rows':_0x305d7f||[],'count':_0x252781};});}});}exports['run']=function(_0x521ddc,_0x48f4a8){return runReport(_0x521ddc[_0x9703('0x46')],_0x521ddc[_0x9703('0x31')],_0x521ddc[_0x9703('0x9d')])[_0x9703('0x24')](respondWithResult(_0x48f4a8,null))[_0x9703('0x44')](handleError(_0x48f4a8,null));};exports['runReport']=runReport;exports['query']=function(_0x489c46,_0x5830b1){var _0x3f1ff8=0xa;var _0xe05e7f=['join',_0x9703('0x52'),_0x9703('0x53'),_0x9703('0x54')];var _0x2a3b51={'SUM':_0x9703('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9703('0x56'),'MAX':_0x9703('0x57'),'MIN':'MIN(%s)','AVG':_0x9703('0x88'),'GROUP_CONCAT':_0x9703('0x59'),'GROUP_CONCAT ASC':_0x9703('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x461cca={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9703('0x60')};var _0x1e38a2=function(_0x4da17d){return!_[_0x9703('0x61')]([_0x9703('0x89'),_0x9703('0x62'),_0x9703('0x63'),_0x9703('0x64')],_0x4da17d);};var _0x53a7de=function(_0x3e4689){if(!_0x3e4689||!_0x3e4689[_0x9703('0x65')][_0x9703('0x47')]){return'';}for(var _0x462646='(',_0xd33a56=0x0;_0xd33a56<_0x3e4689[_0x9703('0x65')]['length'];_0xd33a56+=0x1){_0xd33a56>0x0&&(_0x462646+='\x20'+_0x3e4689[_0x9703('0x66')]+'\x20');_0x462646+=_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x67')]?_0x53a7de(_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x67')]):_0x3e4689[_0x9703('0x65')][_0xd33a56]['field']+'\x20'+_0x3e4689['rules'][_0xd33a56]['condition']+(_0x1e38a2(_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x69')])?'\x20'+_0x3e4689[_0x9703('0x65')][_0xd33a56][_0x9703('0x6a')]:'');}return _0x462646+')';};var _0x20b43d={'where':{'id':_0x489c46['params']['id']}},_0xc32344,_0x479617,_0x587720,_0x50db5c,_0x2824fb;_0x20b43d=_[_0x9703('0x3b')]({},_0x20b43d,_0x489c46[_0x9703('0x9d')]);return db[_0x9703('0x2c')]['find'](_0x20b43d)['then'](function(_0xdd94c){if(_0xdd94c){_0xc32344=_0xdd94c;return _0xdd94c['getFields']();}return null;})['then'](function(_0x343cce){if(_0x343cce){if(!_0x343cce['length']){throw new db[(_0x9703('0x6c'))]['ValidationErrorItem'](_0x9703('0x6e'),0x193);}_0x479617=_0x343cce;return db[_0x9703('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x9703('0x24')](function(_0x232f63){if(_0x232f63){_0x587720=_[_0x9703('0x9e')](_0x232f63,'id');var _0x2c0e6d;var _0x5c41ee=squel['select']();_0x5c41ee[_0x9703('0x8a')](_0xc32344['table']);for(var _0x3b4be5=0x0;_0x3b4be5<_0x479617[_0x9703('0x47')];_0x3b4be5+=0x1){_0x2c0e6d=_0x479617[_0x3b4be5]['MetricId']?_0x587720[_0x479617[_0x3b4be5][_0x9703('0x72')]][_0x9703('0x73')]:_0x479617[_0x3b4be5][_0x9703('0x68')];_0x2c0e6d=_0x479617[_0x3b4be5][_0x9703('0x74')]?_[_0x9703('0x75')](_0x2a3b51[_0x479617[_0x3b4be5][_0x9703('0x74')]],'%s',_0x2c0e6d):_0x2c0e6d;_0x2c0e6d=_0x479617[_0x3b4be5][_0x9703('0x76')]?_[_0x9703('0x75')](_0x461cca[_0x479617[_0x3b4be5][_0x9703('0x76')]],'%s',_0x2c0e6d):_0x2c0e6d;if(_0x479617[_0x3b4be5][_0x9703('0x77')]){_0x5c41ee[_0x9703('0x67')](_0x2c0e6d);}_0x479617[_0x3b4be5]['orderBy']&&_0x5c41ee['order'](_0x2c0e6d,_0x479617[_0x3b4be5][_0x9703('0x78')]===_0x9703('0x79')?![]:!![]);_0x5c41ee['field'](_0x2c0e6d,_0x479617[_0x3b4be5][_0x9703('0x7a')]||_0x2c0e6d);}if(_0xc32344[_0x9703('0x7b')]){_0xc32344[_0x9703('0x7b')]=JSON[_0x9703('0x81')](_0xc32344[_0x9703('0x7b')]);for(var _0xa2cbe2=0x0;_0xa2cbe2<_0xc32344[_0x9703('0x7b')][_0x9703('0x47')];_0xa2cbe2+=0x1){if(_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x3c')]&&_[_0x9703('0x61')](_0xe05e7f,_0xc32344[_0x9703('0x7b')][_0xa2cbe2]['type'])&&_0xc32344[_0x9703('0x7b')][_0xa2cbe2]['parentKey']&&_0xc32344['joins'][_0xa2cbe2]['foreignTable']&&_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x7d')]){_0x5c41ee[_0xc32344['joins'][_0xa2cbe2][_0x9703('0x3c')]](_0xc32344['joins'][_0xa2cbe2][_0x9703('0x7e')],null,util[_0x9703('0x76')](_0x9703('0x7f'),_0xc32344[_0x9703('0x71')],_0xc32344[_0x9703('0x7b')][_0xa2cbe2]['parentKey'],_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x7e')],_0xc32344[_0x9703('0x7b')][_0xa2cbe2][_0x9703('0x7d')]));}}}if(_0xc32344[_0x9703('0x80')]){_0xc32344[_0x9703('0x80')]=JSON[_0x9703('0x81')](_0xc32344[_0x9703('0x80')]);_0x5c41ee[_0x9703('0x3e')](_0x53a7de(_0xc32344[_0x9703('0x80')][_0x9703('0x67')]));}_0x2824fb=_0x5c41ee[_0x9703('0x82')]();_0x5c41ee['limit'](_0x3f1ff8);_0x5c41ee[_0x9703('0x1d')](0x0);logger[_0x9703('0x83')](_0x9703('0x9f'),_0x5c41ee[_0x9703('0x84')]());return dbH[_0x9703('0x85')]['query'](_0x5c41ee['toString'](),{'type':dbH[_0x9703('0x85')][_0x9703('0x86')][_0x9703('0xa0')]});}})[_0x9703('0x24')](function(){return{'sql':_0x2824fb['toString']()};})[_0x9703('0x24')](respondWithResult(_0x5830b1,null))[_0x9703('0x44')](handleError(_0x5830b1,null));};
\ No newline at end of file
+var _0x9805=['Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','join','cross_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ValidationErrorItem','AnalyticMetric','order','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','CustomReports','name','send','map','AnalyticCustomReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize'];(function(_0x2336af,_0x53f669){var _0x84fad4=function(_0x21b892){while(--_0x21b892){_0x2336af['push'](_0x2336af['shift']());}};_0x84fad4(++_0x53f669);}(_0x9805,0x18f));var _0x5980=function(_0x229a03,_0x36fefc){_0x229a03=_0x229a03-0x0;var _0x2d6e11=_0x9805[_0x229a03];return _0x2d6e11;};'use strict';var emlformat=require(_0x5980('0x0'));var rimraf=require(_0x5980('0x1'));var zipdir=require(_0x5980('0x2'));var jsonpatch=require(_0x5980('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5980('0x4'));var Mustache=require(_0x5980('0x5'));var util=require(_0x5980('0x6'));var path=require(_0x5980('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5980('0x8'));var fs=require('fs');var fs_extra=require(_0x5980('0x9'));var _=require(_0x5980('0xa'));var squel=require(_0x5980('0xb'));var crypto=require(_0x5980('0xc'));var jsforce=require(_0x5980('0xd'));var deskjs=require(_0x5980('0xe'));var toCsv=require(_0x5980('0xf'));var querystring=require(_0x5980('0x10'));var Papa=require(_0x5980('0x11'));var Redis=require(_0x5980('0x12'));var authService=require(_0x5980('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5980('0x14'));var logger=require(_0x5980('0x15'))(_0x5980('0x16'));var utils=require(_0x5980('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5980('0x18'));var db=require(_0x5980('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x1892d4,_0x1be1b3){_0x1be1b3=_0x1be1b3||0xcc;return function(_0x1548a1){if(_0x1548a1){return _0x1892d4[_0x5980('0x1a')](_0x1be1b3);}return _0x1892d4[_0x5980('0x1b')](_0x1be1b3)[_0x5980('0x1c')]();};}function respondWithResult(_0x15fd1a,_0x3de3a4){_0x3de3a4=_0x3de3a4||0xc8;return function(_0x489ede){if(_0x489ede){return _0x15fd1a[_0x5980('0x1b')](_0x3de3a4)['json'](_0x489ede);}};}function respondWithFilteredResult(_0x46cf94,_0x2fcdf2){return function(_0x1ce651){if(_0x1ce651){var _0x18275c=typeof _0x2fcdf2[_0x5980('0x1d')]==='undefined'&&typeof _0x2fcdf2[_0x5980('0x1e')]===_0x5980('0x1f');var _0x462408=_0x1ce651[_0x5980('0x20')];var _0x336ad3=_0x18275c?0x0:_0x2fcdf2[_0x5980('0x1d')];var _0x1753ea=_0x18275c?_0x1ce651[_0x5980('0x20')]:_0x2fcdf2[_0x5980('0x1d')]+_0x2fcdf2[_0x5980('0x1e')];var _0x2222fa;if(_0x1753ea>=_0x462408){_0x1753ea=_0x462408;_0x2222fa=0xc8;}else{_0x2222fa=0xce;}_0x46cf94['status'](_0x2222fa);return _0x46cf94['set']('Content-Range',_0x336ad3+'-'+_0x1753ea+'/'+_0x462408)[_0x5980('0x21')](_0x1ce651);}return null;};}function patchUpdates(_0x4ca6f5){return function(_0x47af1d){try{jsonpatch[_0x5980('0x22')](_0x47af1d,_0x4ca6f5,!![]);}catch(_0x2a4019){return BPromise[_0x5980('0x23')](_0x2a4019);}return _0x47af1d[_0x5980('0x24')]();};}function saveUpdates(_0x453aeb,_0x42ccc4){return function(_0x1a75c6){if(_0x1a75c6){return _0x1a75c6[_0x5980('0x25')](_0x453aeb)[_0x5980('0x26')](function(_0x509100){return _0x509100;});}return null;};}function removeEntity(_0x5826d3,_0x1f363a){return function(_0x3ce7ea){if(_0x3ce7ea){return _0x3ce7ea[_0x5980('0x27')]()[_0x5980('0x26')](function(){var _0x50c929=_0x3ce7ea['get']({'plain':!![]});var _0x5b428e=_0x5980('0x28');return db['UserProfileResource'][_0x5980('0x27')]({'where':{'type':_0x5b428e,'resourceId':_0x50c929['id']}})[_0x5980('0x26')](function(){return _0x3ce7ea;});})[_0x5980('0x26')](function(){_0x5826d3[_0x5980('0x1b')](0xcc)[_0x5980('0x1c')]();});}};}function handleEntityNotFound(_0x4ffad5,_0x9dd25a){return function(_0x252641){if(!_0x252641){_0x4ffad5[_0x5980('0x1a')](0x194);}return _0x252641;};}function handleError(_0x2b436d,_0x13a134){_0x13a134=_0x13a134||0x1f4;return function(_0x55e6f6){logger['error'](_0x55e6f6['stack']);if(_0x55e6f6[_0x5980('0x29')]){delete _0x55e6f6[_0x5980('0x29')];}_0x2b436d[_0x5980('0x1b')](_0x13a134)[_0x5980('0x2a')](_0x55e6f6);};}exports['index']=function(_0x2ca762,_0x491385){var _0x3f0fdc={},_0x5a6a7a={},_0x208575={'count':0x0,'rows':[]};var _0x4d7d81=_[_0x5980('0x2b')](db[_0x5980('0x2c')]['rawAttributes'],function(_0x4757cb){return{'name':_0x4757cb[_0x5980('0x2d')],'type':_0x4757cb[_0x5980('0x2e')][_0x5980('0x2f')]};});_0x5a6a7a['model']=_[_0x5980('0x2b')](_0x4d7d81,_0x5980('0x29'));_0x5a6a7a[_0x5980('0x30')]=_[_0x5980('0x31')](_0x2ca762[_0x5980('0x30')]);_0x5a6a7a[_0x5980('0x32')]=_[_0x5980('0x33')](_0x5a6a7a[_0x5980('0x34')],_0x5a6a7a[_0x5980('0x30')]);_0x3f0fdc[_0x5980('0x35')]=_[_0x5980('0x33')](_0x5a6a7a[_0x5980('0x34')],qs[_0x5980('0x36')](_0x2ca762[_0x5980('0x30')]['fields']));_0x3f0fdc['attributes']=_0x3f0fdc[_0x5980('0x35')]['length']?_0x3f0fdc['attributes']:_0x5a6a7a[_0x5980('0x34')];if(!_0x2ca762['query'][_0x5980('0x37')]('nolimit')){_0x3f0fdc[_0x5980('0x1e')]=qs[_0x5980('0x1e')](_0x2ca762[_0x5980('0x30')][_0x5980('0x1e')]);_0x3f0fdc[_0x5980('0x1d')]=qs['offset'](_0x2ca762[_0x5980('0x30')][_0x5980('0x1d')]);}_0x3f0fdc['order']=qs[_0x5980('0x38')](_0x2ca762[_0x5980('0x30')][_0x5980('0x38')]);_0x3f0fdc[_0x5980('0x39')]=qs[_0x5980('0x32')](_[_0x5980('0x3a')](_0x2ca762[_0x5980('0x30')],_0x5a6a7a[_0x5980('0x32')]),_0x4d7d81);if(_0x2ca762[_0x5980('0x30')]['filter']){_0x3f0fdc['where']=_['merge'](_0x3f0fdc[_0x5980('0x39')],{'$or':_['map'](_0x4d7d81,function(_0x201706){if(_0x201706['type']!==_0x5980('0x3b')){var _0x4fba61={};_0x4fba61[_0x201706[_0x5980('0x29')]]={'$like':'%'+_0x2ca762['query'][_0x5980('0x3c')]+'%'};return _0x4fba61;}})});}_0x3f0fdc=_[_0x5980('0x3d')]({},_0x3f0fdc,_0x2ca762[_0x5980('0x3e')]);var _0x37bb36={'where':_0x3f0fdc[_0x5980('0x39')]};return db[_0x5980('0x2c')][_0x5980('0x20')](_0x37bb36)['then'](function(_0x6ad54){_0x208575[_0x5980('0x20')]=_0x6ad54;if(_0x2ca762[_0x5980('0x30')][_0x5980('0x3f')]){_0x3f0fdc[_0x5980('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5980('0x41')](_0x3f0fdc);})[_0x5980('0x26')](function(_0x239798){_0x208575[_0x5980('0x42')]=_0x239798;return _0x208575;})[_0x5980('0x26')](respondWithFilteredResult(_0x491385,_0x3f0fdc))['catch'](handleError(_0x491385,null));};exports[_0x5980('0x43')]=function(_0x80f8b6,_0x9fed2a){var _0x3ee0e1={'raw':![],'where':{'id':_0x80f8b6[_0x5980('0x44')]['id']}},_0x110220={};_0x110220['model']=_[_0x5980('0x31')](db[_0x5980('0x2c')][_0x5980('0x45')]);_0x110220['query']=_[_0x5980('0x31')](_0x80f8b6[_0x5980('0x30')]);_0x110220[_0x5980('0x32')]=_[_0x5980('0x33')](_0x110220[_0x5980('0x34')],_0x110220[_0x5980('0x30')]);_0x3ee0e1[_0x5980('0x35')]=_['intersection'](_0x110220[_0x5980('0x34')],qs[_0x5980('0x36')](_0x80f8b6[_0x5980('0x30')][_0x5980('0x36')]));_0x3ee0e1[_0x5980('0x35')]=_0x3ee0e1['attributes'][_0x5980('0x46')]?_0x3ee0e1['attributes']:_0x110220[_0x5980('0x34')];if(_0x80f8b6[_0x5980('0x30')]['includeAll']){_0x3ee0e1['include']=[{'all':!![]}];}_0x3ee0e1=_[_0x5980('0x3d')]({},_0x3ee0e1,_0x80f8b6['options']);return db[_0x5980('0x2c')]['find'](_0x3ee0e1)[_0x5980('0x26')](handleEntityNotFound(_0x9fed2a,null))[_0x5980('0x26')](respondWithResult(_0x9fed2a,null))['catch'](handleError(_0x9fed2a,null));};exports['create']=function(_0x38ce3e,_0x1673b2){return db[_0x5980('0x2c')][_0x5980('0x47')](_0x38ce3e['body'],{})[_0x5980('0x26')](function(_0xa07dbb){var _0x57381e=_0x38ce3e[_0x5980('0x48')][_0x5980('0x49')]({'plain':!![]});if(!_0x57381e)throw new Error(_0x5980('0x4a'));if(_0x57381e['role']===_0x5980('0x48')){var _0x574861=_0xa07dbb['get']({'plain':!![]});var _0x4cc37f=_0x5980('0x4b');return db[_0x5980('0x4c')][_0x5980('0x4d')]({'where':{'name':_0x4cc37f,'userProfileId':_0x57381e[_0x5980('0x4e')]},'raw':!![]})[_0x5980('0x26')](function(_0x177e0c){if(_0x177e0c&&_0x177e0c[_0x5980('0x4f')]===0x0){return db[_0x5980('0x50')][_0x5980('0x47')]({'name':_0x574861[_0x5980('0x29')],'resourceId':_0x574861['id'],'type':_0x5980('0x28'),'sectionId':_0x177e0c['id']},{})[_0x5980('0x26')](function(){return _0xa07dbb;});}else{return _0xa07dbb;}})[_0x5980('0x51')](function(_0x1ee320){logger[_0x5980('0x52')](_0x5980('0x53'),_0x1ee320);throw _0x1ee320;});}return _0xa07dbb;})[_0x5980('0x26')](respondWithResult(_0x1673b2,0xc9))[_0x5980('0x51')](handleError(_0x1673b2,null));};exports[_0x5980('0x25')]=function(_0x2c83cb,_0x12c7ea){if(_0x2c83cb[_0x5980('0x54')]['id']){delete _0x2c83cb[_0x5980('0x54')]['id'];}return db['AnalyticCustomReport'][_0x5980('0x4d')]({'where':{'id':_0x2c83cb['params']['id']}})[_0x5980('0x26')](handleEntityNotFound(_0x12c7ea,null))[_0x5980('0x26')](saveUpdates(_0x2c83cb[_0x5980('0x54')],null))[_0x5980('0x26')](respondWithResult(_0x12c7ea,null))['catch'](handleError(_0x12c7ea,null));};exports[_0x5980('0x27')]=function(_0x483d29,_0x103177){return db['AnalyticCustomReport'][_0x5980('0x4d')]({'where':{'id':_0x483d29[_0x5980('0x44')]['id']}})[_0x5980('0x26')](handleEntityNotFound(_0x103177,null))[_0x5980('0x26')](removeEntity(_0x103177,null))[_0x5980('0x51')](handleError(_0x103177,null));};exports['preview']=function(_0x5379e0,_0x1861ed){var _0x23ebff=0xa;var _0x565b98=['join',_0x5980('0x55'),_0x5980('0x56'),'cross_join'];var _0x406b75={'SUM':_0x5980('0x57'),'COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':_0x5980('0x5a'),'MIN':_0x5980('0x5b'),'AVG':_0x5980('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x32d9cf={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':_0x5980('0x60'),'ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':_0x5980('0x62')};var _0xf60031=function(_0x43045c){return!_[_0x5980('0x63')]([_0x5980('0x64'),_0x5980('0x65'),_0x5980('0x66'),_0x5980('0x67')],_0x43045c);};var _0x23c988=function(_0x3fed7f){if(!_0x3fed7f||!_0x3fed7f['rules'][_0x5980('0x46')]){return'';}for(var _0x5dac67='(',_0x2ee9bb=0x0;_0x2ee9bb<_0x3fed7f[_0x5980('0x68')][_0x5980('0x46')];_0x2ee9bb+=0x1){_0x2ee9bb>0x0&&(_0x5dac67+='\x20'+_0x3fed7f[_0x5980('0x69')]+'\x20');_0x5dac67+=_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6a')]?_0x23c988(_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6a')]):_0x3fed7f[_0x5980('0x68')][_0x2ee9bb]['field']+'\x20'+_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6b')]+(_0xf60031(_0x3fed7f['rules'][_0x2ee9bb][_0x5980('0x6b')])?'\x20'+_0x3fed7f['rules'][_0x2ee9bb][_0x5980('0x6c')]:'');}return _0x5dac67+')';};var _0x2ceed2={'where':{'id':_0x5379e0['params']['id']}},_0x108015,_0x3168c4,_0x120d4c,_0x2731ea,_0x1f63e8;_0x2ceed2=_[_0x5980('0x3d')]({},_0x2ceed2,_0x5379e0['options']);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x2ceed2)[_0x5980('0x26')](function(_0xd47a4a){if(_0xd47a4a){_0x108015=_0xd47a4a;return _0xd47a4a[_0x5980('0x6d')]();}return null;})[_0x5980('0x26')](function(_0x48b7cd){if(_0x48b7cd){if(!_0x48b7cd['length']){throw new db[(_0x5980('0x6e'))]['ValidationErrorItem'](_0x5980('0x6f'),0x193);}_0x3168c4=_0x48b7cd;return db['AnalyticMetric'][_0x5980('0x41')]({'raw':!![]});}return null;})[_0x5980('0x26')](function(_0x33dcfb){if(_0x33dcfb){_0x120d4c=_[_0x5980('0x70')](_0x33dcfb,'id');var _0x5d8272;var _0x416613=squel[_0x5980('0x71')]();_0x416613[_0x5980('0x72')](_0x108015[_0x5980('0x73')]);for(var _0xbd9d02=0x0;_0xbd9d02<_0x3168c4[_0x5980('0x46')];_0xbd9d02+=0x1){_0x5d8272=_0x3168c4[_0xbd9d02]['MetricId']?_0x120d4c[_0x3168c4[_0xbd9d02][_0x5980('0x74')]][_0x5980('0x75')]:_0x3168c4[_0xbd9d02]['field'];_0x5d8272=_0x3168c4[_0xbd9d02][_0x5980('0x76')]?_[_0x5980('0x77')](_0x406b75[_0x3168c4[_0xbd9d02][_0x5980('0x76')]],'%s',_0x5d8272):_0x5d8272;_0x5d8272=_0x3168c4[_0xbd9d02][_0x5980('0x78')]?_[_0x5980('0x77')](_0x32d9cf[_0x3168c4[_0xbd9d02]['format']],'%s',_0x5d8272):_0x5d8272;if(_0x3168c4[_0xbd9d02][_0x5980('0x79')]){_0x416613[_0x5980('0x6a')](_0x5d8272);}_0x3168c4[_0xbd9d02][_0x5980('0x7a')]&&_0x416613['order'](_0x5d8272,_0x3168c4[_0xbd9d02][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0x416613[_0x5980('0x7c')](_0x5d8272,_0x3168c4[_0xbd9d02][_0x5980('0x7d')]||_0x5d8272);}if(_0x108015[_0x5980('0x7e')]){_0x108015['joins']=JSON[_0x5980('0x7f')](_0x108015[_0x5980('0x7e')]);for(var _0x1a2f60=0x0;_0x1a2f60<_0x108015[_0x5980('0x7e')]['length'];_0x1a2f60+=0x1){if(_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x565b98,_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')])&&_0x108015['joins'][_0x1a2f60][_0x5980('0x80')]&&_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')]&&_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x82')]){_0x416613[_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')]](_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')],null,util['format'](_0x5980('0x83'),_0x108015[_0x5980('0x73')],_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x80')],_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')],_0x108015['joins'][_0x1a2f60][_0x5980('0x82')]));}}}if(_0x108015[_0x5980('0x84')]){_0x108015['conditions']=JSON[_0x5980('0x7f')](_0x108015[_0x5980('0x84')]);_0x416613['where'](_0x23c988(_0x108015[_0x5980('0x84')]['group']));}_0x1f63e8=_0x416613[_0x5980('0x85')]();_0x416613[_0x5980('0x1e')](_0x23ebff);_0x416613[_0x5980('0x1d')](0x0);logger[_0x5980('0x86')]('Limited\x20Query:',_0x416613[_0x5980('0x87')]());return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x416613['toString'](),{'type':dbH[_0x5980('0x88')][_0x5980('0x89')][_0x5980('0x8a')]});}})[_0x5980('0x26')](respondWithResult(_0x1861ed,null))[_0x5980('0x51')](handleError(_0x1861ed,null));};function runReport(_0x44b442,_0x5116d9,_0x366098){var _0x9e44b8=_0x5116d9[_0x5980('0x29')];var _0x22e52f=0xa;var _0x418f7e=[_0x5980('0x8b'),_0x5980('0x55'),_0x5980('0x56'),_0x5980('0x8c')];var _0x3b587e={'SUM':_0x5980('0x57'),'COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':_0x5980('0x5a'),'MIN':_0x5980('0x5b'),'AVG':_0x5980('0x5c'),'GROUP_CONCAT':_0x5980('0x8d'),'GROUP_CONCAT ASC':_0x5980('0x8e'),'GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x2d70eb={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x30ff9f=function(_0x161254){return!_[_0x5980('0x63')](['IS\x20NULL',_0x5980('0x65'),_0x5980('0x66'),_0x5980('0x67')],_0x161254);};var _0xcb66cd=function(_0x7d4f54){if(!_0x7d4f54||!_0x7d4f54[_0x5980('0x68')][_0x5980('0x46')]){return'';}for(var _0x29f4a2='(',_0x49ae2d=0x0;_0x49ae2d<_0x7d4f54['rules'][_0x5980('0x46')];_0x49ae2d+=0x1){_0x49ae2d>0x0&&(_0x29f4a2+='\x20'+_0x7d4f54[_0x5980('0x69')]+'\x20');_0x29f4a2+=_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6a')]?_0xcb66cd(_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6a')]):_0x7d4f54[_0x5980('0x68')][_0x49ae2d]['field']+'\x20'+_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6b')]+(_0x30ff9f(_0x7d4f54[_0x5980('0x68')][_0x49ae2d]['condition'])?'\x20'+_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6c')]:'');}return _0x29f4a2+')';};var _0x1a9d01={'where':{'id':_0x44b442['id']}},_0x58694c,_0x329d9d,_0x468305,_0x3de3ac,_0x34abfd;_0x1a9d01=_[_0x5980('0x3d')]({},_0x1a9d01,_0x366098);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x1a9d01)[_0x5980('0x26')](function(_0x3401ea){if(_0x3401ea){_0x58694c=_0x3401ea;return _0x3401ea[_0x5980('0x6d')]();}return null;})[_0x5980('0x26')](function(_0x2a464b){if(_0x2a464b){if(!_0x2a464b[_0x5980('0x46')]){throw new db['Sequelize'][(_0x5980('0x8f'))](_0x5980('0x6f'),0x193);}_0x329d9d=_0x2a464b;return db[_0x5980('0x90')][_0x5980('0x41')]({'raw':!![]});}return null;})[_0x5980('0x26')](function(_0x2ec02b){if(_0x2ec02b){_0x468305=_[_0x5980('0x70')](_0x2ec02b,'id');var _0x7848c1;var _0xd3b8bf=squel['select']();_0xd3b8bf[_0x5980('0x72')](_0x58694c['table']);for(var _0x5c239c=0x0;_0x5c239c<_0x329d9d['length'];_0x5c239c+=0x1){_0x7848c1=_0x329d9d[_0x5c239c][_0x5980('0x74')]?_0x468305[_0x329d9d[_0x5c239c][_0x5980('0x74')]][_0x5980('0x75')]:_0x329d9d[_0x5c239c]['field'];_0x7848c1=_0x329d9d[_0x5c239c]['function']?_[_0x5980('0x77')](_0x3b587e[_0x329d9d[_0x5c239c]['function']],'%s',_0x7848c1):_0x7848c1;_0x7848c1=_0x329d9d[_0x5c239c][_0x5980('0x78')]?_['replace'](_0x2d70eb[_0x329d9d[_0x5c239c][_0x5980('0x78')]],'%s',_0x7848c1):_0x7848c1;if(_0x329d9d[_0x5c239c][_0x5980('0x79')]){_0xd3b8bf[_0x5980('0x6a')](_0x7848c1);}_0x329d9d[_0x5c239c][_0x5980('0x7a')]&&_0xd3b8bf[_0x5980('0x91')](_0x7848c1,_0x329d9d[_0x5c239c][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0xd3b8bf[_0x5980('0x7c')](_0x7848c1,_0x329d9d[_0x5c239c][_0x5980('0x7d')]||_0x7848c1);}if(_0x58694c[_0x5980('0x7e')]){_0x58694c[_0x5980('0x7e')]=JSON[_0x5980('0x7f')](_0x58694c[_0x5980('0x7e')]);for(var _0x38ad70=0x0;_0x38ad70<_0x58694c[_0x5980('0x7e')][_0x5980('0x46')];_0x38ad70+=0x1){if(_0x58694c['joins'][_0x38ad70][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x418f7e,_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x2e')])&&_0x58694c['joins'][_0x38ad70][_0x5980('0x80')]&&_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignTable']&&_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignKey']){_0xd3b8bf[_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x2e')]](_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x81')],null,util['format'](_0x5980('0x83'),_0x58694c[_0x5980('0x73')],_0x58694c[_0x5980('0x7e')][_0x38ad70]['parentKey'],_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x81')],_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignKey']));}}}if(_0x58694c[_0x5980('0x84')]){_0x58694c[_0x5980('0x84')]=JSON['parse'](_0x58694c[_0x5980('0x84')]);_0xd3b8bf['where'](_0xcb66cd(_0x58694c[_0x5980('0x84')][_0x5980('0x6a')]));}_0x34abfd=_0xd3b8bf['clone']();_0xd3b8bf[_0x5980('0x1e')](_0x22e52f);_0xd3b8bf[_0x5980('0x1d')](0x0);return;}})['then'](function(){if(_0x5116d9[_0x5980('0x92')]===_0x5980('0x93')){return null;}var _0x2d13aa=_[_0x5980('0x3d')](_0x5116d9,{'name':_0x5116d9['fullPath']||_0x5116d9[_0x5980('0x29')]||_0x58694c['name'],'basename':_0x9e44b8,'savename':util[_0x5980('0x78')](_0x5980('0x94'),_0x5116d9[_0x5980('0x29')]||_0x58694c[_0x5980('0x29')],require(_0x5980('0x95'))[_0x5980('0x96')](0x4),_0x5116d9[_0x5980('0x92')]||_0x5980('0x97')),'reportId':_0x58694c['id'],'reportType':_0x5980('0x98')});return db[_0x5980('0x99')][_0x5980('0x47')](_0x2d13aa,{'raw':!![]});})[_0x5980('0x26')](function(_0x27104e){if(_0x58694c['table']===_0x5980('0x9a')){_0x34abfd['where'](_0x58694c[_0x5980('0x73')]+_0x5980('0x9b'),_0x5116d9[_0x5980('0x9c')],_0x5116d9[_0x5980('0x9d')]);}else{_0x34abfd['where'](_0x58694c[_0x5980('0x73')]+_0x5980('0x9e'),_0x5116d9[_0x5980('0x9c')],_0x5116d9[_0x5980('0x9d')]);}if(_0x27104e){logger[_0x5980('0x9f')](_0x5980('0xa0'),_0x34abfd['toString']());require(_0x5980('0xa1'))[_0x5980('0xa2')](path[_0x5980('0x8b')](__dirname,'../../components/export/',_0x27104e[_0x5980('0x92')]),[_0x27104e['id'],_0x34abfd['toString'](),path['join'](__dirname,_0x5980('0xa3'),_0x27104e[_0x5980('0xa4')]),_0x9e44b8]);return _0x27104e;}else{var _0x4e950a=squel[_0x5980('0x71')]();_0x4e950a['from']('('+_0x34abfd[_0x5980('0x87')]()+')',_0x5980('0xa5'));_0x4e950a['field'](_0x5980('0xa6'),_0x5980('0x20'));_0x34abfd[_0x5980('0x1e')](_0x5116d9[_0x5980('0x1e')]||_0x22e52f);_0x34abfd['offset'](_0x5116d9[_0x5980('0x1d')]||0x0);return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x4e950a[_0x5980('0x87')](),{'type':dbH[_0x5980('0x88')][_0x5980('0x89')][_0x5980('0x8a')]})[_0x5980('0x26')](function(_0x71f930){if(!_0x71f930[_0x5980('0x46')]){_0x3de3ac=0x0;}else{_0x3de3ac=_0x71f930[0x0][_0x5980('0x20')]||0x0;}return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x34abfd[_0x5980('0x87')](),{'type':dbH['sequelize'][_0x5980('0x89')][_0x5980('0x8a')]});})['then'](function(_0x5a3831){return{'rows':_0x5a3831||[],'count':_0x3de3ac};});}});}exports[_0x5980('0xa7')]=function(_0x2508b1,_0x298d48){return runReport(_0x2508b1[_0x5980('0x44')],_0x2508b1[_0x5980('0x30')],_0x2508b1['options'])[_0x5980('0x26')](respondWithResult(_0x298d48,null))[_0x5980('0x51')](handleError(_0x298d48,null));};exports[_0x5980('0xa8')]=runReport;exports[_0x5980('0x30')]=function(_0x6893a,_0x5e5870){var _0x3b56e4=0xa;var _0x307e84=[_0x5980('0x8b'),_0x5980('0x55'),_0x5980('0x56'),_0x5980('0x8c')];var _0x5235df={'SUM':'SUM(%s)','COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x5980('0x5c'),'GROUP_CONCAT':_0x5980('0x8d'),'GROUP_CONCAT ASC':_0x5980('0x8e'),'GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x4758f2={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':_0x5980('0x62')};var _0x49dc67=function(_0x21d27a){return!_[_0x5980('0x63')]([_0x5980('0x64'),'IS\x20NOT\x20NULL',_0x5980('0x66'),_0x5980('0x67')],_0x21d27a);};var _0x5e6f24=function(_0x24b0db){if(!_0x24b0db||!_0x24b0db[_0x5980('0x68')]['length']){return'';}for(var _0xceb20b='(',_0x2f7461=0x0;_0x2f7461<_0x24b0db['rules'][_0x5980('0x46')];_0x2f7461+=0x1){_0x2f7461>0x0&&(_0xceb20b+='\x20'+_0x24b0db[_0x5980('0x69')]+'\x20');_0xceb20b+=_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6a')]?_0x5e6f24(_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6a')]):_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x7c')]+'\x20'+_0x24b0db[_0x5980('0x68')][_0x2f7461]['condition']+(_0x49dc67(_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6b')])?'\x20'+_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6c')]:'');}return _0xceb20b+')';};var _0x42ac04={'where':{'id':_0x6893a[_0x5980('0x44')]['id']}},_0x4e7a79,_0x5303ca,_0x1f4512,_0x4c92c3,_0x3ae23c;_0x42ac04=_[_0x5980('0x3d')]({},_0x42ac04,_0x6893a[_0x5980('0x3e')]);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x42ac04)['then'](function(_0x164b13){if(_0x164b13){_0x4e7a79=_0x164b13;return _0x164b13[_0x5980('0x6d')]();}return null;})['then'](function(_0xff5861){if(_0xff5861){if(!_0xff5861[_0x5980('0x46')]){throw new db[(_0x5980('0x6e'))][(_0x5980('0x8f'))](_0x5980('0x6f'),0x193);}_0x5303ca=_0xff5861;return db['AnalyticMetric'][_0x5980('0x41')]({'raw':!![]});}return null;})['then'](function(_0x4407ce){if(_0x4407ce){_0x1f4512=_['keyBy'](_0x4407ce,'id');var _0x44a3ae;var _0x3e7dc5=squel['select']();_0x3e7dc5[_0x5980('0x72')](_0x4e7a79[_0x5980('0x73')]);for(var _0xec9bc2=0x0;_0xec9bc2<_0x5303ca['length'];_0xec9bc2+=0x1){_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x74')]?_0x1f4512[_0x5303ca[_0xec9bc2][_0x5980('0x74')]][_0x5980('0x75')]:_0x5303ca[_0xec9bc2][_0x5980('0x7c')];_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x76')]?_[_0x5980('0x77')](_0x5235df[_0x5303ca[_0xec9bc2]['function']],'%s',_0x44a3ae):_0x44a3ae;_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x78')]?_[_0x5980('0x77')](_0x4758f2[_0x5303ca[_0xec9bc2][_0x5980('0x78')]],'%s',_0x44a3ae):_0x44a3ae;if(_0x5303ca[_0xec9bc2][_0x5980('0x79')]){_0x3e7dc5[_0x5980('0x6a')](_0x44a3ae);}_0x5303ca[_0xec9bc2][_0x5980('0x7a')]&&_0x3e7dc5[_0x5980('0x91')](_0x44a3ae,_0x5303ca[_0xec9bc2][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0x3e7dc5[_0x5980('0x7c')](_0x44a3ae,_0x5303ca[_0xec9bc2][_0x5980('0x7d')]||_0x44a3ae);}if(_0x4e7a79[_0x5980('0x7e')]){_0x4e7a79[_0x5980('0x7e')]=JSON[_0x5980('0x7f')](_0x4e7a79['joins']);for(var _0x3a14ed=0x0;_0x3a14ed<_0x4e7a79[_0x5980('0x7e')][_0x5980('0x46')];_0x3a14ed+=0x1){if(_0x4e7a79['joins'][_0x3a14ed][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x307e84,_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x2e')])&&_0x4e7a79[_0x5980('0x7e')][_0x3a14ed]['parentKey']&&_0x4e7a79[_0x5980('0x7e')][_0x3a14ed]['foreignTable']&&_0x4e7a79['joins'][_0x3a14ed][_0x5980('0x82')]){_0x3e7dc5[_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x2e')]](_0x4e7a79['joins'][_0x3a14ed]['foreignTable'],null,util[_0x5980('0x78')](_0x5980('0x83'),_0x4e7a79['table'],_0x4e7a79['joins'][_0x3a14ed]['parentKey'],_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x81')],_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x82')]));}}}if(_0x4e7a79[_0x5980('0x84')]){_0x4e7a79[_0x5980('0x84')]=JSON[_0x5980('0x7f')](_0x4e7a79[_0x5980('0x84')]);_0x3e7dc5[_0x5980('0x39')](_0x5e6f24(_0x4e7a79[_0x5980('0x84')][_0x5980('0x6a')]));}_0x3ae23c=_0x3e7dc5[_0x5980('0x85')]();_0x3e7dc5[_0x5980('0x1e')](_0x3b56e4);_0x3e7dc5[_0x5980('0x1d')](0x0);logger[_0x5980('0x86')](_0x5980('0xa9'),_0x3e7dc5['toString']());return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x3e7dc5[_0x5980('0x87')](),{'type':dbH['sequelize'][_0x5980('0x89')][_0x5980('0x8a')]});}})[_0x5980('0x26')](function(){return{'sql':_0x3ae23c['toString']()};})[_0x5980('0x26')](respondWithResult(_0x5e5870,null))[_0x5980('0x51')](handleError(_0x5e5870,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 10059d9..94f1bfc 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 _0x4b5b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_custom_reports'];(function(_0x4fbf59,_0x3b946e){var _0x5601ff=function(_0x4883e0){while(--_0x4883e0){_0x4fbf59['push'](_0x4fbf59['shift']());}};_0x5601ff(++_0x3b946e);}(_0x4b5b,0x144));var _0xb4b5=function(_0x5028af,_0xe0361f){_0x5028af=_0x5028af-0x0;var _0x2dad0f=_0x4b5b[_0x5028af];return _0x2dad0f;};'use strict';var _=require(_0xb4b5('0x0'));var util=require(_0xb4b5('0x1'));var logger=require(_0xb4b5('0x2'))(_0xb4b5('0x3'));var moment=require(_0xb4b5('0x4'));var BPromise=require(_0xb4b5('0x5'));var rp=require(_0xb4b5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4b5('0x7'));var config=require(_0xb4b5('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xb4b5('0x9')]=function(_0x38ffa6,_0x134f3f){return _0x38ffa6[_0xb4b5('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0xb4b5('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd19=['request-promise','path','exports','define','AnalyticCustomReport','analytics_custom_reports','util','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd19,0x10b));var _0x9dd1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdd19[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x9dd1('0x0'));var logger=require('../../config/logger')(_0x9dd1('0x1'));var moment=require(_0x9dd1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9dd1('0x3'));var fs=require('fs');var path=require(_0x9dd1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x9dd1('0x5')]=function(_0x3013c,_0x521599){return _0x3013c[_0x9dd1('0x6')](_0x9dd1('0x7'),attributes,{'tableName':_0x9dd1('0x8'),'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 21107b9..a29a81c 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 _0xcdbc=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x37c677,_0x5dcd32){var _0x58d996=function(_0x2f62de){while(--_0x2f62de){_0x37c677['push'](_0x37c677['shift']());}};_0x58d996(++_0x5dcd32);}(_0xcdbc,0xab));var _0xccdb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcdbc[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xccdb('0x0'));var util=require(_0xccdb('0x1'));var moment=require(_0xccdb('0x2'));var BPromise=require(_0xccdb('0x3'));var rs=require(_0xccdb('0x4'));var fs=require('fs');var Redis=require(_0xccdb('0x5'));var db=require(_0xccdb('0x6'))['db'];var utils=require(_0xccdb('0x7'));var logger=require(_0xccdb('0x8'))(_0xccdb('0x9'));var config=require(_0xccdb('0xa'));var jayson=require(_0xccdb('0xb'));var client=jayson[_0xccdb('0xc')][_0xccdb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xa8f62c,_0x423cd7,_0xc9f32){return new BPromise(function(_0x52a970,_0x5acf78){return client[_0xccdb('0xe')](_0xa8f62c,_0xc9f32)[_0xccdb('0xf')](function(_0x451c81){logger[_0xccdb('0x10')](_0xccdb('0x11'),_0x423cd7,_0xccdb('0x12'));logger[_0xccdb('0x13')](_0xccdb('0x14'),_0x423cd7,'request\x20sent',JSON[_0xccdb('0x15')](_0x451c81));if(_0x451c81[_0xccdb('0x16')]){if(_0x451c81[_0xccdb('0x16')][_0xccdb('0x17')]===0x1f4){logger[_0xccdb('0x16')](_0xccdb('0x11'),_0x423cd7,_0x451c81['error'][_0xccdb('0x18')]);return _0x5acf78(_0x451c81['error']['message']);}logger[_0xccdb('0x16')](_0xccdb('0x11'),_0x423cd7,_0x451c81[_0xccdb('0x16')][_0xccdb('0x18')]);return _0x52a970(_0x451c81['error']['message']);}else{logger[_0xccdb('0x10')](_0xccdb('0x11'),_0x423cd7,'request\x20sent');_0x52a970(_0x451c81[_0xccdb('0x19')][_0xccdb('0x18')]);}})[_0xccdb('0x1a')](function(_0x20328e){logger[_0xccdb('0x16')](_0xccdb('0x11'),_0x423cd7,_0x20328e);_0x5acf78(_0x20328e);});});}
\ No newline at end of file
+var _0x7ead=['rpc','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2170e4,_0x5b969e){var _0xec86f5=function(_0x44e53e){while(--_0x44e53e){_0x2170e4['push'](_0x2170e4['shift']());}};_0xec86f5(++_0x5b969e);}(_0x7ead,0x118));var _0xd7ea=function(_0x498f5b,_0xe69ffa){_0x498f5b=_0x498f5b-0x0;var _0x46fafb=_0x7ead[_0x498f5b];return _0x46fafb;};'use strict';var _=require('lodash');var util=require(_0xd7ea('0x0'));var moment=require(_0xd7ea('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7ea('0x3'))['db'];var utils=require(_0xd7ea('0x4'));var logger=require(_0xd7ea('0x5'))(_0xd7ea('0x6'));var config=require(_0xd7ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd7ea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x409576,_0x97907f,_0x1f4cd2){return new BPromise(function(_0x32ae86,_0x2719d5){return client[_0xd7ea('0x9')](_0x409576,_0x1f4cd2)[_0xd7ea('0xa')](function(_0x5d0a93){logger[_0xd7ea('0xb')](_0xd7ea('0xc'),_0x97907f,_0xd7ea('0xd'));logger[_0xd7ea('0xe')](_0xd7ea('0xf'),_0x97907f,'request\x20sent',JSON[_0xd7ea('0x10')](_0x5d0a93));if(_0x5d0a93[_0xd7ea('0x11')]){if(_0x5d0a93['error'][_0xd7ea('0x12')]===0x1f4){logger[_0xd7ea('0x11')](_0xd7ea('0xc'),_0x97907f,_0x5d0a93[_0xd7ea('0x11')][_0xd7ea('0x13')]);return _0x2719d5(_0x5d0a93[_0xd7ea('0x11')]['message']);}logger[_0xd7ea('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x97907f,_0x5d0a93[_0xd7ea('0x11')][_0xd7ea('0x13')]);return _0x32ae86(_0x5d0a93['error'][_0xd7ea('0x13')]);}else{logger[_0xd7ea('0xb')](_0xd7ea('0xc'),_0x97907f,_0xd7ea('0xd'));_0x32ae86(_0x5d0a93[_0xd7ea('0x14')][_0xd7ea('0x13')]);}})[_0xd7ea('0x15')](function(_0x4e40e7){logger[_0xd7ea('0x11')](_0xd7ea('0xc'),_0x97907f,_0x4e40e7);_0x2719d5(_0x4e40e7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b3e07fe..cf23dce 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 _0x4bec=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','index','/:id','show','get','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4bec,0x10e));var _0xc4be=function(_0x39483d,_0x260176){_0x39483d=_0x39483d-0x0;var _0x54d85b=_0x4bec[_0x39483d];return _0x54d85b;};'use strict';var multer=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var path=require(_0xc4be('0x2'));var timeout=require(_0xc4be('0x3'));var express=require(_0xc4be('0x4'));var router=express[_0xc4be('0x5')]();var fs_extra=require(_0xc4be('0x6'));var auth=require(_0xc4be('0x7'));var interaction=require(_0xc4be('0x8'));var config=require('../../config/environment');var controller=require(_0xc4be('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc4be('0xa')]);router['get'](_0xc4be('0xb'),auth['isAuthenticated'](),controller[_0xc4be('0xc')]);router[_0xc4be('0xd')](_0xc4be('0xe'),auth[_0xc4be('0xf')](),controller[_0xc4be('0x10')]);router[_0xc4be('0xd')](_0xc4be('0x11'),auth[_0xc4be('0xf')](),controller[_0xc4be('0x12')]);router[_0xc4be('0xd')](_0xc4be('0x13'),auth[_0xc4be('0xf')](),controller[_0xc4be('0x14')]);router['post']('/',auth[_0xc4be('0xf')](),controller[_0xc4be('0x15')]);router[_0xc4be('0x16')]('/:id',auth[_0xc4be('0xf')](),controller[_0xc4be('0x17')]);router[_0xc4be('0x18')](_0xc4be('0xb'),auth['isAuthenticated'](),controller[_0xc4be('0x19')]);module[_0xc4be('0x1a')]=router;
\ No newline at end of file
+var _0x4550=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','post','create','update','destroy','exports'];(function(_0x25f983,_0x352b9d){var _0x50a304=function(_0x2bc5db){while(--_0x2bc5db){_0x25f983['push'](_0x25f983['shift']());}};_0x50a304(++_0x352b9d);}(_0x4550,0x111));var _0x0455=function(_0x128ee7,_0xbfbe00){_0x128ee7=_0x128ee7-0x0;var _0x38450a=_0x4550[_0x128ee7];return _0x38450a;};'use strict';var multer=require('multer');var util=require(_0x0455('0x0'));var path=require(_0x0455('0x1'));var timeout=require(_0x0455('0x2'));var express=require(_0x0455('0x3'));var router=express[_0x0455('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0455('0x5'));var interaction=require(_0x0455('0x6'));var config=require(_0x0455('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x0455('0x8')]('/',auth[_0x0455('0x9')](),controller[_0x0455('0xa')]);router['get'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0xc')]);router[_0x0455('0x8')]('/:id/preview',auth[_0x0455('0x9')](),controller[_0x0455('0xd')]);router[_0x0455('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x0455('0xe')]);router[_0x0455('0x8')](_0x0455('0xf'),auth[_0x0455('0x9')](),controller['query']);router[_0x0455('0x10')]('/',auth['isAuthenticated'](),controller[_0x0455('0x11')]);router['put'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0x12')]);router['delete'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0x13')]);module[_0x0455('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 8c18339..6a6c9a3 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x57c53e,_0x1670a4){var _0x2db469=function(_0xb6ec0e){while(--_0xb6ec0e){_0x57c53e['push'](_0x57c53e['shift']());}};_0x2db469(++_0x1670a4);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2a80a2,_0x5bd118){_0x2a80a2=_0x2a80a2-0x0;var _0x29db85=_0xdbf5[_0x2a80a2];return _0x29db85;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x27e85a,_0x32d40d){_0x27e85a=_0x27e85a-0x0;var _0x4c52da=_0x8ef6[_0x27e85a];return _0x4c52da;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 007d6f5..852cd98 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 _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x10d3e1,_0x509309){var _0x2165d7=function(_0x4d1741){while(--_0x4d1741){_0x10d3e1['push'](_0x10d3e1['shift']());}};_0x2165d7(++_0x509309);}(_0x2542,0x169));var _0x2254=function(_0x4ce78c,_0x1e609d){_0x4ce78c=_0x4ce78c-0x0;var _0x3e18f5=_0x2542[_0x4ce78c];return _0x3e18f5;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));};
\ No newline at end of file
+var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x2ef3,0xba));var _0x32ef=function(_0x423ff8,_0x3d4296){_0x423ff8=_0x423ff8-0x0;var _0x4cc1e8=_0x2ef3[_0x423ff8];return _0x4cc1e8;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 608737c..377dbec 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 _0xdf68=['AnalyticDefaultReport','lodash','util','../../config/logger','api','bluebird','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xdf68,0xb5));var _0x8df6=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xdf68[_0x2d8f6c];return _0x3a00f6;};'use strict';var _=require(_0x8df6('0x0'));var util=require(_0x8df6('0x1'));var logger=require(_0x8df6('0x2'))(_0x8df6('0x3'));var moment=require('moment');var BPromise=require(_0x8df6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8df6('0x5'));var config=require('../../config/environment');var attributes=require(_0x8df6('0x6'));module[_0x8df6('0x7')]=function(_0xa72705,_0x30ba14){return _0xa72705[_0x8df6('0x8')](_0x8df6('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2885=['util','../../config/logger','api','bluebird','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x503f1d,_0x5a83d0){var _0x184e02=function(_0x34e5b4){while(--_0x34e5b4){_0x503f1d['push'](_0x503f1d['shift']());}};_0x184e02(++_0x5a83d0);}(_0x2885,0x1ac));var _0x5288=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x2885[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var logger=require(_0x5288('0x2'))(_0x5288('0x3'));var moment=require('moment');var BPromise=require(_0x5288('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5288('0x5'));var config=require('../../config/environment');var attributes=require(_0x5288('0x6'));module[_0x5288('0x7')]=function(_0x57f165,_0x2acd2b){return _0x57f165[_0x5288('0x8')](_0x5288('0x9'),attributes,{'tableName':_0x5288('0xa'),'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 60883f4..f06b6a0 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 _0x5c99=['rpc','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5bd83b,_0x4ea55c){var _0x231323=function(_0xb7edd){while(--_0xb7edd){_0x5bd83b['push'](_0x5bd83b['shift']());}};_0x231323(++_0x4ea55c);}(_0x5c99,0x86));var _0x95c9=function(_0x41428b,_0xe6dbc7){_0x41428b=_0x41428b-0x0;var _0x3d32df=_0x5c99[_0x41428b];return _0x3d32df;};'use strict';var _=require(_0x95c9('0x0'));var util=require('util');var moment=require(_0x95c9('0x1'));var BPromise=require('bluebird');var rs=require(_0x95c9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95c9('0x3'))['db'];var utils=require(_0x95c9('0x4'));var logger=require(_0x95c9('0x5'))(_0x95c9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x95c9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a54dd,_0x30cd82,_0x4f1989){return new BPromise(function(_0x5f45ea,_0x4f189f){return client['request'](_0x1a54dd,_0x4f1989)[_0x95c9('0x8')](function(_0x16eed3){logger[_0x95c9('0x9')](_0x95c9('0xa'),_0x30cd82,_0x95c9('0xb'));logger[_0x95c9('0xc')](_0x95c9('0xd'),_0x30cd82,_0x95c9('0xb'),JSON[_0x95c9('0xe')](_0x16eed3));if(_0x16eed3['error']){if(_0x16eed3[_0x95c9('0xf')][_0x95c9('0x10')]===0x1f4){logger['error'](_0x95c9('0xa'),_0x30cd82,_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);return _0x4f189f(_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);}logger[_0x95c9('0xf')](_0x95c9('0xa'),_0x30cd82,_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);return _0x5f45ea(_0x16eed3[_0x95c9('0xf')][_0x95c9('0x11')]);}else{logger[_0x95c9('0x9')](_0x95c9('0xa'),_0x30cd82,_0x95c9('0xb'));_0x5f45ea(_0x16eed3[_0x95c9('0x12')][_0x95c9('0x11')]);}})[_0x95c9('0x13')](function(_0x3f25b1){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x30cd82,_0x3f25b1);_0x4f189f(_0x3f25b1);});});}
\ No newline at end of file
+var _0xbab5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d6338,_0x2b44bb){var _0xbb9b7c=function(_0x404be4){while(--_0x404be4){_0x4d6338['push'](_0x4d6338['shift']());}};_0xbb9b7c(++_0x2b44bb);}(_0xbab5,0x1df));var _0x5bab=function(_0x51f4d3,_0x3a1271){_0x51f4d3=_0x51f4d3-0x0;var _0xbb3a38=_0xbab5[_0x51f4d3];return _0xbb3a38;};'use strict';var _=require('lodash');var util=require(_0x5bab('0x0'));var moment=require(_0x5bab('0x1'));var BPromise=require(_0x5bab('0x2'));var rs=require(_0x5bab('0x3'));var fs=require('fs');var Redis=require(_0x5bab('0x4'));var db=require(_0x5bab('0x5'))['db'];var utils=require(_0x5bab('0x6'));var logger=require(_0x5bab('0x7'))(_0x5bab('0x8'));var config=require(_0x5bab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5bab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b871,_0xc94606,_0x38b7ca){return new BPromise(function(_0x3e1832,_0x1d4e0d){return client[_0x5bab('0xb')](_0x12b871,_0x38b7ca)[_0x5bab('0xc')](function(_0x41cca8){logger[_0x5bab('0xd')](_0x5bab('0xe'),_0xc94606,_0x5bab('0xf'));logger[_0x5bab('0x10')](_0x5bab('0x11'),_0xc94606,'request\x20sent',JSON['stringify'](_0x41cca8));if(_0x41cca8[_0x5bab('0x12')]){if(_0x41cca8[_0x5bab('0x12')][_0x5bab('0x13')]===0x1f4){logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x41cca8['error'][_0x5bab('0x14')]);return _0x1d4e0d(_0x41cca8[_0x5bab('0x12')][_0x5bab('0x14')]);}logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x41cca8[_0x5bab('0x12')][_0x5bab('0x14')]);return _0x3e1832(_0x41cca8[_0x5bab('0x12')]['message']);}else{logger[_0x5bab('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc94606,_0x5bab('0xf'));_0x3e1832(_0x41cca8['result'][_0x5bab('0x14')]);}})[_0x5bab('0x15')](function(_0x4cbced){logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x4cbced);_0x1d4e0d(_0x4cbced);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 328df35..5815ec8 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 _0xa4f4=['show','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x180265,_0x52b0cf){var _0x191d46=function(_0x2c886b){while(--_0x2c886b){_0x180265['push'](_0x180265['shift']());}};_0x191d46(++_0x52b0cf);}(_0xa4f4,0xf6));var _0x4a4f=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xa4f4[_0x36ed48];return _0x51c63a;};'use strict';var multer=require('multer');var util=require(_0x4a4f('0x0'));var path=require(_0x4a4f('0x1'));var timeout=require(_0x4a4f('0x2'));var express=require(_0x4a4f('0x3'));var router=express[_0x4a4f('0x4')]();var fs_extra=require(_0x4a4f('0x5'));var auth=require(_0x4a4f('0x6'));var interaction=require(_0x4a4f('0x7'));var config=require(_0x4a4f('0x8'));var controller=require(_0x4a4f('0x9'));router[_0x4a4f('0xa')]('/',auth[_0x4a4f('0xb')](),controller[_0x4a4f('0xc')]);router[_0x4a4f('0xa')](_0x4a4f('0xd'),auth['isAuthenticated'](),controller[_0x4a4f('0xe')]);router[_0x4a4f('0xa')]('/:id/preview',auth[_0x4a4f('0xb')](),controller[_0x4a4f('0xf')]);router[_0x4a4f('0xa')](_0x4a4f('0x10'),auth['isAuthenticated'](),controller[_0x4a4f('0x11')]);router[_0x4a4f('0xa')](_0x4a4f('0x12'),auth['isAuthenticated'](),controller[_0x4a4f('0x13')]);router[_0x4a4f('0x14')]('/',auth[_0x4a4f('0xb')](),controller[_0x4a4f('0x15')]);router['put'](_0x4a4f('0xd'),auth[_0x4a4f('0xb')](),controller[_0x4a4f('0x16')]);router[_0x4a4f('0x17')](_0x4a4f('0xd'),auth[_0x4a4f('0xb')](),controller[_0x4a4f('0x18')]);module[_0x4a4f('0x19')]=router;
\ No newline at end of file
+var _0x34c2=['create','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','query','post'];(function(_0x4edb8b,_0x5252bc){var _0x2e2e1b=function(_0x1286f6){while(--_0x1286f6){_0x4edb8b['push'](_0x4edb8b['shift']());}};_0x2e2e1b(++_0x5252bc);}(_0x34c2,0x98));var _0x234c=function(_0x221019,_0x15c3c1){_0x221019=_0x221019-0x0;var _0x1b3cae=_0x34c2[_0x221019];return _0x1b3cae;};'use strict';var multer=require(_0x234c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x234c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x234c('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x234c('0x3'));var controller=require(_0x234c('0x4'));router['get']('/',auth[_0x234c('0x5')](),controller[_0x234c('0x6')]);router[_0x234c('0x7')](_0x234c('0x8'),auth['isAuthenticated'](),controller[_0x234c('0x9')]);router[_0x234c('0x7')](_0x234c('0xa'),auth[_0x234c('0x5')](),controller[_0x234c('0xb')]);router[_0x234c('0x7')](_0x234c('0xc'),auth[_0x234c('0x5')](),controller[_0x234c('0xd')]);router[_0x234c('0x7')]('/:id/query',auth[_0x234c('0x5')](),controller[_0x234c('0xe')]);router[_0x234c('0xf')]('/',auth['isAuthenticated'](),controller[_0x234c('0x10')]);router['put']('/:id',auth[_0x234c('0x5')](),controller[_0x234c('0x11')]);router[_0x234c('0x12')](_0x234c('0x8'),auth[_0x234c('0x5')](),controller[_0x234c('0x13')]);module[_0x234c('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 6cb7324..dff29e6 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 _0xdf73=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','scheduled'];(function(_0x2660e1,_0x4ac698){var _0xa3f403=function(_0x2f69c5){while(--_0x2f69c5){_0x2660e1['push'](_0x2660e1['shift']());}};_0xa3f403(++_0x4ac698);}(_0xdf73,0x141));var _0x3df7=function(_0xeb46a1,_0x499aeb){_0xeb46a1=_0xeb46a1-0x0;var _0x1f8ca7=_0xdf73[_0xeb46a1];return _0x1f8ca7;};'use strict';var Sequelize=require(_0x3df7('0x0'));var moment=require(_0x3df7('0x1'));module[_0x3df7('0x2')]={'name':{'type':Sequelize[_0x3df7('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x3df7('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3df7('0x4')](_0x3df7('0x5'),'pdf',_0x3df7('0x6')),'allowNull':![],'defaultValue':_0x3df7('0x5')},'savename':{'type':Sequelize[_0x3df7('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3df7('0x7')]},'endDate':{'type':Sequelize[_0x3df7('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3df7('0x4')]('manual',_0x3df7('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x3df7('0x9')]},'reportType':{'type':Sequelize[_0x3df7('0x3')]}};
\ No newline at end of file
+var _0xf3a5=['UNSIGNED','moment','exports','STRING','ENUM','xlsx','DATE','Loading','manual'];(function(_0xf00800,_0x1f50ba){var _0x381043=function(_0x4850fc){while(--_0x4850fc){_0xf00800['push'](_0xf00800['shift']());}};_0x381043(++_0x1f50ba);}(_0xf3a5,0x1c3));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5f3a('0x0'));module[_0x5f3a('0x1')]={'name':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5f3a('0x3')]('csv','pdf',_0x5f3a('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5f3a('0x5')]},'endDate':{'type':Sequelize[_0x5f3a('0x5')]},'status':{'type':Sequelize[_0x5f3a('0x2')],'defaultValue':_0x5f3a('0x6')},'type':{'type':Sequelize[_0x5f3a('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x5f3a('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x5f3a('0x8')]},'reportType':{'type':Sequelize[_0x5f3a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index a4cd754..bb041a5 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 _0x5e91=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','merge','includeAll','rows','catch','params','length','include','options','find','create','body','user','get'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x5e91,0xc0));var _0x15e9=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0x5e91[_0x3f4f3b];return _0xfc6f02;};'use strict';var emlformat=require(_0x15e9('0x0'));var rimraf=require(_0x15e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15e9('0x2'));var rp=require(_0x15e9('0x3'));var moment=require('moment');var BPromise=require(_0x15e9('0x4'));var Mustache=require(_0x15e9('0x5'));var util=require(_0x15e9('0x6'));var path=require(_0x15e9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15e9('0x8'));var _=require(_0x15e9('0x9'));var squel=require('squel');var crypto=require(_0x15e9('0xa'));var jsforce=require(_0x15e9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x15e9('0xc'));var querystring=require(_0x15e9('0xd'));var Papa=require(_0x15e9('0xe'));var Redis=require('ioredis');var authService=require(_0x15e9('0xf'));var qs=require(_0x15e9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15e9('0x11'));var logger=require(_0x15e9('0x12'))(_0x15e9('0x13'));var utils=require(_0x15e9('0x14'));var config=require(_0x15e9('0x15'));var licenseUtil=require(_0x15e9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15bfa0,_0x1c3226){_0x1c3226=_0x1c3226||0xcc;return function(_0x5c24a8){if(_0x5c24a8){return _0x15bfa0[_0x15e9('0x17')](_0x1c3226);}return _0x15bfa0[_0x15e9('0x18')](_0x1c3226)[_0x15e9('0x19')]();};}function respondWithResult(_0x20eec9,_0x1c904f){_0x1c904f=_0x1c904f||0xc8;return function(_0x4fc857){if(_0x4fc857){return _0x20eec9[_0x15e9('0x18')](_0x1c904f)[_0x15e9('0x1a')](_0x4fc857);}};}function respondWithFilteredResult(_0xa7f2e4,_0x25732d){return function(_0x4fc80b){if(_0x4fc80b){var _0x3519e9=typeof _0x25732d[_0x15e9('0x1b')]===_0x15e9('0x1c')&&typeof _0x25732d[_0x15e9('0x1d')]===_0x15e9('0x1c');var _0x189d42=_0x4fc80b[_0x15e9('0x1e')];var _0x4e9e4f=_0x3519e9?0x0:_0x25732d[_0x15e9('0x1b')];var _0x2e88ba=_0x3519e9?_0x4fc80b[_0x15e9('0x1e')]:_0x25732d[_0x15e9('0x1b')]+_0x25732d[_0x15e9('0x1d')];var _0x16065f;if(_0x2e88ba>=_0x189d42){_0x2e88ba=_0x189d42;_0x16065f=0xc8;}else{_0x16065f=0xce;}_0xa7f2e4[_0x15e9('0x18')](_0x16065f);return _0xa7f2e4[_0x15e9('0x1f')]('Content-Range',_0x4e9e4f+'-'+_0x2e88ba+'/'+_0x189d42)[_0x15e9('0x1a')](_0x4fc80b);}return null;};}function patchUpdates(_0xea7295){return function(_0x59df24){try{jsonpatch['apply'](_0x59df24,_0xea7295,!![]);}catch(_0x5a56b0){return BPromise[_0x15e9('0x20')](_0x5a56b0);}return _0x59df24[_0x15e9('0x21')]();};}function saveUpdates(_0x4812e9,_0x32f39a){return function(_0x369b11){if(_0x369b11){return _0x369b11[_0x15e9('0x22')](_0x4812e9)[_0x15e9('0x23')](function(_0xbdac19){return _0xbdac19;});}return null;};}function removeEntity(_0x402737,_0x5c3702){return function(_0x62de58){if(_0x62de58){return _0x62de58['destroy']()[_0x15e9('0x23')](function(){var _0xe87e7f=_0x62de58['get']({'plain':!![]});var _0x4a9150='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x4a9150,'resourceId':_0xe87e7f['id']}})[_0x15e9('0x23')](function(){return _0x62de58;});})[_0x15e9('0x23')](function(){_0x402737[_0x15e9('0x18')](0xcc)[_0x15e9('0x19')]();});}};}function handleEntityNotFound(_0x592592,_0x5c9720){return function(_0x1e6f49){if(!_0x1e6f49){_0x592592[_0x15e9('0x17')](0x194);}return _0x1e6f49;};}function handleError(_0x40b1eb,_0x5d7421){_0x5d7421=_0x5d7421||0x1f4;return function(_0x38010b){logger[_0x15e9('0x24')](_0x38010b['stack']);if(_0x38010b[_0x15e9('0x25')]){delete _0x38010b[_0x15e9('0x25')];}_0x40b1eb['status'](_0x5d7421)[_0x15e9('0x26')](_0x38010b);};}exports[_0x15e9('0x27')]=function(_0x5dd28d,_0x731e4c){var _0x19beb7={},_0x38f9c5={},_0x74325={'count':0x0,'rows':[]};var _0x5c1901=_[_0x15e9('0x28')](db[_0x15e9('0x29')][_0x15e9('0x2a')],function(_0x3a4cb8){return{'name':_0x3a4cb8[_0x15e9('0x2b')],'type':_0x3a4cb8[_0x15e9('0x2c')][_0x15e9('0x2d')]};});_0x38f9c5['model']=_[_0x15e9('0x28')](_0x5c1901,_0x15e9('0x25'));_0x38f9c5['query']=_[_0x15e9('0x2e')](_0x5dd28d[_0x15e9('0x2f')]);_0x38f9c5[_0x15e9('0x30')]=_[_0x15e9('0x31')](_0x38f9c5[_0x15e9('0x32')],_0x38f9c5[_0x15e9('0x2f')]);_0x19beb7[_0x15e9('0x33')]=_['intersection'](_0x38f9c5['model'],qs['fields'](_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x34')]));_0x19beb7['attributes']=_0x19beb7[_0x15e9('0x33')]['length']?_0x19beb7[_0x15e9('0x33')]:_0x38f9c5[_0x15e9('0x32')];if(!_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x35')]('nolimit')){_0x19beb7[_0x15e9('0x1d')]=qs[_0x15e9('0x1d')](_0x5dd28d['query'][_0x15e9('0x1d')]);_0x19beb7[_0x15e9('0x1b')]=qs['offset'](_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x1b')]);}_0x19beb7['order']=qs[_0x15e9('0x36')](_0x5dd28d['query'][_0x15e9('0x36')]);_0x19beb7['where']=qs[_0x15e9('0x30')](_['pick'](_0x5dd28d[_0x15e9('0x2f')],_0x38f9c5[_0x15e9('0x30')]),_0x5c1901);if(_0x5dd28d[_0x15e9('0x2f')]['filter']){_0x19beb7[_0x15e9('0x37')]=_[_0x15e9('0x38')](_0x19beb7[_0x15e9('0x37')],{'$or':_[_0x15e9('0x28')](_0x5c1901,function(_0x50fdc2){if(_0x50fdc2[_0x15e9('0x2c')]!=='VIRTUAL'){var _0x508481={};_0x508481[_0x50fdc2[_0x15e9('0x25')]]={'$like':'%'+_0x5dd28d[_0x15e9('0x2f')]['filter']+'%'};return _0x508481;}})});}_0x19beb7=_[_0x15e9('0x38')]({},_0x19beb7,_0x5dd28d['options']);var _0x5f5230={'where':_0x19beb7[_0x15e9('0x37')]};return db[_0x15e9('0x29')][_0x15e9('0x1e')](_0x5f5230)[_0x15e9('0x23')](function(_0xf4257){_0x74325[_0x15e9('0x1e')]=_0xf4257;if(_0x5dd28d[_0x15e9('0x2f')][_0x15e9('0x39')]){_0x19beb7['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x19beb7);})[_0x15e9('0x23')](function(_0x3d9afb){_0x74325[_0x15e9('0x3a')]=_0x3d9afb;return _0x74325;})[_0x15e9('0x23')](respondWithFilteredResult(_0x731e4c,_0x19beb7))[_0x15e9('0x3b')](handleError(_0x731e4c,null));};exports['show']=function(_0x3069fd,_0x2cfcc5){var _0x102ba7={'raw':!![],'where':{'id':_0x3069fd[_0x15e9('0x3c')]['id']}},_0x1b3093={};_0x1b3093[_0x15e9('0x32')]=_['keys'](db['AnalyticExtractedReport'][_0x15e9('0x2a')]);_0x1b3093[_0x15e9('0x2f')]=_[_0x15e9('0x2e')](_0x3069fd[_0x15e9('0x2f')]);_0x1b3093[_0x15e9('0x30')]=_[_0x15e9('0x31')](_0x1b3093[_0x15e9('0x32')],_0x1b3093['query']);_0x102ba7['attributes']=_[_0x15e9('0x31')](_0x1b3093[_0x15e9('0x32')],qs[_0x15e9('0x34')](_0x3069fd[_0x15e9('0x2f')][_0x15e9('0x34')]));_0x102ba7[_0x15e9('0x33')]=_0x102ba7[_0x15e9('0x33')][_0x15e9('0x3d')]?_0x102ba7[_0x15e9('0x33')]:_0x1b3093[_0x15e9('0x32')];if(_0x3069fd[_0x15e9('0x2f')]['includeAll']){_0x102ba7[_0x15e9('0x3e')]=[{'all':!![]}];}_0x102ba7=_[_0x15e9('0x38')]({},_0x102ba7,_0x3069fd[_0x15e9('0x3f')]);return db['AnalyticExtractedReport'][_0x15e9('0x40')](_0x102ba7)['then'](handleEntityNotFound(_0x2cfcc5,null))['then'](respondWithResult(_0x2cfcc5,null))[_0x15e9('0x3b')](handleError(_0x2cfcc5,null));};exports[_0x15e9('0x41')]=function(_0x1e788e,_0x1fa532){return db[_0x15e9('0x29')][_0x15e9('0x41')](_0x1e788e[_0x15e9('0x42')],{})[_0x15e9('0x23')](function(_0x2cef56){var _0x40789d=_0x1e788e[_0x15e9('0x43')][_0x15e9('0x44')]({'plain':!![]});if(!_0x40789d)throw new Error(_0x15e9('0x45'));if(_0x40789d[_0x15e9('0x46')]===_0x15e9('0x43')){var _0x3c20a8=_0x2cef56[_0x15e9('0x44')]({'plain':!![]});var _0xa5fb70=_0x15e9('0x47');return db[_0x15e9('0x48')][_0x15e9('0x40')]({'where':{'name':_0xa5fb70,'userProfileId':_0x40789d['userProfileId']},'raw':!![]})[_0x15e9('0x23')](function(_0x346c34){if(_0x346c34&&_0x346c34['autoAssociation']===0x0){return db['UserProfileResource'][_0x15e9('0x41')]({'name':_0x3c20a8['name'],'resourceId':_0x3c20a8['id'],'type':_0x346c34['name'],'sectionId':_0x346c34['id']},{})[_0x15e9('0x23')](function(){return _0x2cef56;});}else{return _0x2cef56;}})[_0x15e9('0x3b')](function(_0x1cdfc0){logger['error'](_0x15e9('0x49'),_0x1cdfc0);throw _0x1cdfc0;});}return _0x2cef56;})[_0x15e9('0x23')](respondWithResult(_0x1fa532,0xc9))[_0x15e9('0x3b')](handleError(_0x1fa532,null));};exports[_0x15e9('0x22')]=function(_0x56fd13,_0x175cca){if(_0x56fd13[_0x15e9('0x42')]['id']){delete _0x56fd13[_0x15e9('0x42')]['id'];}return db[_0x15e9('0x29')][_0x15e9('0x40')]({'where':{'id':_0x56fd13[_0x15e9('0x3c')]['id']}})[_0x15e9('0x23')](handleEntityNotFound(_0x175cca,null))[_0x15e9('0x23')](saveUpdates(_0x56fd13[_0x15e9('0x42')],null))['then'](respondWithResult(_0x175cca,null))[_0x15e9('0x3b')](handleError(_0x175cca,null));};exports[_0x15e9('0x4a')]=function(_0x320ca2,_0x35822b){return db['AnalyticExtractedReport'][_0x15e9('0x40')]({'where':{'id':_0x320ca2[_0x15e9('0x3c')]['id']}})[_0x15e9('0x23')](handleEntityNotFound(_0x35822b,null))[_0x15e9('0x23')](removeEntity(_0x35822b,null))[_0x15e9('0x3b')](handleError(_0x35822b,null));};exports['download']=function(_0x595d4b,_0x56494d,_0x4043a1){return db[_0x15e9('0x29')]['find']({'where':{'id':_0x595d4b[_0x15e9('0x3c')]['id']},'attributes':['name',_0x15e9('0x4b'),_0x15e9('0x4c'),_0x15e9('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x56494d,null))[_0x15e9('0x23')](function(_0x291b13){if(_0x291b13){if(!fs[_0x15e9('0x4e')](path[_0x15e9('0x4f')](config[_0x15e9('0x50')],_0x15e9('0x51'),_0x291b13['savename']))){throw new db[(_0x15e9('0x52'))][(_0x15e9('0x53'))](_0x15e9('0x54'));}if(_0x595d4b['query']['exists']){return _0x56494d['sendStatus'](0xc8);}return _0x56494d['download'](path[_0x15e9('0x4f')](config[_0x15e9('0x50')],'server/files/reports',_0x291b13['savename']),util['format'](_0x15e9('0x55'),_0x291b13[_0x15e9('0x4b')]||_0x291b13[_0x15e9('0x25')],_0x291b13[_0x15e9('0x4d')][_0x15e9('0x56')]()));}})[_0x15e9('0x3b')](handleError(_0x56494d,null));};
\ No newline at end of file
+var _0xf811=['VIRTUAL','filter','options','where','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge'];(function(_0x2fba83,_0x23638f){var _0x1536d9=function(_0x2cc5bf){while(--_0x2cc5bf){_0x2fba83['push'](_0x2fba83['shift']());}};_0x1536d9(++_0x23638f);}(_0xf811,0x139));var _0x1f81=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xf811[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0x1f81('0x0'));var rimraf=require(_0x1f81('0x1'));var zipdir=require(_0x1f81('0x2'));var jsonpatch=require(_0x1f81('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f81('0x4'));var Mustache=require(_0x1f81('0x5'));var util=require(_0x1f81('0x6'));var path=require(_0x1f81('0x7'));var sox=require(_0x1f81('0x8'));var csv=require(_0x1f81('0x9'));var ejs=require(_0x1f81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f81('0xb'));var crypto=require(_0x1f81('0xc'));var jsforce=require(_0x1f81('0xd'));var deskjs=require(_0x1f81('0xe'));var toCsv=require(_0x1f81('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f81('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x10'));var as=require(_0x1f81('0x11'));var hardwareService=require(_0x1f81('0x12'));var logger=require(_0x1f81('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1f81('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c6276,_0x6655c5){_0x6655c5=_0x6655c5||0xcc;return function(_0xe7f42b){if(_0xe7f42b){return _0x5c6276[_0x1f81('0x15')](_0x6655c5);}return _0x5c6276['status'](_0x6655c5)['end']();};}function respondWithResult(_0xb67196,_0x3866b2){_0x3866b2=_0x3866b2||0xc8;return function(_0x5a5254){if(_0x5a5254){return _0xb67196[_0x1f81('0x16')](_0x3866b2)['json'](_0x5a5254);}};}function respondWithFilteredResult(_0x1c6503,_0xfe0d76){return function(_0x30064f){if(_0x30064f){var _0xc56e33=typeof _0xfe0d76[_0x1f81('0x17')]===_0x1f81('0x18')&&typeof _0xfe0d76[_0x1f81('0x19')]===_0x1f81('0x18');var _0x48b69e=_0x30064f[_0x1f81('0x1a')];var _0x1a5a50=_0xc56e33?0x0:_0xfe0d76[_0x1f81('0x17')];var _0x4d706c=_0xc56e33?_0x30064f[_0x1f81('0x1a')]:_0xfe0d76[_0x1f81('0x17')]+_0xfe0d76[_0x1f81('0x19')];var _0x281cc4;if(_0x4d706c>=_0x48b69e){_0x4d706c=_0x48b69e;_0x281cc4=0xc8;}else{_0x281cc4=0xce;}_0x1c6503[_0x1f81('0x16')](_0x281cc4);return _0x1c6503['set'](_0x1f81('0x1b'),_0x1a5a50+'-'+_0x4d706c+'/'+_0x48b69e)[_0x1f81('0x1c')](_0x30064f);}return null;};}function patchUpdates(_0x351c54){return function(_0x52a77f){try{jsonpatch[_0x1f81('0x1d')](_0x52a77f,_0x351c54,!![]);}catch(_0x5dd7a5){return BPromise[_0x1f81('0x1e')](_0x5dd7a5);}return _0x52a77f['save']();};}function saveUpdates(_0x2fd26c,_0x1a69c3){return function(_0x1b5f57){if(_0x1b5f57){return _0x1b5f57[_0x1f81('0x1f')](_0x2fd26c)[_0x1f81('0x20')](function(_0x44e1c9){return _0x44e1c9;});}return null;};}function removeEntity(_0x1e11df,_0x52a17f){return function(_0x763d48){if(_0x763d48){return _0x763d48[_0x1f81('0x21')]()[_0x1f81('0x20')](function(){var _0x54c778=_0x763d48[_0x1f81('0x22')]({'plain':!![]});var _0x4bb248=_0x1f81('0x23');return db[_0x1f81('0x24')]['destroy']({'where':{'type':_0x4bb248,'resourceId':_0x54c778['id']}})[_0x1f81('0x20')](function(){return _0x763d48;});})[_0x1f81('0x20')](function(){_0x1e11df[_0x1f81('0x16')](0xcc)[_0x1f81('0x25')]();});}};}function handleEntityNotFound(_0x320220,_0x4ee881){return function(_0x28e50f){if(!_0x28e50f){_0x320220[_0x1f81('0x15')](0x194);}return _0x28e50f;};}function handleError(_0x3db6db,_0x4a0d32){_0x4a0d32=_0x4a0d32||0x1f4;return function(_0x4343ac){logger[_0x1f81('0x26')](_0x4343ac[_0x1f81('0x27')]);if(_0x4343ac['name']){delete _0x4343ac[_0x1f81('0x28')];}_0x3db6db['status'](_0x4a0d32)['send'](_0x4343ac);};}exports[_0x1f81('0x29')]=function(_0x72a980,_0x39dc93){var _0x523472={},_0x2eea07={},_0x4e19bf={'count':0x0,'rows':[]};var _0x58ebdd=_[_0x1f81('0x2a')](db[_0x1f81('0x2b')][_0x1f81('0x2c')],function(_0x441163){return{'name':_0x441163['fieldName'],'type':_0x441163[_0x1f81('0x2d')][_0x1f81('0x2e')]};});_0x2eea07[_0x1f81('0x2f')]=_[_0x1f81('0x2a')](_0x58ebdd,_0x1f81('0x28'));_0x2eea07['query']=_['keys'](_0x72a980[_0x1f81('0x30')]);_0x2eea07[_0x1f81('0x31')]=_[_0x1f81('0x32')](_0x2eea07[_0x1f81('0x2f')],_0x2eea07['query']);_0x523472[_0x1f81('0x33')]=_[_0x1f81('0x32')](_0x2eea07['model'],qs[_0x1f81('0x34')](_0x72a980[_0x1f81('0x30')][_0x1f81('0x34')]));_0x523472[_0x1f81('0x33')]=_0x523472[_0x1f81('0x33')]['length']?_0x523472['attributes']:_0x2eea07[_0x1f81('0x2f')];if(!_0x72a980['query'][_0x1f81('0x35')](_0x1f81('0x36'))){_0x523472['limit']=qs['limit'](_0x72a980[_0x1f81('0x30')][_0x1f81('0x19')]);_0x523472[_0x1f81('0x17')]=qs['offset'](_0x72a980[_0x1f81('0x30')][_0x1f81('0x17')]);}_0x523472[_0x1f81('0x37')]=qs['sort'](_0x72a980['query'][_0x1f81('0x38')]);_0x523472['where']=qs['filters'](_[_0x1f81('0x39')](_0x72a980['query'],_0x2eea07[_0x1f81('0x31')]),_0x58ebdd);if(_0x72a980[_0x1f81('0x30')]['filter']){_0x523472['where']=_[_0x1f81('0x3a')](_0x523472['where'],{'$or':_[_0x1f81('0x2a')](_0x58ebdd,function(_0x11a151){if(_0x11a151[_0x1f81('0x2d')]!==_0x1f81('0x3b')){var _0x530555={};_0x530555[_0x11a151['name']]={'$like':'%'+_0x72a980[_0x1f81('0x30')][_0x1f81('0x3c')]+'%'};return _0x530555;}})});}_0x523472=_[_0x1f81('0x3a')]({},_0x523472,_0x72a980[_0x1f81('0x3d')]);var _0x2136e0={'where':_0x523472[_0x1f81('0x3e')]};return db['AnalyticExtractedReport'][_0x1f81('0x1a')](_0x2136e0)[_0x1f81('0x20')](function(_0x1f10fe){_0x4e19bf['count']=_0x1f10fe;if(_0x72a980[_0x1f81('0x30')][_0x1f81('0x3f')]){_0x523472['include']=[{'all':!![]}];}return db[_0x1f81('0x2b')][_0x1f81('0x40')](_0x523472);})[_0x1f81('0x20')](function(_0x59d6c3){_0x4e19bf[_0x1f81('0x41')]=_0x59d6c3;return _0x4e19bf;})['then'](respondWithFilteredResult(_0x39dc93,_0x523472))[_0x1f81('0x42')](handleError(_0x39dc93,null));};exports[_0x1f81('0x43')]=function(_0x37a322,_0x3697c0){var _0x1082ee={'raw':!![],'where':{'id':_0x37a322[_0x1f81('0x44')]['id']}},_0x420d41={};_0x420d41[_0x1f81('0x2f')]=_[_0x1f81('0x45')](db[_0x1f81('0x2b')][_0x1f81('0x2c')]);_0x420d41[_0x1f81('0x30')]=_['keys'](_0x37a322[_0x1f81('0x30')]);_0x420d41[_0x1f81('0x31')]=_[_0x1f81('0x32')](_0x420d41['model'],_0x420d41[_0x1f81('0x30')]);_0x1082ee[_0x1f81('0x33')]=_[_0x1f81('0x32')](_0x420d41[_0x1f81('0x2f')],qs[_0x1f81('0x34')](_0x37a322[_0x1f81('0x30')]['fields']));_0x1082ee[_0x1f81('0x33')]=_0x1082ee[_0x1f81('0x33')]['length']?_0x1082ee[_0x1f81('0x33')]:_0x420d41[_0x1f81('0x2f')];if(_0x37a322['query']['includeAll']){_0x1082ee[_0x1f81('0x46')]=[{'all':!![]}];}_0x1082ee=_[_0x1f81('0x3a')]({},_0x1082ee,_0x37a322[_0x1f81('0x3d')]);return db[_0x1f81('0x2b')][_0x1f81('0x47')](_0x1082ee)[_0x1f81('0x20')](handleEntityNotFound(_0x3697c0,null))['then'](respondWithResult(_0x3697c0,null))['catch'](handleError(_0x3697c0,null));};exports[_0x1f81('0x48')]=function(_0x1023bc,_0x5abb4b){return db[_0x1f81('0x2b')][_0x1f81('0x48')](_0x1023bc[_0x1f81('0x49')],{})[_0x1f81('0x20')](function(_0x22d891){var _0x36c421=_0x1023bc[_0x1f81('0x4a')][_0x1f81('0x22')]({'plain':!![]});if(!_0x36c421)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36c421[_0x1f81('0x4b')]===_0x1f81('0x4a')){var _0x5c649b=_0x22d891[_0x1f81('0x22')]({'plain':!![]});var _0x2cc951=_0x1f81('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x2cc951,'userProfileId':_0x36c421[_0x1f81('0x4c')]},'raw':!![]})['then'](function(_0x450112){if(_0x450112&&_0x450112[_0x1f81('0x4d')]===0x0){return db[_0x1f81('0x24')][_0x1f81('0x48')]({'name':_0x5c649b[_0x1f81('0x28')],'resourceId':_0x5c649b['id'],'type':_0x450112[_0x1f81('0x28')],'sectionId':_0x450112['id']},{})[_0x1f81('0x20')](function(){return _0x22d891;});}else{return _0x22d891;}})[_0x1f81('0x42')](function(_0x447727){logger[_0x1f81('0x26')](_0x1f81('0x4e'),_0x447727);throw _0x447727;});}return _0x22d891;})[_0x1f81('0x20')](respondWithResult(_0x5abb4b,0xc9))[_0x1f81('0x42')](handleError(_0x5abb4b,null));};exports[_0x1f81('0x1f')]=function(_0x420ee8,_0x53aeb2){if(_0x420ee8[_0x1f81('0x49')]['id']){delete _0x420ee8['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x420ee8[_0x1f81('0x44')]['id']}})[_0x1f81('0x20')](handleEntityNotFound(_0x53aeb2,null))['then'](saveUpdates(_0x420ee8[_0x1f81('0x49')],null))[_0x1f81('0x20')](respondWithResult(_0x53aeb2,null))[_0x1f81('0x42')](handleError(_0x53aeb2,null));};exports['destroy']=function(_0x5560fd,_0x1bf69b){return db[_0x1f81('0x2b')][_0x1f81('0x47')]({'where':{'id':_0x5560fd[_0x1f81('0x44')]['id']}})[_0x1f81('0x20')](handleEntityNotFound(_0x1bf69b,null))[_0x1f81('0x20')](removeEntity(_0x1bf69b,null))[_0x1f81('0x42')](handleError(_0x1bf69b,null));};exports[_0x1f81('0x4f')]=function(_0x3e1421,_0x4c02d5,_0x22fc32){return db[_0x1f81('0x2b')][_0x1f81('0x47')]({'where':{'id':_0x3e1421[_0x1f81('0x44')]['id']},'attributes':[_0x1f81('0x28'),_0x1f81('0x50'),_0x1f81('0x51'),_0x1f81('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x4c02d5,null))[_0x1f81('0x20')](function(_0x17dc8f){if(_0x17dc8f){if(!fs[_0x1f81('0x53')](path[_0x1f81('0x54')](config[_0x1f81('0x55')],_0x1f81('0x56'),_0x17dc8f['savename']))){throw new db[(_0x1f81('0x57'))][(_0x1f81('0x58'))](_0x1f81('0x59'));}if(_0x3e1421[_0x1f81('0x30')][_0x1f81('0x5a')]){return _0x4c02d5[_0x1f81('0x15')](0xc8);}return _0x4c02d5[_0x1f81('0x4f')](path[_0x1f81('0x54')](config[_0x1f81('0x55')],_0x1f81('0x56'),_0x17dc8f[_0x1f81('0x51')]),util['format'](_0x1f81('0x5b'),_0x17dc8f[_0x1f81('0x50')]||_0x17dc8f[_0x1f81('0x28')],_0x17dc8f[_0x1f81('0x52')][_0x1f81('0x5c')]()));}})[_0x1f81('0x42')](handleError(_0x4c02d5,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index fd8f866..a3a25d3 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 _0xdf31=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0xdf31,0x16c));var _0x1df3=function(_0x55d0ce,_0x55c452){_0x55d0ce=_0x55d0ce-0x0;var _0x6402c6=_0xdf31[_0x55d0ce];return _0x6402c6;};'use strict';var _=require(_0x1df3('0x0'));var util=require(_0x1df3('0x1'));var logger=require(_0x1df3('0x2'))('api');var moment=require(_0x1df3('0x3'));var BPromise=require(_0x1df3('0x4'));var rp=require(_0x1df3('0x5'));var fs=require('fs');var path=require(_0x1df3('0x6'));var rimraf=require(_0x1df3('0x7'));var config=require(_0x1df3('0x8'));var attributes=require(_0x1df3('0x9'));module[_0x1df3('0xa')]=function(_0x548ffa,_0x1e31da){return _0x548ffa[_0x1df3('0xb')](_0x1df3('0xc'),attributes,{'tableName':_0x1df3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x79ad=['define','util','../../config/logger','api','request-promise','path','./analyticExtractedReport.attributes'];(function(_0x40e0cc,_0x30ef05){var _0x591d5e=function(_0x3cc8d9){while(--_0x3cc8d9){_0x40e0cc['push'](_0x40e0cc['shift']());}};_0x591d5e(++_0x30ef05);}(_0x79ad,0x71));var _0xd79a=function(_0x2101c3,_0x6474a3){_0x2101c3=_0x2101c3-0x0;var _0x4592d6=_0x79ad[_0x2101c3];return _0x4592d6;};'use strict';var _=require('lodash');var util=require(_0xd79a('0x0'));var logger=require(_0xd79a('0x1'))(_0xd79a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd79a('0x3'));var fs=require('fs');var path=require(_0xd79a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd79a('0x5'));module['exports']=function(_0x1ed9f1,_0x45abea){return _0x1ed9f1[_0xd79a('0x6')]('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 c6460f6..d63cb53 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 _0xce65=['lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch'];(function(_0x6d6eec,_0x2ea010){var _0x32d3=function(_0x96a0ca){while(--_0x96a0ca){_0x6d6eec['push'](_0x6d6eec['shift']());}};_0x32d3(++_0x2ea010);}(_0xce65,0x18f));var _0x5ce6=function(_0x44f2b0,_0x52f2d8){_0x44f2b0=_0x44f2b0-0x0;var _0x1f3062=_0xce65[_0x44f2b0];return _0x1f3062;};'use strict';var _=require(_0x5ce6('0x0'));var util=require('util');var moment=require(_0x5ce6('0x1'));var BPromise=require(_0x5ce6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ce6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ce6('0x4'));var logger=require('../../config/logger')(_0x5ce6('0x5'));var config=require(_0x5ce6('0x6'));var jayson=require(_0x5ce6('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x523120,_0x4cd6a0,_0x2934a4){return new BPromise(function(_0x5ab950,_0x261482){return client[_0x5ce6('0x8')](_0x523120,_0x2934a4)[_0x5ce6('0x9')](function(_0x54cc08){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4cd6a0,_0x5ce6('0xa'));logger[_0x5ce6('0xb')](_0x5ce6('0xc'),_0x4cd6a0,_0x5ce6('0xa'),JSON[_0x5ce6('0xd')](_0x54cc08));if(_0x54cc08[_0x5ce6('0xe')]){if(_0x54cc08['error'][_0x5ce6('0xf')]===0x1f4){logger[_0x5ce6('0xe')](_0x5ce6('0x10'),_0x4cd6a0,_0x54cc08[_0x5ce6('0xe')][_0x5ce6('0x11')]);return _0x261482(_0x54cc08[_0x5ce6('0xe')][_0x5ce6('0x11')]);}logger[_0x5ce6('0xe')](_0x5ce6('0x10'),_0x4cd6a0,_0x54cc08['error'][_0x5ce6('0x11')]);return _0x5ab950(_0x54cc08[_0x5ce6('0xe')]['message']);}else{logger['info'](_0x5ce6('0x10'),_0x4cd6a0,'request\x20sent');_0x5ab950(_0x54cc08['result'][_0x5ce6('0x11')]);}})[_0x5ce6('0x12')](function(_0x8c6679){logger[_0x5ce6('0xe')](_0x5ce6('0x10'),_0x4cd6a0,_0x8c6679);_0x261482(_0x8c6679);});});}
\ No newline at end of file
+var _0x6bdb=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x6bdb,0xaf));var _0xb6bd=function(_0x317a98,_0x4fa354){_0x317a98=_0x317a98-0x0;var _0x256419=_0x6bdb[_0x317a98];return _0x256419;};'use strict';var _=require(_0xb6bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb6bd('0x1'));var rs=require(_0xb6bd('0x2'));var fs=require('fs');var Redis=require(_0xb6bd('0x3'));var db=require(_0xb6bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6bd('0x5'))('rpc');var config=require(_0xb6bd('0x6'));var jayson=require(_0xb6bd('0x7'));var client=jayson[_0xb6bd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec1a4,_0x470e9c,_0xdcc11e){return new BPromise(function(_0x439f08,_0x4a6265){return client[_0xb6bd('0x9')](_0x3ec1a4,_0xdcc11e)[_0xb6bd('0xa')](function(_0x1f5b51){logger[_0xb6bd('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x470e9c,_0xb6bd('0xc'));logger[_0xb6bd('0xd')](_0xb6bd('0xe'),_0x470e9c,'request\x20sent',JSON['stringify'](_0x1f5b51));if(_0x1f5b51[_0xb6bd('0xf')]){if(_0x1f5b51[_0xb6bd('0xf')][_0xb6bd('0x10')]===0x1f4){logger[_0xb6bd('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x470e9c,_0x1f5b51['error'][_0xb6bd('0x11')]);return _0x4a6265(_0x1f5b51[_0xb6bd('0xf')]['message']);}logger[_0xb6bd('0xf')](_0xb6bd('0x12'),_0x470e9c,_0x1f5b51['error'][_0xb6bd('0x11')]);return _0x439f08(_0x1f5b51[_0xb6bd('0xf')]['message']);}else{logger['info'](_0xb6bd('0x12'),_0x470e9c,_0xb6bd('0xc'));_0x439f08(_0x1f5b51[_0xb6bd('0x13')]['message']);}})[_0xb6bd('0x14')](function(_0x540606){logger[_0xb6bd('0xf')](_0xb6bd('0x12'),_0x470e9c,_0x540606);_0x4a6265(_0x540606);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ca25bd1..c520c85 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 _0xebd9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0xebd9,0xdd));var _0x9ebd=function(_0x2dfca0,_0x2de860){_0x2dfca0=_0x2dfca0-0x0;var _0x3a73f1=_0xebd9[_0x2dfca0];return _0x3a73f1;};'use strict';var multer=require(_0x9ebd('0x0'));var util=require(_0x9ebd('0x1'));var path=require(_0x9ebd('0x2'));var timeout=require(_0x9ebd('0x3'));var express=require(_0x9ebd('0x4'));var router=express[_0x9ebd('0x5')]();var fs_extra=require(_0x9ebd('0x6'));var auth=require(_0x9ebd('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x9ebd('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ebd('0x9')]);router[_0x9ebd('0x8')](_0x9ebd('0xa'),auth[_0x9ebd('0xb')](),controller[_0x9ebd('0xc')]);router[_0x9ebd('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x9ebd('0xd')]('/',auth[_0x9ebd('0xb')](),controller[_0x9ebd('0xe')]);router[_0x9ebd('0xf')]('/:id',auth[_0x9ebd('0xb')](),controller[_0x9ebd('0x10')]);router[_0x9ebd('0x11')](_0x9ebd('0xa'),auth['isAuthenticated'](),controller[_0x9ebd('0x12')]);module[_0x9ebd('0x13')]=router;
\ No newline at end of file
+var _0x4179=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','create','update','delete','destroy','exports','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4179,0x130));var _0x9417=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x4179[_0xe73080];return _0x12cbc4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9417('0x0'));var express=require(_0x9417('0x1'));var router=express[_0x9417('0x2')]();var fs_extra=require(_0x9417('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9417('0x4'));var config=require(_0x9417('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x9417('0x6')]('/',auth[_0x9417('0x7')](),controller[_0x9417('0x8')]);router['get'](_0x9417('0x9'),auth['isAuthenticated'](),controller[_0x9417('0xa')]);router[_0x9417('0x6')]('/:id/download',auth[_0x9417('0x7')](),controller[_0x9417('0xb')]);router[_0x9417('0xc')]('/',auth[_0x9417('0x7')](),controller[_0x9417('0xd')]);router['put'](_0x9417('0x9'),auth[_0x9417('0x7')](),controller[_0x9417('0xe')]);router[_0x9417('0xf')](_0x9417('0x9'),auth[_0x9417('0x7')](),controller[_0x9417('0x10')]);module[_0x9417('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e21e5d0..0092abc 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 _0x4b35=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x4eb485,_0x2fa5ae){var _0x220d69=function(_0x5311a3){while(--_0x5311a3){_0x4eb485['push'](_0x4eb485['shift']());}};_0x220d69(++_0x2fa5ae);}(_0x4b35,0x10c));var _0x54b3=function(_0x8fc9d1,_0x55be5e){_0x8fc9d1=_0x8fc9d1-0x0;var _0x445c72=_0x4b35[_0x8fc9d1];return _0x445c72;};'use strict';var Sequelize=require(_0x54b3('0x0'));module[_0x54b3('0x1')]={'field':{'type':Sequelize[_0x54b3('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x54b3('0x3')]},'format':{'type':Sequelize[_0x54b3('0x3')]},'groupBy':{'type':Sequelize[_0x54b3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x54b3('0x3')]},'custom':{'type':Sequelize[_0x54b3('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6c51=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3c457e,_0x38e123){var _0x21ad50=function(_0x44f76e){while(--_0x44f76e){_0x3c457e['push'](_0x3c457e['shift']());}};_0x21ad50(++_0x38e123);}(_0x6c51,0xd7));var _0x16c5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6c51[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x16c5('0x0'));module[_0x16c5('0x1')]={'field':{'type':Sequelize[_0x16c5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x16c5('0x3')]},'groupBy':{'type':Sequelize[_0x16c5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x16c5('0x3')]},'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 d3400b0..5c2d05e 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 _0xb0e7=['ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','AnalyticFieldReport','findAll','rows','catch','show','include','find','create','body','bulkCreate','params','bulkDestroy'];(function(_0x5d7212,_0x1732eb){var _0xa3ca4b=function(_0x49fbee){while(--_0x49fbee){_0x5d7212['push'](_0x5d7212['shift']());}};_0xa3ca4b(++_0x1732eb);}(_0xb0e7,0x1ec));var _0x7b0e=function(_0x166ea6,_0x5bd371){_0x166ea6=_0x166ea6-0x0;var _0x7fc332=_0xb0e7[_0x166ea6];return _0x7fc332;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b0e('0x0'));var zipdir=require(_0x7b0e('0x1'));var jsonpatch=require(_0x7b0e('0x2'));var rp=require(_0x7b0e('0x3'));var moment=require(_0x7b0e('0x4'));var BPromise=require(_0x7b0e('0x5'));var Mustache=require(_0x7b0e('0x6'));var util=require('util');var path=require(_0x7b0e('0x7'));var sox=require('sox');var csv=require(_0x7b0e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b0e('0x9'));var _=require(_0x7b0e('0xa'));var squel=require(_0x7b0e('0xb'));var crypto=require(_0x7b0e('0xc'));var jsforce=require(_0x7b0e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7b0e('0x8'));var querystring=require(_0x7b0e('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b0e('0xf'));var authService=require(_0x7b0e('0x10'));var qs=require(_0x7b0e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b0e('0x12'))(_0x7b0e('0x13'));var utils=require(_0x7b0e('0x14'));var config=require(_0x7b0e('0x15'));var licenseUtil=require(_0x7b0e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aa600,_0x19b951){_0x19b951=_0x19b951||0xcc;return function(_0x4477ef){if(_0x4477ef){return _0x5aa600[_0x7b0e('0x17')](_0x19b951);}return _0x5aa600['status'](_0x19b951)['end']();};}function respondWithResult(_0x13958a,_0x38ac32){_0x38ac32=_0x38ac32||0xc8;return function(_0x3b26a5){if(_0x3b26a5){return _0x13958a['status'](_0x38ac32)[_0x7b0e('0x18')](_0x3b26a5);}};}function respondWithFilteredResult(_0x1908d0,_0x308621){return function(_0x5357ec){if(_0x5357ec){var _0x1030d0=typeof _0x308621[_0x7b0e('0x19')]==='undefined'&&typeof _0x308621[_0x7b0e('0x1a')]===_0x7b0e('0x1b');var _0x3b6e00=_0x5357ec[_0x7b0e('0x1c')];var _0x466775=_0x1030d0?0x0:_0x308621[_0x7b0e('0x19')];var _0x21de2e=_0x1030d0?_0x5357ec[_0x7b0e('0x1c')]:_0x308621[_0x7b0e('0x19')]+_0x308621[_0x7b0e('0x1a')];var _0x3efea4;if(_0x21de2e>=_0x3b6e00){_0x21de2e=_0x3b6e00;_0x3efea4=0xc8;}else{_0x3efea4=0xce;}_0x1908d0[_0x7b0e('0x1d')](_0x3efea4);return _0x1908d0[_0x7b0e('0x1e')](_0x7b0e('0x1f'),_0x466775+'-'+_0x21de2e+'/'+_0x3b6e00)['json'](_0x5357ec);}return null;};}function patchUpdates(_0x5223c3){return function(_0x1b151c){try{jsonpatch[_0x7b0e('0x20')](_0x1b151c,_0x5223c3,!![]);}catch(_0x1a1354){return BPromise[_0x7b0e('0x21')](_0x1a1354);}return _0x1b151c[_0x7b0e('0x22')]();};}function saveUpdates(_0x5d5749,_0xf096b8){return function(_0x2e9789){if(_0x2e9789){return _0x2e9789[_0x7b0e('0x23')](_0x5d5749)[_0x7b0e('0x24')](function(_0x5a4fd0){return _0x5a4fd0;});}return null;};}function removeEntity(_0x199d00,_0x220525){return function(_0x8f6bd7){if(_0x8f6bd7){return _0x8f6bd7[_0x7b0e('0x25')]()['then'](function(){_0x199d00[_0x7b0e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc60b0,_0x3ab8bf){return function(_0x4ae305){if(!_0x4ae305){_0xbc60b0[_0x7b0e('0x17')](0x194);}return _0x4ae305;};}function handleError(_0x1eb6cd,_0xb3de7f){_0xb3de7f=_0xb3de7f||0x1f4;return function(_0x153738){logger['error'](_0x153738[_0x7b0e('0x26')]);if(_0x153738['name']){delete _0x153738['name'];}_0x1eb6cd[_0x7b0e('0x1d')](_0xb3de7f)[_0x7b0e('0x27')](_0x153738);};}exports[_0x7b0e('0x28')]=function(_0x2d5adc,_0x113979){var _0x112727={},_0x48e749={},_0x2fff80={'count':0x0,'rows':[]};var _0x20221a=_[_0x7b0e('0x29')](db['AnalyticFieldReport']['rawAttributes'],function(_0x481923){return{'name':_0x481923['fieldName'],'type':_0x481923[_0x7b0e('0x2a')][_0x7b0e('0x2b')]};});_0x48e749['model']=_['map'](_0x20221a,_0x7b0e('0x2c'));_0x48e749[_0x7b0e('0x2d')]=_[_0x7b0e('0x2e')](_0x2d5adc['query']);_0x48e749['filters']=_[_0x7b0e('0x2f')](_0x48e749[_0x7b0e('0x30')],_0x48e749['query']);_0x112727[_0x7b0e('0x31')]=_[_0x7b0e('0x2f')](_0x48e749['model'],qs[_0x7b0e('0x32')](_0x2d5adc['query'][_0x7b0e('0x32')]));_0x112727['attributes']=_0x112727['attributes'][_0x7b0e('0x33')]?_0x112727[_0x7b0e('0x31')]:_0x48e749[_0x7b0e('0x30')];if(!_0x2d5adc['query'][_0x7b0e('0x34')](_0x7b0e('0x35'))){_0x112727[_0x7b0e('0x1a')]=qs['limit'](_0x2d5adc[_0x7b0e('0x2d')]['limit']);_0x112727[_0x7b0e('0x19')]=qs['offset'](_0x2d5adc['query'][_0x7b0e('0x19')]);}_0x112727[_0x7b0e('0x36')]=qs[_0x7b0e('0x37')](_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x37')]);_0x112727[_0x7b0e('0x38')]=qs['filters'](_[_0x7b0e('0x39')](_0x2d5adc[_0x7b0e('0x2d')],_0x48e749['filters']),_0x20221a);if(_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x3a')]){_0x112727[_0x7b0e('0x38')]=_[_0x7b0e('0x3b')](_0x112727[_0x7b0e('0x38')],{'$or':_[_0x7b0e('0x29')](_0x20221a,function(_0x20c8d0){if(_0x20c8d0[_0x7b0e('0x2a')]!==_0x7b0e('0x3c')){var _0xe69be8={};_0xe69be8[_0x20c8d0[_0x7b0e('0x2c')]]={'$like':'%'+_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x3a')]+'%'};return _0xe69be8;}})});}_0x112727=_[_0x7b0e('0x3b')]({},_0x112727,_0x2d5adc[_0x7b0e('0x3d')]);var _0xfbaf2e={'where':_0x112727[_0x7b0e('0x38')]};return db['AnalyticFieldReport'][_0x7b0e('0x1c')](_0xfbaf2e)['then'](function(_0x3717bd){_0x2fff80[_0x7b0e('0x1c')]=_0x3717bd;if(_0x2d5adc[_0x7b0e('0x2d')][_0x7b0e('0x3e')]){_0x112727['include']=[{'all':!![]}];}return db[_0x7b0e('0x3f')][_0x7b0e('0x40')](_0x112727);})[_0x7b0e('0x24')](function(_0x2f2486){_0x2fff80[_0x7b0e('0x41')]=_0x2f2486;return _0x2fff80;})[_0x7b0e('0x24')](respondWithFilteredResult(_0x113979,_0x112727))[_0x7b0e('0x42')](handleError(_0x113979,null));};exports[_0x7b0e('0x43')]=function(_0x2828b0,_0x5dbc98){var _0x372402={'raw':![],'where':{'id':_0x2828b0['params']['id']}},_0xc1269c={};_0xc1269c[_0x7b0e('0x30')]=_['keys'](db[_0x7b0e('0x3f')]['rawAttributes']);_0xc1269c[_0x7b0e('0x2d')]=_[_0x7b0e('0x2e')](_0x2828b0[_0x7b0e('0x2d')]);_0xc1269c['filters']=_[_0x7b0e('0x2f')](_0xc1269c['model'],_0xc1269c[_0x7b0e('0x2d')]);_0x372402[_0x7b0e('0x31')]=_[_0x7b0e('0x2f')](_0xc1269c[_0x7b0e('0x30')],qs[_0x7b0e('0x32')](_0x2828b0[_0x7b0e('0x2d')][_0x7b0e('0x32')]));_0x372402[_0x7b0e('0x31')]=_0x372402[_0x7b0e('0x31')][_0x7b0e('0x33')]?_0x372402['attributes']:_0xc1269c[_0x7b0e('0x30')];if(_0x2828b0['query'][_0x7b0e('0x3e')]){_0x372402[_0x7b0e('0x44')]=[{'all':!![]}];}_0x372402=_['merge']({},_0x372402,_0x2828b0[_0x7b0e('0x3d')]);return db[_0x7b0e('0x3f')][_0x7b0e('0x45')](_0x372402)[_0x7b0e('0x24')](handleEntityNotFound(_0x5dbc98,null))['then'](respondWithResult(_0x5dbc98,null))['catch'](handleError(_0x5dbc98,null));};exports[_0x7b0e('0x46')]=function(_0x29e82b,_0x4badbd){return db[_0x7b0e('0x3f')][_0x7b0e('0x46')](_0x29e82b[_0x7b0e('0x47')],{})[_0x7b0e('0x24')](respondWithResult(_0x4badbd,0xc9))[_0x7b0e('0x42')](handleError(_0x4badbd,null));};exports[_0x7b0e('0x48')]=function(_0x416ef4,_0x9bbbeb){return db[_0x7b0e('0x3f')][_0x7b0e('0x48')](_0x416ef4[_0x7b0e('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x9bbbeb,0xc9))[_0x7b0e('0x42')](handleError(_0x9bbbeb,null));};exports[_0x7b0e('0x23')]=function(_0x980cf8,_0x45489e){if(_0x980cf8[_0x7b0e('0x47')]['id']){delete _0x980cf8[_0x7b0e('0x47')]['id'];}return db[_0x7b0e('0x3f')][_0x7b0e('0x45')]({'where':{'id':_0x980cf8[_0x7b0e('0x49')]['id']}})[_0x7b0e('0x24')](handleEntityNotFound(_0x45489e,null))[_0x7b0e('0x24')](saveUpdates(_0x980cf8[_0x7b0e('0x47')],null))[_0x7b0e('0x24')](respondWithResult(_0x45489e,null))[_0x7b0e('0x42')](handleError(_0x45489e,null));};exports[_0x7b0e('0x25')]=function(_0x26ab10,_0x51a778){return db[_0x7b0e('0x3f')][_0x7b0e('0x45')]({'where':{'id':_0x26ab10[_0x7b0e('0x49')]['id']}})[_0x7b0e('0x24')](handleEntityNotFound(_0x51a778,null))[_0x7b0e('0x24')](removeEntity(_0x51a778,null))[_0x7b0e('0x42')](handleError(_0x51a778,null));};exports[_0x7b0e('0x4a')]=function(_0x481f51,_0x269ac5){return db[_0x7b0e('0x3f')][_0x7b0e('0x25')]({'where':{'id':_0x481f51[_0x7b0e('0x2d')][_0x7b0e('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x7b0e('0x24')](respondWithResult(_0x269ac5,0xcc))['catch'](handleError(_0x269ac5,null));};exports['addFields']=function(_0x526226,_0x1cb914,_0x280374){return db[_0x7b0e('0x4c')][_0x7b0e('0x4d')]({'where':{'id':_0x526226[_0x7b0e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1cb914,null))['then'](function(_0x54cc7f){if(_0x54cc7f){return db[_0x7b0e('0x4e')][_0x7b0e('0x4f')](function(_0x5c6838){return db[_0x7b0e('0x3f')][_0x7b0e('0x25')]({'where':{'CustomReportId':_0x526226[_0x7b0e('0x49')]['id']},'transaction':_0x5c6838})[_0x7b0e('0x24')](function(_0x51429c){var _0x1201f4=_[_0x7b0e('0x29')](_0x526226[_0x7b0e('0x47')],function(_0x10b500){delete _0x10b500['id'];_0x10b500[_0x7b0e('0x50')]=_0x526226[_0x7b0e('0x49')]['id'];return _0x10b500;});return db[_0x7b0e('0x3f')][_0x7b0e('0x48')](_0x1201f4,{'transaction':_0x5c6838});});})['then'](function(){return db[_0x7b0e('0x3f')][_0x7b0e('0x40')]({'where':{'CustomReportId':_0x526226[_0x7b0e('0x49')]['id']}});});}})[_0x7b0e('0x24')](respondWithResult(_0x1cb914,null))[_0x7b0e('0x42')](handleError(_0x1cb914,null));};
\ No newline at end of file
+var _0x64d9=['send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','then','rows','show','params','keys','include','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','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/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name'];(function(_0x29be44,_0x4f38b5){var _0x54394e=function(_0x214df0){while(--_0x214df0){_0x29be44['push'](_0x29be44['shift']());}};_0x54394e(++_0x4f38b5);}(_0x64d9,0x83));var _0x964d=function(_0x3d387e,_0x4ddac8){_0x3d387e=_0x3d387e-0x0;var _0x32b303=_0x64d9[_0x3d387e];return _0x32b303;};'use strict';var emlformat=require(_0x964d('0x0'));var rimraf=require(_0x964d('0x1'));var zipdir=require(_0x964d('0x2'));var jsonpatch=require(_0x964d('0x3'));var rp=require(_0x964d('0x4'));var moment=require(_0x964d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x964d('0x6'));var util=require(_0x964d('0x7'));var path=require('path');var sox=require(_0x964d('0x8'));var csv=require('to-csv');var ejs=require(_0x964d('0x9'));var fs=require('fs');var fs_extra=require(_0x964d('0xa'));var _=require(_0x964d('0xb'));var squel=require(_0x964d('0xc'));var crypto=require(_0x964d('0xd'));var jsforce=require(_0x964d('0xe'));var deskjs=require(_0x964d('0xf'));var toCsv=require(_0x964d('0x10'));var querystring=require(_0x964d('0x11'));var Papa=require(_0x964d('0x12'));var Redis=require(_0x964d('0x13'));var authService=require(_0x964d('0x14'));var qs=require(_0x964d('0x15'));var as=require(_0x964d('0x16'));var hardwareService=require(_0x964d('0x17'));var logger=require('../../config/logger')(_0x964d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x964d('0x19'));var db=require(_0x964d('0x1a'))['db'];function respondWithStatusCode(_0x24e3ad,_0x481fb9){_0x481fb9=_0x481fb9||0xcc;return function(_0x104d2e){if(_0x104d2e){return _0x24e3ad[_0x964d('0x1b')](_0x481fb9);}return _0x24e3ad[_0x964d('0x1c')](_0x481fb9)[_0x964d('0x1d')]();};}function respondWithResult(_0x493a13,_0xf7fc96){_0xf7fc96=_0xf7fc96||0xc8;return function(_0x2b7346){if(_0x2b7346){return _0x493a13[_0x964d('0x1c')](_0xf7fc96)['json'](_0x2b7346);}};}function respondWithFilteredResult(_0x12f014,_0x57ebaa){return function(_0x4a6920){if(_0x4a6920){var _0x196397=typeof _0x57ebaa['offset']==='undefined'&&typeof _0x57ebaa[_0x964d('0x1e')]===_0x964d('0x1f');var _0x486342=_0x4a6920['count'];var _0x569e97=_0x196397?0x0:_0x57ebaa[_0x964d('0x20')];var _0x59d02a=_0x196397?_0x4a6920[_0x964d('0x21')]:_0x57ebaa[_0x964d('0x20')]+_0x57ebaa[_0x964d('0x1e')];var _0x5d4544;if(_0x59d02a>=_0x486342){_0x59d02a=_0x486342;_0x5d4544=0xc8;}else{_0x5d4544=0xce;}_0x12f014['status'](_0x5d4544);return _0x12f014[_0x964d('0x22')](_0x964d('0x23'),_0x569e97+'-'+_0x59d02a+'/'+_0x486342)[_0x964d('0x24')](_0x4a6920);}return null;};}function patchUpdates(_0x3d02cf){return function(_0x3e734a){try{jsonpatch[_0x964d('0x25')](_0x3e734a,_0x3d02cf,!![]);}catch(_0x2526af){return BPromise[_0x964d('0x26')](_0x2526af);}return _0x3e734a[_0x964d('0x27')]();};}function saveUpdates(_0x4d4e0f,_0x264b94){return function(_0x35eab5){if(_0x35eab5){return _0x35eab5[_0x964d('0x28')](_0x4d4e0f)['then'](function(_0x4d9d62){return _0x4d9d62;});}return null;};}function removeEntity(_0x4f1899,_0x35524c){return function(_0x4d177b){if(_0x4d177b){return _0x4d177b[_0x964d('0x29')]()['then'](function(){_0x4f1899[_0x964d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a680,_0x22b0b7){return function(_0x4d6a75){if(!_0x4d6a75){_0x34a680[_0x964d('0x1b')](0x194);}return _0x4d6a75;};}function handleError(_0x57eda6,_0xe85011){_0xe85011=_0xe85011||0x1f4;return function(_0x1b169e){logger[_0x964d('0x2a')](_0x1b169e[_0x964d('0x2b')]);if(_0x1b169e[_0x964d('0x2c')]){delete _0x1b169e[_0x964d('0x2c')];}_0x57eda6[_0x964d('0x1c')](_0xe85011)[_0x964d('0x2d')](_0x1b169e);};}exports[_0x964d('0x2e')]=function(_0x3798fe,_0x4f0e1b){var _0x198b8a={},_0x3b7bbe={},_0x5465a9={'count':0x0,'rows':[]};var _0x7e5d5=_[_0x964d('0x2f')](db[_0x964d('0x30')][_0x964d('0x31')],function(_0x5f5979){return{'name':_0x5f5979[_0x964d('0x32')],'type':_0x5f5979[_0x964d('0x33')]['key']};});_0x3b7bbe['model']=_[_0x964d('0x2f')](_0x7e5d5,_0x964d('0x2c'));_0x3b7bbe[_0x964d('0x34')]=_['keys'](_0x3798fe[_0x964d('0x34')]);_0x3b7bbe[_0x964d('0x35')]=_[_0x964d('0x36')](_0x3b7bbe[_0x964d('0x37')],_0x3b7bbe['query']);_0x198b8a['attributes']=_['intersection'](_0x3b7bbe[_0x964d('0x37')],qs[_0x964d('0x38')](_0x3798fe[_0x964d('0x34')][_0x964d('0x38')]));_0x198b8a[_0x964d('0x39')]=_0x198b8a[_0x964d('0x39')][_0x964d('0x3a')]?_0x198b8a[_0x964d('0x39')]:_0x3b7bbe[_0x964d('0x37')];if(!_0x3798fe[_0x964d('0x34')][_0x964d('0x3b')](_0x964d('0x3c'))){_0x198b8a[_0x964d('0x1e')]=qs[_0x964d('0x1e')](_0x3798fe[_0x964d('0x34')][_0x964d('0x1e')]);_0x198b8a[_0x964d('0x20')]=qs['offset'](_0x3798fe[_0x964d('0x34')]['offset']);}_0x198b8a['order']=qs['sort'](_0x3798fe[_0x964d('0x34')][_0x964d('0x3d')]);_0x198b8a['where']=qs[_0x964d('0x35')](_[_0x964d('0x3e')](_0x3798fe[_0x964d('0x34')],_0x3b7bbe[_0x964d('0x35')]),_0x7e5d5);if(_0x3798fe[_0x964d('0x34')][_0x964d('0x3f')]){_0x198b8a[_0x964d('0x40')]=_['merge'](_0x198b8a[_0x964d('0x40')],{'$or':_[_0x964d('0x2f')](_0x7e5d5,function(_0x525b1a){if(_0x525b1a[_0x964d('0x33')]!==_0x964d('0x41')){var _0x4b2b64={};_0x4b2b64[_0x525b1a[_0x964d('0x2c')]]={'$like':'%'+_0x3798fe[_0x964d('0x34')][_0x964d('0x3f')]+'%'};return _0x4b2b64;}})});}_0x198b8a=_[_0x964d('0x42')]({},_0x198b8a,_0x3798fe['options']);var _0x5c1a6f={'where':_0x198b8a[_0x964d('0x40')]};return db['AnalyticFieldReport'][_0x964d('0x21')](_0x5c1a6f)['then'](function(_0xf6d465){_0x5465a9[_0x964d('0x21')]=_0xf6d465;if(_0x3798fe[_0x964d('0x34')][_0x964d('0x43')]){_0x198b8a['include']=[{'all':!![]}];}return db[_0x964d('0x30')][_0x964d('0x44')](_0x198b8a);})[_0x964d('0x45')](function(_0xf9a1d9){_0x5465a9[_0x964d('0x46')]=_0xf9a1d9;return _0x5465a9;})[_0x964d('0x45')](respondWithFilteredResult(_0x4f0e1b,_0x198b8a))['catch'](handleError(_0x4f0e1b,null));};exports[_0x964d('0x47')]=function(_0x30a313,_0x50ba89){var _0x1cbb78={'raw':![],'where':{'id':_0x30a313[_0x964d('0x48')]['id']}},_0xf1d365={};_0xf1d365[_0x964d('0x37')]=_[_0x964d('0x49')](db['AnalyticFieldReport']['rawAttributes']);_0xf1d365[_0x964d('0x34')]=_['keys'](_0x30a313[_0x964d('0x34')]);_0xf1d365[_0x964d('0x35')]=_[_0x964d('0x36')](_0xf1d365[_0x964d('0x37')],_0xf1d365[_0x964d('0x34')]);_0x1cbb78[_0x964d('0x39')]=_[_0x964d('0x36')](_0xf1d365[_0x964d('0x37')],qs[_0x964d('0x38')](_0x30a313[_0x964d('0x34')][_0x964d('0x38')]));_0x1cbb78[_0x964d('0x39')]=_0x1cbb78[_0x964d('0x39')][_0x964d('0x3a')]?_0x1cbb78['attributes']:_0xf1d365[_0x964d('0x37')];if(_0x30a313[_0x964d('0x34')][_0x964d('0x43')]){_0x1cbb78[_0x964d('0x4a')]=[{'all':!![]}];}_0x1cbb78=_[_0x964d('0x42')]({},_0x1cbb78,_0x30a313[_0x964d('0x4b')]);return db[_0x964d('0x30')][_0x964d('0x4c')](_0x1cbb78)[_0x964d('0x45')](handleEntityNotFound(_0x50ba89,null))[_0x964d('0x45')](respondWithResult(_0x50ba89,null))[_0x964d('0x4d')](handleError(_0x50ba89,null));};exports[_0x964d('0x4e')]=function(_0x57abbf,_0x5d602c){return db[_0x964d('0x30')]['create'](_0x57abbf[_0x964d('0x4f')],{})[_0x964d('0x45')](respondWithResult(_0x5d602c,0xc9))[_0x964d('0x4d')](handleError(_0x5d602c,null));};exports[_0x964d('0x50')]=function(_0x18d0cc,_0x46fc15){return db['AnalyticFieldReport'][_0x964d('0x50')](_0x18d0cc[_0x964d('0x4f')],{'raw':![],'individualHooks':!![]})[_0x964d('0x45')](respondWithResult(_0x46fc15,0xc9))['catch'](handleError(_0x46fc15,null));};exports[_0x964d('0x28')]=function(_0x5ed76b,_0x1012ff){if(_0x5ed76b['body']['id']){delete _0x5ed76b['body']['id'];}return db[_0x964d('0x30')]['find']({'where':{'id':_0x5ed76b['params']['id']}})[_0x964d('0x45')](handleEntityNotFound(_0x1012ff,null))[_0x964d('0x45')](saveUpdates(_0x5ed76b[_0x964d('0x4f')],null))[_0x964d('0x45')](respondWithResult(_0x1012ff,null))['catch'](handleError(_0x1012ff,null));};exports['destroy']=function(_0x573d50,_0x23e809){return db[_0x964d('0x30')][_0x964d('0x4c')]({'where':{'id':_0x573d50[_0x964d('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e809,null))[_0x964d('0x45')](removeEntity(_0x23e809,null))['catch'](handleError(_0x23e809,null));};exports[_0x964d('0x51')]=function(_0x57a58c,_0x13fc30){return db[_0x964d('0x30')][_0x964d('0x29')]({'where':{'id':_0x57a58c[_0x964d('0x34')][_0x964d('0x52')]||[]},'raw':![],'individualHooks':!![]})[_0x964d('0x45')](respondWithResult(_0x13fc30,0xcc))[_0x964d('0x4d')](handleError(_0x13fc30,null));};exports[_0x964d('0x53')]=function(_0x59b54a,_0x2fbe64,_0x3cb75d){return db[_0x964d('0x54')][_0x964d('0x55')]({'where':{'id':_0x59b54a[_0x964d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2fbe64,null))[_0x964d('0x45')](function(_0x4866bc){if(_0x4866bc){return db['sequelize'][_0x964d('0x56')](function(_0x3b6c1d){return db[_0x964d('0x30')][_0x964d('0x29')]({'where':{'CustomReportId':_0x59b54a[_0x964d('0x48')]['id']},'transaction':_0x3b6c1d})['then'](function(_0x26413d){var _0x675de5=_[_0x964d('0x2f')](_0x59b54a[_0x964d('0x4f')],function(_0x130c68){delete _0x130c68['id'];_0x130c68[_0x964d('0x57')]=_0x59b54a[_0x964d('0x48')]['id'];return _0x130c68;});return db[_0x964d('0x30')][_0x964d('0x50')](_0x675de5,{'transaction':_0x3b6c1d});});})['then'](function(){return db[_0x964d('0x30')][_0x964d('0x44')]({'where':{'CustomReportId':_0x59b54a['params']['id']}});});}})[_0x964d('0x45')](respondWithResult(_0x2fbe64,null))['catch'](handleError(_0x2fbe64,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3017505..6d663fc 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 _0x49b0=['moment','bluebird','request-promise','rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','util','api'];(function(_0x2a367f,_0x871e8e){var _0x12cfad=function(_0x558fb6){while(--_0x558fb6){_0x2a367f['push'](_0x2a367f['shift']());}};_0x12cfad(++_0x871e8e);}(_0x49b0,0x1ca));var _0x049b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x049b('0x0'));var logger=require('../../config/logger')(_0x049b('0x1'));var moment=require(_0x049b('0x2'));var BPromise=require(_0x049b('0x3'));var rp=require(_0x049b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x049b('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x049b('0x6')]=function(_0x28641a,_0x450dba){return _0x28641a[_0x049b('0x7')](_0x049b('0x8'),attributes,{'tableName':_0x049b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x01f2=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a4da6,_0x5e7f66){var _0x21f384=function(_0x1d2b45){while(--_0x1d2b45){_0x2a4da6['push'](_0x2a4da6['shift']());}};_0x21f384(++_0x5e7f66);}(_0x01f2,0x1c4));var _0x201f=function(_0x352174,_0x39fd8a){_0x352174=_0x352174-0x0;var _0x3ab398=_0x01f2[_0x352174];return _0x3ab398;};'use strict';var _=require(_0x201f('0x0'));var util=require(_0x201f('0x1'));var logger=require(_0x201f('0x2'))(_0x201f('0x3'));var moment=require(_0x201f('0x4'));var BPromise=require(_0x201f('0x5'));var rp=require(_0x201f('0x6'));var fs=require('fs');var path=require(_0x201f('0x7'));var rimraf=require(_0x201f('0x8'));var config=require(_0x201f('0x9'));var attributes=require(_0x201f('0xa'));module[_0x201f('0xb')]=function(_0x528562,_0x201b8b){return _0x528562['define'](_0x201f('0xc'),attributes,{'tableName':_0x201f('0xd'),'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 42ae159..7f5132a 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 _0xbf89=['AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0xbf89,0xfc));var _0x9bf8=function(_0x5da54c,_0x520452){_0x5da54c=_0x5da54c-0x0;var _0x1246b0=_0xbf89[_0x5da54c];return _0x1246b0;};'use strict';var _=require(_0x9bf8('0x0'));var util=require('util');var moment=require(_0x9bf8('0x1'));var BPromise=require('bluebird');var rs=require(_0x9bf8('0x2'));var fs=require('fs');var Redis=require(_0x9bf8('0x3'));var db=require(_0x9bf8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9bf8('0x5'));var config=require(_0x9bf8('0x6'));var jayson=require(_0x9bf8('0x7'));var client=jayson[_0x9bf8('0x8')][_0x9bf8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21764e,_0x3ff793,_0x113f1d){return new BPromise(function(_0x3453a7,_0x13534c){return client[_0x9bf8('0xa')](_0x21764e,_0x113f1d)[_0x9bf8('0xb')](function(_0x598b99){logger['info'](_0x9bf8('0xc'),_0x3ff793,'request\x20sent');logger[_0x9bf8('0xd')](_0x9bf8('0xe'),_0x3ff793,_0x9bf8('0xf'),JSON[_0x9bf8('0x10')](_0x598b99));if(_0x598b99[_0x9bf8('0x11')]){if(_0x598b99[_0x9bf8('0x11')]['code']===0x1f4){logger[_0x9bf8('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ff793,_0x598b99['error']['message']);return _0x13534c(_0x598b99[_0x9bf8('0x11')][_0x9bf8('0x12')]);}logger[_0x9bf8('0x11')](_0x9bf8('0xc'),_0x3ff793,_0x598b99[_0x9bf8('0x11')][_0x9bf8('0x12')]);return _0x3453a7(_0x598b99[_0x9bf8('0x11')][_0x9bf8('0x12')]);}else{logger[_0x9bf8('0x13')](_0x9bf8('0xc'),_0x3ff793,'request\x20sent');_0x3453a7(_0x598b99[_0x9bf8('0x14')][_0x9bf8('0x12')]);}})[_0x9bf8('0x15')](function(_0x14e9ac){logger[_0x9bf8('0x11')](_0x9bf8('0xc'),_0x3ff793,_0x14e9ac);_0x13534c(_0x14e9ac);});});}
\ No newline at end of file
+var _0x10a7=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x544cd7,_0x20f588){var _0x43c000=function(_0x3d71cf){while(--_0x3d71cf){_0x544cd7['push'](_0x544cd7['shift']());}};_0x43c000(++_0x20f588);}(_0x10a7,0x182));var _0x710a=function(_0x2d49f7,_0x3fcac1){_0x2d49f7=_0x2d49f7-0x0;var _0x56e5b1=_0x10a7[_0x2d49f7];return _0x56e5b1;};'use strict';var _=require(_0x710a('0x0'));var util=require(_0x710a('0x1'));var moment=require(_0x710a('0x2'));var BPromise=require('bluebird');var rs=require(_0x710a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x710a('0x4'))['db'];var utils=require(_0x710a('0x5'));var logger=require('../../config/logger')(_0x710a('0x6'));var config=require('../../config/environment');var jayson=require(_0x710a('0x7'));var client=jayson[_0x710a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf5f51,_0x3e7412,_0x61042a){return new BPromise(function(_0x25a894,_0x1cfb83){return client[_0x710a('0x9')](_0xaf5f51,_0x61042a)[_0x710a('0xa')](function(_0x239e5e){logger[_0x710a('0xb')](_0x710a('0xc'),_0x3e7412,_0x710a('0xd'));logger[_0x710a('0xe')](_0x710a('0xf'),_0x3e7412,'request\x20sent',JSON['stringify'](_0x239e5e));if(_0x239e5e[_0x710a('0x10')]){if(_0x239e5e[_0x710a('0x10')]['code']===0x1f4){logger[_0x710a('0x10')](_0x710a('0xc'),_0x3e7412,_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);return _0x1cfb83(_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);}logger[_0x710a('0x10')](_0x710a('0xc'),_0x3e7412,_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);return _0x25a894(_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);}else{logger[_0x710a('0xb')](_0x710a('0xc'),_0x3e7412,_0x710a('0xd'));_0x25a894(_0x239e5e[_0x710a('0x12')]['message']);}})[_0x710a('0x13')](function(_0x10c464){logger['error'](_0x710a('0xc'),_0x3e7412,_0x10c464);_0x1cfb83(_0x10c464);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index c9f0d65..38ba2f8 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(_0x4eaa87,_0x51d135){var _0x104466=function(_0x585136){while(--_0x585136){_0x4eaa87['push'](_0x4eaa87['shift']());}};_0x104466(++_0x51d135);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x4cf0a1,_0x126c6e){var _0x533a44=function(_0x3c379a){while(--_0x3c379a){_0x4cf0a1['push'](_0x4cf0a1['shift']());}};_0x533a44(++_0x126c6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 b058376..e891d05 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 _0xf323=['TEXT','STRING','name'];(function(_0x575440,_0x3684bb){var _0x54a41b=function(_0x451bcd){while(--_0x451bcd){_0x575440['push'](_0x575440['shift']());}};_0x54a41b(++_0x3684bb);}(_0xf323,0x1c6));var _0x3f32=function(_0x5ef262,_0x5480db){_0x5ef262=_0x5ef262-0x0;var _0x1e82b0=_0xf323[_0x5ef262];return _0x1e82b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3f32('0x0')],'allowNull':![],'unique':_0x3f32('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x3f32('0x2')]},'description':{'type':Sequelize[_0x3f32('0x0')]}};
\ No newline at end of file
+var _0x2116=['name','STRING','TEXT','exports'];(function(_0x564801,_0x2ff0e2){var _0x10bb38=function(_0x14681a){while(--_0x14681a){_0x564801['push'](_0x564801['shift']());}};_0x10bb38(++_0x2ff0e2);}(_0x2116,0x67));var _0x6211=function(_0x773787,_0x269f85){_0x773787=_0x773787-0x0;var _0x7b67e3=_0x2116[_0x773787];return _0x7b67e3;};'use strict';var Sequelize=require('sequelize');module[_0x6211('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6211('0x1')},'table':{'type':Sequelize[_0x6211('0x2')]},'metric':{'type':Sequelize[_0x6211('0x3')]},'description':{'type':Sequelize[_0x6211('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 92b6a60..1ed5408 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x1ac269,_0x3c0b34){var _0x4ac556=function(_0x4076f3){while(--_0x4076f3){_0x1ac269['push'](_0x1ac269['shift']());}};_0x4ac556(++_0x3c0b34);}(_0xdc97,0x13b));var _0x7dc9=function(_0x115411,_0x592d33){_0x115411=_0x115411-0x0;var _0x38bb7a=_0xdc97[_0x115411];return _0x38bb7a;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x245044,_0x4c6022){var _0x3fac56=function(_0x138a1b){while(--_0x138a1b){_0x245044['push'](_0x245044['shift']());}};_0x3fac56(++_0x4c6022);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index ae949de..7e76f45 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 _0x2d2c=['../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash','util'];(function(_0x4bfe34,_0x21c0a7){var _0x2c1e1e=function(_0x3f6c9e){while(--_0x3f6c9e){_0x4bfe34['push'](_0x4bfe34['shift']());}};_0x2c1e1e(++_0x21c0a7);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0xd685e,_0x360045){_0xd685e=_0xd685e-0x0;var _0x5ef5e0=_0x2d2c[_0xd685e];return _0x5ef5e0;};'use strict';var _=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var logger=require(_0xc2d2('0x2'))(_0xc2d2('0x3'));var moment=require(_0xc2d2('0x4'));var BPromise=require(_0xc2d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2d2('0x6'));var rimraf=require('rimraf');var config=require(_0xc2d2('0x7'));var attributes=require(_0xc2d2('0x8'));module[_0xc2d2('0x9')]=function(_0x45ad0c,_0xe9cf0e){return _0x45ad0c['define']('AnalyticMetric',attributes,{'tableName':_0xc2d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbccd=['lodash','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x3423ff,_0x2b56c9){var _0x5c00bc=function(_0x28cdd1){while(--_0x28cdd1){_0x3423ff['push'](_0x3423ff['shift']());}};_0x5c00bc(++_0x2b56c9);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbccd[_0x279d37];return _0x530173;};'use strict';var _=require(_0xdbcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbcc('0x1'));var moment=require(_0xdbcc('0x2'));var BPromise=require(_0xdbcc('0x3'));var rp=require(_0xdbcc('0x4'));var fs=require('fs');var path=require(_0xdbcc('0x5'));var rimraf=require(_0xdbcc('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbcc('0x7'));module[_0xdbcc('0x8')]=function(_0x9cca7a,_0x2997fd){return _0x9cca7a[_0xdbcc('0x9')](_0xdbcc('0xa'),attributes,{'tableName':_0xdbcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 301dbac..01ccf6c 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 _0x7bac=['info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then'];(function(_0x473d70,_0x459c26){var _0x19314f=function(_0x43c644){while(--_0x43c644){_0x473d70['push'](_0x473d70['shift']());}};_0x19314f(++_0x459c26);}(_0x7bac,0xc6));var _0xc7ba=function(_0x5c5b0c,_0x386ea2){_0x5c5b0c=_0x5c5b0c-0x0;var _0x1f2660=_0x7bac[_0x5c5b0c];return _0x1f2660;};'use strict';var _=require(_0xc7ba('0x0'));var util=require(_0xc7ba('0x1'));var moment=require(_0xc7ba('0x2'));var BPromise=require(_0xc7ba('0x3'));var rs=require(_0xc7ba('0x4'));var fs=require('fs');var Redis=require(_0xc7ba('0x5'));var db=require(_0xc7ba('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc7ba('0x7'));var jayson=require(_0xc7ba('0x8'));var client=jayson[_0xc7ba('0x9')][_0xc7ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16b2c9,_0x575302,_0x309aff){return new BPromise(function(_0x15dcc5,_0x4e1e88){return client['request'](_0x16b2c9,_0x309aff)[_0xc7ba('0xb')](function(_0x2c52fd){logger[_0xc7ba('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x575302,_0xc7ba('0xd'));logger[_0xc7ba('0xe')](_0xc7ba('0xf'),_0x575302,_0xc7ba('0xd'),JSON['stringify'](_0x2c52fd));if(_0x2c52fd[_0xc7ba('0x10')]){if(_0x2c52fd[_0xc7ba('0x10')]['code']===0x1f4){logger[_0xc7ba('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x575302,_0x2c52fd[_0xc7ba('0x10')][_0xc7ba('0x11')]);return _0x4e1e88(_0x2c52fd[_0xc7ba('0x10')][_0xc7ba('0x11')]);}logger[_0xc7ba('0x10')](_0xc7ba('0x12'),_0x575302,_0x2c52fd[_0xc7ba('0x10')][_0xc7ba('0x11')]);return _0x15dcc5(_0x2c52fd['error'][_0xc7ba('0x11')]);}else{logger[_0xc7ba('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x575302,'request\x20sent');_0x15dcc5(_0x2c52fd[_0xc7ba('0x13')][_0xc7ba('0x11')]);}})[_0xc7ba('0x14')](function(_0x26aa4b){logger[_0xc7ba('0x10')](_0xc7ba('0x12'),_0x575302,_0x26aa4b);_0x4e1e88(_0x26aa4b);});});}
\ No newline at end of file
+var _0x0475=['AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x0475,0xdb));var _0x5047=function(_0x3b0796,_0x3d5382){_0x3b0796=_0x3b0796-0x0;var _0x1bf181=_0x0475[_0x3b0796];return _0x1bf181;};'use strict';var _=require(_0x5047('0x0'));var util=require('util');var moment=require(_0x5047('0x1'));var BPromise=require(_0x5047('0x2'));var rs=require(_0x5047('0x3'));var fs=require('fs');var Redis=require(_0x5047('0x4'));var db=require(_0x5047('0x5'))['db'];var utils=require(_0x5047('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5047('0x7'));var jayson=require(_0x5047('0x8'));var client=jayson[_0x5047('0x9')][_0x5047('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f5db2,_0x4c762a,_0x44b8d6){return new BPromise(function(_0x58a239,_0x512fb9){return client[_0x5047('0xb')](_0x1f5db2,_0x44b8d6)['then'](function(_0x551912){logger['info'](_0x5047('0xc'),_0x4c762a,'request\x20sent');logger[_0x5047('0xd')](_0x5047('0xe'),_0x4c762a,_0x5047('0xf'),JSON[_0x5047('0x10')](_0x551912));if(_0x551912['error']){if(_0x551912[_0x5047('0x11')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4c762a,_0x551912[_0x5047('0x11')]['message']);return _0x512fb9(_0x551912['error'][_0x5047('0x12')]);}logger[_0x5047('0x11')](_0x5047('0xc'),_0x4c762a,_0x551912[_0x5047('0x11')][_0x5047('0x12')]);return _0x58a239(_0x551912[_0x5047('0x11')][_0x5047('0x12')]);}else{logger[_0x5047('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4c762a,'request\x20sent');_0x58a239(_0x551912[_0x5047('0x14')][_0x5047('0x12')]);}})['catch'](function(_0x31193e){logger[_0x5047('0x11')](_0x5047('0xc'),_0x4c762a,_0x31193e);_0x512fb9(_0x31193e);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b0d6c68..121732c 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 _0x34e7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x146e25,_0x190400){var _0x2661a8=function(_0x15ed40){while(--_0x15ed40){_0x146e25['push'](_0x146e25['shift']());}};_0x2661a8(++_0x190400);}(_0x34e7,0x164));var _0x734e=function(_0x5e7913,_0x3d4099){_0x5e7913=_0x5e7913-0x0;var _0x1d50a2=_0x34e7[_0x5e7913];return _0x1d50a2;};'use strict';var multer=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var path=require(_0x734e('0x2'));var timeout=require(_0x734e('0x3'));var express=require(_0x734e('0x4'));var router=express[_0x734e('0x5')]();var fs_extra=require(_0x734e('0x6'));var auth=require(_0x734e('0x7'));var interaction=require(_0x734e('0x8'));var config=require(_0x734e('0x9'));var controller=require(_0x734e('0xa'));router[_0x734e('0xb')]('/',auth[_0x734e('0xc')](),controller[_0x734e('0xd')]);router['get'](_0x734e('0xe'),auth[_0x734e('0xc')](),controller[_0x734e('0xf')]);router['post']('/',auth[_0x734e('0xc')](),controller['create']);router[_0x734e('0x10')](_0x734e('0xe'),auth[_0x734e('0xc')](),controller[_0x734e('0x11')]);router[_0x734e('0x12')](_0x734e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x734e('0x13')]=router;
\ No newline at end of file
+var _0x2cd3=['/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x3de16a,_0x3b9e39){var _0x33d96f=function(_0x578566){while(--_0x578566){_0x3de16a['push'](_0x3de16a['shift']());}};_0x33d96f(++_0x3b9e39);}(_0x2cd3,0xf1));var _0x32cd=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x2cd3[_0x545a3a];return _0x5a5493;};'use strict';var multer=require(_0x32cd('0x0'));var util=require('util');var path=require(_0x32cd('0x1'));var timeout=require(_0x32cd('0x2'));var express=require(_0x32cd('0x3'));var router=express[_0x32cd('0x4')]();var fs_extra=require(_0x32cd('0x5'));var auth=require(_0x32cd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x32cd('0x7'));router[_0x32cd('0x8')]('/',auth[_0x32cd('0x9')](),controller[_0x32cd('0xa')]);router[_0x32cd('0x8')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller[_0x32cd('0xc')]);router[_0x32cd('0xd')]('/',auth[_0x32cd('0x9')](),controller[_0x32cd('0xe')]);router[_0x32cd('0xf')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller[_0x32cd('0x10')]);router[_0x32cd('0x11')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index f324e39..7a69cbd 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 _0x53de=['TEXT','exports'];(function(_0x4ab6cd,_0x2edbdd){var _0x289ccb=function(_0x547651){while(--_0x547651){_0x4ab6cd['push'](_0x4ab6cd['shift']());}};_0x289ccb(++_0x2edbdd);}(_0x53de,0x151));var _0xe53d=function(_0x5d6270,_0x83b57a){_0x5d6270=_0x5d6270-0x0;var _0x168f26=_0x53de[_0x5d6270];return _0x168f26;};'use strict';var Sequelize=require('sequelize');module[_0xe53d('0x0')]={'tree':{'type':Sequelize[_0xe53d('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xc530=['exports','sequelize'];(function(_0x582a19,_0x34dbbf){var _0x50fa01=function(_0x470ab0){while(--_0x470ab0){_0x582a19['push'](_0x582a19['shift']());}};_0x50fa01(++_0x34dbbf);}(_0xc530,0x157));var _0x0c53=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xc530[_0x2f6f50];return _0x2cf365;};'use strict';var Sequelize=require(_0x0c53('0x0'));module[_0x0c53('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 52e7f80..c69cba5 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 _0x469f=['length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','rows','show','intersection','options','find','catch','create','body','update','params','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','offset','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields'];(function(_0x1cb376,_0xd7b3a3){var _0x2792a8=function(_0x47b416){while(--_0x47b416){_0x1cb376['push'](_0x1cb376['shift']());}};_0x2792a8(++_0xd7b3a3);}(_0x469f,0x188));var _0xf469=function(_0x1c7002,_0x17e2c3){_0x1c7002=_0x1c7002-0x0;var _0x4af787=_0x469f[_0x1c7002];return _0x4af787;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf469('0x0'));var zipdir=require(_0xf469('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf469('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf469('0x3'));var util=require(_0xf469('0x4'));var path=require(_0xf469('0x5'));var sox=require(_0xf469('0x6'));var csv=require('to-csv');var ejs=require(_0xf469('0x7'));var fs=require('fs');var fs_extra=require(_0xf469('0x8'));var _=require(_0xf469('0x9'));var squel=require(_0xf469('0xa'));var crypto=require('crypto');var jsforce=require(_0xf469('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf469('0xc'));var querystring=require(_0xf469('0xd'));var Papa=require(_0xf469('0xe'));var Redis=require(_0xf469('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf469('0x10'));var as=require(_0xf469('0x11'));var hardwareService=require(_0xf469('0x12'));var logger=require('../../config/logger')(_0xf469('0x13'));var utils=require(_0xf469('0x14'));var config=require(_0xf469('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4488a5,_0x17dadf){_0x17dadf=_0x17dadf||0xcc;return function(_0x5ad6f7){if(_0x5ad6f7){return _0x4488a5['sendStatus'](_0x17dadf);}return _0x4488a5['status'](_0x17dadf)['end']();};}function respondWithResult(_0x4010bd,_0x54cb3e){_0x54cb3e=_0x54cb3e||0xc8;return function(_0x4f1d2f){if(_0x4f1d2f){return _0x4010bd['status'](_0x54cb3e)['json'](_0x4f1d2f);}};}function respondWithFilteredResult(_0x5a98cb,_0x3ba49e){return function(_0x136a81){if(_0x136a81){var _0x274508=typeof _0x3ba49e[_0xf469('0x16')]==='undefined'&&typeof _0x3ba49e[_0xf469('0x17')]==='undefined';var _0x1c3178=_0x136a81[_0xf469('0x18')];var _0x288cec=_0x274508?0x0:_0x3ba49e['offset'];var _0x2f579f=_0x274508?_0x136a81[_0xf469('0x18')]:_0x3ba49e['offset']+_0x3ba49e[_0xf469('0x17')];var _0x268760;if(_0x2f579f>=_0x1c3178){_0x2f579f=_0x1c3178;_0x268760=0xc8;}else{_0x268760=0xce;}_0x5a98cb[_0xf469('0x19')](_0x268760);return _0x5a98cb[_0xf469('0x1a')](_0xf469('0x1b'),_0x288cec+'-'+_0x2f579f+'/'+_0x1c3178)[_0xf469('0x1c')](_0x136a81);}return null;};}function patchUpdates(_0x591da1){return function(_0x318df5){try{jsonpatch[_0xf469('0x1d')](_0x318df5,_0x591da1,!![]);}catch(_0xebb6b3){return BPromise[_0xf469('0x1e')](_0xebb6b3);}return _0x318df5[_0xf469('0x1f')]();};}function saveUpdates(_0x60a4aa,_0x4a28c3){return function(_0x103b46){if(_0x103b46){return _0x103b46['update'](_0x60a4aa)[_0xf469('0x20')](function(_0xa7e823){return _0xa7e823;});}return null;};}function removeEntity(_0x4ad781,_0x170e88){return function(_0x34a1d1){if(_0x34a1d1){return _0x34a1d1[_0xf469('0x21')]()[_0xf469('0x20')](function(){_0x4ad781[_0xf469('0x19')](0xcc)[_0xf469('0x22')]();});}};}function handleEntityNotFound(_0x2dcf0c,_0x359dd2){return function(_0x46455b){if(!_0x46455b){_0x2dcf0c[_0xf469('0x23')](0x194);}return _0x46455b;};}function handleError(_0xaac709,_0x4449bd){_0x4449bd=_0x4449bd||0x1f4;return function(_0x3b4df3){logger[_0xf469('0x24')](_0x3b4df3[_0xf469('0x25')]);if(_0x3b4df3[_0xf469('0x26')]){delete _0x3b4df3[_0xf469('0x26')];}_0xaac709[_0xf469('0x19')](_0x4449bd)[_0xf469('0x27')](_0x3b4df3);};}exports[_0xf469('0x28')]=function(_0x957b1a,_0x3dbc3d){var _0x28b28={},_0x3df7c9={},_0x161d70={'count':0x0,'rows':[]};var _0x1d9caa=_['map'](db[_0xf469('0x29')][_0xf469('0x2a')],function(_0x5bccb1){return{'name':_0x5bccb1['fieldName'],'type':_0x5bccb1[_0xf469('0x2b')][_0xf469('0x2c')]};});_0x3df7c9[_0xf469('0x2d')]=_[_0xf469('0x2e')](_0x1d9caa,_0xf469('0x26'));_0x3df7c9[_0xf469('0x2f')]=_[_0xf469('0x30')](_0x957b1a['query']);_0x3df7c9[_0xf469('0x31')]=_['intersection'](_0x3df7c9[_0xf469('0x2d')],_0x3df7c9['query']);_0x28b28[_0xf469('0x32')]=_['intersection'](_0x3df7c9['model'],qs[_0xf469('0x33')](_0x957b1a[_0xf469('0x2f')][_0xf469('0x33')]));_0x28b28['attributes']=_0x28b28['attributes'][_0xf469('0x34')]?_0x28b28[_0xf469('0x32')]:_0x3df7c9[_0xf469('0x2d')];if(!_0x957b1a[_0xf469('0x2f')][_0xf469('0x35')](_0xf469('0x36'))){_0x28b28[_0xf469('0x17')]=qs['limit'](_0x957b1a[_0xf469('0x2f')][_0xf469('0x17')]);_0x28b28[_0xf469('0x16')]=qs['offset'](_0x957b1a['query']['offset']);}_0x28b28[_0xf469('0x37')]=qs[_0xf469('0x38')](_0x957b1a[_0xf469('0x2f')][_0xf469('0x38')]);_0x28b28['where']=qs[_0xf469('0x31')](_[_0xf469('0x39')](_0x957b1a[_0xf469('0x2f')],_0x3df7c9[_0xf469('0x31')]),_0x1d9caa);if(_0x957b1a[_0xf469('0x2f')]['filter']){_0x28b28['where']=_[_0xf469('0x3a')](_0x28b28[_0xf469('0x3b')],{'$or':_[_0xf469('0x2e')](_0x1d9caa,function(_0xe35f9e){if(_0xe35f9e[_0xf469('0x2b')]!==_0xf469('0x3c')){var _0x20b04c={};_0x20b04c[_0xe35f9e[_0xf469('0x26')]]={'$like':'%'+_0x957b1a[_0xf469('0x2f')][_0xf469('0x3d')]+'%'};return _0x20b04c;}})});}_0x28b28=_[_0xf469('0x3a')]({},_0x28b28,_0x957b1a['options']);var _0xfa6b73={'where':_0x28b28[_0xf469('0x3b')]};return db['AnalyticTreeReport'][_0xf469('0x18')](_0xfa6b73)[_0xf469('0x20')](function(_0x3a2e77){_0x161d70['count']=_0x3a2e77;if(_0x957b1a[_0xf469('0x2f')][_0xf469('0x3e')]){_0x28b28[_0xf469('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x28b28);})['then'](function(_0x1ba5bf){_0x161d70[_0xf469('0x40')]=_0x1ba5bf;return _0x161d70;})[_0xf469('0x20')](respondWithFilteredResult(_0x3dbc3d,_0x28b28))['catch'](handleError(_0x3dbc3d,null));};exports[_0xf469('0x41')]=function(_0x3cb5c1,_0x12a1fb){var _0x2554a1={'raw':!![],'where':{'id':_0x3cb5c1['params']['id']}},_0x48f43c={};_0x48f43c[_0xf469('0x2d')]=_[_0xf469('0x30')](db[_0xf469('0x29')][_0xf469('0x2a')]);_0x48f43c['query']=_[_0xf469('0x30')](_0x3cb5c1[_0xf469('0x2f')]);_0x48f43c[_0xf469('0x31')]=_['intersection'](_0x48f43c[_0xf469('0x2d')],_0x48f43c['query']);_0x2554a1[_0xf469('0x32')]=_[_0xf469('0x42')](_0x48f43c[_0xf469('0x2d')],qs[_0xf469('0x33')](_0x3cb5c1[_0xf469('0x2f')][_0xf469('0x33')]));_0x2554a1[_0xf469('0x32')]=_0x2554a1['attributes']['length']?_0x2554a1['attributes']:_0x48f43c[_0xf469('0x2d')];if(_0x3cb5c1[_0xf469('0x2f')]['includeAll']){_0x2554a1['include']=[{'all':!![]}];}_0x2554a1=_[_0xf469('0x3a')]({},_0x2554a1,_0x3cb5c1[_0xf469('0x43')]);return db[_0xf469('0x29')][_0xf469('0x44')](_0x2554a1)[_0xf469('0x20')](handleEntityNotFound(_0x12a1fb,null))['then'](respondWithResult(_0x12a1fb,null))[_0xf469('0x45')](handleError(_0x12a1fb,null));};exports['create']=function(_0x5dcb77,_0x1dc189){return db['AnalyticTreeReport'][_0xf469('0x46')](_0x5dcb77[_0xf469('0x47')],{})['then'](respondWithResult(_0x1dc189,0xc9))[_0xf469('0x45')](handleError(_0x1dc189,null));};exports[_0xf469('0x48')]=function(_0x1fdb57,_0xa5caed){if(_0x1fdb57['body']['id']){delete _0x1fdb57[_0xf469('0x47')]['id'];}return db['AnalyticTreeReport'][_0xf469('0x44')]({'where':{'id':_0x1fdb57[_0xf469('0x49')]['id']}})['then'](handleEntityNotFound(_0xa5caed,null))['then'](saveUpdates(_0x1fdb57[_0xf469('0x47')],null))[_0xf469('0x20')](respondWithResult(_0xa5caed,null))[_0xf469('0x45')](handleError(_0xa5caed,null));};exports['destroy']=function(_0x5012ba,_0x4b9e0b){return db[_0xf469('0x29')][_0xf469('0x44')]({'where':{'id':_0x5012ba[_0xf469('0x49')]['id']}})[_0xf469('0x20')](handleEntityNotFound(_0x4b9e0b,null))[_0xf469('0x20')](removeEntity(_0x4b9e0b,null))[_0xf469('0x45')](handleError(_0x4b9e0b,null));};
\ No newline at end of file
+var _0xcafb=['create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','merge','options','AnalyticTreeReport','include','findAll','rows','catch','show','params'];(function(_0x175d53,_0x4215d0){var _0x135620=function(_0x43649b){while(--_0x43649b){_0x175d53['push'](_0x175d53['shift']());}};_0x135620(++_0x4215d0);}(_0xcafb,0xdd));var _0xbcaf=function(_0x52aa4c,_0x1abcb2){_0x52aa4c=_0x52aa4c-0x0;var _0x3a9660=_0xcafb[_0x52aa4c];return _0x3a9660;};'use strict';var emlformat=require(_0xbcaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcaf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbcaf('0x2'));var moment=require(_0xbcaf('0x3'));var BPromise=require(_0xbcaf('0x4'));var Mustache=require(_0xbcaf('0x5'));var util=require(_0xbcaf('0x6'));var path=require(_0xbcaf('0x7'));var sox=require(_0xbcaf('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcaf('0x9'));var _=require(_0xbcaf('0xa'));var squel=require(_0xbcaf('0xb'));var crypto=require(_0xbcaf('0xc'));var jsforce=require(_0xbcaf('0xd'));var deskjs=require(_0xbcaf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbcaf('0xf'));var Papa=require(_0xbcaf('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbcaf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcaf('0x12'))(_0xbcaf('0x13'));var utils=require(_0xbcaf('0x14'));var config=require(_0xbcaf('0x15'));var licenseUtil=require(_0xbcaf('0x16'));var db=require(_0xbcaf('0x17'))['db'];function respondWithStatusCode(_0x37569e,_0x4ee18f){_0x4ee18f=_0x4ee18f||0xcc;return function(_0x5527f3){if(_0x5527f3){return _0x37569e[_0xbcaf('0x18')](_0x4ee18f);}return _0x37569e[_0xbcaf('0x19')](_0x4ee18f)[_0xbcaf('0x1a')]();};}function respondWithResult(_0x4373b5,_0xa1dd4f){_0xa1dd4f=_0xa1dd4f||0xc8;return function(_0x467bb9){if(_0x467bb9){return _0x4373b5['status'](_0xa1dd4f)[_0xbcaf('0x1b')](_0x467bb9);}};}function respondWithFilteredResult(_0x253304,_0x72ac1f){return function(_0x313d8c){if(_0x313d8c){var _0x53caa8=typeof _0x72ac1f[_0xbcaf('0x1c')]===_0xbcaf('0x1d')&&typeof _0x72ac1f['limit']===_0xbcaf('0x1d');var _0x4371f6=_0x313d8c[_0xbcaf('0x1e')];var _0x1382bd=_0x53caa8?0x0:_0x72ac1f[_0xbcaf('0x1c')];var _0x459c98=_0x53caa8?_0x313d8c['count']:_0x72ac1f['offset']+_0x72ac1f['limit'];var _0x50e96b;if(_0x459c98>=_0x4371f6){_0x459c98=_0x4371f6;_0x50e96b=0xc8;}else{_0x50e96b=0xce;}_0x253304[_0xbcaf('0x19')](_0x50e96b);return _0x253304[_0xbcaf('0x1f')](_0xbcaf('0x20'),_0x1382bd+'-'+_0x459c98+'/'+_0x4371f6)['json'](_0x313d8c);}return null;};}function patchUpdates(_0xc8a5ee){return function(_0x963dc5){try{jsonpatch['apply'](_0x963dc5,_0xc8a5ee,!![]);}catch(_0x460ef1){return BPromise[_0xbcaf('0x21')](_0x460ef1);}return _0x963dc5[_0xbcaf('0x22')]();};}function saveUpdates(_0x2682ad,_0x3caaca){return function(_0x3ca623){if(_0x3ca623){return _0x3ca623[_0xbcaf('0x23')](_0x2682ad)['then'](function(_0x339bed){return _0x339bed;});}return null;};}function removeEntity(_0x576cb9,_0xbe9f60){return function(_0x167138){if(_0x167138){return _0x167138[_0xbcaf('0x24')]()[_0xbcaf('0x25')](function(){_0x576cb9[_0xbcaf('0x19')](0xcc)[_0xbcaf('0x1a')]();});}};}function handleEntityNotFound(_0x472292,_0x2b60f2){return function(_0x2f613e){if(!_0x2f613e){_0x472292[_0xbcaf('0x18')](0x194);}return _0x2f613e;};}function handleError(_0x594f33,_0x11ee72){_0x11ee72=_0x11ee72||0x1f4;return function(_0x1658be){logger[_0xbcaf('0x26')](_0x1658be[_0xbcaf('0x27')]);if(_0x1658be[_0xbcaf('0x28')]){delete _0x1658be['name'];}_0x594f33[_0xbcaf('0x19')](_0x11ee72)[_0xbcaf('0x29')](_0x1658be);};}exports[_0xbcaf('0x2a')]=function(_0x23bd35,_0x992a97){var _0x267058={},_0x50a375={},_0x4908b0={'count':0x0,'rows':[]};var _0x5ed0a5=_[_0xbcaf('0x2b')](db['AnalyticTreeReport'][_0xbcaf('0x2c')],function(_0x3800a6){return{'name':_0x3800a6['fieldName'],'type':_0x3800a6[_0xbcaf('0x2d')][_0xbcaf('0x2e')]};});_0x50a375[_0xbcaf('0x2f')]=_[_0xbcaf('0x2b')](_0x5ed0a5,_0xbcaf('0x28'));_0x50a375[_0xbcaf('0x30')]=_[_0xbcaf('0x31')](_0x23bd35[_0xbcaf('0x30')]);_0x50a375[_0xbcaf('0x32')]=_[_0xbcaf('0x33')](_0x50a375[_0xbcaf('0x2f')],_0x50a375['query']);_0x267058[_0xbcaf('0x34')]=_[_0xbcaf('0x33')](_0x50a375['model'],qs[_0xbcaf('0x35')](_0x23bd35['query'][_0xbcaf('0x35')]));_0x267058[_0xbcaf('0x34')]=_0x267058[_0xbcaf('0x34')][_0xbcaf('0x36')]?_0x267058['attributes']:_0x50a375[_0xbcaf('0x2f')];if(!_0x23bd35['query'][_0xbcaf('0x37')]('nolimit')){_0x267058[_0xbcaf('0x38')]=qs['limit'](_0x23bd35[_0xbcaf('0x30')][_0xbcaf('0x38')]);_0x267058[_0xbcaf('0x1c')]=qs[_0xbcaf('0x1c')](_0x23bd35[_0xbcaf('0x30')][_0xbcaf('0x1c')]);}_0x267058[_0xbcaf('0x39')]=qs[_0xbcaf('0x3a')](_0x23bd35[_0xbcaf('0x30')]['sort']);_0x267058[_0xbcaf('0x3b')]=qs[_0xbcaf('0x32')](_[_0xbcaf('0x3c')](_0x23bd35[_0xbcaf('0x30')],_0x50a375[_0xbcaf('0x32')]),_0x5ed0a5);if(_0x23bd35[_0xbcaf('0x30')]['filter']){_0x267058['where']=_['merge'](_0x267058['where'],{'$or':_['map'](_0x5ed0a5,function(_0x5116f8){if(_0x5116f8['type']!==_0xbcaf('0x3d')){var _0x4d6931={};_0x4d6931[_0x5116f8[_0xbcaf('0x28')]]={'$like':'%'+_0x23bd35[_0xbcaf('0x30')]['filter']+'%'};return _0x4d6931;}})});}_0x267058=_[_0xbcaf('0x3e')]({},_0x267058,_0x23bd35[_0xbcaf('0x3f')]);var _0x239e15={'where':_0x267058[_0xbcaf('0x3b')]};return db[_0xbcaf('0x40')][_0xbcaf('0x1e')](_0x239e15)['then'](function(_0x3eeae5){_0x4908b0['count']=_0x3eeae5;if(_0x23bd35['query']['includeAll']){_0x267058[_0xbcaf('0x41')]=[{'all':!![]}];}return db[_0xbcaf('0x40')][_0xbcaf('0x42')](_0x267058);})[_0xbcaf('0x25')](function(_0x2b7b0b){_0x4908b0[_0xbcaf('0x43')]=_0x2b7b0b;return _0x4908b0;})['then'](respondWithFilteredResult(_0x992a97,_0x267058))[_0xbcaf('0x44')](handleError(_0x992a97,null));};exports[_0xbcaf('0x45')]=function(_0x56ab60,_0x26c243){var _0x5a1405={'raw':!![],'where':{'id':_0x56ab60[_0xbcaf('0x46')]['id']}},_0x2608bb={};_0x2608bb[_0xbcaf('0x2f')]=_[_0xbcaf('0x31')](db['AnalyticTreeReport']['rawAttributes']);_0x2608bb[_0xbcaf('0x30')]=_[_0xbcaf('0x31')](_0x56ab60[_0xbcaf('0x30')]);_0x2608bb[_0xbcaf('0x32')]=_[_0xbcaf('0x33')](_0x2608bb[_0xbcaf('0x2f')],_0x2608bb[_0xbcaf('0x30')]);_0x5a1405[_0xbcaf('0x34')]=_[_0xbcaf('0x33')](_0x2608bb[_0xbcaf('0x2f')],qs['fields'](_0x56ab60['query'][_0xbcaf('0x35')]));_0x5a1405[_0xbcaf('0x34')]=_0x5a1405[_0xbcaf('0x34')][_0xbcaf('0x36')]?_0x5a1405[_0xbcaf('0x34')]:_0x2608bb[_0xbcaf('0x2f')];if(_0x56ab60[_0xbcaf('0x30')]['includeAll']){_0x5a1405[_0xbcaf('0x41')]=[{'all':!![]}];}_0x5a1405=_['merge']({},_0x5a1405,_0x56ab60[_0xbcaf('0x3f')]);return db['AnalyticTreeReport']['find'](_0x5a1405)[_0xbcaf('0x25')](handleEntityNotFound(_0x26c243,null))[_0xbcaf('0x25')](respondWithResult(_0x26c243,null))[_0xbcaf('0x44')](handleError(_0x26c243,null));};exports['create']=function(_0x142d48,_0x35fad7){return db[_0xbcaf('0x40')][_0xbcaf('0x47')](_0x142d48['body'],{})['then'](respondWithResult(_0x35fad7,0xc9))[_0xbcaf('0x44')](handleError(_0x35fad7,null));};exports[_0xbcaf('0x23')]=function(_0x4132f8,_0x3708c3){if(_0x4132f8[_0xbcaf('0x48')]['id']){delete _0x4132f8['body']['id'];}return db[_0xbcaf('0x40')]['find']({'where':{'id':_0x4132f8['params']['id']}})['then'](handleEntityNotFound(_0x3708c3,null))['then'](saveUpdates(_0x4132f8[_0xbcaf('0x48')],null))['then'](respondWithResult(_0x3708c3,null))['catch'](handleError(_0x3708c3,null));};exports[_0xbcaf('0x24')]=function(_0x1d445c,_0x4bbb3c){return db[_0xbcaf('0x40')]['find']({'where':{'id':_0x1d445c[_0xbcaf('0x46')]['id']}})[_0xbcaf('0x25')](handleEntityNotFound(_0x4bbb3c,null))[_0xbcaf('0x25')](removeEntity(_0x4bbb3c,null))[_0xbcaf('0x44')](handleError(_0x4bbb3c,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 21cd072..43f50a6 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 _0xbc8b=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc8b,0xc8));var _0xbbc8=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xbc8b[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xbbc8('0x0'));var util=require('util');var logger=require(_0xbbc8('0x1'))(_0xbbc8('0x2'));var moment=require('moment');var BPromise=require(_0xbbc8('0x3'));var rp=require(_0xbbc8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbc8('0x5'));var config=require(_0xbbc8('0x6'));var attributes=require(_0xbbc8('0x7'));module[_0xbbc8('0x8')]=function(_0x292b0b,_0x27782e){return _0x292b0b[_0xbbc8('0x9')](_0xbbc8('0xa'),attributes,{'tableName':_0xbbc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd6df=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd6df,0xb4));var _0xfd6d=function(_0x23a3cd,_0x6e2762){_0x23a3cd=_0x23a3cd-0x0;var _0x1ec75b=_0xd6df[_0x23a3cd];return _0x1ec75b;};'use strict';var _=require(_0xfd6d('0x0'));var util=require(_0xfd6d('0x1'));var logger=require(_0xfd6d('0x2'))(_0xfd6d('0x3'));var moment=require(_0xfd6d('0x4'));var BPromise=require(_0xfd6d('0x5'));var rp=require(_0xfd6d('0x6'));var fs=require('fs');var path=require(_0xfd6d('0x7'));var rimraf=require(_0xfd6d('0x8'));var config=require(_0xfd6d('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0xfd6d('0xa')]=function(_0x39e558,_0x5f51da){return _0x39e558['define'](_0xfd6d('0xb'),attributes,{'tableName':_0xfd6d('0xc'),'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 dd06538..b95c227 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x37b2be,_0x2c92fc){var _0x1e80ef=function(_0x680b58){while(--_0x680b58){_0x37b2be['push'](_0x37b2be['shift']());}};_0x1e80ef(++_0x2c92fc);}(_0x2ef3,0xba));var _0x32ef=function(_0x19c980,_0x53a31e){_0x19c980=_0x19c980-0x0;var _0x9b6c7=_0x2ef3[_0x19c980];return _0x9b6c7;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1e88f9,_0xb92e06){var _0x29f1a0=function(_0x4d79d1){while(--_0x4d79d1){_0x1e88f9['push'](_0x1e88f9['shift']());}};_0x29f1a0(++_0xb92e06);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7e89ab,_0x1f8dc3){_0x7e89ab=_0x7e89ab-0x0;var _0x234184=_0x5f2f[_0x7e89ab];return _0x234184;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index b7ed0a9..be4d866 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 _0xc035=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4bb28b,_0x521859){var _0x4c7c9b=function(_0x257c4d){while(--_0x257c4d){_0x4bb28b['push'](_0x4bb28b['shift']());}};_0x4c7c9b(++_0x521859);}(_0xc035,0x1dd));var _0x5c03=function(_0x355f6d,_0x2b640e){_0x355f6d=_0x355f6d-0x0;var _0x3d6f05=_0xc035[_0x355f6d];return _0x3d6f05;};'use strict';var multer=require('multer');var util=require(_0x5c03('0x0'));var path=require(_0x5c03('0x1'));var timeout=require(_0x5c03('0x2'));var express=require('express');var router=express[_0x5c03('0x3')]();var fs_extra=require(_0x5c03('0x4'));var auth=require(_0x5c03('0x5'));var interaction=require(_0x5c03('0x6'));var config=require(_0x5c03('0x7'));var controller=require(_0x5c03('0x8'));router[_0x5c03('0x9')]('/',auth['isAuthenticated'](),controller[_0x5c03('0xa')]);router['get'](_0x5c03('0xb'),auth['isAuthenticated'](),controller[_0x5c03('0xc')]);router[_0x5c03('0xd')]('/',auth[_0x5c03('0xe')](),controller['create']);router[_0x5c03('0xf')]('/:id',auth[_0x5c03('0xe')](),controller[_0x5c03('0x10')]);router[_0x5c03('0x11')](_0x5c03('0xb'),auth[_0x5c03('0xe')](),controller[_0x5c03('0x12')]);module[_0x5c03('0x13')]=router;
\ No newline at end of file
+var _0x6931=['express','Router','fs-extra','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x4bd7c9,_0xc4fed8){var _0x593124=function(_0x13e2b6){while(--_0x13e2b6){_0x4bd7c9['push'](_0x4bd7c9['shift']());}};_0x593124(++_0xc4fed8);}(_0x6931,0x19c));var _0x1693=function(_0x29807f,_0xe0404){_0x29807f=_0x29807f-0x0;var _0x81aff2=_0x6931[_0x29807f];return _0x81aff2;};'use strict';var multer=require(_0x1693('0x0'));var util=require('util');var path=require(_0x1693('0x1'));var timeout=require('connect-timeout');var express=require(_0x1693('0x2'));var router=express[_0x1693('0x3')]();var fs_extra=require(_0x1693('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1693('0x5'));router[_0x1693('0x6')]('/',auth[_0x1693('0x7')](),controller[_0x1693('0x8')]);router[_0x1693('0x6')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0xa')]);router[_0x1693('0xb')]('/',auth[_0x1693('0x7')](),controller[_0x1693('0xc')]);router[_0x1693('0xd')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0xe')]);router[_0x1693('0xf')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0x10')]);module[_0x1693('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index c35cc82..5c3dea1 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 _0xd3d1=['STRING','sequelize','exports'];(function(_0x3a8aec,_0x1aff3f){var _0x5ccb87=function(_0x13917a){while(--_0x13917a){_0x3a8aec['push'](_0x3a8aec['shift']());}};_0x5ccb87(++_0x1aff3f);}(_0xd3d1,0x172));var _0x1d3d=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd3d1[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x1d3d('0x0'));module[_0x1d3d('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1d3d('0x2')]}};
\ No newline at end of file
+var _0x37dc=['sequelize','exports','STRING'];(function(_0x3beaa7,_0x26e2d7){var _0x4e87e2=function(_0x48a569){while(--_0x48a569){_0x3beaa7['push'](_0x3beaa7['shift']());}};_0x4e87e2(++_0x26e2d7);}(_0x37dc,0x1e9));var _0xc37d=function(_0x5e086f,_0x4f1821){_0x5e086f=_0x5e086f-0x0;var _0x12dba8=_0x37dc[_0x5e086f];return _0x12dba8;};'use strict';var Sequelize=require(_0xc37d('0x0'));module[_0xc37d('0x1')]={'name':{'type':Sequelize[_0xc37d('0x2')]},'basename':{'type':Sequelize[_0xc37d('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 0641d5d..dd776e3 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 _0x6e54=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','clone','get','omit','createdAt','updatedAt','body','update','create','file','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','Attachment','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x6e54,0x1de));var _0x46e5=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x6e54[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x46e5('0x0'));var rimraf=require(_0x46e5('0x1'));var zipdir=require(_0x46e5('0x2'));var jsonpatch=require(_0x46e5('0x3'));var rp=require('request-promise');var moment=require(_0x46e5('0x4'));var BPromise=require(_0x46e5('0x5'));var Mustache=require(_0x46e5('0x6'));var util=require(_0x46e5('0x7'));var path=require('path');var sox=require(_0x46e5('0x8'));var csv=require(_0x46e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46e5('0xa'));var _=require(_0x46e5('0xb'));var squel=require('squel');var crypto=require(_0x46e5('0xc'));var jsforce=require(_0x46e5('0xd'));var deskjs=require(_0x46e5('0xe'));var toCsv=require(_0x46e5('0x9'));var querystring=require('querystring');var Papa=require(_0x46e5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x46e5('0x10'));var as=require(_0x46e5('0x11'));var hardwareService=require(_0x46e5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x46e5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x46e5('0x14'));var db=require(_0x46e5('0x15'))['db'];function respondWithStatusCode(_0xd3569f,_0x1d30b3){_0x1d30b3=_0x1d30b3||0xcc;return function(_0x52b0bd){if(_0x52b0bd){return _0xd3569f[_0x46e5('0x16')](_0x1d30b3);}return _0xd3569f['status'](_0x1d30b3)['end']();};}function respondWithResult(_0x320fbb,_0x417e1c){_0x417e1c=_0x417e1c||0xc8;return function(_0x237a6a){if(_0x237a6a){return _0x320fbb[_0x46e5('0x17')](_0x417e1c)[_0x46e5('0x18')](_0x237a6a);}};}function respondWithFilteredResult(_0x160487,_0x2f7287){return function(_0x49308c){if(_0x49308c){var _0x18fde1=typeof _0x2f7287['offset']===_0x46e5('0x19')&&typeof _0x2f7287['limit']===_0x46e5('0x19');var _0x449031=_0x49308c[_0x46e5('0x1a')];var _0xbf688f=_0x18fde1?0x0:_0x2f7287[_0x46e5('0x1b')];var _0x1b40df=_0x18fde1?_0x49308c['count']:_0x2f7287[_0x46e5('0x1b')]+_0x2f7287[_0x46e5('0x1c')];var _0x529057;if(_0x1b40df>=_0x449031){_0x1b40df=_0x449031;_0x529057=0xc8;}else{_0x529057=0xce;}_0x160487[_0x46e5('0x17')](_0x529057);return _0x160487[_0x46e5('0x1d')](_0x46e5('0x1e'),_0xbf688f+'-'+_0x1b40df+'/'+_0x449031)['json'](_0x49308c);}return null;};}function patchUpdates(_0x35706f){return function(_0x233976){try{jsonpatch['apply'](_0x233976,_0x35706f,!![]);}catch(_0x2e6eaf){return BPromise[_0x46e5('0x1f')](_0x2e6eaf);}return _0x233976[_0x46e5('0x20')]();};}function saveUpdates(_0x1e57d7,_0x627283){return function(_0x2d26d4){if(_0x2d26d4){return _0x2d26d4['update'](_0x1e57d7)[_0x46e5('0x21')](function(_0x5cb97e){return _0x5cb97e;});}return null;};}function removeEntity(_0x398143,_0x5b48fe){return function(_0x3b95fe){if(_0x3b95fe){return _0x3b95fe[_0x46e5('0x22')]()[_0x46e5('0x21')](function(){_0x398143[_0x46e5('0x17')](0xcc)[_0x46e5('0x23')]();});}};}function handleEntityNotFound(_0x5c689a,_0x515d47){return function(_0x268e65){if(!_0x268e65){_0x5c689a['sendStatus'](0x194);}return _0x268e65;};}function handleError(_0x48a791,_0x22ec36){_0x22ec36=_0x22ec36||0x1f4;return function(_0x484f85){logger[_0x46e5('0x24')](_0x484f85[_0x46e5('0x25')]);if(_0x484f85['name']){delete _0x484f85[_0x46e5('0x26')];}_0x48a791['status'](_0x22ec36)['send'](_0x484f85);};}exports['index']=function(_0x16480e,_0x5a07c6){var _0x285eaf={},_0x2a9d54={},_0x50c501={'count':0x0,'rows':[]};var _0x2249b0=_['map'](db[_0x46e5('0x27')][_0x46e5('0x28')],function(_0x5b4d53){return{'name':_0x5b4d53[_0x46e5('0x29')],'type':_0x5b4d53[_0x46e5('0x2a')][_0x46e5('0x2b')]};});_0x2a9d54[_0x46e5('0x2c')]=_[_0x46e5('0x2d')](_0x2249b0,_0x46e5('0x26'));_0x2a9d54[_0x46e5('0x2e')]=_['keys'](_0x16480e[_0x46e5('0x2e')]);_0x2a9d54['filters']=_[_0x46e5('0x2f')](_0x2a9d54[_0x46e5('0x2c')],_0x2a9d54[_0x46e5('0x2e')]);_0x285eaf[_0x46e5('0x30')]=_['intersection'](_0x2a9d54['model'],qs[_0x46e5('0x31')](_0x16480e[_0x46e5('0x2e')]['fields']));_0x285eaf['attributes']=_0x285eaf['attributes'][_0x46e5('0x32')]?_0x285eaf[_0x46e5('0x30')]:_0x2a9d54[_0x46e5('0x2c')];if(!_0x16480e[_0x46e5('0x2e')][_0x46e5('0x33')](_0x46e5('0x34'))){_0x285eaf['limit']=qs[_0x46e5('0x1c')](_0x16480e['query'][_0x46e5('0x1c')]);_0x285eaf[_0x46e5('0x1b')]=qs[_0x46e5('0x1b')](_0x16480e[_0x46e5('0x2e')]['offset']);}_0x285eaf[_0x46e5('0x35')]=qs[_0x46e5('0x36')](_0x16480e[_0x46e5('0x2e')][_0x46e5('0x36')]);_0x285eaf[_0x46e5('0x37')]=qs[_0x46e5('0x38')](_[_0x46e5('0x39')](_0x16480e['query'],_0x2a9d54[_0x46e5('0x38')]),_0x2249b0);if(_0x16480e[_0x46e5('0x2e')]['filter']){_0x285eaf[_0x46e5('0x37')]=_[_0x46e5('0x3a')](_0x285eaf[_0x46e5('0x37')],{'$or':_['map'](_0x2249b0,function(_0x18d6ab){if(_0x18d6ab['type']!==_0x46e5('0x3b')){var _0x211ed1={};_0x211ed1[_0x18d6ab[_0x46e5('0x26')]]={'$like':'%'+_0x16480e['query'][_0x46e5('0x3c')]+'%'};return _0x211ed1;}})});}_0x285eaf=_['merge']({},_0x285eaf,_0x16480e[_0x46e5('0x3d')]);var _0x5e10c4={'where':_0x285eaf[_0x46e5('0x37')]};return db['Attachment'][_0x46e5('0x1a')](_0x5e10c4)[_0x46e5('0x21')](function(_0x5f0b46){_0x50c501[_0x46e5('0x1a')]=_0x5f0b46;if(_0x16480e[_0x46e5('0x2e')][_0x46e5('0x3e')]){_0x285eaf[_0x46e5('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x46e5('0x40')](_0x285eaf);})['then'](function(_0x5ad07a){_0x50c501[_0x46e5('0x41')]=_0x5ad07a;return _0x50c501;})[_0x46e5('0x21')](respondWithFilteredResult(_0x5a07c6,_0x285eaf))[_0x46e5('0x42')](handleError(_0x5a07c6,null));};exports[_0x46e5('0x43')]=function(_0x190504,_0x2c2d0e){var _0x320f46={'raw':!![],'where':{'id':_0x190504[_0x46e5('0x44')]['id']}},_0x3e7b58={};_0x3e7b58['model']=_[_0x46e5('0x45')](db[_0x46e5('0x27')][_0x46e5('0x28')]);_0x3e7b58[_0x46e5('0x2e')]=_[_0x46e5('0x45')](_0x190504[_0x46e5('0x2e')]);_0x3e7b58['filters']=_[_0x46e5('0x2f')](_0x3e7b58[_0x46e5('0x2c')],_0x3e7b58[_0x46e5('0x2e')]);_0x320f46[_0x46e5('0x30')]=_['intersection'](_0x3e7b58['model'],qs[_0x46e5('0x31')](_0x190504['query'][_0x46e5('0x31')]));_0x320f46['attributes']=_0x320f46['attributes'][_0x46e5('0x32')]?_0x320f46['attributes']:_0x3e7b58['model'];if(_0x190504['query'][_0x46e5('0x3e')]){_0x320f46['include']=[{'all':!![]}];}_0x320f46=_['merge']({},_0x320f46,_0x190504[_0x46e5('0x3d')]);return db['Attachment'][_0x46e5('0x46')](_0x320f46)[_0x46e5('0x21')](handleEntityNotFound(_0x2c2d0e,null))[_0x46e5('0x21')](respondWithResult(_0x2c2d0e,null))[_0x46e5('0x42')](handleError(_0x2c2d0e,null));};exports[_0x46e5('0x47')]=function(_0x48cf6b,_0x342a85){var _0x494eca={'where':{'id':_0x48cf6b[_0x46e5('0x44')]['id']}},_0x2caedb={};_0x2caedb[_0x46e5('0x2c')]=_[_0x46e5('0x45')](db[_0x46e5('0x27')][_0x46e5('0x28')]);_0x494eca[_0x46e5('0x30')]=_['intersection'](_0x2caedb[_0x46e5('0x2c')],qs[_0x46e5('0x31')](_0x48cf6b[_0x46e5('0x2e')][_0x46e5('0x31')]));_0x494eca[_0x46e5('0x30')]=_0x494eca[_0x46e5('0x30')][_0x46e5('0x32')]?_0x494eca['attributes']:_0x2caedb['model'];if(_0x48cf6b[_0x46e5('0x2e')][_0x46e5('0x3e')]){_0x494eca[_0x46e5('0x3f')]=[{'all':!![]}];}_0x494eca=_['merge']({},_0x494eca,_0x48cf6b[_0x46e5('0x3d')]);return db[_0x46e5('0x27')][_0x46e5('0x46')](_0x494eca)[_0x46e5('0x21')](handleEntityNotFound(_0x342a85,null))[_0x46e5('0x21')](function(_0x5aa976){if(_0x5aa976){var _0x16ec97=_0x5aa976[_0x46e5('0x48')]({'plain':!![]});_0x16ec97=qs[_0x46e5('0x49')](_0x16ec97,['id',_0x46e5('0x4a'),_0x46e5('0x4b')]);_0x48cf6b[_0x46e5('0x4c')]=_[_0x46e5('0x49')](_0x48cf6b[_0x46e5('0x4c')],['id',_0x46e5('0x4a'),_0x46e5('0x4b')]);return db['Attachment']['create'](_[_0x46e5('0x3a')](_0x16ec97,_0x48cf6b[_0x46e5('0x4c')]),{'include':_0x48cf6b[_0x46e5('0x2e')][_0x46e5('0x3e')]?[{'all':!![]}]:undefined});}})[_0x46e5('0x21')](respondWithResult(_0x342a85,0xc9))[_0x46e5('0x42')](handleError(_0x342a85,null));};exports[_0x46e5('0x4d')]=function(_0x2b92a7,_0x641318){if(_0x2b92a7['body']['id']){delete _0x2b92a7[_0x46e5('0x4c')]['id'];}return db['Attachment'][_0x46e5('0x46')]({'where':{'id':_0x2b92a7[_0x46e5('0x44')]['id']}})[_0x46e5('0x21')](handleEntityNotFound(_0x641318,null))[_0x46e5('0x21')](saveUpdates(_0x2b92a7[_0x46e5('0x4c')],null))[_0x46e5('0x21')](respondWithResult(_0x641318,null))[_0x46e5('0x42')](handleError(_0x641318,null));};exports[_0x46e5('0x22')]=function(_0x3c95ff,_0x4f6d89){return db['Attachment']['find']({'where':{'id':_0x3c95ff['params']['id']}})['then'](handleEntityNotFound(_0x4f6d89,null))[_0x46e5('0x21')](removeEntity(_0x4f6d89,null))['catch'](handleError(_0x4f6d89,null));};exports[_0x46e5('0x4e')]=function(_0x5ec1c1,_0x1d469b,_0x4e00d0){_0x5ec1c1[_0x46e5('0x4c')][_0x46e5('0x26')]=_0x5ec1c1[_0x46e5('0x4f')]['originalname'];_0x5ec1c1['body'][_0x46e5('0x50')]=_0x5ec1c1[_0x46e5('0x4f')][_0x46e5('0x51')];_0x5ec1c1['body']['type']=_0x5ec1c1[_0x46e5('0x4f')]['mimetype'];return db[_0x46e5('0x27')][_0x46e5('0x4e')](_0x5ec1c1[_0x46e5('0x4c')])['then'](respondWithResult(_0x1d469b,0xc9))[_0x46e5('0x42')](handleError(_0x1d469b,null));};exports[_0x46e5('0x52')]=function(_0x360227,_0x224e19,_0x185ec9){return db['Attachment'][_0x46e5('0x53')]({'where':{'id':_0x360227[_0x46e5('0x44')]['id']},'raw':!![]})[_0x46e5('0x21')](handleEntityNotFound(_0x224e19,null))[_0x46e5('0x21')](function(_0x3d24f0){if(_0x3d24f0){var _0x29d96b=_0x3d24f0[_0x46e5('0x54')]!==null;var _0x2c5271=path[_0x46e5('0x55')](config[_0x46e5('0x56')],_0x46e5('0x57'));if(_0x29d96b){_0x2c5271=path['join'](_0x2c5271,'offline-chat/');}var _0xde6675=path[_0x46e5('0x55')](_0x2c5271,_0x3d24f0[_0x46e5('0x50')]);return _0x224e19[_0x46e5('0x52')](_0xde6675);}})['catch'](handleError(_0x224e19,null));};
\ No newline at end of file
+var _0x658e=['reject','save','update','then','destroy','end','error','stack','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','name','options','includeAll','include','rows','catch','show','params','keys','intersection','length','find','clone','merge','get','body','omit','createdAt','create','file','originalname','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','apply'];(function(_0x2c42e1,_0x5141c7){var _0x34df52=function(_0x35a840){while(--_0x35a840){_0x2c42e1['push'](_0x2c42e1['shift']());}};_0x34df52(++_0x5141c7);}(_0x658e,0x19a));var _0xe658=function(_0x5877ae,_0x358cda){_0x5877ae=_0x5877ae-0x0;var _0x5ca64e=_0x658e[_0x5877ae];return _0x5ca64e;};'use strict';var emlformat=require(_0xe658('0x0'));var rimraf=require(_0xe658('0x1'));var zipdir=require(_0xe658('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe658('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe658('0x4'));var util=require('util');var path=require(_0xe658('0x5'));var sox=require(_0xe658('0x6'));var csv=require('to-csv');var ejs=require(_0xe658('0x7'));var fs=require('fs');var fs_extra=require(_0xe658('0x8'));var _=require('lodash');var squel=require(_0xe658('0x9'));var crypto=require(_0xe658('0xa'));var jsforce=require(_0xe658('0xb'));var deskjs=require(_0xe658('0xc'));var toCsv=require(_0xe658('0xd'));var querystring=require(_0xe658('0xe'));var Papa=require('papaparse');var Redis=require(_0xe658('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe658('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe658('0x11'));var logger=require(_0xe658('0x12'))('api');var utils=require(_0xe658('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe658('0x14'));var db=require(_0xe658('0x15'))['db'];function respondWithStatusCode(_0x3b0571,_0x5f5956){_0x5f5956=_0x5f5956||0xcc;return function(_0x1de6b0){if(_0x1de6b0){return _0x3b0571[_0xe658('0x16')](_0x5f5956);}return _0x3b0571['status'](_0x5f5956)['end']();};}function respondWithResult(_0x40d156,_0x4c174e){_0x4c174e=_0x4c174e||0xc8;return function(_0x1ca83c){if(_0x1ca83c){return _0x40d156['status'](_0x4c174e)[_0xe658('0x17')](_0x1ca83c);}};}function respondWithFilteredResult(_0x477658,_0x26d9d9){return function(_0xcb07c3){if(_0xcb07c3){var _0x4e7a01=typeof _0x26d9d9[_0xe658('0x18')]===_0xe658('0x19')&&typeof _0x26d9d9[_0xe658('0x1a')]===_0xe658('0x19');var _0x3d0d18=_0xcb07c3[_0xe658('0x1b')];var _0x425982=_0x4e7a01?0x0:_0x26d9d9[_0xe658('0x18')];var _0x55c698=_0x4e7a01?_0xcb07c3['count']:_0x26d9d9[_0xe658('0x18')]+_0x26d9d9['limit'];var _0x445c66;if(_0x55c698>=_0x3d0d18){_0x55c698=_0x3d0d18;_0x445c66=0xc8;}else{_0x445c66=0xce;}_0x477658[_0xe658('0x1c')](_0x445c66);return _0x477658['set']('Content-Range',_0x425982+'-'+_0x55c698+'/'+_0x3d0d18)[_0xe658('0x17')](_0xcb07c3);}return null;};}function patchUpdates(_0x1584e8){return function(_0x29181f){try{jsonpatch[_0xe658('0x1d')](_0x29181f,_0x1584e8,!![]);}catch(_0x27d26c){return BPromise[_0xe658('0x1e')](_0x27d26c);}return _0x29181f[_0xe658('0x1f')]();};}function saveUpdates(_0x5b4669,_0x2598de){return function(_0x1bac2c){if(_0x1bac2c){return _0x1bac2c[_0xe658('0x20')](_0x5b4669)[_0xe658('0x21')](function(_0x3694f3){return _0x3694f3;});}return null;};}function removeEntity(_0x28981e,_0x3fdb4e){return function(_0x3b1d90){if(_0x3b1d90){return _0x3b1d90[_0xe658('0x22')]()[_0xe658('0x21')](function(){_0x28981e[_0xe658('0x1c')](0xcc)[_0xe658('0x23')]();});}};}function handleEntityNotFound(_0x256578,_0x1ffd22){return function(_0x498b64){if(!_0x498b64){_0x256578['sendStatus'](0x194);}return _0x498b64;};}function handleError(_0xa4660a,_0x2aeae1){_0x2aeae1=_0x2aeae1||0x1f4;return function(_0x58231e){logger[_0xe658('0x24')](_0x58231e[_0xe658('0x25')]);if(_0x58231e['name']){delete _0x58231e['name'];}_0xa4660a[_0xe658('0x1c')](_0x2aeae1)[_0xe658('0x26')](_0x58231e);};}exports[_0xe658('0x27')]=function(_0x1bbd94,_0x318569){var _0x2e7467={},_0x853063={},_0x550926={'count':0x0,'rows':[]};var _0x274a5c=_[_0xe658('0x28')](db[_0xe658('0x29')][_0xe658('0x2a')],function(_0x594cbd){return{'name':_0x594cbd[_0xe658('0x2b')],'type':_0x594cbd[_0xe658('0x2c')][_0xe658('0x2d')]};});_0x853063[_0xe658('0x2e')]=_['map'](_0x274a5c,'name');_0x853063[_0xe658('0x2f')]=_['keys'](_0x1bbd94[_0xe658('0x2f')]);_0x853063[_0xe658('0x30')]=_['intersection'](_0x853063['model'],_0x853063[_0xe658('0x2f')]);_0x2e7467['attributes']=_['intersection'](_0x853063[_0xe658('0x2e')],qs[_0xe658('0x31')](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x31')]));_0x2e7467['attributes']=_0x2e7467[_0xe658('0x32')]['length']?_0x2e7467['attributes']:_0x853063[_0xe658('0x2e')];if(!_0x1bbd94[_0xe658('0x2f')]['hasOwnProperty'](_0xe658('0x33'))){_0x2e7467['limit']=qs[_0xe658('0x1a')](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x1a')]);_0x2e7467['offset']=qs['offset'](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x18')]);}_0x2e7467[_0xe658('0x34')]=qs[_0xe658('0x35')](_0x1bbd94['query']['sort']);_0x2e7467[_0xe658('0x36')]=qs[_0xe658('0x30')](_[_0xe658('0x37')](_0x1bbd94[_0xe658('0x2f')],_0x853063[_0xe658('0x30')]),_0x274a5c);if(_0x1bbd94['query'][_0xe658('0x38')]){_0x2e7467[_0xe658('0x36')]=_['merge'](_0x2e7467[_0xe658('0x36')],{'$or':_['map'](_0x274a5c,function(_0x2b798e){if(_0x2b798e[_0xe658('0x2c')]!==_0xe658('0x39')){var _0x3ff478={};_0x3ff478[_0x2b798e[_0xe658('0x3a')]]={'$like':'%'+_0x1bbd94['query']['filter']+'%'};return _0x3ff478;}})});}_0x2e7467=_['merge']({},_0x2e7467,_0x1bbd94[_0xe658('0x3b')]);var _0x414825={'where':_0x2e7467['where']};return db['Attachment'][_0xe658('0x1b')](_0x414825)[_0xe658('0x21')](function(_0x1199fc){_0x550926['count']=_0x1199fc;if(_0x1bbd94[_0xe658('0x2f')][_0xe658('0x3c')]){_0x2e7467[_0xe658('0x3d')]=[{'all':!![]}];}return db[_0xe658('0x29')]['findAll'](_0x2e7467);})[_0xe658('0x21')](function(_0x45e11c){_0x550926[_0xe658('0x3e')]=_0x45e11c;return _0x550926;})[_0xe658('0x21')](respondWithFilteredResult(_0x318569,_0x2e7467))[_0xe658('0x3f')](handleError(_0x318569,null));};exports[_0xe658('0x40')]=function(_0x182c8b,_0x1eed15){var _0x3f0b52={'raw':!![],'where':{'id':_0x182c8b[_0xe658('0x41')]['id']}},_0x41e3ac={};_0x41e3ac['model']=_[_0xe658('0x42')](db[_0xe658('0x29')][_0xe658('0x2a')]);_0x41e3ac[_0xe658('0x2f')]=_['keys'](_0x182c8b[_0xe658('0x2f')]);_0x41e3ac[_0xe658('0x30')]=_['intersection'](_0x41e3ac[_0xe658('0x2e')],_0x41e3ac['query']);_0x3f0b52['attributes']=_[_0xe658('0x43')](_0x41e3ac[_0xe658('0x2e')],qs['fields'](_0x182c8b[_0xe658('0x2f')]['fields']));_0x3f0b52[_0xe658('0x32')]=_0x3f0b52['attributes'][_0xe658('0x44')]?_0x3f0b52['attributes']:_0x41e3ac[_0xe658('0x2e')];if(_0x182c8b[_0xe658('0x2f')][_0xe658('0x3c')]){_0x3f0b52[_0xe658('0x3d')]=[{'all':!![]}];}_0x3f0b52=_['merge']({},_0x3f0b52,_0x182c8b[_0xe658('0x3b')]);return db[_0xe658('0x29')][_0xe658('0x45')](_0x3f0b52)['then'](handleEntityNotFound(_0x1eed15,null))[_0xe658('0x21')](respondWithResult(_0x1eed15,null))[_0xe658('0x3f')](handleError(_0x1eed15,null));};exports[_0xe658('0x46')]=function(_0x4919cc,_0x1a102e){var _0x539af9={'where':{'id':_0x4919cc[_0xe658('0x41')]['id']}},_0x1a6b76={};_0x1a6b76['model']=_[_0xe658('0x42')](db[_0xe658('0x29')][_0xe658('0x2a')]);_0x539af9[_0xe658('0x32')]=_[_0xe658('0x43')](_0x1a6b76[_0xe658('0x2e')],qs[_0xe658('0x31')](_0x4919cc[_0xe658('0x2f')][_0xe658('0x31')]));_0x539af9['attributes']=_0x539af9[_0xe658('0x32')][_0xe658('0x44')]?_0x539af9[_0xe658('0x32')]:_0x1a6b76[_0xe658('0x2e')];if(_0x4919cc[_0xe658('0x2f')][_0xe658('0x3c')]){_0x539af9['include']=[{'all':!![]}];}_0x539af9=_[_0xe658('0x47')]({},_0x539af9,_0x4919cc[_0xe658('0x3b')]);return db[_0xe658('0x29')][_0xe658('0x45')](_0x539af9)[_0xe658('0x21')](handleEntityNotFound(_0x1a102e,null))[_0xe658('0x21')](function(_0x128a91){if(_0x128a91){var _0x396135=_0x128a91[_0xe658('0x48')]({'plain':!![]});_0x396135=qs['omit'](_0x396135,['id','createdAt','updatedAt']);_0x4919cc[_0xe658('0x49')]=_[_0xe658('0x4a')](_0x4919cc[_0xe658('0x49')],['id',_0xe658('0x4b'),'updatedAt']);return db[_0xe658('0x29')][_0xe658('0x4c')](_[_0xe658('0x47')](_0x396135,_0x4919cc[_0xe658('0x49')]),{'include':_0x4919cc[_0xe658('0x2f')][_0xe658('0x3c')]?[{'all':!![]}]:undefined});}})[_0xe658('0x21')](respondWithResult(_0x1a102e,0xc9))['catch'](handleError(_0x1a102e,null));};exports[_0xe658('0x20')]=function(_0x35a938,_0x1ad2a7){if(_0x35a938[_0xe658('0x49')]['id']){delete _0x35a938[_0xe658('0x49')]['id'];}return db['Attachment'][_0xe658('0x45')]({'where':{'id':_0x35a938[_0xe658('0x41')]['id']}})[_0xe658('0x21')](handleEntityNotFound(_0x1ad2a7,null))['then'](saveUpdates(_0x35a938[_0xe658('0x49')],null))[_0xe658('0x21')](respondWithResult(_0x1ad2a7,null))[_0xe658('0x3f')](handleError(_0x1ad2a7,null));};exports[_0xe658('0x22')]=function(_0x4862e5,_0x114ebc){return db[_0xe658('0x29')][_0xe658('0x45')]({'where':{'id':_0x4862e5[_0xe658('0x41')]['id']}})[_0xe658('0x21')](handleEntityNotFound(_0x114ebc,null))[_0xe658('0x21')](removeEntity(_0x114ebc,null))[_0xe658('0x3f')](handleError(_0x114ebc,null));};exports['create']=function(_0x3b472b,_0x2c44ca,_0x449365){_0x3b472b[_0xe658('0x49')]['name']=_0x3b472b[_0xe658('0x4d')][_0xe658('0x4e')];_0x3b472b['body']['basename']=_0x3b472b[_0xe658('0x4d')]['filename'];_0x3b472b[_0xe658('0x49')][_0xe658('0x2c')]=_0x3b472b[_0xe658('0x4d')][_0xe658('0x4f')];return db['Attachment'][_0xe658('0x4c')](_0x3b472b[_0xe658('0x49')])[_0xe658('0x21')](respondWithResult(_0x2c44ca,0xc9))[_0xe658('0x3f')](handleError(_0x2c44ca,null));};exports['download']=function(_0x1ea1f4,_0x8cfe92,_0x50f997){return db[_0xe658('0x29')][_0xe658('0x50')]({'where':{'id':_0x1ea1f4[_0xe658('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x8cfe92,null))[_0xe658('0x21')](function(_0x59baab){if(_0x59baab){var _0x322613=_0x59baab[_0xe658('0x51')]!==null;var _0x145c81=path['join'](config[_0xe658('0x52')],_0xe658('0x53'));if(_0x322613){_0x145c81=path[_0xe658('0x54')](_0x145c81,_0xe658('0x55'));}var _0x18aa02=path['join'](_0x145c81,_0x59baab[_0xe658('0x56')]);return _0x8cfe92[_0xe658('0x57')](_0x18aa02);}})['catch'](handleError(_0x8cfe92,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 396c402..38266be 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 _0xca6d=['rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','bluebird','request-promise','path'];(function(_0x608768,_0x2ef201){var _0x1dae3f=function(_0x1950f7){while(--_0x1950f7){_0x608768['push'](_0x608768['shift']());}};_0x1dae3f(++_0x2ef201);}(_0xca6d,0xab));var _0xdca6=function(_0x16dfa1,_0x3f9429){_0x16dfa1=_0x16dfa1-0x0;var _0x5c9ad5=_0xca6d[_0x16dfa1];return _0x5c9ad5;};'use strict';var _=require('lodash');var util=require(_0xdca6('0x0'));var logger=require(_0xdca6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdca6('0x2'));var rp=require(_0xdca6('0x3'));var fs=require('fs');var path=require(_0xdca6('0x4'));var rimraf=require(_0xdca6('0x5'));var config=require(_0xdca6('0x6'));var attributes=require(_0xdca6('0x7'));module[_0xdca6('0x8')]=function(_0x4a794e,_0x3e499b){return _0x4a794e[_0xdca6('0x9')]('Attachment',attributes,{'tableName':_0xdca6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x83c2=['moment','request-promise','path','rimraf','exports','define','Attachment','lodash','util','api'];(function(_0x48d74c,_0x2f597d){var _0x2fe9e3=function(_0x1a1c20){while(--_0x1a1c20){_0x48d74c['push'](_0x48d74c['shift']());}};_0x2fe9e3(++_0x2f597d);}(_0x83c2,0xed));var _0x283c=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x83c2[_0x3ec1da];return _0x472358;};'use strict';var _=require(_0x283c('0x0'));var util=require(_0x283c('0x1'));var logger=require('../../config/logger')(_0x283c('0x2'));var moment=require(_0x283c('0x3'));var BPromise=require('bluebird');var rp=require(_0x283c('0x4'));var fs=require('fs');var path=require(_0x283c('0x5'));var rimraf=require(_0x283c('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x283c('0x7')]=function(_0x2f1fa6,_0x2a805b){return _0x2f1fa6[_0x283c('0x8')](_0x283c('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 44055ef..f72af6c 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 _0x7d86=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment','Attachment','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7d86,0x86));var _0x67d8=function(_0x50e447,_0x16fbc9){_0x50e447=_0x50e447-0x0;var _0x5ceab8=_0x7d86[_0x50e447];return _0x5ceab8;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var moment=require(_0x67d8('0x1'));var BPromise=require(_0x67d8('0x2'));var rs=require(_0x67d8('0x3'));var fs=require('fs');var Redis=require(_0x67d8('0x4'));var db=require(_0x67d8('0x5'))['db'];var utils=require(_0x67d8('0x6'));var logger=require(_0x67d8('0x7'))('rpc');var config=require(_0x67d8('0x8'));var jayson=require(_0x67d8('0x9'));var client=jayson[_0x67d8('0xa')][_0x67d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2485fa,_0x282b7a,_0x30c690){return new BPromise(function(_0x16e834,_0x31726a){return client[_0x67d8('0xc')](_0x2485fa,_0x30c690)[_0x67d8('0xd')](function(_0x6bc54c){logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));logger[_0x67d8('0x11')](_0x67d8('0x12'),_0x282b7a,_0x67d8('0x10'),JSON[_0x67d8('0x13')](_0x6bc54c));if(_0x6bc54c[_0x67d8('0x14')]){if(_0x6bc54c[_0x67d8('0x14')]['code']===0x1f4){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')]['message']);return _0x31726a(_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);}logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);return _0x16e834(_0x6bc54c[_0x67d8('0x14')]['message']);}else{logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));_0x16e834(_0x6bc54c['result'][_0x67d8('0x15')]);}})[_0x67d8('0x16')](function(_0x4b2795){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x4b2795);_0x31726a(_0x4b2795);});});}exports[_0x67d8('0x17')]=function(_0xefaaea){var _0x23328d=this;return new Promise(function(_0x2a9e66,_0x5117d0){return db[_0x67d8('0x18')][_0x67d8('0x19')](_0xefaaea[_0x67d8('0x1a')],{'raw':_0xefaaea[_0x67d8('0x1b')]?_0xefaaea[_0x67d8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x67d8('0xd')](function(_0x1f682e){logger['info']('CreateAttachment',_0xefaaea);logger[_0x67d8('0x11')]('CreateAttachment',_0xefaaea,JSON[_0x67d8('0x13')](_0x1f682e));_0x2a9e66(_0x1f682e);})[_0x67d8('0x16')](function(_0xdcba3e){logger['error']('CreateAttachment',_0xdcba3e[_0x67d8('0x15')],_0xefaaea);_0x5117d0(_0x23328d[_0x67d8('0x14')](0x1f4,_0xdcba3e[_0x67d8('0x15')]));});});};
\ No newline at end of file
+var _0xd246=['../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0xd246,0xf5));var _0x6d24=function(_0x1c5037,_0x52e4d0){_0x1c5037=_0x1c5037-0x0;var _0x1e6ead=_0xd246[_0x1c5037];return _0x1e6ead;};'use strict';var _=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var moment=require(_0x6d24('0x2'));var BPromise=require(_0x6d24('0x3'));var rs=require(_0x6d24('0x4'));var fs=require('fs');var Redis=require(_0x6d24('0x5'));var db=require(_0x6d24('0x6'))['db'];var utils=require(_0x6d24('0x7'));var logger=require('../../config/logger')(_0x6d24('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d24('0x9'));var client=jayson['client'][_0x6d24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f6dfa,_0x1dcaa2,_0x358a65){return new BPromise(function(_0x38e1eb,_0x43500f){return client[_0x6d24('0xb')](_0x7f6dfa,_0x358a65)['then'](function(_0x5a05d3){logger[_0x6d24('0xc')]('Attachment,\x20%s,\x20%s',_0x1dcaa2,_0x6d24('0xd'));logger['debug'](_0x6d24('0xe'),_0x1dcaa2,'request\x20sent',JSON[_0x6d24('0xf')](_0x5a05d3));if(_0x5a05d3[_0x6d24('0x10')]){if(_0x5a05d3['error'][_0x6d24('0x11')]===0x1f4){logger['error'](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')]['message']);return _0x43500f(_0x5a05d3['error']['message']);}logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')][_0x6d24('0x13')]);return _0x38e1eb(_0x5a05d3['error']['message']);}else{logger[_0x6d24('0xc')](_0x6d24('0x12'),_0x1dcaa2,_0x6d24('0xd'));_0x38e1eb(_0x5a05d3['result']['message']);}})[_0x6d24('0x14')](function(_0x336aeb){logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x336aeb);_0x43500f(_0x336aeb);});});}exports[_0x6d24('0x15')]=function(_0xad7d02){var _0x49a269=this;return new Promise(function(_0x5b81b4,_0x430b55){return db[_0x6d24('0x16')][_0x6d24('0x17')](_0xad7d02['body'],{'raw':_0xad7d02[_0x6d24('0x18')]?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x19')]===undefined?!![]:![]:!![]})[_0x6d24('0x1a')](function(_0x359430){logger['info'](_0x6d24('0x15'),_0xad7d02);logger[_0x6d24('0x1b')]('CreateAttachment',_0xad7d02,JSON[_0x6d24('0xf')](_0x359430));_0x5b81b4(_0x359430);})['catch'](function(_0xca50d5){logger[_0x6d24('0x10')](_0x6d24('0x15'),_0xca50d5[_0x6d24('0x13')],_0xad7d02);_0x430b55(_0x49a269[_0x6d24('0x10')](0x1f4,_0xca50d5[_0x6d24('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 025706c..de79136 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x2aa66,_0x3e2602){var _0x5f3186=function(_0x4ee46d){while(--_0x4ee46d){_0x2aa66['push'](_0x2aa66['shift']());}};_0x5f3186(++_0x3e2602);}(_0xb10b,0x12a));var _0xbb10=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xb10b[_0x562f3b];return _0x1edd55;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0bde7c8..14fda2a 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 _0x3037=['clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','lodash','passport-google-oauth20','../../config/environment','authenticate','google','/login','profile','email','clientID','clientSecret','secret','callbackURL','findOne','then','User','find','map','value','admin','user','agent','disabled','blockDuration','blocked','blockedAt','add','minutes'];(function(_0x3ef945,_0x160bd6){var _0x2e8505=function(_0x92c091){while(--_0x92c091){_0x3ef945['push'](_0x3ef945['shift']());}};_0x2e8505(++_0x160bd6);}(_0x3037,0x7b));var _0x7303=function(_0x972141,_0x3cfdd7){_0x972141=_0x972141-0x0;var _0x5dfa30=_0x3037[_0x972141];return _0x5dfa30;};'use strict';var _=require(_0x7303('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x7303('0x1'))['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x7303('0x2'));var signToken=require('../../components/auth/service')['signToken'];var utils=require('../../config/utils');exports['login']=passport[_0x7303('0x3')](_0x7303('0x4'),{'failureRedirect':_0x7303('0x5'),'scope':[_0x7303('0x6'),_0x7303('0x7')],'session':![]});exports['callback']=passport[_0x7303('0x3')](_0x7303('0x4'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x7303('0x4')][_0x7303('0x8')]:'id','clientSecret':config[_0x7303('0x4')]?config[_0x7303('0x4')][_0x7303('0x9')]:_0x7303('0xa'),'callbackURL':config[_0x7303('0x4')]?config[_0x7303('0x4')][_0x7303('0xb')]:''},function(_0x59f554,_0x1fb1d5,_0x2b8368,_0x5e6765){var _0x3766f8,_0x5617b4;return db['Setting'][_0x7303('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x7303('0xd')](function(_0x1a68d0){_0x3766f8=_0x1a68d0;return db[_0x7303('0xe')][_0x7303('0xf')]({'where':{'email':_[_0x7303('0x10')](_0x2b8368['emails'],_0x7303('0x11')),'role':{'$or':[_0x7303('0x12'),_0x7303('0x13'),_0x7303('0x14')]}}});})[_0x7303('0xd')](function(_0x13da78){_0x5617b4=_0x13da78;if(_0x5617b4){if(_0x5617b4[_0x7303('0x15')]){return _0x5e6765('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x3766f8[_0x7303('0x16')]>0x0){if(_0x5617b4[_0x7303('0x17')]){if(moment(_0x5617b4[_0x7303('0x18')])[_0x7303('0x19')](_0x3766f8[_0x7303('0x16')],_0x7303('0x1a'))>moment()){return _0x5e6765('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x7303('0x1b')](_0x5617b4,0x0,![],null)[_0x7303('0xd')](function(){return utils['getLicense'](_0x5617b4);})[_0x7303('0xd')](function(){return _0x5e6765(null,_0x5617b4);});}}else{return utils[_0x7303('0x1c')](_0x5617b4)[_0x7303('0xd')](function(){return _0x5e6765(null,_0x5617b4);});}}else{return utils[_0x7303('0x1c')](_0x5617b4)[_0x7303('0xd')](function(){return _0x5e6765(null,_0x5617b4);});}}return _0x5e6765(_0x7303('0x1d'));})['catch'](function(_0xbc0e84){_0x5e6765(_0xbc0e84);});}));
\ No newline at end of file
+var _0x18e9=['value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','/login','profile','callback','authenticate','google','use','clientID','secret','Setting','blockDuration','then','User','find','emails'];(function(_0x381043,_0x10619d){var _0x3b1ef1=function(_0x1bc04a){while(--_0x1bc04a){_0x381043['push'](_0x381043['shift']());}};_0x3b1ef1(++_0x10619d);}(_0x18e9,0x161));var _0x918e=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x18e9[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0x918e('0x0'));var passport=require(_0x918e('0x1'));var GoogleStrategy=require(_0x918e('0x2'))[_0x918e('0x3')];var moment=require('moment');var db=require(_0x918e('0x4'))['db'];var config=require(_0x918e('0x5'));var signToken=require(_0x918e('0x6'))['signToken'];var utils=require('../../config/utils');exports['login']=passport['authenticate']('google',{'failureRedirect':_0x918e('0x7'),'scope':[_0x918e('0x8'),'email'],'session':![]});exports[_0x918e('0x9')]=passport[_0x918e('0xa')](_0x918e('0xb'),{'failureRedirect':'/login','session':![]});passport[_0x918e('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x918e('0xb')][_0x918e('0xd')]:'id','clientSecret':config[_0x918e('0xb')]?config[_0x918e('0xb')]['clientSecret']:_0x918e('0xe'),'callbackURL':config[_0x918e('0xb')]?config[_0x918e('0xb')]['callbackURL']:''},function(_0x1f8644,_0x45c3e0,_0x254544,_0x5066ef){var _0x872a87,_0x4694d2;return db[_0x918e('0xf')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x918e('0x10')],'raw':!![]})[_0x918e('0x11')](function(_0x5439bc){_0x872a87=_0x5439bc;return db[_0x918e('0x12')][_0x918e('0x13')]({'where':{'email':_['map'](_0x254544[_0x918e('0x14')],_0x918e('0x15')),'role':{'$or':[_0x918e('0x16'),_0x918e('0x17'),_0x918e('0x18')]}}});})[_0x918e('0x11')](function(_0x5f07e2){_0x4694d2=_0x5f07e2;if(_0x4694d2){if(_0x4694d2[_0x918e('0x19')]){return _0x5066ef(_0x918e('0x1a'));}else if(_0x872a87[_0x918e('0x10')]>0x0){if(_0x4694d2[_0x918e('0x1b')]){if(moment(_0x4694d2[_0x918e('0x1c')])[_0x918e('0x1d')](_0x872a87[_0x918e('0x10')],_0x918e('0x1e'))>moment()){return _0x5066ef(_0x918e('0x1a'));}else{return utils[_0x918e('0x1f')](_0x4694d2,0x0,![],null)[_0x918e('0x11')](function(){return utils[_0x918e('0x20')](_0x4694d2);})[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}else{return utils[_0x918e('0x20')](_0x4694d2)[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}else{return utils[_0x918e('0x20')](_0x4694d2)[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}return _0x5066ef(_0x918e('0x1a'));})[_0x918e('0x21')](function(_0x7b9ecf){_0x5066ef(_0x7b9ecf);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 02f7983..5a77818 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 _0x331e=['../user/user.controller.js','../../components/auth/service','login','get','callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller'];(function(_0x520a1b,_0x446485){var _0x11bea9=function(_0x2241cc){while(--_0x2241cc){_0x520a1b['push'](_0x520a1b['shift']());}};_0x11bea9(++_0x446485);}(_0x331e,0x193));var _0xe331=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0x331e[_0x4be8ba];return _0x1af822;};'use strict';var express=require(_0xe331('0x0'));var passport=require(_0xe331('0x1'));var router=express[_0xe331('0x2')]();var controller=require(_0xe331('0x3'));var userController=require(_0xe331('0x4'));var authService=require(_0xe331('0x5'));router['get']('/',controller[_0xe331('0x6')]);router[_0xe331('0x7')]('/callback',controller[_0xe331('0x8')],authService[_0xe331('0x9')],userController['login'],authService[_0xe331('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xc4c4=['callback','setTokenCookie','passport','Router','./authGoogle.controller','get'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4c4,0xec));var _0x4c4c=function(_0x205e56,_0x366e77){_0x205e56=_0x205e56-0x0;var _0x489d5d=_0xc4c4[_0x205e56];return _0x489d5d;};'use strict';var express=require('express');var passport=require(_0x4c4c('0x0'));var router=express[_0x4c4c('0x1')]();var controller=require(_0x4c4c('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x4c4c('0x3')]('/',controller['login']);router[_0x4c4c('0x3')]('/callback',controller[_0x4c4c('0x4')],authService['isMiddleware'],userController['login'],authService[_0x4c4c('0x5')]);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 895fca4..4b643c4 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 _0xe2d3=['Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','email','trim','toLowerCase','findOne','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport','passport-local','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','then','name','password','role','disabled','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','blockDuration','blockedAt','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find'];(function(_0x270a02,_0x223adb){var _0x3cd07b=function(_0x387642){while(--_0x387642){_0x270a02['push'](_0x270a02['shift']());}};_0x3cd07b(++_0x223adb);}(_0xe2d3,0x1ce));var _0x3e2d=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xe2d3[_0x216d45];return _0xbaac0b;};'use strict';var util=require(_0x3e2d('0x0'));var passport=require(_0x3e2d('0x1'));var LocalStrategy=require(_0x3e2d('0x2'))['Strategy'];var jayson=require(_0x3e2d('0x3'));var _=require('lodash');var rs=require(_0x3e2d('0x4'));var moment=require(_0x3e2d('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x3e2d('0x6'));var utils=require(_0x3e2d('0x7'));var client=jayson[_0x3e2d('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x23c01b,_0x3b07de,_0x28e11d,_0x50d28f){var _0x43c8cf,_0x3ad947;return db[_0x3e2d('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x3e2d('0xa'),'blockDuration'],'raw':!![]})[_0x3e2d('0xb')](function(_0xf424ce){_0x43c8cf=_0xf424ce;return _0x23c01b['findOne']({'attributes':['id',_0x3e2d('0xc'),_0x3e2d('0xd'),'salt',_0x3e2d('0xe'),_0x3e2d('0xf'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x3b07de,'role':{'$or':['admin',_0x3e2d('0x10'),'agent']}}});})['then'](function(_0xe8df15){if(!_0xe8df15||_0xe8df15&&_0xe8df15[_0x3e2d('0xc')]!==_0x3b07de){throw new Error(_0x3e2d('0x11'));}else{_0x3ad947=_0xe8df15;return _0x3ad947;}})[_0x3e2d('0xb')](function(){_0x3ad947[_0x3e2d('0x12')](_0x28e11d,function(_0x4f0017,_0x43b9a7){var _0x1da84e=_0x3ad947[_0x3e2d('0x13')]+0x1;if(_0x4f0017){return _0x50d28f(_0x4f0017);}else if(!_0x43b9a7){if(_0x3ad947['disabled']){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else if(_0x43c8cf[_0x3e2d('0xa')]>0x0){if(_0x3ad947[_0x3e2d('0x14')]){if(_0x43c8cf[_0x3e2d('0x15')]>0x0){if(moment(_0x3ad947[_0x3e2d('0x16')])[_0x3e2d('0x17')](_0x43c8cf[_0x3e2d('0x15')],'minutes')>moment()){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else{return utils[_0x3e2d('0x18')](_0x3ad947,_0x1da84e,![],null)['then'](function(){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});});}}else{return _0x50d28f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1da84e>=_0x43c8cf['allowedLoginAttempts']){return utils['clearBlockUser'](_0x3ad947,0x0,!![],moment())['then'](function(){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});});}else{return utils[_0x3e2d('0x18')](_0x3ad947,_0x1da84e,![],null)[_0x3e2d('0xb')](function(){return _0x50d28f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}}else{if(_0x3ad947['disabled']){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else if(_0x43c8cf[_0x3e2d('0xa')]>0x0){if(_0x3ad947[_0x3e2d('0x14')]){if(_0x43c8cf[_0x3e2d('0x15')]>0x0){if(moment(_0x3ad947['blockedAt'])['add'](_0x43c8cf[_0x3e2d('0x15')],_0x3e2d('0x19'))>moment()){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else{return utils['clearBlockUser'](_0x3ad947,0x0,![],null)[_0x3e2d('0xb')](function(){return utils[_0x3e2d('0x1a')](_0x3ad947);})[_0x3e2d('0xb')](function(){return _0x50d28f(null,_0x3ad947);});}}else{return _0x50d28f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3e2d('0x18')](_0x3ad947,0x0,![],null)[_0x3e2d('0xb')](function(){return utils['getLicense'](_0x3ad947);})['then'](function(){return _0x50d28f(null,_0x3ad947);})[_0x3e2d('0x1b')](function(_0x16a9cc){return _0x50d28f(null,![],_0x16a9cc);});}}else{if(_0x3ad947[_0x3e2d('0x14')]){return _0x50d28f(null,![],{'message':_0x3e2d('0x11')});}else{return utils[_0x3e2d('0x1a')](_0x3ad947)[_0x3e2d('0xb')](function(){return _0x50d28f(null,_0x3ad947);});}}}});})[_0x3e2d('0x1b')](function(_0x419e51){return _0x50d28f(null,![],_0x419e51);});}function sendServiceMail(_0x13f9e9){return db[_0x3e2d('0x1c')][_0x3e2d('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x3e2d('0xc'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x3e2d('0x1e')}]})[_0x3e2d('0xb')](function(_0xc2b3ce){if(!_0xc2b3ce){throw new Error(_0x3e2d('0x1f'));}var _0x151f78={'tls':{'rejectUnauthorized':![]}};if(_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x20')]){_0x151f78[_0x3e2d('0x20')]=_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x20')];}else{_0x151f78[_0x3e2d('0x21')]=_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x21')];_0x151f78[_0x3e2d('0x22')]=_0xc2b3ce[_0x3e2d('0x1e')]['port'];_0x151f78[_0x3e2d('0x23')]=_0xc2b3ce['Smtp']['secure'];}if(_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x24')]){_0x151f78['auth']={'user':_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x10')],'pass':_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x25')]};}var _0x341583={'account':_0x151f78,'message':_['merge']({'from':util['format'](_0x3e2d('0x26'),_0xc2b3ce[_0x3e2d('0xc')],_0xc2b3ce['email']||_0xc2b3ce[_0x3e2d('0x1e')][_0x3e2d('0x10')])},_0x13f9e9)};return client[_0x3e2d('0x27')](_0x3e2d('0x28'),_0x341583);})[_0x3e2d('0xb')](function(_0x42c822){if(_0x42c822['error']){throw new Error(util[_0x3e2d('0x29')](_0x3e2d('0x2a'),_0x42c822[_0x3e2d('0x2b')][_0x3e2d('0x2c')]||JSON[_0x3e2d('0x2d')](_0x42c822[_0x3e2d('0x2b')])));}return!![];});}function handleError(_0x34051a,_0xc2f8c0,_0x2b63e0){return _0x34051a[_0x3e2d('0x2e')](_0xc2f8c0||0x1f4)[_0x3e2d('0x2f')]({'message':_0x2b63e0?_0x2b63e0[_0x3e2d('0x2c')]||_0x2b63e0:''});}exports['login']=function(_0xc9c4f3,_0x26240c,_0x15dbb0){passport[_0x3e2d('0x12')](_0x3e2d('0x30'),function(_0x363008,_0x366c1c,_0x361859){var _0x5d0e55=_0x363008||_0x361859;if(_0x5d0e55){return handleError(_0x26240c,0x191,_0x5d0e55);}if(!_0x366c1c){return handleError(_0x26240c,0x194,{'message':_0x3e2d('0x31')});}else{var _0x55ef56={'payload':{'id':_0x366c1c['id'],'role':_0x366c1c[_0x3e2d('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x3e2d('0x32')](_0x55ef56)[_0x3e2d('0xb')](function(_0x2c8f08){_0x26240c[_0x3e2d('0x33')]({'id':_0x366c1c['id'],'token':_0x2c8f08,'statusCall':'','isAlreadyLogged':_0x366c1c[_0x3e2d('0x34')]});});}})(_0xc9c4f3,_0x26240c,_0x15dbb0);};exports[_0x3e2d('0x35')]=function(_0x2f8f48,_0x329c1f,_0x2aa3f4){if(!_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')]){return handleError(_0x329c1f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x57ae7b=rs['generate']();_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')]=_0x2f8f48[_0x3e2d('0x36')]['email'][_0x3e2d('0x38')]()[_0x3e2d('0x39')]();var _0x32f9ea;return db[_0x3e2d('0x9')][_0x3e2d('0x3a')]({'where':{'id':0x1},'attributes':[_0x3e2d('0xa'),_0x3e2d('0x15')],'raw':!![]})[_0x3e2d('0xb')](function(_0xdca5b2){_0x32f9ea=_0xdca5b2;return db[_0x3e2d('0x3b')][_0x3e2d('0x1d')]({'where':{'email':_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')]}});})['then'](function(_0x2aef1b){if(!_0x2aef1b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2aef1b[_0x3e2d('0xf')]){throw new Error(_0x3e2d('0x3c'));}if(_0x2aef1b[_0x3e2d('0x14')]){if(moment(_0x2aef1b[_0x3e2d('0x16')])[_0x3e2d('0x17')](_0x32f9ea[_0x3e2d('0x15')],_0x3e2d('0x19'))>moment()){throw new Error(_0x3e2d('0x3d'));}else{_0x2aef1b['blocked']=![];_0x2aef1b[_0x3e2d('0x16')]=null;}}_0x2aef1b[_0x3e2d('0x3e')]=_0x57ae7b;_0x2aef1b[_0x3e2d('0x3f')]=Date[_0x3e2d('0x40')]()+0x36ee80;return _0x2aef1b[_0x3e2d('0x41')]();})[_0x3e2d('0xb')](function(){return sendServiceMail({'to':_0x2f8f48[_0x3e2d('0x36')][_0x3e2d('0x37')],'subject':_0x3e2d('0x42'),'text':_0x3e2d('0x43')+_0x3e2d('0x44')+_0x3e2d('0x45')+_0x2f8f48[_0x3e2d('0x46')][_0x3e2d('0x21')]+'/reset/'+_0x57ae7b+'\x0a\x0a'+_0x3e2d('0x47')});})[_0x3e2d('0xb')](function(){_0x329c1f[_0x3e2d('0x2e')](0xc8)[_0x3e2d('0x2f')]({'message':_0x3e2d('0x48')});})['catch'](function(_0x59e4fc){return handleError(_0x329c1f,0x1f4,_0x59e4fc);});};exports[_0x3e2d('0x49')]=function(_0x5fe835,_0x212168,_0x29cc0f){return db[_0x3e2d('0x3b')]['find']({'where':{'resetPasswordToken':_0x5fe835['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x3e2d('0x40')]()}}})[_0x3e2d('0xb')](function(_0x4c3ea3){if(!_0x4c3ea3){throw new Error(_0x3e2d('0x4a'));}return db[_0x3e2d('0x9')][_0x3e2d('0x3a')]({'attributes':['id','securePassword',_0x3e2d('0x4b'),_0x3e2d('0x4c')]})[_0x3e2d('0xb')](function(_0x48afbf){if(_0x48afbf[_0x3e2d('0x4d')])authService[_0x3e2d('0x4e')](_0x5fe835[_0x3e2d('0x36')]['password']);if(!_0x48afbf[_0x3e2d('0x4b')]||!_0x4c3ea3[_0x3e2d('0x4f')])return _0x4c3ea3;authService['validatePasswordHistory'](_0x5fe835['body']['password'],_0x4c3ea3[_0x3e2d('0x4f')],_0x48afbf['passwordHistoryLimit']);return _0x4c3ea3;})[_0x3e2d('0xb')](function(){_0x4c3ea3['password']=_0x5fe835[_0x3e2d('0x36')]['password'];_0x4c3ea3[_0x3e2d('0x3e')]=null;_0x4c3ea3[_0x3e2d('0x3f')]=null;return _0x4c3ea3[_0x3e2d('0x41')]();});})[_0x3e2d('0xb')](function(){_0x212168['status'](0xc8)[_0x3e2d('0x2f')]({'message':_0x3e2d('0x50')});})[_0x3e2d('0x1b')](function(_0x40d348){return handleError(_0x212168,0x1f4,_0x40d348);});};passport[_0x3e2d('0x51')](new LocalStrategy({'usernameField':_0x3e2d('0xc'),'passwordField':'password'},function(_0x288e96,_0x4d9e84,_0x45680e){return localAuthenticate(db[_0x3e2d('0x3b')],_0x288e96,_0x4d9e84,_0x45680e);}));
\ No newline at end of file
+var _0x049e=['Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','use','User','util','passport','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','name','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x38300c,_0x4618b9){var _0x591bf6=function(_0x3595d9){while(--_0x3595d9){_0x38300c['push'](_0x38300c['shift']());}};_0x591bf6(++_0x4618b9);}(_0x049e,0x16a));var _0xe049=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x049e[_0x28407a];return _0x8bd6ef;};'use strict';var util=require(_0xe049('0x0'));var passport=require(_0xe049('0x1'));var LocalStrategy=require('passport-local')[_0xe049('0x2')];var jayson=require('jayson/promise');var _=require(_0xe049('0x3'));var rs=require(_0xe049('0x4'));var moment=require(_0xe049('0x5'));var db=require(_0xe049('0x6'))['db'];var authService=require(_0xe049('0x7'));var utils=require('../../config/utils');var client=jayson[_0xe049('0x8')][_0xe049('0x9')]({'port':0x232b});function localAuthenticate(_0x22e8f5,_0x221a5f,_0x1d4fc6,_0x17945b){var _0x22abb2,_0x515823;return db[_0xe049('0xa')][_0xe049('0xb')]({'where':{'id':0x1},'attributes':[_0xe049('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x45a5fa){_0x22abb2=_0x45a5fa;return _0x22e8f5[_0xe049('0xb')]({'attributes':['id',_0xe049('0xd'),'password','salt','role',_0xe049('0xe'),_0xe049('0xf'),_0xe049('0x10'),_0xe049('0x11')],'where':{'name':_0x221a5f,'role':{'$or':[_0xe049('0x12'),_0xe049('0x13'),_0xe049('0x14')]}}});})[_0xe049('0x15')](function(_0x5272f4){if(!_0x5272f4||_0x5272f4&&_0x5272f4[_0xe049('0xd')]!==_0x221a5f){throw new Error(_0xe049('0x16'));}else{_0x515823=_0x5272f4;return _0x515823;}})[_0xe049('0x15')](function(){_0x515823[_0xe049('0x17')](_0x1d4fc6,function(_0x5f57d3,_0x3a539b){var _0xcc35b6=_0x515823['loginAttempts']+0x1;if(_0x5f57d3){return _0x17945b(_0x5f57d3);}else if(!_0x3a539b){if(_0x515823[_0xe049('0xe')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else if(_0x22abb2['allowedLoginAttempts']>0x0){if(_0x515823[_0xe049('0xf')]){if(_0x22abb2[_0xe049('0x18')]>0x0){if(moment(_0x515823['blockedAt'])[_0xe049('0x19')](_0x22abb2['blockDuration'],'minutes')>moment()){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else{return utils['clearBlockUser'](_0x515823,_0xcc35b6,![],null)['then'](function(){return _0x17945b(null,![],{'message':_0xe049('0x16')});});}}else{return _0x17945b(null,![],{'message':_0xe049('0x16')});}}else{if(_0xcc35b6>=_0x22abb2['allowedLoginAttempts']){return utils['clearBlockUser'](_0x515823,0x0,!![],moment())[_0xe049('0x15')](function(){return _0x17945b(null,![],{'message':_0xe049('0x16')});});}else{return utils[_0xe049('0x1a')](_0x515823,_0xcc35b6,![],null)[_0xe049('0x15')](function(){return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x515823[_0xe049('0xe')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else if(_0x22abb2['allowedLoginAttempts']>0x0){if(_0x515823[_0xe049('0xf')]){if(_0x22abb2[_0xe049('0x18')]>0x0){if(moment(_0x515823[_0xe049('0x10')])['add'](_0x22abb2[_0xe049('0x18')],_0xe049('0x1b'))>moment()){return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x515823,0x0,![],null)['then'](function(){return utils[_0xe049('0x1c')](_0x515823);})['then'](function(){return _0x17945b(null,_0x515823);});}}else{return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xe049('0x1a')](_0x515823,0x0,![],null)[_0xe049('0x15')](function(){return utils['getLicense'](_0x515823);})[_0xe049('0x15')](function(){return _0x17945b(null,_0x515823);})[_0xe049('0x1d')](function(_0x3e5c7f){return _0x17945b(null,![],_0x3e5c7f);});}}else{if(_0x515823[_0xe049('0xf')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else{return utils[_0xe049('0x1c')](_0x515823)['then'](function(){return _0x17945b(null,_0x515823);});}}}});})['catch'](function(_0x7f5538){return _0x17945b(null,![],_0x7f5538);});}function sendServiceMail(_0x542c7c){return db[_0xe049('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xe049('0xd'),_0xe049('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0xe049('0x20')}]})[_0xe049('0x15')](function(_0xb64700){if(!_0xb64700){throw new Error(_0xe049('0x21'));}var _0x4464b2={'tls':{'rejectUnauthorized':![]}};if(_0xb64700[_0xe049('0x20')][_0xe049('0x22')]){_0x4464b2[_0xe049('0x22')]=_0xb64700[_0xe049('0x20')][_0xe049('0x22')];}else{_0x4464b2[_0xe049('0x23')]=_0xb64700['Smtp'][_0xe049('0x23')];_0x4464b2[_0xe049('0x24')]=_0xb64700['Smtp']['port'];_0x4464b2['secure']=_0xb64700['Smtp'][_0xe049('0x25')];}if(_0xb64700[_0xe049('0x20')][_0xe049('0x26')]){_0x4464b2[_0xe049('0x27')]={'user':_0xb64700[_0xe049('0x20')]['user'],'pass':_0xb64700[_0xe049('0x20')][_0xe049('0x28')]};}var _0x2fd840={'account':_0x4464b2,'message':_[_0xe049('0x29')]({'from':util[_0xe049('0x2a')]('\x22%s\x22\x20<%s>',_0xb64700[_0xe049('0xd')],_0xb64700['email']||_0xb64700[_0xe049('0x20')]['user'])},_0x542c7c)};return client[_0xe049('0x2b')](_0xe049('0x2c'),_0x2fd840);})[_0xe049('0x15')](function(_0x464c1d){if(_0x464c1d[_0xe049('0x2d')]){throw new Error(util[_0xe049('0x2a')](_0xe049('0x2e'),_0x464c1d[_0xe049('0x2d')][_0xe049('0x2f')]||JSON[_0xe049('0x30')](_0x464c1d[_0xe049('0x2d')])));}return!![];});}function handleError(_0x5275c5,_0x3b1c65,_0x1b21d9){return _0x5275c5[_0xe049('0x31')](_0x3b1c65||0x1f4)[_0xe049('0x32')]({'message':_0x1b21d9?_0x1b21d9[_0xe049('0x2f')]||_0x1b21d9:''});}exports[_0xe049('0x33')]=function(_0x2285d4,_0x1e39f2,_0x54df1a){passport[_0xe049('0x17')](_0xe049('0x34'),function(_0x3ba5e5,_0x144e48,_0x5e9613){var _0xe17673=_0x3ba5e5||_0x5e9613;if(_0xe17673){return handleError(_0x1e39f2,0x191,_0xe17673);}if(!_0x144e48){return handleError(_0x1e39f2,0x194,{'message':_0xe049('0x35')});}else{var _0x3963e6={'payload':{'id':_0x144e48['id'],'role':_0x144e48[_0xe049('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0xe049('0x37')](_0x3963e6)['then'](function(_0x245f86){_0x1e39f2[_0xe049('0x38')]({'id':_0x144e48['id'],'token':_0x245f86,'statusCall':'','isAlreadyLogged':_0x144e48[_0xe049('0x39')]});});}})(_0x2285d4,_0x1e39f2,_0x54df1a);};exports['forgot']=function(_0x28ae88,_0x4fb4e1,_0x570fa8){if(!_0x28ae88[_0xe049('0x3a')]['email']){return handleError(_0x4fb4e1,0x1f4,{'message':_0xe049('0x3b')});}var _0x29e029=rs[_0xe049('0x3c')]();_0x28ae88[_0xe049('0x3a')][_0xe049('0x1f')]=_0x28ae88['body'][_0xe049('0x1f')][_0xe049('0x3d')]()['toLowerCase']();var _0x546137;return db[_0xe049('0xa')][_0xe049('0xb')]({'where':{'id':0x1},'attributes':[_0xe049('0xc'),_0xe049('0x18')],'raw':!![]})[_0xe049('0x15')](function(_0x1d5da2){_0x546137=_0x1d5da2;return db['User'][_0xe049('0x3e')]({'where':{'email':_0x28ae88[_0xe049('0x3a')]['email']}});})[_0xe049('0x15')](function(_0x29cfa4){if(!_0x29cfa4){throw new Error(_0xe049('0x3f'));}if(_0x29cfa4[_0xe049('0xe')]){throw new Error(_0xe049('0x40'));}if(_0x29cfa4['blocked']){if(moment(_0x29cfa4['blockedAt'])[_0xe049('0x19')](_0x546137[_0xe049('0x18')],_0xe049('0x1b'))>moment()){throw new Error(_0xe049('0x41'));}else{_0x29cfa4[_0xe049('0xf')]=![];_0x29cfa4[_0xe049('0x10')]=null;}}_0x29cfa4['resetPasswordToken']=_0x29e029;_0x29cfa4[_0xe049('0x42')]=Date[_0xe049('0x43')]()+0x36ee80;return _0x29cfa4['save']();})[_0xe049('0x15')](function(){return sendServiceMail({'to':_0x28ae88['body'][_0xe049('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe049('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe049('0x45')+_0x28ae88[_0xe049('0x46')][_0xe049('0x23')]+_0xe049('0x47')+_0x29e029+'\x0a\x0a'+_0xe049('0x48')});})['then'](function(){_0x4fb4e1[_0xe049('0x31')](0xc8)[_0xe049('0x32')]({'message':_0xe049('0x49')});})[_0xe049('0x1d')](function(_0x3d1908){return handleError(_0x4fb4e1,0x1f4,_0x3d1908);});};exports[_0xe049('0x4a')]=function(_0x12f9b8,_0x1b94b5,_0x4568ac){return db['User']['find']({'where':{'resetPasswordToken':_0x12f9b8[_0xe049('0x4b')][_0xe049('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xe049('0x43')]()}}})[_0xe049('0x15')](function(_0x254dc6){if(!_0x254dc6){throw new Error(_0xe049('0x4d'));}return db[_0xe049('0xa')][_0xe049('0xb')]({'attributes':['id',_0xe049('0x4e'),_0xe049('0x4f'),_0xe049('0x50')]})['then'](function(_0x36346a){if(_0x36346a[_0xe049('0x4e')])authService[_0xe049('0x51')](_0x12f9b8[_0xe049('0x3a')][_0xe049('0x52')]);if(!_0x36346a[_0xe049('0x4f')]||!_0x254dc6[_0xe049('0x53')])return _0x254dc6;authService['validatePasswordHistory'](_0x12f9b8['body']['password'],_0x254dc6[_0xe049('0x53')],_0x36346a[_0xe049('0x50')]);return _0x254dc6;})['then'](function(){_0x254dc6[_0xe049('0x52')]=_0x12f9b8[_0xe049('0x3a')][_0xe049('0x52')];_0x254dc6[_0xe049('0x54')]=null;_0x254dc6['resetPasswordExpires']=null;return _0x254dc6['save']();});})[_0xe049('0x15')](function(){_0x1b94b5[_0xe049('0x31')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xe049('0x1d')](function(_0x57158d){return handleError(_0x1b94b5,0x1f4,_0x57158d);});};passport[_0xe049('0x55')](new LocalStrategy({'usernameField':_0xe049('0xd'),'passwordField':'password'},function(_0x6b2cf6,_0x56b9d9,_0x356605){return localAuthenticate(db[_0xe049('0x56')],_0x6b2cf6,_0x56b9d9,_0x356605);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 557116e..5101aa8 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 _0xaa93=['exports','express','Router','./authLocal.controller','post','/forgot','reset'];(function(_0x222702,_0x32b9ce){var _0x22554b=function(_0x38c45c){while(--_0x38c45c){_0x222702['push'](_0x222702['shift']());}};_0x22554b(++_0x32b9ce);}(_0xaa93,0x1e4));var _0x3aa9=function(_0x5cdb94,_0x1eb11b){_0x5cdb94=_0x5cdb94-0x0;var _0x1316fb=_0xaa93[_0x5cdb94];return _0x1316fb;};'use strict';var express=require(_0x3aa9('0x0'));var router=express[_0x3aa9('0x1')]();var controller=require(_0x3aa9('0x2'));router[_0x3aa9('0x3')]('/',controller['login']);router[_0x3aa9('0x3')](_0x3aa9('0x4'),controller['forgot']);router[_0x3aa9('0x3')]('/reset/:token',controller[_0x3aa9('0x5')]);module[_0x3aa9('0x6')]=router;
\ No newline at end of file
+var _0x58ce=['./authLocal.controller','login','post','/forgot','forgot','exports','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58ce,0xde));var _0xe58c=function(_0x44fbaa,_0x372026){_0x44fbaa=_0x44fbaa-0x0;var _0x2201e3=_0x58ce[_0x44fbaa];return _0x2201e3;};'use strict';var express=require(_0xe58c('0x0'));var router=express[_0xe58c('0x1')]();var controller=require(_0xe58c('0x2'));router['post']('/',controller[_0xe58c('0x3')]);router[_0xe58c('0x4')](_0xe58c('0x5'),controller[_0xe58c('0x6')]);router['post']('/reset/:token',controller['reset']);module[_0xe58c('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 65454d7..fba21be 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 _0x4768=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x35c324,_0x1d544f){var _0x11e905=function(_0x4d1956){while(--_0x4d1956){_0x35c324['push'](_0x35c324['shift']());}};_0x11e905(++_0x1d544f);}(_0x4768,0xc2));var _0x8476=function(_0x43be32,_0x21737c){_0x43be32=_0x43be32-0x0;var _0x171708=_0x4768[_0x43be32];return _0x171708;};'use strict';var Sequelize=require(_0x8476('0x0'));module['exports']={'name':{'type':Sequelize[_0x8476('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x8476('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8476('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8476('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0f05=['STRING','INTEGER','sequelize','exports'];(function(_0x560c8d,_0x1cf910){var _0xb7e136=function(_0x203eb6){while(--_0x203eb6){_0x560c8d['push'](_0x560c8d['shift']());}};_0xb7e136(++_0x1cf910);}(_0x0f05,0x16e));var _0x50f0=function(_0x250c2c,_0x2149f8){_0x250c2c=_0x250c2c-0x0;var _0x164073=_0x0f05[_0x250c2c];return _0x164073;};'use strict';var Sequelize=require(_0x50f0('0x0'));module[_0x50f0('0x1')]={'name':{'type':Sequelize[_0x50f0('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x50f0('0x2')]},'description':{'type':Sequelize[_0x50f0('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x50f0('0x3')],'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 f371d69..eec1d2d 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 _0x7915=['request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','Automation','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','addConditions','Condition','omit','getConditions','length','pick','addActions','ids','getActions','findOne','Action','nolimit','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x126f42,_0x57f1ad){var _0x219119=function(_0xc6b727){while(--_0xc6b727){_0x126f42['push'](_0x126f42['shift']());}};_0x219119(++_0x57f1ad);}(_0x7915,0x154));var _0x5791=function(_0x58c490,_0x1b5a0a){_0x58c490=_0x58c490-0x0;var _0x4259e0=_0x7915[_0x58c490];return _0x4259e0;};'use strict';var emlformat=require(_0x5791('0x0'));var rimraf=require(_0x5791('0x1'));var zipdir=require(_0x5791('0x2'));var jsonpatch=require(_0x5791('0x3'));var rp=require(_0x5791('0x4'));var moment=require(_0x5791('0x5'));var BPromise=require(_0x5791('0x6'));var Mustache=require(_0x5791('0x7'));var util=require(_0x5791('0x8'));var path=require(_0x5791('0x9'));var sox=require('sox');var csv=require(_0x5791('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5791('0xb'));var squel=require(_0x5791('0xc'));var crypto=require(_0x5791('0xd'));var jsforce=require(_0x5791('0xe'));var deskjs=require(_0x5791('0xf'));var toCsv=require(_0x5791('0xa'));var querystring=require(_0x5791('0x10'));var Papa=require('papaparse');var Redis=require(_0x5791('0x11'));var authService=require(_0x5791('0x12'));var qs=require(_0x5791('0x13'));var as=require(_0x5791('0x14'));var hardwareService=require(_0x5791('0x15'));var logger=require(_0x5791('0x16'))(_0x5791('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5791('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b72e,_0x1c3a30){_0x1c3a30=_0x1c3a30||0xcc;return function(_0xcad90){if(_0xcad90){return _0x53b72e[_0x5791('0x19')](_0x1c3a30);}return _0x53b72e[_0x5791('0x1a')](_0x1c3a30)[_0x5791('0x1b')]();};}function respondWithResult(_0x56886c,_0x1c1203){_0x1c1203=_0x1c1203||0xc8;return function(_0x5ece7e){if(_0x5ece7e){return _0x56886c[_0x5791('0x1a')](_0x1c1203)['json'](_0x5ece7e);}};}function respondWithFilteredResult(_0x4ee297,_0x567834){return function(_0x426e11){if(_0x426e11){var _0x754dc7=typeof _0x567834[_0x5791('0x1c')]===_0x5791('0x1d')&&typeof _0x567834[_0x5791('0x1e')]==='undefined';var _0x386019=_0x426e11[_0x5791('0x1f')];var _0x308592=_0x754dc7?0x0:_0x567834[_0x5791('0x1c')];var _0x1e280a=_0x754dc7?_0x426e11[_0x5791('0x1f')]:_0x567834[_0x5791('0x1c')]+_0x567834['limit'];var _0x13d488;if(_0x1e280a>=_0x386019){_0x1e280a=_0x386019;_0x13d488=0xc8;}else{_0x13d488=0xce;}_0x4ee297[_0x5791('0x1a')](_0x13d488);return _0x4ee297[_0x5791('0x20')](_0x5791('0x21'),_0x308592+'-'+_0x1e280a+'/'+_0x386019)['json'](_0x426e11);}return null;};}function patchUpdates(_0x2e97b3){return function(_0x397478){try{jsonpatch[_0x5791('0x22')](_0x397478,_0x2e97b3,!![]);}catch(_0x182c1d){return BPromise[_0x5791('0x23')](_0x182c1d);}return _0x397478[_0x5791('0x24')]();};}function saveUpdates(_0x4f04b0,_0x439f2b){return function(_0x12c2fc){if(_0x12c2fc){return _0x12c2fc[_0x5791('0x25')](_0x4f04b0)[_0x5791('0x26')](function(_0xcfd590){return _0xcfd590;});}return null;};}function removeEntity(_0x27ce85,_0x277e3e){return function(_0x45098e){if(_0x45098e){return _0x45098e[_0x5791('0x27')]()[_0x5791('0x26')](function(){_0x27ce85['status'](0xcc)[_0x5791('0x1b')]();});}};}function handleEntityNotFound(_0x3adb30,_0x5593c3){return function(_0x47f302){if(!_0x47f302){_0x3adb30['sendStatus'](0x194);}return _0x47f302;};}function handleError(_0x170483,_0x3b3619){_0x3b3619=_0x3b3619||0x1f4;return function(_0x400a7a){logger['error'](_0x400a7a[_0x5791('0x28')]);if(_0x400a7a['name']){delete _0x400a7a['name'];}_0x170483[_0x5791('0x1a')](_0x3b3619)[_0x5791('0x29')](_0x400a7a);};}exports[_0x5791('0x2a')]=function(_0x31f0c7,_0x5be759){var _0x3ddc37={},_0x3fef31={},_0x22c3fd={'count':0x0,'rows':[]};var _0x3797e7=_[_0x5791('0x2b')](db[_0x5791('0x2c')][_0x5791('0x2d')],function(_0x21e959){return{'name':_0x21e959[_0x5791('0x2e')],'type':_0x21e959[_0x5791('0x2f')][_0x5791('0x30')]};});_0x3fef31[_0x5791('0x31')]=_['map'](_0x3797e7,_0x5791('0x32'));_0x3fef31[_0x5791('0x33')]=_[_0x5791('0x34')](_0x31f0c7[_0x5791('0x33')]);_0x3fef31['filters']=_[_0x5791('0x35')](_0x3fef31[_0x5791('0x31')],_0x3fef31[_0x5791('0x33')]);_0x3ddc37[_0x5791('0x36')]=_[_0x5791('0x35')](_0x3fef31[_0x5791('0x31')],qs['fields'](_0x31f0c7[_0x5791('0x33')][_0x5791('0x37')]));_0x3ddc37[_0x5791('0x36')]=_0x3ddc37[_0x5791('0x36')]['length']?_0x3ddc37[_0x5791('0x36')]:_0x3fef31[_0x5791('0x31')];if(!_0x31f0c7[_0x5791('0x33')][_0x5791('0x38')]('nolimit')){_0x3ddc37[_0x5791('0x1e')]=qs[_0x5791('0x1e')](_0x31f0c7[_0x5791('0x33')][_0x5791('0x1e')]);_0x3ddc37[_0x5791('0x1c')]=qs['offset'](_0x31f0c7[_0x5791('0x33')][_0x5791('0x1c')]);}_0x3ddc37[_0x5791('0x39')]=qs['sort'](_0x31f0c7[_0x5791('0x33')][_0x5791('0x3a')]);_0x3ddc37[_0x5791('0x3b')]=qs[_0x5791('0x3c')](_['pick'](_0x31f0c7[_0x5791('0x33')],_0x3fef31[_0x5791('0x3c')]),_0x3797e7);if(_0x31f0c7['query'][_0x5791('0x3d')]){_0x3ddc37[_0x5791('0x3b')]=_[_0x5791('0x3e')](_0x3ddc37['where'],{'$or':_[_0x5791('0x2b')](_0x3797e7,function(_0x40b1b7){if(_0x40b1b7[_0x5791('0x2f')]!==_0x5791('0x3f')){var _0x15afbe={};_0x15afbe[_0x40b1b7[_0x5791('0x32')]]={'$like':'%'+_0x31f0c7[_0x5791('0x33')][_0x5791('0x3d')]+'%'};return _0x15afbe;}})});}_0x3ddc37=_[_0x5791('0x3e')]({},_0x3ddc37,_0x31f0c7[_0x5791('0x40')]);var _0x301a2d={'where':_0x3ddc37[_0x5791('0x3b')]};return db[_0x5791('0x2c')][_0x5791('0x1f')](_0x301a2d)['then'](function(_0xc05d82){_0x22c3fd[_0x5791('0x1f')]=_0xc05d82;if(_0x31f0c7[_0x5791('0x33')][_0x5791('0x41')]){_0x3ddc37[_0x5791('0x42')]=[{'all':!![]}];}return db[_0x5791('0x2c')]['findAll'](_0x3ddc37);})[_0x5791('0x26')](function(_0x21aacb){_0x22c3fd[_0x5791('0x43')]=_0x21aacb;return _0x22c3fd;})[_0x5791('0x26')](respondWithFilteredResult(_0x5be759,_0x3ddc37))[_0x5791('0x44')](handleError(_0x5be759,null));};exports[_0x5791('0x45')]=function(_0x59bda3,_0x34eb27){var _0x10eee4={'raw':![],'where':{'id':_0x59bda3[_0x5791('0x46')]['id']}},_0x46efa0={};_0x46efa0[_0x5791('0x31')]=_[_0x5791('0x34')](db['Automation'][_0x5791('0x2d')]);_0x46efa0[_0x5791('0x33')]=_[_0x5791('0x34')](_0x59bda3['query']);_0x46efa0[_0x5791('0x3c')]=_['intersection'](_0x46efa0['model'],_0x46efa0[_0x5791('0x33')]);_0x10eee4[_0x5791('0x36')]=_[_0x5791('0x35')](_0x46efa0[_0x5791('0x31')],qs[_0x5791('0x37')](_0x59bda3[_0x5791('0x33')]['fields']));_0x10eee4[_0x5791('0x36')]=_0x10eee4[_0x5791('0x36')]['length']?_0x10eee4[_0x5791('0x36')]:_0x46efa0[_0x5791('0x31')];if(_0x59bda3['query'][_0x5791('0x41')]){_0x10eee4['include']=[{'all':!![]}];}_0x10eee4=_['merge']({},_0x10eee4,_0x59bda3['options']);return db['Automation'][_0x5791('0x47')](_0x10eee4)[_0x5791('0x26')](handleEntityNotFound(_0x34eb27,null))['then'](respondWithResult(_0x34eb27,null))[_0x5791('0x44')](handleError(_0x34eb27,null));};exports[_0x5791('0x48')]=function(_0x19d4b2,_0x159e14){return db[_0x5791('0x2c')][_0x5791('0x48')](_0x19d4b2[_0x5791('0x49')],{})[_0x5791('0x26')](respondWithResult(_0x159e14,0xc9))[_0x5791('0x44')](handleError(_0x159e14,null));};exports[_0x5791('0x25')]=function(_0xdb38e5,_0x36badb){if(_0xdb38e5[_0x5791('0x49')]['id']){delete _0xdb38e5[_0x5791('0x49')]['id'];}return db[_0x5791('0x2c')][_0x5791('0x47')]({'where':{'id':_0xdb38e5[_0x5791('0x46')]['id']}})['then'](handleEntityNotFound(_0x36badb,null))['then'](saveUpdates(_0xdb38e5[_0x5791('0x49')],null))[_0x5791('0x26')](respondWithResult(_0x36badb,null))['catch'](handleError(_0x36badb,null));};exports['destroy']=function(_0x31dd45,_0x3ef0d8){return db[_0x5791('0x2c')]['find']({'where':{'id':_0x31dd45[_0x5791('0x46')]['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x3ef0d8,null))[_0x5791('0x26')](removeEntity(_0x3ef0d8,null))[_0x5791('0x44')](handleError(_0x3ef0d8,null));};exports[_0x5791('0x4a')]=function(_0x52b0e4,_0x1dc4bb,_0x4e39f0){return db[_0x5791('0x4b')][_0x5791('0x47')]({'where':{'id':_0x52b0e4[_0x5791('0x46')]['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x1dc4bb,null))[_0x5791('0x26')](function(_0x5c1a4a){if(_0x5c1a4a){return _0x5c1a4a[_0x5791('0x4a')](_0x52b0e4[_0x5791('0x49')]['ids'],_[_0x5791('0x4c')](_0x52b0e4[_0x5791('0x49')],['ids','id'])||{});}})[_0x5791('0x26')](respondWithResult(_0x1dc4bb,null))[_0x5791('0x44')](handleError(_0x1dc4bb,null));};exports[_0x5791('0x4d')]=function(_0x18e099,_0x547e60,_0x3614e7){var _0xcdafd4={};var _0x8900af={};var _0x3e761f;var _0x263897;return db[_0x5791('0x2c')]['findOne']({'where':{'id':_0x18e099['params']['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x547e60,null))[_0x5791('0x26')](function(_0x62b35b){if(_0x62b35b){_0x3e761f=_0x62b35b;_0x8900af['model']=_[_0x5791('0x34')](db[_0x5791('0x4b')]['rawAttributes']);_0x8900af['query']=_['keys'](_0x18e099['query']);_0x8900af['filters']=_['intersection'](_0x8900af[_0x5791('0x31')],_0x8900af[_0x5791('0x33')]);_0xcdafd4[_0x5791('0x36')]=_[_0x5791('0x35')](_0x8900af[_0x5791('0x31')],qs['fields'](_0x18e099[_0x5791('0x33')]['fields']));_0xcdafd4[_0x5791('0x36')]=_0xcdafd4[_0x5791('0x36')][_0x5791('0x4e')]?_0xcdafd4[_0x5791('0x36')]:_0x8900af[_0x5791('0x31')];_0xcdafd4[_0x5791('0x39')]=qs['sort'](_0x18e099[_0x5791('0x33')][_0x5791('0x3a')]);_0xcdafd4[_0x5791('0x3b')]=qs[_0x5791('0x3c')](_[_0x5791('0x4f')](_0x18e099[_0x5791('0x33')],_0x8900af[_0x5791('0x3c')]));if(_0x18e099[_0x5791('0x33')][_0x5791('0x3d')]){_0xcdafd4[_0x5791('0x3b')]=_[_0x5791('0x3e')](_0xcdafd4[_0x5791('0x3b')],{'$or':_[_0x5791('0x2b')](_0xcdafd4[_0x5791('0x36')],function(_0x6925c7){var _0x2ec85e={};_0x2ec85e[_0x6925c7]={'$like':'%'+_0x18e099[_0x5791('0x33')][_0x5791('0x3d')]+'%'};return _0x2ec85e;})});}_0xcdafd4=_['merge']({},_0xcdafd4,_0x18e099[_0x5791('0x40')]);return _0x3e761f[_0x5791('0x4d')](_0xcdafd4);}})['then'](function(_0x56855f){if(_0x56855f){_0x263897=_0x56855f['length'];if(!_0x18e099['query'][_0x5791('0x38')]('nolimit')){_0xcdafd4[_0x5791('0x1e')]=qs['limit'](_0x18e099[_0x5791('0x33')][_0x5791('0x1e')]);_0xcdafd4['offset']=qs[_0x5791('0x1c')](_0x18e099[_0x5791('0x33')][_0x5791('0x1c')]);}return _0x3e761f['getConditions'](_0xcdafd4);}})[_0x5791('0x26')](function(_0x1278c0){if(_0x1278c0){return _0x1278c0?{'count':_0x263897,'rows':_0x1278c0}:null;}})[_0x5791('0x26')](respondWithResult(_0x547e60,null))[_0x5791('0x44')](handleError(_0x547e60,null));};exports['addActions']=function(_0x4e2fd6,_0x5138b2,_0x7ec881){return db['Action'][_0x5791('0x47')]({'where':{'id':_0x4e2fd6[_0x5791('0x46')]['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x5138b2,null))[_0x5791('0x26')](function(_0x39fdbd){if(_0x39fdbd){return _0x39fdbd[_0x5791('0x50')](_0x4e2fd6[_0x5791('0x49')][_0x5791('0x51')],_['omit'](_0x4e2fd6[_0x5791('0x49')],[_0x5791('0x51'),'id'])||{});}})[_0x5791('0x26')](respondWithResult(_0x5138b2,null))[_0x5791('0x44')](handleError(_0x5138b2,null));};exports[_0x5791('0x52')]=function(_0x354265,_0x4a0daf,_0x2876e0){var _0x4005e6={};var _0x503711={};var _0x512115;var _0x1e1564;return db[_0x5791('0x2c')][_0x5791('0x53')]({'where':{'id':_0x354265['params']['id']}})[_0x5791('0x26')](handleEntityNotFound(_0x4a0daf,null))[_0x5791('0x26')](function(_0xd7f799){if(_0xd7f799){_0x512115=_0xd7f799;_0x503711[_0x5791('0x31')]=_['keys'](db[_0x5791('0x54')][_0x5791('0x2d')]);_0x503711[_0x5791('0x33')]=_['keys'](_0x354265[_0x5791('0x33')]);_0x503711[_0x5791('0x3c')]=_[_0x5791('0x35')](_0x503711[_0x5791('0x31')],_0x503711[_0x5791('0x33')]);_0x4005e6[_0x5791('0x36')]=_[_0x5791('0x35')](_0x503711[_0x5791('0x31')],qs[_0x5791('0x37')](_0x354265['query'][_0x5791('0x37')]));_0x4005e6['attributes']=_0x4005e6[_0x5791('0x36')][_0x5791('0x4e')]?_0x4005e6[_0x5791('0x36')]:_0x503711['model'];_0x4005e6['order']=qs[_0x5791('0x3a')](_0x354265['query']['sort']);_0x4005e6['where']=qs[_0x5791('0x3c')](_[_0x5791('0x4f')](_0x354265['query'],_0x503711[_0x5791('0x3c')]));if(_0x354265['query'][_0x5791('0x3d')]){_0x4005e6[_0x5791('0x3b')]=_['merge'](_0x4005e6[_0x5791('0x3b')],{'$or':_[_0x5791('0x2b')](_0x4005e6[_0x5791('0x36')],function(_0x6a0206){var _0x54d6bc={};_0x54d6bc[_0x6a0206]={'$like':'%'+_0x354265[_0x5791('0x33')]['filter']+'%'};return _0x54d6bc;})});}_0x4005e6=_[_0x5791('0x3e')]({},_0x4005e6,_0x354265[_0x5791('0x40')]);return _0x512115[_0x5791('0x52')](_0x4005e6);}})[_0x5791('0x26')](function(_0x120da6){if(_0x120da6){_0x1e1564=_0x120da6[_0x5791('0x4e')];if(!_0x354265[_0x5791('0x33')][_0x5791('0x38')](_0x5791('0x55'))){_0x4005e6[_0x5791('0x1e')]=qs[_0x5791('0x1e')](_0x354265[_0x5791('0x33')][_0x5791('0x1e')]);_0x4005e6[_0x5791('0x1c')]=qs[_0x5791('0x1c')](_0x354265[_0x5791('0x33')]['offset']);}return _0x512115['getActions'](_0x4005e6);}})['then'](function(_0x27fd0e){if(_0x27fd0e){return _0x27fd0e?{'count':_0x1e1564,'rows':_0x27fd0e}:null;}})[_0x5791('0x26')](respondWithResult(_0x4a0daf,null))[_0x5791('0x44')](handleError(_0x4a0daf,null));};
\ No newline at end of file
+var _0x708c=['then','error','stack','name','send','map','Automation','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','rimraf','zip-dir','bluebird','path','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x708c,0xd4));var _0xc708=function(_0x2634c1,_0x4bd833){_0x2634c1=_0x2634c1-0x0;var _0x2cd333=_0x708c[_0x2634c1];return _0x2cd333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc708('0x0'));var zipdir=require(_0xc708('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc708('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc708('0x3'));var sox=require(_0xc708('0x4'));var csv=require(_0xc708('0x5'));var ejs=require(_0xc708('0x6'));var fs=require('fs');var fs_extra=require(_0xc708('0x7'));var _=require(_0xc708('0x8'));var squel=require(_0xc708('0x9'));var crypto=require('crypto');var jsforce=require(_0xc708('0xa'));var deskjs=require(_0xc708('0xb'));var toCsv=require(_0xc708('0x5'));var querystring=require(_0xc708('0xc'));var Papa=require(_0xc708('0xd'));var Redis=require(_0xc708('0xe'));var authService=require(_0xc708('0xf'));var qs=require(_0xc708('0x10'));var as=require(_0xc708('0x11'));var hardwareService=require(_0xc708('0x12'));var logger=require(_0xc708('0x13'))(_0xc708('0x14'));var utils=require(_0xc708('0x15'));var config=require(_0xc708('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc708('0x17'))['db'];function respondWithStatusCode(_0x5081b2,_0x22dc34){_0x22dc34=_0x22dc34||0xcc;return function(_0x131610){if(_0x131610){return _0x5081b2[_0xc708('0x18')](_0x22dc34);}return _0x5081b2[_0xc708('0x19')](_0x22dc34)[_0xc708('0x1a')]();};}function respondWithResult(_0x3706c1,_0x418eff){_0x418eff=_0x418eff||0xc8;return function(_0x8447e8){if(_0x8447e8){return _0x3706c1['status'](_0x418eff)[_0xc708('0x1b')](_0x8447e8);}};}function respondWithFilteredResult(_0x164d37,_0x5c99d8){return function(_0x167c25){if(_0x167c25){var _0x509faa=typeof _0x5c99d8[_0xc708('0x1c')]==='undefined'&&typeof _0x5c99d8['limit']==='undefined';var _0x11028a=_0x167c25[_0xc708('0x1d')];var _0x4c4d1d=_0x509faa?0x0:_0x5c99d8['offset'];var _0x4cb069=_0x509faa?_0x167c25['count']:_0x5c99d8[_0xc708('0x1c')]+_0x5c99d8[_0xc708('0x1e')];var _0x49a2d6;if(_0x4cb069>=_0x11028a){_0x4cb069=_0x11028a;_0x49a2d6=0xc8;}else{_0x49a2d6=0xce;}_0x164d37[_0xc708('0x19')](_0x49a2d6);return _0x164d37[_0xc708('0x1f')](_0xc708('0x20'),_0x4c4d1d+'-'+_0x4cb069+'/'+_0x11028a)[_0xc708('0x1b')](_0x167c25);}return null;};}function patchUpdates(_0x4b307a){return function(_0x12b213){try{jsonpatch[_0xc708('0x21')](_0x12b213,_0x4b307a,!![]);}catch(_0x432462){return BPromise[_0xc708('0x22')](_0x432462);}return _0x12b213[_0xc708('0x23')]();};}function saveUpdates(_0x455ac0,_0x29167a){return function(_0x19697e){if(_0x19697e){return _0x19697e[_0xc708('0x24')](_0x455ac0)[_0xc708('0x25')](function(_0x4b1674){return _0x4b1674;});}return null;};}function removeEntity(_0x5ede90,_0x8bc34b){return function(_0x3baa75){if(_0x3baa75){return _0x3baa75['destroy']()[_0xc708('0x25')](function(){_0x5ede90[_0xc708('0x19')](0xcc)[_0xc708('0x1a')]();});}};}function handleEntityNotFound(_0x497d72,_0x38cbfd){return function(_0x213627){if(!_0x213627){_0x497d72[_0xc708('0x18')](0x194);}return _0x213627;};}function handleError(_0x483420,_0x505278){_0x505278=_0x505278||0x1f4;return function(_0x1c3ecb){logger[_0xc708('0x26')](_0x1c3ecb[_0xc708('0x27')]);if(_0x1c3ecb[_0xc708('0x28')]){delete _0x1c3ecb[_0xc708('0x28')];}_0x483420[_0xc708('0x19')](_0x505278)[_0xc708('0x29')](_0x1c3ecb);};}exports['index']=function(_0x1dd21d,_0x22a4dd){var _0x276271={},_0x268494={},_0x41736d={'count':0x0,'rows':[]};var _0x1f19ac=_[_0xc708('0x2a')](db[_0xc708('0x2b')]['rawAttributes'],function(_0x6d8639){return{'name':_0x6d8639['fieldName'],'type':_0x6d8639['type'][_0xc708('0x2c')]};});_0x268494[_0xc708('0x2d')]=_[_0xc708('0x2a')](_0x1f19ac,'name');_0x268494[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0x1dd21d[_0xc708('0x2e')]);_0x268494[_0xc708('0x30')]=_[_0xc708('0x31')](_0x268494[_0xc708('0x2d')],_0x268494[_0xc708('0x2e')]);_0x276271[_0xc708('0x32')]=_[_0xc708('0x31')](_0x268494['model'],qs[_0xc708('0x33')](_0x1dd21d['query'][_0xc708('0x33')]));_0x276271['attributes']=_0x276271[_0xc708('0x32')][_0xc708('0x34')]?_0x276271[_0xc708('0x32')]:_0x268494[_0xc708('0x2d')];if(!_0x1dd21d[_0xc708('0x2e')]['hasOwnProperty'](_0xc708('0x35'))){_0x276271[_0xc708('0x1e')]=qs[_0xc708('0x1e')](_0x1dd21d[_0xc708('0x2e')][_0xc708('0x1e')]);_0x276271['offset']=qs[_0xc708('0x1c')](_0x1dd21d['query'][_0xc708('0x1c')]);}_0x276271[_0xc708('0x36')]=qs[_0xc708('0x37')](_0x1dd21d['query'][_0xc708('0x37')]);_0x276271[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0x1dd21d[_0xc708('0x2e')],_0x268494[_0xc708('0x30')]),_0x1f19ac);if(_0x1dd21d[_0xc708('0x2e')][_0xc708('0x3a')]){_0x276271['where']=_[_0xc708('0x3b')](_0x276271[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x1f19ac,function(_0x598fc5){if(_0x598fc5[_0xc708('0x3c')]!=='VIRTUAL'){var _0x2c9164={};_0x2c9164[_0x598fc5[_0xc708('0x28')]]={'$like':'%'+_0x1dd21d['query'][_0xc708('0x3a')]+'%'};return _0x2c9164;}})});}_0x276271=_['merge']({},_0x276271,_0x1dd21d[_0xc708('0x3d')]);var _0x3d751d={'where':_0x276271['where']};return db[_0xc708('0x2b')][_0xc708('0x1d')](_0x3d751d)['then'](function(_0x3a4684){_0x41736d[_0xc708('0x1d')]=_0x3a4684;if(_0x1dd21d[_0xc708('0x2e')][_0xc708('0x3e')]){_0x276271[_0xc708('0x3f')]=[{'all':!![]}];}return db[_0xc708('0x2b')][_0xc708('0x40')](_0x276271);})[_0xc708('0x25')](function(_0x344858){_0x41736d[_0xc708('0x41')]=_0x344858;return _0x41736d;})[_0xc708('0x25')](respondWithFilteredResult(_0x22a4dd,_0x276271))[_0xc708('0x42')](handleError(_0x22a4dd,null));};exports['show']=function(_0x4a96af,_0xb21f91){var _0x31cfc0={'raw':![],'where':{'id':_0x4a96af[_0xc708('0x43')]['id']}},_0x1f18b9={};_0x1f18b9[_0xc708('0x2d')]=_[_0xc708('0x2f')](db[_0xc708('0x2b')][_0xc708('0x44')]);_0x1f18b9[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0x4a96af[_0xc708('0x2e')]);_0x1f18b9[_0xc708('0x30')]=_[_0xc708('0x31')](_0x1f18b9['model'],_0x1f18b9[_0xc708('0x2e')]);_0x31cfc0[_0xc708('0x32')]=_[_0xc708('0x31')](_0x1f18b9[_0xc708('0x2d')],qs[_0xc708('0x33')](_0x4a96af[_0xc708('0x2e')][_0xc708('0x33')]));_0x31cfc0[_0xc708('0x32')]=_0x31cfc0[_0xc708('0x32')][_0xc708('0x34')]?_0x31cfc0[_0xc708('0x32')]:_0x1f18b9['model'];if(_0x4a96af[_0xc708('0x2e')][_0xc708('0x3e')]){_0x31cfc0[_0xc708('0x3f')]=[{'all':!![]}];}_0x31cfc0=_[_0xc708('0x3b')]({},_0x31cfc0,_0x4a96af[_0xc708('0x3d')]);return db[_0xc708('0x2b')][_0xc708('0x45')](_0x31cfc0)[_0xc708('0x25')](handleEntityNotFound(_0xb21f91,null))[_0xc708('0x25')](respondWithResult(_0xb21f91,null))[_0xc708('0x42')](handleError(_0xb21f91,null));};exports[_0xc708('0x46')]=function(_0x1df486,_0x5e4cab){return db[_0xc708('0x2b')]['create'](_0x1df486[_0xc708('0x47')],{})['then'](respondWithResult(_0x5e4cab,0xc9))['catch'](handleError(_0x5e4cab,null));};exports[_0xc708('0x24')]=function(_0x1514ae,_0x1a7392){if(_0x1514ae['body']['id']){delete _0x1514ae[_0xc708('0x47')]['id'];}return db['Automation'][_0xc708('0x45')]({'where':{'id':_0x1514ae['params']['id']}})['then'](handleEntityNotFound(_0x1a7392,null))[_0xc708('0x25')](saveUpdates(_0x1514ae[_0xc708('0x47')],null))[_0xc708('0x25')](respondWithResult(_0x1a7392,null))[_0xc708('0x42')](handleError(_0x1a7392,null));};exports[_0xc708('0x48')]=function(_0x3bad3a,_0x14df29){return db[_0xc708('0x2b')][_0xc708('0x45')]({'where':{'id':_0x3bad3a['params']['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x14df29,null))[_0xc708('0x25')](removeEntity(_0x14df29,null))[_0xc708('0x42')](handleError(_0x14df29,null));};exports[_0xc708('0x49')]=function(_0x16fba9,_0x2af62b,_0x2d06e8){return db[_0xc708('0x4a')][_0xc708('0x45')]({'where':{'id':_0x16fba9[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x2af62b,null))[_0xc708('0x25')](function(_0x496746){if(_0x496746){return _0x496746[_0xc708('0x49')](_0x16fba9[_0xc708('0x47')][_0xc708('0x4b')],_[_0xc708('0x4c')](_0x16fba9[_0xc708('0x47')],['ids','id'])||{});}})[_0xc708('0x25')](respondWithResult(_0x2af62b,null))[_0xc708('0x42')](handleError(_0x2af62b,null));};exports[_0xc708('0x4d')]=function(_0xdf3e39,_0xe1634c,_0x2381bf){var _0x19d07b={};var _0x3df97c={};var _0x2a93ef;var _0x2b8a74;return db[_0xc708('0x2b')][_0xc708('0x4e')]({'where':{'id':_0xdf3e39[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0xe1634c,null))[_0xc708('0x25')](function(_0x6509e8){if(_0x6509e8){_0x2a93ef=_0x6509e8;_0x3df97c[_0xc708('0x2d')]=_['keys'](db['Condition'][_0xc708('0x44')]);_0x3df97c[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0xdf3e39[_0xc708('0x2e')]);_0x3df97c['filters']=_[_0xc708('0x31')](_0x3df97c[_0xc708('0x2d')],_0x3df97c[_0xc708('0x2e')]);_0x19d07b['attributes']=_[_0xc708('0x31')](_0x3df97c[_0xc708('0x2d')],qs[_0xc708('0x33')](_0xdf3e39['query']['fields']));_0x19d07b[_0xc708('0x32')]=_0x19d07b[_0xc708('0x32')]['length']?_0x19d07b['attributes']:_0x3df97c[_0xc708('0x2d')];_0x19d07b[_0xc708('0x36')]=qs[_0xc708('0x37')](_0xdf3e39['query'][_0xc708('0x37')]);_0x19d07b[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0xdf3e39[_0xc708('0x2e')],_0x3df97c['filters']));if(_0xdf3e39[_0xc708('0x2e')][_0xc708('0x3a')]){_0x19d07b[_0xc708('0x38')]=_[_0xc708('0x3b')](_0x19d07b[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x19d07b[_0xc708('0x32')],function(_0x4d492f){var _0x19e819={};_0x19e819[_0x4d492f]={'$like':'%'+_0xdf3e39[_0xc708('0x2e')][_0xc708('0x3a')]+'%'};return _0x19e819;})});}_0x19d07b=_[_0xc708('0x3b')]({},_0x19d07b,_0xdf3e39[_0xc708('0x3d')]);return _0x2a93ef[_0xc708('0x4d')](_0x19d07b);}})[_0xc708('0x25')](function(_0xc1b831){if(_0xc1b831){_0x2b8a74=_0xc1b831[_0xc708('0x34')];if(!_0xdf3e39[_0xc708('0x2e')][_0xc708('0x4f')]('nolimit')){_0x19d07b['limit']=qs[_0xc708('0x1e')](_0xdf3e39[_0xc708('0x2e')][_0xc708('0x1e')]);_0x19d07b['offset']=qs[_0xc708('0x1c')](_0xdf3e39[_0xc708('0x2e')][_0xc708('0x1c')]);}return _0x2a93ef['getConditions'](_0x19d07b);}})[_0xc708('0x25')](function(_0x86f819){if(_0x86f819){return _0x86f819?{'count':_0x2b8a74,'rows':_0x86f819}:null;}})['then'](respondWithResult(_0xe1634c,null))[_0xc708('0x42')](handleError(_0xe1634c,null));};exports[_0xc708('0x50')]=function(_0x1ef5b8,_0x50959c,_0xf21bbd){return db[_0xc708('0x51')][_0xc708('0x45')]({'where':{'id':_0x1ef5b8[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x50959c,null))[_0xc708('0x25')](function(_0x2b93b6){if(_0x2b93b6){return _0x2b93b6['addActions'](_0x1ef5b8[_0xc708('0x47')]['ids'],_[_0xc708('0x4c')](_0x1ef5b8[_0xc708('0x47')],['ids','id'])||{});}})[_0xc708('0x25')](respondWithResult(_0x50959c,null))['catch'](handleError(_0x50959c,null));};exports[_0xc708('0x52')]=function(_0x41e5b6,_0x450605,_0x2c259d){var _0x55e787={};var _0x3b216a={};var _0x255b4c;var _0x245a3c;return db['Automation']['findOne']({'where':{'id':_0x41e5b6[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x450605,null))['then'](function(_0x443002){if(_0x443002){_0x255b4c=_0x443002;_0x3b216a[_0xc708('0x2d')]=_[_0xc708('0x2f')](db[_0xc708('0x51')][_0xc708('0x44')]);_0x3b216a[_0xc708('0x2e')]=_['keys'](_0x41e5b6['query']);_0x3b216a[_0xc708('0x30')]=_[_0xc708('0x31')](_0x3b216a[_0xc708('0x2d')],_0x3b216a[_0xc708('0x2e')]);_0x55e787['attributes']=_[_0xc708('0x31')](_0x3b216a[_0xc708('0x2d')],qs[_0xc708('0x33')](_0x41e5b6[_0xc708('0x2e')][_0xc708('0x33')]));_0x55e787['attributes']=_0x55e787[_0xc708('0x32')][_0xc708('0x34')]?_0x55e787[_0xc708('0x32')]:_0x3b216a[_0xc708('0x2d')];_0x55e787[_0xc708('0x36')]=qs['sort'](_0x41e5b6[_0xc708('0x2e')]['sort']);_0x55e787[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0x41e5b6['query'],_0x3b216a[_0xc708('0x30')]));if(_0x41e5b6[_0xc708('0x2e')]['filter']){_0x55e787[_0xc708('0x38')]=_[_0xc708('0x3b')](_0x55e787[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x55e787[_0xc708('0x32')],function(_0x197b88){var _0x435806={};_0x435806[_0x197b88]={'$like':'%'+_0x41e5b6[_0xc708('0x2e')]['filter']+'%'};return _0x435806;})});}_0x55e787=_['merge']({},_0x55e787,_0x41e5b6[_0xc708('0x3d')]);return _0x255b4c[_0xc708('0x52')](_0x55e787);}})['then'](function(_0x11fd1a){if(_0x11fd1a){_0x245a3c=_0x11fd1a[_0xc708('0x34')];if(!_0x41e5b6[_0xc708('0x2e')][_0xc708('0x4f')](_0xc708('0x35'))){_0x55e787[_0xc708('0x1e')]=qs['limit'](_0x41e5b6['query'][_0xc708('0x1e')]);_0x55e787[_0xc708('0x1c')]=qs['offset'](_0x41e5b6[_0xc708('0x2e')]['offset']);}return _0x255b4c[_0xc708('0x52')](_0x55e787);}})[_0xc708('0x25')](function(_0x30cf73){if(_0x30cf73){return _0x30cf73?{'count':_0x245a3c,'rows':_0x30cf73}:null;}})['then'](respondWithResult(_0x450605,null))['catch'](handleError(_0x450605,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 8bdf745..7c1d111 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 _0x98da=['rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x44d628,_0x3024bf){var _0x303593=function(_0x4d5781){while(--_0x4d5781){_0x44d628['push'](_0x44d628['shift']());}};_0x303593(++_0x3024bf);}(_0x98da,0xe1));var _0xa98d=function(_0xf82293,_0x23b61c){_0xf82293=_0xf82293-0x0;var _0x15589d=_0x98da[_0xf82293];return _0x15589d;};'use strict';var _=require(_0xa98d('0x0'));var util=require(_0xa98d('0x1'));var logger=require(_0xa98d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa98d('0x3'));var rp=require(_0xa98d('0x4'));var fs=require('fs');var path=require(_0xa98d('0x5'));var rimraf=require(_0xa98d('0x6'));var config=require(_0xa98d('0x7'));var attributes=require(_0xa98d('0x8'));module['exports']=function(_0x3b13ef,_0x16106f){return _0x3b13ef[_0xa98d('0x9')]('Automation',attributes,{'tableName':_0xa98d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4fbc=['moment','bluebird','request-promise','path','./automation.attributes','exports','define','tools_automations','lodash','../../config/logger','api'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x4fbc,0x168));var _0xc4fb=function(_0x1cb550,_0x6b2222){_0x1cb550=_0x1cb550-0x0;var _0x588b49=_0x4fbc[_0x1cb550];return _0x588b49;};'use strict';var _=require(_0xc4fb('0x0'));var util=require('util');var logger=require(_0xc4fb('0x1'))(_0xc4fb('0x2'));var moment=require(_0xc4fb('0x3'));var BPromise=require(_0xc4fb('0x4'));var rp=require(_0xc4fb('0x5'));var fs=require('fs');var path=require(_0xc4fb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4fb('0x7'));module[_0xc4fb('0x8')]=function(_0x4b2563,_0x5e192f){return _0x4b2563[_0xc4fb('0x9')]('Automation',attributes,{'tableName':_0xc4fb('0xa'),'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 dcd7b4e..020660a 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 _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','Automation,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x26bfb0,_0x5b0ffc){var _0x4454b3=function(_0x2e7c5f){while(--_0x2e7c5f){_0x26bfb0['push'](_0x26bfb0['shift']());}};_0x4454b3(++_0x5b0ffc);}(_0x505d,0x93));var _0xd505=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x505d[_0x99868f];return _0x27a71b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});}
\ No newline at end of file
+var _0x50a5=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x48efe5,_0x24d889){var _0x5962c2=function(_0x1ce132){while(--_0x1ce132){_0x48efe5['push'](_0x48efe5['shift']());}};_0x5962c2(++_0x24d889);}(_0x50a5,0xd1));var _0x550a=function(_0x5ac443,_0x284ba7){_0x5ac443=_0x5ac443-0x0;var _0x369aef=_0x50a5[_0x5ac443];return _0x369aef;};'use strict';var _=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x550a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x550a('0x3'))(_0x550a('0x4'));var config=require(_0x550a('0x5'));var jayson=require(_0x550a('0x6'));var client=jayson[_0x550a('0x7')][_0x550a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1983bf,_0x2596b7,_0x3e9984){return new BPromise(function(_0x329303,_0x434f2e){return client[_0x550a('0x9')](_0x1983bf,_0x3e9984)[_0x550a('0xa')](function(_0x5247ac){logger[_0x550a('0xb')](_0x550a('0xc'),_0x2596b7,_0x550a('0xd'));logger[_0x550a('0xe')](_0x550a('0xf'),_0x2596b7,_0x550a('0xd'),JSON['stringify'](_0x5247ac));if(_0x5247ac[_0x550a('0x10')]){if(_0x5247ac[_0x550a('0x10')][_0x550a('0x11')]===0x1f4){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x5247ac[_0x550a('0x10')][_0x550a('0x12')]);return _0x434f2e(_0x5247ac[_0x550a('0x10')]['message']);}logger[_0x550a('0x10')]('Automation,\x20%s,\x20%s',_0x2596b7,_0x5247ac['error'][_0x550a('0x12')]);return _0x329303(_0x5247ac[_0x550a('0x10')]['message']);}else{logger[_0x550a('0xb')]('Automation,\x20%s,\x20%s',_0x2596b7,_0x550a('0xd'));_0x329303(_0x5247ac['result'][_0x550a('0x12')]);}})[_0x550a('0x13')](function(_0x11994d){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x11994d);_0x434f2e(_0x11994d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 100b494..f4f0cdb 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 _0x6548=['exports','multer','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','create','post','addConditions','addActions','destroy'];(function(_0x231c25,_0x237859){var _0x2b5c30=function(_0x5f0c1e){while(--_0x5f0c1e){_0x231c25['push'](_0x231c25['shift']());}};_0x2b5c30(++_0x237859);}(_0x6548,0x133));var _0x8654=function(_0x3b2163,_0x54a058){_0x3b2163=_0x3b2163-0x0;var _0x4ee9eb=_0x6548[_0x3b2163];return _0x4ee9eb;};'use strict';var multer=require(_0x8654('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8654('0x1'));var express=require(_0x8654('0x2'));var router=express[_0x8654('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8654('0x4'));var controller=require('./automation.controller');router[_0x8654('0x5')]('/',auth[_0x8654('0x6')](),controller[_0x8654('0x7')]);router[_0x8654('0x5')](_0x8654('0x8'),auth[_0x8654('0x6')](),controller[_0x8654('0x9')]);router['get'](_0x8654('0xa'),auth[_0x8654('0x6')](),controller['getConditions']);router[_0x8654('0x5')](_0x8654('0xb'),auth[_0x8654('0x6')](),controller['getActions']);router['post']('/',auth[_0x8654('0x6')](),controller[_0x8654('0xc')]);router[_0x8654('0xd')](_0x8654('0xa'),auth['isAuthenticated'](),controller[_0x8654('0xe')]);router[_0x8654('0xd')](_0x8654('0xb'),auth['isAuthenticated'](),controller[_0x8654('0xf')]);router['put'](_0x8654('0x8'),auth[_0x8654('0x6')](),controller['update']);router['delete']('/:id',auth[_0x8654('0x6')](),controller[_0x8654('0x10')]);module[_0x8654('0x11')]=router;
\ No newline at end of file
+var _0xcb70=['../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addActions','put','exports','multer','util','fs-extra','../../components/auth/service'];(function(_0x2d9315,_0xc56bd0){var _0xb6039=function(_0x48a693){while(--_0x48a693){_0x2d9315['push'](_0x2d9315['shift']());}};_0xb6039(++_0xc56bd0);}(_0xcb70,0xf3));var _0x0cb7=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xcb70[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x0cb7('0x0'));var util=require(_0x0cb7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0cb7('0x2'));var auth=require(_0x0cb7('0x3'));var interaction=require(_0x0cb7('0x4'));var config=require(_0x0cb7('0x5'));var controller=require(_0x0cb7('0x6'));router[_0x0cb7('0x7')]('/',auth[_0x0cb7('0x8')](),controller['index']);router[_0x0cb7('0x7')](_0x0cb7('0x9'),auth[_0x0cb7('0x8')](),controller[_0x0cb7('0xa')]);router[_0x0cb7('0x7')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x0cb7('0xb')]);router[_0x0cb7('0x7')](_0x0cb7('0xc'),auth[_0x0cb7('0x8')](),controller['getActions']);router[_0x0cb7('0xd')]('/',auth[_0x0cb7('0x8')](),controller[_0x0cb7('0xe')]);router['post'](_0x0cb7('0xf'),auth[_0x0cb7('0x8')](),controller['addConditions']);router[_0x0cb7('0xd')](_0x0cb7('0xc'),auth[_0x0cb7('0x8')](),controller[_0x0cb7('0x10')]);router[_0x0cb7('0x11')](_0x0cb7('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0cb7('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0cb7('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e23d2fc..9e58cc6 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 _0xa57e=['#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','STRING','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xa57e,0x1bf));var _0xea57=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa57e[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xea57('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xea57('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xea57('0x2')](_0xea57('0x3')),'allowNull':![],'defaultValue':_0xea57('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xea57('0x4')],'defaultValue':0x0,'comment':_0xea57('0x5')},'limitCalls':{'type':Sequelize[_0xea57('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xea57('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'comment':_0xea57('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xea57('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xea57('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xea57('0x11'),_0xea57('0x12'),_0xea57('0x13')),'defaultValue':_0xea57('0x11')},'dialAMDActive':{'type':Sequelize[_0xea57('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xea57('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xea57('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xea57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xea57('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xea57('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xea57('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xea57('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xea57('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xea57('0x6')](0x9)[_0xea57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xea57('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xea57('0x2')]('DESC','ASC'),'defaultValue':_0xea57('0x1c')},'dialPrefix':{'type':Sequelize[_0xea57('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xea57('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xea57('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xea57('0x6')](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xea57('0x6')](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xea57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xea57('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xea57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xea57('0x26')}};
\ No newline at end of file
+var _0x2961=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3a3b1e,_0x230f6d){var _0x583039=function(_0x527d4c){while(--_0x527d4c){_0x3a3b1e['push'](_0x3a3b1e['shift']());}};_0x583039(++_0x230f6d);}(_0x2961,0xb6));var _0x1296=function(_0x169dbd,_0x2f741a){_0x169dbd=_0x169dbd-0x0;var _0x282fc2=_0x2961[_0x169dbd];return _0x282fc2;};'use strict';var Sequelize=require(_0x1296('0x0'));module[_0x1296('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1296('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1296('0x3')](_0x1296('0x4')),'allowNull':![],'defaultValue':_0x1296('0x4')},'description':{'type':Sequelize[_0x1296('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1296('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1296('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1296('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1296('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1296('0xe')},'dialTimezone':{'type':Sequelize[_0x1296('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1296('0x5')],'defaultValue':_0x1296('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1296('0x3')](_0x1296('0x10'),_0x1296('0x11'),'onlyIfOpen'),'defaultValue':_0x1296('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1296('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1296('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1296('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1296('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1296('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1296('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1296('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1296('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1296('0x18'),_0x1296('0x19')),'defaultValue':_0x1296('0x18')},'dialPrefix':{'type':Sequelize[_0x1296('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1296('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1296('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 43dcbde..c1b0147 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 _0xdc19=['CmHopper','sort','CampaignId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','ListId','toString','updatedAt','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','includeAll','include','show','params','rawAttributes','options','Campaign','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','omit','createdAt','user','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne'];(function(_0x2d7676,_0x1a4420){var _0x38d992=function(_0x3652d6){while(--_0x3652d6){_0x2d7676['push'](_0x2d7676['shift']());}};_0x38d992(++_0x1a4420);}(_0xdc19,0x1ce));var _0x9dc1=function(_0x28a961,_0x552379){_0x28a961=_0x28a961-0x0;var _0x2674f3=_0xdc19[_0x28a961];return _0x2674f3;};'use strict';var emlformat=require(_0x9dc1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9dc1('0x1'));var rp=require(_0x9dc1('0x2'));var moment=require(_0x9dc1('0x3'));var BPromise=require(_0x9dc1('0x4'));var Mustache=require(_0x9dc1('0x5'));var util=require(_0x9dc1('0x6'));var path=require(_0x9dc1('0x7'));var sox=require(_0x9dc1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9dc1('0x9'));var _=require(_0x9dc1('0xa'));var squel=require(_0x9dc1('0xb'));var crypto=require(_0x9dc1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dc1('0xd'));var querystring=require(_0x9dc1('0xe'));var Papa=require('papaparse');var Redis=require(_0x9dc1('0xf'));var authService=require(_0x9dc1('0x10'));var qs=require(_0x9dc1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dc1('0x12'));var logger=require('../../config/logger')(_0x9dc1('0x13'));var utils=require(_0x9dc1('0x14'));var config=require(_0x9dc1('0x15'));var licenseUtil=require(_0x9dc1('0x16'));var db=require(_0x9dc1('0x17'))['db'];function respondWithStatusCode(_0xf43f93,_0x39785c){_0x39785c=_0x39785c||0xcc;return function(_0xb6f400){if(_0xb6f400){return _0xf43f93[_0x9dc1('0x18')](_0x39785c);}return _0xf43f93[_0x9dc1('0x19')](_0x39785c)['end']();};}function respondWithResult(_0x3e4577,_0x570b3c){_0x570b3c=_0x570b3c||0xc8;return function(_0x17c7e3){if(_0x17c7e3){return _0x3e4577[_0x9dc1('0x19')](_0x570b3c)[_0x9dc1('0x1a')](_0x17c7e3);}};}function respondWithFilteredResult(_0x1995ef,_0x3fb9eb){return function(_0x5edfe9){if(_0x5edfe9){var _0x4491bd=typeof _0x3fb9eb['offset']==='undefined'&&typeof _0x3fb9eb[_0x9dc1('0x1b')]===_0x9dc1('0x1c');var _0x5a8683=_0x5edfe9[_0x9dc1('0x1d')];var _0x3f2496=_0x4491bd?0x0:_0x3fb9eb[_0x9dc1('0x1e')];var _0xf7e90b=_0x4491bd?_0x5edfe9[_0x9dc1('0x1d')]:_0x3fb9eb[_0x9dc1('0x1e')]+_0x3fb9eb[_0x9dc1('0x1b')];var _0x493c71;if(_0xf7e90b>=_0x5a8683){_0xf7e90b=_0x5a8683;_0x493c71=0xc8;}else{_0x493c71=0xce;}_0x1995ef[_0x9dc1('0x19')](_0x493c71);return _0x1995ef[_0x9dc1('0x1f')](_0x9dc1('0x20'),_0x3f2496+'-'+_0xf7e90b+'/'+_0x5a8683)[_0x9dc1('0x1a')](_0x5edfe9);}return null;};}function patchUpdates(_0x48bf18){return function(_0x2f79d9){try{jsonpatch['apply'](_0x2f79d9,_0x48bf18,!![]);}catch(_0x17e977){return BPromise[_0x9dc1('0x21')](_0x17e977);}return _0x2f79d9[_0x9dc1('0x22')]();};}function saveUpdates(_0x39d6d4,_0x479823){return function(_0x4ff15b){if(_0x4ff15b){return _0x4ff15b['update'](_0x39d6d4)['then'](function(_0x268b15){return _0x268b15;});}return null;};}function removeEntity(_0x38202a,_0x2c6a9c){return function(_0x469c4b){if(_0x469c4b){return _0x469c4b[_0x9dc1('0x23')]()[_0x9dc1('0x24')](function(){var _0x1e92ce=_0x469c4b[_0x9dc1('0x25')]({'plain':!![]});var _0x312918='IvrCampaigns';return db[_0x9dc1('0x26')][_0x9dc1('0x23')]({'where':{'type':_0x312918,'resourceId':_0x1e92ce['id']}})[_0x9dc1('0x24')](function(){return _0x469c4b;});})['then'](function(){_0x38202a[_0x9dc1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4abee8,_0x3b4e2a){return function(_0x410305){if(!_0x410305){_0x4abee8[_0x9dc1('0x18')](0x194);}return _0x410305;};}function handleError(_0x253901,_0x25f6b1){_0x25f6b1=_0x25f6b1||0x1f4;return function(_0x336ed5){logger[_0x9dc1('0x27')](_0x336ed5[_0x9dc1('0x28')]);if(_0x336ed5[_0x9dc1('0x29')]){delete _0x336ed5['name'];}_0x253901['status'](_0x25f6b1)[_0x9dc1('0x2a')](_0x336ed5);};}exports[_0x9dc1('0x2b')]=function(_0xfa8444,_0x6bf47f){var _0x26eba9={},_0x97d709={},_0x4e1650={'count':0x0,'rows':[]};var _0x386bfa=_[_0x9dc1('0x2c')](db['Campaign']['rawAttributes'],function(_0x471751){return{'name':_0x471751[_0x9dc1('0x2d')],'type':_0x471751['type'][_0x9dc1('0x2e')]};});_0x97d709[_0x9dc1('0x2f')]=_[_0x9dc1('0x2c')](_0x386bfa,_0x9dc1('0x29'));_0x97d709[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0xfa8444[_0x9dc1('0x30')]);_0x97d709[_0x9dc1('0x32')]=_['intersection'](_0x97d709[_0x9dc1('0x2f')],_0x97d709[_0x9dc1('0x30')]);_0x26eba9[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x97d709[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x26eba9[_0x9dc1('0x33')]=_0x26eba9[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x26eba9['attributes']:_0x97d709[_0x9dc1('0x2f')];if(!_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x26eba9[_0x9dc1('0x1b')]=qs['limit'](_0xfa8444[_0x9dc1('0x30')]['limit']);_0x26eba9['offset']=qs[_0x9dc1('0x1e')](_0xfa8444['query']['offset']);}_0x26eba9[_0x9dc1('0x39')]=qs['sort'](_0xfa8444[_0x9dc1('0x30')]['sort']);_0x26eba9['where']=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0xfa8444[_0x9dc1('0x30')],_0x97d709['filters']),_0x386bfa);if(_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x3b')]){_0x26eba9[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x26eba9['where'],{'$or':_[_0x9dc1('0x2c')](_0x386bfa,function(_0x22506e){if(_0x22506e[_0x9dc1('0x3e')]!==_0x9dc1('0x3f')){var _0x2a31ff={};_0x2a31ff[_0x22506e[_0x9dc1('0x29')]]={'$like':'%'+_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x3b')]+'%'};return _0x2a31ff;}})});}_0x26eba9=_[_0x9dc1('0x3d')]({},_0x26eba9,_0xfa8444['options']);var _0x28124b={'where':_0x26eba9[_0x9dc1('0x3c')]};return db['Campaign']['count'](_0x28124b)['then'](function(_0x2505d0){_0x4e1650['count']=_0x2505d0;if(_0xfa8444[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x26eba9[_0x9dc1('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x26eba9);})['then'](function(_0x49ecc8){_0x4e1650['rows']=_0x49ecc8;return _0x4e1650;})[_0x9dc1('0x24')](respondWithFilteredResult(_0x6bf47f,_0x26eba9))['catch'](handleError(_0x6bf47f,null));};exports[_0x9dc1('0x42')]=function(_0x1437ec,_0x13d826){var _0x4452c1={'raw':![],'where':{'id':_0x1437ec[_0x9dc1('0x43')]['id']}},_0xb17783={};_0xb17783[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db['Campaign'][_0x9dc1('0x44')]);_0xb17783[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x1437ec[_0x9dc1('0x30')]);_0xb17783[_0x9dc1('0x32')]=_['intersection'](_0xb17783[_0x9dc1('0x2f')],_0xb17783[_0x9dc1('0x30')]);_0x4452c1['attributes']=_[_0x9dc1('0x34')](_0xb17783['model'],qs[_0x9dc1('0x35')](_0x1437ec[_0x9dc1('0x30')]['fields']));_0x4452c1[_0x9dc1('0x33')]=_0x4452c1[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x4452c1[_0x9dc1('0x33')]:_0xb17783['model'];if(_0x1437ec[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x4452c1[_0x9dc1('0x41')]=[{'all':!![]}];}_0x4452c1=_[_0x9dc1('0x3d')]({},_0x4452c1,_0x1437ec[_0x9dc1('0x45')]);return db[_0x9dc1('0x46')][_0x9dc1('0x47')](_0x4452c1)['then'](handleEntityNotFound(_0x13d826,null))['then'](respondWithResult(_0x13d826,null))[_0x9dc1('0x48')](handleError(_0x13d826,null));};exports['create']=function(_0x6b8bbf,_0xfe2d5a){return db['Campaign'][_0x9dc1('0x49')](_0x6b8bbf[_0x9dc1('0x4a')],{})[_0x9dc1('0x24')](function(_0x59a401){var _0x27f5de=_0x6b8bbf['user'][_0x9dc1('0x25')]({'plain':!![]});if(!_0x27f5de)throw new Error(_0x9dc1('0x4b'));if(_0x27f5de['role']==='user'){var _0x58061e=_0x59a401[_0x9dc1('0x25')]({'plain':!![]});var _0x5a8a9f='IvrCampaigns';return db[_0x9dc1('0x4c')][_0x9dc1('0x47')]({'where':{'name':_0x5a8a9f,'userProfileId':_0x27f5de['userProfileId']},'raw':!![]})['then'](function(_0x10fc18){if(_0x10fc18&&_0x10fc18['autoAssociation']===0x0){return db[_0x9dc1('0x26')][_0x9dc1('0x49')]({'name':_0x58061e[_0x9dc1('0x29')],'resourceId':_0x58061e['id'],'type':_0x10fc18[_0x9dc1('0x29')],'sectionId':_0x10fc18['id']},{})[_0x9dc1('0x24')](function(){return _0x59a401;});}else{return _0x59a401;}})[_0x9dc1('0x48')](function(_0x20c668){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20c668);throw _0x20c668;});}return _0x59a401;})[_0x9dc1('0x24')](respondWithResult(_0xfe2d5a,0xc9))['catch'](handleError(_0xfe2d5a,null));};exports['clone']=function(_0xfc3cc3,_0x8ed882){var _0x539d65={'where':{'id':_0xfc3cc3[_0x9dc1('0x43')]['id']}},_0x14cc91={};_0x14cc91[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x46')][_0x9dc1('0x44')]);_0x539d65[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x14cc91[_0x9dc1('0x2f')],qs['fields'](_0xfc3cc3[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x539d65[_0x9dc1('0x33')]=_0x539d65[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x539d65[_0x9dc1('0x33')]:_0x14cc91[_0x9dc1('0x2f')];if(_0xfc3cc3[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x539d65[_0x9dc1('0x41')]=[{'all':!![]}];}_0x539d65=_[_0x9dc1('0x3d')]({},_0x539d65,_0xfc3cc3['options']);return db[_0x9dc1('0x46')]['find'](_0x539d65)[_0x9dc1('0x24')](handleEntityNotFound(_0x8ed882,null))[_0x9dc1('0x24')](function(_0x1f14d1){if(_0x1f14d1){var _0x337b2c=_0x1f14d1[_0x9dc1('0x25')]({'plain':!![]});_0x337b2c=qs[_0x9dc1('0x4d')](_0x337b2c,['id',_0x9dc1('0x4e'),'updatedAt']);_0xfc3cc3['body']=_[_0x9dc1('0x4d')](_0xfc3cc3[_0x9dc1('0x4a')],['id','createdAt','updatedAt']);return db[_0x9dc1('0x46')][_0x9dc1('0x49')](_[_0x9dc1('0x3d')](_0x337b2c,_0xfc3cc3[_0x9dc1('0x4a')]),{'include':_0xfc3cc3[_0x9dc1('0x30')][_0x9dc1('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x107e9a){var _0x40a324=_0xfc3cc3[_0x9dc1('0x4f')]['get']({'plain':!![]});if(!_0x40a324)throw new Error(_0x9dc1('0x4b'));if(_0x40a324['role']===_0x9dc1('0x4f')){var _0x5b6fbb=_0x107e9a[_0x9dc1('0x25')]({'plain':!![]});var _0x1a8a55=_0x9dc1('0x50');return db[_0x9dc1('0x4c')]['find']({'where':{'name':_0x1a8a55,'userProfileId':_0x40a324['userProfileId']},'raw':!![]})[_0x9dc1('0x24')](function(_0x5cd8fd){if(_0x5cd8fd&&_0x5cd8fd[_0x9dc1('0x51')]===0x0){return db[_0x9dc1('0x26')][_0x9dc1('0x49')]({'name':_0x5b6fbb[_0x9dc1('0x29')],'resourceId':_0x5b6fbb['id'],'type':_0x5cd8fd[_0x9dc1('0x29')],'sectionId':_0x5cd8fd['id']},{})['then'](function(){return _0x107e9a;});}else{return _0x107e9a;}})[_0x9dc1('0x48')](function(_0x4312f8){logger['error'](_0x9dc1('0x52'),_0x4312f8);throw _0x4312f8;});}return _0x107e9a;});}})['then'](respondWithResult(_0x8ed882,0xc9))[_0x9dc1('0x48')](handleError(_0x8ed882,null));};exports[_0x9dc1('0x53')]=function(_0x39b49c,_0x587f98){if(_0x39b49c[_0x9dc1('0x4a')]['id']){delete _0x39b49c[_0x9dc1('0x4a')]['id'];}return db['Campaign'][_0x9dc1('0x47')]({'where':{'id':_0x39b49c['params']['id']}})['then'](handleEntityNotFound(_0x587f98,null))['then'](saveUpdates(_0x39b49c[_0x9dc1('0x4a')],null))[_0x9dc1('0x24')](respondWithResult(_0x587f98,null))[_0x9dc1('0x48')](handleError(_0x587f98,null));};exports[_0x9dc1('0x23')]=function(_0x53deac,_0x2c473a){return db[_0x9dc1('0x46')][_0x9dc1('0x47')]({'where':{'id':_0x53deac[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c473a,null))['then'](removeEntity(_0x2c473a,null))[_0x9dc1('0x48')](handleError(_0x2c473a,null));};exports[_0x9dc1('0x54')]=function(_0x4c785b,_0x1145d5,_0x41cc55){var _0x18ad2c={'raw':!![],'where':{}};var _0x2ddbb6={};var _0x537c14={'count':0x0,'rows':[]};return db['Campaign'][_0x9dc1('0x55')]({'where':{'id':_0x4c785b['params']['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x1145d5,null))[_0x9dc1('0x24')](function(_0x1a066d){if(_0x1a066d){_0x2ddbb6[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x56')][_0x9dc1('0x44')]);_0x2ddbb6[_0x9dc1('0x30')]=_['keys'](_0x4c785b[_0x9dc1('0x30')]);_0x2ddbb6['filters']=_[_0x9dc1('0x34')](_0x2ddbb6[_0x9dc1('0x2f')],_0x2ddbb6[_0x9dc1('0x30')]);_0x18ad2c[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x2ddbb6[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0x4c785b[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x18ad2c[_0x9dc1('0x33')]=_0x18ad2c[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x18ad2c['attributes']:_0x2ddbb6[_0x9dc1('0x2f')];if(!_0x4c785b['query'][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x18ad2c[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x4c785b[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x18ad2c['offset']=qs[_0x9dc1('0x1e')](_0x4c785b[_0x9dc1('0x30')]['offset']);}_0x18ad2c[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x4c785b[_0x9dc1('0x30')]['sort']);_0x18ad2c['where']=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x4c785b[_0x9dc1('0x30')],_0x2ddbb6['filters']));_0x18ad2c[_0x9dc1('0x3c')][_0x9dc1('0x58')]=_0x1a066d['id'];if(_0x4c785b[_0x9dc1('0x30')]['filter']){_0x18ad2c[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x18ad2c['where'],{'$or':_[_0x9dc1('0x2c')](_0x18ad2c[_0x9dc1('0x33')],function(_0x5ca0b2){var _0x252215={};_0x252215[_0x5ca0b2]={'$like':'%'+_0x4c785b[_0x9dc1('0x30')]['filter']+'%'};return _0x252215;})});}_0x18ad2c=_[_0x9dc1('0x3d')]({},_0x18ad2c,_0x4c785b['options']);return db[_0x9dc1('0x56')]['count']({'where':_0x18ad2c['where']})['then'](function(_0x195568){_0x537c14[_0x9dc1('0x1d')]=_0x195568;if(_0x4c785b[_0x9dc1('0x30')]['includeAll']){_0x18ad2c[_0x9dc1('0x41')]=[{'all':!![]}];}return db[_0x9dc1('0x56')][_0x9dc1('0x59')](_0x18ad2c);})[_0x9dc1('0x24')](function(_0x43b7cc){_0x537c14[_0x9dc1('0x5a')]=_0x43b7cc;return _0x537c14;});}})[_0x9dc1('0x24')](respondWithFilteredResult(_0x1145d5,_0x18ad2c))[_0x9dc1('0x48')](handleError(_0x1145d5,null));};exports[_0x9dc1('0x5b')]=function(_0x8f60f5,_0xbeaff2,_0x7b263f){var _0x1b7e1a={'raw':!![],'where':{}};var _0x3b6e86={};var _0x4e6568={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x8f60f5[_0x9dc1('0x43')]['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0xbeaff2,null))[_0x9dc1('0x24')](function(_0x3255dd){if(_0x3255dd){_0x3b6e86['model']=_[_0x9dc1('0x31')](db[_0x9dc1('0x5c')][_0x9dc1('0x44')]);_0x3b6e86[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x8f60f5[_0x9dc1('0x30')]);_0x3b6e86[_0x9dc1('0x32')]=_['intersection'](_0x3b6e86[_0x9dc1('0x2f')],_0x3b6e86[_0x9dc1('0x30')]);_0x1b7e1a['attributes']=_[_0x9dc1('0x34')](_0x3b6e86[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0x8f60f5[_0x9dc1('0x30')]['fields']));_0x1b7e1a['attributes']=_0x1b7e1a['attributes']['length']?_0x1b7e1a[_0x9dc1('0x33')]:_0x3b6e86[_0x9dc1('0x2f')];if(!_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x1b7e1a['limit']=qs['limit'](_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x1b7e1a['offset']=qs[_0x9dc1('0x1e')](_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x1e')]);}_0x1b7e1a[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x1b7e1a[_0x9dc1('0x3c')]=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x8f60f5[_0x9dc1('0x30')],_0x3b6e86[_0x9dc1('0x32')]));_0x1b7e1a[_0x9dc1('0x3c')]['CampaignId']=_0x3255dd['id'];if(_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x3b')]){_0x1b7e1a['where']=_[_0x9dc1('0x3d')](_0x1b7e1a[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x1b7e1a[_0x9dc1('0x33')],function(_0x246248){var _0x57caff={};_0x57caff[_0x246248]={'$like':'%'+_0x8f60f5[_0x9dc1('0x30')]['filter']+'%'};return _0x57caff;})});}_0x1b7e1a=_[_0x9dc1('0x3d')]({},_0x1b7e1a,_0x8f60f5[_0x9dc1('0x45')]);return db['CmHopperHistory'][_0x9dc1('0x1d')]({'where':_0x1b7e1a[_0x9dc1('0x3c')]})[_0x9dc1('0x24')](function(_0x1c14ee){_0x4e6568['count']=_0x1c14ee;if(_0x8f60f5[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x1b7e1a['include']=[{'all':!![]}];}return db[_0x9dc1('0x5c')][_0x9dc1('0x59')](_0x1b7e1a);})[_0x9dc1('0x24')](function(_0x7a8ea7){_0x4e6568[_0x9dc1('0x5a')]=_0x7a8ea7;return _0x4e6568;});}})[_0x9dc1('0x24')](respondWithFilteredResult(_0xbeaff2,_0x1b7e1a))[_0x9dc1('0x48')](handleError(_0xbeaff2,null));};exports[_0x9dc1('0x5d')]=function(_0x52a5d3,_0x546ac1,_0x2602c6){var _0x3a6a52={'raw':!![],'where':{}};var _0x8a4385={};var _0x47b318={'count':0x0,'rows':[]};return db[_0x9dc1('0x46')][_0x9dc1('0x55')]({'where':{'id':_0x52a5d3['params']['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x546ac1,null))[_0x9dc1('0x24')](function(_0x1cb806){if(_0x1cb806){_0x8a4385[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x5e')][_0x9dc1('0x44')]);_0x8a4385[_0x9dc1('0x30')]=_['keys'](_0x52a5d3[_0x9dc1('0x30')]);_0x8a4385['filters']=_[_0x9dc1('0x34')](_0x8a4385[_0x9dc1('0x2f')],_0x8a4385[_0x9dc1('0x30')]);_0x3a6a52[_0x9dc1('0x33')]=_[_0x9dc1('0x34')](_0x8a4385['model'],qs['fields'](_0x52a5d3['query'][_0x9dc1('0x35')]));_0x3a6a52[_0x9dc1('0x33')]=_0x3a6a52[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x3a6a52[_0x9dc1('0x33')]:_0x8a4385[_0x9dc1('0x2f')];if(!_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x3a6a52[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x3a6a52[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x1e')]);}_0x3a6a52[_0x9dc1('0x39')]=qs['sort'](_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x3a6a52[_0x9dc1('0x3c')]=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x52a5d3['query'],_0x8a4385[_0x9dc1('0x32')]));_0x3a6a52[_0x9dc1('0x3c')]['CampaignId']=_0x1cb806['id'];if(_0x52a5d3[_0x9dc1('0x30')]['filter']){_0x3a6a52[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x3a6a52[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x3a6a52[_0x9dc1('0x33')],function(_0x300432){var _0x23b8fd={};_0x23b8fd[_0x300432]={'$like':'%'+_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x3b')]+'%'};return _0x23b8fd;})});}_0x3a6a52=_[_0x9dc1('0x3d')]({},_0x3a6a52,_0x52a5d3['options']);return db['CmHopperFinal'][_0x9dc1('0x1d')]({'where':_0x3a6a52['where']})[_0x9dc1('0x24')](function(_0x38db78){_0x47b318[_0x9dc1('0x1d')]=_0x38db78;if(_0x52a5d3[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x3a6a52[_0x9dc1('0x41')]=[{'all':!![]}];}return db[_0x9dc1('0x5e')][_0x9dc1('0x59')](_0x3a6a52);})['then'](function(_0x4509fe){_0x47b318[_0x9dc1('0x5a')]=_0x4509fe;return _0x47b318;});}})['then'](respondWithFilteredResult(_0x546ac1,_0x3a6a52))[_0x9dc1('0x48')](handleError(_0x546ac1,null));};exports[_0x9dc1('0x5f')]=function(_0x5523f7,_0x6448dd,_0x11a96b){var _0x434528={'raw':!![],'where':{}};var _0x5b0647={};var _0x1165fa={'count':0x0,'rows':[]};return db[_0x9dc1('0x46')][_0x9dc1('0x55')]({'where':{'id':_0x5523f7['params']['id']}})['then'](handleEntityNotFound(_0x6448dd,null))[_0x9dc1('0x24')](function(_0x464ea2){if(_0x464ea2){_0x5b0647[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x60')][_0x9dc1('0x44')]);_0x5b0647[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x5523f7[_0x9dc1('0x30')]);_0x5b0647[_0x9dc1('0x32')]=_[_0x9dc1('0x34')](_0x5b0647[_0x9dc1('0x2f')],_0x5b0647[_0x9dc1('0x30')]);_0x434528[_0x9dc1('0x33')]=_['intersection'](_0x5b0647[_0x9dc1('0x2f')],qs['fields'](_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x434528['attributes']=_0x434528['attributes'][_0x9dc1('0x36')]?_0x434528[_0x9dc1('0x33')]:_0x5b0647[_0x9dc1('0x2f')];if(!_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x434528[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x434528[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x1e')]);}_0x434528[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x5523f7[_0x9dc1('0x30')]['sort']);_0x434528[_0x9dc1('0x3c')]=qs['filters'](_[_0x9dc1('0x3a')](_0x5523f7[_0x9dc1('0x30')],_0x5b0647[_0x9dc1('0x32')]));_0x434528['where'][_0x9dc1('0x58')]=_0x464ea2['id'];if(_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x3b')]){_0x434528['where']=_[_0x9dc1('0x3d')](_0x434528[_0x9dc1('0x3c')],{'$or':_['map'](_0x434528['attributes'],function(_0x28e154){var _0x28aba4={};_0x28aba4[_0x28e154]={'$like':'%'+_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x3b')]+'%'};return _0x28aba4;})});}_0x434528=_[_0x9dc1('0x3d')]({},_0x434528,_0x5523f7[_0x9dc1('0x45')]);return db[_0x9dc1('0x60')][_0x9dc1('0x1d')]({'where':_0x434528[_0x9dc1('0x3c')]})[_0x9dc1('0x24')](function(_0x5a6304){_0x1165fa[_0x9dc1('0x1d')]=_0x5a6304;if(_0x5523f7[_0x9dc1('0x30')][_0x9dc1('0x40')]){_0x434528[_0x9dc1('0x41')]=[{'all':!![]}];}return db[_0x9dc1('0x60')]['findAll'](_0x434528);})['then'](function(_0x5d3cfb){_0x1165fa[_0x9dc1('0x5a')]=_0x5d3cfb;return _0x1165fa;});}})[_0x9dc1('0x24')](respondWithFilteredResult(_0x6448dd,_0x434528))[_0x9dc1('0x48')](handleError(_0x6448dd,null));};exports['getLists']=function(_0x2382df,_0x22217f,_0x41320e){var _0x113c99={};var _0x43ca93={};var _0x2be239;var _0x4a8bf6;return db['Campaign'][_0x9dc1('0x55')]({'where':{'id':_0x2382df['params']['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x22217f,null))[_0x9dc1('0x24')](function(_0x5c5dd1){if(_0x5c5dd1){_0x2be239=_0x5c5dd1;_0x43ca93[_0x9dc1('0x2f')]=_[_0x9dc1('0x31')](db[_0x9dc1('0x61')][_0x9dc1('0x44')]);_0x43ca93['query']=_[_0x9dc1('0x31')](_0x2382df[_0x9dc1('0x30')]);_0x43ca93[_0x9dc1('0x32')]=_['intersection'](_0x43ca93[_0x9dc1('0x2f')],_0x43ca93[_0x9dc1('0x30')]);_0x113c99[_0x9dc1('0x33')]=_['intersection'](_0x43ca93['model'],qs[_0x9dc1('0x35')](_0x2382df[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x113c99[_0x9dc1('0x33')]=_0x113c99[_0x9dc1('0x33')]['length']?_0x113c99[_0x9dc1('0x33')]:_0x43ca93[_0x9dc1('0x2f')];_0x113c99[_0x9dc1('0x39')]=qs[_0x9dc1('0x57')](_0x2382df[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x113c99[_0x9dc1('0x3c')]=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x2382df[_0x9dc1('0x30')],_0x43ca93['filters']));if(_0x2382df['query'][_0x9dc1('0x3b')]){_0x113c99[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x113c99[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x113c99[_0x9dc1('0x33')],function(_0x5c1b06){var _0x48e3ea={};_0x48e3ea[_0x5c1b06]={'$like':'%'+_0x2382df[_0x9dc1('0x30')]['filter']+'%'};return _0x48e3ea;})});}_0x113c99=_[_0x9dc1('0x3d')]({},_0x113c99,_0x2382df[_0x9dc1('0x45')]);return _0x2be239[_0x9dc1('0x62')](_0x113c99);}})['then'](function(_0x1d4606){if(_0x1d4606){_0x4a8bf6=_0x1d4606['length'];if(!_0x2382df[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x113c99[_0x9dc1('0x1b')]=qs[_0x9dc1('0x1b')](_0x2382df['query'][_0x9dc1('0x1b')]);_0x113c99[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x2382df['query'][_0x9dc1('0x1e')]);}return _0x2be239[_0x9dc1('0x62')](_0x113c99);}})[_0x9dc1('0x24')](function(_0x199d40){if(_0x199d40){return _0x199d40?{'count':_0x4a8bf6,'rows':_0x199d40}:null;}})['then'](respondWithResult(_0x22217f,null))[_0x9dc1('0x48')](handleError(_0x22217f,null));};exports[_0x9dc1('0x63')]=function(_0x1ba42e,_0x492518,_0x129db8){var _0x1d84f4,_0x5e1123;return db[_0x9dc1('0x46')]['find']({'where':{'id':_0x1ba42e[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x492518,null))[_0x9dc1('0x24')](function(_0x542724){if(_0x542724){_0x5e1123=_0x542724;return _0x542724[_0x9dc1('0x63')](_0x1ba42e['body'][_0x9dc1('0x64')],_['omit'](_0x1ba42e[_0x9dc1('0x4a')],['ids','id'])||{});}return null;})[_0x9dc1('0x65')](function(_0x173d05){var _0x466bd8;_0x1d84f4=_0x173d05||[];var _0x7c6ed9=[];if(_0x173d05){for(var _0x54bc1e=0x0;_0x54bc1e<_0x173d05[_0x9dc1('0x36')];_0x54bc1e+=0x1){var _0x513109=_0x173d05[_0x54bc1e][_0x9dc1('0x25')]({'plain':!![]});_0x5e1123[_0x9dc1('0x66')]=_0x1ba42e[_0x9dc1('0x4a')][_0x9dc1('0x66')]?_0x1ba42e[_0x9dc1('0x4a')][_0x9dc1('0x66')]:_0x5e1123[_0x9dc1('0x66')];switch(_0x5e1123[_0x9dc1('0x66')]){case _0x9dc1('0x67'):_0x466bd8=squel[_0x9dc1('0x68')]()['into'](_0x9dc1('0x69'))[_0x9dc1('0x6a')]([_0x9dc1('0x6b'),'scheduledAt',_0x9dc1('0x6c'),'ListId',_0x9dc1('0x58'),_0x9dc1('0x4e'),'updatedAt'],squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x6b'),_0x9dc1('0x6b'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x70'))[_0x9dc1('0x6e')]('id',_0x9dc1('0x6c'))[_0x9dc1('0x6e')](_0x513109['CmListId']['toString'](),_0x9dc1('0x71'))[_0x9dc1('0x6e')](_0x1ba42e[_0x9dc1('0x43')]['id'][_0x9dc1('0x72')](),_0x9dc1('0x58'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x4e'))['field'](_0x9dc1('0x6f'),_0x9dc1('0x73'))[_0x9dc1('0x74')](_0x9dc1('0x75'))[_0x9dc1('0x3c')]('deletedAt\x20IS\x20NULL')[_0x9dc1('0x3c')](_0x9dc1('0x76'),_0x513109[_0x9dc1('0x77')]['toString']())[_0x9dc1('0x3c')](_0x9dc1('0x78'))[_0x9dc1('0x3c')](_0x9dc1('0x79'),squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x7a'))[_0x9dc1('0x74')](_0x9dc1('0x7b'))[_0x9dc1('0x3c')](_0x9dc1('0x7c'),_0x1ba42e[_0x9dc1('0x43')]['id']['toString']()))[_0x9dc1('0x3c')](_0x9dc1('0x79'),squel['select']()[_0x9dc1('0x6e')]('COALESCE(phone,\x27\x27)')['from'](_0x9dc1('0x69'))[_0x9dc1('0x3c')]('CampaignId\x20=\x20?',_0x1ba42e['params']['id'][_0x9dc1('0x72')]())))['toString']();break;case _0x9dc1('0x7d'):_0x466bd8=squel[_0x9dc1('0x68')]()[_0x9dc1('0x7e')]('cm_hopper')[_0x9dc1('0x6a')]([_0x9dc1('0x6b'),'scheduledAt',_0x9dc1('0x6c'),_0x9dc1('0x71'),_0x9dc1('0x58'),_0x9dc1('0x4e'),_0x9dc1('0x73')],squel[_0x9dc1('0x6d')]()['field']('phone',_0x9dc1('0x6b'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x70'))[_0x9dc1('0x6e')]('id',_0x9dc1('0x6c'))['field'](_0x513109[_0x9dc1('0x77')][_0x9dc1('0x72')](),_0x9dc1('0x71'))['field'](_0x1ba42e[_0x9dc1('0x43')]['id'][_0x9dc1('0x72')](),_0x9dc1('0x58'))[_0x9dc1('0x6e')]('NOW()',_0x9dc1('0x4e'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x73'))[_0x9dc1('0x74')](_0x9dc1('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0x9dc1('0x3c')](_0x9dc1('0x76'),_0x513109[_0x9dc1('0x77')][_0x9dc1('0x72')]())[_0x9dc1('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x9dc1('0x3c')](_0x9dc1('0x79'),squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x7f'))[_0x9dc1('0x74')](_0x9dc1('0x69'))[_0x9dc1('0x3c')](_0x9dc1('0x7c'),_0x1ba42e[_0x9dc1('0x43')]['id'][_0x9dc1('0x72')]())))[_0x9dc1('0x72')]();break;default:_0x466bd8=squel[_0x9dc1('0x68')]()['into'](_0x9dc1('0x69'))['fromQuery'](['phone','scheduledAt',_0x9dc1('0x6c'),_0x9dc1('0x71'),_0x9dc1('0x58'),'createdAt','updatedAt'],squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x6b'),_0x9dc1('0x6b'))['field'](_0x9dc1('0x6f'),'scheduledAt')[_0x9dc1('0x6e')]('id',_0x9dc1('0x6c'))[_0x9dc1('0x6e')](_0x513109['CmListId'][_0x9dc1('0x72')](),'ListId')[_0x9dc1('0x6e')](_0x1ba42e['params']['id'][_0x9dc1('0x72')](),_0x9dc1('0x58'))[_0x9dc1('0x6e')]('NOW()',_0x9dc1('0x4e'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),'updatedAt')['from'](_0x9dc1('0x75'))[_0x9dc1('0x3c')](_0x9dc1('0x80'))[_0x9dc1('0x3c')]('ListId\x20=\x20?',_0x513109[_0x9dc1('0x77')][_0x9dc1('0x72')]())[_0x9dc1('0x3c')](_0x9dc1('0x78')))['toString']();}_0x7c6ed9['push'](db[_0x9dc1('0x81')][_0x9dc1('0x30')](_0x466bd8));}return BPromise[_0x9dc1('0x82')](_0x7c6ed9);}})[_0x9dc1('0x24')](function(){return _0x1d84f4;})[_0x9dc1('0x24')](respondWithResult(_0x492518,null))['catch'](handleError(_0x492518,null));};exports[_0x9dc1('0x83')]=function(_0x4991db,_0x368859,_0x745486){return db[_0x9dc1('0x46')][_0x9dc1('0x47')]({'where':{'id':_0x4991db[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x368859,null))[_0x9dc1('0x24')](function(_0x27991a){if(_0x27991a){return _0x27991a[_0x9dc1('0x83')](_0x4991db[_0x9dc1('0x30')]['ids']);}})[_0x9dc1('0x24')](function(_0x5f48d5){if(_0x5f48d5){return db['CmHopper'][_0x9dc1('0x23')]({'where':{'ListId':_0x4991db['query'][_0x9dc1('0x64')],'CampaignId':_0x4991db[_0x9dc1('0x43')]['id']}})['then'](function(){return _0x5f48d5;});}})[_0x9dc1('0x24')](respondWithStatusCode(_0x368859,null))[_0x9dc1('0x48')](handleError(_0x368859,null));};exports[_0x9dc1('0x84')]=function(_0x5a0b69,_0x2a7e63,_0x4ffaba){var _0x2b1555={};var _0x51800d={};var _0x497115;var _0x109aa1;return db['Campaign'][_0x9dc1('0x55')]({'where':{'id':_0x5a0b69['params']['id']}})['then'](handleEntityNotFound(_0x2a7e63,null))[_0x9dc1('0x24')](function(_0x55f0bb){if(_0x55f0bb){_0x497115=_0x55f0bb;_0x51800d['model']=_['keys'](db[_0x9dc1('0x61')][_0x9dc1('0x44')]);_0x51800d[_0x9dc1('0x30')]=_[_0x9dc1('0x31')](_0x5a0b69[_0x9dc1('0x30')]);_0x51800d['filters']=_[_0x9dc1('0x34')](_0x51800d[_0x9dc1('0x2f')],_0x51800d[_0x9dc1('0x30')]);_0x2b1555[_0x9dc1('0x33')]=_['intersection'](_0x51800d[_0x9dc1('0x2f')],qs[_0x9dc1('0x35')](_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x35')]));_0x2b1555[_0x9dc1('0x33')]=_0x2b1555[_0x9dc1('0x33')][_0x9dc1('0x36')]?_0x2b1555[_0x9dc1('0x33')]:_0x51800d[_0x9dc1('0x2f')];_0x2b1555['order']=qs[_0x9dc1('0x57')](_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x57')]);_0x2b1555['where']=qs[_0x9dc1('0x32')](_[_0x9dc1('0x3a')](_0x5a0b69[_0x9dc1('0x30')],_0x51800d[_0x9dc1('0x32')]));if(_0x5a0b69['query'][_0x9dc1('0x3b')]){_0x2b1555[_0x9dc1('0x3c')]=_[_0x9dc1('0x3d')](_0x2b1555[_0x9dc1('0x3c')],{'$or':_[_0x9dc1('0x2c')](_0x2b1555[_0x9dc1('0x33')],function(_0x2113a4){var _0x3982f5={};_0x3982f5[_0x2113a4]={'$like':'%'+_0x5a0b69[_0x9dc1('0x30')]['filter']+'%'};return _0x3982f5;})});}_0x2b1555=_[_0x9dc1('0x3d')]({},_0x2b1555,_0x5a0b69[_0x9dc1('0x45')]);return _0x497115['getBlackLists'](_0x2b1555);}})['then'](function(_0x160b5c){if(_0x160b5c){_0x109aa1=_0x160b5c[_0x9dc1('0x36')];if(!_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x37')](_0x9dc1('0x38'))){_0x2b1555['limit']=qs['limit'](_0x5a0b69[_0x9dc1('0x30')][_0x9dc1('0x1b')]);_0x2b1555[_0x9dc1('0x1e')]=qs[_0x9dc1('0x1e')](_0x5a0b69[_0x9dc1('0x30')]['offset']);}return _0x497115[_0x9dc1('0x84')](_0x2b1555);}})[_0x9dc1('0x24')](function(_0x2542ab){if(_0x2542ab){return _0x2542ab?{'count':_0x109aa1,'rows':_0x2542ab}:null;}})[_0x9dc1('0x24')](respondWithResult(_0x2a7e63,null))[_0x9dc1('0x48')](handleError(_0x2a7e63,null));};exports['addBlackLists']=function(_0xaeeb7c,_0x22531e,_0x2460d7){var _0x2669af,_0x205588;return db[_0x9dc1('0x46')][_0x9dc1('0x47')]({'where':{'id':_0xaeeb7c[_0x9dc1('0x43')]['id']}})['then'](handleEntityNotFound(_0x22531e,null))[_0x9dc1('0x24')](function(_0x42eefe){if(_0x42eefe){_0x205588=_0x42eefe;return _0x42eefe[_0x9dc1('0x85')](_0xaeeb7c['body'][_0x9dc1('0x64')],_[_0x9dc1('0x4d')](_0xaeeb7c[_0x9dc1('0x4a')],['ids','id'])||{});}return null;})[_0x9dc1('0x65')](function(_0x11b52d){var _0xbb0b15;_0x2669af=_0x11b52d||[];var _0xb6d35e=[];if(_0x11b52d){for(var _0xfdccf7=0x0;_0xfdccf7<_0x11b52d[_0x9dc1('0x36')];_0xfdccf7+=0x1){var _0x3e55f0=_0x11b52d[_0xfdccf7][_0x9dc1('0x25')]({'plain':!![]});_0xbb0b15=squel[_0x9dc1('0x68')]()[_0x9dc1('0x7e')](_0x9dc1('0x86'))[_0x9dc1('0x6a')]([_0x9dc1('0x6b'),_0x9dc1('0x6c'),_0x9dc1('0x71'),_0x9dc1('0x58'),_0x9dc1('0x4e'),_0x9dc1('0x73')],squel[_0x9dc1('0x6d')]()[_0x9dc1('0x6e')](_0x9dc1('0x6b'),_0x9dc1('0x6b'))[_0x9dc1('0x6e')]('id','ContactId')['field'](_0x3e55f0[_0x9dc1('0x77')][_0x9dc1('0x72')](),_0x9dc1('0x71'))[_0x9dc1('0x6e')](_0xaeeb7c[_0x9dc1('0x43')]['id']['toString'](),_0x9dc1('0x58'))[_0x9dc1('0x6e')](_0x9dc1('0x6f'),_0x9dc1('0x4e'))['field'](_0x9dc1('0x6f'),_0x9dc1('0x73'))['from']('cm_contacts')['where'](_0x9dc1('0x80'))[_0x9dc1('0x3c')](_0x9dc1('0x76'),_0x3e55f0[_0x9dc1('0x77')][_0x9dc1('0x72')]())[_0x9dc1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x9dc1('0x72')]();_0xb6d35e[_0x9dc1('0x87')](db[_0x9dc1('0x81')][_0x9dc1('0x30')](_0xbb0b15));}return BPromise['all'](_0xb6d35e);}})['then'](function(){return _0x2669af;})[_0x9dc1('0x24')](respondWithResult(_0x22531e,null))[_0x9dc1('0x48')](handleError(_0x22531e,null));};exports[_0x9dc1('0x88')]=function(_0x211c00,_0x180ddb,_0x4ae02a){return db['Campaign'][_0x9dc1('0x47')]({'where':{'id':_0x211c00[_0x9dc1('0x43')]['id']}})[_0x9dc1('0x24')](handleEntityNotFound(_0x180ddb,null))[_0x9dc1('0x24')](function(_0x3e251d){if(_0x3e251d){return _0x3e251d[_0x9dc1('0x88')](_0x211c00[_0x9dc1('0x30')][_0x9dc1('0x64')]);}})[_0x9dc1('0x24')](function(_0x30c047){if(_0x30c047){return db[_0x9dc1('0x60')][_0x9dc1('0x23')]({'where':{'ListId':_0x211c00[_0x9dc1('0x30')]['ids'],'CampaignId':_0x211c00[_0x9dc1('0x43')]['id']}})['then'](function(){return _0x30c047;});}})['then'](respondWithStatusCode(_0x180ddb,null))[_0x9dc1('0x48')](handleError(_0x180ddb,null));};
\ No newline at end of file
+var _0x6ccb=['rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','role','UserProfileSection','destroy','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','ListId','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','CmListId','cm_contacts','ListId\x20=\x20?','insert','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','Campaign','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','params','keys'];(function(_0x154f6a,_0x4c617b){var _0x833e6e=function(_0x255f83){while(--_0x255f83){_0x154f6a['push'](_0x154f6a['shift']());}};_0x833e6e(++_0x4c617b);}(_0x6ccb,0xc9));var _0xb6cc=function(_0x54218b,_0x456eca){_0x54218b=_0x54218b-0x0;var _0x54f8da=_0x6ccb[_0x54218b];return _0x54f8da;};'use strict';var emlformat=require(_0xb6cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb6cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb6cc('0x2'));var BPromise=require(_0xb6cc('0x3'));var Mustache=require('mustache');var util=require(_0xb6cc('0x4'));var path=require(_0xb6cc('0x5'));var sox=require('sox');var csv=require(_0xb6cc('0x6'));var ejs=require(_0xb6cc('0x7'));var fs=require('fs');var fs_extra=require(_0xb6cc('0x8'));var _=require(_0xb6cc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb6cc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb6cc('0x6'));var querystring=require('querystring');var Papa=require(_0xb6cc('0xb'));var Redis=require(_0xb6cc('0xc'));var authService=require(_0xb6cc('0xd'));var qs=require(_0xb6cc('0xe'));var as=require(_0xb6cc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6cc('0x10'))(_0xb6cc('0x11'));var utils=require(_0xb6cc('0x12'));var config=require(_0xb6cc('0x13'));var licenseUtil=require(_0xb6cc('0x14'));var db=require(_0xb6cc('0x15'))['db'];function respondWithStatusCode(_0x6fc8b0,_0x5960ea){_0x5960ea=_0x5960ea||0xcc;return function(_0x5c9cd4){if(_0x5c9cd4){return _0x6fc8b0[_0xb6cc('0x16')](_0x5960ea);}return _0x6fc8b0[_0xb6cc('0x17')](_0x5960ea)[_0xb6cc('0x18')]();};}function respondWithResult(_0x16ec67,_0x35e602){_0x35e602=_0x35e602||0xc8;return function(_0x243537){if(_0x243537){return _0x16ec67[_0xb6cc('0x17')](_0x35e602)[_0xb6cc('0x19')](_0x243537);}};}function respondWithFilteredResult(_0x18b801,_0x50e3da){return function(_0x345878){if(_0x345878){var _0x4334f3=typeof _0x50e3da[_0xb6cc('0x1a')]===_0xb6cc('0x1b')&&typeof _0x50e3da[_0xb6cc('0x1c')]==='undefined';var _0x2c287f=_0x345878[_0xb6cc('0x1d')];var _0x8a2295=_0x4334f3?0x0:_0x50e3da['offset'];var _0x1b5d61=_0x4334f3?_0x345878[_0xb6cc('0x1d')]:_0x50e3da[_0xb6cc('0x1a')]+_0x50e3da['limit'];var _0x563733;if(_0x1b5d61>=_0x2c287f){_0x1b5d61=_0x2c287f;_0x563733=0xc8;}else{_0x563733=0xce;}_0x18b801[_0xb6cc('0x17')](_0x563733);return _0x18b801[_0xb6cc('0x1e')](_0xb6cc('0x1f'),_0x8a2295+'-'+_0x1b5d61+'/'+_0x2c287f)[_0xb6cc('0x19')](_0x345878);}return null;};}function patchUpdates(_0x2a81b7){return function(_0x157489){try{jsonpatch[_0xb6cc('0x20')](_0x157489,_0x2a81b7,!![]);}catch(_0x37afd3){return BPromise['reject'](_0x37afd3);}return _0x157489[_0xb6cc('0x21')]();};}function saveUpdates(_0x3f20ca,_0x23ceb7){return function(_0x48c65e){if(_0x48c65e){return _0x48c65e[_0xb6cc('0x22')](_0x3f20ca)['then'](function(_0x1f173a){return _0x1f173a;});}return null;};}function removeEntity(_0x271f38,_0x22470f){return function(_0x39a197){if(_0x39a197){return _0x39a197['destroy']()['then'](function(){var _0x4adb76=_0x39a197['get']({'plain':!![]});var _0x5ddfb4=_0xb6cc('0x23');return db[_0xb6cc('0x24')]['destroy']({'where':{'type':_0x5ddfb4,'resourceId':_0x4adb76['id']}})[_0xb6cc('0x25')](function(){return _0x39a197;});})[_0xb6cc('0x25')](function(){_0x271f38['status'](0xcc)[_0xb6cc('0x18')]();});}};}function handleEntityNotFound(_0x1506ff,_0x5e28d3){return function(_0x159cc0){if(!_0x159cc0){_0x1506ff[_0xb6cc('0x16')](0x194);}return _0x159cc0;};}function handleError(_0x28b951,_0x34b09e){_0x34b09e=_0x34b09e||0x1f4;return function(_0xf676f6){logger[_0xb6cc('0x26')](_0xf676f6[_0xb6cc('0x27')]);if(_0xf676f6['name']){delete _0xf676f6[_0xb6cc('0x28')];}_0x28b951[_0xb6cc('0x17')](_0x34b09e)[_0xb6cc('0x29')](_0xf676f6);};}exports[_0xb6cc('0x2a')]=function(_0x50aa51,_0x130b47){var _0x3d7e8f={},_0x89b079={},_0x434c={'count':0x0,'rows':[]};var _0x305027=_[_0xb6cc('0x2b')](db[_0xb6cc('0x2c')]['rawAttributes'],function(_0xededf6){return{'name':_0xededf6[_0xb6cc('0x2d')],'type':_0xededf6['type']['key']};});_0x89b079[_0xb6cc('0x2e')]=_['map'](_0x305027,_0xb6cc('0x28'));_0x89b079[_0xb6cc('0x2f')]=_['keys'](_0x50aa51[_0xb6cc('0x2f')]);_0x89b079[_0xb6cc('0x30')]=_['intersection'](_0x89b079[_0xb6cc('0x2e')],_0x89b079[_0xb6cc('0x2f')]);_0x3d7e8f[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x89b079['model'],qs[_0xb6cc('0x33')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x3d7e8f[_0xb6cc('0x31')]=_0x3d7e8f[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x3d7e8f['attributes']:_0x89b079['model'];if(!_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x35')](_0xb6cc('0x36'))){_0x3d7e8f['limit']=qs[_0xb6cc('0x1c')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x3d7e8f[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x1a')]);}_0x3d7e8f[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x3d7e8f['where']=qs[_0xb6cc('0x30')](_[_0xb6cc('0x39')](_0x50aa51[_0xb6cc('0x2f')],_0x89b079['filters']),_0x305027);if(_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x3d7e8f[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0x3d7e8f[_0xb6cc('0x3b')],{'$or':_['map'](_0x305027,function(_0x260e6c){if(_0x260e6c['type']!=='VIRTUAL'){var _0x44792b={};_0x44792b[_0x260e6c[_0xb6cc('0x28')]]={'$like':'%'+_0x50aa51[_0xb6cc('0x2f')]['filter']+'%'};return _0x44792b;}})});}_0x3d7e8f=_['merge']({},_0x3d7e8f,_0x50aa51[_0xb6cc('0x3d')]);var _0x15fca3={'where':_0x3d7e8f[_0xb6cc('0x3b')]};return db[_0xb6cc('0x2c')][_0xb6cc('0x1d')](_0x15fca3)[_0xb6cc('0x25')](function(_0x163159){_0x434c[_0xb6cc('0x1d')]=_0x163159;if(_0x50aa51['query'][_0xb6cc('0x3e')]){_0x3d7e8f[_0xb6cc('0x3f')]=[{'all':!![]}];}return db[_0xb6cc('0x2c')]['findAll'](_0x3d7e8f);})[_0xb6cc('0x25')](function(_0x4f0d22){_0x434c[_0xb6cc('0x40')]=_0x4f0d22;return _0x434c;})[_0xb6cc('0x25')](respondWithFilteredResult(_0x130b47,_0x3d7e8f))['catch'](handleError(_0x130b47,null));};exports['show']=function(_0x5b8c59,_0x7a3934){var _0x2c7218={'raw':![],'where':{'id':_0x5b8c59[_0xb6cc('0x41')]['id']}},_0x2aa1dc={};_0x2aa1dc[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x2c')][_0xb6cc('0x43')]);_0x2aa1dc['query']=_[_0xb6cc('0x42')](_0x5b8c59[_0xb6cc('0x2f')]);_0x2aa1dc['filters']=_[_0xb6cc('0x32')](_0x2aa1dc[_0xb6cc('0x2e')],_0x2aa1dc[_0xb6cc('0x2f')]);_0x2c7218[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x2aa1dc['model'],qs['fields'](_0x5b8c59[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x2c7218[_0xb6cc('0x31')]=_0x2c7218[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x2c7218[_0xb6cc('0x31')]:_0x2aa1dc[_0xb6cc('0x2e')];if(_0x5b8c59['query']['includeAll']){_0x2c7218[_0xb6cc('0x3f')]=[{'all':!![]}];}_0x2c7218=_['merge']({},_0x2c7218,_0x5b8c59['options']);return db[_0xb6cc('0x2c')][_0xb6cc('0x44')](_0x2c7218)[_0xb6cc('0x25')](handleEntityNotFound(_0x7a3934,null))[_0xb6cc('0x25')](respondWithResult(_0x7a3934,null))[_0xb6cc('0x45')](handleError(_0x7a3934,null));};exports[_0xb6cc('0x46')]=function(_0x2e8e3f,_0x18e70e){return db[_0xb6cc('0x2c')][_0xb6cc('0x46')](_0x2e8e3f['body'],{})['then'](function(_0x354e4a){var _0x369851=_0x2e8e3f[_0xb6cc('0x47')][_0xb6cc('0x48')]({'plain':!![]});if(!_0x369851)throw new Error(_0xb6cc('0x49'));if(_0x369851['role']===_0xb6cc('0x47')){var _0x4da830=_0x354e4a[_0xb6cc('0x48')]({'plain':!![]});var _0x21d1c6=_0xb6cc('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x21d1c6,'userProfileId':_0x369851[_0xb6cc('0x4a')]},'raw':!![]})[_0xb6cc('0x25')](function(_0x35cb0f){if(_0x35cb0f&&_0x35cb0f[_0xb6cc('0x4b')]===0x0){return db[_0xb6cc('0x24')][_0xb6cc('0x46')]({'name':_0x4da830[_0xb6cc('0x28')],'resourceId':_0x4da830['id'],'type':_0x35cb0f[_0xb6cc('0x28')],'sectionId':_0x35cb0f['id']},{})[_0xb6cc('0x25')](function(){return _0x354e4a;});}else{return _0x354e4a;}})['catch'](function(_0x239b87){logger['error'](_0xb6cc('0x4c'),_0x239b87);throw _0x239b87;});}return _0x354e4a;})[_0xb6cc('0x25')](respondWithResult(_0x18e70e,0xc9))[_0xb6cc('0x45')](handleError(_0x18e70e,null));};exports[_0xb6cc('0x4d')]=function(_0x7bbb71,_0x261139){var _0x3c0fcb={'where':{'id':_0x7bbb71[_0xb6cc('0x41')]['id']}},_0x158a55={};_0x158a55[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x2c')][_0xb6cc('0x43')]);_0x3c0fcb[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x158a55[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x3c0fcb['attributes']=_0x3c0fcb['attributes'][_0xb6cc('0x34')]?_0x3c0fcb[_0xb6cc('0x31')]:_0x158a55['model'];if(_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x3c0fcb['include']=[{'all':!![]}];}_0x3c0fcb=_[_0xb6cc('0x3c')]({},_0x3c0fcb,_0x7bbb71[_0xb6cc('0x3d')]);return db[_0xb6cc('0x2c')][_0xb6cc('0x44')](_0x3c0fcb)[_0xb6cc('0x25')](handleEntityNotFound(_0x261139,null))[_0xb6cc('0x25')](function(_0x23da13){if(_0x23da13){var _0x376c78=_0x23da13[_0xb6cc('0x48')]({'plain':!![]});_0x376c78=qs[_0xb6cc('0x4e')](_0x376c78,['id','createdAt',_0xb6cc('0x4f')]);_0x7bbb71[_0xb6cc('0x50')]=_[_0xb6cc('0x4e')](_0x7bbb71[_0xb6cc('0x50')],['id','createdAt','updatedAt']);return db[_0xb6cc('0x2c')][_0xb6cc('0x46')](_['merge'](_0x376c78,_0x7bbb71['body']),{'include':_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0xe30e32){var _0x2e2669=_0x7bbb71[_0xb6cc('0x47')][_0xb6cc('0x48')]({'plain':!![]});if(!_0x2e2669)throw new Error(_0xb6cc('0x49'));if(_0x2e2669[_0xb6cc('0x51')]===_0xb6cc('0x47')){var _0x24ace9=_0xe30e32[_0xb6cc('0x48')]({'plain':!![]});var _0x173fe6=_0xb6cc('0x23');return db[_0xb6cc('0x52')]['find']({'where':{'name':_0x173fe6,'userProfileId':_0x2e2669[_0xb6cc('0x4a')]},'raw':!![]})[_0xb6cc('0x25')](function(_0x579653){if(_0x579653&&_0x579653[_0xb6cc('0x4b')]===0x0){return db['UserProfileResource'][_0xb6cc('0x46')]({'name':_0x24ace9[_0xb6cc('0x28')],'resourceId':_0x24ace9['id'],'type':_0x579653[_0xb6cc('0x28')],'sectionId':_0x579653['id']},{})[_0xb6cc('0x25')](function(){return _0xe30e32;});}else{return _0xe30e32;}})[_0xb6cc('0x45')](function(_0x560cd5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560cd5);throw _0x560cd5;});}return _0xe30e32;});}})[_0xb6cc('0x25')](respondWithResult(_0x261139,0xc9))[_0xb6cc('0x45')](handleError(_0x261139,null));};exports[_0xb6cc('0x22')]=function(_0x23c605,_0x2712bc){if(_0x23c605[_0xb6cc('0x50')]['id']){delete _0x23c605[_0xb6cc('0x50')]['id'];}return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x23c605[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x2712bc,null))['then'](saveUpdates(_0x23c605['body'],null))[_0xb6cc('0x25')](respondWithResult(_0x2712bc,null))['catch'](handleError(_0x2712bc,null));};exports[_0xb6cc('0x53')]=function(_0x4b55fd,_0x54d1c1){return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x4b55fd['params']['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x54d1c1,null))[_0xb6cc('0x25')](removeEntity(_0x54d1c1,null))[_0xb6cc('0x45')](handleError(_0x54d1c1,null));};exports[_0xb6cc('0x54')]=function(_0x42ce68,_0xa82a45,_0x5803f6){var _0x47f83c={'raw':!![],'where':{}};var _0x1aa2fa={};var _0x84b5f7={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x42ce68[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0xa82a45,null))[_0xb6cc('0x25')](function(_0x3010b3){if(_0x3010b3){_0x1aa2fa[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db['CmHopper'][_0xb6cc('0x43')]);_0x1aa2fa['query']=_[_0xb6cc('0x42')](_0x42ce68[_0xb6cc('0x2f')]);_0x1aa2fa['filters']=_[_0xb6cc('0x32')](_0x1aa2fa['model'],_0x1aa2fa[_0xb6cc('0x2f')]);_0x47f83c[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x1aa2fa[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x42ce68[_0xb6cc('0x2f')]['fields']));_0x47f83c[_0xb6cc('0x31')]=_0x47f83c['attributes']['length']?_0x47f83c[_0xb6cc('0x31')]:_0x1aa2fa[_0xb6cc('0x2e')];if(!_0x42ce68[_0xb6cc('0x2f')]['hasOwnProperty'](_0xb6cc('0x36'))){_0x47f83c[_0xb6cc('0x1c')]=qs[_0xb6cc('0x1c')](_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x47f83c[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x42ce68[_0xb6cc('0x2f')]['offset']);}_0x47f83c[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x47f83c[_0xb6cc('0x3b')]=qs['filters'](_[_0xb6cc('0x39')](_0x42ce68[_0xb6cc('0x2f')],_0x1aa2fa[_0xb6cc('0x30')]));_0x47f83c[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x3010b3['id'];if(_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x47f83c[_0xb6cc('0x3b')]=_['merge'](_0x47f83c[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x47f83c['attributes'],function(_0x432c5d){var _0x11a6d4={};_0x11a6d4[_0x432c5d]={'$like':'%'+_0x42ce68[_0xb6cc('0x2f')]['filter']+'%'};return _0x11a6d4;})});}_0x47f83c=_[_0xb6cc('0x3c')]({},_0x47f83c,_0x42ce68[_0xb6cc('0x3d')]);return db[_0xb6cc('0x57')]['count']({'where':_0x47f83c[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0xf48fcd){_0x84b5f7[_0xb6cc('0x1d')]=_0xf48fcd;if(_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x47f83c[_0xb6cc('0x3f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x47f83c);})[_0xb6cc('0x25')](function(_0x10c99e){_0x84b5f7[_0xb6cc('0x40')]=_0x10c99e;return _0x84b5f7;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0xa82a45,_0x47f83c))[_0xb6cc('0x45')](handleError(_0xa82a45,null));};exports[_0xb6cc('0x58')]=function(_0x1760fa,_0x235e52,_0x331795){var _0xba0742={'raw':!![],'where':{}};var _0x2b8761={};var _0xdcc4fc={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x1760fa[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x235e52,null))[_0xb6cc('0x25')](function(_0x37b83f){if(_0x37b83f){_0x2b8761[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x59')][_0xb6cc('0x43')]);_0x2b8761[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0x1760fa[_0xb6cc('0x2f')]);_0x2b8761['filters']=_[_0xb6cc('0x32')](_0x2b8761['model'],_0x2b8761[_0xb6cc('0x2f')]);_0xba0742['attributes']=_[_0xb6cc('0x32')](_0x2b8761[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0xba0742[_0xb6cc('0x31')]=_0xba0742[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0xba0742[_0xb6cc('0x31')]:_0x2b8761[_0xb6cc('0x2e')];if(!_0x1760fa['query'][_0xb6cc('0x35')]('nolimit')){_0xba0742['limit']=qs['limit'](_0x1760fa[_0xb6cc('0x2f')]['limit']);_0xba0742[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x1760fa['query'][_0xb6cc('0x1a')]);}_0xba0742['order']=qs[_0xb6cc('0x38')](_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0xba0742['where']=qs[_0xb6cc('0x30')](_['pick'](_0x1760fa['query'],_0x2b8761[_0xb6cc('0x30')]));_0xba0742[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x37b83f['id'];if(_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0xba0742[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0xba0742[_0xb6cc('0x3b')],{'$or':_['map'](_0xba0742[_0xb6cc('0x31')],function(_0x48f13c){var _0x550c3a={};_0x550c3a[_0x48f13c]={'$like':'%'+_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x550c3a;})});}_0xba0742=_[_0xb6cc('0x3c')]({},_0xba0742,_0x1760fa['options']);return db[_0xb6cc('0x59')][_0xb6cc('0x1d')]({'where':_0xba0742[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x1f1f8d){_0xdcc4fc[_0xb6cc('0x1d')]=_0x1f1f8d;if(_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0xba0742[_0xb6cc('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xba0742);})['then'](function(_0x59e58b){_0xdcc4fc[_0xb6cc('0x40')]=_0x59e58b;return _0xdcc4fc;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0x235e52,_0xba0742))[_0xb6cc('0x45')](handleError(_0x235e52,null));};exports[_0xb6cc('0x5a')]=function(_0xfd9ec4,_0x10fa67,_0x5c2f00){var _0xb5aec3={'raw':!![],'where':{}};var _0x53e468={};var _0x9966c8={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0xfd9ec4['params']['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x10fa67,null))[_0xb6cc('0x25')](function(_0x53aea7){if(_0x53aea7){_0x53e468[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x5b')][_0xb6cc('0x43')]);_0x53e468[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0xfd9ec4[_0xb6cc('0x2f')]);_0x53e468[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x53e468[_0xb6cc('0x2e')],_0x53e468['query']);_0xb5aec3[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x53e468['model'],qs[_0xb6cc('0x33')](_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0xb5aec3['attributes']=_0xb5aec3['attributes'][_0xb6cc('0x34')]?_0xb5aec3[_0xb6cc('0x31')]:_0x53e468[_0xb6cc('0x2e')];if(!_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0xb5aec3['limit']=qs[_0xb6cc('0x1c')](_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0xb5aec3['offset']=qs['offset'](_0xfd9ec4[_0xb6cc('0x2f')]['offset']);}_0xb5aec3[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0xfd9ec4[_0xb6cc('0x2f')]['sort']);_0xb5aec3['where']=qs[_0xb6cc('0x30')](_[_0xb6cc('0x39')](_0xfd9ec4[_0xb6cc('0x2f')],_0x53e468[_0xb6cc('0x30')]));_0xb5aec3[_0xb6cc('0x3b')]['CampaignId']=_0x53aea7['id'];if(_0xfd9ec4[_0xb6cc('0x2f')]['filter']){_0xb5aec3[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0xb5aec3[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0xb5aec3[_0xb6cc('0x31')],function(_0x3385f0){var _0x23a8b3={};_0x23a8b3[_0x3385f0]={'$like':'%'+_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x23a8b3;})});}_0xb5aec3=_[_0xb6cc('0x3c')]({},_0xb5aec3,_0xfd9ec4['options']);return db[_0xb6cc('0x5b')][_0xb6cc('0x1d')]({'where':_0xb5aec3[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x319ba5){_0x9966c8['count']=_0x319ba5;if(_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0xb5aec3['include']=[{'all':!![]}];}return db[_0xb6cc('0x5b')][_0xb6cc('0x5c')](_0xb5aec3);})[_0xb6cc('0x25')](function(_0x14ad5c){_0x9966c8[_0xb6cc('0x40')]=_0x14ad5c;return _0x9966c8;});}})['then'](respondWithFilteredResult(_0x10fa67,_0xb5aec3))[_0xb6cc('0x45')](handleError(_0x10fa67,null));};exports[_0xb6cc('0x5d')]=function(_0x4ce81d,_0x30e09e,_0x1e4827){var _0x317b40={'raw':!![],'where':{}};var _0x53c114={};var _0x4efd48={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x4ce81d[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x30e09e,null))[_0xb6cc('0x25')](function(_0x5248c1){if(_0x5248c1){_0x53c114[_0xb6cc('0x2e')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x53c114[_0xb6cc('0x2f')]=_['keys'](_0x4ce81d[_0xb6cc('0x2f')]);_0x53c114[_0xb6cc('0x30')]=_['intersection'](_0x53c114[_0xb6cc('0x2e')],_0x53c114[_0xb6cc('0x2f')]);_0x317b40[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x53c114[_0xb6cc('0x2e')],qs['fields'](_0x4ce81d['query'][_0xb6cc('0x33')]));_0x317b40[_0xb6cc('0x31')]=_0x317b40[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x317b40[_0xb6cc('0x31')]:_0x53c114[_0xb6cc('0x2e')];if(!_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0x317b40['limit']=qs[_0xb6cc('0x1c')](_0x4ce81d['query'][_0xb6cc('0x1c')]);_0x317b40[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x4ce81d['query'][_0xb6cc('0x1a')]);}_0x317b40['order']=qs[_0xb6cc('0x38')](_0x4ce81d['query']['sort']);_0x317b40[_0xb6cc('0x3b')]=qs[_0xb6cc('0x30')](_['pick'](_0x4ce81d[_0xb6cc('0x2f')],_0x53c114['filters']));_0x317b40[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x5248c1['id'];if(_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x317b40['where']=_[_0xb6cc('0x3c')](_0x317b40[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x317b40[_0xb6cc('0x31')],function(_0x1ef7a2){var _0x4b8aa1={};_0x4b8aa1[_0x1ef7a2]={'$like':'%'+_0x4ce81d['query'][_0xb6cc('0x3a')]+'%'};return _0x4b8aa1;})});}_0x317b40=_[_0xb6cc('0x3c')]({},_0x317b40,_0x4ce81d[_0xb6cc('0x3d')]);return db['CmHopperBlack'][_0xb6cc('0x1d')]({'where':_0x317b40[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x3e6156){_0x4efd48['count']=_0x3e6156;if(_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x317b40[_0xb6cc('0x3f')]=[{'all':!![]}];}return db[_0xb6cc('0x5e')][_0xb6cc('0x5c')](_0x317b40);})['then'](function(_0xdcf81a){_0x4efd48[_0xb6cc('0x40')]=_0xdcf81a;return _0x4efd48;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0x30e09e,_0x317b40))[_0xb6cc('0x45')](handleError(_0x30e09e,null));};exports[_0xb6cc('0x5f')]=function(_0x2fdc61,_0xb2b7dc,_0x54ef25){var _0x11ef9d={};var _0x185cad={};var _0x4b7548;var _0x1d82e9;return db['Campaign']['findOne']({'where':{'id':_0x2fdc61[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0xb2b7dc,null))['then'](function(_0x27b706){if(_0x27b706){_0x4b7548=_0x27b706;_0x185cad[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db['CmList']['rawAttributes']);_0x185cad[_0xb6cc('0x2f')]=_['keys'](_0x2fdc61['query']);_0x185cad[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x185cad[_0xb6cc('0x2e')],_0x185cad[_0xb6cc('0x2f')]);_0x11ef9d['attributes']=_['intersection'](_0x185cad['model'],qs[_0xb6cc('0x33')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x11ef9d['attributes']=_0x11ef9d[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x11ef9d[_0xb6cc('0x31')]:_0x185cad[_0xb6cc('0x2e')];_0x11ef9d[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x11ef9d[_0xb6cc('0x3b')]=qs['filters'](_[_0xb6cc('0x39')](_0x2fdc61['query'],_0x185cad[_0xb6cc('0x30')]));if(_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x11ef9d[_0xb6cc('0x3b')]=_['merge'](_0x11ef9d['where'],{'$or':_[_0xb6cc('0x2b')](_0x11ef9d[_0xb6cc('0x31')],function(_0x4ba31e){var _0x47addc={};_0x47addc[_0x4ba31e]={'$like':'%'+_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x47addc;})});}_0x11ef9d=_['merge']({},_0x11ef9d,_0x2fdc61[_0xb6cc('0x3d')]);return _0x4b7548[_0xb6cc('0x5f')](_0x11ef9d);}})[_0xb6cc('0x25')](function(_0x47dc79){if(_0x47dc79){_0x1d82e9=_0x47dc79[_0xb6cc('0x34')];if(!_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x35')](_0xb6cc('0x36'))){_0x11ef9d['limit']=qs[_0xb6cc('0x1c')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x11ef9d['offset']=qs[_0xb6cc('0x1a')](_0x2fdc61[_0xb6cc('0x2f')]['offset']);}return _0x4b7548['getLists'](_0x11ef9d);}})['then'](function(_0x1661bf){if(_0x1661bf){return _0x1661bf?{'count':_0x1d82e9,'rows':_0x1661bf}:null;}})['then'](respondWithResult(_0xb2b7dc,null))[_0xb6cc('0x45')](handleError(_0xb2b7dc,null));};exports[_0xb6cc('0x60')]=function(_0xe45ed9,_0x1ccbf6,_0x389b61){var _0x231cb5,_0x1fae3e;return db[_0xb6cc('0x2c')]['find']({'where':{'id':_0xe45ed9['params']['id']}})['then'](handleEntityNotFound(_0x1ccbf6,null))[_0xb6cc('0x25')](function(_0x21a902){if(_0x21a902){_0x1fae3e=_0x21a902;return _0x21a902['addLists'](_0xe45ed9[_0xb6cc('0x50')][_0xb6cc('0x61')],_[_0xb6cc('0x4e')](_0xe45ed9[_0xb6cc('0x50')],[_0xb6cc('0x61'),'id'])||{});}return null;})[_0xb6cc('0x62')](function(_0x191994){var _0x13a010;_0x231cb5=_0x191994||[];var _0x3c3d41=[];if(_0x191994){for(var _0xaf7633=0x0;_0xaf7633<_0x191994[_0xb6cc('0x34')];_0xaf7633+=0x1){var _0x27ff91=_0x191994[_0xaf7633]['get']({'plain':!![]});_0x1fae3e[_0xb6cc('0x63')]=_0xe45ed9[_0xb6cc('0x50')][_0xb6cc('0x63')]?_0xe45ed9['body'][_0xb6cc('0x63')]:_0x1fae3e[_0xb6cc('0x63')];switch(_0x1fae3e[_0xb6cc('0x63')]){case _0xb6cc('0x64'):_0x13a010=squel['insert']()[_0xb6cc('0x65')](_0xb6cc('0x66'))[_0xb6cc('0x67')]([_0xb6cc('0x68'),_0xb6cc('0x69'),_0xb6cc('0x6a'),'ListId','CampaignId',_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')]('phone',_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x69'))[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))[_0xb6cc('0x6d')](_0x27ff91['CmListId'][_0xb6cc('0x6f')](),_0xb6cc('0x70'))['field'](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),_0xb6cc('0x56'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x6b'))['field'](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')]('cm_contacts')[_0xb6cc('0x3b')](_0xb6cc('0x72'))[_0xb6cc('0x3b')]('ListId\x20=\x20?',_0x27ff91['CmListId'][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73'))[_0xb6cc('0x3b')](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x75'))['from'](_0xb6cc('0x76'))['where'](_0xb6cc('0x77'),_0xe45ed9['params']['id'][_0xb6cc('0x6f')]()))[_0xb6cc('0x3b')](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x78'))[_0xb6cc('0x71')]('cm_hopper')[_0xb6cc('0x3b')]('CampaignId\x20=\x20?',_0xe45ed9['params']['id'][_0xb6cc('0x6f')]())))[_0xb6cc('0x6f')]();break;case'onlyIfOpen':_0x13a010=squel['insert']()[_0xb6cc('0x65')]('cm_hopper')[_0xb6cc('0x67')](['phone',_0xb6cc('0x69'),_0xb6cc('0x6a'),'ListId',_0xb6cc('0x56'),'createdAt',_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()['field'](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x69'))['field']('id','ContactId')[_0xb6cc('0x6d')](_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),'CampaignId')['field']('NOW()','createdAt')[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))[_0xb6cc('0x3b')](_0xb6cc('0x72'))['where'](_0xb6cc('0x7b'),_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x78'))[_0xb6cc('0x71')](_0xb6cc('0x66'))[_0xb6cc('0x3b')](_0xb6cc('0x77'),_0xe45ed9[_0xb6cc('0x41')]['id'][_0xb6cc('0x6f')]())))[_0xb6cc('0x6f')]();break;default:_0x13a010=squel[_0xb6cc('0x7c')]()['into'](_0xb6cc('0x66'))['fromQuery']([_0xb6cc('0x68'),_0xb6cc('0x69'),_0xb6cc('0x6a'),_0xb6cc('0x70'),'CampaignId',_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel['select']()[_0xb6cc('0x6d')](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),'scheduledAt')[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))[_0xb6cc('0x6d')](_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),_0xb6cc('0x56'))['field'](_0xb6cc('0x6e'),_0xb6cc('0x6b'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))[_0xb6cc('0x3b')](_0xb6cc('0x72'))['where'](_0xb6cc('0x7b'),_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73')))[_0xb6cc('0x6f')]();}_0x3c3d41[_0xb6cc('0x7d')](db['sequelize'][_0xb6cc('0x2f')](_0x13a010));}return BPromise[_0xb6cc('0x7e')](_0x3c3d41);}})[_0xb6cc('0x25')](function(){return _0x231cb5;})[_0xb6cc('0x25')](respondWithResult(_0x1ccbf6,null))['catch'](handleError(_0x1ccbf6,null));};exports[_0xb6cc('0x7f')]=function(_0x23a025,_0x36b7f2,_0x54fdf9){return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x23a025[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x36b7f2,null))[_0xb6cc('0x25')](function(_0x31a490){if(_0x31a490){return _0x31a490[_0xb6cc('0x7f')](_0x23a025[_0xb6cc('0x2f')][_0xb6cc('0x61')]);}})[_0xb6cc('0x25')](function(_0x111b37){if(_0x111b37){return db['CmHopper']['destroy']({'where':{'ListId':_0x23a025[_0xb6cc('0x2f')]['ids'],'CampaignId':_0x23a025['params']['id']}})[_0xb6cc('0x25')](function(){return _0x111b37;});}})[_0xb6cc('0x25')](respondWithStatusCode(_0x36b7f2,null))[_0xb6cc('0x45')](handleError(_0x36b7f2,null));};exports[_0xb6cc('0x80')]=function(_0x59a9df,_0x5f00a2,_0x527abd){var _0x538be5={};var _0x1303b9={};var _0x4891d9;var _0x557d24;return db[_0xb6cc('0x2c')]['findOne']({'where':{'id':_0x59a9df[_0xb6cc('0x41')]['id']}})['then'](handleEntityNotFound(_0x5f00a2,null))[_0xb6cc('0x25')](function(_0x4824b6){if(_0x4824b6){_0x4891d9=_0x4824b6;_0x1303b9[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x81')]['rawAttributes']);_0x1303b9[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0x59a9df[_0xb6cc('0x2f')]);_0x1303b9[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x1303b9['model'],_0x1303b9[_0xb6cc('0x2f')]);_0x538be5['attributes']=_['intersection'](_0x1303b9['model'],qs[_0xb6cc('0x33')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x538be5[_0xb6cc('0x31')]=_0x538be5[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x538be5[_0xb6cc('0x31')]:_0x1303b9['model'];_0x538be5[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x538be5['where']=qs['filters'](_[_0xb6cc('0x39')](_0x59a9df[_0xb6cc('0x2f')],_0x1303b9['filters']));if(_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x538be5[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0x538be5[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x538be5[_0xb6cc('0x31')],function(_0xe2da37){var _0x3fceed={};_0x3fceed[_0xe2da37]={'$like':'%'+_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x3fceed;})});}_0x538be5=_['merge']({},_0x538be5,_0x59a9df['options']);return _0x4891d9[_0xb6cc('0x80')](_0x538be5);}})[_0xb6cc('0x25')](function(_0x443449){if(_0x443449){_0x557d24=_0x443449['length'];if(!_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0x538be5[_0xb6cc('0x1c')]=qs['limit'](_0x59a9df['query']['limit']);_0x538be5['offset']=qs[_0xb6cc('0x1a')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x1a')]);}return _0x4891d9[_0xb6cc('0x80')](_0x538be5);}})[_0xb6cc('0x25')](function(_0x4a7118){if(_0x4a7118){return _0x4a7118?{'count':_0x557d24,'rows':_0x4a7118}:null;}})[_0xb6cc('0x25')](respondWithResult(_0x5f00a2,null))[_0xb6cc('0x45')](handleError(_0x5f00a2,null));};exports[_0xb6cc('0x82')]=function(_0x2b5701,_0x12d19e,_0x2a4f2e){var _0x1ceaf3,_0x371c2e;return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x2b5701[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x12d19e,null))[_0xb6cc('0x25')](function(_0xe3d9f6){if(_0xe3d9f6){_0x371c2e=_0xe3d9f6;return _0xe3d9f6[_0xb6cc('0x82')](_0x2b5701['body'][_0xb6cc('0x61')],_[_0xb6cc('0x4e')](_0x2b5701[_0xb6cc('0x50')],['ids','id'])||{});}return null;})[_0xb6cc('0x62')](function(_0x2b7dc2){var _0x427d60;_0x1ceaf3=_0x2b7dc2||[];var _0x5b3518=[];if(_0x2b7dc2){for(var _0x4a34b0=0x0;_0x4a34b0<_0x2b7dc2[_0xb6cc('0x34')];_0x4a34b0+=0x1){var _0x3b64cd=_0x2b7dc2[_0x4a34b0][_0xb6cc('0x48')]({'plain':!![]});_0x427d60=squel[_0xb6cc('0x7c')]()[_0xb6cc('0x65')](_0xb6cc('0x83'))['fromQuery']([_0xb6cc('0x68'),'ContactId',_0xb6cc('0x70'),_0xb6cc('0x56'),_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))['field'](_0x3b64cd[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0x2b5701['params']['id'][_0xb6cc('0x6f')](),'CampaignId')['field'](_0xb6cc('0x6e'),_0xb6cc('0x6b'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xb6cc('0x7b'),_0x3b64cd[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73')))[_0xb6cc('0x6f')]();_0x5b3518[_0xb6cc('0x7d')](db[_0xb6cc('0x84')]['query'](_0x427d60));}return BPromise['all'](_0x5b3518);}})['then'](function(){return _0x1ceaf3;})['then'](respondWithResult(_0x12d19e,null))['catch'](handleError(_0x12d19e,null));};exports[_0xb6cc('0x85')]=function(_0x581ac2,_0x4b880c,_0x2f21e2){return db[_0xb6cc('0x2c')]['find']({'where':{'id':_0x581ac2[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x4b880c,null))[_0xb6cc('0x25')](function(_0x3a0553){if(_0x3a0553){return _0x3a0553['removeBlackLists'](_0x581ac2[_0xb6cc('0x2f')][_0xb6cc('0x61')]);}})[_0xb6cc('0x25')](function(_0x4e7ce0){if(_0x4e7ce0){return db[_0xb6cc('0x5e')][_0xb6cc('0x53')]({'where':{'ListId':_0x581ac2[_0xb6cc('0x2f')]['ids'],'CampaignId':_0x581ac2[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](function(){return _0x4e7ce0;});}})[_0xb6cc('0x25')](respondWithStatusCode(_0x4b880c,null))[_0xb6cc('0x45')](handleError(_0x4b880c,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index d198470..501fd50 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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 4fa7672..2b10762 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 _0x3685=['request\x20sent','debug','stringify','error','code','message','result','GetCampaign','Campaign','raw','options','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x193c54,_0x52b209){var _0x1a8b38=function(_0x5c9db3){while(--_0x5c9db3){_0x193c54['push'](_0x193c54['shift']());}};_0x1a8b38(++_0x52b209);}(_0x3685,0xf8));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529a2,_0x39223d,_0xaf4549){return new BPromise(function(_0x55fb7d,_0x14e621){return client[_0x5368('0xc')](_0x2529a2,_0xaf4549)[_0x5368('0xd')](function(_0x2a6ce8){logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,_0x5368('0x10'));logger[_0x5368('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x39223d,_0x5368('0x10'),JSON[_0x5368('0x12')](_0x2a6ce8));if(_0x2a6ce8[_0x5368('0x13')]){if(_0x2a6ce8['error'][_0x5368('0x14')]===0x1f4){logger[_0x5368('0x13')]('Campaign,\x20%s,\x20%s',_0x39223d,_0x2a6ce8['error']['message']);return _0x14e621(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);return _0x55fb7d(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}else{logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,'request\x20sent');_0x55fb7d(_0x2a6ce8[_0x5368('0x16')][_0x5368('0x15')]);}})['catch'](function(_0x19790d){logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x19790d);_0x14e621(_0x19790d);});});}exports[_0x5368('0x17')]=function(_0x5b10e9){var _0x3fcae0=this;return new Promise(function(_0x56ac4d,_0x4baaa9){return db[_0x5368('0x18')]['findAll']({'raw':_0x5b10e9['options']?_0x5b10e9['options'][_0x5368('0x19')]===undefined?!![]:![]:!![],'where':_0x5b10e9[_0x5368('0x1a')]?_0x5b10e9[_0x5368('0x1a')]['where']||null:null,'attributes':_0x5b10e9['options']?_0x5b10e9[_0x5368('0x1a')][_0x5368('0x1b')]||null:null,'limit':_0x5b10e9[_0x5368('0x1a')]?_0x5b10e9[_0x5368('0x1a')][_0x5368('0x1c')]||null:null,'include':_0x5b10e9[_0x5368('0x1a')]?_0x5b10e9[_0x5368('0x1a')][_0x5368('0x1d')]?_[_0x5368('0x1e')](_0x5b10e9[_0x5368('0x1a')]['include'],function(_0x45884f){return{'model':db[_0x45884f[_0x5368('0x1f')]],'as':_0x45884f['as'],'attributes':_0x45884f[_0x5368('0x1b')],'include':_0x45884f[_0x5368('0x1d')]?_[_0x5368('0x1e')](_0x45884f[_0x5368('0x1d')],function(_0xabac8c){return{'model':db[_0xabac8c[_0x5368('0x1f')]],'as':_0xabac8c['as'],'attributes':_0xabac8c[_0x5368('0x1b')],'include':_0xabac8c['include']?_['map'](_0xabac8c[_0x5368('0x1d')],function(_0x229e5){return{'model':db[_0x229e5[_0x5368('0x1f')]],'as':_0x229e5['as'],'attributes':_0x229e5[_0x5368('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5368('0xd')](function(_0x4b94cd){logger[_0x5368('0xe')](_0x5368('0x17'),_0x5b10e9);logger[_0x5368('0x11')](_0x5368('0x17'),_0x5b10e9,JSON[_0x5368('0x12')](_0x4b94cd));_0x56ac4d(_0x4b94cd);})[_0x5368('0x20')](function(_0x3d40de){logger[_0x5368('0x13')](_0x5368('0x17'),_0x3d40de[_0x5368('0x15')],_0x5b10e9);_0x4baaa9(_0x3fcae0[_0x5368('0x13')](0x1f4,_0x3d40de[_0x5368('0x15')]));});});};
\ No newline at end of file
+var _0xc1c4=['message','result','catch','GetCampaign','Campaign','findAll','options','raw','map','include','model','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x104abc,_0x142a9c){_0x104abc=_0x104abc-0x0;var _0x5c35a7=_0xc1c4[_0x104abc];return _0x5c35a7;};'use strict';var _=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var moment=require(_0x4c1c('0x2'));var BPromise=require(_0x4c1c('0x3'));var rs=require(_0x4c1c('0x4'));var fs=require('fs');var Redis=require(_0x4c1c('0x5'));var db=require(_0x4c1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c1c('0x7'))(_0x4c1c('0x8'));var config=require(_0x4c1c('0x9'));var jayson=require(_0x4c1c('0xa'));var client=jayson['client'][_0x4c1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5a4f,_0x5863d0,_0x20e276){return new BPromise(function(_0x3337e4,_0x486065){return client[_0x4c1c('0xc')](_0x4f5a4f,_0x20e276)[_0x4c1c('0xd')](function(_0x445441){logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,'request\x20sent');logger['debug'](_0x4c1c('0x10'),_0x5863d0,_0x4c1c('0x11'),JSON[_0x4c1c('0x12')](_0x445441));if(_0x445441[_0x4c1c('0x13')]){if(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x14')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x486065(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);}logger[_0x4c1c('0x13')]('Campaign,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x3337e4(_0x445441['error'][_0x4c1c('0x15')]);}else{logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,_0x4c1c('0x11'));_0x3337e4(_0x445441[_0x4c1c('0x16')][_0x4c1c('0x15')]);}})[_0x4c1c('0x17')](function(_0x33641d){logger[_0x4c1c('0x13')](_0x4c1c('0xf'),_0x5863d0,_0x33641d);_0x486065(_0x33641d);});});}exports[_0x4c1c('0x18')]=function(_0x5a9217){var _0x1fad89=this;return new Promise(function(_0x213019,_0x64fe4b){return db[_0x4c1c('0x19')][_0x4c1c('0x1a')]({'raw':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')][_0x4c1c('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')]['where']||null:null,'attributes':_0x5a9217['options']?_0x5a9217[_0x4c1c('0x1b')]['attributes']||null:null,'limit':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')]['limit']||null:null,'include':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217['options']['include']?_[_0x4c1c('0x1d')](_0x5a9217[_0x4c1c('0x1b')][_0x4c1c('0x1e')],function(_0x13c2a1){return{'model':db[_0x13c2a1[_0x4c1c('0x1f')]],'as':_0x13c2a1['as'],'attributes':_0x13c2a1['attributes'],'include':_0x13c2a1[_0x4c1c('0x1e')]?_[_0x4c1c('0x1d')](_0x13c2a1[_0x4c1c('0x1e')],function(_0x1ec87a){return{'model':db[_0x1ec87a[_0x4c1c('0x1f')]],'as':_0x1ec87a['as'],'attributes':_0x1ec87a['attributes'],'include':_0x1ec87a['include']?_[_0x4c1c('0x1d')](_0x1ec87a['include'],function(_0x1104d4){return{'model':db[_0x1104d4['model']],'as':_0x1104d4['as'],'attributes':_0x1104d4[_0x4c1c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4c1c('0xd')](function(_0x38f7f7){logger['info'](_0x4c1c('0x18'),_0x5a9217);logger[_0x4c1c('0x21')](_0x4c1c('0x18'),_0x5a9217,JSON[_0x4c1c('0x12')](_0x38f7f7));_0x213019(_0x38f7f7);})[_0x4c1c('0x17')](function(_0x281286){logger[_0x4c1c('0x13')](_0x4c1c('0x18'),_0x281286['message'],_0x5a9217);_0x64fe4b(_0x1fad89['error'](0x1f4,_0x281286['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index fc1650c..66a6ab6 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 _0xd306=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','update','destroy','delete','removeLists','/:id/blacklists','removeBlackLists','exports'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xd306,0x69));var _0x6d30=function(_0x5ada29,_0x339d44){_0x5ada29=_0x5ada29-0x0;var _0xb65f3=_0xd306[_0x5ada29];return _0xb65f3;};'use strict';var multer=require(_0x6d30('0x0'));var util=require(_0x6d30('0x1'));var path=require(_0x6d30('0x2'));var timeout=require(_0x6d30('0x3'));var express=require('express');var router=express[_0x6d30('0x4')]();var fs_extra=require(_0x6d30('0x5'));var auth=require(_0x6d30('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d30('0x7'));var controller=require('./campaign.controller');router[_0x6d30('0x8')]('/',auth[_0x6d30('0x9')](),controller[_0x6d30('0xa')]);router[_0x6d30('0x8')](_0x6d30('0xb'),auth[_0x6d30('0x9')](),controller[_0x6d30('0xc')]);router['get'](_0x6d30('0xd'),auth[_0x6d30('0x9')](),controller['getHoppers']);router['get'](_0x6d30('0xe'),auth[_0x6d30('0x9')](),controller[_0x6d30('0xf')]);router['get'](_0x6d30('0x10'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x11')]);router[_0x6d30('0x8')](_0x6d30('0x12'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x13')]);router[_0x6d30('0x8')](_0x6d30('0x14'),auth['isAuthenticated'](),controller[_0x6d30('0x15')]);router['get']('/:id/blacklists',auth[_0x6d30('0x9')](),controller[_0x6d30('0x16')]);router[_0x6d30('0x17')]('/',auth[_0x6d30('0x9')](),controller[_0x6d30('0x18')]);router[_0x6d30('0x17')](_0x6d30('0x19'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1a')]);router['post'](_0x6d30('0x14'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1b')]);router[_0x6d30('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0x6d30('0xb'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1c')]);router['delete'](_0x6d30('0xb'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x1d')]);router[_0x6d30('0x1e')]('/:id/lists',auth[_0x6d30('0x9')](),controller[_0x6d30('0x1f')]);router['delete'](_0x6d30('0x20'),auth['isAuthenticated'](),controller[_0x6d30('0x21')]);module[_0x6d30('0x22')]=router;
\ No newline at end of file
+var _0x2303=['getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x2303,0x75));var _0x3230=function(_0x55eb05,_0x36eb0d){_0x55eb05=_0x55eb05-0x0;var _0x5cefb6=_0x2303[_0x55eb05];return _0x5cefb6;};'use strict';var multer=require(_0x3230('0x0'));var util=require(_0x3230('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3230('0x2'));var auth=require(_0x3230('0x3'));var interaction=require(_0x3230('0x4'));var config=require(_0x3230('0x5'));var controller=require(_0x3230('0x6'));router[_0x3230('0x7')]('/',auth[_0x3230('0x8')](),controller[_0x3230('0x9')]);router[_0x3230('0x7')](_0x3230('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3230('0x7')](_0x3230('0xb'),auth[_0x3230('0x8')](),controller[_0x3230('0xc')]);router[_0x3230('0x7')](_0x3230('0xd'),auth[_0x3230('0x8')](),controller[_0x3230('0xe')]);router[_0x3230('0x7')](_0x3230('0xf'),auth[_0x3230('0x8')](),controller['getHopperFinals']);router[_0x3230('0x7')](_0x3230('0x10'),auth[_0x3230('0x8')](),controller[_0x3230('0x11')]);router[_0x3230('0x7')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x13')]);router[_0x3230('0x7')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x15')]);router['post']('/',auth[_0x3230('0x8')](),controller[_0x3230('0x16')]);router[_0x3230('0x17')](_0x3230('0x18'),auth[_0x3230('0x8')](),controller[_0x3230('0x19')]);router[_0x3230('0x17')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x1a')]);router['post'](_0x3230('0x14'),auth['isAuthenticated'](),controller[_0x3230('0x1b')]);router[_0x3230('0x1c')](_0x3230('0xa'),auth[_0x3230('0x8')](),controller[_0x3230('0x1d')]);router[_0x3230('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x3230('0x1f')]);router['delete'](_0x3230('0x12'),auth['isAuthenticated'](),controller[_0x3230('0x20')]);router[_0x3230('0x1e')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x21')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index e04ad31..5ed33c5 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 _0x85c9=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x85c9,0x9a));var _0x985c=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0x85c9[_0x1314d4];return _0x584ba5;};'use strict';var Sequelize=require(_0x985c('0x0'));module[_0x985c('0x1')]={'key':{'type':Sequelize[_0x985c('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x985c('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x985c('0x2')]},'name':{'type':Sequelize[_0x985c('0x4')],'get':function(){return this[_0x985c('0x5')](_0x985c('0x6'));}}};
\ No newline at end of file
+var _0xe439=['getDataValue','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xe439,0x6d));var _0x9e43=function(_0x4e3719,_0x3a6289){_0x4e3719=_0x4e3719-0x0;var _0x4c761c=_0xe439[_0x4e3719];return _0x4c761c;};'use strict';var Sequelize=require(_0x9e43('0x0'));module[_0x9e43('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9e43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9e43('0x3')]},'name':{'type':Sequelize[_0x9e43('0x4')],'get':function(){return this[_0x9e43('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 2c1591c..08345cd 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 _0x0446=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','keys','catch','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x0446,0x15c));var _0x6044=function(_0x4fbe96,_0x82c4b0){_0x4fbe96=_0x4fbe96-0x0;var _0x3d2656=_0x0446[_0x4fbe96];return _0x3d2656;};'use strict';var emlformat=require(_0x6044('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6044('0x1'));var jsonpatch=require(_0x6044('0x2'));var rp=require(_0x6044('0x3'));var moment=require('moment');var BPromise=require(_0x6044('0x4'));var Mustache=require('mustache');var util=require(_0x6044('0x5'));var path=require(_0x6044('0x6'));var sox=require(_0x6044('0x7'));var csv=require(_0x6044('0x8'));var ejs=require(_0x6044('0x9'));var fs=require('fs');var fs_extra=require(_0x6044('0xa'));var _=require('lodash');var squel=require(_0x6044('0xb'));var crypto=require(_0x6044('0xc'));var jsforce=require(_0x6044('0xd'));var deskjs=require(_0x6044('0xe'));var toCsv=require(_0x6044('0x8'));var querystring=require(_0x6044('0xf'));var Papa=require(_0x6044('0x10'));var Redis=require(_0x6044('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6044('0x12'));var as=require(_0x6044('0x13'));var hardwareService=require(_0x6044('0x14'));var logger=require(_0x6044('0x15'))(_0x6044('0x16'));var utils=require(_0x6044('0x17'));var config=require(_0x6044('0x18'));var licenseUtil=require(_0x6044('0x19'));var db=require(_0x6044('0x1a'))['db'];function respondWithStatusCode(_0x239850,_0x7b8408){_0x7b8408=_0x7b8408||0xcc;return function(_0x2e929d){if(_0x2e929d){return _0x239850[_0x6044('0x1b')](_0x7b8408);}return _0x239850['status'](_0x7b8408)[_0x6044('0x1c')]();};}function respondWithResult(_0x1cfb7f,_0x48b916){_0x48b916=_0x48b916||0xc8;return function(_0x152ba9){if(_0x152ba9){return _0x1cfb7f[_0x6044('0x1d')](_0x48b916)['json'](_0x152ba9);}};}function respondWithFilteredResult(_0x347945,_0x52a45a){return function(_0x248dee){if(_0x248dee){var _0x1169fb=typeof _0x52a45a[_0x6044('0x1e')]==='undefined'&&typeof _0x52a45a[_0x6044('0x1f')]===_0x6044('0x20');var _0x47aa4f=_0x248dee[_0x6044('0x21')];var _0x348d0c=_0x1169fb?0x0:_0x52a45a[_0x6044('0x1e')];var _0x2bae6e=_0x1169fb?_0x248dee[_0x6044('0x21')]:_0x52a45a[_0x6044('0x1e')]+_0x52a45a[_0x6044('0x1f')];var _0x51f45e;if(_0x2bae6e>=_0x47aa4f){_0x2bae6e=_0x47aa4f;_0x51f45e=0xc8;}else{_0x51f45e=0xce;}_0x347945['status'](_0x51f45e);return _0x347945[_0x6044('0x22')](_0x6044('0x23'),_0x348d0c+'-'+_0x2bae6e+'/'+_0x47aa4f)[_0x6044('0x24')](_0x248dee);}return null;};}function patchUpdates(_0x5e5dde){return function(_0x483f7a){try{jsonpatch[_0x6044('0x25')](_0x483f7a,_0x5e5dde,!![]);}catch(_0x19d3df){return BPromise[_0x6044('0x26')](_0x19d3df);}return _0x483f7a[_0x6044('0x27')]();};}function saveUpdates(_0x42d18e,_0x428d29){return function(_0x3ba305){if(_0x3ba305){return _0x3ba305[_0x6044('0x28')](_0x42d18e)[_0x6044('0x29')](function(_0x4dcfd5){return _0x4dcfd5;});}return null;};}function removeEntity(_0x54fa96,_0x499ecf){return function(_0x299038){if(_0x299038){return _0x299038['destroy']()[_0x6044('0x29')](function(){var _0x1c0da9=_0x299038[_0x6044('0x2a')]({'plain':!![]});var _0xea7bc7='CannedAnswers';return db[_0x6044('0x2b')][_0x6044('0x2c')]({'where':{'type':_0xea7bc7,'resourceId':_0x1c0da9['id']}})[_0x6044('0x29')](function(){return _0x299038;});})[_0x6044('0x29')](function(){_0x54fa96[_0x6044('0x1d')](0xcc)[_0x6044('0x1c')]();});}};}function handleEntityNotFound(_0xab05ce,_0x3f5d1e){return function(_0x22e154){if(!_0x22e154){_0xab05ce['sendStatus'](0x194);}return _0x22e154;};}function handleError(_0x2c5224,_0x25e0dd){_0x25e0dd=_0x25e0dd||0x1f4;return function(_0x46efa9){logger[_0x6044('0x2d')](_0x46efa9['stack']);if(_0x46efa9[_0x6044('0x2e')]){delete _0x46efa9[_0x6044('0x2e')];}_0x2c5224[_0x6044('0x1d')](_0x25e0dd)['send'](_0x46efa9);};}exports['index']=function(_0x5a5c5f,_0x331dc9){var _0x4f1b0d={},_0x4d5e25={},_0x516de0={'count':0x0,'rows':[]};var _0x3afe2e=_[_0x6044('0x2f')](db['CannedAnswer'][_0x6044('0x30')],function(_0x19acf4){return{'name':_0x19acf4[_0x6044('0x31')],'type':_0x19acf4[_0x6044('0x32')][_0x6044('0x33')]};});_0x4d5e25[_0x6044('0x34')]=_[_0x6044('0x2f')](_0x3afe2e,'name');_0x4d5e25['query']=_['keys'](_0x5a5c5f[_0x6044('0x35')]);_0x4d5e25[_0x6044('0x36')]=_['intersection'](_0x4d5e25[_0x6044('0x34')],_0x4d5e25[_0x6044('0x35')]);_0x4f1b0d['attributes']=_[_0x6044('0x37')](_0x4d5e25['model'],qs[_0x6044('0x38')](_0x5a5c5f[_0x6044('0x35')][_0x6044('0x38')]));_0x4f1b0d['attributes']=_0x4f1b0d[_0x6044('0x39')][_0x6044('0x3a')]?_0x4f1b0d[_0x6044('0x39')]:_0x4d5e25['model'];if(!_0x5a5c5f[_0x6044('0x35')][_0x6044('0x3b')](_0x6044('0x3c'))){_0x4f1b0d[_0x6044('0x1f')]=qs[_0x6044('0x1f')](_0x5a5c5f['query'][_0x6044('0x1f')]);_0x4f1b0d[_0x6044('0x1e')]=qs[_0x6044('0x1e')](_0x5a5c5f['query'][_0x6044('0x1e')]);}_0x4f1b0d[_0x6044('0x3d')]=qs['sort'](_0x5a5c5f['query'][_0x6044('0x3e')]);_0x4f1b0d[_0x6044('0x3f')]=qs['filters'](_[_0x6044('0x40')](_0x5a5c5f['query'],_0x4d5e25[_0x6044('0x36')]),_0x3afe2e);if(_0x5a5c5f[_0x6044('0x35')][_0x6044('0x41')]){_0x4f1b0d['where']=_['merge'](_0x4f1b0d['where'],{'$or':[{'key':{'$like':'%'+_0x5a5c5f[_0x6044('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x5a5c5f[_0x6044('0x35')]['filter']+'%'}}]});}_0x4f1b0d=_[_0x6044('0x42')]({},_0x4f1b0d,_0x5a5c5f[_0x6044('0x43')]);var _0x19dd9a={'where':_0x4f1b0d['where']};return db[_0x6044('0x44')][_0x6044('0x21')](_0x19dd9a)[_0x6044('0x29')](function(_0x292cf3){_0x516de0[_0x6044('0x21')]=_0x292cf3;if(_0x5a5c5f[_0x6044('0x35')][_0x6044('0x45')]){_0x4f1b0d[_0x6044('0x46')]=[{'all':!![]}];}return db[_0x6044('0x44')][_0x6044('0x47')](_0x4f1b0d);})['then'](function(_0x1048d6){_0x516de0['rows']=_0x1048d6;return _0x516de0;})[_0x6044('0x29')](respondWithFilteredResult(_0x331dc9,_0x4f1b0d))['catch'](handleError(_0x331dc9,null));};exports['show']=function(_0x9e3511,_0x247f53){var _0x17926b={'raw':!![],'where':{'id':_0x9e3511['params']['id']}},_0x1458a8={};_0x1458a8[_0x6044('0x34')]=_[_0x6044('0x48')](db[_0x6044('0x44')]['rawAttributes']);_0x1458a8[_0x6044('0x35')]=_[_0x6044('0x48')](_0x9e3511[_0x6044('0x35')]);_0x1458a8[_0x6044('0x36')]=_[_0x6044('0x37')](_0x1458a8[_0x6044('0x34')],_0x1458a8[_0x6044('0x35')]);_0x17926b['attributes']=_['intersection'](_0x1458a8[_0x6044('0x34')],qs[_0x6044('0x38')](_0x9e3511[_0x6044('0x35')][_0x6044('0x38')]));_0x17926b[_0x6044('0x39')]=_0x17926b[_0x6044('0x39')]['length']?_0x17926b[_0x6044('0x39')]:_0x1458a8[_0x6044('0x34')];if(_0x9e3511[_0x6044('0x35')][_0x6044('0x45')]){_0x17926b[_0x6044('0x46')]=[{'all':!![]}];}_0x17926b=_[_0x6044('0x42')]({},_0x17926b,_0x9e3511[_0x6044('0x43')]);return db['CannedAnswer']['find'](_0x17926b)['then'](handleEntityNotFound(_0x247f53,null))[_0x6044('0x29')](respondWithResult(_0x247f53,null))[_0x6044('0x49')](handleError(_0x247f53,null));};exports[_0x6044('0x28')]=function(_0x1c65e7,_0x3ea5ae){if(_0x1c65e7[_0x6044('0x4a')]['id']){delete _0x1c65e7[_0x6044('0x4a')]['id'];}return db[_0x6044('0x44')][_0x6044('0x4b')]({'where':{'id':_0x1c65e7[_0x6044('0x4c')]['id']}})[_0x6044('0x29')](handleEntityNotFound(_0x3ea5ae,null))[_0x6044('0x29')](saveUpdates(_0x1c65e7[_0x6044('0x4a')],null))[_0x6044('0x29')](respondWithResult(_0x3ea5ae,null))[_0x6044('0x49')](handleError(_0x3ea5ae,null));};exports[_0x6044('0x2c')]=function(_0x366e24,_0x1cbda8){return db[_0x6044('0x44')][_0x6044('0x4b')]({'where':{'id':_0x366e24[_0x6044('0x4c')]['id']}})[_0x6044('0x29')](handleEntityNotFound(_0x1cbda8,null))[_0x6044('0x29')](removeEntity(_0x1cbda8,null))[_0x6044('0x49')](handleError(_0x1cbda8,null));};exports[_0x6044('0x4d')]=function(_0x319a4a,_0x3f4a44){var _0x457967={'key':_0x319a4a[_0x6044('0x4a')][_0x6044('0x33')]};if(_0x319a4a[_0x6044('0x4a')]['MailAccountId']){_0x457967['MailAccountId']=_0x319a4a[_0x6044('0x4a')][_0x6044('0x4e')];}else if(_0x319a4a[_0x6044('0x4a')]['SmsAccountId']){_0x457967['SmsAccountId']=_0x319a4a['body'][_0x6044('0x4f')];}else if(_0x319a4a[_0x6044('0x4a')][_0x6044('0x50')]){_0x457967[_0x6044('0x50')]=_0x319a4a['body']['OpenchannelAccountId'];}else if(_0x319a4a[_0x6044('0x4a')][_0x6044('0x51')]){_0x457967[_0x6044('0x51')]=_0x319a4a[_0x6044('0x4a')][_0x6044('0x51')];}return db[_0x6044('0x44')][_0x6044('0x4b')]({'where':_0x457967})[_0x6044('0x29')](function(_0x2bd8da){if(_0x2bd8da){throw new db['Sequelize'][(_0x6044('0x52'))](_0x6044('0x53'));}return db[_0x6044('0x44')][_0x6044('0x4d')](_0x319a4a[_0x6044('0x4a')]);})['then'](function(_0x6a44da){var _0x30c8ef=_0x319a4a[_0x6044('0x54')][_0x6044('0x2a')]({'plain':!![]});if(!_0x30c8ef)throw new Error(_0x6044('0x55'));if(_0x30c8ef[_0x6044('0x56')]===_0x6044('0x54')){var _0x29ae5b=_0x6a44da['get']({'plain':!![]});return db[_0x6044('0x57')][_0x6044('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x30c8ef[_0x6044('0x58')]},'raw':!![]})['then'](function(_0x26edcd){if(_0x26edcd&&_0x26edcd[_0x6044('0x59')]===0x0){return db[_0x6044('0x2b')][_0x6044('0x4d')]({'name':_0x29ae5b[_0x6044('0x2e')],'resourceId':_0x29ae5b['id'],'type':_0x26edcd[_0x6044('0x2e')],'sectionId':_0x26edcd['id']},{})[_0x6044('0x29')](function(){return _0x6a44da;});}else{return _0x6a44da;}})[_0x6044('0x49')](function(_0x3ec5b4){logger[_0x6044('0x2d')](_0x6044('0x5a'),_0x3ec5b4);throw _0x3ec5b4;});}return _0x6a44da;})[_0x6044('0x29')](respondWithResult(_0x3f4a44,0xc9))[_0x6044('0x49')](handleError(_0x3f4a44,null));};
\ No newline at end of file
+var _0x99b3=['count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','update','body','destroy','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x99b3,0x196));var _0x399b=function(_0x58249f,_0x4668b5){_0x58249f=_0x58249f-0x0;var _0x2d0221=_0x99b3[_0x58249f];return _0x2d0221;};'use strict';var emlformat=require(_0x399b('0x0'));var rimraf=require(_0x399b('0x1'));var zipdir=require(_0x399b('0x2'));var jsonpatch=require(_0x399b('0x3'));var rp=require(_0x399b('0x4'));var moment=require(_0x399b('0x5'));var BPromise=require(_0x399b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x399b('0x7'));var sox=require(_0x399b('0x8'));var csv=require('to-csv');var ejs=require(_0x399b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x399b('0xa'));var jsforce=require(_0x399b('0xb'));var deskjs=require(_0x399b('0xc'));var toCsv=require(_0x399b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x399b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x399b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x399b('0x10'));var logger=require(_0x399b('0x11'))(_0x399b('0x12'));var utils=require(_0x399b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x399b('0x14'));var db=require(_0x399b('0x15'))['db'];function respondWithStatusCode(_0xcfe7a2,_0x3e4f25){_0x3e4f25=_0x3e4f25||0xcc;return function(_0x3954a1){if(_0x3954a1){return _0xcfe7a2[_0x399b('0x16')](_0x3e4f25);}return _0xcfe7a2[_0x399b('0x17')](_0x3e4f25)[_0x399b('0x18')]();};}function respondWithResult(_0x59bf43,_0xc05882){_0xc05882=_0xc05882||0xc8;return function(_0x41c6e6){if(_0x41c6e6){return _0x59bf43[_0x399b('0x17')](_0xc05882)[_0x399b('0x19')](_0x41c6e6);}};}function respondWithFilteredResult(_0x2cb7ec,_0x3f088a){return function(_0x2ae1d0){if(_0x2ae1d0){var _0x138c77=typeof _0x3f088a[_0x399b('0x1a')]===_0x399b('0x1b')&&typeof _0x3f088a[_0x399b('0x1c')]===_0x399b('0x1b');var _0x4793c6=_0x2ae1d0[_0x399b('0x1d')];var _0x2db9aa=_0x138c77?0x0:_0x3f088a[_0x399b('0x1a')];var _0x1be9e4=_0x138c77?_0x2ae1d0[_0x399b('0x1d')]:_0x3f088a[_0x399b('0x1a')]+_0x3f088a[_0x399b('0x1c')];var _0xd149e5;if(_0x1be9e4>=_0x4793c6){_0x1be9e4=_0x4793c6;_0xd149e5=0xc8;}else{_0xd149e5=0xce;}_0x2cb7ec['status'](_0xd149e5);return _0x2cb7ec[_0x399b('0x1e')](_0x399b('0x1f'),_0x2db9aa+'-'+_0x1be9e4+'/'+_0x4793c6)['json'](_0x2ae1d0);}return null;};}function patchUpdates(_0x5a6aad){return function(_0x5dd868){try{jsonpatch[_0x399b('0x20')](_0x5dd868,_0x5a6aad,!![]);}catch(_0x90c0eb){return BPromise[_0x399b('0x21')](_0x90c0eb);}return _0x5dd868[_0x399b('0x22')]();};}function saveUpdates(_0x50a1b8,_0x54da07){return function(_0x4f1b30){if(_0x4f1b30){return _0x4f1b30['update'](_0x50a1b8)[_0x399b('0x23')](function(_0x407077){return _0x407077;});}return null;};}function removeEntity(_0x13c864,_0xf6c33c){return function(_0x1f5fa3){if(_0x1f5fa3){return _0x1f5fa3['destroy']()[_0x399b('0x23')](function(){var _0x4e6207=_0x1f5fa3[_0x399b('0x24')]({'plain':!![]});var _0x59b488='CannedAnswers';return db[_0x399b('0x25')]['destroy']({'where':{'type':_0x59b488,'resourceId':_0x4e6207['id']}})[_0x399b('0x23')](function(){return _0x1f5fa3;});})[_0x399b('0x23')](function(){_0x13c864[_0x399b('0x17')](0xcc)[_0x399b('0x18')]();});}};}function handleEntityNotFound(_0x4fbddf,_0x1e544c){return function(_0x327690){if(!_0x327690){_0x4fbddf[_0x399b('0x16')](0x194);}return _0x327690;};}function handleError(_0x6b9dae,_0x15c1e7){_0x15c1e7=_0x15c1e7||0x1f4;return function(_0x43e853){logger[_0x399b('0x26')](_0x43e853['stack']);if(_0x43e853[_0x399b('0x27')]){delete _0x43e853[_0x399b('0x27')];}_0x6b9dae[_0x399b('0x17')](_0x15c1e7)[_0x399b('0x28')](_0x43e853);};}exports[_0x399b('0x29')]=function(_0x106a18,_0x3db879){var _0x4a9be5={},_0x3bdfe6={},_0x2a3185={'count':0x0,'rows':[]};var _0x29224b=_['map'](db[_0x399b('0x2a')][_0x399b('0x2b')],function(_0x45718a){return{'name':_0x45718a[_0x399b('0x2c')],'type':_0x45718a[_0x399b('0x2d')]['key']};});_0x3bdfe6[_0x399b('0x2e')]=_[_0x399b('0x2f')](_0x29224b,_0x399b('0x27'));_0x3bdfe6['query']=_['keys'](_0x106a18['query']);_0x3bdfe6[_0x399b('0x30')]=_[_0x399b('0x31')](_0x3bdfe6['model'],_0x3bdfe6[_0x399b('0x32')]);_0x4a9be5[_0x399b('0x33')]=_[_0x399b('0x31')](_0x3bdfe6[_0x399b('0x2e')],qs[_0x399b('0x34')](_0x106a18[_0x399b('0x32')][_0x399b('0x34')]));_0x4a9be5[_0x399b('0x33')]=_0x4a9be5[_0x399b('0x33')][_0x399b('0x35')]?_0x4a9be5[_0x399b('0x33')]:_0x3bdfe6[_0x399b('0x2e')];if(!_0x106a18[_0x399b('0x32')][_0x399b('0x36')](_0x399b('0x37'))){_0x4a9be5[_0x399b('0x1c')]=qs[_0x399b('0x1c')](_0x106a18[_0x399b('0x32')][_0x399b('0x1c')]);_0x4a9be5[_0x399b('0x1a')]=qs[_0x399b('0x1a')](_0x106a18[_0x399b('0x32')]['offset']);}_0x4a9be5[_0x399b('0x38')]=qs[_0x399b('0x39')](_0x106a18[_0x399b('0x32')]['sort']);_0x4a9be5[_0x399b('0x3a')]=qs[_0x399b('0x30')](_[_0x399b('0x3b')](_0x106a18[_0x399b('0x32')],_0x3bdfe6[_0x399b('0x30')]),_0x29224b);if(_0x106a18[_0x399b('0x32')][_0x399b('0x3c')]){_0x4a9be5[_0x399b('0x3a')]=_['merge'](_0x4a9be5[_0x399b('0x3a')],{'$or':[{'key':{'$like':'%'+_0x106a18['query'][_0x399b('0x3c')]+'%'}},{'value':{'$like':'%'+_0x106a18[_0x399b('0x32')][_0x399b('0x3c')]+'%'}}]});}_0x4a9be5=_['merge']({},_0x4a9be5,_0x106a18['options']);var _0x16aa6e={'where':_0x4a9be5[_0x399b('0x3a')]};return db[_0x399b('0x2a')][_0x399b('0x1d')](_0x16aa6e)[_0x399b('0x23')](function(_0x43b7e4){_0x2a3185[_0x399b('0x1d')]=_0x43b7e4;if(_0x106a18[_0x399b('0x32')][_0x399b('0x3d')]){_0x4a9be5[_0x399b('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x399b('0x3f')](_0x4a9be5);})[_0x399b('0x23')](function(_0x4abbed){_0x2a3185[_0x399b('0x40')]=_0x4abbed;return _0x2a3185;})[_0x399b('0x23')](respondWithFilteredResult(_0x3db879,_0x4a9be5))[_0x399b('0x41')](handleError(_0x3db879,null));};exports[_0x399b('0x42')]=function(_0x2c4cc8,_0x16bfe3){var _0x254e33={'raw':!![],'where':{'id':_0x2c4cc8[_0x399b('0x43')]['id']}},_0x3af16e={};_0x3af16e[_0x399b('0x2e')]=_['keys'](db[_0x399b('0x2a')]['rawAttributes']);_0x3af16e[_0x399b('0x32')]=_[_0x399b('0x44')](_0x2c4cc8[_0x399b('0x32')]);_0x3af16e['filters']=_[_0x399b('0x31')](_0x3af16e['model'],_0x3af16e['query']);_0x254e33[_0x399b('0x33')]=_[_0x399b('0x31')](_0x3af16e['model'],qs[_0x399b('0x34')](_0x2c4cc8[_0x399b('0x32')][_0x399b('0x34')]));_0x254e33[_0x399b('0x33')]=_0x254e33['attributes']['length']?_0x254e33[_0x399b('0x33')]:_0x3af16e[_0x399b('0x2e')];if(_0x2c4cc8[_0x399b('0x32')][_0x399b('0x3d')]){_0x254e33[_0x399b('0x3e')]=[{'all':!![]}];}_0x254e33=_['merge']({},_0x254e33,_0x2c4cc8[_0x399b('0x45')]);return db[_0x399b('0x2a')][_0x399b('0x46')](_0x254e33)[_0x399b('0x23')](handleEntityNotFound(_0x16bfe3,null))[_0x399b('0x23')](respondWithResult(_0x16bfe3,null))[_0x399b('0x41')](handleError(_0x16bfe3,null));};exports[_0x399b('0x47')]=function(_0x102997,_0x36a8ca){if(_0x102997[_0x399b('0x48')]['id']){delete _0x102997['body']['id'];}return db['CannedAnswer'][_0x399b('0x46')]({'where':{'id':_0x102997[_0x399b('0x43')]['id']}})[_0x399b('0x23')](handleEntityNotFound(_0x36a8ca,null))[_0x399b('0x23')](saveUpdates(_0x102997['body'],null))[_0x399b('0x23')](respondWithResult(_0x36a8ca,null))[_0x399b('0x41')](handleError(_0x36a8ca,null));};exports[_0x399b('0x49')]=function(_0x2669ca,_0x53ef2f){return db['CannedAnswer']['find']({'where':{'id':_0x2669ca[_0x399b('0x43')]['id']}})['then'](handleEntityNotFound(_0x53ef2f,null))[_0x399b('0x23')](removeEntity(_0x53ef2f,null))[_0x399b('0x41')](handleError(_0x53ef2f,null));};exports[_0x399b('0x4a')]=function(_0x495787,_0x598673){var _0x1fdfb3={'key':_0x495787[_0x399b('0x48')][_0x399b('0x4b')]};if(_0x495787['body'][_0x399b('0x4c')]){_0x1fdfb3['MailAccountId']=_0x495787[_0x399b('0x48')][_0x399b('0x4c')];}else if(_0x495787['body'][_0x399b('0x4d')]){_0x1fdfb3[_0x399b('0x4d')]=_0x495787[_0x399b('0x48')]['SmsAccountId'];}else if(_0x495787[_0x399b('0x48')]['OpenchannelAccountId']){_0x1fdfb3[_0x399b('0x4e')]=_0x495787[_0x399b('0x48')][_0x399b('0x4e')];}else if(_0x495787[_0x399b('0x48')][_0x399b('0x4f')]){_0x1fdfb3['ChatWebsiteId']=_0x495787[_0x399b('0x48')][_0x399b('0x4f')];}return db[_0x399b('0x2a')][_0x399b('0x46')]({'where':_0x1fdfb3})['then'](function(_0x43940d){if(_0x43940d){throw new db[(_0x399b('0x50'))][(_0x399b('0x51'))](_0x399b('0x52'));}return db[_0x399b('0x2a')][_0x399b('0x4a')](_0x495787[_0x399b('0x48')]);})[_0x399b('0x23')](function(_0x485d3a){var _0x54de6c=_0x495787[_0x399b('0x53')][_0x399b('0x24')]({'plain':!![]});if(!_0x54de6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54de6c['role']===_0x399b('0x53')){var _0x3d2d61=_0x485d3a['get']({'plain':!![]});return db[_0x399b('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x54de6c['userProfileId']},'raw':!![]})[_0x399b('0x23')](function(_0x1126c2){if(_0x1126c2&&_0x1126c2[_0x399b('0x55')]===0x0){return db[_0x399b('0x25')][_0x399b('0x4a')]({'name':_0x3d2d61[_0x399b('0x27')],'resourceId':_0x3d2d61['id'],'type':_0x1126c2['name'],'sectionId':_0x1126c2['id']},{})['then'](function(){return _0x485d3a;});}else{return _0x485d3a;}})[_0x399b('0x41')](function(_0x40a47f){logger[_0x399b('0x26')](_0x399b('0x56'),_0x40a47f);throw _0x40a47f;});}return _0x485d3a;})[_0x399b('0x23')](respondWithResult(_0x598673,0xc9))[_0x399b('0x41')](handleError(_0x598673,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 659e14a..b21aede 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 _0x1f7d=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','CannedAnswer','utf8mb4_unicode_ci'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1f7d,0xa2));var _0xd1f7=function(_0x25fc3b,_0x5b9391){_0x25fc3b=_0x25fc3b-0x0;var _0x207a55=_0x1f7d[_0x25fc3b];return _0x207a55;};'use strict';var _=require('lodash');var util=require(_0xd1f7('0x0'));var logger=require(_0xd1f7('0x1'))('api');var moment=require(_0xd1f7('0x2'));var BPromise=require(_0xd1f7('0x3'));var rp=require(_0xd1f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1f7('0x5'));var config=require('../../config/environment');var attributes=require(_0xd1f7('0x6'));module['exports']=function(_0x598e14,_0x349ca7){return _0x598e14['define'](_0xd1f7('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd1f7('0x8')});};
\ No newline at end of file
+var _0x0188=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x19311a,_0x2d2679){var _0x42617c=function(_0x43227d){while(--_0x43227d){_0x19311a['push'](_0x19311a['shift']());}};_0x42617c(++_0x2d2679);}(_0x0188,0x1a7));var _0x8018=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x0188[_0x3e531a];return _0x3c2574;};'use strict';var _=require(_0x8018('0x0'));var util=require('util');var logger=require(_0x8018('0x1'))('api');var moment=require(_0x8018('0x2'));var BPromise=require(_0x8018('0x3'));var rp=require(_0x8018('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8018('0x5'));var config=require(_0x8018('0x6'));var attributes=require(_0x8018('0x7'));module[_0x8018('0x8')]=function(_0x1b9f44,_0x16330a){return _0x1b9f44['define']('CannedAnswer',attributes,{'tableName':_0x8018('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8018('0xa'),'collate':_0x8018('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a193bb0..5a388e9 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(_0xaa7629,_0x2837d8){var _0x3d5570=function(_0x4b31b9){while(--_0x4b31b9){_0xaa7629['push'](_0xaa7629['shift']());}};_0x3d5570(++_0x2837d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x531253,_0x8acb9b){var _0x307a0e=function(_0x5cfb48){while(--_0x5cfb48){_0x531253['push'](_0x531253['shift']());}};_0x307a0e(++_0x8acb9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 b29fbbf..3b55b45 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 _0xdc0a=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc0a,0x1b9));var _0xadc0=function(_0x12e8d5,_0x5cc297){_0x12e8d5=_0x12e8d5-0x0;var _0x1dc087=_0xdc0a[_0x12e8d5];return _0x1dc087;};'use strict';var multer=require(_0xadc0('0x0'));var util=require(_0xadc0('0x1'));var path=require(_0xadc0('0x2'));var timeout=require(_0xadc0('0x3'));var express=require(_0xadc0('0x4'));var router=express[_0xadc0('0x5')]();var fs_extra=require(_0xadc0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xadc0('0x7'));var config=require(_0xadc0('0x8'));var controller=require(_0xadc0('0x9'));router[_0xadc0('0xa')]('/',auth[_0xadc0('0xb')](),controller[_0xadc0('0xc')]);router[_0xadc0('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xadc0('0xd')]('/',auth[_0xadc0('0xb')](),controller[_0xadc0('0xe')]);router[_0xadc0('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xadc0('0x10')]);router[_0xadc0('0x11')]('/:id',auth[_0xadc0('0xb')](),controller[_0xadc0('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x487e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x401392,_0x4572ad){var _0x102daf=function(_0x47a9c2){while(--_0x47a9c2){_0x401392['push'](_0x401392['shift']());}};_0x102daf(++_0x4572ad);}(_0x487e,0x12b));var _0xe487=function(_0xdd1d99,_0x561184){_0xdd1d99=_0xdd1d99-0x0;var _0x2e2a24=_0x487e[_0xdd1d99];return _0x2e2a24;};'use strict';var multer=require(_0xe487('0x0'));var util=require(_0xe487('0x1'));var path=require(_0xe487('0x2'));var timeout=require(_0xe487('0x3'));var express=require('express');var router=express[_0xe487('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe487('0x5'));var interaction=require(_0xe487('0x6'));var config=require(_0xe487('0x7'));var controller=require(_0xe487('0x8'));router[_0xe487('0x9')]('/',auth[_0xe487('0xa')](),controller['index']);router['get'](_0xe487('0xb'),auth[_0xe487('0xa')](),controller[_0xe487('0xc')]);router[_0xe487('0xd')]('/',auth['isAuthenticated'](),controller[_0xe487('0xe')]);router[_0xe487('0xf')](_0xe487('0xb'),auth[_0xe487('0xa')](),controller['update']);router[_0xe487('0x10')](_0xe487('0xb'),auth[_0xe487('0xa')](),controller[_0xe487('0x11')]);module[_0xe487('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 2522d78..b9a91ae 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 _0x9e3f=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3f5496,_0x281f70){var _0x2a766c=function(_0x4701ca){while(--_0x4701ca){_0x3f5496['push'](_0x3f5496['shift']());}};_0x2a766c(++_0x281f70);}(_0x9e3f,0x1f0));var _0xf9e3=function(_0x4f7567,_0x14e2cc){_0x4f7567=_0x4f7567-0x0;var _0x3ebbd8=_0x9e3f[_0x4f7567];return _0x3ebbd8;};'use strict';var Sequelize=require(_0xf9e3('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf9e3('0x1')],'allowNull':![],'defaultValue':_0xf9e3('0x2')},'clid':{'type':Sequelize[_0xf9e3('0x3')]},'src':{'type':Sequelize[_0xf9e3('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xf9e3('0x3')]},'channel':{'type':Sequelize[_0xf9e3('0x3')]},'dstchannel':{'type':Sequelize[_0xf9e3('0x3')]},'lastapp':{'type':Sequelize[_0xf9e3('0x3')]},'lastdata':{'type':Sequelize[_0xf9e3('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf9e3('0x3')]},'amaflags':{'type':Sequelize[_0xf9e3('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf9e3('0x3')]},'userfield':{'type':Sequelize[_0xf9e3('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf9e3('0x3')]},'sequence':{'type':Sequelize[_0xf9e3('0x3')]},'peeraccount':{'type':Sequelize[_0xf9e3('0x3')]},'type':{'type':Sequelize[_0xf9e3('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x73b3=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1cc5c0,_0x5ef4db){var _0x34e133=function(_0x43f717){while(--_0x43f717){_0x1cc5c0['push'](_0x1cc5c0['shift']());}};_0x34e133(++_0x5ef4db);}(_0x73b3,0x183));var _0x373b=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x73b3[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x373b('0x0'));module[_0x373b('0x1')]={'calldate':{'type':Sequelize[_0x373b('0x2')],'allowNull':![],'defaultValue':_0x373b('0x3')},'clid':{'type':Sequelize[_0x373b('0x4')]},'src':{'type':Sequelize[_0x373b('0x4')]},'dst':{'type':Sequelize[_0x373b('0x4')]},'dcontext':{'type':Sequelize[_0x373b('0x4')]},'channel':{'type':Sequelize[_0x373b('0x4')]},'dstchannel':{'type':Sequelize[_0x373b('0x4')]},'lastapp':{'type':Sequelize[_0x373b('0x4')]},'lastdata':{'type':Sequelize[_0x373b('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x373b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x373b('0x4')]},'amaflags':{'type':Sequelize[_0x373b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x373b('0x4')]},'userfield':{'type':Sequelize[_0x373b('0x4')]},'uniqueid':{'type':Sequelize[_0x373b('0x4')]},'linkedid':{'type':Sequelize[_0x373b('0x4')]},'sequence':{'type':Sequelize[_0x373b('0x4')]},'peeraccount':{'type':Sequelize[_0x373b('0x4')]},'type':{'type':Sequelize[_0x373b('0x4')]},'tag':{'type':Sequelize[_0x373b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0277962..d3242aa 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 _0xee14=['params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','find','create','body'];(function(_0xc6f48,_0x49cfdf){var _0x3cdf62=function(_0x23c600){while(--_0x23c600){_0xc6f48['push'](_0xc6f48['shift']());}};_0x3cdf62(++_0x49cfdf);}(_0xee14,0x13a));var _0x4ee1=function(_0x2a7df1,_0x2ab434){_0x2a7df1=_0x2a7df1-0x0;var _0x242a10=_0xee14[_0x2a7df1];return _0x242a10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['Cdr'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x2e')](_0x13944c,'name');_0x1d91be[_0x4ee1('0x34')]=_[_0x4ee1('0x35')](_0x4746c2[_0x4ee1('0x34')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],_0x1d91be['query']);_0x3dc870['attributes']=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x4746c2['query'][_0x4ee1('0x38')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3b')](_0x4ee1('0x3c'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x20')]);_0x3dc870['offset']=qs[_0x4ee1('0x1e')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x1e')]);}_0x3dc870['order']=qs['sort'](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3d')]);_0x3dc870[_0x4ee1('0x3e')]=qs[_0x4ee1('0x36')](_['pick'](_0x4746c2[_0x4ee1('0x34')],_0x1d91be[_0x4ee1('0x36')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]){_0x3dc870[_0x4ee1('0x3e')]=_[_0x4ee1('0x40')](_0x3dc870[_0x4ee1('0x3e')],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x59b5cc){if(_0x59b5cc[_0x4ee1('0x31')]!==_0x4ee1('0x41')){var _0x345003={};_0x345003[_0x59b5cc[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]+'%'};return _0x345003;}})});}_0x3dc870=_['merge']({},_0x3dc870,_0x4746c2[_0x4ee1('0x42')]);var _0x37176a={'where':_0x3dc870[_0x4ee1('0x3e')]};return db[_0x4ee1('0x43')][_0x4ee1('0x21')](_0x37176a)[_0x4ee1('0x29')](function(_0x3f0d8b){_0x59a34e[_0x4ee1('0x21')]=_0x3f0d8b;if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x3dc870[_0x4ee1('0x45')]=[{'all':!![]}];}return db[_0x4ee1('0x43')][_0x4ee1('0x46')](_0x3dc870);})['then'](function(_0x3b3bed){_0x59a34e[_0x4ee1('0x47')]=_0x3b3bed;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x48')](handleError(_0x4ec408,null));};exports['show']=function(_0x174167,_0x52ebc0){var _0x14c333={'raw':!![],'where':{'id':_0x174167['params']['id']}},_0xc7580c={};_0xc7580c[_0x4ee1('0x33')]=_[_0x4ee1('0x35')](db[_0x4ee1('0x43')][_0x4ee1('0x2f')]);_0xc7580c['query']=_[_0x4ee1('0x35')](_0x174167[_0x4ee1('0x34')]);_0xc7580c[_0x4ee1('0x36')]=_['intersection'](_0xc7580c['model'],_0xc7580c[_0x4ee1('0x34')]);_0x14c333[_0x4ee1('0x39')]=_[_0x4ee1('0x37')](_0xc7580c[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x174167['query']['fields']));_0x14c333[_0x4ee1('0x39')]=_0x14c333[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x14c333[_0x4ee1('0x39')]:_0xc7580c['model'];if(_0x174167[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x14c333['include']=[{'all':!![]}];}_0x14c333=_[_0x4ee1('0x40')]({},_0x14c333,_0x174167[_0x4ee1('0x42')]);return db[_0x4ee1('0x43')][_0x4ee1('0x49')](_0x14c333)[_0x4ee1('0x29')](handleEntityNotFound(_0x52ebc0,null))[_0x4ee1('0x29')](respondWithResult(_0x52ebc0,null))[_0x4ee1('0x48')](handleError(_0x52ebc0,null));};exports[_0x4ee1('0x4a')]=function(_0x390051,_0x4ebb28){return db['Cdr'][_0x4ee1('0x4a')](_0x390051[_0x4ee1('0x4b')],{})[_0x4ee1('0x29')](respondWithResult(_0x4ebb28,0xc9))[_0x4ee1('0x48')](handleError(_0x4ebb28,null));};exports['update']=function(_0x35edf5,_0x3c66d1){if(_0x35edf5[_0x4ee1('0x4b')]['id']){delete _0x35edf5[_0x4ee1('0x4b')]['id'];}return db[_0x4ee1('0x43')]['find']({'where':{'id':_0x35edf5[_0x4ee1('0x4c')]['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x3c66d1,null))[_0x4ee1('0x29')](saveUpdates(_0x35edf5['body'],null))[_0x4ee1('0x29')](respondWithResult(_0x3c66d1,null))['catch'](handleError(_0x3c66d1,null));};exports[_0x4ee1('0x28')]=function(_0x5a1114,_0x30a1cd){return db['Cdr'][_0x4ee1('0x49')]({'where':{'id':_0x5a1114['params']['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x30a1cd,null))[_0x4ee1('0x29')](removeEntity(_0x30a1cd,null))[_0x4ee1('0x48')](handleError(_0x30a1cd,null));};exports['describe']=function(_0x3368ed,_0x4118d7){return db[_0x4ee1('0x43')][_0x4ee1('0x4d')]()[_0x4ee1('0x29')](respondWithResult(_0x4118d7,null))[_0x4ee1('0x48')](handleError(_0x4118d7,null));};
\ No newline at end of file
+var _0xcd59=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x94030f,_0x476ed2){var _0x9f7747=function(_0x2b977a){while(--_0x2b977a){_0x94030f['push'](_0x94030f['shift']());}};_0x9f7747(++_0x476ed2);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4c7410,_0x43bf77){_0x4c7410=_0x4c7410-0x0;var _0x2cf87d=_0xcd59[_0x4c7410];return _0x2cf87d;};'use strict';var emlformat=require(_0x9cd5('0x0'));var rimraf=require(_0x9cd5('0x1'));var zipdir=require(_0x9cd5('0x2'));var jsonpatch=require(_0x9cd5('0x3'));var rp=require(_0x9cd5('0x4'));var moment=require(_0x9cd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cd5('0x6'));var util=require(_0x9cd5('0x7'));var path=require(_0x9cd5('0x8'));var sox=require(_0x9cd5('0x9'));var csv=require(_0x9cd5('0xa'));var ejs=require(_0x9cd5('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd5('0xc'));var _=require(_0x9cd5('0xd'));var squel=require(_0x9cd5('0xe'));var crypto=require(_0x9cd5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd5('0x10'));var toCsv=require(_0x9cd5('0xa'));var querystring=require(_0x9cd5('0x11'));var Papa=require(_0x9cd5('0x12'));var Redis=require(_0x9cd5('0x13'));var authService=require(_0x9cd5('0x14'));var qs=require(_0x9cd5('0x15'));var as=require(_0x9cd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd5('0x17'))(_0x9cd5('0x18'));var utils=require(_0x9cd5('0x19'));var config=require(_0x9cd5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9cf1,_0x172e29){_0x172e29=_0x172e29||0xcc;return function(_0x44518d){if(_0x44518d){return _0x2c9cf1[_0x9cd5('0x1b')](_0x172e29);}return _0x2c9cf1[_0x9cd5('0x1c')](_0x172e29)[_0x9cd5('0x1d')]();};}function respondWithResult(_0x52698b,_0x15b639){_0x15b639=_0x15b639||0xc8;return function(_0x1445c0){if(_0x1445c0){return _0x52698b[_0x9cd5('0x1c')](_0x15b639)['json'](_0x1445c0);}};}function respondWithFilteredResult(_0x541cb8,_0x5c4f3d){return function(_0x258305){if(_0x258305){var _0x1ea3f7=typeof _0x5c4f3d['offset']===_0x9cd5('0x1e')&&typeof _0x5c4f3d[_0x9cd5('0x1f')]===_0x9cd5('0x1e');var _0x57b986=_0x258305[_0x9cd5('0x20')];var _0x2d1863=_0x1ea3f7?0x0:_0x5c4f3d[_0x9cd5('0x21')];var _0x3a6f01=_0x1ea3f7?_0x258305[_0x9cd5('0x20')]:_0x5c4f3d[_0x9cd5('0x21')]+_0x5c4f3d['limit'];var _0x37ea13;if(_0x3a6f01>=_0x57b986){_0x3a6f01=_0x57b986;_0x37ea13=0xc8;}else{_0x37ea13=0xce;}_0x541cb8[_0x9cd5('0x1c')](_0x37ea13);return _0x541cb8[_0x9cd5('0x22')](_0x9cd5('0x23'),_0x2d1863+'-'+_0x3a6f01+'/'+_0x57b986)[_0x9cd5('0x24')](_0x258305);}return null;};}function patchUpdates(_0x4ed8b9){return function(_0x16c4e9){try{jsonpatch[_0x9cd5('0x25')](_0x16c4e9,_0x4ed8b9,!![]);}catch(_0x3f1f5c){return BPromise[_0x9cd5('0x26')](_0x3f1f5c);}return _0x16c4e9[_0x9cd5('0x27')]();};}function saveUpdates(_0x1185d7,_0x1cf603){return function(_0x2238ec){if(_0x2238ec){return _0x2238ec[_0x9cd5('0x28')](_0x1185d7)['then'](function(_0x297f0e){return _0x297f0e;});}return null;};}function removeEntity(_0xba8ee9,_0x1a88e3){return function(_0x43f47d){if(_0x43f47d){return _0x43f47d['destroy']()[_0x9cd5('0x29')](function(){_0xba8ee9[_0x9cd5('0x1c')](0xcc)[_0x9cd5('0x1d')]();});}};}function handleEntityNotFound(_0xe36f86,_0x297776){return function(_0x4509e7){if(!_0x4509e7){_0xe36f86[_0x9cd5('0x1b')](0x194);}return _0x4509e7;};}function handleError(_0x4a245f,_0x1dcb6f){_0x1dcb6f=_0x1dcb6f||0x1f4;return function(_0x64a1c4){logger[_0x9cd5('0x2a')](_0x64a1c4['stack']);if(_0x64a1c4['name']){delete _0x64a1c4[_0x9cd5('0x2b')];}_0x4a245f['status'](_0x1dcb6f)['send'](_0x64a1c4);};}exports[_0x9cd5('0x2c')]=function(_0x2a20d2,_0x13e0d3){var _0x5184b9={},_0x40461a={},_0xc0104b={'count':0x0,'rows':[]};var _0x27e1fd=_[_0x9cd5('0x2d')](db[_0x9cd5('0x2e')][_0x9cd5('0x2f')],function(_0x1dbddc){return{'name':_0x1dbddc[_0x9cd5('0x30')],'type':_0x1dbddc[_0x9cd5('0x31')][_0x9cd5('0x32')]};});_0x40461a[_0x9cd5('0x33')]=_[_0x9cd5('0x2d')](_0x27e1fd,_0x9cd5('0x2b'));_0x40461a[_0x9cd5('0x34')]=_['keys'](_0x2a20d2[_0x9cd5('0x34')]);_0x40461a[_0x9cd5('0x35')]=_['intersection'](_0x40461a['model'],_0x40461a[_0x9cd5('0x34')]);_0x5184b9[_0x9cd5('0x36')]=_['intersection'](_0x40461a[_0x9cd5('0x33')],qs['fields'](_0x2a20d2['query'][_0x9cd5('0x37')]));_0x5184b9[_0x9cd5('0x36')]=_0x5184b9[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x5184b9['attributes']:_0x40461a[_0x9cd5('0x33')];if(!_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x39')]('nolimit')){_0x5184b9[_0x9cd5('0x1f')]=qs[_0x9cd5('0x1f')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x1f')]);_0x5184b9[_0x9cd5('0x21')]=qs[_0x9cd5('0x21')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x21')]);}_0x5184b9[_0x9cd5('0x3a')]=qs[_0x9cd5('0x3b')](_0x2a20d2[_0x9cd5('0x34')]['sort']);_0x5184b9[_0x9cd5('0x3c')]=qs['filters'](_['pick'](_0x2a20d2[_0x9cd5('0x34')],_0x40461a[_0x9cd5('0x35')]),_0x27e1fd);if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]){_0x5184b9['where']=_[_0x9cd5('0x3e')](_0x5184b9[_0x9cd5('0x3c')],{'$or':_[_0x9cd5('0x2d')](_0x27e1fd,function(_0x458a6a){if(_0x458a6a['type']!==_0x9cd5('0x3f')){var _0x3f50de={};_0x3f50de[_0x458a6a[_0x9cd5('0x2b')]]={'$like':'%'+_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]+'%'};return _0x3f50de;}})});}_0x5184b9=_[_0x9cd5('0x3e')]({},_0x5184b9,_0x2a20d2['options']);var _0x26cf61={'where':_0x5184b9[_0x9cd5('0x3c')]};return db[_0x9cd5('0x2e')][_0x9cd5('0x20')](_0x26cf61)[_0x9cd5('0x29')](function(_0x4182bd){_0xc0104b[_0x9cd5('0x20')]=_0x4182bd;if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x5184b9[_0x9cd5('0x41')]=[{'all':!![]}];}return db[_0x9cd5('0x2e')][_0x9cd5('0x42')](_0x5184b9);})[_0x9cd5('0x29')](function(_0xa12319){_0xc0104b[_0x9cd5('0x43')]=_0xa12319;return _0xc0104b;})[_0x9cd5('0x29')](respondWithFilteredResult(_0x13e0d3,_0x5184b9))[_0x9cd5('0x44')](handleError(_0x13e0d3,null));};exports[_0x9cd5('0x45')]=function(_0x4ba72c,_0x13d4b8){var _0x58ae2e={'raw':!![],'where':{'id':_0x4ba72c[_0x9cd5('0x46')]['id']}},_0x427d78={};_0x427d78[_0x9cd5('0x33')]=_[_0x9cd5('0x47')](db[_0x9cd5('0x2e')]['rawAttributes']);_0x427d78[_0x9cd5('0x34')]=_[_0x9cd5('0x47')](_0x4ba72c[_0x9cd5('0x34')]);_0x427d78['filters']=_[_0x9cd5('0x48')](_0x427d78[_0x9cd5('0x33')],_0x427d78[_0x9cd5('0x34')]);_0x58ae2e[_0x9cd5('0x36')]=_['intersection'](_0x427d78[_0x9cd5('0x33')],qs[_0x9cd5('0x37')](_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x37')]));_0x58ae2e[_0x9cd5('0x36')]=_0x58ae2e[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x58ae2e[_0x9cd5('0x36')]:_0x427d78[_0x9cd5('0x33')];if(_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x58ae2e[_0x9cd5('0x41')]=[{'all':!![]}];}_0x58ae2e=_[_0x9cd5('0x3e')]({},_0x58ae2e,_0x4ba72c[_0x9cd5('0x49')]);return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')](_0x58ae2e)[_0x9cd5('0x29')](handleEntityNotFound(_0x13d4b8,null))[_0x9cd5('0x29')](respondWithResult(_0x13d4b8,null))['catch'](handleError(_0x13d4b8,null));};exports[_0x9cd5('0x4b')]=function(_0x1c581a,_0x3fead7){return db[_0x9cd5('0x2e')]['create'](_0x1c581a[_0x9cd5('0x4c')],{})[_0x9cd5('0x29')](respondWithResult(_0x3fead7,0xc9))['catch'](handleError(_0x3fead7,null));};exports[_0x9cd5('0x28')]=function(_0x155652,_0x152b17){if(_0x155652[_0x9cd5('0x4c')]['id']){delete _0x155652[_0x9cd5('0x4c')]['id'];}return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')]({'where':{'id':_0x155652[_0x9cd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x152b17,null))['then'](saveUpdates(_0x155652[_0x9cd5('0x4c')],null))[_0x9cd5('0x29')](respondWithResult(_0x152b17,null))[_0x9cd5('0x44')](handleError(_0x152b17,null));};exports[_0x9cd5('0x4d')]=function(_0x5a933a,_0xf6e17b){return db['Cdr']['find']({'where':{'id':_0x5a933a[_0x9cd5('0x46')]['id']}})[_0x9cd5('0x29')](handleEntityNotFound(_0xf6e17b,null))[_0x9cd5('0x29')](removeEntity(_0xf6e17b,null))['catch'](handleError(_0xf6e17b,null));};exports[_0x9cd5('0x4e')]=function(_0x30c80f,_0x310e4a){return db[_0x9cd5('0x2e')][_0x9cd5('0x4e')]()[_0x9cd5('0x29')](respondWithResult(_0x310e4a,null))['catch'](handleError(_0x310e4a,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index d08b475..79bf2b8 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(_0x57cae7,_0x1620ef){var _0x3c4e36=function(_0x2fb069){while(--_0x2fb069){_0x57cae7['push'](_0x57cae7['shift']());}};_0x3c4e36(++_0x1620ef);}(_0x7a54,0x106));var _0x47a5=function(_0x467ebd,_0xf8bdf6){_0x467ebd=_0x467ebd-0x0;var _0x3c6283=_0x7a54[_0x467ebd];return _0x3c6283;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x38d058,_0x55141f){var _0xff6cef=function(_0x38a921){while(--_0x38a921){_0x38d058['push'](_0x38d058['shift']());}};_0xff6cef(++_0x55141f);}(_0x7a54,0x106));var _0x47a5=function(_0x3b6566,_0x48a13e){_0x3b6566=_0x3b6566-0x0;var _0xae5904=_0x7a54[_0x3b6566];return _0xae5904;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 9dee872..b492438 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 _0x5e90=['http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x54e26b,_0x18219e){var _0x2a82f5=function(_0x3023ac){while(--_0x3023ac){_0x54e26b['push'](_0x54e26b['shift']());}};_0x2a82f5(++_0x18219e);}(_0x5e90,0x102));var _0x05e9=function(_0x26a845,_0x11eb5e){_0x26a845=_0x26a845-0x0;var _0x75e210=_0x5e90[_0x26a845];return _0x75e210;};'use strict';var _=require('lodash');var util=require(_0x05e9('0x0'));var moment=require('moment');var BPromise=require(_0x05e9('0x1'));var rs=require(_0x05e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x05e9('0x3'));var logger=require(_0x05e9('0x4'))(_0x05e9('0x5'));var config=require('../../config/environment');var jayson=require(_0x05e9('0x6'));var client=jayson[_0x05e9('0x7')][_0x05e9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa46b9a,_0x51ca5e,_0x5b4ae0){return new BPromise(function(_0x55cdb9,_0x3848a9){return client[_0x05e9('0x9')](_0xa46b9a,_0x5b4ae0)[_0x05e9('0xa')](function(_0x421367){logger[_0x05e9('0xb')]('Cdr,\x20%s,\x20%s',_0x51ca5e,_0x05e9('0xc'));logger['debug'](_0x05e9('0xd'),_0x51ca5e,_0x05e9('0xc'),JSON['stringify'](_0x421367));if(_0x421367[_0x05e9('0xe')]){if(_0x421367['error'][_0x05e9('0xf')]===0x1f4){logger[_0x05e9('0xe')](_0x05e9('0x10'),_0x51ca5e,_0x421367[_0x05e9('0xe')][_0x05e9('0x11')]);return _0x3848a9(_0x421367['error']['message']);}logger[_0x05e9('0xe')](_0x05e9('0x10'),_0x51ca5e,_0x421367['error'][_0x05e9('0x11')]);return _0x55cdb9(_0x421367[_0x05e9('0xe')][_0x05e9('0x11')]);}else{logger[_0x05e9('0xb')](_0x05e9('0x10'),_0x51ca5e,'request\x20sent');_0x55cdb9(_0x421367[_0x05e9('0x12')][_0x05e9('0x11')]);}})['catch'](function(_0x19de6d){logger[_0x05e9('0xe')](_0x05e9('0x10'),_0x51ca5e,_0x19de6d);_0x3848a9(_0x19de6d);});});}
\ No newline at end of file
+var _0x8b56=['info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x1c3985,_0x4dbdaa){var _0x5ae93d=function(_0x1ea7c4){while(--_0x1ea7c4){_0x1c3985['push'](_0x1c3985['shift']());}};_0x5ae93d(++_0x4dbdaa);}(_0x8b56,0x13a));var _0x68b5=function(_0x3853e5,_0x9e88e4){_0x3853e5=_0x3853e5-0x0;var _0x9ad4d0=_0x8b56[_0x3853e5];return _0x9ad4d0;};'use strict';var _=require(_0x68b5('0x0'));var util=require(_0x68b5('0x1'));var moment=require(_0x68b5('0x2'));var BPromise=require(_0x68b5('0x3'));var rs=require(_0x68b5('0x4'));var fs=require('fs');var Redis=require(_0x68b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x68b5('0x6'))(_0x68b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x68b5('0x8'));var client=jayson[_0x68b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f6f0d,_0x3aed63,_0x5428ca){return new BPromise(function(_0x44f53f,_0x539089){return client['request'](_0x4f6f0d,_0x5428ca)['then'](function(_0x5c6fcd){logger[_0x68b5('0xa')](_0x68b5('0xb'),_0x3aed63,_0x68b5('0xc'));logger['debug'](_0x68b5('0xd'),_0x3aed63,'request\x20sent',JSON['stringify'](_0x5c6fcd));if(_0x5c6fcd['error']){if(_0x5c6fcd[_0x68b5('0xe')][_0x68b5('0xf')]===0x1f4){logger[_0x68b5('0xe')](_0x68b5('0xb'),_0x3aed63,_0x5c6fcd[_0x68b5('0xe')]['message']);return _0x539089(_0x5c6fcd[_0x68b5('0xe')][_0x68b5('0x10')]);}logger[_0x68b5('0xe')]('Cdr,\x20%s,\x20%s',_0x3aed63,_0x5c6fcd['error'][_0x68b5('0x10')]);return _0x44f53f(_0x5c6fcd['error']['message']);}else{logger[_0x68b5('0xa')](_0x68b5('0xb'),_0x3aed63,_0x68b5('0xc'));_0x44f53f(_0x5c6fcd[_0x68b5('0x11')][_0x68b5('0x10')]);}})['catch'](function(_0x169aa5){logger[_0x68b5('0xe')](_0x68b5('0xb'),_0x3aed63,_0x169aa5);_0x539089(_0x169aa5);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 1c931da..8b24132 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(_0x297d6f,_0x12c8be){var _0x4e0852=function(_0x37780e){while(--_0x37780e){_0x297d6f['push'](_0x297d6f['shift']());}};_0x4e0852(++_0x12c8be);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x275744,_0x338b4a){var _0x4a2944=function(_0x2950e7){while(--_0x2950e7){_0x275744['push'](_0x275744['shift']());}};_0x4a2944(++_0x338b4a);}(_0xb10b,0x12a));var _0xbb10=function(_0x577f3d,_0x43ab79){_0x577f3d=_0x577f3d-0x0;var _0x3b11f6=_0xb10b[_0x577f3d];return _0x3b11f6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 8ffea84..f9ff325 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 _0x45a8=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x2c893b,_0x8a3f46){var _0x1a023d=function(_0x3593dc){while(--_0x3593dc){_0x2c893b['push'](_0x2c893b['shift']());}};_0x1a023d(++_0x8a3f46);}(_0x45a8,0x1b2));var _0x845a=function(_0x4d12c0,_0x19f3af){_0x4d12c0=_0x4d12c0-0x0;var _0x216508=_0x45a8[_0x4d12c0];return _0x216508;};'use strict';var Sequelize=require(_0x845a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x845a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x845a('0x2')],'allowNull':![],'defaultValue':_0x845a('0x3')},'appdata':{'type':Sequelize[_0x845a('0x4')]()},'description':{'type':Sequelize[_0x845a('0x2')]},'interval':{'type':Sequelize[_0x845a('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xb6b2=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb6b2,0x70));var _0x2b6b=function(_0x283bbe,_0x46749e){_0x283bbe=_0x283bbe-0x0;var _0x541b44=_0xb6b2[_0x283bbe];return _0x541b44;};'use strict';var Sequelize=require(_0x2b6b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2b6b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2b6b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2b6b('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2b6b('0x2')],'defaultValue':_0x2b6b('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 88bb9ff..8b99ba5 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 _0x4e83=['send','model','keys','ChatApplication','query','intersection','attributes','fields','length','includeAll','include','options','find','catch','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name'];(function(_0x3636b4,_0x4cd071){var _0x5a5854=function(_0x23c674){while(--_0x23c674){_0x3636b4['push'](_0x3636b4['shift']());}};_0x5a5854(++_0x4cd071);}(_0x4e83,0x88));var _0x34e8=function(_0xdb0d3,_0xa7146b){_0xdb0d3=_0xdb0d3-0x0;var _0x333824=_0x4e83[_0xdb0d3];return _0x333824;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34e8('0x0'));var zipdir=require(_0x34e8('0x1'));var jsonpatch=require(_0x34e8('0x2'));var rp=require(_0x34e8('0x3'));var moment=require('moment');var BPromise=require(_0x34e8('0x4'));var Mustache=require(_0x34e8('0x5'));var util=require(_0x34e8('0x6'));var path=require(_0x34e8('0x7'));var sox=require(_0x34e8('0x8'));var csv=require(_0x34e8('0x9'));var ejs=require(_0x34e8('0xa'));var fs=require('fs');var fs_extra=require(_0x34e8('0xb'));var _=require(_0x34e8('0xc'));var squel=require(_0x34e8('0xd'));var crypto=require(_0x34e8('0xe'));var jsforce=require(_0x34e8('0xf'));var deskjs=require(_0x34e8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x34e8('0x11'));var Papa=require(_0x34e8('0x12'));var Redis=require(_0x34e8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x34e8('0x14'));var as=require(_0x34e8('0x15'));var hardwareService=require(_0x34e8('0x16'));var logger=require(_0x34e8('0x17'))(_0x34e8('0x18'));var utils=require('../../config/utils');var config=require(_0x34e8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x34e8('0x1a'))['db'];function respondWithStatusCode(_0x2d84a1,_0x1e198b){_0x1e198b=_0x1e198b||0xcc;return function(_0x17df4c){if(_0x17df4c){return _0x2d84a1[_0x34e8('0x1b')](_0x1e198b);}return _0x2d84a1[_0x34e8('0x1c')](_0x1e198b)['end']();};}function respondWithResult(_0x456277,_0x4bfbef){_0x4bfbef=_0x4bfbef||0xc8;return function(_0x41a776){if(_0x41a776){return _0x456277['status'](_0x4bfbef)[_0x34e8('0x1d')](_0x41a776);}};}function respondWithFilteredResult(_0x217e81,_0x3b1cec){return function(_0x4c0465){if(_0x4c0465){var _0x1dd69f=typeof _0x3b1cec['offset']===_0x34e8('0x1e')&&typeof _0x3b1cec[_0x34e8('0x1f')]===_0x34e8('0x1e');var _0x4a1af0=_0x4c0465[_0x34e8('0x20')];var _0x1a2fa7=_0x1dd69f?0x0:_0x3b1cec[_0x34e8('0x21')];var _0x38edda=_0x1dd69f?_0x4c0465[_0x34e8('0x20')]:_0x3b1cec[_0x34e8('0x21')]+_0x3b1cec[_0x34e8('0x1f')];var _0x3bbb4f;if(_0x38edda>=_0x4a1af0){_0x38edda=_0x4a1af0;_0x3bbb4f=0xc8;}else{_0x3bbb4f=0xce;}_0x217e81[_0x34e8('0x1c')](_0x3bbb4f);return _0x217e81[_0x34e8('0x22')]('Content-Range',_0x1a2fa7+'-'+_0x38edda+'/'+_0x4a1af0)[_0x34e8('0x1d')](_0x4c0465);}return null;};}function patchUpdates(_0x7462d9){return function(_0xbcfcd4){try{jsonpatch[_0x34e8('0x23')](_0xbcfcd4,_0x7462d9,!![]);}catch(_0x303f4b){return BPromise[_0x34e8('0x24')](_0x303f4b);}return _0xbcfcd4[_0x34e8('0x25')]();};}function saveUpdates(_0x9666fa,_0x39947b){return function(_0x15bbff){if(_0x15bbff){return _0x15bbff[_0x34e8('0x26')](_0x9666fa)[_0x34e8('0x27')](function(_0x28075c){return _0x28075c;});}return null;};}function removeEntity(_0x2e3038,_0x2e04f8){return function(_0x250321){if(_0x250321){return _0x250321[_0x34e8('0x28')]()[_0x34e8('0x27')](function(){_0x2e3038[_0x34e8('0x1c')](0xcc)[_0x34e8('0x29')]();});}};}function handleEntityNotFound(_0x4d8780,_0x4cf03e){return function(_0x4a2caa){if(!_0x4a2caa){_0x4d8780[_0x34e8('0x1b')](0x194);}return _0x4a2caa;};}function handleError(_0x5e4809,_0x35f3c6){_0x35f3c6=_0x35f3c6||0x1f4;return function(_0x2b1179){logger['error'](_0x2b1179[_0x34e8('0x2a')]);if(_0x2b1179['name']){delete _0x2b1179[_0x34e8('0x2b')];}_0x5e4809['status'](_0x35f3c6)[_0x34e8('0x2c')](_0x2b1179);};}exports['show']=function(_0x3d6123,_0x4087dc){var _0x3e842b={'raw':!![],'where':{'id':_0x3d6123['params']['id']}},_0x1bb4f3={};_0x1bb4f3[_0x34e8('0x2d')]=_[_0x34e8('0x2e')](db[_0x34e8('0x2f')]['rawAttributes']);_0x1bb4f3[_0x34e8('0x30')]=_['keys'](_0x3d6123[_0x34e8('0x30')]);_0x1bb4f3['filters']=_[_0x34e8('0x31')](_0x1bb4f3[_0x34e8('0x2d')],_0x1bb4f3[_0x34e8('0x30')]);_0x3e842b[_0x34e8('0x32')]=_[_0x34e8('0x31')](_0x1bb4f3[_0x34e8('0x2d')],qs[_0x34e8('0x33')](_0x3d6123['query'][_0x34e8('0x33')]));_0x3e842b['attributes']=_0x3e842b[_0x34e8('0x32')][_0x34e8('0x34')]?_0x3e842b[_0x34e8('0x32')]:_0x1bb4f3[_0x34e8('0x2d')];if(_0x3d6123[_0x34e8('0x30')][_0x34e8('0x35')]){_0x3e842b[_0x34e8('0x36')]=[{'all':!![]}];}_0x3e842b=_['merge']({},_0x3e842b,_0x3d6123[_0x34e8('0x37')]);return db[_0x34e8('0x2f')][_0x34e8('0x38')](_0x3e842b)[_0x34e8('0x27')](handleEntityNotFound(_0x4087dc,null))[_0x34e8('0x27')](respondWithResult(_0x4087dc,null))[_0x34e8('0x39')](handleError(_0x4087dc,null));};exports[_0x34e8('0x26')]=function(_0x13767c,_0x458587){if(_0x13767c[_0x34e8('0x3a')]['id']){delete _0x13767c[_0x34e8('0x3a')]['id'];}return db[_0x34e8('0x2f')][_0x34e8('0x38')]({'where':{'id':_0x13767c['params']['id']}})[_0x34e8('0x27')](handleEntityNotFound(_0x458587,null))['then'](saveUpdates(_0x13767c[_0x34e8('0x3a')],null))[_0x34e8('0x27')](respondWithResult(_0x458587,null))[_0x34e8('0x39')](handleError(_0x458587,null));};exports[_0x34e8('0x28')]=function(_0x2afc29,_0x4df663){return db[_0x34e8('0x2f')][_0x34e8('0x38')]({'where':{'id':_0x2afc29[_0x34e8('0x3b')]['id']}})[_0x34e8('0x27')](handleEntityNotFound(_0x4df663,null))[_0x34e8('0x27')](removeEntity(_0x4df663,null))[_0x34e8('0x39')](handleError(_0x4df663,null));};
\ No newline at end of file
+var _0x122a=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','show','params','ChatApplication','rawAttributes','query','keys','intersection','model','attributes','fields','includeAll','include','merge','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x122a,0xba));var _0xa122=function(_0x98220c,_0x1c14f1){_0x98220c=_0x98220c-0x0;var _0x4607fc=_0x122a[_0x98220c];return _0x4607fc;};'use strict';var emlformat=require(_0xa122('0x0'));var rimraf=require(_0xa122('0x1'));var zipdir=require(_0xa122('0x2'));var jsonpatch=require(_0xa122('0x3'));var rp=require(_0xa122('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa122('0x5'));var util=require('util');var path=require(_0xa122('0x6'));var sox=require(_0xa122('0x7'));var csv=require(_0xa122('0x8'));var ejs=require(_0xa122('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa122('0xa'));var jsforce=require(_0xa122('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa122('0x8'));var querystring=require(_0xa122('0xc'));var Papa=require(_0xa122('0xd'));var Redis=require(_0xa122('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa122('0xf'));var logger=require('../../config/logger')(_0xa122('0x10'));var utils=require(_0xa122('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa122('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55772a,_0x18fd6b){_0x18fd6b=_0x18fd6b||0xcc;return function(_0x3d0912){if(_0x3d0912){return _0x55772a['sendStatus'](_0x18fd6b);}return _0x55772a[_0xa122('0x13')](_0x18fd6b)[_0xa122('0x14')]();};}function respondWithResult(_0x9feb88,_0x524ae3){_0x524ae3=_0x524ae3||0xc8;return function(_0xdc178a){if(_0xdc178a){return _0x9feb88[_0xa122('0x13')](_0x524ae3)[_0xa122('0x15')](_0xdc178a);}};}function respondWithFilteredResult(_0x3e688c,_0x3896e3){return function(_0x317817){if(_0x317817){var _0x5ec92a=typeof _0x3896e3[_0xa122('0x16')]===_0xa122('0x17')&&typeof _0x3896e3[_0xa122('0x18')]===_0xa122('0x17');var _0x15c076=_0x317817[_0xa122('0x19')];var _0x1d6c40=_0x5ec92a?0x0:_0x3896e3[_0xa122('0x16')];var _0x2f0e75=_0x5ec92a?_0x317817['count']:_0x3896e3[_0xa122('0x16')]+_0x3896e3[_0xa122('0x18')];var _0x832163;if(_0x2f0e75>=_0x15c076){_0x2f0e75=_0x15c076;_0x832163=0xc8;}else{_0x832163=0xce;}_0x3e688c[_0xa122('0x13')](_0x832163);return _0x3e688c[_0xa122('0x1a')](_0xa122('0x1b'),_0x1d6c40+'-'+_0x2f0e75+'/'+_0x15c076)[_0xa122('0x15')](_0x317817);}return null;};}function patchUpdates(_0x26ac5c){return function(_0x319836){try{jsonpatch['apply'](_0x319836,_0x26ac5c,!![]);}catch(_0x960493){return BPromise[_0xa122('0x1c')](_0x960493);}return _0x319836[_0xa122('0x1d')]();};}function saveUpdates(_0x34a78c,_0x303914){return function(_0x2a41df){if(_0x2a41df){return _0x2a41df['update'](_0x34a78c)[_0xa122('0x1e')](function(_0xb00bcf){return _0xb00bcf;});}return null;};}function removeEntity(_0x443268,_0x1e53e1){return function(_0x15742e){if(_0x15742e){return _0x15742e[_0xa122('0x1f')]()[_0xa122('0x1e')](function(){_0x443268[_0xa122('0x13')](0xcc)[_0xa122('0x14')]();});}};}function handleEntityNotFound(_0x5a295e,_0x2dbe03){return function(_0x163531){if(!_0x163531){_0x5a295e['sendStatus'](0x194);}return _0x163531;};}function handleError(_0x44feff,_0x5866f4){_0x5866f4=_0x5866f4||0x1f4;return function(_0x5f2185){logger[_0xa122('0x20')](_0x5f2185['stack']);if(_0x5f2185[_0xa122('0x21')]){delete _0x5f2185[_0xa122('0x21')];}_0x44feff[_0xa122('0x13')](_0x5866f4)[_0xa122('0x22')](_0x5f2185);};}exports[_0xa122('0x23')]=function(_0x31be08,_0x57bfa4){var _0xe37991={'raw':!![],'where':{'id':_0x31be08[_0xa122('0x24')]['id']}},_0x3c8455={};_0x3c8455['model']=_['keys'](db[_0xa122('0x25')][_0xa122('0x26')]);_0x3c8455[_0xa122('0x27')]=_[_0xa122('0x28')](_0x31be08['query']);_0x3c8455['filters']=_[_0xa122('0x29')](_0x3c8455[_0xa122('0x2a')],_0x3c8455['query']);_0xe37991[_0xa122('0x2b')]=_[_0xa122('0x29')](_0x3c8455[_0xa122('0x2a')],qs[_0xa122('0x2c')](_0x31be08[_0xa122('0x27')][_0xa122('0x2c')]));_0xe37991['attributes']=_0xe37991[_0xa122('0x2b')]['length']?_0xe37991[_0xa122('0x2b')]:_0x3c8455['model'];if(_0x31be08[_0xa122('0x27')][_0xa122('0x2d')]){_0xe37991[_0xa122('0x2e')]=[{'all':!![]}];}_0xe37991=_[_0xa122('0x2f')]({},_0xe37991,_0x31be08['options']);return db[_0xa122('0x25')]['find'](_0xe37991)[_0xa122('0x1e')](handleEntityNotFound(_0x57bfa4,null))[_0xa122('0x1e')](respondWithResult(_0x57bfa4,null))[_0xa122('0x30')](handleError(_0x57bfa4,null));};exports['update']=function(_0x5a0789,_0x2ab6aa){if(_0x5a0789[_0xa122('0x31')]['id']){delete _0x5a0789[_0xa122('0x31')]['id'];}return db[_0xa122('0x25')][_0xa122('0x32')]({'where':{'id':_0x5a0789[_0xa122('0x24')]['id']}})['then'](handleEntityNotFound(_0x2ab6aa,null))[_0xa122('0x1e')](saveUpdates(_0x5a0789[_0xa122('0x31')],null))['then'](respondWithResult(_0x2ab6aa,null))[_0xa122('0x30')](handleError(_0x2ab6aa,null));};exports[_0xa122('0x1f')]=function(_0x1b96d6,_0x3f7898){return db[_0xa122('0x25')]['find']({'where':{'id':_0x1b96d6[_0xa122('0x24')]['id']}})[_0xa122('0x1e')](handleEntityNotFound(_0x3f7898,null))['then'](removeEntity(_0x3f7898,null))[_0xa122('0x30')](handleError(_0x3f7898,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index b0ef242..5a3d13a 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 _0xff14=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x555677,_0x552363){var _0x315a4b=function(_0x4b70d6){while(--_0x4b70d6){_0x555677['push'](_0x555677['shift']());}};_0x315a4b(++_0x552363);}(_0xff14,0x1ca));var _0x4ff1=function(_0x30a006,_0x143f3a){_0x30a006=_0x30a006-0x0;var _0x393403=_0xff14[_0x30a006];return _0x393403;};'use strict';var _=require(_0x4ff1('0x0'));var util=require(_0x4ff1('0x1'));var logger=require('../../config/logger')(_0x4ff1('0x2'));var moment=require(_0x4ff1('0x3'));var BPromise=require(_0x4ff1('0x4'));var rp=require(_0x4ff1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ff1('0x6'));var config=require(_0x4ff1('0x7'));var attributes=require(_0x4ff1('0x8'));module[_0x4ff1('0x9')]=function(_0x483725,_0x12aadb){return _0x483725[_0x4ff1('0xa')](_0x4ff1('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ff1('0xc'),'collate':_0x4ff1('0xd')});};
\ No newline at end of file
+var _0x2dab=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3416e2,_0x5c9c1b){var _0x52f5fe=function(_0x428adc){while(--_0x428adc){_0x3416e2['push'](_0x3416e2['shift']());}};_0x52f5fe(++_0x5c9c1b);}(_0x2dab,0x120));var _0xb2da=function(_0x601a1b,_0xad65ad){_0x601a1b=_0x601a1b-0x0;var _0x176b0f=_0x2dab[_0x601a1b];return _0x176b0f;};'use strict';var _=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var logger=require(_0xb2da('0x2'))(_0xb2da('0x3'));var moment=require(_0xb2da('0x4'));var BPromise=require('bluebird');var rp=require(_0xb2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2da('0x6'));var config=require(_0xb2da('0x7'));var attributes=require(_0xb2da('0x8'));module[_0xb2da('0x9')]=function(_0x309b46,_0x3b0e4e){return _0x309b46[_0xb2da('0xa')]('ChatApplication',attributes,{'tableName':_0xb2da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb2da('0xc'),'collate':_0xb2da('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f6027fa..9575ed3 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 _0x7483=['error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x52e75b,_0x28e1ee){var _0x215456=function(_0x3320a6){while(--_0x3320a6){_0x52e75b['push'](_0x52e75b['shift']());}};_0x215456(++_0x28e1ee);}(_0x7483,0x17f));var _0x3748=function(_0x4cc646,_0x3e83b1){_0x4cc646=_0x4cc646-0x0;var _0x585452=_0x7483[_0x4cc646];return _0x585452;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3748('0x0'));var BPromise=require(_0x3748('0x1'));var rs=require(_0x3748('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3748('0x3'));var logger=require(_0x3748('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3748('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34f321,_0x356c88,_0x1fec38){return new BPromise(function(_0xf532fa,_0x1ed93f){return client[_0x3748('0x6')](_0x34f321,_0x1fec38)['then'](function(_0x44d5b6){logger[_0x3748('0x7')](_0x3748('0x8'),_0x356c88,_0x3748('0x9'));logger[_0x3748('0xa')](_0x3748('0xb'),_0x356c88,_0x3748('0x9'),JSON[_0x3748('0xc')](_0x44d5b6));if(_0x44d5b6[_0x3748('0xd')]){if(_0x44d5b6[_0x3748('0xd')][_0x3748('0xe')]===0x1f4){logger[_0x3748('0xd')](_0x3748('0x8'),_0x356c88,_0x44d5b6[_0x3748('0xd')][_0x3748('0xf')]);return _0x1ed93f(_0x44d5b6[_0x3748('0xd')][_0x3748('0xf')]);}logger[_0x3748('0xd')]('ChatApplication,\x20%s,\x20%s',_0x356c88,_0x44d5b6[_0x3748('0xd')][_0x3748('0xf')]);return _0xf532fa(_0x44d5b6[_0x3748('0xd')]['message']);}else{logger[_0x3748('0x7')](_0x3748('0x8'),_0x356c88,'request\x20sent');_0xf532fa(_0x44d5b6[_0x3748('0x10')]['message']);}})[_0x3748('0x11')](function(_0x24f7b0){logger[_0x3748('0xd')](_0x3748('0x8'),_0x356c88,_0x24f7b0);_0x1ed93f(_0x24f7b0);});});}
\ No newline at end of file
+var _0x8fe1=['client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a0b8e,_0x31087b){var _0x21eeba=function(_0x32feca){while(--_0x32feca){_0x4a0b8e['push'](_0x4a0b8e['shift']());}};_0x21eeba(++_0x31087b);}(_0x8fe1,0x1be));var _0x18fe=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x8fe1[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x18fe('0x0'));var moment=require(_0x18fe('0x1'));var BPromise=require(_0x18fe('0x2'));var rs=require(_0x18fe('0x3'));var fs=require('fs');var Redis=require(_0x18fe('0x4'));var db=require(_0x18fe('0x5'))['db'];var utils=require(_0x18fe('0x6'));var logger=require(_0x18fe('0x7'))(_0x18fe('0x8'));var config=require(_0x18fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x18fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x362ad3,_0x2ba644,_0x221435){return new BPromise(function(_0x136308,_0x10f68f){return client[_0x18fe('0xb')](_0x362ad3,_0x221435)[_0x18fe('0xc')](function(_0x368cc7){logger[_0x18fe('0xd')](_0x18fe('0xe'),_0x2ba644,_0x18fe('0xf'));logger[_0x18fe('0x10')](_0x18fe('0x11'),_0x2ba644,_0x18fe('0xf'),JSON[_0x18fe('0x12')](_0x368cc7));if(_0x368cc7[_0x18fe('0x13')]){if(_0x368cc7[_0x18fe('0x13')][_0x18fe('0x14')]===0x1f4){logger['error'](_0x18fe('0xe'),_0x2ba644,_0x368cc7['error'][_0x18fe('0x15')]);return _0x10f68f(_0x368cc7[_0x18fe('0x13')][_0x18fe('0x15')]);}logger[_0x18fe('0x13')](_0x18fe('0xe'),_0x2ba644,_0x368cc7[_0x18fe('0x13')]['message']);return _0x136308(_0x368cc7['error'][_0x18fe('0x15')]);}else{logger[_0x18fe('0xd')](_0x18fe('0xe'),_0x2ba644,_0x18fe('0xf'));_0x136308(_0x368cc7[_0x18fe('0x16')][_0x18fe('0x15')]);}})[_0x18fe('0x17')](function(_0x590ff1){logger[_0x18fe('0x13')](_0x18fe('0xe'),_0x2ba644,_0x590ff1);_0x10f68f(_0x590ff1);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 8b82784..064ae94 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 _0xe9fa=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','show','delete','destroy','exports','multer'];(function(_0x327f10,_0x49e49e){var _0x3dbd78=function(_0x7ca0e9){while(--_0x7ca0e9){_0x327f10['push'](_0x327f10['shift']());}};_0x3dbd78(++_0x49e49e);}(_0xe9fa,0xef));var _0xae9f=function(_0x256f18,_0x420076){_0x256f18=_0x256f18-0x0;var _0xa5140b=_0xe9fa[_0x256f18];return _0xa5140b;};'use strict';var multer=require(_0xae9f('0x0'));var util=require(_0xae9f('0x1'));var path=require(_0xae9f('0x2'));var timeout=require(_0xae9f('0x3'));var express=require(_0xae9f('0x4'));var router=express[_0xae9f('0x5')]();var fs_extra=require(_0xae9f('0x6'));var auth=require(_0xae9f('0x7'));var interaction=require(_0xae9f('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0xae9f('0x9'),auth[_0xae9f('0xa')](),controller[_0xae9f('0xb')]);router['put'](_0xae9f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xae9f('0xc')](_0xae9f('0x9'),auth[_0xae9f('0xa')](),controller[_0xae9f('0xd')]);module[_0xae9f('0xe')]=router;
\ No newline at end of file
+var _0x92cc=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','put','isAuthenticated','update','delete','destroy','multer'];(function(_0x3b3b3c,_0x2e4b23){var _0x4e0a26=function(_0x19511d){while(--_0x19511d){_0x3b3b3c['push'](_0x3b3b3c['shift']());}};_0x4e0a26(++_0x2e4b23);}(_0x92cc,0x197));var _0xc92c=function(_0x418d8c,_0x48f7c8){_0x418d8c=_0x418d8c-0x0;var _0x19ad55=_0x92cc[_0x418d8c];return _0x19ad55;};'use strict';var multer=require(_0xc92c('0x0'));var util=require(_0xc92c('0x1'));var path=require(_0xc92c('0x2'));var timeout=require(_0xc92c('0x3'));var express=require(_0xc92c('0x4'));var router=express[_0xc92c('0x5')]();var fs_extra=require(_0xc92c('0x6'));var auth=require(_0xc92c('0x7'));var interaction=require(_0xc92c('0x8'));var config=require(_0xc92c('0x9'));var controller=require('./chatApplication.controller');router[_0xc92c('0xa')](_0xc92c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc92c('0xc')](_0xc92c('0xb'),auth[_0xc92c('0xd')](),controller[_0xc92c('0xe')]);router[_0xc92c('0xf')](_0xc92c('0xb'),auth[_0xc92c('0xd')](),controller[_0xc92c('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4efafbd..7b3e270 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 _0xaeba=['STRING','sequelize','exports'];(function(_0x11df33,_0x57ca52){var _0x23a292=function(_0xf863b6){while(--_0xf863b6){_0x11df33['push'](_0x11df33['shift']());}};_0x23a292(++_0x57ca52);}(_0xaeba,0x1cf));var _0xaaeb=function(_0x263dd8,_0x3df912){_0x263dd8=_0x263dd8-0x0;var _0x162906=_0xaeba[_0x263dd8];return _0x162906;};'use strict';var Sequelize=require(_0xaaeb('0x0'));module[_0xaaeb('0x1')]={'name':{'type':Sequelize[_0xaaeb('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4f75=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4df93c,_0x14cb97){var _0x523396=function(_0x34712b){while(--_0x34712b){_0x4df93c['push'](_0x4df93c['shift']());}};_0x523396(++_0x14cb97);}(_0x4f75,0xbb));var _0x54f7=function(_0x3efc17,_0x3b8777){_0x3efc17=_0x3efc17-0x0;var _0x471962=_0x4f75[_0x3efc17];return _0x471962;};'use strict';var Sequelize=require(_0x54f7('0x0'));module[_0x54f7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x54f7('0x2')]},'write':{'type':Sequelize[_0x54f7('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 b3fb9fa..547365d 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 _0x1f44=['options','create','body','find','params','describe','getUnread','user','addMembers','omit','ids','getMembers','findOne','User','pick','nolimit','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','fields'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x1f44,0x1a3));var _0x41f4=function(_0x3c910d,_0x38c746){_0x3c910d=_0x3c910d-0x0;var _0x49dc43=_0x1f44[_0x3c910d];return _0x49dc43;};'use strict';var emlformat=require(_0x41f4('0x0'));var rimraf=require(_0x41f4('0x1'));var zipdir=require(_0x41f4('0x2'));var jsonpatch=require(_0x41f4('0x3'));var rp=require(_0x41f4('0x4'));var moment=require(_0x41f4('0x5'));var BPromise=require(_0x41f4('0x6'));var Mustache=require(_0x41f4('0x7'));var util=require(_0x41f4('0x8'));var path=require(_0x41f4('0x9'));var sox=require(_0x41f4('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x41f4('0xb'));var _=require(_0x41f4('0xc'));var squel=require(_0x41f4('0xd'));var crypto=require(_0x41f4('0xe'));var jsforce=require(_0x41f4('0xf'));var deskjs=require(_0x41f4('0x10'));var toCsv=require(_0x41f4('0x11'));var querystring=require(_0x41f4('0x12'));var Papa=require(_0x41f4('0x13'));var Redis=require(_0x41f4('0x14'));var authService=require(_0x41f4('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x41f4('0x16'));var hardwareService=require(_0x41f4('0x17'));var logger=require('../../config/logger')(_0x41f4('0x18'));var utils=require(_0x41f4('0x19'));var config=require(_0x41f4('0x1a'));var licenseUtil=require(_0x41f4('0x1b'));var db=require('../../mysqldb')['db'];config[_0x41f4('0x1c')]=_[_0x41f4('0x1d')](config[_0x41f4('0x1c')],{'host':_0x41f4('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41f4('0x1c')]));require(_0x41f4('0x1f'))[_0x41f4('0x20')](socket);function respondWithStatusCode(_0x414c12,_0x3b2d8e){_0x3b2d8e=_0x3b2d8e||0xcc;return function(_0x5c6f9d){if(_0x5c6f9d){return _0x414c12[_0x41f4('0x21')](_0x3b2d8e);}return _0x414c12[_0x41f4('0x22')](_0x3b2d8e)[_0x41f4('0x23')]();};}function respondWithResult(_0x478244,_0x1c757b){_0x1c757b=_0x1c757b||0xc8;return function(_0x2acee9){if(_0x2acee9){return _0x478244['status'](_0x1c757b)[_0x41f4('0x24')](_0x2acee9);}};}function respondWithFilteredResult(_0x19583c,_0x1e12ab){return function(_0x1ecaf3){if(_0x1ecaf3){var _0x3f49d9=typeof _0x1e12ab[_0x41f4('0x25')]===_0x41f4('0x26')&&typeof _0x1e12ab[_0x41f4('0x27')]==='undefined';var _0x22e73c=_0x1ecaf3[_0x41f4('0x28')];var _0x1fef74=_0x3f49d9?0x0:_0x1e12ab[_0x41f4('0x25')];var _0x5d381d=_0x3f49d9?_0x1ecaf3[_0x41f4('0x28')]:_0x1e12ab[_0x41f4('0x25')]+_0x1e12ab[_0x41f4('0x27')];var _0x23b10f;if(_0x5d381d>=_0x22e73c){_0x5d381d=_0x22e73c;_0x23b10f=0xc8;}else{_0x23b10f=0xce;}_0x19583c[_0x41f4('0x22')](_0x23b10f);return _0x19583c[_0x41f4('0x29')](_0x41f4('0x2a'),_0x1fef74+'-'+_0x5d381d+'/'+_0x22e73c)[_0x41f4('0x24')](_0x1ecaf3);}return null;};}function patchUpdates(_0x12df01){return function(_0x1a5055){try{jsonpatch[_0x41f4('0x2b')](_0x1a5055,_0x12df01,!![]);}catch(_0x4446c4){return BPromise[_0x41f4('0x2c')](_0x4446c4);}return _0x1a5055[_0x41f4('0x2d')]();};}function saveUpdates(_0x94fdf0,_0x508ca0){return function(_0x5ab4ed){if(_0x5ab4ed){return _0x5ab4ed[_0x41f4('0x2e')](_0x94fdf0)[_0x41f4('0x2f')](function(_0x215325){return _0x215325;});}return null;};}function removeEntity(_0xdd8524,_0x25d21a){return function(_0x393c57){if(_0x393c57){return _0x393c57[_0x41f4('0x30')]()[_0x41f4('0x2f')](function(){_0xdd8524['status'](0xcc)[_0x41f4('0x23')]();});}};}function handleEntityNotFound(_0x5de04a,_0x2acdef){return function(_0x1688b7){if(!_0x1688b7){_0x5de04a[_0x41f4('0x21')](0x194);}return _0x1688b7;};}function handleError(_0x4974c7,_0x26391a){_0x26391a=_0x26391a||0x1f4;return function(_0x4f6a53){logger['error'](_0x4f6a53[_0x41f4('0x31')]);if(_0x4f6a53[_0x41f4('0x32')]){delete _0x4f6a53['name'];}_0x4974c7['status'](_0x26391a)['send'](_0x4f6a53);};}exports[_0x41f4('0x33')]=function(_0x39b717,_0x296d76){var _0x4649bd={},_0x4b79e7={},_0x4fa804={'count':0x0,'rows':[]};var _0x21dbc5=_[_0x41f4('0x34')](db[_0x41f4('0x35')][_0x41f4('0x36')],function(_0x1937c0){return{'name':_0x1937c0['fieldName'],'type':_0x1937c0[_0x41f4('0x37')][_0x41f4('0x38')]};});_0x4b79e7[_0x41f4('0x39')]=_[_0x41f4('0x34')](_0x21dbc5,'name');_0x4b79e7[_0x41f4('0x3a')]=_[_0x41f4('0x3b')](_0x39b717['query']);_0x4b79e7['filters']=_[_0x41f4('0x3c')](_0x4b79e7['model'],_0x4b79e7[_0x41f4('0x3a')]);_0x4649bd[_0x41f4('0x3d')]=_[_0x41f4('0x3c')](_0x4b79e7['model'],qs['fields'](_0x39b717['query']['fields']));_0x4649bd[_0x41f4('0x3d')]=_0x4649bd[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x4649bd[_0x41f4('0x3d')]:_0x4b79e7[_0x41f4('0x39')];if(!_0x39b717['query'][_0x41f4('0x3f')]('nolimit')){_0x4649bd[_0x41f4('0x27')]=qs[_0x41f4('0x27')](_0x39b717[_0x41f4('0x3a')][_0x41f4('0x27')]);_0x4649bd['offset']=qs['offset'](_0x39b717[_0x41f4('0x3a')][_0x41f4('0x25')]);}_0x4649bd[_0x41f4('0x40')]=qs[_0x41f4('0x41')](_0x39b717['query'][_0x41f4('0x41')]);_0x4649bd[_0x41f4('0x42')]=qs['filters'](_['pick'](_0x39b717[_0x41f4('0x3a')],_0x4b79e7[_0x41f4('0x43')]),_0x21dbc5);if(_0x39b717[_0x41f4('0x3a')][_0x41f4('0x44')]){_0x4649bd[_0x41f4('0x42')]=_['merge'](_0x4649bd[_0x41f4('0x42')],{'$or':_[_0x41f4('0x34')](_0x21dbc5,function(_0x11b9e7){if(_0x11b9e7[_0x41f4('0x37')]!=='VIRTUAL'){var _0x45ad60={};_0x45ad60[_0x11b9e7[_0x41f4('0x32')]]={'$like':'%'+_0x39b717['query']['filter']+'%'};return _0x45ad60;}})});}_0x4649bd=_[_0x41f4('0x45')]({},_0x4649bd,_0x39b717['options']);var _0x3c278e={'where':_0x4649bd[_0x41f4('0x42')]};return db['ChatGroup'][_0x41f4('0x28')](_0x3c278e)[_0x41f4('0x2f')](function(_0x1a3512){_0x4fa804[_0x41f4('0x28')]=_0x1a3512;if(_0x39b717[_0x41f4('0x3a')][_0x41f4('0x46')]){_0x4649bd[_0x41f4('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x41f4('0x48')](_0x4649bd);})[_0x41f4('0x2f')](function(_0x2ce94f){_0x4fa804[_0x41f4('0x49')]=_0x2ce94f;return _0x4fa804;})[_0x41f4('0x2f')](respondWithFilteredResult(_0x296d76,_0x4649bd))[_0x41f4('0x4a')](handleError(_0x296d76,null));};exports['show']=function(_0x3442ac,_0x2e3296){var _0x2c1a02={'raw':!![],'where':{'id':_0x3442ac['params']['id']}},_0x432fd1={};_0x432fd1['model']=_[_0x41f4('0x3b')](db[_0x41f4('0x35')][_0x41f4('0x36')]);_0x432fd1[_0x41f4('0x3a')]=_[_0x41f4('0x3b')](_0x3442ac['query']);_0x432fd1[_0x41f4('0x43')]=_['intersection'](_0x432fd1[_0x41f4('0x39')],_0x432fd1['query']);_0x2c1a02[_0x41f4('0x3d')]=_[_0x41f4('0x3c')](_0x432fd1[_0x41f4('0x39')],qs[_0x41f4('0x4b')](_0x3442ac[_0x41f4('0x3a')][_0x41f4('0x4b')]));_0x2c1a02[_0x41f4('0x3d')]=_0x2c1a02[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x2c1a02[_0x41f4('0x3d')]:_0x432fd1['model'];if(_0x3442ac[_0x41f4('0x3a')][_0x41f4('0x46')]){_0x2c1a02[_0x41f4('0x47')]=[{'all':!![]}];}_0x2c1a02=_[_0x41f4('0x45')]({},_0x2c1a02,_0x3442ac[_0x41f4('0x4c')]);return db[_0x41f4('0x35')]['find'](_0x2c1a02)[_0x41f4('0x2f')](handleEntityNotFound(_0x2e3296,null))[_0x41f4('0x2f')](respondWithResult(_0x2e3296,null))[_0x41f4('0x4a')](handleError(_0x2e3296,null));};exports[_0x41f4('0x4d')]=function(_0x487107,_0xf861d3){return db[_0x41f4('0x35')]['create'](_0x487107[_0x41f4('0x4e')],{})['then'](respondWithResult(_0xf861d3,0xc9))[_0x41f4('0x4a')](handleError(_0xf861d3,null));};exports[_0x41f4('0x2e')]=function(_0x30a8d5,_0xe7cef5){if(_0x30a8d5[_0x41f4('0x4e')]['id']){delete _0x30a8d5['body']['id'];}return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x30a8d5[_0x41f4('0x50')]['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0xe7cef5,null))[_0x41f4('0x2f')](saveUpdates(_0x30a8d5[_0x41f4('0x4e')],null))[_0x41f4('0x2f')](respondWithResult(_0xe7cef5,null))[_0x41f4('0x4a')](handleError(_0xe7cef5,null));};exports[_0x41f4('0x30')]=function(_0x5d009d,_0x890ca0){return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x5d009d[_0x41f4('0x50')]['id']}})['then'](handleEntityNotFound(_0x890ca0,null))[_0x41f4('0x2f')](removeEntity(_0x890ca0,null))['catch'](handleError(_0x890ca0,null));};exports[_0x41f4('0x51')]=function(_0x187292,_0x236301){return db[_0x41f4('0x35')][_0x41f4('0x51')]()['then'](respondWithResult(_0x236301,null))[_0x41f4('0x4a')](handleError(_0x236301,null));};exports[_0x41f4('0x52')]=function(_0x1d27fb,_0x3fb1af,_0x28b96e){return db['ChatInternalMessage'][_0x41f4('0x28')]({'where':{'ChatGroupId':_0x1d27fb[_0x41f4('0x50')]['id'],'ToId':_0x1d27fb[_0x41f4('0x53')]['id'],'read':![]}})[_0x41f4('0x2f')](function(_0xf9e1e0){return{'id':_['toInteger'](_0x1d27fb['params']['id']),'count':_0xf9e1e0};})['then'](respondWithResult(_0x3fb1af,null))[_0x41f4('0x4a')](handleError(_0x3fb1af,null));};exports['addMembers']=function(_0x3b6e11,_0x77cc38,_0x294274){return db['ChatGroup'][_0x41f4('0x4f')]({'where':{'id':_0x3b6e11['params']['id']}})['then'](handleEntityNotFound(_0x77cc38,null))[_0x41f4('0x2f')](function(_0x3b8929){if(_0x3b8929){return _0x3b8929[_0x41f4('0x54')](_0x3b6e11[_0x41f4('0x4e')]['ids'],_[_0x41f4('0x55')](_0x3b6e11['body'],[_0x41f4('0x56'),'id'])||{});}})[_0x41f4('0x2f')](respondWithResult(_0x77cc38,null))[_0x41f4('0x4a')](handleError(_0x77cc38,null));};exports[_0x41f4('0x57')]=function(_0x21abea,_0x5d0d2f,_0x1d14b8){var _0x3ed0ea={};var _0xffa8d9={};var _0x5ab814;var _0x314b41;return db['ChatGroup'][_0x41f4('0x58')]({'where':{'id':_0x21abea[_0x41f4('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d0d2f,null))[_0x41f4('0x2f')](function(_0x2b4c0f){if(_0x2b4c0f){_0x5ab814=_0x2b4c0f;_0xffa8d9[_0x41f4('0x39')]=_[_0x41f4('0x3b')](db[_0x41f4('0x59')][_0x41f4('0x36')]);_0xffa8d9[_0x41f4('0x3a')]=_[_0x41f4('0x3b')](_0x21abea['query']);_0xffa8d9[_0x41f4('0x43')]=_[_0x41f4('0x3c')](_0xffa8d9[_0x41f4('0x39')],_0xffa8d9[_0x41f4('0x3a')]);_0x3ed0ea[_0x41f4('0x3d')]=_[_0x41f4('0x3c')](_0xffa8d9[_0x41f4('0x39')],qs['fields'](_0x21abea[_0x41f4('0x3a')]['fields']));_0x3ed0ea[_0x41f4('0x3d')]=_0x3ed0ea[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x3ed0ea[_0x41f4('0x3d')]:_0xffa8d9['model'];_0x3ed0ea[_0x41f4('0x40')]=qs[_0x41f4('0x41')](_0x21abea['query'][_0x41f4('0x41')]);_0x3ed0ea[_0x41f4('0x42')]=qs['filters'](_[_0x41f4('0x5a')](_0x21abea[_0x41f4('0x3a')],_0xffa8d9['filters']));if(_0x21abea[_0x41f4('0x3a')][_0x41f4('0x44')]){_0x3ed0ea[_0x41f4('0x42')]=_[_0x41f4('0x45')](_0x3ed0ea[_0x41f4('0x42')],{'$or':_[_0x41f4('0x34')](_0x3ed0ea['attributes'],function(_0x397679){var _0x44bbc6={};_0x44bbc6[_0x397679]={'$like':'%'+_0x21abea[_0x41f4('0x3a')][_0x41f4('0x44')]+'%'};return _0x44bbc6;})});}_0x3ed0ea=_[_0x41f4('0x45')]({},_0x3ed0ea,_0x21abea['options']);return _0x5ab814[_0x41f4('0x57')](_0x3ed0ea);}})[_0x41f4('0x2f')](function(_0x5abbfb){if(_0x5abbfb){_0x314b41=_0x5abbfb[_0x41f4('0x3e')];if(!_0x21abea[_0x41f4('0x3a')][_0x41f4('0x3f')](_0x41f4('0x5b'))){_0x3ed0ea[_0x41f4('0x27')]=qs['limit'](_0x21abea[_0x41f4('0x3a')][_0x41f4('0x27')]);_0x3ed0ea[_0x41f4('0x25')]=qs[_0x41f4('0x25')](_0x21abea[_0x41f4('0x3a')]['offset']);}return _0x5ab814[_0x41f4('0x57')](_0x3ed0ea);}})[_0x41f4('0x2f')](function(_0x3a0210){if(_0x3a0210){return _0x3a0210?{'count':_0x314b41,'rows':_0x3a0210}:null;}})[_0x41f4('0x2f')](respondWithResult(_0x5d0d2f,null))[_0x41f4('0x4a')](handleError(_0x5d0d2f,null));};exports[_0x41f4('0x5c')]=function(_0x583599,_0x137ce2,_0x34efeb){return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x583599[_0x41f4('0x50')]['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0x137ce2,null))['then'](function(_0xd11472){if(_0xd11472){return _0xd11472[_0x41f4('0x5c')](_0x583599['query'][_0x41f4('0x56')]);}})[_0x41f4('0x2f')](respondWithStatusCode(_0x137ce2,null))[_0x41f4('0x4a')](handleError(_0x137ce2,null));};exports['addMessage']=function(_0x183907,_0x362441,_0x57d5e3){if(_0x183907[_0x41f4('0x4e')]['id']){delete _0x183907[_0x41f4('0x4e')]['id'];}return db[_0x41f4('0x35')][_0x41f4('0x4f')]({'where':{'id':_0x183907['params']['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0x362441,null))[_0x41f4('0x2f')](function(_0x5cc989){if(_0x5cc989){_0x183907[_0x41f4('0x4e')][_0x41f4('0x5d')]=_0x5cc989['id'];return db[_0x41f4('0x5e')][_0x41f4('0x4d')](_0x183907['body']);}})[_0x41f4('0x2f')](respondWithResult(_0x362441,null))[_0x41f4('0x4a')](handleError(_0x362441,null));};exports[_0x41f4('0x5f')]=function(_0x1b4d53,_0x1e4799,_0x2b8aa3){var _0x2bb375={};var _0x46cfe3={};var _0x492321;var _0x596507;return db[_0x41f4('0x35')]['findOne']({'where':{'id':_0x1b4d53[_0x41f4('0x50')]['id']}})[_0x41f4('0x2f')](handleEntityNotFound(_0x1e4799,null))[_0x41f4('0x2f')](function(_0x1c22ff){if(_0x1c22ff){_0x492321=_0x1c22ff;_0x46cfe3['model']=_['keys'](db[_0x41f4('0x5e')]['rawAttributes']);_0x46cfe3[_0x41f4('0x3a')]=_['keys'](_0x1b4d53[_0x41f4('0x3a')]);_0x46cfe3[_0x41f4('0x43')]=_[_0x41f4('0x3c')](_0x46cfe3[_0x41f4('0x39')],_0x46cfe3['query']);_0x2bb375[_0x41f4('0x3d')]=_['intersection'](_0x46cfe3[_0x41f4('0x39')],qs['fields'](_0x1b4d53[_0x41f4('0x3a')]['fields']));_0x2bb375[_0x41f4('0x3d')]=_0x2bb375[_0x41f4('0x3d')][_0x41f4('0x3e')]?_0x2bb375['attributes']:_0x46cfe3[_0x41f4('0x39')];_0x2bb375[_0x41f4('0x40')]=qs[_0x41f4('0x41')](_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x41')]);_0x2bb375['where']=qs['filters'](_[_0x41f4('0x5a')](_0x1b4d53['query'],_0x46cfe3[_0x41f4('0x43')]));if(_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x44')]){_0x2bb375['where']=_[_0x41f4('0x45')](_0x2bb375[_0x41f4('0x42')],{'$or':_[_0x41f4('0x34')](_0x2bb375[_0x41f4('0x3d')],function(_0x48befb){var _0x45b82c={};_0x45b82c[_0x48befb]={'$like':'%'+_0x1b4d53[_0x41f4('0x3a')]['filter']+'%'};return _0x45b82c;})});}if(_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x60')]){var _0x4c10a6=_0x1b4d53['query'][_0x41f4('0x60')][_0x41f4('0x61')](',');var _0x393b97={};_0x393b97[_0x4c10a6[0x0]]={'$gte':moment(_0x4c10a6[0x1])[_0x41f4('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2bb375[_0x41f4('0x42')]=_['merge'](_0x2bb375['where'],_0x393b97);}_0x2bb375=_[_0x41f4('0x45')]({},_0x2bb375,_0x1b4d53['options']);return _0x492321[_0x41f4('0x5f')](_0x2bb375);}})['then'](function(_0x1f57cf){if(_0x1f57cf){_0x596507=_0x1f57cf[_0x41f4('0x3e')];if(!_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x3f')](_0x41f4('0x5b'))){_0x2bb375[_0x41f4('0x27')]=qs[_0x41f4('0x27')](_0x1b4d53[_0x41f4('0x3a')][_0x41f4('0x27')]);_0x2bb375[_0x41f4('0x25')]=qs[_0x41f4('0x25')](_0x1b4d53['query']['offset']);}return _0x492321['getMessages'](_0x2bb375);}})[_0x41f4('0x2f')](function(_0x50005f){if(_0x50005f){return _0x50005f?{'count':_0x596507,'rows':_0x50005f}:null;}})[_0x41f4('0x2f')](respondWithResult(_0x1e4799,null))[_0x41f4('0x4a')](handleError(_0x1e4799,null));};
\ No newline at end of file
+var _0x6f69=['includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','omit','ids','findOne','User','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','pick','split','format','eml-format','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','count'];(function(_0x446a8b,_0x37f5cd){var _0xb56d31=function(_0x23ee4a){while(--_0x23ee4a){_0x446a8b['push'](_0x446a8b['shift']());}};_0xb56d31(++_0x37f5cd);}(_0x6f69,0x143));var _0x96f6=function(_0x46a836,_0x59b1e9){_0x46a836=_0x46a836-0x0;var _0x4e6773=_0x6f69[_0x46a836];return _0x4e6773;};'use strict';var emlformat=require(_0x96f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96f6('0x1'));var BPromise=require(_0x96f6('0x2'));var Mustache=require(_0x96f6('0x3'));var util=require('util');var path=require(_0x96f6('0x4'));var sox=require('sox');var csv=require(_0x96f6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f6('0x6'));var _=require(_0x96f6('0x7'));var squel=require(_0x96f6('0x8'));var crypto=require(_0x96f6('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x96f6('0x5'));var querystring=require(_0x96f6('0xa'));var Papa=require('papaparse');var Redis=require(_0x96f6('0xb'));var authService=require(_0x96f6('0xc'));var qs=require(_0x96f6('0xd'));var as=require(_0x96f6('0xe'));var hardwareService=require(_0x96f6('0xf'));var logger=require(_0x96f6('0x10'))(_0x96f6('0x11'));var utils=require(_0x96f6('0x12'));var config=require(_0x96f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x96f6('0x14'))['db'];config[_0x96f6('0x15')]=_[_0x96f6('0x16')](config['redis'],{'host':_0x96f6('0x17'),'port':0x18eb});var socket=require(_0x96f6('0x18'))(new Redis(config[_0x96f6('0x15')]));require(_0x96f6('0x19'))[_0x96f6('0x1a')](socket);function respondWithStatusCode(_0x319d9c,_0x4967a7){_0x4967a7=_0x4967a7||0xcc;return function(_0x43c964){if(_0x43c964){return _0x319d9c['sendStatus'](_0x4967a7);}return _0x319d9c[_0x96f6('0x1b')](_0x4967a7)[_0x96f6('0x1c')]();};}function respondWithResult(_0x24d330,_0x2796b2){_0x2796b2=_0x2796b2||0xc8;return function(_0x3ff8d1){if(_0x3ff8d1){return _0x24d330[_0x96f6('0x1b')](_0x2796b2)[_0x96f6('0x1d')](_0x3ff8d1);}};}function respondWithFilteredResult(_0x1b7dca,_0x18bb81){return function(_0xedf402){if(_0xedf402){var _0x115b9f=typeof _0x18bb81['offset']==='undefined'&&typeof _0x18bb81[_0x96f6('0x1e')]===_0x96f6('0x1f');var _0x5171af=_0xedf402['count'];var _0x4a40c0=_0x115b9f?0x0:_0x18bb81['offset'];var _0x2d9549=_0x115b9f?_0xedf402['count']:_0x18bb81[_0x96f6('0x20')]+_0x18bb81['limit'];var _0x531c72;if(_0x2d9549>=_0x5171af){_0x2d9549=_0x5171af;_0x531c72=0xc8;}else{_0x531c72=0xce;}_0x1b7dca['status'](_0x531c72);return _0x1b7dca[_0x96f6('0x21')](_0x96f6('0x22'),_0x4a40c0+'-'+_0x2d9549+'/'+_0x5171af)[_0x96f6('0x1d')](_0xedf402);}return null;};}function patchUpdates(_0x585c77){return function(_0x2113ca){try{jsonpatch[_0x96f6('0x23')](_0x2113ca,_0x585c77,!![]);}catch(_0x165652){return BPromise[_0x96f6('0x24')](_0x165652);}return _0x2113ca[_0x96f6('0x25')]();};}function saveUpdates(_0x5caee9,_0x422aa8){return function(_0x4509a1){if(_0x4509a1){return _0x4509a1[_0x96f6('0x26')](_0x5caee9)[_0x96f6('0x27')](function(_0xb0ddda){return _0xb0ddda;});}return null;};}function removeEntity(_0x1a9a26,_0x42bbbc){return function(_0x80bae){if(_0x80bae){return _0x80bae[_0x96f6('0x28')]()[_0x96f6('0x27')](function(){_0x1a9a26['status'](0xcc)[_0x96f6('0x1c')]();});}};}function handleEntityNotFound(_0x1e2c58,_0x20a8d2){return function(_0x2e2676){if(!_0x2e2676){_0x1e2c58[_0x96f6('0x29')](0x194);}return _0x2e2676;};}function handleError(_0x2628a9,_0x41dc5c){_0x41dc5c=_0x41dc5c||0x1f4;return function(_0x13e089){logger[_0x96f6('0x2a')](_0x13e089[_0x96f6('0x2b')]);if(_0x13e089[_0x96f6('0x2c')]){delete _0x13e089[_0x96f6('0x2c')];}_0x2628a9[_0x96f6('0x1b')](_0x41dc5c)[_0x96f6('0x2d')](_0x13e089);};}exports[_0x96f6('0x2e')]=function(_0x525d69,_0x2539f8){var _0x58b00d={},_0x41d60b={},_0x3a5e93={'count':0x0,'rows':[]};var _0x3563e8=_[_0x96f6('0x2f')](db[_0x96f6('0x30')][_0x96f6('0x31')],function(_0x432a8b){return{'name':_0x432a8b[_0x96f6('0x32')],'type':_0x432a8b[_0x96f6('0x33')][_0x96f6('0x34')]};});_0x41d60b[_0x96f6('0x35')]=_[_0x96f6('0x2f')](_0x3563e8,_0x96f6('0x2c'));_0x41d60b[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x525d69['query']);_0x41d60b['filters']=_['intersection'](_0x41d60b[_0x96f6('0x35')],_0x41d60b['query']);_0x58b00d['attributes']=_[_0x96f6('0x38')](_0x41d60b[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x525d69['query'][_0x96f6('0x39')]));_0x58b00d[_0x96f6('0x3a')]=_0x58b00d[_0x96f6('0x3a')][_0x96f6('0x3b')]?_0x58b00d[_0x96f6('0x3a')]:_0x41d60b[_0x96f6('0x35')];if(!_0x525d69['query'][_0x96f6('0x3c')](_0x96f6('0x3d'))){_0x58b00d[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x525d69[_0x96f6('0x36')][_0x96f6('0x1e')]);_0x58b00d[_0x96f6('0x20')]=qs['offset'](_0x525d69['query'][_0x96f6('0x20')]);}_0x58b00d['order']=qs[_0x96f6('0x3e')](_0x525d69[_0x96f6('0x36')]['sort']);_0x58b00d[_0x96f6('0x3f')]=qs[_0x96f6('0x40')](_['pick'](_0x525d69[_0x96f6('0x36')],_0x41d60b['filters']),_0x3563e8);if(_0x525d69['query']['filter']){_0x58b00d[_0x96f6('0x3f')]=_[_0x96f6('0x41')](_0x58b00d['where'],{'$or':_[_0x96f6('0x2f')](_0x3563e8,function(_0x40793e){if(_0x40793e[_0x96f6('0x33')]!==_0x96f6('0x42')){var _0x54348b={};_0x54348b[_0x40793e[_0x96f6('0x2c')]]={'$like':'%'+_0x525d69[_0x96f6('0x36')][_0x96f6('0x43')]+'%'};return _0x54348b;}})});}_0x58b00d=_['merge']({},_0x58b00d,_0x525d69['options']);var _0x336605={'where':_0x58b00d['where']};return db[_0x96f6('0x30')][_0x96f6('0x44')](_0x336605)[_0x96f6('0x27')](function(_0x32f825){_0x3a5e93[_0x96f6('0x44')]=_0x32f825;if(_0x525d69[_0x96f6('0x36')][_0x96f6('0x45')]){_0x58b00d[_0x96f6('0x46')]=[{'all':!![]}];}return db[_0x96f6('0x30')][_0x96f6('0x47')](_0x58b00d);})['then'](function(_0x280fd0){_0x3a5e93[_0x96f6('0x48')]=_0x280fd0;return _0x3a5e93;})[_0x96f6('0x27')](respondWithFilteredResult(_0x2539f8,_0x58b00d))[_0x96f6('0x49')](handleError(_0x2539f8,null));};exports[_0x96f6('0x4a')]=function(_0x5177c0,_0x40badd){var _0x55c04f={'raw':!![],'where':{'id':_0x5177c0[_0x96f6('0x4b')]['id']}},_0x5d317d={};_0x5d317d['model']=_[_0x96f6('0x37')](db[_0x96f6('0x30')]['rawAttributes']);_0x5d317d[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x5177c0['query']);_0x5d317d['filters']=_[_0x96f6('0x38')](_0x5d317d[_0x96f6('0x35')],_0x5d317d['query']);_0x55c04f[_0x96f6('0x3a')]=_[_0x96f6('0x38')](_0x5d317d[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x5177c0[_0x96f6('0x36')]['fields']));_0x55c04f[_0x96f6('0x3a')]=_0x55c04f['attributes']['length']?_0x55c04f['attributes']:_0x5d317d[_0x96f6('0x35')];if(_0x5177c0[_0x96f6('0x36')][_0x96f6('0x45')]){_0x55c04f['include']=[{'all':!![]}];}_0x55c04f=_[_0x96f6('0x41')]({},_0x55c04f,_0x5177c0[_0x96f6('0x4c')]);return db[_0x96f6('0x30')][_0x96f6('0x4d')](_0x55c04f)[_0x96f6('0x27')](handleEntityNotFound(_0x40badd,null))[_0x96f6('0x27')](respondWithResult(_0x40badd,null))[_0x96f6('0x49')](handleError(_0x40badd,null));};exports[_0x96f6('0x4e')]=function(_0x32f430,_0x43ec2e){return db[_0x96f6('0x30')][_0x96f6('0x4e')](_0x32f430[_0x96f6('0x4f')],{})[_0x96f6('0x27')](respondWithResult(_0x43ec2e,0xc9))['catch'](handleError(_0x43ec2e,null));};exports[_0x96f6('0x26')]=function(_0x494f13,_0x4bcb05){if(_0x494f13[_0x96f6('0x4f')]['id']){delete _0x494f13[_0x96f6('0x4f')]['id'];}return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x494f13[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x4bcb05,null))[_0x96f6('0x27')](saveUpdates(_0x494f13[_0x96f6('0x4f')],null))['then'](respondWithResult(_0x4bcb05,null))[_0x96f6('0x49')](handleError(_0x4bcb05,null));};exports[_0x96f6('0x28')]=function(_0x1ce91d,_0x431cee){return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x1ce91d['params']['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x431cee,null))[_0x96f6('0x27')](removeEntity(_0x431cee,null))[_0x96f6('0x49')](handleError(_0x431cee,null));};exports['describe']=function(_0x5f2dee,_0x51107f){return db[_0x96f6('0x30')][_0x96f6('0x50')]()['then'](respondWithResult(_0x51107f,null))['catch'](handleError(_0x51107f,null));};exports[_0x96f6('0x51')]=function(_0x294036,_0x44ff09,_0x487815){return db[_0x96f6('0x52')][_0x96f6('0x44')]({'where':{'ChatGroupId':_0x294036['params']['id'],'ToId':_0x294036[_0x96f6('0x53')]['id'],'read':![]}})[_0x96f6('0x27')](function(_0x3d0014){return{'id':_['toInteger'](_0x294036[_0x96f6('0x4b')]['id']),'count':_0x3d0014};})[_0x96f6('0x27')](respondWithResult(_0x44ff09,null))[_0x96f6('0x49')](handleError(_0x44ff09,null));};exports[_0x96f6('0x54')]=function(_0x3f3e21,_0x435030,_0x2d932b){return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x3f3e21[_0x96f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x435030,null))[_0x96f6('0x27')](function(_0x4d4687){if(_0x4d4687){return _0x4d4687['addMembers'](_0x3f3e21[_0x96f6('0x4f')]['ids'],_[_0x96f6('0x55')](_0x3f3e21[_0x96f6('0x4f')],[_0x96f6('0x56'),'id'])||{});}})['then'](respondWithResult(_0x435030,null))[_0x96f6('0x49')](handleError(_0x435030,null));};exports['getMembers']=function(_0x5022be,_0x135d3e,_0x4a044a){var _0x5b6ff8={};var _0x46ca69={};var _0x5dbcb2;var _0x53ca24;return db['ChatGroup'][_0x96f6('0x57')]({'where':{'id':_0x5022be[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x135d3e,null))[_0x96f6('0x27')](function(_0x28c737){if(_0x28c737){_0x5dbcb2=_0x28c737;_0x46ca69[_0x96f6('0x35')]=_[_0x96f6('0x37')](db[_0x96f6('0x58')][_0x96f6('0x31')]);_0x46ca69[_0x96f6('0x36')]=_['keys'](_0x5022be['query']);_0x46ca69[_0x96f6('0x40')]=_['intersection'](_0x46ca69[_0x96f6('0x35')],_0x46ca69['query']);_0x5b6ff8[_0x96f6('0x3a')]=_[_0x96f6('0x38')](_0x46ca69[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x39')]));_0x5b6ff8['attributes']=_0x5b6ff8[_0x96f6('0x3a')][_0x96f6('0x3b')]?_0x5b6ff8['attributes']:_0x46ca69[_0x96f6('0x35')];_0x5b6ff8[_0x96f6('0x59')]=qs[_0x96f6('0x3e')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x3e')]);_0x5b6ff8[_0x96f6('0x3f')]=qs[_0x96f6('0x40')](_['pick'](_0x5022be['query'],_0x46ca69[_0x96f6('0x40')]));if(_0x5022be[_0x96f6('0x36')][_0x96f6('0x43')]){_0x5b6ff8[_0x96f6('0x3f')]=_[_0x96f6('0x41')](_0x5b6ff8['where'],{'$or':_[_0x96f6('0x2f')](_0x5b6ff8['attributes'],function(_0x323fa3){var _0x17ff3a={};_0x17ff3a[_0x323fa3]={'$like':'%'+_0x5022be[_0x96f6('0x36')]['filter']+'%'};return _0x17ff3a;})});}_0x5b6ff8=_[_0x96f6('0x41')]({},_0x5b6ff8,_0x5022be[_0x96f6('0x4c')]);return _0x5dbcb2[_0x96f6('0x5a')](_0x5b6ff8);}})[_0x96f6('0x27')](function(_0x153f8f){if(_0x153f8f){_0x53ca24=_0x153f8f[_0x96f6('0x3b')];if(!_0x5022be[_0x96f6('0x36')]['hasOwnProperty'](_0x96f6('0x3d'))){_0x5b6ff8[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x1e')]);_0x5b6ff8[_0x96f6('0x20')]=qs[_0x96f6('0x20')](_0x5022be[_0x96f6('0x36')]['offset']);}return _0x5dbcb2['getMembers'](_0x5b6ff8);}})['then'](function(_0x47da43){if(_0x47da43){return _0x47da43?{'count':_0x53ca24,'rows':_0x47da43}:null;}})[_0x96f6('0x27')](respondWithResult(_0x135d3e,null))[_0x96f6('0x49')](handleError(_0x135d3e,null));};exports[_0x96f6('0x5b')]=function(_0x178617,_0x269f63,_0x1f9bcc){return db['ChatGroup'][_0x96f6('0x4d')]({'where':{'id':_0x178617[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x269f63,null))[_0x96f6('0x27')](function(_0x1660f1){if(_0x1660f1){return _0x1660f1[_0x96f6('0x5b')](_0x178617[_0x96f6('0x36')][_0x96f6('0x56')]);}})['then'](respondWithStatusCode(_0x269f63,null))['catch'](handleError(_0x269f63,null));};exports[_0x96f6('0x5c')]=function(_0x5d2f95,_0x3d2bc5,_0x1a5ee5){if(_0x5d2f95['body']['id']){delete _0x5d2f95[_0x96f6('0x4f')]['id'];}return db[_0x96f6('0x30')]['find']({'where':{'id':_0x5d2f95[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x3d2bc5,null))[_0x96f6('0x27')](function(_0x45134c){if(_0x45134c){_0x5d2f95[_0x96f6('0x4f')][_0x96f6('0x5d')]=_0x45134c['id'];return db['ChatInternalMessage']['create'](_0x5d2f95[_0x96f6('0x4f')]);}})['then'](respondWithResult(_0x3d2bc5,null))['catch'](handleError(_0x3d2bc5,null));};exports[_0x96f6('0x5e')]=function(_0x53a84d,_0x6b7ea9,_0x3da4da){var _0x53bb3f={};var _0xbfe9fb={};var _0x2068bb;var _0x4bb2a3;return db[_0x96f6('0x30')][_0x96f6('0x57')]({'where':{'id':_0x53a84d[_0x96f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6b7ea9,null))[_0x96f6('0x27')](function(_0x277cc9){if(_0x277cc9){_0x2068bb=_0x277cc9;_0xbfe9fb[_0x96f6('0x35')]=_[_0x96f6('0x37')](db['ChatInternalMessage'][_0x96f6('0x31')]);_0xbfe9fb[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x53a84d[_0x96f6('0x36')]);_0xbfe9fb[_0x96f6('0x40')]=_['intersection'](_0xbfe9fb[_0x96f6('0x35')],_0xbfe9fb[_0x96f6('0x36')]);_0x53bb3f['attributes']=_[_0x96f6('0x38')](_0xbfe9fb[_0x96f6('0x35')],qs['fields'](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x39')]));_0x53bb3f['attributes']=_0x53bb3f['attributes'][_0x96f6('0x3b')]?_0x53bb3f[_0x96f6('0x3a')]:_0xbfe9fb[_0x96f6('0x35')];_0x53bb3f[_0x96f6('0x59')]=qs[_0x96f6('0x3e')](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x3e')]);_0x53bb3f[_0x96f6('0x3f')]=qs['filters'](_[_0x96f6('0x5f')](_0x53a84d[_0x96f6('0x36')],_0xbfe9fb[_0x96f6('0x40')]));if(_0x53a84d[_0x96f6('0x36')][_0x96f6('0x43')]){_0x53bb3f[_0x96f6('0x3f')]=_['merge'](_0x53bb3f[_0x96f6('0x3f')],{'$or':_[_0x96f6('0x2f')](_0x53bb3f[_0x96f6('0x3a')],function(_0xff6e4d){var _0x110ad5={};_0x110ad5[_0xff6e4d]={'$like':'%'+_0x53a84d[_0x96f6('0x36')][_0x96f6('0x43')]+'%'};return _0x110ad5;})});}if(_0x53a84d[_0x96f6('0x36')]['$gte']){var _0x34a5fb=_0x53a84d[_0x96f6('0x36')]['$gte'][_0x96f6('0x60')](',');var _0x185cef={};_0x185cef[_0x34a5fb[0x0]]={'$gte':moment(_0x34a5fb[0x1])[_0x96f6('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x53bb3f['where']=_[_0x96f6('0x41')](_0x53bb3f['where'],_0x185cef);}_0x53bb3f=_['merge']({},_0x53bb3f,_0x53a84d[_0x96f6('0x4c')]);return _0x2068bb[_0x96f6('0x5e')](_0x53bb3f);}})[_0x96f6('0x27')](function(_0x1854e8){if(_0x1854e8){_0x4bb2a3=_0x1854e8[_0x96f6('0x3b')];if(!_0x53a84d[_0x96f6('0x36')][_0x96f6('0x3c')](_0x96f6('0x3d'))){_0x53bb3f[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x53a84d['query'][_0x96f6('0x1e')]);_0x53bb3f[_0x96f6('0x20')]=qs[_0x96f6('0x20')](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x20')]);}return _0x2068bb['getMessages'](_0x53bb3f);}})[_0x96f6('0x27')](function(_0x3cc98a){if(_0x3cc98a){return _0x3cc98a?{'count':_0x4bb2a3,'rows':_0x3cc98a}:null;}})[_0x96f6('0x27')](respondWithResult(_0x6b7ea9,null))[_0x96f6('0x49')](handleError(_0x6b7ea9,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index be05921..c16e413 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 _0xf23e=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x42919b,_0x598bb9){var _0x51d905=function(_0x4bec92){while(--_0x4bec92){_0x42919b['push'](_0x42919b['shift']());}};_0x51d905(++_0x598bb9);}(_0xf23e,0xd2));var _0xef23=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xf23e[_0x58e469];return _0x4c01c5;};'use strict';var EventEmitter=require(_0xef23('0x0'));var ChatGroup=require(_0xef23('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xef23('0x2')](0x0);var events={'afterCreate':_0xef23('0x3'),'afterUpdate':_0xef23('0x4'),'afterDestroy':_0xef23('0x5')};function emitEvent(_0x48a4e6){return function(_0x4a747a,_0x3a8cb1,_0x36c0c5){ChatGroupEvents[_0xef23('0x6')](_0x48a4e6+':'+_0x4a747a['id'],_0x4a747a);ChatGroupEvents[_0xef23('0x6')](_0x48a4e6,_0x4a747a);_0x36c0c5(null);};}for(var e in events){if(events[_0xef23('0x7')](e)){var event=events[e];ChatGroup[_0xef23('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xb486=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xb486,0x138));var _0x6b48=function(_0x219b60,_0xde6b4b){_0x219b60=_0x219b60-0x0;var _0x495da4=_0xb486[_0x219b60];return _0x495da4;};'use strict';var EventEmitter=require(_0x6b48('0x0'));var ChatGroup=require(_0x6b48('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6b48('0x2')](0x0);var events={'afterCreate':_0x6b48('0x3'),'afterUpdate':_0x6b48('0x4'),'afterDestroy':_0x6b48('0x5')};function emitEvent(_0x385959){return function(_0x3884f3,_0x3e4c13,_0x3a8371){ChatGroupEvents[_0x6b48('0x6')](_0x385959+':'+_0x3884f3['id'],_0x3884f3);ChatGroupEvents[_0x6b48('0x6')](_0x385959,_0x3884f3);_0x3a8371(null);};}for(var e in events){if(events[_0x6b48('0x7')](e)){var event=events[e];ChatGroup[_0x6b48('0x8')](e,emitEvent(event));}}module[_0x6b48('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 37846c0..51aa941 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 _0x90d8=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x4de2de,_0x2171db){var _0x2e3372=function(_0x2d37bd){while(--_0x2d37bd){_0x4de2de['push'](_0x4de2de['shift']());}};_0x2e3372(++_0x2171db);}(_0x90d8,0x105));var _0x890d=function(_0x1f244d,_0x19e830){_0x1f244d=_0x1f244d-0x0;var _0x16003a=_0x90d8[_0x1f244d];return _0x16003a;};'use strict';var _=require(_0x890d('0x0'));var util=require(_0x890d('0x1'));var logger=require(_0x890d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x890d('0x3'));var fs=require('fs');var path=require(_0x890d('0x4'));var rimraf=require(_0x890d('0x5'));var config=require(_0x890d('0x6'));var attributes=require(_0x890d('0x7'));module[_0x890d('0x8')]=function(_0x518dbc,_0x141535){return _0x518dbc[_0x890d('0x9')](_0x890d('0xa'),attributes,{'tableName':_0x890d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9062=['moment','bluebird','request-promise','path','../../config/environment','exports','define','chat_groups','util','../../config/logger','api'];(function(_0x424365,_0x5750d1){var _0x51119d=function(_0x4b54ab){while(--_0x4b54ab){_0x424365['push'](_0x424365['shift']());}};_0x51119d(++_0x5750d1);}(_0x9062,0xad));var _0x2906=function(_0x204a63,_0x4dc00a){_0x204a63=_0x204a63-0x0;var _0x389f09=_0x9062[_0x204a63];return _0x389f09;};'use strict';var _=require('lodash');var util=require(_0x2906('0x0'));var logger=require(_0x2906('0x1'))(_0x2906('0x2'));var moment=require(_0x2906('0x3'));var BPromise=require(_0x2906('0x4'));var rp=require(_0x2906('0x5'));var fs=require('fs');var path=require(_0x2906('0x6'));var rimraf=require('rimraf');var config=require(_0x2906('0x7'));var attributes=require('./chatGroup.attributes');module[_0x2906('0x8')]=function(_0x15af70,_0x5b1f19){return _0x15af70[_0x2906('0x9')]('ChatGroup',attributes,{'tableName':_0x2906('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 93bad78..fa3ebd2 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 _0x8bda=['http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8bda,0x104));var _0xa8bd=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x8bda[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0xa8bd('0x0'));var util=require(_0xa8bd('0x1'));var moment=require(_0xa8bd('0x2'));var BPromise=require(_0xa8bd('0x3'));var rs=require(_0xa8bd('0x4'));var fs=require('fs');var Redis=require(_0xa8bd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8bd('0x6'));var logger=require(_0xa8bd('0x7'))('rpc');var config=require(_0xa8bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8bd('0x9')][_0xa8bd('0xa')]({'port':0x232a});config['redis']=_[_0xa8bd('0xb')](config[_0xa8bd('0xc')],{'host':_0xa8bd('0xd'),'port':0x18eb});var socket=require(_0xa8bd('0xe'))(new Redis(config[_0xa8bd('0xc')]));require('./chatGroup.socket')[_0xa8bd('0xf')](socket);function respondWithRpcPromise(_0x47316a,_0x8253b4,_0x3bcc02){return new BPromise(function(_0x56dba9,_0xbff49b){return client[_0xa8bd('0x10')](_0x47316a,_0x3bcc02)['then'](function(_0x141d4f){logger[_0xa8bd('0x11')](_0xa8bd('0x12'),_0x8253b4,_0xa8bd('0x13'));logger[_0xa8bd('0x14')](_0xa8bd('0x15'),_0x8253b4,_0xa8bd('0x13'),JSON[_0xa8bd('0x16')](_0x141d4f));if(_0x141d4f[_0xa8bd('0x17')]){if(_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x18')]===0x1f4){logger[_0xa8bd('0x17')](_0xa8bd('0x12'),_0x8253b4,_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x19')]);return _0xbff49b(_0x141d4f['error'][_0xa8bd('0x19')]);}logger['error'](_0xa8bd('0x12'),_0x8253b4,_0x141d4f['error']['message']);return _0x56dba9(_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x19')]);}else{logger[_0xa8bd('0x11')](_0xa8bd('0x12'),_0x8253b4,'request\x20sent');_0x56dba9(_0x141d4f[_0xa8bd('0x1a')]['message']);}})['catch'](function(_0x57bdeb){logger['error'](_0xa8bd('0x12'),_0x8253b4,_0x57bdeb);_0xbff49b(_0x57bdeb);});});}
\ No newline at end of file
+var _0xef89=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x4974f1,_0x2ec84f){var _0x190b73=function(_0x16e562){while(--_0x16e562){_0x4974f1['push'](_0x4974f1['shift']());}};_0x190b73(++_0x2ec84f);}(_0xef89,0xf6));var _0x9ef8=function(_0x588480,_0x39b0b5){_0x588480=_0x588480-0x0;var _0x68ae0d=_0xef89[_0x588480];return _0x68ae0d;};'use strict';var _=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var moment=require(_0x9ef8('0x2'));var BPromise=require(_0x9ef8('0x3'));var rs=require(_0x9ef8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ef8('0x5'))['db'];var utils=require(_0x9ef8('0x6'));var logger=require(_0x9ef8('0x7'))(_0x9ef8('0x8'));var config=require(_0x9ef8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9ef8('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9ef8('0xb')],{'host':_0x9ef8('0xc'),'port':0x18eb});var socket=require(_0x9ef8('0xd'))(new Redis(config[_0x9ef8('0xb')]));require(_0x9ef8('0xe'))[_0x9ef8('0xf')](socket);function respondWithRpcPromise(_0x3c13e7,_0x4fc3b1,_0x6ccc67){return new BPromise(function(_0x49dc9c,_0x556c62){return client[_0x9ef8('0x10')](_0x3c13e7,_0x6ccc67)[_0x9ef8('0x11')](function(_0x5269f9){logger[_0x9ef8('0x12')](_0x9ef8('0x13'),_0x4fc3b1,_0x9ef8('0x14'));logger[_0x9ef8('0x15')](_0x9ef8('0x16'),_0x4fc3b1,_0x9ef8('0x14'),JSON['stringify'](_0x5269f9));if(_0x5269f9['error']){if(_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x18')]===0x1f4){logger[_0x9ef8('0x17')](_0x9ef8('0x13'),_0x4fc3b1,_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);return _0x556c62(_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4fc3b1,_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);return _0x49dc9c(_0x5269f9[_0x9ef8('0x17')]['message']);}else{logger[_0x9ef8('0x12')](_0x9ef8('0x13'),_0x4fc3b1,_0x9ef8('0x14'));_0x49dc9c(_0x5269f9['result']['message']);}})[_0x9ef8('0x1a')](function(_0xd01fd9){logger[_0x9ef8('0x17')](_0x9ef8('0x13'),_0x4fc3b1,_0xd01fd9);_0x556c62(_0xd01fd9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 2c95cd4..93c5ef3 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 _0xcd29=['register','length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0xcd29,0x16b));var _0x9cd2=function(_0x38f9b3,_0x1b7191){_0x38f9b3=_0x38f9b3-0x0;var _0x41b711=_0xcd29[_0x38f9b3];return _0x41b711;};'use strict';var ChatGroupEvents=require(_0x9cd2('0x0'));var events=[_0x9cd2('0x1'),_0x9cd2('0x2'),'update'];function createListener(_0x24f023,_0x291163){return function(_0x204b77){_0x291163[_0x9cd2('0x3')](_0x24f023,_0x204b77);};}function removeListener(_0x27a31c,_0x241740){return function(){ChatGroupEvents[_0x9cd2('0x4')](_0x27a31c,_0x241740);};}exports[_0x9cd2('0x5')]=function(_0x1ac6ab){for(var _0x1ad7f8=0x0,_0x3a888a=events[_0x9cd2('0x6')];_0x1ad7f8<_0x3a888a;_0x1ad7f8++){var _0x2e781d=events[_0x1ad7f8];var _0x284fc3=createListener(_0x9cd2('0x7')+_0x2e781d,_0x1ac6ab);ChatGroupEvents['on'](_0x2e781d,_0x284fc3);}};
\ No newline at end of file
+var _0x84a5=['update','emit','removeListener','length','./chatGroup.events','save','remove'];(function(_0x4c6fa0,_0x15d3b7){var _0x318edc=function(_0x16c299){while(--_0x16c299){_0x4c6fa0['push'](_0x4c6fa0['shift']());}};_0x318edc(++_0x15d3b7);}(_0x84a5,0x15b));var _0x584a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x84a5[_0x2dadb9];return _0x2f0097;};'use strict';var ChatGroupEvents=require(_0x584a('0x0'));var events=[_0x584a('0x1'),_0x584a('0x2'),_0x584a('0x3')];function createListener(_0x1f6c07,_0x257ee7){return function(_0x917934){_0x257ee7[_0x584a('0x4')](_0x1f6c07,_0x917934);};}function removeListener(_0x4ced06,_0x14e677){return function(){ChatGroupEvents[_0x584a('0x5')](_0x4ced06,_0x14e677);};}exports['register']=function(_0xe39248){for(var _0x22205a=0x0,_0x4c7618=events[_0x584a('0x6')];_0x22205a<_0x4c7618;_0x22205a++){var _0x4b6e55=events[_0x22205a];var _0x41a1ff=createListener('chatGroup:'+_0x4b6e55,_0xe39248);ChatGroupEvents['on'](_0x4b6e55,_0x41a1ff);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 92b9c24..2c9902c 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 _0x2c31=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','show','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','update','destroy','multer','util'];(function(_0x2ed005,_0x25abd0){var _0xc46288=function(_0x31d9bc){while(--_0x31d9bc){_0x2ed005['push'](_0x2ed005['shift']());}};_0xc46288(++_0x25abd0);}(_0x2c31,0x17e));var _0x12c3=function(_0x1c02e4,_0x1e1fbb){_0x1c02e4=_0x1c02e4-0x0;var _0x446869=_0x2c31[_0x1c02e4];return _0x446869;};'use strict';var multer=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var path=require(_0x12c3('0x2'));var timeout=require(_0x12c3('0x3'));var express=require(_0x12c3('0x4'));var router=express['Router']();var fs_extra=require(_0x12c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x12c3('0x6'));var config=require(_0x12c3('0x7'));var controller=require(_0x12c3('0x8'));router[_0x12c3('0x9')]('/',auth[_0x12c3('0xa')](),controller[_0x12c3('0xb')]);router[_0x12c3('0x9')](_0x12c3('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x12c3('0xa')](),controller[_0x12c3('0xd')]);router[_0x12c3('0x9')]('/:id/unread',auth[_0x12c3('0xa')](),controller['getUnread']);router[_0x12c3('0x9')](_0x12c3('0xe'),auth[_0x12c3('0xa')](),controller['getMembers']);router[_0x12c3('0x9')](_0x12c3('0xf'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x10')]);router[_0x12c3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x12c3('0x11')]('/:id/members',auth[_0x12c3('0xa')](),controller[_0x12c3('0x12')]);router[_0x12c3('0x11')](_0x12c3('0xf'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x13')]);router[_0x12c3('0x14')](_0x12c3('0x15'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x16')]);router['delete'](_0x12c3('0x15'),auth[_0x12c3('0xa')](),controller[_0x12c3('0x17')]);router['delete'](_0x12c3('0xe'),auth[_0x12c3('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x1cc7=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','delete','destroy','removeMembers','multer'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x1cc7,0x1d3));var _0x71cc=function(_0x44bb25,_0x11524d){_0x44bb25=_0x44bb25-0x0;var _0x55a226=_0x1cc7[_0x44bb25];return _0x55a226;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require(_0x71cc('0x3'));var router=express[_0x71cc('0x4')]();var fs_extra=require(_0x71cc('0x5'));var auth=require(_0x71cc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x71cc('0x7'));var controller=require(_0x71cc('0x8'));router[_0x71cc('0x9')]('/',auth[_0x71cc('0xa')](),controller[_0x71cc('0xb')]);router[_0x71cc('0x9')]('/describe',auth[_0x71cc('0xa')](),controller[_0x71cc('0xc')]);router[_0x71cc('0x9')](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller['show']);router[_0x71cc('0x9')](_0x71cc('0xe'),auth[_0x71cc('0xa')](),controller[_0x71cc('0xf')]);router[_0x71cc('0x9')](_0x71cc('0x10'),auth[_0x71cc('0xa')](),controller['getMembers']);router[_0x71cc('0x9')](_0x71cc('0x11'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x12')]);router['post']('/',auth[_0x71cc('0xa')](),controller[_0x71cc('0x13')]);router[_0x71cc('0x14')](_0x71cc('0x10'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x15')]);router[_0x71cc('0x14')]('/:id/messages',auth[_0x71cc('0xa')](),controller[_0x71cc('0x16')]);router['put'](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller['update']);router[_0x71cc('0x17')](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x18')]);router[_0x71cc('0x17')](_0x71cc('0x10'),auth['isAuthenticated'](),controller[_0x71cc('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 327eded..da0fed3 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 _0x14b7=['TEXT','STRING','long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0x132aed,_0x28d93c){var _0xc28b5f=function(_0x3055c2){while(--_0x3055c2){_0x132aed['push'](_0x132aed['shift']());}};_0xc28b5f(++_0x28d93c);}(_0x14b7,0x144));var _0x714b=function(_0x55c97d,_0x228ffc){_0x55c97d=_0x55c97d-0x0;var _0x1d5112=_0x14b7[_0x55c97d];return _0x1d5112;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'closed':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x714b('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x714b('0x4'),_0x714b('0x5')),'defaultValue':_0x714b('0x4')},'ratingMessage':{'type':Sequelize[_0x714b('0x6')]},'pathTranscript':{'type':Sequelize[_0x714b('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x714b('0x7')]},'secondDisposition':{'type':Sequelize[_0x714b('0x7')]},'thirdDisposition':{'type':Sequelize[_0x714b('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x714b('0x7')]},'browserVersion':{'type':Sequelize[_0x714b('0x7')]},'osName':{'type':Sequelize[_0x714b('0x7')]},'osVersion':{'type':Sequelize[_0x714b('0x7')]},'deviceModel':{'type':Sequelize[_0x714b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x714b('0x7')]},'referer':{'type':Sequelize[_0x714b('0x6')]},'customerIp':{'type':Sequelize[_0x714b('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x714b('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x714b('0x9')]('in',_0x714b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x714b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x714b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xac4a=['exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','long','DATE','sequelize'];(function(_0x3d9afb,_0x549bf2){var _0x4b5c8a=function(_0x84d231){while(--_0x84d231){_0x3d9afb['push'](_0x3d9afb['shift']());}};_0x4b5c8a(++_0x549bf2);}(_0xac4a,0x13f));var _0xaac4=function(_0x25f17b,_0x2fbffc){_0x25f17b=_0x25f17b-0x0;var _0xc345d=_0xac4a[_0x25f17b];return _0xc345d;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'closed':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaac4('0x3')]},'ratingType':{'type':Sequelize[_0xaac4('0x4')](_0xaac4('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xaac4('0x6')]},'pathTranscript':{'type':Sequelize[_0xaac4('0x6')]},'mailTranscript':{'type':Sequelize[_0xaac4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xaac4('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaac4('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xaac4('0x7')]},'browserVersion':{'type':Sequelize[_0xaac4('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xaac4('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xaac4('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xaac4('0x6')](_0xaac4('0x8'))},'read1stAt':{'type':Sequelize[_0xaac4('0x9')]},'lastMsgAt':{'type':Sequelize[_0xaac4('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xaac4('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xaac4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xaac4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 16169e4..2048d23 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 _0x5f2f=['vidaooMetadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','pick','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','limit','undefined','count','set','Content-Range','json','apply','save','update','name','merge','body','contact','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','union','User','UserId','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','include','options','create','destroy','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52be73,_0x1b4cbd){_0x52be73=_0x52be73-0x0;var _0x26f66a=_0x5f2f[_0x52be73];return _0x26f66a;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f2('0x14'))(_0xf5f2('0x15'));var utils=require('../../config/utils');var config=require(_0xf5f2('0x16'));var licenseUtil=require(_0xf5f2('0x17'));var db=require(_0xf5f2('0x18'))['db'];config[_0xf5f2('0x19')]=_[_0xf5f2('0x1a')](config[_0xf5f2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0x1b'))(new Redis(config[_0xf5f2('0x19')]));require(_0xf5f2('0x1c'))[_0xf5f2('0x1d')](socket);var jayson=require(_0xf5f2('0x1e'));var client=jayson['client'][_0xf5f2('0x1f')]({'port':0x232b});var client9004=jayson[_0xf5f2('0x20')][_0xf5f2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1b6dd2,_0x23e23a,_0x3a9dbb,_0xdb61b3){return new BPromise(function(_0x395a5a,_0x11f702){var _0x228ace=_0xdb61b3||client;return _0x228ace[_0xf5f2('0x21')](_0x1b6dd2,_0x3a9dbb)[_0xf5f2('0x22')](function(_0x4ff59b){logger[_0xf5f2('0x23')](_0xf5f2('0x24'),_0x23e23a,_0xf5f2('0x25'));logger[_0xf5f2('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x23e23a,_0xf5f2('0x25'),JSON[_0xf5f2('0x27')](_0x4ff59b));if(_0x4ff59b['error']){if(_0x4ff59b['error'][_0xf5f2('0x28')]===0x1f4){logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x11f702(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x395a5a(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}else{logger[_0xf5f2('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,'request\x20sent');_0x395a5a(_0x4ff59b[_0xf5f2('0x2b')][_0xf5f2('0x2a')]);}})[_0xf5f2('0x2c')](function(_0x1a5bb3){logger[_0xf5f2('0x29')](_0xf5f2('0x24'),_0x23e23a,_0x1a5bb3);_0x11f702(_0x1a5bb3);});});}function respondWithStatusCode(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0xcc;return function(_0x294414){if(_0x294414){return _0x13a3be['sendStatus'](_0x281ec8);}return _0x13a3be[_0xf5f2('0x2d')](_0x281ec8)[_0xf5f2('0x2e')]();};}function respondWithResult(_0x375ca8,_0x31bfcb){_0x31bfcb=_0x31bfcb||0xc8;return function(_0x198c73){if(_0x198c73){return _0x375ca8[_0xf5f2('0x2d')](_0x31bfcb)['json'](_0x198c73);}};}function respondWithFilteredResult(_0x53cb96,_0x22c826){return function(_0x14c829){if(_0x14c829){var _0x11c771=typeof _0x22c826['offset']==='undefined'&&typeof _0x22c826[_0xf5f2('0x2f')]===_0xf5f2('0x30');var _0x17394a=_0x14c829[_0xf5f2('0x31')];var _0x1b381e=_0x11c771?0x0:_0x22c826['offset'];var _0x52e959=_0x11c771?_0x14c829[_0xf5f2('0x31')]:_0x22c826['offset']+_0x22c826[_0xf5f2('0x2f')];var _0x58a4df;if(_0x52e959>=_0x17394a){_0x52e959=_0x17394a;_0x58a4df=0xc8;}else{_0x58a4df=0xce;}_0x53cb96[_0xf5f2('0x2d')](_0x58a4df);return _0x53cb96[_0xf5f2('0x32')](_0xf5f2('0x33'),_0x1b381e+'-'+_0x52e959+'/'+_0x17394a)[_0xf5f2('0x34')](_0x14c829);}return null;};}function patchUpdates(_0x256bd9){return function(_0x277eee){try{jsonpatch[_0xf5f2('0x35')](_0x277eee,_0x256bd9,!![]);}catch(_0x2c0e05){return BPromise['reject'](_0x2c0e05);}return _0x277eee[_0xf5f2('0x36')]();};}function saveUpdates(_0x43e4ff,_0x4590ec){return function(_0x43c77d){if(_0x43c77d){return _0x43c77d[_0xf5f2('0x37')](_0x43e4ff)[_0xf5f2('0x22')](function(_0x297c0c){return _0x297c0c;});}return null;};}function removeEntity(_0x48d64d,_0x144646){return function(_0xf503e8){if(_0xf503e8){return _0xf503e8['destroy']()[_0xf5f2('0x22')](function(){_0x48d64d['status'](0xcc)[_0xf5f2('0x2e')]();});}};}function handleEntityNotFound(_0x3930fb,_0x2a2c31){return function(_0x2e3cca){if(!_0x2e3cca){_0x3930fb['sendStatus'](0x194);}return _0x2e3cca;};}function handleError(_0x5a98d7,_0x41088b){_0x41088b=_0x41088b||0x1f4;return function(_0x46ad4a){logger[_0xf5f2('0x29')](_0x46ad4a['stack']);if(_0x46ad4a[_0xf5f2('0x38')]){delete _0x46ad4a['name'];}_0x5a98d7[_0xf5f2('0x2d')](_0x41088b)['send'](_0x46ad4a);};}function getMustacheRender(_0x46f464,_0x456764){return Mustache['render'](_0x46f464,_[_0xf5f2('0x39')](_0x456764[_0xf5f2('0x3a')],{'contact':_0x456764[_0xf5f2('0x3b')],'message':_0x456764[_0xf5f2('0x2a')],'agent':_0x456764['agent'],'interaction':_0x456764['interaction'],'account':_0x456764[_0xf5f2('0x3c')]}))||'';}function getInteractionUsers(_0x140a11,_0x22b20c){return new BPromise(function(_0x2d4400,_0x2c7f65){try{if(_0x22b20c[_0x140a11['id']]){_0x140a11[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x22b20c[_0x140a11['id']],function(_0x4c0ac7){return{'id':_0x4c0ac7['id'],'fullname':_0x4c0ac7[_0xf5f2('0x3f')]};});}}catch(_0x3b4ea6){_0x2c7f65(_0x3b4ea6);}_0x2d4400(_0x140a11);});}function getInteractionTags(_0x536501,_0xc6a1ae){return new BPromise(function(_0x3f3895,_0x71b0e7){try{if(_0x536501[_0xf5f2('0x40')]){_0x536501[_0xf5f2('0x41')]=[];_0x536501[_0xf5f2('0x40')][_0xf5f2('0x42')](',')[_0xf5f2('0x43')](function(_0x574f24){_0x536501[_0xf5f2('0x41')][_0xf5f2('0x44')](_0xc6a1ae[_0x574f24]);});}delete _0x536501[_0xf5f2('0x40')];}catch(_0x4a8e39){_0x71b0e7(_0x4a8e39);}_0x3f3895(_0x536501);});}function updateChatInteraction(_0x509dbc,_0x59eb00,_0x76d21b){return new BPromise(function(_0x2ad13c,_0x4c8d8e){return getInteractionUsers(_0x509dbc,_0x76d21b)[_0xf5f2('0x22')](function(_0xeed03d){return getInteractionTags(_0xeed03d,_0x59eb00);})[_0xf5f2('0x22')](function(_0x31f86c){_0x2ad13c(_0x31f86c);})[_0xf5f2('0x2c')](function(_0x2b3b1c){_0x4c8d8e(_0x2b3b1c);});});}exports[_0xf5f2('0x45')]=function(_0x212e90,_0x40c322){var _0x106062={},_0x444317={},_0x4773cd={'count':0x0,'rows':[]};var _0x4252a3=_[_0xf5f2('0x3e')](db['ChatInteraction'][_0xf5f2('0x46')],function(_0x578c93){return{'name':_0x578c93[_0xf5f2('0x47')],'type':_0x578c93[_0xf5f2('0x48')][_0xf5f2('0x49')]};});_0x444317[_0xf5f2('0x4a')]=_[_0xf5f2('0x3e')](_0x4252a3,_0xf5f2('0x38'));_0x444317['query']=_[_0xf5f2('0x4b')](_0x212e90[_0xf5f2('0x4c')]);_0x444317[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x444317[_0xf5f2('0x4a')],_0x444317[_0xf5f2('0x4c')]);_0x106062[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x444317['model'],qs[_0xf5f2('0x50')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x106062['attributes']=_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x106062[_0xf5f2('0x4f')]:_0x444317['model'];if(!_0x212e90['query'][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x106062['limit']=qs[_0xf5f2('0x2f')](_0x212e90['query'][_0xf5f2('0x2f')]);_0x106062['offset']=qs[_0xf5f2('0x54')](_0x212e90['query'][_0xf5f2('0x54')]);}_0x106062[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x212e90[_0xf5f2('0x4c')]['sort']);_0x106062[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_['pick'](_0x212e90['query'],_0x444317[_0xf5f2('0x4d')]),_0x4252a3);var _0x3dc0c4=[];var _0x57782c=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')]('id')[_0xf5f2('0x59')](_0xf5f2('0x38'))['field']('color')[_0xf5f2('0x5a')](_0xf5f2('0x5b'));var _0x4b62fc=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')](_0xf5f2('0x5c'))[_0xf5f2('0x59')](_0xf5f2('0x5d'))[_0xf5f2('0x59')](_0xf5f2('0x5e'))['from']('user_has_chat_interactions','ui')[_0xf5f2('0x5f')](_0xf5f2('0x60'),'u',_0xf5f2('0x61'));var _0x46a905=squel[_0xf5f2('0x58')]()['from'](_0xf5f2('0x62'),'i')[_0xf5f2('0x5f')](_0xf5f2('0x63'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf5f2('0x5f')]('users','o',_0xf5f2('0x64'))[_0xf5f2('0x5f')](_0xf5f2('0x65'),'a',_0xf5f2('0x66'))['left_join']('chat_messages','me',_0xf5f2('0x67'))['left_join'](_0xf5f2('0x68'),'it',_0xf5f2('0x69'))['left_join'](_0xf5f2('0x5b'),'t',_0xf5f2('0x6a'));var _0x2a8f6d=squel['expr']();var _0x397b99=[];var _0xcf7a50=squel[_0xf5f2('0x6b')]();var _0x4579f4;if(_0x212e90['query'][_0xf5f2('0x6c')]){_0x4579f4=as['parseSearch'](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x6c')]);var _0x2e6f5d=_0x4579f4[_0xf5f2('0x6d')];for(var _0x9f210e=0x0;_0x9f210e<_0x4579f4['conditions'][_0xf5f2('0x51')];_0x9f210e++){var _0xacd80=_0x4579f4[_0xf5f2('0x6e')][_0x9f210e];var _0x212639='i';var _0x2c5733=_['find'](_0x4252a3,[_0xf5f2('0x38'),_0xacd80['field']]);if(!_0x2c5733){switch(_0xacd80['field']){case _0xf5f2('0x6f'):if(_0xacd80['value']==0x1){_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80[_0xf5f2('0x59')]+_0xf5f2('0x71'));}else{_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80['field']+_0xf5f2('0x72'));}break;case _0xf5f2('0x73'):if(_0xacd80[_0xf5f2('0x74')]===_0xf5f2('0x75')){if(_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')]('\x20')[_0xf5f2('0x51')]>0x1){_0x2a8f6d[_0x2e6f5d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf5f2('0x77')](_0xacd80[_0xf5f2('0x76')]),null);}else{var _0xb39a6e='%'+_0xacd80[_0xf5f2('0x76')]+'%';_0x2a8f6d[_0x2e6f5d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb39a6e,_0xb39a6e,_0xb39a6e);}}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,['name',_0xf5f2('0x79')]);_0xacd80[_0xf5f2('0x59')]='ContactId';_0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x7d'):var _0x3a0e75=_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')](',')[_0xf5f2('0x3e')](function(_0x53284f){return Number(_0x53284f);});_0x3a0e75[_0xf5f2('0x43')](function(_0x3f475e){_0xcf7a50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f475e+',%');});_0x397b99=_[_0xf5f2('0x7e')](_0x397b99,_0x3a0e75);break;case _0xf5f2('0x7f'):if(_0xacd80[_0xf5f2('0x74')]==='$substring'){_0x2a8f6d[_0x2e6f5d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xacd80['value']+'%',null);}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,[_0xf5f2('0x38'),_0xf5f2('0x80')]);_0xacd80[_0xf5f2('0x59')]=_0xf5f2('0x80');_0x5a143f=as['buildExpression'](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x3a'):_0x5a143f=as[_0xf5f2('0x7a')]('me',null,_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value']['end']);break;}}else{var _0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}}}else{var _0x43c732=_(_0x212e90[_0xf5f2('0x4c')])[_0xf5f2('0x4b')]()[_0xf5f2('0x3e')](function(_0x55748d){return _[_0xf5f2('0x81')](_0x4252a3,[_0xf5f2('0x38'),_0x55748d])?_0x55748d:undefined;})['compact']()[_0xf5f2('0x76')]();if(!_[_0xf5f2('0x82')](_0x43c732)){_0x43c732[_0xf5f2('0x43')](function(_0x30ac41){if(_0x30ac41==='ChatWebsiteId'){_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x83'),[][_0xf5f2('0x84')](_0x212e90[_0xf5f2('0x4c')][_0x30ac41]));}else if(_0x30ac41===_0xf5f2('0x85')){var _0x4f47e1=JSON['parse'](_0x212e90[_0xf5f2('0x4c')][_0x30ac41])[_0xf5f2('0x86')];var _0x17eb69=JSON[_0xf5f2('0x87')](_0x212e90['query'][_0x30ac41])['$lte'];_0x46a905[_0xf5f2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f47e1,_0x17eb69);}else{if(_0x212e90['query'][_0x30ac41]==='null'){_0x46a905['where']('i.'+_0x30ac41+_0xf5f2('0x88'));}else{_0x46a905[_0xf5f2('0x57')]('i.'+_0x30ac41+_0xf5f2('0x89'),_0x212e90[_0xf5f2('0x4c')][_0x30ac41]);}}});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]==0x1){_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8b'));}else{_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8c'));}}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]){_0x397b99=_[_0xf5f2('0x8e')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')])?_0x212e90[_0xf5f2('0x4c')]['tag']:new Array(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]);_0x397b99[_0xf5f2('0x43')](function(_0x2811ad){_0xcf7a50['or'](_0xf5f2('0x8f'),'%,'+_0x2811ad+',%');});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x90')]){var _0xcf48eb=_0x212e90['query'][_0xf5f2('0x90')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcf48eb)){_0x2a8f6d['or']('i.id\x20LIKE\x20?',_0xcf48eb+'%');}else{_0x2a8f6d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xcf48eb))['or'](_0xf5f2('0x91'),_0xcf48eb+'%');}}}_0x46a905[_0xf5f2('0x57')](_0x2a8f6d);_0x46a905[_0xf5f2('0x92')](_0xf5f2('0x93'));var _0x145d4d={'type':db[_0xf5f2('0x94')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2fb1a6=_0x46a905['clone']();_0x2fb1a6[_0xf5f2('0x59')](_0xf5f2('0x93'));_0x2fb1a6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf5f2('0x6f'));if(_0x106062[_0xf5f2('0x55')]){_0x106062['order'][_0xf5f2('0x43')](function(_0x388b32){var _0x49e363=_0x388b32[0x0]===_0xf5f2('0x95')?_0x388b32[0x0]:'i.'+_0x388b32[0x0];_0x46a905[_0xf5f2('0x55')](_0x49e363,_0x388b32[0x1]===_0xf5f2('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x397b99)){_0x46a905[_0xf5f2('0x70')](_0xcf7a50);_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x97'),_0x397b99);}BPromise[_0xf5f2('0x98')]()[_0xf5f2('0x22')](function(){if(!_0x4579f4){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return;_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9a'));_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x9a'));return;}if(_0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9c')]!==_0xf5f2('0x9d'))return;return _0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9e')]({'attributes':['id'],'raw':!![]})[_0xf5f2('0x22')](function(_0x29a9d4){if(_[_0xf5f2('0x82')](_0x29a9d4)){_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9f'));_0x46a905['where'](_0xf5f2('0x9f'));}else{_0x2fb1a6[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));_0x46a905[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));}});})[_0xf5f2('0x22')](function(){if(_0x212e90[_0xf5f2('0x9b')]['role']==='agent'&&!_0x4579f4&&!_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return[];return db[_0xf5f2('0xa0')]['query'](_0x2fb1a6['toString'](),_0x145d4d);})[_0xf5f2('0x22')](function(_0xcdc6fd){_0x4773cd[_0xf5f2('0x31')]=_0xcdc6fd['length'];if(_0x4773cd['count']===0x0)return[];return db['sequelize']['query'](_0x57782c['toString'](),_0x145d4d)[_0xf5f2('0x22')](function(_0x561bab){_0x3dc0c4=_[_0xf5f2('0xa1')](_0x561bab,'id');_0x145d4d=_[_0xf5f2('0x39')](_0x145d4d,{'model':db[_0xf5f2('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]){_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x43')](function(_0x40e921){_0x46a905[_0xf5f2('0x59')]('i.'+_0x40e921);});}else{_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa3'),_0xf5f2('0x6f'));_0x46a905[_0xf5f2('0x59')]('a.key',_0xf5f2('0xa4'));_0x46a905[_0xf5f2('0x59')]('a.mandatoryDisposition',_0xf5f2('0xa5'));_0x46a905[_0xf5f2('0x59')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xf5f2('0x95'));_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa6'));_0x46a905['field'](_0xf5f2('0xa7'),_0xf5f2('0xa8'));_0x46a905['field'](_0xf5f2('0xa9'),_0xf5f2('0xaa'));_0x46a905[_0xf5f2('0x59')]('c.email',_0xf5f2('0xab'));_0x46a905['field'](_0xf5f2('0xac'),'Contact.phone');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xad'),_0xf5f2('0xae'));_0x46a905[_0xf5f2('0x59')]('c.fax',_0xf5f2('0xaf'));_0x46a905['field']('o.fullname','Owner.fullname');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb0'),'Owner.internal');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb1'),_0xf5f2('0x40'));}if(_0x106062[_0xf5f2('0x2f')])_0x46a905[_0xf5f2('0x2f')](_0x106062[_0xf5f2('0x2f')]);if(_0x106062['offset'])_0x46a905[_0xf5f2('0x54')](_0x106062[_0xf5f2('0x54')]);return db['sequelize'][_0xf5f2('0x4c')](_0x46a905[_0xf5f2('0xb2')](),_0x145d4d);})['then'](function(_0x32301a){if(_0x32301a[_0xf5f2('0x51')]>0x0)_0x4b62fc[_0xf5f2('0x57')](_0xf5f2('0xb3'),_[_0xf5f2('0x3e')](_0x32301a,'id'));return db[_0xf5f2('0xa0')]['query'](_0x4b62fc[_0xf5f2('0xb2')](),_0x145d4d)[_0xf5f2('0x22')](function(_0x13fcb0){var _0x792c75=_[_0xf5f2('0xb4')](_0x13fcb0,_0xf5f2('0xb5'));var _0x162c13=[];_0x32301a[_0xf5f2('0x43')](function(_0x3e4e40){_0x162c13['push'](updateChatInteraction(_0x3e4e40,_0x3dc0c4,_0x792c75));});return BPromise[_0xf5f2('0xb6')](_0x162c13);});});})[_0xf5f2('0x22')](function(_0xdbb2cd){_0x4773cd[_0xf5f2('0xb7')]=_0xdbb2cd;return _0x4773cd;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x40c322,_0x106062))[_0xf5f2('0x2c')](handleError(_0x40c322,null));};exports[_0xf5f2('0xb8')]=function(_0x56f4b4,_0x33cfe7){var _0x40d0eb={'raw':![],'where':{'id':_0x56f4b4['params']['id']}},_0x4c138c={};_0x4c138c[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xa2')][_0xf5f2('0x46')]);_0x4c138c['query']=_[_0xf5f2('0x4b')](_0x56f4b4[_0xf5f2('0x4c')]);_0x4c138c[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x4c138c[_0xf5f2('0x4a')],_0x4c138c['query']);_0x40d0eb[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x4c138c['model'],qs[_0xf5f2('0x50')](_0x56f4b4[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x40d0eb[_0xf5f2('0x4f')]=_0x40d0eb['attributes'][_0xf5f2('0x51')]?_0x40d0eb[_0xf5f2('0x4f')]:_0x4c138c[_0xf5f2('0x4a')];if(_0x56f4b4['query']['includeAll']){_0x40d0eb[_0xf5f2('0xb9')]=[{'all':!![]}];}_0x40d0eb=_[_0xf5f2('0x39')]({},_0x40d0eb,_0x56f4b4[_0xf5f2('0xba')]);return db[_0xf5f2('0xa2')][_0xf5f2('0x78')](_0x40d0eb)[_0xf5f2('0x22')](handleEntityNotFound(_0x33cfe7,null))['then'](respondWithResult(_0x33cfe7,null))[_0xf5f2('0x2c')](handleError(_0x33cfe7,null));};exports['create']=function(_0x151f13,_0x1624a4){return db[_0xf5f2('0xa2')][_0xf5f2('0xbb')](_0x151f13[_0xf5f2('0x3a')],{})[_0xf5f2('0x22')](respondWithResult(_0x1624a4,0xc9))['catch'](handleError(_0x1624a4,null));};exports[_0xf5f2('0x37')]=function(_0x409ed1,_0x457b53){if(_0x409ed1[_0xf5f2('0x3a')]['id']){delete _0x409ed1[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x409ed1['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x457b53,null))['then'](saveUpdates(_0x409ed1['body'],null))['then'](respondWithResult(_0x457b53,null))[_0xf5f2('0x2c')](handleError(_0x457b53,null));};exports[_0xf5f2('0xbc')]=function(_0x568806,_0x3487df){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x568806[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3487df,null))[_0xf5f2('0x22')](removeEntity(_0x3487df,null))[_0xf5f2('0x2c')](handleError(_0x3487df,null));};exports[_0xf5f2('0xbe')]=function(_0x5d3ca7,_0x29f7bd){return db[_0xf5f2('0xa2')]['describe']()[_0xf5f2('0x22')](respondWithResult(_0x29f7bd,null))[_0xf5f2('0x2c')](handleError(_0x29f7bd,null));};exports[_0xf5f2('0xbf')]=function(_0x1583bb,_0x176974){var _0x8b591c=_0x1583bb[_0xf5f2('0xbd')]['id'];var _0x2c242b;var _0x155007;var _0x4782da;return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x8b591c}})[_0xf5f2('0x22')](function(_0x31dbfa){_0x2c242b=_0x31dbfa;return db['ChatWebsite'][_0xf5f2('0xc0')]({'where':{'id':_0x31dbfa['ChatWebsiteId']},'attributes':['id',_0xf5f2('0xc1'),_0xf5f2('0xc2'),_0xf5f2('0xc3'),_0xf5f2('0xc4'),'vidaooMetadata'],'raw':!![]});})[_0xf5f2('0x22')](function(_0x5a104b){if(_0x5a104b&&_0x5a104b[_0xf5f2('0xc1')]&&_0x5a104b['vidaooEscalation']){_0x155007=_0x5a104b;var _0x3310cb={'interaction':{'id':_0x8b591c},'agent':{'id':_0x1583bb[_0xf5f2('0x9b')]['id'],'name':_0x1583bb['user'][_0xf5f2('0x38')],'fullname':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0x3f')],'email':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]},'contact':_0x1583bb[_0xf5f2('0x3a')]['contact'],'account':_0x1583bb['body'][_0xf5f2('0x3c')]};var _0x17e1eb={'rejectUnauthorized':![],'method':'POST','url':_0xf5f2('0xc6'),'headers':{'X-APIKEY':_0x5a104b[_0xf5f2('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]],'buttons':null,'topic':_0x155007[_0xf5f2('0xc3')],'note':_[_0xf5f2('0xc7')](_0x155007[_0xf5f2('0xc4')])?null:getMustacheRender(_0x155007['vidaooNote'],_0x3310cb),'metadata':null},'redirect':_0xf5f2('0xc8'),'json':!![]};try{if(!_['isNull'](_0x155007[_0xf5f2('0xc9')])){var _0x5ec0f3=getMustacheRender(_0x155007[_0xf5f2('0xc9')],_0x3310cb);var _0x4f2531=JSON[_0xf5f2('0x87')](_0x5ec0f3);_0x17e1eb['body']['metadata']=_0x4f2531;}}catch(_0x2c285c){throw new db[(_0xf5f2('0x94'))]['ValidationError'](_0xf5f2('0xca'));}return rp(_0x17e1eb);}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcc'));}})[_0xf5f2('0x22')](function(_0x25af1e){_0x4782da=_0x25af1e;if(_0x4782da['id']){var _0xd0b5d={'body':_0x4782da[_0xf5f2('0xcd')],'ChatWebsiteId':_0x155007['id'],'ChatInteractionId':_0x2c242b['id'],'direction':'out','UserId':_0x1583bb['user']['id']};return db[_0xf5f2('0xce')]['create'](_0xd0b5d,{});}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcf'));}})[_0xf5f2('0x22')](function(){return _0x2c242b[_0xf5f2('0xd0')]({'vidaooSessionId':_0x4782da['id']});})[_0xf5f2('0x22')](respondWithResult(_0x176974,null))[_0xf5f2('0x2c')](handleError(_0x176974,null));};exports[_0xf5f2('0xd1')]=function(_0x28f65b,_0x16cbd3){if(_0x28f65b[_0xf5f2('0x3a')]['id']){delete _0x28f65b[_0xf5f2('0x3a')]['id'];}return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x28f65b['params']['id']},'include':[{'model':db[_0xf5f2('0xd2')],'as':_0xf5f2('0x73')}]})[_0xf5f2('0x22')](handleEntityNotFound(_0x16cbd3,null))[_0xf5f2('0x22')](saveUpdates(_0x28f65b[_0xf5f2('0x3a')],null))[_0xf5f2('0x22')](respondWithResult(_0x16cbd3,null))[_0xf5f2('0x2c')](handleError(_0x16cbd3,null));};exports[_0xf5f2('0xd3')]=function(_0x29db4f,_0x377c68,_0xe0f288){if(_0x29db4f['body']['id']){delete _0x29db4f[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x29db4f[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](function(_0x3f8794){if(!_0x3f8794){logger[_0xf5f2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf5f2('0xd3'),0x194,_0xf5f2('0xd4'));_0x377c68[_0xf5f2('0xd5')](0x194);}else{if(_0x3f8794[_0xf5f2('0x80')]){throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xd6'));}}return _0x3f8794;})[_0xf5f2('0x22')](function(_0x356155){if(_0x356155){return _0x356155[_0xf5f2('0x37')]({'closed':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd7')],'disposition':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd8')]})[_0xf5f2('0x22')](function(_0x654b1b){return _0x654b1b;});}})['then'](function(_0x25566a){return respondWithRpcPromise(_0xf5f2('0xd9'),'abandon',_0x29db4f['body'],client9004);})[_0xf5f2('0x22')](respondWithResult(_0x377c68,null))[_0xf5f2('0x2c')](handleError(_0x377c68,null));};exports[_0xf5f2('0xda')]=function(_0x2c8f4c,_0x529d6f,_0x28cc){_0x2c8f4c[_0xf5f2('0x3a')][_0xf5f2('0x38')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdc')];_0x2c8f4c[_0xf5f2('0x3a')]['basename']=_0x2c8f4c[_0xf5f2('0xdb')]['filename'];_0x2c8f4c['body'][_0xf5f2('0x48')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdd')];return db[_0xf5f2('0xde')][_0xf5f2('0xbb')](_0x2c8f4c[_0xf5f2('0x3a')])[_0xf5f2('0x22')](respondWithResult(_0x529d6f,0xc9))['catch'](handleError(_0x529d6f,null));};exports[_0xf5f2('0xdf')]=function(_0x3a2862,_0x2c1160,_0x5e6c83){return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x3a2862['params']['id']},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null))['then'](function(_0x2389b7){if(_0x2389b7){if(_0x2389b7[_0xf5f2('0xd7')]){return _0x2c1160['status'](0x193)[_0xf5f2('0x34')]({'status':0x193,'message':_0xf5f2('0xe0')});}return db['Attachment'][_0xf5f2('0xc0')]({'where':{'id':_0x3a2862[_0xf5f2('0x4c')][_0xf5f2('0xe1')]},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null));}})[_0xf5f2('0x22')](function(_0x47a28a){if(_0x47a28a){var _0x182fa7=_0x47a28a[_0xf5f2('0xe2')]!==null;var _0x4d9048=path['join'](config[_0xf5f2('0xe3')],_0xf5f2('0xe4'));if(_0x182fa7){_0x4d9048=path[_0xf5f2('0xe5')](_0x4d9048,_0xf5f2('0xe6'));}var _0x1f51d8=path[_0xf5f2('0xe5')](_0x4d9048,_0x47a28a[_0xf5f2('0xe7')]);return _0x2c1160[_0xf5f2('0xe8')](_0x1f51d8);}})['catch'](handleError(_0x2c1160,null));};exports['close']=function(_0xc86ed5,_0x5be398){var _0x34abb6=null;var _0x235c30=null;var _0x15b060=null;var _0x422e88=null;if(_0xc86ed5['body']['id']){delete _0xc86ed5[_0xf5f2('0x3a')]['id'];}if(_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]){_0x422e88=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],'server/files/chat/upload/',util[_0xf5f2('0xea')](_0xf5f2('0xeb'),Date[_0xf5f2('0xec')]()));_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xed')]=_0x422e88;}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0xc86ed5[_0xf5f2('0xbd')]['id']},'include':[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'include':[{'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x7f')}]}]})['then'](handleEntityNotFound(_0x5be398,null))[_0xf5f2('0x22')](saveUpdates(_0xc86ed5['body'],null))[_0xf5f2('0x22')](function(_0x349efe){if(_0x349efe){_0x34abb6=_0x349efe;return db[_0xf5f2('0xef')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x99')]}});}})[_0xf5f2('0x22')](function(_0x2cd0b7){if(_0x2cd0b7){_0x15b060=_0x2cd0b7;return db[_0xf5f2('0xd2')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x79')]}});}})[_0xf5f2('0x22')](function(_0x2b6f46){if(_0x2b6f46){_0x235c30=_0x2b6f46;if(_0x422e88){var _0xf53f16=null;for(var _0xd45a63=0x1;_0xd45a63<_0x34abb6[_0xf5f2('0xee')][_0xf5f2('0x51')];++_0xd45a63){_0xf53f16=_0x34abb6[_0xf5f2('0xee')][_0xd45a63];var _0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')]('%s%d',_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');var _0x53e85c=_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xf1')]||util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0xf5f2('0xf3'),_0xf53f16[_0xf5f2('0x79')]);switch(_0x15b060[_0xf5f2('0xf4')]){case _0xf5f2('0xf5'):_0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060[_0xf5f2('0xf6')],_0xf53f16['UserId']):_0xf5f2('0xf0');break;case _0xf5f2('0xf7'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')]['alias']||_0xf53f16['User'][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;case _0xf5f2('0xf8'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;default:_0x33f987=_0xf53f16[_0xf5f2('0x80')]?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');}var _0x3881cd=util['format'](_0xf5f2('0xf9'),moment(_0xf53f16[_0xf5f2('0x85')])['format'](_0xf5f2('0xfa')),_0xf53f16['direction']==='in'?_0x53e85c:_0x33f987,_0xf53f16[_0xf5f2('0x3a')]);if(!_0xf53f16[_0xf5f2('0xfb')]){fs['appendFileSync'](_0x422e88,_0x3881cd);}}return db[_0xf5f2('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf5f2('0xfd')],'as':_0xf5f2('0xfe'),'raw':!![]}]});}}})['then'](function(_0x3971ee){if(_0x3971ee&&_0x3971ee[_0xf5f2('0xfe')]&&_0xc86ed5[_0xf5f2('0x3a')]){var _0xfeccdd={'tls':{'rejectUnauthorized':![]}};if(_0x3971ee[_0xf5f2('0xfe')]['service']){_0xfeccdd[_0xf5f2('0xff')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0xff')];}else{_0xfeccdd[_0xf5f2('0x100')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x100')];_0xfeccdd[_0xf5f2('0x101')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x101')];_0xfeccdd['secure']=_0x3971ee[_0xf5f2('0xfe')]['secure'];}if(_0x3971ee['Smtp'][_0xf5f2('0x102')]){_0xfeccdd[_0xf5f2('0x103')]={'user':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x9b')],'pass':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x104')]};}return respondWithRpcPromise(_0xf5f2('0x105'),_0xf5f2('0x106'),{'account':_0xfeccdd,'message':{'from':util[_0xf5f2('0xea')](_0xf5f2('0x107'),_0x3971ee['name'],_0x3971ee['email']||_0x3971ee['Smtp'][_0xf5f2('0x9b')]),'to':_0xc86ed5['body'][_0xf5f2('0xe9')],'subject':_0xf5f2('0x108'),'text':util[_0xf5f2('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]),'attachments':[{'path':_0x422e88}]}})['then'](function(){return _0x34abb6;})['catch'](function(_0x4d0709){console[_0xf5f2('0x29')](_0x4d0709);});}else{return _0x34abb6;}})[_0xf5f2('0x22')](respondWithStatusCode(_0x5be398,0xc8))[_0xf5f2('0x2c')](handleError(_0x5be398,null));};exports['addMessage']=function(_0x2cfa84,_0x4a22fb,_0x7cf1b6){return db[_0xf5f2('0xce')][_0xf5f2('0x78')]({'where':{'id':_0x2cfa84['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4a22fb,null))['then'](function(_0x1b88b5){if(_0x1b88b5){return _0x1b88b5[_0xf5f2('0x109')](_0x2cfa84[_0xf5f2('0x3a')]['ids'],_[_0xf5f2('0x10a')](_0x2cfa84[_0xf5f2('0x3a')],['ids','id'])||{});}})[_0xf5f2('0x22')](respondWithResult(_0x4a22fb,null))[_0xf5f2('0x2c')](handleError(_0x4a22fb,null));};exports[_0xf5f2('0x10b')]=function(_0x29526c,_0x2a52e3,_0x439c9f){var _0x44adaa={'raw':![],'where':{}};var _0x3c7058={};var _0x3bcb44={'count':0x0,'rows':[]};return db[_0xf5f2('0xa2')][_0xf5f2('0xc0')]({'where':{'id':_0x29526c[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x2a52e3,null))[_0xf5f2('0x22')](function(_0x23675a){if(_0x23675a){_0x3c7058[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x3c7058[_0xf5f2('0x4c')]=_[_0xf5f2('0x4b')](_0x29526c[_0xf5f2('0x4c')]);_0x3c7058['filters']=_[_0xf5f2('0x4e')](_0x3c7058[_0xf5f2('0x4a')],_0x3c7058[_0xf5f2('0x4c')]);_0x44adaa[_0xf5f2('0x4f')]=_['intersection'](_0x3c7058[_0xf5f2('0x4a')],qs['fields'](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x44adaa[_0xf5f2('0x4f')]=_0x44adaa[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x44adaa[_0xf5f2('0x4f')]:_0x3c7058[_0xf5f2('0x4a')];if(!_0x29526c['query']['hasOwnProperty'](_0xf5f2('0x53'))){_0x44adaa[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x29526c[_0xf5f2('0x4c')]['limit']);_0x44adaa[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x44adaa[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x29526c['query']['sort']);_0x44adaa['where']=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x29526c[_0xf5f2('0x4c')],_0x3c7058['filters']));_0x44adaa[_0xf5f2('0x57')]['ChatInteractionId']=_0x23675a['id'];if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]){_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],{'$or':_[_0xf5f2('0x3e')](_0x44adaa[_0xf5f2('0x4f')],function(_0xece862){var _0x3b4121={};_0x3b4121[_0xece862]={'$like':'%'+_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]+'%'};return _0x3b4121;})});}if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x86')]){var _0x2fa70d=_0x29526c['query'][_0xf5f2('0x86')][_0xf5f2('0x42')](',');var _0x31f018={};_0x31f018[_0x2fa70d[0x0]]={'$gte':moment(_0x2fa70d[0x1])[_0xf5f2('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],_0x31f018);}_0x44adaa=_[_0xf5f2('0x39')]({},_0x44adaa,_0x29526c['options']);return db[_0xf5f2('0xce')]['count']({'where':_0x44adaa[_0xf5f2('0x57')]})[_0xf5f2('0x22')](function(_0x20bb46){_0x3bcb44[_0xf5f2('0x31')]=_0x20bb46;if(_0x29526c['query'][_0xf5f2('0x10d')]){_0x44adaa[_0xf5f2('0xb9')]=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x44adaa);})[_0xf5f2('0x22')](function(_0x889f0e){_0x3bcb44['rows']=_0x889f0e;return _0x3bcb44;});}})[_0xf5f2('0x22')](respondWithFilteredResult(_0x2a52e3,_0x44adaa))[_0xf5f2('0x2c')](handleError(_0x2a52e3,null));};exports[_0xf5f2('0x10f')]=function(_0x3dcf4e,_0x4212d4,_0x2ebe4f){var _0x34fc35={'where':{}},_0x29c1ca={},_0x2cf93e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf5f2('0xc0')]({'where':{'id':_0x3dcf4e[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4212d4,null))[_0xf5f2('0x22')](function(_0x544db3){if(_0x544db3){_0x29c1ca['model']=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x29c1ca['query']=_['keys'](_0x3dcf4e[_0xf5f2('0x4c')]);_0x29c1ca[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x29c1ca[_0xf5f2('0x4a')],_0x29c1ca[_0xf5f2('0x4c')]);_0x34fc35[_0xf5f2('0x4f')]=_['intersection'](_0x29c1ca[_0xf5f2('0x4a')],qs[_0xf5f2('0x50')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x34fc35['attributes']=_0x34fc35['attributes'][_0xf5f2('0x51')]?_0x34fc35['attributes']:_0x29c1ca[_0xf5f2('0x4a')];if(!_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x34fc35[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x2f')]);_0x34fc35[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x34fc35[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x3dcf4e['query'][_0xf5f2('0x56')]);_0x34fc35[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x3dcf4e[_0xf5f2('0x4c')],_0x29c1ca['filters']));_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xb5')]=_0x544db3['id'];if(_0x3dcf4e['query'][_0xf5f2('0x90')]){_0x34fc35[_0xf5f2('0x57')]=_['merge'](_0x34fc35['where'],{'$or':_[_0xf5f2('0x3e')](_0x34fc35[_0xf5f2('0x4f')],function(_0x3e7f54){var _0x5e165c={};_0x5e165c[_0x3e7f54]={'$like':'%'+_0x3dcf4e['query'][_0xf5f2('0x90')]+'%'};return _0x5e165c;})});}_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xfb')]=![];if(_0x3dcf4e[_0xf5f2('0x4c')]['id']){_0x34fc35[_0xf5f2('0x57')]['id']={'$gt':_0x3dcf4e[_0xf5f2('0x4c')]['id']};}_0x34fc35=_[_0xf5f2('0x39')]({},_0x34fc35,_0x3dcf4e[_0xf5f2('0xba')]);return db[_0xf5f2('0xce')][_0xf5f2('0x31')]({'where':_0x34fc35['where']})[_0xf5f2('0x22')](function(_0x1c2842){_0x2cf93e['count']=_0x1c2842;_0x34fc35[_0xf5f2('0xb9')]=[];if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x110')]){_0x34fc35[_0xf5f2('0xb9')][_0xf5f2('0x44')]({'model':db['User'],'as':'User','attributes':['id',_0xf5f2('0x3f'),_0xf5f2('0x111')]});}if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x10d')]){_0x34fc35['include']=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x34fc35);})[_0xf5f2('0x22')](function(_0x3518f9){_0x2cf93e['rows']=_0x3518f9;return _0x2cf93e;});}})['then'](respondWithFilteredResult(_0x4212d4,_0x34fc35))['catch'](handleError(_0x4212d4,null));};exports['addTags']=function(_0x2e9d3b,_0x496802,_0x5be074){return db['ChatInteraction']['find']({'where':{'id':_0x2e9d3b[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x496802,null))['then'](function(_0x43150f){if(_0x43150f){return _0x43150f[_0xf5f2('0x112')](_0x2e9d3b[_0xf5f2('0x3a')][_0xf5f2('0x113')],_['omit'](_0x2e9d3b[_0xf5f2('0x3a')],[_0xf5f2('0x113'),'id'])||{})[_0xf5f2('0x114')](function(){return db[_0xf5f2('0x7d')][_0xf5f2('0x10e')]({'attributes':['id',_0xf5f2('0x38'),_0xf5f2('0x115')],'where':{'id':_0x2e9d3b['body'][_0xf5f2('0x113')]}});})[_0xf5f2('0x22')](function(_0x4f4af9){socket[_0xf5f2('0x116')](_0xf5f2('0x117'),{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]});return{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]};});}})[_0xf5f2('0x22')](respondWithResult(_0x496802,null))['catch'](handleError(_0x496802,null));};exports[_0xf5f2('0x118')]=function(_0x5f470f,_0x1f0a64,_0x2bbc23){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x5f470f['params']['id']}})['then'](handleEntityNotFound(_0x1f0a64,null))[_0xf5f2('0x22')](function(_0x179901){if(_0x179901){return _0x179901[_0xf5f2('0x118')](_0x5f470f[_0xf5f2('0x4c')][_0xf5f2('0x113')]);}})[_0xf5f2('0x22')](respondWithStatusCode(_0x1f0a64,null))[_0xf5f2('0x2c')](handleError(_0x1f0a64,null));};exports[_0xf5f2('0xe8')]=function(_0x5d8c6a,_0x4f777b){var _0x26dc8c=moment()[_0xf5f2('0x119')]()['toString']();var _0xb8bcf3=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11c'));var _0x2bc493=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11d'));var _0x212d97=path[_0xf5f2('0xe5')](_0xb8bcf3,_0x26dc8c);var _0x8ee5fd=util[_0xf5f2('0xea')](_0xf5f2('0x11e'),_0x5d8c6a['params']['id'],_0x26dc8c);var _0x3712e3=path['join'](_0xb8bcf3,_0x8ee5fd);var _0x56a1c3=[];_0x56a1c3['push']({'model':db['User'],'as':_0xf5f2('0x7f'),'attributes':['id',_0xf5f2('0x3f')],'raw':!![]});_0x56a1c3[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xd2')],'as':'Contact','attributes':['id',_0xf5f2('0x11f'),_0xf5f2('0x120')],'raw':!![]});if(_0x5d8c6a['query']['attachments']){_0x56a1c3['push']({'model':db[_0xf5f2('0xde')],'as':_0xf5f2('0xde'),'raw':!![]});}var _0x5a6da7=[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'attributes':['id',_0xf5f2('0x3a'),'createdAt',_0xf5f2('0x121'),_0xf5f2('0xfb'),_0xf5f2('0x8a')],'include':_0x56a1c3}];_0x5a6da7[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xef')],'as':_0xf5f2('0x122'),'attributes':['id','name']});_0x5a6da7['push']({'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x123'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x5d8c6a['params']['id']},'include':_0x5a6da7})[_0xf5f2('0x22')](handleEntityNotFound(_0x4f777b,null))[_0xf5f2('0x22')](function(_0x2ee55f){if(_0x2ee55f){var _0x43ca34=_0x2ee55f[_0xf5f2('0x124')]({'plain':!![]});fs[_0xf5f2('0x125')](_0x212d97);var _0x220300={'channel':_0xf5f2('0x126'),'account':_0x43ca34[_0xf5f2('0x122')][_0xf5f2('0x38')],'agent':_0x43ca34['Owner']?_0x43ca34[_0xf5f2('0x123')][_0xf5f2('0x3f')]:_0xf5f2('0x127'),'createdAt':moment(_0x43ca34[_0xf5f2('0x85')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'closedAt':_0x43ca34['closed']?moment(_0x43ca34[_0xf5f2('0x129')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')]():'','disposition':_0x43ca34['disposition'],'chatInfo':{'browser':_0x43ca34[_0xf5f2('0x12a')],'os':_0x43ca34[_0xf5f2('0x12b')],'referer':_0x43ca34[_0xf5f2('0x12c')],'customerIp':_0x43ca34[_0xf5f2('0x12d')],'customerPort':_0x43ca34['customerPort']?_0x43ca34[_0xf5f2('0x12e')]:_0xf5f2('0x127')},'messages':_(_0x43ca34[_0xf5f2('0xee')])['tail']()[_0xf5f2('0x90')]({'secret':![]})[_0xf5f2('0x3e')](function(_0x5981bb){if(_0x5981bb[_0xf5f2('0xde')]){var _0x4586b5=path[_0xf5f2('0xe5')](_0x2bc493,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]);if(fs[_0xf5f2('0x12f')](_0x4586b5)){fs[_0xf5f2('0x130')](_0x4586b5)[_0xf5f2('0x131')](fs[_0xf5f2('0x132')](path['join'](_0x212d97,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')])));}}return{'date':moment(_0x5981bb[_0xf5f2('0x85')])[_0xf5f2('0xea')](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'sender':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?_0x5981bb[_0xf5f2('0x7f')]?_0x5981bb[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:'System':_0x5981bb['Contact']['firstName']+(_0x5981bb[_0xf5f2('0x73')][_0xf5f2('0x120')]?'\x20'+_0x5981bb[_0xf5f2('0x73')]['lastName']:''),'body':_0x5981bb[_0xf5f2('0xde')]?_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]:_0x5981bb['body'],'direction':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?'A':'C','secret':_0x5981bb[_0xf5f2('0xfb')],'read':_0x5981bb[_0xf5f2('0x8a')],'attachment':_0x5981bb[_0xf5f2('0xde')]};})[_0xf5f2('0x76')]()};return ejs[_0xf5f2('0x134')](path[_0xf5f2('0xe5')](config['root'],_0xf5f2('0x11a'),_0xf5f2('0x135'),_0xf5f2('0x136')),{'interaction':_0x220300})[_0xf5f2('0x22')](function(_0x510f56){var _0x319b39=path[_0xf5f2('0xe5')](_0x212d97,_0xf5f2('0x137')+_0x43ca34['id']+'-'+_0x26dc8c+'.pdf');var _0x346a95={'path':_0x319b39,'channel':_0xf5f2('0x126'),'interactionId':_0x43ca34['id']};return pdf[_0xf5f2('0x138')](_0x510f56,_0x346a95);})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x249e9b,_0x56ab93){zipdir(_0x212d97,{'saveTo':_0x3712e3},function(_0x21fce7,_0x38a5e3){if(_0x21fce7)return _0x56ab93(_0x21fce7);return _0x249e9b(_0x38a5e3);});})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x4d8a71,_0x1ca92b){rimraf(_0x212d97,function(_0x486c5e){if(_0x486c5e)_0x1ca92b(_0x486c5e);return _0x4d8a71();});});})[_0xf5f2('0x22')](function(){return _0x4f777b[_0xf5f2('0xe8')](_0x3712e3,_0x8ee5fd,function(_0x5089c1){if(_0x5089c1){console[_0xf5f2('0x139')](_0xf5f2('0x13a'),_0x5089c1);}else{fs[_0xf5f2('0x13b')](_0x3712e3);}});});});}else{return _0x4f777b['sendStatus'](0xc8);}})[_0xf5f2('0x2c')](handleError(_0x4f777b,null));};
\ No newline at end of file
+var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x238d89,_0x35530b){_0x238d89=_0x238d89-0x0;var _0x55e6e9=_0x9ffd[_0x238d89];return _0x55e6e9;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 0931070..585434d 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 _0x1bda=['ChatMessage','setMaxListeners','save','update','setDataValue','map','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x127316,_0x2774a8){var _0x34d919=function(_0x22691d){while(--_0x22691d){_0x127316['push'](_0x127316['shift']());}};_0x34d919(++_0x2774a8);}(_0x1bda,0xed));var _0xa1bd=function(_0x4ae6f5,_0x3b7de0){_0x4ae6f5=_0x4ae6f5-0x0;var _0x45e3d1=_0x1bda[_0x4ae6f5];return _0x45e3d1;};'use strict';var EventEmitter=require(_0xa1bd('0x0'));var ChatInteraction=require(_0xa1bd('0x1'))['db'][_0xa1bd('0x2')];var ChatMessage=require(_0xa1bd('0x1'))['db'][_0xa1bd('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa1bd('0x4')](0x0);var events={'afterCreate':_0xa1bd('0x5'),'afterUpdate':_0xa1bd('0x6'),'afterDestroy':'remove'};function emitEvent(_0x59243e){return function(_0x29ed30,_0x2f0a52,_0x4cc87c){_0x29ed30['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x311d92){_0x29ed30[_0xa1bd('0x7')]('Users',_0x311d92[_0xa1bd('0x8')](function(_0x54c280){return{'id':_0x54c280['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x29ed30['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1bd('0x9')](function(_0x3600a8){_0x29ed30[_0xa1bd('0x7')](_0xa1bd('0xa'),_0x3600a8[_0xa1bd('0xb')]);ChatInteractionEvents[_0xa1bd('0xc')](_0x59243e+':'+_0x29ed30['id'],_0x29ed30);ChatInteractionEvents[_0xa1bd('0xc')](_0x59243e,_0x29ed30);_0x4cc87c(null);})[_0xa1bd('0xd')](_0x4cc87c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xa1bd('0xe')](e,emitEvent(event));}}module[_0xa1bd('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd0ab=['getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x22da00,_0x305396){var _0x4fe74c=function(_0x1a9e95){while(--_0x1a9e95){_0x22da00['push'](_0x22da00['shift']());}};_0x4fe74c(++_0x305396);}(_0xd0ab,0xdc));var _0xbd0a=function(_0x34db4b,_0x3813c9){_0x34db4b=_0x34db4b-0x0;var _0xc2ff2f=_0xd0ab[_0x34db4b];return _0xc2ff2f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbd0a('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xbd0a('0x0'))['db'][_0xbd0a('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbd0a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd0a('0x3'),'afterDestroy':_0xbd0a('0x4')};function emitEvent(_0xaec08b){return function(_0x5531f8,_0x35361d,_0x433725){_0x5531f8[_0xbd0a('0x5')]({'attributes':['id'],'raw':!![]})[_0xbd0a('0x6')](function(_0x4202ba){_0x5531f8[_0xbd0a('0x7')](_0xbd0a('0x8'),_0x4202ba[_0xbd0a('0x9')](function(_0x15406e){return{'id':_0x15406e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5531f8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd0a('0x6')](function(_0x455528){_0x5531f8[_0xbd0a('0x7')](_0xbd0a('0xa'),_0x455528[_0xbd0a('0xb')]);ChatInteractionEvents[_0xbd0a('0xc')](_0xaec08b+':'+_0x5531f8['id'],_0x5531f8);ChatInteractionEvents[_0xbd0a('0xc')](_0xaec08b,_0x5531f8);_0x433725(null);})['catch'](_0x433725(null));};}for(var e in events){if(events[_0xbd0a('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xbd0a('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e3c93e4..4fa8a78 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 _0x2ac2=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x30d967,_0x26f848){var _0x25d257=function(_0x1fabc3){while(--_0x1fabc3){_0x30d967['push'](_0x30d967['shift']());}};_0x25d257(++_0x26f848);}(_0x2ac2,0x148));var _0x22ac=function(_0x128440,_0xeaccfa){_0x128440=_0x128440-0x0;var _0x3cb264=_0x2ac2[_0x128440];return _0x3cb264;};'use strict';var _=require(_0x22ac('0x0'));var util=require(_0x22ac('0x1'));var logger=require(_0x22ac('0x2'))(_0x22ac('0x3'));var moment=require('moment');var BPromise=require(_0x22ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22ac('0x5'));var rimraf=require(_0x22ac('0x6'));var config=require(_0x22ac('0x7'));var attributes=require(_0x22ac('0x8'));module[_0x22ac('0x9')]=function(_0x4ee91e,_0x400ef9){return _0x4ee91e[_0x22ac('0xa')](_0x22ac('0xb'),attributes,{'tableName':_0x22ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa700aa,_0x47dce0,_0xbc0372){if(_0xa700aa['changed'](_0x22ac('0xd'))){_0xa700aa[_0x22ac('0xe')]=moment()[_0x22ac('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0xbc0372(null,_0xa700aa);}},'charset':_0x22ac('0x10'),'collate':_0x22ac('0x11')});};
\ No newline at end of file
+var _0x3c30=['moment','request-promise','../../config/environment','./chatInteraction.attributes','exports','changed','closed','closedAt','format','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x3c30,0x65));var _0x03c3=function(_0x933e49,_0x44f455){_0x933e49=_0x933e49-0x0;var _0x5e1f1f=_0x3c30[_0x933e49];return _0x5e1f1f;};'use strict';var _=require('lodash');var util=require(_0x03c3('0x0'));var logger=require(_0x03c3('0x1'))(_0x03c3('0x2'));var moment=require(_0x03c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x03c3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x03c3('0x5'));var attributes=require(_0x03c3('0x6'));module[_0x03c3('0x7')]=function(_0x4a7552,_0x32b236){return _0x4a7552['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fecd3,_0x1e8bda,_0x3f10e7){if(_0x1fecd3[_0x03c3('0x8')](_0x03c3('0x9'))){_0x1fecd3[_0x03c3('0xa')]=moment()[_0x03c3('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f10e7(null,_0x1fecd3);}},'charset':'utf8mb4','collate':_0x03c3('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index a112c9b..93f86e3 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 _0x087f=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','catch','AddTagsToChatInteraction','find','ids','omit','spread','AddTags'];(function(_0x36fbf3,_0x32aace){var _0x1536e2=function(_0x547d3a){while(--_0x547d3a){_0x36fbf3['push'](_0x36fbf3['shift']());}};_0x1536e2(++_0x32aace);}(_0x087f,0x183));var _0xf087=function(_0x5bc5fa,_0x476c67){_0x5bc5fa=_0x5bc5fa-0x0;var _0x5c2179=_0x087f[_0x5bc5fa];return _0x5c2179;};'use strict';var _=require(_0xf087('0x0'));var util=require('util');var moment=require(_0xf087('0x1'));var BPromise=require(_0xf087('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf087('0x3'));var db=require(_0xf087('0x4'))['db'];var utils=require(_0xf087('0x5'));var logger=require(_0xf087('0x6'))(_0xf087('0x7'));var config=require(_0xf087('0x8'));var jayson=require(_0xf087('0x9'));var client=jayson[_0xf087('0xa')][_0xf087('0xb')]({'port':0x232a});config['redis']=_[_0xf087('0xc')](config['redis'],{'host':_0xf087('0xd'),'port':0x18eb});var socket=require(_0xf087('0xe'))(new Redis(config['redis']));require(_0xf087('0xf'))['register'](socket);function respondWithRpcPromise(_0x1e4b4b,_0x5dbd50,_0x147288){return new BPromise(function(_0x5dba16,_0x27f0ef){return client[_0xf087('0x10')](_0x1e4b4b,_0x147288)[_0xf087('0x11')](function(_0x43b0ae){logger['info'](_0xf087('0x12'),_0x5dbd50,_0xf087('0x13'));logger[_0xf087('0x14')](_0xf087('0x15'),_0x5dbd50,_0xf087('0x13'),JSON[_0xf087('0x16')](_0x43b0ae));if(_0x43b0ae['error']){if(_0x43b0ae['error'][_0xf087('0x17')]===0x1f4){logger[_0xf087('0x18')](_0xf087('0x12'),_0x5dbd50,_0x43b0ae['error'][_0xf087('0x19')]);return _0x27f0ef(_0x43b0ae[_0xf087('0x18')]['message']);}logger['error'](_0xf087('0x12'),_0x5dbd50,_0x43b0ae[_0xf087('0x18')][_0xf087('0x19')]);return _0x5dba16(_0x43b0ae[_0xf087('0x18')][_0xf087('0x19')]);}else{logger[_0xf087('0x1a')](_0xf087('0x12'),_0x5dbd50,_0xf087('0x13'));_0x5dba16(_0x43b0ae[_0xf087('0x1b')]['message']);}})['catch'](function(_0xf04f5a){logger['error'](_0xf087('0x12'),_0x5dbd50,_0xf04f5a);_0x27f0ef(_0xf04f5a);});});}exports[_0xf087('0x1c')]=function(_0x30828d){var _0x27e5d8=this;return new Promise(function(_0xece0e2,_0xea9128){return db[_0xf087('0x1d')][_0xf087('0x1e')](_0x30828d[_0xf087('0x1f')],{'raw':_0x30828d[_0xf087('0x20')]?_0x30828d[_0xf087('0x20')][_0xf087('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30828d[_0xf087('0x20')]?_0x30828d[_0xf087('0x20')][_0xf087('0x22')]||null:null,'attributes':_0x30828d[_0xf087('0x20')]?_0x30828d['options'][_0xf087('0x23')]||null:null,'limit':_0x30828d['options']?_0x30828d[_0xf087('0x20')]['limit']||null:null})[_0xf087('0x11')](function(_0x2f0182){logger[_0xf087('0x1a')](_0xf087('0x1c'),_0x30828d);logger[_0xf087('0x14')](_0xf087('0x1c'),_0x30828d,JSON[_0xf087('0x16')](_0x2f0182));_0xece0e2(_0x2f0182);})[_0xf087('0x24')](function(_0x1a6e18){logger[_0xf087('0x18')]('UpdateChatInteraction',_0x1a6e18[_0xf087('0x19')],_0x30828d);_0xea9128(_0x27e5d8[_0xf087('0x18')](0x1f4,_0x1a6e18[_0xf087('0x19')]));});});};exports[_0xf087('0x25')]=function(_0x8839a){return new Promise(function(_0x36c6b5,_0x43bc32){return db[_0xf087('0x1d')][_0xf087('0x26')]({'where':_0x8839a['options']?_0x8839a[_0xf087('0x20')][_0xf087('0x22')]||null:null})[_0xf087('0x11')](function(_0x4c8ffc){if(_0x4c8ffc){return _0x4c8ffc['addTags'](_0x8839a['body'][_0xf087('0x27')],_[_0xf087('0x28')](_0x8839a[_0xf087('0x1f')],[_0xf087('0x27'),'id'])||{});}})[_0xf087('0x29')](function(_0xc1688d){logger['info']('AddTags',_0x8839a);logger[_0xf087('0x14')](_0xf087('0x2a'),_0x8839a,JSON[_0xf087('0x16')](_0xc1688d));_0x36c6b5(_0xc1688d);})['catch'](function(_0x473968){logger[_0xf087('0x18')](_0xf087('0x2a'),_0x473968['message'],_0x8839a);_0x43bc32(_this['error'](0x1f4,_0x473968[_0xf087('0x19')]));});});};
\ No newline at end of file
+var _0x2889=['stringify','error','message','result','ChatInteraction','update','body','options','raw','attributes','limit','then','info','UpdateChatInteraction','catch','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0xe0be82,_0x1ee7fd){var _0x4ad171=function(_0x3ff89d){while(--_0x3ff89d){_0xe0be82['push'](_0xe0be82['shift']());}};_0x4ad171(++_0x1ee7fd);}(_0x2889,0x1ef));var _0x9288=function(_0x2b9e11,_0x1e1f09){_0x2b9e11=_0x2b9e11-0x0;var _0x25f732=_0x2889[_0x2b9e11];return _0x25f732;};'use strict';var _=require(_0x9288('0x0'));var util=require('util');var moment=require(_0x9288('0x1'));var BPromise=require(_0x9288('0x2'));var rs=require(_0x9288('0x3'));var fs=require('fs');var Redis=require(_0x9288('0x4'));var db=require(_0x9288('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9288('0x6'));var config=require(_0x9288('0x7'));var jayson=require(_0x9288('0x8'));var client=jayson[_0x9288('0x9')][_0x9288('0xa')]({'port':0x232a});config['redis']=_[_0x9288('0xb')](config[_0x9288('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9288('0xd'))(new Redis(config['redis']));require(_0x9288('0xe'))[_0x9288('0xf')](socket);function respondWithRpcPromise(_0x3757c3,_0x3c067f,_0x2757b7){return new BPromise(function(_0x5a72cc,_0x11da64){return client[_0x9288('0x10')](_0x3757c3,_0x2757b7)['then'](function(_0x30b71f){logger['info'](_0x9288('0x11'),_0x3c067f,_0x9288('0x12'));logger[_0x9288('0x13')](_0x9288('0x14'),_0x3c067f,_0x9288('0x12'),JSON[_0x9288('0x15')](_0x30b71f));if(_0x30b71f['error']){if(_0x30b71f[_0x9288('0x16')]['code']===0x1f4){logger['error'](_0x9288('0x11'),_0x3c067f,_0x30b71f[_0x9288('0x16')]['message']);return _0x11da64(_0x30b71f['error'][_0x9288('0x17')]);}logger[_0x9288('0x16')](_0x9288('0x11'),_0x3c067f,_0x30b71f[_0x9288('0x16')][_0x9288('0x17')]);return _0x5a72cc(_0x30b71f[_0x9288('0x16')][_0x9288('0x17')]);}else{logger['info'](_0x9288('0x11'),_0x3c067f,_0x9288('0x12'));_0x5a72cc(_0x30b71f[_0x9288('0x18')][_0x9288('0x17')]);}})['catch'](function(_0x1d7fd2){logger[_0x9288('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3c067f,_0x1d7fd2);_0x11da64(_0x1d7fd2);});});}exports['UpdateChatInteraction']=function(_0x3df2a8){var _0x539c4c=this;return new Promise(function(_0x1cd999,_0x17c96d){return db[_0x9288('0x19')][_0x9288('0x1a')](_0x3df2a8[_0x9288('0x1b')],{'raw':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8['options'][_0x9288('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8[_0x9288('0x1c')]['where']||null:null,'attributes':_0x3df2a8['options']?_0x3df2a8[_0x9288('0x1c')][_0x9288('0x1e')]||null:null,'limit':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8[_0x9288('0x1c')][_0x9288('0x1f')]||null:null})[_0x9288('0x20')](function(_0x469bf1){logger[_0x9288('0x21')](_0x9288('0x22'),_0x3df2a8);logger[_0x9288('0x13')](_0x9288('0x22'),_0x3df2a8,JSON['stringify'](_0x469bf1));_0x1cd999(_0x469bf1);})[_0x9288('0x23')](function(_0x528567){logger[_0x9288('0x16')](_0x9288('0x22'),_0x528567['message'],_0x3df2a8);_0x17c96d(_0x539c4c[_0x9288('0x16')](0x1f4,_0x528567[_0x9288('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x36b372){return new Promise(function(_0x2650dc,_0x12ff1d){return db[_0x9288('0x19')][_0x9288('0x24')]({'where':_0x36b372[_0x9288('0x1c')]?_0x36b372['options'][_0x9288('0x25')]||null:null})[_0x9288('0x20')](function(_0x3dd206){if(_0x3dd206){return _0x3dd206[_0x9288('0x26')](_0x36b372['body'][_0x9288('0x27')],_[_0x9288('0x28')](_0x36b372[_0x9288('0x1b')],[_0x9288('0x27'),'id'])||{});}})[_0x9288('0x29')](function(_0x542d25){logger[_0x9288('0x21')](_0x9288('0x2a'),_0x36b372);logger[_0x9288('0x13')]('AddTags',_0x36b372,JSON['stringify'](_0x542d25));_0x2650dc(_0x542d25);})[_0x9288('0x23')](function(_0x48daef){logger['error'](_0x9288('0x2a'),_0x48daef[_0x9288('0x17')],_0x36b372);_0x12ff1d(_this[_0x9288('0x16')](0x1f4,_0x48daef['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 742e263..b420d9f 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 _0x6d50=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x1fcbf6,_0x5d66f0){var _0x8e8040=function(_0x4ecd81){while(--_0x4ecd81){_0x1fcbf6['push'](_0x1fcbf6['shift']());}};_0x8e8040(++_0x5d66f0);}(_0x6d50,0x1a6));var _0x06d5=function(_0x5531be,_0x19ae37){_0x5531be=_0x5531be-0x0;var _0x233584=_0x6d50[_0x5531be];return _0x233584;};'use strict';var ChatInteractionEvents=require(_0x06d5('0x0'));var events=[_0x06d5('0x1'),'remove',_0x06d5('0x2')];function createListener(_0x541606,_0x5b6269){return function(_0x1d5146){_0x5b6269[_0x06d5('0x3')](_0x541606,_0x1d5146);};}function removeListener(_0xddf577,_0x43b3fd){return function(){ChatInteractionEvents[_0x06d5('0x4')](_0xddf577,_0x43b3fd);};}exports[_0x06d5('0x5')]=function(_0x25cb32){for(var _0x3940ef=0x0,_0x2a2d3b=events[_0x06d5('0x6')];_0x3940ef<_0x2a2d3b;_0x3940ef++){var _0x459677=events[_0x3940ef];var _0xf81756=createListener(_0x06d5('0x7')+_0x459677,_0x25cb32);ChatInteractionEvents['on'](_0x459677,_0xf81756);}};
\ No newline at end of file
+var _0xe211=['save','remove','emit','removeListener','./chatInteraction.events'];(function(_0x464b39,_0x8dad8f){var _0x589f5c=function(_0x4eb81b){while(--_0x4eb81b){_0x464b39['push'](_0x464b39['shift']());}};_0x589f5c(++_0x8dad8f);}(_0xe211,0x19e));var _0x1e21=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe211[_0x14add3];return _0x4a174f;};'use strict';var ChatInteractionEvents=require(_0x1e21('0x0'));var events=[_0x1e21('0x1'),_0x1e21('0x2'),'update'];function createListener(_0x888798,_0x4e73bb){return function(_0x3acd1d){_0x4e73bb[_0x1e21('0x3')](_0x888798,_0x3acd1d);};}function removeListener(_0x4a96e2,_0x4a3a08){return function(){ChatInteractionEvents[_0x1e21('0x4')](_0x4a96e2,_0x4a3a08);};}exports['register']=function(_0x34338b){for(var _0x11a3b3=0x0,_0x508996=events['length'];_0x11a3b3<_0x508996;_0x11a3b3++){var _0x393ab0=events[_0x11a3b3];var _0x337142=createListener('chatInteraction:'+_0x393ab0,_0x34338b);ChatInteractionEvents['on'](_0x393ab0,_0x337142);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 080be57..488f7b5 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 _0xb59b=['describe','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','root','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','/:id','chat','chatinteraction:update','update','/:id/custom_update','put','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x4c0b23,_0x474c1c){var _0x3a06f0=function(_0x340837){while(--_0x340837){_0x4c0b23['push'](_0x4c0b23['shift']());}};_0x3a06f0(++_0x474c1c);}(_0xb59b,0x18c));var _0xbb59=function(_0x25cb66,_0x11b7ce){_0x25cb66=_0x25cb66-0x0;var _0x3b805d=_0xb59b[_0x25cb66];return _0x3b805d;};'use strict';var multer=require('multer');var util=require(_0xbb59('0x0'));var path=require(_0xbb59('0x1'));var timeout=require(_0xbb59('0x2'));var express=require(_0xbb59('0x3'));var router=express[_0xbb59('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb59('0x5'));var interaction=require(_0xbb59('0x6'));var config=require('../../config/environment');var controller=require(_0xbb59('0x7'));router[_0xbb59('0x8')]('/',auth[_0xbb59('0x9')](),controller[_0xbb59('0xa')]);router['get'](_0xbb59('0xb'),auth[_0xbb59('0x9')](),controller[_0xbb59('0xc')]);router[_0xbb59('0x8')]('/:id',auth[_0xbb59('0xd')](),controller[_0xbb59('0xe')]);router['get'](_0xbb59('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xbb59('0x8')]('/:id/messages',auth[_0xbb59('0x9')](),controller[_0xbb59('0x10')]);router['get'](_0xbb59('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xbb59('0x12')]);router[_0xbb59('0x8')](_0xbb59('0x13'),auth[_0xbb59('0x9')](),controller[_0xbb59('0x14')]);router[_0xbb59('0x15')]('/',auth[_0xbb59('0x9')](),controller['create']);router[_0xbb59('0x15')](_0xbb59('0x16'),auth[_0xbb59('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1754ba,_0x5d5b42,_0x57e0b1){_0x57e0b1(null,path['join'](config[_0xbb59('0x17')],'server/files/attachments/'));},'filename':function(_0x49869e,_0x843bb0,_0xbd4de3){_0xbd4de3(null,util['format'](_0xbb59('0x18'),Date[_0xbb59('0x19')](),_0x843bb0[_0xbb59('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb59('0x15')](_0xbb59('0x1b'),upload[_0xbb59('0x1c')](_0xbb59('0x1d')),controller[_0xbb59('0x1e')]);router[_0xbb59('0x15')]('/:id/messages',auth[_0xbb59('0xd')](),controller[_0xbb59('0x1f')]);router['post'](_0xbb59('0x20'),auth['isAuthenticated'](),interaction[_0xbb59('0x21')]('chat',_0xbb59('0x22')),controller[_0xbb59('0x23')]);router['put'](_0xbb59('0x24'),auth[_0xbb59('0x9')](),interaction[_0xbb59('0x21')](_0xbb59('0x25'),_0xbb59('0x26')),controller[_0xbb59('0x27')]);router['put'](_0xbb59('0x28'),controller['customUpdate']);router[_0xbb59('0x29')](_0xbb59('0x2a'),auth[_0xbb59('0xd')](),controller[_0xbb59('0x2b')]);router[_0xbb59('0x29')](_0xbb59('0x2c'),controller[_0xbb59('0x2d')]);router['delete']('/:id',auth[_0xbb59('0x9')](),interaction['tracked']('chat',_0xbb59('0x2e')),controller[_0xbb59('0x2f')]);router[_0xbb59('0x30')]('/:id/tags',auth[_0xbb59('0x9')](),controller[_0xbb59('0x31')]);module[_0xbb59('0x32')]=router;
\ No newline at end of file
+var _0xd093=['/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','/:id/close','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized'];(function(_0x3f6c2d,_0x7d0ae8){var _0x432ea9=function(_0x174a16){while(--_0x174a16){_0x3f6c2d['push'](_0x3f6c2d['shift']());}};_0x432ea9(++_0x7d0ae8);}(_0xd093,0x15c));var _0x3d09=function(_0x3f53e6,_0x4c4739){_0x3f53e6=_0x3f53e6-0x0;var _0x845321=_0xd093[_0x3f53e6];return _0x845321;};'use strict';var multer=require(_0x3d09('0x0'));var util=require('util');var path=require(_0x3d09('0x1'));var timeout=require(_0x3d09('0x2'));var express=require(_0x3d09('0x3'));var router=express[_0x3d09('0x4')]();var fs_extra=require(_0x3d09('0x5'));var auth=require(_0x3d09('0x6'));var interaction=require(_0x3d09('0x7'));var config=require(_0x3d09('0x8'));var controller=require('./chatInteraction.controller');router[_0x3d09('0x9')]('/',auth[_0x3d09('0xa')](),controller[_0x3d09('0xb')]);router[_0x3d09('0x9')](_0x3d09('0xc'),auth[_0x3d09('0xa')](),controller[_0x3d09('0xd')]);router[_0x3d09('0x9')](_0x3d09('0xe'),auth[_0x3d09('0xf')](),controller['show']);router['get'](_0x3d09('0x10'),auth[_0x3d09('0xf')](),controller['attachmentDownload']);router[_0x3d09('0x9')](_0x3d09('0x11'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x12')]);router[_0x3d09('0x9')](_0x3d09('0x13'),auth[_0x3d09('0xf')](),controller['getMyMessages']);router[_0x3d09('0x9')](_0x3d09('0x14'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x15')]);router[_0x3d09('0x16')]('/',auth[_0x3d09('0xa')](),controller[_0x3d09('0x17')]);router[_0x3d09('0x16')]('/:id/vidaoo',auth[_0x3d09('0xa')](),controller[_0x3d09('0x18')]);var upload=multer({'storage':multer[_0x3d09('0x19')]({'destination':function(_0x400d9e,_0x2e6fa8,_0x28597e){_0x28597e(null,path[_0x3d09('0x1a')](config[_0x3d09('0x1b')],_0x3d09('0x1c')));},'filename':function(_0x8a80e2,_0xd4afdc,_0x2ef5cb){_0x2ef5cb(null,util[_0x3d09('0x1d')](_0x3d09('0x1e'),Date['now'](),_0xd4afdc[_0x3d09('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x3d09('0x20'),upload[_0x3d09('0x21')](_0x3d09('0x22')),controller[_0x3d09('0x23')]);router[_0x3d09('0x16')](_0x3d09('0x11'),auth[_0x3d09('0xf')](),controller[_0x3d09('0x24')]);router[_0x3d09('0x16')](_0x3d09('0x25'),auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),_0x3d09('0x28')),controller[_0x3d09('0x29')]);router['put'](_0x3d09('0xe'),auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),_0x3d09('0x2a')),controller[_0x3d09('0x2b')]);router[_0x3d09('0x2c')](_0x3d09('0x2d'),controller['customUpdate']);router[_0x3d09('0x2c')](_0x3d09('0x2e'),auth[_0x3d09('0xf')](),controller[_0x3d09('0x2f')]);router[_0x3d09('0x2c')](_0x3d09('0x30'),controller['close']);router['delete']('/:id',auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),'chatinteraction:destroy'),controller[_0x3d09('0x31')]);router['delete'](_0x3d09('0x25'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x32')]);module[_0x3d09('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index b4b5935..b63b540 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 _0x0b1c=['sequelize','exports','medium','BOOLEAN','INTEGER'];(function(_0x208af9,_0x428504){var _0x34e94b=function(_0x48aa03){while(--_0x48aa03){_0x208af9['push'](_0x208af9['shift']());}};_0x34e94b(++_0x428504);}(_0x0b1c,0x109));var _0xc0b1=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x0b1c[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0xc0b1('0x0'));module[_0xc0b1('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc0b1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc0b1('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc0b1('0x4')]}};
\ No newline at end of file
+var _0x489b=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x47087a,_0x5ef3c6){var _0x28fdf1=function(_0xe1618e){while(--_0xe1618e){_0x47087a['push'](_0x47087a['shift']());}};_0x28fdf1(++_0x5ef3c6);}(_0x489b,0x15f));var _0xb489=function(_0x43a5ca,_0x279e55){_0x43a5ca=_0x43a5ca-0x0;var _0x310a4f=_0x489b[_0x43a5ca];return _0x310a4f;};'use strict';var Sequelize=require(_0xb489('0x0'));module[_0xb489('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb489('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb489('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb489('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 2b9e67e..e476f9d 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 _0x562c=['allowmessenger','showWebBar','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','includeAll','include','findAll','catch','params','intersection','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','internal','lastLoginAt'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0x562c,0x7d));var _0xc562=function(_0x1947ed,_0x30c213){_0x1947ed=_0x1947ed-0x0;var _0x435c51=_0x562c[_0x1947ed];return _0x435c51;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc562('0x0'));var jsonpatch=require(_0xc562('0x1'));var rp=require(_0xc562('0x2'));var moment=require(_0xc562('0x3'));var BPromise=require(_0xc562('0x4'));var Mustache=require(_0xc562('0x5'));var util=require('util');var path=require(_0xc562('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc562('0x7'));var fs=require('fs');var fs_extra=require(_0xc562('0x8'));var _=require(_0xc562('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc562('0xa'));var deskjs=require(_0xc562('0xb'));var toCsv=require(_0xc562('0xc'));var querystring=require(_0xc562('0xd'));var Papa=require(_0xc562('0xe'));var Redis=require('ioredis');var authService=require(_0xc562('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc562('0x10'));var logger=require('../../config/logger')(_0xc562('0x11'));var utils=require(_0xc562('0x12'));var config=require(_0xc562('0x13'));var licenseUtil=require(_0xc562('0x14'));var db=require('../../mysqldb')['db'];config[_0xc562('0x15')]=_[_0xc562('0x16')](config[_0xc562('0x15')],{'host':_0xc562('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc562('0x15')]));require('./chatInternalMessage.socket')[_0xc562('0x18')](socket);function respondWithStatusCode(_0x179439,_0x22a1f4){_0x22a1f4=_0x22a1f4||0xcc;return function(_0x3e3d7f){if(_0x3e3d7f){return _0x179439[_0xc562('0x19')](_0x22a1f4);}return _0x179439[_0xc562('0x1a')](_0x22a1f4)[_0xc562('0x1b')]();};}function respondWithResult(_0x5c82ca,_0x39bac6){_0x39bac6=_0x39bac6||0xc8;return function(_0x394789){if(_0x394789){return _0x5c82ca[_0xc562('0x1a')](_0x39bac6)['json'](_0x394789);}};}function respondWithFilteredResult(_0x3c9680,_0x69641d){return function(_0x5c6ae7){if(_0x5c6ae7){var _0x462a47=typeof _0x69641d[_0xc562('0x1c')]===_0xc562('0x1d')&&typeof _0x69641d[_0xc562('0x1e')]===_0xc562('0x1d');var _0x4bcd29=_0x5c6ae7['count'];var _0x4c9dad=_0x462a47?0x0:_0x69641d[_0xc562('0x1c')];var _0x16322f=_0x462a47?_0x5c6ae7[_0xc562('0x1f')]:_0x69641d[_0xc562('0x1c')]+_0x69641d[_0xc562('0x1e')];var _0x3fda3e;if(_0x16322f>=_0x4bcd29){_0x16322f=_0x4bcd29;_0x3fda3e=0xc8;}else{_0x3fda3e=0xce;}_0x3c9680[_0xc562('0x1a')](_0x3fda3e);return _0x3c9680[_0xc562('0x20')](_0xc562('0x21'),_0x4c9dad+'-'+_0x16322f+'/'+_0x4bcd29)[_0xc562('0x22')](_0x5c6ae7);}return null;};}function patchUpdates(_0x244450){return function(_0x333270){try{jsonpatch[_0xc562('0x23')](_0x333270,_0x244450,!![]);}catch(_0x675849){return BPromise[_0xc562('0x24')](_0x675849);}return _0x333270['save']();};}function saveUpdates(_0x4aef9f,_0xf78b49){return function(_0x43dc50){if(_0x43dc50){return _0x43dc50[_0xc562('0x25')](_0x4aef9f)['then'](function(_0x3ac1b0){return _0x3ac1b0;});}return null;};}function removeEntity(_0x118e0c,_0x164cbc){return function(_0x161660){if(_0x161660){return _0x161660[_0xc562('0x26')]()[_0xc562('0x27')](function(){_0x118e0c[_0xc562('0x1a')](0xcc)[_0xc562('0x1b')]();});}};}function handleEntityNotFound(_0x16cff1,_0x3c4ede){return function(_0x355022){if(!_0x355022){_0x16cff1['sendStatus'](0x194);}return _0x355022;};}function handleError(_0x360e72,_0x17d4a8){_0x17d4a8=_0x17d4a8||0x1f4;return function(_0x1bb21c){logger[_0xc562('0x28')](_0x1bb21c['stack']);if(_0x1bb21c[_0xc562('0x29')]){delete _0x1bb21c[_0xc562('0x29')];}_0x360e72[_0xc562('0x1a')](_0x17d4a8)[_0xc562('0x2a')](_0x1bb21c);};}exports['index']=function(_0x18403e,_0x101a13){var _0x1411a4={},_0x45799c={},_0x5c1e2d={'count':0x0,'rows':[]};var _0x50967f=_[_0xc562('0x2b')](db[_0xc562('0x2c')][_0xc562('0x2d')],function(_0x2300f4){return{'name':_0x2300f4[_0xc562('0x2e')],'type':_0x2300f4[_0xc562('0x2f')][_0xc562('0x30')]};});_0x45799c[_0xc562('0x31')]=_[_0xc562('0x2b')](_0x50967f,_0xc562('0x29'));_0x45799c[_0xc562('0x32')]=_[_0xc562('0x33')](_0x18403e['query']);_0x45799c[_0xc562('0x34')]=_['intersection'](_0x45799c['model'],_0x45799c[_0xc562('0x32')]);_0x1411a4['attributes']=_['intersection'](_0x45799c[_0xc562('0x31')],qs[_0xc562('0x35')](_0x18403e[_0xc562('0x32')][_0xc562('0x35')]));_0x1411a4[_0xc562('0x36')]=_0x1411a4[_0xc562('0x36')][_0xc562('0x37')]?_0x1411a4[_0xc562('0x36')]:_0x45799c[_0xc562('0x31')];if(!_0x18403e[_0xc562('0x32')][_0xc562('0x38')]('nolimit')){_0x1411a4['limit']=qs[_0xc562('0x1e')](_0x18403e[_0xc562('0x32')]['limit']);_0x1411a4[_0xc562('0x1c')]=qs[_0xc562('0x1c')](_0x18403e[_0xc562('0x32')]['offset']);}_0x1411a4[_0xc562('0x39')]=qs[_0xc562('0x3a')](_0x18403e[_0xc562('0x32')][_0xc562('0x3a')]);_0x1411a4['where']=qs['filters'](_[_0xc562('0x3b')](_0x18403e[_0xc562('0x32')],_0x45799c[_0xc562('0x34')]),_0x50967f);if(_0x18403e[_0xc562('0x32')][_0xc562('0x3c')]){_0x1411a4['where']=_[_0xc562('0x3d')](_0x1411a4['where'],{'$or':_['map'](_0x50967f,function(_0x26dbcd){if(_0x26dbcd['type']!=='VIRTUAL'){var _0x390876={};_0x390876[_0x26dbcd[_0xc562('0x29')]]={'$like':'%'+_0x18403e[_0xc562('0x32')][_0xc562('0x3c')]+'%'};return _0x390876;}})});}_0x1411a4=_[_0xc562('0x3d')]({},_0x1411a4,_0x18403e['options']);var _0x5f5450={'where':_0x1411a4[_0xc562('0x3e')]};return db[_0xc562('0x2c')][_0xc562('0x1f')](_0x5f5450)['then'](function(_0x2c9c83){_0x5c1e2d[_0xc562('0x1f')]=_0x2c9c83;if(_0x18403e['query'][_0xc562('0x3f')]){_0x1411a4[_0xc562('0x40')]=[{'all':!![]}];}return db[_0xc562('0x2c')][_0xc562('0x41')](_0x1411a4);})[_0xc562('0x27')](function(_0x3d93f5){_0x5c1e2d['rows']=_0x3d93f5;return _0x5c1e2d;})[_0xc562('0x27')](respondWithFilteredResult(_0x101a13,_0x1411a4))[_0xc562('0x42')](handleError(_0x101a13,null));};exports['show']=function(_0x14dff5,_0x133720){var _0xa245f5={'raw':!![],'where':{'id':_0x14dff5[_0xc562('0x43')]['id']}},_0x3469e5={};_0x3469e5[_0xc562('0x31')]=_[_0xc562('0x33')](db[_0xc562('0x2c')]['rawAttributes']);_0x3469e5['query']=_[_0xc562('0x33')](_0x14dff5[_0xc562('0x32')]);_0x3469e5[_0xc562('0x34')]=_[_0xc562('0x44')](_0x3469e5[_0xc562('0x31')],_0x3469e5[_0xc562('0x32')]);_0xa245f5['attributes']=_['intersection'](_0x3469e5[_0xc562('0x31')],qs[_0xc562('0x35')](_0x14dff5['query']['fields']));_0xa245f5[_0xc562('0x36')]=_0xa245f5[_0xc562('0x36')][_0xc562('0x37')]?_0xa245f5[_0xc562('0x36')]:_0x3469e5[_0xc562('0x31')];if(_0x14dff5[_0xc562('0x32')][_0xc562('0x3f')]){_0xa245f5['include']=[{'all':!![]}];}_0xa245f5=_[_0xc562('0x3d')]({},_0xa245f5,_0x14dff5[_0xc562('0x45')]);return db['ChatInternalMessage'][_0xc562('0x46')](_0xa245f5)['then'](handleEntityNotFound(_0x133720,null))[_0xc562('0x27')](respondWithResult(_0x133720,null))[_0xc562('0x42')](handleError(_0x133720,null));};exports[_0xc562('0x47')]=function(_0x5e908e,_0x1f8987){return db[_0xc562('0x2c')]['create'](_0x5e908e[_0xc562('0x48')],{})[_0xc562('0x27')](respondWithResult(_0x1f8987,0xc9))['catch'](handleError(_0x1f8987,null));};exports[_0xc562('0x25')]=function(_0xd1ac62,_0x32c84e){if(_0xd1ac62['body']['id']){delete _0xd1ac62[_0xc562('0x48')]['id'];}return db[_0xc562('0x2c')][_0xc562('0x46')]({'where':{'id':_0xd1ac62[_0xc562('0x43')]['id']}})[_0xc562('0x27')](handleEntityNotFound(_0x32c84e,null))[_0xc562('0x27')](saveUpdates(_0xd1ac62[_0xc562('0x48')],null))[_0xc562('0x27')](respondWithResult(_0x32c84e,null))[_0xc562('0x42')](handleError(_0x32c84e,null));};exports[_0xc562('0x26')]=function(_0x4339c2,_0x3f77aa){return db['ChatInternalMessage'][_0xc562('0x46')]({'where':{'id':_0x4339c2['params']['id']}})[_0xc562('0x27')](handleEntityNotFound(_0x3f77aa,null))[_0xc562('0x27')](removeEntity(_0x3f77aa,null))[_0xc562('0x42')](handleError(_0x3f77aa,null));};exports[_0xc562('0x49')]=function(_0x529944,_0x3438b7){return db[_0xc562('0x2c')][_0xc562('0x49')]()[_0xc562('0x27')](respondWithResult(_0x3438b7,null))[_0xc562('0x42')](handleError(_0x3438b7,null));};function wrapUser(_0x464f82){return function(_0x4344c2){var _0x27bd07=_0x464f82[_0xc562('0x4a')]({'plain':!![]});_0x27bd07[_0xc562('0x4b')]=[];if(_0x4344c2){_0x27bd07[_0xc562('0x4c')]=_0x4344c2[_0xc562('0x4d')];_0x27bd07[_0xc562('0x4e')]=_0x4344c2;}else{_0x27bd07[_0xc562('0x4c')]=moment(0x0)[_0xc562('0x4f')](_0xc562('0x50'));_0x27bd07[_0xc562('0x4e')]={};}return _0x27bd07;};}exports[_0xc562('0x51')]=function(_0x520a82,_0x10393a,_0x1dfefd){var _0x1468aa=[];return db['User'][_0xc562('0x41')]({'where':{'role':[_0xc562('0x52'),_0xc562('0x53'),'user']},'attributes':['id',_0xc562('0x54'),_0xc562('0x29'),_0xc562('0x55'),_0xc562('0x56'),_0xc562('0x57'),'online',_0xc562('0x58'),_0xc562('0x59'),_0xc562('0x5a')],'order':qs[_0xc562('0x3a')](_0xc562('0x5b')),'include':[{'model':db['VoiceQueue'],'as':_0xc562('0x5c'),'attributes':['id',_0xc562('0x29'),_0xc562('0x2f')],'through':{'attributes':[]}}]})[_0xc562('0x27')](function(_0x57536a){if(_0x57536a){var _0x45b566=_0x520a82[_0xc562('0x5d')]['get']({'plain':!![]});if(!_0x45b566)throw new Error(_0xc562('0x5e'));if(_0x45b566[_0xc562('0x55')]===_0xc562('0x5d')){return db[_0xc562('0x5f')][_0xc562('0x46')]({'where':{'name':_0xc562('0x60'),'userProfileId':_0x45b566[_0xc562('0x61')]},'raw':!![]})[_0xc562('0x27')](function(_0x3f9059){if(_0x3f9059){if(_0x3f9059[_0xc562('0x62')]===0x0){return db[_0xc562('0x63')][_0xc562('0x41')]({'where':{'sectionId':_0x3f9059['id']},'raw':!![]})['then'](function(_0x2e34dc){var _0x3fbf1f=[];if(_[_0xc562('0x64')](_0x2e34dc)){_0x3fbf1f=_[_0xc562('0x3c')](_0x57536a,function(_0x50c2){if(_0x50c2[_0xc562('0x55')]!==_0xc562('0x52')){return _0x50c2;}});return _0x3fbf1f;}else{for(var _0x2d4e6c=0x0;_0x2d4e6c<_0x57536a[_0xc562('0x37')];_0x2d4e6c++){var _0x3ede59=_0x57536a[_0x2d4e6c];if(_0x3ede59[_0xc562('0x55')]===_0xc562('0x52')){var _0x15cf0a=_[_0xc562('0x46')](_0x2e34dc,function(_0x4cd703){return _0x4cd703[_0xc562('0x65')]===_0x3ede59['id'];});if(_0x15cf0a)_0x3fbf1f[_0xc562('0x66')](_0x3ede59);}else{_0x3fbf1f[_0xc562('0x66')](_0x3ede59);}}return _0x3fbf1f;}});}else{return _0x57536a;}}else{var _0x520db6=_[_0xc562('0x3c')](_0x57536a,function(_0x4fc8a5){if(_0x4fc8a5[_0xc562('0x55')]!==_0xc562('0x52')){return _0x4fc8a5;}});return _0x520db6;}});}else{return _0x57536a;}}})[_0xc562('0x27')](function(_0x1dda8c){var _0x41303a=[];if(_0x1dda8c){_0x1468aa=_0x1dda8c;for(var _0x52ddf7=0x0;_0x52ddf7<_0x1dda8c[_0xc562('0x37')];_0x52ddf7+=0x1){_0x1468aa[_0x52ddf7][_0xc562('0x4b')]=[];_0x41303a[_0xc562('0x66')](db[_0xc562('0x2c')]['find']({'where':{'FromId':[_0x520a82[_0xc562('0x5d')]['id'],_0x1dda8c[_0x52ddf7]['id']],'ToId':[_0x520a82[_0xc562('0x5d')]['id'],_0x1dda8c[_0x52ddf7]['id']],'ChatGroupId':null},'attributes':['id',_0xc562('0x4d'),_0xc562('0x67'),_0xc562('0x68'),_0xc562('0x69'),'body'],'order':qs[_0xc562('0x3a')](_0xc562('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc562('0x27')](wrapUser(_0x1dda8c[_0x52ddf7])));}return BPromise['all'](_0x41303a);}return[];})[_0xc562('0x27')](function(_0x33dfb5){return{'rows':_0x33dfb5,'count':_0x33dfb5[_0xc562('0x37')]};})[_0xc562('0x27')](respondWithResult(_0x10393a,null))[_0xc562('0x42')](handleError(_0x10393a,null));};
\ No newline at end of file
+var _0xf5bf=['params','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','user','role','userpic','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','resourceId','push','FromId','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','VIRTUAL','options','where','includeAll','include','findAll','catch','show','find','create','body'];(function(_0x195eb3,_0x59180c){var _0x36ea03=function(_0x5f583d){while(--_0x5f583d){_0x195eb3['push'](_0x195eb3['shift']());}};_0x36ea03(++_0x59180c);}(_0xf5bf,0x15d));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xff5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff5b('0x1'));var jsonpatch=require(_0xff5b('0x2'));var rp=require(_0xff5b('0x3'));var moment=require(_0xff5b('0x4'));var BPromise=require(_0xff5b('0x5'));var Mustache=require('mustache');var util=require(_0xff5b('0x6'));var path=require(_0xff5b('0x7'));var sox=require(_0xff5b('0x8'));var csv=require('to-csv');var ejs=require(_0xff5b('0x9'));var fs=require('fs');var fs_extra=require(_0xff5b('0xa'));var _=require(_0xff5b('0xb'));var squel=require('squel');var crypto=require(_0xff5b('0xc'));var jsforce=require(_0xff5b('0xd'));var deskjs=require(_0xff5b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xff5b('0xf'));var Papa=require(_0xff5b('0x10'));var Redis=require(_0xff5b('0x11'));var authService=require(_0xff5b('0x12'));var qs=require(_0xff5b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff5b('0x14'));var logger=require('../../config/logger')(_0xff5b('0x15'));var utils=require(_0xff5b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff5b('0x17'))['db'];config['redis']=_[_0xff5b('0x18')](config[_0xff5b('0x19')],{'host':_0xff5b('0x1a'),'port':0x18eb});var socket=require(_0xff5b('0x1b'))(new Redis(config[_0xff5b('0x19')]));require(_0xff5b('0x1c'))[_0xff5b('0x1d')](socket);function respondWithStatusCode(_0x165ba6,_0x131c21){_0x131c21=_0x131c21||0xcc;return function(_0x1cbe53){if(_0x1cbe53){return _0x165ba6[_0xff5b('0x1e')](_0x131c21);}return _0x165ba6[_0xff5b('0x1f')](_0x131c21)[_0xff5b('0x20')]();};}function respondWithResult(_0xcc9be5,_0x3d98a7){_0x3d98a7=_0x3d98a7||0xc8;return function(_0x28acfa){if(_0x28acfa){return _0xcc9be5[_0xff5b('0x1f')](_0x3d98a7)['json'](_0x28acfa);}};}function respondWithFilteredResult(_0x3e4ed5,_0x2d12c1){return function(_0x4b90b8){if(_0x4b90b8){var _0x3abc7f=typeof _0x2d12c1[_0xff5b('0x21')]==='undefined'&&typeof _0x2d12c1[_0xff5b('0x22')]===_0xff5b('0x23');var _0x400d5e=_0x4b90b8[_0xff5b('0x24')];var _0x4ab762=_0x3abc7f?0x0:_0x2d12c1[_0xff5b('0x21')];var _0x4b3650=_0x3abc7f?_0x4b90b8[_0xff5b('0x24')]:_0x2d12c1['offset']+_0x2d12c1[_0xff5b('0x22')];var _0x5790fe;if(_0x4b3650>=_0x400d5e){_0x4b3650=_0x400d5e;_0x5790fe=0xc8;}else{_0x5790fe=0xce;}_0x3e4ed5[_0xff5b('0x1f')](_0x5790fe);return _0x3e4ed5[_0xff5b('0x25')](_0xff5b('0x26'),_0x4ab762+'-'+_0x4b3650+'/'+_0x400d5e)[_0xff5b('0x27')](_0x4b90b8);}return null;};}function patchUpdates(_0x25f9cb){return function(_0x20337e){try{jsonpatch[_0xff5b('0x28')](_0x20337e,_0x25f9cb,!![]);}catch(_0x3f9fcb){return BPromise[_0xff5b('0x29')](_0x3f9fcb);}return _0x20337e[_0xff5b('0x2a')]();};}function saveUpdates(_0x2fd738,_0x5c27ab){return function(_0x2a0dd7){if(_0x2a0dd7){return _0x2a0dd7[_0xff5b('0x2b')](_0x2fd738)['then'](function(_0x161421){return _0x161421;});}return null;};}function removeEntity(_0x506cae,_0x54e96f){return function(_0x2a2734){if(_0x2a2734){return _0x2a2734[_0xff5b('0x2c')]()[_0xff5b('0x2d')](function(){_0x506cae[_0xff5b('0x1f')](0xcc)[_0xff5b('0x20')]();});}};}function handleEntityNotFound(_0x4e9873,_0x137df3){return function(_0x15b09f){if(!_0x15b09f){_0x4e9873[_0xff5b('0x1e')](0x194);}return _0x15b09f;};}function handleError(_0x39e08e,_0x20ef59){_0x20ef59=_0x20ef59||0x1f4;return function(_0x7e1c93){logger[_0xff5b('0x2e')](_0x7e1c93['stack']);if(_0x7e1c93[_0xff5b('0x2f')]){delete _0x7e1c93['name'];}_0x39e08e[_0xff5b('0x1f')](_0x20ef59)['send'](_0x7e1c93);};}exports[_0xff5b('0x30')]=function(_0x16aa25,_0x5ce572){var _0x2e0c6b={},_0x40ee70={},_0x3884ab={'count':0x0,'rows':[]};var _0x1d287f=_[_0xff5b('0x31')](db[_0xff5b('0x32')][_0xff5b('0x33')],function(_0x92da99){return{'name':_0x92da99[_0xff5b('0x34')],'type':_0x92da99[_0xff5b('0x35')][_0xff5b('0x36')]};});_0x40ee70[_0xff5b('0x37')]=_[_0xff5b('0x31')](_0x1d287f,_0xff5b('0x2f'));_0x40ee70['query']=_[_0xff5b('0x38')](_0x16aa25['query']);_0x40ee70[_0xff5b('0x39')]=_['intersection'](_0x40ee70[_0xff5b('0x37')],_0x40ee70[_0xff5b('0x3a')]);_0x2e0c6b[_0xff5b('0x3b')]=_[_0xff5b('0x3c')](_0x40ee70[_0xff5b('0x37')],qs[_0xff5b('0x3d')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x3d')]));_0x2e0c6b[_0xff5b('0x3b')]=_0x2e0c6b[_0xff5b('0x3b')][_0xff5b('0x3e')]?_0x2e0c6b[_0xff5b('0x3b')]:_0x40ee70[_0xff5b('0x37')];if(!_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x3f')](_0xff5b('0x40'))){_0x2e0c6b['limit']=qs[_0xff5b('0x22')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x22')]);_0x2e0c6b[_0xff5b('0x21')]=qs['offset'](_0x16aa25[_0xff5b('0x3a')]['offset']);}_0x2e0c6b[_0xff5b('0x41')]=qs[_0xff5b('0x42')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x42')]);_0x2e0c6b['where']=qs['filters'](_['pick'](_0x16aa25['query'],_0x40ee70[_0xff5b('0x39')]),_0x1d287f);if(_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x43')]){_0x2e0c6b['where']=_['merge'](_0x2e0c6b['where'],{'$or':_['map'](_0x1d287f,function(_0x38f93e){if(_0x38f93e[_0xff5b('0x35')]!==_0xff5b('0x44')){var _0x129852={};_0x129852[_0x38f93e['name']]={'$like':'%'+_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x43')]+'%'};return _0x129852;}})});}_0x2e0c6b=_['merge']({},_0x2e0c6b,_0x16aa25[_0xff5b('0x45')]);var _0x4738ad={'where':_0x2e0c6b[_0xff5b('0x46')]};return db['ChatInternalMessage'][_0xff5b('0x24')](_0x4738ad)[_0xff5b('0x2d')](function(_0x2f797b){_0x3884ab[_0xff5b('0x24')]=_0x2f797b;if(_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x47')]){_0x2e0c6b[_0xff5b('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xff5b('0x49')](_0x2e0c6b);})[_0xff5b('0x2d')](function(_0x4c6c18){_0x3884ab['rows']=_0x4c6c18;return _0x3884ab;})[_0xff5b('0x2d')](respondWithFilteredResult(_0x5ce572,_0x2e0c6b))[_0xff5b('0x4a')](handleError(_0x5ce572,null));};exports[_0xff5b('0x4b')]=function(_0xca66dd,_0x3c8c5e){var _0x2b96d8={'raw':!![],'where':{'id':_0xca66dd['params']['id']}},_0x511c36={};_0x511c36[_0xff5b('0x37')]=_[_0xff5b('0x38')](db['ChatInternalMessage'][_0xff5b('0x33')]);_0x511c36[_0xff5b('0x3a')]=_[_0xff5b('0x38')](_0xca66dd[_0xff5b('0x3a')]);_0x511c36['filters']=_[_0xff5b('0x3c')](_0x511c36[_0xff5b('0x37')],_0x511c36[_0xff5b('0x3a')]);_0x2b96d8[_0xff5b('0x3b')]=_[_0xff5b('0x3c')](_0x511c36[_0xff5b('0x37')],qs[_0xff5b('0x3d')](_0xca66dd[_0xff5b('0x3a')][_0xff5b('0x3d')]));_0x2b96d8[_0xff5b('0x3b')]=_0x2b96d8['attributes']['length']?_0x2b96d8[_0xff5b('0x3b')]:_0x511c36[_0xff5b('0x37')];if(_0xca66dd[_0xff5b('0x3a')][_0xff5b('0x47')]){_0x2b96d8[_0xff5b('0x48')]=[{'all':!![]}];}_0x2b96d8=_['merge']({},_0x2b96d8,_0xca66dd[_0xff5b('0x45')]);return db[_0xff5b('0x32')][_0xff5b('0x4c')](_0x2b96d8)[_0xff5b('0x2d')](handleEntityNotFound(_0x3c8c5e,null))[_0xff5b('0x2d')](respondWithResult(_0x3c8c5e,null))['catch'](handleError(_0x3c8c5e,null));};exports['create']=function(_0x5c588e,_0x195366){return db[_0xff5b('0x32')][_0xff5b('0x4d')](_0x5c588e[_0xff5b('0x4e')],{})[_0xff5b('0x2d')](respondWithResult(_0x195366,0xc9))[_0xff5b('0x4a')](handleError(_0x195366,null));};exports[_0xff5b('0x2b')]=function(_0x1b0163,_0x19cf55){if(_0x1b0163[_0xff5b('0x4e')]['id']){delete _0x1b0163[_0xff5b('0x4e')]['id'];}return db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'id':_0x1b0163[_0xff5b('0x4f')]['id']}})[_0xff5b('0x2d')](handleEntityNotFound(_0x19cf55,null))[_0xff5b('0x2d')](saveUpdates(_0x1b0163[_0xff5b('0x4e')],null))[_0xff5b('0x2d')](respondWithResult(_0x19cf55,null))[_0xff5b('0x4a')](handleError(_0x19cf55,null));};exports[_0xff5b('0x2c')]=function(_0x5af1d1,_0x209e87){return db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'id':_0x5af1d1[_0xff5b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x209e87,null))[_0xff5b('0x2d')](removeEntity(_0x209e87,null))[_0xff5b('0x4a')](handleError(_0x209e87,null));};exports[_0xff5b('0x50')]=function(_0x5bc2e6,_0x3f52fe){return db[_0xff5b('0x32')][_0xff5b('0x50')]()[_0xff5b('0x2d')](respondWithResult(_0x3f52fe,null))['catch'](handleError(_0x3f52fe,null));};function wrapUser(_0x35ab0e){return function(_0x3472a2){var _0xd32e17=_0x35ab0e[_0xff5b('0x51')]({'plain':!![]});_0xd32e17['messages']=[];if(_0x3472a2){_0xd32e17[_0xff5b('0x52')]=_0x3472a2[_0xff5b('0x53')];_0xd32e17[_0xff5b('0x54')]=_0x3472a2;}else{_0xd32e17[_0xff5b('0x52')]=moment(0x0)[_0xff5b('0x55')](_0xff5b('0x56'));_0xd32e17[_0xff5b('0x54')]={};}return _0xd32e17;};}exports['getUsers']=function(_0x543b14,_0x280b80,_0x5ec330){var _0x4301e0=[];return db[_0xff5b('0x57')][_0xff5b('0x49')]({'where':{'role':[_0xff5b('0x58'),'admin',_0xff5b('0x59')]},'attributes':['id','fullname',_0xff5b('0x2f'),_0xff5b('0x5a'),_0xff5b('0x5b'),'internal',_0xff5b('0x5c'),_0xff5b('0x5d'),_0xff5b('0x5e'),'showWebBar'],'order':qs[_0xff5b('0x42')](_0xff5b('0x5f')),'include':[{'model':db[_0xff5b('0x60')],'as':_0xff5b('0x61'),'attributes':['id',_0xff5b('0x2f'),_0xff5b('0x35')],'through':{'attributes':[]}}]})[_0xff5b('0x2d')](function(_0x286481){if(_0x286481){var _0x59a1e0=_0x543b14['user'][_0xff5b('0x51')]({'plain':!![]});if(!_0x59a1e0)throw new Error(_0xff5b('0x62'));if(_0x59a1e0['role']===_0xff5b('0x59')){return db['UserProfileSection']['find']({'where':{'name':_0xff5b('0x63'),'userProfileId':_0x59a1e0[_0xff5b('0x64')]},'raw':!![]})[_0xff5b('0x2d')](function(_0x5de466){if(_0x5de466){if(_0x5de466[_0xff5b('0x65')]===0x0){return db['UserProfileResource'][_0xff5b('0x49')]({'where':{'sectionId':_0x5de466['id']},'raw':!![]})['then'](function(_0x2adf3b){var _0x1a8fa4=[];if(_['isEmpty'](_0x2adf3b)){_0x1a8fa4=_[_0xff5b('0x43')](_0x286481,function(_0x2256d9){if(_0x2256d9['role']!==_0xff5b('0x58')){return _0x2256d9;}});return _0x1a8fa4;}else{for(var _0x5d0298=0x0;_0x5d0298<_0x286481[_0xff5b('0x3e')];_0x5d0298++){var _0x24f25e=_0x286481[_0x5d0298];if(_0x24f25e[_0xff5b('0x5a')]===_0xff5b('0x58')){var _0xccfc32=_[_0xff5b('0x4c')](_0x2adf3b,function(_0x47b4c3){return _0x47b4c3[_0xff5b('0x66')]===_0x24f25e['id'];});if(_0xccfc32)_0x1a8fa4[_0xff5b('0x67')](_0x24f25e);}else{_0x1a8fa4[_0xff5b('0x67')](_0x24f25e);}}return _0x1a8fa4;}});}else{return _0x286481;}}else{var _0x45dedf=_[_0xff5b('0x43')](_0x286481,function(_0x25400c){if(_0x25400c[_0xff5b('0x5a')]!=='agent'){return _0x25400c;}});return _0x45dedf;}});}else{return _0x286481;}}})[_0xff5b('0x2d')](function(_0x31fd25){var _0x5bed0e=[];if(_0x31fd25){_0x4301e0=_0x31fd25;for(var _0x1432dc=0x0;_0x1432dc<_0x31fd25[_0xff5b('0x3e')];_0x1432dc+=0x1){_0x4301e0[_0x1432dc]['messages']=[];_0x5bed0e['push'](db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'FromId':[_0x543b14[_0xff5b('0x59')]['id'],_0x31fd25[_0x1432dc]['id']],'ToId':[_0x543b14[_0xff5b('0x59')]['id'],_0x31fd25[_0x1432dc]['id']],'ChatGroupId':null},'attributes':['id',_0xff5b('0x53'),_0xff5b('0x68'),_0xff5b('0x69'),_0xff5b('0x6a'),_0xff5b('0x4e')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xff5b('0x2d')](wrapUser(_0x31fd25[_0x1432dc])));}return BPromise['all'](_0x5bed0e);}return[];})[_0xff5b('0x2d')](function(_0x197389){return{'rows':_0x197389,'count':_0x197389[_0xff5b('0x3e')]};})[_0xff5b('0x2d')](respondWithResult(_0x280b80,null))['catch'](handleError(_0x280b80,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 4a95922..d207c69 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 _0x53aa=['remove','emit','hasOwnProperty','hook','ChatInternalMessage','setMaxListeners','update'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x53aa,0x6d));var _0xa53a=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x53aa[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xa53a('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa53a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa53a('0x2'),'afterDestroy':_0xa53a('0x3')};function emitEvent(_0x360ab4){return function(_0x3e10a6,_0x4400bd,_0x3458a1){ChatInternalMessageEvents[_0xa53a('0x4')](_0x360ab4+':'+_0x3e10a6['id'],_0x3e10a6);ChatInternalMessageEvents[_0xa53a('0x4')](_0x360ab4,_0x3e10a6);_0x3458a1(null);};}for(var e in events){if(events[_0xa53a('0x5')](e)){var event=events[e];ChatInternalMessage[_0xa53a('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x505e=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x486250,_0x316dd8){var _0x5447b2=function(_0x1d08ec){while(--_0x1d08ec){_0x486250['push'](_0x486250['shift']());}};_0x5447b2(++_0x316dd8);}(_0x505e,0x199));var _0xe505=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x505e[_0x2f62aa];return _0x1a341f;};'use strict';var EventEmitter=require(_0xe505('0x0'));var ChatInternalMessage=require(_0xe505('0x1'))['db'][_0xe505('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe505('0x3')](0x0);var events={'afterCreate':_0xe505('0x4'),'afterUpdate':_0xe505('0x5'),'afterDestroy':_0xe505('0x6')};function emitEvent(_0x19b96f){return function(_0x506b4c,_0x4ec430,_0x448d81){ChatInternalMessageEvents['emit'](_0x19b96f+':'+_0x506b4c['id'],_0x506b4c);ChatInternalMessageEvents[_0xe505('0x7')](_0x19b96f,_0x506b4c);_0x448d81(null);};}for(var e in events){if(events[_0xe505('0x8')](e)){var event=events[e];ChatInternalMessage[_0xe505('0x9')](e,emitEvent(event));}}module[_0xe505('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index f0462c4..f4b4d5a 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 _0xc30f=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','./chatInternalMessage.attributes'];(function(_0x3bc884,_0x3af23d){var _0x306ce6=function(_0x15ef60){while(--_0x15ef60){_0x3bc884['push'](_0x3bc884['shift']());}};_0x306ce6(++_0x3af23d);}(_0xc30f,0xf4));var _0xfc30=function(_0x5ef748,_0x15cb9b){_0x5ef748=_0x5ef748-0x0;var _0x106bee=_0xc30f[_0x5ef748];return _0x106bee;};'use strict';var _=require(_0xfc30('0x0'));var util=require('util');var logger=require(_0xfc30('0x1'))(_0xfc30('0x2'));var moment=require('moment');var BPromise=require(_0xfc30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc30('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfc30('0x5'));module['exports']=function(_0x5e41af,_0x1942c0){return _0x5e41af[_0xfc30('0x6')](_0xfc30('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc30('0x8'),'collate':_0xfc30('0x9')});};
\ No newline at end of file
+var _0xd856=['lodash','util','../../config/logger','bluebird','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x252d53,_0x218794){var _0x560841=function(_0x379b11){while(--_0x379b11){_0x252d53['push'](_0x252d53['shift']());}};_0x560841(++_0x218794);}(_0xd856,0xdc));var _0x6d85=function(_0x596b3d,_0x2a6e03){_0x596b3d=_0x596b3d-0x0;var _0x53dda8=_0xd856[_0x596b3d];return _0x53dda8;};'use strict';var _=require(_0x6d85('0x0'));var util=require(_0x6d85('0x1'));var logger=require(_0x6d85('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6d85('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d85('0x4'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x6d85('0x5')]=function(_0x392ed5,_0xec8ff6){return _0x392ed5[_0x6d85('0x6')](_0x6d85('0x7'),attributes,{'tableName':_0x6d85('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d85('0x9'),'collate':_0x6d85('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 6157619..76c9371 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 _0xa7af=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5a6868,_0x4b37c2){var _0x225ed5=function(_0x3bc0d5){while(--_0x3bc0d5){_0x5a6868['push'](_0x5a6868['shift']());}};_0x225ed5(++_0x4b37c2);}(_0xa7af,0x13e));var _0xfa7a=function(_0x5628a9,_0x431158){_0x5628a9=_0x5628a9-0x0;var _0x19f4af=_0xa7af[_0x5628a9];return _0x19f4af;};'use strict';var _=require(_0xfa7a('0x0'));var util=require(_0xfa7a('0x1'));var moment=require(_0xfa7a('0x2'));var BPromise=require(_0xfa7a('0x3'));var rs=require(_0xfa7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa7a('0x5'))['db'];var utils=require(_0xfa7a('0x6'));var logger=require(_0xfa7a('0x7'))(_0xfa7a('0x8'));var config=require(_0xfa7a('0x9'));var jayson=require(_0xfa7a('0xa'));var client=jayson['client'][_0xfa7a('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xfa7a('0xc'),'port':0x18eb});var socket=require(_0xfa7a('0xd'))(new Redis(config[_0xfa7a('0xe')]));require('./chatInternalMessage.socket')[_0xfa7a('0xf')](socket);function respondWithRpcPromise(_0x599969,_0x347a07,_0x9cf71a){return new BPromise(function(_0x46960e,_0x574018){return client[_0xfa7a('0x10')](_0x599969,_0x9cf71a)[_0xfa7a('0x11')](function(_0x13b0ab){logger['info'](_0xfa7a('0x12'),_0x347a07,_0xfa7a('0x13'));logger[_0xfa7a('0x14')](_0xfa7a('0x15'),_0x347a07,_0xfa7a('0x13'),JSON[_0xfa7a('0x16')](_0x13b0ab));if(_0x13b0ab[_0xfa7a('0x17')]){if(_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x18')]===0x1f4){logger['error'](_0xfa7a('0x12'),_0x347a07,_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x19')]);return _0x574018(_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x19')]);}logger['error'](_0xfa7a('0x12'),_0x347a07,_0x13b0ab['error']['message']);return _0x46960e(_0x13b0ab[_0xfa7a('0x17')][_0xfa7a('0x19')]);}else{logger[_0xfa7a('0x1a')](_0xfa7a('0x12'),_0x347a07,'request\x20sent');_0x46960e(_0x13b0ab['result'][_0xfa7a('0x19')]);}})['catch'](function(_0x567880){logger[_0xfa7a('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x347a07,_0x567880);_0x574018(_0x567880);});});}
\ No newline at end of file
+var _0x33c1=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33c1,0x82));var _0x133c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x33c1[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x133c('0x0'));var moment=require('moment');var BPromise=require(_0x133c('0x1'));var rs=require(_0x133c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133c('0x3'))['db'];var utils=require(_0x133c('0x4'));var logger=require(_0x133c('0x5'))(_0x133c('0x6'));var config=require(_0x133c('0x7'));var jayson=require(_0x133c('0x8'));var client=jayson[_0x133c('0x9')][_0x133c('0xa')]({'port':0x232a});config[_0x133c('0xb')]=_[_0x133c('0xc')](config[_0x133c('0xb')],{'host':_0x133c('0xd'),'port':0x18eb});var socket=require(_0x133c('0xe'))(new Redis(config[_0x133c('0xb')]));require(_0x133c('0xf'))[_0x133c('0x10')](socket);function respondWithRpcPromise(_0x34d536,_0x515ddf,_0x2546e7){return new BPromise(function(_0x599818,_0x4a422c){return client['request'](_0x34d536,_0x2546e7)['then'](function(_0x49909b){logger['info'](_0x133c('0x11'),_0x515ddf,_0x133c('0x12'));logger[_0x133c('0x13')](_0x133c('0x14'),_0x515ddf,_0x133c('0x12'),JSON[_0x133c('0x15')](_0x49909b));if(_0x49909b[_0x133c('0x16')]){if(_0x49909b[_0x133c('0x16')][_0x133c('0x17')]===0x1f4){logger['error'](_0x133c('0x11'),_0x515ddf,_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);return _0x4a422c(_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);}logger[_0x133c('0x16')](_0x133c('0x11'),_0x515ddf,_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);return _0x599818(_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);}else{logger[_0x133c('0x19')](_0x133c('0x11'),_0x515ddf,'request\x20sent');_0x599818(_0x49909b['result'][_0x133c('0x18')]);}})['catch'](function(_0x5c43ec){logger['error'](_0x133c('0x11'),_0x515ddf,_0x5c43ec);_0x4a422c(_0x5c43ec);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 84613a0..d2f3b09 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 _0x44b8=['remove','update','emit','register','length','chatInternalMessage:'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x44b8,0x1e6));var _0x844b=function(_0x458dc1,_0x56a907){_0x458dc1=_0x458dc1-0x0;var _0x35ab83=_0x44b8[_0x458dc1];return _0x35ab83;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x844b('0x0'),_0x844b('0x1')];function createListener(_0x4ba007,_0x426260){return function(_0xb141fa){_0x426260[_0x844b('0x2')](_0x4ba007,_0xb141fa);};}function removeListener(_0xe5ed3d,_0x3707ca){return function(){ChatInternalMessageEvents['removeListener'](_0xe5ed3d,_0x3707ca);};}exports[_0x844b('0x3')]=function(_0x19ee39){for(var _0x3eed04=0x0,_0x296392=events[_0x844b('0x4')];_0x3eed04<_0x296392;_0x3eed04++){var _0x4f2df2=events[_0x3eed04];var _0x4f38e7=createListener(_0x844b('0x5')+_0x4f2df2,_0x19ee39);ChatInternalMessageEvents['on'](_0x4f2df2,_0x4f38e7);}};
\ No newline at end of file
+var _0x3abc=['save','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0xee6028,_0x678569){var _0x16a6cf=function(_0x14fa6a){while(--_0x14fa6a){_0xee6028['push'](_0xee6028['shift']());}};_0x16a6cf(++_0x678569);}(_0x3abc,0xa7));var _0xc3ab=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3abc[_0xbb091];return _0x467a04;};'use strict';var ChatInternalMessageEvents=require(_0xc3ab('0x0'));var events=[_0xc3ab('0x1'),'remove',_0xc3ab('0x2')];function createListener(_0x171e80,_0x8f288e){return function(_0x153585){_0x8f288e[_0xc3ab('0x3')](_0x171e80,_0x153585);};}function removeListener(_0x163849,_0x59e4a7){return function(){ChatInternalMessageEvents[_0xc3ab('0x4')](_0x163849,_0x59e4a7);};}exports[_0xc3ab('0x5')]=function(_0x379e74){for(var _0xcfbff=0x0,_0x59e51f=events[_0xc3ab('0x6')];_0xcfbff<_0x59e51f;_0xcfbff++){var _0x3c901e=events[_0xcfbff];var _0x2be4a4=createListener(_0xc3ab('0x7')+_0x3c901e,_0x379e74);ChatInternalMessageEvents['on'](_0x3c901e,_0x2be4a4);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7b5a0c3..f17312a 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 _0x4b50=['put','/:id','update','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated','describe','getUsers','show','post','create'];(function(_0x26854d,_0x1e8768){var _0x381390=function(_0x3e5fc6){while(--_0x3e5fc6){_0x26854d['push'](_0x26854d['shift']());}};_0x381390(++_0x1e8768);}(_0x4b50,0x12f));var _0x04b5=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x4b50[_0x193e28];return _0x20ef59;};'use strict';var multer=require('multer');var util=require(_0x04b5('0x0'));var path=require(_0x04b5('0x1'));var timeout=require('connect-timeout');var express=require(_0x04b5('0x2'));var router=express[_0x04b5('0x3')]();var fs_extra=require(_0x04b5('0x4'));var auth=require(_0x04b5('0x5'));var interaction=require(_0x04b5('0x6'));var config=require(_0x04b5('0x7'));var controller=require(_0x04b5('0x8'));router[_0x04b5('0x9')]('/',auth['isAuthenticated'](),controller[_0x04b5('0xa')]);router['get']('/describe',auth[_0x04b5('0xb')](),controller[_0x04b5('0xc')]);router[_0x04b5('0x9')]('/users',auth['isAuthenticated'](),controller[_0x04b5('0xd')]);router[_0x04b5('0x9')]('/:id',auth[_0x04b5('0xb')](),controller[_0x04b5('0xe')]);router[_0x04b5('0xf')]('/',auth[_0x04b5('0xb')](),controller[_0x04b5('0x10')]);router[_0x04b5('0x11')](_0x04b5('0x12'),controller[_0x04b5('0x13')]);router['delete'](_0x04b5('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x914d=['isAuthenticated','/describe','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x914d,0x1f0));var _0xd914=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x914d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xd914('0x0'));var util=require(_0xd914('0x1'));var path=require('path');var timeout=require(_0xd914('0x2'));var express=require(_0xd914('0x3'));var router=express[_0xd914('0x4')]();var fs_extra=require(_0xd914('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd914('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xd914('0x7')]('/',auth[_0xd914('0x8')](),controller['index']);router['get'](_0xd914('0x9'),auth[_0xd914('0x8')](),controller[_0xd914('0xa')]);router[_0xd914('0x7')](_0xd914('0xb'),auth[_0xd914('0x8')](),controller[_0xd914('0xc')]);router[_0xd914('0x7')]('/:id',auth[_0xd914('0x8')](),controller[_0xd914('0xd')]);router[_0xd914('0xe')]('/',auth['isAuthenticated'](),controller[_0xd914('0xf')]);router[_0xd914('0x10')](_0xd914('0x11'),controller[_0xd914('0x12')]);router[_0xd914('0x13')](_0xd914('0x11'),auth[_0xd914('0x8')](),controller[_0xd914('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 865072e..b142dd0 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 _0x3266=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3e6680,_0xe70817){var _0x466d2c=function(_0x40e8b3){while(--_0x40e8b3){_0x3e6680['push'](_0x3e6680['shift']());}};_0x466d2c(++_0xe70817);}(_0x3266,0x6a));var _0x6326=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x3266[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'body':{'type':Sequelize[_0x6326('0x2')](_0x6326('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6326('0x5')]('in',_0x6326('0x6')),'defaultValue':_0x6326('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6326('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x3ccfea,_0x44ffb3){var _0x3a530f=function(_0x7c4323){while(--_0x7c4323){_0x3ccfea['push'](_0x3ccfea['shift']());}};_0x3a530f(++_0x44ffb3);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x384076,_0x491e1c){_0x384076=_0x384076-0x0;var _0x1d8f5d=_0xe2ab[_0x384076];return _0x1d8f5d;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 42a80a9..e93f44c 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 _0x4210=['internal','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','client','http','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','end','stack','name','send','index','map','ChatMessage','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','include','findAll','rows','params','rawAttributes','keys','length','includeAll','find','create','body','update','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','interaction','get','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','interface','channel','motionChannel','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','email'];(function(_0x1347ea,_0x26676e){var _0x5e1b92=function(_0xba2879){while(--_0xba2879){_0x1347ea['push'](_0x1347ea['shift']());}};_0x5e1b92(++_0x26676e);}(_0x4210,0x83));var _0x0421=function(_0x13a7b3,_0x787f3c){_0x13a7b3=_0x13a7b3-0x0;var _0x1af7a3=_0x4210[_0x13a7b3];return _0x1af7a3;};'use strict';var emlformat=require(_0x0421('0x0'));var rimraf=require(_0x0421('0x1'));var zipdir=require(_0x0421('0x2'));var jsonpatch=require(_0x0421('0x3'));var rp=require(_0x0421('0x4'));var moment=require(_0x0421('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0421('0x6'));var fs=require('fs');var fs_extra=require(_0x0421('0x7'));var _=require(_0x0421('0x8'));var squel=require(_0x0421('0x9'));var crypto=require('crypto');var jsforce=require(_0x0421('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0421('0xb'));var querystring=require(_0x0421('0xc'));var Papa=require(_0x0421('0xd'));var Redis=require(_0x0421('0xe'));var authService=require(_0x0421('0xf'));var qs=require(_0x0421('0x10'));var as=require(_0x0421('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0421('0x12'))(_0x0421('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0421('0x14'));var db=require(_0x0421('0x15'))['db'];config[_0x0421('0x16')]=_[_0x0421('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0421('0x18'))(new Redis(config['redis']));require(_0x0421('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0421('0x1a')][_0x0421('0x1b')]({'port':0x232c});var client9002=jayson[_0x0421('0x1a')][_0x0421('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x495fc0,_0x43fcb6,_0x40d007,_0x4b830d){return new BPromise(function(_0x5b10ee,_0x5e162e){var _0x2a911f=_0x4b830d||client;return _0x2a911f['request'](_0x495fc0,_0x40d007)['then'](function(_0x3da6f1){logger[_0x0421('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x43fcb6,_0x0421('0x1d'));logger[_0x0421('0x1e')](_0x0421('0x1f'),_0x43fcb6,_0x0421('0x1d'),JSON[_0x0421('0x20')](_0x3da6f1));if(_0x3da6f1[_0x0421('0x21')]){if(_0x3da6f1[_0x0421('0x21')][_0x0421('0x22')]===0x1f4){logger[_0x0421('0x21')](_0x0421('0x23'),_0x43fcb6,_0x3da6f1['error'][_0x0421('0x24')]);return _0x5e162e(_0x3da6f1[_0x0421('0x21')][_0x0421('0x24')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x43fcb6,_0x3da6f1['error'][_0x0421('0x24')]);return _0x5b10ee(_0x3da6f1[_0x0421('0x21')][_0x0421('0x24')]);}else{logger[_0x0421('0x1c')](_0x0421('0x23'),_0x43fcb6,_0x0421('0x1d'));_0x5b10ee(_0x3da6f1[_0x0421('0x25')]['message']);}})[_0x0421('0x26')](function(_0x2d5fa0){logger[_0x0421('0x21')]('ChatMessage,\x20%s,\x20%s',_0x43fcb6,_0x2d5fa0);_0x5e162e(_0x2d5fa0);});});}function respondWithStatusCode(_0x4c2c91,_0x1d948f){_0x1d948f=_0x1d948f||0xcc;return function(_0x176ad0){if(_0x176ad0){return _0x4c2c91[_0x0421('0x27')](_0x1d948f);}return _0x4c2c91['status'](_0x1d948f)['end']();};}function respondWithResult(_0x195791,_0x44adc7){_0x44adc7=_0x44adc7||0xc8;return function(_0xef5f75){if(_0xef5f75){return _0x195791[_0x0421('0x28')](_0x44adc7)['json'](_0xef5f75);}};}function respondWithFilteredResult(_0xb61599,_0x371d9c){return function(_0x14f9a6){if(_0x14f9a6){var _0x5e1354=typeof _0x371d9c[_0x0421('0x29')]===_0x0421('0x2a')&&typeof _0x371d9c['limit']===_0x0421('0x2a');var _0x2cd429=_0x14f9a6[_0x0421('0x2b')];var _0x730ce0=_0x5e1354?0x0:_0x371d9c[_0x0421('0x29')];var _0x552643=_0x5e1354?_0x14f9a6['count']:_0x371d9c[_0x0421('0x29')]+_0x371d9c[_0x0421('0x2c')];var _0x4ced5a;if(_0x552643>=_0x2cd429){_0x552643=_0x2cd429;_0x4ced5a=0xc8;}else{_0x4ced5a=0xce;}_0xb61599['status'](_0x4ced5a);return _0xb61599[_0x0421('0x2d')](_0x0421('0x2e'),_0x730ce0+'-'+_0x552643+'/'+_0x2cd429)[_0x0421('0x2f')](_0x14f9a6);}return null;};}function patchUpdates(_0x237c0d){return function(_0x2706fa){try{jsonpatch[_0x0421('0x30')](_0x2706fa,_0x237c0d,!![]);}catch(_0x1c2277){return BPromise[_0x0421('0x31')](_0x1c2277);}return _0x2706fa[_0x0421('0x32')]();};}function saveUpdates(_0x38a156,_0x1e02b5){return function(_0x2520f2){if(_0x2520f2){return _0x2520f2['update'](_0x38a156)[_0x0421('0x33')](function(_0x482b16){return _0x482b16;});}return null;};}function removeEntity(_0x2ed673,_0xfcb36e){return function(_0x31d01d){if(_0x31d01d){return _0x31d01d['destroy']()[_0x0421('0x33')](function(){_0x2ed673['status'](0xcc)[_0x0421('0x34')]();});}};}function handleEntityNotFound(_0x58f154,_0x292135){return function(_0x4eb1aa){if(!_0x4eb1aa){_0x58f154[_0x0421('0x27')](0x194);}return _0x4eb1aa;};}function handleError(_0x4a9477,_0x2ec452){_0x2ec452=_0x2ec452||0x1f4;return function(_0x520d08){logger[_0x0421('0x21')](_0x520d08[_0x0421('0x35')]);if(_0x520d08['name']){delete _0x520d08[_0x0421('0x36')];}_0x4a9477[_0x0421('0x28')](_0x2ec452)[_0x0421('0x37')](_0x520d08);};}exports[_0x0421('0x38')]=function(_0x192cb3,_0x51a376){var _0x48de6e={},_0x295e73={},_0x3b84a7={'count':0x0,'rows':[]};var _0x2840f2=_[_0x0421('0x39')](db[_0x0421('0x3a')]['rawAttributes'],function(_0x2b1f26){return{'name':_0x2b1f26['fieldName'],'type':_0x2b1f26[_0x0421('0x3b')][_0x0421('0x3c')]};});_0x295e73[_0x0421('0x3d')]=_[_0x0421('0x39')](_0x2840f2,_0x0421('0x36'));_0x295e73[_0x0421('0x3e')]=_['keys'](_0x192cb3[_0x0421('0x3e')]);_0x295e73[_0x0421('0x3f')]=_['intersection'](_0x295e73[_0x0421('0x3d')],_0x295e73[_0x0421('0x3e')]);_0x48de6e[_0x0421('0x40')]=_[_0x0421('0x41')](_0x295e73['model'],qs['fields'](_0x192cb3[_0x0421('0x3e')][_0x0421('0x42')]));_0x48de6e['attributes']=_0x48de6e[_0x0421('0x40')]['length']?_0x48de6e['attributes']:_0x295e73[_0x0421('0x3d')];if(!_0x192cb3[_0x0421('0x3e')][_0x0421('0x43')](_0x0421('0x44'))){_0x48de6e['limit']=qs[_0x0421('0x2c')](_0x192cb3[_0x0421('0x3e')]['limit']);_0x48de6e[_0x0421('0x29')]=qs[_0x0421('0x29')](_0x192cb3[_0x0421('0x3e')][_0x0421('0x29')]);}_0x48de6e[_0x0421('0x45')]=qs['sort'](_0x192cb3[_0x0421('0x3e')][_0x0421('0x46')]);_0x48de6e['where']=qs[_0x0421('0x3f')](_[_0x0421('0x47')](_0x192cb3[_0x0421('0x3e')],_0x295e73['filters']),_0x2840f2);if(_0x192cb3['query'][_0x0421('0x48')]){_0x48de6e['where']=_[_0x0421('0x49')](_0x48de6e[_0x0421('0x4a')],{'$or':_[_0x0421('0x39')](_0x2840f2,function(_0x78b5e9){if(_0x78b5e9[_0x0421('0x3b')]!=='VIRTUAL'){var _0x3399c8={};_0x3399c8[_0x78b5e9['name']]={'$like':'%'+_0x192cb3['query'][_0x0421('0x48')]+'%'};return _0x3399c8;}})});}_0x48de6e=_[_0x0421('0x49')]({},_0x48de6e,_0x192cb3[_0x0421('0x4b')]);var _0x53ba52={'where':_0x48de6e[_0x0421('0x4a')]};return db['ChatMessage']['count'](_0x53ba52)[_0x0421('0x33')](function(_0x328d37){_0x3b84a7[_0x0421('0x2b')]=_0x328d37;if(_0x192cb3[_0x0421('0x3e')]['includeAll']){_0x48de6e[_0x0421('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0x0421('0x4d')](_0x48de6e);})[_0x0421('0x33')](function(_0x1f056b){_0x3b84a7[_0x0421('0x4e')]=_0x1f056b;return _0x3b84a7;})[_0x0421('0x33')](respondWithFilteredResult(_0x51a376,_0x48de6e))['catch'](handleError(_0x51a376,null));};exports['show']=function(_0x5e171f,_0x11d4a6){var _0x4e68ed={'raw':!![],'where':{'id':_0x5e171f[_0x0421('0x4f')]['id']}},_0x50b94e={};_0x50b94e[_0x0421('0x3d')]=_['keys'](db[_0x0421('0x3a')][_0x0421('0x50')]);_0x50b94e[_0x0421('0x3e')]=_[_0x0421('0x51')](_0x5e171f[_0x0421('0x3e')]);_0x50b94e[_0x0421('0x3f')]=_[_0x0421('0x41')](_0x50b94e[_0x0421('0x3d')],_0x50b94e['query']);_0x4e68ed[_0x0421('0x40')]=_['intersection'](_0x50b94e[_0x0421('0x3d')],qs['fields'](_0x5e171f[_0x0421('0x3e')]['fields']));_0x4e68ed[_0x0421('0x40')]=_0x4e68ed[_0x0421('0x40')][_0x0421('0x52')]?_0x4e68ed[_0x0421('0x40')]:_0x50b94e[_0x0421('0x3d')];if(_0x5e171f[_0x0421('0x3e')][_0x0421('0x53')]){_0x4e68ed[_0x0421('0x4c')]=[{'all':!![]}];}_0x4e68ed=_[_0x0421('0x49')]({},_0x4e68ed,_0x5e171f[_0x0421('0x4b')]);return db['ChatMessage'][_0x0421('0x54')](_0x4e68ed)[_0x0421('0x33')](handleEntityNotFound(_0x11d4a6,null))[_0x0421('0x33')](respondWithResult(_0x11d4a6,null))['catch'](handleError(_0x11d4a6,null));};exports[_0x0421('0x55')]=function(_0x5efecb,_0x171653){return db['ChatMessage'][_0x0421('0x55')](_0x5efecb[_0x0421('0x56')],{})[_0x0421('0x33')](respondWithResult(_0x171653,0xc9))['catch'](handleError(_0x171653,null));};exports[_0x0421('0x57')]=function(_0x6f57e,_0x525c92){if(_0x6f57e[_0x0421('0x56')]['id']){delete _0x6f57e[_0x0421('0x56')]['id'];}return db['ChatMessage'][_0x0421('0x54')]({'where':{'id':_0x6f57e[_0x0421('0x4f')]['id']}})[_0x0421('0x33')](handleEntityNotFound(_0x525c92,null))[_0x0421('0x33')](saveUpdates(_0x6f57e[_0x0421('0x56')],null))['then'](respondWithResult(_0x525c92,null))['catch'](handleError(_0x525c92,null));};exports[_0x0421('0x58')]=function(_0x1ff7c8,_0x41e995){return db[_0x0421('0x3a')][_0x0421('0x54')]({'where':{'id':_0x1ff7c8[_0x0421('0x4f')]['id']}})[_0x0421('0x33')](handleEntityNotFound(_0x41e995,null))[_0x0421('0x33')](removeEntity(_0x41e995,null))[_0x0421('0x26')](handleError(_0x41e995,null));};exports[_0x0421('0x59')]=function(_0x5d553f,_0x5428ca){return db[_0x0421('0x3a')][_0x0421('0x59')]()[_0x0421('0x33')](respondWithResult(_0x5428ca,null))[_0x0421('0x26')](handleError(_0x5428ca,null));};var interaction_log=require(_0x0421('0x12'))(_0x0421('0x5a'));exports['accept']=function(_0x5436d3,_0x386764,_0x2f3ee6){var _0x37c033={'agent':{},'channel':_0x0421('0x5b')};if(_0x5436d3[_0x0421('0x56')]['id']){delete _0x5436d3[_0x0421('0x56')]['id'];}_0x5436d3[_0x0421('0x56')][_0x0421('0x5c')]=!![];_0x5436d3['body'][_0x0421('0x5d')]=moment()[_0x0421('0x5e')](_0x0421('0x5f'));_0x5436d3[_0x0421('0x56')][_0x0421('0x60')]=_0x5436d3[_0x0421('0x56')][_0x0421('0x60')]||_0x5436d3['user']['id'];_0x37c033[_0x0421('0x61')]['id']=_0x5436d3[_0x0421('0x56')][_0x0421('0x60')];return db[_0x0421('0x3a')]['find']({'where':{'id':_0x5436d3['params']['id'],'UserId':null}})[_0x0421('0x33')](handleEntityNotFound(_0x386764,null))['then'](saveUpdates(_0x5436d3[_0x0421('0x56')],null))[_0x0421('0x33')](function(_0x4798e){if(_0x4798e){_0x37c033[_0x0421('0x24')]=_0x4798e['get']({'plain':!![]});return db[_0x0421('0x62')][_0x0421('0x54')]({'where':{'id':_0x4798e[_0x0421('0x63')]}});}return null;})[_0x0421('0x33')](handleEntityNotFound(_0x386764,null))['then'](function(_0x46859d){if(_0x46859d){return _0x46859d[_0x0421('0x57')]({'UserId':_0x5436d3['body'][_0x0421('0x60')],'read1stAt':_[_0x0421('0x64')](_0x46859d['read1stAt'])?moment()[_0x0421('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2d96b5){if(_0x2d96b5){_0x37c033[_0x0421('0x65')]=_0x2d96b5[_0x0421('0x66')]({'plain':!![]});interaction_log[_0x0421('0x1c')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5436d3[_0x0421('0x67')]['id'],_0x5436d3[_0x0421('0x67')][_0x0421('0x36')],_0x5436d3[_0x0421('0x67')][_0x0421('0x68')],_0x37c033[_0x0421('0x65')]['id'],_0x5436d3[_0x0421('0x56')]?JSON[_0x0421('0x20')](_0x5436d3[_0x0421('0x56')]):_0x0421('0x69'));return respondWithRpcPromise(_0x0421('0x6a'),_0x0421('0x6b'),_0x37c033);}return null;})[_0x0421('0x33')](function(_0x126b35){var _0x4afd2a=_0x0421('0x6c')+_0x126b35['message'][_0x0421('0x6d')];return db[_0x0421('0x6e')]['query'](_0x4afd2a,{'type':db[_0x0421('0x6f')][_0x0421('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x150479){return _0x150479;});})[_0x0421('0x33')](function(_0x4c7173){if(_0x4c7173){_0x37c033['message']['contact']=_0x4c7173[0x0];if(!_0x5436d3['body']['UserId'])return;return db[_0x0421('0x71')]['find']({'where':{'id':_0x5436d3[_0x0421('0x56')][_0x0421('0x60')],'role':_0x0421('0x61')},'attributes':['id',_0x0421('0x36'),_0x0421('0x72'),'email','internal'],'raw':!![]});}return null;})[_0x0421('0x33')](function(_0x21b3fb){if(!_0x21b3fb)return null;_0x37c033[_0x0421('0x24')][_0x0421('0x61')]=_0x21b3fb;return _0x37c033;})[_0x0421('0x33')](function(_0x25c8e0){if(_0x25c8e0){if(_0x5436d3[_0x0421('0x56')]['manual']){_0x37c033[_0x0421('0x24')][_0x0421('0x73')]=util[_0x0421('0x5e')]('SIP/%s',_0x5436d3[_0x0421('0x67')]['name']);_0x37c033[_0x0421('0x24')][_0x0421('0x74')]=_0x37c033[_0x0421('0x74')];_0x37c033[_0x0421('0x24')][_0x0421('0x75')]=_0x37c033[_0x0421('0x74')];_0x37c033['message']['event']=_0x0421('0x76');return respondWithRpcPromise(_0x0421('0x77'),'EventManager',{'event':_0x0421('0x78'),'message':_[_0x0421('0x49')](_0x37c033['message'],JSON[_0x0421('0x79')](_0x37c033[_0x0421('0x65')][_0x0421('0x7a')]))},client9002)[_0x0421('0x33')](function(){return _0x37c033;});}return _0x37c033;}return null;})[_0x0421('0x33')](respondWithResult(_0x386764,null))['catch'](handleError(_0x386764,null));};var interaction_log=require('../../config/logger')(_0x0421('0x5a'));exports[_0x0421('0x31')]=function(_0xa50cae,_0xd42d74,_0x523ab1){var _0xb382f={'agent':{},'channel':_0x0421('0x5b')};if(_0xa50cae[_0x0421('0x56')]['id']){delete _0xa50cae[_0x0421('0x56')]['id'];}_0xa50cae['body'][_0x0421('0x60')]=_0xa50cae[_0x0421('0x56')][_0x0421('0x60')]||_0xa50cae[_0x0421('0x67')]['id'];_0xb382f['agent']['id']=_0xa50cae[_0x0421('0x56')][_0x0421('0x60')];return db[_0x0421('0x3a')][_0x0421('0x54')]({'where':{'id':_0xa50cae[_0x0421('0x4f')]['id'],'UserId':null}})[_0x0421('0x33')](handleEntityNotFound(_0xd42d74,null))['then'](function(_0x3de33d){if(_0x3de33d){_0xb382f['message']=_0x3de33d[_0x0421('0x66')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x3de33d['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xd42d74,null))[_0x0421('0x33')](function(_0x391be8){if(_0x391be8){_0xb382f[_0x0421('0x65')]=_0x391be8['get']({'plain':!![]});interaction_log['info'](_0x0421('0x7b'),_0xa50cae[_0x0421('0x67')]['id'],_0xa50cae[_0x0421('0x67')][_0x0421('0x36')],_0xa50cae[_0x0421('0x67')][_0x0421('0x68')],_0xb382f[_0x0421('0x65')]['id'],_0xa50cae['body']?JSON['stringify'](_0xa50cae[_0x0421('0x56')]):_0x0421('0x69'));return respondWithRpcPromise('RejectMessage',_0x0421('0x7c'),_0xb382f);}return null;})['then'](function(_0x39ec7b){var _0x49a181=_0x0421('0x6c')+_0x39ec7b[_0x0421('0x24')][_0x0421('0x6d')];return db['sequelize'][_0x0421('0x3e')](_0x49a181,{'type':db[_0x0421('0x6f')][_0x0421('0x70')]['SELECT'],'raw':!![]})[_0x0421('0x33')](function(_0x46efaf){return _0x46efaf;});})[_0x0421('0x33')](function(_0x3a255b){if(_0x3a255b){_0xb382f[_0x0421('0x24')][_0x0421('0x7d')]=_0x3a255b[0x0];if(!_0xa50cae['body'][_0x0421('0x60')])return;return db[_0x0421('0x71')]['find']({'where':{'id':_0xa50cae['body']['UserId'],'role':_0x0421('0x61')},'attributes':['id',_0x0421('0x36'),_0x0421('0x72'),_0x0421('0x7e'),_0x0421('0x7f')],'raw':!![]});}return null;})[_0x0421('0x33')](function(_0x1c96c8){if(!_0x1c96c8)return null;_0xb382f[_0x0421('0x24')][_0x0421('0x61')]=_0x1c96c8;return _0xb382f;})['then'](function(_0x39c741){if(_0x39c741){_0x39c741[_0x0421('0x24')][_0x0421('0x73')]=util[_0x0421('0x5e')]('SIP/%s',_0xa50cae[_0x0421('0x67')][_0x0421('0x36')]);_0x39c741[_0x0421('0x24')][_0x0421('0x74')]=_0xb382f['channel'];_0x39c741['message']['motionChannel']=_0xb382f[_0x0421('0x74')];_0x39c741[_0x0421('0x24')][_0x0421('0x80')]=_0x0421('0x31');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0x0421('0x49')](_0xb382f['message'],JSON['parse'](_0xb382f[_0x0421('0x65')][_0x0421('0x7a')]))},client9002);return _0xb382f;}return null;})['then'](respondWithResult(_0xd42d74,null))[_0x0421('0x26')](handleError(_0xd42d74,null));};
\ No newline at end of file
+var _0xfe18=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','sequelize','Sequelize','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','stack','send','index','map','ChatMessage','rawAttributes','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xfe18,0x1b5));var _0x8fe1=function(_0x52cc68,_0x440163){_0x52cc68=_0x52cc68-0x0;var _0x572cd4=_0xfe18[_0x52cc68];return _0x572cd4;};'use strict';var emlformat=require(_0x8fe1('0x0'));var rimraf=require(_0x8fe1('0x1'));var zipdir=require(_0x8fe1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fe1('0x3'));var moment=require(_0x8fe1('0x4'));var BPromise=require(_0x8fe1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8fe1('0x6'));var sox=require(_0x8fe1('0x7'));var csv=require(_0x8fe1('0x8'));var ejs=require(_0x8fe1('0x9'));var fs=require('fs');var fs_extra=require(_0x8fe1('0xa'));var _=require('lodash');var squel=require(_0x8fe1('0xb'));var crypto=require(_0x8fe1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8fe1('0xd'));var toCsv=require(_0x8fe1('0x8'));var querystring=require(_0x8fe1('0xe'));var Papa=require(_0x8fe1('0xf'));var Redis=require(_0x8fe1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8fe1('0x11'));var as=require(_0x8fe1('0x12'));var hardwareService=require(_0x8fe1('0x13'));var logger=require(_0x8fe1('0x14'))(_0x8fe1('0x15'));var utils=require(_0x8fe1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8fe1('0x17'));var db=require(_0x8fe1('0x18'))['db'];config[_0x8fe1('0x19')]=_[_0x8fe1('0x1a')](config[_0x8fe1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fe1('0x1b'))(new Redis(config[_0x8fe1('0x19')]));require(_0x8fe1('0x1c'))[_0x8fe1('0x1d')](socket);var jayson=require(_0x8fe1('0x1e'));var client=jayson['client'][_0x8fe1('0x1f')]({'port':0x232c});var client9002=jayson[_0x8fe1('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365368,_0x492dc1,_0x4ccdf4,_0x384799){return new BPromise(function(_0x4347f4,_0x1f6b80){var _0x3e047e=_0x384799||client;return _0x3e047e[_0x8fe1('0x21')](_0x365368,_0x4ccdf4)[_0x8fe1('0x22')](function(_0x52e65f){logger[_0x8fe1('0x23')](_0x8fe1('0x24'),_0x492dc1,_0x8fe1('0x25'));logger[_0x8fe1('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x492dc1,_0x8fe1('0x25'),JSON['stringify'](_0x52e65f));if(_0x52e65f['error']){if(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x28')]===0x1f4){logger[_0x8fe1('0x27')](_0x8fe1('0x24'),_0x492dc1,_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x1f6b80(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);}logger['error'](_0x8fe1('0x24'),_0x492dc1,_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x4347f4(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);}else{logger[_0x8fe1('0x23')](_0x8fe1('0x24'),_0x492dc1,'request\x20sent');_0x4347f4(_0x52e65f['result'][_0x8fe1('0x29')]);}})['catch'](function(_0x384cc0){logger[_0x8fe1('0x27')](_0x8fe1('0x24'),_0x492dc1,_0x384cc0);_0x1f6b80(_0x384cc0);});});}function respondWithStatusCode(_0x53ad2e,_0x7a0bba){_0x7a0bba=_0x7a0bba||0xcc;return function(_0x5cb0e3){if(_0x5cb0e3){return _0x53ad2e[_0x8fe1('0x2a')](_0x7a0bba);}return _0x53ad2e['status'](_0x7a0bba)[_0x8fe1('0x2b')]();};}function respondWithResult(_0x4fb99a,_0xc11967){_0xc11967=_0xc11967||0xc8;return function(_0x73f7de){if(_0x73f7de){return _0x4fb99a[_0x8fe1('0x2c')](_0xc11967)['json'](_0x73f7de);}};}function respondWithFilteredResult(_0x56a6bc,_0x391bf1){return function(_0x2aa19c){if(_0x2aa19c){var _0x2442e3=typeof _0x391bf1[_0x8fe1('0x2d')]===_0x8fe1('0x2e')&&typeof _0x391bf1[_0x8fe1('0x2f')]===_0x8fe1('0x2e');var _0x1532e2=_0x2aa19c[_0x8fe1('0x30')];var _0x35256d=_0x2442e3?0x0:_0x391bf1[_0x8fe1('0x2d')];var _0x2fb21f=_0x2442e3?_0x2aa19c['count']:_0x391bf1[_0x8fe1('0x2d')]+_0x391bf1['limit'];var _0x2a2985;if(_0x2fb21f>=_0x1532e2){_0x2fb21f=_0x1532e2;_0x2a2985=0xc8;}else{_0x2a2985=0xce;}_0x56a6bc[_0x8fe1('0x2c')](_0x2a2985);return _0x56a6bc[_0x8fe1('0x31')](_0x8fe1('0x32'),_0x35256d+'-'+_0x2fb21f+'/'+_0x1532e2)[_0x8fe1('0x33')](_0x2aa19c);}return null;};}function patchUpdates(_0x1bede1){return function(_0x5d0ae2){try{jsonpatch[_0x8fe1('0x34')](_0x5d0ae2,_0x1bede1,!![]);}catch(_0x44804d){return BPromise[_0x8fe1('0x35')](_0x44804d);}return _0x5d0ae2[_0x8fe1('0x36')]();};}function saveUpdates(_0x18f437,_0x41cf52){return function(_0x1280da){if(_0x1280da){return _0x1280da['update'](_0x18f437)[_0x8fe1('0x22')](function(_0x2089ac){return _0x2089ac;});}return null;};}function removeEntity(_0x435a99,_0x4b5f2c){return function(_0x3536d5){if(_0x3536d5){return _0x3536d5[_0x8fe1('0x37')]()[_0x8fe1('0x22')](function(){_0x435a99[_0x8fe1('0x2c')](0xcc)[_0x8fe1('0x2b')]();});}};}function handleEntityNotFound(_0x3f6a1b,_0x3bdad7){return function(_0x322826){if(!_0x322826){_0x3f6a1b[_0x8fe1('0x2a')](0x194);}return _0x322826;};}function handleError(_0x4a7d81,_0x8447cc){_0x8447cc=_0x8447cc||0x1f4;return function(_0x9382ff){logger[_0x8fe1('0x27')](_0x9382ff[_0x8fe1('0x38')]);if(_0x9382ff['name']){delete _0x9382ff['name'];}_0x4a7d81[_0x8fe1('0x2c')](_0x8447cc)[_0x8fe1('0x39')](_0x9382ff);};}exports[_0x8fe1('0x3a')]=function(_0x3ca9ca,_0x48cd57){var _0x22cfee={},_0x214deb={},_0x479add={'count':0x0,'rows':[]};var _0xaff71d=_[_0x8fe1('0x3b')](db[_0x8fe1('0x3c')][_0x8fe1('0x3d')],function(_0x33c0e1){return{'name':_0x33c0e1['fieldName'],'type':_0x33c0e1[_0x8fe1('0x3e')][_0x8fe1('0x3f')]};});_0x214deb['model']=_[_0x8fe1('0x3b')](_0xaff71d,_0x8fe1('0x40'));_0x214deb[_0x8fe1('0x41')]=_['keys'](_0x3ca9ca[_0x8fe1('0x41')]);_0x214deb[_0x8fe1('0x42')]=_[_0x8fe1('0x43')](_0x214deb[_0x8fe1('0x44')],_0x214deb['query']);_0x22cfee[_0x8fe1('0x45')]=_['intersection'](_0x214deb['model'],qs[_0x8fe1('0x46')](_0x3ca9ca[_0x8fe1('0x41')]['fields']));_0x22cfee[_0x8fe1('0x45')]=_0x22cfee[_0x8fe1('0x45')][_0x8fe1('0x47')]?_0x22cfee[_0x8fe1('0x45')]:_0x214deb[_0x8fe1('0x44')];if(!_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x48')]('nolimit')){_0x22cfee['limit']=qs['limit'](_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x2f')]);_0x22cfee[_0x8fe1('0x2d')]=qs['offset'](_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x2d')]);}_0x22cfee[_0x8fe1('0x49')]=qs['sort'](_0x3ca9ca['query']['sort']);_0x22cfee[_0x8fe1('0x4a')]=qs[_0x8fe1('0x42')](_[_0x8fe1('0x4b')](_0x3ca9ca['query'],_0x214deb[_0x8fe1('0x42')]),_0xaff71d);if(_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x4c')]){_0x22cfee[_0x8fe1('0x4a')]=_['merge'](_0x22cfee[_0x8fe1('0x4a')],{'$or':_['map'](_0xaff71d,function(_0x134028){if(_0x134028[_0x8fe1('0x3e')]!==_0x8fe1('0x4d')){var _0x128ec2={};_0x128ec2[_0x134028[_0x8fe1('0x40')]]={'$like':'%'+_0x3ca9ca['query'][_0x8fe1('0x4c')]+'%'};return _0x128ec2;}})});}_0x22cfee=_[_0x8fe1('0x4e')]({},_0x22cfee,_0x3ca9ca[_0x8fe1('0x4f')]);var _0x20d34d={'where':_0x22cfee[_0x8fe1('0x4a')]};return db['ChatMessage'][_0x8fe1('0x30')](_0x20d34d)['then'](function(_0x3bb7fb){_0x479add[_0x8fe1('0x30')]=_0x3bb7fb;if(_0x3ca9ca[_0x8fe1('0x41')]['includeAll']){_0x22cfee[_0x8fe1('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x8fe1('0x51')](_0x22cfee);})[_0x8fe1('0x22')](function(_0x385f98){_0x479add[_0x8fe1('0x52')]=_0x385f98;return _0x479add;})[_0x8fe1('0x22')](respondWithFilteredResult(_0x48cd57,_0x22cfee))[_0x8fe1('0x53')](handleError(_0x48cd57,null));};exports[_0x8fe1('0x54')]=function(_0x4d37fc,_0x16754f){var _0x2054ad={'raw':!![],'where':{'id':_0x4d37fc[_0x8fe1('0x55')]['id']}},_0x34668c={};_0x34668c[_0x8fe1('0x44')]=_['keys'](db[_0x8fe1('0x3c')]['rawAttributes']);_0x34668c['query']=_['keys'](_0x4d37fc[_0x8fe1('0x41')]);_0x34668c[_0x8fe1('0x42')]=_['intersection'](_0x34668c[_0x8fe1('0x44')],_0x34668c[_0x8fe1('0x41')]);_0x2054ad[_0x8fe1('0x45')]=_['intersection'](_0x34668c['model'],qs[_0x8fe1('0x46')](_0x4d37fc[_0x8fe1('0x41')][_0x8fe1('0x46')]));_0x2054ad[_0x8fe1('0x45')]=_0x2054ad[_0x8fe1('0x45')][_0x8fe1('0x47')]?_0x2054ad[_0x8fe1('0x45')]:_0x34668c[_0x8fe1('0x44')];if(_0x4d37fc[_0x8fe1('0x41')][_0x8fe1('0x56')]){_0x2054ad[_0x8fe1('0x50')]=[{'all':!![]}];}_0x2054ad=_[_0x8fe1('0x4e')]({},_0x2054ad,_0x4d37fc[_0x8fe1('0x4f')]);return db[_0x8fe1('0x3c')][_0x8fe1('0x57')](_0x2054ad)[_0x8fe1('0x22')](handleEntityNotFound(_0x16754f,null))[_0x8fe1('0x22')](respondWithResult(_0x16754f,null))[_0x8fe1('0x53')](handleError(_0x16754f,null));};exports[_0x8fe1('0x58')]=function(_0x7d4aac,_0x47dc58){return db[_0x8fe1('0x3c')][_0x8fe1('0x58')](_0x7d4aac[_0x8fe1('0x59')],{})[_0x8fe1('0x22')](respondWithResult(_0x47dc58,0xc9))[_0x8fe1('0x53')](handleError(_0x47dc58,null));};exports[_0x8fe1('0x5a')]=function(_0x320a84,_0x242e14){if(_0x320a84[_0x8fe1('0x59')]['id']){delete _0x320a84[_0x8fe1('0x59')]['id'];}return db[_0x8fe1('0x3c')][_0x8fe1('0x57')]({'where':{'id':_0x320a84['params']['id']}})[_0x8fe1('0x22')](handleEntityNotFound(_0x242e14,null))[_0x8fe1('0x22')](saveUpdates(_0x320a84[_0x8fe1('0x59')],null))[_0x8fe1('0x22')](respondWithResult(_0x242e14,null))['catch'](handleError(_0x242e14,null));};exports[_0x8fe1('0x37')]=function(_0x1c3d58,_0x44480){return db[_0x8fe1('0x3c')][_0x8fe1('0x57')]({'where':{'id':_0x1c3d58[_0x8fe1('0x55')]['id']}})['then'](handleEntityNotFound(_0x44480,null))[_0x8fe1('0x22')](removeEntity(_0x44480,null))['catch'](handleError(_0x44480,null));};exports[_0x8fe1('0x5b')]=function(_0x4684c2,_0x36c6d1){return db[_0x8fe1('0x3c')][_0x8fe1('0x5b')]()[_0x8fe1('0x22')](respondWithResult(_0x36c6d1,null))[_0x8fe1('0x53')](handleError(_0x36c6d1,null));};var interaction_log=require(_0x8fe1('0x14'))(_0x8fe1('0x5c'));exports[_0x8fe1('0x5d')]=function(_0x3ce5ca,_0x2ded18,_0x2eabe3){var _0x43e12f={'agent':{},'channel':_0x8fe1('0x5e')};if(_0x3ce5ca[_0x8fe1('0x59')]['id']){delete _0x3ce5ca['body']['id'];}_0x3ce5ca['body'][_0x8fe1('0x5f')]=!![];_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x60')]=moment()[_0x8fe1('0x61')](_0x8fe1('0x62'));_0x3ce5ca['body'][_0x8fe1('0x63')]=_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')]||_0x3ce5ca[_0x8fe1('0x64')]['id'];_0x43e12f['agent']['id']=_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')];return db[_0x8fe1('0x3c')]['find']({'where':{'id':_0x3ce5ca[_0x8fe1('0x55')]['id'],'UserId':null}})[_0x8fe1('0x22')](handleEntityNotFound(_0x2ded18,null))[_0x8fe1('0x22')](saveUpdates(_0x3ce5ca['body'],null))[_0x8fe1('0x22')](function(_0x352ebf){if(_0x352ebf){_0x43e12f[_0x8fe1('0x29')]=_0x352ebf[_0x8fe1('0x65')]({'plain':!![]});return db[_0x8fe1('0x66')][_0x8fe1('0x57')]({'where':{'id':_0x352ebf[_0x8fe1('0x67')]}});}return null;})[_0x8fe1('0x22')](handleEntityNotFound(_0x2ded18,null))[_0x8fe1('0x22')](function(_0xc3b6af){if(_0xc3b6af){return _0xc3b6af[_0x8fe1('0x5a')]({'UserId':_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')],'read1stAt':_[_0x8fe1('0x68')](_0xc3b6af[_0x8fe1('0x69')])?moment()[_0x8fe1('0x61')](_0x8fe1('0x62')):undefined});}return null;})[_0x8fe1('0x22')](function(_0x5946d0){if(_0x5946d0){_0x43e12f[_0x8fe1('0x6a')]=_0x5946d0[_0x8fe1('0x65')]({'plain':!![]});interaction_log['info'](_0x8fe1('0x6b'),_0x3ce5ca[_0x8fe1('0x64')]['id'],_0x3ce5ca[_0x8fe1('0x64')][_0x8fe1('0x40')],_0x3ce5ca[_0x8fe1('0x64')]['role'],_0x43e12f[_0x8fe1('0x6a')]['id'],_0x3ce5ca[_0x8fe1('0x59')]?JSON[_0x8fe1('0x6c')](_0x3ce5ca[_0x8fe1('0x59')]):_0x8fe1('0x6d'));return respondWithRpcPromise(_0x8fe1('0x6e'),_0x8fe1('0x6f'),_0x43e12f);}return null;})['then'](function(_0x226b14){var _0x45918b=_0x8fe1('0x70')+_0x226b14['message'][_0x8fe1('0x71')];return db['sequelize'][_0x8fe1('0x41')](_0x45918b,{'type':db['Sequelize'][_0x8fe1('0x72')][_0x8fe1('0x73')],'raw':!![]})[_0x8fe1('0x22')](function(_0x1f502b){return _0x1f502b;});})['then'](function(_0x1f1208){if(_0x1f1208){_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x74')]=_0x1f1208[0x0];if(!_0x3ce5ca['body']['UserId'])return;return db[_0x8fe1('0x75')][_0x8fe1('0x57')]({'where':{'id':_0x3ce5ca['body'][_0x8fe1('0x63')],'role':_0x8fe1('0x76')},'attributes':['id','name',_0x8fe1('0x77'),_0x8fe1('0x78'),_0x8fe1('0x79')],'raw':!![]});}return null;})['then'](function(_0x3f0b1d){if(!_0x3f0b1d)return null;_0x43e12f[_0x8fe1('0x29')]['agent']=_0x3f0b1d;return _0x43e12f;})[_0x8fe1('0x22')](function(_0x454b80){if(_0x454b80){if(_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x7a')]){_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x7b')]=util[_0x8fe1('0x61')](_0x8fe1('0x7c'),_0x3ce5ca[_0x8fe1('0x64')][_0x8fe1('0x40')]);_0x43e12f['message'][_0x8fe1('0x7d')]=_0x43e12f[_0x8fe1('0x7d')];_0x43e12f['message']['motionChannel']=_0x43e12f['channel'];_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x7e')]=_0x8fe1('0x5d');return respondWithRpcPromise('EventManager',_0x8fe1('0x7f'),{'event':_0x8fe1('0x80'),'message':_[_0x8fe1('0x4e')](_0x43e12f[_0x8fe1('0x29')],JSON[_0x8fe1('0x81')](_0x43e12f[_0x8fe1('0x6a')][_0x8fe1('0x82')]))},client9002)[_0x8fe1('0x22')](function(){return _0x43e12f;});}return _0x43e12f;}return null;})[_0x8fe1('0x22')](respondWithResult(_0x2ded18,null))['catch'](handleError(_0x2ded18,null));};var interaction_log=require(_0x8fe1('0x14'))(_0x8fe1('0x5c'));exports['reject']=function(_0x4190dc,_0x255f82,_0x277596){var _0x4fd80b={'agent':{},'channel':_0x8fe1('0x5e')};if(_0x4190dc['body']['id']){delete _0x4190dc['body']['id'];}_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')]=_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')]||_0x4190dc[_0x8fe1('0x64')]['id'];_0x4fd80b[_0x8fe1('0x76')]['id']=_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')];return db[_0x8fe1('0x3c')]['find']({'where':{'id':_0x4190dc['params']['id'],'UserId':null}})[_0x8fe1('0x22')](handleEntityNotFound(_0x255f82,null))[_0x8fe1('0x22')](function(_0x1aa30c){if(_0x1aa30c){_0x4fd80b[_0x8fe1('0x29')]=_0x1aa30c[_0x8fe1('0x65')]({'plain':!![]});return db[_0x8fe1('0x66')][_0x8fe1('0x57')]({'where':{'id':_0x1aa30c[_0x8fe1('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x255f82,null))[_0x8fe1('0x22')](function(_0x1b3a0d){if(_0x1b3a0d){_0x4fd80b['interaction']=_0x1b3a0d[_0x8fe1('0x65')]({'plain':!![]});interaction_log['info'](_0x8fe1('0x83'),_0x4190dc[_0x8fe1('0x64')]['id'],_0x4190dc[_0x8fe1('0x64')]['name'],_0x4190dc[_0x8fe1('0x64')][_0x8fe1('0x84')],_0x4fd80b[_0x8fe1('0x6a')]['id'],_0x4190dc[_0x8fe1('0x59')]?JSON[_0x8fe1('0x6c')](_0x4190dc['body']):_0x8fe1('0x6d'));return respondWithRpcPromise(_0x8fe1('0x85'),'rejectMessage',_0x4fd80b);}return null;})[_0x8fe1('0x22')](function(_0x3f0efe){var _0x5bd448=_0x8fe1('0x70')+_0x3f0efe['message']['ContactId'];return db[_0x8fe1('0x86')][_0x8fe1('0x41')](_0x5bd448,{'type':db[_0x8fe1('0x87')][_0x8fe1('0x72')][_0x8fe1('0x73')],'raw':!![]})[_0x8fe1('0x22')](function(_0x2f52d9){return _0x2f52d9;});})[_0x8fe1('0x22')](function(_0x1a38b7){if(_0x1a38b7){_0x4fd80b['message']['contact']=_0x1a38b7[0x0];if(!_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')])return;return db['User'][_0x8fe1('0x57')]({'where':{'id':_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')],'role':'agent'},'attributes':['id','name',_0x8fe1('0x77'),_0x8fe1('0x78'),_0x8fe1('0x79')],'raw':!![]});}return null;})['then'](function(_0xe0ed34){if(!_0xe0ed34)return null;_0x4fd80b[_0x8fe1('0x29')][_0x8fe1('0x76')]=_0xe0ed34;return _0x4fd80b;})[_0x8fe1('0x22')](function(_0x5f0d4d){if(_0x5f0d4d){_0x5f0d4d['message'][_0x8fe1('0x7b')]=util[_0x8fe1('0x61')](_0x8fe1('0x7c'),_0x4190dc['user']['name']);_0x5f0d4d[_0x8fe1('0x29')][_0x8fe1('0x7d')]=_0x4fd80b[_0x8fe1('0x7d')];_0x5f0d4d[_0x8fe1('0x29')]['motionChannel']=_0x4fd80b[_0x8fe1('0x7d')];_0x5f0d4d[_0x8fe1('0x29')][_0x8fe1('0x7e')]=_0x8fe1('0x35');respondWithRpcPromise(_0x8fe1('0x7f'),_0x8fe1('0x7f'),{'event':_0x8fe1('0x88'),'message':_[_0x8fe1('0x4e')](_0x4fd80b[_0x8fe1('0x29')],JSON['parse'](_0x4fd80b['interaction']['formData']))},client9002);return _0x4fd80b;}return null;})[_0x8fe1('0x22')](respondWithResult(_0x255f82,null))['catch'](handleError(_0x255f82,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 3194fbf..b8631f6 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 _0x7307=['hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit'];(function(_0x3ca39c,_0x263221){var _0x3aad48=function(_0x16830e){while(--_0x16830e){_0x3ca39c['push'](_0x3ca39c['shift']());}};_0x3aad48(++_0x263221);}(_0x7307,0x6a));var _0x7730=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x7307[_0xac151d];return _0x111dba;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7730('0x0'))['db'][_0x7730('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7730('0x2')](0x0);var events={'afterCreate':_0x7730('0x3'),'afterUpdate':'update','afterDestroy':_0x7730('0x4')};function emitEvent(_0x1f0e2c){return function(_0x322343,_0x2ae0ef,_0x15f130){ChatMessageEvents[_0x7730('0x5')](_0x1f0e2c+':'+_0x322343['id'],_0x322343);ChatMessageEvents[_0x7730('0x5')](_0x1f0e2c,_0x322343);_0x15f130(null);};}for(var e in events){if(events[_0x7730('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x7730('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6421=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','save'];(function(_0x1dcda7,_0x392711){var _0x5add78=function(_0x4af948){while(--_0x4af948){_0x1dcda7['push'](_0x1dcda7['shift']());}};_0x5add78(++_0x392711);}(_0x6421,0x1c8));var _0x1642=function(_0x4eefdf,_0x2604d0){_0x4eefdf=_0x4eefdf-0x0;var _0x165423=_0x6421[_0x4eefdf];return _0x165423;};'use strict';var EventEmitter=require(_0x1642('0x0'));var ChatMessage=require(_0x1642('0x1'))['db'][_0x1642('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1642('0x3'),'afterUpdate':_0x1642('0x4'),'afterDestroy':_0x1642('0x5')};function emitEvent(_0x541a95){return function(_0x34d7ee,_0x1282d3,_0x4d693c){ChatMessageEvents['emit'](_0x541a95+':'+_0x34d7ee['id'],_0x34d7ee);ChatMessageEvents[_0x1642('0x6')](_0x541a95,_0x34d7ee);_0x4d693c(null);};}for(var e in events){if(events[_0x1642('0x7')](e)){var event=events[e];ChatMessage[_0x1642('0x8')](e,emitEvent(event));}}module[_0x1642('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index ecb448c..30c29ea 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 _0x4afd=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4afd,0x1d9));var _0xd4af=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4afd[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xd4af('0x0'));var util=require('util');var logger=require(_0xd4af('0x1'))(_0xd4af('0x2'));var moment=require(_0xd4af('0x3'));var BPromise=require(_0xd4af('0x4'));var rp=require(_0xd4af('0x5'));var fs=require('fs');var path=require(_0xd4af('0x6'));var rimraf=require(_0xd4af('0x7'));var config=require(_0xd4af('0x8'));var attributes=require(_0xd4af('0x9'));module[_0xd4af('0xa')]=function(_0x76281d,_0x1dfc4e){return _0x76281d[_0xd4af('0xb')](_0xd4af('0xc'),attributes,{'tableName':_0xd4af('0xd'),'paranoid':![],'indexes':[{'name':_0xd4af('0xe'),'fields':[_0xd4af('0xf')],'type':_0xd4af('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dbe5c,_0x122aa2,_0x5d06bb){var _0x20045e=_0x76281d[_0xd4af('0x11')];var _0x35ef09=_0x5dbe5c[_0xd4af('0x12')]({'plain':!![]});if(_0x35ef09[_0xd4af('0x13')][_0xd4af('0x14')]()==='in'||_0x35ef09[_0xd4af('0x13')][_0xd4af('0x14')]()==='out'&&!_0x35ef09[_0xd4af('0x15')]&&!_[_0xd4af('0x16')](_0x35ef09[_0xd4af('0x17')])){_0x20045e[_0xd4af('0x18')]['findOne']({'where':{'id':_0x35ef09[_0xd4af('0x19')]}})[_0xd4af('0x1a')](function(_0x489326){if(_0x489326){_0x489326['update']({'lastMsgAt':_0x35ef09[_0xd4af('0x1b')],'lastMsgDirection':_0x35ef09[_0xd4af('0x13')][_0xd4af('0x14')]()});}})[_0xd4af('0x1c')](function(_0x548c37){console[_0xd4af('0x1d')](_0x548c37);});}_0x5d06bb();}},'charset':_0xd4af('0x1e'),'collate':_0xd4af('0x1f')});};
\ No newline at end of file
+var _0xff97=['chat_messages','FULLTEXT','get','toLowerCase','direction','out','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define'];(function(_0x4adead,_0x3e7eef){var _0x34cfca=function(_0x4b52ca){while(--_0x4b52ca){_0x4adead['push'](_0x4adead['shift']());}};_0x34cfca(++_0x3e7eef);}(_0xff97,0x19f));var _0x7ff9=function(_0x3e66c9,_0x22fccd){_0x3e66c9=_0x3e66c9-0x0;var _0x3c1e9b=_0xff97[_0x3e66c9];return _0x3c1e9b;};'use strict';var _=require(_0x7ff9('0x0'));var util=require(_0x7ff9('0x1'));var logger=require('../../config/logger')(_0x7ff9('0x2'));var moment=require('moment');var BPromise=require(_0x7ff9('0x3'));var rp=require(_0x7ff9('0x4'));var fs=require('fs');var path=require(_0x7ff9('0x5'));var rimraf=require(_0x7ff9('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ff9('0x7'));module[_0x7ff9('0x8')]=function(_0x23753f,_0x4229f3){return _0x23753f[_0x7ff9('0x9')]('ChatMessage',attributes,{'tableName':_0x7ff9('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x7ff9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b47c4,_0x3cf64e,_0x376e69){var _0x51a8b0=_0x23753f['models'];var _0x9c9238=_0x5b47c4[_0x7ff9('0xc')]({'plain':!![]});if(_0x9c9238['direction'][_0x7ff9('0xd')]()==='in'||_0x9c9238[_0x7ff9('0xe')]['toLowerCase']()===_0x7ff9('0xf')&&!_0x9c9238['secret']&&!_[_0x7ff9('0x10')](_0x9c9238[_0x7ff9('0x11')])){_0x51a8b0[_0x7ff9('0x12')]['findOne']({'where':{'id':_0x9c9238[_0x7ff9('0x13')]}})[_0x7ff9('0x14')](function(_0x356f16){if(_0x356f16){_0x356f16[_0x7ff9('0x15')]({'lastMsgAt':_0x9c9238[_0x7ff9('0x16')],'lastMsgDirection':_0x9c9238[_0x7ff9('0xe')]['toLowerCase']()});}})['catch'](function(_0x167dbb){console[_0x7ff9('0x17')](_0x167dbb);});}_0x376e69();}},'charset':'utf8mb4','collate':_0x7ff9('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index f5ec1b9..b784c8b 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 _0x00e1=['redis','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','ChatMessage','body','options','raw','then','CreateChatMessage','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x58970c,_0x3c4066){var _0x1528ba=function(_0x42bc77){while(--_0x42bc77){_0x58970c['push'](_0x58970c['shift']());}};_0x1528ba(++_0x3c4066);}(_0x00e1,0x151));var _0x100e=function(_0x486215,_0x331114){_0x486215=_0x486215-0x0;var _0x2fcfa4=_0x00e1[_0x486215];return _0x2fcfa4;};'use strict';var _=require('lodash');var util=require(_0x100e('0x0'));var moment=require(_0x100e('0x1'));var BPromise=require(_0x100e('0x2'));var rs=require(_0x100e('0x3'));var fs=require('fs');var Redis=require(_0x100e('0x4'));var db=require(_0x100e('0x5'))['db'];var utils=require(_0x100e('0x6'));var logger=require(_0x100e('0x7'))(_0x100e('0x8'));var config=require(_0x100e('0x9'));var jayson=require(_0x100e('0xa'));var client=jayson['client'][_0x100e('0xb')]({'port':0x232a});config['redis']=_[_0x100e('0xc')](config[_0x100e('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x100e('0xe'))(new Redis(config[_0x100e('0xd')]));require(_0x100e('0xf'))[_0x100e('0x10')](socket);function respondWithRpcPromise(_0x252350,_0x351495,_0x12b744){return new BPromise(function(_0x34d294,_0x25a30b){return client[_0x100e('0x11')](_0x252350,_0x12b744)['then'](function(_0x386b25){logger[_0x100e('0x12')](_0x100e('0x13'),_0x351495,_0x100e('0x14'));logger[_0x100e('0x15')](_0x100e('0x16'),_0x351495,_0x100e('0x14'),JSON['stringify'](_0x386b25));if(_0x386b25['error']){if(_0x386b25['error'][_0x100e('0x17')]===0x1f4){logger[_0x100e('0x18')](_0x100e('0x13'),_0x351495,_0x386b25['error'][_0x100e('0x19')]);return _0x25a30b(_0x386b25[_0x100e('0x18')][_0x100e('0x19')]);}logger[_0x100e('0x18')](_0x100e('0x13'),_0x351495,_0x386b25['error'][_0x100e('0x19')]);return _0x34d294(_0x386b25[_0x100e('0x18')][_0x100e('0x19')]);}else{logger['info'](_0x100e('0x13'),_0x351495,_0x100e('0x14'));_0x34d294(_0x386b25[_0x100e('0x1a')][_0x100e('0x19')]);}})[_0x100e('0x1b')](function(_0x421c7e){logger['error'](_0x100e('0x13'),_0x351495,_0x421c7e);_0x25a30b(_0x421c7e);});});}exports['CreateChatMessage']=function(_0x593094){var _0x4ae083=this;return new Promise(function(_0x20b5a6,_0x11f596){return db[_0x100e('0x1c')]['create'](_0x593094[_0x100e('0x1d')],{'raw':_0x593094[_0x100e('0x1e')]?_0x593094[_0x100e('0x1e')][_0x100e('0x1f')]===undefined?!![]:![]:!![]})[_0x100e('0x20')](function(_0x457b45){logger[_0x100e('0x12')](_0x100e('0x21'),_0x593094);logger['debug'](_0x100e('0x21'),_0x593094,JSON[_0x100e('0x22')](_0x457b45));_0x20b5a6(_0x457b45);})['catch'](function(_0x439ceb){logger['error'](_0x100e('0x21'),_0x439ceb['message'],_0x593094);_0x11f596(_0x4ae083[_0x100e('0x18')](0x1f4,_0x439ceb[_0x100e('0x19')]));});});};
\ No newline at end of file
+var _0x4d21=['info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','result','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request'];(function(_0x4703b5,_0x5c668d){var _0x37ff03=function(_0x3d08ce){while(--_0x3d08ce){_0x4703b5['push'](_0x4703b5['shift']());}};_0x37ff03(++_0x5c668d);}(_0x4d21,0xc3));var _0x14d2=function(_0x5a95b4,_0x1f919a){_0x5a95b4=_0x5a95b4-0x0;var _0xaf224d=_0x4d21[_0x5a95b4];return _0xaf224d;};'use strict';var _=require(_0x14d2('0x0'));var util=require(_0x14d2('0x1'));var moment=require(_0x14d2('0x2'));var BPromise=require(_0x14d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d2('0x4'));var db=require(_0x14d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x14d2('0x6'));var config=require(_0x14d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14d2('0x8')][_0x14d2('0x9')]({'port':0x232a});config[_0x14d2('0xa')]=_[_0x14d2('0xb')](config[_0x14d2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x14d2('0xc'))(new Redis(config['redis']));require(_0x14d2('0xd'))['register'](socket);function respondWithRpcPromise(_0x3bb3aa,_0x4fd37b,_0x50826c){return new BPromise(function(_0x26a1cf,_0x30b541){return client[_0x14d2('0xe')](_0x3bb3aa,_0x50826c)['then'](function(_0x148265){logger[_0x14d2('0xf')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x14d2('0x10'));logger[_0x14d2('0x11')](_0x14d2('0x12'),_0x4fd37b,_0x14d2('0x10'),JSON[_0x14d2('0x13')](_0x148265));if(_0x148265['error']){if(_0x148265[_0x14d2('0x14')]['code']===0x1f4){logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x148265[_0x14d2('0x14')][_0x14d2('0x15')]);return _0x30b541(_0x148265['error'][_0x14d2('0x15')]);}logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x148265[_0x14d2('0x14')][_0x14d2('0x15')]);return _0x26a1cf(_0x148265['error'][_0x14d2('0x15')]);}else{logger['info'](_0x14d2('0x16'),_0x4fd37b,_0x14d2('0x10'));_0x26a1cf(_0x148265[_0x14d2('0x17')][_0x14d2('0x15')]);}})['catch'](function(_0x2214a5){logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x2214a5);_0x30b541(_0x2214a5);});});}exports[_0x14d2('0x18')]=function(_0x39f10d){var _0x32350e=this;return new Promise(function(_0x47e68e,_0x1c1b88){return db[_0x14d2('0x19')][_0x14d2('0x1a')](_0x39f10d[_0x14d2('0x1b')],{'raw':_0x39f10d[_0x14d2('0x1c')]?_0x39f10d[_0x14d2('0x1c')][_0x14d2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3a4ad3){logger[_0x14d2('0xf')](_0x14d2('0x18'),_0x39f10d);logger[_0x14d2('0x11')](_0x14d2('0x18'),_0x39f10d,JSON[_0x14d2('0x13')](_0x3a4ad3));_0x47e68e(_0x3a4ad3);})['catch'](function(_0x360f86){logger[_0x14d2('0x14')]('CreateChatMessage',_0x360f86[_0x14d2('0x15')],_0x39f10d);_0x1c1b88(_0x32350e[_0x14d2('0x14')](0x1f4,_0x360f86['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 26d255a..c16cd00 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 _0xa93e=['update','emit','removeListener','register','length','remove'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa93e,0x1df));var _0xea93=function(_0x270489,_0x145ce2){_0x270489=_0x270489-0x0;var _0x194d28=_0xa93e[_0x270489];return _0x194d28;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xea93('0x0'),_0xea93('0x1')];function createListener(_0x47d9db,_0xd64380){return function(_0x50af65){_0xd64380[_0xea93('0x2')](_0x47d9db,_0x50af65);};}function removeListener(_0x5b5341,_0x5398ba){return function(){ChatMessageEvents[_0xea93('0x3')](_0x5b5341,_0x5398ba);};}exports[_0xea93('0x4')]=function(_0x6c6985){for(var _0x26def3=0x0,_0x477a7d=events[_0xea93('0x5')];_0x26def3<_0x477a7d;_0x26def3++){var _0x54ebdf=events[_0x26def3];var _0x12876e=createListener('chatMessage:'+_0x54ebdf,_0x6c6985);ChatMessageEvents['on'](_0x54ebdf,_0x12876e);}};
\ No newline at end of file
+var _0x99c9=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x3dc763,_0x18c359){var _0x1338f8=function(_0x32f76d){while(--_0x32f76d){_0x3dc763['push'](_0x3dc763['shift']());}};_0x1338f8(++_0x18c359);}(_0x99c9,0x13c));var _0x999c=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x99c9[_0x565ed7];return _0x183ad7;};'use strict';var ChatMessageEvents=require(_0x999c('0x0'));var events=[_0x999c('0x1'),_0x999c('0x2'),_0x999c('0x3')];function createListener(_0x2bb83d,_0x16a7a3){return function(_0x31e9b1){_0x16a7a3['emit'](_0x2bb83d,_0x31e9b1);};}function removeListener(_0x2a4e06,_0x140cd5){return function(){ChatMessageEvents[_0x999c('0x4')](_0x2a4e06,_0x140cd5);};}exports[_0x999c('0x5')]=function(_0x2bdd73){for(var _0x14df32=0x0,_0x34f100=events[_0x999c('0x6')];_0x14df32<_0x34f100;_0x14df32++){var _0xc8a6b5=events[_0x14df32];var _0xb88ec1=createListener(_0x999c('0x7')+_0xc8a6b5,_0x2bdd73);ChatMessageEvents['on'](_0xc8a6b5,_0xb88ec1);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 4c77635..eed6d76 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 _0x6e73=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','/:id','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','delete','multer','util','path','connect-timeout'];(function(_0x417160,_0x54ee37){var _0x270ad1=function(_0x4bd83e){while(--_0x4bd83e){_0x417160['push'](_0x417160['shift']());}};_0x270ad1(++_0x54ee37);}(_0x6e73,0x8c));var _0x36e7=function(_0x2abd11,_0x4e9bd0){_0x2abd11=_0x2abd11-0x0;var _0x192095=_0x6e73[_0x2abd11];return _0x192095;};'use strict';var multer=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var path=require(_0x36e7('0x2'));var timeout=require(_0x36e7('0x3'));var express=require(_0x36e7('0x4'));var router=express[_0x36e7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x36e7('0x6'));var interaction=require(_0x36e7('0x7'));var config=require(_0x36e7('0x8'));var controller=require(_0x36e7('0x9'));router['get']('/',auth[_0x36e7('0xa')](),controller[_0x36e7('0xb')]);router['get'](_0x36e7('0xc'),auth[_0x36e7('0xa')](),controller['describe']);router['get'](_0x36e7('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x36e7('0xe')]('/',auth[_0x36e7('0xa')](),interaction[_0x36e7('0xf')](_0x36e7('0x10'),_0x36e7('0x11')),controller['create']);router[_0x36e7('0x12')](_0x36e7('0xd'),controller[_0x36e7('0x13')]);router[_0x36e7('0x12')](_0x36e7('0x14'),auth[_0x36e7('0xa')](),controller[_0x36e7('0x15')]);router[_0x36e7('0x12')](_0x36e7('0x16'),auth[_0x36e7('0xa')](),controller['reject']);router[_0x36e7('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x50b6=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','chatmessage:create','create','put','/:id/accept','/:id/reject'];(function(_0x21fc17,_0x1496c5){var _0x4bd46e=function(_0x3d76c8){while(--_0x3d76c8){_0x21fc17['push'](_0x21fc17['shift']());}};_0x4bd46e(++_0x1496c5);}(_0x50b6,0x18f));var _0x650b=function(_0x24d03d,_0x3f7e3e){_0x24d03d=_0x24d03d-0x0;var _0x20af54=_0x50b6[_0x24d03d];return _0x20af54;};'use strict';var multer=require(_0x650b('0x0'));var util=require(_0x650b('0x1'));var path=require(_0x650b('0x2'));var timeout=require('connect-timeout');var express=require(_0x650b('0x3'));var router=express[_0x650b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x650b('0x5'));var interaction=require(_0x650b('0x6'));var config=require(_0x650b('0x7'));var controller=require('./chatMessage.controller');router[_0x650b('0x8')]('/',auth[_0x650b('0x9')](),controller[_0x650b('0xa')]);router[_0x650b('0x8')](_0x650b('0xb'),auth[_0x650b('0x9')](),controller['describe']);router[_0x650b('0x8')](_0x650b('0xc'),auth[_0x650b('0x9')](),controller[_0x650b('0xd')]);router['post']('/',auth[_0x650b('0x9')](),interaction['tracked']('chat',_0x650b('0xe')),controller[_0x650b('0xf')]);router[_0x650b('0x10')]('/:id',controller['update']);router['put'](_0x650b('0x11'),auth['isAuthenticated'](),controller['accept']);router[_0x650b('0x10')](_0x650b('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0x650b('0x13')](_0x650b('0xc'),auth[_0x650b('0x9')](),controller[_0x650b('0x14')]);module[_0x650b('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 377bb27..1221dc0 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 _0xcb60=['TEXT','medium','sequelize','exports'];(function(_0xafe04f,_0x26de9c){var _0x3fc6ab=function(_0x240145){while(--_0x240145){_0xafe04f['push'](_0xafe04f['shift']());}};_0x3fc6ab(++_0x26de9c);}(_0xcb60,0x16e));var _0x0cb6=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xcb60[_0x1ae4a9];return _0x54d0b0;};'use strict';var Sequelize=require(_0x0cb6('0x0'));module[_0x0cb6('0x1')]={'body':{'type':Sequelize[_0x0cb6('0x2')](_0x0cb6('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x1ea6=['medium','exports','TEXT'];(function(_0x29a2ce,_0x5d6558){var _0x2fa9ea=function(_0x526d35){while(--_0x526d35){_0x29a2ce['push'](_0x29a2ce['shift']());}};_0x2fa9ea(++_0x5d6558);}(_0x1ea6,0x6d));var _0x61ea=function(_0x14487f,_0x2ce4cb){_0x14487f=_0x14487f-0x0;var _0x1aee0b=_0x1ea6[_0x14487f];return _0x1aee0b;};'use strict';var Sequelize=require('sequelize');module[_0x61ea('0x0')]={'body':{'type':Sequelize[_0x61ea('0x1')](_0x61ea('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index d53e3b0..33a926c 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(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x7a54,0x106));var _0x47a5=function(_0x3533fe,_0x1767e3){_0x3533fe=_0x3533fe-0x0;var _0x87bc86=_0x7a54[_0x3533fe];return _0x87bc86;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7a54,0x106));var _0x47a5=function(_0x241045,_0x40b4a1){_0x241045=_0x241045-0x0;var _0x24eb4a=_0x7a54[_0x241045];return _0x24eb4a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 863a5e0..4cd7999 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 _0xce93=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xce93,0x15f));var _0x3ce9=function(_0x31b137,_0xa54c07){_0x31b137=_0x31b137-0x0;var _0x35a4f8=_0xce93[_0x31b137];return _0x35a4f8;};'use strict';var _=require(_0x3ce9('0x0'));var util=require(_0x3ce9('0x1'));var logger=require('../../config/logger')(_0x3ce9('0x2'));var moment=require(_0x3ce9('0x3'));var BPromise=require(_0x3ce9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ce9('0x5'));var rimraf=require(_0x3ce9('0x6'));var config=require(_0x3ce9('0x7'));var attributes=require(_0x3ce9('0x8'));module[_0x3ce9('0x9')]=function(_0x424920,_0x676d9c){return _0x424920[_0x3ce9('0xa')](_0x3ce9('0xb'),attributes,{'tableName':_0x3ce9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3ce9('0xd'),'collate':_0x3ce9('0xe')});};
\ No newline at end of file
+var _0xa902=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x26b006,_0x5f25a2){var _0x4b7c04=function(_0x521781){while(--_0x521781){_0x26b006['push'](_0x26b006['shift']());}};_0x4b7c04(++_0x5f25a2);}(_0xa902,0x85));var _0x2a90=function(_0xc12ef6,_0x3f3852){_0xc12ef6=_0xc12ef6-0x0;var _0x242bd0=_0xa902[_0xc12ef6];return _0x242bd0;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var logger=require(_0x2a90('0x2'))('api');var moment=require(_0x2a90('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a90('0x4'));var fs=require('fs');var path=require(_0x2a90('0x5'));var rimraf=require(_0x2a90('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a90('0x7'));module[_0x2a90('0x8')]=function(_0x5a1a83,_0x16e85b){return _0x5a1a83[_0x2a90('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0x2a90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2a90('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index d9edc02..c8aedd3 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 _0x0cc8=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x0cc8,0xcb));var _0x80cc=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x0cc8[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require(_0x80cc('0x0'));var util=require('util');var moment=require(_0x80cc('0x1'));var BPromise=require(_0x80cc('0x2'));var rs=require(_0x80cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x80cc('0x4'));var logger=require('../../config/logger')(_0x80cc('0x5'));var config=require('../../config/environment');var jayson=require(_0x80cc('0x6'));var client=jayson[_0x80cc('0x7')][_0x80cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x487346,_0x21415d,_0x10a0b8){return new BPromise(function(_0x1de064,_0x19087a){return client[_0x80cc('0x9')](_0x487346,_0x10a0b8)[_0x80cc('0xa')](function(_0x443f15){logger[_0x80cc('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x21415d,_0x80cc('0xc'));logger[_0x80cc('0xd')](_0x80cc('0xe'),_0x21415d,_0x80cc('0xc'),JSON['stringify'](_0x443f15));if(_0x443f15[_0x80cc('0xf')]){if(_0x443f15[_0x80cc('0xf')]['code']===0x1f4){logger[_0x80cc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x21415d,_0x443f15[_0x80cc('0xf')]['message']);return _0x19087a(_0x443f15[_0x80cc('0xf')][_0x80cc('0x10')]);}logger[_0x80cc('0xf')](_0x80cc('0x11'),_0x21415d,_0x443f15['error'][_0x80cc('0x10')]);return _0x1de064(_0x443f15['error'][_0x80cc('0x10')]);}else{logger['info'](_0x80cc('0x11'),_0x21415d,_0x80cc('0xc'));_0x1de064(_0x443f15[_0x80cc('0x12')]['message']);}})['catch'](function(_0x49e90d){logger['error'](_0x80cc('0x11'),_0x21415d,_0x49e90d);_0x19087a(_0x49e90d);});});}
\ No newline at end of file
+var _0xa34e=['ioredis','../../config/environment','jayson/promise','client','http','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0xa34e,0x19e));var _0xea34=function(_0x3af270,_0x5675b4){_0x3af270=_0x3af270-0x0;var _0x1dc18a=_0xa34e[_0x3af270];return _0x1dc18a;};'use strict';var _=require(_0xea34('0x0'));var util=require(_0xea34('0x1'));var moment=require('moment');var BPromise=require(_0xea34('0x2'));var rs=require(_0xea34('0x3'));var fs=require('fs');var Redis=require(_0xea34('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xea34('0x5'));var jayson=require(_0xea34('0x6'));var client=jayson[_0xea34('0x7')][_0xea34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34ee77,_0x3e10af,_0xdcdb59){return new BPromise(function(_0x54d3ee,_0x1d0e1a){return client['request'](_0x34ee77,_0xdcdb59)[_0xea34('0x9')](function(_0x415328){logger[_0xea34('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3e10af,'request\x20sent');logger[_0xea34('0xb')](_0xea34('0xc'),_0x3e10af,_0xea34('0xd'),JSON[_0xea34('0xe')](_0x415328));if(_0x415328['error']){if(_0x415328[_0xea34('0xf')]['code']===0x1f4){logger['error'](_0xea34('0x10'),_0x3e10af,_0x415328[_0xea34('0xf')][_0xea34('0x11')]);return _0x1d0e1a(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}logger[_0xea34('0xf')](_0xea34('0x10'),_0x3e10af,_0x415328['error'][_0xea34('0x11')]);return _0x54d3ee(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}else{logger['info'](_0xea34('0x10'),_0x3e10af,_0xea34('0xd'));_0x54d3ee(_0x415328['result'][_0xea34('0x11')]);}})[_0xea34('0x12')](function(_0x2b1380){logger['error'](_0xea34('0x10'),_0x3e10af,_0x2b1380);_0x1d0e1a(_0x2b1380);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 0ab1fd7..ebdd5e6 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 _0x778a=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x778a,0xdc));var _0xa778=function(_0x104993,_0x3f9a6b){_0x104993=_0x104993-0x0;var _0x105a96=_0x778a[_0x104993];return _0x105a96;};'use strict';var multer=require(_0xa778('0x0'));var util=require(_0xa778('0x1'));var path=require('path');var timeout=require(_0xa778('0x2'));var express=require(_0xa778('0x3'));var router=express[_0xa778('0x4')]();var fs_extra=require(_0xa778('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa778('0x6'));var config=require(_0xa778('0x7'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa778('0x8')]);router[_0xa778('0x9')]('/describe',auth[_0xa778('0xa')](),controller[_0xa778('0xb')]);router['get'](_0xa778('0xc'),auth[_0xa778('0xa')](),controller[_0xa778('0xd')]);router[_0xa778('0xe')]('/',auth[_0xa778('0xa')](),controller[_0xa778('0xf')]);router[_0xa778('0x10')]('/:id',auth[_0xa778('0xa')](),controller[_0xa778('0x11')]);router['delete'](_0xa778('0xc'),auth[_0xa778('0xa')](),controller[_0xa778('0x12')]);module[_0xa778('0x13')]=router;
\ No newline at end of file
+var _0x06f1=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x06f1,0x77));var _0x106f=function(_0x5c0e7d,_0x5827a1){_0x5c0e7d=_0x5c0e7d-0x0;var _0x47775e=_0x06f1[_0x5c0e7d];return _0x47775e;};'use strict';var multer=require(_0x106f('0x0'));var util=require(_0x106f('0x1'));var path=require(_0x106f('0x2'));var timeout=require('connect-timeout');var express=require(_0x106f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x106f('0x4'));var interaction=require(_0x106f('0x5'));var config=require(_0x106f('0x6'));var controller=require(_0x106f('0x7'));router[_0x106f('0x8')]('/',auth[_0x106f('0x9')](),controller[_0x106f('0xa')]);router[_0x106f('0x8')](_0x106f('0xb'),auth[_0x106f('0x9')](),controller[_0x106f('0xc')]);router['get'](_0x106f('0xd'),auth[_0x106f('0x9')](),controller['show']);router[_0x106f('0xe')]('/',auth[_0x106f('0x9')](),controller[_0x106f('0xf')]);router[_0x106f('0x10')](_0x106f('0xd'),auth[_0x106f('0x9')](),controller[_0x106f('0x11')]);router[_0x106f('0x12')](_0x106f('0xd'),auth[_0x106f('0x9')](),controller[_0x106f('0x13')]);module[_0x106f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 3cc37eb..eef8638 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 _0xaa37=['INTEGER','sequelize','STRING','ENUM','mouseOver'];(function(_0x3f6beb,_0x5090d7){var _0xd758bf=function(_0x17ffec){while(--_0x17ffec){_0x3f6beb['push'](_0x3f6beb['shift']());}};_0xd758bf(++_0x5090d7);}(_0xaa37,0xc9));var _0x7aa3=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xaa37[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x7aa3('0x0'));module['exports']={'name':{'type':Sequelize[_0x7aa3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7aa3('0x2')](_0x7aa3('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7aa3('0x1')]},'timeout':{'type':Sequelize[_0x7aa3('0x4')]}};
\ No newline at end of file
+var _0x6480=['exports','STRING','ENUM','timeout','INTEGER','sequelize'];(function(_0x12fa03,_0x1bfe2b){var _0x4d7545=function(_0x234921){while(--_0x234921){_0x12fa03['push'](_0x12fa03['shift']());}};_0x4d7545(++_0x1bfe2b);}(_0x6480,0x12b));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0648('0x0'));module[_0x0648('0x1')]={'name':{'type':Sequelize[_0x0648('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0648('0x3')]('mouseOver',_0x0648('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0648('0x2')]},'timeout':{'type':Sequelize[_0x0648('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 02f6e8b..0f20f93 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 _0x6e12=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','stack','name','show','ChatProactiveAction','rawAttributes','query','keys','intersection','model','attributes','fields','length','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox'];(function(_0x7e5cfe,_0x5809e1){var _0x2624c4=function(_0x43194a){while(--_0x43194a){_0x7e5cfe['push'](_0x7e5cfe['shift']());}};_0x2624c4(++_0x5809e1);}(_0x6e12,0x154));var _0x26e1=function(_0x27e8c4,_0x1321e4){_0x27e8c4=_0x27e8c4-0x0;var _0x1673e2=_0x6e12[_0x27e8c4];return _0x1673e2;};'use strict';var emlformat=require(_0x26e1('0x0'));var rimraf=require(_0x26e1('0x1'));var zipdir=require(_0x26e1('0x2'));var jsonpatch=require(_0x26e1('0x3'));var rp=require('request-promise');var moment=require(_0x26e1('0x4'));var BPromise=require(_0x26e1('0x5'));var Mustache=require(_0x26e1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x26e1('0x7'));var csv=require(_0x26e1('0x8'));var ejs=require(_0x26e1('0x9'));var fs=require('fs');var fs_extra=require(_0x26e1('0xa'));var _=require(_0x26e1('0xb'));var squel=require('squel');var crypto=require(_0x26e1('0xc'));var jsforce=require(_0x26e1('0xd'));var deskjs=require(_0x26e1('0xe'));var toCsv=require(_0x26e1('0x8'));var querystring=require(_0x26e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x26e1('0x10'));var authService=require(_0x26e1('0x11'));var qs=require(_0x26e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e1('0x13'));var logger=require(_0x26e1('0x14'))(_0x26e1('0x15'));var utils=require(_0x26e1('0x16'));var config=require(_0x26e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x26e1('0x18'))['db'];function respondWithStatusCode(_0x21ff26,_0x124c88){_0x124c88=_0x124c88||0xcc;return function(_0x4a85d3){if(_0x4a85d3){return _0x21ff26[_0x26e1('0x19')](_0x124c88);}return _0x21ff26[_0x26e1('0x1a')](_0x124c88)[_0x26e1('0x1b')]();};}function respondWithResult(_0x46a37b,_0x4ef6fe){_0x4ef6fe=_0x4ef6fe||0xc8;return function(_0x532aee){if(_0x532aee){return _0x46a37b[_0x26e1('0x1a')](_0x4ef6fe)[_0x26e1('0x1c')](_0x532aee);}};}function respondWithFilteredResult(_0x2bbe71,_0x1f845f){return function(_0x438eca){if(_0x438eca){var _0x5edd81=typeof _0x1f845f[_0x26e1('0x1d')]===_0x26e1('0x1e')&&typeof _0x1f845f['limit']===_0x26e1('0x1e');var _0x1043e1=_0x438eca[_0x26e1('0x1f')];var _0x1bb967=_0x5edd81?0x0:_0x1f845f[_0x26e1('0x1d')];var _0xf7a3c5=_0x5edd81?_0x438eca[_0x26e1('0x1f')]:_0x1f845f['offset']+_0x1f845f['limit'];var _0x2b5c48;if(_0xf7a3c5>=_0x1043e1){_0xf7a3c5=_0x1043e1;_0x2b5c48=0xc8;}else{_0x2b5c48=0xce;}_0x2bbe71[_0x26e1('0x1a')](_0x2b5c48);return _0x2bbe71[_0x26e1('0x20')]('Content-Range',_0x1bb967+'-'+_0xf7a3c5+'/'+_0x1043e1)[_0x26e1('0x1c')](_0x438eca);}return null;};}function patchUpdates(_0x53886f){return function(_0x46feb5){try{jsonpatch['apply'](_0x46feb5,_0x53886f,!![]);}catch(_0x2612e9){return BPromise[_0x26e1('0x21')](_0x2612e9);}return _0x46feb5[_0x26e1('0x22')]();};}function saveUpdates(_0x5dc73e,_0x248a21){return function(_0x36e971){if(_0x36e971){return _0x36e971[_0x26e1('0x23')](_0x5dc73e)[_0x26e1('0x24')](function(_0x371324){return _0x371324;});}return null;};}function removeEntity(_0x6f0034,_0x51b5bf){return function(_0x22598f){if(_0x22598f){return _0x22598f[_0x26e1('0x25')]()['then'](function(){_0x6f0034[_0x26e1('0x1a')](0xcc)[_0x26e1('0x1b')]();});}};}function handleEntityNotFound(_0x21ed95,_0x287379){return function(_0xac95a4){if(!_0xac95a4){_0x21ed95[_0x26e1('0x19')](0x194);}return _0xac95a4;};}function handleError(_0x112285,_0x5973c1){_0x5973c1=_0x5973c1||0x1f4;return function(_0x5f31fa){logger['error'](_0x5f31fa[_0x26e1('0x26')]);if(_0x5f31fa[_0x26e1('0x27')]){delete _0x5f31fa[_0x26e1('0x27')];}_0x112285['status'](_0x5973c1)['send'](_0x5f31fa);};}exports[_0x26e1('0x28')]=function(_0xeed638,_0x385698){var _0x2abff3={'raw':!![],'where':{'id':_0xeed638['params']['id']}},_0x2e4c78={};_0x2e4c78['model']=_['keys'](db[_0x26e1('0x29')][_0x26e1('0x2a')]);_0x2e4c78[_0x26e1('0x2b')]=_[_0x26e1('0x2c')](_0xeed638['query']);_0x2e4c78['filters']=_[_0x26e1('0x2d')](_0x2e4c78[_0x26e1('0x2e')],_0x2e4c78[_0x26e1('0x2b')]);_0x2abff3[_0x26e1('0x2f')]=_[_0x26e1('0x2d')](_0x2e4c78[_0x26e1('0x2e')],qs[_0x26e1('0x30')](_0xeed638['query'][_0x26e1('0x30')]));_0x2abff3[_0x26e1('0x2f')]=_0x2abff3['attributes'][_0x26e1('0x31')]?_0x2abff3[_0x26e1('0x2f')]:_0x2e4c78[_0x26e1('0x2e')];if(_0xeed638['query']['includeAll']){_0x2abff3[_0x26e1('0x32')]=[{'all':!![]}];}_0x2abff3=_[_0x26e1('0x33')]({},_0x2abff3,_0xeed638[_0x26e1('0x34')]);return db['ChatProactiveAction'][_0x26e1('0x35')](_0x2abff3)[_0x26e1('0x24')](handleEntityNotFound(_0x385698,null))[_0x26e1('0x24')](respondWithResult(_0x385698,null))[_0x26e1('0x36')](handleError(_0x385698,null));};exports[_0x26e1('0x37')]=function(_0xe8cbc6,_0x3d8a7){return db[_0x26e1('0x29')][_0x26e1('0x37')](_0xe8cbc6[_0x26e1('0x38')],{})[_0x26e1('0x24')](respondWithResult(_0x3d8a7,0xc9))['catch'](handleError(_0x3d8a7,null));};exports[_0x26e1('0x23')]=function(_0x39584a,_0x254ab2){if(_0x39584a['body']['id']){delete _0x39584a[_0x26e1('0x38')]['id'];}return db['ChatProactiveAction'][_0x26e1('0x35')]({'where':{'id':_0x39584a[_0x26e1('0x39')]['id']}})[_0x26e1('0x24')](handleEntityNotFound(_0x254ab2,null))[_0x26e1('0x24')](saveUpdates(_0x39584a[_0x26e1('0x38')],null))['then'](respondWithResult(_0x254ab2,null))[_0x26e1('0x36')](handleError(_0x254ab2,null));};exports['destroy']=function(_0x36ff0e,_0x5565d3){return db[_0x26e1('0x29')][_0x26e1('0x35')]({'where':{'id':_0x36ff0e[_0x26e1('0x39')]['id']}})[_0x26e1('0x24')](handleEntityNotFound(_0x5565d3,null))[_0x26e1('0x24')](removeEntity(_0x5565d3,null))[_0x26e1('0x36')](handleError(_0x5565d3,null));};
\ No newline at end of file
+var _0xbcc7=['find','create','body','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','keys','ChatProactiveAction','filters','intersection','model','query','fields','attributes','length','includeAll','include','merge','options'];(function(_0x1912cd,_0x1746bf){var _0x3c9336=function(_0x157695){while(--_0x157695){_0x1912cd['push'](_0x1912cd['shift']());}};_0x3c9336(++_0x1746bf);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x5ea210,_0x246fbc){_0x5ea210=_0x5ea210-0x0;var _0x31f084=_0xbcc7[_0x5ea210];return _0x31f084;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)[_0x7bcc('0x18')]();});}};}function handleEntityNotFound(_0x1d085c,_0x4f8562){return function(_0x48b296){if(!_0x48b296){_0x1d085c[_0x7bcc('0x16')](0x194);}return _0x48b296;};}function handleError(_0x4a91d0,_0x4db3c0){_0x4db3c0=_0x4db3c0||0x1f4;return function(_0xd3ca3b){logger['error'](_0xd3ca3b[_0x7bcc('0x24')]);if(_0xd3ca3b[_0x7bcc('0x25')]){delete _0xd3ca3b[_0x7bcc('0x25')];}_0x4a91d0['status'](_0x4db3c0)[_0x7bcc('0x26')](_0xd3ca3b);};}exports[_0x7bcc('0x27')]=function(_0x2e92e1,_0x319943){var _0x20c458={'raw':!![],'where':{'id':_0x2e92e1[_0x7bcc('0x28')]['id']}},_0x1ecf95={};_0x1ecf95['model']=_[_0x7bcc('0x29')](db[_0x7bcc('0x2a')]['rawAttributes']);_0x1ecf95['query']=_[_0x7bcc('0x29')](_0x2e92e1['query']);_0x1ecf95[_0x7bcc('0x2b')]=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],_0x1ecf95[_0x7bcc('0x2e')]);_0x20c458['attributes']=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],qs[_0x7bcc('0x2f')](_0x2e92e1['query'][_0x7bcc('0x2f')]));_0x20c458[_0x7bcc('0x30')]=_0x20c458[_0x7bcc('0x30')][_0x7bcc('0x31')]?_0x20c458[_0x7bcc('0x30')]:_0x1ecf95[_0x7bcc('0x2d')];if(_0x2e92e1[_0x7bcc('0x2e')][_0x7bcc('0x32')]){_0x20c458[_0x7bcc('0x33')]=[{'all':!![]}];}_0x20c458=_[_0x7bcc('0x34')]({},_0x20c458,_0x2e92e1[_0x7bcc('0x35')]);return db['ChatProactiveAction'][_0x7bcc('0x36')](_0x20c458)[_0x7bcc('0x22')](handleEntityNotFound(_0x319943,null))[_0x7bcc('0x22')](respondWithResult(_0x319943,null))['catch'](handleError(_0x319943,null));};exports['create']=function(_0x409ff4,_0x1ef50b){return db[_0x7bcc('0x2a')][_0x7bcc('0x37')](_0x409ff4[_0x7bcc('0x38')],{})[_0x7bcc('0x22')](respondWithResult(_0x1ef50b,0xc9))[_0x7bcc('0x39')](handleError(_0x1ef50b,null));};exports['update']=function(_0x5bbb4b,_0x5584f6){if(_0x5bbb4b['body']['id']){delete _0x5bbb4b[_0x7bcc('0x38')]['id'];}return db[_0x7bcc('0x2a')][_0x7bcc('0x36')]({'where':{'id':_0x5bbb4b['params']['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5584f6,null))[_0x7bcc('0x22')](saveUpdates(_0x5bbb4b[_0x7bcc('0x38')],null))['then'](respondWithResult(_0x5584f6,null))['catch'](handleError(_0x5584f6,null));};exports[_0x7bcc('0x23')]=function(_0xca6ce3,_0x1d9c06){return db['ChatProactiveAction']['find']({'where':{'id':_0xca6ce3[_0x7bcc('0x28')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x1d9c06,null))[_0x7bcc('0x22')](removeEntity(_0x1d9c06,null))['catch'](handleError(_0x1d9c06,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 073a2ae..4ebf8c7 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 _0xde2a=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x2fcbf7,_0x2850c8){var _0x15c90f=function(_0x3694dd){while(--_0x3694dd){_0x2fcbf7['push'](_0x2fcbf7['shift']());}};_0x15c90f(++_0x2850c8);}(_0xde2a,0x18c));var _0xade2=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0xde2a[_0x374ada];return _0x449ed8;};'use strict';var _=require(_0xade2('0x0'));var util=require('util');var logger=require(_0xade2('0x1'))(_0xade2('0x2'));var moment=require('moment');var BPromise=require(_0xade2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xade2('0x4'));var rimraf=require(_0xade2('0x5'));var config=require(_0xade2('0x6'));var attributes=require(_0xade2('0x7'));module[_0xade2('0x8')]=function(_0x3a2b51,_0x3fa2ce){return _0x3a2b51[_0xade2('0x9')](_0xade2('0xa'),attributes,{'tableName':_0xade2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdae7=['define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xdae7,0x1f0));var _0x7dae=function(_0xe0c564,_0x2ff569){_0xe0c564=_0xe0c564-0x0;var _0x32e0f6=_0xdae7[_0xe0c564];return _0x32e0f6;};'use strict';var _=require(_0x7dae('0x0'));var util=require(_0x7dae('0x1'));var logger=require(_0x7dae('0x2'))(_0x7dae('0x3'));var moment=require(_0x7dae('0x4'));var BPromise=require(_0x7dae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7dae('0x6'));var rimraf=require(_0x7dae('0x7'));var config=require(_0x7dae('0x8'));var attributes=require(_0x7dae('0x9'));module[_0x7dae('0xa')]=function(_0x36462c,_0x75a8fb){return _0x36462c[_0x7dae('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x7dae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 83f0b4e..8fbdc46 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 _0xd19e=['message','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x6cf5af,_0x44dc8c){var _0x465f3a=function(_0x25146e){while(--_0x25146e){_0x6cf5af['push'](_0x6cf5af['shift']());}};_0x465f3a(++_0x44dc8c);}(_0xd19e,0xf9));var _0xed19=function(_0x4ccffd,_0xd9c2d7){_0x4ccffd=_0x4ccffd-0x0;var _0xb9e766=_0xd19e[_0x4ccffd];return _0xb9e766;};'use strict';var _=require('lodash');var util=require(_0xed19('0x0'));var moment=require('moment');var BPromise=require(_0xed19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed19('0x2'))['db'];var utils=require(_0xed19('0x3'));var logger=require('../../config/logger')(_0xed19('0x4'));var config=require(_0xed19('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xed19('0x6')][_0xed19('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x423851,_0x2bbc9b,_0x1daec0){return new BPromise(function(_0x34950b,_0x3e8e66){return client[_0xed19('0x8')](_0x423851,_0x1daec0)[_0xed19('0x9')](function(_0x4fbef4){logger[_0xed19('0xa')](_0xed19('0xb'),_0x2bbc9b,_0xed19('0xc'));logger[_0xed19('0xd')](_0xed19('0xe'),_0x2bbc9b,_0xed19('0xc'),JSON['stringify'](_0x4fbef4));if(_0x4fbef4['error']){if(_0x4fbef4['error'][_0xed19('0xf')]===0x1f4){logger[_0xed19('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bbc9b,_0x4fbef4[_0xed19('0x10')]['message']);return _0x3e8e66(_0x4fbef4[_0xed19('0x10')]['message']);}logger['error'](_0xed19('0xb'),_0x2bbc9b,_0x4fbef4[_0xed19('0x10')][_0xed19('0x11')]);return _0x34950b(_0x4fbef4[_0xed19('0x10')][_0xed19('0x11')]);}else{logger[_0xed19('0xa')](_0xed19('0xb'),_0x2bbc9b,'request\x20sent');_0x34950b(_0x4fbef4['result'][_0xed19('0x11')]);}})[_0xed19('0x12')](function(_0x22e964){logger['error'](_0xed19('0xb'),_0x2bbc9b,_0x22e964);_0x3e8e66(_0x22e964);});});}
\ No newline at end of file
+var _0xb21b=['client','request','then','info','request\x20sent','debug','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1470b4,_0x660ead){var _0x14dd3f=function(_0x45324a){while(--_0x45324a){_0x1470b4['push'](_0x1470b4['shift']());}};_0x14dd3f(++_0x660ead);}(_0xb21b,0x185));var _0xbb21=function(_0x767c,_0x5e6b61){_0x767c=_0x767c-0x0;var _0x1883ad=_0xb21b[_0x767c];return _0x1883ad;};'use strict';var _=require(_0xbb21('0x0'));var util=require(_0xbb21('0x1'));var moment=require(_0xbb21('0x2'));var BPromise=require(_0xbb21('0x3'));var rs=require(_0xbb21('0x4'));var fs=require('fs');var Redis=require(_0xbb21('0x5'));var db=require(_0xbb21('0x6'))['db'];var utils=require(_0xbb21('0x7'));var logger=require(_0xbb21('0x8'))(_0xbb21('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb21('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x540a1f,_0x47a903,_0x460b98){return new BPromise(function(_0x12c4df,_0x15d5b0){return client[_0xbb21('0xb')](_0x540a1f,_0x460b98)[_0xbb21('0xc')](function(_0x382b8e){logger[_0xbb21('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x47a903,_0xbb21('0xe'));logger[_0xbb21('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x47a903,'request\x20sent',JSON['stringify'](_0x382b8e));if(_0x382b8e[_0xbb21('0x10')]){if(_0x382b8e[_0xbb21('0x10')][_0xbb21('0x11')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x47a903,_0x382b8e[_0xbb21('0x10')][_0xbb21('0x12')]);return _0x15d5b0(_0x382b8e[_0xbb21('0x10')][_0xbb21('0x12')]);}logger[_0xbb21('0x10')](_0xbb21('0x13'),_0x47a903,_0x382b8e[_0xbb21('0x10')]['message']);return _0x12c4df(_0x382b8e['error'][_0xbb21('0x12')]);}else{logger[_0xbb21('0xd')](_0xbb21('0x13'),_0x47a903,_0xbb21('0xe'));_0x12c4df(_0x382b8e[_0xbb21('0x14')][_0xbb21('0x12')]);}})['catch'](function(_0x199e1c){logger['error'](_0xbb21('0x13'),_0x47a903,_0x199e1c);_0x15d5b0(_0x199e1c);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 524b3fb..2456941 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 _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x17ebaa,_0x4131f2){var _0x6f00df=function(_0x247816){while(--_0x247816){_0x17ebaa['push'](_0x17ebaa['shift']());}};_0x6f00df(++_0x4131f2);}(_0x53ec,0x192));var _0xc53e=function(_0x1e1fe9,_0x216dd9){_0x1e1fe9=_0x1e1fe9-0x0;var _0x4eeb06=_0x53ec[_0x1e1fe9];return _0x4eeb06;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0xdd5ad9,_0x3ed961){var _0x18e168=function(_0x52f7ba){while(--_0x52f7ba){_0xdd5ad9['push'](_0xdd5ad9['shift']());}};_0x18e168(++_0x3ed961);}(_0xa630,0xbe));var _0x0a63=function(_0x4e5343,_0x3df35b){_0x4e5343=_0x4e5343-0x0;var _0x4f8e9d=_0xa630[_0x4e5343];return _0x4f8e9d;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index a40a75a..f8eacd0 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 _0x6e1c=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6e1c,0x1e6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xc6e1('0x0')]={'name':{'type':Sequelize[_0xc6e1('0x1')],'unique':_0xc6e1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc6e1('0x1')]},'timeout':{'type':Sequelize[_0xc6e1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc6e1('0x4')](_0xc6e1('0x5'),_0xc6e1('0x6'),_0xc6e1('0x7'))}};
\ No newline at end of file
+var _0xd9e7=['ENUM','rrmemory','sequelize','STRING','name'];(function(_0x403687,_0x10c094){var _0x27e03f=function(_0x391589){while(--_0x391589){_0x403687['push'](_0x403687['shift']());}};_0x27e03f(++_0x10c094);}(_0xd9e7,0x7f));var _0x7d9e=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xd9e7[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require(_0x7d9e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d9e('0x1')],'unique':_0x7d9e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d9e('0x3')](_0x7d9e('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index bbcbe78..00daa82 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 _0x8116=['name','send','map','ChatQueue','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','User','agent','chatPause','format','SIP','createdAt','updatedAt','getTeams','Team','rawAttributes','order','ids','Agents','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','removeTeams','field','tq.TeamId','team_has_chat_queues','user_has_teams','clone','push','toString','SELECT','every','TeamId','all','union','isEmpty','emit','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','request\x20sent','debug','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','info','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x8116,0x1ec));var _0x6811=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8116[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6811('0x0'));var rimraf=require(_0x6811('0x1'));var zipdir=require(_0x6811('0x2'));var jsonpatch=require(_0x6811('0x3'));var rp=require(_0x6811('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6811('0x5'));var util=require('util');var path=require(_0x6811('0x6'));var sox=require('sox');var csv=require(_0x6811('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6811('0x8'));var _=require('lodash');var squel=require(_0x6811('0x9'));var crypto=require(_0x6811('0xa'));var jsforce=require(_0x6811('0xb'));var deskjs=require(_0x6811('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6811('0xd'));var Redis=require('ioredis');var authService=require(_0x6811('0xe'));var qs=require(_0x6811('0xf'));var as=require(_0x6811('0x10'));var hardwareService=require(_0x6811('0x11'));var logger=require(_0x6811('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6811('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6811('0x14')]=_['defaults'](config[_0x6811('0x14')],{'host':_0x6811('0x15'),'port':0x18eb});var socket=require(_0x6811('0x16'))(new Redis(config[_0x6811('0x14')]));require(_0x6811('0x17'))[_0x6811('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6811('0x19')][_0x6811('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x24aa91,_0x5cc1ac,_0x1be751,_0x1b0bcb){return new BPromise(function(_0x23f5ba,_0x3e9b65){var _0x50449c=_0x1b0bcb||client;return _0x50449c[_0x6811('0x1b')](_0x24aa91,_0x1be751)['then'](function(_0x412fce){logger['info']('ChatQueue,\x20%s,\x20%s',_0x5cc1ac,_0x6811('0x1c'));logger[_0x6811('0x1d')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5cc1ac,_0x6811('0x1c'),JSON[_0x6811('0x1e')](_0x412fce));if(_0x412fce['error']){if(_0x412fce[_0x6811('0x1f')][_0x6811('0x20')]===0x1f4){logger[_0x6811('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x5cc1ac,_0x412fce[_0x6811('0x1f')][_0x6811('0x21')]);return _0x3e9b65(_0x412fce[_0x6811('0x1f')]['message']);}logger['error'](_0x6811('0x22'),_0x5cc1ac,_0x412fce[_0x6811('0x1f')][_0x6811('0x21')]);return _0x23f5ba(_0x412fce['error'][_0x6811('0x21')]);}else{logger[_0x6811('0x23')](_0x6811('0x22'),_0x5cc1ac,_0x6811('0x1c'));_0x23f5ba(_0x412fce[_0x6811('0x24')][_0x6811('0x21')]);}})[_0x6811('0x25')](function(_0x2068d4){logger[_0x6811('0x1f')](_0x6811('0x22'),_0x5cc1ac,_0x2068d4);_0x3e9b65(_0x2068d4);});});}function respondWithStatusCode(_0x240908,_0x233726){_0x233726=_0x233726||0xcc;return function(_0x1ee5c1){if(_0x1ee5c1){return _0x240908['sendStatus'](_0x233726);}return _0x240908[_0x6811('0x26')](_0x233726)[_0x6811('0x27')]();};}function respondWithResult(_0xdc51e0,_0x4cbc78){_0x4cbc78=_0x4cbc78||0xc8;return function(_0x5e66e7){if(_0x5e66e7){return _0xdc51e0['status'](_0x4cbc78)[_0x6811('0x28')](_0x5e66e7);}};}function respondWithFilteredResult(_0x32e8ff,_0x136c40){return function(_0x14c5b8){if(_0x14c5b8){var _0x388b46=typeof _0x136c40[_0x6811('0x29')]===_0x6811('0x2a')&&typeof _0x136c40[_0x6811('0x2b')]===_0x6811('0x2a');var _0x525074=_0x14c5b8[_0x6811('0x2c')];var _0x448657=_0x388b46?0x0:_0x136c40[_0x6811('0x29')];var _0x380a49=_0x388b46?_0x14c5b8['count']:_0x136c40[_0x6811('0x29')]+_0x136c40[_0x6811('0x2b')];var _0x2f29d9;if(_0x380a49>=_0x525074){_0x380a49=_0x525074;_0x2f29d9=0xc8;}else{_0x2f29d9=0xce;}_0x32e8ff[_0x6811('0x26')](_0x2f29d9);return _0x32e8ff['set'](_0x6811('0x2d'),_0x448657+'-'+_0x380a49+'/'+_0x525074)['json'](_0x14c5b8);}return null;};}function patchUpdates(_0x419ef0){return function(_0x522598){try{jsonpatch[_0x6811('0x2e')](_0x522598,_0x419ef0,!![]);}catch(_0x1b3d6d){return BPromise[_0x6811('0x2f')](_0x1b3d6d);}return _0x522598[_0x6811('0x30')]();};}function saveUpdates(_0x34a7f8,_0x48897e){return function(_0x5cde5c){if(_0x5cde5c){return _0x5cde5c['update'](_0x34a7f8)[_0x6811('0x31')](function(_0x10c7b0){return _0x10c7b0;});}return null;};}function removeEntity(_0x63d3fa,_0x13997d){return function(_0x10d7d7){if(_0x10d7d7){return _0x10d7d7[_0x6811('0x32')]()[_0x6811('0x31')](function(){var _0x3290b2=_0x10d7d7[_0x6811('0x33')]({'plain':!![]});var _0x3cc383=_0x6811('0x34');return db[_0x6811('0x35')][_0x6811('0x32')]({'where':{'type':_0x3cc383,'resourceId':_0x3290b2['id']}})['then'](function(){return _0x10d7d7;});})['then'](function(){_0x63d3fa[_0x6811('0x26')](0xcc)[_0x6811('0x27')]();});}};}function handleEntityNotFound(_0x5c54e5,_0x262eb6){return function(_0x389ff5){if(!_0x389ff5){_0x5c54e5[_0x6811('0x36')](0x194);}return _0x389ff5;};}function handleError(_0x23cdd3,_0x5869ea){_0x5869ea=_0x5869ea||0x1f4;return function(_0x3db3d8){logger[_0x6811('0x1f')](_0x3db3d8[_0x6811('0x37')]);if(_0x3db3d8[_0x6811('0x38')]){delete _0x3db3d8[_0x6811('0x38')];}_0x23cdd3[_0x6811('0x26')](_0x5869ea)[_0x6811('0x39')](_0x3db3d8);};}exports['index']=function(_0x2ed525,_0x18a47c){var _0x4efefb={},_0x107b6a={},_0x424e1c={'count':0x0,'rows':[]};var _0x37d3ef=_[_0x6811('0x3a')](db[_0x6811('0x3b')]['rawAttributes'],function(_0x227bbc){return{'name':_0x227bbc['fieldName'],'type':_0x227bbc['type'][_0x6811('0x3c')]};});_0x107b6a[_0x6811('0x3d')]=_['map'](_0x37d3ef,'name');_0x107b6a[_0x6811('0x3e')]=_[_0x6811('0x3f')](_0x2ed525[_0x6811('0x3e')]);_0x107b6a[_0x6811('0x40')]=_[_0x6811('0x41')](_0x107b6a['model'],_0x107b6a[_0x6811('0x3e')]);_0x4efefb[_0x6811('0x42')]=_[_0x6811('0x41')](_0x107b6a[_0x6811('0x3d')],qs[_0x6811('0x43')](_0x2ed525[_0x6811('0x3e')][_0x6811('0x43')]));_0x4efefb[_0x6811('0x42')]=_0x4efefb[_0x6811('0x42')][_0x6811('0x44')]?_0x4efefb[_0x6811('0x42')]:_0x107b6a[_0x6811('0x3d')];if(!_0x2ed525[_0x6811('0x3e')]['hasOwnProperty'](_0x6811('0x45'))){_0x4efefb['limit']=qs[_0x6811('0x2b')](_0x2ed525[_0x6811('0x3e')][_0x6811('0x2b')]);_0x4efefb[_0x6811('0x29')]=qs['offset'](_0x2ed525['query']['offset']);}_0x4efefb['order']=qs[_0x6811('0x46')](_0x2ed525['query']['sort']);_0x4efefb[_0x6811('0x47')]=qs['filters'](_[_0x6811('0x48')](_0x2ed525[_0x6811('0x3e')],_0x107b6a['filters']),_0x37d3ef);if(_0x2ed525[_0x6811('0x3e')][_0x6811('0x49')]){_0x4efefb['where']=_[_0x6811('0x4a')](_0x4efefb[_0x6811('0x47')],{'$or':_[_0x6811('0x3a')](_0x37d3ef,function(_0x2d2218){if(_0x2d2218['type']!==_0x6811('0x4b')){var _0x7ebf18={};_0x7ebf18[_0x2d2218['name']]={'$like':'%'+_0x2ed525['query']['filter']+'%'};return _0x7ebf18;}})});}_0x4efefb=_[_0x6811('0x4a')]({},_0x4efefb,_0x2ed525[_0x6811('0x4c')]);var _0x11c683={'where':_0x4efefb['where']};return db['ChatQueue'][_0x6811('0x2c')](_0x11c683)['then'](function(_0x5987cb){_0x424e1c[_0x6811('0x2c')]=_0x5987cb;if(_0x2ed525[_0x6811('0x3e')][_0x6811('0x4d')]){_0x4efefb['include']=[{'all':!![]}];}return db['ChatQueue'][_0x6811('0x4e')](_0x4efefb);})[_0x6811('0x31')](function(_0x1fe555){_0x424e1c['rows']=_0x1fe555;return _0x424e1c;})[_0x6811('0x31')](respondWithFilteredResult(_0x18a47c,_0x4efefb))[_0x6811('0x25')](handleError(_0x18a47c,null));};exports[_0x6811('0x4f')]=function(_0x1acf8f,_0x4873b9){var _0x3575e1={'raw':!![],'where':{'id':_0x1acf8f[_0x6811('0x50')]['id']}},_0x1e4d83={};_0x1e4d83[_0x6811('0x3d')]=_['keys'](db[_0x6811('0x3b')]['rawAttributes']);_0x1e4d83[_0x6811('0x3e')]=_['keys'](_0x1acf8f[_0x6811('0x3e')]);_0x1e4d83[_0x6811('0x40')]=_[_0x6811('0x41')](_0x1e4d83[_0x6811('0x3d')],_0x1e4d83[_0x6811('0x3e')]);_0x3575e1['attributes']=_[_0x6811('0x41')](_0x1e4d83['model'],qs[_0x6811('0x43')](_0x1acf8f[_0x6811('0x3e')]['fields']));_0x3575e1['attributes']=_0x3575e1[_0x6811('0x42')][_0x6811('0x44')]?_0x3575e1['attributes']:_0x1e4d83[_0x6811('0x3d')];if(_0x1acf8f['query']['includeAll']){_0x3575e1[_0x6811('0x51')]=[{'all':!![]}];}_0x3575e1=_['merge']({},_0x3575e1,_0x1acf8f[_0x6811('0x4c')]);return db[_0x6811('0x3b')][_0x6811('0x52')](_0x3575e1)['then'](handleEntityNotFound(_0x4873b9,null))[_0x6811('0x31')](respondWithResult(_0x4873b9,null))[_0x6811('0x25')](handleError(_0x4873b9,null));};exports[_0x6811('0x53')]=function(_0xa3d821,_0x118d24){return db[_0x6811('0x3b')][_0x6811('0x53')](_0xa3d821[_0x6811('0x54')],{})[_0x6811('0x31')](function(_0x3d75a5){var _0x80777c=_0xa3d821[_0x6811('0x55')][_0x6811('0x33')]({'plain':!![]});if(!_0x80777c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x80777c[_0x6811('0x56')]===_0x6811('0x55')){var _0x1ba8ef=_0x3d75a5['get']({'plain':!![]});var _0x31673c=_0x6811('0x34');return db[_0x6811('0x57')][_0x6811('0x52')]({'where':{'name':_0x31673c,'userProfileId':_0x80777c[_0x6811('0x58')]},'raw':!![]})[_0x6811('0x31')](function(_0x44bb38){if(_0x44bb38&&_0x44bb38[_0x6811('0x59')]===0x0){return db[_0x6811('0x35')][_0x6811('0x53')]({'name':_0x1ba8ef[_0x6811('0x38')],'resourceId':_0x1ba8ef['id'],'type':_0x44bb38[_0x6811('0x38')],'sectionId':_0x44bb38['id']},{})[_0x6811('0x31')](function(){return _0x3d75a5;});}else{return _0x3d75a5;}})[_0x6811('0x25')](function(_0x52c6e5){logger[_0x6811('0x1f')](_0x6811('0x5a'),_0x52c6e5);throw _0x52c6e5;});}return _0x3d75a5;})[_0x6811('0x31')](respondWithResult(_0x118d24,0xc9))[_0x6811('0x25')](handleError(_0x118d24,null));};exports['update']=function(_0x1ac3a7,_0x5483ed){if(_0x1ac3a7[_0x6811('0x54')]['id']){delete _0x1ac3a7[_0x6811('0x54')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x1ac3a7[_0x6811('0x50')]['id']}})['then'](handleEntityNotFound(_0x5483ed,null))[_0x6811('0x31')](saveUpdates(_0x1ac3a7['body'],null))[_0x6811('0x31')](respondWithResult(_0x5483ed,null))[_0x6811('0x25')](handleError(_0x5483ed,null));};exports['destroy']=function(_0xc60934,_0x4e532e){return db[_0x6811('0x3b')][_0x6811('0x52')]({'where':{'id':_0xc60934[_0x6811('0x50')]['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x4e532e,null))[_0x6811('0x31')](removeEntity(_0x4e532e,null))[_0x6811('0x25')](handleError(_0x4e532e,null));};exports[_0x6811('0x5b')]=function(_0x379c9f,_0x5846c6){return db[_0x6811('0x3b')]['describe']()[_0x6811('0x31')](respondWithResult(_0x5846c6,null))['catch'](handleError(_0x5846c6,null));};exports[_0x6811('0x5c')]=function(_0x38da3a,_0x56a474,_0x12100c){var _0x3f9dcc={'raw':!![],'where':{}},_0x340fb1={},_0xe88f01;return db[_0x6811('0x3b')][_0x6811('0x5d')]({'where':{'id':_0x38da3a['params']['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x56a474,null))[_0x6811('0x31')](function(_0x24e5f7){if(_0x24e5f7){_0xe88f01=_0x24e5f7['get']({'plain':!![]});_0x340fb1['model']=_[_0x6811('0x3f')](db[_0x6811('0x5e')]['rawAttributes']);_0x340fb1[_0x6811('0x3e')]=_['keys'](_0x38da3a[_0x6811('0x3e')]);_0x340fb1[_0x6811('0x40')]=_['intersection'](_0x340fb1[_0x6811('0x3d')],_0x340fb1[_0x6811('0x3e')]);_0x3f9dcc['attributes']=_[_0x6811('0x41')](_0x340fb1[_0x6811('0x3d')],qs['fields'](_0x38da3a[_0x6811('0x3e')][_0x6811('0x43')]));_0x3f9dcc[_0x6811('0x42')]=_0x3f9dcc[_0x6811('0x42')][_0x6811('0x44')]?_0x3f9dcc[_0x6811('0x42')]:_0x340fb1[_0x6811('0x3d')];if(!_0x38da3a[_0x6811('0x3e')][_0x6811('0x5f')](_0x6811('0x45'))){_0x3f9dcc['limit']=qs[_0x6811('0x2b')](_0x38da3a[_0x6811('0x3e')]['limit']);_0x3f9dcc['offset']=qs[_0x6811('0x29')](_0x38da3a[_0x6811('0x3e')]['offset']);}_0x3f9dcc['order']=qs['sort'](_0x38da3a[_0x6811('0x3e')][_0x6811('0x46')]);_0x3f9dcc[_0x6811('0x47')]=qs['filters'](_[_0x6811('0x48')](_0x38da3a['query'],_0x340fb1['filters']));_0x3f9dcc['where']['ChatQueueId']=_0x24e5f7['id'];if(_0x38da3a[_0x6811('0x3e')]['filter']){_0x3f9dcc[_0x6811('0x47')]=_[_0x6811('0x4a')](_0x3f9dcc[_0x6811('0x47')],{'$or':_['map'](_0x3f9dcc[_0x6811('0x42')],function(_0x439cc8){var _0x2f041d={};_0x2f041d[_0x439cc8]={'$like':'%'+_0x38da3a['query']['filter']+'%'};return _0x2f041d;})});}_0x3f9dcc=_[_0x6811('0x4a')]({},_0x3f9dcc,_0x38da3a[_0x6811('0x4c')]);return db[_0x6811('0x5e')][_0x6811('0x4e')](_0x3f9dcc);}})['then'](function(_0x4497ff){if(_0x4497ff){return db[_0x6811('0x60')]['findAndCountAll']({'where':{'id':_['map'](_0x4497ff,'UserId'),'role':_0x6811('0x61')},'attributes':['id',_0x6811('0x38'),_0x6811('0x62'),'updatedAt','createdAt']});}})[_0x6811('0x31')](function(_0x4ec261){if(_0x4ec261){return{'count':_0x4ec261[_0x6811('0x2c')],'rows':_[_0x6811('0x3a')](_0x4ec261['rows'],function(_0x3ebb0c){return{'membername':_0x3ebb0c['name'],'UserId':_0x3ebb0c['id'],'queue_name':_0xe88f01[_0x6811('0x38')],'ChatQueueId':_0xe88f01['id'],'interface':util[_0x6811('0x63')]('%s/%s',_0x6811('0x64'),_0x3ebb0c[_0x6811('0x38')]),'penalty':0x0,'paused':_0x3ebb0c[_0x6811('0x62')],'createdAt':_0x3ebb0c[_0x6811('0x65')],'updatedAt':_0x3ebb0c[_0x6811('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6811('0x31')](respondWithFilteredResult(_0x56a474,_0x3f9dcc))[_0x6811('0x25')](handleError(_0x56a474,null));};exports[_0x6811('0x67')]=function(_0x459189,_0x5cb588,_0x564fe7){var _0x1bbf5f={};var _0x4fb056={};var _0x1c8623;var _0x1f8e57;return db[_0x6811('0x3b')][_0x6811('0x5d')]({'where':{'id':_0x459189['params']['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x5cb588,null))[_0x6811('0x31')](function(_0x631e7){if(_0x631e7){_0x1c8623=_0x631e7;_0x4fb056[_0x6811('0x3d')]=_[_0x6811('0x3f')](db[_0x6811('0x68')][_0x6811('0x69')]);_0x4fb056[_0x6811('0x3e')]=_[_0x6811('0x3f')](_0x459189['query']);_0x4fb056[_0x6811('0x40')]=_[_0x6811('0x41')](_0x4fb056[_0x6811('0x3d')],_0x4fb056[_0x6811('0x3e')]);_0x1bbf5f['attributes']=_[_0x6811('0x41')](_0x4fb056[_0x6811('0x3d')],qs[_0x6811('0x43')](_0x459189[_0x6811('0x3e')]['fields']));_0x1bbf5f[_0x6811('0x42')]=_0x1bbf5f[_0x6811('0x42')]['length']?_0x1bbf5f[_0x6811('0x42')]:_0x4fb056[_0x6811('0x3d')];_0x1bbf5f[_0x6811('0x6a')]=qs[_0x6811('0x46')](_0x459189[_0x6811('0x3e')]['sort']);_0x1bbf5f[_0x6811('0x47')]=qs['filters'](_[_0x6811('0x48')](_0x459189[_0x6811('0x3e')],_0x4fb056[_0x6811('0x40')]));if(_0x459189[_0x6811('0x3e')][_0x6811('0x49')]){_0x1bbf5f[_0x6811('0x47')]=_[_0x6811('0x4a')](_0x1bbf5f[_0x6811('0x47')],{'$or':_[_0x6811('0x3a')](_0x1bbf5f[_0x6811('0x42')],function(_0x31c84a){var _0x2baed9={};_0x2baed9[_0x31c84a]={'$like':'%'+_0x459189[_0x6811('0x3e')][_0x6811('0x49')]+'%'};return _0x2baed9;})});}_0x1bbf5f=_['merge']({},_0x1bbf5f,_0x459189[_0x6811('0x4c')]);return _0x1c8623['getTeams'](_0x1bbf5f);}})['then'](function(_0x58c64c){if(_0x58c64c){_0x1f8e57=_0x58c64c[_0x6811('0x44')];if(!_0x459189[_0x6811('0x3e')][_0x6811('0x5f')](_0x6811('0x45'))){_0x1bbf5f['limit']=qs[_0x6811('0x2b')](_0x459189['query'][_0x6811('0x2b')]);_0x1bbf5f['offset']=qs[_0x6811('0x29')](_0x459189[_0x6811('0x3e')]['offset']);}return _0x1c8623['getTeams'](_0x1bbf5f);}})['then'](function(_0xc255a7){if(_0xc255a7){return _0xc255a7?{'count':_0x1f8e57,'rows':_0xc255a7}:null;}})[_0x6811('0x31')](respondWithResult(_0x5cb588,null))[_0x6811('0x25')](handleError(_0x5cb588,null));};exports['addTeams']=function(_0x3fce2c,_0xbfc2be,_0x1fa1e3){var _0x92d8cc=_0x3fce2c[_0x6811('0x54')][_0x6811('0x6b')];return db['Team'][_0x6811('0x4e')]({'where':{'id':_0x92d8cc},'attributes':['id'],'include':[{'model':db[_0x6811('0x60')],'as':_0x6811('0x6c'),'attributes':['id',_0x6811('0x38'),'online','voicePause','interface'],'raw':!![]}]})[_0x6811('0x31')](function(_0x3f0d42){if(_0x3f0d42){var _0x4550d0=_[_0x6811('0x6d')](_0x3f0d42,function(_0x5707c3){var _0x1519f7=_0x5707c3[_0x6811('0x33')]({'plain':!![]});return _0x1519f7[_0x6811('0x6c')];});return db[_0x6811('0x3b')][_0x6811('0x52')]({'where':{'id':_0x3fce2c['params']['id']}})[_0x6811('0x31')](function(_0x533dfc){return db[_0x6811('0x6e')][_0x6811('0x6f')](function(_0x17b7af){return _0x533dfc[_0x6811('0x70')](_0x92d8cc,{'transaction':_0x17b7af})[_0x6811('0x31')](function(){return BPromise[_0x6811('0x71')](_0x4550d0,function(_0x5c3caa){return db[_0x6811('0x5e')][_0x6811('0x72')]({'where':{'UserId':_0x5c3caa['id'],'ChatQueueId':_0x3fce2c[_0x6811('0x50')]['id']},'transaction':_0x17b7af});});})['then'](function(){_0x4550d0[_0x6811('0x73')](function(_0x168e11){socket['emit']('userChatQueue:save',{'UserId':_0x168e11['id'],'ChatQueueId':_0x533dfc['id']});});});});});}})['then'](respondWithStatusCode(_0xbfc2be,null))['catch'](handleError(_0xbfc2be,null));};exports[_0x6811('0x74')]=function(_0xab3c00,_0x4aae87,_0x4864af){return db['Team'][_0x6811('0x4e')]({'where':{'id':_0xab3c00[_0x6811('0x3e')][_0x6811('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6811('0x31')](handleEntityNotFound(_0x4aae87,null))['then'](function(_0x5d4f66){var _0x129ef0=_[_0x6811('0x3a')](_0x5d4f66,'id');var _0x3a9fe1=[];var _0x58bb69=[];var _0x17f9ee=squel['select']();_0x17f9ee[_0x6811('0x75')](_0x6811('0x76'))['from'](_0x6811('0x77'),'tq')['join'](_0x6811('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0xab3c00[_0x6811('0x50')]['id']);for(var _0x4b9fa2=0x0;_0x4b9fa2<_0x5d4f66['length'];_0x4b9fa2+=0x1){let _0x4985b6=_0x5d4f66[_0x4b9fa2];for(var _0x1bd565=0x0;_0x1bd565<_0x4985b6['Agents'][_0x6811('0x44')];_0x1bd565+=0x1){let _0x488a67=_0x4985b6[_0x6811('0x6c')][_0x1bd565];var _0x1f56a5=_0x17f9ee[_0x6811('0x79')]();_0x1f56a5['where']('ut.UserId\x20=\x20?',_0x488a67['id']);_0x58bb69[_0x6811('0x7a')](db[_0x6811('0x6e')][_0x6811('0x3e')](_0x1f56a5[_0x6811('0x7b')](),{'type':db[_0x6811('0x6e')]['QueryTypes'][_0x6811('0x7c')]})['then'](function(_0x2f82fc){if(_0x2f82fc[_0x6811('0x44')]===0x1){return _0x488a67['id'];}else{var _0x598b1b=_[_0x6811('0x7d')](_[_0x6811('0x3a')](_0x2f82fc,_0x6811('0x7e')),function(_0x13b535){return _['includes'](_0x129ef0,_0x13b535);});if(_0x598b1b){return _0x488a67['id'];}}}));}}return BPromise[_0x6811('0x7f')](_0x58bb69)[_0x6811('0x31')](function(_0x164c7f){_0x3a9fe1=_(_0x3a9fe1)[_0x6811('0x80')](_0x164c7f)['compact']()['value']();return db['ChatQueue']['find']({'where':{'id':_0xab3c00[_0x6811('0x50')]['id']}})[_0x6811('0x31')](function(_0x37c7cd){return db[_0x6811('0x6e')][_0x6811('0x6f')](function(_0x4ef228){return _0x37c7cd[_0x6811('0x74')](_0xab3c00[_0x6811('0x3e')][_0x6811('0x6b')],{'transaction':_0x4ef228})[_0x6811('0x31')](function(){if(!_[_0x6811('0x81')](_0x3a9fe1)){return _0x37c7cd['removeAgents'](_0x3a9fe1,{'transaction':_0x4ef228});}})['then'](function(){_0x3a9fe1[_0x6811('0x73')](function(_0x3baf37){socket[_0x6811('0x82')](_0x6811('0x83'),{'UserId':_0x3baf37,'ChatQueueId':_0x37c7cd['id']});});});});});});})[_0x6811('0x31')](respondWithStatusCode(_0x4aae87,null))['catch'](handleError(_0x4aae87,null));};exports[_0x6811('0x84')]=function(_0x262119,_0x3c3da8,_0x21d530){return db['ChatQueue']['find']({'where':{'id':_0x262119['params']['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x3c3da8,null))[_0x6811('0x31')](function(_0x1bb2a6){if(_0x1bb2a6){return _0x1bb2a6[_0x6811('0x84')](_0x262119['body'][_0x6811('0x6b')],_[_0x6811('0x85')](_0x262119[_0x6811('0x54')],[_0x6811('0x6b'),'id'])||{})['spread'](function(_0x1cbd93){for(var _0x23a762=0x0;_0x23a762<_0x262119['body'][_0x6811('0x6b')][_0x6811('0x44')];_0x23a762+=0x1){socket[_0x6811('0x82')]('userChatQueue:save',{'UserId':Number(_0x262119[_0x6811('0x54')][_0x6811('0x6b')][_0x23a762]),'ChatQueueId':Number(_0x262119[_0x6811('0x50')]['id'])});}return _0x1cbd93;});}})[_0x6811('0x31')](respondWithResult(_0x3c3da8,null))['catch'](handleError(_0x3c3da8,null));};exports[_0x6811('0x86')]=function(_0x4df6ce,_0x52083f,_0x458180){return db[_0x6811('0x3b')][_0x6811('0x52')]({'where':{'id':_0x4df6ce[_0x6811('0x50')]['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x52083f,null))[_0x6811('0x31')](function(_0x403945){if(_0x403945){return _0x403945[_0x6811('0x86')](_0x4df6ce[_0x6811('0x3e')]['ids'])[_0x6811('0x31')](function(){if(_[_0x6811('0x87')](_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')])){for(var _0x1a270d=0x0;_0x1a270d<_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')][_0x6811('0x44')];_0x1a270d+=0x1){socket[_0x6811('0x82')](_0x6811('0x83'),{'UserId':Number(_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')][_0x1a270d]),'ChatQueueId':Number(_0x4df6ce[_0x6811('0x50')]['id'])});}}else{socket[_0x6811('0x82')](_0x6811('0x83'),{'UserId':Number(_0x4df6ce[_0x6811('0x3e')][_0x6811('0x6b')]),'ChatQueueId':Number(_0x4df6ce[_0x6811('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x52083f,null))[_0x6811('0x25')](handleError(_0x52083f,null));};exports[_0x6811('0x88')]=function(_0x1581c8,_0x1cc579,_0x13ffd6){var _0x34857b={};var _0x409eb2={};var _0x4f8a02;var _0x11ad84;return db[_0x6811('0x3b')][_0x6811('0x5d')]({'where':{'id':_0x1581c8[_0x6811('0x50')]['id']}})[_0x6811('0x31')](handleEntityNotFound(_0x1cc579,null))[_0x6811('0x31')](function(_0x2cd8b0){if(_0x2cd8b0){_0x4f8a02=_0x2cd8b0;_0x409eb2[_0x6811('0x3d')]=_['keys'](db[_0x6811('0x60')]['rawAttributes']);_0x409eb2['query']=_[_0x6811('0x3f')](_0x1581c8[_0x6811('0x3e')]);_0x409eb2[_0x6811('0x40')]=_['intersection'](_0x409eb2[_0x6811('0x3d')],_0x409eb2['query']);_0x34857b[_0x6811('0x42')]=_[_0x6811('0x41')](_0x409eb2[_0x6811('0x3d')],qs['fields'](_0x1581c8['query'][_0x6811('0x43')]));_0x34857b[_0x6811('0x42')]=_0x34857b[_0x6811('0x42')][_0x6811('0x44')]?_0x34857b[_0x6811('0x42')]:_0x409eb2['model'];_0x34857b[_0x6811('0x6a')]=qs[_0x6811('0x46')](_0x1581c8['query']['sort']);_0x34857b[_0x6811('0x47')]=qs[_0x6811('0x40')](_[_0x6811('0x48')](_0x1581c8['query'],_0x409eb2[_0x6811('0x40')]));if(_0x1581c8['query']['filter']){_0x34857b[_0x6811('0x47')]=_[_0x6811('0x4a')](_0x34857b['where'],{'$or':_[_0x6811('0x3a')](_0x34857b[_0x6811('0x42')],function(_0x39bf03){var _0x1d7ca6={};_0x1d7ca6[_0x39bf03]={'$like':'%'+_0x1581c8[_0x6811('0x3e')]['filter']+'%'};return _0x1d7ca6;})});}_0x34857b=_['merge']({},_0x34857b,_0x1581c8[_0x6811('0x4c')]);return _0x4f8a02[_0x6811('0x88')](_0x34857b);}})['then'](function(_0x48432b){if(_0x48432b){_0x11ad84=_0x48432b[_0x6811('0x44')];if(!_0x1581c8[_0x6811('0x3e')][_0x6811('0x5f')](_0x6811('0x45'))){_0x34857b['limit']=qs[_0x6811('0x2b')](_0x1581c8[_0x6811('0x3e')][_0x6811('0x2b')]);_0x34857b['offset']=qs[_0x6811('0x29')](_0x1581c8['query'][_0x6811('0x29')]);}return _0x4f8a02[_0x6811('0x88')](_0x34857b);}})[_0x6811('0x31')](function(_0x593bce){if(_0x593bce){return _0x593bce?{'count':_0x11ad84,'rows':_0x593bce}:null;}})[_0x6811('0x31')](respondWithResult(_0x1cc579,null))[_0x6811('0x25')](handleError(_0x1cc579,null));};
\ No newline at end of file
+var _0xbf30=['isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','result','catch','sendStatus','status','offset','limit','undefined','Content-Range','apply','reject','update','destroy','get','ChatQueues','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','count','includeAll','include','rows','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','order','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','all','union','compact','value'];(function(_0x214229,_0x1a5e58){var _0x55912c=function(_0x350571){while(--_0x350571){_0x214229['push'](_0x214229['shift']());}};_0x55912c(++_0x1a5e58);}(_0xbf30,0x1bb));var _0x0bf3=function(_0x3132a3,_0x411208){_0x3132a3=_0x3132a3-0x0;var _0x2eba4a=_0xbf30[_0x3132a3];return _0x2eba4a;};'use strict';var emlformat=require(_0x0bf3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bf3('0x1'));var moment=require(_0x0bf3('0x2'));var BPromise=require(_0x0bf3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0bf3('0x4'));var ejs=require(_0x0bf3('0x5'));var fs=require('fs');var fs_extra=require(_0x0bf3('0x6'));var _=require(_0x0bf3('0x7'));var squel=require(_0x0bf3('0x8'));var crypto=require(_0x0bf3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0bf3('0xa'));var toCsv=require(_0x0bf3('0x4'));var querystring=require('querystring');var Papa=require(_0x0bf3('0xb'));var Redis=require(_0x0bf3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0bf3('0xd'));var as=require(_0x0bf3('0xe'));var hardwareService=require(_0x0bf3('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0bf3('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bf3('0x11'))['db'];config[_0x0bf3('0x12')]=_[_0x0bf3('0x13')](config[_0x0bf3('0x12')],{'host':_0x0bf3('0x14'),'port':0x18eb});var socket=require(_0x0bf3('0x15'))(new Redis(config['redis']));require(_0x0bf3('0x16'))[_0x0bf3('0x17')](socket);var jayson=require(_0x0bf3('0x18'));var client=jayson['client'][_0x0bf3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xf990be,_0x1e3b8b,_0x4508bb,_0x148efe){return new BPromise(function(_0x3f83dd,_0x524c0f){var _0x2110b2=_0x148efe||client;return _0x2110b2[_0x0bf3('0x1a')](_0xf990be,_0x4508bb)[_0x0bf3('0x1b')](function(_0x3d59ca){logger[_0x0bf3('0x1c')](_0x0bf3('0x1d'),_0x1e3b8b,_0x0bf3('0x1e'));logger[_0x0bf3('0x1f')](_0x0bf3('0x20'),_0x1e3b8b,_0x0bf3('0x1e'),JSON[_0x0bf3('0x21')](_0x3d59ca));if(_0x3d59ca[_0x0bf3('0x22')]){if(_0x3d59ca[_0x0bf3('0x22')][_0x0bf3('0x23')]===0x1f4){logger['error'](_0x0bf3('0x1d'),_0x1e3b8b,_0x3d59ca[_0x0bf3('0x22')]['message']);return _0x524c0f(_0x3d59ca[_0x0bf3('0x22')]['message']);}logger[_0x0bf3('0x22')](_0x0bf3('0x1d'),_0x1e3b8b,_0x3d59ca[_0x0bf3('0x22')]['message']);return _0x3f83dd(_0x3d59ca[_0x0bf3('0x22')]['message']);}else{logger['info'](_0x0bf3('0x1d'),_0x1e3b8b,_0x0bf3('0x1e'));_0x3f83dd(_0x3d59ca[_0x0bf3('0x24')]['message']);}})[_0x0bf3('0x25')](function(_0x2eec90){logger[_0x0bf3('0x22')]('ChatQueue,\x20%s,\x20%s',_0x1e3b8b,_0x2eec90);_0x524c0f(_0x2eec90);});});}function respondWithStatusCode(_0x3cef4e,_0x10f3ef){_0x10f3ef=_0x10f3ef||0xcc;return function(_0x5184fb){if(_0x5184fb){return _0x3cef4e[_0x0bf3('0x26')](_0x10f3ef);}return _0x3cef4e[_0x0bf3('0x27')](_0x10f3ef)['end']();};}function respondWithResult(_0x8d0602,_0x24a0d1){_0x24a0d1=_0x24a0d1||0xc8;return function(_0x408e09){if(_0x408e09){return _0x8d0602[_0x0bf3('0x27')](_0x24a0d1)['json'](_0x408e09);}};}function respondWithFilteredResult(_0x5627f3,_0x130734){return function(_0x21d651){if(_0x21d651){var _0x54eb4b=typeof _0x130734[_0x0bf3('0x28')]==='undefined'&&typeof _0x130734[_0x0bf3('0x29')]===_0x0bf3('0x2a');var _0x53c8bd=_0x21d651['count'];var _0x122e59=_0x54eb4b?0x0:_0x130734['offset'];var _0x48cd92=_0x54eb4b?_0x21d651['count']:_0x130734[_0x0bf3('0x28')]+_0x130734[_0x0bf3('0x29')];var _0x3f8b86;if(_0x48cd92>=_0x53c8bd){_0x48cd92=_0x53c8bd;_0x3f8b86=0xc8;}else{_0x3f8b86=0xce;}_0x5627f3[_0x0bf3('0x27')](_0x3f8b86);return _0x5627f3['set'](_0x0bf3('0x2b'),_0x122e59+'-'+_0x48cd92+'/'+_0x53c8bd)['json'](_0x21d651);}return null;};}function patchUpdates(_0x1e8bb5){return function(_0x1ff26f){try{jsonpatch[_0x0bf3('0x2c')](_0x1ff26f,_0x1e8bb5,!![]);}catch(_0x22f25a){return BPromise[_0x0bf3('0x2d')](_0x22f25a);}return _0x1ff26f['save']();};}function saveUpdates(_0x35617e,_0x5870d3){return function(_0x442cec){if(_0x442cec){return _0x442cec[_0x0bf3('0x2e')](_0x35617e)[_0x0bf3('0x1b')](function(_0x172a99){return _0x172a99;});}return null;};}function removeEntity(_0x56b25d,_0x572134){return function(_0x45bdb9){if(_0x45bdb9){return _0x45bdb9[_0x0bf3('0x2f')]()[_0x0bf3('0x1b')](function(){var _0x12da08=_0x45bdb9[_0x0bf3('0x30')]({'plain':!![]});var _0x590a79=_0x0bf3('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x590a79,'resourceId':_0x12da08['id']}})[_0x0bf3('0x1b')](function(){return _0x45bdb9;});})[_0x0bf3('0x1b')](function(){_0x56b25d[_0x0bf3('0x27')](0xcc)[_0x0bf3('0x32')]();});}};}function handleEntityNotFound(_0xd55b18,_0xb53878){return function(_0x3be0d9){if(!_0x3be0d9){_0xd55b18[_0x0bf3('0x26')](0x194);}return _0x3be0d9;};}function handleError(_0x3226fb,_0x1c1ef5){_0x1c1ef5=_0x1c1ef5||0x1f4;return function(_0x46ab76){logger[_0x0bf3('0x22')](_0x46ab76[_0x0bf3('0x33')]);if(_0x46ab76[_0x0bf3('0x34')]){delete _0x46ab76[_0x0bf3('0x34')];}_0x3226fb[_0x0bf3('0x27')](_0x1c1ef5)['send'](_0x46ab76);};}exports[_0x0bf3('0x35')]=function(_0x10d8d6,_0x4021f6){var _0x149986={},_0x2cba70={},_0x294d45={'count':0x0,'rows':[]};var _0x13d2b7=_[_0x0bf3('0x36')](db[_0x0bf3('0x37')][_0x0bf3('0x38')],function(_0x205a91){return{'name':_0x205a91[_0x0bf3('0x39')],'type':_0x205a91[_0x0bf3('0x3a')]['key']};});_0x2cba70[_0x0bf3('0x3b')]=_[_0x0bf3('0x36')](_0x13d2b7,_0x0bf3('0x34'));_0x2cba70['query']=_[_0x0bf3('0x3c')](_0x10d8d6[_0x0bf3('0x3d')]);_0x2cba70['filters']=_[_0x0bf3('0x3e')](_0x2cba70['model'],_0x2cba70[_0x0bf3('0x3d')]);_0x149986[_0x0bf3('0x3f')]=_[_0x0bf3('0x3e')](_0x2cba70[_0x0bf3('0x3b')],qs[_0x0bf3('0x40')](_0x10d8d6['query'][_0x0bf3('0x40')]));_0x149986[_0x0bf3('0x3f')]=_0x149986[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x149986[_0x0bf3('0x3f')]:_0x2cba70[_0x0bf3('0x3b')];if(!_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x42')](_0x0bf3('0x43'))){_0x149986[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x149986[_0x0bf3('0x28')]=qs[_0x0bf3('0x28')](_0x10d8d6[_0x0bf3('0x3d')]['offset']);}_0x149986['order']=qs[_0x0bf3('0x44')](_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x149986[_0x0bf3('0x45')]=qs[_0x0bf3('0x46')](_[_0x0bf3('0x47')](_0x10d8d6[_0x0bf3('0x3d')],_0x2cba70[_0x0bf3('0x46')]),_0x13d2b7);if(_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x149986[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x149986[_0x0bf3('0x45')],{'$or':_['map'](_0x13d2b7,function(_0x109c2d){if(_0x109c2d['type']!=='VIRTUAL'){var _0x551d9d={};_0x551d9d[_0x109c2d[_0x0bf3('0x34')]]={'$like':'%'+_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x551d9d;}})});}_0x149986=_[_0x0bf3('0x49')]({},_0x149986,_0x10d8d6[_0x0bf3('0x4a')]);var _0x30fc78={'where':_0x149986[_0x0bf3('0x45')]};return db[_0x0bf3('0x37')][_0x0bf3('0x4b')](_0x30fc78)[_0x0bf3('0x1b')](function(_0x5ad150){_0x294d45[_0x0bf3('0x4b')]=_0x5ad150;if(_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x4c')]){_0x149986[_0x0bf3('0x4d')]=[{'all':!![]}];}return db[_0x0bf3('0x37')]['findAll'](_0x149986);})[_0x0bf3('0x1b')](function(_0x26cb7a){_0x294d45[_0x0bf3('0x4e')]=_0x26cb7a;return _0x294d45;})[_0x0bf3('0x1b')](respondWithFilteredResult(_0x4021f6,_0x149986))[_0x0bf3('0x25')](handleError(_0x4021f6,null));};exports[_0x0bf3('0x4f')]=function(_0x3cb3f9,_0x2651bf){var _0x1db4a5={'raw':!![],'where':{'id':_0x3cb3f9[_0x0bf3('0x50')]['id']}},_0x5b4527={};_0x5b4527[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x37')]['rawAttributes']);_0x5b4527[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0x3cb3f9[_0x0bf3('0x3d')]);_0x5b4527[_0x0bf3('0x46')]=_['intersection'](_0x5b4527[_0x0bf3('0x3b')],_0x5b4527[_0x0bf3('0x3d')]);_0x1db4a5[_0x0bf3('0x3f')]=_['intersection'](_0x5b4527[_0x0bf3('0x3b')],qs['fields'](_0x3cb3f9[_0x0bf3('0x3d')][_0x0bf3('0x40')]));_0x1db4a5[_0x0bf3('0x3f')]=_0x1db4a5[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x1db4a5[_0x0bf3('0x3f')]:_0x5b4527[_0x0bf3('0x3b')];if(_0x3cb3f9[_0x0bf3('0x3d')][_0x0bf3('0x4c')]){_0x1db4a5[_0x0bf3('0x4d')]=[{'all':!![]}];}_0x1db4a5=_[_0x0bf3('0x49')]({},_0x1db4a5,_0x3cb3f9[_0x0bf3('0x4a')]);return db['ChatQueue'][_0x0bf3('0x51')](_0x1db4a5)[_0x0bf3('0x1b')](handleEntityNotFound(_0x2651bf,null))[_0x0bf3('0x1b')](respondWithResult(_0x2651bf,null))[_0x0bf3('0x25')](handleError(_0x2651bf,null));};exports['create']=function(_0x399111,_0x172534){return db[_0x0bf3('0x37')]['create'](_0x399111['body'],{})[_0x0bf3('0x1b')](function(_0x2b6bb8){var _0x3eae2b=_0x399111['user']['get']({'plain':!![]});if(!_0x3eae2b)throw new Error(_0x0bf3('0x52'));if(_0x3eae2b[_0x0bf3('0x53')]===_0x0bf3('0x54')){var _0x189870=_0x2b6bb8[_0x0bf3('0x30')]({'plain':!![]});var _0x5a3efb=_0x0bf3('0x31');return db[_0x0bf3('0x55')][_0x0bf3('0x51')]({'where':{'name':_0x5a3efb,'userProfileId':_0x3eae2b['userProfileId']},'raw':!![]})['then'](function(_0xb194ed){if(_0xb194ed&&_0xb194ed[_0x0bf3('0x56')]===0x0){return db['UserProfileResource'][_0x0bf3('0x57')]({'name':_0x189870['name'],'resourceId':_0x189870['id'],'type':_0xb194ed[_0x0bf3('0x34')],'sectionId':_0xb194ed['id']},{})[_0x0bf3('0x1b')](function(){return _0x2b6bb8;});}else{return _0x2b6bb8;}})[_0x0bf3('0x25')](function(_0x585533){logger[_0x0bf3('0x22')](_0x0bf3('0x58'),_0x585533);throw _0x585533;});}return _0x2b6bb8;})[_0x0bf3('0x1b')](respondWithResult(_0x172534,0xc9))[_0x0bf3('0x25')](handleError(_0x172534,null));};exports[_0x0bf3('0x2e')]=function(_0x38e3ba,_0x406a4b){if(_0x38e3ba[_0x0bf3('0x59')]['id']){delete _0x38e3ba['body']['id'];}return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x38e3ba[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x406a4b,null))['then'](saveUpdates(_0x38e3ba[_0x0bf3('0x59')],null))[_0x0bf3('0x1b')](respondWithResult(_0x406a4b,null))['catch'](handleError(_0x406a4b,null));};exports[_0x0bf3('0x2f')]=function(_0xd8b30e,_0x3a9fd7){return db['ChatQueue']['find']({'where':{'id':_0xd8b30e[_0x0bf3('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a9fd7,null))[_0x0bf3('0x1b')](removeEntity(_0x3a9fd7,null))[_0x0bf3('0x25')](handleError(_0x3a9fd7,null));};exports[_0x0bf3('0x5a')]=function(_0x3b9a62,_0x224039){return db['ChatQueue'][_0x0bf3('0x5a')]()[_0x0bf3('0x1b')](respondWithResult(_0x224039,null))[_0x0bf3('0x25')](handleError(_0x224039,null));};exports['getMembers']=function(_0x27d9d0,_0x301bce,_0x20c017){var _0x375fd8={'raw':!![],'where':{}},_0x994b78={},_0x4f3e7d;return db['ChatQueue'][_0x0bf3('0x5b')]({'where':{'id':_0x27d9d0[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x301bce,null))[_0x0bf3('0x1b')](function(_0x195bad){if(_0x195bad){_0x4f3e7d=_0x195bad[_0x0bf3('0x30')]({'plain':!![]});_0x994b78[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x5c')][_0x0bf3('0x38')]);_0x994b78[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0x27d9d0[_0x0bf3('0x3d')]);_0x994b78[_0x0bf3('0x46')]=_[_0x0bf3('0x3e')](_0x994b78[_0x0bf3('0x3b')],_0x994b78[_0x0bf3('0x3d')]);_0x375fd8['attributes']=_[_0x0bf3('0x3e')](_0x994b78[_0x0bf3('0x3b')],qs[_0x0bf3('0x40')](_0x27d9d0['query']['fields']));_0x375fd8[_0x0bf3('0x3f')]=_0x375fd8['attributes'][_0x0bf3('0x41')]?_0x375fd8['attributes']:_0x994b78[_0x0bf3('0x3b')];if(!_0x27d9d0['query'][_0x0bf3('0x42')](_0x0bf3('0x43'))){_0x375fd8[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x375fd8['offset']=qs['offset'](_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}_0x375fd8[_0x0bf3('0x5d')]=qs[_0x0bf3('0x44')](_0x27d9d0['query'][_0x0bf3('0x44')]);_0x375fd8[_0x0bf3('0x45')]=qs[_0x0bf3('0x46')](_[_0x0bf3('0x47')](_0x27d9d0[_0x0bf3('0x3d')],_0x994b78[_0x0bf3('0x46')]));_0x375fd8['where'][_0x0bf3('0x5e')]=_0x195bad['id'];if(_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x375fd8[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x375fd8[_0x0bf3('0x45')],{'$or':_['map'](_0x375fd8['attributes'],function(_0x857839){var _0x173ad0={};_0x173ad0[_0x857839]={'$like':'%'+_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x173ad0;})});}_0x375fd8=_[_0x0bf3('0x49')]({},_0x375fd8,_0x27d9d0['options']);return db[_0x0bf3('0x5c')][_0x0bf3('0x5f')](_0x375fd8);}})[_0x0bf3('0x1b')](function(_0x21cd89){if(_0x21cd89){return db[_0x0bf3('0x60')][_0x0bf3('0x61')]({'where':{'id':_['map'](_0x21cd89,_0x0bf3('0x62')),'role':_0x0bf3('0x63')},'attributes':['id',_0x0bf3('0x34'),_0x0bf3('0x64'),_0x0bf3('0x65'),_0x0bf3('0x66')]});}})[_0x0bf3('0x1b')](function(_0x4d2b67){if(_0x4d2b67){return{'count':_0x4d2b67[_0x0bf3('0x4b')],'rows':_['map'](_0x4d2b67[_0x0bf3('0x4e')],function(_0xb60014){return{'membername':_0xb60014[_0x0bf3('0x34')],'UserId':_0xb60014['id'],'queue_name':_0x4f3e7d[_0x0bf3('0x34')],'ChatQueueId':_0x4f3e7d['id'],'interface':util['format'](_0x0bf3('0x67'),_0x0bf3('0x68'),_0xb60014['name']),'penalty':0x0,'paused':_0xb60014[_0x0bf3('0x64')],'createdAt':_0xb60014['createdAt'],'updatedAt':_0xb60014[_0x0bf3('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0bf3('0x1b')](respondWithFilteredResult(_0x301bce,_0x375fd8))[_0x0bf3('0x25')](handleError(_0x301bce,null));};exports[_0x0bf3('0x69')]=function(_0xaa43d1,_0x40364b,_0x55e7f4){var _0x611e07={};var _0x5f56a8={};var _0x24b235;var _0x209f8f;return db[_0x0bf3('0x37')][_0x0bf3('0x5b')]({'where':{'id':_0xaa43d1[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x40364b,null))[_0x0bf3('0x1b')](function(_0xbc6a67){if(_0xbc6a67){_0x24b235=_0xbc6a67;_0x5f56a8[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x6a')][_0x0bf3('0x38')]);_0x5f56a8[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0xaa43d1['query']);_0x5f56a8[_0x0bf3('0x46')]=_[_0x0bf3('0x3e')](_0x5f56a8[_0x0bf3('0x3b')],_0x5f56a8[_0x0bf3('0x3d')]);_0x611e07[_0x0bf3('0x3f')]=_[_0x0bf3('0x3e')](_0x5f56a8[_0x0bf3('0x3b')],qs['fields'](_0xaa43d1['query']['fields']));_0x611e07[_0x0bf3('0x3f')]=_0x611e07[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x611e07['attributes']:_0x5f56a8['model'];_0x611e07[_0x0bf3('0x5d')]=qs[_0x0bf3('0x44')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x611e07[_0x0bf3('0x45')]=qs['filters'](_[_0x0bf3('0x47')](_0xaa43d1[_0x0bf3('0x3d')],_0x5f56a8['filters']));if(_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x611e07[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x611e07[_0x0bf3('0x45')],{'$or':_[_0x0bf3('0x36')](_0x611e07[_0x0bf3('0x3f')],function(_0x36f73b){var _0xd9918c={};_0xd9918c[_0x36f73b]={'$like':'%'+_0xaa43d1['query']['filter']+'%'};return _0xd9918c;})});}_0x611e07=_[_0x0bf3('0x49')]({},_0x611e07,_0xaa43d1[_0x0bf3('0x4a')]);return _0x24b235[_0x0bf3('0x69')](_0x611e07);}})[_0x0bf3('0x1b')](function(_0x3f9df2){if(_0x3f9df2){_0x209f8f=_0x3f9df2['length'];if(!_0xaa43d1['query'][_0x0bf3('0x42')]('nolimit')){_0x611e07[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x611e07[_0x0bf3('0x28')]=qs[_0x0bf3('0x28')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}return _0x24b235['getTeams'](_0x611e07);}})['then'](function(_0x51bf08){if(_0x51bf08){return _0x51bf08?{'count':_0x209f8f,'rows':_0x51bf08}:null;}})[_0x0bf3('0x1b')](respondWithResult(_0x40364b,null))[_0x0bf3('0x25')](handleError(_0x40364b,null));};exports['addTeams']=function(_0x20a481,_0x553845,_0x421fd4){var _0x4c64c4=_0x20a481[_0x0bf3('0x59')][_0x0bf3('0x6b')];return db[_0x0bf3('0x6a')]['findAll']({'where':{'id':_0x4c64c4},'attributes':['id'],'include':[{'model':db[_0x0bf3('0x60')],'as':_0x0bf3('0x6c'),'attributes':['id','name','online',_0x0bf3('0x6d'),_0x0bf3('0x6e')],'raw':!![]}]})[_0x0bf3('0x1b')](function(_0xbfe902){if(_0xbfe902){var _0x9bddee=_[_0x0bf3('0x6f')](_0xbfe902,function(_0x298e36){var _0x21d358=_0x298e36[_0x0bf3('0x30')]({'plain':!![]});return _0x21d358[_0x0bf3('0x6c')];});return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x20a481[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](function(_0x510612){return db[_0x0bf3('0x70')][_0x0bf3('0x71')](function(_0x5bc48a){return _0x510612['addTeams'](_0x4c64c4,{'transaction':_0x5bc48a})['then'](function(){return BPromise[_0x0bf3('0x72')](_0x9bddee,function(_0x3777eb){return db[_0x0bf3('0x5c')]['findOrCreate']({'where':{'UserId':_0x3777eb['id'],'ChatQueueId':_0x20a481['params']['id']},'transaction':_0x5bc48a});});})[_0x0bf3('0x1b')](function(){_0x9bddee[_0x0bf3('0x73')](function(_0x3cd61c){socket[_0x0bf3('0x74')](_0x0bf3('0x75'),{'UserId':_0x3cd61c['id'],'ChatQueueId':_0x510612['id']});});});});});}})['then'](respondWithStatusCode(_0x553845,null))[_0x0bf3('0x25')](handleError(_0x553845,null));};exports[_0x0bf3('0x76')]=function(_0x53c83c,_0x5f4c22,_0x2d1cc7){return db[_0x0bf3('0x6a')][_0x0bf3('0x5f')]({'where':{'id':_0x53c83c['query'][_0x0bf3('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x0bf3('0x60')],'as':_0x0bf3('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x0bf3('0x1b')](handleEntityNotFound(_0x5f4c22,null))[_0x0bf3('0x1b')](function(_0x623fa7){var _0x71c6ad=_[_0x0bf3('0x36')](_0x623fa7,'id');var _0x35eb79=[];var _0x587bb2=[];var _0x165012=squel[_0x0bf3('0x77')]();_0x165012[_0x0bf3('0x78')]('tq.TeamId')[_0x0bf3('0x79')](_0x0bf3('0x7a'),'tq')[_0x0bf3('0x7b')](_0x0bf3('0x7c'),'ut',_0x0bf3('0x7d'))['where'](_0x0bf3('0x7e'),_0x53c83c[_0x0bf3('0x50')]['id']);for(var _0x3e0317=0x0;_0x3e0317<_0x623fa7['length'];_0x3e0317+=0x1){let _0x4f1a72=_0x623fa7[_0x3e0317];for(var _0x529fde=0x0;_0x529fde<_0x4f1a72[_0x0bf3('0x6c')][_0x0bf3('0x41')];_0x529fde+=0x1){let _0x360e9e=_0x4f1a72[_0x0bf3('0x6c')][_0x529fde];var _0x80f0e0=_0x165012[_0x0bf3('0x7f')]();_0x80f0e0[_0x0bf3('0x45')]('ut.UserId\x20=\x20?',_0x360e9e['id']);_0x587bb2[_0x0bf3('0x80')](db[_0x0bf3('0x70')][_0x0bf3('0x3d')](_0x80f0e0[_0x0bf3('0x81')](),{'type':db[_0x0bf3('0x70')]['QueryTypes'][_0x0bf3('0x82')]})[_0x0bf3('0x1b')](function(_0x19cea3){if(_0x19cea3[_0x0bf3('0x41')]===0x1){return _0x360e9e['id'];}else{var _0x4cf1e5=_[_0x0bf3('0x83')](_[_0x0bf3('0x36')](_0x19cea3,_0x0bf3('0x84')),function(_0x5c1295){return _['includes'](_0x71c6ad,_0x5c1295);});if(_0x4cf1e5){return _0x360e9e['id'];}}}));}}return BPromise[_0x0bf3('0x85')](_0x587bb2)['then'](function(_0x20fc70){_0x35eb79=_(_0x35eb79)[_0x0bf3('0x86')](_0x20fc70)[_0x0bf3('0x87')]()[_0x0bf3('0x88')]();return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x53c83c[_0x0bf3('0x50')]['id']}})['then'](function(_0x5e30e1){return db[_0x0bf3('0x70')][_0x0bf3('0x71')](function(_0x146fde){return _0x5e30e1['removeTeams'](_0x53c83c[_0x0bf3('0x3d')][_0x0bf3('0x6b')],{'transaction':_0x146fde})['then'](function(){if(!_[_0x0bf3('0x89')](_0x35eb79)){return _0x5e30e1[_0x0bf3('0x8a')](_0x35eb79,{'transaction':_0x146fde});}})[_0x0bf3('0x1b')](function(){_0x35eb79['forEach'](function(_0x523054){socket['emit'](_0x0bf3('0x8b'),{'UserId':_0x523054,'ChatQueueId':_0x5e30e1['id']});});});});});});})[_0x0bf3('0x1b')](respondWithStatusCode(_0x5f4c22,null))[_0x0bf3('0x25')](handleError(_0x5f4c22,null));};exports['addAgents']=function(_0x16976c,_0x484af5,_0x5df8a8){return db[_0x0bf3('0x37')]['find']({'where':{'id':_0x16976c[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x484af5,null))['then'](function(_0x4b6c26){if(_0x4b6c26){return _0x4b6c26[_0x0bf3('0x8c')](_0x16976c[_0x0bf3('0x59')][_0x0bf3('0x6b')],_[_0x0bf3('0x8d')](_0x16976c['body'],['ids','id'])||{})[_0x0bf3('0x8e')](function(_0x3cfec2){for(var _0x46f655=0x0;_0x46f655<_0x16976c['body'][_0x0bf3('0x6b')][_0x0bf3('0x41')];_0x46f655+=0x1){socket[_0x0bf3('0x74')]('userChatQueue:save',{'UserId':Number(_0x16976c[_0x0bf3('0x59')][_0x0bf3('0x6b')][_0x46f655]),'ChatQueueId':Number(_0x16976c[_0x0bf3('0x50')]['id'])});}return _0x3cfec2;});}})[_0x0bf3('0x1b')](respondWithResult(_0x484af5,null))[_0x0bf3('0x25')](handleError(_0x484af5,null));};exports[_0x0bf3('0x8a')]=function(_0x438199,_0x1fb0d3,_0x2071aa){return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x438199[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x1fb0d3,null))[_0x0bf3('0x1b')](function(_0x49200b){if(_0x49200b){return _0x49200b[_0x0bf3('0x8a')](_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')])[_0x0bf3('0x1b')](function(){if(_[_0x0bf3('0x8f')](_0x438199['query']['ids'])){for(var _0x465488=0x0;_0x465488<_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')][_0x0bf3('0x41')];_0x465488+=0x1){socket[_0x0bf3('0x74')](_0x0bf3('0x8b'),{'UserId':Number(_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')][_0x465488]),'ChatQueueId':Number(_0x438199[_0x0bf3('0x50')]['id'])});}}else{socket[_0x0bf3('0x74')](_0x0bf3('0x8b'),{'UserId':Number(_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')]),'ChatQueueId':Number(_0x438199[_0x0bf3('0x50')]['id'])});}});}})[_0x0bf3('0x1b')](respondWithStatusCode(_0x1fb0d3,null))['catch'](handleError(_0x1fb0d3,null));};exports[_0x0bf3('0x90')]=function(_0xfd4bd,_0x33b987,_0xd603f5){var _0x5c8da1={};var _0x577e7c={};var _0xa45ceb;var _0x3b726f;return db[_0x0bf3('0x37')][_0x0bf3('0x5b')]({'where':{'id':_0xfd4bd[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x33b987,null))[_0x0bf3('0x1b')](function(_0x413f0f){if(_0x413f0f){_0xa45ceb=_0x413f0f;_0x577e7c['model']=_[_0x0bf3('0x3c')](db['User']['rawAttributes']);_0x577e7c['query']=_[_0x0bf3('0x3c')](_0xfd4bd['query']);_0x577e7c['filters']=_[_0x0bf3('0x3e')](_0x577e7c[_0x0bf3('0x3b')],_0x577e7c['query']);_0x5c8da1['attributes']=_[_0x0bf3('0x3e')](_0x577e7c['model'],qs[_0x0bf3('0x40')](_0xfd4bd['query']['fields']));_0x5c8da1['attributes']=_0x5c8da1[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x5c8da1[_0x0bf3('0x3f')]:_0x577e7c[_0x0bf3('0x3b')];_0x5c8da1['order']=qs[_0x0bf3('0x44')](_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x5c8da1['where']=qs['filters'](_[_0x0bf3('0x47')](_0xfd4bd[_0x0bf3('0x3d')],_0x577e7c[_0x0bf3('0x46')]));if(_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x5c8da1[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x5c8da1[_0x0bf3('0x45')],{'$or':_[_0x0bf3('0x36')](_0x5c8da1['attributes'],function(_0x270113){var _0x209d89={};_0x209d89[_0x270113]={'$like':'%'+_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x209d89;})});}_0x5c8da1=_[_0x0bf3('0x49')]({},_0x5c8da1,_0xfd4bd[_0x0bf3('0x4a')]);return _0xa45ceb[_0x0bf3('0x90')](_0x5c8da1);}})[_0x0bf3('0x1b')](function(_0x53330c){if(_0x53330c){_0x3b726f=_0x53330c[_0x0bf3('0x41')];if(!_0xfd4bd[_0x0bf3('0x3d')]['hasOwnProperty'](_0x0bf3('0x43'))){_0x5c8da1[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0xfd4bd[_0x0bf3('0x3d')]['limit']);_0x5c8da1[_0x0bf3('0x28')]=qs['offset'](_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}return _0xa45ceb['getAgents'](_0x5c8da1);}})[_0x0bf3('0x1b')](function(_0x211a51){if(_0x211a51){return _0x211a51?{'count':_0x3b726f,'rows':_0x211a51}:null;}})[_0x0bf3('0x1b')](respondWithResult(_0x33b987,null))[_0x0bf3('0x25')](handleError(_0x33b987,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 4731baa..6c6af53 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 _0x3fc6=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','save','update','remove'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x3fc6,0x159));var _0x63fc=function(_0x1511ce,_0x37e2d9){_0x1511ce=_0x1511ce-0x0;var _0x3986b7=_0x3fc6[_0x1511ce];return _0x3986b7;};'use strict';var EventEmitter=require(_0x63fc('0x0'));var ChatQueue=require(_0x63fc('0x1'))['db'][_0x63fc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63fc('0x3'),'afterUpdate':_0x63fc('0x4'),'afterDestroy':_0x63fc('0x5')};function emitEvent(_0x133695){return function(_0x155db7,_0x13c33d,_0x4e6030){ChatQueueEvents['emit'](_0x133695+':'+_0x155db7['id'],_0x155db7);ChatQueueEvents[_0x63fc('0x6')](_0x133695,_0x155db7);_0x4e6030(null);};}for(var e in events){if(events[_0x63fc('0x7')](e)){var event=events[e];ChatQueue[_0x63fc('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xc0b9=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0xd65c8d,_0x50621a){var _0x5f1323=function(_0x290a16){while(--_0x290a16){_0xd65c8d['push'](_0xd65c8d['shift']());}};_0x5f1323(++_0x50621a);}(_0xc0b9,0x152));var _0x9c0b=function(_0x2e15d6,_0x388a92){_0x2e15d6=_0x2e15d6-0x0;var _0x582498=_0xc0b9[_0x2e15d6];return _0x582498;};'use strict';var EventEmitter=require(_0x9c0b('0x0'));var ChatQueue=require(_0x9c0b('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c0b('0x2'),'afterUpdate':'update','afterDestroy':_0x9c0b('0x3')};function emitEvent(_0x39cd77){return function(_0x1db2c4,_0x59a53e,_0x472488){ChatQueueEvents[_0x9c0b('0x4')](_0x39cd77+':'+_0x1db2c4['id'],_0x1db2c4);ChatQueueEvents[_0x9c0b('0x4')](_0x39cd77,_0x1db2c4);_0x472488(null);};}for(var e in events){if(events[_0x9c0b('0x5')](e)){var event=events[e];ChatQueue[_0x9c0b('0x6')](e,emitEvent(event));}}module[_0x9c0b('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index f6acbc8..f500e7b 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 _0x8669=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','lodash','util','../../config/logger'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x8669,0x1d1));var _0x9866=function(_0xba26f1,_0x2709c9){_0xba26f1=_0xba26f1-0x0;var _0x5d5831=_0x8669[_0xba26f1];return _0x5d5831;};'use strict';var _=require(_0x9866('0x0'));var util=require(_0x9866('0x1'));var logger=require(_0x9866('0x2'))(_0x9866('0x3'));var moment=require(_0x9866('0x4'));var BPromise=require(_0x9866('0x5'));var rp=require(_0x9866('0x6'));var fs=require('fs');var path=require(_0x9866('0x7'));var rimraf=require(_0x9866('0x8'));var config=require(_0x9866('0x9'));var attributes=require(_0x9866('0xa'));module['exports']=function(_0x56cba8,_0x43cf87){return _0x56cba8[_0x9866('0xb')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9026=['path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9026,0xdf));var _0x6902=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x9026[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0x6902('0x0'));var logger=require(_0x6902('0x1'))(_0x6902('0x2'));var moment=require(_0x6902('0x3'));var BPromise=require('bluebird');var rp=require(_0x6902('0x4'));var fs=require('fs');var path=require(_0x6902('0x5'));var rimraf=require('rimraf');var config=require(_0x6902('0x6'));var attributes=require(_0x6902('0x7'));module[_0x6902('0x8')]=function(_0x17a475,_0x34c869){return _0x17a475[_0x6902('0x9')](_0x6902('0xa'),attributes,{'tableName':_0x6902('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index f502e90..b719144 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 _0x56c8=['include','attributes','map','model','then','ShowChatQueue','ChatQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','where','limit'];(function(_0x40a107,_0x5acc82){var _0x4beb59=function(_0x4bfb2a){while(--_0x4bfb2a){_0x40a107['push'](_0x40a107['shift']());}};_0x4beb59(++_0x5acc82);}(_0x56c8,0x12f));var _0x856c=function(_0x248876,_0x4660af){_0x248876=_0x248876-0x0;var _0xf1d63f=_0x56c8[_0x248876];return _0xf1d63f;};'use strict';var _=require(_0x856c('0x0'));var util=require(_0x856c('0x1'));var moment=require(_0x856c('0x2'));var BPromise=require(_0x856c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x856c('0x4'));var db=require(_0x856c('0x5'))['db'];var utils=require(_0x856c('0x6'));var logger=require(_0x856c('0x7'))(_0x856c('0x8'));var config=require('../../config/environment');var jayson=require(_0x856c('0x9'));var client=jayson[_0x856c('0xa')][_0x856c('0xb')]({'port':0x232a});config[_0x856c('0xc')]=_[_0x856c('0xd')](config[_0x856c('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x856c('0xc')]));require(_0x856c('0xe'))[_0x856c('0xf')](socket);function respondWithRpcPromise(_0x4c173b,_0x4b8bbc,_0x56217b){return new BPromise(function(_0x619489,_0x36e8ef){return client[_0x856c('0x10')](_0x4c173b,_0x56217b)['then'](function(_0x134cc9){logger[_0x856c('0x11')]('ChatQueue,\x20%s,\x20%s',_0x4b8bbc,_0x856c('0x12'));logger[_0x856c('0x13')](_0x856c('0x14'),_0x4b8bbc,_0x856c('0x12'),JSON[_0x856c('0x15')](_0x134cc9));if(_0x134cc9[_0x856c('0x16')]){if(_0x134cc9[_0x856c('0x16')][_0x856c('0x17')]===0x1f4){logger['error'](_0x856c('0x18'),_0x4b8bbc,_0x134cc9['error'][_0x856c('0x19')]);return _0x36e8ef(_0x134cc9[_0x856c('0x16')][_0x856c('0x19')]);}logger[_0x856c('0x16')](_0x856c('0x18'),_0x4b8bbc,_0x134cc9[_0x856c('0x16')][_0x856c('0x19')]);return _0x619489(_0x134cc9[_0x856c('0x16')][_0x856c('0x19')]);}else{logger[_0x856c('0x11')](_0x856c('0x18'),_0x4b8bbc,_0x856c('0x12'));_0x619489(_0x134cc9[_0x856c('0x1a')][_0x856c('0x19')]);}})[_0x856c('0x1b')](function(_0x27c7cc){logger[_0x856c('0x16')](_0x856c('0x18'),_0x4b8bbc,_0x27c7cc);_0x36e8ef(_0x27c7cc);});});}exports[_0x856c('0x1c')]=function(_0x1a262a){var _0x347b1b=this;return new Promise(function(_0x1dd835,_0x4c42e0){return db['ChatQueue'][_0x856c('0x1d')]({'raw':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1a262a[_0x856c('0x1e')]?_0x1a262a['options'][_0x856c('0x1f')]||null:null,'attributes':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')]['attributes']||null:null,'limit':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')][_0x856c('0x20')]||null:null,'include':_0x1a262a[_0x856c('0x1e')]?_0x1a262a[_0x856c('0x1e')][_0x856c('0x21')]?_['map'](_0x1a262a[_0x856c('0x1e')][_0x856c('0x21')],function(_0x4150ec){return{'model':db[_0x4150ec['model']],'as':_0x4150ec['as'],'attributes':_0x4150ec[_0x856c('0x22')],'include':_0x4150ec['include']?_[_0x856c('0x23')](_0x4150ec['include'],function(_0x3d38d4){return{'model':db[_0x3d38d4[_0x856c('0x24')]],'as':_0x3d38d4['as'],'attributes':_0x3d38d4['attributes'],'include':_0x3d38d4[_0x856c('0x21')]?_['map'](_0x3d38d4[_0x856c('0x21')],function(_0x384f5f){return{'model':db[_0x384f5f[_0x856c('0x24')]],'as':_0x384f5f['as'],'attributes':_0x384f5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x856c('0x25')](function(_0x3548ab){logger[_0x856c('0x11')]('GetChatQueue',_0x1a262a);logger['debug'](_0x856c('0x1c'),_0x1a262a,JSON[_0x856c('0x15')](_0x3548ab));_0x1dd835(_0x3548ab);})[_0x856c('0x1b')](function(_0x25cbab){logger[_0x856c('0x16')](_0x856c('0x1c'),_0x25cbab['message'],_0x1a262a);_0x4c42e0(_0x347b1b[_0x856c('0x16')](0x1f4,_0x25cbab[_0x856c('0x19')]));});});};exports[_0x856c('0x26')]=function(_0x39e4e){var _0x3ead28=this;return new Promise(function(_0x147f23,_0x5494c2){return db[_0x856c('0x27')][_0x856c('0x28')]({'raw':_0x39e4e[_0x856c('0x1e')]?_0x39e4e['options'][_0x856c('0x29')]===undefined?!![]:![]:!![],'where':_0x39e4e[_0x856c('0x1e')]?_0x39e4e['options'][_0x856c('0x1f')]||null:null,'attributes':_0x39e4e[_0x856c('0x1e')]?_0x39e4e[_0x856c('0x1e')][_0x856c('0x22')]||null:null,'include':_0x39e4e[_0x856c('0x1e')]?_0x39e4e['options'][_0x856c('0x21')]?_[_0x856c('0x23')](_0x39e4e[_0x856c('0x1e')][_0x856c('0x21')],function(_0x19acd5){return{'model':db[_0x19acd5[_0x856c('0x24')]],'as':_0x19acd5['as'],'attributes':_0x19acd5[_0x856c('0x22')],'include':_0x19acd5[_0x856c('0x21')]?_[_0x856c('0x23')](_0x19acd5[_0x856c('0x21')],function(_0x1faa6a){return{'model':db[_0x1faa6a[_0x856c('0x24')]],'as':_0x1faa6a['as'],'attributes':_0x1faa6a['attributes'],'include':_0x1faa6a['include']?_[_0x856c('0x23')](_0x1faa6a['include'],function(_0x208472){return{'model':db[_0x208472[_0x856c('0x24')]],'as':_0x208472['as'],'attributes':_0x208472[_0x856c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x856c('0x25')](function(_0x44ff0a){logger['info'](_0x856c('0x26'),_0x39e4e);logger[_0x856c('0x13')](_0x856c('0x26'),_0x39e4e,JSON[_0x856c('0x15')](_0x44ff0a));_0x147f23(_0x44ff0a);})[_0x856c('0x1b')](function(_0x4d7d48){logger[_0x856c('0x16')](_0x856c('0x26'),_0x4d7d48[_0x856c('0x19')],_0x39e4e);_0x5494c2(_0x3ead28[_0x856c('0x16')](0x1f4,_0x4d7d48[_0x856c('0x19')]));});});};
\ No newline at end of file
+var _0xce2f=['catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','ShowChatQueue','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result'];(function(_0x413a2f,_0x1eb399){var _0x1ad4f2=function(_0x5cf9b1){while(--_0x5cf9b1){_0x413a2f['push'](_0x413a2f['shift']());}};_0x1ad4f2(++_0x1eb399);}(_0xce2f,0x18a));var _0xfce2=function(_0x1b0d0d,_0x3d8d3f){_0x1b0d0d=_0x1b0d0d-0x0;var _0x2b7df9=_0xce2f[_0x1b0d0d];return _0x2b7df9;};'use strict';var _=require('lodash');var util=require(_0xfce2('0x0'));var moment=require(_0xfce2('0x1'));var BPromise=require(_0xfce2('0x2'));var rs=require(_0xfce2('0x3'));var fs=require('fs');var Redis=require(_0xfce2('0x4'));var db=require(_0xfce2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfce2('0x6'))('rpc');var config=require(_0xfce2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfce2('0x8')][_0xfce2('0x9')]({'port':0x232a});config[_0xfce2('0xa')]=_[_0xfce2('0xb')](config[_0xfce2('0xa')],{'host':_0xfce2('0xc'),'port':0x18eb});var socket=require(_0xfce2('0xd'))(new Redis(config[_0xfce2('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2141d1,_0x512cc4,_0x3f0071){return new BPromise(function(_0x4b2866,_0x441666){return client['request'](_0x2141d1,_0x3f0071)[_0xfce2('0xe')](function(_0xd76e83){logger[_0xfce2('0xf')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xfce2('0x10'));logger['debug'](_0xfce2('0x11'),_0x512cc4,_0xfce2('0x10'),JSON[_0xfce2('0x12')](_0xd76e83));if(_0xd76e83[_0xfce2('0x13')]){if(_0xd76e83[_0xfce2('0x13')][_0xfce2('0x14')]===0x1f4){logger[_0xfce2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xd76e83[_0xfce2('0x13')][_0xfce2('0x15')]);return _0x441666(_0xd76e83['error'][_0xfce2('0x15')]);}logger[_0xfce2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xd76e83['error'][_0xfce2('0x15')]);return _0x4b2866(_0xd76e83[_0xfce2('0x13')]['message']);}else{logger[_0xfce2('0xf')](_0xfce2('0x16'),_0x512cc4,_0xfce2('0x10'));_0x4b2866(_0xd76e83[_0xfce2('0x17')][_0xfce2('0x15')]);}})[_0xfce2('0x18')](function(_0x270e52){logger[_0xfce2('0x13')](_0xfce2('0x16'),_0x512cc4,_0x270e52);_0x441666(_0x270e52);});});}exports[_0xfce2('0x19')]=function(_0x4b90ed){var _0x56fb0e=this;return new Promise(function(_0x3c4f1f,_0x3ea07b){return db[_0xfce2('0x1a')][_0xfce2('0x1b')]({'raw':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed['options'][_0xfce2('0x1e')]||null:null,'attributes':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')]['attributes']||null:null,'limit':_0x4b90ed['options']?_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x1f')]||null:null,'include':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')]['include']?_[_0xfce2('0x20')](_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x21')],function(_0x47ed7f){return{'model':db[_0x47ed7f[_0xfce2('0x22')]],'as':_0x47ed7f['as'],'attributes':_0x47ed7f[_0xfce2('0x23')],'include':_0x47ed7f[_0xfce2('0x21')]?_['map'](_0x47ed7f[_0xfce2('0x21')],function(_0x2358dc){return{'model':db[_0x2358dc[_0xfce2('0x22')]],'as':_0x2358dc['as'],'attributes':_0x2358dc[_0xfce2('0x23')],'include':_0x2358dc['include']?_[_0xfce2('0x20')](_0x2358dc[_0xfce2('0x21')],function(_0x58022e){return{'model':db[_0x58022e[_0xfce2('0x22')]],'as':_0x58022e['as'],'attributes':_0x58022e[_0xfce2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfce2('0xe')](function(_0x1f48ba){logger['info'](_0xfce2('0x19'),_0x4b90ed);logger['debug'](_0xfce2('0x19'),_0x4b90ed,JSON[_0xfce2('0x12')](_0x1f48ba));_0x3c4f1f(_0x1f48ba);})[_0xfce2('0x18')](function(_0x35b7fe){logger[_0xfce2('0x13')](_0xfce2('0x19'),_0x35b7fe[_0xfce2('0x15')],_0x4b90ed);_0x3ea07b(_0x56fb0e[_0xfce2('0x13')](0x1f4,_0x35b7fe['message']));});});};exports[_0xfce2('0x24')]=function(_0x26a757){var _0x254206=this;return new Promise(function(_0x4b6657,_0x44d500){return db['ChatQueue']['find']({'raw':_0x26a757[_0xfce2('0x1c')]?_0x26a757['options'][_0xfce2('0x1d')]===undefined?!![]:![]:!![],'where':_0x26a757[_0xfce2('0x1c')]?_0x26a757[_0xfce2('0x1c')][_0xfce2('0x1e')]||null:null,'attributes':_0x26a757['options']?_0x26a757['options']['attributes']||null:null,'include':_0x26a757[_0xfce2('0x1c')]?_0x26a757[_0xfce2('0x1c')][_0xfce2('0x21')]?_[_0xfce2('0x20')](_0x26a757[_0xfce2('0x1c')]['include'],function(_0x4afa63){return{'model':db[_0x4afa63[_0xfce2('0x22')]],'as':_0x4afa63['as'],'attributes':_0x4afa63[_0xfce2('0x23')],'include':_0x4afa63[_0xfce2('0x21')]?_['map'](_0x4afa63[_0xfce2('0x21')],function(_0x4f7153){return{'model':db[_0x4f7153[_0xfce2('0x22')]],'as':_0x4f7153['as'],'attributes':_0x4f7153[_0xfce2('0x23')],'include':_0x4f7153[_0xfce2('0x21')]?_['map'](_0x4f7153['include'],function(_0x365873){return{'model':db[_0x365873[_0xfce2('0x22')]],'as':_0x365873['as'],'attributes':_0x365873[_0xfce2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfce2('0xe')](function(_0x52caca){logger[_0xfce2('0xf')]('ShowChatQueue',_0x26a757);logger[_0xfce2('0x25')]('ShowChatQueue',_0x26a757,JSON[_0xfce2('0x12')](_0x52caca));_0x4b6657(_0x52caca);})[_0xfce2('0x18')](function(_0x3bc14e){logger[_0xfce2('0x13')](_0xfce2('0x24'),_0x3bc14e['message'],_0x26a757);_0x44d500(_0x254206[_0xfce2('0x13')](0x1f4,_0x3bc14e[_0xfce2('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 42d3f51..b26b02b 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 _0xd13e=['removeListener','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0xd13e,0x193));var _0xed13=function(_0x5452ca,_0x125b62){_0x5452ca=_0x5452ca-0x0;var _0x1d1373=_0xd13e[_0x5452ca];return _0x1d1373;};'use strict';var ChatQueueEvents=require(_0xed13('0x0'));var events=[_0xed13('0x1'),_0xed13('0x2'),_0xed13('0x3')];function createListener(_0x50b476,_0x1a064e){return function(_0x5cdb65){_0x1a064e[_0xed13('0x4')](_0x50b476,_0x5cdb65);};}function removeListener(_0x59d4db,_0x46158d){return function(){ChatQueueEvents[_0xed13('0x5')](_0x59d4db,_0x46158d);};}exports['register']=function(_0x50de44){for(var _0x5142bd=0x0,_0x95ff4c=events[_0xed13('0x6')];_0x5142bd<_0x95ff4c;_0x5142bd++){var _0xab0fff=events[_0x5142bd];var _0x3b3984=createListener(_0xed13('0x7')+_0xab0fff,_0x50de44);ChatQueueEvents['on'](_0xab0fff,_0x3b3984);}};
\ No newline at end of file
+var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x302165,_0x4543d5){var _0x36059f=function(_0x596974){while(--_0x596974){_0x302165['push'](_0x302165['shift']());}};_0x36059f(++_0x4543d5);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5ec6dc,_0x1a6293){_0x5ec6dc=_0x5ec6dc-0x0;var _0x550a4b=_0x4c6d[_0x5ec6dc];return _0x550a4b;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c3f6f96..13afc01 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(_0x24ff41,_0x1fafde){var _0x1bfede=function(_0x5831d1){while(--_0x5831d1){_0x24ff41['push'](_0x24ff41['shift']());}};_0x1bfede(++_0x1fafde);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x5fc3[_0x3e0763];return _0x351ca2;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 8ae0788..7c4c315 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 _0x515f=['sequelize','STRING','DATE'];(function(_0x2e32a5,_0xc5e0e4){var _0xeaf48a=function(_0x2a0592){while(--_0x2a0592){_0x2e32a5['push'](_0x2e32a5['shift']());}};_0xeaf48a(++_0xc5e0e4);}(_0x515f,0x165));var _0xf515=function(_0x3b9e02,_0x394b1c){_0x3b9e02=_0x3b9e02-0x0;var _0xee324e=_0x515f[_0x3b9e02];return _0xee324e;};'use strict';var moment=require('moment');var Sequelize=require(_0xf515('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf515('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xf515('0x1')]},'joinAt':{'type':Sequelize[_0xf515('0x2')]},'leaveAt':{'type':Sequelize[_0xf515('0x2')]},'acceptAt':{'type':Sequelize[_0xf515('0x2')]},'exitAt':{'type':Sequelize[_0xf515('0x2')]},'reason':{'type':Sequelize[_0xf515('0x1')]}};
\ No newline at end of file
+var _0x961e=['DATE','exports','STRING'];(function(_0x5b10a7,_0x4e441d){var _0x23b5c8=function(_0x36d59b){while(--_0x36d59b){_0x5b10a7['push'](_0x5b10a7['shift']());}};_0x23b5c8(++_0x4e441d);}(_0x961e,0x1a8));var _0xe961=function(_0x290e73,_0x2351bb){_0x290e73=_0x290e73-0x0;var _0x1e0b65=_0x961e[_0x290e73];return _0x1e0b65;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe961('0x0')]={'uniqueid':{'type':Sequelize[_0xe961('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe961('0x1')]},'joinAt':{'type':Sequelize[_0xe961('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe961('0x2')]},'reason':{'type':Sequelize[_0xe961('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 1a15a56..8679c7b 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 _0x195f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','Content-Range','save','update','then','destroy','end','sendStatus','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4bb234,_0x105f9b){var _0x2f2db7=function(_0xc5c510){while(--_0xc5c510){_0x4bb234['push'](_0x4bb234['shift']());}};_0x2f2db7(++_0x105f9b);}(_0x195f,0x113));var _0xf195=function(_0x5ca644,_0x3d2165){_0x5ca644=_0x5ca644-0x0;var _0x5c87a2=_0x195f[_0x5ca644];return _0x5c87a2;};'use strict';var emlformat=require(_0xf195('0x0'));var rimraf=require(_0xf195('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf195('0x2'));var rp=require(_0xf195('0x3'));var moment=require('moment');var BPromise=require(_0xf195('0x4'));var Mustache=require('mustache');var util=require(_0xf195('0x5'));var path=require(_0xf195('0x6'));var sox=require(_0xf195('0x7'));var csv=require(_0xf195('0x8'));var ejs=require(_0xf195('0x9'));var fs=require('fs');var fs_extra=require(_0xf195('0xa'));var _=require(_0xf195('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf195('0xc'));var deskjs=require(_0xf195('0xd'));var toCsv=require(_0xf195('0x8'));var querystring=require(_0xf195('0xe'));var Papa=require(_0xf195('0xf'));var Redis=require(_0xf195('0x10'));var authService=require(_0xf195('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf195('0x12'));var hardwareService=require(_0xf195('0x13'));var logger=require(_0xf195('0x14'))('api');var utils=require(_0xf195('0x15'));var config=require(_0xf195('0x16'));var licenseUtil=require(_0xf195('0x17'));var db=require(_0xf195('0x18'))['db'];function respondWithStatusCode(_0x48c9d9,_0x3e12f4){_0x3e12f4=_0x3e12f4||0xcc;return function(_0x33844b){if(_0x33844b){return _0x48c9d9['sendStatus'](_0x3e12f4);}return _0x48c9d9[_0xf195('0x19')](_0x3e12f4)['end']();};}function respondWithResult(_0x3d06cc,_0x9c114){_0x9c114=_0x9c114||0xc8;return function(_0x345a44){if(_0x345a44){return _0x3d06cc[_0xf195('0x19')](_0x9c114)[_0xf195('0x1a')](_0x345a44);}};}function respondWithFilteredResult(_0x33b5c4,_0x5041fd){return function(_0xe76164){if(_0xe76164){var _0x4c1956=typeof _0x5041fd['offset']===_0xf195('0x1b')&&typeof _0x5041fd[_0xf195('0x1c')]===_0xf195('0x1b');var _0x321bd7=_0xe76164['count'];var _0x374fc6=_0x4c1956?0x0:_0x5041fd[_0xf195('0x1d')];var _0x5cf7dc=_0x4c1956?_0xe76164[_0xf195('0x1e')]:_0x5041fd[_0xf195('0x1d')]+_0x5041fd['limit'];var _0x15acd6;if(_0x5cf7dc>=_0x321bd7){_0x5cf7dc=_0x321bd7;_0x15acd6=0xc8;}else{_0x15acd6=0xce;}_0x33b5c4[_0xf195('0x19')](_0x15acd6);return _0x33b5c4['set'](_0xf195('0x1f'),_0x374fc6+'-'+_0x5cf7dc+'/'+_0x321bd7)[_0xf195('0x1a')](_0xe76164);}return null;};}function patchUpdates(_0x421cab){return function(_0x1eea05){try{jsonpatch['apply'](_0x1eea05,_0x421cab,!![]);}catch(_0x5933f0){return BPromise['reject'](_0x5933f0);}return _0x1eea05[_0xf195('0x20')]();};}function saveUpdates(_0x1b2821,_0x388c36){return function(_0x785aae){if(_0x785aae){return _0x785aae[_0xf195('0x21')](_0x1b2821)[_0xf195('0x22')](function(_0x3d3d14){return _0x3d3d14;});}return null;};}function removeEntity(_0x1ee8d6,_0x45cfa4){return function(_0x255d58){if(_0x255d58){return _0x255d58[_0xf195('0x23')]()[_0xf195('0x22')](function(){_0x1ee8d6['status'](0xcc)[_0xf195('0x24')]();});}};}function handleEntityNotFound(_0x246750,_0x3dddd3){return function(_0x2ae42e){if(!_0x2ae42e){_0x246750[_0xf195('0x25')](0x194);}return _0x2ae42e;};}function handleError(_0x23484e,_0x1ea31a){_0x1ea31a=_0x1ea31a||0x1f4;return function(_0x3c1371){logger['error'](_0x3c1371['stack']);if(_0x3c1371[_0xf195('0x26')]){delete _0x3c1371[_0xf195('0x26')];}_0x23484e[_0xf195('0x19')](_0x1ea31a)[_0xf195('0x27')](_0x3c1371);};}exports[_0xf195('0x28')]=function(_0x37b3c6,_0x408e3b){var _0x3c592e={},_0x5dbca={},_0x7d3a34={'count':0x0,'rows':[]};var _0xe3465f=_[_0xf195('0x29')](db[_0xf195('0x2a')][_0xf195('0x2b')],function(_0xdb8e93){return{'name':_0xdb8e93[_0xf195('0x2c')],'type':_0xdb8e93[_0xf195('0x2d')][_0xf195('0x2e')]};});_0x5dbca[_0xf195('0x2f')]=_['map'](_0xe3465f,_0xf195('0x26'));_0x5dbca[_0xf195('0x30')]=_[_0xf195('0x31')](_0x37b3c6[_0xf195('0x30')]);_0x5dbca[_0xf195('0x32')]=_[_0xf195('0x33')](_0x5dbca[_0xf195('0x2f')],_0x5dbca[_0xf195('0x30')]);_0x3c592e[_0xf195('0x34')]=_[_0xf195('0x33')](_0x5dbca[_0xf195('0x2f')],qs[_0xf195('0x35')](_0x37b3c6[_0xf195('0x30')][_0xf195('0x35')]));_0x3c592e[_0xf195('0x34')]=_0x3c592e[_0xf195('0x34')][_0xf195('0x36')]?_0x3c592e['attributes']:_0x5dbca[_0xf195('0x2f')];if(!_0x37b3c6[_0xf195('0x30')][_0xf195('0x37')](_0xf195('0x38'))){_0x3c592e[_0xf195('0x1c')]=qs['limit'](_0x37b3c6[_0xf195('0x30')][_0xf195('0x1c')]);_0x3c592e[_0xf195('0x1d')]=qs['offset'](_0x37b3c6['query'][_0xf195('0x1d')]);}_0x3c592e[_0xf195('0x39')]=qs[_0xf195('0x3a')](_0x37b3c6[_0xf195('0x30')][_0xf195('0x3a')]);_0x3c592e[_0xf195('0x3b')]=qs[_0xf195('0x32')](_[_0xf195('0x3c')](_0x37b3c6[_0xf195('0x30')],_0x5dbca[_0xf195('0x32')]),_0xe3465f);if(_0x37b3c6['query']['filter']){_0x3c592e[_0xf195('0x3b')]=_[_0xf195('0x3d')](_0x3c592e[_0xf195('0x3b')],{'$or':_[_0xf195('0x29')](_0xe3465f,function(_0x4059b3){if(_0x4059b3[_0xf195('0x2d')]!==_0xf195('0x3e')){var _0x34f3ce={};_0x34f3ce[_0x4059b3['name']]={'$like':'%'+_0x37b3c6[_0xf195('0x30')]['filter']+'%'};return _0x34f3ce;}})});}_0x3c592e=_['merge']({},_0x3c592e,_0x37b3c6[_0xf195('0x3f')]);var _0x83c396={'where':_0x3c592e[_0xf195('0x3b')]};return db[_0xf195('0x2a')][_0xf195('0x1e')](_0x83c396)[_0xf195('0x22')](function(_0x7f9360){_0x7d3a34[_0xf195('0x1e')]=_0x7f9360;if(_0x37b3c6[_0xf195('0x30')][_0xf195('0x40')]){_0x3c592e[_0xf195('0x41')]=[{'all':!![]}];}return db[_0xf195('0x2a')][_0xf195('0x42')](_0x3c592e);})[_0xf195('0x22')](function(_0x49edfb){_0x7d3a34['rows']=_0x49edfb;return _0x7d3a34;})[_0xf195('0x22')](respondWithFilteredResult(_0x408e3b,_0x3c592e))[_0xf195('0x43')](handleError(_0x408e3b,null));};exports[_0xf195('0x44')]=function(_0x6b22ec,_0x382fd9){var _0x1907ce={'raw':!![],'where':{'id':_0x6b22ec[_0xf195('0x45')]['id']}},_0x343f3e={};_0x343f3e['model']=_[_0xf195('0x31')](db[_0xf195('0x2a')][_0xf195('0x2b')]);_0x343f3e[_0xf195('0x30')]=_[_0xf195('0x31')](_0x6b22ec[_0xf195('0x30')]);_0x343f3e[_0xf195('0x32')]=_['intersection'](_0x343f3e[_0xf195('0x2f')],_0x343f3e[_0xf195('0x30')]);_0x1907ce['attributes']=_[_0xf195('0x33')](_0x343f3e['model'],qs[_0xf195('0x35')](_0x6b22ec[_0xf195('0x30')][_0xf195('0x35')]));_0x1907ce['attributes']=_0x1907ce[_0xf195('0x34')][_0xf195('0x36')]?_0x1907ce['attributes']:_0x343f3e[_0xf195('0x2f')];if(_0x6b22ec[_0xf195('0x30')][_0xf195('0x40')]){_0x1907ce[_0xf195('0x41')]=[{'all':!![]}];}_0x1907ce=_[_0xf195('0x3d')]({},_0x1907ce,_0x6b22ec['options']);return db[_0xf195('0x2a')][_0xf195('0x46')](_0x1907ce)[_0xf195('0x22')](handleEntityNotFound(_0x382fd9,null))[_0xf195('0x22')](respondWithResult(_0x382fd9,null))[_0xf195('0x43')](handleError(_0x382fd9,null));};exports[_0xf195('0x47')]=function(_0x2362da,_0x30fc9b){return db['ChatQueueReport'][_0xf195('0x47')](_0x2362da['body'],{})[_0xf195('0x22')](respondWithResult(_0x30fc9b,0xc9))[_0xf195('0x43')](handleError(_0x30fc9b,null));};exports[_0xf195('0x21')]=function(_0x42f895,_0x2e56ea){if(_0x42f895[_0xf195('0x48')]['id']){delete _0x42f895[_0xf195('0x48')]['id'];}return db[_0xf195('0x2a')]['find']({'where':{'id':_0x42f895[_0xf195('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e56ea,null))[_0xf195('0x22')](saveUpdates(_0x42f895[_0xf195('0x48')],null))[_0xf195('0x22')](respondWithResult(_0x2e56ea,null))[_0xf195('0x43')](handleError(_0x2e56ea,null));};exports[_0xf195('0x23')]=function(_0x586275,_0x33a0a6){return db[_0xf195('0x2a')][_0xf195('0x46')]({'where':{'id':_0x586275[_0xf195('0x45')]['id']}})['then'](handleEntityNotFound(_0x33a0a6,null))[_0xf195('0x22')](removeEntity(_0x33a0a6,null))[_0xf195('0x43')](handleError(_0x33a0a6,null));};exports['describe']=function(_0x1d7fbc,_0x29bb46){return db[_0xf195('0x2a')][_0xf195('0x49')]()[_0xf195('0x22')](respondWithResult(_0x29bb46,null))['catch'](handleError(_0x29bb46,null));};
\ No newline at end of file
+var _0x3914=['filter','VIRTUAL','merge','include','findAll','rows','catch','params','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','send','index','map','ChatQueueReport','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x19c429,_0x178ed2){var _0x5f2a33=function(_0x57214e){while(--_0x57214e){_0x19c429['push'](_0x19c429['shift']());}};_0x5f2a33(++_0x178ed2);}(_0x3914,0xeb));var _0x4391=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x3914[_0x2fbd0e];return _0x481c9f;};'use strict';var emlformat=require(_0x4391('0x0'));var rimraf=require(_0x4391('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4391('0x2'));var rp=require(_0x4391('0x3'));var moment=require('moment');var BPromise=require(_0x4391('0x4'));var Mustache=require(_0x4391('0x5'));var util=require(_0x4391('0x6'));var path=require('path');var sox=require(_0x4391('0x7'));var csv=require(_0x4391('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4391('0x9'));var _=require('lodash');var squel=require(_0x4391('0xa'));var crypto=require('crypto');var jsforce=require(_0x4391('0xb'));var deskjs=require(_0x4391('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4391('0xd'));var Redis=require(_0x4391('0xe'));var authService=require(_0x4391('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4391('0x10'));var hardwareService=require(_0x4391('0x11'));var logger=require(_0x4391('0x12'))(_0x4391('0x13'));var utils=require('../../config/utils');var config=require(_0x4391('0x14'));var licenseUtil=require(_0x4391('0x15'));var db=require(_0x4391('0x16'))['db'];function respondWithStatusCode(_0x137902,_0x254ffb){_0x254ffb=_0x254ffb||0xcc;return function(_0xdebb72){if(_0xdebb72){return _0x137902[_0x4391('0x17')](_0x254ffb);}return _0x137902[_0x4391('0x18')](_0x254ffb)['end']();};}function respondWithResult(_0x1a49ba,_0x3bd3a7){_0x3bd3a7=_0x3bd3a7||0xc8;return function(_0x3f82fb){if(_0x3f82fb){return _0x1a49ba[_0x4391('0x18')](_0x3bd3a7)['json'](_0x3f82fb);}};}function respondWithFilteredResult(_0x62c763,_0x4ff882){return function(_0x343203){if(_0x343203){var _0x3a1b80=typeof _0x4ff882[_0x4391('0x19')]===_0x4391('0x1a')&&typeof _0x4ff882[_0x4391('0x1b')]===_0x4391('0x1a');var _0x2b5117=_0x343203[_0x4391('0x1c')];var _0x58a311=_0x3a1b80?0x0:_0x4ff882['offset'];var _0x2ecb23=_0x3a1b80?_0x343203['count']:_0x4ff882[_0x4391('0x19')]+_0x4ff882[_0x4391('0x1b')];var _0xa9c97f;if(_0x2ecb23>=_0x2b5117){_0x2ecb23=_0x2b5117;_0xa9c97f=0xc8;}else{_0xa9c97f=0xce;}_0x62c763[_0x4391('0x18')](_0xa9c97f);return _0x62c763[_0x4391('0x1d')]('Content-Range',_0x58a311+'-'+_0x2ecb23+'/'+_0x2b5117)['json'](_0x343203);}return null;};}function patchUpdates(_0x36c34c){return function(_0x37fca4){try{jsonpatch[_0x4391('0x1e')](_0x37fca4,_0x36c34c,!![]);}catch(_0x5570a8){return BPromise[_0x4391('0x1f')](_0x5570a8);}return _0x37fca4[_0x4391('0x20')]();};}function saveUpdates(_0x737d10,_0x3e1e0b){return function(_0x505d2c){if(_0x505d2c){return _0x505d2c[_0x4391('0x21')](_0x737d10)[_0x4391('0x22')](function(_0x3c4c9b){return _0x3c4c9b;});}return null;};}function removeEntity(_0xfee343,_0x24e16c){return function(_0x40ff34){if(_0x40ff34){return _0x40ff34['destroy']()[_0x4391('0x22')](function(){_0xfee343[_0x4391('0x18')](0xcc)[_0x4391('0x23')]();});}};}function handleEntityNotFound(_0x333ca6,_0x540339){return function(_0x4b0c28){if(!_0x4b0c28){_0x333ca6[_0x4391('0x17')](0x194);}return _0x4b0c28;};}function handleError(_0x3aa79f,_0x3f2554){_0x3f2554=_0x3f2554||0x1f4;return function(_0x197408){logger[_0x4391('0x24')](_0x197408['stack']);if(_0x197408['name']){delete _0x197408['name'];}_0x3aa79f['status'](_0x3f2554)[_0x4391('0x25')](_0x197408);};}exports[_0x4391('0x26')]=function(_0x471d43,_0x2f7b18){var _0x49aa36={},_0x34059f={},_0x32ed74={'count':0x0,'rows':[]};var _0x115e36=_[_0x4391('0x27')](db[_0x4391('0x28')]['rawAttributes'],function(_0x1a8df0){return{'name':_0x1a8df0[_0x4391('0x29')],'type':_0x1a8df0[_0x4391('0x2a')][_0x4391('0x2b')]};});_0x34059f[_0x4391('0x2c')]=_[_0x4391('0x27')](_0x115e36,_0x4391('0x2d'));_0x34059f[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x471d43[_0x4391('0x2e')]);_0x34059f[_0x4391('0x30')]=_['intersection'](_0x34059f[_0x4391('0x2c')],_0x34059f['query']);_0x49aa36[_0x4391('0x31')]=_['intersection'](_0x34059f['model'],qs[_0x4391('0x32')](_0x471d43[_0x4391('0x2e')][_0x4391('0x32')]));_0x49aa36[_0x4391('0x31')]=_0x49aa36[_0x4391('0x31')][_0x4391('0x33')]?_0x49aa36[_0x4391('0x31')]:_0x34059f['model'];if(!_0x471d43[_0x4391('0x2e')]['hasOwnProperty'](_0x4391('0x34'))){_0x49aa36['limit']=qs[_0x4391('0x1b')](_0x471d43[_0x4391('0x2e')][_0x4391('0x1b')]);_0x49aa36[_0x4391('0x19')]=qs[_0x4391('0x19')](_0x471d43[_0x4391('0x2e')][_0x4391('0x19')]);}_0x49aa36[_0x4391('0x35')]=qs[_0x4391('0x36')](_0x471d43[_0x4391('0x2e')][_0x4391('0x36')]);_0x49aa36[_0x4391('0x37')]=qs[_0x4391('0x30')](_[_0x4391('0x38')](_0x471d43[_0x4391('0x2e')],_0x34059f[_0x4391('0x30')]),_0x115e36);if(_0x471d43[_0x4391('0x2e')][_0x4391('0x39')]){_0x49aa36['where']=_['merge'](_0x49aa36[_0x4391('0x37')],{'$or':_[_0x4391('0x27')](_0x115e36,function(_0x58e161){if(_0x58e161[_0x4391('0x2a')]!==_0x4391('0x3a')){var _0x1c716c={};_0x1c716c[_0x58e161[_0x4391('0x2d')]]={'$like':'%'+_0x471d43[_0x4391('0x2e')]['filter']+'%'};return _0x1c716c;}})});}_0x49aa36=_[_0x4391('0x3b')]({},_0x49aa36,_0x471d43['options']);var _0x5ec1cf={'where':_0x49aa36['where']};return db['ChatQueueReport'][_0x4391('0x1c')](_0x5ec1cf)[_0x4391('0x22')](function(_0x33736a){_0x32ed74[_0x4391('0x1c')]=_0x33736a;if(_0x471d43['query']['includeAll']){_0x49aa36[_0x4391('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x4391('0x3d')](_0x49aa36);})[_0x4391('0x22')](function(_0x3bfcdc){_0x32ed74[_0x4391('0x3e')]=_0x3bfcdc;return _0x32ed74;})[_0x4391('0x22')](respondWithFilteredResult(_0x2f7b18,_0x49aa36))[_0x4391('0x3f')](handleError(_0x2f7b18,null));};exports['show']=function(_0x2708e2,_0x3da701){var _0x361f44={'raw':!![],'where':{'id':_0x2708e2[_0x4391('0x40')]['id']}},_0x13f5f4={};_0x13f5f4[_0x4391('0x2c')]=_[_0x4391('0x2f')](db['ChatQueueReport'][_0x4391('0x41')]);_0x13f5f4[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x2708e2[_0x4391('0x2e')]);_0x13f5f4[_0x4391('0x30')]=_[_0x4391('0x42')](_0x13f5f4[_0x4391('0x2c')],_0x13f5f4['query']);_0x361f44[_0x4391('0x31')]=_['intersection'](_0x13f5f4[_0x4391('0x2c')],qs[_0x4391('0x32')](_0x2708e2[_0x4391('0x2e')][_0x4391('0x32')]));_0x361f44[_0x4391('0x31')]=_0x361f44[_0x4391('0x31')][_0x4391('0x33')]?_0x361f44[_0x4391('0x31')]:_0x13f5f4[_0x4391('0x2c')];if(_0x2708e2[_0x4391('0x2e')][_0x4391('0x43')]){_0x361f44[_0x4391('0x3c')]=[{'all':!![]}];}_0x361f44=_[_0x4391('0x3b')]({},_0x361f44,_0x2708e2['options']);return db['ChatQueueReport'][_0x4391('0x44')](_0x361f44)[_0x4391('0x22')](handleEntityNotFound(_0x3da701,null))[_0x4391('0x22')](respondWithResult(_0x3da701,null))[_0x4391('0x3f')](handleError(_0x3da701,null));};exports[_0x4391('0x45')]=function(_0x25c7f6,_0x4efc22){return db[_0x4391('0x28')]['create'](_0x25c7f6[_0x4391('0x46')],{})['then'](respondWithResult(_0x4efc22,0xc9))[_0x4391('0x3f')](handleError(_0x4efc22,null));};exports[_0x4391('0x21')]=function(_0x738d35,_0x1b07b2){if(_0x738d35[_0x4391('0x46')]['id']){delete _0x738d35[_0x4391('0x46')]['id'];}return db['ChatQueueReport'][_0x4391('0x44')]({'where':{'id':_0x738d35[_0x4391('0x40')]['id']}})[_0x4391('0x22')](handleEntityNotFound(_0x1b07b2,null))[_0x4391('0x22')](saveUpdates(_0x738d35[_0x4391('0x46')],null))[_0x4391('0x22')](respondWithResult(_0x1b07b2,null))[_0x4391('0x3f')](handleError(_0x1b07b2,null));};exports[_0x4391('0x47')]=function(_0x1ca698,_0x294498){return db[_0x4391('0x28')][_0x4391('0x44')]({'where':{'id':_0x1ca698[_0x4391('0x40')]['id']}})['then'](handleEntityNotFound(_0x294498,null))[_0x4391('0x22')](removeEntity(_0x294498,null))[_0x4391('0x3f')](handleError(_0x294498,null));};exports[_0x4391('0x48')]=function(_0x516c64,_0x156614){return db[_0x4391('0x28')][_0x4391('0x48')]()['then'](respondWithResult(_0x156614,null))[_0x4391('0x3f')](handleError(_0x156614,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index a8894f3..dc41af0 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_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 17af33d..4bc04f9 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 _0xdace=['stringify','error','code','message','catch','ChatQueueReport','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','attributes','limit','debug','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x65f140,_0x45cbc7){var _0x18fbda=function(_0x26fb39){while(--_0x26fb39){_0x65f140['push'](_0x65f140['shift']());}};_0x18fbda(++_0x45cbc7);}(_0xdace,0x9f));var _0xedac=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdace[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xedac('0x0'));var moment=require(_0xedac('0x1'));var BPromise=require('bluebird');var rs=require(_0xedac('0x2'));var fs=require('fs');var Redis=require(_0xedac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xedac('0x4'));var logger=require('../../config/logger')(_0xedac('0x5'));var config=require(_0xedac('0x6'));var jayson=require(_0xedac('0x7'));var client=jayson[_0xedac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22662d,_0x511949,_0xe3371f){return new BPromise(function(_0x29dcc2,_0x1fceca){return client[_0xedac('0x9')](_0x22662d,_0xe3371f)[_0xedac('0xa')](function(_0x2a8524){logger[_0xedac('0xb')](_0xedac('0xc'),_0x511949,_0xedac('0xd'));logger['debug'](_0xedac('0xe'),_0x511949,_0xedac('0xd'),JSON[_0xedac('0xf')](_0x2a8524));if(_0x2a8524[_0xedac('0x10')]){if(_0x2a8524[_0xedac('0x10')][_0xedac('0x11')]===0x1f4){logger[_0xedac('0x10')](_0xedac('0xc'),_0x511949,_0x2a8524[_0xedac('0x10')]['message']);return _0x1fceca(_0x2a8524[_0xedac('0x10')]['message']);}logger['error'](_0xedac('0xc'),_0x511949,_0x2a8524[_0xedac('0x10')]['message']);return _0x29dcc2(_0x2a8524[_0xedac('0x10')][_0xedac('0x12')]);}else{logger[_0xedac('0xb')](_0xedac('0xc'),_0x511949,_0xedac('0xd'));_0x29dcc2(_0x2a8524['result'][_0xedac('0x12')]);}})[_0xedac('0x13')](function(_0x4e579b){logger[_0xedac('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x511949,_0x4e579b);_0x1fceca(_0x4e579b);});});}exports['CreateChatQueueReport']=function(_0xfb6631){var _0x23dea8=this;return new Promise(function(_0x2f02f2,_0x1fd0e3){return db[_0xedac('0x14')]['create'](_0xfb6631[_0xedac('0x15')],{'raw':_0xfb6631[_0xedac('0x16')]?_0xfb6631[_0xedac('0x16')][_0xedac('0x17')]===undefined?!![]:![]:!![]})[_0xedac('0xa')](function(_0x3bc9a3){logger[_0xedac('0xb')](_0xedac('0x18'),_0xfb6631);logger['debug']('CreateChatQueueReport',_0xfb6631,JSON[_0xedac('0xf')](_0x3bc9a3));_0x2f02f2(_0x3bc9a3);})[_0xedac('0x13')](function(_0xdccccc){logger['error'](_0xedac('0x18'),_0xdccccc['message'],_0xfb6631);_0x1fd0e3(_0x23dea8[_0xedac('0x10')](0x1f4,_0xdccccc['message']));});});};exports[_0xedac('0x19')]=function(_0x8359de){var _0x1871ff=this;return new Promise(function(_0x29a0f5,_0x238182){return db[_0xedac('0x14')]['update'](_0x8359de[_0xedac('0x15')],{'raw':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8359de[_0xedac('0x16')]?_0x8359de['options']['where']||null:null,'attributes':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x1a')]||null:null,'limit':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x1b')]||null:null})[_0xedac('0xa')](function(_0x2a8f44){logger[_0xedac('0xb')](_0xedac('0x19'),_0x8359de);logger[_0xedac('0x1c')](_0xedac('0x19'),_0x8359de,JSON[_0xedac('0xf')](_0x2a8f44));_0x29a0f5(_0x2a8f44);})[_0xedac('0x13')](function(_0x4aa9c3){logger[_0xedac('0x10')]('UpdateChatQueueReport',_0x4aa9c3[_0xedac('0x12')],_0x8359de);_0x238182(_0x1871ff[_0xedac('0x10')](0x1f4,_0x4aa9c3['message']));});});};
\ No newline at end of file
+var _0x9ff3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','randomstring'];(function(_0x587218,_0x246b3e){var _0x444925=function(_0x446422){while(--_0x446422){_0x587218['push'](_0x587218['shift']());}};_0x444925(++_0x246b3e);}(_0x9ff3,0x104));var _0x39ff=function(_0xfd773b,_0xca2cb3){_0xfd773b=_0xfd773b-0x0;var _0x4927fb=_0x9ff3[_0xfd773b];return _0x4927fb;};'use strict';var _=require(_0x39ff('0x0'));var util=require(_0x39ff('0x1'));var moment=require(_0x39ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x39ff('0x3'));var fs=require('fs');var Redis=require(_0x39ff('0x4'));var db=require(_0x39ff('0x5'))['db'];var utils=require(_0x39ff('0x6'));var logger=require(_0x39ff('0x7'))(_0x39ff('0x8'));var config=require(_0x39ff('0x9'));var jayson=require(_0x39ff('0xa'));var client=jayson['client'][_0x39ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5261ee,_0x169b62,_0x22eeb0){return new BPromise(function(_0xe8bdff,_0x5d2cab){return client[_0x39ff('0xc')](_0x5261ee,_0x22eeb0)[_0x39ff('0xd')](function(_0x19b86c){logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,_0x39ff('0x10'));logger[_0x39ff('0x11')](_0x39ff('0x12'),_0x169b62,_0x39ff('0x10'),JSON[_0x39ff('0x13')](_0x19b86c));if(_0x19b86c['error']){if(_0x19b86c[_0x39ff('0x14')]['code']===0x1f4){logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0x5d2cab(_0x19b86c[_0x39ff('0x14')]['message']);}logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0xe8bdff(_0x19b86c['error'][_0x39ff('0x15')]);}else{logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,'request\x20sent');_0xe8bdff(_0x19b86c['result'][_0x39ff('0x15')]);}})[_0x39ff('0x16')](function(_0x375ada){logger[_0x39ff('0x14')](_0x39ff('0xf'),_0x169b62,_0x375ada);_0x5d2cab(_0x375ada);});});}exports[_0x39ff('0x17')]=function(_0x51a775){var _0x1df667=this;return new Promise(function(_0x1b0f3f,_0x3dbbb5){return db[_0x39ff('0x18')][_0x39ff('0x19')](_0x51a775[_0x39ff('0x1a')],{'raw':_0x51a775[_0x39ff('0x1b')]?_0x51a775[_0x39ff('0x1b')][_0x39ff('0x1c')]===undefined?!![]:![]:!![]})[_0x39ff('0xd')](function(_0x411621){logger['info'](_0x39ff('0x17'),_0x51a775);logger[_0x39ff('0x11')]('CreateChatQueueReport',_0x51a775,JSON[_0x39ff('0x13')](_0x411621));_0x1b0f3f(_0x411621);})[_0x39ff('0x16')](function(_0x308dd4){logger[_0x39ff('0x14')](_0x39ff('0x17'),_0x308dd4[_0x39ff('0x15')],_0x51a775);_0x3dbbb5(_0x1df667[_0x39ff('0x14')](0x1f4,_0x308dd4[_0x39ff('0x15')]));});});};exports[_0x39ff('0x1d')]=function(_0x92388c){var _0x293dc0=this;return new Promise(function(_0x13eb0b,_0x47afe5){return db[_0x39ff('0x18')][_0x39ff('0x1e')](_0x92388c[_0x39ff('0x1a')],{'raw':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')][_0x39ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')]['where']||null:null,'attributes':_0x92388c[_0x39ff('0x1b')]?_0x92388c['options'][_0x39ff('0x1f')]||null:null,'limit':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')][_0x39ff('0x20')]||null:null})['then'](function(_0x490084){logger['info'](_0x39ff('0x1d'),_0x92388c);logger['debug'](_0x39ff('0x1d'),_0x92388c,JSON[_0x39ff('0x13')](_0x490084));_0x13eb0b(_0x490084);})[_0x39ff('0x16')](function(_0x10e9ed){logger[_0x39ff('0x14')]('UpdateChatQueueReport',_0x10e9ed[_0x39ff('0x15')],_0x92388c);_0x47afe5(_0x293dc0[_0x39ff('0x14')](0x1f4,_0x10e9ed[_0x39ff('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index cfe45c9..2e7cf4f 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 _0x5e98=['get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5e98,0x123));var _0x85e9=function(_0x2b79db,_0x47e974){_0x2b79db=_0x2b79db-0x0;var _0x1943cf=_0x5e98[_0x2b79db];return _0x1943cf;};'use strict';var multer=require(_0x85e9('0x0'));var util=require(_0x85e9('0x1'));var path=require(_0x85e9('0x2'));var timeout=require('connect-timeout');var express=require(_0x85e9('0x3'));var router=express[_0x85e9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x85e9('0x5'));var interaction=require(_0x85e9('0x6'));var config=require(_0x85e9('0x7'));var controller=require(_0x85e9('0x8'));router[_0x85e9('0x9')]('/',auth[_0x85e9('0xa')](),controller[_0x85e9('0xb')]);router[_0x85e9('0x9')](_0x85e9('0xc'),auth[_0x85e9('0xa')](),controller[_0x85e9('0xd')]);router['get'](_0x85e9('0xe'),auth['isAuthenticated'](),controller[_0x85e9('0xf')]);router[_0x85e9('0x10')]('/',auth[_0x85e9('0xa')](),controller['create']);router['put']('/:id',auth[_0x85e9('0xa')](),controller[_0x85e9('0x11')]);router[_0x85e9('0x12')](_0x85e9('0xe'),auth[_0x85e9('0xa')](),controller[_0x85e9('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xc72a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','create','put','update','delete','/:id','destroy','express'];(function(_0x1ef734,_0x57c70c){var _0x4ba9a5=function(_0x2c61ac){while(--_0x2c61ac){_0x1ef734['push'](_0x1ef734['shift']());}};_0x4ba9a5(++_0x57c70c);}(_0xc72a,0xcf));var _0xac72=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xc72a[_0x3bf925];return _0x2128a1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac72('0x0'));var router=express[_0xac72('0x1')]();var fs_extra=require(_0xac72('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xac72('0x3'));var config=require(_0xac72('0x4'));var controller=require('./chatQueueReport.controller');router[_0xac72('0x5')]('/',auth[_0xac72('0x6')](),controller['index']);router[_0xac72('0x5')](_0xac72('0x7'),auth[_0xac72('0x6')](),controller[_0xac72('0x8')]);router[_0xac72('0x5')]('/:id',auth[_0xac72('0x6')](),controller[_0xac72('0x9')]);router['post']('/',auth[_0xac72('0x6')](),controller[_0xac72('0xa')]);router[_0xac72('0xb')]('/:id',auth[_0xac72('0x6')](),controller[_0xac72('0xc')]);router[_0xac72('0xd')](_0xac72('0xe'),auth[_0xac72('0x6')](),controller[_0xac72('0xf')]);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 3975e7a..36ae5aa 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x35ab16,_0x54155a){var _0x3f768d=function(_0x5c5d32){while(--_0x5c5d32){_0x35ab16['push'](_0x35ab16['shift']());}};_0x3f768d(++_0x54155a);}(_0xaa88,0x137));var _0x8aa8=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xaa88[_0x47e549];return _0x251374;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x538e8e,_0x3d57f6){var _0x21252a=function(_0x321171){while(--_0x321171){_0x538e8e['push'](_0x538e8e['shift']());}};_0x21252a(++_0x3d57f6);}(_0x70e0,0x17b));var _0x070e=function(_0x538cc5,_0x3716f7){_0x538cc5=_0x538cc5-0x0;var _0x28239=_0x70e0[_0x538cc5];return _0x28239;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 5fe6ae4..d2ea4d1 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 _0x046b=['pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x33e0f6,_0x286ceb){var _0xee24dc=function(_0x5e7c96){while(--_0x5e7c96){_0x33e0f6['push'](_0x33e0f6['shift']());}};_0xee24dc(++_0x286ceb);}(_0x046b,0x13d));var _0xb046=function(_0x20048c,_0x337690){_0x20048c=_0x20048c-0x0;var _0x1d7f4b=_0x046b[_0x20048c];return _0x1d7f4b;};'use strict';var emlformat=require(_0xb046('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb046('0x1'));var jsonpatch=require(_0xb046('0x2'));var rp=require(_0xb046('0x3'));var moment=require(_0xb046('0x4'));var BPromise=require(_0xb046('0x5'));var Mustache=require(_0xb046('0x6'));var util=require(_0xb046('0x7'));var path=require(_0xb046('0x8'));var sox=require(_0xb046('0x9'));var csv=require(_0xb046('0xa'));var ejs=require(_0xb046('0xb'));var fs=require('fs');var fs_extra=require(_0xb046('0xc'));var _=require(_0xb046('0xd'));var squel=require(_0xb046('0xe'));var crypto=require(_0xb046('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb046('0x10'));var toCsv=require(_0xb046('0xa'));var querystring=require(_0xb046('0x11'));var Papa=require(_0xb046('0x12'));var Redis=require('ioredis');var authService=require(_0xb046('0x13'));var qs=require(_0xb046('0x14'));var as=require(_0xb046('0x15'));var hardwareService=require(_0xb046('0x16'));var logger=require(_0xb046('0x17'))(_0xb046('0x18'));var utils=require(_0xb046('0x19'));var config=require(_0xb046('0x1a'));var licenseUtil=require(_0xb046('0x1b'));var db=require(_0xb046('0x1c'))['db'];function respondWithStatusCode(_0x3269e5,_0x4e9b20){_0x4e9b20=_0x4e9b20||0xcc;return function(_0x174fdd){if(_0x174fdd){return _0x3269e5[_0xb046('0x1d')](_0x4e9b20);}return _0x3269e5[_0xb046('0x1e')](_0x4e9b20)[_0xb046('0x1f')]();};}function respondWithResult(_0x4126d5,_0x88c3ab){_0x88c3ab=_0x88c3ab||0xc8;return function(_0xe21a97){if(_0xe21a97){return _0x4126d5['status'](_0x88c3ab)[_0xb046('0x20')](_0xe21a97);}};}function respondWithFilteredResult(_0x5aab93,_0x475315){return function(_0x9b36e8){if(_0x9b36e8){var _0x3e4f98=typeof _0x475315[_0xb046('0x21')]==='undefined'&&typeof _0x475315[_0xb046('0x22')]===_0xb046('0x23');var _0x5175c8=_0x9b36e8['count'];var _0x561b31=_0x3e4f98?0x0:_0x475315[_0xb046('0x21')];var _0x4d0870=_0x3e4f98?_0x9b36e8[_0xb046('0x24')]:_0x475315[_0xb046('0x21')]+_0x475315['limit'];var _0x39d2e8;if(_0x4d0870>=_0x5175c8){_0x4d0870=_0x5175c8;_0x39d2e8=0xc8;}else{_0x39d2e8=0xce;}_0x5aab93[_0xb046('0x1e')](_0x39d2e8);return _0x5aab93[_0xb046('0x25')]('Content-Range',_0x561b31+'-'+_0x4d0870+'/'+_0x5175c8)[_0xb046('0x20')](_0x9b36e8);}return null;};}function patchUpdates(_0x29328f){return function(_0x383e72){try{jsonpatch[_0xb046('0x26')](_0x383e72,_0x29328f,!![]);}catch(_0x577de4){return BPromise['reject'](_0x577de4);}return _0x383e72[_0xb046('0x27')]();};}function saveUpdates(_0x4d2967,_0x3a3e5b){return function(_0x8eec63){if(_0x8eec63){return _0x8eec63[_0xb046('0x28')](_0x4d2967)[_0xb046('0x29')](function(_0x3141da){return _0x3141da;});}return null;};}function removeEntity(_0x3e0021,_0x3f6671){return function(_0x26d6aa){if(_0x26d6aa){return _0x26d6aa['destroy']()[_0xb046('0x29')](function(){_0x3e0021[_0xb046('0x1e')](0xcc)[_0xb046('0x1f')]();});}};}function handleEntityNotFound(_0xc828ea,_0x21bdcb){return function(_0x416357){if(!_0x416357){_0xc828ea[_0xb046('0x1d')](0x194);}return _0x416357;};}function handleError(_0x45f18b,_0x383bee){_0x383bee=_0x383bee||0x1f4;return function(_0x36862f){logger['error'](_0x36862f[_0xb046('0x2a')]);if(_0x36862f['name']){delete _0x36862f[_0xb046('0x2b')];}_0x45f18b[_0xb046('0x1e')](_0x383bee)[_0xb046('0x2c')](_0x36862f);};}exports[_0xb046('0x2d')]=function(_0x3e1ac0,_0x34cd46){var _0x5657e0={},_0x53293c={},_0x4dcb92={'count':0x0,'rows':[]};var _0x153b1e=_[_0xb046('0x2e')](db[_0xb046('0x2f')][_0xb046('0x30')],function(_0x516798){return{'name':_0x516798[_0xb046('0x31')],'type':_0x516798['type'][_0xb046('0x32')]};});_0x53293c[_0xb046('0x33')]=_[_0xb046('0x2e')](_0x153b1e,'name');_0x53293c['query']=_['keys'](_0x3e1ac0[_0xb046('0x34')]);_0x53293c[_0xb046('0x35')]=_['intersection'](_0x53293c['model'],_0x53293c[_0xb046('0x34')]);_0x5657e0['attributes']=_[_0xb046('0x36')](_0x53293c[_0xb046('0x33')],qs[_0xb046('0x37')](_0x3e1ac0[_0xb046('0x34')][_0xb046('0x37')]));_0x5657e0['attributes']=_0x5657e0[_0xb046('0x38')][_0xb046('0x39')]?_0x5657e0['attributes']:_0x53293c[_0xb046('0x33')];if(!_0x3e1ac0[_0xb046('0x34')][_0xb046('0x3a')](_0xb046('0x3b'))){_0x5657e0[_0xb046('0x22')]=qs[_0xb046('0x22')](_0x3e1ac0[_0xb046('0x34')][_0xb046('0x22')]);_0x5657e0[_0xb046('0x21')]=qs[_0xb046('0x21')](_0x3e1ac0[_0xb046('0x34')][_0xb046('0x21')]);}_0x5657e0[_0xb046('0x3c')]=qs[_0xb046('0x3d')](_0x3e1ac0['query'][_0xb046('0x3d')]);_0x5657e0[_0xb046('0x3e')]=qs[_0xb046('0x35')](_[_0xb046('0x3f')](_0x3e1ac0[_0xb046('0x34')],_0x53293c['filters']),_0x153b1e);if(_0x3e1ac0[_0xb046('0x34')][_0xb046('0x40')]){_0x5657e0['where']=_[_0xb046('0x41')](_0x5657e0[_0xb046('0x3e')],{'$or':_[_0xb046('0x2e')](_0x153b1e,function(_0x5742e9){if(_0x5742e9['type']!==_0xb046('0x42')){var _0x4fcc0e={};_0x4fcc0e[_0x5742e9['name']]={'$like':'%'+_0x3e1ac0[_0xb046('0x34')]['filter']+'%'};return _0x4fcc0e;}})});}_0x5657e0=_['merge']({},_0x5657e0,_0x3e1ac0['options']);var _0xfc53ce={'where':_0x5657e0[_0xb046('0x3e')]};return db['ChatTransferReport'][_0xb046('0x24')](_0xfc53ce)[_0xb046('0x29')](function(_0x377561){_0x4dcb92[_0xb046('0x24')]=_0x377561;if(_0x3e1ac0['query'][_0xb046('0x43')]){_0x5657e0['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x5657e0);})[_0xb046('0x29')](function(_0x23372e){_0x4dcb92[_0xb046('0x44')]=_0x23372e;return _0x4dcb92;})['then'](respondWithFilteredResult(_0x34cd46,_0x5657e0))[_0xb046('0x45')](handleError(_0x34cd46,null));};exports[_0xb046('0x46')]=function(_0x84552c,_0x3b0d0f){var _0x595596={'raw':!![],'where':{'id':_0x84552c[_0xb046('0x47')]['id']}},_0x1ab627={};_0x1ab627[_0xb046('0x33')]=_['keys'](db[_0xb046('0x2f')][_0xb046('0x30')]);_0x1ab627[_0xb046('0x34')]=_[_0xb046('0x48')](_0x84552c['query']);_0x1ab627[_0xb046('0x35')]=_['intersection'](_0x1ab627[_0xb046('0x33')],_0x1ab627[_0xb046('0x34')]);_0x595596[_0xb046('0x38')]=_[_0xb046('0x36')](_0x1ab627[_0xb046('0x33')],qs[_0xb046('0x37')](_0x84552c[_0xb046('0x34')][_0xb046('0x37')]));_0x595596['attributes']=_0x595596[_0xb046('0x38')]['length']?_0x595596[_0xb046('0x38')]:_0x1ab627[_0xb046('0x33')];if(_0x84552c[_0xb046('0x34')][_0xb046('0x43')]){_0x595596['include']=[{'all':!![]}];}_0x595596=_['merge']({},_0x595596,_0x84552c['options']);return db[_0xb046('0x2f')]['find'](_0x595596)[_0xb046('0x29')](handleEntityNotFound(_0x3b0d0f,null))[_0xb046('0x29')](respondWithResult(_0x3b0d0f,null))[_0xb046('0x45')](handleError(_0x3b0d0f,null));};exports['create']=function(_0x513605,_0x354b57){return db['ChatTransferReport'][_0xb046('0x49')](_0x513605[_0xb046('0x4a')],{})[_0xb046('0x29')](respondWithResult(_0x354b57,0xc9))[_0xb046('0x45')](handleError(_0x354b57,null));};exports[_0xb046('0x28')]=function(_0x80b69,_0x262ce9){if(_0x80b69[_0xb046('0x4a')]['id']){delete _0x80b69[_0xb046('0x4a')]['id'];}return db[_0xb046('0x2f')][_0xb046('0x4b')]({'where':{'id':_0x80b69[_0xb046('0x47')]['id']}})[_0xb046('0x29')](handleEntityNotFound(_0x262ce9,null))[_0xb046('0x29')](saveUpdates(_0x80b69[_0xb046('0x4a')],null))[_0xb046('0x29')](respondWithResult(_0x262ce9,null))[_0xb046('0x45')](handleError(_0x262ce9,null));};exports['destroy']=function(_0x717dc2,_0x1dbb68){return db[_0xb046('0x2f')][_0xb046('0x4b')]({'where':{'id':_0x717dc2[_0xb046('0x47')]['id']}})[_0xb046('0x29')](handleEntityNotFound(_0x1dbb68,null))['then'](removeEntity(_0x1dbb68,null))['catch'](handleError(_0x1dbb68,null));};exports['describe']=function(_0x41d00f,_0x2de393){return db[_0xb046('0x2f')]['describe']()[_0xb046('0x29')](respondWithResult(_0x2de393,null))[_0xb046('0x45')](handleError(_0x2de393,null));};
\ No newline at end of file
+var _0x790c=['length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','rows','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x280c6a,_0x2fc1e9){var _0x4bfe09=function(_0x1a8334){while(--_0x1a8334){_0x280c6a['push'](_0x280c6a['shift']());}};_0x4bfe09(++_0x2fc1e9);}(_0x790c,0xad));var _0xc790=function(_0x1e8a30,_0x9d4596){_0x1e8a30=_0x1e8a30-0x0;var _0x1f8b30=_0x790c[_0x1e8a30];return _0x1f8b30;};'use strict';var emlformat=require(_0xc790('0x0'));var rimraf=require(_0xc790('0x1'));var zipdir=require(_0xc790('0x2'));var jsonpatch=require(_0xc790('0x3'));var rp=require(_0xc790('0x4'));var moment=require(_0xc790('0x5'));var BPromise=require(_0xc790('0x6'));var Mustache=require(_0xc790('0x7'));var util=require(_0xc790('0x8'));var path=require(_0xc790('0x9'));var sox=require('sox');var csv=require(_0xc790('0xa'));var ejs=require(_0xc790('0xb'));var fs=require('fs');var fs_extra=require(_0xc790('0xc'));var _=require(_0xc790('0xd'));var squel=require(_0xc790('0xe'));var crypto=require(_0xc790('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc790('0xa'));var querystring=require(_0xc790('0x10'));var Papa=require('papaparse');var Redis=require(_0xc790('0x11'));var authService=require(_0xc790('0x12'));var qs=require(_0xc790('0x13'));var as=require(_0xc790('0x14'));var hardwareService=require(_0xc790('0x15'));var logger=require(_0xc790('0x16'))('api');var utils=require(_0xc790('0x17'));var config=require(_0xc790('0x18'));var licenseUtil=require(_0xc790('0x19'));var db=require(_0xc790('0x1a'))['db'];function respondWithStatusCode(_0x21a159,_0x2733ff){_0x2733ff=_0x2733ff||0xcc;return function(_0x27fada){if(_0x27fada){return _0x21a159[_0xc790('0x1b')](_0x2733ff);}return _0x21a159[_0xc790('0x1c')](_0x2733ff)['end']();};}function respondWithResult(_0xeddc37,_0x31fc5e){_0x31fc5e=_0x31fc5e||0xc8;return function(_0x5f217a){if(_0x5f217a){return _0xeddc37[_0xc790('0x1c')](_0x31fc5e)[_0xc790('0x1d')](_0x5f217a);}};}function respondWithFilteredResult(_0x455928,_0x4fef85){return function(_0x43ce87){if(_0x43ce87){var _0x586912=typeof _0x4fef85[_0xc790('0x1e')]===_0xc790('0x1f')&&typeof _0x4fef85[_0xc790('0x20')]===_0xc790('0x1f');var _0x3281f7=_0x43ce87[_0xc790('0x21')];var _0x1ab208=_0x586912?0x0:_0x4fef85['offset'];var _0x23f1d1=_0x586912?_0x43ce87[_0xc790('0x21')]:_0x4fef85[_0xc790('0x1e')]+_0x4fef85['limit'];var _0x6cced5;if(_0x23f1d1>=_0x3281f7){_0x23f1d1=_0x3281f7;_0x6cced5=0xc8;}else{_0x6cced5=0xce;}_0x455928[_0xc790('0x1c')](_0x6cced5);return _0x455928[_0xc790('0x22')]('Content-Range',_0x1ab208+'-'+_0x23f1d1+'/'+_0x3281f7)[_0xc790('0x1d')](_0x43ce87);}return null;};}function patchUpdates(_0x5d8107){return function(_0x4b5b76){try{jsonpatch[_0xc790('0x23')](_0x4b5b76,_0x5d8107,!![]);}catch(_0x1a36b9){return BPromise[_0xc790('0x24')](_0x1a36b9);}return _0x4b5b76[_0xc790('0x25')]();};}function saveUpdates(_0x2da1e3,_0x4c5110){return function(_0x5497d5){if(_0x5497d5){return _0x5497d5[_0xc790('0x26')](_0x2da1e3)[_0xc790('0x27')](function(_0x5915d9){return _0x5915d9;});}return null;};}function removeEntity(_0x37d028,_0x49afc9){return function(_0x1ed864){if(_0x1ed864){return _0x1ed864[_0xc790('0x28')]()[_0xc790('0x27')](function(){_0x37d028[_0xc790('0x1c')](0xcc)[_0xc790('0x29')]();});}};}function handleEntityNotFound(_0x3bee84,_0x107438){return function(_0x152b79){if(!_0x152b79){_0x3bee84['sendStatus'](0x194);}return _0x152b79;};}function handleError(_0x5cbb3d,_0x2961a4){_0x2961a4=_0x2961a4||0x1f4;return function(_0x107dee){logger[_0xc790('0x2a')](_0x107dee[_0xc790('0x2b')]);if(_0x107dee[_0xc790('0x2c')]){delete _0x107dee[_0xc790('0x2c')];}_0x5cbb3d[_0xc790('0x1c')](_0x2961a4)[_0xc790('0x2d')](_0x107dee);};}exports['index']=function(_0x10abdf,_0x350756){var _0x5e928f={},_0x9aa1d8={},_0x31b570={'count':0x0,'rows':[]};var _0x38915c=_[_0xc790('0x2e')](db[_0xc790('0x2f')][_0xc790('0x30')],function(_0x5d0013){return{'name':_0x5d0013[_0xc790('0x31')],'type':_0x5d0013[_0xc790('0x32')]['key']};});_0x9aa1d8[_0xc790('0x33')]=_[_0xc790('0x2e')](_0x38915c,_0xc790('0x2c'));_0x9aa1d8[_0xc790('0x34')]=_[_0xc790('0x35')](_0x10abdf[_0xc790('0x34')]);_0x9aa1d8[_0xc790('0x36')]=_['intersection'](_0x9aa1d8[_0xc790('0x33')],_0x9aa1d8[_0xc790('0x34')]);_0x5e928f['attributes']=_[_0xc790('0x37')](_0x9aa1d8[_0xc790('0x33')],qs['fields'](_0x10abdf['query'][_0xc790('0x38')]));_0x5e928f[_0xc790('0x39')]=_0x5e928f[_0xc790('0x39')][_0xc790('0x3a')]?_0x5e928f['attributes']:_0x9aa1d8[_0xc790('0x33')];if(!_0x10abdf[_0xc790('0x34')][_0xc790('0x3b')]('nolimit')){_0x5e928f[_0xc790('0x20')]=qs[_0xc790('0x20')](_0x10abdf[_0xc790('0x34')][_0xc790('0x20')]);_0x5e928f[_0xc790('0x1e')]=qs[_0xc790('0x1e')](_0x10abdf[_0xc790('0x34')][_0xc790('0x1e')]);}_0x5e928f[_0xc790('0x3c')]=qs['sort'](_0x10abdf['query'][_0xc790('0x3d')]);_0x5e928f['where']=qs[_0xc790('0x36')](_['pick'](_0x10abdf['query'],_0x9aa1d8['filters']),_0x38915c);if(_0x10abdf[_0xc790('0x34')][_0xc790('0x3e')]){_0x5e928f['where']=_[_0xc790('0x3f')](_0x5e928f['where'],{'$or':_[_0xc790('0x2e')](_0x38915c,function(_0x42ba79){if(_0x42ba79[_0xc790('0x32')]!==_0xc790('0x40')){var _0x2a5e6c={};_0x2a5e6c[_0x42ba79[_0xc790('0x2c')]]={'$like':'%'+_0x10abdf[_0xc790('0x34')]['filter']+'%'};return _0x2a5e6c;}})});}_0x5e928f=_[_0xc790('0x3f')]({},_0x5e928f,_0x10abdf['options']);var _0x4cf83e={'where':_0x5e928f[_0xc790('0x41')]};return db[_0xc790('0x2f')][_0xc790('0x21')](_0x4cf83e)[_0xc790('0x27')](function(_0x4a3128){_0x31b570['count']=_0x4a3128;if(_0x10abdf[_0xc790('0x34')]['includeAll']){_0x5e928f[_0xc790('0x42')]=[{'all':!![]}];}return db[_0xc790('0x2f')]['findAll'](_0x5e928f);})[_0xc790('0x27')](function(_0x5e7926){_0x31b570[_0xc790('0x43')]=_0x5e7926;return _0x31b570;})[_0xc790('0x27')](respondWithFilteredResult(_0x350756,_0x5e928f))[_0xc790('0x44')](handleError(_0x350756,null));};exports[_0xc790('0x45')]=function(_0x4bfa06,_0x544d29){var _0x2d38c7={'raw':!![],'where':{'id':_0x4bfa06[_0xc790('0x46')]['id']}},_0x1866e7={};_0x1866e7[_0xc790('0x33')]=_['keys'](db[_0xc790('0x2f')][_0xc790('0x30')]);_0x1866e7[_0xc790('0x34')]=_['keys'](_0x4bfa06[_0xc790('0x34')]);_0x1866e7[_0xc790('0x36')]=_[_0xc790('0x37')](_0x1866e7['model'],_0x1866e7[_0xc790('0x34')]);_0x2d38c7[_0xc790('0x39')]=_[_0xc790('0x37')](_0x1866e7[_0xc790('0x33')],qs[_0xc790('0x38')](_0x4bfa06[_0xc790('0x34')]['fields']));_0x2d38c7[_0xc790('0x39')]=_0x2d38c7[_0xc790('0x39')][_0xc790('0x3a')]?_0x2d38c7[_0xc790('0x39')]:_0x1866e7[_0xc790('0x33')];if(_0x4bfa06['query'][_0xc790('0x47')]){_0x2d38c7[_0xc790('0x42')]=[{'all':!![]}];}_0x2d38c7=_['merge']({},_0x2d38c7,_0x4bfa06[_0xc790('0x48')]);return db[_0xc790('0x2f')][_0xc790('0x49')](_0x2d38c7)[_0xc790('0x27')](handleEntityNotFound(_0x544d29,null))[_0xc790('0x27')](respondWithResult(_0x544d29,null))['catch'](handleError(_0x544d29,null));};exports['create']=function(_0x4ce4cc,_0x462bc3){return db[_0xc790('0x2f')][_0xc790('0x4a')](_0x4ce4cc[_0xc790('0x4b')],{})['then'](respondWithResult(_0x462bc3,0xc9))[_0xc790('0x44')](handleError(_0x462bc3,null));};exports['update']=function(_0x36907f,_0x5cf0ee){if(_0x36907f[_0xc790('0x4b')]['id']){delete _0x36907f[_0xc790('0x4b')]['id'];}return db['ChatTransferReport'][_0xc790('0x49')]({'where':{'id':_0x36907f[_0xc790('0x46')]['id']}})[_0xc790('0x27')](handleEntityNotFound(_0x5cf0ee,null))['then'](saveUpdates(_0x36907f[_0xc790('0x4b')],null))[_0xc790('0x27')](respondWithResult(_0x5cf0ee,null))[_0xc790('0x44')](handleError(_0x5cf0ee,null));};exports[_0xc790('0x28')]=function(_0x3ac9aa,_0x40acb5){return db[_0xc790('0x2f')][_0xc790('0x49')]({'where':{'id':_0x3ac9aa[_0xc790('0x46')]['id']}})[_0xc790('0x27')](handleEntityNotFound(_0x40acb5,null))[_0xc790('0x27')](removeEntity(_0x40acb5,null))[_0xc790('0x44')](handleError(_0x40acb5,null));};exports[_0xc790('0x4c')]=function(_0x286083,_0x27df10){return db[_0xc790('0x2f')]['describe']()[_0xc790('0x27')](respondWithResult(_0x27df10,null))[_0xc790('0x44')](handleError(_0x27df10,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3ff00a3..eb52204 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 _0x2867=['moment','bluebird','request-promise','path','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x18321f,_0x359e53){var _0x156220=function(_0x4ffa14){while(--_0x4ffa14){_0x18321f['push'](_0x18321f['shift']());}};_0x156220(++_0x359e53);}(_0x2867,0x1ad));var _0x7286=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x2867[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0x7286('0x0'));var util=require('util');var logger=require(_0x7286('0x1'))(_0x7286('0x2'));var moment=require(_0x7286('0x3'));var BPromise=require(_0x7286('0x4'));var rp=require(_0x7286('0x5'));var fs=require('fs');var path=require(_0x7286('0x6'));var rimraf=require('rimraf');var config=require(_0x7286('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x1248eb,_0x5c5195){return _0x1248eb[_0x7286('0x8')](_0x7286('0x9'),attributes,{'tableName':_0x7286('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7286('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x95a6=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define'];(function(_0x34e850,_0x3fedd6){var _0x282de1=function(_0x424539){while(--_0x424539){_0x34e850['push'](_0x34e850['shift']());}};_0x282de1(++_0x3fedd6);}(_0x95a6,0x18d));var _0x695a=function(_0xb5cd0,_0x51a333){_0xb5cd0=_0xb5cd0-0x0;var _0x2253cb=_0x95a6[_0xb5cd0];return _0x2253cb;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var logger=require(_0x695a('0x2'))(_0x695a('0x3'));var moment=require('moment');var BPromise=require(_0x695a('0x4'));var rp=require(_0x695a('0x5'));var fs=require('fs');var path=require(_0x695a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x695a('0x7'));module[_0x695a('0x8')]=function(_0x1f0d90,_0x39d199){return _0x1f0d90[_0x695a('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x695a('0xa'),'fields':[_0x695a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index d1427a8..d0de835 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 _0x0505=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','bluebird'];(function(_0x4d06ae,_0x5969a9){var _0x496033=function(_0x346b30){while(--_0x346b30){_0x4d06ae['push'](_0x4d06ae['shift']());}};_0x496033(++_0x5969a9);}(_0x0505,0x8e));var _0x5050=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x0505[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0x5050('0x0'));var moment=require('moment');var BPromise=require(_0x5050('0x1'));var rs=require(_0x5050('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5050('0x3'))['db'];var utils=require(_0x5050('0x4'));var logger=require('../../config/logger')(_0x5050('0x5'));var config=require(_0x5050('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5050('0x7')][_0x5050('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x357a39,_0x340cab,_0x3a02c8){return new BPromise(function(_0x3a5da3,_0x2918f5){return client[_0x5050('0x9')](_0x357a39,_0x3a02c8)[_0x5050('0xa')](function(_0x2eef60){logger[_0x5050('0xb')](_0x5050('0xc'),_0x340cab,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x340cab,_0x5050('0xd'),JSON['stringify'](_0x2eef60));if(_0x2eef60[_0x5050('0xe')]){if(_0x2eef60[_0x5050('0xe')][_0x5050('0xf')]===0x1f4){logger[_0x5050('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x340cab,_0x2eef60[_0x5050('0xe')][_0x5050('0x10')]);return _0x2918f5(_0x2eef60[_0x5050('0xe')]['message']);}logger[_0x5050('0xe')](_0x5050('0xc'),_0x340cab,_0x2eef60['error'][_0x5050('0x10')]);return _0x3a5da3(_0x2eef60[_0x5050('0xe')][_0x5050('0x10')]);}else{logger['info'](_0x5050('0xc'),_0x340cab,_0x5050('0xd'));_0x3a5da3(_0x2eef60[_0x5050('0x11')]['message']);}})['catch'](function(_0x5efb30){logger[_0x5050('0xe')](_0x5050('0xc'),_0x340cab,_0x5efb30);_0x2918f5(_0x5efb30);});});}
\ No newline at end of file
+var _0xc207=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x5bd9de,_0x48f971){var _0x4d6926=function(_0xc2c465){while(--_0xc2c465){_0x5bd9de['push'](_0x5bd9de['shift']());}};_0x4d6926(++_0x48f971);}(_0xc207,0x182));var _0x7c20=function(_0x414901,_0x20ee6a){_0x414901=_0x414901-0x0;var _0x2cae72=_0xc207[_0x414901];return _0x2cae72;};'use strict';var _=require(_0x7c20('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7c20('0x1'));var rs=require(_0x7c20('0x2'));var fs=require('fs');var Redis=require(_0x7c20('0x3'));var db=require(_0x7c20('0x4'))['db'];var utils=require(_0x7c20('0x5'));var logger=require(_0x7c20('0x6'))('rpc');var config=require(_0x7c20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7c20('0x8')][_0x7c20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1afa18,_0x3b5cd9,_0x236dfe){return new BPromise(function(_0x1d2e9e,_0xd671e8){return client[_0x7c20('0xa')](_0x1afa18,_0x236dfe)[_0x7c20('0xb')](function(_0x53bb80){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3b5cd9,_0x7c20('0xc'));logger[_0x7c20('0xd')](_0x7c20('0xe'),_0x3b5cd9,_0x7c20('0xc'),JSON[_0x7c20('0xf')](_0x53bb80));if(_0x53bb80['error']){if(_0x53bb80[_0x7c20('0x10')][_0x7c20('0x11')]===0x1f4){logger[_0x7c20('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3b5cd9,_0x53bb80['error'][_0x7c20('0x12')]);return _0xd671e8(_0x53bb80[_0x7c20('0x10')]['message']);}logger[_0x7c20('0x10')](_0x7c20('0x13'),_0x3b5cd9,_0x53bb80['error'][_0x7c20('0x12')]);return _0x1d2e9e(_0x53bb80[_0x7c20('0x10')][_0x7c20('0x12')]);}else{logger['info'](_0x7c20('0x13'),_0x3b5cd9,_0x7c20('0xc'));_0x1d2e9e(_0x53bb80[_0x7c20('0x14')]['message']);}})['catch'](function(_0x12f7ee){logger[_0x7c20('0x10')](_0x7c20('0x13'),_0x3b5cd9,_0x12f7ee);_0xd671e8(_0x12f7ee);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9a78b47..084e9f7 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 _0x3861=['isAuthenticated','index','/describe','post','put','update','delete','/:id','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x3861,0x1b9));var _0x1386=function(_0x4486d7,_0x5d8cf2){_0x4486d7=_0x4486d7-0x0;var _0x32f705=_0x3861[_0x4486d7];return _0x32f705;};'use strict';var multer=require(_0x1386('0x0'));var util=require(_0x1386('0x1'));var path=require(_0x1386('0x2'));var timeout=require('connect-timeout');var express=require(_0x1386('0x3'));var router=express['Router']();var fs_extra=require(_0x1386('0x4'));var auth=require(_0x1386('0x5'));var interaction=require(_0x1386('0x6'));var config=require(_0x1386('0x7'));var controller=require('./chatTransferReport.controller');router[_0x1386('0x8')]('/',auth[_0x1386('0x9')](),controller[_0x1386('0xa')]);router[_0x1386('0x8')](_0x1386('0xb'),auth[_0x1386('0x9')](),controller['describe']);router[_0x1386('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1386('0xc')]('/',auth[_0x1386('0x9')](),controller['create']);router[_0x1386('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1386('0xe')]);router[_0x1386('0xf')](_0x1386('0x10'),auth['isAuthenticated'](),controller[_0x1386('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xab44=['../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xab44,0xd6));var _0x4ab4=function(_0x384157,_0x50bf56){_0x384157=_0x384157-0x0;var _0x3ef36a=_0xab44[_0x384157];return _0x3ef36a;};'use strict';var multer=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var path=require('path');var timeout=require(_0x4ab4('0x2'));var express=require(_0x4ab4('0x3'));var router=express[_0x4ab4('0x4')]();var fs_extra=require(_0x4ab4('0x5'));var auth=require(_0x4ab4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ab4('0x7'));router[_0x4ab4('0x8')]('/',auth[_0x4ab4('0x9')](),controller['index']);router['get'](_0x4ab4('0xa'),auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xb')]);router['get'](_0x4ab4('0xc'),auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xd')]);router[_0x4ab4('0xe')]('/',auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xf')]);router[_0x4ab4('0x10')]('/:id',auth[_0x4ab4('0x9')](),controller['update']);router[_0x4ab4('0x11')]('/:id',auth[_0x4ab4('0x9')](),controller[_0x4ab4('0x12')]);module[_0x4ab4('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 8186169..a70c134 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 _0x6e5d=['Thanks\x20you\x20for\x20your\x20time!','Skip','BOOLEAN','Feedback','star','thumb','TEXT','stringify','name','getDataValue','onlineForm','parse','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','#011F6A','INTEGER','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x3c3a3c,_0x2c1fac){var _0x1cb9cd=function(_0xcafb63){while(--_0xcafb63){_0x3c3a3c['push'](_0x3c3a3c['shift']());}};_0x1cb9cd(++_0x2c1fac);}(_0x6e5d,0x145));var _0xd6e5=function(_0x1c268e,_0x2a59e6){_0x1c268e=_0x1c268e-0x0;var _0x27d639=_0x6e5d[_0x1c268e];return _0x27d639;};'use strict';var Sequelize=require(_0xd6e5('0x0'));var rs=require(_0xd6e5('0x1'));module[_0xd6e5('0x2')]={'name':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'unique':_0xd6e5('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x5')},'mapKeyOffline':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':_0xd6e5('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':_0xd6e5('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd6e5('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xd6e5('0x8'),_0xd6e5('0x9')),'defaultValue':_0xd6e5('0x8')},'header_online':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xf')},'noteTitle':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x10')},'placeholderMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x11')},'closingMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x12')},'closingMessageButton':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0xb')},'skipMessageButton':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x13')},'conditionAgreement':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0xd6e5('0x16'),_0xd6e5('0x17')),'defaultValue':_0xd6e5('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':function(){return JSON[_0xd6e5('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd6e5('0x1a'),'type':'text','required':!![]},'props':{'title':_0xd6e5('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xd6e5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd6e5('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd6e5('0x1b')](_0xd6e5('0x1c'))?JSON[_0xd6e5('0x1d')](this['getDataValue'](_0xd6e5('0x1c'))):{};},'set':function(_0x56d033){return this[_0xd6e5('0x1e')](_0xd6e5('0x1c'),JSON[_0xd6e5('0x19')](_0x56d033));}},'offlineForm':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':function(){return JSON[_0xd6e5('0x19')]({'items':[{'type':_0xd6e5('0x1f'),'props':{'title':_0xd6e5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd6e5('0x5'),'type':_0xd6e5('0x5')},'variable':null},{'type':_0xd6e5('0x20'),'config':{'placeholder':_0xd6e5('0x21')},'props':{'title':'Comments','helpText':_0xd6e5('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xd6e5('0x1b')](_0xd6e5('0x23'))?JSON['parse'](this[_0xd6e5('0x1b')](_0xd6e5('0x23'))):{};},'set':function(_0xa2fc58){return this[_0xd6e5('0x1e')](_0xd6e5('0x23'),JSON['stringify'](_0xa2fc58));}},'token':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd6e5('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd6e5('0x3')]},'waitingTitle':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x26')},'offlineMessageBody':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x28')},'skipUnmanaged':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd6e5('0x18')]},'showAgentAvatar':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':function(){return _0xd6e5('0x29');}},'notificationSound':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6e5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd6e5('0x2b')},'defaultTitle':{'type':Sequelize[_0xd6e5('0x3')]},'customerAvatar':{'type':Sequelize[_0xd6e5('0x18')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd6e5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd6e5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd6e5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':_0xd6e5('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6e5('0x7')],'comment':_0xd6e5('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![],'comment':_0xd6e5('0x2e'),'set':function(_0x414a59){if(!_0x414a59)this['setDataValue'](_0xd6e5('0x2f'),null);this[_0xd6e5('0x1e')](_0xd6e5('0x30'),_0x414a59);}},'vidaooEscalation':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xd6e5('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xd6e5('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xd6e5('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd6e5('0x14')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xba6e=['Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','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}}','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','TEXT','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify'];(function(_0x1b4680,_0x18ec5d){var _0x327ceb=function(_0x446ae1){while(--_0x446ae1){_0x1b4680['push'](_0x1b4680['shift']());}};_0x327ceb(++_0x18ec5d);}(_0xba6e,0x10c));var _0xeba6=function(_0x5df711,_0x3f2a31){_0x5df711=_0x5df711-0x0;var _0x24a716=_0xba6e[_0x5df711];return _0x24a716;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xeba6('0x0'));module[_0xeba6('0x1')]={'name':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'unique':_0xeba6('0x3')},'description':{'type':Sequelize[_0xeba6('0x2')]},'mapKey':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':_0xeba6('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':_0xeba6('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeba6('0x2')]},'animation':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xeba6('0x9')](_0xeba6('0xa'),_0xeba6('0xb')),'defaultValue':_0xeba6('0xa')},'header_online':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xc')},'start_chat_button':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xd')},'offline_chat_button':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xe')},'header_offline':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x12')},'noteTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x13')},'placeholderMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x14')},'closingMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x15')},'closingMessageButton':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x16')},'conditionAgreement':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xeba6('0x18'),'variable':null,'config':{'placeholder':_0xeba6('0x19'),'type':_0xeba6('0x1a'),'required':!![]},'props':{'title':_0xeba6('0x19'),'helpText':''}},{'type':_0xeba6('0x18'),'props':{'title':_0xeba6('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xeba6('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeba6('0x1b')](_0xeba6('0x1c'))?JSON[_0xeba6('0x1d')](this[_0xeba6('0x1b')](_0xeba6('0x1c'))):{};},'set':function(_0x292b4e){return this[_0xeba6('0x1e')](_0xeba6('0x1c'),JSON['stringify'](_0x292b4e));}},'offlineForm':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return JSON[_0xeba6('0x1f')]({'items':[{'type':'input','props':{'title':_0xeba6('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xeba6('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xeba6('0x20')},'props':{'title':'Comments','helpText':_0xeba6('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xeba6('0x22'))?JSON['parse'](this[_0xeba6('0x1b')](_0xeba6('0x22'))):{};},'set':function(_0x314b9e){return this[_0xeba6('0x1e')](_0xeba6('0x22'),JSON[_0xeba6('0x1f')](_0x314b9e));}},'token':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':function(){return rs[_0xeba6('0x23')]();}},'autoclose':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeba6('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeba6('0x2')]},'waitingTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x26')},'skipUnmanaged':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x16')},'sendUnmanaged':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return _0xeba6('0x27');}},'notificationSound':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x29')},'verticalAlignment':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x2a')},'defaultTitle':{'type':Sequelize[_0xeba6('0x2')]},'customerAvatar':{'type':Sequelize[_0xeba6('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeba6('0x7')],'comment':_0xeba6('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![],'comment':_0xeba6('0x2d'),'set':function(_0x3edc8a){if(!_0x3edc8a)this[_0xeba6('0x1e')](_0xeba6('0x2e'),null);this['setDataValue'](_0xeba6('0x2f'),_0x3edc8a);}},'vidaooEscalation':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeba6('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeba6('0x30')},'vidaooNote':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':function(){return _0xeba6('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeba6('0x17')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4c40b5d..3223d09 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 _0x9608=['threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','*,*,*,*','forcedOwnership','Start','EventManager','files','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','true','interval','ONLINE','OFFLINE','timezone','No\x20timezone','Interval','Intervals','getProactiveActions','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','virtual','replace','verticalAlignment','color_button','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','info','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','ChatWebsites','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','ChatWebsiteId','filter','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','device','%s\x20%s\x20%s','vendor'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x9608,0x74));var _0x8960=function(_0x2e7398,_0x35d985){_0x2e7398=_0x2e7398-0x0;var _0x4e094e=_0x9608[_0x2e7398];return _0x4e094e;};'use strict';var emlformat=require(_0x8960('0x0'));var rimraf=require(_0x8960('0x1'));var zipdir=require(_0x8960('0x2'));var jsonpatch=require(_0x8960('0x3'));var rp=require(_0x8960('0x4'));var moment=require(_0x8960('0x5'));var BPromise=require(_0x8960('0x6'));var Mustache=require('mustache');var util=require(_0x8960('0x7'));var path=require(_0x8960('0x8'));var sox=require(_0x8960('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8960('0xa'));var _=require(_0x8960('0xb'));var squel=require('squel');var crypto=require(_0x8960('0xc'));var jsforce=require(_0x8960('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8960('0xe'));var querystring=require(_0x8960('0xf'));var Papa=require('papaparse');var Redis=require(_0x8960('0x10'));var authService=require(_0x8960('0x11'));var qs=require(_0x8960('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8960('0x13'));var logger=require(_0x8960('0x14'))(_0x8960('0x15'));var utils=require('../../config/utils');var config=require(_0x8960('0x16'));var licenseUtil=require(_0x8960('0x17'));var db=require('../../mysqldb')['db'];config[_0x8960('0x18')]=_[_0x8960('0x19')](config[_0x8960('0x18')],{'host':_0x8960('0x1a'),'port':0x18eb});var socket=require(_0x8960('0x1b'))(new Redis(config[_0x8960('0x18')]));require(_0x8960('0x1c'))[_0x8960('0x1d')](socket);var jayson=require(_0x8960('0x1e'));var client=jayson[_0x8960('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x8960('0x1f')][_0x8960('0x20')]({'port':0x232a});var client9003=jayson[_0x8960('0x1f')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x183a9c,_0x3fdf0c,_0x146976,_0x594558){return new BPromise(function(_0x1a566b,_0x58e7ad){var _0x13cc94=_0x594558||client;return _0x13cc94['request'](_0x183a9c,_0x146976)['then'](function(_0x1feba5){logger[_0x8960('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x3fdf0c,'request\x20sent');logger[_0x8960('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3fdf0c,'request\x20sent',JSON[_0x8960('0x23')](_0x1feba5));if(_0x1feba5['error']){if(_0x1feba5[_0x8960('0x24')][_0x8960('0x25')]===0x1f4){logger['error'](_0x8960('0x26'),_0x3fdf0c,_0x1feba5[_0x8960('0x24')][_0x8960('0x27')]);return _0x58e7ad(_0x1feba5['error'][_0x8960('0x27')]);}logger[_0x8960('0x24')](_0x8960('0x26'),_0x3fdf0c,_0x1feba5[_0x8960('0x24')][_0x8960('0x27')]);return _0x1a566b(_0x1feba5[_0x8960('0x24')][_0x8960('0x27')]);}else{logger['info'](_0x8960('0x26'),_0x3fdf0c,_0x8960('0x28'));_0x1a566b(_0x1feba5[_0x8960('0x29')][_0x8960('0x27')]);}})['catch'](function(_0x31fa8b){logger[_0x8960('0x24')](_0x8960('0x26'),_0x3fdf0c,_0x31fa8b);_0x58e7ad(_0x31fa8b);});});}function respondWithStatusCode(_0x54dbc9,_0x442046){_0x442046=_0x442046||0xcc;return function(_0xcd96ce){if(_0xcd96ce){return _0x54dbc9[_0x8960('0x2a')](_0x442046);}return _0x54dbc9[_0x8960('0x2b')](_0x442046)[_0x8960('0x2c')]();};}function respondWithResult(_0x16415b,_0x16f855){_0x16f855=_0x16f855||0xc8;return function(_0x325571){if(_0x325571){return _0x16415b[_0x8960('0x2b')](_0x16f855)[_0x8960('0x2d')](_0x325571);}};}function respondWithFilteredResult(_0x43bd84,_0x5151a6){return function(_0x4185a7){if(_0x4185a7){var _0x3fce2d=typeof _0x5151a6['offset']===_0x8960('0x2e')&&typeof _0x5151a6[_0x8960('0x2f')]===_0x8960('0x2e');var _0x5aaec5=_0x4185a7[_0x8960('0x30')];var _0x30d137=_0x3fce2d?0x0:_0x5151a6[_0x8960('0x31')];var _0x51da11=_0x3fce2d?_0x4185a7['count']:_0x5151a6['offset']+_0x5151a6[_0x8960('0x2f')];var _0x3c96c4;if(_0x51da11>=_0x5aaec5){_0x51da11=_0x5aaec5;_0x3c96c4=0xc8;}else{_0x3c96c4=0xce;}_0x43bd84[_0x8960('0x2b')](_0x3c96c4);return _0x43bd84[_0x8960('0x32')]('Content-Range',_0x30d137+'-'+_0x51da11+'/'+_0x5aaec5)[_0x8960('0x2d')](_0x4185a7);}return null;};}function patchUpdates(_0x5e826d){return function(_0x24ae87){try{jsonpatch[_0x8960('0x33')](_0x24ae87,_0x5e826d,!![]);}catch(_0x46260a){return BPromise[_0x8960('0x34')](_0x46260a);}return _0x24ae87[_0x8960('0x35')]();};}function saveUpdates(_0x7973a7,_0x536048){return function(_0x833407){if(_0x833407){return _0x833407[_0x8960('0x36')](_0x7973a7)[_0x8960('0x37')](function(_0x22443e){return _0x22443e;});}return null;};}function removeEntity(_0x2f74e2,_0x144b81){return function(_0x7d08b1){if(_0x7d08b1){return _0x7d08b1['destroy']()[_0x8960('0x37')](function(){var _0x1fe695=_0x7d08b1[_0x8960('0x38')]({'plain':!![]});var _0x562a1b=_0x8960('0x39');return db['UserProfileResource'][_0x8960('0x3a')]({'where':{'type':_0x562a1b,'resourceId':_0x1fe695['id']}})[_0x8960('0x37')](function(){return _0x7d08b1;});})[_0x8960('0x37')](function(){_0x2f74e2[_0x8960('0x2b')](0xcc)[_0x8960('0x2c')]();});}};}function handleEntityNotFound(_0x33e060,_0x58fbdc){return function(_0x44c3fb){if(!_0x44c3fb){_0x33e060[_0x8960('0x2a')](0x194);}return _0x44c3fb;};}function handleError(_0x12a33f,_0x4ea884){_0x4ea884=_0x4ea884||0x1f4;return function(_0x4d9183){logger[_0x8960('0x24')](_0x4d9183[_0x8960('0x3b')]);if(_0x4d9183['name']){delete _0x4d9183[_0x8960('0x3c')];}_0x12a33f['status'](_0x4ea884)[_0x8960('0x3d')](_0x4d9183);};}exports[_0x8960('0x3e')]=function(_0x31c1ff,_0x48bc9e){var _0x3e83b3={'include':[{'model':db[_0x8960('0x3f')],'as':_0x8960('0x40')}]},_0x4fc7fb={},_0x361391={'count':0x0,'rows':[]};var _0x277f6e=_[_0x8960('0x41')](db['ChatWebsite']['rawAttributes'],function(_0x361bbe){return{'name':_0x361bbe['fieldName'],'type':_0x361bbe[_0x8960('0x42')][_0x8960('0x43')]};});_0x4fc7fb[_0x8960('0x44')]=_[_0x8960('0x41')](_0x277f6e,_0x8960('0x3c'));_0x4fc7fb[_0x8960('0x45')]=_[_0x8960('0x46')](_0x31c1ff[_0x8960('0x45')]);_0x4fc7fb[_0x8960('0x47')]=_[_0x8960('0x48')](_0x4fc7fb['model'],_0x4fc7fb[_0x8960('0x45')]);_0x3e83b3[_0x8960('0x49')]=_[_0x8960('0x48')](_0x4fc7fb[_0x8960('0x44')],qs['fields'](_0x31c1ff[_0x8960('0x45')][_0x8960('0x4a')]));_0x3e83b3['attributes']=_0x3e83b3[_0x8960('0x49')][_0x8960('0x4b')]?_0x3e83b3[_0x8960('0x49')]:_0x4fc7fb[_0x8960('0x44')];if(!_0x31c1ff[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x3e83b3['limit']=qs[_0x8960('0x2f')](_0x31c1ff['query']['limit']);_0x3e83b3[_0x8960('0x31')]=qs['offset'](_0x31c1ff[_0x8960('0x45')][_0x8960('0x31')]);}_0x3e83b3[_0x8960('0x4e')]=qs[_0x8960('0x4f')](_0x31c1ff[_0x8960('0x45')]['sort']);_0x3e83b3['where']=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x31c1ff[_0x8960('0x45')],_0x4fc7fb['filters']),_0x277f6e);if(_0x31c1ff[_0x8960('0x45')]['filter']){_0x3e83b3['where']=_[_0x8960('0x51')](_0x3e83b3[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x277f6e,function(_0x4d678a){if(_0x4d678a['type']!==_0x8960('0x53')){var _0x1465cd={};_0x1465cd[_0x4d678a[_0x8960('0x3c')]]={'$like':'%'+_0x31c1ff['query']['filter']+'%'};return _0x1465cd;}})});}_0x3e83b3=_[_0x8960('0x51')]({},_0x3e83b3,_0x31c1ff[_0x8960('0x54')]);var _0x2c8347={'where':_0x3e83b3[_0x8960('0x52')]};return db[_0x8960('0x55')][_0x8960('0x30')](_0x2c8347)['then'](function(_0x21eb05){_0x361391[_0x8960('0x30')]=_0x21eb05;if(_0x31c1ff[_0x8960('0x45')][_0x8960('0x56')]){_0x3e83b3[_0x8960('0x57')]=[{'all':!![]}];}return db[_0x8960('0x55')][_0x8960('0x58')](_0x3e83b3);})[_0x8960('0x37')](function(_0x6910a0){_0x361391[_0x8960('0x59')]=_0x6910a0;return _0x361391;})[_0x8960('0x37')](respondWithFilteredResult(_0x48bc9e,_0x3e83b3))['catch'](handleError(_0x48bc9e,null));};exports[_0x8960('0x5a')]=function(_0x28f302,_0xb46f5b){var _0x273845={'raw':![],'where':{'id':_0x28f302[_0x8960('0x5b')]['id']},'include':[{'model':db[_0x8960('0x3f')],'as':_0x8960('0x40')}]},_0x2854ab={};_0x2854ab[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0x55')][_0x8960('0x5c')]);_0x2854ab['query']=_[_0x8960('0x46')](_0x28f302['query']);_0x2854ab['filters']=_[_0x8960('0x48')](_0x2854ab['model'],_0x2854ab['query']);_0x273845[_0x8960('0x49')]=_[_0x8960('0x48')](_0x2854ab['model'],qs['fields'](_0x28f302[_0x8960('0x45')]['fields']));_0x273845['attributes']=_0x273845['attributes']['length']?_0x273845['attributes']:_0x2854ab[_0x8960('0x44')];if(_0x28f302['query'][_0x8960('0x56')]){_0x273845[_0x8960('0x57')]=[{'all':!![]}];}_0x273845=_[_0x8960('0x51')]({},_0x273845,_0x28f302['options']);return db[_0x8960('0x55')][_0x8960('0x5d')](_0x273845)[_0x8960('0x37')](handleEntityNotFound(_0xb46f5b,null))[_0x8960('0x37')](respondWithResult(_0xb46f5b,null))[_0x8960('0x5e')](handleError(_0xb46f5b,null));};exports['create']=function(_0x568459,_0x449db5){return db['ChatWebsite'][_0x8960('0x5f')](_0x568459[_0x8960('0x60')],{})['then'](function(_0x509863){var _0x205a2a=_0x568459[_0x8960('0x61')][_0x8960('0x38')]({'plain':!![]});if(!_0x205a2a)throw new Error(_0x8960('0x62'));if(_0x205a2a[_0x8960('0x63')]==='user'){var _0x4f35b6=_0x509863[_0x8960('0x38')]({'plain':!![]});var _0x1dd17d=_0x8960('0x39');return db[_0x8960('0x64')][_0x8960('0x5d')]({'where':{'name':_0x1dd17d,'userProfileId':_0x205a2a[_0x8960('0x65')]},'raw':!![]})['then'](function(_0x4ce7b3){if(_0x4ce7b3&&_0x4ce7b3[_0x8960('0x66')]===0x0){return db[_0x8960('0x67')][_0x8960('0x5f')]({'name':_0x4f35b6['name'],'resourceId':_0x4f35b6['id'],'type':_0x4ce7b3['name'],'sectionId':_0x4ce7b3['id']},{})[_0x8960('0x37')](function(){return _0x509863;});}else{return _0x509863;}})[_0x8960('0x5e')](function(_0x5360bd){logger[_0x8960('0x24')](_0x8960('0x68'),_0x5360bd);throw _0x5360bd;});}return _0x509863;})['then'](respondWithResult(_0x449db5,0xc9))[_0x8960('0x5e')](handleError(_0x449db5,null));};exports[_0x8960('0x36')]=function(_0x175c4a,_0x887090){if(_0x175c4a[_0x8960('0x60')]['id']){delete _0x175c4a[_0x8960('0x60')]['id'];}return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x175c4a[_0x8960('0x5b')]['id']},'include':[{'model':db[_0x8960('0x3f')],'as':_0x8960('0x40')}]})[_0x8960('0x37')](handleEntityNotFound(_0x887090,null))[_0x8960('0x37')](saveUpdates(_0x175c4a[_0x8960('0x60')],null))[_0x8960('0x37')](respondWithResult(_0x887090,null))[_0x8960('0x5e')](handleError(_0x887090,null));};exports[_0x8960('0x3a')]=function(_0x27f4df,_0x130513){return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x27f4df[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x130513,null))['then'](removeEntity(_0x130513,null))[_0x8960('0x5e')](handleError(_0x130513,null));};exports[_0x8960('0x69')]=function(_0x1476ab,_0x3e2a5b){return db[_0x8960('0x55')]['describe']()[_0x8960('0x37')](respondWithResult(_0x3e2a5b,null))[_0x8960('0x5e')](handleError(_0x3e2a5b,null));};exports[_0x8960('0x6a')]=function(_0xadf2bf,_0x4d3abe,_0x499578){if(_0xadf2bf[_0x8960('0x60')]['id']){delete _0xadf2bf[_0x8960('0x60')]['id'];}return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0xadf2bf[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x4d3abe,null))[_0x8960('0x37')](function(_0x3e4c39){if(_0x3e4c39){_0xadf2bf[_0x8960('0x60')]['ChatWebsiteId']=_0x3e4c39['id'];return db['Disposition'][_0x8960('0x5f')](_0xadf2bf['body']);}})[_0x8960('0x37')](respondWithResult(_0x4d3abe,null))[_0x8960('0x5e')](handleError(_0x4d3abe,null));};exports[_0x8960('0x6b')]=function(_0x485ea5,_0x64be5b,_0x4010d2){var _0x20b7a6={'raw':![],'where':{}};var _0x4f2298={};var _0x4e9776={'count':0x0,'rows':[]};return db[_0x8960('0x55')]['findOne']({'where':{'id':_0x485ea5['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x64be5b,null))[_0x8960('0x37')](function(_0x551ba3){if(_0x551ba3){_0x4f2298[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0x6c')][_0x8960('0x5c')]);_0x4f2298['query']=_[_0x8960('0x46')](_0x485ea5['query']);_0x4f2298[_0x8960('0x47')]=_[_0x8960('0x48')](_0x4f2298['model'],_0x4f2298[_0x8960('0x45')]);_0x20b7a6[_0x8960('0x49')]=_[_0x8960('0x48')](_0x4f2298[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x485ea5['query'][_0x8960('0x4a')]));_0x20b7a6[_0x8960('0x49')]=_0x20b7a6[_0x8960('0x49')][_0x8960('0x4b')]?_0x20b7a6['attributes']:_0x4f2298['model'];if(!_0x485ea5[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x20b7a6[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x485ea5[_0x8960('0x45')][_0x8960('0x2f')]);_0x20b7a6[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x485ea5[_0x8960('0x45')][_0x8960('0x31')]);}_0x20b7a6['order']=qs[_0x8960('0x4f')](_0x485ea5['query'][_0x8960('0x4f')]);_0x20b7a6['where']=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x485ea5[_0x8960('0x45')],_0x4f2298['filters']));_0x20b7a6[_0x8960('0x52')][_0x8960('0x6d')]=_0x551ba3['id'];if(_0x485ea5['query']['filter']){_0x20b7a6[_0x8960('0x52')]=_[_0x8960('0x51')](_0x20b7a6[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x20b7a6[_0x8960('0x49')],function(_0x1f4259){var _0x55de7f={};_0x55de7f[_0x1f4259]={'$like':'%'+_0x485ea5['query'][_0x8960('0x6e')]+'%'};return _0x55de7f;})});}_0x20b7a6=_[_0x8960('0x51')]({},_0x20b7a6,_0x485ea5[_0x8960('0x54')]);return db[_0x8960('0x6c')][_0x8960('0x30')]({'where':_0x20b7a6['where']})[_0x8960('0x37')](function(_0x333b47){_0x4e9776[_0x8960('0x30')]=_0x333b47;if(_0x485ea5[_0x8960('0x45')][_0x8960('0x56')]){_0x20b7a6[_0x8960('0x57')]=[{'all':!![]}];}return db[_0x8960('0x6c')][_0x8960('0x58')](_0x20b7a6);})[_0x8960('0x37')](function(_0x21e09b){_0x4e9776[_0x8960('0x59')]=_0x21e09b;return _0x4e9776;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x64be5b,_0x20b7a6))[_0x8960('0x5e')](handleError(_0x64be5b,null));};exports[_0x8960('0x6f')]=function(_0x254ae6,_0x4cd70e,_0x1364c8){return db['ChatWebsite']['find']({'where':{'id':_0x254ae6[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x4cd70e,null))[_0x8960('0x37')](function(_0x5d1dd8){if(_0x5d1dd8){return _0x5d1dd8[_0x8960('0x6f')](_0x254ae6[_0x8960('0x45')][_0x8960('0x70')]);}})['then'](respondWithStatusCode(_0x4cd70e,null))['catch'](handleError(_0x4cd70e,null));};exports[_0x8960('0x71')]=function(_0x2f16d8,_0xeb081,_0xc026e3){if(_0x2f16d8[_0x8960('0x60')]['id']){delete _0x2f16d8[_0x8960('0x60')]['id'];}return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x2f16d8[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0xeb081,null))[_0x8960('0x37')](function(_0x481600){if(_0x481600){_0x2f16d8[_0x8960('0x60')][_0x8960('0x6d')]=_0x481600['id'];return db[_0x8960('0x72')][_0x8960('0x5f')](_0x2f16d8[_0x8960('0x60')]);}})[_0x8960('0x37')](respondWithResult(_0xeb081,null))[_0x8960('0x5e')](handleError(_0xeb081,null));};exports['getAnswers']=function(_0x52b828,_0x22af3b,_0x4df7ff){var _0x151939={'raw':![],'where':{}};var _0x2273d0={};var _0x24e473={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8960('0x73')]({'where':{'id':_0x52b828['params']['id']}})['then'](handleEntityNotFound(_0x22af3b,null))[_0x8960('0x37')](function(_0x21d620){if(_0x21d620){_0x2273d0[_0x8960('0x44')]=_['keys'](db[_0x8960('0x72')]['rawAttributes']);_0x2273d0['query']=_['keys'](_0x52b828[_0x8960('0x45')]);_0x2273d0[_0x8960('0x47')]=_['intersection'](_0x2273d0[_0x8960('0x44')],_0x2273d0[_0x8960('0x45')]);_0x151939[_0x8960('0x49')]=_['intersection'](_0x2273d0[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x52b828['query']['fields']));_0x151939['attributes']=_0x151939[_0x8960('0x49')][_0x8960('0x4b')]?_0x151939['attributes']:_0x2273d0[_0x8960('0x44')];if(!_0x52b828[_0x8960('0x45')]['hasOwnProperty'](_0x8960('0x4d'))){_0x151939['limit']=qs[_0x8960('0x2f')](_0x52b828[_0x8960('0x45')]['limit']);_0x151939['offset']=qs[_0x8960('0x31')](_0x52b828['query'][_0x8960('0x31')]);}_0x151939[_0x8960('0x4e')]=qs[_0x8960('0x4f')](_0x52b828[_0x8960('0x45')]['sort']);_0x151939[_0x8960('0x52')]=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x52b828[_0x8960('0x45')],_0x2273d0[_0x8960('0x47')]));_0x151939['where']['ChatWebsiteId']=_0x21d620['id'];if(_0x52b828['query'][_0x8960('0x6e')]){_0x151939[_0x8960('0x52')]=_[_0x8960('0x51')](_0x151939[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x151939[_0x8960('0x49')],function(_0x5609ba){var _0x50d847={};_0x50d847[_0x5609ba]={'$like':'%'+_0x52b828[_0x8960('0x45')]['filter']+'%'};return _0x50d847;})});}_0x151939=_[_0x8960('0x51')]({},_0x151939,_0x52b828[_0x8960('0x54')]);return db[_0x8960('0x72')]['count']({'where':_0x151939['where']})[_0x8960('0x37')](function(_0x1b8cf4){_0x24e473[_0x8960('0x30')]=_0x1b8cf4;if(_0x52b828[_0x8960('0x45')]['includeAll']){_0x151939[_0x8960('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8960('0x58')](_0x151939);})['then'](function(_0x55fee4){_0x24e473[_0x8960('0x59')]=_0x55fee4;return _0x24e473;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x22af3b,_0x151939))['catch'](handleError(_0x22af3b,null));};exports[_0x8960('0x74')]=function(_0x277592,_0x196a27,_0xba47b8){return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x277592['params']['id']}})['then'](handleEntityNotFound(_0x196a27,null))[_0x8960('0x37')](function(_0xa3ca8d){if(_0xa3ca8d){return _0xa3ca8d['removeAnswers'](_0x277592[_0x8960('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x196a27,null))['catch'](handleError(_0x196a27,null));};exports['addLogo']=function(_0x4be0a5,_0x498181,_0x3d26ab){_0x4be0a5[_0x8960('0x60')][_0x8960('0x75')]=_0x4be0a5[_0x8960('0x76')][_0x8960('0x77')];return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x4be0a5['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x498181,null))[_0x8960('0x37')](saveUpdates(_0x4be0a5['body'],null))[_0x8960('0x37')](respondWithResult(_0x498181,null))['catch'](handleError(_0x498181,null));};exports['addAvatar']=function(_0x1ffe14,_0xebfb86,_0x243dc1){_0x1ffe14[_0x8960('0x60')]['agentAvatar']=_0x1ffe14[_0x8960('0x76')][_0x8960('0x77')];return db['ChatWebsite']['find']({'where':{'id':_0x1ffe14['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0xebfb86,null))[_0x8960('0x37')](saveUpdates(_0x1ffe14[_0x8960('0x60')],null))[_0x8960('0x37')](respondWithResult(_0xebfb86,null))['catch'](handleError(_0xebfb86,null));};exports[_0x8960('0x78')]=function(_0x3e54dc,_0x304247,_0x31101b){_0x3e54dc[_0x8960('0x60')][_0x8960('0x79')]=_0x3e54dc[_0x8960('0x76')][_0x8960('0x77')];return db[_0x8960('0x55')]['find']({'where':{'id':_0x3e54dc[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x304247,null))['then'](saveUpdates(_0x3e54dc[_0x8960('0x60')],null))[_0x8960('0x37')](respondWithResult(_0x304247,null))['catch'](handleError(_0x304247,null));};exports[_0x8960('0x7a')]=function(_0x48bee5,_0x374783,_0x35af9d){_0x48bee5[_0x8960('0x60')][_0x8960('0x7b')]=_0x48bee5[_0x8960('0x76')]['filename'];return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x48bee5[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x374783,null))[_0x8960('0x37')](saveUpdates(_0x48bee5[_0x8960('0x60')],null))['then'](respondWithResult(_0x374783,null))['catch'](handleError(_0x374783,null));};exports[_0x8960('0x7c')]=function(_0x263d2d,_0x22fdc0,_0x2b3f8e){var _0x1657a2=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x7f'));var _0xcfed01={'where':{'id':_0x263d2d[_0x8960('0x5b')]['id']},'attributes':['id',_0x8960('0x75')],'raw':!![]};var _0x548f54=![];return require('../../config/license/util')[_0x8960('0x80')]()[_0x8960('0x37')](function(_0x41bead){if(_0x41bead){_0x548f54=_0x41bead[_0x8960('0x81')];}})['then'](function(){return db[_0x8960('0x55')][_0x8960('0x5d')](_0xcfed01);})[_0x8960('0x37')](handleEntityNotFound(_0x22fdc0,null))[_0x8960('0x37')](function(_0x6539ba){if(_0x6539ba){if(!_[_0x8960('0x82')](_0x6539ba[_0x8960('0x75')])){if(fs[_0x8960('0x83')](path[_0x8960('0x7d')](config['root'],'server/files/images/logos/',_0x6539ba[_0x8960('0x75')]))&&_0x548f54){_0x1657a2=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x84'),_0x6539ba[_0x8960('0x75')]);}}return _0x22fdc0[_0x8960('0x85')](_0x1657a2);}})[_0x8960('0x5e')](handleError(_0x22fdc0,null));};exports['getAvatar']=function(_0x441877,_0x536cfd,_0x2e2d04){var _0x26fe0b=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x86'));var _0x796759={'where':{'id':_0x441877[_0x8960('0x5b')]['id']},'attributes':['id',_0x8960('0x87')],'raw':!![]};return db['ChatWebsite']['find'](_0x796759)[_0x8960('0x37')](handleEntityNotFound(_0x536cfd,null))[_0x8960('0x37')](function(_0x52fc01){if(_0x52fc01){if(!_[_0x8960('0x82')](_0x52fc01[_0x8960('0x87')])){if(fs[_0x8960('0x83')](path['join'](config[_0x8960('0x7e')],_0x8960('0x88'),_0x52fc01[_0x8960('0x87')]))){_0x26fe0b=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x88'),_0x52fc01[_0x8960('0x87')]);}}return _0x536cfd['download'](_0x26fe0b);}})[_0x8960('0x5e')](handleError(_0x536cfd,null));};exports[_0x8960('0x89')]=function(_0xc726c7,_0x1f3ceb,_0x3f3d38){var _0x7ed974=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x8a'));var _0x3fb37b={'where':{'id':_0xc726c7[_0x8960('0x5b')]['id']},'attributes':['id',_0x8960('0x79'),_0x8960('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x8960('0x5d')](_0x3fb37b)[_0x8960('0x37')](handleEntityNotFound(_0x1f3ceb,null))[_0x8960('0x37')](function(_0x1ba4b3){if(_0x1ba4b3){if(!_[_0x8960('0x82')](_0x1ba4b3['customerAvatar'])){if(fs[_0x8960('0x83')](path[_0x8960('0x7d')](config[_0x8960('0x7e')],'server/files/images/avatars/',_0x1ba4b3[_0x8960('0x79')]))&&_0x1ba4b3[_0x8960('0x8b')]){_0x7ed974=path['join'](config[_0x8960('0x7e')],'server/files/images/avatars/',_0x1ba4b3['customerAvatar']);}}return _0x1f3ceb['download'](_0x7ed974);}})['catch'](handleError(_0x1f3ceb,null));};exports['getSystemAvatar']=function(_0x1ba542,_0x2362e5,_0x2e0c8e){var _0x472bc9=path['join'](config[_0x8960('0x7e')],_0x8960('0x8c'));var _0x4840ef={'where':{'id':_0x1ba542['params']['id']},'attributes':['id',_0x8960('0x7b')],'raw':!![]};return db[_0x8960('0x55')][_0x8960('0x5d')](_0x4840ef)[_0x8960('0x37')](handleEntityNotFound(_0x2362e5,null))[_0x8960('0x37')](function(_0x560322){if(_0x560322){if(!_[_0x8960('0x82')](_0x560322[_0x8960('0x7b')])){if(fs[_0x8960('0x83')](path[_0x8960('0x7d')](config['root'],'server/files/images/avatars/',_0x560322[_0x8960('0x7b')]))){_0x472bc9=path[_0x8960('0x7d')](config[_0x8960('0x7e')],_0x8960('0x88'),_0x560322[_0x8960('0x7b')]);}}return _0x2362e5['download'](_0x472bc9);}})[_0x8960('0x5e')](handleError(_0x2362e5,null));};exports[_0x8960('0x8d')]=function(_0xc4b590,_0x30890e,_0x57cc41){var _0x570348=require(_0x8960('0x8e'));var _0x5138c2=new _0x570348();var _0x19f0ca=_0x5138c2[_0x8960('0x8f')](_0xc4b590[_0x8960('0x90')]['user-agent'])[_0x8960('0x91')]();var _0x97b200={'body':_0xc4b590[_0x8960('0x60')],'channel':_0x8960('0x92')};var _0x4aa17e=[];var _0x3ecda8=[];var _0x14258a={};var _0x46fd5d=![];return db[_0x8960('0x93')][_0x8960('0x69')]()[_0x8960('0x37')](function(_0x1442d7){if(!_0x1442d7){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x96'));}_0x4aa17e=_['difference'](_[_0x8960('0x46')](_0x1442d7),['createdAt',_0x8960('0x97')]);_0x3ecda8=_[_0x8960('0x98')](_[_0x8960('0x46')](_0x1442d7),[_0x8960('0x99'),_0x8960('0x97'),_0x8960('0x9a'),_0x8960('0x9b')]);if(_0xc4b590[_0x8960('0x60')]['id']){delete _0xc4b590[_0x8960('0x60')]['id'];}if(_[_0x8960('0x82')](_0xc4b590[_0x8960('0x60')]['from'])){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))]('from\x20is\x20mandatory');}if(_[_0x8960('0x82')](_0xc4b590['body'][_0x8960('0x60')])||_0xc4b590[_0x8960('0x60')]['body']===''){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x9c'));}if(_[_0x8960('0x82')](_0xc4b590[_0x8960('0x60')][_0x8960('0x9d')])){throw new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x9e')+_0x3ecda8);}if(!_['includes'](_0x3ecda8,_0xc4b590['body']['mapKey'])){throw new db[(_0x8960('0x94'))]['ValidationError'](_0x8960('0x9f')+_0x3ecda8);}_0x14258a[_0xc4b590[_0x8960('0x60')]['mapKey']]=_0xc4b590[_0x8960('0x60')]['from'];})[_0x8960('0x37')](function(){return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0xc4b590['params']['id']},'include':[{'model':db[_0x8960('0xa0')],'as':_0x8960('0xa1'),'include':[{'model':db[_0x8960('0x93')],'as':_0x8960('0xa2'),'where':_0x14258a,'limit':0x1,'order':[[_0x8960('0x97'),_0x8960('0xa3')]]}]},{'model':db[_0x8960('0xa4')],'as':_0x8960('0xa5')}]});})[_0x8960('0x37')](handleEntityNotFound(_0x30890e,null))['then'](function(_0x23b932){if(_0x23b932&&_0x23b932[_0x8960('0xa1')]){_0x97b200[_0x8960('0xa6')]=_0x23b932;_0x97b200[_0x8960('0xa7')]=_0x23b932[_0x8960('0xa5')];_0x97b200[_0x8960('0xa8')]=_0x23b932[_0x8960('0xa1')];_0x97b200[_0x8960('0xa7')]=_[_0x8960('0xa9')](_0x97b200[_0x8960('0xa7')],[_0x8960('0xaa')],['asc']);if(_0x97b200[_0x8960('0xa6')][_0x8960('0xa5')]){delete _0x97b200[_0x8960('0xa6')][_0x8960('0xa5')];}if(_0x97b200[_0x8960('0xa6')][_0x8960('0xa1')]&&_0x97b200[_0x8960('0xa6')][_0x8960('0xa1')][_0x8960('0xa2')][_0x8960('0x4b')]){return _0x97b200[_0x8960('0xa6')]['List'][_0x8960('0xa2')][0x0];}var _0x2ff8f2=_[_0x8960('0x19')](_0xc4b590[_0x8960('0x60')],{'firstName':_0xc4b590[_0x8960('0x60')][_0x8960('0xab')],'ListId':_0x23b932['ListId']});_0x2ff8f2[_0xc4b590[_0x8960('0x60')][_0x8960('0x9d')]]=_0xc4b590[_0x8960('0x60')]['from'];return db[_0x8960('0x93')]['create'](_0x2ff8f2,{'fields':_0x4aa17e,'raw':!![]});}})[_0x8960('0x37')](handleEntityNotFound(_0x30890e,null))[_0x8960('0x37')](function(_0x5e8c3f){_0x97b200[_0x8960('0xac')]=_0x5e8c3f;var _0x3d5fd6=_0xc4b590[_0x8960('0x60')][_0x8960('0xad')];if(_0xc4b590[_0x8960('0x90')]['cf-connecting-ip']){_0x3d5fd6=_0xc4b590[_0x8960('0x90')][_0x8960('0xae')];}else if(_0xc4b590[_0x8960('0x90')][_0x8960('0xaf')]){_0x3d5fd6=_[_0x8960('0xb0')](_0xc4b590[_0x8960('0x90')][_0x8960('0xaf')][_0x8960('0xb1')](','));}if(_0x5e8c3f){var _0x33815f={'ContactId':_0x5e8c3f['id'],'ChatWebsiteId':_0xc4b590[_0x8960('0x5b')]['id'],'from':(_0x5e8c3f[_0x8960('0xb2')]||'')+'\x20'+(_0x5e8c3f[_0x8960('0xb3')]||''),'customerIp':_0x3d5fd6,'customerPort':_0xc4b590[_0x8960('0x90')][_0x8960('0xb4')]?_0xc4b590[_0x8960('0x90')][_0x8960('0xb4')]:null,'referer':_0xc4b590[_0x8960('0x60')]['referer'],'browserName':_0x19f0ca[_0x8960('0xb5')]['name']&&_0x19f0ca['browser'][_0x8960('0xb6')]?util[_0x8960('0xb7')](_0x8960('0xb8'),_0x19f0ca[_0x8960('0xb5')][_0x8960('0x3c')],_0x19f0ca[_0x8960('0xb5')][_0x8960('0xb6')]):'unknown','browserVersion':_0x19f0ca['browser'][_0x8960('0xb6')]||'unknown','osName':util[_0x8960('0xb7')](_0x8960('0xb8'),_0x19f0ca['os'][_0x8960('0x3c')],_0x19f0ca['os'][_0x8960('0xb6')]),'osVersion':_0x19f0ca['os'][_0x8960('0xb6')],'deviceModel':_0x19f0ca[_0x8960('0xb9')][_0x8960('0x44')]&&_0x19f0ca[_0x8960('0xb9')]['vendor']?util[_0x8960('0xb7')](_0x8960('0xba'),_0x19f0ca['device'][_0x8960('0x44')],_0x19f0ca[_0x8960('0xb9')][_0x8960('0xbb')],_0x19f0ca[_0x8960('0xb9')][_0x8960('0x42')]):null,'deviceVendor':_0x19f0ca[_0x8960('0xb9')][_0x8960('0xbb')],'deviceType':_0x19f0ca['device']['type'],'formData':JSON[_0x8960('0x23')](_0xc4b590[_0x8960('0x60')])};var _0x169bb0={'ChatWebsiteId':_0xc4b590[_0x8960('0x5b')]['id'],'closed':![]};if(_0xc4b590[_0x8960('0x60')]['threadId']){_0x169bb0[_0x8960('0xbc')]=_0xc4b590['body'][_0x8960('0xbc')];return db[_0x8960('0xbd')][_0x8960('0x5d')]({'where':_0x169bb0})[_0x8960('0x37')](function(_0x2f1b9d){if(_0x2f1b9d){return[_0x2f1b9d,![]];}_0x33815f[_0x8960('0xbc')]=_0xc4b590[_0x8960('0x60')][_0x8960('0xbc')];_0x33815f['externalUrl']=_0xc4b590[_0x8960('0x60')][_0x8960('0xbe')];return db[_0x8960('0xbd')]['create'](_0x33815f)[_0x8960('0x37')](function(_0x55e2f7){return[_0x55e2f7,!![]];});});}_0x169bb0[_0x8960('0xbf')]=_0x5e8c3f['id'];if(_0xc4b590['body'][_0x8960('0xc0')]&&_0xc4b590['body'][_0x8960('0xc0')]['id']){_0x169bb0['id']=_0xc4b590[_0x8960('0x60')][_0x8960('0xc0')]['id'];return db[_0x8960('0xbd')][_0x8960('0x5d')]({'where':_0x169bb0})['then'](function(_0x22d39e){if(_0x22d39e){return[_0x22d39e,![]];}return db[_0x8960('0xbd')][_0x8960('0x5f')](_0x33815f)[_0x8960('0x37')](function(_0x42c1a1){return[_0x42c1a1,!![]];});});}return db['ChatInteraction']['create'](_0x33815f)[_0x8960('0x37')](function(_0x28fc4c){return[_0x28fc4c,!![]];});}})[_0x8960('0xc1')](function(_0x407172,_0x54eeb6){if(_0x407172){_0x46fd5d=_0x54eeb6;if(!_0x54eeb6){var _0x4a5ed0={'from':(_0x97b200[_0x8960('0xac')][_0x8960('0xb2')]||'')+'\x20'+(_0x97b200[_0x8960('0xac')][_0x8960('0xb3')]||'')};if(_0xc4b590[_0x8960('0x60')]['threadId']&&_0xc4b590['body'][_0x8960('0xc2')]&&_0xc4b590[_0x8960('0x60')][_0x8960('0xbc')]!=_0xc4b590[_0x8960('0x60')]['messageId']){_0x4a5ed0[_0x8960('0xbc')]=_0xc4b590['body']['messageId'];}return _0x407172[_0x8960('0x36')](_0x4a5ed0);}else{return _0x407172;}}})['then'](function(_0x249ac1){_0x97b200[_0x8960('0xc0')]=_0x249ac1[_0x8960('0x38')]({'plain':!![]});_0x97b200[_0x8960('0xc0')][_0x8960('0xc3')]=_0x46fd5d;if(_0x97b200['interaction'][_0x8960('0xc3')]){if(_0x97b200[_0x8960('0xa6')]['autoclose']){_0x97b200['applications'][_0x8960('0xc4')]({'id':0x0,'priority':_0x97b200[_0x8960('0xa7')]['length']+0x1,'app':_0x8960('0xc5'),'appdata':_0x8960('0xc6'),'interval':'*,*,*,*'});}}return db[_0x8960('0xc7')][_0x8960('0x5f')]({'body':_0xc4b590[_0x8960('0x60')][_0x8960('0x60')],'ChatWebsiteId':_0xc4b590[_0x8960('0x5b')]['id'],'ChatInteractionId':_0x249ac1['id'],'direction':'in','ContactId':_0x97b200[_0x8960('0xac')]['id'],'AttachmentId':_0xc4b590[_0x8960('0x60')][_0x8960('0xc8')]});})[_0x8960('0x37')](function(_0xa7ddb0){_0x97b200['message']=_0xa7ddb0;if(_0x97b200[_0x8960('0xc0')][_0x8960('0xc9')]){return db[_0x8960('0xca')]['find']({'attributes':['id',_0x8960('0x3c')],'where':{'id':_0x97b200[_0x8960('0xc0')][_0x8960('0xc9')]}})[_0x8960('0x37')](function(_0x33bce6){if(_0x33bce6){_0x97b200[_0x8960('0xa7')][_0x8960('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x33bce6['name']+','+(_0x97b200[_0x8960('0xa6')]['waitForTheAssignedAgent']||0xa),'interval':_0x8960('0xcc')});_0x97b200[_0x8960('0xcd')]=!![];}return respondWithRpcPromise(_0x8960('0xce'),'startRouting',_0x97b200);});}return respondWithRpcPromise(_0x8960('0xce'),'startRouting',_0x97b200);})[_0x8960('0x37')](function(_0x4b915e){respondWithRpcPromise('EventManager',_0x8960('0xcf'),{'event':_0x8960('0x8d'),'message':_0x4b915e},client9002);return _0x4b915e;})[_0x8960('0x37')](respondWithResult(_0x30890e,null))['catch'](handleError(_0x30890e,null));};exports['offline']=function(_0x4e2144,_0x2ea795,_0x562607){var _0xac389a,_0x9b0341,_0x268e32;var _0x2f7270=[];var _0x571b87=[];var _0x14517e={};var _0x47bfe2=_0x4e2144[_0x8960('0xd0')]||[];var _0x2a9287=[];var _0x5f16c4;return db[_0x8960('0x93')][_0x8960('0x69')]()[_0x8960('0x37')](function(_0x51f3e7){if(!_0x51f3e7){throw new db[(_0x8960('0x94'))]['ValidationError'](_0x8960('0x96'));}_0x571b87=_[_0x8960('0x98')](_[_0x8960('0x46')](_0x51f3e7),[_0x8960('0x99'),_0x8960('0x97')]);_0x2f7270=_[_0x8960('0x98')](_[_0x8960('0x46')](_0x51f3e7),['createdAt',_0x8960('0x97'),_0x8960('0x9a'),_0x8960('0x9b')]);if(_0x4e2144['body']['id']){delete _0x4e2144[_0x8960('0x60')]['id'];}if(_[_0x8960('0x82')](_0x4e2144[_0x8960('0x60')]['from'])){throw _0x2ea795[_0x8960('0x2b')](0x1f4)[_0x8960('0x3d')](new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0xd1')));}if(_['isNil'](_0x4e2144[_0x8960('0x60')][_0x8960('0x60')])||_0x4e2144['body'][_0x8960('0x60')]===''){throw _0x2ea795[_0x8960('0x2b')](0x1f4)[_0x8960('0x3d')](new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0x9c')));}if(_['isNil'](_0x4e2144[_0x8960('0x60')][_0x8960('0xd2')])){throw _0x2ea795[_0x8960('0x2b')](0x1f4)[_0x8960('0x3d')](new db['Sequelize'][(_0x8960('0x95'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f7270));}if(!_[_0x8960('0xd3')](_0x2f7270,_0x4e2144[_0x8960('0x60')][_0x8960('0xd2')])){throw _0x2ea795[_0x8960('0x2b')](0x1f4)['send'](new db[(_0x8960('0x94'))][(_0x8960('0x95'))](_0x8960('0xd4')+_0x2f7270));}_0x14517e[_0x4e2144[_0x8960('0x60')][_0x8960('0xd2')]]=_0x4e2144[_0x8960('0x60')][_0x8960('0xab')];})[_0x8960('0x37')](function(){return db[_0x8960('0x55')]['find']({'where':{'id':_0x4e2144[_0x8960('0x5b')]['id']},'include':[{'model':db[_0x8960('0xa0')],'as':_0x8960('0xa1')},{'model':db[_0x8960('0xd5')],'as':_0x8960('0xd5')}]});})[_0x8960('0x37')](handleEntityNotFound(_0x2ea795,null))['then'](function(_0x2024f5){if(_0x2024f5&&_0x2024f5['List']){_0x9b0341=_0x2024f5;var _0x4436ee=_[_0x8960('0x19')](_0x4e2144['body'],{'firstName':_0x4e2144['body']['from'],'phone':_0x4e2144[_0x8960('0x60')][_0x8960('0xab')],'ListId':_0x2024f5[_0x8960('0x9b')]});_0x4436ee[_0x4e2144[_0x8960('0x60')]['mapKeyOffline']]=_0x4e2144[_0x8960('0x60')][_0x8960('0xab')];return db[_0x8960('0x93')]['findOrCreate']({'where':_0x14517e,'defaults':_0x4436ee});}})['spread'](function(_0x46197b){if(_0x46197b){_0x268e32=_0x46197b;var _0x1457c7=fs[_0x8960('0xd6')](path[_0x8960('0x7d')](config['root'],_0x8960('0xd7')),'utf8');var _0x26d940=ejs[_0x8960('0xd8')](_0x1457c7,{'body':_[_0x8960('0xd9')](_0x4e2144[_0x8960('0x60')]['body']),'bodyTitle':_0x9b0341['offlineMessageBody']});return db['ChatOfflineMessage'][_0x8960('0x5f')]({'body':_0x26d940,'ContactId':_0x46197b['id'],'ChatWebsiteId':_0x9b0341['id']});}})[_0x8960('0x37')](function(_0x31f849){_0x5f16c4=_0x31f849;if(_0x47bfe2[_0x8960('0x4b')]){var _0x570977=_0x47bfe2['map'](function(_0x448f29){return{'name':_0x448f29[_0x8960('0xda')],'basename':_0x448f29['filename'],'type':_0x448f29[_0x8960('0xdb')],'ChatOfflineMessageId':_0x31f849['id']};});_0x2a9287=_0x570977[_0x8960('0x41')](_0x5d56b8=>{var _0xbff41f={'filename':_0x5d56b8[_0x8960('0x3c')],'path':path[_0x8960('0x7d')](config['root'],_0x8960('0xdc'),_0x8960('0xd0'),_0x8960('0xdd'),_0x8960('0xde'),_0x5d56b8['basename'])};return _0xbff41f;});if(!_0x9b0341[_0x8960('0xdf')]){return db[_0x8960('0xe0')][_0x8960('0xe1')](function(_0x4d3c5b){return db[_0x8960('0xe2')]['bulkCreate'](_0x570977,{'transaction':_0x4d3c5b});});}}})[_0x8960('0x37')](function(){if(_0x5f16c4){_0xac389a=_0x5f16c4;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x8960('0xe3')],'as':_0x8960('0xe4'),'raw':!![]}]});}})[_0x8960('0x37')](function(_0x46e1fb){if(_0x46e1fb&&_0x46e1fb[_0x8960('0xe4')]&&_0x9b0341[_0x8960('0xe5')]&&_0x9b0341[_0x8960('0xe6')]){var _0x1be2b1={'tls':{'rejectUnauthorized':![]}};if(_0x46e1fb[_0x8960('0xe4')][_0x8960('0xe7')]){_0x1be2b1[_0x8960('0xe7')]=_0x46e1fb['Smtp'][_0x8960('0xe7')];}else{_0x1be2b1[_0x8960('0xe8')]=_0x46e1fb[_0x8960('0xe4')]['host'];_0x1be2b1['port']=_0x46e1fb[_0x8960('0xe4')][_0x8960('0xe9')];_0x1be2b1[_0x8960('0xea')]=_0x46e1fb['Smtp'][_0x8960('0xea')];}if(_0x46e1fb['Smtp'][_0x8960('0xeb')]){_0x1be2b1[_0x8960('0xec')]={'user':_0x46e1fb[_0x8960('0xe4')][_0x8960('0x61')],'pass':_0x46e1fb[_0x8960('0xe4')][_0x8960('0xed')]};}return respondWithRpcPromise(_0x8960('0xee'),_0x8960('0xef'),{'account':_0x1be2b1,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x46e1fb[_0x8960('0x3c')],_0x46e1fb[_0x8960('0xf0')]||_0x46e1fb[_0x8960('0xe4')][_0x8960('0x61')]),'to':_0x9b0341['forwardOfflineAddress'],'subject':_0x9b0341['offlineMessageSubject'],'html':_0xac389a['body'],'attachments':_0x2a9287}},client9003)[_0x8960('0x37')](function(){return _0xac389a;})[_0x8960('0x5e')](function(_0x375400){console[_0x8960('0x24')](_0x375400);});}})[_0x8960('0x37')](function(){if(_0x9b0341&&_0x9b0341[_0x8960('0xdf')]&&_0x9b0341[_0x8960('0xf1')]){var _0x4aabc6=[];if(_0x47bfe2['length']){_0x4aabc6=_0x47bfe2['map'](function(_0x113f53){return{'name':_0x113f53[_0x8960('0xda')],'basename':_0x113f53[_0x8960('0x77')],'type':_0x113f53['mimetype'],'ChatOfflineMessageId':_0x5f16c4['id']};});}var _0x572fdf;if(!_[_0x8960('0x82')](_0x9b0341[_0x8960('0xf2')])){var _0x43e748=_[_0x8960('0x41')](_0x4e2144[_0x8960('0x60')],function(_0x249f39){return _0x249f39;});var _0x1b1bc1=_[_0x8960('0xf3')](_0x43e748)[0x0];var _0x34455a=_['mapValues'](_0x1b1bc1,function(_0x5b2028){return _0x5b2028;});_0x572fdf=_0x34455a[0x1][_0x9b0341[_0x8960('0xf2')]];}var _0x4d1a9c={'from':_0x268e32[_0x8960('0xf0')],'firstName':_0x268e32[_0x8960('0xb2')],'lastName':_0x268e32['lastName'],'mapKey':_0x8960('0xf0'),'message':{'from':_0x268e32[_0x8960('0xf0')],'to':_0x9b0341[_0x8960('0xd5')]['email'],'cc':'','subject':_['isNil'](_0x572fdf)?_0x9b0341['offlineMessageSubject']:_0x572fdf,'messageId':'','sentAt':new Date(),'attach':_0x4aabc6[_0x8960('0x4b')],'attachments':_0x4aabc6,'originChannel':'Chat','ChatWebsiteId':_0x9b0341['id'],'ChatOfflineMessageId':_0xac389a['id'],'originTo':_0x9b0341[_0x8960('0xd5')][_0x8960('0xf0')]},'body':_0xac389a[_0x8960('0x60')]};var _0x2eb74b={'account':{'id':_0x9b0341[_0x8960('0xf1')]},'body':_0x4d1a9c,'log':_0x8960('0xf4')};return respondWithRpcPromise('NotifyMailAccount',_0x8960('0xf5'),_0x2eb74b,client9001)[_0x8960('0x37')](function(){return _0xac389a;})[_0x8960('0x5e')](function(_0x4d6452){console[_0x8960('0x24')](_0x4d6452);});}return;})['then'](function(){if(_0xac389a){return _0xac389a;}})[_0x8960('0x37')](respondWithResult(_0x2ea795,null))['catch'](function(_0x39df5c){console[_0x8960('0x24')](_0x8960('0x5e'),_0x39df5c);for(var _0x1707a3 of _0x47bfe2){var _0x3f56b3=path[_0x8960('0x7d')](config['root'],_0x8960('0xdc'),_0x8960('0xd0'),_0x8960('0xdd'),_0x8960('0xde'),_0x1707a3[_0x8960('0x77')]);fs_extra[_0x8960('0xf6')](_0x3f56b3)[_0x8960('0x5e')](function(_0x10eaa8){console['error'](_0x8960('0xf7'),_0x3f56b3,_0x10eaa8);});}});};exports['addInteraction']=function(_0x57919a,_0x4f0cdb,_0x576576){return db['ChatInteraction']['find']({'where':{'id':_0x57919a[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x4f0cdb,null))[_0x8960('0x37')](function(_0x2594bb){if(_0x2594bb){return _0x2594bb[_0x8960('0xf8')](_0x57919a['body'][_0x8960('0x70')],_[_0x8960('0xf9')](_0x57919a['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4f0cdb,null))[_0x8960('0x5e')](handleError(_0x4f0cdb,null));};exports[_0x8960('0xfa')]=function(_0x3fa94f,_0x118a8c,_0xc84562){var _0x58afb2={'raw':![],'where':{}};var _0x3c60db={};var _0x489b11={'count':0x0,'rows':[]};return db[_0x8960('0x55')][_0x8960('0x73')]({'where':{'id':_0x3fa94f[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x118a8c,null))['then'](function(_0x430a46){if(_0x430a46){_0x3c60db['model']=_[_0x8960('0x46')](db[_0x8960('0xbd')]['rawAttributes']);_0x3c60db['query']=_[_0x8960('0x46')](_0x3fa94f[_0x8960('0x45')]);_0x3c60db[_0x8960('0x47')]=_['intersection'](_0x3c60db[_0x8960('0x44')],_0x3c60db[_0x8960('0x45')]);_0x58afb2[_0x8960('0x49')]=_['intersection'](_0x3c60db['model'],qs['fields'](_0x3fa94f[_0x8960('0x45')][_0x8960('0x4a')]));_0x58afb2['attributes']=_0x58afb2[_0x8960('0x49')][_0x8960('0x4b')]?_0x58afb2[_0x8960('0x49')]:_0x3c60db[_0x8960('0x44')];if(!_0x3fa94f[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x58afb2[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x3fa94f[_0x8960('0x45')][_0x8960('0x2f')]);_0x58afb2[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x3fa94f[_0x8960('0x45')]['offset']);}_0x58afb2['order']=qs[_0x8960('0x4f')](_0x3fa94f[_0x8960('0x45')][_0x8960('0x4f')]);_0x58afb2['where']=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x3fa94f[_0x8960('0x45')],_0x3c60db[_0x8960('0x47')]));_0x58afb2[_0x8960('0x52')][_0x8960('0x6d')]=_0x430a46['id'];if(_0x3fa94f[_0x8960('0x45')]['filter']){_0x58afb2[_0x8960('0x52')]=_[_0x8960('0x51')](_0x58afb2[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x58afb2[_0x8960('0x49')],function(_0x2a30db){var _0x4ad287={};_0x4ad287[_0x2a30db]={'$like':'%'+_0x3fa94f[_0x8960('0x45')][_0x8960('0x6e')]+'%'};return _0x4ad287;})});}_0x58afb2=_['merge']({},_0x58afb2,_0x3fa94f[_0x8960('0x54')]);return db[_0x8960('0xbd')][_0x8960('0x30')]({'where':_0x58afb2['where']})[_0x8960('0x37')](function(_0x420ad8){_0x489b11[_0x8960('0x30')]=_0x420ad8;if(_0x3fa94f[_0x8960('0x45')][_0x8960('0x56')]){_0x58afb2[_0x8960('0x57')]=[{'model':db[_0x8960('0x93')],'as':_0x8960('0xfb'),'required':![]},{'model':db[_0x8960('0xca')],'as':_0x8960('0xfc'),'attributes':[_0x8960('0x3c'),'fullname','internal'],'required':![]},{'model':db[_0x8960('0xfd')],'as':'Tags','attributes':['id',_0x8960('0x3c'),_0x8960('0xfe')],'where':_0x3fa94f[_0x8960('0x45')][_0x8960('0xff')]?{'id':_0x3fa94f[_0x8960('0x45')][_0x8960('0xff')]}:undefined,'required':_0x3fa94f[_0x8960('0x45')][_0x8960('0xff')]?!![]:![]}];}return db['ChatInteraction'][_0x8960('0x58')](_0x58afb2);})['then'](function(_0x6fd4f9){_0x489b11[_0x8960('0x59')]=_0x6fd4f9;return _0x489b11;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x118a8c,_0x58afb2))[_0x8960('0x5e')](handleError(_0x118a8c,null));};function iftimePromise(_0x42a6b8,_0x25725b){return respondWithRpcPromise(_0x8960('0x100'),_0x8960('0x101'),{'command':_0x25725b['timezone']?util['format'](_0x8960('0x102'),_0x42a6b8['interval'],_0x25725b['timezone']):util[_0x8960('0xb7')]('iftime\x20%s',_0x42a6b8['interval'])},client9002)[_0x8960('0x37')](function(_0x1a7868){var _0x14aefd=_0x1a7868&&_0x1a7868['indexOf'](_0x8960('0x103'))>=0x0?!![]:![];logger[_0x8960('0x21')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x25725b['id'],_0x42a6b8['id'],_0x42a6b8[_0x8960('0x104')],_0x14aefd?_0x8960('0x105'):_0x8960('0x106'),_0x25725b[_0x8960('0x107')]?_0x25725b['timezone']:_0x8960('0x108'));return _0x14aefd;})[_0x8960('0x5e')](function(_0x892987){logger[_0x8960('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x25725b['id'],_0x42a6b8['id'],_0x42a6b8[_0x8960('0x104')],util['inspect'](_0x892987,{'showHidden':![],'depth':null}),_0x25725b[_0x8960('0x107')]?_0x25725b['timezone']:_0x8960('0x108'));return![];});}exports[_0x8960('0x101')]=function(_0x326a5e,_0x946924,_0x295a5f){var _0x39de0f=0x0;var _0x54c0b0=0x0;var _0x144605=![];var _0x392d2d;var _0x4aa39b;return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x326a5e[_0x8960('0x5b')]['id']},'include':[{'model':db['Interval'],'as':_0x8960('0x109'),'include':[{'model':db['Interval'],'as':_0x8960('0x10a'),'attributes':['id',_0x8960('0x104')],'raw':!![]}]}]})[_0x8960('0x37')](handleEntityNotFound(_0x946924,null))[_0x8960('0x37')](function(_0x595ff8){if(_0x595ff8){_0x392d2d=_0x595ff8;return _0x595ff8[_0x8960('0x10b')]({'raw':!![]});}})[_0x8960('0x37')](function(_0x380196){if(_0x392d2d){if(_0x380196){_0x4aa39b=_0x380196;}}return require(_0x8960('0x17'))['getLicense']();})[_0x8960('0x37')](function(_0x2af66f){if(_0x2af66f){_0x54c0b0=_0x2af66f['virtual'];_0x144605=_0x2af66f['custom'];}})[_0x8960('0x37')](function(){return db[_0x8960('0xbd')][_0x8960('0x30')]({'where':{'closed':![]}});})[_0x8960('0x37')](function(_0x5d98dc){_0x39de0f=_0x5d98dc;if(_0x54c0b0&&_0x5d98dc>_0x54c0b0){return db[_0x8960('0x10c')][_0x8960('0x73')]({'where':{'id':0x1}})['then'](function(_0x2b2cd0){if(_0x2b2cd0){_0x2b2cd0[_0x8960('0x10d')]('chatLicenseExceeded');}});}})[_0x8960('0x37')](function(){if(_0x392d2d[_0x8960('0x109')]&&_0x392d2d['Interval']['Intervals']){var _0x33ea4e=[];for(var _0x594580=0x0;_0x594580<_0x392d2d[_0x8960('0x109')][_0x8960('0x10a')][_0x8960('0x4b')];_0x594580++){var _0xf8cae4=_0x392d2d['Interval'][_0x8960('0x10a')][_0x594580][_0x8960('0x38')]({'plain':!![]});_0x33ea4e[_0x8960('0xc4')](iftimePromise(_0xf8cae4,_0x392d2d));}return BPromise[_0x8960('0x10e')](_0x33ea4e)[_0x8960('0x37')](function(_0x32c4a3){return _[_0x8960('0x10f')](_0x32c4a3);});}else{return!![];}})['then'](function(_0x482e25){var _0x5386ef=fs['readFileSync'](path['join'](config[_0x8960('0x7e')],_0x8960('0x110')),'utf8');var _0x1f69b7={'remote':_0x392d2d[_0x8960('0x111')],'query':querystring[_0x8960('0x23')](_[_0x8960('0x51')](_0x392d2d['get']({'plain':!![]}),{'customerIp':_0x326a5e[_0x8960('0x90')][_0x8960('0xaf')]||_0x326a5e[_0x8960('0x90')][_0x8960('0x112')]||_0x326a5e[_0x8960('0x113')][_0x8960('0x114')]||_0x326a5e['ip'],'referer':_0x326a5e[_0x8960('0x90')][_0x8960('0x115')],'openedInteractions':_0x39de0f,'maxInteractions':_0x54c0b0,'virtual':_0x144605[_0x8960('0x116')],'online':_0x482e25,'custom':_0x144605}))[_0x8960('0x117')](/'/g,'\x5c\x27')};_0x946924[_0x8960('0x3d')](ejs[_0x8960('0xd8')](Mustache[_0x8960('0xd8')](_0x5386ef,_0x1f69b7),{'proactiveActions':_0x4aa39b,'alignment':_0x392d2d['alignment'],'verticalAlignment':_0x392d2d[_0x8960('0x118')],'div_color':_0x392d2d['color'],'text_color':_0x392d2d['textColor'],'button_color':_0x392d2d[_0x8960('0x119')],'background_color':_0x392d2d['backgroundColor']}));})['catch'](handleError(_0x946924,null));};exports[_0x8960('0x11a')]=function(_0x5a77c4,_0x311984,_0xfc4f90){return db['ChatWebsite'][_0x8960('0x73')]({'where':{'id':_0x5a77c4[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x311984,null))['then'](function(_0x3182f8){if(_0x3182f8){return db[_0x8960('0xe0')][_0x8960('0xe1')](function(_0x1b330b){return db[_0x8960('0xa4')][_0x8960('0x3a')]({'where':{'ChatWebsiteId':_0x5a77c4[_0x8960('0x5b')]['id']},'transaction':_0x1b330b})[_0x8960('0x37')](function(_0x2f8272){var _0x411034=_[_0x8960('0x41')](_0x5a77c4['body'],function(_0x11187b){_0x11187b['ChatWebsiteId']=_0x5a77c4[_0x8960('0x5b')]['id'];return _0x11187b;});return db[_0x8960('0xa4')][_0x8960('0x11b')](_0x411034,{'transaction':_0x1b330b});});})[_0x8960('0x37')](function(){return db[_0x8960('0xa4')][_0x8960('0x11c')]({'where':{'ChatWebsiteId':_0x5a77c4[_0x8960('0x5b')]['id']},'order':'priority'});});}})[_0x8960('0x37')](respondWithResult(_0x311984,null))[_0x8960('0x5e')](handleError(_0x311984,null));};exports[_0x8960('0x11d')]=function(_0x3e7b98,_0xe9b87f,_0xab4c5){var _0x330cb2={};var _0x35a99c={};var _0x3c643b;var _0x473908;return db[_0x8960('0x55')][_0x8960('0x73')]({'where':{'id':_0x3e7b98[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe9b87f,null))[_0x8960('0x37')](function(_0x2ce0ad){if(_0x2ce0ad){_0x3c643b=_0x2ce0ad;_0x35a99c[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0xa4')]['rawAttributes']);_0x35a99c[_0x8960('0x45')]=_['keys'](_0x3e7b98[_0x8960('0x45')]);_0x35a99c[_0x8960('0x47')]=_[_0x8960('0x48')](_0x35a99c[_0x8960('0x44')],_0x35a99c['query']);_0x330cb2[_0x8960('0x49')]=_[_0x8960('0x48')](_0x35a99c['model'],qs[_0x8960('0x4a')](_0x3e7b98[_0x8960('0x45')][_0x8960('0x4a')]));_0x330cb2[_0x8960('0x49')]=_0x330cb2['attributes']['length']?_0x330cb2[_0x8960('0x49')]:_0x35a99c[_0x8960('0x44')];_0x330cb2['order']=qs[_0x8960('0x4f')](_0x3e7b98[_0x8960('0x45')][_0x8960('0x4f')]);_0x330cb2['where']=qs['filters'](_[_0x8960('0x50')](_0x3e7b98[_0x8960('0x45')],_0x35a99c[_0x8960('0x47')]));if(_0x3e7b98[_0x8960('0x45')][_0x8960('0x6e')]){_0x330cb2[_0x8960('0x52')]=_[_0x8960('0x51')](_0x330cb2[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x330cb2[_0x8960('0x49')],function(_0x481fb2){var _0x33d467={};_0x33d467[_0x481fb2]={'$like':'%'+_0x3e7b98[_0x8960('0x45')]['filter']+'%'};return _0x33d467;})});}_0x330cb2=_[_0x8960('0x51')]({},_0x330cb2,_0x3e7b98['options']);return _0x3c643b[_0x8960('0x11d')](_0x330cb2);}})[_0x8960('0x37')](function(_0x4fa9fb){if(_0x4fa9fb){_0x473908=_0x4fa9fb[_0x8960('0x4b')];if(!_0x3e7b98[_0x8960('0x45')][_0x8960('0x4c')]('nolimit')){_0x330cb2['limit']=qs['limit'](_0x3e7b98[_0x8960('0x45')][_0x8960('0x2f')]);_0x330cb2[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x3e7b98[_0x8960('0x45')]['offset']);}return _0x3c643b[_0x8960('0x11d')](_0x330cb2);}})['then'](function(_0x3accee){if(_0x3accee){return _0x3accee?{'count':_0x473908,'rows':_0x3accee}:null;}})[_0x8960('0x37')](respondWithResult(_0xe9b87f,null))[_0x8960('0x5e')](handleError(_0xe9b87f,null));};exports['addProactiveActions']=function(_0xfca6c3,_0x57c759,_0x248db1){return db['chatProactiveAction'][_0x8960('0x5d')]({'where':{'id':_0xfca6c3[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x57c759,null))[_0x8960('0x37')](function(_0xe133d6){if(_0xe133d6){return _0xe133d6[_0x8960('0x11e')](_0xfca6c3[_0x8960('0x60')][_0x8960('0x70')],_[_0x8960('0xf9')](_0xfca6c3[_0x8960('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0x57c759,null))[_0x8960('0x5e')](handleError(_0x57c759,null));};exports[_0x8960('0x10b')]=function(_0x514114,_0x551b19,_0x3be707){var _0x2bfbb2={};var _0x37b027={};var _0x2633d3;var _0x413c0b;return db[_0x8960('0x55')]['findOne']({'where':{'id':_0x514114['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x551b19,null))['then'](function(_0x44a7de){if(_0x44a7de){_0x2633d3=_0x44a7de;_0x37b027[_0x8960('0x44')]=_[_0x8960('0x46')](db[_0x8960('0x11f')][_0x8960('0x5c')]);_0x37b027[_0x8960('0x45')]=_['keys'](_0x514114[_0x8960('0x45')]);_0x37b027[_0x8960('0x47')]=_['intersection'](_0x37b027[_0x8960('0x44')],_0x37b027[_0x8960('0x45')]);_0x2bfbb2['attributes']=_[_0x8960('0x48')](_0x37b027[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x514114['query'][_0x8960('0x4a')]));_0x2bfbb2[_0x8960('0x49')]=_0x2bfbb2[_0x8960('0x49')][_0x8960('0x4b')]?_0x2bfbb2['attributes']:_0x37b027[_0x8960('0x44')];_0x2bfbb2[_0x8960('0x4e')]=qs['sort'](_0x514114['query']['sort']);_0x2bfbb2[_0x8960('0x52')]=qs['filters'](_[_0x8960('0x50')](_0x514114[_0x8960('0x45')],_0x37b027['filters']));if(_0x514114[_0x8960('0x45')][_0x8960('0x6e')]){_0x2bfbb2[_0x8960('0x52')]=_['merge'](_0x2bfbb2[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x2bfbb2[_0x8960('0x49')],function(_0x577fc7){var _0x55666f={};_0x55666f[_0x577fc7]={'$like':'%'+_0x514114[_0x8960('0x45')][_0x8960('0x6e')]+'%'};return _0x55666f;})});}_0x2bfbb2=_[_0x8960('0x51')]({},_0x2bfbb2,_0x514114[_0x8960('0x54')]);return _0x2633d3[_0x8960('0x10b')](_0x2bfbb2);}})[_0x8960('0x37')](function(_0x4e9acc){if(_0x4e9acc){_0x413c0b=_0x4e9acc['length'];if(!_0x514114[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x2bfbb2[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x514114[_0x8960('0x45')][_0x8960('0x2f')]);_0x2bfbb2[_0x8960('0x31')]=qs['offset'](_0x514114[_0x8960('0x45')][_0x8960('0x31')]);}return _0x2633d3[_0x8960('0x10b')](_0x2bfbb2);}})[_0x8960('0x37')](function(_0x5b9215){if(_0x5b9215){return _0x5b9215?{'count':_0x413c0b,'rows':_0x5b9215}:null;}})[_0x8960('0x37')](respondWithResult(_0x551b19,null))[_0x8960('0x5e')](handleError(_0x551b19,null));};exports[_0x8960('0x120')]=function(_0x3fce4e,_0x296c5f,_0x42e4b7){var _0x495fe3=_0x3fce4e[_0x8960('0x45')][_0x8960('0x121')]===_0x8960('0x122')?_0x8960('0x123'):_0x8960('0x124');return db[_0x8960('0x55')][_0x8960('0x5d')]({'attributes':['id',_0x495fe3],'where':{'id':_0x3fce4e['params']['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x296c5f,null))[_0x8960('0x37')](function(_0x43a91f){if(_0x43a91f){var _0x49a5fd=_0x43a91f[_0x495fe3];var _0x1db40c=_0x49a5fd&&_0x49a5fd[_0x8960('0x125')]?_0x49a5fd[_0x8960('0x125')]:[];_0x296c5f[_0x8960('0x3d')]({'fromKey':_[_0x8960('0x82')](_0x49a5fd[_0x8960('0x126')])?undefined:_0x49a5fd[_0x8960('0x126')],'count':_0x1db40c['length'],'rows':_0x1db40c});}})[_0x8960('0x5e')](handleError(_0x296c5f,null));};exports[_0x8960('0x127')]=function(_0x2ca615,_0x35836b,_0xb52098){var _0x4b318c={'raw':![],'where':{}};var _0x650856={};var _0x329807={'count':0x0,'rows':[]};return db[_0x8960('0x55')]['findOne']({'where':{'id':_0x2ca615[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x35836b,null))[_0x8960('0x37')](function(_0x153be0){if(_0x153be0){_0x650856[_0x8960('0x44')]=_['keys'](db[_0x8960('0x128')][_0x8960('0x5c')]);_0x650856[_0x8960('0x45')]=_[_0x8960('0x46')](_0x2ca615[_0x8960('0x45')]);_0x650856['filters']=_[_0x8960('0x48')](_0x650856[_0x8960('0x44')],_0x650856[_0x8960('0x45')]);_0x4b318c[_0x8960('0x49')]=_[_0x8960('0x48')](_0x650856[_0x8960('0x44')],qs[_0x8960('0x4a')](_0x2ca615['query'][_0x8960('0x4a')]));_0x4b318c[_0x8960('0x49')]=_0x4b318c[_0x8960('0x49')][_0x8960('0x4b')]?_0x4b318c[_0x8960('0x49')]:_0x650856['model'];if(!_0x2ca615[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x4b318c['limit']=qs[_0x8960('0x2f')](_0x2ca615[_0x8960('0x45')][_0x8960('0x2f')]);_0x4b318c['offset']=qs[_0x8960('0x31')](_0x2ca615['query'][_0x8960('0x31')]);}_0x4b318c[_0x8960('0x4e')]=qs[_0x8960('0x4f')](_0x2ca615[_0x8960('0x45')][_0x8960('0x4f')]);_0x4b318c[_0x8960('0x52')]=qs[_0x8960('0x47')](_['pick'](_0x2ca615[_0x8960('0x45')],_0x650856[_0x8960('0x47')]));_0x4b318c['where'][_0x8960('0x6d')]=_0x153be0['id'];if(_0x2ca615[_0x8960('0x45')][_0x8960('0x6e')]){_0x4b318c[_0x8960('0x52')]=_[_0x8960('0x51')](_0x4b318c[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x4b318c[_0x8960('0x49')],function(_0x138a34){var _0x303f0={};_0x303f0[_0x138a34]={'$like':'%'+_0x2ca615[_0x8960('0x45')]['filter']+'%'};return _0x303f0;})});}_0x4b318c=_[_0x8960('0x51')]({},_0x4b318c,_0x2ca615['options']);return db[_0x8960('0x128')][_0x8960('0x30')]({'where':_0x4b318c[_0x8960('0x52')]})[_0x8960('0x37')](function(_0x443a2f){_0x329807[_0x8960('0x30')]=_0x443a2f;if(_0x2ca615[_0x8960('0x45')][_0x8960('0x56')]){_0x4b318c['include']=[{'all':!![]}];}else{_0x4b318c[_0x8960('0x57')]=[{'model':db['CmContact'],'as':_0x8960('0xfb'),'required':![]},{'model':db[_0x8960('0xe2')],'as':'Attachments','required':![]}];}return db[_0x8960('0x128')][_0x8960('0x58')](_0x4b318c);})[_0x8960('0x37')](function(_0x2de94e){_0x329807[_0x8960('0x59')]=_0x2de94e;return _0x329807;});}})[_0x8960('0x37')](respondWithFilteredResult(_0x35836b,_0x4b318c))[_0x8960('0x5e')](handleError(_0x35836b,null));};exports['addAgents']=function(_0x10a6fb,_0x48f48f,_0x2a3e90){return db['ChatWebsite'][_0x8960('0x5d')]({'where':{'id':_0x10a6fb[_0x8960('0x5b')]['id']}})[_0x8960('0x37')](handleEntityNotFound(_0x48f48f,null))['then'](function(_0x34c5c7){if(_0x34c5c7){return _0x34c5c7[_0x8960('0x129')](_0x10a6fb['body'][_0x8960('0x70')],_[_0x8960('0xf9')](_0x10a6fb[_0x8960('0x60')],[_0x8960('0x70'),'id'])||{})['spread'](function(_0x2a0d88){for(var _0x1c6ed1=0x0;_0x1c6ed1<_0x10a6fb[_0x8960('0x60')]['ids'][_0x8960('0x4b')];_0x1c6ed1+=0x1){socket[_0x8960('0x12a')](_0x8960('0x12b'),{'UserId':Number(_0x10a6fb[_0x8960('0x60')][_0x8960('0x70')][_0x1c6ed1]),'ChatWebsiteId':Number(_0x10a6fb[_0x8960('0x5b')]['id'])});}return _0x2a0d88;});}})['then'](respondWithResult(_0x48f48f,null))[_0x8960('0x5e')](handleError(_0x48f48f,null));};exports[_0x8960('0x12c')]=function(_0x5eaaae,_0x5c9463,_0x1c9c5c){return db[_0x8960('0x55')][_0x8960('0x5d')]({'where':{'id':_0x5eaaae[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5c9463,null))[_0x8960('0x37')](function(_0x544d5d){if(_0x544d5d){return _0x544d5d[_0x8960('0x12c')](_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')])[_0x8960('0x37')](function(){if(_[_0x8960('0x12d')](_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')])){for(var _0x11f390=0x0;_0x11f390<_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')][_0x8960('0x4b')];_0x11f390+=0x1){socket[_0x8960('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x5eaaae[_0x8960('0x45')][_0x8960('0x70')][_0x11f390]),'ChatWebsiteId':Number(_0x5eaaae['params']['id'])});}}else{socket[_0x8960('0x12a')](_0x8960('0x12e'),{'UserId':Number(_0x5eaaae['query'][_0x8960('0x70')]),'ChatWebsiteId':Number(_0x5eaaae[_0x8960('0x5b')]['id'])});}});}})[_0x8960('0x37')](respondWithStatusCode(_0x5c9463,null))[_0x8960('0x5e')](handleError(_0x5c9463,null));};exports[_0x8960('0x12f')]=function(_0x2bb0cb,_0x42ddf1,_0x1033cd){var _0x1542f8={};var _0x54c104={};var _0x4da9eb;var _0x3c87e8;return db['ChatWebsite'][_0x8960('0x73')]({'where':{'id':_0x2bb0cb[_0x8960('0x5b')]['id']}})['then'](handleEntityNotFound(_0x42ddf1,null))['then'](function(_0x484611){if(_0x484611){_0x4da9eb=_0x484611;_0x54c104['model']=_['keys'](db['User'][_0x8960('0x5c')]);_0x54c104[_0x8960('0x45')]=_[_0x8960('0x46')](_0x2bb0cb[_0x8960('0x45')]);_0x54c104[_0x8960('0x47')]=_[_0x8960('0x48')](_0x54c104[_0x8960('0x44')],_0x54c104[_0x8960('0x45')]);_0x1542f8[_0x8960('0x49')]=_[_0x8960('0x48')](_0x54c104[_0x8960('0x44')],qs['fields'](_0x2bb0cb['query'][_0x8960('0x4a')]));_0x1542f8[_0x8960('0x49')]=_0x1542f8[_0x8960('0x49')][_0x8960('0x4b')]?_0x1542f8[_0x8960('0x49')]:_0x54c104[_0x8960('0x44')];_0x1542f8['order']=qs[_0x8960('0x4f')](_0x2bb0cb[_0x8960('0x45')][_0x8960('0x4f')]);_0x1542f8[_0x8960('0x52')]=qs[_0x8960('0x47')](_[_0x8960('0x50')](_0x2bb0cb[_0x8960('0x45')],_0x54c104[_0x8960('0x47')]));if(_0x2bb0cb[_0x8960('0x45')][_0x8960('0x6e')]){_0x1542f8['where']=_[_0x8960('0x51')](_0x1542f8[_0x8960('0x52')],{'$or':_[_0x8960('0x41')](_0x1542f8[_0x8960('0x49')],function(_0x3548a0){var _0x3387d6={};_0x3387d6[_0x3548a0]={'$like':'%'+_0x2bb0cb[_0x8960('0x45')][_0x8960('0x6e')]+'%'};return _0x3387d6;})});}_0x1542f8=_[_0x8960('0x51')]({},_0x1542f8,_0x2bb0cb[_0x8960('0x54')]);return _0x4da9eb[_0x8960('0x12f')](_0x1542f8);}})[_0x8960('0x37')](function(_0x6225ee){if(_0x6225ee){_0x3c87e8=_0x6225ee['length'];if(!_0x2bb0cb[_0x8960('0x45')][_0x8960('0x4c')](_0x8960('0x4d'))){_0x1542f8[_0x8960('0x2f')]=qs[_0x8960('0x2f')](_0x2bb0cb['query'][_0x8960('0x2f')]);_0x1542f8[_0x8960('0x31')]=qs[_0x8960('0x31')](_0x2bb0cb['query'][_0x8960('0x31')]);}return _0x4da9eb['getAgents'](_0x1542f8);}})['then'](function(_0x5b25e2){if(_0x5b25e2){return _0x5b25e2?{'count':_0x3c87e8,'rows':_0x5b25e2}:null;}})[_0x8960('0x37')](respondWithResult(_0x42ddf1,null))[_0x8960('0x5e')](handleError(_0x42ddf1,null));};
\ No newline at end of file
+var _0x91bd=['update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','addLogo','sitepic','addAvatar','addCustomerAvatar','customerAvatar','file','filename','addSystemAvatar','getLogo','root','getLicense','isNil','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','headers','user-agent','getResult','chat','CmContact','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','interval','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','replace','color_button','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x44182a,_0xa34b75){var _0x28620e=function(_0x988aa6){while(--_0x988aa6){_0x44182a['push'](_0x44182a['shift']());}};_0x28620e(++_0xa34b75);}(_0x91bd,0xfb));var _0xd91b=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x91bd[_0x5b26cb];return _0x563d12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd91b('0x0'));var zipdir=require(_0xd91b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd91b('0x2'));var moment=require('moment');var BPromise=require(_0xd91b('0x3'));var Mustache=require(_0xd91b('0x4'));var util=require(_0xd91b('0x5'));var path=require(_0xd91b('0x6'));var sox=require(_0xd91b('0x7'));var csv=require(_0xd91b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd91b('0x9'));var crypto=require(_0xd91b('0xa'));var jsforce=require(_0xd91b('0xb'));var deskjs=require(_0xd91b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd91b('0xd'));var Papa=require(_0xd91b('0xe'));var Redis=require('ioredis');var authService=require(_0xd91b('0xf'));var qs=require(_0xd91b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd91b('0x11'));var logger=require(_0xd91b('0x12'))(_0xd91b('0x13'));var utils=require(_0xd91b('0x14'));var config=require(_0xd91b('0x15'));var licenseUtil=require(_0xd91b('0x16'));var db=require(_0xd91b('0x17'))['db'];config['redis']=_[_0xd91b('0x18')](config['redis'],{'host':_0xd91b('0x19'),'port':0x18eb});var socket=require(_0xd91b('0x1a'))(new Redis(config[_0xd91b('0x1b')]));require(_0xd91b('0x1c'))[_0xd91b('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd91b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xd91b('0x1e')]['http']({'port':0x232a});var client9003=jayson[_0xd91b('0x1e')][_0xd91b('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0xd91b('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x2a8fed,_0x910eea,_0x2a9cec,_0x4c6096){return new BPromise(function(_0xd154f7,_0x1272e9){var _0x149a0f=_0x4c6096||client;return _0x149a0f[_0xd91b('0x20')](_0x2a8fed,_0x2a9cec)[_0xd91b('0x21')](function(_0x2429f7){logger[_0xd91b('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x910eea,'request\x20sent');logger[_0xd91b('0x23')](_0xd91b('0x24'),_0x910eea,_0xd91b('0x25'),JSON[_0xd91b('0x26')](_0x2429f7));if(_0x2429f7['error']){if(_0x2429f7['error']['code']===0x1f4){logger[_0xd91b('0x27')](_0xd91b('0x28'),_0x910eea,_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);return _0x1272e9(_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);}logger[_0xd91b('0x27')](_0xd91b('0x28'),_0x910eea,_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);return _0xd154f7(_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x910eea,_0xd91b('0x25'));_0xd154f7(_0x2429f7[_0xd91b('0x2a')][_0xd91b('0x29')]);}})[_0xd91b('0x2b')](function(_0x41f1ad){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x910eea,_0x41f1ad);_0x1272e9(_0x41f1ad);});});}function respondWithStatusCode(_0x34c536,_0x5c95a3){_0x5c95a3=_0x5c95a3||0xcc;return function(_0x1532bc){if(_0x1532bc){return _0x34c536[_0xd91b('0x2c')](_0x5c95a3);}return _0x34c536[_0xd91b('0x2d')](_0x5c95a3)[_0xd91b('0x2e')]();};}function respondWithResult(_0x2c7d19,_0x4863f5){_0x4863f5=_0x4863f5||0xc8;return function(_0x5a3d60){if(_0x5a3d60){return _0x2c7d19[_0xd91b('0x2d')](_0x4863f5)[_0xd91b('0x2f')](_0x5a3d60);}};}function respondWithFilteredResult(_0x557959,_0x38d649){return function(_0x4852e5){if(_0x4852e5){var _0x16d5bb=typeof _0x38d649['offset']===_0xd91b('0x30')&&typeof _0x38d649[_0xd91b('0x31')]===_0xd91b('0x30');var _0x3f522a=_0x4852e5[_0xd91b('0x32')];var _0x7e958=_0x16d5bb?0x0:_0x38d649[_0xd91b('0x33')];var _0x406acd=_0x16d5bb?_0x4852e5[_0xd91b('0x32')]:_0x38d649['offset']+_0x38d649[_0xd91b('0x31')];var _0xc1f78d;if(_0x406acd>=_0x3f522a){_0x406acd=_0x3f522a;_0xc1f78d=0xc8;}else{_0xc1f78d=0xce;}_0x557959['status'](_0xc1f78d);return _0x557959[_0xd91b('0x34')]('Content-Range',_0x7e958+'-'+_0x406acd+'/'+_0x3f522a)[_0xd91b('0x2f')](_0x4852e5);}return null;};}function patchUpdates(_0x4fefa6){return function(_0x2ede62){try{jsonpatch[_0xd91b('0x35')](_0x2ede62,_0x4fefa6,!![]);}catch(_0x2f5a65){return BPromise[_0xd91b('0x36')](_0x2f5a65);}return _0x2ede62[_0xd91b('0x37')]();};}function saveUpdates(_0x1a1a01,_0x4dcdde){return function(_0x1f16f3){if(_0x1f16f3){return _0x1f16f3[_0xd91b('0x38')](_0x1a1a01)[_0xd91b('0x21')](function(_0x8029b2){return _0x8029b2;});}return null;};}function removeEntity(_0x459ca2,_0x13e83d){return function(_0x12d0d5){if(_0x12d0d5){return _0x12d0d5[_0xd91b('0x39')]()[_0xd91b('0x21')](function(){var _0x419e38=_0x12d0d5[_0xd91b('0x3a')]({'plain':!![]});var _0x596121=_0xd91b('0x3b');return db['UserProfileResource'][_0xd91b('0x39')]({'where':{'type':_0x596121,'resourceId':_0x419e38['id']}})[_0xd91b('0x21')](function(){return _0x12d0d5;});})[_0xd91b('0x21')](function(){_0x459ca2[_0xd91b('0x2d')](0xcc)[_0xd91b('0x2e')]();});}};}function handleEntityNotFound(_0x2d2bcd,_0x45013b){return function(_0x44c3f6){if(!_0x44c3f6){_0x2d2bcd[_0xd91b('0x2c')](0x194);}return _0x44c3f6;};}function handleError(_0x20377d,_0x33d589){_0x33d589=_0x33d589||0x1f4;return function(_0x3acf40){logger[_0xd91b('0x27')](_0x3acf40[_0xd91b('0x3c')]);if(_0x3acf40[_0xd91b('0x3d')]){delete _0x3acf40[_0xd91b('0x3d')];}_0x20377d['status'](_0x33d589)[_0xd91b('0x3e')](_0x3acf40);};}exports[_0xd91b('0x3f')]=function(_0x5afb7c,_0x18032e){var _0x237876={'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]},_0x5ac005={},_0x4a64df={'count':0x0,'rows':[]};var _0x16e2ba=_[_0xd91b('0x42')](db[_0xd91b('0x43')][_0xd91b('0x44')],function(_0x189346){return{'name':_0x189346[_0xd91b('0x45')],'type':_0x189346['type']['key']};});_0x5ac005[_0xd91b('0x46')]=_['map'](_0x16e2ba,'name');_0x5ac005['query']=_[_0xd91b('0x47')](_0x5afb7c[_0xd91b('0x48')]);_0x5ac005[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x5ac005[_0xd91b('0x46')],_0x5ac005['query']);_0x237876[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x5ac005[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x5afb7c[_0xd91b('0x48')]['fields']));_0x237876[_0xd91b('0x4b')]=_0x237876['attributes'][_0xd91b('0x4d')]?_0x237876[_0xd91b('0x4b')]:_0x5ac005[_0xd91b('0x46')];if(!_0x5afb7c[_0xd91b('0x48')]['hasOwnProperty']('nolimit')){_0x237876[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x5afb7c[_0xd91b('0x48')]['limit']);_0x237876['offset']=qs[_0xd91b('0x33')](_0x5afb7c[_0xd91b('0x48')]['offset']);}_0x237876['order']=qs[_0xd91b('0x4e')](_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x237876[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x5afb7c['query'],_0x5ac005['filters']),_0x16e2ba);if(_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x51')]){_0x237876[_0xd91b('0x4f')]=_['merge'](_0x237876[_0xd91b('0x4f')],{'$or':_['map'](_0x16e2ba,function(_0x3552a5){if(_0x3552a5[_0xd91b('0x52')]!==_0xd91b('0x53')){var _0x14fbdc={};_0x14fbdc[_0x3552a5[_0xd91b('0x3d')]]={'$like':'%'+_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x14fbdc;}})});}_0x237876=_[_0xd91b('0x54')]({},_0x237876,_0x5afb7c[_0xd91b('0x55')]);var _0x145326={'where':_0x237876['where']};return db['ChatWebsite']['count'](_0x145326)[_0xd91b('0x21')](function(_0x8936d9){_0x4a64df['count']=_0x8936d9;if(_0x5afb7c['query'][_0xd91b('0x56')]){_0x237876[_0xd91b('0x57')]=[{'all':!![]}];}return db['ChatWebsite'][_0xd91b('0x58')](_0x237876);})[_0xd91b('0x21')](function(_0x4b041a){_0x4a64df[_0xd91b('0x59')]=_0x4b041a;return _0x4a64df;})[_0xd91b('0x21')](respondWithFilteredResult(_0x18032e,_0x237876))[_0xd91b('0x2b')](handleError(_0x18032e,null));};exports[_0xd91b('0x5a')]=function(_0x22474c,_0x4f6699){var _0x900420={'raw':![],'where':{'id':_0x22474c[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]},_0x47c464={};_0x47c464[_0xd91b('0x46')]=_[_0xd91b('0x47')](db['ChatWebsite']['rawAttributes']);_0x47c464[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x22474c[_0xd91b('0x48')]);_0x47c464['filters']=_[_0xd91b('0x4a')](_0x47c464[_0xd91b('0x46')],_0x47c464[_0xd91b('0x48')]);_0x900420[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x47c464['model'],qs[_0xd91b('0x4c')](_0x22474c[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x900420[_0xd91b('0x4b')]=_0x900420[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x900420['attributes']:_0x47c464[_0xd91b('0x46')];if(_0x22474c[_0xd91b('0x48')]['includeAll']){_0x900420['include']=[{'all':!![]}];}_0x900420=_['merge']({},_0x900420,_0x22474c['options']);return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x900420)['then'](handleEntityNotFound(_0x4f6699,null))['then'](respondWithResult(_0x4f6699,null))['catch'](handleError(_0x4f6699,null));};exports[_0xd91b('0x5d')]=function(_0x2514a3,_0x16863b){return db[_0xd91b('0x43')][_0xd91b('0x5d')](_0x2514a3['body'],{})[_0xd91b('0x21')](function(_0x369e16){var _0x3a778f=_0x2514a3[_0xd91b('0x5e')][_0xd91b('0x3a')]({'plain':!![]});if(!_0x3a778f)throw new Error(_0xd91b('0x5f'));if(_0x3a778f[_0xd91b('0x60')]==='user'){var _0x3f27f6=_0x369e16[_0xd91b('0x3a')]({'plain':!![]});var _0x4dcca2=_0xd91b('0x3b');return db[_0xd91b('0x61')][_0xd91b('0x5c')]({'where':{'name':_0x4dcca2,'userProfileId':_0x3a778f['userProfileId']},'raw':!![]})[_0xd91b('0x21')](function(_0x4106ea){if(_0x4106ea&&_0x4106ea['autoAssociation']===0x0){return db[_0xd91b('0x62')]['create']({'name':_0x3f27f6[_0xd91b('0x3d')],'resourceId':_0x3f27f6['id'],'type':_0x4106ea[_0xd91b('0x3d')],'sectionId':_0x4106ea['id']},{})[_0xd91b('0x21')](function(){return _0x369e16;});}else{return _0x369e16;}})[_0xd91b('0x2b')](function(_0x24229d){logger[_0xd91b('0x27')](_0xd91b('0x63'),_0x24229d);throw _0x24229d;});}return _0x369e16;})[_0xd91b('0x21')](respondWithResult(_0x16863b,0xc9))[_0xd91b('0x2b')](handleError(_0x16863b,null));};exports[_0xd91b('0x38')]=function(_0x503e75,_0x339cbc){if(_0x503e75[_0xd91b('0x64')]['id']){delete _0x503e75['body']['id'];}return db['ChatWebsite'][_0xd91b('0x5c')]({'where':{'id':_0x503e75[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]})['then'](handleEntityNotFound(_0x339cbc,null))[_0xd91b('0x21')](saveUpdates(_0x503e75['body'],null))[_0xd91b('0x21')](respondWithResult(_0x339cbc,null))[_0xd91b('0x2b')](handleError(_0x339cbc,null));};exports[_0xd91b('0x39')]=function(_0x1012dd,_0x534b34){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x1012dd[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x534b34,null))[_0xd91b('0x21')](removeEntity(_0x534b34,null))[_0xd91b('0x2b')](handleError(_0x534b34,null));};exports[_0xd91b('0x65')]=function(_0x332ef3,_0x52522e){return db[_0xd91b('0x43')][_0xd91b('0x65')]()[_0xd91b('0x21')](respondWithResult(_0x52522e,null))[_0xd91b('0x2b')](handleError(_0x52522e,null));};exports[_0xd91b('0x66')]=function(_0x34eba4,_0x55d653,_0x2fd11d){if(_0x34eba4[_0xd91b('0x64')]['id']){delete _0x34eba4['body']['id'];}return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x34eba4[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x55d653,null))[_0xd91b('0x21')](function(_0x1c8546){if(_0x1c8546){_0x34eba4[_0xd91b('0x64')][_0xd91b('0x67')]=_0x1c8546['id'];return db[_0xd91b('0x68')][_0xd91b('0x5d')](_0x34eba4['body']);}})[_0xd91b('0x21')](respondWithResult(_0x55d653,null))[_0xd91b('0x2b')](handleError(_0x55d653,null));};exports['getDispositions']=function(_0x4402c9,_0x13416c,_0x4a2e2f){var _0x48a35f={'raw':![],'where':{}};var _0x20f041={};var _0x51bfb2={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x4402c9[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x13416c,null))[_0xd91b('0x21')](function(_0x542f45){if(_0x542f45){_0x20f041[_0xd91b('0x46')]=_[_0xd91b('0x47')](db['Disposition'][_0xd91b('0x44')]);_0x20f041[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x4402c9[_0xd91b('0x48')]);_0x20f041[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x20f041[_0xd91b('0x46')],_0x20f041['query']);_0x48a35f[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x20f041[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x4402c9[_0xd91b('0x48')]['fields']));_0x48a35f[_0xd91b('0x4b')]=_0x48a35f[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x48a35f[_0xd91b('0x4b')]:_0x20f041[_0xd91b('0x46')];if(!_0x4402c9[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x48a35f[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x4402c9['query']['limit']);_0x48a35f[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x4402c9[_0xd91b('0x48')][_0xd91b('0x33')]);}_0x48a35f['order']=qs['sort'](_0x4402c9[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x48a35f[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_['pick'](_0x4402c9[_0xd91b('0x48')],_0x20f041[_0xd91b('0x49')]));_0x48a35f[_0xd91b('0x4f')][_0xd91b('0x67')]=_0x542f45['id'];if(_0x4402c9[_0xd91b('0x48')][_0xd91b('0x51')]){_0x48a35f[_0xd91b('0x4f')]=_[_0xd91b('0x54')](_0x48a35f[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x48a35f['attributes'],function(_0x3a1ca1){var _0x3c9257={};_0x3c9257[_0x3a1ca1]={'$like':'%'+_0x4402c9[_0xd91b('0x48')]['filter']+'%'};return _0x3c9257;})});}_0x48a35f=_[_0xd91b('0x54')]({},_0x48a35f,_0x4402c9[_0xd91b('0x55')]);return db['Disposition'][_0xd91b('0x32')]({'where':_0x48a35f[_0xd91b('0x4f')]})['then'](function(_0x54d042){_0x51bfb2['count']=_0x54d042;if(_0x4402c9[_0xd91b('0x48')]['includeAll']){_0x48a35f['include']=[{'all':!![]}];}return db[_0xd91b('0x68')]['findAll'](_0x48a35f);})[_0xd91b('0x21')](function(_0x25499e){_0x51bfb2[_0xd91b('0x59')]=_0x25499e;return _0x51bfb2;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x13416c,_0x48a35f))[_0xd91b('0x2b')](handleError(_0x13416c,null));};exports[_0xd91b('0x6c')]=function(_0x56b0ab,_0x3a6ce7,_0x3d3c03){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x56b0ab[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3a6ce7,null))['then'](function(_0x1ad836){if(_0x1ad836){return _0x1ad836['removeDispositions'](_0x56b0ab[_0xd91b('0x48')][_0xd91b('0x6d')]);}})['then'](respondWithStatusCode(_0x3a6ce7,null))[_0xd91b('0x2b')](handleError(_0x3a6ce7,null));};exports['addAnswer']=function(_0x4e73a3,_0xfeef6e,_0x5b80eb){if(_0x4e73a3[_0xd91b('0x64')]['id']){delete _0x4e73a3[_0xd91b('0x64')]['id'];}return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x4e73a3['params']['id']}})['then'](handleEntityNotFound(_0xfeef6e,null))[_0xd91b('0x21')](function(_0x2bffc3){if(_0x2bffc3){_0x4e73a3['body'][_0xd91b('0x67')]=_0x2bffc3['id'];return db[_0xd91b('0x6e')][_0xd91b('0x5d')](_0x4e73a3[_0xd91b('0x64')]);}})['then'](respondWithResult(_0xfeef6e,null))[_0xd91b('0x2b')](handleError(_0xfeef6e,null));};exports[_0xd91b('0x6f')]=function(_0x4e7274,_0x300336,_0x18aa80){var _0x487d41={'raw':![],'where':{}};var _0x5c0e01={};var _0x533e7d={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x4e7274[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x300336,null))[_0xd91b('0x21')](function(_0x3b1b3c){if(_0x3b1b3c){_0x5c0e01['model']=_[_0xd91b('0x47')](db['CannedAnswer'][_0xd91b('0x44')]);_0x5c0e01[_0xd91b('0x48')]=_['keys'](_0x4e7274['query']);_0x5c0e01[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x5c0e01['model'],_0x5c0e01[_0xd91b('0x48')]);_0x487d41[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x5c0e01[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x4e7274[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x487d41[_0xd91b('0x4b')]=_0x487d41[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x487d41['attributes']:_0x5c0e01[_0xd91b('0x46')];if(!_0x4e7274['query'][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x487d41[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x4e7274[_0xd91b('0x48')][_0xd91b('0x31')]);_0x487d41[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x4e7274['query']['offset']);}_0x487d41[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x4e7274[_0xd91b('0x48')]['sort']);_0x487d41[_0xd91b('0x4f')]=qs['filters'](_[_0xd91b('0x50')](_0x4e7274[_0xd91b('0x48')],_0x5c0e01['filters']));_0x487d41[_0xd91b('0x4f')][_0xd91b('0x67')]=_0x3b1b3c['id'];if(_0x4e7274[_0xd91b('0x48')][_0xd91b('0x51')]){_0x487d41[_0xd91b('0x4f')]=_['merge'](_0x487d41['where'],{'$or':_[_0xd91b('0x42')](_0x487d41['attributes'],function(_0x1795d3){var _0x2877bb={};_0x2877bb[_0x1795d3]={'$like':'%'+_0x4e7274[_0xd91b('0x48')]['filter']+'%'};return _0x2877bb;})});}_0x487d41=_['merge']({},_0x487d41,_0x4e7274[_0xd91b('0x55')]);return db[_0xd91b('0x6e')][_0xd91b('0x32')]({'where':_0x487d41[_0xd91b('0x4f')]})['then'](function(_0x560b84){_0x533e7d[_0xd91b('0x32')]=_0x560b84;if(_0x4e7274[_0xd91b('0x48')][_0xd91b('0x56')]){_0x487d41[_0xd91b('0x57')]=[{'all':!![]}];}return db[_0xd91b('0x6e')][_0xd91b('0x58')](_0x487d41);})['then'](function(_0x320452){_0x533e7d[_0xd91b('0x59')]=_0x320452;return _0x533e7d;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x300336,_0x487d41))[_0xd91b('0x2b')](handleError(_0x300336,null));};exports[_0xd91b('0x71')]=function(_0x3813f5,_0x28808d,_0x2b2c00){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x3813f5['params']['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x28808d,null))[_0xd91b('0x21')](function(_0x405b0c){if(_0x405b0c){return _0x405b0c[_0xd91b('0x71')](_0x3813f5['query'][_0xd91b('0x6d')]);}})['then'](respondWithStatusCode(_0x28808d,null))[_0xd91b('0x2b')](handleError(_0x28808d,null));};exports[_0xd91b('0x72')]=function(_0x3c3e60,_0x3d150b,_0x229055){_0x3c3e60['body'][_0xd91b('0x73')]=_0x3c3e60['file']['filename'];return db[_0xd91b('0x43')]['find']({'where':{'id':_0x3c3e60[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3d150b,null))[_0xd91b('0x21')](saveUpdates(_0x3c3e60[_0xd91b('0x64')],null))[_0xd91b('0x21')](respondWithResult(_0x3d150b,null))['catch'](handleError(_0x3d150b,null));};exports[_0xd91b('0x74')]=function(_0x19e579,_0x4fda30,_0x4031b3){_0x19e579[_0xd91b('0x64')]['agentAvatar']=_0x19e579['file']['filename'];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x19e579[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4fda30,null))[_0xd91b('0x21')](saveUpdates(_0x19e579[_0xd91b('0x64')],null))[_0xd91b('0x21')](respondWithResult(_0x4fda30,null))[_0xd91b('0x2b')](handleError(_0x4fda30,null));};exports[_0xd91b('0x75')]=function(_0x375a2f,_0x57d8e8,_0x34629a){_0x375a2f['body'][_0xd91b('0x76')]=_0x375a2f[_0xd91b('0x77')][_0xd91b('0x78')];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x375a2f[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x57d8e8,null))['then'](saveUpdates(_0x375a2f[_0xd91b('0x64')],null))['then'](respondWithResult(_0x57d8e8,null))[_0xd91b('0x2b')](handleError(_0x57d8e8,null));};exports[_0xd91b('0x79')]=function(_0x392aef,_0x266719,_0x10d85c){_0x392aef['body']['systemAvatar']=_0x392aef[_0xd91b('0x77')][_0xd91b('0x78')];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x392aef[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x266719,null))[_0xd91b('0x21')](saveUpdates(_0x392aef[_0xd91b('0x64')],null))['then'](respondWithResult(_0x266719,null))['catch'](handleError(_0x266719,null));};exports[_0xd91b('0x7a')]=function(_0x189e68,_0x243721,_0xf69f35){var _0x5e30aa=path['join'](config[_0xd91b('0x7b')],'server/files/images/logos/default_logo.svg');var _0xb56c3b={'where':{'id':_0x189e68['params']['id']},'attributes':['id',_0xd91b('0x73')],'raw':!![]};var _0x52c4a4=![];return require(_0xd91b('0x16'))[_0xd91b('0x7c')]()[_0xd91b('0x21')](function(_0x1c0202){if(_0x1c0202){_0x52c4a4=_0x1c0202['custom'];}})[_0xd91b('0x21')](function(){return db['ChatWebsite'][_0xd91b('0x5c')](_0xb56c3b);})['then'](handleEntityNotFound(_0x243721,null))[_0xd91b('0x21')](function(_0x133b76){if(_0x133b76){if(!_[_0xd91b('0x7d')](_0x133b76[_0xd91b('0x73')])){if(fs['existsSync'](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x7f'),_0x133b76['sitepic']))&&_0x52c4a4){_0x5e30aa=path['join'](config[_0xd91b('0x7b')],_0xd91b('0x7f'),_0x133b76[_0xd91b('0x73')]);}}return _0x243721['download'](_0x5e30aa);}})[_0xd91b('0x2b')](handleError(_0x243721,null));};exports[_0xd91b('0x80')]=function(_0x8580ce,_0x1941b9,_0x37c958){var _0x220932=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x81'));var _0x5ac361={'where':{'id':_0x8580ce['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x5ac361)[_0xd91b('0x21')](handleEntityNotFound(_0x1941b9,null))['then'](function(_0x6bad10){if(_0x6bad10){if(!_['isNil'](_0x6bad10[_0xd91b('0x82')])){if(fs[_0xd91b('0x83')](path[_0xd91b('0x7e')](config['root'],_0xd91b('0x84'),_0x6bad10[_0xd91b('0x82')]))){_0x220932=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/images/avatars/',_0x6bad10['agentAvatar']);}}return _0x1941b9[_0xd91b('0x85')](_0x220932);}})[_0xd91b('0x2b')](handleError(_0x1941b9,null));};exports[_0xd91b('0x86')]=function(_0x597b84,_0x321867,_0x529612){var _0x4cba33=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x43cbbc={'where':{'id':_0x597b84[_0xd91b('0x5b')]['id']},'attributes':['id','customerAvatar',_0xd91b('0x87')],'raw':!![]};return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x43cbbc)[_0xd91b('0x21')](handleEntityNotFound(_0x321867,null))[_0xd91b('0x21')](function(_0x17dc02){if(_0x17dc02){if(!_[_0xd91b('0x7d')](_0x17dc02[_0xd91b('0x76')])){if(fs[_0xd91b('0x83')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x17dc02[_0xd91b('0x76')]))&&_0x17dc02[_0xd91b('0x87')]){_0x4cba33=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x17dc02[_0xd91b('0x76')]);}}return _0x321867['download'](_0x4cba33);}})[_0xd91b('0x2b')](handleError(_0x321867,null));};exports['getSystemAvatar']=function(_0x338cc5,_0x206f71,_0x5a472f){var _0x17e211=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x88'));var _0x57795d={'where':{'id':_0x338cc5[_0xd91b('0x5b')]['id']},'attributes':['id',_0xd91b('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd91b('0x5c')](_0x57795d)[_0xd91b('0x21')](handleEntityNotFound(_0x206f71,null))[_0xd91b('0x21')](function(_0x5432fd){if(_0x5432fd){if(!_[_0xd91b('0x7d')](_0x5432fd[_0xd91b('0x89')])){if(fs['existsSync'](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x5432fd[_0xd91b('0x89')]))){_0x17e211=path[_0xd91b('0x7e')](config['root'],_0xd91b('0x84'),_0x5432fd[_0xd91b('0x89')]);}}return _0x206f71[_0xd91b('0x85')](_0x17e211);}})[_0xd91b('0x2b')](handleError(_0x206f71,null));};exports[_0xd91b('0x8a')]=function(_0x26db22,_0x7b4e7d,_0x38cff3){var _0x33010c=require('user-agent-parser');var _0x380137=new _0x33010c();var _0x1cb4b9=_0x380137['setUA'](_0x26db22[_0xd91b('0x8b')][_0xd91b('0x8c')])[_0xd91b('0x8d')]();var _0x47f631={'body':_0x26db22[_0xd91b('0x64')],'channel':_0xd91b('0x8e')};var _0x57bbf9=[];var _0x3c38d5=[];var _0x48130a={};var _0x6ac3e3=![];return db[_0xd91b('0x8f')]['describe']()[_0xd91b('0x21')](function(_0x1506c6){if(!_0x1506c6){throw new db['Sequelize'][(_0xd91b('0x90'))]('no\x20available\x20attributes');}_0x57bbf9=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x1506c6),['createdAt',_0xd91b('0x92')]);_0x3c38d5=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x1506c6),[_0xd91b('0x93'),_0xd91b('0x92'),_0xd91b('0x94'),_0xd91b('0x95')]);if(_0x26db22['body']['id']){delete _0x26db22[_0xd91b('0x64')]['id'];}if(_['isNil'](_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')])){throw new db[(_0xd91b('0x97'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd91b('0x7d')](_0x26db22[_0xd91b('0x64')][_0xd91b('0x64')])||_0x26db22[_0xd91b('0x64')][_0xd91b('0x64')]===''){throw new db[(_0xd91b('0x97'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd91b('0x7d')](_0x26db22[_0xd91b('0x64')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c38d5);}if(!_[_0xd91b('0x98')](_0x3c38d5,_0x26db22[_0xd91b('0x64')][_0xd91b('0x99')])){throw new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))](_0xd91b('0x9a')+_0x3c38d5);}_0x48130a[_0x26db22['body'][_0xd91b('0x99')]]=_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')];})[_0xd91b('0x21')](function(){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x26db22[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x9b')],'as':_0xd91b('0x9c'),'include':[{'model':db[_0xd91b('0x8f')],'as':_0xd91b('0x9d'),'where':_0x48130a,'limit':0x1,'order':[[_0xd91b('0x92'),_0xd91b('0x9e')]]}]},{'model':db[_0xd91b('0x9f')],'as':_0xd91b('0xa0')}]});})[_0xd91b('0x21')](handleEntityNotFound(_0x7b4e7d,null))[_0xd91b('0x21')](function(_0x4ce03d){if(_0x4ce03d&&_0x4ce03d[_0xd91b('0x9c')]){_0x47f631['account']=_0x4ce03d;_0x47f631['applications']=_0x4ce03d[_0xd91b('0xa0')];_0x47f631[_0xd91b('0xa1')]=_0x4ce03d[_0xd91b('0x9c')];_0x47f631[_0xd91b('0xa2')]=_[_0xd91b('0xa3')](_0x47f631[_0xd91b('0xa2')],[_0xd91b('0xa4')],[_0xd91b('0xa5')]);if(_0x47f631[_0xd91b('0xa6')][_0xd91b('0xa0')]){delete _0x47f631[_0xd91b('0xa6')][_0xd91b('0xa0')];}if(_0x47f631[_0xd91b('0xa6')]['List']&&_0x47f631[_0xd91b('0xa6')]['List'][_0xd91b('0x9d')][_0xd91b('0x4d')]){return _0x47f631[_0xd91b('0xa6')][_0xd91b('0x9c')][_0xd91b('0x9d')][0x0];}var _0x341c4e=_[_0xd91b('0x18')](_0x26db22[_0xd91b('0x64')],{'firstName':_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')],'ListId':_0x4ce03d[_0xd91b('0x95')]});_0x341c4e[_0x26db22[_0xd91b('0x64')]['mapKey']]=_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')];return db['CmContact'][_0xd91b('0x5d')](_0x341c4e,{'fields':_0x57bbf9,'raw':!![]});}})[_0xd91b('0x21')](handleEntityNotFound(_0x7b4e7d,null))['then'](function(_0x3b775b){_0x47f631[_0xd91b('0xa7')]=_0x3b775b;var _0x596b4c=_0x26db22[_0xd91b('0x64')][_0xd91b('0xa8')];if(_0x26db22['headers'][_0xd91b('0xa9')]){_0x596b4c=_0x26db22[_0xd91b('0x8b')][_0xd91b('0xa9')];}else if(_0x26db22[_0xd91b('0x8b')][_0xd91b('0xaa')]){_0x596b4c=_[_0xd91b('0xab')](_0x26db22[_0xd91b('0x8b')][_0xd91b('0xaa')][_0xd91b('0xac')](','));}if(_0x3b775b){var _0x4fbcf1={'ContactId':_0x3b775b['id'],'ChatWebsiteId':_0x26db22['params']['id'],'from':(_0x3b775b[_0xd91b('0xad')]||'')+'\x20'+(_0x3b775b[_0xd91b('0xae')]||''),'customerIp':_0x596b4c,'customerPort':_0x26db22[_0xd91b('0x8b')]['x-real-port']?_0x26db22['headers'][_0xd91b('0xaf')]:null,'referer':_0x26db22['body'][_0xd91b('0xb0')],'browserName':_0x1cb4b9[_0xd91b('0xb1')][_0xd91b('0x3d')]&&_0x1cb4b9['browser']['version']?util[_0xd91b('0xb2')]('%s\x20%s',_0x1cb4b9['browser'][_0xd91b('0x3d')],_0x1cb4b9[_0xd91b('0xb1')][_0xd91b('0xb3')]):_0xd91b('0xb4'),'browserVersion':_0x1cb4b9[_0xd91b('0xb1')]['version']||_0xd91b('0xb4'),'osName':util[_0xd91b('0xb2')]('%s\x20%s',_0x1cb4b9['os']['name'],_0x1cb4b9['os'][_0xd91b('0xb3')]),'osVersion':_0x1cb4b9['os'][_0xd91b('0xb3')],'deviceModel':_0x1cb4b9[_0xd91b('0xb5')][_0xd91b('0x46')]&&_0x1cb4b9[_0xd91b('0xb5')]['vendor']?util[_0xd91b('0xb2')](_0xd91b('0xb6'),_0x1cb4b9[_0xd91b('0xb5')]['model'],_0x1cb4b9[_0xd91b('0xb5')][_0xd91b('0xb7')],_0x1cb4b9[_0xd91b('0xb5')]['type']):null,'deviceVendor':_0x1cb4b9['device'][_0xd91b('0xb7')],'deviceType':_0x1cb4b9[_0xd91b('0xb5')]['type'],'formData':JSON[_0xd91b('0x26')](_0x26db22['body'])};var _0x151671={'ChatWebsiteId':_0x26db22[_0xd91b('0x5b')]['id'],'closed':![]};if(_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')]){_0x151671[_0xd91b('0xb8')]=_0x26db22['body'][_0xd91b('0xb8')];return db[_0xd91b('0xb9')]['find']({'where':_0x151671})['then'](function(_0x15be79){if(_0x15be79){return[_0x15be79,![]];}_0x4fbcf1[_0xd91b('0xb8')]=_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')];_0x4fbcf1[_0xd91b('0xba')]=_0x26db22[_0xd91b('0x64')][_0xd91b('0xba')];return db[_0xd91b('0xb9')]['create'](_0x4fbcf1)[_0xd91b('0x21')](function(_0x528a04){return[_0x528a04,!![]];});});}_0x151671[_0xd91b('0xbb')]=_0x3b775b['id'];if(_0x26db22[_0xd91b('0x64')][_0xd91b('0xbc')]&&_0x26db22[_0xd91b('0x64')]['interaction']['id']){_0x151671['id']=_0x26db22[_0xd91b('0x64')][_0xd91b('0xbc')]['id'];return db[_0xd91b('0xb9')]['find']({'where':_0x151671})[_0xd91b('0x21')](function(_0xa38683){if(_0xa38683){return[_0xa38683,![]];}return db[_0xd91b('0xb9')][_0xd91b('0x5d')](_0x4fbcf1)[_0xd91b('0x21')](function(_0x59e790){return[_0x59e790,!![]];});});}return db[_0xd91b('0xb9')][_0xd91b('0x5d')](_0x4fbcf1)['then'](function(_0x267254){return[_0x267254,!![]];});}})[_0xd91b('0xbd')](function(_0x46df80,_0x4d21a0){if(_0x46df80){_0x6ac3e3=_0x4d21a0;if(!_0x4d21a0){var _0x2fde7b={'from':(_0x47f631[_0xd91b('0xa7')][_0xd91b('0xad')]||'')+'\x20'+(_0x47f631['contact'][_0xd91b('0xae')]||'')};if(_0x26db22['body'][_0xd91b('0xb8')]&&_0x26db22[_0xd91b('0x64')][_0xd91b('0xbe')]&&_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')]!=_0x26db22['body'][_0xd91b('0xbe')]){_0x2fde7b[_0xd91b('0xb8')]=_0x26db22['body'][_0xd91b('0xbe')];}return _0x46df80[_0xd91b('0x38')](_0x2fde7b);}else{return _0x46df80;}}})[_0xd91b('0x21')](function(_0x1abaa9){_0x47f631[_0xd91b('0xbc')]=_0x1abaa9['get']({'plain':!![]});_0x47f631[_0xd91b('0xbc')][_0xd91b('0xbf')]=_0x6ac3e3;if(_0x47f631[_0xd91b('0xbc')]['created']){if(_0x47f631['account']['autoclose']){_0x47f631[_0xd91b('0xa2')][_0xd91b('0xc0')]({'id':0x0,'priority':_0x47f631[_0xd91b('0xa2')][_0xd91b('0x4d')]+0x1,'app':_0xd91b('0xc1'),'appdata':'unmanaged','interval':_0xd91b('0xc2')});}}return db[_0xd91b('0xc3')][_0xd91b('0x5d')]({'body':_0x26db22[_0xd91b('0x64')]['body'],'ChatWebsiteId':_0x26db22[_0xd91b('0x5b')]['id'],'ChatInteractionId':_0x1abaa9['id'],'direction':'in','ContactId':_0x47f631[_0xd91b('0xa7')]['id'],'AttachmentId':_0x26db22['body'][_0xd91b('0xc4')]});})[_0xd91b('0x21')](function(_0x3ea9cd){_0x47f631['message']=_0x3ea9cd;if(_0x47f631[_0xd91b('0xbc')][_0xd91b('0xc5')]){return db[_0xd91b('0xc6')][_0xd91b('0x5c')]({'attributes':['id',_0xd91b('0x3d')],'where':{'id':_0x47f631[_0xd91b('0xbc')][_0xd91b('0xc5')]}})[_0xd91b('0x21')](function(_0xd29a80){if(_0xd29a80){_0x47f631[_0xd91b('0xa2')][_0xd91b('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd29a80[_0xd91b('0x3d')]+','+(_0x47f631[_0xd91b('0xa6')][_0xd91b('0xc8')]||0xa),'interval':_0xd91b('0xc2')});_0x47f631[_0xd91b('0xc9')]=!![];}return respondWithRpcPromise(_0xd91b('0xca'),_0xd91b('0xcb'),_0x47f631);});}return respondWithRpcPromise(_0xd91b('0xca'),'startRouting',_0x47f631);})[_0xd91b('0x21')](function(_0x3646a5){respondWithRpcPromise('EventManager',_0xd91b('0xcc'),{'event':_0xd91b('0x8a'),'message':_0x3646a5},client9002);return _0x3646a5;})[_0xd91b('0x21')](respondWithResult(_0x7b4e7d,null))[_0xd91b('0x2b')](handleError(_0x7b4e7d,null));};exports[_0xd91b('0xcd')]=function(_0x22d046,_0x1e0f77,_0x579b2d){var _0x15ad28,_0x572bb8,_0x5954e4;var _0x1c70d0=[];var _0x2fd82e=[];var _0x535c45={};var _0x16dfe7=_0x22d046[_0xd91b('0xce')]||[];var _0x4b4e77=[];var _0x2a8aaa;return db[_0xd91b('0x8f')]['describe']()[_0xd91b('0x21')](function(_0x555bda){if(!_0x555bda){throw new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))]('no\x20available\x20attributes');}_0x2fd82e=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x555bda),['createdAt','updatedAt']);_0x1c70d0=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x555bda),[_0xd91b('0x93'),_0xd91b('0x92'),'CompanyId','ListId']);if(_0x22d046[_0xd91b('0x64')]['id']){delete _0x22d046[_0xd91b('0x64')]['id'];}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x96')])){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))](_0xd91b('0xcf')));}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x64')])||_0x22d046[_0xd91b('0x64')]['body']===''){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))]['ValidationError'](_0xd91b('0xd0')));}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')])){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c70d0));}if(!_['includes'](_0x1c70d0,_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')])){throw _0x1e0f77['status'](0x1f4)[_0xd91b('0x3e')](new db['Sequelize'][(_0xd91b('0x90'))](_0xd91b('0xd2')+_0x1c70d0));}_0x535c45[_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')]]=_0x22d046[_0xd91b('0x64')]['from'];})[_0xd91b('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x22d046['params']['id']},'include':[{'model':db[_0xd91b('0x9b')],'as':_0xd91b('0x9c')},{'model':db[_0xd91b('0xd3')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x1e0f77,null))[_0xd91b('0x21')](function(_0x1726a1){if(_0x1726a1&&_0x1726a1[_0xd91b('0x9c')]){_0x572bb8=_0x1726a1;var _0x544551=_[_0xd91b('0x18')](_0x22d046['body'],{'firstName':_0x22d046[_0xd91b('0x64')][_0xd91b('0x96')],'phone':_0x22d046['body'][_0xd91b('0x96')],'ListId':_0x1726a1[_0xd91b('0x95')]});_0x544551[_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')]]=_0x22d046[_0xd91b('0x64')]['from'];return db['CmContact'][_0xd91b('0xd4')]({'where':_0x535c45,'defaults':_0x544551});}})['spread'](function(_0x32f677){if(_0x32f677){_0x5954e4=_0x32f677;var _0x3f0489=fs[_0xd91b('0xd5')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/templates/chatOfflineMessage.ejs'),_0xd91b('0xd6'));var _0x27666b=ejs[_0xd91b('0xd7')](_0x3f0489,{'body':_[_0xd91b('0xd8')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x64')]),'bodyTitle':_0x572bb8[_0xd91b('0xd9')]});return db[_0xd91b('0xda')][_0xd91b('0x5d')]({'body':_0x27666b,'ContactId':_0x32f677['id'],'ChatWebsiteId':_0x572bb8['id']});}})['then'](function(_0x328916){_0x2a8aaa=_0x328916;if(_0x16dfe7[_0xd91b('0x4d')]){var _0x3fc231=_0x16dfe7[_0xd91b('0x42')](function(_0x37a466){return{'name':_0x37a466[_0xd91b('0xdb')],'basename':_0x37a466[_0xd91b('0x78')],'type':_0x37a466['mimetype'],'ChatOfflineMessageId':_0x328916['id']};});_0x4b4e77=_0x3fc231[_0xd91b('0x42')](_0x4bc33c=>{var _0x458bb7={'filename':_0x4bc33c[_0xd91b('0x3d')],'path':path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0xdc'),_0xd91b('0xce'),_0xd91b('0xdd'),_0xd91b('0xde'),_0x4bc33c['basename'])};return _0x458bb7;});if(!_0x572bb8[_0xd91b('0xdf')]){return db['sequelize']['transaction'](function(_0x328817){return db[_0xd91b('0xe0')]['bulkCreate'](_0x3fc231,{'transaction':_0x328817});});}}})['then'](function(){if(_0x2a8aaa){_0x15ad28=_0x2a8aaa;return db[_0xd91b('0xd3')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xd91b('0xe1')],'as':_0xd91b('0xe2'),'raw':!![]}]});}})[_0xd91b('0x21')](function(_0x539305){if(_0x539305&&_0x539305[_0xd91b('0xe2')]&&_0x572bb8['forwardOffline']&&_0x572bb8[_0xd91b('0xe3')]){var _0x3c232d={'tls':{'rejectUnauthorized':![]}};if(_0x539305[_0xd91b('0xe2')][_0xd91b('0xe4')]){_0x3c232d['service']=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe4')];}else{_0x3c232d[_0xd91b('0xe5')]=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe5')];_0x3c232d[_0xd91b('0xe6')]=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe6')];_0x3c232d['secure']=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe7')];}if(_0x539305[_0xd91b('0xe2')]['authentication']){_0x3c232d[_0xd91b('0xe8')]={'user':_0x539305[_0xd91b('0xe2')][_0xd91b('0x5e')],'pass':_0x539305[_0xd91b('0xe2')][_0xd91b('0xe9')]};}return respondWithRpcPromise(_0xd91b('0xea'),_0xd91b('0xeb'),{'account':_0x3c232d,'message':{'from':util[_0xd91b('0xb2')](_0xd91b('0xec'),_0x539305[_0xd91b('0x3d')],_0x539305[_0xd91b('0xed')]||_0x539305['Smtp'][_0xd91b('0x5e')]),'to':_0x572bb8[_0xd91b('0xe3')],'subject':_0x572bb8[_0xd91b('0xee')],'html':_0x15ad28['body'],'attachments':_0x4b4e77}},client9003)['then'](function(){return _0x15ad28;})[_0xd91b('0x2b')](function(_0x4e9221){console[_0xd91b('0x27')](_0x4e9221);});}})[_0xd91b('0x21')](function(){if(_0x572bb8&&_0x572bb8[_0xd91b('0xdf')]&&_0x572bb8[_0xd91b('0xef')]){var _0x24eb7b=[];if(_0x16dfe7[_0xd91b('0x4d')]){_0x24eb7b=_0x16dfe7[_0xd91b('0x42')](function(_0x1fc85a){return{'name':_0x1fc85a[_0xd91b('0xdb')],'basename':_0x1fc85a[_0xd91b('0x78')],'type':_0x1fc85a[_0xd91b('0xf0')],'ChatOfflineMessageId':_0x2a8aaa['id']};});}var _0x4266d2;if(!_[_0xd91b('0x7d')](_0x572bb8['subjectOffline'])){var _0x1e4383=_[_0xd91b('0x42')](_0x22d046[_0xd91b('0x64')],function(_0x3a0073){return _0x3a0073;});var _0x284a5f=_[_0xd91b('0xf1')](_0x1e4383)[0x0];var _0x1563ba=_[_0xd91b('0xf2')](_0x284a5f,function(_0xaa733a){return _0xaa733a;});_0x4266d2=_0x1563ba[0x1][_0x572bb8[_0xd91b('0xf3')]];}var _0x428415={'from':_0x5954e4['email'],'firstName':_0x5954e4[_0xd91b('0xad')],'lastName':_0x5954e4[_0xd91b('0xae')],'mapKey':_0xd91b('0xed'),'message':{'from':_0x5954e4[_0xd91b('0xed')],'to':_0x572bb8[_0xd91b('0xd3')]['email'],'cc':'','subject':_[_0xd91b('0x7d')](_0x4266d2)?_0x572bb8[_0xd91b('0xee')]:_0x4266d2,'messageId':'','sentAt':new Date(),'attach':_0x24eb7b[_0xd91b('0x4d')],'attachments':_0x24eb7b,'originChannel':_0xd91b('0xf4'),'ChatWebsiteId':_0x572bb8['id'],'ChatOfflineMessageId':_0x15ad28['id'],'originTo':_0x572bb8['MailAccount']['email']},'body':_0x15ad28[_0xd91b('0x64')]};var _0x377287={'account':{'id':_0x572bb8[_0xd91b('0xef')]},'body':_0x428415,'log':_0xd91b('0xf5')};return respondWithRpcPromise(_0xd91b('0xf5'),_0xd91b('0xf6'),_0x377287,client9001)[_0xd91b('0x21')](function(){return _0x15ad28;})[_0xd91b('0x2b')](function(_0x286bb5){console['error'](_0x286bb5);});}return;})['then'](function(){if(_0x15ad28){return _0x15ad28;}})[_0xd91b('0x21')](respondWithResult(_0x1e0f77,null))['catch'](function(_0x3d6c3c){console[_0xd91b('0x27')](_0xd91b('0x2b'),_0x3d6c3c);for(var _0x318a94 of _0x16dfe7){var _0x353a39=path[_0xd91b('0x7e')](config['root'],_0xd91b('0xdc'),'files',_0xd91b('0xdd'),'offline-chat',_0x318a94[_0xd91b('0x78')]);fs_extra['remove'](_0x353a39)[_0xd91b('0x2b')](function(_0x1d70c1){console[_0xd91b('0x27')](_0xd91b('0xf7'),_0x353a39,_0x1d70c1);});}});};exports[_0xd91b('0xf8')]=function(_0x4225a0,_0x373cdf,_0xb6afa2){return db[_0xd91b('0xb9')][_0xd91b('0x5c')]({'where':{'id':_0x4225a0['params']['id']}})['then'](handleEntityNotFound(_0x373cdf,null))['then'](function(_0x8f81b){if(_0x8f81b){return _0x8f81b[_0xd91b('0xf8')](_0x4225a0['body'][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x4225a0[_0xd91b('0x64')],['ids','id'])||{});}})[_0xd91b('0x21')](respondWithResult(_0x373cdf,null))['catch'](handleError(_0x373cdf,null));};exports[_0xd91b('0xfa')]=function(_0x3075d8,_0x3ff73b,_0x1d6600){var _0x2c75fa={'raw':![],'where':{}};var _0x2a5a60={};var _0x1b6d78={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x3075d8[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3ff73b,null))[_0xd91b('0x21')](function(_0x3e244c){if(_0x3e244c){_0x2a5a60['model']=_['keys'](db['ChatInteraction'][_0xd91b('0x44')]);_0x2a5a60[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x3075d8[_0xd91b('0x48')]);_0x2a5a60[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x2a5a60['model'],_0x2a5a60['query']);_0x2c75fa['attributes']=_['intersection'](_0x2a5a60[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x3075d8['query'][_0xd91b('0x4c')]));_0x2c75fa[_0xd91b('0x4b')]=_0x2c75fa['attributes'][_0xd91b('0x4d')]?_0x2c75fa[_0xd91b('0x4b')]:_0x2a5a60[_0xd91b('0x46')];if(!_0x3075d8[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x2c75fa[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x3075d8[_0xd91b('0x48')][_0xd91b('0x31')]);_0x2c75fa['offset']=qs[_0xd91b('0x33')](_0x3075d8[_0xd91b('0x48')][_0xd91b('0x33')]);}_0x2c75fa[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x3075d8[_0xd91b('0x48')]['sort']);_0x2c75fa[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x3075d8[_0xd91b('0x48')],_0x2a5a60[_0xd91b('0x49')]));_0x2c75fa[_0xd91b('0x4f')]['ChatWebsiteId']=_0x3e244c['id'];if(_0x3075d8[_0xd91b('0x48')]['filter']){_0x2c75fa[_0xd91b('0x4f')]=_['merge'](_0x2c75fa[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x2c75fa[_0xd91b('0x4b')],function(_0x315422){var _0x2df11e={};_0x2df11e[_0x315422]={'$like':'%'+_0x3075d8[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x2df11e;})});}_0x2c75fa=_[_0xd91b('0x54')]({},_0x2c75fa,_0x3075d8[_0xd91b('0x55')]);return db[_0xd91b('0xb9')]['count']({'where':_0x2c75fa['where']})[_0xd91b('0x21')](function(_0x44d204){_0x1b6d78['count']=_0x44d204;if(_0x3075d8[_0xd91b('0x48')][_0xd91b('0x56')]){_0x2c75fa[_0xd91b('0x57')]=[{'model':db[_0xd91b('0x8f')],'as':'Contact','required':![]},{'model':db[_0xd91b('0xc6')],'as':_0xd91b('0xfb'),'attributes':['name',_0xd91b('0xfc'),_0xd91b('0xfd')],'required':![]},{'model':db['Tag'],'as':_0xd91b('0xfe'),'attributes':['id','name',_0xd91b('0xff')],'where':_0x3075d8[_0xd91b('0x48')]['tag']?{'id':_0x3075d8[_0xd91b('0x48')][_0xd91b('0x100')]}:undefined,'required':_0x3075d8['query']['tag']?!![]:![]}];}return db['ChatInteraction'][_0xd91b('0x58')](_0x2c75fa);})['then'](function(_0x4dcd8e){_0x1b6d78[_0xd91b('0x59')]=_0x4dcd8e;return _0x1b6d78;});}})['then'](respondWithFilteredResult(_0x3ff73b,_0x2c75fa))[_0xd91b('0x2b')](handleError(_0x3ff73b,null));};function iftimePromise(_0x477b50,_0x2dda03){return respondWithRpcPromise(_0xd91b('0x101'),_0xd91b('0x102'),{'command':_0x2dda03['timezone']?util[_0xd91b('0xb2')](_0xd91b('0x103'),_0x477b50['interval'],_0x2dda03[_0xd91b('0x104')]):util[_0xd91b('0xb2')](_0xd91b('0x105'),_0x477b50['interval'])},client9002)[_0xd91b('0x21')](function(_0x2baff4){var _0x501474=_0x2baff4&&_0x2baff4[_0xd91b('0x106')](_0xd91b('0x107'))>=0x0?!![]:![];logger['info'](_0xd91b('0x108'),_0x2dda03['id'],_0x477b50['id'],_0x477b50['interval'],_0x501474?_0xd91b('0x109'):_0xd91b('0x10a'),_0x2dda03['timezone']?_0x2dda03[_0xd91b('0x104')]:_0xd91b('0x10b'));return _0x501474;})[_0xd91b('0x2b')](function(_0x2ad6a6){logger['error'](_0xd91b('0x108'),_0x2dda03['id'],_0x477b50['id'],_0x477b50['interval'],util[_0xd91b('0x10c')](_0x2ad6a6,{'showHidden':![],'depth':null}),_0x2dda03[_0xd91b('0x104')]?_0x2dda03[_0xd91b('0x104')]:_0xd91b('0x10b'));return![];});}exports['getSnippet']=function(_0x4d046f,_0x12a7a1,_0x2f0436){var _0x4073ef=0x0;var _0x33c921=0x0;var _0x50a269=![];var _0x5123ec;var _0x5d9af1;return db[_0xd91b('0x43')]['find']({'where':{'id':_0x4d046f[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x10d')],'as':_0xd91b('0x10d'),'include':[{'model':db['Interval'],'as':_0xd91b('0x10e'),'attributes':['id',_0xd91b('0x10f')],'raw':!![]}]}]})[_0xd91b('0x21')](handleEntityNotFound(_0x12a7a1,null))[_0xd91b('0x21')](function(_0xc941da){if(_0xc941da){_0x5123ec=_0xc941da;return _0xc941da[_0xd91b('0x110')]({'raw':!![]});}})[_0xd91b('0x21')](function(_0x29ce7e){if(_0x5123ec){if(_0x29ce7e){_0x5d9af1=_0x29ce7e;}}return require(_0xd91b('0x16'))['getLicense']();})[_0xd91b('0x21')](function(_0x12633c){if(_0x12633c){_0x33c921=_0x12633c[_0xd91b('0x111')];_0x50a269=_0x12633c['custom'];}})['then'](function(){return db[_0xd91b('0xb9')][_0xd91b('0x32')]({'where':{'closed':![]}});})[_0xd91b('0x21')](function(_0xa0d263){_0x4073ef=_0xa0d263;if(_0x33c921&&_0xa0d263>_0x33c921){return db[_0xd91b('0x112')][_0xd91b('0x69')]({'where':{'id':0x1}})[_0xd91b('0x21')](function(_0x136e30){if(_0x136e30){_0x136e30['increment'](_0xd91b('0x113'));}});}})[_0xd91b('0x21')](function(){if(_0x5123ec[_0xd91b('0x10d')]&&_0x5123ec[_0xd91b('0x10d')]['Intervals']){var _0x33e8ce=[];for(var _0xffc07c=0x0;_0xffc07c<_0x5123ec[_0xd91b('0x10d')][_0xd91b('0x10e')][_0xd91b('0x4d')];_0xffc07c++){var _0x1bee52=_0x5123ec[_0xd91b('0x10d')][_0xd91b('0x10e')][_0xffc07c][_0xd91b('0x3a')]({'plain':!![]});_0x33e8ce[_0xd91b('0xc0')](iftimePromise(_0x1bee52,_0x5123ec));}return BPromise[_0xd91b('0x114')](_0x33e8ce)[_0xd91b('0x21')](function(_0x2c7031){return _[_0xd91b('0x115')](_0x2c7031);});}else{return!![];}})[_0xd91b('0x21')](function(_0x304143){var _0x373022=fs[_0xd91b('0xd5')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/chat/iframe.ejs'),'utf8');var _0x11b454={'remote':_0x5123ec[_0xd91b('0x116')],'query':querystring[_0xd91b('0x26')](_[_0xd91b('0x54')](_0x5123ec[_0xd91b('0x3a')]({'plain':!![]}),{'customerIp':_0x4d046f[_0xd91b('0x8b')]['x-forwarded-for']||_0x4d046f[_0xd91b('0x8b')][_0xd91b('0x117')]||_0x4d046f[_0xd91b('0x118')][_0xd91b('0x119')]||_0x4d046f['ip'],'referer':_0x4d046f[_0xd91b('0x8b')][_0xd91b('0xb0')],'openedInteractions':_0x4073ef,'maxInteractions':_0x33c921,'virtual':_0x50a269[_0xd91b('0x111')],'online':_0x304143,'custom':_0x50a269}))[_0xd91b('0x11a')](/'/g,'\x5c\x27')};_0x12a7a1[_0xd91b('0x3e')](ejs[_0xd91b('0xd7')](Mustache[_0xd91b('0xd7')](_0x373022,_0x11b454),{'proactiveActions':_0x5d9af1,'alignment':_0x5123ec['alignment'],'verticalAlignment':_0x5123ec['verticalAlignment'],'div_color':_0x5123ec[_0xd91b('0xff')],'text_color':_0x5123ec['textColor'],'button_color':_0x5123ec[_0xd91b('0x11b')],'background_color':_0x5123ec['backgroundColor']}));})[_0xd91b('0x2b')](handleError(_0x12a7a1,null));};exports[_0xd91b('0x11c')]=function(_0x1cd163,_0x3d1079,_0x59f46d){return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x1cd163['params']['id']}})['then'](handleEntityNotFound(_0x3d1079,null))[_0xd91b('0x21')](function(_0x4ad226){if(_0x4ad226){return db[_0xd91b('0x11d')][_0xd91b('0x11e')](function(_0x47664a){return db['ChatApplication'][_0xd91b('0x39')]({'where':{'ChatWebsiteId':_0x1cd163['params']['id']},'transaction':_0x47664a})[_0xd91b('0x21')](function(_0x185ce8){var _0xddf319=_['map'](_0x1cd163[_0xd91b('0x64')],function(_0x6033e2){_0x6033e2[_0xd91b('0x67')]=_0x1cd163[_0xd91b('0x5b')]['id'];return _0x6033e2;});return db[_0xd91b('0x9f')][_0xd91b('0x11f')](_0xddf319,{'transaction':_0x47664a});});})[_0xd91b('0x21')](function(){return db['ChatApplication'][_0xd91b('0x120')]({'where':{'ChatWebsiteId':_0x1cd163['params']['id']},'order':'priority'});});}})[_0xd91b('0x21')](respondWithResult(_0x3d1079,null))[_0xd91b('0x2b')](handleError(_0x3d1079,null));};exports[_0xd91b('0x121')]=function(_0x1f3697,_0xa52d12,_0x298e46){var _0x26d3dc={};var _0x250478={};var _0x3c5e15;var _0x5dc275;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x1f3697[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0xa52d12,null))[_0xd91b('0x21')](function(_0x283220){if(_0x283220){_0x3c5e15=_0x283220;_0x250478[_0xd91b('0x46')]=_[_0xd91b('0x47')](db[_0xd91b('0x9f')][_0xd91b('0x44')]);_0x250478[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x1f3697[_0xd91b('0x48')]);_0x250478[_0xd91b('0x49')]=_['intersection'](_0x250478[_0xd91b('0x46')],_0x250478['query']);_0x26d3dc[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x250478[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x26d3dc[_0xd91b('0x4b')]=_0x26d3dc[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x26d3dc['attributes']:_0x250478['model'];_0x26d3dc[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x26d3dc[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x1f3697[_0xd91b('0x48')],_0x250478[_0xd91b('0x49')]));if(_0x1f3697[_0xd91b('0x48')][_0xd91b('0x51')]){_0x26d3dc[_0xd91b('0x4f')]=_[_0xd91b('0x54')](_0x26d3dc[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x26d3dc[_0xd91b('0x4b')],function(_0x3e2776){var _0x2659c4={};_0x2659c4[_0x3e2776]={'$like':'%'+_0x1f3697[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x2659c4;})});}_0x26d3dc=_[_0xd91b('0x54')]({},_0x26d3dc,_0x1f3697[_0xd91b('0x55')]);return _0x3c5e15['getApplications'](_0x26d3dc);}})['then'](function(_0x4a8ceb){if(_0x4a8ceb){_0x5dc275=_0x4a8ceb['length'];if(!_0x1f3697[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x26d3dc[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x31')]);_0x26d3dc['offset']=qs[_0xd91b('0x33')](_0x1f3697['query'][_0xd91b('0x33')]);}return _0x3c5e15[_0xd91b('0x121')](_0x26d3dc);}})[_0xd91b('0x21')](function(_0x264371){if(_0x264371){return _0x264371?{'count':_0x5dc275,'rows':_0x264371}:null;}})[_0xd91b('0x21')](respondWithResult(_0xa52d12,null))['catch'](handleError(_0xa52d12,null));};exports[_0xd91b('0x122')]=function(_0x16665b,_0x2193f5,_0x2750f8){return db['chatProactiveAction'][_0xd91b('0x5c')]({'where':{'id':_0x16665b['params']['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x2193f5,null))['then'](function(_0x20d645){if(_0x20d645){return _0x20d645[_0xd91b('0x122')](_0x16665b['body'][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x16665b[_0xd91b('0x64')],[_0xd91b('0x6d'),'id'])||{});}})[_0xd91b('0x21')](respondWithResult(_0x2193f5,null))[_0xd91b('0x2b')](handleError(_0x2193f5,null));};exports[_0xd91b('0x110')]=function(_0x21d377,_0x383b12,_0x2a2364){var _0x3741ef={};var _0x842b46={};var _0x3f6265;var _0x3f2701;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x21d377[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x383b12,null))[_0xd91b('0x21')](function(_0x1e9444){if(_0x1e9444){_0x3f6265=_0x1e9444;_0x842b46[_0xd91b('0x46')]=_[_0xd91b('0x47')](db[_0xd91b('0x123')][_0xd91b('0x44')]);_0x842b46[_0xd91b('0x48')]=_['keys'](_0x21d377[_0xd91b('0x48')]);_0x842b46[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x842b46['model'],_0x842b46[_0xd91b('0x48')]);_0x3741ef['attributes']=_[_0xd91b('0x4a')](_0x842b46[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x3741ef[_0xd91b('0x4b')]=_0x3741ef[_0xd91b('0x4b')]['length']?_0x3741ef['attributes']:_0x842b46['model'];_0x3741ef['order']=qs[_0xd91b('0x4e')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x3741ef[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x21d377[_0xd91b('0x48')],_0x842b46[_0xd91b('0x49')]));if(_0x21d377['query'][_0xd91b('0x51')]){_0x3741ef['where']=_[_0xd91b('0x54')](_0x3741ef['where'],{'$or':_[_0xd91b('0x42')](_0x3741ef[_0xd91b('0x4b')],function(_0x405671){var _0x4a2e66={};_0x4a2e66[_0x405671]={'$like':'%'+_0x21d377[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x4a2e66;})});}_0x3741ef=_['merge']({},_0x3741ef,_0x21d377[_0xd91b('0x55')]);return _0x3f6265[_0xd91b('0x110')](_0x3741ef);}})[_0xd91b('0x21')](function(_0x938074){if(_0x938074){_0x3f2701=_0x938074[_0xd91b('0x4d')];if(!_0x21d377[_0xd91b('0x48')]['hasOwnProperty'](_0xd91b('0x6b'))){_0x3741ef[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x31')]);_0x3741ef[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x21d377[_0xd91b('0x48')]['offset']);}return _0x3f6265['getProactiveActions'](_0x3741ef);}})[_0xd91b('0x21')](function(_0x3d0b43){if(_0x3d0b43){return _0x3d0b43?{'count':_0x3f2701,'rows':_0x3d0b43}:null;}})['then'](respondWithResult(_0x383b12,null))[_0xd91b('0x2b')](handleError(_0x383b12,null));};exports[_0xd91b('0x124')]=function(_0x12bd3c,_0x5d7f21,_0x368b50){var _0x4fbf17=_0x12bd3c['query'][_0xd91b('0x125')]===_0xd91b('0x126')?'offlineForm':'onlineForm';return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'attributes':['id',_0x4fbf17],'where':{'id':_0x12bd3c[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x5d7f21,null))[_0xd91b('0x21')](function(_0x2205a9){if(_0x2205a9){var _0x481d3f=_0x2205a9[_0x4fbf17];var _0x5953fd=_0x481d3f&&_0x481d3f[_0xd91b('0x127')]?_0x481d3f['items']:[];_0x5d7f21[_0xd91b('0x3e')]({'fromKey':_[_0xd91b('0x7d')](_0x481d3f[_0xd91b('0x128')])?undefined:_0x481d3f[_0xd91b('0x128')],'count':_0x5953fd['length'],'rows':_0x5953fd});}})[_0xd91b('0x2b')](handleError(_0x5d7f21,null));};exports[_0xd91b('0x129')]=function(_0x458e07,_0x5ccb38,_0x3b5caf){var _0x225b02={'raw':![],'where':{}};var _0x256260={};var _0x5a1306={'count':0x0,'rows':[]};return db[_0xd91b('0x43')]['findOne']({'where':{'id':_0x458e07[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ccb38,null))[_0xd91b('0x21')](function(_0x19d4be){if(_0x19d4be){_0x256260[_0xd91b('0x46')]=_['keys'](db[_0xd91b('0xda')][_0xd91b('0x44')]);_0x256260[_0xd91b('0x48')]=_['keys'](_0x458e07['query']);_0x256260['filters']=_[_0xd91b('0x4a')](_0x256260[_0xd91b('0x46')],_0x256260['query']);_0x225b02[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x256260[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x458e07[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x225b02['attributes']=_0x225b02['attributes'][_0xd91b('0x4d')]?_0x225b02[_0xd91b('0x4b')]:_0x256260[_0xd91b('0x46')];if(!_0x458e07[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x225b02['limit']=qs[_0xd91b('0x31')](_0x458e07['query']['limit']);_0x225b02[_0xd91b('0x33')]=qs['offset'](_0x458e07[_0xd91b('0x48')]['offset']);}_0x225b02['order']=qs[_0xd91b('0x4e')](_0x458e07[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x225b02[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x458e07['query'],_0x256260['filters']));_0x225b02[_0xd91b('0x4f')]['ChatWebsiteId']=_0x19d4be['id'];if(_0x458e07[_0xd91b('0x48')][_0xd91b('0x51')]){_0x225b02[_0xd91b('0x4f')]=_['merge'](_0x225b02[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x225b02[_0xd91b('0x4b')],function(_0x10264c){var _0x21f75e={};_0x21f75e[_0x10264c]={'$like':'%'+_0x458e07[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x21f75e;})});}_0x225b02=_[_0xd91b('0x54')]({},_0x225b02,_0x458e07[_0xd91b('0x55')]);return db['ChatOfflineMessage'][_0xd91b('0x32')]({'where':_0x225b02[_0xd91b('0x4f')]})[_0xd91b('0x21')](function(_0x58309a){_0x5a1306[_0xd91b('0x32')]=_0x58309a;if(_0x458e07[_0xd91b('0x48')][_0xd91b('0x56')]){_0x225b02[_0xd91b('0x57')]=[{'all':!![]}];}else{_0x225b02[_0xd91b('0x57')]=[{'model':db[_0xd91b('0x8f')],'as':_0xd91b('0x12a'),'required':![]},{'model':db[_0xd91b('0xe0')],'as':_0xd91b('0x12b'),'required':![]}];}return db[_0xd91b('0xda')][_0xd91b('0x58')](_0x225b02);})['then'](function(_0x422ddb){_0x5a1306[_0xd91b('0x59')]=_0x422ddb;return _0x5a1306;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x5ccb38,_0x225b02))[_0xd91b('0x2b')](handleError(_0x5ccb38,null));};exports[_0xd91b('0x12c')]=function(_0x49e539,_0x4b7697,_0x2a7bae){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x49e539[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x4b7697,null))[_0xd91b('0x21')](function(_0x1ac559){if(_0x1ac559){return _0x1ac559['addAgents'](_0x49e539[_0xd91b('0x64')][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x49e539[_0xd91b('0x64')],[_0xd91b('0x6d'),'id'])||{})['spread'](function(_0x152d26){for(var _0x403f8c=0x0;_0x403f8c<_0x49e539[_0xd91b('0x64')]['ids'][_0xd91b('0x4d')];_0x403f8c+=0x1){socket[_0xd91b('0x12d')](_0xd91b('0x12e'),{'UserId':Number(_0x49e539[_0xd91b('0x64')][_0xd91b('0x6d')][_0x403f8c]),'ChatWebsiteId':Number(_0x49e539[_0xd91b('0x5b')]['id'])});}return _0x152d26;});}})[_0xd91b('0x21')](respondWithResult(_0x4b7697,null))[_0xd91b('0x2b')](handleError(_0x4b7697,null));};exports[_0xd91b('0x12f')]=function(_0x2cc933,_0x285afc,_0x1bd85c){return db['ChatWebsite']['find']({'where':{'id':_0x2cc933[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x285afc,null))['then'](function(_0x52704d){if(_0x52704d){return _0x52704d[_0xd91b('0x12f')](_0x2cc933[_0xd91b('0x48')][_0xd91b('0x6d')])[_0xd91b('0x21')](function(){if(_[_0xd91b('0x130')](_0x2cc933['query'][_0xd91b('0x6d')])){for(var _0x4f33fe=0x0;_0x4f33fe<_0x2cc933[_0xd91b('0x48')]['ids'][_0xd91b('0x4d')];_0x4f33fe+=0x1){socket[_0xd91b('0x12d')](_0xd91b('0x131'),{'UserId':Number(_0x2cc933['query']['ids'][_0x4f33fe]),'ChatWebsiteId':Number(_0x2cc933[_0xd91b('0x5b')]['id'])});}}else{socket[_0xd91b('0x12d')](_0xd91b('0x131'),{'UserId':Number(_0x2cc933[_0xd91b('0x48')][_0xd91b('0x6d')]),'ChatWebsiteId':Number(_0x2cc933[_0xd91b('0x5b')]['id'])});}});}})[_0xd91b('0x21')](respondWithStatusCode(_0x285afc,null))['catch'](handleError(_0x285afc,null));};exports[_0xd91b('0x132')]=function(_0x745f15,_0x310620,_0x3ce44e){var _0x204cb4={};var _0x290240={};var _0x42d938;var _0x16558a;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x745f15[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x310620,null))[_0xd91b('0x21')](function(_0x4ad69c){if(_0x4ad69c){_0x42d938=_0x4ad69c;_0x290240[_0xd91b('0x46')]=_['keys'](db[_0xd91b('0xc6')][_0xd91b('0x44')]);_0x290240[_0xd91b('0x48')]=_['keys'](_0x745f15['query']);_0x290240['filters']=_['intersection'](_0x290240[_0xd91b('0x46')],_0x290240[_0xd91b('0x48')]);_0x204cb4['attributes']=_['intersection'](_0x290240[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x745f15['query']['fields']));_0x204cb4[_0xd91b('0x4b')]=_0x204cb4[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x204cb4['attributes']:_0x290240[_0xd91b('0x46')];_0x204cb4[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x204cb4[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x745f15[_0xd91b('0x48')],_0x290240['filters']));if(_0x745f15[_0xd91b('0x48')]['filter']){_0x204cb4['where']=_[_0xd91b('0x54')](_0x204cb4[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x204cb4['attributes'],function(_0x1ad2f4){var _0x4f7a17={};_0x4f7a17[_0x1ad2f4]={'$like':'%'+_0x745f15[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x4f7a17;})});}_0x204cb4=_[_0xd91b('0x54')]({},_0x204cb4,_0x745f15['options']);return _0x42d938[_0xd91b('0x132')](_0x204cb4);}})[_0xd91b('0x21')](function(_0x151779){if(_0x151779){_0x16558a=_0x151779['length'];if(!_0x745f15[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x204cb4[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x31')]);_0x204cb4[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x33')]);}return _0x42d938[_0xd91b('0x132')](_0x204cb4);}})['then'](function(_0x446708){if(_0x446708){return _0x446708?{'count':_0x16558a,'rows':_0x446708}:null;}})[_0xd91b('0x21')](respondWithResult(_0x310620,null))[_0xd91b('0x2b')](handleError(_0x310620,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 92eca68..24c44c4 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 _0x5395=['events','ChatWebsite','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x7b4216,_0x30a95d){var _0x513051=function(_0x3920dc){while(--_0x3920dc){_0x7b4216['push'](_0x7b4216['shift']());}};_0x513051(++_0x30a95d);}(_0x5395,0x150));var _0x5539=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5395[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x5539('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x5539('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5539('0x2'),'afterDestroy':_0x5539('0x3')};function emitEvent(_0x2d24c7){return function(_0x4cd571,_0x2b6f8b,_0x453ad5){ChatWebsiteEvents[_0x5539('0x4')](_0x2d24c7+':'+_0x4cd571['id'],_0x4cd571);ChatWebsiteEvents[_0x5539('0x4')](_0x2d24c7,_0x4cd571);_0x453ad5(null);};}for(var e in events){if(events[_0x5539('0x5')](e)){var event=events[e];ChatWebsite[_0x5539('0x6')](e,emitEvent(event));}}module[_0x5539('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x94b1=['setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x94b1,0x102));var _0x194b=function(_0xbf12e8,_0x33154c){_0xbf12e8=_0xbf12e8-0x0;var _0x150e20=_0x94b1[_0xbf12e8];return _0x150e20;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x194b('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x194b('0x1')](0x0);var events={'afterCreate':_0x194b('0x2'),'afterUpdate':_0x194b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13fda1){return function(_0x3a21be,_0x32586a,_0x23ab83){ChatWebsiteEvents['emit'](_0x13fda1+':'+_0x3a21be['id'],_0x3a21be);ChatWebsiteEvents[_0x194b('0x4')](_0x13fda1,_0x3a21be);_0x23ab83(null);};}for(var e in events){if(events[_0x194b('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x194b('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 5b2f119..c6e483c 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 _0x3ad6=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','path','../../config/environment','define'];(function(_0x1c249e,_0x56786e){var _0x28f75d=function(_0x15352a){while(--_0x15352a){_0x1c249e['push'](_0x1c249e['shift']());}};_0x28f75d(++_0x56786e);}(_0x3ad6,0xe8));var _0x63ad=function(_0x47debb,_0x335057){_0x47debb=_0x47debb-0x0;var _0x49907c=_0x3ad6[_0x47debb];return _0x49907c;};'use strict';var _=require(_0x63ad('0x0'));var util=require(_0x63ad('0x1'));var logger=require(_0x63ad('0x2'))(_0x63ad('0x3'));var moment=require(_0x63ad('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x63ad('0x5'));var rimraf=require('rimraf');var config=require(_0x63ad('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x15a147,_0x4845d9){return _0x15a147[_0x63ad('0x7')](_0x63ad('0x8'),attributes,{'tableName':_0x63ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd74a=['moment','bluebird','rimraf','./chatWebsite.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x59092d,_0x1dd573){var _0x4aa450=function(_0x5ddc2a){while(--_0x5ddc2a){_0x59092d['push'](_0x59092d['shift']());}};_0x4aa450(++_0x1dd573);}(_0xd74a,0x1d2));var _0xad74=function(_0x4e1fd1,_0x4d9f35){_0x4e1fd1=_0x4e1fd1-0x0;var _0x1418d8=_0xd74a[_0x4e1fd1];return _0x1418d8;};'use strict';var _=require(_0xad74('0x0'));var util=require(_0xad74('0x1'));var logger=require(_0xad74('0x2'))(_0xad74('0x3'));var moment=require(_0xad74('0x4'));var BPromise=require(_0xad74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xad74('0x6'));var config=require('../../config/environment');var attributes=require(_0xad74('0x7'));module[_0xad74('0x8')]=function(_0x3dc7d7,_0x37ec4c){return _0x3dc7d7[_0xad74('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index f86f402..207faf2 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 _0xf785=['client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4c5793,_0xc25684){var _0x5503e2=function(_0x5bff71){while(--_0x5bff71){_0x4c5793['push'](_0x4c5793['shift']());}};_0x5503e2(++_0xc25684);}(_0xf785,0x8c));var _0x5f78=function(_0x112658,_0x3792de){_0x112658=_0x112658-0x0;var _0x1ac5e2=_0xf785[_0x112658];return _0x1ac5e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5f78('0x0'));var BPromise=require(_0x5f78('0x1'));var rs=require(_0x5f78('0x2'));var fs=require('fs');var Redis=require(_0x5f78('0x3'));var db=require(_0x5f78('0x4'))['db'];var utils=require(_0x5f78('0x5'));var logger=require(_0x5f78('0x6'))(_0x5f78('0x7'));var config=require(_0x5f78('0x8'));var jayson=require(_0x5f78('0x9'));var client=jayson[_0x5f78('0xa')][_0x5f78('0xb')]({'port':0x232a});config[_0x5f78('0xc')]=_[_0x5f78('0xd')](config['redis'],{'host':_0x5f78('0xe'),'port':0x18eb});var socket=require(_0x5f78('0xf'))(new Redis(config[_0x5f78('0xc')]));require(_0x5f78('0x10'))[_0x5f78('0x11')](socket);function respondWithRpcPromise(_0x3ed5ac,_0x15802c,_0x57fe6d){return new BPromise(function(_0x312ff6,_0x1660be){return client[_0x5f78('0x12')](_0x3ed5ac,_0x57fe6d)['then'](function(_0x153b8b){logger[_0x5f78('0x13')](_0x5f78('0x14'),_0x15802c,'request\x20sent');logger[_0x5f78('0x15')](_0x5f78('0x16'),_0x15802c,_0x5f78('0x17'),JSON[_0x5f78('0x18')](_0x153b8b));if(_0x153b8b[_0x5f78('0x19')]){if(_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1a')]===0x1f4){logger[_0x5f78('0x19')](_0x5f78('0x14'),_0x15802c,_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1b')]);return _0x1660be(_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1b')]);}logger['error'](_0x5f78('0x14'),_0x15802c,_0x153b8b[_0x5f78('0x19')][_0x5f78('0x1b')]);return _0x312ff6(_0x153b8b['error'][_0x5f78('0x1b')]);}else{logger['info'](_0x5f78('0x14'),_0x15802c,_0x5f78('0x17'));_0x312ff6(_0x153b8b[_0x5f78('0x1c')][_0x5f78('0x1b')]);}})[_0x5f78('0x1d')](function(_0x5cf734){logger[_0x5f78('0x19')](_0x5f78('0x14'),_0x15802c,_0x5cf734);_0x1660be(_0x5cf734);});});}
\ No newline at end of file
+var _0xc4e3=['./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','socket.io-emitter','redis'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0xc4e3,0xd2));var _0x3c4e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4e3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3c4e('0x0'));var util=require('util');var moment=require(_0x3c4e('0x1'));var BPromise=require(_0x3c4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c4e('0x3'));var db=require(_0x3c4e('0x4'))['db'];var utils=require(_0x3c4e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c4e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3c4e('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c4e('0x8'))(new Redis(config[_0x3c4e('0x9')]));require(_0x3c4e('0xa'))[_0x3c4e('0xb')](socket);function respondWithRpcPromise(_0x2387df,_0x323469,_0x34d65d){return new BPromise(function(_0x4d2238,_0x2047ea){return client['request'](_0x2387df,_0x34d65d)[_0x3c4e('0xc')](function(_0xb61990){logger[_0x3c4e('0xd')](_0x3c4e('0xe'),_0x323469,_0x3c4e('0xf'));logger[_0x3c4e('0x10')](_0x3c4e('0x11'),_0x323469,_0x3c4e('0xf'),JSON[_0x3c4e('0x12')](_0xb61990));if(_0xb61990[_0x3c4e('0x13')]){if(_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x14')]===0x1f4){logger[_0x3c4e('0x13')](_0x3c4e('0xe'),_0x323469,_0xb61990[_0x3c4e('0x13')]['message']);return _0x2047ea(_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x323469,_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x15')]);return _0x4d2238(_0xb61990['error']['message']);}else{logger[_0x3c4e('0xd')](_0x3c4e('0xe'),_0x323469,'request\x20sent');_0x4d2238(_0xb61990['result'][_0x3c4e('0x15')]);}})['catch'](function(_0x4c5a5d){logger[_0x3c4e('0x13')](_0x3c4e('0xe'),_0x323469,_0x4c5a5d);_0x2047ea(_0x4c5a5d);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index fddb542..515bb74 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 _0xdb6e=['register','length','./chatWebsite.events','save','update','emit'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xdb6e,0x1d0));var _0xedb6=function(_0x45515b,_0x1e16a8){_0x45515b=_0x45515b-0x0;var _0x20ed56=_0xdb6e[_0x45515b];return _0x20ed56;};'use strict';var ChatWebsiteEvents=require(_0xedb6('0x0'));var events=[_0xedb6('0x1'),'remove',_0xedb6('0x2')];function createListener(_0x6f60e7,_0x69c088){return function(_0x18f680){_0x69c088[_0xedb6('0x3')](_0x6f60e7,_0x18f680);};}function removeListener(_0x42c542,_0x215bb2){return function(){ChatWebsiteEvents['removeListener'](_0x42c542,_0x215bb2);};}exports[_0xedb6('0x4')]=function(_0x23da33){for(var _0x2ac722=0x0,_0x4b069e=events[_0xedb6('0x5')];_0x2ac722<_0x4b069e;_0x2ac722++){var _0x4ff70d=events[_0x2ac722];var _0x22961c=createListener('chatWebsite:'+_0x4ff70d,_0x23da33);ChatWebsiteEvents['on'](_0x4ff70d,_0x22961c);}};
\ No newline at end of file
+var _0xe7a8=['chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0xe7a8,0xa9));var _0x8e7a=function(_0x49f72d,_0x315dc6){_0x49f72d=_0x49f72d-0x0;var _0x4e1123=_0xe7a8[_0x49f72d];return _0x4e1123;};'use strict';var ChatWebsiteEvents=require(_0x8e7a('0x0'));var events=['save',_0x8e7a('0x1'),_0x8e7a('0x2')];function createListener(_0x29bae1,_0x36afd7){return function(_0x5a7b17){_0x36afd7[_0x8e7a('0x3')](_0x29bae1,_0x5a7b17);};}function removeListener(_0x349445,_0x188e1e){return function(){ChatWebsiteEvents[_0x8e7a('0x4')](_0x349445,_0x188e1e);};}exports[_0x8e7a('0x5')]=function(_0x4258c8){for(var _0x27b260=0x0,_0xb7aa39=events['length'];_0x27b260<_0xb7aa39;_0x27b260++){var _0x30bbc0=events[_0x27b260];var _0x13014a=createListener(_0x8e7a('0x6')+_0x30bbc0,_0x4258c8);ChatWebsiteEvents['on'](_0x30bbc0,_0x13014a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 996bbd3..399355c 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 _0x3389=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','now','/:id/avatar','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','removeAnswers','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition'];(function(_0x3ad2f1,_0x3633b3){var _0x230f36=function(_0x1aef67){while(--_0x1aef67){_0x3ad2f1['push'](_0x3ad2f1['shift']());}};_0x230f36(++_0x3633b3);}(_0x3389,0xec));var _0x9338=function(_0x3dc718,_0x1d85d5){_0x3dc718=_0x3dc718-0x0;var _0x14b3b9=_0x3389[_0x3dc718];return _0x14b3b9;};'use strict';var multer=require(_0x9338('0x0'));var util=require('util');var path=require(_0x9338('0x1'));var timeout=require('connect-timeout');var express=require(_0x9338('0x2'));var router=express[_0x9338('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9338('0x4'));var config=require(_0x9338('0x5'));var controller=require(_0x9338('0x6'));router['get']('/',auth[_0x9338('0x7')](),controller['index']);router[_0x9338('0x8')](_0x9338('0x9'),auth[_0x9338('0x7')](),controller[_0x9338('0xa')]);router[_0x9338('0x8')](_0x9338('0xb'),auth[_0x9338('0x7')](),controller[_0x9338('0xc')]);router[_0x9338('0x8')](_0x9338('0xd'),auth[_0x9338('0x7')](),controller[_0x9338('0xe')]);router[_0x9338('0x8')](_0x9338('0xf'),auth['isAuthenticated'](),controller[_0x9338('0x10')]);router[_0x9338('0x8')](_0x9338('0x11'),controller['getLogo']);router[_0x9338('0x8')]('/:id/avatar',controller[_0x9338('0x12')]);router[_0x9338('0x8')](_0x9338('0x13'),controller[_0x9338('0x14')]);router[_0x9338('0x8')](_0x9338('0x15'),controller[_0x9338('0x16')]);router[_0x9338('0x8')](_0x9338('0x17'),auth[_0x9338('0x7')](),controller[_0x9338('0x18')]);router[_0x9338('0x8')](_0x9338('0x19'),controller['getSnippet']);router[_0x9338('0x8')](_0x9338('0x1a'),auth[_0x9338('0x7')](),controller['getApplications']);router[_0x9338('0x8')](_0x9338('0x1b'),auth[_0x9338('0x7')](),controller['getProactiveActions']);router['get'](_0x9338('0x1c'),controller[_0x9338('0x1d')]);router[_0x9338('0x8')]('/:id/offline_messages',auth[_0x9338('0x7')](),controller[_0x9338('0x1e')]);router[_0x9338('0x8')](_0x9338('0x1f'),auth['isAuthenticated'](),controller[_0x9338('0x20')]);router['post']('/',auth[_0x9338('0x7')](),controller[_0x9338('0x21')]);router[_0x9338('0x22')]('/:id/dispositions',auth[_0x9338('0x7')](),controller[_0x9338('0x23')]);router[_0x9338('0x22')](_0x9338('0xf'),auth[_0x9338('0x7')](),controller[_0x9338('0x24')]);var upload=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0x2119c5,_0x4ee21e,_0x376002){_0x376002(null,path[_0x9338('0x26')](config[_0x9338('0x27')],_0x9338('0x28')));},'filename':function(_0xca527,_0x120936,_0x3aa7d3){_0x3aa7d3(null,util[_0x9338('0x29')](_0x9338('0x2a'),Date['now'](),_0x120936[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x11'),upload[_0x9338('0x2c')](_0x9338('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4452bd,_0x49bd63,_0x2cde9e){_0x2cde9e(null,path[_0x9338('0x26')](config[_0x9338('0x27')],'server/files/images/avatars/'));},'filename':function(_0x276dd6,_0x45b2c8,_0x4b666d){_0x4b666d(null,util['format'](_0x9338('0x2a'),Date[_0x9338('0x2e')](),_0x45b2c8[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x2f'),upload[_0x9338('0x2c')](_0x9338('0x2d')),controller[_0x9338('0x30')]);var upload=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0xc2867f,_0x259ac9,_0x3d63c0){_0x3d63c0(null,path[_0x9338('0x26')](config[_0x9338('0x27')],_0x9338('0x31')));},'filename':function(_0x299f5b,_0x45261b,_0x97da0b){_0x97da0b(null,util['format'](_0x9338('0x2a'),Date[_0x9338('0x2e')](),_0x45261b[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x13'),upload[_0x9338('0x2c')]('file'),controller[_0x9338('0x32')]);var upload=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0x2672e4,_0x4d7192,_0x289555){_0x289555(null,path[_0x9338('0x26')](config[_0x9338('0x27')],_0x9338('0x31')));},'filename':function(_0x34e401,_0x2848dc,_0x52a73e){_0x52a73e(null,util[_0x9338('0x29')](_0x9338('0x2a'),Date[_0x9338('0x2e')](),_0x2848dc[_0x9338('0x2b')]));}})});router[_0x9338('0x22')](_0x9338('0x15'),upload[_0x9338('0x2c')](_0x9338('0x2d')),controller[_0x9338('0x33')]);router[_0x9338('0x22')](_0x9338('0x34'),controller[_0x9338('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x9338('0x25')]({'destination':function(_0x1eceb1,_0x2f87ad,_0x2854f3){const _0x319223=path['join'](config[_0x9338('0x27')],_0x9338('0x36'),'attachments',_0x9338('0x37'));fs_extra[_0x9338('0x38')](_0x319223,function(){_0x2854f3(null,_0x319223);});},'filename':function(_0x503744,_0x504c5e,_0x55aca5){const _0x303fbf=_0x504c5e[_0x9338('0x2b')][_0x9338('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x551596=path[_0x9338('0x3a')](_0x303fbf);const _0x5e4f9c=Date[_0x9338('0x2e')]()+'-'+_0x303fbf[_0x9338('0x39')](_0x551596,'')+_0x551596;_0x55aca5(null,_0x5e4f9c);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0x9338('0x3b')]);router['post'](_0x9338('0x17'),auth[_0x9338('0x7')](),controller[_0x9338('0x3c')]);router[_0x9338('0x22')](_0x9338('0x1a'),auth[_0x9338('0x7')](),controller['addApplications']);router[_0x9338('0x22')](_0x9338('0x1b'),auth[_0x9338('0x7')](),controller[_0x9338('0x3d')]);router[_0x9338('0x22')](_0x9338('0x1f'),auth['isAuthenticated'](),controller[_0x9338('0x3e')]);router[_0x9338('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x9338('0x40')]);router[_0x9338('0x41')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x9338('0x41')]('/:id/dispositions',auth[_0x9338('0x7')](),controller['removeDispositions']);router[_0x9338('0x41')]('/:id/canned_answers',auth[_0x9338('0x7')](),controller[_0x9338('0x42')]);router[_0x9338('0x41')](_0x9338('0x1f'),auth[_0x9338('0x7')](),controller['removeAgents']);module[_0x9338('0x43')]=router;
\ No newline at end of file
+var _0x7245=['get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getLogo','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','join','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','/:id/avatar','addAvatar','diskStorage','root','/:id/customer_avatar','addSystemAvatar','notify','server/files','attachments','ensureDir','extname','replace','/:id/offline','offline','addInteraction','/:id/proactive_actions','addAgents','put','update','delete','destroy','removeAnswers','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x4d9e30,_0x15912b){var _0x4691fb=function(_0x5b7895){while(--_0x5b7895){_0x4d9e30['push'](_0x4d9e30['shift']());}};_0x4691fb(++_0x15912b);}(_0x7245,0x7c));var _0x5724=function(_0x28e781,_0x38485b){_0x28e781=_0x28e781-0x0;var _0x4c4cb5=_0x7245[_0x28e781];return _0x4c4cb5;};'use strict';var multer=require(_0x5724('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5724('0x1'));var express=require(_0x5724('0x2'));var router=express[_0x5724('0x3')]();var fs_extra=require(_0x5724('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5724('0x5'));var controller=require('./chatWebsite.controller');router[_0x5724('0x6')]('/',auth[_0x5724('0x7')](),controller[_0x5724('0x8')]);router[_0x5724('0x6')]('/describe',auth[_0x5724('0x7')](),controller[_0x5724('0x9')]);router[_0x5724('0x6')](_0x5724('0xa'),auth[_0x5724('0x7')](),controller['show']);router[_0x5724('0x6')](_0x5724('0xb'),auth[_0x5724('0x7')](),controller[_0x5724('0xc')]);router[_0x5724('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x5724('0x6')]('/:id/logo',controller[_0x5724('0xd')]);router[_0x5724('0x6')]('/:id/avatar',controller[_0x5724('0xe')]);router[_0x5724('0x6')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x5724('0x6')](_0x5724('0xf'),controller[_0x5724('0x10')]);router[_0x5724('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x5724('0x11'),controller[_0x5724('0x12')]);router[_0x5724('0x6')](_0x5724('0x13'),auth[_0x5724('0x7')](),controller[_0x5724('0x14')]);router['get']('/:id/proactive_actions',auth[_0x5724('0x7')](),controller[_0x5724('0x15')]);router['get'](_0x5724('0x16'),controller[_0x5724('0x17')]);router[_0x5724('0x6')](_0x5724('0x18'),auth[_0x5724('0x7')](),controller[_0x5724('0x19')]);router['get'](_0x5724('0x1a'),auth['isAuthenticated'](),controller[_0x5724('0x1b')]);router[_0x5724('0x1c')]('/',auth[_0x5724('0x7')](),controller[_0x5724('0x1d')]);router[_0x5724('0x1c')](_0x5724('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x5724('0x1e'),auth[_0x5724('0x7')](),controller[_0x5724('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ac7fa,_0x1989bb,_0x20ebec){_0x20ebec(null,path[_0x5724('0x20')](config['root'],_0x5724('0x21')));},'filename':function(_0x4fed71,_0x2b205c,_0x4ca2ea){_0x4ca2ea(null,util[_0x5724('0x22')](_0x5724('0x23'),Date[_0x5724('0x24')](),_0x2b205c[_0x5724('0x25')]));}})});router[_0x5724('0x1c')](_0x5724('0x26'),upload[_0x5724('0x27')](_0x5724('0x28')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d5cbc,_0x366d1f,_0x590717){_0x590717(null,path[_0x5724('0x20')](config['root'],_0x5724('0x29')));},'filename':function(_0x2a44a7,_0x547576,_0x3fa6cd){_0x3fa6cd(null,util[_0x5724('0x22')]('%s-%s',Date[_0x5724('0x24')](),_0x547576[_0x5724('0x25')]));}})});router['post'](_0x5724('0x2a'),upload[_0x5724('0x27')](_0x5724('0x28')),controller[_0x5724('0x2b')]);var upload=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0xa4c325,_0x23d9f9,_0x544817){_0x544817(null,path[_0x5724('0x20')](config[_0x5724('0x2d')],_0x5724('0x29')));},'filename':function(_0x21f2c7,_0x40b07e,_0x57a5e0){_0x57a5e0(null,util[_0x5724('0x22')](_0x5724('0x23'),Date[_0x5724('0x24')](),_0x40b07e[_0x5724('0x25')]));}})});router[_0x5724('0x1c')](_0x5724('0x2e'),upload[_0x5724('0x27')](_0x5724('0x28')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0x2e0657,_0x4bd00e,_0x4eb855){_0x4eb855(null,path[_0x5724('0x20')](config[_0x5724('0x2d')],_0x5724('0x29')));},'filename':function(_0x444f52,_0x3ceb27,_0x34b508){_0x34b508(null,util['format'](_0x5724('0x23'),Date['now'](),_0x3ceb27['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x5724('0x27')](_0x5724('0x28')),controller[_0x5724('0x2f')]);router['post']('/:id/notify',controller[_0x5724('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0x31b5aa,_0x2e8ed3,_0x5165c4){const _0x18e079=path[_0x5724('0x20')](config['root'],_0x5724('0x31'),_0x5724('0x32'),'offline-chat');fs_extra[_0x5724('0x33')](_0x18e079,function(){_0x5165c4(null,_0x18e079);});},'filename':function(_0x42f41c,_0xda964d,_0x4cafc6){const _0x5a4ebe=_0xda964d[_0x5724('0x25')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x551505=path[_0x5724('0x34')](_0x5a4ebe);const _0x58d142=Date[_0x5724('0x24')]()+'-'+_0x5a4ebe[_0x5724('0x35')](_0x551505,'')+_0x551505;_0x4cafc6(null,_0x58d142);}})});router[_0x5724('0x1c')](_0x5724('0x36'),offlineUploadMulter['any'](),controller[_0x5724('0x37')]);router[_0x5724('0x1c')]('/:id/interactions',auth[_0x5724('0x7')](),controller[_0x5724('0x38')]);router['post'](_0x5724('0x13'),auth[_0x5724('0x7')](),controller['addApplications']);router[_0x5724('0x1c')](_0x5724('0x39'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0x5724('0x1a'),auth[_0x5724('0x7')](),controller[_0x5724('0x3a')]);router[_0x5724('0x3b')](_0x5724('0xa'),auth['isAuthenticated'](),controller[_0x5724('0x3c')]);router[_0x5724('0x3d')](_0x5724('0xa'),auth[_0x5724('0x7')](),controller[_0x5724('0x3e')]);router[_0x5724('0x3d')](_0x5724('0xb'),auth[_0x5724('0x7')](),controller['removeDispositions']);router[_0x5724('0x3d')](_0x5724('0x1e'),auth[_0x5724('0x7')](),controller[_0x5724('0x3f')]);router[_0x5724('0x3d')](_0x5724('0x1a'),auth[_0x5724('0x7')](),controller['removeAgents']);module[_0x5724('0x40')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 741b5d0..c185a51 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 _0xf03a=['exports','STRING','ENUM','AmazonAWS'];(function(_0x4df30a,_0x28bd70){var _0x2ac426=function(_0x3dd055){while(--_0x3dd055){_0x4df30a['push'](_0x4df30a['shift']());}};_0x2ac426(++_0x28bd70);}(_0xf03a,0x1a0));var _0xaf03=function(_0x485835,_0x4a0708){_0x485835=_0x485835-0x0;var _0x3e079f=_0xf03a[_0x485835];return _0x3e079f;};'use strict';var Sequelize=require('sequelize');module[_0xaf03('0x0')]={'name':{'type':Sequelize[_0xaf03('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xaf03('0x2')](_0xaf03('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xaf03('0x1')]},'data2':{'type':Sequelize[_0xaf03('0x1')]}};
\ No newline at end of file
+var _0x4453=['STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x53286a,_0x485c92){var _0x5730ff=function(_0x478c81){while(--_0x478c81){_0x53286a['push'](_0x53286a['shift']());}};_0x5730ff(++_0x485c92);}(_0x4453,0x9c));var _0x3445=function(_0x45ff95,_0x4c138e){_0x45ff95=_0x45ff95-0x0;var _0x3ff0a7=_0x4453[_0x45ff95];return _0x3ff0a7;};'use strict';var Sequelize=require(_0x3445('0x0'));module[_0x3445('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3445('0x2')](_0x3445('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3445('0x4')]},'data2':{'type':Sequelize[_0x3445('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 9cec9a5..39a3deb 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x129bd2,_0x4e7e88){var _0x2bc703=function(_0x53abc9){while(--_0x53abc9){_0x129bd2['push'](_0x129bd2['shift']());}};_0x2bc703(++_0x4e7e88);}(_0x7a54,0x106));var _0x47a5=function(_0xa9a3b,_0x5716e2){_0xa9a3b=_0xa9a3b-0x0;var _0x4764eb=_0x7a54[_0xa9a3b];return _0x4764eb;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x5f2f,0x73));var _0xf5f2=function(_0x277ca5,_0x1b1451){_0x277ca5=_0x277ca5-0x0;var _0x48fa84=_0x5f2f[_0x277ca5];return _0x48fa84;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 3eefa8a..90c6e57 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 _0x8d3c=['rimraf','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0xc58b4d,_0x6dd26a){var _0x496a98=function(_0x66892f){while(--_0x66892f){_0xc58b4d['push'](_0xc58b4d['shift']());}};_0x496a98(++_0x6dd26a);}(_0x8d3c,0x170));var _0xc8d3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8d3c[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xc8d3('0x0'));var util=require(_0xc8d3('0x1'));var logger=require(_0xc8d3('0x2'))('api');var moment=require(_0xc8d3('0x3'));var BPromise=require(_0xc8d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8d3('0x5'));var rimraf=require(_0xc8d3('0x6'));var config=require(_0xc8d3('0x7'));var attributes=require(_0xc8d3('0x8'));module[_0xc8d3('0x9')]=function(_0x249baf,_0x55f8d4){return _0x249baf['define']('CloudProvider',attributes,{'tableName':_0xc8d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1db=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x377924,_0x50bdca){var _0x5ad504=function(_0x220c81){while(--_0x220c81){_0x377924['push'](_0x377924['shift']());}};_0x5ad504(++_0x50bdca);}(_0xd1db,0x13d));var _0xbd1d=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xd1db[_0x5f4cd7];return _0x47c93f;};'use strict';var _=require(_0xbd1d('0x0'));var util=require(_0xbd1d('0x1'));var logger=require(_0xbd1d('0x2'))(_0xbd1d('0x3'));var moment=require('moment');var BPromise=require(_0xbd1d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd1d('0x5'));var rimraf=require(_0xbd1d('0x6'));var config=require(_0xbd1d('0x7'));var attributes=require(_0xbd1d('0x8'));module[_0xbd1d('0x9')]=function(_0x542c12,_0x85b70e){return _0x542c12[_0xbd1d('0xa')](_0xbd1d('0xb'),attributes,{'tableName':_0xbd1d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 52d2218..96cda6a 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 _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x384ecc,_0x4c4f22){var _0x128066=function(_0x95a905){while(--_0x95a905){_0x384ecc['push'](_0x384ecc['shift']());}};_0x128066(++_0x4c4f22);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x711ac2,_0x4fd7bd){_0x711ac2=_0x711ac2-0x0;var _0x496861=_0xdd4f[_0x711ac2];return _0x496861;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});}
\ No newline at end of file
+var _0xaa64=['rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c8be7,_0x5178b2){var _0x15976c=function(_0x3f57f8){while(--_0x3f57f8){_0x5c8be7['push'](_0x5c8be7['shift']());}};_0x15976c(++_0x5178b2);}(_0xaa64,0xf7));var _0x4aa6=function(_0x85d355,_0x546c82){_0x85d355=_0x85d355-0x0;var _0x31057a=_0xaa64[_0x85d355];return _0x31057a;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require('moment');var BPromise=require(_0x4aa6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aa6('0x3'));var db=require(_0x4aa6('0x4'))['db'];var utils=require(_0x4aa6('0x5'));var logger=require('../../config/logger')(_0x4aa6('0x6'));var config=require(_0x4aa6('0x7'));var jayson=require(_0x4aa6('0x8'));var client=jayson[_0x4aa6('0x9')][_0x4aa6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7dd83d,_0x39c4b5,_0x49e174){return new BPromise(function(_0x529c89,_0xee21ba){return client[_0x4aa6('0xb')](_0x7dd83d,_0x49e174)['then'](function(_0x26619c){logger['info'](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));logger[_0x4aa6('0xe')](_0x4aa6('0xf'),_0x39c4b5,'request\x20sent',JSON[_0x4aa6('0x10')](_0x26619c));if(_0x26619c[_0x4aa6('0x11')]){if(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x12')]===0x1f4){logger[_0x4aa6('0x11')](_0x4aa6('0xc'),_0x39c4b5,_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);return _0xee21ba(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}logger['error'](_0x4aa6('0xc'),_0x39c4b5,_0x26619c['error']['message']);return _0x529c89(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}else{logger[_0x4aa6('0x14')](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));_0x529c89(_0x26619c[_0x4aa6('0x15')][_0x4aa6('0x13')]);}})[_0x4aa6('0x16')](function(_0x530ed0){logger[_0x4aa6('0x11')]('CloudProvider,\x20%s,\x20%s',_0x39c4b5,_0x530ed0);_0xee21ba(_0x530ed0);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 919d303..c78b659 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 _0xa0bf=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x41bfbe,_0x5eebff){var _0x470d5c=function(_0x2bd839){while(--_0x2bd839){_0x41bfbe['push'](_0x41bfbe['shift']());}};_0x470d5c(++_0x5eebff);}(_0xa0bf,0xb6));var _0xfa0b=function(_0x1e3fab,_0x22437a){_0x1e3fab=_0x1e3fab-0x0;var _0x3992f8=_0xa0bf[_0x1e3fab];return _0x3992f8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa0b('0x0')]();var fs_extra=require('fs-extra');var auth=require(_0xfa0b('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0xfa0b('0x2'));var controller=require('./cloudProvider.controller');router[_0xfa0b('0x3')]('/',auth[_0xfa0b('0x4')](),controller[_0xfa0b('0x5')]);router[_0xfa0b('0x3')](_0xfa0b('0x6'),auth[_0xfa0b('0x4')](),controller[_0xfa0b('0x7')]);router[_0xfa0b('0x8')]('/',auth[_0xfa0b('0x4')](),controller[_0xfa0b('0x9')]);router['put'](_0xfa0b('0x6'),auth['isAuthenticated'](),controller[_0xfa0b('0xa')]);router[_0xfa0b('0xb')](_0xfa0b('0x6'),auth['isAuthenticated'](),controller[_0xfa0b('0xc')]);module[_0xfa0b('0xd')]=router;
\ No newline at end of file
+var _0x13ef=['../../components/auth/service','../../config/environment','./cloudProvider.controller','get','index','/:id','show','isAuthenticated','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x59ece8,_0xc1be9a){var _0x4ae43e=function(_0x32b914){while(--_0x32b914){_0x59ece8['push'](_0x59ece8['shift']());}};_0x4ae43e(++_0xc1be9a);}(_0x13ef,0x19c));var _0xf13e=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x13ef[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0xf13e('0x0'));var util=require(_0xf13e('0x1'));var path=require(_0xf13e('0x2'));var timeout=require(_0xf13e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf13e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf13e('0x5'));var controller=require(_0xf13e('0x6'));router[_0xf13e('0x7')]('/',auth['isAuthenticated'](),controller[_0xf13e('0x8')]);router[_0xf13e('0x7')](_0xf13e('0x9'),auth['isAuthenticated'](),controller[_0xf13e('0xa')]);router['post']('/',auth[_0xf13e('0xb')](),controller['create']);router[_0xf13e('0xc')](_0xf13e('0x9'),auth[_0xf13e('0xb')](),controller[_0xf13e('0xd')]);router['delete'](_0xf13e('0x9'),auth[_0xf13e('0xb')](),controller[_0xf13e('0xe')]);module[_0xf13e('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 083d74a..9760542 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 _0x2c0a=['exports','STRING','sequelize'];(function(_0x4a4d36,_0x41ff0d){var _0x339e31=function(_0x2e3c32){while(--_0x2e3c32){_0x4a4d36['push'](_0x4a4d36['shift']());}};_0x339e31(++_0x41ff0d);}(_0x2c0a,0x1a6));var _0xa2c0=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x2c0a[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require(_0xa2c0('0x0'));module[_0xa2c0('0x1')]={'name':{'type':Sequelize[_0xa2c0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa2c0('0x2')]},'companyId':{'type':Sequelize[_0xa2c0('0x2')]},'website':{'type':Sequelize[_0xa2c0('0x2')]},'phone':{'type':Sequelize[_0xa2c0('0x2')]},'fax':{'type':Sequelize[_0xa2c0('0x2')]},'type':{'type':Sequelize[_0xa2c0('0x2')]},'street':{'type':Sequelize[_0xa2c0('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa2c0('0x2')]},'country':{'type':Sequelize[_0xa2c0('0x2')]},'email':{'type':Sequelize[_0xa2c0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa2c0('0x2')]},'sStreet':{'type':Sequelize[_0xa2c0('0x2')]},'sPostalCode':{'type':Sequelize[_0xa2c0('0x2')]},'sCity':{'type':Sequelize[_0xa2c0('0x2')]},'sCountry':{'type':Sequelize[_0xa2c0('0x2')]},'description':{'type':Sequelize[_0xa2c0('0x2')]}};
\ No newline at end of file
+var _0x7b4a=['STRING','sequelize'];(function(_0x5c44bc,_0x499961){var _0x2ba826=function(_0x49c3df){while(--_0x49c3df){_0x5c44bc['push'](_0x5c44bc['shift']());}};_0x2ba826(++_0x499961);}(_0x7b4a,0x119));var _0xa7b4=function(_0x67ef3d,_0x50f0bd){_0x67ef3d=_0x67ef3d-0x0;var _0x2ef03e=_0x7b4a[_0x67ef3d];return _0x2ef03e;};'use strict';var Sequelize=require(_0xa7b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7b4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa7b4('0x1')]},'companyId':{'type':Sequelize[_0xa7b4('0x1')]},'website':{'type':Sequelize[_0xa7b4('0x1')]},'phone':{'type':Sequelize[_0xa7b4('0x1')]},'fax':{'type':Sequelize[_0xa7b4('0x1')]},'type':{'type':Sequelize[_0xa7b4('0x1')]},'street':{'type':Sequelize[_0xa7b4('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa7b4('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa7b4('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa7b4('0x1')]},'sStreet':{'type':Sequelize[_0xa7b4('0x1')]},'sPostalCode':{'type':Sequelize[_0xa7b4('0x1')]},'sCity':{'type':Sequelize[_0xa7b4('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa7b4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 399c712..7dae7d5 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 _0x1dd6=['ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','Companies','UserProfileResource','error','stack','name','index','CmCompany','keys','query','filters','intersection','model','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','include','findAll','catch','params','rawAttributes','fields','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ids','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0xfd7b3a,_0x477c00){var _0x1022fa=function(_0x4a3dbe){while(--_0x4a3dbe){_0xfd7b3a['push'](_0xfd7b3a['shift']());}};_0x1022fa(++_0x477c00);}(_0x1dd6,0x13b));var _0x61dd=function(_0x1ab966,_0xf40888){_0x1ab966=_0x1ab966-0x0;var _0x4f209e=_0x1dd6[_0x1ab966];return _0x4f209e;};'use strict';var emlformat=require(_0x61dd('0x0'));var rimraf=require(_0x61dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61dd('0x2'));var rp=require(_0x61dd('0x3'));var moment=require('moment');var BPromise=require(_0x61dd('0x4'));var Mustache=require(_0x61dd('0x5'));var util=require(_0x61dd('0x6'));var path=require(_0x61dd('0x7'));var sox=require('sox');var csv=require(_0x61dd('0x8'));var ejs=require(_0x61dd('0x9'));var fs=require('fs');var fs_extra=require(_0x61dd('0xa'));var _=require(_0x61dd('0xb'));var squel=require('squel');var crypto=require(_0x61dd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x61dd('0x8'));var querystring=require(_0x61dd('0xd'));var Papa=require(_0x61dd('0xe'));var Redis=require('ioredis');var authService=require(_0x61dd('0xf'));var qs=require(_0x61dd('0x10'));var as=require(_0x61dd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x61dd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x61dd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5313a2,_0xbbe503){_0xbbe503=_0xbbe503||0xcc;return function(_0x4f873e){if(_0x4f873e){return _0x5313a2[_0x61dd('0x14')](_0xbbe503);}return _0x5313a2[_0x61dd('0x15')](_0xbbe503)[_0x61dd('0x16')]();};}function respondWithResult(_0x81002e,_0x2c987b){_0x2c987b=_0x2c987b||0xc8;return function(_0x1bccbf){if(_0x1bccbf){return _0x81002e[_0x61dd('0x15')](_0x2c987b)['json'](_0x1bccbf);}};}function respondWithFilteredResult(_0x2892b6,_0x2fefa6){return function(_0x29e0eb){if(_0x29e0eb){var _0x297e57=typeof _0x2fefa6[_0x61dd('0x17')]===_0x61dd('0x18')&&typeof _0x2fefa6[_0x61dd('0x19')]===_0x61dd('0x18');var _0x1853c5=_0x29e0eb['count'];var _0x292bcd=_0x297e57?0x0:_0x2fefa6['offset'];var _0x3b491f=_0x297e57?_0x29e0eb[_0x61dd('0x1a')]:_0x2fefa6[_0x61dd('0x17')]+_0x2fefa6[_0x61dd('0x19')];var _0x1e9ed5;if(_0x3b491f>=_0x1853c5){_0x3b491f=_0x1853c5;_0x1e9ed5=0xc8;}else{_0x1e9ed5=0xce;}_0x2892b6[_0x61dd('0x15')](_0x1e9ed5);return _0x2892b6[_0x61dd('0x1b')]('Content-Range',_0x292bcd+'-'+_0x3b491f+'/'+_0x1853c5)[_0x61dd('0x1c')](_0x29e0eb);}return null;};}function patchUpdates(_0x48ee2c){return function(_0x59d248){try{jsonpatch[_0x61dd('0x1d')](_0x59d248,_0x48ee2c,!![]);}catch(_0xb48197){return BPromise[_0x61dd('0x1e')](_0xb48197);}return _0x59d248[_0x61dd('0x1f')]();};}function saveUpdates(_0x2d03ca,_0x28dda4){return function(_0xb26c04){if(_0xb26c04){return _0xb26c04[_0x61dd('0x20')](_0x2d03ca)[_0x61dd('0x21')](function(_0x1c7ad4){return _0x1c7ad4;});}return null;};}function removeEntity(_0x29eac6,_0x300436){return function(_0xf831c){if(_0xf831c){return _0xf831c[_0x61dd('0x22')]()[_0x61dd('0x21')](function(){var _0x184233=_0xf831c['get']({'plain':!![]});var _0x47007d=_0x61dd('0x23');return db[_0x61dd('0x24')]['destroy']({'where':{'type':_0x47007d,'resourceId':_0x184233['id']}})['then'](function(){return _0xf831c;});})[_0x61dd('0x21')](function(){_0x29eac6[_0x61dd('0x15')](0xcc)[_0x61dd('0x16')]();});}};}function handleEntityNotFound(_0x5ccfe7,_0x410931){return function(_0x7fc35f){if(!_0x7fc35f){_0x5ccfe7[_0x61dd('0x14')](0x194);}return _0x7fc35f;};}function handleError(_0x8b30f0,_0x261820){_0x261820=_0x261820||0x1f4;return function(_0x3ebf32){logger[_0x61dd('0x25')](_0x3ebf32[_0x61dd('0x26')]);if(_0x3ebf32[_0x61dd('0x27')]){delete _0x3ebf32['name'];}_0x8b30f0[_0x61dd('0x15')](_0x261820)['send'](_0x3ebf32);};}exports[_0x61dd('0x28')]=function(_0x1ae1d4,_0x55a538){var _0x158420={},_0x5a198c={},_0x356d2d={'count':0x0,'rows':[]};return db[_0x61dd('0x29')]['describe']()[_0x61dd('0x21')](function(_0x2ce011){_0x5a198c['model']=_[_0x61dd('0x2a')](_0x2ce011);_0x5a198c['query']=_[_0x61dd('0x2a')](_0x1ae1d4[_0x61dd('0x2b')]);_0x5a198c[_0x61dd('0x2c')]=_[_0x61dd('0x2d')](_0x5a198c[_0x61dd('0x2e')],_0x5a198c['query']);_0x158420['attributes']=_[_0x61dd('0x2d')](_0x5a198c['model'],qs['fields'](_0x1ae1d4['query']['fields']));_0x158420['attributes']=_0x158420['attributes'][_0x61dd('0x2f')]?_0x158420[_0x61dd('0x30')]:_0x5a198c[_0x61dd('0x2e')];if(!_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x31')](_0x61dd('0x32'))){_0x158420[_0x61dd('0x19')]=qs[_0x61dd('0x19')](_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x19')]);_0x158420[_0x61dd('0x17')]=qs[_0x61dd('0x17')](_0x1ae1d4[_0x61dd('0x2b')]['offset']);}_0x158420[_0x61dd('0x33')]=qs[_0x61dd('0x34')](_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x34')]);_0x158420[_0x61dd('0x35')]=qs[_0x61dd('0x2c')](_[_0x61dd('0x36')](_0x1ae1d4[_0x61dd('0x2b')],_0x5a198c[_0x61dd('0x2c')]),_0x2ce011);if(_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x37')]){_0x158420['where']=_['merge'](_0x158420[_0x61dd('0x35')],{'$or':_[_0x61dd('0x38')](_0x158420[_0x61dd('0x30')],function(_0x3a44e9){var _0xedaab6={};_0xedaab6[_0x3a44e9]={'$like':'%'+_0x1ae1d4[_0x61dd('0x2b')][_0x61dd('0x37')]+'%'};return _0xedaab6;})});}_0x158420=_[_0x61dd('0x39')]({},_0x158420,_0x1ae1d4[_0x61dd('0x3a')]);var _0x282aa9={'where':_0x158420[_0x61dd('0x35')]};return db[_0x61dd('0x29')][_0x61dd('0x1a')](_0x282aa9)['then'](function(_0x592db3){_0x356d2d['count']=_0x592db3;if(_0x1ae1d4[_0x61dd('0x2b')]['includeAll']){_0x158420[_0x61dd('0x3b')]=[{'all':!![]}];}return db[_0x61dd('0x29')][_0x61dd('0x3c')](_0x158420);})['then'](function(_0x327302){_0x356d2d['rows']=_0x327302;return _0x356d2d;})[_0x61dd('0x21')](respondWithFilteredResult(_0x55a538,_0x158420))[_0x61dd('0x3d')](handleError(_0x55a538,null));})[_0x61dd('0x3d')](handleError(_0x55a538,null));};exports['show']=function(_0x24a346,_0x412fe8){var _0x242fc3={'raw':![],'where':{'id':_0x24a346[_0x61dd('0x3e')]['id']}},_0xd7eb45={};_0xd7eb45[_0x61dd('0x2e')]=_['keys'](db[_0x61dd('0x29')][_0x61dd('0x3f')]);_0xd7eb45[_0x61dd('0x2b')]=_['keys'](_0x24a346[_0x61dd('0x2b')]);_0xd7eb45['filters']=_[_0x61dd('0x2d')](_0xd7eb45[_0x61dd('0x2e')],_0xd7eb45['query']);_0x242fc3['attributes']=_['intersection'](_0xd7eb45['model'],qs[_0x61dd('0x40')](_0x24a346[_0x61dd('0x2b')][_0x61dd('0x40')]));_0x242fc3[_0x61dd('0x30')]=_0x242fc3[_0x61dd('0x30')]['length']?_0x242fc3['attributes']:_0xd7eb45[_0x61dd('0x2e')];if(_0x24a346['query'][_0x61dd('0x41')]){_0x242fc3['include']=[{'all':!![]}];}_0x242fc3=_[_0x61dd('0x39')]({},_0x242fc3,_0x24a346[_0x61dd('0x3a')]);return db[_0x61dd('0x29')][_0x61dd('0x42')](_0x242fc3)[_0x61dd('0x21')](handleEntityNotFound(_0x412fe8,null))[_0x61dd('0x21')](respondWithResult(_0x412fe8,null))['catch'](handleError(_0x412fe8,null));};exports[_0x61dd('0x43')]=function(_0x5411b7,_0x3fbdb4){return db[_0x61dd('0x29')][_0x61dd('0x43')](_0x5411b7[_0x61dd('0x44')],{})[_0x61dd('0x21')](function(_0x1f9687){var _0x28fa4d=_0x5411b7['user'][_0x61dd('0x45')]({'plain':!![]});if(!_0x28fa4d)throw new Error(_0x61dd('0x46'));if(_0x28fa4d[_0x61dd('0x47')]==='user'){var _0x4bb8ca=_0x1f9687[_0x61dd('0x45')]({'plain':!![]});var _0x4c860b=_0x61dd('0x23');return db[_0x61dd('0x48')][_0x61dd('0x42')]({'where':{'name':_0x4c860b,'userProfileId':_0x28fa4d[_0x61dd('0x49')]},'raw':!![]})['then'](function(_0x9088ff){if(_0x9088ff&&_0x9088ff[_0x61dd('0x4a')]===0x0){return db[_0x61dd('0x24')][_0x61dd('0x43')]({'name':_0x4bb8ca[_0x61dd('0x27')],'resourceId':_0x4bb8ca['id'],'type':_0x9088ff['name'],'sectionId':_0x9088ff['id']},{})[_0x61dd('0x21')](function(){return _0x1f9687;});}else{return _0x1f9687;}})[_0x61dd('0x3d')](function(_0x3b8dd8){logger[_0x61dd('0x25')](_0x61dd('0x4b'),_0x3b8dd8);throw _0x3b8dd8;});}return _0x1f9687;})[_0x61dd('0x21')](respondWithResult(_0x3fbdb4,0xc9))[_0x61dd('0x3d')](handleError(_0x3fbdb4,null));};exports[_0x61dd('0x20')]=function(_0x3cfa9d,_0x481f28){if(_0x3cfa9d[_0x61dd('0x44')]['id']){delete _0x3cfa9d[_0x61dd('0x44')]['id'];}return db[_0x61dd('0x29')][_0x61dd('0x42')]({'where':{'id':_0x3cfa9d['params']['id']}})['then'](handleEntityNotFound(_0x481f28,null))[_0x61dd('0x21')](saveUpdates(_0x3cfa9d['body'],null))[_0x61dd('0x21')](respondWithResult(_0x481f28,null))[_0x61dd('0x3d')](handleError(_0x481f28,null));};exports[_0x61dd('0x22')]=function(_0x1a9951,_0x4d216d){return db[_0x61dd('0x29')][_0x61dd('0x42')]({'where':{'id':_0x1a9951[_0x61dd('0x3e')]['id']}})[_0x61dd('0x21')](handleEntityNotFound(_0x4d216d,null))[_0x61dd('0x21')](removeEntity(_0x4d216d,null))[_0x61dd('0x3d')](handleError(_0x4d216d,null));};exports['describe']=function(_0x16fb6c,_0x5cf6e6){return db[_0x61dd('0x29')][_0x61dd('0x4c')]()[_0x61dd('0x21')](respondWithResult(_0x5cf6e6,null))[_0x61dd('0x3d')](handleError(_0x5cf6e6,null));};exports['addContacts']=function(_0x4e8d77,_0x5ae432,_0x48da4b){return db['CmContact'][_0x61dd('0x42')]({'where':{'id':_0x4e8d77['params']['id']}})[_0x61dd('0x21')](handleEntityNotFound(_0x5ae432,null))[_0x61dd('0x21')](function(_0x1e9f01){if(_0x1e9f01){return _0x1e9f01['addContacts'](_0x4e8d77[_0x61dd('0x44')][_0x61dd('0x4d')],_[_0x61dd('0x4e')](_0x4e8d77[_0x61dd('0x44')],[_0x61dd('0x4d'),'id'])||{});}})[_0x61dd('0x21')](respondWithResult(_0x5ae432,null))[_0x61dd('0x3d')](handleError(_0x5ae432,null));};exports[_0x61dd('0x4f')]=function(_0x274331,_0x2197dc,_0x12a187){var _0x109881={};var _0x55e6b2={};var _0x18601c;var _0x3d1c3e;return db[_0x61dd('0x29')][_0x61dd('0x50')]({'where':{'id':_0x274331[_0x61dd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2197dc,null))[_0x61dd('0x21')](function(_0x3491a8){if(_0x3491a8){_0x18601c=_0x3491a8;_0x55e6b2['model']=_[_0x61dd('0x2a')](db['CmContact'][_0x61dd('0x3f')]);_0x55e6b2['query']=_['keys'](_0x274331[_0x61dd('0x2b')]);_0x55e6b2[_0x61dd('0x2c')]=_[_0x61dd('0x2d')](_0x55e6b2[_0x61dd('0x2e')],_0x55e6b2[_0x61dd('0x2b')]);_0x109881[_0x61dd('0x30')]=_[_0x61dd('0x2d')](_0x55e6b2['model'],qs[_0x61dd('0x40')](_0x274331[_0x61dd('0x2b')][_0x61dd('0x40')]));_0x109881[_0x61dd('0x30')]=_0x109881[_0x61dd('0x30')][_0x61dd('0x2f')]?_0x109881[_0x61dd('0x30')]:_0x55e6b2['model'];_0x109881['order']=qs[_0x61dd('0x34')](_0x274331[_0x61dd('0x2b')]['sort']);_0x109881[_0x61dd('0x35')]=qs[_0x61dd('0x2c')](_[_0x61dd('0x36')](_0x274331['query'],_0x55e6b2[_0x61dd('0x2c')]));if(_0x274331[_0x61dd('0x2b')]['filter']){_0x109881[_0x61dd('0x35')]=_[_0x61dd('0x39')](_0x109881[_0x61dd('0x35')],{'$or':_[_0x61dd('0x38')](_0x109881[_0x61dd('0x30')],function(_0x312139){var _0x2cde4d={};_0x2cde4d[_0x312139]={'$like':'%'+_0x274331[_0x61dd('0x2b')]['filter']+'%'};return _0x2cde4d;})});}_0x109881=_[_0x61dd('0x39')]({},_0x109881,_0x274331[_0x61dd('0x3a')]);return _0x18601c[_0x61dd('0x4f')](_0x109881);}})[_0x61dd('0x21')](function(_0x266b94){if(_0x266b94){_0x3d1c3e=_0x266b94[_0x61dd('0x2f')];if(!_0x274331['query'][_0x61dd('0x31')](_0x61dd('0x32'))){_0x109881['limit']=qs[_0x61dd('0x19')](_0x274331[_0x61dd('0x2b')][_0x61dd('0x19')]);_0x109881[_0x61dd('0x17')]=qs[_0x61dd('0x17')](_0x274331[_0x61dd('0x2b')][_0x61dd('0x17')]);}return _0x18601c[_0x61dd('0x4f')](_0x109881);}})['then'](function(_0x39d70e){if(_0x39d70e){return _0x39d70e?{'count':_0x3d1c3e,'rows':_0x39d70e}:null;}})['then'](respondWithResult(_0x2197dc,null))['catch'](handleError(_0x2197dc,null));};
\ No newline at end of file
+var _0xd30c=['hasOwnProperty','order','sort','where','pick','map','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','options','nolimit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x36c20f,_0x591729){var _0x5a84ad=function(_0x22afd6){while(--_0x22afd6){_0x36c20f['push'](_0x36c20f['shift']());}};_0x5a84ad(++_0x591729);}(_0xd30c,0x12b));var _0xcd30=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xd30c[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0xcd30('0x0'));var rimraf=require(_0xcd30('0x1'));var zipdir=require(_0xcd30('0x2'));var jsonpatch=require(_0xcd30('0x3'));var rp=require(_0xcd30('0x4'));var moment=require(_0xcd30('0x5'));var BPromise=require(_0xcd30('0x6'));var Mustache=require(_0xcd30('0x7'));var util=require(_0xcd30('0x8'));var path=require(_0xcd30('0x9'));var sox=require(_0xcd30('0xa'));var csv=require(_0xcd30('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd30('0xc'));var squel=require(_0xcd30('0xd'));var crypto=require(_0xcd30('0xe'));var jsforce=require(_0xcd30('0xf'));var deskjs=require(_0xcd30('0x10'));var toCsv=require(_0xcd30('0xb'));var querystring=require('querystring');var Papa=require(_0xcd30('0x11'));var Redis=require(_0xcd30('0x12'));var authService=require(_0xcd30('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcd30('0x14'));var hardwareService=require(_0xcd30('0x15'));var logger=require('../../config/logger')(_0xcd30('0x16'));var utils=require(_0xcd30('0x17'));var config=require(_0xcd30('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd30('0x19'))['db'];function respondWithStatusCode(_0x53297b,_0x254887){_0x254887=_0x254887||0xcc;return function(_0x433ae3){if(_0x433ae3){return _0x53297b[_0xcd30('0x1a')](_0x254887);}return _0x53297b[_0xcd30('0x1b')](_0x254887)[_0xcd30('0x1c')]();};}function respondWithResult(_0x46043b,_0x479e23){_0x479e23=_0x479e23||0xc8;return function(_0x2a45a7){if(_0x2a45a7){return _0x46043b['status'](_0x479e23)[_0xcd30('0x1d')](_0x2a45a7);}};}function respondWithFilteredResult(_0x382bfe,_0x1851de){return function(_0x5d9930){if(_0x5d9930){var _0x142f4c=typeof _0x1851de['offset']===_0xcd30('0x1e')&&typeof _0x1851de['limit']==='undefined';var _0x50202e=_0x5d9930[_0xcd30('0x1f')];var _0x424a17=_0x142f4c?0x0:_0x1851de[_0xcd30('0x20')];var _0x513ce5=_0x142f4c?_0x5d9930[_0xcd30('0x1f')]:_0x1851de[_0xcd30('0x20')]+_0x1851de[_0xcd30('0x21')];var _0x2d9d92;if(_0x513ce5>=_0x50202e){_0x513ce5=_0x50202e;_0x2d9d92=0xc8;}else{_0x2d9d92=0xce;}_0x382bfe[_0xcd30('0x1b')](_0x2d9d92);return _0x382bfe['set'](_0xcd30('0x22'),_0x424a17+'-'+_0x513ce5+'/'+_0x50202e)[_0xcd30('0x1d')](_0x5d9930);}return null;};}function patchUpdates(_0x55a5dd){return function(_0x1e815a){try{jsonpatch[_0xcd30('0x23')](_0x1e815a,_0x55a5dd,!![]);}catch(_0x3b1c26){return BPromise[_0xcd30('0x24')](_0x3b1c26);}return _0x1e815a['save']();};}function saveUpdates(_0x13328e,_0x5a5106){return function(_0x321f7f){if(_0x321f7f){return _0x321f7f['update'](_0x13328e)[_0xcd30('0x25')](function(_0x19c600){return _0x19c600;});}return null;};}function removeEntity(_0xa42147,_0x359fb5){return function(_0x54f6e6){if(_0x54f6e6){return _0x54f6e6[_0xcd30('0x26')]()[_0xcd30('0x25')](function(){var _0x5eb9d4=_0x54f6e6[_0xcd30('0x27')]({'plain':!![]});var _0x129101=_0xcd30('0x28');return db[_0xcd30('0x29')][_0xcd30('0x26')]({'where':{'type':_0x129101,'resourceId':_0x5eb9d4['id']}})[_0xcd30('0x25')](function(){return _0x54f6e6;});})[_0xcd30('0x25')](function(){_0xa42147['status'](0xcc)[_0xcd30('0x1c')]();});}};}function handleEntityNotFound(_0xb5c846,_0x3e20e5){return function(_0x1c238d){if(!_0x1c238d){_0xb5c846[_0xcd30('0x1a')](0x194);}return _0x1c238d;};}function handleError(_0x14887e,_0x5369e3){_0x5369e3=_0x5369e3||0x1f4;return function(_0x582dee){logger[_0xcd30('0x2a')](_0x582dee[_0xcd30('0x2b')]);if(_0x582dee[_0xcd30('0x2c')]){delete _0x582dee[_0xcd30('0x2c')];}_0x14887e['status'](_0x5369e3)[_0xcd30('0x2d')](_0x582dee);};}exports[_0xcd30('0x2e')]=function(_0x415e74,_0x43c4ef){var _0x32b25e={},_0x122921={},_0x4392d4={'count':0x0,'rows':[]};return db[_0xcd30('0x2f')][_0xcd30('0x30')]()[_0xcd30('0x25')](function(_0x1aebf2){_0x122921[_0xcd30('0x31')]=_['keys'](_0x1aebf2);_0x122921[_0xcd30('0x32')]=_[_0xcd30('0x33')](_0x415e74['query']);_0x122921[_0xcd30('0x34')]=_[_0xcd30('0x35')](_0x122921[_0xcd30('0x31')],_0x122921[_0xcd30('0x32')]);_0x32b25e['attributes']=_[_0xcd30('0x35')](_0x122921[_0xcd30('0x31')],qs[_0xcd30('0x36')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x36')]));_0x32b25e[_0xcd30('0x37')]=_0x32b25e[_0xcd30('0x37')][_0xcd30('0x38')]?_0x32b25e[_0xcd30('0x37')]:_0x122921[_0xcd30('0x31')];if(!_0x415e74[_0xcd30('0x32')][_0xcd30('0x39')]('nolimit')){_0x32b25e['limit']=qs[_0xcd30('0x21')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x21')]);_0x32b25e['offset']=qs[_0xcd30('0x20')](_0x415e74['query'][_0xcd30('0x20')]);}_0x32b25e[_0xcd30('0x3a')]=qs[_0xcd30('0x3b')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x3b')]);_0x32b25e[_0xcd30('0x3c')]=qs[_0xcd30('0x34')](_[_0xcd30('0x3d')](_0x415e74['query'],_0x122921[_0xcd30('0x34')]),_0x1aebf2);if(_0x415e74[_0xcd30('0x32')]['filter']){_0x32b25e[_0xcd30('0x3c')]=_['merge'](_0x32b25e[_0xcd30('0x3c')],{'$or':_[_0xcd30('0x3e')](_0x32b25e[_0xcd30('0x37')],function(_0x21f6c3){var _0x5e152e={};_0x5e152e[_0x21f6c3]={'$like':'%'+_0x415e74[_0xcd30('0x32')][_0xcd30('0x3f')]+'%'};return _0x5e152e;})});}_0x32b25e=_['merge']({},_0x32b25e,_0x415e74['options']);var _0x30e17b={'where':_0x32b25e[_0xcd30('0x3c')]};return db[_0xcd30('0x2f')][_0xcd30('0x1f')](_0x30e17b)[_0xcd30('0x25')](function(_0x126bb6){_0x4392d4['count']=_0x126bb6;if(_0x415e74[_0xcd30('0x32')][_0xcd30('0x40')]){_0x32b25e[_0xcd30('0x41')]=[{'all':!![]}];}return db[_0xcd30('0x2f')][_0xcd30('0x42')](_0x32b25e);})[_0xcd30('0x25')](function(_0x70253){_0x4392d4[_0xcd30('0x43')]=_0x70253;return _0x4392d4;})[_0xcd30('0x25')](respondWithFilteredResult(_0x43c4ef,_0x32b25e))[_0xcd30('0x44')](handleError(_0x43c4ef,null));})[_0xcd30('0x44')](handleError(_0x43c4ef,null));};exports[_0xcd30('0x45')]=function(_0x51baa8,_0x42a2ed){var _0x43a1d3={'raw':![],'where':{'id':_0x51baa8[_0xcd30('0x46')]['id']}},_0x4d596c={};_0x4d596c[_0xcd30('0x31')]=_[_0xcd30('0x33')](db['CmCompany'][_0xcd30('0x47')]);_0x4d596c['query']=_[_0xcd30('0x33')](_0x51baa8[_0xcd30('0x32')]);_0x4d596c[_0xcd30('0x34')]=_['intersection'](_0x4d596c['model'],_0x4d596c[_0xcd30('0x32')]);_0x43a1d3[_0xcd30('0x37')]=_['intersection'](_0x4d596c[_0xcd30('0x31')],qs['fields'](_0x51baa8[_0xcd30('0x32')][_0xcd30('0x36')]));_0x43a1d3[_0xcd30('0x37')]=_0x43a1d3['attributes'][_0xcd30('0x38')]?_0x43a1d3[_0xcd30('0x37')]:_0x4d596c[_0xcd30('0x31')];if(_0x51baa8[_0xcd30('0x32')][_0xcd30('0x40')]){_0x43a1d3[_0xcd30('0x41')]=[{'all':!![]}];}_0x43a1d3=_[_0xcd30('0x48')]({},_0x43a1d3,_0x51baa8['options']);return db[_0xcd30('0x2f')][_0xcd30('0x49')](_0x43a1d3)[_0xcd30('0x25')](handleEntityNotFound(_0x42a2ed,null))[_0xcd30('0x25')](respondWithResult(_0x42a2ed,null))['catch'](handleError(_0x42a2ed,null));};exports[_0xcd30('0x4a')]=function(_0x316ace,_0x26f2f6){return db[_0xcd30('0x2f')]['create'](_0x316ace[_0xcd30('0x4b')],{})['then'](function(_0x12c516){var _0x4cf9f1=_0x316ace[_0xcd30('0x4c')][_0xcd30('0x27')]({'plain':!![]});if(!_0x4cf9f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cf9f1[_0xcd30('0x4d')]===_0xcd30('0x4c')){var _0x2431ba=_0x12c516['get']({'plain':!![]});var _0x3f104f=_0xcd30('0x28');return db[_0xcd30('0x4e')][_0xcd30('0x49')]({'where':{'name':_0x3f104f,'userProfileId':_0x4cf9f1[_0xcd30('0x4f')]},'raw':!![]})[_0xcd30('0x25')](function(_0x172e96){if(_0x172e96&&_0x172e96[_0xcd30('0x50')]===0x0){return db[_0xcd30('0x29')][_0xcd30('0x4a')]({'name':_0x2431ba['name'],'resourceId':_0x2431ba['id'],'type':_0x172e96[_0xcd30('0x2c')],'sectionId':_0x172e96['id']},{})[_0xcd30('0x25')](function(){return _0x12c516;});}else{return _0x12c516;}})[_0xcd30('0x44')](function(_0x24b114){logger[_0xcd30('0x2a')](_0xcd30('0x51'),_0x24b114);throw _0x24b114;});}return _0x12c516;})[_0xcd30('0x25')](respondWithResult(_0x26f2f6,0xc9))[_0xcd30('0x44')](handleError(_0x26f2f6,null));};exports[_0xcd30('0x52')]=function(_0x28696e,_0x4a4c8f){if(_0x28696e[_0xcd30('0x4b')]['id']){delete _0x28696e[_0xcd30('0x4b')]['id'];}return db[_0xcd30('0x2f')][_0xcd30('0x49')]({'where':{'id':_0x28696e[_0xcd30('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a4c8f,null))[_0xcd30('0x25')](saveUpdates(_0x28696e[_0xcd30('0x4b')],null))[_0xcd30('0x25')](respondWithResult(_0x4a4c8f,null))[_0xcd30('0x44')](handleError(_0x4a4c8f,null));};exports[_0xcd30('0x26')]=function(_0x7db9a9,_0x43b8e7){return db['CmCompany'][_0xcd30('0x49')]({'where':{'id':_0x7db9a9[_0xcd30('0x46')]['id']}})[_0xcd30('0x25')](handleEntityNotFound(_0x43b8e7,null))[_0xcd30('0x25')](removeEntity(_0x43b8e7,null))[_0xcd30('0x44')](handleError(_0x43b8e7,null));};exports[_0xcd30('0x30')]=function(_0x20d4f1,_0x936c21){return db[_0xcd30('0x2f')]['describe']()['then'](respondWithResult(_0x936c21,null))['catch'](handleError(_0x936c21,null));};exports['addContacts']=function(_0x4244c2,_0x136b49,_0x193302){return db[_0xcd30('0x53')][_0xcd30('0x49')]({'where':{'id':_0x4244c2['params']['id']}})[_0xcd30('0x25')](handleEntityNotFound(_0x136b49,null))[_0xcd30('0x25')](function(_0x35fa5a){if(_0x35fa5a){return _0x35fa5a[_0xcd30('0x54')](_0x4244c2[_0xcd30('0x4b')]['ids'],_['omit'](_0x4244c2[_0xcd30('0x4b')],[_0xcd30('0x55'),'id'])||{});}})['then'](respondWithResult(_0x136b49,null))[_0xcd30('0x44')](handleError(_0x136b49,null));};exports['getContacts']=function(_0x560e28,_0x2c6d19,_0x234b5b){var _0x41d6d8={};var _0x30d60a={};var _0x5b74ac;var _0x34b4b9;return db['CmCompany']['findOne']({'where':{'id':_0x560e28[_0xcd30('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c6d19,null))['then'](function(_0x557dfd){if(_0x557dfd){_0x5b74ac=_0x557dfd;_0x30d60a[_0xcd30('0x31')]=_[_0xcd30('0x33')](db[_0xcd30('0x53')]['rawAttributes']);_0x30d60a[_0xcd30('0x32')]=_[_0xcd30('0x33')](_0x560e28[_0xcd30('0x32')]);_0x30d60a['filters']=_[_0xcd30('0x35')](_0x30d60a[_0xcd30('0x31')],_0x30d60a[_0xcd30('0x32')]);_0x41d6d8[_0xcd30('0x37')]=_[_0xcd30('0x35')](_0x30d60a[_0xcd30('0x31')],qs['fields'](_0x560e28[_0xcd30('0x32')][_0xcd30('0x36')]));_0x41d6d8[_0xcd30('0x37')]=_0x41d6d8[_0xcd30('0x37')][_0xcd30('0x38')]?_0x41d6d8[_0xcd30('0x37')]:_0x30d60a[_0xcd30('0x31')];_0x41d6d8['order']=qs[_0xcd30('0x3b')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x3b')]);_0x41d6d8[_0xcd30('0x3c')]=qs['filters'](_[_0xcd30('0x3d')](_0x560e28[_0xcd30('0x32')],_0x30d60a['filters']));if(_0x560e28[_0xcd30('0x32')][_0xcd30('0x3f')]){_0x41d6d8['where']=_[_0xcd30('0x48')](_0x41d6d8[_0xcd30('0x3c')],{'$or':_[_0xcd30('0x3e')](_0x41d6d8[_0xcd30('0x37')],function(_0x429f60){var _0x3a540f={};_0x3a540f[_0x429f60]={'$like':'%'+_0x560e28[_0xcd30('0x32')][_0xcd30('0x3f')]+'%'};return _0x3a540f;})});}_0x41d6d8=_[_0xcd30('0x48')]({},_0x41d6d8,_0x560e28[_0xcd30('0x56')]);return _0x5b74ac['getContacts'](_0x41d6d8);}})[_0xcd30('0x25')](function(_0x14b0bd){if(_0x14b0bd){_0x34b4b9=_0x14b0bd[_0xcd30('0x38')];if(!_0x560e28[_0xcd30('0x32')][_0xcd30('0x39')](_0xcd30('0x57'))){_0x41d6d8[_0xcd30('0x21')]=qs[_0xcd30('0x21')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x21')]);_0x41d6d8['offset']=qs[_0xcd30('0x20')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x20')]);}return _0x5b74ac[_0xcd30('0x58')](_0x41d6d8);}})[_0xcd30('0x25')](function(_0x31b2e4){if(_0x31b2e4){return _0x31b2e4?{'count':_0x34b4b9,'rows':_0x31b2e4}:null;}})[_0xcd30('0x25')](respondWithResult(_0x2c6d19,null))[_0xcd30('0x44')](handleError(_0x2c6d19,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e0c46b0..63e1219 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 _0x0282=['./cmCompany.attributes','exports','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x139faf,_0x5df434){var _0x11ef81=function(_0x1ab89f){while(--_0x1ab89f){_0x139faf['push'](_0x139faf['shift']());}};_0x11ef81(++_0x5df434);}(_0x0282,0x71));var _0x2028=function(_0x21d299,_0x4067e7){_0x21d299=_0x21d299-0x0;var _0x33a2ed=_0x0282[_0x21d299];return _0x33a2ed;};'use strict';var _=require(_0x2028('0x0'));var util=require(_0x2028('0x1'));var logger=require(_0x2028('0x2'))(_0x2028('0x3'));var moment=require(_0x2028('0x4'));var BPromise=require(_0x2028('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2028('0x6'));var rimraf=require('rimraf');var config=require(_0x2028('0x7'));var attributes=require(_0x2028('0x8'));module[_0x2028('0x9')]=function(_0x519bf3,_0x41ab62){return _0x519bf3['define']('CmCompany',attributes,{'tableName':_0x2028('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f22=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','CmCompany','lodash'];(function(_0x148bb9,_0x284f06){var _0x4a63ae=function(_0x4410ea){while(--_0x4410ea){_0x148bb9['push'](_0x148bb9['shift']());}};_0x4a63ae(++_0x284f06);}(_0x1f22,0x1c2));var _0x21f2=function(_0x2508b5,_0x2a1623){_0x2508b5=_0x2508b5-0x0;var _0x5513c2=_0x1f22[_0x2508b5];return _0x5513c2;};'use strict';var _=require(_0x21f2('0x0'));var util=require(_0x21f2('0x1'));var logger=require(_0x21f2('0x2'))(_0x21f2('0x3'));var moment=require(_0x21f2('0x4'));var BPromise=require(_0x21f2('0x5'));var rp=require(_0x21f2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x21f2('0x7'));var attributes=require('./cmCompany.attributes');module[_0x21f2('0x8')]=function(_0x1d91d6,_0x1e5721){return _0x1d91d6[_0x21f2('0x9')](_0x21f2('0xa'),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 fc938ee..1ebe682 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 _0x7e61=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result'];(function(_0x4b9d47,_0x1afd37){var _0x3c00cc=function(_0x4d3efe){while(--_0x4d3efe){_0x4b9d47['push'](_0x4b9d47['shift']());}};_0x3c00cc(++_0x1afd37);}(_0x7e61,0x19e));var _0x17e6=function(_0x2d7ba7,_0x3330be){_0x2d7ba7=_0x2d7ba7-0x0;var _0x4cf69a=_0x7e61[_0x2d7ba7];return _0x4cf69a;};'use strict';var _=require(_0x17e6('0x0'));var util=require(_0x17e6('0x1'));var moment=require(_0x17e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x17e6('0x3'));var fs=require('fs');var Redis=require(_0x17e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17e6('0x5'));var logger=require(_0x17e6('0x6'))(_0x17e6('0x7'));var config=require(_0x17e6('0x8'));var jayson=require(_0x17e6('0x9'));var client=jayson[_0x17e6('0xa')][_0x17e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44640f,_0x106572,_0x54f8d0){return new BPromise(function(_0xe82e21,_0x20b080){return client[_0x17e6('0xc')](_0x44640f,_0x54f8d0)[_0x17e6('0xd')](function(_0x3771d9){logger['info']('CmCompany,\x20%s,\x20%s',_0x106572,'request\x20sent');logger['debug'](_0x17e6('0xe'),_0x106572,_0x17e6('0xf'),JSON[_0x17e6('0x10')](_0x3771d9));if(_0x3771d9['error']){if(_0x3771d9[_0x17e6('0x11')][_0x17e6('0x12')]===0x1f4){logger[_0x17e6('0x11')](_0x17e6('0x13'),_0x106572,_0x3771d9['error'][_0x17e6('0x14')]);return _0x20b080(_0x3771d9['error'][_0x17e6('0x14')]);}logger[_0x17e6('0x11')]('CmCompany,\x20%s,\x20%s',_0x106572,_0x3771d9[_0x17e6('0x11')][_0x17e6('0x14')]);return _0xe82e21(_0x3771d9[_0x17e6('0x11')][_0x17e6('0x14')]);}else{logger[_0x17e6('0x15')](_0x17e6('0x13'),_0x106572,_0x17e6('0xf'));_0xe82e21(_0x3771d9[_0x17e6('0x16')][_0x17e6('0x14')]);}})['catch'](function(_0x2b6be0){logger['error'](_0x17e6('0x13'),_0x106572,_0x2b6be0);_0x20b080(_0x2b6be0);});});}
\ No newline at end of file
+var _0x5c06=['then','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x455fee,_0xdb4e0d){var _0x173acf=function(_0x315af3){while(--_0x315af3){_0x455fee['push'](_0x455fee['shift']());}};_0x173acf(++_0xdb4e0d);}(_0x5c06,0x186));var _0x65c0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5c06[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x65c0('0x0'));var util=require(_0x65c0('0x1'));var moment=require(_0x65c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x65c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65c0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x65c0('0x6'));var client=jayson[_0x65c0('0x7')][_0x65c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9ec3d5,_0x2bb547,_0x170f5f){return new BPromise(function(_0x4c3401,_0x1746fc){return client['request'](_0x9ec3d5,_0x170f5f)[_0x65c0('0x9')](function(_0x47ef3f){logger['info']('CmCompany,\x20%s,\x20%s',_0x2bb547,_0x65c0('0xa'));logger['debug'](_0x65c0('0xb'),_0x2bb547,_0x65c0('0xa'),JSON[_0x65c0('0xc')](_0x47ef3f));if(_0x47ef3f[_0x65c0('0xd')]){if(_0x47ef3f['error'][_0x65c0('0xe')]===0x1f4){logger[_0x65c0('0xd')]('CmCompany,\x20%s,\x20%s',_0x2bb547,_0x47ef3f[_0x65c0('0xd')][_0x65c0('0xf')]);return _0x1746fc(_0x47ef3f['error'][_0x65c0('0xf')]);}logger[_0x65c0('0xd')](_0x65c0('0x10'),_0x2bb547,_0x47ef3f[_0x65c0('0xd')][_0x65c0('0xf')]);return _0x4c3401(_0x47ef3f['error'][_0x65c0('0xf')]);}else{logger[_0x65c0('0x11')](_0x65c0('0x10'),_0x2bb547,_0x65c0('0xa'));_0x4c3401(_0x47ef3f[_0x65c0('0x12')][_0x65c0('0xf')]);}})['catch'](function(_0x1b7fb9){logger[_0x65c0('0xd')](_0x65c0('0x10'),_0x2bb547,_0x1b7fb9);_0x1746fc(_0x1b7fb9);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index fb3ee59..bb9873e 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 _0x4aa6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x34de7a,_0x57d22c){var _0xd1c14=function(_0x20c909){while(--_0x20c909){_0x34de7a['push'](_0x34de7a['shift']());}};_0xd1c14(++_0x57d22c);}(_0x4aa6,0x1f0));var _0x64aa=function(_0x35eddc,_0x567c9e){_0x35eddc=_0x35eddc-0x0;var _0x41c4ae=_0x4aa6[_0x35eddc];return _0x41c4ae;};'use strict';var multer=require(_0x64aa('0x0'));var util=require(_0x64aa('0x1'));var path=require('path');var timeout=require(_0x64aa('0x2'));var express=require('express');var router=express[_0x64aa('0x3')]();var fs_extra=require(_0x64aa('0x4'));var auth=require(_0x64aa('0x5'));var interaction=require(_0x64aa('0x6'));var config=require(_0x64aa('0x7'));var controller=require(_0x64aa('0x8'));router[_0x64aa('0x9')]('/',auth[_0x64aa('0xa')](),controller[_0x64aa('0xb')]);router[_0x64aa('0x9')](_0x64aa('0xc'),auth['isAuthenticated'](),controller[_0x64aa('0xd')]);router['get'](_0x64aa('0xe'),auth[_0x64aa('0xa')](),controller[_0x64aa('0xf')]);router[_0x64aa('0x9')](_0x64aa('0x10'),auth[_0x64aa('0xa')](),controller[_0x64aa('0x11')]);router[_0x64aa('0x12')]('/',auth[_0x64aa('0xa')](),controller[_0x64aa('0x13')]);router[_0x64aa('0x12')](_0x64aa('0x10'),auth['isAuthenticated'](),controller[_0x64aa('0x14')]);router[_0x64aa('0x15')](_0x64aa('0xe'),auth['isAuthenticated'](),controller[_0x64aa('0x16')]);router[_0x64aa('0x17')]('/:id',auth[_0x64aa('0xa')](),controller['destroy']);module[_0x64aa('0x18')]=router;
\ No newline at end of file
+var _0xbe42=['getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts'];(function(_0x2877ad,_0x33a482){var _0x33f359=function(_0x1da939){while(--_0x1da939){_0x2877ad['push'](_0x2877ad['shift']());}};_0x33f359(++_0x33a482);}(_0xbe42,0x141));var _0x2be4=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0xbe42[_0x367336];return _0x3423a7;};'use strict';var multer=require(_0x2be4('0x0'));var util=require('util');var path=require(_0x2be4('0x1'));var timeout=require(_0x2be4('0x2'));var express=require(_0x2be4('0x3'));var router=express[_0x2be4('0x4')]();var fs_extra=require(_0x2be4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2be4('0x6'));var controller=require(_0x2be4('0x7'));router[_0x2be4('0x8')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0xa')]);router[_0x2be4('0x8')](_0x2be4('0xb'),auth[_0x2be4('0x9')](),controller[_0x2be4('0xc')]);router[_0x2be4('0x8')](_0x2be4('0xd'),auth[_0x2be4('0x9')](),controller['show']);router['get'](_0x2be4('0xe'),auth['isAuthenticated'](),controller[_0x2be4('0xf')]);router[_0x2be4('0x10')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0x11')]);router[_0x2be4('0x10')](_0x2be4('0xe'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x12')]);router[_0x2be4('0x13')]('/:id',auth[_0x2be4('0x9')](),controller[_0x2be4('0x14')]);router[_0x2be4('0x15')](_0x2be4('0xd'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x16')]);module[_0x2be4('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c800736..fb89265 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 _0x7771=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1a7b8b,_0xe53a61){var _0x4e55f4=function(_0x22c00b){while(--_0x22c00b){_0x1a7b8b['push'](_0x1a7b8b['shift']());}};_0x4e55f4(++_0xe53a61);}(_0x7771,0x69));var _0x1777=function(_0x44cd28,_0x1502d9){_0x44cd28=_0x44cd28-0x0;var _0x39356e=_0x7771[_0x44cd28];return _0x39356e;};'use strict';var _=require('lodash');var Sequelize=require(_0x1777('0x0'));module[_0x1777('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x1777('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1777('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1777('0x2')]},'mobile':{'type':Sequelize[_0x1777('0x2')]},'fax':{'type':Sequelize[_0x1777('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x1777('0x2')]},'facebook':{'type':Sequelize[_0x1777('0x2')]},'fb_data':{'type':Sequelize[_0x1777('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x1777('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1777('0x2')]},'line':{'type':Sequelize[_0x1777('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1777('0x3')]},'priority':{'type':Sequelize[_0x1777('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1777('0x4')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x3aa5=['UNSIGNED','lodash','exports','STRING','INTEGER'];(function(_0x448ed3,_0x12fa53){var _0x3b4a07=function(_0x3279d0){while(--_0x3279d0){_0x448ed3['push'](_0x448ed3['shift']());}};_0x3b4a07(++_0x12fa53);}(_0x3aa5,0xc4));var _0x53aa=function(_0x396d43,_0x994f3a){_0x396d43=_0x396d43-0x0;var _0x58c668=_0x3aa5[_0x396d43];return _0x58c668;};'use strict';var _=require(_0x53aa('0x0'));var Sequelize=require('sequelize');module[_0x53aa('0x1')]={'firstName':{'type':Sequelize[_0x53aa('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x53aa('0x2')]},'street':{'type':Sequelize[_0x53aa('0x2')]},'postalCode':{'type':Sequelize[_0x53aa('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x53aa('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x53aa('0x2')]},'mobile':{'type':Sequelize[_0x53aa('0x2')]},'fax':{'type':Sequelize[_0x53aa('0x2')]},'email':{'type':Sequelize[_0x53aa('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x53aa('0x2')]},'fb_data':{'type':Sequelize[_0x53aa('0x2')]},'twitter':{'type':Sequelize[_0x53aa('0x2')]},'skype':{'type':Sequelize[_0x53aa('0x2')]},'teams':{'type':Sequelize[_0x53aa('0x2')]},'viber':{'type':Sequelize[_0x53aa('0x2')]},'line':{'type':Sequelize[_0x53aa('0x2')]},'wechat':{'type':Sequelize[_0x53aa('0x2')]},'telegram':{'type':Sequelize[_0x53aa('0x2')]},'UserId':{'type':Sequelize[_0x53aa('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x53aa('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a6bb277..9a2c1a3 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 _0x86c9=['body','get','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','findOrCreate','spread','show','Tags','omit','cf_%d','pickBy','table','setFields','toParam','phone','getTags','findOne','rawAttributes','options','setTags','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','JscriptySessionReport','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','exit','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','callerid','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','startCase','Website','Account','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','threadId','Interaction','flatten','sortBy','reverse','slice','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./cmContact.socket','register','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','CmContact','describe','keys','length','startsWith','push','CmCustomField','trimStart','cf_','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','split','map','union','User','dateOfBirth','datetime','DATE','buildExpression','type','text','start','isNil','Contact','isEmpty','forEach','ListId','where','concat','\x20=\x20?','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','user','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','agent','sequelize','toString','keyBy','merge','c.phone','c.mobile','c.fax','c.email','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','params','catch','columnName','displayName','findAll','custom','values'];(function(_0x533ef1,_0x4c37a6){var _0x555ec3=function(_0x359369){while(--_0x359369){_0x533ef1['push'](_0x533ef1['shift']());}};_0x555ec3(++_0x4c37a6);}(_0x86c9,0x89));var _0x986c=function(_0x255737,_0x15e582){_0x255737=_0x255737-0x0;var _0x43b248=_0x86c9[_0x255737];return _0x43b248;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x986c('0x0'));var jsonpatch=require(_0x986c('0x1'));var rp=require(_0x986c('0x2'));var moment=require(_0x986c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x986c('0x4'));var util=require(_0x986c('0x5'));var path=require(_0x986c('0x6'));var sox=require(_0x986c('0x7'));var csv=require(_0x986c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x986c('0x9'));var _=require(_0x986c('0xa'));var squel=require(_0x986c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x986c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x986c('0xd'));var Papa=require(_0x986c('0xe'));var Redis=require('ioredis');var authService=require(_0x986c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x986c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x986c('0x11'))(_0x986c('0x12'));var utils=require(_0x986c('0x13'));var config=require(_0x986c('0x14'));var licenseUtil=require(_0x986c('0x15'));var db=require(_0x986c('0x16'))['db'];config['redis']=_[_0x986c('0x17')](config[_0x986c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x986c('0x19'))(new Redis(config[_0x986c('0x18')]));require(_0x986c('0x1a'))[_0x986c('0x1b')](socket);function respondWithStatusCode(_0x2c8c12,_0x5eba0c){_0x5eba0c=_0x5eba0c||0xcc;return function(_0x25fdd5){if(_0x25fdd5){return _0x2c8c12['sendStatus'](_0x5eba0c);}return _0x2c8c12[_0x986c('0x1c')](_0x5eba0c)[_0x986c('0x1d')]();};}function respondWithResult(_0xe5174e,_0x5c8eca){_0x5c8eca=_0x5c8eca||0xc8;return function(_0x1c1a2d){if(_0x1c1a2d){return _0xe5174e[_0x986c('0x1c')](_0x5c8eca)[_0x986c('0x1e')](_0x1c1a2d);}};}function respondWithFilteredResult(_0x58306f,_0x2db3f1){return function(_0x51d4f6){if(_0x51d4f6){var _0x2216a4=typeof _0x2db3f1[_0x986c('0x1f')]==='undefined'&&typeof _0x2db3f1[_0x986c('0x20')]===_0x986c('0x21');var _0x3e2e69=_0x51d4f6[_0x986c('0x22')];var _0x4a6fc4=_0x2216a4?0x0:_0x2db3f1['offset'];var _0x535dfd=_0x2216a4?_0x51d4f6[_0x986c('0x22')]:_0x2db3f1[_0x986c('0x1f')]+_0x2db3f1[_0x986c('0x20')];var _0x5b25f6;if(_0x535dfd>=_0x3e2e69){_0x535dfd=_0x3e2e69;_0x5b25f6=0xc8;}else{_0x5b25f6=0xce;}_0x58306f[_0x986c('0x1c')](_0x5b25f6);return _0x58306f[_0x986c('0x23')]('Content-Range',_0x4a6fc4+'-'+_0x535dfd+'/'+_0x3e2e69)[_0x986c('0x1e')](_0x51d4f6);}return null;};}function patchUpdates(_0x14a845){return function(_0x3d8d5e){try{jsonpatch[_0x986c('0x24')](_0x3d8d5e,_0x14a845,!![]);}catch(_0x3c1981){return BPromise[_0x986c('0x25')](_0x3c1981);}return _0x3d8d5e[_0x986c('0x26')]();};}function saveUpdates(_0xb09e9e,_0xec3f2c){return function(_0x49228f){if(_0x49228f){return _0x49228f[_0x986c('0x27')](_0xb09e9e)['then'](function(_0x5b912c){return _0x5b912c;});}return null;};}function removeEntity(_0x2d2d04,_0x493054){return function(_0x4a3dda){if(_0x4a3dda){return _0x4a3dda[_0x986c('0x28')]()[_0x986c('0x29')](function(){_0x2d2d04[_0x986c('0x1c')](0xcc)[_0x986c('0x1d')]();});}};}function handleEntityNotFound(_0x3992e4,_0xd14cb0){return function(_0x375b91){if(!_0x375b91){_0x3992e4[_0x986c('0x2a')](0x194);}return _0x375b91;};}function handleError(_0x40de21,_0x46fe5b){_0x46fe5b=_0x46fe5b||0x1f4;return function(_0x57ab75){logger[_0x986c('0x2b')](_0x57ab75['stack']);if(_0x57ab75[_0x986c('0x2c')]){delete _0x57ab75[_0x986c('0x2c')];}_0x40de21[_0x986c('0x1c')](_0x46fe5b)[_0x986c('0x2d')](_0x57ab75);};}exports[_0x986c('0x2e')]=function(_0x14224b,_0x101e1e){var _0x1585cb={},_0x1fe380={},_0x40c113={'count':0x0,'rows':[]};return db[_0x986c('0x2f')][_0x986c('0x30')]()[_0x986c('0x29')](function(_0x264973){var _0x3467d7=[];for(var _0x4e6ca7=0x0;_0x4e6ca7
','Attachments'];(function(_0x41f7b5,_0x19a56d){var _0x225fa3=function(_0xe74b8f){while(--_0xe74b8f){_0x41f7b5['push'](_0x41f7b5['shift']());}};_0x225fa3(++_0x19a56d);}(_0x6a55,0xdb));var _0x56a5=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0x6a55[_0x61bb05];return _0x3ceb3e;};'use strict';var _=require(_0x56a5('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x56a5('0x1'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x56a5('0x2'));var config=require('../../../config/environment');function getAddress(_0x3ff76a){var _0x5171fa=_[_0x56a5('0x3')](_0x3ff76a[_0x56a5('0x4')]);return _0x5171fa&&_0x5171fa[_0x56a5('0x5')]?_0x5171fa[_0x56a5('0x5')]:_0x56a5('0x6')+random[_0x56a5('0x7')](0x6)+_0x56a5('0x8');}function getFirstName(_0x387dcb){var _0x586f7a=_[_0x56a5('0x3')](_0x387dcb[_0x56a5('0x4')]);if(_0x586f7a&&_0x586f7a[_0x56a5('0x9')]){if(_0x586f7a[_0x56a5('0x9')]==_0x586f7a[_0x56a5('0x5')]){return _0x586f7a[_0x56a5('0x9')][_0x56a5('0xa')](0x0,_0x586f7a[_0x56a5('0x9')][_0x56a5('0xb')]('@'));}var _0x4cd7c4=_0x586f7a['name'][_0x56a5('0xc')](/\s+/);return _0x4cd7c4[_0x56a5('0xd')]>0x1?_0x4cd7c4[_0x56a5('0xe')](0x0,-0x1)[_0x56a5('0xf')]('\x20'):_0x586f7a[_0x56a5('0x9')];}return _0x56a5('0x10');}function getLastName(_0x4db11b){var _0x4a6dc5=_[_0x56a5('0x3')](_0x4db11b[_0x56a5('0x4')]);if(_0x4a6dc5&&_0x4a6dc5[_0x56a5('0x9')]){var _0x1d7aac=_0x4a6dc5[_0x56a5('0x9')][_0x56a5('0xc')](/\s+/);return _0x1d7aac[_0x56a5('0xd')]>0x1?_0x1d7aac['pop']():'';}return'';}function getMails(_0x360297,_0x5488c6){var _0x41e8b6='';for(var _0x51d031=0x0;_0x51d031<_0x5488c6[_0x56a5('0x4')][_0x56a5('0xd')];_0x51d031+=0x1){if(_0x5488c6[_0x56a5('0x4')][_0x51d031][_0x56a5('0x5')]!==_0x360297){if(!_[_0x56a5('0x11')](_0x41e8b6)){_0x41e8b6+=',';}_0x41e8b6+=_0x5488c6[_0x56a5('0x4')][_0x51d031][_0x56a5('0x9')]||_0x5488c6['value'][_0x51d031][_0x56a5('0x5')]||'';_0x41e8b6+='\x20<';_0x41e8b6+=_0x5488c6[_0x56a5('0x4')][_0x51d031][_0x56a5('0x5')]?_0x5488c6[_0x56a5('0x4')][_0x51d031]['address']:_0x56a5('0x6')+random[_0x56a5('0x7')](0x6)+_0x56a5('0x8');_0x41e8b6+='>';}}return _0x41e8b6;}function parseEmail(_0x15e469,_0x155d3b,_0x529711){if(_0x155d3b['html']){var _0x29f181=/