From: Andrea Amorese
Date: Tue, 14 Sep 2021 08:56:18 +0000 (+0200)
Subject: Built motion from commit c4823e9f.|2.5.345
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=11c1f79a8b52d5ba0a0ed5a1bd78f84ee6537dd3;p=motion2.git
Built motion from commit c4823e9f.|2.5.345
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f5497cb..174aec6 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-14T08:20:49.875Z",
+ "time": "2021-09-14T08:43:48.915Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 8c91f7f..aca68c0 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-14T08:20:49.875Z",
+ "time": "2021-09-14T08:43:48.915Z",
"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 f5b511a..bc97cc6 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 _0x9fd4=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x1e0327,_0x3797c2){var _0x337c9f=function(_0x5f2f3a){while(--_0x5f2f3a){_0x1e0327['push'](_0x1e0327['shift']());}};_0x337c9f(++_0x3797c2);}(_0x9fd4,0x16c));var _0x49fd=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x9fd4[_0x3a3c17];return _0xd07f21;};'use strict';var Sequelize=require(_0x49fd('0x0'));module[_0x49fd('0x1')]={'name':{'type':Sequelize[_0x49fd('0x2')],'get':function(_0x30771e){return this[_0x49fd('0x3')](_0x49fd('0x4'));}},'action':{'type':Sequelize[_0x49fd('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x49fd('0x6'),_0x49fd('0x7'),'motionbar','jscripty',_0x49fd('0x8'),_0x49fd('0x9'),_0x49fd('0xa'),_0x49fd('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x49fd('0xc')},'data1':{'type':Sequelize[_0x49fd('0x5')](0x1000),'comment':_0x49fd('0xd')},'data2':{'type':Sequelize[_0x49fd('0x5')](0x1000),'comment':_0x49fd('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x49fd('0xf')},'data4':{'type':Sequelize[_0x49fd('0x5')](0x1000),'comments':_0x49fd('0x10')},'data5':{'type':Sequelize[_0x49fd('0x5')](0x1000),'comments':_0x49fd('0x11')},'data6':{'type':Sequelize[_0x49fd('0x5')],'comments':_0x49fd('0x12')},'data7':{'type':Sequelize['TEXT'],'comments':_0x49fd('0x13')}};
\ No newline at end of file
+var _0x6eed=['exports','VIRTUAL','getDataValue','STRING','contactManager','jscripty','urlForward','browser','bot','script','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]','TEXT','urlForward[body]','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6eed,0xff));var _0xd6ee=function(_0x3f761d,_0x5d907d){_0x3f761d=_0x3f761d-0x0;var _0x49d6e3=_0x6eed[_0x3f761d];return _0x49d6e3;};'use strict';var Sequelize=require(_0xd6ee('0x0'));module[_0xd6ee('0x1')]={'name':{'type':Sequelize[_0xd6ee('0x2')],'get':function(_0x27b7bf){return this[_0xd6ee('0x3')]('action');}},'action':{'type':Sequelize[_0xd6ee('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd6ee('0x5'),'integration','motionbar',_0xd6ee('0x6'),_0xd6ee('0x7'),_0xd6ee('0x8'),_0xd6ee('0x9'),_0xd6ee('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xd6ee('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['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[_0xd6ee('0x4')](0x1000),'comment':_0xd6ee('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xd6ee('0xc')},'data5':{'type':Sequelize[_0xd6ee('0x4')](0x1000),'comments':_0xd6ee('0xd')},'data6':{'type':Sequelize[_0xd6ee('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xd6ee('0xe')],'comments':_0xd6ee('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index fff7885..717a0d3 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 _0x140e=['params','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','name','send','update','Action','find','body','catch'];(function(_0x18b7eb,_0x19e89d){var _0x525d5e=function(_0x4b9e34){while(--_0x4b9e34){_0x18b7eb['push'](_0x18b7eb['shift']());}};_0x525d5e(++_0x19e89d);}(_0x140e,0x1e1));var _0xe140=function(_0x46b83c,_0x1fc79c){_0x46b83c=_0x46b83c-0x0;var _0x25eb27=_0x140e[_0x46b83c];return _0x25eb27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe140('0x0'));var zipdir=require(_0xe140('0x1'));var jsonpatch=require(_0xe140('0x2'));var rp=require(_0xe140('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe140('0x4'));var path=require('path');var sox=require(_0xe140('0x5'));var csv=require(_0xe140('0x6'));var ejs=require(_0xe140('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe140('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xe140('0x9'));var toCsv=require(_0xe140('0x6'));var querystring=require(_0xe140('0xa'));var Papa=require(_0xe140('0xb'));var Redis=require('ioredis');var authService=require(_0xe140('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xe140('0xd'));var hardwareService=require(_0xe140('0xe'));var logger=require(_0xe140('0xf'))(_0xe140('0x10'));var utils=require('../../config/utils');var config=require(_0xe140('0x11'));var licenseUtil=require(_0xe140('0x12'));var db=require(_0xe140('0x13'))['db'];function respondWithStatusCode(_0x3a5109,_0x442928){_0x442928=_0x442928||0xcc;return function(_0x5022a3){if(_0x5022a3){return _0x3a5109[_0xe140('0x14')](_0x442928);}return _0x3a5109[_0xe140('0x15')](_0x442928)[_0xe140('0x16')]();};}function respondWithResult(_0x1b9d67,_0xa72b47){_0xa72b47=_0xa72b47||0xc8;return function(_0x580915){if(_0x580915){return _0x1b9d67[_0xe140('0x15')](_0xa72b47)[_0xe140('0x17')](_0x580915);}};}function respondWithFilteredResult(_0x223e84,_0x3e2f10){return function(_0x591089){if(_0x591089){var _0x34884e=typeof _0x3e2f10[_0xe140('0x18')]===_0xe140('0x19')&&typeof _0x3e2f10['limit']===_0xe140('0x19');var _0x33325b=_0x591089['count'];var _0x4877ca=_0x34884e?0x0:_0x3e2f10[_0xe140('0x18')];var _0x36d84f=_0x34884e?_0x591089[_0xe140('0x1a')]:_0x3e2f10[_0xe140('0x18')]+_0x3e2f10['limit'];var _0x2263a6;if(_0x36d84f>=_0x33325b){_0x36d84f=_0x33325b;_0x2263a6=0xc8;}else{_0x2263a6=0xce;}_0x223e84[_0xe140('0x15')](_0x2263a6);return _0x223e84[_0xe140('0x1b')](_0xe140('0x1c'),_0x4877ca+'-'+_0x36d84f+'/'+_0x33325b)[_0xe140('0x17')](_0x591089);}return null;};}function patchUpdates(_0x360e36){return function(_0x3f5fcd){try{jsonpatch[_0xe140('0x1d')](_0x3f5fcd,_0x360e36,!![]);}catch(_0x5effc6){return BPromise[_0xe140('0x1e')](_0x5effc6);}return _0x3f5fcd['save']();};}function saveUpdates(_0x20bcbe,_0x487b97){return function(_0x22ab16){if(_0x22ab16){return _0x22ab16['update'](_0x20bcbe)[_0xe140('0x1f')](function(_0x51add5){return _0x51add5;});}return null;};}function removeEntity(_0x3fc7c5,_0x1831e6){return function(_0x209825){if(_0x209825){return _0x209825['destroy']()[_0xe140('0x1f')](function(){_0x3fc7c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcd677,_0x91c7c6){return function(_0x4f1248){if(!_0x4f1248){_0xcd677['sendStatus'](0x194);}return _0x4f1248;};}function handleError(_0x22522c,_0x1f27b9){_0x1f27b9=_0x1f27b9||0x1f4;return function(_0x1006a2){logger['error'](_0x1006a2['stack']);if(_0x1006a2[_0xe140('0x20')]){delete _0x1006a2[_0xe140('0x20')];}_0x22522c[_0xe140('0x15')](_0x1f27b9)[_0xe140('0x21')](_0x1006a2);};}exports[_0xe140('0x22')]=function(_0x4e8350,_0x326a91){if(_0x4e8350['body']['id']){delete _0x4e8350['body']['id'];}return db[_0xe140('0x23')][_0xe140('0x24')]({'where':{'id':_0x4e8350['params']['id']}})[_0xe140('0x1f')](handleEntityNotFound(_0x326a91,null))['then'](saveUpdates(_0x4e8350[_0xe140('0x25')],null))[_0xe140('0x1f')](respondWithResult(_0x326a91,null))[_0xe140('0x26')](handleError(_0x326a91,null));};exports['destroy']=function(_0x1ec8d4,_0x38f37e){return db[_0xe140('0x23')][_0xe140('0x24')]({'where':{'id':_0x1ec8d4[_0xe140('0x27')]['id']}})['then'](handleEntityNotFound(_0x38f37e,null))['then'](removeEntity(_0x38f37e,null))[_0xe140('0x26')](handleError(_0x38f37e,null));};
\ No newline at end of file
+var _0xc08e=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','find','Action','params','catch','eml-format','rimraf','request-promise'];(function(_0x27d8e2,_0x3808e6){var _0x1a980b=function(_0x23ece1){while(--_0x23ece1){_0x27d8e2['push'](_0x27d8e2['shift']());}};_0x1a980b(++_0x3808e6);}(_0xc08e,0xbd));var _0xec08=function(_0x5cb5b1,_0xafc0d6){_0x5cb5b1=_0x5cb5b1-0x0;var _0x22d423=_0xc08e[_0x5cb5b1];return _0x22d423;};'use strict';var emlformat=require(_0xec08('0x0'));var rimraf=require(_0xec08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xec08('0x2'));var moment=require(_0xec08('0x3'));var BPromise=require(_0xec08('0x4'));var Mustache=require(_0xec08('0x5'));var util=require('util');var path=require(_0xec08('0x6'));var sox=require(_0xec08('0x7'));var csv=require(_0xec08('0x8'));var ejs=require(_0xec08('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec08('0xa'));var squel=require(_0xec08('0xb'));var crypto=require(_0xec08('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xec08('0xd'));var toCsv=require(_0xec08('0x8'));var querystring=require(_0xec08('0xe'));var Papa=require(_0xec08('0xf'));var Redis=require(_0xec08('0x10'));var authService=require(_0xec08('0x11'));var qs=require(_0xec08('0x12'));var as=require(_0xec08('0x13'));var hardwareService=require(_0xec08('0x14'));var logger=require(_0xec08('0x15'))(_0xec08('0x16'));var utils=require(_0xec08('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xec08('0x18'))['db'];function respondWithStatusCode(_0x3ae005,_0x1c74a7){_0x1c74a7=_0x1c74a7||0xcc;return function(_0x1a380f){if(_0x1a380f){return _0x3ae005['sendStatus'](_0x1c74a7);}return _0x3ae005['status'](_0x1c74a7)[_0xec08('0x19')]();};}function respondWithResult(_0x472b1e,_0x548772){_0x548772=_0x548772||0xc8;return function(_0xef5838){if(_0xef5838){return _0x472b1e[_0xec08('0x1a')](_0x548772)[_0xec08('0x1b')](_0xef5838);}};}function respondWithFilteredResult(_0x318bef,_0x50bd7f){return function(_0x51b028){if(_0x51b028){var _0x35145c=typeof _0x50bd7f['offset']===_0xec08('0x1c')&&typeof _0x50bd7f['limit']===_0xec08('0x1c');var _0x3a3bf1=_0x51b028[_0xec08('0x1d')];var _0x329e63=_0x35145c?0x0:_0x50bd7f[_0xec08('0x1e')];var _0x122164=_0x35145c?_0x51b028[_0xec08('0x1d')]:_0x50bd7f['offset']+_0x50bd7f['limit'];var _0x5b4108;if(_0x122164>=_0x3a3bf1){_0x122164=_0x3a3bf1;_0x5b4108=0xc8;}else{_0x5b4108=0xce;}_0x318bef[_0xec08('0x1a')](_0x5b4108);return _0x318bef['set'](_0xec08('0x1f'),_0x329e63+'-'+_0x122164+'/'+_0x3a3bf1)[_0xec08('0x1b')](_0x51b028);}return null;};}function patchUpdates(_0x50ee24){return function(_0x3588d4){try{jsonpatch[_0xec08('0x20')](_0x3588d4,_0x50ee24,!![]);}catch(_0x33aa95){return BPromise[_0xec08('0x21')](_0x33aa95);}return _0x3588d4[_0xec08('0x22')]();};}function saveUpdates(_0x3fc93d,_0x3a21f2){return function(_0x1df01d){if(_0x1df01d){return _0x1df01d[_0xec08('0x23')](_0x3fc93d)['then'](function(_0xeeff9e){return _0xeeff9e;});}return null;};}function removeEntity(_0x4b4fe6,_0x9e725c){return function(_0x23e20a){if(_0x23e20a){return _0x23e20a[_0xec08('0x24')]()[_0xec08('0x25')](function(){_0x4b4fe6[_0xec08('0x1a')](0xcc)[_0xec08('0x19')]();});}};}function handleEntityNotFound(_0xf45bfa,_0x3ab65d){return function(_0x57b5f3){if(!_0x57b5f3){_0xf45bfa[_0xec08('0x26')](0x194);}return _0x57b5f3;};}function handleError(_0x82d292,_0x4913d4){_0x4913d4=_0x4913d4||0x1f4;return function(_0x377769){logger[_0xec08('0x27')](_0x377769[_0xec08('0x28')]);if(_0x377769[_0xec08('0x29')]){delete _0x377769[_0xec08('0x29')];}_0x82d292['status'](_0x4913d4)[_0xec08('0x2a')](_0x377769);};}exports[_0xec08('0x23')]=function(_0x311d33,_0x216c97){if(_0x311d33[_0xec08('0x2b')]['id']){delete _0x311d33[_0xec08('0x2b')]['id'];}return db['Action'][_0xec08('0x2c')]({'where':{'id':_0x311d33['params']['id']}})[_0xec08('0x25')](handleEntityNotFound(_0x216c97,null))[_0xec08('0x25')](saveUpdates(_0x311d33['body'],null))[_0xec08('0x25')](respondWithResult(_0x216c97,null))['catch'](handleError(_0x216c97,null));};exports[_0xec08('0x24')]=function(_0x39d7e1,_0x5dded5){return db[_0xec08('0x2d')][_0xec08('0x2c')]({'where':{'id':_0x39d7e1[_0xec08('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5dded5,null))[_0xec08('0x25')](removeEntity(_0x5dded5,null))[_0xec08('0x2f')](handleError(_0x5dded5,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 905b070..54af11e 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 _0x899d=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','Action','tools_actions','lodash','util'];(function(_0x5e6d6a,_0x2ab8cf){var _0x3df9f7=function(_0x7c55d){while(--_0x7c55d){_0x5e6d6a['push'](_0x5e6d6a['shift']());}};_0x3df9f7(++_0x2ab8cf);}(_0x899d,0xca));var _0xd899=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x899d[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xd899('0x0'));var util=require(_0xd899('0x1'));var logger=require(_0xd899('0x2'))(_0xd899('0x3'));var moment=require('moment');var BPromise=require(_0xd899('0x4'));var rp=require(_0xd899('0x5'));var fs=require('fs');var path=require(_0xd899('0x6'));var rimraf=require(_0xd899('0x7'));var config=require(_0xd899('0x8'));var attributes=require('./action.attributes');module['exports']=function(_0x10f463,_0x1864a3){return _0x10f463[_0xd899('0x9')](_0xd899('0xa'),attributes,{'tableName':_0xd899('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x844d=['bluebird','request-promise','../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger','api','moment'];(function(_0x2bf6be,_0x5b23f1){var _0x532ef4=function(_0x3760df){while(--_0x3760df){_0x2bf6be['push'](_0x2bf6be['shift']());}};_0x532ef4(++_0x5b23f1);}(_0x844d,0xaf));var _0xd844=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x844d[_0x2f227c];return _0x5032bc;};'use strict';var _=require(_0xd844('0x0'));var util=require(_0xd844('0x1'));var logger=require(_0xd844('0x2'))(_0xd844('0x3'));var moment=require(_0xd844('0x4'));var BPromise=require(_0xd844('0x5'));var rp=require(_0xd844('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd844('0x7'));var attributes=require(_0xd844('0x8'));module[_0xd844('0x9')]=function(_0x4f8fa6,_0x32a58c){return _0x4f8fa6[_0xd844('0xa')](_0xd844('0xb'),attributes,{'tableName':'tools_actions','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 06567d5..9e78df1 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x814b,0x1a2));var _0xb814=function(_0x21e79a,_0x5a7990){_0x21e79a=_0x21e79a-0x0;var _0x506c02=_0x814b[_0x21e79a];return _0x506c02;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x3b7bbb,_0x3a8e31){var _0x994331=function(_0x19539c){while(--_0x19539c){_0x3b7bbb['push'](_0x3b7bbb['shift']());}};_0x994331(++_0x3a8e31);}(_0xe14b,0x93));var _0xbe14=function(_0x26e2f5,_0x2012f7){_0x26e2f5=_0x26e2f5-0x0;var _0x1a3917=_0xe14b[_0x26e2f5];return _0x1a3917;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 8cee48a..55bf83b 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 _0xdc16=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./action.controller','put','/:id','delete','destroy','exports'];(function(_0x15b1ec,_0x15ee62){var _0x33320c=function(_0x26e74d){while(--_0x26e74d){_0x15b1ec['push'](_0x15b1ec['shift']());}};_0x33320c(++_0x15ee62);}(_0xdc16,0x9c));var _0x6dc1=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0xdc16[_0x4e697a];return _0x88850c;};'use strict';var multer=require(_0x6dc1('0x0'));var util=require(_0x6dc1('0x1'));var path=require(_0x6dc1('0x2'));var timeout=require(_0x6dc1('0x3'));var express=require(_0x6dc1('0x4'));var router=express['Router']();var fs_extra=require(_0x6dc1('0x5'));var auth=require(_0x6dc1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6dc1('0x7'));router[_0x6dc1('0x8')](_0x6dc1('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x6dc1('0xa')](_0x6dc1('0x9'),auth['isAuthenticated'](),controller[_0x6dc1('0xb')]);module[_0x6dc1('0xc')]=router;
\ No newline at end of file
+var _0xde41=['destroy','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated'];(function(_0xad08b3,_0x2a3003){var _0xb6c9b6=function(_0x57e379){while(--_0x57e379){_0xad08b3['push'](_0xad08b3['shift']());}};_0xb6c9b6(++_0x2a3003);}(_0xde41,0x187));var _0x1de4=function(_0x5cd173,_0x42b6c8){_0x5cd173=_0x5cd173-0x0;var _0x170e48=_0xde41[_0x5cd173];return _0x170e48;};'use strict';var multer=require(_0x1de4('0x0'));var util=require('util');var path=require(_0x1de4('0x1'));var timeout=require(_0x1de4('0x2'));var express=require(_0x1de4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1de4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1de4('0x5'));var controller=require(_0x1de4('0x6'));router[_0x1de4('0x7')](_0x1de4('0x8'),auth['isAuthenticated'](),controller[_0x1de4('0x9')]);router[_0x1de4('0xa')]('/:id',auth[_0x1de4('0xb')](),controller[_0x1de4('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index b2dfed1..c4134e9 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x74dd89,_0x8524a6){var _0x719ece=function(_0x50abf9){while(--_0x50abf9){_0x74dd89['push'](_0x74dd89['shift']());}};_0x719ece(++_0x8524a6);}(_0xac9d,0x14d));var _0xdac9=function(_0x4c6bca,_0x3de390){_0x4c6bca=_0x4c6bca-0x0;var _0x29d58e=_0xac9d[_0x4c6bca];return _0x29d58e;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
+var _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x496709,_0x572736){var _0x56ddc3=function(_0x1eba61){while(--_0x1eba61){_0x496709['push'](_0x496709['shift']());}};_0x56ddc3(++_0x572736);}(_0x2bd8,0x130));var _0x82bd=function(_0x35a10b,_0x5ec760){_0x35a10b=_0x35a10b-0x0;var _0x67274d=_0x2bd8[_0x35a10b];return _0x67274d;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 70c3794..06ee64c 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 _0xf495=['stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','AnalyticCustomReport','includeAll','include','rows','catch','show','params','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','create','CustomReports','join','left_join','right_join','SUM(%s)','COUNT(%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)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','cross_join','AVG(%s)','HOUR(%s)','IS\x20EMPTY','AnalyticMetric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','child_process','fork','../../files/reports','savename','countTable','run','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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/utils','../../mysqldb','dbH','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','then','sendStatus','error'];(function(_0x297318,_0x552f41){var _0x521a7f=function(_0x5cbe0f){while(--_0x5cbe0f){_0x297318['push'](_0x297318['shift']());}};_0x521a7f(++_0x552f41);}(_0xf495,0x7d));var _0x5f49=function(_0x33ab7e,_0x3193ad){_0x33ab7e=_0x33ab7e-0x0;var _0x4b6ae8=_0xf495[_0x33ab7e];return _0x4b6ae8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f49('0x0'));var zipdir=require(_0x5f49('0x1'));var jsonpatch=require(_0x5f49('0x2'));var rp=require('request-promise');var moment=require(_0x5f49('0x3'));var BPromise=require(_0x5f49('0x4'));var Mustache=require(_0x5f49('0x5'));var util=require(_0x5f49('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5f49('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f49('0x8'));var _=require(_0x5f49('0x9'));var squel=require(_0x5f49('0xa'));var crypto=require(_0x5f49('0xb'));var jsforce=require(_0x5f49('0xc'));var deskjs=require(_0x5f49('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5f49('0xe'));var Papa=require(_0x5f49('0xf'));var Redis=require(_0x5f49('0x10'));var authService=require(_0x5f49('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5f49('0x12'));var hardwareService=require(_0x5f49('0x13'));var logger=require(_0x5f49('0x14'))(_0x5f49('0x15'));var utils=require(_0x5f49('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5f49('0x17'))['db'];var dbH=require(_0x5f49('0x17'))[_0x5f49('0x18')];function respondWithStatusCode(_0x980b78,_0x48cf5f){_0x48cf5f=_0x48cf5f||0xcc;return function(_0x2adb0e){if(_0x2adb0e){return _0x980b78['sendStatus'](_0x48cf5f);}return _0x980b78[_0x5f49('0x19')](_0x48cf5f)[_0x5f49('0x1a')]();};}function respondWithResult(_0x46d38a,_0x5c0052){_0x5c0052=_0x5c0052||0xc8;return function(_0x4bc456){if(_0x4bc456){return _0x46d38a['status'](_0x5c0052)['json'](_0x4bc456);}};}function respondWithFilteredResult(_0x4374d3,_0x1090be){return function(_0x5ce9f2){if(_0x5ce9f2){var _0x8e61db=typeof _0x1090be['offset']===_0x5f49('0x1b')&&typeof _0x1090be[_0x5f49('0x1c')]===_0x5f49('0x1b');var _0x1de934=_0x5ce9f2[_0x5f49('0x1d')];var _0x3e5f20=_0x8e61db?0x0:_0x1090be['offset'];var _0x549915=_0x8e61db?_0x5ce9f2[_0x5f49('0x1d')]:_0x1090be[_0x5f49('0x1e')]+_0x1090be[_0x5f49('0x1c')];var _0x1ff63c;if(_0x549915>=_0x1de934){_0x549915=_0x1de934;_0x1ff63c=0xc8;}else{_0x1ff63c=0xce;}_0x4374d3[_0x5f49('0x19')](_0x1ff63c);return _0x4374d3[_0x5f49('0x1f')]('Content-Range',_0x3e5f20+'-'+_0x549915+'/'+_0x1de934)[_0x5f49('0x20')](_0x5ce9f2);}return null;};}function patchUpdates(_0x5a3277){return function(_0x167ee6){try{jsonpatch[_0x5f49('0x21')](_0x167ee6,_0x5a3277,!![]);}catch(_0x175418){return BPromise[_0x5f49('0x22')](_0x175418);}return _0x167ee6[_0x5f49('0x23')]();};}function saveUpdates(_0x5a4995,_0x35e8ed){return function(_0x470e00){if(_0x470e00){return _0x470e00[_0x5f49('0x24')](_0x5a4995)['then'](function(_0x4cddca){return _0x4cddca;});}return null;};}function removeEntity(_0x5c0bb1,_0x31dc9f){return function(_0x11f6d4){if(_0x11f6d4){return _0x11f6d4[_0x5f49('0x25')]()['then'](function(){var _0x3dbc7c=_0x11f6d4['get']({'plain':!![]});var _0x483647='CustomReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x483647,'resourceId':_0x3dbc7c['id']}})[_0x5f49('0x26')](function(){return _0x11f6d4;});})['then'](function(){_0x5c0bb1[_0x5f49('0x19')](0xcc)[_0x5f49('0x1a')]();});}};}function handleEntityNotFound(_0x527b1a,_0x341aee){return function(_0x24b4ea){if(!_0x24b4ea){_0x527b1a[_0x5f49('0x27')](0x194);}return _0x24b4ea;};}function handleError(_0x54d645,_0x305ab9){_0x305ab9=_0x305ab9||0x1f4;return function(_0x5b4bd0){logger[_0x5f49('0x28')](_0x5b4bd0[_0x5f49('0x29')]);if(_0x5b4bd0['name']){delete _0x5b4bd0[_0x5f49('0x2a')];}_0x54d645[_0x5f49('0x19')](_0x305ab9)[_0x5f49('0x2b')](_0x5b4bd0);};}exports[_0x5f49('0x2c')]=function(_0x5e94d3,_0x9987fb){var _0xad2732={},_0xdff68c={},_0x21e196={'count':0x0,'rows':[]};var _0x2e7dda=_[_0x5f49('0x2d')](db['AnalyticCustomReport'][_0x5f49('0x2e')],function(_0x546b17){return{'name':_0x546b17[_0x5f49('0x2f')],'type':_0x546b17[_0x5f49('0x30')]['key']};});_0xdff68c['model']=_['map'](_0x2e7dda,_0x5f49('0x2a'));_0xdff68c[_0x5f49('0x31')]=_[_0x5f49('0x32')](_0x5e94d3['query']);_0xdff68c[_0x5f49('0x33')]=_['intersection'](_0xdff68c[_0x5f49('0x34')],_0xdff68c[_0x5f49('0x31')]);_0xad2732[_0x5f49('0x35')]=_[_0x5f49('0x36')](_0xdff68c[_0x5f49('0x34')],qs[_0x5f49('0x37')](_0x5e94d3[_0x5f49('0x31')][_0x5f49('0x37')]));_0xad2732['attributes']=_0xad2732['attributes'][_0x5f49('0x38')]?_0xad2732[_0x5f49('0x35')]:_0xdff68c[_0x5f49('0x34')];if(!_0x5e94d3[_0x5f49('0x31')][_0x5f49('0x39')](_0x5f49('0x3a'))){_0xad2732['limit']=qs[_0x5f49('0x1c')](_0x5e94d3['query'][_0x5f49('0x1c')]);_0xad2732[_0x5f49('0x1e')]=qs[_0x5f49('0x1e')](_0x5e94d3['query']['offset']);}_0xad2732[_0x5f49('0x3b')]=qs[_0x5f49('0x3c')](_0x5e94d3[_0x5f49('0x31')][_0x5f49('0x3c')]);_0xad2732[_0x5f49('0x3d')]=qs['filters'](_['pick'](_0x5e94d3[_0x5f49('0x31')],_0xdff68c['filters']),_0x2e7dda);if(_0x5e94d3[_0x5f49('0x31')][_0x5f49('0x3e')]){_0xad2732[_0x5f49('0x3d')]=_['merge'](_0xad2732[_0x5f49('0x3d')],{'$or':_['map'](_0x2e7dda,function(_0x2ae0cb){if(_0x2ae0cb[_0x5f49('0x30')]!==_0x5f49('0x3f')){var _0x2256c5={};_0x2256c5[_0x2ae0cb[_0x5f49('0x2a')]]={'$like':'%'+_0x5e94d3[_0x5f49('0x31')][_0x5f49('0x3e')]+'%'};return _0x2256c5;}})});}_0xad2732=_[_0x5f49('0x40')]({},_0xad2732,_0x5e94d3['options']);var _0x166b18={'where':_0xad2732[_0x5f49('0x3d')]};return db[_0x5f49('0x41')][_0x5f49('0x1d')](_0x166b18)['then'](function(_0x290593){_0x21e196['count']=_0x290593;if(_0x5e94d3[_0x5f49('0x31')][_0x5f49('0x42')]){_0xad2732[_0x5f49('0x43')]=[{'all':!![]}];}return db[_0x5f49('0x41')]['findAll'](_0xad2732);})['then'](function(_0x4851ae){_0x21e196[_0x5f49('0x44')]=_0x4851ae;return _0x21e196;})['then'](respondWithFilteredResult(_0x9987fb,_0xad2732))[_0x5f49('0x45')](handleError(_0x9987fb,null));};exports[_0x5f49('0x46')]=function(_0x284a65,_0x37b5e8){var _0x49c05e={'raw':![],'where':{'id':_0x284a65[_0x5f49('0x47')]['id']}},_0x10c273={};_0x10c273[_0x5f49('0x34')]=_['keys'](db[_0x5f49('0x41')][_0x5f49('0x2e')]);_0x10c273[_0x5f49('0x31')]=_[_0x5f49('0x32')](_0x284a65[_0x5f49('0x31')]);_0x10c273[_0x5f49('0x33')]=_[_0x5f49('0x36')](_0x10c273['model'],_0x10c273['query']);_0x49c05e[_0x5f49('0x35')]=_[_0x5f49('0x36')](_0x10c273['model'],qs[_0x5f49('0x37')](_0x284a65[_0x5f49('0x31')]['fields']));_0x49c05e[_0x5f49('0x35')]=_0x49c05e[_0x5f49('0x35')][_0x5f49('0x38')]?_0x49c05e[_0x5f49('0x35')]:_0x10c273[_0x5f49('0x34')];if(_0x284a65['query'][_0x5f49('0x42')]){_0x49c05e[_0x5f49('0x43')]=[{'all':!![]}];}_0x49c05e=_['merge']({},_0x49c05e,_0x284a65['options']);return db[_0x5f49('0x41')]['find'](_0x49c05e)[_0x5f49('0x26')](handleEntityNotFound(_0x37b5e8,null))[_0x5f49('0x26')](respondWithResult(_0x37b5e8,null))[_0x5f49('0x45')](handleError(_0x37b5e8,null));};exports['create']=function(_0x23ce64,_0x299e74){return db[_0x5f49('0x41')]['create'](_0x23ce64[_0x5f49('0x48')],{})[_0x5f49('0x26')](function(_0x555833){var _0x5ccaa3=_0x23ce64[_0x5f49('0x49')][_0x5f49('0x4a')]({'plain':!![]});if(!_0x5ccaa3)throw new Error(_0x5f49('0x4b'));if(_0x5ccaa3[_0x5f49('0x4c')]===_0x5f49('0x49')){var _0x2e81b9=_0x555833['get']({'plain':!![]});var _0x194d33=_0x5f49('0x4d');return db[_0x5f49('0x4e')][_0x5f49('0x4f')]({'where':{'name':_0x194d33,'userProfileId':_0x5ccaa3[_0x5f49('0x50')]},'raw':!![]})[_0x5f49('0x26')](function(_0x486b4a){if(_0x486b4a&&_0x486b4a[_0x5f49('0x51')]===0x0){return db['UserProfileResource'][_0x5f49('0x52')]({'name':_0x2e81b9[_0x5f49('0x2a')],'resourceId':_0x2e81b9['id'],'type':_0x5f49('0x53'),'sectionId':_0x486b4a['id']},{})[_0x5f49('0x26')](function(){return _0x555833;});}else{return _0x555833;}})[_0x5f49('0x45')](function(_0x4be5d0){logger[_0x5f49('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4be5d0);throw _0x4be5d0;});}return _0x555833;})[_0x5f49('0x26')](respondWithResult(_0x299e74,0xc9))[_0x5f49('0x45')](handleError(_0x299e74,null));};exports['update']=function(_0x492b4d,_0x2f6860){if(_0x492b4d[_0x5f49('0x48')]['id']){delete _0x492b4d[_0x5f49('0x48')]['id'];}return db[_0x5f49('0x41')]['find']({'where':{'id':_0x492b4d['params']['id']}})[_0x5f49('0x26')](handleEntityNotFound(_0x2f6860,null))['then'](saveUpdates(_0x492b4d[_0x5f49('0x48')],null))['then'](respondWithResult(_0x2f6860,null))['catch'](handleError(_0x2f6860,null));};exports[_0x5f49('0x25')]=function(_0x27ca40,_0x5c8d37){return db['AnalyticCustomReport']['find']({'where':{'id':_0x27ca40[_0x5f49('0x47')]['id']}})[_0x5f49('0x26')](handleEntityNotFound(_0x5c8d37,null))[_0x5f49('0x26')](removeEntity(_0x5c8d37,null))[_0x5f49('0x45')](handleError(_0x5c8d37,null));};exports['preview']=function(_0x18627f,_0x180fd9){var _0x170de9=0xa;var _0x52149d=[_0x5f49('0x54'),_0x5f49('0x55'),_0x5f49('0x56'),'cross_join'];var _0x415e3e={'SUM':_0x5f49('0x57'),'COUNT':_0x5f49('0x58'),'COUNT DISTINCT':_0x5f49('0x59'),'MAX':_0x5f49('0x5a'),'MIN':_0x5f49('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5f49('0x5c'),'GROUP_CONCAT ASC':_0x5f49('0x5d'),'GROUP_CONCAT DESC':_0x5f49('0x5e')};var _0xda2125={'SEC_TO_TIME':_0x5f49('0x5f'),'DATE':_0x5f49('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x5f49('0x61'),'UNIX_TIMESTAMP':_0x5f49('0x62')};var _0x11bb49=function(_0x3d8093){return!_[_0x5f49('0x63')]([_0x5f49('0x64'),_0x5f49('0x65'),'IS\x20EMPTY',_0x5f49('0x66')],_0x3d8093);};var _0x26f65f=function(_0x48271e){if(!_0x48271e||!_0x48271e[_0x5f49('0x67')]['length']){return'';}for(var _0x3d3369='(',_0x25d7c8=0x0;_0x25d7c8<_0x48271e[_0x5f49('0x67')]['length'];_0x25d7c8+=0x1){_0x25d7c8>0x0&&(_0x3d3369+='\x20'+_0x48271e[_0x5f49('0x68')]+'\x20');_0x3d3369+=_0x48271e[_0x5f49('0x67')][_0x25d7c8]['group']?_0x26f65f(_0x48271e['rules'][_0x25d7c8][_0x5f49('0x69')]):_0x48271e['rules'][_0x25d7c8][_0x5f49('0x6a')]+'\x20'+_0x48271e[_0x5f49('0x67')][_0x25d7c8][_0x5f49('0x6b')]+(_0x11bb49(_0x48271e[_0x5f49('0x67')][_0x25d7c8][_0x5f49('0x6b')])?'\x20'+_0x48271e['rules'][_0x25d7c8][_0x5f49('0x6c')]:'');}return _0x3d3369+')';};var _0xc42b97={'where':{'id':_0x18627f[_0x5f49('0x47')]['id']}},_0x338765,_0x2e95a8,_0x1d1da3,_0x53251b,_0x31448b;_0xc42b97=_[_0x5f49('0x40')]({},_0xc42b97,_0x18627f[_0x5f49('0x6d')]);return db[_0x5f49('0x41')][_0x5f49('0x4f')](_0xc42b97)[_0x5f49('0x26')](function(_0x4a6bb0){if(_0x4a6bb0){_0x338765=_0x4a6bb0;return _0x4a6bb0[_0x5f49('0x6e')]();}return null;})[_0x5f49('0x26')](function(_0x5da91f){if(_0x5da91f){if(!_0x5da91f[_0x5f49('0x38')]){throw new db[(_0x5f49('0x6f'))][(_0x5f49('0x70'))](_0x5f49('0x71'),0x193);}_0x2e95a8=_0x5da91f;return db['AnalyticMetric'][_0x5f49('0x72')]({'raw':!![]});}return null;})[_0x5f49('0x26')](function(_0x5a1cb4){if(_0x5a1cb4){_0x1d1da3=_[_0x5f49('0x73')](_0x5a1cb4,'id');var _0x113347;var _0x1cfbc2=squel[_0x5f49('0x74')]();_0x1cfbc2[_0x5f49('0x75')](_0x338765[_0x5f49('0x76')]);for(var _0x41b3d9=0x0;_0x41b3d9<_0x2e95a8[_0x5f49('0x38')];_0x41b3d9+=0x1){_0x113347=_0x2e95a8[_0x41b3d9][_0x5f49('0x77')]?_0x1d1da3[_0x2e95a8[_0x41b3d9]['MetricId']][_0x5f49('0x78')]:_0x2e95a8[_0x41b3d9][_0x5f49('0x6a')];_0x113347=_0x2e95a8[_0x41b3d9][_0x5f49('0x79')]?_[_0x5f49('0x7a')](_0x415e3e[_0x2e95a8[_0x41b3d9][_0x5f49('0x79')]],'%s',_0x113347):_0x113347;_0x113347=_0x2e95a8[_0x41b3d9][_0x5f49('0x7b')]?_[_0x5f49('0x7a')](_0xda2125[_0x2e95a8[_0x41b3d9][_0x5f49('0x7b')]],'%s',_0x113347):_0x113347;if(_0x2e95a8[_0x41b3d9][_0x5f49('0x7c')]){_0x1cfbc2[_0x5f49('0x69')](_0x113347);}_0x2e95a8[_0x41b3d9][_0x5f49('0x7d')]&&_0x1cfbc2['order'](_0x113347,_0x2e95a8[_0x41b3d9]['orderBy']===_0x5f49('0x7e')?![]:!![]);_0x1cfbc2[_0x5f49('0x6a')](_0x113347,_0x2e95a8[_0x41b3d9][_0x5f49('0x7f')]||_0x113347);}if(_0x338765[_0x5f49('0x80')]){_0x338765['joins']=JSON[_0x5f49('0x81')](_0x338765[_0x5f49('0x80')]);for(var _0xe86fb1=0x0;_0xe86fb1<_0x338765[_0x5f49('0x80')][_0x5f49('0x38')];_0xe86fb1+=0x1){if(_0x338765[_0x5f49('0x80')][_0xe86fb1][_0x5f49('0x30')]&&_[_0x5f49('0x63')](_0x52149d,_0x338765['joins'][_0xe86fb1][_0x5f49('0x30')])&&_0x338765[_0x5f49('0x80')][_0xe86fb1][_0x5f49('0x82')]&&_0x338765[_0x5f49('0x80')][_0xe86fb1][_0x5f49('0x83')]&&_0x338765[_0x5f49('0x80')][_0xe86fb1][_0x5f49('0x84')]){_0x1cfbc2[_0x338765[_0x5f49('0x80')][_0xe86fb1][_0x5f49('0x30')]](_0x338765[_0x5f49('0x80')][_0xe86fb1][_0x5f49('0x83')],null,util['format'](_0x5f49('0x85'),_0x338765[_0x5f49('0x76')],_0x338765[_0x5f49('0x80')][_0xe86fb1][_0x5f49('0x82')],_0x338765['joins'][_0xe86fb1][_0x5f49('0x83')],_0x338765['joins'][_0xe86fb1][_0x5f49('0x84')]));}}}if(_0x338765['conditions']){_0x338765[_0x5f49('0x86')]=JSON[_0x5f49('0x81')](_0x338765[_0x5f49('0x86')]);_0x1cfbc2['where'](_0x26f65f(_0x338765[_0x5f49('0x86')][_0x5f49('0x69')]));}_0x31448b=_0x1cfbc2[_0x5f49('0x87')]();_0x1cfbc2[_0x5f49('0x1c')](_0x170de9);_0x1cfbc2['offset'](0x0);logger[_0x5f49('0x88')]('Limited\x20Query:',_0x1cfbc2[_0x5f49('0x89')]());return dbH[_0x5f49('0x8a')][_0x5f49('0x31')](_0x1cfbc2[_0x5f49('0x89')](),{'type':dbH[_0x5f49('0x8a')][_0x5f49('0x8b')][_0x5f49('0x8c')]});}})['then'](respondWithResult(_0x180fd9,null))[_0x5f49('0x45')](handleError(_0x180fd9,null));};function runReport(_0x48f0c2,_0x8284ea,_0x3ea527){var _0x3ef1b4=_0x8284ea[_0x5f49('0x2a')];var _0x19f067=0xa;var _0x35216a=[_0x5f49('0x54'),_0x5f49('0x55'),_0x5f49('0x56'),_0x5f49('0x8d')];var _0x2a5885={'SUM':_0x5f49('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5f49('0x59'),'MAX':_0x5f49('0x5a'),'MIN':'MIN(%s)','AVG':_0x5f49('0x8e'),'GROUP_CONCAT':_0x5f49('0x5c'),'GROUP_CONCAT ASC':_0x5f49('0x5d'),'GROUP_CONCAT DESC':_0x5f49('0x5e')};var _0x13b479={'SEC_TO_TIME':_0x5f49('0x5f'),'DATE':'DATE(%s)','HOUR':_0x5f49('0x8f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5f49('0x62')};var _0x307ad6=function(_0x31d18a){return!_[_0x5f49('0x63')]([_0x5f49('0x64'),_0x5f49('0x65'),_0x5f49('0x90'),_0x5f49('0x66')],_0x31d18a);};var _0x3bae01=function(_0x15e7f8){if(!_0x15e7f8||!_0x15e7f8[_0x5f49('0x67')]['length']){return'';}for(var _0x4fee1e='(',_0x3afd73=0x0;_0x3afd73<_0x15e7f8[_0x5f49('0x67')][_0x5f49('0x38')];_0x3afd73+=0x1){_0x3afd73>0x0&&(_0x4fee1e+='\x20'+_0x15e7f8[_0x5f49('0x68')]+'\x20');_0x4fee1e+=_0x15e7f8[_0x5f49('0x67')][_0x3afd73]['group']?_0x3bae01(_0x15e7f8[_0x5f49('0x67')][_0x3afd73][_0x5f49('0x69')]):_0x15e7f8['rules'][_0x3afd73]['field']+'\x20'+_0x15e7f8[_0x5f49('0x67')][_0x3afd73][_0x5f49('0x6b')]+(_0x307ad6(_0x15e7f8[_0x5f49('0x67')][_0x3afd73]['condition'])?'\x20'+_0x15e7f8['rules'][_0x3afd73][_0x5f49('0x6c')]:'');}return _0x4fee1e+')';};var _0x4a0590={'where':{'id':_0x48f0c2['id']}},_0x59314d,_0xd13dca,_0x8feff6,_0x207985,_0x395c32;_0x4a0590=_[_0x5f49('0x40')]({},_0x4a0590,_0x3ea527);return db[_0x5f49('0x41')][_0x5f49('0x4f')](_0x4a0590)[_0x5f49('0x26')](function(_0x13e5bf){if(_0x13e5bf){_0x59314d=_0x13e5bf;return _0x13e5bf[_0x5f49('0x6e')]();}return null;})['then'](function(_0x16aee6){if(_0x16aee6){if(!_0x16aee6['length']){throw new db[(_0x5f49('0x6f'))][(_0x5f49('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xd13dca=_0x16aee6;return db[_0x5f49('0x91')][_0x5f49('0x72')]({'raw':!![]});}return null;})[_0x5f49('0x26')](function(_0x52ff1c){if(_0x52ff1c){_0x8feff6=_['keyBy'](_0x52ff1c,'id');var _0x37fd3b;var _0x1a182f=squel['select']();_0x1a182f['from'](_0x59314d[_0x5f49('0x76')]);for(var _0x5a9f12=0x0;_0x5a9f12<_0xd13dca[_0x5f49('0x38')];_0x5a9f12+=0x1){_0x37fd3b=_0xd13dca[_0x5a9f12][_0x5f49('0x77')]?_0x8feff6[_0xd13dca[_0x5a9f12][_0x5f49('0x77')]][_0x5f49('0x78')]:_0xd13dca[_0x5a9f12][_0x5f49('0x6a')];_0x37fd3b=_0xd13dca[_0x5a9f12]['function']?_[_0x5f49('0x7a')](_0x2a5885[_0xd13dca[_0x5a9f12][_0x5f49('0x79')]],'%s',_0x37fd3b):_0x37fd3b;_0x37fd3b=_0xd13dca[_0x5a9f12][_0x5f49('0x7b')]?_['replace'](_0x13b479[_0xd13dca[_0x5a9f12]['format']],'%s',_0x37fd3b):_0x37fd3b;if(_0xd13dca[_0x5a9f12]['groupBy']){_0x1a182f[_0x5f49('0x69')](_0x37fd3b);}_0xd13dca[_0x5a9f12][_0x5f49('0x7d')]&&_0x1a182f['order'](_0x37fd3b,_0xd13dca[_0x5a9f12]['orderBy']==='DESC'?![]:!![]);_0x1a182f[_0x5f49('0x6a')](_0x37fd3b,_0xd13dca[_0x5a9f12][_0x5f49('0x7f')]||_0x37fd3b);}if(_0x59314d[_0x5f49('0x80')]){_0x59314d['joins']=JSON[_0x5f49('0x81')](_0x59314d['joins']);for(var _0x2893c5=0x0;_0x2893c5<_0x59314d[_0x5f49('0x80')][_0x5f49('0x38')];_0x2893c5+=0x1){if(_0x59314d[_0x5f49('0x80')][_0x2893c5]['type']&&_[_0x5f49('0x63')](_0x35216a,_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x30')])&&_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x82')]&&_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x83')]&&_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x84')]){_0x1a182f[_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x30')]](_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x83')],null,util['format'](_0x5f49('0x85'),_0x59314d[_0x5f49('0x76')],_0x59314d[_0x5f49('0x80')][_0x2893c5]['parentKey'],_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x83')],_0x59314d[_0x5f49('0x80')][_0x2893c5][_0x5f49('0x84')]));}}}if(_0x59314d[_0x5f49('0x86')]){_0x59314d[_0x5f49('0x86')]=JSON['parse'](_0x59314d[_0x5f49('0x86')]);_0x1a182f[_0x5f49('0x3d')](_0x3bae01(_0x59314d[_0x5f49('0x86')][_0x5f49('0x69')]));}_0x395c32=_0x1a182f[_0x5f49('0x87')]();_0x1a182f[_0x5f49('0x1c')](_0x19f067);_0x1a182f[_0x5f49('0x1e')](0x0);return;}})[_0x5f49('0x26')](function(){if(_0x8284ea[_0x5f49('0x92')]===_0x5f49('0x93')){return null;}var _0x1032dc=_[_0x5f49('0x40')](_0x8284ea,{'name':_0x8284ea[_0x5f49('0x94')]||_0x8284ea[_0x5f49('0x2a')]||_0x59314d[_0x5f49('0x2a')],'basename':_0x3ef1b4,'savename':util[_0x5f49('0x7b')](_0x5f49('0x95'),_0x8284ea[_0x5f49('0x2a')]||_0x59314d[_0x5f49('0x2a')],require(_0x5f49('0x96'))[_0x5f49('0x97')](0x4),_0x8284ea[_0x5f49('0x92')]||_0x5f49('0x98')),'reportId':_0x59314d['id'],'reportType':_0x5f49('0x99')});return db[_0x5f49('0x9a')]['create'](_0x1032dc,{'raw':!![]});})[_0x5f49('0x26')](function(_0x1370b5){if(_0x59314d[_0x5f49('0x76')]===_0x5f49('0x9b')){_0x395c32[_0x5f49('0x3d')](_0x59314d[_0x5f49('0x76')]+_0x5f49('0x9c'),_0x8284ea[_0x5f49('0x9d')],_0x8284ea['endDate']);}else{_0x395c32[_0x5f49('0x3d')](_0x59314d[_0x5f49('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x8284ea[_0x5f49('0x9d')],_0x8284ea[_0x5f49('0x9e')]);}if(_0x1370b5){logger['info']('Run\x20Query:',_0x395c32[_0x5f49('0x89')]());require(_0x5f49('0x9f'))[_0x5f49('0xa0')](path[_0x5f49('0x54')](__dirname,'../../components/export/',_0x1370b5['output']),[_0x1370b5['id'],_0x395c32['toString'](),path[_0x5f49('0x54')](__dirname,_0x5f49('0xa1'),_0x1370b5[_0x5f49('0xa2')]),_0x3ef1b4]);return _0x1370b5;}else{var _0x4a86ab=squel[_0x5f49('0x74')]();_0x4a86ab['from']('('+_0x395c32[_0x5f49('0x89')]()+')',_0x5f49('0xa3'));_0x4a86ab[_0x5f49('0x6a')]('COUNT(*)','count');_0x395c32[_0x5f49('0x1c')](_0x8284ea['limit']||_0x19f067);_0x395c32[_0x5f49('0x1e')](_0x8284ea[_0x5f49('0x1e')]||0x0);return dbH['sequelize'][_0x5f49('0x31')](_0x4a86ab[_0x5f49('0x89')](),{'type':dbH['sequelize'][_0x5f49('0x8b')]['SELECT']})[_0x5f49('0x26')](function(_0x433019){if(!_0x433019[_0x5f49('0x38')]){_0x207985=0x0;}else{_0x207985=_0x433019[0x0][_0x5f49('0x1d')]||0x0;}return dbH[_0x5f49('0x8a')][_0x5f49('0x31')](_0x395c32[_0x5f49('0x89')](),{'type':dbH[_0x5f49('0x8a')]['QueryTypes'][_0x5f49('0x8c')]});})['then'](function(_0x329769){return{'rows':_0x329769||[],'count':_0x207985};});}});}exports[_0x5f49('0xa4')]=function(_0x58a7bb,_0x5a3bec){return runReport(_0x58a7bb[_0x5f49('0x47')],_0x58a7bb[_0x5f49('0x31')],_0x58a7bb[_0x5f49('0x6d')])[_0x5f49('0x26')](respondWithResult(_0x5a3bec,null))[_0x5f49('0x45')](handleError(_0x5a3bec,null));};exports['runReport']=runReport;exports['query']=function(_0x4fe1a4,_0x2a04a2){var _0x4864fd=0xa;var _0x35bad9=[_0x5f49('0x54'),_0x5f49('0x55'),_0x5f49('0x56'),_0x5f49('0x8d')];var _0x569bb4={'SUM':_0x5f49('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5f49('0x59'),'MAX':_0x5f49('0x5a'),'MIN':_0x5f49('0x5b'),'AVG':_0x5f49('0x8e'),'GROUP_CONCAT':_0x5f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5f49('0x5e')};var _0x2fe4cb={'SEC_TO_TIME':_0x5f49('0x5f'),'DATE':'DATE(%s)','HOUR':_0x5f49('0x8f'),'ROUND':_0x5f49('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1673e1=function(_0x1dba14){return!_[_0x5f49('0x63')]([_0x5f49('0x64'),_0x5f49('0x65'),_0x5f49('0x90'),'IS\x20NOT\x20EMPTY'],_0x1dba14);};var _0x48e9cd=function(_0x5cf32c){if(!_0x5cf32c||!_0x5cf32c[_0x5f49('0x67')][_0x5f49('0x38')]){return'';}for(var _0xd39f84='(',_0x86aa40=0x0;_0x86aa40<_0x5cf32c[_0x5f49('0x67')][_0x5f49('0x38')];_0x86aa40+=0x1){_0x86aa40>0x0&&(_0xd39f84+='\x20'+_0x5cf32c[_0x5f49('0x68')]+'\x20');_0xd39f84+=_0x5cf32c['rules'][_0x86aa40][_0x5f49('0x69')]?_0x48e9cd(_0x5cf32c['rules'][_0x86aa40]['group']):_0x5cf32c[_0x5f49('0x67')][_0x86aa40][_0x5f49('0x6a')]+'\x20'+_0x5cf32c['rules'][_0x86aa40][_0x5f49('0x6b')]+(_0x1673e1(_0x5cf32c[_0x5f49('0x67')][_0x86aa40][_0x5f49('0x6b')])?'\x20'+_0x5cf32c[_0x5f49('0x67')][_0x86aa40][_0x5f49('0x6c')]:'');}return _0xd39f84+')';};var _0x53f65b={'where':{'id':_0x4fe1a4[_0x5f49('0x47')]['id']}},_0x5c4c5c,_0x2f66a0,_0x5b4306,_0x71fa3,_0x4ac9bb;_0x53f65b=_[_0x5f49('0x40')]({},_0x53f65b,_0x4fe1a4[_0x5f49('0x6d')]);return db[_0x5f49('0x41')][_0x5f49('0x4f')](_0x53f65b)[_0x5f49('0x26')](function(_0x497563){if(_0x497563){_0x5c4c5c=_0x497563;return _0x497563[_0x5f49('0x6e')]();}return null;})[_0x5f49('0x26')](function(_0x488633){if(_0x488633){if(!_0x488633['length']){throw new db[(_0x5f49('0x6f'))][(_0x5f49('0x70'))](_0x5f49('0x71'),0x193);}_0x2f66a0=_0x488633;return db['AnalyticMetric'][_0x5f49('0x72')]({'raw':!![]});}return null;})[_0x5f49('0x26')](function(_0x5767bd){if(_0x5767bd){_0x5b4306=_['keyBy'](_0x5767bd,'id');var _0x26133a;var _0x33b1d3=squel[_0x5f49('0x74')]();_0x33b1d3['from'](_0x5c4c5c[_0x5f49('0x76')]);for(var _0xb0385b=0x0;_0xb0385b<_0x2f66a0['length'];_0xb0385b+=0x1){_0x26133a=_0x2f66a0[_0xb0385b][_0x5f49('0x77')]?_0x5b4306[_0x2f66a0[_0xb0385b][_0x5f49('0x77')]][_0x5f49('0x78')]:_0x2f66a0[_0xb0385b][_0x5f49('0x6a')];_0x26133a=_0x2f66a0[_0xb0385b]['function']?_[_0x5f49('0x7a')](_0x569bb4[_0x2f66a0[_0xb0385b]['function']],'%s',_0x26133a):_0x26133a;_0x26133a=_0x2f66a0[_0xb0385b][_0x5f49('0x7b')]?_['replace'](_0x2fe4cb[_0x2f66a0[_0xb0385b][_0x5f49('0x7b')]],'%s',_0x26133a):_0x26133a;if(_0x2f66a0[_0xb0385b][_0x5f49('0x7c')]){_0x33b1d3[_0x5f49('0x69')](_0x26133a);}_0x2f66a0[_0xb0385b][_0x5f49('0x7d')]&&_0x33b1d3[_0x5f49('0x3b')](_0x26133a,_0x2f66a0[_0xb0385b]['orderBy']===_0x5f49('0x7e')?![]:!![]);_0x33b1d3[_0x5f49('0x6a')](_0x26133a,_0x2f66a0[_0xb0385b][_0x5f49('0x7f')]||_0x26133a);}if(_0x5c4c5c[_0x5f49('0x80')]){_0x5c4c5c[_0x5f49('0x80')]=JSON[_0x5f49('0x81')](_0x5c4c5c[_0x5f49('0x80')]);for(var _0x5bcb12=0x0;_0x5bcb12<_0x5c4c5c[_0x5f49('0x80')]['length'];_0x5bcb12+=0x1){if(_0x5c4c5c[_0x5f49('0x80')][_0x5bcb12]['type']&&_['includes'](_0x35bad9,_0x5c4c5c[_0x5f49('0x80')][_0x5bcb12][_0x5f49('0x30')])&&_0x5c4c5c['joins'][_0x5bcb12]['parentKey']&&_0x5c4c5c[_0x5f49('0x80')][_0x5bcb12]['foreignTable']&&_0x5c4c5c[_0x5f49('0x80')][_0x5bcb12][_0x5f49('0x84')]){_0x33b1d3[_0x5c4c5c[_0x5f49('0x80')][_0x5bcb12][_0x5f49('0x30')]](_0x5c4c5c[_0x5f49('0x80')][_0x5bcb12][_0x5f49('0x83')],null,util['format'](_0x5f49('0x85'),_0x5c4c5c[_0x5f49('0x76')],_0x5c4c5c['joins'][_0x5bcb12][_0x5f49('0x82')],_0x5c4c5c['joins'][_0x5bcb12]['foreignTable'],_0x5c4c5c[_0x5f49('0x80')][_0x5bcb12][_0x5f49('0x84')]));}}}if(_0x5c4c5c['conditions']){_0x5c4c5c['conditions']=JSON['parse'](_0x5c4c5c[_0x5f49('0x86')]);_0x33b1d3[_0x5f49('0x3d')](_0x48e9cd(_0x5c4c5c['conditions'][_0x5f49('0x69')]));}_0x4ac9bb=_0x33b1d3['clone']();_0x33b1d3[_0x5f49('0x1c')](_0x4864fd);_0x33b1d3[_0x5f49('0x1e')](0x0);logger['debug'](_0x5f49('0xa5'),_0x33b1d3[_0x5f49('0x89')]());return dbH['sequelize'][_0x5f49('0x31')](_0x33b1d3['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5f49('0x8c')]});}})[_0x5f49('0x26')](function(){return{'sql':_0x4ac9bb['toString']()};})['then'](respondWithResult(_0x2a04a2,null))[_0x5f49('0x45')](handleError(_0x2a04a2,null));};
\ No newline at end of file
+var _0xa8fd=['where','merge','options','includeAll','rows','params','keys','find','catch','create','user','role','Reports','UserProfileSection','autoAssociation','UserProfileResource','error','update','body','destroy','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','order','DESC','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','keyBy','select','alias','clone','output','web','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','left_join','IS\x20EMPTY','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','get','CustomReports','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter'];(function(_0x4c291a,_0x15fc10){var _0x276509=function(_0x518692){while(--_0x518692){_0x4c291a['push'](_0x4c291a['shift']());}};_0x276509(++_0x15fc10);}(_0xa8fd,0x69));var _0xda8f=function(_0x1daf92,_0x3ff770){_0x1daf92=_0x1daf92-0x0;var _0x5b4f6f=_0xa8fd[_0x1daf92];return _0x5b4f6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda8f('0x0'));var zipdir=require(_0xda8f('0x1'));var jsonpatch=require(_0xda8f('0x2'));var rp=require(_0xda8f('0x3'));var moment=require(_0xda8f('0x4'));var BPromise=require(_0xda8f('0x5'));var Mustache=require('mustache');var util=require(_0xda8f('0x6'));var path=require(_0xda8f('0x7'));var sox=require('sox');var csv=require(_0xda8f('0x8'));var ejs=require(_0xda8f('0x9'));var fs=require('fs');var fs_extra=require(_0xda8f('0xa'));var _=require(_0xda8f('0xb'));var squel=require('squel');var crypto=require(_0xda8f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xda8f('0x8'));var querystring=require(_0xda8f('0xd'));var Papa=require('papaparse');var Redis=require(_0xda8f('0xe'));var authService=require(_0xda8f('0xf'));var qs=require(_0xda8f('0x10'));var as=require(_0xda8f('0x11'));var hardwareService=require(_0xda8f('0x12'));var logger=require('../../config/logger')(_0xda8f('0x13'));var utils=require(_0xda8f('0x14'));var config=require(_0xda8f('0x15'));var licenseUtil=require(_0xda8f('0x16'));var db=require(_0xda8f('0x17'))['db'];var dbH=require(_0xda8f('0x17'))['dbH'];function respondWithStatusCode(_0x1671c8,_0x589e05){_0x589e05=_0x589e05||0xcc;return function(_0x2967be){if(_0x2967be){return _0x1671c8['sendStatus'](_0x589e05);}return _0x1671c8[_0xda8f('0x18')](_0x589e05)[_0xda8f('0x19')]();};}function respondWithResult(_0xeb2aad,_0x170c45){_0x170c45=_0x170c45||0xc8;return function(_0x1365d7){if(_0x1365d7){return _0xeb2aad[_0xda8f('0x18')](_0x170c45)[_0xda8f('0x1a')](_0x1365d7);}};}function respondWithFilteredResult(_0x10b30b,_0x16c8ac){return function(_0x403f91){if(_0x403f91){var _0x179779=typeof _0x16c8ac['offset']==='undefined'&&typeof _0x16c8ac['limit']===_0xda8f('0x1b');var _0x59a031=_0x403f91[_0xda8f('0x1c')];var _0x385d38=_0x179779?0x0:_0x16c8ac[_0xda8f('0x1d')];var _0xa2aea2=_0x179779?_0x403f91[_0xda8f('0x1c')]:_0x16c8ac[_0xda8f('0x1d')]+_0x16c8ac[_0xda8f('0x1e')];var _0x5abe5b;if(_0xa2aea2>=_0x59a031){_0xa2aea2=_0x59a031;_0x5abe5b=0xc8;}else{_0x5abe5b=0xce;}_0x10b30b[_0xda8f('0x18')](_0x5abe5b);return _0x10b30b[_0xda8f('0x1f')](_0xda8f('0x20'),_0x385d38+'-'+_0xa2aea2+'/'+_0x59a031)[_0xda8f('0x1a')](_0x403f91);}return null;};}function patchUpdates(_0x5dff4b){return function(_0x242595){try{jsonpatch[_0xda8f('0x21')](_0x242595,_0x5dff4b,!![]);}catch(_0x5c6876){return BPromise[_0xda8f('0x22')](_0x5c6876);}return _0x242595['save']();};}function saveUpdates(_0x1f7d19,_0x4d0fe3){return function(_0x265253){if(_0x265253){return _0x265253['update'](_0x1f7d19)[_0xda8f('0x23')](function(_0x462363){return _0x462363;});}return null;};}function removeEntity(_0x2a951c,_0x322822){return function(_0x5b1e31){if(_0x5b1e31){return _0x5b1e31['destroy']()['then'](function(){var _0x909745=_0x5b1e31[_0xda8f('0x24')]({'plain':!![]});var _0x1b4280=_0xda8f('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1b4280,'resourceId':_0x909745['id']}})['then'](function(){return _0x5b1e31;});})[_0xda8f('0x23')](function(){_0x2a951c[_0xda8f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc99b82,_0x1f7eec){return function(_0x483b28){if(!_0x483b28){_0xc99b82[_0xda8f('0x26')](0x194);}return _0x483b28;};}function handleError(_0x3b9cf5,_0x3c086){_0x3c086=_0x3c086||0x1f4;return function(_0x12f292){logger['error'](_0x12f292[_0xda8f('0x27')]);if(_0x12f292[_0xda8f('0x28')]){delete _0x12f292[_0xda8f('0x28')];}_0x3b9cf5[_0xda8f('0x18')](_0x3c086)[_0xda8f('0x29')](_0x12f292);};}exports[_0xda8f('0x2a')]=function(_0x44d376,_0x366c8b){var _0x5458ab={},_0x502d9e={},_0x2bab6b={'count':0x0,'rows':[]};var _0x1ba035=_[_0xda8f('0x2b')](db[_0xda8f('0x2c')][_0xda8f('0x2d')],function(_0x253181){return{'name':_0x253181[_0xda8f('0x2e')],'type':_0x253181[_0xda8f('0x2f')][_0xda8f('0x30')]};});_0x502d9e[_0xda8f('0x31')]=_['map'](_0x1ba035,_0xda8f('0x28'));_0x502d9e[_0xda8f('0x32')]=_['keys'](_0x44d376[_0xda8f('0x32')]);_0x502d9e[_0xda8f('0x33')]=_[_0xda8f('0x34')](_0x502d9e[_0xda8f('0x31')],_0x502d9e[_0xda8f('0x32')]);_0x5458ab[_0xda8f('0x35')]=_[_0xda8f('0x34')](_0x502d9e[_0xda8f('0x31')],qs[_0xda8f('0x36')](_0x44d376[_0xda8f('0x32')]['fields']));_0x5458ab['attributes']=_0x5458ab[_0xda8f('0x35')][_0xda8f('0x37')]?_0x5458ab['attributes']:_0x502d9e['model'];if(!_0x44d376[_0xda8f('0x32')][_0xda8f('0x38')](_0xda8f('0x39'))){_0x5458ab[_0xda8f('0x1e')]=qs[_0xda8f('0x1e')](_0x44d376['query'][_0xda8f('0x1e')]);_0x5458ab[_0xda8f('0x1d')]=qs[_0xda8f('0x1d')](_0x44d376[_0xda8f('0x32')][_0xda8f('0x1d')]);}_0x5458ab['order']=qs['sort'](_0x44d376[_0xda8f('0x32')][_0xda8f('0x3a')]);_0x5458ab['where']=qs[_0xda8f('0x33')](_[_0xda8f('0x3b')](_0x44d376[_0xda8f('0x32')],_0x502d9e['filters']),_0x1ba035);if(_0x44d376['query'][_0xda8f('0x3c')]){_0x5458ab[_0xda8f('0x3d')]=_[_0xda8f('0x3e')](_0x5458ab[_0xda8f('0x3d')],{'$or':_[_0xda8f('0x2b')](_0x1ba035,function(_0x3f4814){if(_0x3f4814[_0xda8f('0x2f')]!=='VIRTUAL'){var _0x34883c={};_0x34883c[_0x3f4814[_0xda8f('0x28')]]={'$like':'%'+_0x44d376['query'][_0xda8f('0x3c')]+'%'};return _0x34883c;}})});}_0x5458ab=_[_0xda8f('0x3e')]({},_0x5458ab,_0x44d376[_0xda8f('0x3f')]);var _0x557cb3={'where':_0x5458ab['where']};return db['AnalyticCustomReport']['count'](_0x557cb3)[_0xda8f('0x23')](function(_0x1929d6){_0x2bab6b[_0xda8f('0x1c')]=_0x1929d6;if(_0x44d376['query'][_0xda8f('0x40')]){_0x5458ab['include']=[{'all':!![]}];}return db[_0xda8f('0x2c')]['findAll'](_0x5458ab);})[_0xda8f('0x23')](function(_0x4afee6){_0x2bab6b[_0xda8f('0x41')]=_0x4afee6;return _0x2bab6b;})[_0xda8f('0x23')](respondWithFilteredResult(_0x366c8b,_0x5458ab))['catch'](handleError(_0x366c8b,null));};exports['show']=function(_0x1422fd,_0x4ac96c){var _0x4e9bc5={'raw':![],'where':{'id':_0x1422fd[_0xda8f('0x42')]['id']}},_0x1030a0={};_0x1030a0['model']=_[_0xda8f('0x43')](db[_0xda8f('0x2c')]['rawAttributes']);_0x1030a0[_0xda8f('0x32')]=_[_0xda8f('0x43')](_0x1422fd['query']);_0x1030a0[_0xda8f('0x33')]=_[_0xda8f('0x34')](_0x1030a0['model'],_0x1030a0['query']);_0x4e9bc5[_0xda8f('0x35')]=_[_0xda8f('0x34')](_0x1030a0['model'],qs[_0xda8f('0x36')](_0x1422fd[_0xda8f('0x32')][_0xda8f('0x36')]));_0x4e9bc5[_0xda8f('0x35')]=_0x4e9bc5[_0xda8f('0x35')][_0xda8f('0x37')]?_0x4e9bc5[_0xda8f('0x35')]:_0x1030a0[_0xda8f('0x31')];if(_0x1422fd['query'][_0xda8f('0x40')]){_0x4e9bc5['include']=[{'all':!![]}];}_0x4e9bc5=_[_0xda8f('0x3e')]({},_0x4e9bc5,_0x1422fd[_0xda8f('0x3f')]);return db[_0xda8f('0x2c')][_0xda8f('0x44')](_0x4e9bc5)['then'](handleEntityNotFound(_0x4ac96c,null))[_0xda8f('0x23')](respondWithResult(_0x4ac96c,null))[_0xda8f('0x45')](handleError(_0x4ac96c,null));};exports[_0xda8f('0x46')]=function(_0x3ac295,_0x5c33f5){return db[_0xda8f('0x2c')][_0xda8f('0x46')](_0x3ac295['body'],{})[_0xda8f('0x23')](function(_0x143d42){var _0x16c0be=_0x3ac295[_0xda8f('0x47')]['get']({'plain':!![]});if(!_0x16c0be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16c0be[_0xda8f('0x48')]==='user'){var _0xdc3300=_0x143d42[_0xda8f('0x24')]({'plain':!![]});var _0x262024=_0xda8f('0x49');return db[_0xda8f('0x4a')]['find']({'where':{'name':_0x262024,'userProfileId':_0x16c0be['userProfileId']},'raw':!![]})['then'](function(_0x2cc2ad){if(_0x2cc2ad&&_0x2cc2ad[_0xda8f('0x4b')]===0x0){return db[_0xda8f('0x4c')][_0xda8f('0x46')]({'name':_0xdc3300[_0xda8f('0x28')],'resourceId':_0xdc3300['id'],'type':'CustomReports','sectionId':_0x2cc2ad['id']},{})[_0xda8f('0x23')](function(){return _0x143d42;});}else{return _0x143d42;}})[_0xda8f('0x45')](function(_0xc72639){logger[_0xda8f('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc72639);throw _0xc72639;});}return _0x143d42;})[_0xda8f('0x23')](respondWithResult(_0x5c33f5,0xc9))[_0xda8f('0x45')](handleError(_0x5c33f5,null));};exports[_0xda8f('0x4e')]=function(_0x2b834b,_0x4953b8){if(_0x2b834b[_0xda8f('0x4f')]['id']){delete _0x2b834b[_0xda8f('0x4f')]['id'];}return db[_0xda8f('0x2c')]['find']({'where':{'id':_0x2b834b[_0xda8f('0x42')]['id']}})[_0xda8f('0x23')](handleEntityNotFound(_0x4953b8,null))[_0xda8f('0x23')](saveUpdates(_0x2b834b[_0xda8f('0x4f')],null))[_0xda8f('0x23')](respondWithResult(_0x4953b8,null))[_0xda8f('0x45')](handleError(_0x4953b8,null));};exports[_0xda8f('0x50')]=function(_0x39e3e6,_0x51ca18){return db['AnalyticCustomReport'][_0xda8f('0x44')]({'where':{'id':_0x39e3e6[_0xda8f('0x42')]['id']}})[_0xda8f('0x23')](handleEntityNotFound(_0x51ca18,null))[_0xda8f('0x23')](removeEntity(_0x51ca18,null))[_0xda8f('0x45')](handleError(_0x51ca18,null));};exports[_0xda8f('0x51')]=function(_0x45c7b3,_0x17e238){var _0x512b55=0xa;var _0x13c140=[_0xda8f('0x52'),'left_join',_0xda8f('0x53'),_0xda8f('0x54')];var _0x125d4b={'SUM':_0xda8f('0x55'),'COUNT':_0xda8f('0x56'),'COUNT DISTINCT':_0xda8f('0x57'),'MAX':_0xda8f('0x58'),'MIN':_0xda8f('0x59'),'AVG':_0xda8f('0x5a'),'GROUP_CONCAT':_0xda8f('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xec51c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xda8f('0x5c'),'HOUR':_0xda8f('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3ac4b3=function(_0x5441b1){return!_[_0xda8f('0x5e')]([_0xda8f('0x5f'),_0xda8f('0x60'),'IS\x20EMPTY',_0xda8f('0x61')],_0x5441b1);};var _0x1b710f=function(_0x3116e9){if(!_0x3116e9||!_0x3116e9[_0xda8f('0x62')][_0xda8f('0x37')]){return'';}for(var _0x1c8c3c='(',_0x1b3d28=0x0;_0x1b3d28<_0x3116e9[_0xda8f('0x62')][_0xda8f('0x37')];_0x1b3d28+=0x1){_0x1b3d28>0x0&&(_0x1c8c3c+='\x20'+_0x3116e9[_0xda8f('0x63')]+'\x20');_0x1c8c3c+=_0x3116e9['rules'][_0x1b3d28][_0xda8f('0x64')]?_0x1b710f(_0x3116e9[_0xda8f('0x62')][_0x1b3d28][_0xda8f('0x64')]):_0x3116e9[_0xda8f('0x62')][_0x1b3d28][_0xda8f('0x65')]+'\x20'+_0x3116e9[_0xda8f('0x62')][_0x1b3d28]['condition']+(_0x3ac4b3(_0x3116e9[_0xda8f('0x62')][_0x1b3d28][_0xda8f('0x66')])?'\x20'+_0x3116e9[_0xda8f('0x62')][_0x1b3d28][_0xda8f('0x67')]:'');}return _0x1c8c3c+')';};var _0xb853ba={'where':{'id':_0x45c7b3[_0xda8f('0x42')]['id']}},_0x413a90,_0x4e950a,_0x4fc14,_0x3abd74,_0x5de69d;_0xb853ba=_[_0xda8f('0x3e')]({},_0xb853ba,_0x45c7b3[_0xda8f('0x3f')]);return db[_0xda8f('0x2c')]['find'](_0xb853ba)[_0xda8f('0x23')](function(_0x4be953){if(_0x4be953){_0x413a90=_0x4be953;return _0x4be953[_0xda8f('0x68')]();}return null;})[_0xda8f('0x23')](function(_0x4855ba){if(_0x4855ba){if(!_0x4855ba[_0xda8f('0x37')]){throw new db[(_0xda8f('0x69'))][(_0xda8f('0x6a'))](_0xda8f('0x6b'),0x193);}_0x4e950a=_0x4855ba;return db[_0xda8f('0x6c')][_0xda8f('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x20278d){if(_0x20278d){_0x4fc14=_['keyBy'](_0x20278d,'id');var _0x39dac3;var _0x18fc0c=squel['select']();_0x18fc0c[_0xda8f('0x6e')](_0x413a90[_0xda8f('0x6f')]);for(var _0xba0cb7=0x0;_0xba0cb7<_0x4e950a['length'];_0xba0cb7+=0x1){_0x39dac3=_0x4e950a[_0xba0cb7][_0xda8f('0x70')]?_0x4fc14[_0x4e950a[_0xba0cb7][_0xda8f('0x70')]][_0xda8f('0x71')]:_0x4e950a[_0xba0cb7][_0xda8f('0x65')];_0x39dac3=_0x4e950a[_0xba0cb7]['function']?_[_0xda8f('0x72')](_0x125d4b[_0x4e950a[_0xba0cb7][_0xda8f('0x73')]],'%s',_0x39dac3):_0x39dac3;_0x39dac3=_0x4e950a[_0xba0cb7][_0xda8f('0x74')]?_[_0xda8f('0x72')](_0xec51c[_0x4e950a[_0xba0cb7]['format']],'%s',_0x39dac3):_0x39dac3;if(_0x4e950a[_0xba0cb7][_0xda8f('0x75')]){_0x18fc0c[_0xda8f('0x64')](_0x39dac3);}_0x4e950a[_0xba0cb7][_0xda8f('0x76')]&&_0x18fc0c[_0xda8f('0x77')](_0x39dac3,_0x4e950a[_0xba0cb7][_0xda8f('0x76')]===_0xda8f('0x78')?![]:!![]);_0x18fc0c['field'](_0x39dac3,_0x4e950a[_0xba0cb7]['alias']||_0x39dac3);}if(_0x413a90['joins']){_0x413a90['joins']=JSON[_0xda8f('0x79')](_0x413a90[_0xda8f('0x7a')]);for(var _0x4f6176=0x0;_0x4f6176<_0x413a90[_0xda8f('0x7a')][_0xda8f('0x37')];_0x4f6176+=0x1){if(_0x413a90['joins'][_0x4f6176][_0xda8f('0x2f')]&&_[_0xda8f('0x5e')](_0x13c140,_0x413a90['joins'][_0x4f6176]['type'])&&_0x413a90[_0xda8f('0x7a')][_0x4f6176][_0xda8f('0x7b')]&&_0x413a90[_0xda8f('0x7a')][_0x4f6176][_0xda8f('0x7c')]&&_0x413a90[_0xda8f('0x7a')][_0x4f6176][_0xda8f('0x7d')]){_0x18fc0c[_0x413a90[_0xda8f('0x7a')][_0x4f6176][_0xda8f('0x2f')]](_0x413a90[_0xda8f('0x7a')][_0x4f6176][_0xda8f('0x7c')],null,util[_0xda8f('0x74')](_0xda8f('0x7e'),_0x413a90['table'],_0x413a90[_0xda8f('0x7a')][_0x4f6176]['parentKey'],_0x413a90[_0xda8f('0x7a')][_0x4f6176][_0xda8f('0x7c')],_0x413a90[_0xda8f('0x7a')][_0x4f6176]['foreignKey']));}}}if(_0x413a90[_0xda8f('0x7f')]){_0x413a90['conditions']=JSON['parse'](_0x413a90[_0xda8f('0x7f')]);_0x18fc0c[_0xda8f('0x3d')](_0x1b710f(_0x413a90[_0xda8f('0x7f')][_0xda8f('0x64')]));}_0x5de69d=_0x18fc0c['clone']();_0x18fc0c[_0xda8f('0x1e')](_0x512b55);_0x18fc0c[_0xda8f('0x1d')](0x0);logger[_0xda8f('0x80')]('Limited\x20Query:',_0x18fc0c[_0xda8f('0x81')]());return dbH[_0xda8f('0x82')][_0xda8f('0x32')](_0x18fc0c[_0xda8f('0x81')](),{'type':dbH[_0xda8f('0x82')][_0xda8f('0x83')][_0xda8f('0x84')]});}})[_0xda8f('0x23')](respondWithResult(_0x17e238,null))[_0xda8f('0x45')](handleError(_0x17e238,null));};function runReport(_0x27612b,_0x39d21c,_0x4f2984){var _0xab168b=_0x39d21c['name'];var _0x50f51=0xa;var _0x2a94a6=[_0xda8f('0x52'),'left_join',_0xda8f('0x53'),_0xda8f('0x54')];var _0x528141={'SUM':_0xda8f('0x55'),'COUNT':_0xda8f('0x56'),'COUNT DISTINCT':_0xda8f('0x57'),'MAX':_0xda8f('0x58'),'MIN':_0xda8f('0x59'),'AVG':_0xda8f('0x5a'),'GROUP_CONCAT':_0xda8f('0x5b'),'GROUP_CONCAT ASC':_0xda8f('0x85'),'GROUP_CONCAT DESC':_0xda8f('0x86')};var _0x34ede2={'SEC_TO_TIME':_0xda8f('0x87'),'DATE':_0xda8f('0x5c'),'HOUR':_0xda8f('0x5d'),'ROUND':_0xda8f('0x88'),'UNIX_TIMESTAMP':_0xda8f('0x89')};var _0x3fdae7=function(_0x48c188){return!_[_0xda8f('0x5e')]([_0xda8f('0x5f'),_0xda8f('0x60'),'IS\x20EMPTY',_0xda8f('0x61')],_0x48c188);};var _0x4e8b20=function(_0x1b8bd5){if(!_0x1b8bd5||!_0x1b8bd5[_0xda8f('0x62')][_0xda8f('0x37')]){return'';}for(var _0x24593c='(',_0x318261=0x0;_0x318261<_0x1b8bd5[_0xda8f('0x62')][_0xda8f('0x37')];_0x318261+=0x1){_0x318261>0x0&&(_0x24593c+='\x20'+_0x1b8bd5[_0xda8f('0x63')]+'\x20');_0x24593c+=_0x1b8bd5[_0xda8f('0x62')][_0x318261]['group']?_0x4e8b20(_0x1b8bd5['rules'][_0x318261][_0xda8f('0x64')]):_0x1b8bd5[_0xda8f('0x62')][_0x318261]['field']+'\x20'+_0x1b8bd5['rules'][_0x318261][_0xda8f('0x66')]+(_0x3fdae7(_0x1b8bd5['rules'][_0x318261][_0xda8f('0x66')])?'\x20'+_0x1b8bd5[_0xda8f('0x62')][_0x318261]['value']:'');}return _0x24593c+')';};var _0x4a543a={'where':{'id':_0x27612b['id']}},_0xf913a3,_0x1cdb27,_0x1d778c,_0x5b5f35,_0x2778e7;_0x4a543a=_['merge']({},_0x4a543a,_0x4f2984);return db[_0xda8f('0x2c')]['find'](_0x4a543a)[_0xda8f('0x23')](function(_0x1cf326){if(_0x1cf326){_0xf913a3=_0x1cf326;return _0x1cf326[_0xda8f('0x68')]();}return null;})[_0xda8f('0x23')](function(_0x3bbb1c){if(_0x3bbb1c){if(!_0x3bbb1c[_0xda8f('0x37')]){throw new db[(_0xda8f('0x69'))][(_0xda8f('0x6a'))](_0xda8f('0x6b'),0x193);}_0x1cdb27=_0x3bbb1c;return db[_0xda8f('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xda8f('0x23')](function(_0x38188a){if(_0x38188a){_0x1d778c=_[_0xda8f('0x8a')](_0x38188a,'id');var _0x19902e;var _0x3866ce=squel[_0xda8f('0x8b')]();_0x3866ce[_0xda8f('0x6e')](_0xf913a3['table']);for(var _0x53a9c3=0x0;_0x53a9c3<_0x1cdb27[_0xda8f('0x37')];_0x53a9c3+=0x1){_0x19902e=_0x1cdb27[_0x53a9c3][_0xda8f('0x70')]?_0x1d778c[_0x1cdb27[_0x53a9c3][_0xda8f('0x70')]][_0xda8f('0x71')]:_0x1cdb27[_0x53a9c3][_0xda8f('0x65')];_0x19902e=_0x1cdb27[_0x53a9c3][_0xda8f('0x73')]?_[_0xda8f('0x72')](_0x528141[_0x1cdb27[_0x53a9c3][_0xda8f('0x73')]],'%s',_0x19902e):_0x19902e;_0x19902e=_0x1cdb27[_0x53a9c3][_0xda8f('0x74')]?_[_0xda8f('0x72')](_0x34ede2[_0x1cdb27[_0x53a9c3]['format']],'%s',_0x19902e):_0x19902e;if(_0x1cdb27[_0x53a9c3]['groupBy']){_0x3866ce['group'](_0x19902e);}_0x1cdb27[_0x53a9c3][_0xda8f('0x76')]&&_0x3866ce[_0xda8f('0x77')](_0x19902e,_0x1cdb27[_0x53a9c3][_0xda8f('0x76')]===_0xda8f('0x78')?![]:!![]);_0x3866ce[_0xda8f('0x65')](_0x19902e,_0x1cdb27[_0x53a9c3][_0xda8f('0x8c')]||_0x19902e);}if(_0xf913a3[_0xda8f('0x7a')]){_0xf913a3[_0xda8f('0x7a')]=JSON[_0xda8f('0x79')](_0xf913a3['joins']);for(var _0x1de696=0x0;_0x1de696<_0xf913a3[_0xda8f('0x7a')][_0xda8f('0x37')];_0x1de696+=0x1){if(_0xf913a3[_0xda8f('0x7a')][_0x1de696][_0xda8f('0x2f')]&&_['includes'](_0x2a94a6,_0xf913a3['joins'][_0x1de696][_0xda8f('0x2f')])&&_0xf913a3[_0xda8f('0x7a')][_0x1de696][_0xda8f('0x7b')]&&_0xf913a3[_0xda8f('0x7a')][_0x1de696][_0xda8f('0x7c')]&&_0xf913a3[_0xda8f('0x7a')][_0x1de696][_0xda8f('0x7d')]){_0x3866ce[_0xf913a3['joins'][_0x1de696][_0xda8f('0x2f')]](_0xf913a3['joins'][_0x1de696][_0xda8f('0x7c')],null,util[_0xda8f('0x74')]('%s.%s\x20=\x20%s.%s',_0xf913a3['table'],_0xf913a3[_0xda8f('0x7a')][_0x1de696][_0xda8f('0x7b')],_0xf913a3[_0xda8f('0x7a')][_0x1de696]['foreignTable'],_0xf913a3[_0xda8f('0x7a')][_0x1de696]['foreignKey']));}}}if(_0xf913a3['conditions']){_0xf913a3['conditions']=JSON[_0xda8f('0x79')](_0xf913a3[_0xda8f('0x7f')]);_0x3866ce[_0xda8f('0x3d')](_0x4e8b20(_0xf913a3[_0xda8f('0x7f')]['group']));}_0x2778e7=_0x3866ce[_0xda8f('0x8d')]();_0x3866ce[_0xda8f('0x1e')](_0x50f51);_0x3866ce[_0xda8f('0x1d')](0x0);return;}})['then'](function(){if(_0x39d21c[_0xda8f('0x8e')]===_0xda8f('0x8f')){return null;}var _0x581ade=_[_0xda8f('0x3e')](_0x39d21c,{'name':_0x39d21c[_0xda8f('0x90')]||_0x39d21c[_0xda8f('0x28')]||_0xf913a3['name'],'basename':_0xab168b,'savename':util['format'](_0xda8f('0x91'),_0x39d21c[_0xda8f('0x28')]||_0xf913a3[_0xda8f('0x28')],require(_0xda8f('0x92'))['generate'](0x4),_0x39d21c[_0xda8f('0x8e')]||'csv'),'reportId':_0xf913a3['id'],'reportType':_0xda8f('0x93')});return db[_0xda8f('0x94')][_0xda8f('0x46')](_0x581ade,{'raw':!![]});})['then'](function(_0x43a59d){if(_0xf913a3[_0xda8f('0x6f')]===_0xda8f('0x95')){_0x2778e7[_0xda8f('0x3d')](_0xf913a3[_0xda8f('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x39d21c[_0xda8f('0x96')],_0x39d21c['endDate']);}else{_0x2778e7[_0xda8f('0x3d')](_0xf913a3['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x39d21c[_0xda8f('0x96')],_0x39d21c[_0xda8f('0x97')]);}if(_0x43a59d){logger[_0xda8f('0x98')](_0xda8f('0x99'),_0x2778e7['toString']());require(_0xda8f('0x9a'))[_0xda8f('0x9b')](path[_0xda8f('0x52')](__dirname,_0xda8f('0x9c'),_0x43a59d[_0xda8f('0x8e')]),[_0x43a59d['id'],_0x2778e7['toString'](),path['join'](__dirname,_0xda8f('0x9d'),_0x43a59d[_0xda8f('0x9e')]),_0xab168b]);return _0x43a59d;}else{var _0x5aa84c=squel['select']();_0x5aa84c[_0xda8f('0x6e')]('('+_0x2778e7[_0xda8f('0x81')]()+')',_0xda8f('0x9f'));_0x5aa84c[_0xda8f('0x65')](_0xda8f('0xa0'),_0xda8f('0x1c'));_0x2778e7[_0xda8f('0x1e')](_0x39d21c['limit']||_0x50f51);_0x2778e7['offset'](_0x39d21c[_0xda8f('0x1d')]||0x0);return dbH[_0xda8f('0x82')]['query'](_0x5aa84c[_0xda8f('0x81')](),{'type':dbH[_0xda8f('0x82')][_0xda8f('0x83')]['SELECT']})[_0xda8f('0x23')](function(_0x4886fa){if(!_0x4886fa[_0xda8f('0x37')]){_0x5b5f35=0x0;}else{_0x5b5f35=_0x4886fa[0x0]['count']||0x0;}return dbH[_0xda8f('0x82')][_0xda8f('0x32')](_0x2778e7[_0xda8f('0x81')](),{'type':dbH[_0xda8f('0x82')][_0xda8f('0x83')][_0xda8f('0x84')]});})['then'](function(_0x3f038f){return{'rows':_0x3f038f||[],'count':_0x5b5f35};});}});}exports[_0xda8f('0xa1')]=function(_0x5c2979,_0x406ee3){return runReport(_0x5c2979[_0xda8f('0x42')],_0x5c2979['query'],_0x5c2979[_0xda8f('0x3f')])[_0xda8f('0x23')](respondWithResult(_0x406ee3,null))['catch'](handleError(_0x406ee3,null));};exports[_0xda8f('0xa2')]=runReport;exports[_0xda8f('0x32')]=function(_0x21f257,_0x55a677){var _0x1e4fe0=0xa;var _0x1a9f05=[_0xda8f('0x52'),_0xda8f('0xa3'),_0xda8f('0x53'),'cross_join'];var _0x5e442d={'SUM':_0xda8f('0x55'),'COUNT':_0xda8f('0x56'),'COUNT DISTINCT':_0xda8f('0x57'),'MAX':'MAX(%s)','MIN':_0xda8f('0x59'),'AVG':_0xda8f('0x5a'),'GROUP_CONCAT':_0xda8f('0x5b'),'GROUP_CONCAT ASC':_0xda8f('0x85'),'GROUP_CONCAT DESC':_0xda8f('0x86')};var _0x1250a4={'SEC_TO_TIME':_0xda8f('0x87'),'DATE':_0xda8f('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xda8f('0x88'),'UNIX_TIMESTAMP':_0xda8f('0x89')};var _0x513abd=function(_0x220d51){return!_[_0xda8f('0x5e')]([_0xda8f('0x5f'),_0xda8f('0x60'),_0xda8f('0xa4'),_0xda8f('0x61')],_0x220d51);};var _0x3aaae6=function(_0x5995ae){if(!_0x5995ae||!_0x5995ae[_0xda8f('0x62')][_0xda8f('0x37')]){return'';}for(var _0x16bb32='(',_0x26478e=0x0;_0x26478e<_0x5995ae[_0xda8f('0x62')][_0xda8f('0x37')];_0x26478e+=0x1){_0x26478e>0x0&&(_0x16bb32+='\x20'+_0x5995ae['operator']+'\x20');_0x16bb32+=_0x5995ae[_0xda8f('0x62')][_0x26478e]['group']?_0x3aaae6(_0x5995ae[_0xda8f('0x62')][_0x26478e][_0xda8f('0x64')]):_0x5995ae[_0xda8f('0x62')][_0x26478e][_0xda8f('0x65')]+'\x20'+_0x5995ae['rules'][_0x26478e][_0xda8f('0x66')]+(_0x513abd(_0x5995ae[_0xda8f('0x62')][_0x26478e][_0xda8f('0x66')])?'\x20'+_0x5995ae[_0xda8f('0x62')][_0x26478e][_0xda8f('0x67')]:'');}return _0x16bb32+')';};var _0x54b8b3={'where':{'id':_0x21f257['params']['id']}},_0x1503a2,_0x4733ae,_0x3a9e2e,_0x499bbd,_0x12c7e3;_0x54b8b3=_[_0xda8f('0x3e')]({},_0x54b8b3,_0x21f257[_0xda8f('0x3f')]);return db[_0xda8f('0x2c')][_0xda8f('0x44')](_0x54b8b3)[_0xda8f('0x23')](function(_0x34eb40){if(_0x34eb40){_0x1503a2=_0x34eb40;return _0x34eb40[_0xda8f('0x68')]();}return null;})[_0xda8f('0x23')](function(_0x621336){if(_0x621336){if(!_0x621336['length']){throw new db[(_0xda8f('0x69'))]['ValidationErrorItem'](_0xda8f('0x6b'),0x193);}_0x4733ae=_0x621336;return db[_0xda8f('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xda8f('0x23')](function(_0x8f32ce){if(_0x8f32ce){_0x3a9e2e=_[_0xda8f('0x8a')](_0x8f32ce,'id');var _0x191954;var _0x1d7ba4=squel['select']();_0x1d7ba4['from'](_0x1503a2[_0xda8f('0x6f')]);for(var _0x3da5ea=0x0;_0x3da5ea<_0x4733ae[_0xda8f('0x37')];_0x3da5ea+=0x1){_0x191954=_0x4733ae[_0x3da5ea][_0xda8f('0x70')]?_0x3a9e2e[_0x4733ae[_0x3da5ea]['MetricId']]['metric']:_0x4733ae[_0x3da5ea][_0xda8f('0x65')];_0x191954=_0x4733ae[_0x3da5ea]['function']?_[_0xda8f('0x72')](_0x5e442d[_0x4733ae[_0x3da5ea]['function']],'%s',_0x191954):_0x191954;_0x191954=_0x4733ae[_0x3da5ea][_0xda8f('0x74')]?_[_0xda8f('0x72')](_0x1250a4[_0x4733ae[_0x3da5ea][_0xda8f('0x74')]],'%s',_0x191954):_0x191954;if(_0x4733ae[_0x3da5ea]['groupBy']){_0x1d7ba4[_0xda8f('0x64')](_0x191954);}_0x4733ae[_0x3da5ea][_0xda8f('0x76')]&&_0x1d7ba4[_0xda8f('0x77')](_0x191954,_0x4733ae[_0x3da5ea][_0xda8f('0x76')]===_0xda8f('0x78')?![]:!![]);_0x1d7ba4[_0xda8f('0x65')](_0x191954,_0x4733ae[_0x3da5ea]['alias']||_0x191954);}if(_0x1503a2[_0xda8f('0x7a')]){_0x1503a2['joins']=JSON[_0xda8f('0x79')](_0x1503a2['joins']);for(var _0x4ce235=0x0;_0x4ce235<_0x1503a2[_0xda8f('0x7a')][_0xda8f('0x37')];_0x4ce235+=0x1){if(_0x1503a2['joins'][_0x4ce235][_0xda8f('0x2f')]&&_['includes'](_0x1a9f05,_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x2f')])&&_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x7b')]&&_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x7c')]&&_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x7d')]){_0x1d7ba4[_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x2f')]](_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x7c')],null,util[_0xda8f('0x74')](_0xda8f('0x7e'),_0x1503a2['table'],_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x7b')],_0x1503a2['joins'][_0x4ce235][_0xda8f('0x7c')],_0x1503a2[_0xda8f('0x7a')][_0x4ce235][_0xda8f('0x7d')]));}}}if(_0x1503a2[_0xda8f('0x7f')]){_0x1503a2[_0xda8f('0x7f')]=JSON['parse'](_0x1503a2[_0xda8f('0x7f')]);_0x1d7ba4[_0xda8f('0x3d')](_0x3aaae6(_0x1503a2[_0xda8f('0x7f')]['group']));}_0x12c7e3=_0x1d7ba4['clone']();_0x1d7ba4[_0xda8f('0x1e')](_0x1e4fe0);_0x1d7ba4[_0xda8f('0x1d')](0x0);logger[_0xda8f('0x80')](_0xda8f('0xa5'),_0x1d7ba4[_0xda8f('0x81')]());return dbH['sequelize'][_0xda8f('0x32')](_0x1d7ba4[_0xda8f('0x81')](),{'type':dbH[_0xda8f('0x82')][_0xda8f('0x83')][_0xda8f('0x84')]});}})[_0xda8f('0x23')](function(){return{'sql':_0x12c7e3['toString']()};})['then'](respondWithResult(_0x55a677,null))[_0xda8f('0x45')](handleError(_0x55a677,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index c087899..8c26b34 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 _0x8703=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x2a4569,_0x353e8f){var _0x27cae3=function(_0x4c809f){while(--_0x4c809f){_0x2a4569['push'](_0x2a4569['shift']());}};_0x27cae3(++_0x353e8f);}(_0x8703,0x196));var _0x3870=function(_0x19afbc,_0x5bc711){_0x19afbc=_0x19afbc-0x0;var _0x22a698=_0x8703[_0x19afbc];return _0x22a698;};'use strict';var _=require(_0x3870('0x0'));var util=require(_0x3870('0x1'));var logger=require(_0x3870('0x2'))('api');var moment=require(_0x3870('0x3'));var BPromise=require(_0x3870('0x4'));var rp=require(_0x3870('0x5'));var fs=require('fs');var path=require(_0x3870('0x6'));var rimraf=require(_0x3870('0x7'));var config=require('../../config/environment');var attributes=require(_0x3870('0x8'));module[_0x3870('0x9')]=function(_0x4f8bea,_0xf8468a){return _0x4f8bea['define'](_0x3870('0xa'),attributes,{'tableName':_0x3870('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xccf8=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes'];(function(_0x48245e,_0x178e51){var _0x4e5e30=function(_0x428bfd){while(--_0x428bfd){_0x48245e['push'](_0x48245e['shift']());}};_0x4e5e30(++_0x178e51);}(_0xccf8,0x1b6));var _0x8ccf=function(_0x4af703,_0x1b6475){_0x4af703=_0x4af703-0x0;var _0x380feb=_0xccf8[_0x4af703];return _0x380feb;};'use strict';var _=require(_0x8ccf('0x0'));var util=require(_0x8ccf('0x1'));var logger=require(_0x8ccf('0x2'))(_0x8ccf('0x3'));var moment=require(_0x8ccf('0x4'));var BPromise=require(_0x8ccf('0x5'));var rp=require(_0x8ccf('0x6'));var fs=require('fs');var path=require(_0x8ccf('0x7'));var rimraf=require('rimraf');var config=require(_0x8ccf('0x8'));var attributes=require(_0x8ccf('0x9'));module[_0x8ccf('0xa')]=function(_0x4b5f49,_0x19352d){return _0x4b5f49[_0x8ccf('0xb')](_0x8ccf('0xc'),attributes,{'tableName':_0x8ccf('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 9685f1d..7b48ca3 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 _0x44fd=['client','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise'];(function(_0x273333,_0x279f46){var _0x2c6e8f=function(_0x17c2c0){while(--_0x17c2c0){_0x273333['push'](_0x273333['shift']());}};_0x2c6e8f(++_0x279f46);}(_0x44fd,0x1d8));var _0xd44f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x44fd[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xd44f('0x0'));var util=require(_0xd44f('0x1'));var moment=require(_0xd44f('0x2'));var BPromise=require(_0xd44f('0x3'));var rs=require(_0xd44f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd44f('0x5'));var logger=require(_0xd44f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd44f('0x7'));var client=jayson[_0xd44f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29bfd2,_0x5e9e46,_0x3a37d1){return new BPromise(function(_0x321bb0,_0x149173){return client[_0xd44f('0x9')](_0x29bfd2,_0x3a37d1)[_0xd44f('0xa')](function(_0x474cda){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5e9e46,_0xd44f('0xb'));logger[_0xd44f('0xc')](_0xd44f('0xd'),_0x5e9e46,_0xd44f('0xb'),JSON[_0xd44f('0xe')](_0x474cda));if(_0x474cda[_0xd44f('0xf')]){if(_0x474cda[_0xd44f('0xf')]['code']===0x1f4){logger[_0xd44f('0xf')](_0xd44f('0x10'),_0x5e9e46,_0x474cda['error'][_0xd44f('0x11')]);return _0x149173(_0x474cda['error'][_0xd44f('0x11')]);}logger[_0xd44f('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e9e46,_0x474cda[_0xd44f('0xf')][_0xd44f('0x11')]);return _0x321bb0(_0x474cda['error']['message']);}else{logger[_0xd44f('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e9e46,_0xd44f('0xb'));_0x321bb0(_0x474cda[_0xd44f('0x13')][_0xd44f('0x11')]);}})['catch'](function(_0x15beca){logger[_0xd44f('0xf')](_0xd44f('0x10'),_0x5e9e46,_0x15beca);_0x149173(_0x15beca);});});}
\ No newline at end of file
+var _0xbbc8=['client','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x1444e4,_0xb9594c){var _0x306585=function(_0x97153f){while(--_0x97153f){_0x1444e4['push'](_0x1444e4['shift']());}};_0x306585(++_0xb9594c);}(_0xbbc8,0xd0));var _0x8bbc=function(_0x22b390,_0x959f67){_0x22b390=_0x22b390-0x0;var _0x4ac5ac=_0xbbc8[_0x22b390];return _0x4ac5ac;};'use strict';var _=require(_0x8bbc('0x0'));var util=require(_0x8bbc('0x1'));var moment=require(_0x8bbc('0x2'));var BPromise=require(_0x8bbc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bbc('0x5'));var logger=require('../../config/logger')(_0x8bbc('0x6'));var config=require('../../config/environment');var jayson=require(_0x8bbc('0x7'));var client=jayson[_0x8bbc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dfb40,_0x559db2,_0x481b8e){return new BPromise(function(_0x997d20,_0x21ef0b){return client['request'](_0x3dfb40,_0x481b8e)[_0x8bbc('0x9')](function(_0x4c8418){logger['info'](_0x8bbc('0xa'),_0x559db2,_0x8bbc('0xb'));logger[_0x8bbc('0xc')](_0x8bbc('0xd'),_0x559db2,_0x8bbc('0xb'),JSON['stringify'](_0x4c8418));if(_0x4c8418[_0x8bbc('0xe')]){if(_0x4c8418['error']['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x559db2,_0x4c8418[_0x8bbc('0xe')][_0x8bbc('0xf')]);return _0x21ef0b(_0x4c8418[_0x8bbc('0xe')][_0x8bbc('0xf')]);}logger[_0x8bbc('0xe')](_0x8bbc('0xa'),_0x559db2,_0x4c8418[_0x8bbc('0xe')][_0x8bbc('0xf')]);return _0x997d20(_0x4c8418[_0x8bbc('0xe')]['message']);}else{logger[_0x8bbc('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x559db2,_0x8bbc('0xb'));_0x997d20(_0x4c8418[_0x8bbc('0x11')][_0x8bbc('0xf')]);}})['catch'](function(_0x4636bd){logger[_0x8bbc('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x559db2,_0x4636bd);_0x21ef0b(_0x4636bd);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 19c750c..93f9d05 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 _0x4bbf=['/:id/query','query','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','/:id/run','run'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4bbf,0xd0));var _0xf4bb=function(_0x17cdb2,_0x16f15d){_0x17cdb2=_0x17cdb2-0x0;var _0x488955=_0x4bbf[_0x17cdb2];return _0x488955;};'use strict';var multer=require(_0xf4bb('0x0'));var util=require('util');var path=require(_0xf4bb('0x1'));var timeout=require(_0xf4bb('0x2'));var express=require('express');var router=express[_0xf4bb('0x3')]();var fs_extra=require(_0xf4bb('0x4'));var auth=require(_0xf4bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf4bb('0x6'));var controller=require(_0xf4bb('0x7'));router['get']('/',auth[_0xf4bb('0x8')](),controller[_0xf4bb('0x9')]);router['get'](_0xf4bb('0xa'),auth[_0xf4bb('0x8')](),controller[_0xf4bb('0xb')]);router[_0xf4bb('0xc')](_0xf4bb('0xd'),auth[_0xf4bb('0x8')](),controller[_0xf4bb('0xe')]);router['get'](_0xf4bb('0xf'),auth[_0xf4bb('0x8')](),controller[_0xf4bb('0x10')]);router['get'](_0xf4bb('0x11'),auth[_0xf4bb('0x8')](),controller[_0xf4bb('0x12')]);router[_0xf4bb('0x13')]('/',auth[_0xf4bb('0x8')](),controller['create']);router[_0xf4bb('0x14')](_0xf4bb('0xa'),auth[_0xf4bb('0x8')](),controller[_0xf4bb('0x15')]);router[_0xf4bb('0x16')](_0xf4bb('0xa'),auth[_0xf4bb('0x8')](),controller[_0xf4bb('0x17')]);module[_0xf4bb('0x18')]=router;
\ No newline at end of file
+var _0xc4ec=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x238469,_0x28b7e9){var _0x18c9e5=function(_0x1df8e7){while(--_0x1df8e7){_0x238469['push'](_0x238469['shift']());}};_0x18c9e5(++_0x28b7e9);}(_0xc4ec,0x1d1));var _0xcc4e=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xc4ec[_0x38ce4c];return _0x5d4544;};'use strict';var multer=require(_0xcc4e('0x0'));var util=require('util');var path=require(_0xcc4e('0x1'));var timeout=require(_0xcc4e('0x2'));var express=require(_0xcc4e('0x3'));var router=express[_0xcc4e('0x4')]();var fs_extra=require(_0xcc4e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcc4e('0x6'));var config=require(_0xcc4e('0x7'));var controller=require(_0xcc4e('0x8'));router[_0xcc4e('0x9')]('/',auth[_0xcc4e('0xa')](),controller['index']);router[_0xcc4e('0x9')](_0xcc4e('0xb'),auth[_0xcc4e('0xa')](),controller[_0xcc4e('0xc')]);router[_0xcc4e('0x9')](_0xcc4e('0xd'),auth[_0xcc4e('0xa')](),controller[_0xcc4e('0xe')]);router['get'](_0xcc4e('0xf'),auth['isAuthenticated'](),controller[_0xcc4e('0x10')]);router['get'](_0xcc4e('0x11'),auth[_0xcc4e('0xa')](),controller[_0xcc4e('0x12')]);router[_0xcc4e('0x13')]('/',auth[_0xcc4e('0xa')](),controller[_0xcc4e('0x14')]);router[_0xcc4e('0x15')](_0xcc4e('0xb'),auth[_0xcc4e('0xa')](),controller[_0xcc4e('0x16')]);router[_0xcc4e('0x17')](_0xcc4e('0xb'),auth['isAuthenticated'](),controller[_0xcc4e('0x18')]);module[_0xcc4e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 7aa2ef9..91931c9 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x242f63,_0x228566){var _0x17df2b=function(_0x1bf179){while(--_0x1bf179){_0x242f63['push'](_0x242f63['shift']());}};_0x17df2b(++_0x228566);}(_0x6f47,0xc7));var _0x76f4=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x6f47[_0xe66cf2];return _0x2d84e7;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x416c1a,_0x19c685){var _0xcf7188=function(_0x1e31e2){while(--_0x1e31e2){_0x416c1a['push'](_0x416c1a['shift']());}};_0xcf7188(++_0x19c685);}(_0x2bd8,0x130));var _0x82bd=function(_0x9c284f,_0xc6c39f){_0x9c284f=_0x9c284f-0x0;var _0x325d5e=_0x2bd8[_0x9c284f];return _0x325d5e;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 537ee92..d128675 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 _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0xd0e639,_0x60783b){var _0x1a6948=function(_0x59bf93){while(--_0x59bf93){_0xd0e639['push'](_0xd0e639['shift']());}};_0x1a6948(++_0x60783b);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x468e45,_0x27afe2){var _0x2c1e49=function(_0x10a6b3){while(--_0x10a6b3){_0x468e45['push'](_0x468e45['shift']());}};_0x2c1e49(++_0x27afe2);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index dada23b..22eddc6 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 _0xb30f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x3b8952,_0x24296d){var _0x4ad6a8=function(_0x978fbe){while(--_0x978fbe){_0x3b8952['push'](_0x3b8952['shift']());}};_0x4ad6a8(++_0x24296d);}(_0xb30f,0x89));var _0xfb30=function(_0x2e41ed,_0x26dc33){_0x2e41ed=_0x2e41ed-0x0;var _0xf12845=_0xb30f[_0x2e41ed];return _0xf12845;};'use strict';var _=require(_0xfb30('0x0'));var util=require(_0xfb30('0x1'));var logger=require(_0xfb30('0x2'))(_0xfb30('0x3'));var moment=require(_0xfb30('0x4'));var BPromise=require(_0xfb30('0x5'));var rp=require(_0xfb30('0x6'));var fs=require('fs');var path=require(_0xfb30('0x7'));var rimraf=require(_0xfb30('0x8'));var config=require(_0xfb30('0x9'));var attributes=require('./analyticDefaultReport.attributes');module[_0xfb30('0xa')]=function(_0x5358f4,_0x34e987){return _0x5358f4[_0xfb30('0xb')](_0xfb30('0xc'),attributes,{'tableName':_0xfb30('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8776=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','lodash','util','api'];(function(_0xb46359,_0x4391ad){var _0x6d9807=function(_0x350fdc){while(--_0x350fdc){_0xb46359['push'](_0xb46359['shift']());}};_0x6d9807(++_0x4391ad);}(_0x8776,0xd9));var _0x6877=function(_0x5bd6c7,_0x24f383){_0x5bd6c7=_0x5bd6c7-0x0;var _0x5d8ef7=_0x8776[_0x5bd6c7];return _0x5d8ef7;};'use strict';var _=require(_0x6877('0x0'));var util=require(_0x6877('0x1'));var logger=require('../../config/logger')(_0x6877('0x2'));var moment=require(_0x6877('0x3'));var BPromise=require(_0x6877('0x4'));var rp=require(_0x6877('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6877('0x6'));var config=require(_0x6877('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x6877('0x8')]=function(_0x32f057,_0x1cdb4c){return _0x32f057[_0x6877('0x9')](_0x6877('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 1f58bcb..a29c329 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 _0xf16f=['client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/environment','jayson/promise'];(function(_0x47a14b,_0x6f8c0){var _0x52cf12=function(_0x232ef2){while(--_0x232ef2){_0x47a14b['push'](_0x47a14b['shift']());}};_0x52cf12(++_0x6f8c0);}(_0xf16f,0x1c2));var _0xff16=function(_0x2bc4fd,_0x298c78){_0x2bc4fd=_0x2bc4fd-0x0;var _0x59a56d=_0xf16f[_0x2bc4fd];return _0x59a56d;};'use strict';var _=require(_0xff16('0x0'));var util=require(_0xff16('0x1'));var moment=require(_0xff16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff16('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xff16('0x4'));var jayson=require(_0xff16('0x5'));var client=jayson[_0xff16('0x6')][_0xff16('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2be742,_0x3eb5df,_0x587495){return new BPromise(function(_0x700de7,_0x2fd543){return client['request'](_0x2be742,_0x587495)[_0xff16('0x8')](function(_0x2bf9c8){logger[_0xff16('0x9')](_0xff16('0xa'),_0x3eb5df,_0xff16('0xb'));logger[_0xff16('0xc')](_0xff16('0xd'),_0x3eb5df,_0xff16('0xb'),JSON[_0xff16('0xe')](_0x2bf9c8));if(_0x2bf9c8[_0xff16('0xf')]){if(_0x2bf9c8['error'][_0xff16('0x10')]===0x1f4){logger[_0xff16('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3eb5df,_0x2bf9c8[_0xff16('0xf')][_0xff16('0x11')]);return _0x2fd543(_0x2bf9c8['error'][_0xff16('0x11')]);}logger['error'](_0xff16('0xa'),_0x3eb5df,_0x2bf9c8[_0xff16('0xf')][_0xff16('0x11')]);return _0x700de7(_0x2bf9c8[_0xff16('0xf')][_0xff16('0x11')]);}else{logger['info'](_0xff16('0xa'),_0x3eb5df,_0xff16('0xb'));_0x700de7(_0x2bf9c8[_0xff16('0x12')][_0xff16('0x11')]);}})['catch'](function(_0x29d578){logger[_0xff16('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3eb5df,_0x29d578);_0x2fd543(_0x29d578);});});}
\ No newline at end of file
+var _0x1559=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x14a84e,_0xffb06){var _0x2aca47=function(_0x5cdc00){while(--_0x5cdc00){_0x14a84e['push'](_0x14a84e['shift']());}};_0x2aca47(++_0xffb06);}(_0x1559,0x163));var _0x9155=function(_0x48fb10,_0xa50a89){_0x48fb10=_0x48fb10-0x0;var _0x534251=_0x1559[_0x48fb10];return _0x534251;};'use strict';var _=require(_0x9155('0x0'));var util=require('util');var moment=require(_0x9155('0x1'));var BPromise=require('bluebird');var rs=require(_0x9155('0x2'));var fs=require('fs');var Redis=require(_0x9155('0x3'));var db=require(_0x9155('0x4'))['db'];var utils=require(_0x9155('0x5'));var logger=require(_0x9155('0x6'))('rpc');var config=require(_0x9155('0x7'));var jayson=require(_0x9155('0x8'));var client=jayson[_0x9155('0x9')][_0x9155('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5772f4,_0x5e8c77,_0x4c8ad0){return new BPromise(function(_0x2529cb,_0x276d48){return client['request'](_0x5772f4,_0x4c8ad0)[_0x9155('0xb')](function(_0xc2db51){logger[_0x9155('0xc')](_0x9155('0xd'),_0x5e8c77,'request\x20sent');logger[_0x9155('0xe')](_0x9155('0xf'),_0x5e8c77,_0x9155('0x10'),JSON['stringify'](_0xc2db51));if(_0xc2db51['error']){if(_0xc2db51[_0x9155('0x11')][_0x9155('0x12')]===0x1f4){logger[_0x9155('0x11')](_0x9155('0xd'),_0x5e8c77,_0xc2db51['error'][_0x9155('0x13')]);return _0x276d48(_0xc2db51[_0x9155('0x11')]['message']);}logger[_0x9155('0x11')](_0x9155('0xd'),_0x5e8c77,_0xc2db51[_0x9155('0x11')]['message']);return _0x2529cb(_0xc2db51['error'][_0x9155('0x13')]);}else{logger['info'](_0x9155('0xd'),_0x5e8c77,_0x9155('0x10'));_0x2529cb(_0xc2db51[_0x9155('0x14')][_0x9155('0x13')]);}})[_0x9155('0x15')](function(_0x21a188){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5e8c77,_0x21a188);_0x276d48(_0x21a188);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 93e1029..d5ef8cb 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 _0x7e5c=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x19eef5,_0x45589c){var _0xef7759=function(_0x1a3b94){while(--_0x1a3b94){_0x19eef5['push'](_0x19eef5['shift']());}};_0xef7759(++_0x45589c);}(_0x7e5c,0xc0));var _0xc7e5=function(_0x43d0dd,_0x1bd3d2){_0x43d0dd=_0x43d0dd-0x0;var _0x233879=_0x7e5c[_0x43d0dd];return _0x233879;};'use strict';var multer=require('multer');var util=require(_0xc7e5('0x0'));var path=require(_0xc7e5('0x1'));var timeout=require(_0xc7e5('0x2'));var express=require(_0xc7e5('0x3'));var router=express[_0xc7e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc7e5('0x5'));var interaction=require(_0xc7e5('0x6'));var config=require(_0xc7e5('0x7'));var controller=require(_0xc7e5('0x8'));router[_0xc7e5('0x9')]('/',auth[_0xc7e5('0xa')](),controller[_0xc7e5('0xb')]);router[_0xc7e5('0x9')](_0xc7e5('0xc'),auth[_0xc7e5('0xa')](),controller[_0xc7e5('0xd')]);router['get'](_0xc7e5('0xe'),auth[_0xc7e5('0xa')](),controller[_0xc7e5('0xf')]);router[_0xc7e5('0x9')](_0xc7e5('0x10'),auth['isAuthenticated'](),controller[_0xc7e5('0x11')]);router[_0xc7e5('0x9')]('/:id/query',auth[_0xc7e5('0xa')](),controller[_0xc7e5('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc7e5('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc7e5('0x14')](_0xc7e5('0xc'),auth[_0xc7e5('0xa')](),controller[_0xc7e5('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xd939=['/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','preview'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xd939,0x12b));var _0x9d93=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0xd939[_0x49beea];return _0x27693a;};'use strict';var multer=require(_0x9d93('0x0'));var util=require(_0x9d93('0x1'));var path=require(_0x9d93('0x2'));var timeout=require(_0x9d93('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9d93('0x4'));var auth=require(_0x9d93('0x5'));var interaction=require(_0x9d93('0x6'));var config=require(_0x9d93('0x7'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9d93('0x8')](_0x9d93('0x9'),auth[_0x9d93('0xa')](),controller[_0x9d93('0xb')]);router[_0x9d93('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0x9d93('0xc')]);router[_0x9d93('0x8')](_0x9d93('0xd'),auth['isAuthenticated'](),controller[_0x9d93('0xe')]);router['get'](_0x9d93('0xf'),auth['isAuthenticated'](),controller[_0x9d93('0x10')]);router[_0x9d93('0x11')]('/',auth[_0x9d93('0xa')](),controller[_0x9d93('0x12')]);router[_0x9d93('0x13')](_0x9d93('0x9'),auth[_0x9d93('0xa')](),controller[_0x9d93('0x14')]);router[_0x9d93('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9d93('0x16')]);module[_0x9d93('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index b50800c..5b07011 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 _0x3a60=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x3a60,0x152));var _0x03a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a60[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x03a6('0x0'));module[_0x03a6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x03a6('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x03a6('0x3')](_0x03a6('0x4'),_0x03a6('0x5'),_0x03a6('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x03a6('0x7')]},'endDate':{'type':Sequelize[_0x03a6('0x7')]},'status':{'type':Sequelize[_0x03a6('0x2')],'defaultValue':_0x03a6('0x8')},'type':{'type':Sequelize[_0x03a6('0x3')](_0x03a6('0x9'),_0x03a6('0xa')),'allowNull':![],'defaultValue':_0x03a6('0x9')},'reportId':{'type':Sequelize[_0x03a6('0xb')](0xb)[_0x03a6('0xc')]},'reportType':{'type':Sequelize[_0x03a6('0x2')]}};
\ No newline at end of file
+var _0x38c3=['INTEGER','sequelize','STRING','ENUM','csv','xlsx','DATE','manual','scheduled'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x38c3,0x106));var _0x338c=function(_0x259ce8,_0x798276){_0x259ce8=_0x259ce8-0x0;var _0x5ef5c2=_0x38c3[_0x259ce8];return _0x5ef5c2;};'use strict';var Sequelize=require(_0x338c('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x338c('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x338c('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x338c('0x2')](_0x338c('0x3'),'pdf',_0x338c('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x338c('0x5')]},'status':{'type':Sequelize[_0x338c('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x338c('0x6'),_0x338c('0x7')),'allowNull':![],'defaultValue':_0x338c('0x6')},'reportId':{'type':Sequelize[_0x338c('0x8')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 705a2fb..6fd68ba 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 _0x8561=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','end','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find'];(function(_0x1b319f,_0x2598b1){var _0x19dbcf=function(_0x4e10d3){while(--_0x4e10d3){_0x1b319f['push'](_0x1b319f['shift']());}};_0x19dbcf(++_0x2598b1);}(_0x8561,0x1ee));var _0x1856=function(_0x422ac3,_0x48bbd4){_0x422ac3=_0x422ac3-0x0;var _0x53c0d4=_0x8561[_0x422ac3];return _0x53c0d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1856('0x0'));var zipdir=require(_0x1856('0x1'));var jsonpatch=require(_0x1856('0x2'));var rp=require(_0x1856('0x3'));var moment=require(_0x1856('0x4'));var BPromise=require(_0x1856('0x5'));var Mustache=require('mustache');var util=require(_0x1856('0x6'));var path=require(_0x1856('0x7'));var sox=require('sox');var csv=require(_0x1856('0x8'));var ejs=require(_0x1856('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1856('0xa'));var squel=require(_0x1856('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1856('0xc'));var toCsv=require(_0x1856('0x8'));var querystring=require(_0x1856('0xd'));var Papa=require(_0x1856('0xe'));var Redis=require(_0x1856('0xf'));var authService=require(_0x1856('0x10'));var qs=require(_0x1856('0x11'));var as=require(_0x1856('0x12'));var hardwareService=require(_0x1856('0x13'));var logger=require('../../config/logger')(_0x1856('0x14'));var utils=require(_0x1856('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1856('0x16'))['db'];function respondWithStatusCode(_0x197221,_0x373507){_0x373507=_0x373507||0xcc;return function(_0x3cdd50){if(_0x3cdd50){return _0x197221[_0x1856('0x17')](_0x373507);}return _0x197221['status'](_0x373507)['end']();};}function respondWithResult(_0x52b532,_0x121797){_0x121797=_0x121797||0xc8;return function(_0x54dc47){if(_0x54dc47){return _0x52b532[_0x1856('0x18')](_0x121797)[_0x1856('0x19')](_0x54dc47);}};}function respondWithFilteredResult(_0x4ee354,_0x508d7b){return function(_0x2db8c2){if(_0x2db8c2){var _0x1bfef7=typeof _0x508d7b[_0x1856('0x1a')]===_0x1856('0x1b')&&typeof _0x508d7b[_0x1856('0x1c')]===_0x1856('0x1b');var _0x598f8e=_0x2db8c2[_0x1856('0x1d')];var _0x59eac0=_0x1bfef7?0x0:_0x508d7b[_0x1856('0x1a')];var _0xcec0aa=_0x1bfef7?_0x2db8c2['count']:_0x508d7b['offset']+_0x508d7b[_0x1856('0x1c')];var _0x5155d9;if(_0xcec0aa>=_0x598f8e){_0xcec0aa=_0x598f8e;_0x5155d9=0xc8;}else{_0x5155d9=0xce;}_0x4ee354[_0x1856('0x18')](_0x5155d9);return _0x4ee354['set']('Content-Range',_0x59eac0+'-'+_0xcec0aa+'/'+_0x598f8e)[_0x1856('0x19')](_0x2db8c2);}return null;};}function patchUpdates(_0x1f92e0){return function(_0xcb4eae){try{jsonpatch['apply'](_0xcb4eae,_0x1f92e0,!![]);}catch(_0x5e49bc){return BPromise[_0x1856('0x1e')](_0x5e49bc);}return _0xcb4eae[_0x1856('0x1f')]();};}function saveUpdates(_0x1d5af0,_0x41b0a3){return function(_0x3ff8dc){if(_0x3ff8dc){return _0x3ff8dc[_0x1856('0x20')](_0x1d5af0)[_0x1856('0x21')](function(_0x5a994d){return _0x5a994d;});}return null;};}function removeEntity(_0x512477,_0x49e50b){return function(_0x44a04d){if(_0x44a04d){return _0x44a04d[_0x1856('0x22')]()[_0x1856('0x21')](function(){var _0x1ebd65=_0x44a04d['get']({'plain':!![]});var _0x2fe1c8='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x2fe1c8,'resourceId':_0x1ebd65['id']}})[_0x1856('0x21')](function(){return _0x44a04d;});})[_0x1856('0x21')](function(){_0x512477[_0x1856('0x18')](0xcc)[_0x1856('0x23')]();});}};}function handleEntityNotFound(_0x3a3e0a,_0x46f87a){return function(_0x4e46d1){if(!_0x4e46d1){_0x3a3e0a[_0x1856('0x17')](0x194);}return _0x4e46d1;};}function handleError(_0x90b80,_0x1dcbc2){_0x1dcbc2=_0x1dcbc2||0x1f4;return function(_0x4914fe){logger[_0x1856('0x24')](_0x4914fe['stack']);if(_0x4914fe[_0x1856('0x25')]){delete _0x4914fe['name'];}_0x90b80[_0x1856('0x18')](_0x1dcbc2)[_0x1856('0x26')](_0x4914fe);};}exports['index']=function(_0x2c275a,_0x42ff4d){var _0xef3d9b={},_0x2a616c={},_0x5bd76d={'count':0x0,'rows':[]};var _0x4afbba=_[_0x1856('0x27')](db[_0x1856('0x28')][_0x1856('0x29')],function(_0x158567){return{'name':_0x158567[_0x1856('0x2a')],'type':_0x158567[_0x1856('0x2b')][_0x1856('0x2c')]};});_0x2a616c[_0x1856('0x2d')]=_[_0x1856('0x27')](_0x4afbba,_0x1856('0x25'));_0x2a616c[_0x1856('0x2e')]=_[_0x1856('0x2f')](_0x2c275a[_0x1856('0x2e')]);_0x2a616c['filters']=_[_0x1856('0x30')](_0x2a616c[_0x1856('0x2d')],_0x2a616c[_0x1856('0x2e')]);_0xef3d9b['attributes']=_[_0x1856('0x30')](_0x2a616c[_0x1856('0x2d')],qs['fields'](_0x2c275a['query'][_0x1856('0x31')]));_0xef3d9b[_0x1856('0x32')]=_0xef3d9b[_0x1856('0x32')]['length']?_0xef3d9b[_0x1856('0x32')]:_0x2a616c['model'];if(!_0x2c275a['query'][_0x1856('0x33')](_0x1856('0x34'))){_0xef3d9b[_0x1856('0x1c')]=qs[_0x1856('0x1c')](_0x2c275a[_0x1856('0x2e')][_0x1856('0x1c')]);_0xef3d9b[_0x1856('0x1a')]=qs[_0x1856('0x1a')](_0x2c275a[_0x1856('0x2e')][_0x1856('0x1a')]);}_0xef3d9b[_0x1856('0x35')]=qs[_0x1856('0x36')](_0x2c275a[_0x1856('0x2e')]['sort']);_0xef3d9b[_0x1856('0x37')]=qs[_0x1856('0x38')](_[_0x1856('0x39')](_0x2c275a['query'],_0x2a616c[_0x1856('0x38')]),_0x4afbba);if(_0x2c275a['query'][_0x1856('0x3a')]){_0xef3d9b[_0x1856('0x37')]=_[_0x1856('0x3b')](_0xef3d9b['where'],{'$or':_[_0x1856('0x27')](_0x4afbba,function(_0x57a651){if(_0x57a651[_0x1856('0x2b')]!==_0x1856('0x3c')){var _0x319a1b={};_0x319a1b[_0x57a651['name']]={'$like':'%'+_0x2c275a[_0x1856('0x2e')]['filter']+'%'};return _0x319a1b;}})});}_0xef3d9b=_[_0x1856('0x3b')]({},_0xef3d9b,_0x2c275a[_0x1856('0x3d')]);var _0x492564={'where':_0xef3d9b[_0x1856('0x37')]};return db[_0x1856('0x28')]['count'](_0x492564)[_0x1856('0x21')](function(_0x341fc4){_0x5bd76d['count']=_0x341fc4;if(_0x2c275a[_0x1856('0x2e')][_0x1856('0x3e')]){_0xef3d9b['include']=[{'all':!![]}];}return db[_0x1856('0x28')][_0x1856('0x3f')](_0xef3d9b);})[_0x1856('0x21')](function(_0x3e49f5){_0x5bd76d[_0x1856('0x40')]=_0x3e49f5;return _0x5bd76d;})[_0x1856('0x21')](respondWithFilteredResult(_0x42ff4d,_0xef3d9b))[_0x1856('0x41')](handleError(_0x42ff4d,null));};exports['show']=function(_0x163b9c,_0x210dd9){var _0x28cbec={'raw':!![],'where':{'id':_0x163b9c[_0x1856('0x42')]['id']}},_0x1dda0c={};_0x1dda0c[_0x1856('0x2d')]=_[_0x1856('0x2f')](db[_0x1856('0x28')][_0x1856('0x29')]);_0x1dda0c['query']=_[_0x1856('0x2f')](_0x163b9c['query']);_0x1dda0c[_0x1856('0x38')]=_[_0x1856('0x30')](_0x1dda0c['model'],_0x1dda0c[_0x1856('0x2e')]);_0x28cbec['attributes']=_[_0x1856('0x30')](_0x1dda0c[_0x1856('0x2d')],qs[_0x1856('0x31')](_0x163b9c[_0x1856('0x2e')][_0x1856('0x31')]));_0x28cbec[_0x1856('0x32')]=_0x28cbec[_0x1856('0x32')][_0x1856('0x43')]?_0x28cbec[_0x1856('0x32')]:_0x1dda0c['model'];if(_0x163b9c[_0x1856('0x2e')][_0x1856('0x3e')]){_0x28cbec[_0x1856('0x44')]=[{'all':!![]}];}_0x28cbec=_[_0x1856('0x3b')]({},_0x28cbec,_0x163b9c[_0x1856('0x3d')]);return db[_0x1856('0x28')][_0x1856('0x45')](_0x28cbec)[_0x1856('0x21')](handleEntityNotFound(_0x210dd9,null))['then'](respondWithResult(_0x210dd9,null))['catch'](handleError(_0x210dd9,null));};exports[_0x1856('0x46')]=function(_0x464122,_0x1076d1){return db[_0x1856('0x28')][_0x1856('0x46')](_0x464122['body'],{})[_0x1856('0x21')](function(_0x258aa4){var _0x4c59b1=_0x464122[_0x1856('0x47')]['get']({'plain':!![]});if(!_0x4c59b1)throw new Error(_0x1856('0x48'));if(_0x4c59b1[_0x1856('0x49')]===_0x1856('0x47')){var _0x59b26d=_0x258aa4[_0x1856('0x4a')]({'plain':!![]});var _0x1c138e=_0x1856('0x4b');return db[_0x1856('0x4c')][_0x1856('0x45')]({'where':{'name':_0x1c138e,'userProfileId':_0x4c59b1[_0x1856('0x4d')]},'raw':!![]})['then'](function(_0x1201ab){if(_0x1201ab&&_0x1201ab[_0x1856('0x4e')]===0x0){return db[_0x1856('0x4f')]['create']({'name':_0x59b26d[_0x1856('0x25')],'resourceId':_0x59b26d['id'],'type':_0x1201ab[_0x1856('0x25')],'sectionId':_0x1201ab['id']},{})['then'](function(){return _0x258aa4;});}else{return _0x258aa4;}})[_0x1856('0x41')](function(_0x5a3ef5){logger['error'](_0x1856('0x50'),_0x5a3ef5);throw _0x5a3ef5;});}return _0x258aa4;})[_0x1856('0x21')](respondWithResult(_0x1076d1,0xc9))[_0x1856('0x41')](handleError(_0x1076d1,null));};exports[_0x1856('0x20')]=function(_0x3639ca,_0x1df51c){if(_0x3639ca[_0x1856('0x51')]['id']){delete _0x3639ca[_0x1856('0x51')]['id'];}return db['AnalyticExtractedReport'][_0x1856('0x45')]({'where':{'id':_0x3639ca[_0x1856('0x42')]['id']}})[_0x1856('0x21')](handleEntityNotFound(_0x1df51c,null))['then'](saveUpdates(_0x3639ca[_0x1856('0x51')],null))[_0x1856('0x21')](respondWithResult(_0x1df51c,null))[_0x1856('0x41')](handleError(_0x1df51c,null));};exports[_0x1856('0x22')]=function(_0x167b23,_0x2b52f3){return db[_0x1856('0x28')][_0x1856('0x45')]({'where':{'id':_0x167b23['params']['id']}})[_0x1856('0x21')](handleEntityNotFound(_0x2b52f3,null))[_0x1856('0x21')](removeEntity(_0x2b52f3,null))['catch'](handleError(_0x2b52f3,null));};exports[_0x1856('0x52')]=function(_0x20edb9,_0x1dd372,_0x159bd5){return db['AnalyticExtractedReport'][_0x1856('0x45')]({'where':{'id':_0x20edb9[_0x1856('0x42')]['id']},'attributes':[_0x1856('0x25'),_0x1856('0x53'),_0x1856('0x54'),'output'],'raw':!![]})[_0x1856('0x21')](handleEntityNotFound(_0x1dd372,null))[_0x1856('0x21')](function(_0x42686f){if(_0x42686f){if(!fs[_0x1856('0x55')](path['join'](config[_0x1856('0x56')],_0x1856('0x57'),_0x42686f[_0x1856('0x54')]))){throw new db[(_0x1856('0x58'))][(_0x1856('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x20edb9[_0x1856('0x2e')][_0x1856('0x5a')]){return _0x1dd372[_0x1856('0x17')](0xc8);}return _0x1dd372[_0x1856('0x52')](path['join'](config[_0x1856('0x56')],_0x1856('0x57'),_0x42686f['savename']),util[_0x1856('0x5b')](_0x1856('0x5c'),_0x42686f[_0x1856('0x53')]||_0x42686f[_0x1856('0x25')],_0x42686f['output'][_0x1856('0x5d')]()));}})[_0x1856('0x41')](handleError(_0x1dd372,null));};
\ No newline at end of file
+var _0x6356=['ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','merge','find','create','body','user','get','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','Sequelize','ValidationError','exists','root','server/files/reports','savename','format','%s.%s','toLowerCase','rimraf','request-promise','moment','mustache','path','to-csv'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6356,0x17e));var _0x6635=function(_0x50bace,_0x16f8b7){_0x50bace=_0x50bace-0x0;var _0x25dc5e=_0x6356[_0x50bace];return _0x25dc5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6635('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6635('0x1'));var moment=require(_0x6635('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6635('0x3'));var util=require('util');var path=require(_0x6635('0x4'));var sox=require('sox');var csv=require(_0x6635('0x5'));var ejs=require(_0x6635('0x6'));var fs=require('fs');var fs_extra=require(_0x6635('0x7'));var _=require('lodash');var squel=require(_0x6635('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6635('0x9'));var toCsv=require(_0x6635('0x5'));var querystring=require(_0x6635('0xa'));var Papa=require(_0x6635('0xb'));var Redis=require(_0x6635('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6635('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6635('0xe'));var logger=require(_0x6635('0xf'))(_0x6635('0x10'));var utils=require(_0x6635('0x11'));var config=require(_0x6635('0x12'));var licenseUtil=require(_0x6635('0x13'));var db=require(_0x6635('0x14'))['db'];function respondWithStatusCode(_0x1d09b5,_0x579a44){_0x579a44=_0x579a44||0xcc;return function(_0xcdeca5){if(_0xcdeca5){return _0x1d09b5[_0x6635('0x15')](_0x579a44);}return _0x1d09b5[_0x6635('0x16')](_0x579a44)['end']();};}function respondWithResult(_0x510738,_0x2c087f){_0x2c087f=_0x2c087f||0xc8;return function(_0x5a8d86){if(_0x5a8d86){return _0x510738[_0x6635('0x16')](_0x2c087f)[_0x6635('0x17')](_0x5a8d86);}};}function respondWithFilteredResult(_0x37544d,_0x583600){return function(_0xbff8d7){if(_0xbff8d7){var _0x5cece7=typeof _0x583600[_0x6635('0x18')]===_0x6635('0x19')&&typeof _0x583600[_0x6635('0x1a')]===_0x6635('0x19');var _0x422a10=_0xbff8d7[_0x6635('0x1b')];var _0x5ab1d8=_0x5cece7?0x0:_0x583600[_0x6635('0x18')];var _0x2e7657=_0x5cece7?_0xbff8d7[_0x6635('0x1b')]:_0x583600[_0x6635('0x18')]+_0x583600[_0x6635('0x1a')];var _0x4027c7;if(_0x2e7657>=_0x422a10){_0x2e7657=_0x422a10;_0x4027c7=0xc8;}else{_0x4027c7=0xce;}_0x37544d[_0x6635('0x16')](_0x4027c7);return _0x37544d[_0x6635('0x1c')](_0x6635('0x1d'),_0x5ab1d8+'-'+_0x2e7657+'/'+_0x422a10)['json'](_0xbff8d7);}return null;};}function patchUpdates(_0x41f1cf){return function(_0x4f2718){try{jsonpatch[_0x6635('0x1e')](_0x4f2718,_0x41f1cf,!![]);}catch(_0x23e327){return BPromise[_0x6635('0x1f')](_0x23e327);}return _0x4f2718[_0x6635('0x20')]();};}function saveUpdates(_0x4f4969,_0x1de07b){return function(_0x115fba){if(_0x115fba){return _0x115fba[_0x6635('0x21')](_0x4f4969)[_0x6635('0x22')](function(_0x10bdc8){return _0x10bdc8;});}return null;};}function removeEntity(_0xfbb0af,_0xf9d9d){return function(_0x1ec402){if(_0x1ec402){return _0x1ec402['destroy']()['then'](function(){var _0x1e3411=_0x1ec402['get']({'plain':!![]});var _0x13c876='ExtractedReports';return db[_0x6635('0x23')][_0x6635('0x24')]({'where':{'type':_0x13c876,'resourceId':_0x1e3411['id']}})[_0x6635('0x22')](function(){return _0x1ec402;});})[_0x6635('0x22')](function(){_0xfbb0af[_0x6635('0x16')](0xcc)[_0x6635('0x25')]();});}};}function handleEntityNotFound(_0xffffd,_0x4a48b1){return function(_0x600fc3){if(!_0x600fc3){_0xffffd[_0x6635('0x15')](0x194);}return _0x600fc3;};}function handleError(_0x42f6bd,_0x493652){_0x493652=_0x493652||0x1f4;return function(_0x1f33b8){logger[_0x6635('0x26')](_0x1f33b8[_0x6635('0x27')]);if(_0x1f33b8['name']){delete _0x1f33b8[_0x6635('0x28')];}_0x42f6bd['status'](_0x493652)[_0x6635('0x29')](_0x1f33b8);};}exports[_0x6635('0x2a')]=function(_0x3d4ba0,_0x220156){var _0x21f937={},_0x4385a5={},_0x4436e2={'count':0x0,'rows':[]};var _0xcc0527=_[_0x6635('0x2b')](db[_0x6635('0x2c')][_0x6635('0x2d')],function(_0x42d1c1){return{'name':_0x42d1c1[_0x6635('0x2e')],'type':_0x42d1c1[_0x6635('0x2f')][_0x6635('0x30')]};});_0x4385a5[_0x6635('0x31')]=_[_0x6635('0x2b')](_0xcc0527,_0x6635('0x28'));_0x4385a5[_0x6635('0x32')]=_[_0x6635('0x33')](_0x3d4ba0['query']);_0x4385a5[_0x6635('0x34')]=_[_0x6635('0x35')](_0x4385a5[_0x6635('0x31')],_0x4385a5[_0x6635('0x32')]);_0x21f937['attributes']=_[_0x6635('0x35')](_0x4385a5[_0x6635('0x31')],qs[_0x6635('0x36')](_0x3d4ba0[_0x6635('0x32')][_0x6635('0x36')]));_0x21f937[_0x6635('0x37')]=_0x21f937['attributes']['length']?_0x21f937[_0x6635('0x37')]:_0x4385a5[_0x6635('0x31')];if(!_0x3d4ba0['query'][_0x6635('0x38')]('nolimit')){_0x21f937[_0x6635('0x1a')]=qs['limit'](_0x3d4ba0[_0x6635('0x32')]['limit']);_0x21f937[_0x6635('0x18')]=qs['offset'](_0x3d4ba0['query'][_0x6635('0x18')]);}_0x21f937[_0x6635('0x39')]=qs[_0x6635('0x3a')](_0x3d4ba0[_0x6635('0x32')]['sort']);_0x21f937[_0x6635('0x3b')]=qs[_0x6635('0x34')](_[_0x6635('0x3c')](_0x3d4ba0[_0x6635('0x32')],_0x4385a5[_0x6635('0x34')]),_0xcc0527);if(_0x3d4ba0[_0x6635('0x32')][_0x6635('0x3d')]){_0x21f937['where']=_['merge'](_0x21f937[_0x6635('0x3b')],{'$or':_[_0x6635('0x2b')](_0xcc0527,function(_0x443172){if(_0x443172[_0x6635('0x2f')]!==_0x6635('0x3e')){var _0x223c46={};_0x223c46[_0x443172[_0x6635('0x28')]]={'$like':'%'+_0x3d4ba0['query'][_0x6635('0x3d')]+'%'};return _0x223c46;}})});}_0x21f937=_['merge']({},_0x21f937,_0x3d4ba0[_0x6635('0x3f')]);var _0x17b240={'where':_0x21f937[_0x6635('0x3b')]};return db[_0x6635('0x2c')][_0x6635('0x1b')](_0x17b240)[_0x6635('0x22')](function(_0x17de3a){_0x4436e2[_0x6635('0x1b')]=_0x17de3a;if(_0x3d4ba0[_0x6635('0x32')]['includeAll']){_0x21f937[_0x6635('0x40')]=[{'all':!![]}];}return db[_0x6635('0x2c')]['findAll'](_0x21f937);})[_0x6635('0x22')](function(_0x25b3de){_0x4436e2[_0x6635('0x41')]=_0x25b3de;return _0x4436e2;})[_0x6635('0x22')](respondWithFilteredResult(_0x220156,_0x21f937))[_0x6635('0x42')](handleError(_0x220156,null));};exports[_0x6635('0x43')]=function(_0x4d8f9b,_0x5eeb1c){var _0x46a9f5={'raw':!![],'where':{'id':_0x4d8f9b[_0x6635('0x44')]['id']}},_0xb6323b={};_0xb6323b[_0x6635('0x31')]=_[_0x6635('0x33')](db[_0x6635('0x2c')][_0x6635('0x2d')]);_0xb6323b[_0x6635('0x32')]=_[_0x6635('0x33')](_0x4d8f9b['query']);_0xb6323b[_0x6635('0x34')]=_['intersection'](_0xb6323b[_0x6635('0x31')],_0xb6323b[_0x6635('0x32')]);_0x46a9f5[_0x6635('0x37')]=_['intersection'](_0xb6323b[_0x6635('0x31')],qs[_0x6635('0x36')](_0x4d8f9b[_0x6635('0x32')][_0x6635('0x36')]));_0x46a9f5['attributes']=_0x46a9f5[_0x6635('0x37')][_0x6635('0x45')]?_0x46a9f5['attributes']:_0xb6323b['model'];if(_0x4d8f9b['query'][_0x6635('0x46')]){_0x46a9f5['include']=[{'all':!![]}];}_0x46a9f5=_[_0x6635('0x47')]({},_0x46a9f5,_0x4d8f9b[_0x6635('0x3f')]);return db[_0x6635('0x2c')][_0x6635('0x48')](_0x46a9f5)[_0x6635('0x22')](handleEntityNotFound(_0x5eeb1c,null))[_0x6635('0x22')](respondWithResult(_0x5eeb1c,null))[_0x6635('0x42')](handleError(_0x5eeb1c,null));};exports[_0x6635('0x49')]=function(_0x5ac3c7,_0x3b675f){return db[_0x6635('0x2c')][_0x6635('0x49')](_0x5ac3c7[_0x6635('0x4a')],{})[_0x6635('0x22')](function(_0x136ac1){var _0x5f0fb7=_0x5ac3c7[_0x6635('0x4b')][_0x6635('0x4c')]({'plain':!![]});if(!_0x5f0fb7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f0fb7[_0x6635('0x4d')]==='user'){var _0x2c80f1=_0x136ac1[_0x6635('0x4c')]({'plain':!![]});var _0x2b922f=_0x6635('0x4e');return db[_0x6635('0x4f')][_0x6635('0x48')]({'where':{'name':_0x2b922f,'userProfileId':_0x5f0fb7[_0x6635('0x50')]},'raw':!![]})[_0x6635('0x22')](function(_0x3a27e3){if(_0x3a27e3&&_0x3a27e3[_0x6635('0x51')]===0x0){return db['UserProfileResource'][_0x6635('0x49')]({'name':_0x2c80f1[_0x6635('0x28')],'resourceId':_0x2c80f1['id'],'type':_0x3a27e3[_0x6635('0x28')],'sectionId':_0x3a27e3['id']},{})[_0x6635('0x22')](function(){return _0x136ac1;});}else{return _0x136ac1;}})['catch'](function(_0x3f8538){logger['error'](_0x6635('0x52'),_0x3f8538);throw _0x3f8538;});}return _0x136ac1;})[_0x6635('0x22')](respondWithResult(_0x3b675f,0xc9))[_0x6635('0x42')](handleError(_0x3b675f,null));};exports[_0x6635('0x21')]=function(_0x5e7f92,_0x34dec7){if(_0x5e7f92[_0x6635('0x4a')]['id']){delete _0x5e7f92['body']['id'];}return db[_0x6635('0x2c')][_0x6635('0x48')]({'where':{'id':_0x5e7f92['params']['id']}})[_0x6635('0x22')](handleEntityNotFound(_0x34dec7,null))[_0x6635('0x22')](saveUpdates(_0x5e7f92[_0x6635('0x4a')],null))[_0x6635('0x22')](respondWithResult(_0x34dec7,null))['catch'](handleError(_0x34dec7,null));};exports[_0x6635('0x24')]=function(_0x4626ae,_0x12f163){return db['AnalyticExtractedReport'][_0x6635('0x48')]({'where':{'id':_0x4626ae[_0x6635('0x44')]['id']}})['then'](handleEntityNotFound(_0x12f163,null))['then'](removeEntity(_0x12f163,null))['catch'](handleError(_0x12f163,null));};exports[_0x6635('0x53')]=function(_0x2c8b13,_0x458d32,_0x56e7a6){return db[_0x6635('0x2c')][_0x6635('0x48')]({'where':{'id':_0x2c8b13[_0x6635('0x44')]['id']},'attributes':[_0x6635('0x28'),_0x6635('0x54'),'savename',_0x6635('0x55')],'raw':!![]})[_0x6635('0x22')](handleEntityNotFound(_0x458d32,null))[_0x6635('0x22')](function(_0x3c9f61){if(_0x3c9f61){if(!fs[_0x6635('0x56')](path[_0x6635('0x57')](config['root'],'server/files/reports',_0x3c9f61['savename']))){throw new db[(_0x6635('0x58'))][(_0x6635('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2c8b13[_0x6635('0x32')][_0x6635('0x5a')]){return _0x458d32['sendStatus'](0xc8);}return _0x458d32[_0x6635('0x53')](path[_0x6635('0x57')](config[_0x6635('0x5b')],_0x6635('0x5c'),_0x3c9f61[_0x6635('0x5d')]),util[_0x6635('0x5e')](_0x6635('0x5f'),_0x3c9f61[_0x6635('0x54')]||_0x3c9f61['name'],_0x3c9f61[_0x6635('0x55')][_0x6635('0x60')]()));}})[_0x6635('0x42')](handleError(_0x458d32,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 32acbb9..142a8ac 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 _0x5a23=['../../config/environment','./analyticExtractedReport.attributes','analytics_extracted_reports','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x5a23,0x1b3));var _0x35a2=function(_0x3ffb88,_0x20036c){_0x3ffb88=_0x3ffb88-0x0;var _0x23de86=_0x5a23[_0x3ffb88];return _0x23de86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x35a2('0x0'))(_0x35a2('0x1'));var moment=require(_0x35a2('0x2'));var BPromise=require(_0x35a2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35a2('0x4'));var config=require(_0x35a2('0x5'));var attributes=require(_0x35a2('0x6'));module['exports']=function(_0x2b820b,_0x3d132f){return _0x2b820b['define']('AnalyticExtractedReport',attributes,{'tableName':_0x35a2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe477=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2d6f29,_0x2f6366){var _0x291f5a=function(_0x36b6bd){while(--_0x36b6bd){_0x2d6f29['push'](_0x2d6f29['shift']());}};_0x291f5a(++_0x2f6366);}(_0xe477,0x1f1));var _0x7e47=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0xe477[_0x440917];return _0x5e906b;};'use strict';var _=require('lodash');var util=require(_0x7e47('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7e47('0x1'));var BPromise=require(_0x7e47('0x2'));var rp=require(_0x7e47('0x3'));var fs=require('fs');var path=require(_0x7e47('0x4'));var rimraf=require(_0x7e47('0x5'));var config=require(_0x7e47('0x6'));var attributes=require(_0x7e47('0x7'));module[_0x7e47('0x8')]=function(_0x272921,_0x35dc8a){return _0x272921[_0x7e47('0x9')](_0x7e47('0xa'),attributes,{'tableName':_0x7e47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index b5e8acf..6764f79 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 _0x7a52=['request\x20sent','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x7a52,0x1bd));var _0x27a5=function(_0x3bbf4b,_0x549d33){_0x3bbf4b=_0x3bbf4b-0x0;var _0x15d54d=_0x7a52[_0x3bbf4b];return _0x15d54d;};'use strict';var _=require(_0x27a5('0x0'));var util=require('util');var moment=require(_0x27a5('0x1'));var BPromise=require(_0x27a5('0x2'));var rs=require(_0x27a5('0x3'));var fs=require('fs');var Redis=require(_0x27a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x27a5('0x5'));var logger=require(_0x27a5('0x6'))(_0x27a5('0x7'));var config=require(_0x27a5('0x8'));var jayson=require(_0x27a5('0x9'));var client=jayson[_0x27a5('0xa')][_0x27a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x568bbe,_0x26ddd,_0x2c49fe){return new BPromise(function(_0x4b6ef0,_0x47ab24){return client[_0x27a5('0xc')](_0x568bbe,_0x2c49fe)['then'](function(_0x2e1fe4){logger[_0x27a5('0xd')](_0x27a5('0xe'),_0x26ddd,'request\x20sent');logger[_0x27a5('0xf')](_0x27a5('0x10'),_0x26ddd,_0x27a5('0x11'),JSON['stringify'](_0x2e1fe4));if(_0x2e1fe4['error']){if(_0x2e1fe4[_0x27a5('0x12')]['code']===0x1f4){logger['error'](_0x27a5('0xe'),_0x26ddd,_0x2e1fe4[_0x27a5('0x12')][_0x27a5('0x13')]);return _0x47ab24(_0x2e1fe4[_0x27a5('0x12')][_0x27a5('0x13')]);}logger[_0x27a5('0x12')](_0x27a5('0xe'),_0x26ddd,_0x2e1fe4['error'][_0x27a5('0x13')]);return _0x4b6ef0(_0x2e1fe4[_0x27a5('0x12')][_0x27a5('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x26ddd,_0x27a5('0x11'));_0x4b6ef0(_0x2e1fe4[_0x27a5('0x14')][_0x27a5('0x13')]);}})[_0x27a5('0x15')](function(_0x398354){logger[_0x27a5('0x12')](_0x27a5('0xe'),_0x26ddd,_0x398354);_0x47ab24(_0x398354);});});}
\ No newline at end of file
+var _0x0a6b=['http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b4c68,_0x14d416){var _0x1686e6=function(_0x56ab6c){while(--_0x56ab6c){_0x4b4c68['push'](_0x4b4c68['shift']());}};_0x1686e6(++_0x14d416);}(_0x0a6b,0x120));var _0xb0a6=function(_0x25bd2a,_0xc8fe7a){_0x25bd2a=_0x25bd2a-0x0;var _0xb6b479=_0x0a6b[_0x25bd2a];return _0xb6b479;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require(_0xb0a6('0x1'));var BPromise=require(_0xb0a6('0x2'));var rs=require(_0xb0a6('0x3'));var fs=require('fs');var Redis=require(_0xb0a6('0x4'));var db=require(_0xb0a6('0x5'))['db'];var utils=require(_0xb0a6('0x6'));var logger=require(_0xb0a6('0x7'))(_0xb0a6('0x8'));var config=require(_0xb0a6('0x9'));var jayson=require(_0xb0a6('0xa'));var client=jayson['client'][_0xb0a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x504a45,_0x23e004,_0x490cfc){return new BPromise(function(_0x597b68,_0xdaa894){return client['request'](_0x504a45,_0x490cfc)[_0xb0a6('0xc')](function(_0x423683){logger['info'](_0xb0a6('0xd'),_0x23e004,_0xb0a6('0xe'));logger['debug'](_0xb0a6('0xf'),_0x23e004,_0xb0a6('0xe'),JSON[_0xb0a6('0x10')](_0x423683));if(_0x423683[_0xb0a6('0x11')]){if(_0x423683[_0xb0a6('0x11')][_0xb0a6('0x12')]===0x1f4){logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x423683['error'][_0xb0a6('0x13')]);return _0xdaa894(_0x423683[_0xb0a6('0x11')][_0xb0a6('0x13')]);}logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x423683['error'][_0xb0a6('0x13')]);return _0x597b68(_0x423683[_0xb0a6('0x11')]['message']);}else{logger[_0xb0a6('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x23e004,'request\x20sent');_0x597b68(_0x423683[_0xb0a6('0x15')][_0xb0a6('0x13')]);}})[_0xb0a6('0x16')](function(_0x2ef938){logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x2ef938);_0xdaa894(_0x2ef938);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e66595a..a9a2307 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 _0x4d66=['get','index','isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller'];(function(_0x291f3d,_0x5f8285){var _0x12e96e=function(_0x31a51b){while(--_0x31a51b){_0x291f3d['push'](_0x291f3d['shift']());}};_0x12e96e(++_0x5f8285);}(_0x4d66,0x1f1));var _0x64d6=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x4d66[_0x476c7];return _0x47ae56;};'use strict';var multer=require('multer');var util=require(_0x64d6('0x0'));var path=require(_0x64d6('0x1'));var timeout=require(_0x64d6('0x2'));var express=require('express');var router=express[_0x64d6('0x3')]();var fs_extra=require(_0x64d6('0x4'));var auth=require(_0x64d6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x64d6('0x6'));router[_0x64d6('0x7')]('/',auth['isAuthenticated'](),controller[_0x64d6('0x8')]);router[_0x64d6('0x7')]('/:id',auth[_0x64d6('0x9')](),controller[_0x64d6('0xa')]);router[_0x64d6('0x7')](_0x64d6('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x64d6('0xc')]('/',auth[_0x64d6('0x9')](),controller[_0x64d6('0xd')]);router['put'](_0x64d6('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x64d6('0xf')](_0x64d6('0xe'),auth[_0x64d6('0x9')](),controller[_0x64d6('0x10')]);module[_0x64d6('0x11')]=router;
\ No newline at end of file
+var _0x72af=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','show','/:id/download','download','create','put','update','delete','/:id','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72af,0x190));var _0xf72a=function(_0x5716b1,_0x25cf2a){_0x5716b1=_0x5716b1-0x0;var _0x31c026=_0x72af[_0x5716b1];return _0x31c026;};'use strict';var multer=require(_0xf72a('0x0'));var util=require(_0xf72a('0x1'));var path=require('path');var timeout=require(_0xf72a('0x2'));var express=require(_0xf72a('0x3'));var router=express[_0xf72a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf72a('0x5'));var interaction=require(_0xf72a('0x6'));var config=require(_0xf72a('0x7'));var controller=require(_0xf72a('0x8'));router['get']('/',auth[_0xf72a('0x9')](),controller[_0xf72a('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf72a('0xb')]);router['get'](_0xf72a('0xc'),auth[_0xf72a('0x9')](),controller[_0xf72a('0xd')]);router['post']('/',auth[_0xf72a('0x9')](),controller[_0xf72a('0xe')]);router[_0xf72a('0xf')]('/:id',auth[_0xf72a('0x9')](),controller[_0xf72a('0x10')]);router[_0xf72a('0x11')](_0xf72a('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xf72a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 942a6f2..4528344 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 _0xa071=['BOOLEAN','exports','TEXT','STRING'];(function(_0x4b96bd,_0x6a3d65){var _0x30ff3a=function(_0x45d287){while(--_0x45d287){_0x4b96bd['push'](_0x4b96bd['shift']());}};_0x30ff3a(++_0x6a3d65);}(_0xa071,0x1ed));var _0x1a07=function(_0x21e920,_0x296dc3){_0x21e920=_0x21e920-0x0;var _0x47f9c5=_0xa071[_0x21e920];return _0x47f9c5;};'use strict';var Sequelize=require('sequelize');module[_0x1a07('0x0')]={'field':{'type':Sequelize[_0x1a07('0x1')]},'alias':{'type':Sequelize[_0x1a07('0x2')]},'function':{'type':Sequelize[_0x1a07('0x2')]},'format':{'type':Sequelize[_0x1a07('0x2')]},'groupBy':{'type':Sequelize[_0x1a07('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x1a07('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4740=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x18f030,_0x30fd56){var _0x3ea085=function(_0x8ea6ed){while(--_0x8ea6ed){_0x18f030['push'](_0x18f030['shift']());}};_0x3ea085(++_0x30fd56);}(_0x4740,0x1ac));var _0x0474=function(_0x7075ca,_0x16577d){_0x7075ca=_0x7075ca-0x0;var _0x1f527e=_0x4740[_0x7075ca];return _0x1f527e;};'use strict';var Sequelize=require(_0x0474('0x0'));module[_0x0474('0x1')]={'field':{'type':Sequelize[_0x0474('0x2')]},'alias':{'type':Sequelize[_0x0474('0x3')]},'function':{'type':Sequelize[_0x0474('0x3')]},'format':{'type':Sequelize[_0x0474('0x3')]},'groupBy':{'type':Sequelize[_0x0474('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0474('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 56b2727..bbe7c05 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 _0xfdd0=['fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','bulkCreate','params','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','map','AnalyticFieldReport','rawAttributes'];(function(_0x4c2cd2,_0x1d50b8){var _0x448543=function(_0x29e355){while(--_0x29e355){_0x4c2cd2['push'](_0x4c2cd2['shift']());}};_0x448543(++_0x1d50b8);}(_0xfdd0,0x7d));var _0x0fdd=function(_0x469add,_0x50ef21){_0x469add=_0x469add-0x0;var _0x2e8a26=_0xfdd0[_0x469add];return _0x2e8a26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fdd('0x0'));var zipdir=require(_0x0fdd('0x1'));var jsonpatch=require(_0x0fdd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0fdd('0x3'));var Mustache=require(_0x0fdd('0x4'));var util=require(_0x0fdd('0x5'));var path=require('path');var sox=require(_0x0fdd('0x6'));var csv=require(_0x0fdd('0x7'));var ejs=require(_0x0fdd('0x8'));var fs=require('fs');var fs_extra=require(_0x0fdd('0x9'));var _=require(_0x0fdd('0xa'));var squel=require(_0x0fdd('0xb'));var crypto=require(_0x0fdd('0xc'));var jsforce=require(_0x0fdd('0xd'));var deskjs=require(_0x0fdd('0xe'));var toCsv=require(_0x0fdd('0x7'));var querystring=require(_0x0fdd('0xf'));var Papa=require(_0x0fdd('0x10'));var Redis=require(_0x0fdd('0x11'));var authService=require(_0x0fdd('0x12'));var qs=require(_0x0fdd('0x13'));var as=require(_0x0fdd('0x14'));var hardwareService=require(_0x0fdd('0x15'));var logger=require(_0x0fdd('0x16'))(_0x0fdd('0x17'));var utils=require(_0x0fdd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0fdd('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x535aec,_0x698aa6){_0x698aa6=_0x698aa6||0xcc;return function(_0x21888f){if(_0x21888f){return _0x535aec['sendStatus'](_0x698aa6);}return _0x535aec['status'](_0x698aa6)[_0x0fdd('0x1a')]();};}function respondWithResult(_0xa57ddd,_0x1dc234){_0x1dc234=_0x1dc234||0xc8;return function(_0x57aa19){if(_0x57aa19){return _0xa57ddd[_0x0fdd('0x1b')](_0x1dc234)['json'](_0x57aa19);}};}function respondWithFilteredResult(_0x5902d8,_0x11de67){return function(_0x5e4813){if(_0x5e4813){var _0x4bd8df=typeof _0x11de67['offset']===_0x0fdd('0x1c')&&typeof _0x11de67[_0x0fdd('0x1d')]==='undefined';var _0x37740c=_0x5e4813[_0x0fdd('0x1e')];var _0x4a1ae3=_0x4bd8df?0x0:_0x11de67['offset'];var _0x2a4e17=_0x4bd8df?_0x5e4813[_0x0fdd('0x1e')]:_0x11de67['offset']+_0x11de67['limit'];var _0x230408;if(_0x2a4e17>=_0x37740c){_0x2a4e17=_0x37740c;_0x230408=0xc8;}else{_0x230408=0xce;}_0x5902d8[_0x0fdd('0x1b')](_0x230408);return _0x5902d8[_0x0fdd('0x1f')](_0x0fdd('0x20'),_0x4a1ae3+'-'+_0x2a4e17+'/'+_0x37740c)[_0x0fdd('0x21')](_0x5e4813);}return null;};}function patchUpdates(_0x3d6baf){return function(_0x378022){try{jsonpatch[_0x0fdd('0x22')](_0x378022,_0x3d6baf,!![]);}catch(_0x44a8d0){return BPromise[_0x0fdd('0x23')](_0x44a8d0);}return _0x378022['save']();};}function saveUpdates(_0x5df2fb,_0x1d32de){return function(_0x5b4632){if(_0x5b4632){return _0x5b4632[_0x0fdd('0x24')](_0x5df2fb)[_0x0fdd('0x25')](function(_0x59b3b3){return _0x59b3b3;});}return null;};}function removeEntity(_0x3e4bdb,_0x235621){return function(_0x2a3734){if(_0x2a3734){return _0x2a3734[_0x0fdd('0x26')]()['then'](function(){_0x3e4bdb['status'](0xcc)[_0x0fdd('0x1a')]();});}};}function handleEntityNotFound(_0x582545,_0x3599bd){return function(_0x2c3821){if(!_0x2c3821){_0x582545['sendStatus'](0x194);}return _0x2c3821;};}function handleError(_0x2e84c5,_0x2f7b5c){_0x2f7b5c=_0x2f7b5c||0x1f4;return function(_0x13c2d9){logger[_0x0fdd('0x27')](_0x13c2d9[_0x0fdd('0x28')]);if(_0x13c2d9[_0x0fdd('0x29')]){delete _0x13c2d9['name'];}_0x2e84c5[_0x0fdd('0x1b')](_0x2f7b5c)['send'](_0x13c2d9);};}exports['index']=function(_0x366489,_0x25c909){var _0x980c1b={},_0x3d45f7={},_0x151e92={'count':0x0,'rows':[]};var _0x25be3e=_[_0x0fdd('0x2a')](db[_0x0fdd('0x2b')][_0x0fdd('0x2c')],function(_0x15d24d){return{'name':_0x15d24d[_0x0fdd('0x2d')],'type':_0x15d24d[_0x0fdd('0x2e')][_0x0fdd('0x2f')]};});_0x3d45f7[_0x0fdd('0x30')]=_[_0x0fdd('0x2a')](_0x25be3e,'name');_0x3d45f7['query']=_['keys'](_0x366489[_0x0fdd('0x31')]);_0x3d45f7['filters']=_[_0x0fdd('0x32')](_0x3d45f7['model'],_0x3d45f7[_0x0fdd('0x31')]);_0x980c1b[_0x0fdd('0x33')]=_[_0x0fdd('0x32')](_0x3d45f7[_0x0fdd('0x30')],qs[_0x0fdd('0x34')](_0x366489[_0x0fdd('0x31')]['fields']));_0x980c1b[_0x0fdd('0x33')]=_0x980c1b['attributes'][_0x0fdd('0x35')]?_0x980c1b[_0x0fdd('0x33')]:_0x3d45f7[_0x0fdd('0x30')];if(!_0x366489[_0x0fdd('0x31')][_0x0fdd('0x36')](_0x0fdd('0x37'))){_0x980c1b[_0x0fdd('0x1d')]=qs[_0x0fdd('0x1d')](_0x366489['query'][_0x0fdd('0x1d')]);_0x980c1b['offset']=qs['offset'](_0x366489[_0x0fdd('0x31')][_0x0fdd('0x38')]);}_0x980c1b[_0x0fdd('0x39')]=qs['sort'](_0x366489[_0x0fdd('0x31')][_0x0fdd('0x3a')]);_0x980c1b[_0x0fdd('0x3b')]=qs[_0x0fdd('0x3c')](_[_0x0fdd('0x3d')](_0x366489[_0x0fdd('0x31')],_0x3d45f7['filters']),_0x25be3e);if(_0x366489[_0x0fdd('0x31')][_0x0fdd('0x3e')]){_0x980c1b[_0x0fdd('0x3b')]=_[_0x0fdd('0x3f')](_0x980c1b['where'],{'$or':_[_0x0fdd('0x2a')](_0x25be3e,function(_0x3f0508){if(_0x3f0508[_0x0fdd('0x2e')]!==_0x0fdd('0x40')){var _0x321473={};_0x321473[_0x3f0508['name']]={'$like':'%'+_0x366489[_0x0fdd('0x31')]['filter']+'%'};return _0x321473;}})});}_0x980c1b=_[_0x0fdd('0x3f')]({},_0x980c1b,_0x366489[_0x0fdd('0x41')]);var _0x1ab1cb={'where':_0x980c1b['where']};return db['AnalyticFieldReport'][_0x0fdd('0x1e')](_0x1ab1cb)[_0x0fdd('0x25')](function(_0x595dbb){_0x151e92[_0x0fdd('0x1e')]=_0x595dbb;if(_0x366489[_0x0fdd('0x31')][_0x0fdd('0x42')]){_0x980c1b[_0x0fdd('0x43')]=[{'all':!![]}];}return db[_0x0fdd('0x2b')][_0x0fdd('0x44')](_0x980c1b);})[_0x0fdd('0x25')](function(_0x2accf5){_0x151e92[_0x0fdd('0x45')]=_0x2accf5;return _0x151e92;})[_0x0fdd('0x25')](respondWithFilteredResult(_0x25c909,_0x980c1b))[_0x0fdd('0x46')](handleError(_0x25c909,null));};exports[_0x0fdd('0x47')]=function(_0x5c8e25,_0xea8a74){var _0x3aeb96={'raw':![],'where':{'id':_0x5c8e25['params']['id']}},_0x1937df={};_0x1937df[_0x0fdd('0x30')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x1937df[_0x0fdd('0x31')]=_[_0x0fdd('0x48')](_0x5c8e25['query']);_0x1937df[_0x0fdd('0x3c')]=_[_0x0fdd('0x32')](_0x1937df[_0x0fdd('0x30')],_0x1937df[_0x0fdd('0x31')]);_0x3aeb96['attributes']=_[_0x0fdd('0x32')](_0x1937df[_0x0fdd('0x30')],qs[_0x0fdd('0x34')](_0x5c8e25[_0x0fdd('0x31')]['fields']));_0x3aeb96['attributes']=_0x3aeb96['attributes'][_0x0fdd('0x35')]?_0x3aeb96['attributes']:_0x1937df[_0x0fdd('0x30')];if(_0x5c8e25[_0x0fdd('0x31')][_0x0fdd('0x42')]){_0x3aeb96['include']=[{'all':!![]}];}_0x3aeb96=_[_0x0fdd('0x3f')]({},_0x3aeb96,_0x5c8e25[_0x0fdd('0x41')]);return db[_0x0fdd('0x2b')][_0x0fdd('0x49')](_0x3aeb96)[_0x0fdd('0x25')](handleEntityNotFound(_0xea8a74,null))[_0x0fdd('0x25')](respondWithResult(_0xea8a74,null))[_0x0fdd('0x46')](handleError(_0xea8a74,null));};exports[_0x0fdd('0x4a')]=function(_0x26391b,_0x201bb7){return db[_0x0fdd('0x2b')][_0x0fdd('0x4a')](_0x26391b[_0x0fdd('0x4b')],{})[_0x0fdd('0x25')](respondWithResult(_0x201bb7,0xc9))[_0x0fdd('0x46')](handleError(_0x201bb7,null));};exports[_0x0fdd('0x4c')]=function(_0x3e3230,_0xfe3c8a){return db[_0x0fdd('0x2b')][_0x0fdd('0x4c')](_0x3e3230[_0x0fdd('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xfe3c8a,0xc9))[_0x0fdd('0x46')](handleError(_0xfe3c8a,null));};exports[_0x0fdd('0x24')]=function(_0x26706f,_0x401a6b){if(_0x26706f[_0x0fdd('0x4b')]['id']){delete _0x26706f['body']['id'];}return db['AnalyticFieldReport'][_0x0fdd('0x49')]({'where':{'id':_0x26706f[_0x0fdd('0x4d')]['id']}})[_0x0fdd('0x25')](handleEntityNotFound(_0x401a6b,null))[_0x0fdd('0x25')](saveUpdates(_0x26706f[_0x0fdd('0x4b')],null))[_0x0fdd('0x25')](respondWithResult(_0x401a6b,null))[_0x0fdd('0x46')](handleError(_0x401a6b,null));};exports[_0x0fdd('0x26')]=function(_0x3eefc1,_0x30eddb){return db['AnalyticFieldReport'][_0x0fdd('0x49')]({'where':{'id':_0x3eefc1[_0x0fdd('0x4d')]['id']}})[_0x0fdd('0x25')](handleEntityNotFound(_0x30eddb,null))[_0x0fdd('0x25')](removeEntity(_0x30eddb,null))[_0x0fdd('0x46')](handleError(_0x30eddb,null));};exports[_0x0fdd('0x4e')]=function(_0x1eb93b,_0x4527f1){return db[_0x0fdd('0x2b')][_0x0fdd('0x26')]({'where':{'id':_0x1eb93b['query'][_0x0fdd('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x0fdd('0x25')](respondWithResult(_0x4527f1,0xcc))['catch'](handleError(_0x4527f1,null));};exports['addFields']=function(_0x1b2156,_0x52dda7,_0x292e84){return db[_0x0fdd('0x50')][_0x0fdd('0x51')]({'where':{'id':_0x1b2156[_0x0fdd('0x4d')]['id']}})[_0x0fdd('0x25')](handleEntityNotFound(_0x52dda7,null))['then'](function(_0x1ce7bf){if(_0x1ce7bf){return db[_0x0fdd('0x52')][_0x0fdd('0x53')](function(_0x5ebe56){return db['AnalyticFieldReport'][_0x0fdd('0x26')]({'where':{'CustomReportId':_0x1b2156[_0x0fdd('0x4d')]['id']},'transaction':_0x5ebe56})[_0x0fdd('0x25')](function(_0x13ee77){var _0x48f6ae=_[_0x0fdd('0x2a')](_0x1b2156[_0x0fdd('0x4b')],function(_0x53f88f){delete _0x53f88f['id'];_0x53f88f[_0x0fdd('0x54')]=_0x1b2156[_0x0fdd('0x4d')]['id'];return _0x53f88f;});return db[_0x0fdd('0x2b')][_0x0fdd('0x4c')](_0x48f6ae,{'transaction':_0x5ebe56});});})[_0x0fdd('0x25')](function(){return db['AnalyticFieldReport'][_0x0fdd('0x44')]({'where':{'CustomReportId':_0x1b2156[_0x0fdd('0x4d')]['id']}});});}})[_0x0fdd('0x25')](respondWithResult(_0x52dda7,null))[_0x0fdd('0x46')](handleError(_0x52dda7,null));};
\ No newline at end of file
+var _0x4a85=['findOne','sequelize','transaction','CustomReportId','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','rows','show','params','rawAttributes','keys','include','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport'];(function(_0x4dc48e,_0x3d2d69){var _0x4858b5=function(_0xb20765){while(--_0xb20765){_0x4dc48e['push'](_0x4dc48e['shift']());}};_0x4858b5(++_0x3d2d69);}(_0x4a85,0x101));var _0x54a8=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x4a85[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x54a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x54a8('0x1'));var jsonpatch=require(_0x54a8('0x2'));var rp=require('request-promise');var moment=require(_0x54a8('0x3'));var BPromise=require(_0x54a8('0x4'));var Mustache=require('mustache');var util=require(_0x54a8('0x5'));var path=require(_0x54a8('0x6'));var sox=require(_0x54a8('0x7'));var csv=require(_0x54a8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54a8('0x9'));var _=require(_0x54a8('0xa'));var squel=require(_0x54a8('0xb'));var crypto=require('crypto');var jsforce=require(_0x54a8('0xc'));var deskjs=require(_0x54a8('0xd'));var toCsv=require(_0x54a8('0x8'));var querystring=require(_0x54a8('0xe'));var Papa=require(_0x54a8('0xf'));var Redis=require(_0x54a8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x54a8('0x11'));var as=require(_0x54a8('0x12'));var hardwareService=require(_0x54a8('0x13'));var logger=require(_0x54a8('0x14'))(_0x54a8('0x15'));var utils=require('../../config/utils');var config=require(_0x54a8('0x16'));var licenseUtil=require(_0x54a8('0x17'));var db=require(_0x54a8('0x18'))['db'];function respondWithStatusCode(_0x2a6f39,_0x4819f1){_0x4819f1=_0x4819f1||0xcc;return function(_0x3ed53c){if(_0x3ed53c){return _0x2a6f39[_0x54a8('0x19')](_0x4819f1);}return _0x2a6f39[_0x54a8('0x1a')](_0x4819f1)[_0x54a8('0x1b')]();};}function respondWithResult(_0x10c684,_0x889ad4){_0x889ad4=_0x889ad4||0xc8;return function(_0x5a77aa){if(_0x5a77aa){return _0x10c684[_0x54a8('0x1a')](_0x889ad4)[_0x54a8('0x1c')](_0x5a77aa);}};}function respondWithFilteredResult(_0x23feb7,_0x46c80d){return function(_0x5b1e6a){if(_0x5b1e6a){var _0x17e49b=typeof _0x46c80d[_0x54a8('0x1d')]==='undefined'&&typeof _0x46c80d[_0x54a8('0x1e')]===_0x54a8('0x1f');var _0x51399e=_0x5b1e6a[_0x54a8('0x20')];var _0x2a0b43=_0x17e49b?0x0:_0x46c80d[_0x54a8('0x1d')];var _0x747660=_0x17e49b?_0x5b1e6a[_0x54a8('0x20')]:_0x46c80d['offset']+_0x46c80d[_0x54a8('0x1e')];var _0x562965;if(_0x747660>=_0x51399e){_0x747660=_0x51399e;_0x562965=0xc8;}else{_0x562965=0xce;}_0x23feb7[_0x54a8('0x1a')](_0x562965);return _0x23feb7[_0x54a8('0x21')](_0x54a8('0x22'),_0x2a0b43+'-'+_0x747660+'/'+_0x51399e)['json'](_0x5b1e6a);}return null;};}function patchUpdates(_0xff1e8d){return function(_0x56cd3f){try{jsonpatch['apply'](_0x56cd3f,_0xff1e8d,!![]);}catch(_0x446d30){return BPromise[_0x54a8('0x23')](_0x446d30);}return _0x56cd3f[_0x54a8('0x24')]();};}function saveUpdates(_0x40f5a8,_0x3012b0){return function(_0x4d5f12){if(_0x4d5f12){return _0x4d5f12[_0x54a8('0x25')](_0x40f5a8)[_0x54a8('0x26')](function(_0x25351f){return _0x25351f;});}return null;};}function removeEntity(_0x53f839,_0x1c959e){return function(_0x1253b5){if(_0x1253b5){return _0x1253b5[_0x54a8('0x27')]()[_0x54a8('0x26')](function(){_0x53f839['status'](0xcc)[_0x54a8('0x1b')]();});}};}function handleEntityNotFound(_0x258341,_0x1a22d4){return function(_0x3e1a99){if(!_0x3e1a99){_0x258341['sendStatus'](0x194);}return _0x3e1a99;};}function handleError(_0x26b33a,_0x342265){_0x342265=_0x342265||0x1f4;return function(_0x41c69a){logger[_0x54a8('0x28')](_0x41c69a[_0x54a8('0x29')]);if(_0x41c69a[_0x54a8('0x2a')]){delete _0x41c69a['name'];}_0x26b33a['status'](_0x342265)[_0x54a8('0x2b')](_0x41c69a);};}exports['index']=function(_0xa5d26,_0x247e86){var _0x1edf70={},_0x3a3b9a={},_0x154ed5={'count':0x0,'rows':[]};var _0x323b27=_[_0x54a8('0x2c')](db[_0x54a8('0x2d')]['rawAttributes'],function(_0x315bd8){return{'name':_0x315bd8[_0x54a8('0x2e')],'type':_0x315bd8['type'][_0x54a8('0x2f')]};});_0x3a3b9a[_0x54a8('0x30')]=_[_0x54a8('0x2c')](_0x323b27,_0x54a8('0x2a'));_0x3a3b9a[_0x54a8('0x31')]=_['keys'](_0xa5d26[_0x54a8('0x31')]);_0x3a3b9a[_0x54a8('0x32')]=_['intersection'](_0x3a3b9a[_0x54a8('0x30')],_0x3a3b9a['query']);_0x1edf70[_0x54a8('0x33')]=_[_0x54a8('0x34')](_0x3a3b9a[_0x54a8('0x30')],qs[_0x54a8('0x35')](_0xa5d26[_0x54a8('0x31')][_0x54a8('0x35')]));_0x1edf70[_0x54a8('0x33')]=_0x1edf70[_0x54a8('0x33')][_0x54a8('0x36')]?_0x1edf70[_0x54a8('0x33')]:_0x3a3b9a[_0x54a8('0x30')];if(!_0xa5d26['query'][_0x54a8('0x37')](_0x54a8('0x38'))){_0x1edf70[_0x54a8('0x1e')]=qs['limit'](_0xa5d26[_0x54a8('0x31')][_0x54a8('0x1e')]);_0x1edf70[_0x54a8('0x1d')]=qs['offset'](_0xa5d26[_0x54a8('0x31')][_0x54a8('0x1d')]);}_0x1edf70['order']=qs[_0x54a8('0x39')](_0xa5d26['query'][_0x54a8('0x39')]);_0x1edf70[_0x54a8('0x3a')]=qs[_0x54a8('0x32')](_[_0x54a8('0x3b')](_0xa5d26['query'],_0x3a3b9a['filters']),_0x323b27);if(_0xa5d26[_0x54a8('0x31')]['filter']){_0x1edf70[_0x54a8('0x3a')]=_[_0x54a8('0x3c')](_0x1edf70[_0x54a8('0x3a')],{'$or':_[_0x54a8('0x2c')](_0x323b27,function(_0x53d0f1){if(_0x53d0f1['type']!==_0x54a8('0x3d')){var _0x4000f2={};_0x4000f2[_0x53d0f1['name']]={'$like':'%'+_0xa5d26[_0x54a8('0x31')][_0x54a8('0x3e')]+'%'};return _0x4000f2;}})});}_0x1edf70=_['merge']({},_0x1edf70,_0xa5d26[_0x54a8('0x3f')]);var _0x1ea466={'where':_0x1edf70[_0x54a8('0x3a')]};return db['AnalyticFieldReport'][_0x54a8('0x20')](_0x1ea466)['then'](function(_0x268744){_0x154ed5[_0x54a8('0x20')]=_0x268744;if(_0xa5d26[_0x54a8('0x31')]['includeAll']){_0x1edf70['include']=[{'all':!![]}];}return db[_0x54a8('0x2d')]['findAll'](_0x1edf70);})[_0x54a8('0x26')](function(_0x17a6d6){_0x154ed5[_0x54a8('0x40')]=_0x17a6d6;return _0x154ed5;})[_0x54a8('0x26')](respondWithFilteredResult(_0x247e86,_0x1edf70))['catch'](handleError(_0x247e86,null));};exports[_0x54a8('0x41')]=function(_0x5b3fe3,_0x491a35){var _0x599c9f={'raw':![],'where':{'id':_0x5b3fe3[_0x54a8('0x42')]['id']}},_0x1a1727={};_0x1a1727[_0x54a8('0x30')]=_['keys'](db[_0x54a8('0x2d')][_0x54a8('0x43')]);_0x1a1727[_0x54a8('0x31')]=_[_0x54a8('0x44')](_0x5b3fe3[_0x54a8('0x31')]);_0x1a1727[_0x54a8('0x32')]=_[_0x54a8('0x34')](_0x1a1727['model'],_0x1a1727[_0x54a8('0x31')]);_0x599c9f[_0x54a8('0x33')]=_[_0x54a8('0x34')](_0x1a1727[_0x54a8('0x30')],qs[_0x54a8('0x35')](_0x5b3fe3[_0x54a8('0x31')][_0x54a8('0x35')]));_0x599c9f[_0x54a8('0x33')]=_0x599c9f[_0x54a8('0x33')][_0x54a8('0x36')]?_0x599c9f[_0x54a8('0x33')]:_0x1a1727[_0x54a8('0x30')];if(_0x5b3fe3[_0x54a8('0x31')]['includeAll']){_0x599c9f[_0x54a8('0x45')]=[{'all':!![]}];}_0x599c9f=_[_0x54a8('0x3c')]({},_0x599c9f,_0x5b3fe3[_0x54a8('0x3f')]);return db[_0x54a8('0x2d')][_0x54a8('0x46')](_0x599c9f)[_0x54a8('0x26')](handleEntityNotFound(_0x491a35,null))[_0x54a8('0x26')](respondWithResult(_0x491a35,null))[_0x54a8('0x47')](handleError(_0x491a35,null));};exports[_0x54a8('0x48')]=function(_0x564363,_0x556fd6){return db[_0x54a8('0x2d')]['create'](_0x564363[_0x54a8('0x49')],{})[_0x54a8('0x26')](respondWithResult(_0x556fd6,0xc9))[_0x54a8('0x47')](handleError(_0x556fd6,null));};exports[_0x54a8('0x4a')]=function(_0x750bce,_0x28c50b){return db[_0x54a8('0x2d')][_0x54a8('0x4a')](_0x750bce[_0x54a8('0x49')],{'raw':![],'individualHooks':!![]})[_0x54a8('0x26')](respondWithResult(_0x28c50b,0xc9))[_0x54a8('0x47')](handleError(_0x28c50b,null));};exports['update']=function(_0x1141f0,_0x472fbc){if(_0x1141f0[_0x54a8('0x49')]['id']){delete _0x1141f0[_0x54a8('0x49')]['id'];}return db[_0x54a8('0x2d')][_0x54a8('0x46')]({'where':{'id':_0x1141f0['params']['id']}})[_0x54a8('0x26')](handleEntityNotFound(_0x472fbc,null))[_0x54a8('0x26')](saveUpdates(_0x1141f0[_0x54a8('0x49')],null))[_0x54a8('0x26')](respondWithResult(_0x472fbc,null))[_0x54a8('0x47')](handleError(_0x472fbc,null));};exports[_0x54a8('0x27')]=function(_0x5e507d,_0x28253f){return db[_0x54a8('0x2d')][_0x54a8('0x46')]({'where':{'id':_0x5e507d[_0x54a8('0x42')]['id']}})['then'](handleEntityNotFound(_0x28253f,null))[_0x54a8('0x26')](removeEntity(_0x28253f,null))[_0x54a8('0x47')](handleError(_0x28253f,null));};exports[_0x54a8('0x4b')]=function(_0x1c18d3,_0x4e0370){return db['AnalyticFieldReport'][_0x54a8('0x27')]({'where':{'id':_0x1c18d3[_0x54a8('0x31')][_0x54a8('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x54a8('0x26')](respondWithResult(_0x4e0370,0xcc))['catch'](handleError(_0x4e0370,null));};exports[_0x54a8('0x4d')]=function(_0x1e9c9e,_0xd82b93,_0xf00b4c){return db[_0x54a8('0x4e')][_0x54a8('0x4f')]({'where':{'id':_0x1e9c9e['params']['id']}})[_0x54a8('0x26')](handleEntityNotFound(_0xd82b93,null))['then'](function(_0x30fb3c){if(_0x30fb3c){return db[_0x54a8('0x50')][_0x54a8('0x51')](function(_0x2764fd){return db[_0x54a8('0x2d')][_0x54a8('0x27')]({'where':{'CustomReportId':_0x1e9c9e[_0x54a8('0x42')]['id']},'transaction':_0x2764fd})['then'](function(_0xc9a4d5){var _0x746abf=_['map'](_0x1e9c9e[_0x54a8('0x49')],function(_0x5227b7){delete _0x5227b7['id'];_0x5227b7[_0x54a8('0x52')]=_0x1e9c9e[_0x54a8('0x42')]['id'];return _0x5227b7;});return db['AnalyticFieldReport'][_0x54a8('0x4a')](_0x746abf,{'transaction':_0x2764fd});});})[_0x54a8('0x26')](function(){return db[_0x54a8('0x2d')][_0x54a8('0x53')]({'where':{'CustomReportId':_0x1e9c9e['params']['id']}});});}})[_0x54a8('0x26')](respondWithResult(_0xd82b93,null))['catch'](handleError(_0xd82b93,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index a0faff1..c54bb5b 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 _0x1ffb=['../../config/environment','exports','define','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x22d8d9,_0x4257bb){var _0x215b78=function(_0x405509){while(--_0x405509){_0x22d8d9['push'](_0x22d8d9['shift']());}};_0x215b78(++_0x4257bb);}(_0x1ffb,0x1b1));var _0xb1ff=function(_0xe4bd12,_0x75f8a3){_0xe4bd12=_0xe4bd12-0x0;var _0x5943f2=_0x1ffb[_0xe4bd12];return _0x5943f2;};'use strict';var _=require(_0xb1ff('0x0'));var util=require(_0xb1ff('0x1'));var logger=require(_0xb1ff('0x2'))('api');var moment=require(_0xb1ff('0x3'));var BPromise=require(_0xb1ff('0x4'));var rp=require(_0xb1ff('0x5'));var fs=require('fs');var path=require(_0xb1ff('0x6'));var rimraf=require('rimraf');var config=require(_0xb1ff('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xb1ff('0x8')]=function(_0x1104e8,_0x4154f6){return _0x1104e8[_0xb1ff('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xb1ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd38b=['analytics_report_fields','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport'];(function(_0x43ba8d,_0x347e9f){var _0x300aaf=function(_0x5e1b2d){while(--_0x5e1b2d){_0x43ba8d['push'](_0x43ba8d['shift']());}};_0x300aaf(++_0x347e9f);}(_0xd38b,0x97));var _0xbd38=function(_0x5e8d3a,_0x2ac363){_0x5e8d3a=_0x5e8d3a-0x0;var _0x3a0dbb=_0xd38b[_0x5e8d3a];return _0x3a0dbb;};'use strict';var _=require('lodash');var util=require(_0xbd38('0x0'));var logger=require(_0xbd38('0x1'))('api');var moment=require(_0xbd38('0x2'));var BPromise=require(_0xbd38('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd38('0x4'));var config=require(_0xbd38('0x5'));var attributes=require(_0xbd38('0x6'));module[_0xbd38('0x7')]=function(_0x206601,_0x366977){return _0x206601['define'](_0xbd38('0x8'),attributes,{'tableName':_0xbd38('0x9'),'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 7c4f1db..c7ade35 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 _0xca1a=['message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x336e50,_0x29dd04){var _0x135939=function(_0x57fb42){while(--_0x57fb42){_0x336e50['push'](_0x336e50['shift']());}};_0x135939(++_0x29dd04);}(_0xca1a,0xf3));var _0xaca1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaca1('0x0'));var BPromise=require(_0xaca1('0x1'));var rs=require(_0xaca1('0x2'));var fs=require('fs');var Redis=require(_0xaca1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaca1('0x4'))('rpc');var config=require(_0xaca1('0x5'));var jayson=require(_0xaca1('0x6'));var client=jayson['client'][_0xaca1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7eaa85,_0xd19f67,_0x586f80){return new BPromise(function(_0x5b8798,_0x3be0e9){return client[_0xaca1('0x8')](_0x7eaa85,_0x586f80)[_0xaca1('0x9')](function(_0x2afaf3){logger[_0xaca1('0xa')](_0xaca1('0xb'),_0xd19f67,'request\x20sent');logger[_0xaca1('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xd19f67,_0xaca1('0xd'),JSON[_0xaca1('0xe')](_0x2afaf3));if(_0x2afaf3['error']){if(_0x2afaf3[_0xaca1('0xf')][_0xaca1('0x10')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xd19f67,_0x2afaf3[_0xaca1('0xf')]['message']);return _0x3be0e9(_0x2afaf3[_0xaca1('0xf')]['message']);}logger[_0xaca1('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0xd19f67,_0x2afaf3[_0xaca1('0xf')][_0xaca1('0x11')]);return _0x5b8798(_0x2afaf3['error'][_0xaca1('0x11')]);}else{logger['info'](_0xaca1('0xb'),_0xd19f67,_0xaca1('0xd'));_0x5b8798(_0x2afaf3[_0xaca1('0x12')][_0xaca1('0x11')]);}})[_0xaca1('0x13')](function(_0x57040e){logger[_0xaca1('0xf')](_0xaca1('0xb'),_0xd19f67,_0x57040e);_0x3be0e9(_0x57040e);});});}
\ No newline at end of file
+var _0xd335=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd335,0x6a));var _0x5d33=function(_0x2652f5,_0x3130ec){_0x2652f5=_0x2652f5-0x0;var _0xd81bb5=_0xd335[_0x2652f5];return _0xd81bb5;};'use strict';var _=require(_0x5d33('0x0'));var util=require('util');var moment=require(_0x5d33('0x1'));var BPromise=require(_0x5d33('0x2'));var rs=require(_0x5d33('0x3'));var fs=require('fs');var Redis=require(_0x5d33('0x4'));var db=require(_0x5d33('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d33('0x6'))(_0x5d33('0x7'));var config=require(_0x5d33('0x8'));var jayson=require(_0x5d33('0x9'));var client=jayson['client'][_0x5d33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8c86,_0x5d06b4,_0x3c82df){return new BPromise(function(_0x2d45e9,_0x1befb5){return client[_0x5d33('0xb')](_0x1c8c86,_0x3c82df)[_0x5d33('0xc')](function(_0x1645e2){logger[_0x5d33('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5d06b4,_0x5d33('0xe'));logger[_0x5d33('0xf')](_0x5d33('0x10'),_0x5d06b4,_0x5d33('0xe'),JSON['stringify'](_0x1645e2));if(_0x1645e2[_0x5d33('0x11')]){if(_0x1645e2[_0x5d33('0x11')][_0x5d33('0x12')]===0x1f4){logger[_0x5d33('0x11')](_0x5d33('0x13'),_0x5d06b4,_0x1645e2['error'][_0x5d33('0x14')]);return _0x1befb5(_0x1645e2['error']['message']);}logger[_0x5d33('0x11')](_0x5d33('0x13'),_0x5d06b4,_0x1645e2[_0x5d33('0x11')][_0x5d33('0x14')]);return _0x2d45e9(_0x1645e2[_0x5d33('0x11')][_0x5d33('0x14')]);}else{logger[_0x5d33('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5d06b4,_0x5d33('0xe'));_0x2d45e9(_0x1645e2['result'][_0x5d33('0x14')]);}})[_0x5d33('0x15')](function(_0x509fa9){logger[_0x5d33('0x11')](_0x5d33('0x13'),_0x5d06b4,_0x509fa9);_0x1befb5(_0x509fa9);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 651fa96..dfac656 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(_0x95faf1,_0x5171a7){var _0x3ac0fb=function(_0x3d61c2){while(--_0x3d61c2){_0x95faf1['push'](_0x95faf1['shift']());}};_0x3ac0fb(++_0x5171a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x11e07d,_0x3eb473){var _0x389290=function(_0x2ecc29){while(--_0x2ecc29){_0x11e07d['push'](_0x11e07d['shift']());}};_0x389290(++_0x3eb473);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 5dc8dd2..777d607 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 _0xce3a=['exports','STRING','name','TEXT','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xce3a,0x194));var _0xace3=function(_0x58b665,_0x5bdd88){_0x58b665=_0x58b665-0x0;var _0x560ae5=_0xce3a[_0x58b665];return _0x560ae5;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'name':{'type':Sequelize[_0xace3('0x2')],'allowNull':![],'unique':_0xace3('0x3')},'table':{'type':Sequelize[_0xace3('0x2')]},'metric':{'type':Sequelize[_0xace3('0x4')]},'description':{'type':Sequelize[_0xace3('0x2')]}};
\ No newline at end of file
+var _0x4c4d=['sequelize','TEXT'];(function(_0x573fcc,_0x37239f){var _0x322e29=function(_0xb30f49){while(--_0xb30f49){_0x573fcc['push'](_0x573fcc['shift']());}};_0x322e29(++_0x37239f);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x14acbd,_0x3b2502){_0x14acbd=_0x14acbd-0x0;var _0x4f51c8=_0x4c4d[_0x14acbd];return _0x4f51c8;};'use strict';var Sequelize=require(_0xd4c4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd4c4('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index c76d34c..eab5db6 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','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','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x4bf457,_0x14dcf4){var _0x232be2=function(_0x12daf7){while(--_0x12daf7){_0x4bf457['push'](_0x4bf457['shift']());}};_0x232be2(++_0x14dcf4);}(_0x81bd,0x7c));var _0xd81b=function(_0x3746ff,_0x5dfa8f){_0x3746ff=_0x3746ff-0x0;var _0x353055=_0x81bd[_0x3746ff];return _0x353055;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
+var _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3afe16,_0x4e20cf){_0x3afe16=_0x3afe16-0x0;var _0xe117c9=_0x1cb9[_0x3afe16];return _0xe117c9;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index dc07ea1..62647de 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 _0x8c46=['api','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8c46,0x171));var _0x68c4=function(_0x2e6724,_0xee938a){_0x2e6724=_0x2e6724-0x0;var _0x3eb41b=_0x8c46[_0x2e6724];return _0x3eb41b;};'use strict';var _=require(_0x68c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x68c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x68c4('0x2'));var fs=require('fs');var path=require(_0x68c4('0x3'));var rimraf=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var attributes=require(_0x68c4('0x6'));module[_0x68c4('0x7')]=function(_0x40ce21,_0x1516cf){return _0x40ce21[_0x68c4('0x8')](_0x68c4('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac0a=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','../../config/logger','api'];(function(_0x491fe8,_0xfdb264){var _0xc6f9e6=function(_0x4867e5){while(--_0x4867e5){_0x491fe8['push'](_0x491fe8['shift']());}};_0xc6f9e6(++_0xfdb264);}(_0xac0a,0x11e));var _0xaac0=function(_0xe0e3d0,_0x3eabd9){_0xe0e3d0=_0xe0e3d0-0x0;var _0x4a7f63=_0xac0a[_0xe0e3d0];return _0x4a7f63;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaac0('0x0'))(_0xaac0('0x1'));var moment=require('moment');var BPromise=require(_0xaac0('0x2'));var rp=require(_0xaac0('0x3'));var fs=require('fs');var path=require(_0xaac0('0x4'));var rimraf=require(_0xaac0('0x5'));var config=require(_0xaac0('0x6'));var attributes=require(_0xaac0('0x7'));module[_0xaac0('0x8')]=function(_0x1c92d1,_0x2cefc3){return _0x1c92d1[_0xaac0('0x9')](_0xaac0('0xa'),attributes,{'tableName':_0xaac0('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 46c879f..0fa6264 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 _0xf082=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird'];(function(_0x138946,_0x46b9db){var _0x4e009b=function(_0x24601b){while(--_0x24601b){_0x138946['push'](_0x138946['shift']());}};_0x4e009b(++_0x46b9db);}(_0xf082,0x15d));var _0x2f08=function(_0x591c9a,_0x3f14bd){_0x591c9a=_0x591c9a-0x0;var _0x443759=_0xf082[_0x591c9a];return _0x443759;};'use strict';var _=require('lodash');var util=require(_0x2f08('0x0'));var moment=require(_0x2f08('0x1'));var BPromise=require(_0x2f08('0x2'));var rs=require(_0x2f08('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f08('0x4'))['db'];var utils=require(_0x2f08('0x5'));var logger=require(_0x2f08('0x6'))('rpc');var config=require(_0x2f08('0x7'));var jayson=require(_0x2f08('0x8'));var client=jayson[_0x2f08('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x520584,_0x5f000a,_0x2a3789){return new BPromise(function(_0x5c2b72,_0x445070){return client[_0x2f08('0xa')](_0x520584,_0x2a3789)[_0x2f08('0xb')](function(_0x120fae){logger[_0x2f08('0xc')](_0x2f08('0xd'),_0x5f000a,_0x2f08('0xe'));logger[_0x2f08('0xf')](_0x2f08('0x10'),_0x5f000a,'request\x20sent',JSON[_0x2f08('0x11')](_0x120fae));if(_0x120fae['error']){if(_0x120fae[_0x2f08('0x12')][_0x2f08('0x13')]===0x1f4){logger[_0x2f08('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x5f000a,_0x120fae[_0x2f08('0x12')][_0x2f08('0x14')]);return _0x445070(_0x120fae[_0x2f08('0x12')][_0x2f08('0x14')]);}logger[_0x2f08('0x12')](_0x2f08('0xd'),_0x5f000a,_0x120fae[_0x2f08('0x12')]['message']);return _0x5c2b72(_0x120fae['error']['message']);}else{logger[_0x2f08('0xc')](_0x2f08('0xd'),_0x5f000a,_0x2f08('0xe'));_0x5c2b72(_0x120fae[_0x2f08('0x15')][_0x2f08('0x14')]);}})['catch'](function(_0x36c9d1){logger['error'](_0x2f08('0xd'),_0x5f000a,_0x36c9d1);_0x445070(_0x36c9d1);});});}
\ No newline at end of file
+var _0x6fd2=['debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x1e6179,_0x230c83){var _0xd7c30a=function(_0x141ba1){while(--_0x141ba1){_0x1e6179['push'](_0x1e6179['shift']());}};_0xd7c30a(++_0x230c83);}(_0x6fd2,0xd5));var _0x26fd=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x6fd2[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x26fd('0x0'));var util=require(_0x26fd('0x1'));var moment=require(_0x26fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x26fd('0x3'));var fs=require('fs');var Redis=require(_0x26fd('0x4'));var db=require(_0x26fd('0x5'))['db'];var utils=require(_0x26fd('0x6'));var logger=require(_0x26fd('0x7'))(_0x26fd('0x8'));var config=require(_0x26fd('0x9'));var jayson=require(_0x26fd('0xa'));var client=jayson[_0x26fd('0xb')][_0x26fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x349841,_0x520971,_0x5950d4){return new BPromise(function(_0x5172b1,_0xb3679a){return client['request'](_0x349841,_0x5950d4)[_0x26fd('0xd')](function(_0x512c54){logger[_0x26fd('0xe')](_0x26fd('0xf'),_0x520971,_0x26fd('0x10'));logger[_0x26fd('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x520971,_0x26fd('0x10'),JSON[_0x26fd('0x12')](_0x512c54));if(_0x512c54[_0x26fd('0x13')]){if(_0x512c54[_0x26fd('0x13')][_0x26fd('0x14')]===0x1f4){logger['error'](_0x26fd('0xf'),_0x520971,_0x512c54[_0x26fd('0x13')][_0x26fd('0x15')]);return _0xb3679a(_0x512c54[_0x26fd('0x13')]['message']);}logger[_0x26fd('0x13')](_0x26fd('0xf'),_0x520971,_0x512c54['error'][_0x26fd('0x15')]);return _0x5172b1(_0x512c54['error'][_0x26fd('0x15')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x520971,_0x26fd('0x10'));_0x5172b1(_0x512c54['result']['message']);}})[_0x26fd('0x16')](function(_0x2cface){logger[_0x26fd('0x13')](_0x26fd('0xf'),_0x520971,_0x2cface);_0xb3679a(_0x2cface);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 54903a4..546f975 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 _0xf52f=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x260865,_0x3a148a){var _0x5165c6=function(_0x338514){while(--_0x338514){_0x260865['push'](_0x260865['shift']());}};_0x5165c6(++_0x3a148a);}(_0xf52f,0x113));var _0xff52=function(_0x1a2ef3,_0x21186c){_0x1a2ef3=_0x1a2ef3-0x0;var _0x34f4a4=_0xf52f[_0x1a2ef3];return _0x34f4a4;};'use strict';var multer=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var path=require(_0xff52('0x2'));var timeout=require('connect-timeout');var express=require(_0xff52('0x3'));var router=express[_0xff52('0x4')]();var fs_extra=require(_0xff52('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xff52('0x6'));var config=require(_0xff52('0x7'));var controller=require('./analyticMetric.controller');router[_0xff52('0x8')]('/',auth[_0xff52('0x9')](),controller[_0xff52('0xa')]);router[_0xff52('0x8')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0xc')]);router[_0xff52('0xd')]('/',auth[_0xff52('0x9')](),controller[_0xff52('0xe')]);router[_0xff52('0xf')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0x10')]);router[_0xff52('0x11')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0x12')]);module[_0xff52('0x13')]=router;
\ No newline at end of file
+var _0x96e0=['multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','put','delete','exports'];(function(_0x58e275,_0x3f82a6){var _0x7ee0e4=function(_0x3deaf6){while(--_0x3deaf6){_0x58e275['push'](_0x58e275['shift']());}};_0x7ee0e4(++_0x3f82a6);}(_0x96e0,0x7e));var _0x096e=function(_0x54af4e,_0x4c58a7){_0x54af4e=_0x54af4e-0x0;var _0x327970=_0x96e0[_0x54af4e];return _0x327970;};'use strict';var multer=require(_0x096e('0x0'));var util=require('util');var path=require(_0x096e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x096e('0x2')]();var fs_extra=require(_0x096e('0x3'));var auth=require(_0x096e('0x4'));var interaction=require(_0x096e('0x5'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x096e('0x6')](),controller[_0x096e('0x7')]);router[_0x096e('0x8')](_0x096e('0x9'),auth[_0x096e('0x6')](),controller[_0x096e('0xa')]);router['post']('/',auth[_0x096e('0x6')](),controller['create']);router[_0x096e('0xb')](_0x096e('0x9'),auth[_0x096e('0x6')](),controller['update']);router[_0x096e('0xc')](_0x096e('0x9'),auth[_0x096e('0x6')](),controller['destroy']);module[_0x096e('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 7f49792..a7a11ce 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 _0x48dd=['TEXT'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x48dd,0x99));var _0xd48d=function(_0x13527c,_0x3aa564){_0x13527c=_0x13527c-0x0;var _0x2da7e3=_0x48dd[_0x13527c];return _0x2da7e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xd48d('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x0c48=['TEXT','sequelize','exports'];(function(_0x77fce6,_0x1e2fee){var _0x4b2e26=function(_0x30c79c){while(--_0x30c79c){_0x77fce6['push'](_0x77fce6['shift']());}};_0x4b2e26(++_0x1e2fee);}(_0x0c48,0xd3));var _0x80c4=function(_0x2dd161,_0x2afcfb){_0x2dd161=_0x2dd161-0x0;var _0xa027ae=_0x0c48[_0x2dd161];return _0xa027ae;};'use strict';var Sequelize=require(_0x80c4('0x0'));module[_0x80c4('0x1')]={'tree':{'type':Sequelize[_0x80c4('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index c2b7d0e..3916beb 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 _0x1898=['json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x3dbf5a,_0x4613fc){var _0x5e83a8=function(_0x523916){while(--_0x523916){_0x3dbf5a['push'](_0x3dbf5a['shift']());}};_0x5e83a8(++_0x4613fc);}(_0x1898,0xc8));var _0x8189=function(_0x41c82a,_0x2101b5){_0x41c82a=_0x41c82a-0x0;var _0x206c6f=_0x1898[_0x41c82a];return _0x206c6f;};'use strict';var emlformat=require(_0x8189('0x0'));var rimraf=require(_0x8189('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8189('0x2'));var rp=require(_0x8189('0x3'));var moment=require(_0x8189('0x4'));var BPromise=require(_0x8189('0x5'));var Mustache=require(_0x8189('0x6'));var util=require(_0x8189('0x7'));var path=require('path');var sox=require(_0x8189('0x8'));var csv=require(_0x8189('0x9'));var ejs=require(_0x8189('0xa'));var fs=require('fs');var fs_extra=require(_0x8189('0xb'));var _=require(_0x8189('0xc'));var squel=require(_0x8189('0xd'));var crypto=require(_0x8189('0xe'));var jsforce=require(_0x8189('0xf'));var deskjs=require(_0x8189('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8189('0x11'));var authService=require(_0x8189('0x12'));var qs=require(_0x8189('0x13'));var as=require(_0x8189('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8189('0x15'))(_0x8189('0x16'));var utils=require(_0x8189('0x17'));var config=require(_0x8189('0x18'));var licenseUtil=require(_0x8189('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bbef,_0x4a26d4){_0x4a26d4=_0x4a26d4||0xcc;return function(_0x125fb7){if(_0x125fb7){return _0x54bbef[_0x8189('0x1a')](_0x4a26d4);}return _0x54bbef[_0x8189('0x1b')](_0x4a26d4)['end']();};}function respondWithResult(_0x34ea70,_0x25f66c){_0x25f66c=_0x25f66c||0xc8;return function(_0x441850){if(_0x441850){return _0x34ea70['status'](_0x25f66c)[_0x8189('0x1c')](_0x441850);}};}function respondWithFilteredResult(_0x208573,_0x236b4b){return function(_0x3cdfdc){if(_0x3cdfdc){var _0x2338b1=typeof _0x236b4b['offset']===_0x8189('0x1d')&&typeof _0x236b4b[_0x8189('0x1e')]===_0x8189('0x1d');var _0x1b1a76=_0x3cdfdc[_0x8189('0x1f')];var _0x1826a4=_0x2338b1?0x0:_0x236b4b['offset'];var _0x181544=_0x2338b1?_0x3cdfdc[_0x8189('0x1f')]:_0x236b4b[_0x8189('0x20')]+_0x236b4b[_0x8189('0x1e')];var _0x147154;if(_0x181544>=_0x1b1a76){_0x181544=_0x1b1a76;_0x147154=0xc8;}else{_0x147154=0xce;}_0x208573[_0x8189('0x1b')](_0x147154);return _0x208573[_0x8189('0x21')](_0x8189('0x22'),_0x1826a4+'-'+_0x181544+'/'+_0x1b1a76)['json'](_0x3cdfdc);}return null;};}function patchUpdates(_0x518a95){return function(_0x25da3c){try{jsonpatch['apply'](_0x25da3c,_0x518a95,!![]);}catch(_0x2baa0a){return BPromise[_0x8189('0x23')](_0x2baa0a);}return _0x25da3c[_0x8189('0x24')]();};}function saveUpdates(_0x17739c,_0x14680a){return function(_0x2230ef){if(_0x2230ef){return _0x2230ef[_0x8189('0x25')](_0x17739c)[_0x8189('0x26')](function(_0x31723c){return _0x31723c;});}return null;};}function removeEntity(_0xf13e0a,_0x29d1bd){return function(_0x4f1376){if(_0x4f1376){return _0x4f1376[_0x8189('0x27')]()[_0x8189('0x26')](function(){_0xf13e0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b492,_0x1ca0f4){return function(_0x3d27e5){if(!_0x3d27e5){_0x55b492['sendStatus'](0x194);}return _0x3d27e5;};}function handleError(_0x1d4ae6,_0x366bb3){_0x366bb3=_0x366bb3||0x1f4;return function(_0x4c46cf){logger[_0x8189('0x28')](_0x4c46cf['stack']);if(_0x4c46cf['name']){delete _0x4c46cf[_0x8189('0x29')];}_0x1d4ae6['status'](_0x366bb3)[_0x8189('0x2a')](_0x4c46cf);};}exports[_0x8189('0x2b')]=function(_0x1861c3,_0x4a62e3){var _0x757e6a={},_0x59889b={},_0x193203={'count':0x0,'rows':[]};var _0x97dfa9=_[_0x8189('0x2c')](db[_0x8189('0x2d')][_0x8189('0x2e')],function(_0x5f28fb){return{'name':_0x5f28fb[_0x8189('0x2f')],'type':_0x5f28fb[_0x8189('0x30')][_0x8189('0x31')]};});_0x59889b[_0x8189('0x32')]=_['map'](_0x97dfa9,'name');_0x59889b[_0x8189('0x33')]=_[_0x8189('0x34')](_0x1861c3[_0x8189('0x33')]);_0x59889b[_0x8189('0x35')]=_[_0x8189('0x36')](_0x59889b['model'],_0x59889b['query']);_0x757e6a[_0x8189('0x37')]=_[_0x8189('0x36')](_0x59889b['model'],qs['fields'](_0x1861c3[_0x8189('0x33')][_0x8189('0x38')]));_0x757e6a[_0x8189('0x37')]=_0x757e6a['attributes'][_0x8189('0x39')]?_0x757e6a[_0x8189('0x37')]:_0x59889b['model'];if(!_0x1861c3['query']['hasOwnProperty'](_0x8189('0x3a'))){_0x757e6a[_0x8189('0x1e')]=qs[_0x8189('0x1e')](_0x1861c3[_0x8189('0x33')][_0x8189('0x1e')]);_0x757e6a[_0x8189('0x20')]=qs[_0x8189('0x20')](_0x1861c3[_0x8189('0x33')]['offset']);}_0x757e6a['order']=qs[_0x8189('0x3b')](_0x1861c3[_0x8189('0x33')][_0x8189('0x3b')]);_0x757e6a[_0x8189('0x3c')]=qs[_0x8189('0x35')](_[_0x8189('0x3d')](_0x1861c3[_0x8189('0x33')],_0x59889b[_0x8189('0x35')]),_0x97dfa9);if(_0x1861c3[_0x8189('0x33')][_0x8189('0x3e')]){_0x757e6a[_0x8189('0x3c')]=_['merge'](_0x757e6a['where'],{'$or':_[_0x8189('0x2c')](_0x97dfa9,function(_0x8fab03){if(_0x8fab03[_0x8189('0x30')]!==_0x8189('0x3f')){var _0x4cf506={};_0x4cf506[_0x8fab03[_0x8189('0x29')]]={'$like':'%'+_0x1861c3[_0x8189('0x33')][_0x8189('0x3e')]+'%'};return _0x4cf506;}})});}_0x757e6a=_[_0x8189('0x40')]({},_0x757e6a,_0x1861c3['options']);var _0x2d9f5a={'where':_0x757e6a['where']};return db[_0x8189('0x2d')][_0x8189('0x1f')](_0x2d9f5a)[_0x8189('0x26')](function(_0x26955e){_0x193203[_0x8189('0x1f')]=_0x26955e;if(_0x1861c3[_0x8189('0x33')]['includeAll']){_0x757e6a['include']=[{'all':!![]}];}return db[_0x8189('0x2d')][_0x8189('0x41')](_0x757e6a);})['then'](function(_0x357cce){_0x193203[_0x8189('0x42')]=_0x357cce;return _0x193203;})[_0x8189('0x26')](respondWithFilteredResult(_0x4a62e3,_0x757e6a))[_0x8189('0x43')](handleError(_0x4a62e3,null));};exports[_0x8189('0x44')]=function(_0xeb1492,_0x26c9f9){var _0x3cb49f={'raw':!![],'where':{'id':_0xeb1492[_0x8189('0x45')]['id']}},_0x1fe297={};_0x1fe297[_0x8189('0x32')]=_[_0x8189('0x34')](db[_0x8189('0x2d')][_0x8189('0x2e')]);_0x1fe297[_0x8189('0x33')]=_[_0x8189('0x34')](_0xeb1492[_0x8189('0x33')]);_0x1fe297[_0x8189('0x35')]=_['intersection'](_0x1fe297[_0x8189('0x32')],_0x1fe297[_0x8189('0x33')]);_0x3cb49f[_0x8189('0x37')]=_['intersection'](_0x1fe297['model'],qs[_0x8189('0x38')](_0xeb1492['query'][_0x8189('0x38')]));_0x3cb49f['attributes']=_0x3cb49f[_0x8189('0x37')][_0x8189('0x39')]?_0x3cb49f['attributes']:_0x1fe297[_0x8189('0x32')];if(_0xeb1492['query'][_0x8189('0x46')]){_0x3cb49f[_0x8189('0x47')]=[{'all':!![]}];}_0x3cb49f=_[_0x8189('0x40')]({},_0x3cb49f,_0xeb1492[_0x8189('0x48')]);return db[_0x8189('0x2d')][_0x8189('0x49')](_0x3cb49f)['then'](handleEntityNotFound(_0x26c9f9,null))[_0x8189('0x26')](respondWithResult(_0x26c9f9,null))[_0x8189('0x43')](handleError(_0x26c9f9,null));};exports[_0x8189('0x4a')]=function(_0x17f988,_0xd14e58){return db['AnalyticTreeReport']['create'](_0x17f988[_0x8189('0x4b')],{})[_0x8189('0x26')](respondWithResult(_0xd14e58,0xc9))[_0x8189('0x43')](handleError(_0xd14e58,null));};exports[_0x8189('0x25')]=function(_0x174cb2,_0x587ceb){if(_0x174cb2['body']['id']){delete _0x174cb2[_0x8189('0x4b')]['id'];}return db[_0x8189('0x2d')][_0x8189('0x49')]({'where':{'id':_0x174cb2[_0x8189('0x45')]['id']}})['then'](handleEntityNotFound(_0x587ceb,null))['then'](saveUpdates(_0x174cb2[_0x8189('0x4b')],null))['then'](respondWithResult(_0x587ceb,null))[_0x8189('0x43')](handleError(_0x587ceb,null));};exports[_0x8189('0x27')]=function(_0x388035,_0x551100){return db[_0x8189('0x2d')][_0x8189('0x49')]({'where':{'id':_0x388035[_0x8189('0x45')]['id']}})['then'](handleEntityNotFound(_0x551100,null))['then'](removeEntity(_0x551100,null))['catch'](handleError(_0x551100,null));};
\ No newline at end of file
+var _0x5bd6=['merge','type','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter'];(function(_0x574945,_0x2319ab){var _0x2adfb6=function(_0x168d4b){while(--_0x168d4b){_0x574945['push'](_0x574945['shift']());}};_0x2adfb6(++_0x2319ab);}(_0x5bd6,0xa5));var _0x65bd=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x5bd6[_0x5959c9];return _0x4ffcbc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65bd('0x0'));var zipdir=require(_0x65bd('0x1'));var jsonpatch=require(_0x65bd('0x2'));var rp=require(_0x65bd('0x3'));var moment=require(_0x65bd('0x4'));var BPromise=require(_0x65bd('0x5'));var Mustache=require(_0x65bd('0x6'));var util=require('util');var path=require(_0x65bd('0x7'));var sox=require(_0x65bd('0x8'));var csv=require(_0x65bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65bd('0xa'));var _=require(_0x65bd('0xb'));var squel=require(_0x65bd('0xc'));var crypto=require(_0x65bd('0xd'));var jsforce=require(_0x65bd('0xe'));var deskjs=require(_0x65bd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x65bd('0x10'));var Papa=require(_0x65bd('0x11'));var Redis=require('ioredis');var authService=require(_0x65bd('0x12'));var qs=require(_0x65bd('0x13'));var as=require(_0x65bd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65bd('0x15'))(_0x65bd('0x16'));var utils=require('../../config/utils');var config=require(_0x65bd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x65bd('0x18'))['db'];function respondWithStatusCode(_0x2e8405,_0x3c16cf){_0x3c16cf=_0x3c16cf||0xcc;return function(_0x4f6845){if(_0x4f6845){return _0x2e8405[_0x65bd('0x19')](_0x3c16cf);}return _0x2e8405['status'](_0x3c16cf)[_0x65bd('0x1a')]();};}function respondWithResult(_0x60e359,_0x1147c2){_0x1147c2=_0x1147c2||0xc8;return function(_0x405fb4){if(_0x405fb4){return _0x60e359[_0x65bd('0x1b')](_0x1147c2)[_0x65bd('0x1c')](_0x405fb4);}};}function respondWithFilteredResult(_0x15b515,_0x3fd5a3){return function(_0x10eefc){if(_0x10eefc){var _0x22d3fa=typeof _0x3fd5a3[_0x65bd('0x1d')]===_0x65bd('0x1e')&&typeof _0x3fd5a3[_0x65bd('0x1f')]==='undefined';var _0x117df0=_0x10eefc[_0x65bd('0x20')];var _0x5d5b0f=_0x22d3fa?0x0:_0x3fd5a3[_0x65bd('0x1d')];var _0xecddc2=_0x22d3fa?_0x10eefc[_0x65bd('0x20')]:_0x3fd5a3[_0x65bd('0x1d')]+_0x3fd5a3[_0x65bd('0x1f')];var _0x4fc1ec;if(_0xecddc2>=_0x117df0){_0xecddc2=_0x117df0;_0x4fc1ec=0xc8;}else{_0x4fc1ec=0xce;}_0x15b515[_0x65bd('0x1b')](_0x4fc1ec);return _0x15b515[_0x65bd('0x21')](_0x65bd('0x22'),_0x5d5b0f+'-'+_0xecddc2+'/'+_0x117df0)[_0x65bd('0x1c')](_0x10eefc);}return null;};}function patchUpdates(_0x5c1b29){return function(_0x33e3ef){try{jsonpatch['apply'](_0x33e3ef,_0x5c1b29,!![]);}catch(_0x1b2fd3){return BPromise[_0x65bd('0x23')](_0x1b2fd3);}return _0x33e3ef[_0x65bd('0x24')]();};}function saveUpdates(_0x7f87e4,_0x16db0d){return function(_0x2b8fc9){if(_0x2b8fc9){return _0x2b8fc9[_0x65bd('0x25')](_0x7f87e4)['then'](function(_0x3ed1e1){return _0x3ed1e1;});}return null;};}function removeEntity(_0x458b33,_0x2da8bb){return function(_0x4e676d){if(_0x4e676d){return _0x4e676d[_0x65bd('0x26')]()[_0x65bd('0x27')](function(){_0x458b33[_0x65bd('0x1b')](0xcc)[_0x65bd('0x1a')]();});}};}function handleEntityNotFound(_0x504005,_0x21e96c){return function(_0x4b3c71){if(!_0x4b3c71){_0x504005[_0x65bd('0x19')](0x194);}return _0x4b3c71;};}function handleError(_0x580bb1,_0x330306){_0x330306=_0x330306||0x1f4;return function(_0x2a6ac2){logger[_0x65bd('0x28')](_0x2a6ac2[_0x65bd('0x29')]);if(_0x2a6ac2[_0x65bd('0x2a')]){delete _0x2a6ac2[_0x65bd('0x2a')];}_0x580bb1[_0x65bd('0x1b')](_0x330306)[_0x65bd('0x2b')](_0x2a6ac2);};}exports[_0x65bd('0x2c')]=function(_0x4716db,_0x5c7d5d){var _0x398bbf={},_0x35b73f={},_0x4ed64a={'count':0x0,'rows':[]};var _0x1858a6=_['map'](db[_0x65bd('0x2d')][_0x65bd('0x2e')],function(_0x13283a){return{'name':_0x13283a[_0x65bd('0x2f')],'type':_0x13283a['type']['key']};});_0x35b73f['model']=_[_0x65bd('0x30')](_0x1858a6,'name');_0x35b73f[_0x65bd('0x31')]=_[_0x65bd('0x32')](_0x4716db[_0x65bd('0x31')]);_0x35b73f[_0x65bd('0x33')]=_[_0x65bd('0x34')](_0x35b73f[_0x65bd('0x35')],_0x35b73f['query']);_0x398bbf['attributes']=_['intersection'](_0x35b73f[_0x65bd('0x35')],qs[_0x65bd('0x36')](_0x4716db[_0x65bd('0x31')][_0x65bd('0x36')]));_0x398bbf[_0x65bd('0x37')]=_0x398bbf[_0x65bd('0x37')][_0x65bd('0x38')]?_0x398bbf[_0x65bd('0x37')]:_0x35b73f[_0x65bd('0x35')];if(!_0x4716db[_0x65bd('0x31')]['hasOwnProperty'](_0x65bd('0x39'))){_0x398bbf[_0x65bd('0x1f')]=qs[_0x65bd('0x1f')](_0x4716db[_0x65bd('0x31')][_0x65bd('0x1f')]);_0x398bbf[_0x65bd('0x1d')]=qs[_0x65bd('0x1d')](_0x4716db[_0x65bd('0x31')][_0x65bd('0x1d')]);}_0x398bbf[_0x65bd('0x3a')]=qs[_0x65bd('0x3b')](_0x4716db['query'][_0x65bd('0x3b')]);_0x398bbf[_0x65bd('0x3c')]=qs[_0x65bd('0x33')](_[_0x65bd('0x3d')](_0x4716db['query'],_0x35b73f[_0x65bd('0x33')]),_0x1858a6);if(_0x4716db[_0x65bd('0x31')][_0x65bd('0x3e')]){_0x398bbf['where']=_[_0x65bd('0x3f')](_0x398bbf[_0x65bd('0x3c')],{'$or':_[_0x65bd('0x30')](_0x1858a6,function(_0x3c27f2){if(_0x3c27f2[_0x65bd('0x40')]!==_0x65bd('0x41')){var _0x5de894={};_0x5de894[_0x3c27f2[_0x65bd('0x2a')]]={'$like':'%'+_0x4716db['query']['filter']+'%'};return _0x5de894;}})});}_0x398bbf=_[_0x65bd('0x3f')]({},_0x398bbf,_0x4716db[_0x65bd('0x42')]);var _0xb9189e={'where':_0x398bbf[_0x65bd('0x3c')]};return db[_0x65bd('0x2d')][_0x65bd('0x20')](_0xb9189e)[_0x65bd('0x27')](function(_0x440bc5){_0x4ed64a[_0x65bd('0x20')]=_0x440bc5;if(_0x4716db[_0x65bd('0x31')]['includeAll']){_0x398bbf[_0x65bd('0x43')]=[{'all':!![]}];}return db[_0x65bd('0x2d')][_0x65bd('0x44')](_0x398bbf);})['then'](function(_0x11904e){_0x4ed64a[_0x65bd('0x45')]=_0x11904e;return _0x4ed64a;})['then'](respondWithFilteredResult(_0x5c7d5d,_0x398bbf))[_0x65bd('0x46')](handleError(_0x5c7d5d,null));};exports['show']=function(_0x3f07ae,_0x4fc964){var _0x73ef02={'raw':!![],'where':{'id':_0x3f07ae['params']['id']}},_0x5313e9={};_0x5313e9[_0x65bd('0x35')]=_[_0x65bd('0x32')](db[_0x65bd('0x2d')][_0x65bd('0x2e')]);_0x5313e9['query']=_[_0x65bd('0x32')](_0x3f07ae[_0x65bd('0x31')]);_0x5313e9['filters']=_[_0x65bd('0x34')](_0x5313e9['model'],_0x5313e9[_0x65bd('0x31')]);_0x73ef02[_0x65bd('0x37')]=_[_0x65bd('0x34')](_0x5313e9[_0x65bd('0x35')],qs[_0x65bd('0x36')](_0x3f07ae[_0x65bd('0x31')]['fields']));_0x73ef02[_0x65bd('0x37')]=_0x73ef02[_0x65bd('0x37')][_0x65bd('0x38')]?_0x73ef02[_0x65bd('0x37')]:_0x5313e9[_0x65bd('0x35')];if(_0x3f07ae['query'][_0x65bd('0x47')]){_0x73ef02[_0x65bd('0x43')]=[{'all':!![]}];}_0x73ef02=_[_0x65bd('0x3f')]({},_0x73ef02,_0x3f07ae['options']);return db[_0x65bd('0x2d')][_0x65bd('0x48')](_0x73ef02)['then'](handleEntityNotFound(_0x4fc964,null))[_0x65bd('0x27')](respondWithResult(_0x4fc964,null))[_0x65bd('0x46')](handleError(_0x4fc964,null));};exports[_0x65bd('0x49')]=function(_0x585820,_0x124ad0){return db[_0x65bd('0x2d')][_0x65bd('0x49')](_0x585820[_0x65bd('0x4a')],{})[_0x65bd('0x27')](respondWithResult(_0x124ad0,0xc9))[_0x65bd('0x46')](handleError(_0x124ad0,null));};exports[_0x65bd('0x25')]=function(_0x1c613e,_0x1be882){if(_0x1c613e[_0x65bd('0x4a')]['id']){delete _0x1c613e[_0x65bd('0x4a')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x1c613e['params']['id']}})[_0x65bd('0x27')](handleEntityNotFound(_0x1be882,null))[_0x65bd('0x27')](saveUpdates(_0x1c613e['body'],null))[_0x65bd('0x27')](respondWithResult(_0x1be882,null))[_0x65bd('0x46')](handleError(_0x1be882,null));};exports[_0x65bd('0x26')]=function(_0x4741c3,_0x3e5c31){return db['AnalyticTreeReport'][_0x65bd('0x48')]({'where':{'id':_0x4741c3[_0x65bd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e5c31,null))['then'](removeEntity(_0x3e5c31,null))[_0x65bd('0x46')](handleError(_0x3e5c31,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 20f4d02..29a73c4 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 _0x4715=['../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x4715,0xec));var _0x5471=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x4715[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x5471('0x0'));var util=require('util');var logger=require(_0x5471('0x1'))(_0x5471('0x2'));var moment=require(_0x5471('0x3'));var BPromise=require('bluebird');var rp=require(_0x5471('0x4'));var fs=require('fs');var path=require(_0x5471('0x5'));var rimraf=require('rimraf');var config=require(_0x5471('0x6'));var attributes=require(_0x5471('0x7'));module['exports']=function(_0x4d5226,_0x5636f9){return _0x4d5226[_0x5471('0x8')](_0x5471('0x9'),attributes,{'tableName':_0x5471('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8dc=['request-promise','path','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment'];(function(_0x504ad8,_0x1ff2ff){var _0x38229b=function(_0x52a9be){while(--_0x52a9be){_0x504ad8['push'](_0x504ad8['shift']());}};_0x38229b(++_0x1ff2ff);}(_0xe8dc,0xb0));var _0xce8d=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xe8dc[_0x193e28];return _0x20ef59;};'use strict';var _=require(_0xce8d('0x0'));var util=require('util');var logger=require(_0xce8d('0x1'))(_0xce8d('0x2'));var moment=require(_0xce8d('0x3'));var BPromise=require('bluebird');var rp=require(_0xce8d('0x4'));var fs=require('fs');var path=require(_0xce8d('0x5'));var rimraf=require('rimraf');var config=require(_0xce8d('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xce8d('0x7')]=function(_0xc47045,_0x583dd4){return _0xc47045['define'](_0xce8d('0x8'),attributes,{'tableName':_0xce8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 1b10eee..2995d43 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xadb5,0xad));var _0x5adb=function(_0x399440,_0xdaaf94){_0x399440=_0x399440-0x0;var _0x566163=_0xadb5[_0x399440];return _0x566163;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xa1dcbd,_0x39a535){var _0x5a20dc=function(_0x33c40f){while(--_0x33c40f){_0xa1dcbd['push'](_0xa1dcbd['shift']());}};_0x5a20dc(++_0x39a535);}(_0xadb5,0xad));var _0x5adb=function(_0x4ae173,_0x324e50){_0x4ae173=_0x4ae173-0x0;var _0x27f39b=_0xadb5[_0x4ae173];return _0x27f39b;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index bb4aaed..94a1e1e 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 _0x848a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','express'];(function(_0xdbf8f2,_0x409a32){var _0x4ed5d2=function(_0xe7819c){while(--_0xe7819c){_0xdbf8f2['push'](_0xdbf8f2['shift']());}};_0x4ed5d2(++_0x409a32);}(_0x848a,0x1e3));var _0xa848=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0x848a[_0x12b83d];return _0x1fd39d;};'use strict';var multer=require(_0xa848('0x0'));var util=require(_0xa848('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa848('0x2'));var router=express[_0xa848('0x3')]();var fs_extra=require(_0xa848('0x4'));var auth=require(_0xa848('0x5'));var interaction=require(_0xa848('0x6'));var config=require(_0xa848('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xa848('0x8')]('/',auth[_0xa848('0x9')](),controller[_0xa848('0xa')]);router[_0xa848('0x8')](_0xa848('0xb'),auth[_0xa848('0x9')](),controller['show']);router[_0xa848('0xc')]('/',auth['isAuthenticated'](),controller[_0xa848('0xd')]);router[_0xa848('0xe')](_0xa848('0xb'),auth['isAuthenticated'](),controller[_0xa848('0xf')]);router[_0xa848('0x10')](_0xa848('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa848('0x11')]=router;
\ No newline at end of file
+var _0x54f4=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports','multer','util','path','express','fs-extra'];(function(_0xb524a6,_0x43c07f){var _0x2aaeca=function(_0x2c6e59){while(--_0x2c6e59){_0xb524a6['push'](_0xb524a6['shift']());}};_0x2aaeca(++_0x43c07f);}(_0x54f4,0x160));var _0x454f=function(_0x3683e3,_0xdaa1b3){_0x3683e3=_0x3683e3-0x0;var _0x3825f1=_0x54f4[_0x3683e3];return _0x3825f1;};'use strict';var multer=require(_0x454f('0x0'));var util=require(_0x454f('0x1'));var path=require(_0x454f('0x2'));var timeout=require('connect-timeout');var express=require(_0x454f('0x3'));var router=express['Router']();var fs_extra=require(_0x454f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x454f('0x5'));var controller=require(_0x454f('0x6'));router[_0x454f('0x7')]('/',auth[_0x454f('0x8')](),controller[_0x454f('0x9')]);router[_0x454f('0x7')]('/:id',auth[_0x454f('0x8')](),controller['show']);router[_0x454f('0xa')]('/',auth[_0x454f('0x8')](),controller[_0x454f('0xb')]);router[_0x454f('0xc')]('/:id',auth[_0x454f('0x8')](),controller['update']);router[_0x454f('0xd')](_0x454f('0xe'),auth[_0x454f('0x8')](),controller[_0x454f('0xf')]);module[_0x454f('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index fd6e22a..888887d 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 _0x3fc6=['sequelize','exports','STRING'];(function(_0x46639c,_0x8dd072){var _0x1e7b0b=function(_0x190678){while(--_0x190678){_0x46639c['push'](_0x46639c['shift']());}};_0x1e7b0b(++_0x8dd072);}(_0x3fc6,0x159));var _0x63fc=function(_0x2be24f,_0x2a5efd){_0x2be24f=_0x2be24f-0x0;var _0x4686ca=_0x3fc6[_0x2be24f];return _0x4686ca;};'use strict';var Sequelize=require(_0x63fc('0x0'));module[_0x63fc('0x1')]={'name':{'type':Sequelize[_0x63fc('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x63fc('0x2')]}};
\ No newline at end of file
+var _0xdeb7=['exports','STRING','sequelize'];(function(_0x25f8bc,_0x220222){var _0x39c967=function(_0x8bc969){while(--_0x8bc969){_0x25f8bc['push'](_0x25f8bc['shift']());}};_0x39c967(++_0x220222);}(_0xdeb7,0x77));var _0x7deb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdeb7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7deb('0x0'));module[_0x7deb('0x1')]={'name':{'type':Sequelize[_0x7deb('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7deb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index e142606..76d6e36 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 _0x594f=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','options','findAll','rows','find','catch','clone','params','include','get','createdAt','updatedAt','body','omit','create','includeAll','file','basename','filename','mimetype','download','findOne','root','server/files/attachments/','join','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis'];(function(_0x131090,_0x4b5e43){var _0x1e10cf=function(_0x489085){while(--_0x489085){_0x131090['push'](_0x131090['shift']());}};_0x1e10cf(++_0x4b5e43);}(_0x594f,0x98));var _0xf594=function(_0x135994,_0x31fd0c){_0x135994=_0x135994-0x0;var _0x5ad741=_0x594f[_0x135994];return _0x5ad741;};'use strict';var emlformat=require(_0xf594('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf594('0x1'));var jsonpatch=require(_0xf594('0x2'));var rp=require('request-promise');var moment=require(_0xf594('0x3'));var BPromise=require(_0xf594('0x4'));var Mustache=require('mustache');var util=require(_0xf594('0x5'));var path=require(_0xf594('0x6'));var sox=require(_0xf594('0x7'));var csv=require('to-csv');var ejs=require(_0xf594('0x8'));var fs=require('fs');var fs_extra=require(_0xf594('0x9'));var _=require(_0xf594('0xa'));var squel=require(_0xf594('0xb'));var crypto=require('crypto');var jsforce=require(_0xf594('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf594('0xd'));var querystring=require('querystring');var Papa=require(_0xf594('0xe'));var Redis=require(_0xf594('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf594('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf594('0x11'))(_0xf594('0x12'));var utils=require(_0xf594('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf594('0x14'))['db'];function respondWithStatusCode(_0x429fab,_0x5910c2){_0x5910c2=_0x5910c2||0xcc;return function(_0x1ca7ba){if(_0x1ca7ba){return _0x429fab[_0xf594('0x15')](_0x5910c2);}return _0x429fab['status'](_0x5910c2)[_0xf594('0x16')]();};}function respondWithResult(_0xe4538d,_0x5523c3){_0x5523c3=_0x5523c3||0xc8;return function(_0x18cc87){if(_0x18cc87){return _0xe4538d[_0xf594('0x17')](_0x5523c3)['json'](_0x18cc87);}};}function respondWithFilteredResult(_0x3b7ed4,_0x536647){return function(_0x23ed0a){if(_0x23ed0a){var _0x5580f0=typeof _0x536647[_0xf594('0x18')]===_0xf594('0x19')&&typeof _0x536647['limit']===_0xf594('0x19');var _0x235109=_0x23ed0a[_0xf594('0x1a')];var _0x58c0ac=_0x5580f0?0x0:_0x536647[_0xf594('0x18')];var _0x4bb090=_0x5580f0?_0x23ed0a['count']:_0x536647[_0xf594('0x18')]+_0x536647[_0xf594('0x1b')];var _0x5cf418;if(_0x4bb090>=_0x235109){_0x4bb090=_0x235109;_0x5cf418=0xc8;}else{_0x5cf418=0xce;}_0x3b7ed4['status'](_0x5cf418);return _0x3b7ed4[_0xf594('0x1c')](_0xf594('0x1d'),_0x58c0ac+'-'+_0x4bb090+'/'+_0x235109)['json'](_0x23ed0a);}return null;};}function patchUpdates(_0x313415){return function(_0x321e46){try{jsonpatch['apply'](_0x321e46,_0x313415,!![]);}catch(_0x10997b){return BPromise[_0xf594('0x1e')](_0x10997b);}return _0x321e46[_0xf594('0x1f')]();};}function saveUpdates(_0x92a34a,_0x75976f){return function(_0xcbc736){if(_0xcbc736){return _0xcbc736[_0xf594('0x20')](_0x92a34a)[_0xf594('0x21')](function(_0x5399ec){return _0x5399ec;});}return null;};}function removeEntity(_0xf95fd7,_0x2087ed){return function(_0xa7229c){if(_0xa7229c){return _0xa7229c[_0xf594('0x22')]()['then'](function(){_0xf95fd7[_0xf594('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c4d7a,_0x5d63e6){return function(_0x35f6a7){if(!_0x35f6a7){_0x4c4d7a[_0xf594('0x15')](0x194);}return _0x35f6a7;};}function handleError(_0x12e6c1,_0xa078bd){_0xa078bd=_0xa078bd||0x1f4;return function(_0x5d77c8){logger[_0xf594('0x23')](_0x5d77c8['stack']);if(_0x5d77c8[_0xf594('0x24')]){delete _0x5d77c8['name'];}_0x12e6c1[_0xf594('0x17')](_0xa078bd)[_0xf594('0x25')](_0x5d77c8);};}exports[_0xf594('0x26')]=function(_0x5b9d10,_0x2ce744){var _0x59917e={},_0x1d1990={},_0x53bf97={'count':0x0,'rows':[]};var _0x59999a=_['map'](db[_0xf594('0x27')][_0xf594('0x28')],function(_0x519f12){return{'name':_0x519f12[_0xf594('0x29')],'type':_0x519f12[_0xf594('0x2a')][_0xf594('0x2b')]};});_0x1d1990[_0xf594('0x2c')]=_['map'](_0x59999a,'name');_0x1d1990[_0xf594('0x2d')]=_[_0xf594('0x2e')](_0x5b9d10['query']);_0x1d1990['filters']=_['intersection'](_0x1d1990[_0xf594('0x2c')],_0x1d1990['query']);_0x59917e[_0xf594('0x2f')]=_[_0xf594('0x30')](_0x1d1990[_0xf594('0x2c')],qs['fields'](_0x5b9d10[_0xf594('0x2d')][_0xf594('0x31')]));_0x59917e[_0xf594('0x2f')]=_0x59917e[_0xf594('0x2f')][_0xf594('0x32')]?_0x59917e['attributes']:_0x1d1990[_0xf594('0x2c')];if(!_0x5b9d10[_0xf594('0x2d')][_0xf594('0x33')](_0xf594('0x34'))){_0x59917e[_0xf594('0x1b')]=qs[_0xf594('0x1b')](_0x5b9d10[_0xf594('0x2d')][_0xf594('0x1b')]);_0x59917e[_0xf594('0x18')]=qs[_0xf594('0x18')](_0x5b9d10[_0xf594('0x2d')][_0xf594('0x18')]);}_0x59917e['order']=qs[_0xf594('0x35')](_0x5b9d10[_0xf594('0x2d')][_0xf594('0x35')]);_0x59917e[_0xf594('0x36')]=qs[_0xf594('0x37')](_[_0xf594('0x38')](_0x5b9d10[_0xf594('0x2d')],_0x1d1990[_0xf594('0x37')]),_0x59999a);if(_0x5b9d10[_0xf594('0x2d')][_0xf594('0x39')]){_0x59917e[_0xf594('0x36')]=_[_0xf594('0x3a')](_0x59917e[_0xf594('0x36')],{'$or':_[_0xf594('0x3b')](_0x59999a,function(_0x1dc599){if(_0x1dc599[_0xf594('0x2a')]!=='VIRTUAL'){var _0x396aee={};_0x396aee[_0x1dc599[_0xf594('0x24')]]={'$like':'%'+_0x5b9d10[_0xf594('0x2d')]['filter']+'%'};return _0x396aee;}})});}_0x59917e=_['merge']({},_0x59917e,_0x5b9d10[_0xf594('0x3c')]);var _0x360149={'where':_0x59917e[_0xf594('0x36')]};return db['Attachment'][_0xf594('0x1a')](_0x360149)['then'](function(_0x4788c3){_0x53bf97[_0xf594('0x1a')]=_0x4788c3;if(_0x5b9d10[_0xf594('0x2d')]['includeAll']){_0x59917e['include']=[{'all':!![]}];}return db[_0xf594('0x27')][_0xf594('0x3d')](_0x59917e);})[_0xf594('0x21')](function(_0x5cb6f1){_0x53bf97[_0xf594('0x3e')]=_0x5cb6f1;return _0x53bf97;})[_0xf594('0x21')](respondWithFilteredResult(_0x2ce744,_0x59917e))['catch'](handleError(_0x2ce744,null));};exports['show']=function(_0xc84793,_0x393d44){var _0x10cdaa={'raw':!![],'where':{'id':_0xc84793['params']['id']}},_0x57f779={};_0x57f779[_0xf594('0x2c')]=_['keys'](db[_0xf594('0x27')][_0xf594('0x28')]);_0x57f779[_0xf594('0x2d')]=_[_0xf594('0x2e')](_0xc84793[_0xf594('0x2d')]);_0x57f779[_0xf594('0x37')]=_[_0xf594('0x30')](_0x57f779['model'],_0x57f779[_0xf594('0x2d')]);_0x10cdaa[_0xf594('0x2f')]=_[_0xf594('0x30')](_0x57f779[_0xf594('0x2c')],qs[_0xf594('0x31')](_0xc84793[_0xf594('0x2d')]['fields']));_0x10cdaa['attributes']=_0x10cdaa[_0xf594('0x2f')][_0xf594('0x32')]?_0x10cdaa[_0xf594('0x2f')]:_0x57f779[_0xf594('0x2c')];if(_0xc84793[_0xf594('0x2d')]['includeAll']){_0x10cdaa['include']=[{'all':!![]}];}_0x10cdaa=_[_0xf594('0x3a')]({},_0x10cdaa,_0xc84793[_0xf594('0x3c')]);return db[_0xf594('0x27')][_0xf594('0x3f')](_0x10cdaa)['then'](handleEntityNotFound(_0x393d44,null))[_0xf594('0x21')](respondWithResult(_0x393d44,null))[_0xf594('0x40')](handleError(_0x393d44,null));};exports[_0xf594('0x41')]=function(_0xa84130,_0xceba33){var _0x4f00f8={'where':{'id':_0xa84130[_0xf594('0x42')]['id']}},_0x223e3b={};_0x223e3b[_0xf594('0x2c')]=_[_0xf594('0x2e')](db[_0xf594('0x27')][_0xf594('0x28')]);_0x4f00f8[_0xf594('0x2f')]=_['intersection'](_0x223e3b[_0xf594('0x2c')],qs[_0xf594('0x31')](_0xa84130[_0xf594('0x2d')]['fields']));_0x4f00f8['attributes']=_0x4f00f8[_0xf594('0x2f')][_0xf594('0x32')]?_0x4f00f8['attributes']:_0x223e3b['model'];if(_0xa84130['query']['includeAll']){_0x4f00f8[_0xf594('0x43')]=[{'all':!![]}];}_0x4f00f8=_['merge']({},_0x4f00f8,_0xa84130['options']);return db[_0xf594('0x27')][_0xf594('0x3f')](_0x4f00f8)[_0xf594('0x21')](handleEntityNotFound(_0xceba33,null))['then'](function(_0x3dcaf3){if(_0x3dcaf3){var _0x41def8=_0x3dcaf3[_0xf594('0x44')]({'plain':!![]});_0x41def8=qs['omit'](_0x41def8,['id',_0xf594('0x45'),_0xf594('0x46')]);_0xa84130[_0xf594('0x47')]=_[_0xf594('0x48')](_0xa84130['body'],['id','createdAt',_0xf594('0x46')]);return db[_0xf594('0x27')][_0xf594('0x49')](_['merge'](_0x41def8,_0xa84130[_0xf594('0x47')]),{'include':_0xa84130[_0xf594('0x2d')][_0xf594('0x4a')]?[{'all':!![]}]:undefined});}})[_0xf594('0x21')](respondWithResult(_0xceba33,0xc9))[_0xf594('0x40')](handleError(_0xceba33,null));};exports[_0xf594('0x20')]=function(_0x29c6ec,_0x592b2c){if(_0x29c6ec[_0xf594('0x47')]['id']){delete _0x29c6ec[_0xf594('0x47')]['id'];}return db[_0xf594('0x27')][_0xf594('0x3f')]({'where':{'id':_0x29c6ec[_0xf594('0x42')]['id']}})[_0xf594('0x21')](handleEntityNotFound(_0x592b2c,null))[_0xf594('0x21')](saveUpdates(_0x29c6ec[_0xf594('0x47')],null))[_0xf594('0x21')](respondWithResult(_0x592b2c,null))['catch'](handleError(_0x592b2c,null));};exports['destroy']=function(_0x354ea5,_0x5f0330){return db[_0xf594('0x27')][_0xf594('0x3f')]({'where':{'id':_0x354ea5[_0xf594('0x42')]['id']}})[_0xf594('0x21')](handleEntityNotFound(_0x5f0330,null))['then'](removeEntity(_0x5f0330,null))[_0xf594('0x40')](handleError(_0x5f0330,null));};exports[_0xf594('0x49')]=function(_0x29376b,_0x1cbed0,_0xf7ea91){_0x29376b['body'][_0xf594('0x24')]=_0x29376b[_0xf594('0x4b')]['originalname'];_0x29376b[_0xf594('0x47')][_0xf594('0x4c')]=_0x29376b[_0xf594('0x4b')][_0xf594('0x4d')];_0x29376b[_0xf594('0x47')][_0xf594('0x2a')]=_0x29376b[_0xf594('0x4b')][_0xf594('0x4e')];return db[_0xf594('0x27')][_0xf594('0x49')](_0x29376b[_0xf594('0x47')])[_0xf594('0x21')](respondWithResult(_0x1cbed0,0xc9))[_0xf594('0x40')](handleError(_0x1cbed0,null));};exports[_0xf594('0x4f')]=function(_0x4723fe,_0x1f9451,_0x406d88){return db[_0xf594('0x27')][_0xf594('0x50')]({'where':{'id':_0x4723fe[_0xf594('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1f9451,null))[_0xf594('0x21')](function(_0x4eb290){if(_0x4eb290){var _0xda8d4=_0x4eb290['ChatOfflineMessageId']!==null;var _0x43dca4=path['join'](config[_0xf594('0x51')],_0xf594('0x52'));if(_0xda8d4){_0x43dca4=path[_0xf594('0x53')](_0x43dca4,'offline-chat/');}var _0x4bf800=path[_0xf594('0x53')](_0x43dca4,_0x4eb290[_0xf594('0x4c')]);return _0x1f9451[_0xf594('0x4f')](_0x4bf800);}})[_0xf594('0x40')](handleError(_0x1f9451,null));};
\ No newline at end of file
+var _0x786f=['merge','VIRTUAL','filter','options','findAll','rows','show','params','keys','rawAttributes','includeAll','include','find','catch','clone','get','omit','createdAt','body','updatedAt','create','originalname','basename','filename','file','mimetype','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','Attachment','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3bb7e8,_0x4e6109){var _0x5b6286=function(_0x47f940){while(--_0x47f940){_0x3bb7e8['push'](_0x3bb7e8['shift']());}};_0x5b6286(++_0x4e6109);}(_0x786f,0x137));var _0xf786=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x786f[_0x280f4a];return _0x1bb157;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf786('0x0'));var jsonpatch=require(_0xf786('0x1'));var rp=require(_0xf786('0x2'));var moment=require(_0xf786('0x3'));var BPromise=require(_0xf786('0x4'));var Mustache=require('mustache');var util=require(_0xf786('0x5'));var path=require(_0xf786('0x6'));var sox=require(_0xf786('0x7'));var csv=require(_0xf786('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf786('0x9'));var _=require(_0xf786('0xa'));var squel=require(_0xf786('0xb'));var crypto=require(_0xf786('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf786('0xd'));var toCsv=require(_0xf786('0x8'));var querystring=require(_0xf786('0xe'));var Papa=require(_0xf786('0xf'));var Redis=require(_0xf786('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf786('0x11'));var hardwareService=require(_0xf786('0x12'));var logger=require(_0xf786('0x13'))(_0xf786('0x14'));var utils=require(_0xf786('0x15'));var config=require(_0xf786('0x16'));var licenseUtil=require(_0xf786('0x17'));var db=require(_0xf786('0x18'))['db'];function respondWithStatusCode(_0x352815,_0x5dd1fd){_0x5dd1fd=_0x5dd1fd||0xcc;return function(_0x2878e3){if(_0x2878e3){return _0x352815[_0xf786('0x19')](_0x5dd1fd);}return _0x352815[_0xf786('0x1a')](_0x5dd1fd)[_0xf786('0x1b')]();};}function respondWithResult(_0x805ce3,_0x2b623f){_0x2b623f=_0x2b623f||0xc8;return function(_0x37aeb9){if(_0x37aeb9){return _0x805ce3['status'](_0x2b623f)[_0xf786('0x1c')](_0x37aeb9);}};}function respondWithFilteredResult(_0x49b90f,_0x2fb4b1){return function(_0x2c2e61){if(_0x2c2e61){var _0x38bca4=typeof _0x2fb4b1[_0xf786('0x1d')]===_0xf786('0x1e')&&typeof _0x2fb4b1[_0xf786('0x1f')]==='undefined';var _0x214ed2=_0x2c2e61[_0xf786('0x20')];var _0x14a2ee=_0x38bca4?0x0:_0x2fb4b1['offset'];var _0x35844b=_0x38bca4?_0x2c2e61[_0xf786('0x20')]:_0x2fb4b1[_0xf786('0x1d')]+_0x2fb4b1['limit'];var _0x506d98;if(_0x35844b>=_0x214ed2){_0x35844b=_0x214ed2;_0x506d98=0xc8;}else{_0x506d98=0xce;}_0x49b90f[_0xf786('0x1a')](_0x506d98);return _0x49b90f[_0xf786('0x21')](_0xf786('0x22'),_0x14a2ee+'-'+_0x35844b+'/'+_0x214ed2)[_0xf786('0x1c')](_0x2c2e61);}return null;};}function patchUpdates(_0x38834f){return function(_0x14aa55){try{jsonpatch['apply'](_0x14aa55,_0x38834f,!![]);}catch(_0x17ba8d){return BPromise[_0xf786('0x23')](_0x17ba8d);}return _0x14aa55[_0xf786('0x24')]();};}function saveUpdates(_0x20cec2,_0x533da3){return function(_0x4747b5){if(_0x4747b5){return _0x4747b5[_0xf786('0x25')](_0x20cec2)[_0xf786('0x26')](function(_0x12a774){return _0x12a774;});}return null;};}function removeEntity(_0x410a6e,_0x244d69){return function(_0x207901){if(_0x207901){return _0x207901[_0xf786('0x27')]()[_0xf786('0x26')](function(){_0x410a6e[_0xf786('0x1a')](0xcc)[_0xf786('0x1b')]();});}};}function handleEntityNotFound(_0x43aec5,_0x349bdd){return function(_0x45fc66){if(!_0x45fc66){_0x43aec5['sendStatus'](0x194);}return _0x45fc66;};}function handleError(_0x41ebad,_0x830de5){_0x830de5=_0x830de5||0x1f4;return function(_0x5dd887){logger['error'](_0x5dd887[_0xf786('0x28')]);if(_0x5dd887[_0xf786('0x29')]){delete _0x5dd887[_0xf786('0x29')];}_0x41ebad[_0xf786('0x1a')](_0x830de5)[_0xf786('0x2a')](_0x5dd887);};}exports[_0xf786('0x2b')]=function(_0x4ae2ae,_0x5a5274){var _0x4c23c8={},_0x412afd={},_0x4ae82e={'count':0x0,'rows':[]};var _0x3f52ff=_['map'](db[_0xf786('0x2c')]['rawAttributes'],function(_0x3bd3ac){return{'name':_0x3bd3ac[_0xf786('0x2d')],'type':_0x3bd3ac[_0xf786('0x2e')]['key']};});_0x412afd[_0xf786('0x2f')]=_[_0xf786('0x30')](_0x3f52ff,'name');_0x412afd[_0xf786('0x31')]=_['keys'](_0x4ae2ae[_0xf786('0x31')]);_0x412afd[_0xf786('0x32')]=_[_0xf786('0x33')](_0x412afd['model'],_0x412afd[_0xf786('0x31')]);_0x4c23c8[_0xf786('0x34')]=_[_0xf786('0x33')](_0x412afd[_0xf786('0x2f')],qs[_0xf786('0x35')](_0x4ae2ae['query'][_0xf786('0x35')]));_0x4c23c8[_0xf786('0x34')]=_0x4c23c8['attributes'][_0xf786('0x36')]?_0x4c23c8['attributes']:_0x412afd[_0xf786('0x2f')];if(!_0x4ae2ae[_0xf786('0x31')][_0xf786('0x37')](_0xf786('0x38'))){_0x4c23c8[_0xf786('0x1f')]=qs['limit'](_0x4ae2ae[_0xf786('0x31')]['limit']);_0x4c23c8['offset']=qs[_0xf786('0x1d')](_0x4ae2ae[_0xf786('0x31')][_0xf786('0x1d')]);}_0x4c23c8[_0xf786('0x39')]=qs['sort'](_0x4ae2ae[_0xf786('0x31')][_0xf786('0x3a')]);_0x4c23c8[_0xf786('0x3b')]=qs[_0xf786('0x32')](_[_0xf786('0x3c')](_0x4ae2ae[_0xf786('0x31')],_0x412afd[_0xf786('0x32')]),_0x3f52ff);if(_0x4ae2ae[_0xf786('0x31')]['filter']){_0x4c23c8[_0xf786('0x3b')]=_[_0xf786('0x3d')](_0x4c23c8[_0xf786('0x3b')],{'$or':_['map'](_0x3f52ff,function(_0x4b92ba){if(_0x4b92ba[_0xf786('0x2e')]!==_0xf786('0x3e')){var _0x53425a={};_0x53425a[_0x4b92ba['name']]={'$like':'%'+_0x4ae2ae[_0xf786('0x31')][_0xf786('0x3f')]+'%'};return _0x53425a;}})});}_0x4c23c8=_['merge']({},_0x4c23c8,_0x4ae2ae[_0xf786('0x40')]);var _0x218c05={'where':_0x4c23c8[_0xf786('0x3b')]};return db[_0xf786('0x2c')][_0xf786('0x20')](_0x218c05)[_0xf786('0x26')](function(_0x194399){_0x4ae82e['count']=_0x194399;if(_0x4ae2ae[_0xf786('0x31')]['includeAll']){_0x4c23c8['include']=[{'all':!![]}];}return db[_0xf786('0x2c')][_0xf786('0x41')](_0x4c23c8);})[_0xf786('0x26')](function(_0xe7278c){_0x4ae82e[_0xf786('0x42')]=_0xe7278c;return _0x4ae82e;})[_0xf786('0x26')](respondWithFilteredResult(_0x5a5274,_0x4c23c8))['catch'](handleError(_0x5a5274,null));};exports[_0xf786('0x43')]=function(_0x107446,_0x14f0d7){var _0x34d69d={'raw':!![],'where':{'id':_0x107446[_0xf786('0x44')]['id']}},_0x488d49={};_0x488d49[_0xf786('0x2f')]=_[_0xf786('0x45')](db[_0xf786('0x2c')][_0xf786('0x46')]);_0x488d49['query']=_['keys'](_0x107446[_0xf786('0x31')]);_0x488d49[_0xf786('0x32')]=_[_0xf786('0x33')](_0x488d49[_0xf786('0x2f')],_0x488d49[_0xf786('0x31')]);_0x34d69d[_0xf786('0x34')]=_[_0xf786('0x33')](_0x488d49[_0xf786('0x2f')],qs[_0xf786('0x35')](_0x107446[_0xf786('0x31')][_0xf786('0x35')]));_0x34d69d['attributes']=_0x34d69d[_0xf786('0x34')]['length']?_0x34d69d[_0xf786('0x34')]:_0x488d49[_0xf786('0x2f')];if(_0x107446[_0xf786('0x31')][_0xf786('0x47')]){_0x34d69d[_0xf786('0x48')]=[{'all':!![]}];}_0x34d69d=_[_0xf786('0x3d')]({},_0x34d69d,_0x107446[_0xf786('0x40')]);return db[_0xf786('0x2c')][_0xf786('0x49')](_0x34d69d)[_0xf786('0x26')](handleEntityNotFound(_0x14f0d7,null))[_0xf786('0x26')](respondWithResult(_0x14f0d7,null))[_0xf786('0x4a')](handleError(_0x14f0d7,null));};exports[_0xf786('0x4b')]=function(_0x5450f4,_0x407b5b){var _0x201877={'where':{'id':_0x5450f4[_0xf786('0x44')]['id']}},_0x25720b={};_0x25720b['model']=_['keys'](db[_0xf786('0x2c')][_0xf786('0x46')]);_0x201877[_0xf786('0x34')]=_[_0xf786('0x33')](_0x25720b[_0xf786('0x2f')],qs['fields'](_0x5450f4[_0xf786('0x31')][_0xf786('0x35')]));_0x201877[_0xf786('0x34')]=_0x201877['attributes'][_0xf786('0x36')]?_0x201877['attributes']:_0x25720b[_0xf786('0x2f')];if(_0x5450f4[_0xf786('0x31')]['includeAll']){_0x201877[_0xf786('0x48')]=[{'all':!![]}];}_0x201877=_['merge']({},_0x201877,_0x5450f4[_0xf786('0x40')]);return db[_0xf786('0x2c')][_0xf786('0x49')](_0x201877)[_0xf786('0x26')](handleEntityNotFound(_0x407b5b,null))['then'](function(_0x126146){if(_0x126146){var _0x3b495f=_0x126146[_0xf786('0x4c')]({'plain':!![]});_0x3b495f=qs[_0xf786('0x4d')](_0x3b495f,['id',_0xf786('0x4e'),'updatedAt']);_0x5450f4[_0xf786('0x4f')]=_[_0xf786('0x4d')](_0x5450f4[_0xf786('0x4f')],['id',_0xf786('0x4e'),_0xf786('0x50')]);return db['Attachment'][_0xf786('0x51')](_[_0xf786('0x3d')](_0x3b495f,_0x5450f4[_0xf786('0x4f')]),{'include':_0x5450f4[_0xf786('0x31')][_0xf786('0x47')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x407b5b,0xc9))[_0xf786('0x4a')](handleError(_0x407b5b,null));};exports[_0xf786('0x25')]=function(_0x1a5b84,_0x5563ff){if(_0x1a5b84[_0xf786('0x4f')]['id']){delete _0x1a5b84[_0xf786('0x4f')]['id'];}return db['Attachment'][_0xf786('0x49')]({'where':{'id':_0x1a5b84['params']['id']}})[_0xf786('0x26')](handleEntityNotFound(_0x5563ff,null))[_0xf786('0x26')](saveUpdates(_0x1a5b84[_0xf786('0x4f')],null))[_0xf786('0x26')](respondWithResult(_0x5563ff,null))[_0xf786('0x4a')](handleError(_0x5563ff,null));};exports[_0xf786('0x27')]=function(_0x5b5ddb,_0x3c2ef7){return db[_0xf786('0x2c')][_0xf786('0x49')]({'where':{'id':_0x5b5ddb[_0xf786('0x44')]['id']}})[_0xf786('0x26')](handleEntityNotFound(_0x3c2ef7,null))['then'](removeEntity(_0x3c2ef7,null))['catch'](handleError(_0x3c2ef7,null));};exports[_0xf786('0x51')]=function(_0x4237d0,_0x8210b8,_0x2ef5c9){_0x4237d0[_0xf786('0x4f')][_0xf786('0x29')]=_0x4237d0['file'][_0xf786('0x52')];_0x4237d0[_0xf786('0x4f')][_0xf786('0x53')]=_0x4237d0['file'][_0xf786('0x54')];_0x4237d0[_0xf786('0x4f')][_0xf786('0x2e')]=_0x4237d0[_0xf786('0x55')][_0xf786('0x56')];return db['Attachment'][_0xf786('0x51')](_0x4237d0[_0xf786('0x4f')])['then'](respondWithResult(_0x8210b8,0xc9))[_0xf786('0x4a')](handleError(_0x8210b8,null));};exports['download']=function(_0x34f9b1,_0x2b3a79,_0x54a6a3){return db[_0xf786('0x2c')]['findOne']({'where':{'id':_0x34f9b1[_0xf786('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2b3a79,null))[_0xf786('0x26')](function(_0x4eaabe){if(_0x4eaabe){var _0x368010=_0x4eaabe[_0xf786('0x57')]!==null;var _0x35bc8a=path['join'](config[_0xf786('0x58')],_0xf786('0x59'));if(_0x368010){_0x35bc8a=path[_0xf786('0x5a')](_0x35bc8a,_0xf786('0x5b'));}var _0x4cd65d=path['join'](_0x35bc8a,_0x4eaabe[_0xf786('0x53')]);return _0x2b3a79[_0xf786('0x5c')](_0x4cd65d);}})[_0xf786('0x4a')](handleError(_0x2b3a79,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 252e4f4..4f6052a 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 _0xd760=['request-promise','path','../../config/environment','exports','define','lodash','util','../../config/logger','moment'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0xd760,0x12e));var _0x0d76=function(_0x47faec,_0x3ecd1c){_0x47faec=_0x47faec-0x0;var _0x530c77=_0xd760[_0x47faec];return _0x530c77;};'use strict';var _=require(_0x0d76('0x0'));var util=require(_0x0d76('0x1'));var logger=require(_0x0d76('0x2'))('api');var moment=require(_0x0d76('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d76('0x4'));var fs=require('fs');var path=require(_0x0d76('0x5'));var rimraf=require('rimraf');var config=require(_0x0d76('0x6'));var attributes=require('./attachment.attributes');module[_0x0d76('0x7')]=function(_0x3314be,_0x3fbbec){return _0x3314be[_0x0d76('0x8')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf0e=['exports','define','Attachment','attachments','util','../../config/logger','request-promise','path','../../config/environment','./attachment.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdf0e,0xcc));var _0xedf0=function(_0x382ca6,_0x1aaf79){_0x382ca6=_0x382ca6-0x0;var _0x295a6c=_0xdf0e[_0x382ca6];return _0x295a6c;};'use strict';var _=require('lodash');var util=require(_0xedf0('0x0'));var logger=require(_0xedf0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xedf0('0x2'));var fs=require('fs');var path=require(_0xedf0('0x3'));var rimraf=require('rimraf');var config=require(_0xedf0('0x4'));var attributes=require(_0xedf0('0x5'));module[_0xedf0('0x6')]=function(_0x4aaac9,_0x3c1728){return _0x4aaac9[_0xedf0('0x7')](_0xedf0('0x8'),attributes,{'tableName':_0xedf0('0x9'),'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 532b42c..a4b034a 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 _0x4c4e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','create','body','options','then','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Attachment,\x20%s,\x20%s'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4c4e,0x152));var _0xe4c4=function(_0xd506a9,_0x1bf9db){_0xd506a9=_0xd506a9-0x0;var _0x14f47d=_0x4c4e[_0xd506a9];return _0x14f47d;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('Attachment,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Attachment,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});}exports[_0xe4c4('0x15')]=function(_0x42242c){var _0x3820c7=this;return new Promise(function(_0x43a9ce,_0x376585){return db['Attachment'][_0xe4c4('0x16')](_0x42242c[_0xe4c4('0x17')],{'raw':_0x42242c[_0xe4c4('0x18')]?_0x42242c[_0xe4c4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe4c4('0x19')](function(_0x1cad5d){logger[_0xe4c4('0xb')](_0xe4c4('0x15'),_0x42242c);logger[_0xe4c4('0xe')](_0xe4c4('0x15'),_0x42242c,JSON[_0xe4c4('0x1a')](_0x1cad5d));_0x43a9ce(_0x1cad5d);})[_0xe4c4('0x14')](function(_0x21bbb1){logger[_0xe4c4('0x10')](_0xe4c4('0x15'),_0x21bbb1[_0xe4c4('0x12')],_0x42242c);_0x376585(_0x3820c7[_0xe4c4('0x10')](0x1f4,_0x21bbb1[_0xe4c4('0x12')]));});});};
\ No newline at end of file
+var _0xbe02=['jayson/promise','client','http','request','then','stringify','error','code','Attachment,\x20%s,\x20%s','message','request\x20sent','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e9463,_0x17b772){var _0x40c6c5=function(_0x3949d3){while(--_0x3949d3){_0x5e9463['push'](_0x5e9463['shift']());}};_0x40c6c5(++_0x17b772);}(_0xbe02,0x146));var _0x2be0=function(_0x4dfdb2,_0x3ca31b){_0x4dfdb2=_0x4dfdb2-0x0;var _0x10189a=_0xbe02[_0x4dfdb2];return _0x10189a;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var moment=require(_0x2be0('0x2'));var BPromise=require(_0x2be0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2be0('0x4'));var db=require(_0x2be0('0x5'))['db'];var utils=require(_0x2be0('0x6'));var logger=require(_0x2be0('0x7'))(_0x2be0('0x8'));var config=require(_0x2be0('0x9'));var jayson=require(_0x2be0('0xa'));var client=jayson[_0x2be0('0xb')][_0x2be0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e872c,_0x4ca22f,_0x176f12){return new BPromise(function(_0xdfef68,_0x1ac0a3){return client[_0x2be0('0xd')](_0x4e872c,_0x176f12)[_0x2be0('0xe')](function(_0x45d9f5){logger['info']('Attachment,\x20%s,\x20%s',_0x4ca22f,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x4ca22f,'request\x20sent',JSON[_0x2be0('0xf')](_0x45d9f5));if(_0x45d9f5[_0x2be0('0x10')]){if(_0x45d9f5['error'][_0x2be0('0x11')]===0x1f4){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);return _0x1ac0a3(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')]['message']);return _0xdfef68(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}else{logger['info'](_0x2be0('0x12'),_0x4ca22f,_0x2be0('0x14'));_0xdfef68(_0x45d9f5['result'][_0x2be0('0x13')]);}})[_0x2be0('0x15')](function(_0x137ce9){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x137ce9);_0x1ac0a3(_0x137ce9);});});}exports[_0x2be0('0x16')]=function(_0x48d386){var _0x415894=this;return new Promise(function(_0x3f8dba,_0x35da90){return db[_0x2be0('0x17')][_0x2be0('0x18')](_0x48d386[_0x2be0('0x19')],{'raw':_0x48d386[_0x2be0('0x1a')]?_0x48d386[_0x2be0('0x1a')][_0x2be0('0x1b')]===undefined?!![]:![]:!![]})[_0x2be0('0xe')](function(_0x4c8afc){logger['info'](_0x2be0('0x16'),_0x48d386);logger['debug']('CreateAttachment',_0x48d386,JSON[_0x2be0('0xf')](_0x4c8afc));_0x3f8dba(_0x4c8afc);})[_0x2be0('0x15')](function(_0x2da0d5){logger[_0x2be0('0x10')](_0x2be0('0x16'),_0x2da0d5[_0x2be0('0x13')],_0x48d386);_0x35da90(_0x415894[_0x2be0('0x10')](0x1f4,_0x2da0d5[_0x2be0('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a2b6d77..8298f61 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 _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(_0x174211,_0x1f00ed){var _0x411a85=function(_0x2abb2f){while(--_0x2abb2f){_0x174211['push'](_0x174211['shift']());}};_0x411a85(++_0x1f00ed);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f3173,_0x532c04){_0x2f3173=_0x2f3173-0x0;var _0x426e08=_0xb10b[_0x2f3173];return _0x426e08;};'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
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x20aff6,_0x80787e){var _0x3d23c2=function(_0x175b36){while(--_0x175b36){_0x20aff6['push'](_0x20aff6['shift']());}};_0x3d23c2(++_0x80787e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3747c3,_0x4e17bd){_0x3747c3=_0x3747c3-0x0;var _0x879b56=_0x5f2f[_0x3747c3];return _0x879b56;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index a220b2b..095b751 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 _0x7446=['User','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','then'];(function(_0x498621,_0x392917){var _0x574e8c=function(_0x346258){while(--_0x346258){_0x498621['push'](_0x498621['shift']());}};_0x574e8c(++_0x392917);}(_0x7446,0x146));var _0x6744=function(_0x2a31f1,_0x5320a9){_0x2a31f1=_0x2a31f1-0x0;var _0x26ba98=_0x7446[_0x2a31f1];return _0x26ba98;};'use strict';var _=require(_0x6744('0x0'));var passport=require(_0x6744('0x1'));var GoogleStrategy=require(_0x6744('0x2'))[_0x6744('0x3')];var moment=require(_0x6744('0x4'));var db=require(_0x6744('0x5'))['db'];var config=require(_0x6744('0x6'));var signToken=require(_0x6744('0x7'))[_0x6744('0x8')];var utils=require(_0x6744('0x9'));exports[_0x6744('0xa')]=passport[_0x6744('0xb')](_0x6744('0xc'),{'failureRedirect':_0x6744('0xd'),'scope':[_0x6744('0xe'),_0x6744('0xf')],'session':![]});exports[_0x6744('0x10')]=passport[_0x6744('0xb')](_0x6744('0xc'),{'failureRedirect':_0x6744('0xd'),'session':![]});passport[_0x6744('0x11')](new GoogleStrategy({'clientID':config['google']?config[_0x6744('0xc')][_0x6744('0x12')]:'id','clientSecret':config[_0x6744('0xc')]?config['google'][_0x6744('0x13')]:_0x6744('0x14'),'callbackURL':config['google']?config[_0x6744('0xc')][_0x6744('0x15')]:''},function(_0x3e70c7,_0x40d1f9,_0x1107de,_0x278eae){var _0xb59384,_0x578324;return db[_0x6744('0x16')]['findOne']({'where':{'id':0x1},'attributes':[_0x6744('0x17'),'blockDuration'],'raw':!![]})[_0x6744('0x18')](function(_0x1ff5ff){_0xb59384=_0x1ff5ff;return db[_0x6744('0x19')]['find']({'where':{'email':_['map'](_0x1107de[_0x6744('0x1a')],'value'),'role':{'$or':[_0x6744('0x1b'),_0x6744('0x1c'),_0x6744('0x1d')]}}});})[_0x6744('0x18')](function(_0x527403){_0x578324=_0x527403;if(_0x578324){if(_0x578324[_0x6744('0x1e')]){return _0x278eae(_0x6744('0x1f'));}else if(_0xb59384[_0x6744('0x20')]>0x0){if(_0x578324[_0x6744('0x21')]){if(moment(_0x578324[_0x6744('0x22')])[_0x6744('0x23')](_0xb59384['blockDuration'],_0x6744('0x24'))>moment()){return _0x278eae(_0x6744('0x1f'));}else{return utils['clearBlockUser'](_0x578324,0x0,![],null)[_0x6744('0x18')](function(){return utils['getLicense'](_0x578324);})[_0x6744('0x18')](function(){return _0x278eae(null,_0x578324);});}}else{return utils[_0x6744('0x25')](_0x578324)[_0x6744('0x18')](function(){return _0x278eae(null,_0x578324);});}}else{return utils['getLicense'](_0x578324)['then'](function(){return _0x278eae(null,_0x578324);});}}return _0x278eae('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x6744('0x26')](function(_0x30a164){_0x278eae(_0x30a164);});}));
\ No newline at end of file
+var _0xf69a=['clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','find','map','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service','login','authenticate','google','profile','email','callback','/login','use','clientID'];(function(_0x328249,_0x3680bd){var _0x4162cb=function(_0x3a8665){while(--_0x3a8665){_0x328249['push'](_0x328249['shift']());}};_0x4162cb(++_0x3680bd);}(_0xf69a,0x85));var _0xaf69=function(_0x7b717,_0x311539){_0x7b717=_0x7b717-0x0;var _0x50d254=_0xf69a[_0x7b717];return _0x50d254;};'use strict';var _=require(_0xaf69('0x0'));var passport=require(_0xaf69('0x1'));var GoogleStrategy=require(_0xaf69('0x2'))[_0xaf69('0x3')];var moment=require(_0xaf69('0x4'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0xaf69('0x5'))['signToken'];var utils=require('../../config/utils');exports[_0xaf69('0x6')]=passport[_0xaf69('0x7')](_0xaf69('0x8'),{'failureRedirect':'/login','scope':[_0xaf69('0x9'),_0xaf69('0xa')],'session':![]});exports[_0xaf69('0xb')]=passport['authenticate'](_0xaf69('0x8'),{'failureRedirect':_0xaf69('0xc'),'session':![]});passport[_0xaf69('0xd')](new GoogleStrategy({'clientID':config[_0xaf69('0x8')]?config[_0xaf69('0x8')][_0xaf69('0xe')]:'id','clientSecret':config[_0xaf69('0x8')]?config[_0xaf69('0x8')][_0xaf69('0xf')]:_0xaf69('0x10'),'callbackURL':config[_0xaf69('0x8')]?config[_0xaf69('0x8')][_0xaf69('0x11')]:''},function(_0x38d940,_0x4053d8,_0x3f9f9b,_0x57b477){var _0x49e2af,_0x2718a1;return db[_0xaf69('0x12')][_0xaf69('0x13')]({'where':{'id':0x1},'attributes':[_0xaf69('0x14'),'blockDuration'],'raw':!![]})[_0xaf69('0x15')](function(_0x3e6c35){_0x49e2af=_0x3e6c35;return db['User'][_0xaf69('0x16')]({'where':{'email':_[_0xaf69('0x17')](_0x3f9f9b['emails'],'value'),'role':{'$or':[_0xaf69('0x18'),_0xaf69('0x19'),_0xaf69('0x1a')]}}});})[_0xaf69('0x15')](function(_0x15171a){_0x2718a1=_0x15171a;if(_0x2718a1){if(_0x2718a1[_0xaf69('0x1b')]){return _0x57b477(_0xaf69('0x1c'));}else if(_0x49e2af[_0xaf69('0x1d')]>0x0){if(_0x2718a1[_0xaf69('0x1e')]){if(moment(_0x2718a1[_0xaf69('0x1f')])[_0xaf69('0x20')](_0x49e2af[_0xaf69('0x1d')],_0xaf69('0x21'))>moment()){return _0x57b477(_0xaf69('0x1c'));}else{return utils[_0xaf69('0x22')](_0x2718a1,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2718a1);})['then'](function(){return _0x57b477(null,_0x2718a1);});}}else{return utils[_0xaf69('0x23')](_0x2718a1)['then'](function(){return _0x57b477(null,_0x2718a1);});}}else{return utils[_0xaf69('0x23')](_0x2718a1)[_0xaf69('0x15')](function(){return _0x57b477(null,_0x2718a1);});}}return _0x57b477('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xaf69('0x24')](function(_0x40998e){_0x57b477(_0x40998e);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 39a0e7f..d39128d 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 _0x97a1=['../../components/auth/service','login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js'];(function(_0x474973,_0xb6b5eb){var _0x99479e=function(_0x15af1a){while(--_0x15af1a){_0x474973['push'](_0x474973['shift']());}};_0x99479e(++_0xb6b5eb);}(_0x97a1,0x1b4));var _0x197a=function(_0x5c98a1,_0x4a2a42){_0x5c98a1=_0x5c98a1-0x0;var _0x3d3ad9=_0x97a1[_0x5c98a1];return _0x3d3ad9;};'use strict';var express=require(_0x197a('0x0'));var passport=require(_0x197a('0x1'));var router=express[_0x197a('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x197a('0x3'));var authService=require(_0x197a('0x4'));router['get']('/',controller[_0x197a('0x5')]);router['get']('/callback',controller[_0x197a('0x6')],authService[_0x197a('0x7')],userController[_0x197a('0x5')],authService[_0x197a('0x8')]);module[_0x197a('0x9')]=router;
\ No newline at end of file
+var _0xd161=['../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','express','Router','./authGoogle.controller'];(function(_0x5e3836,_0x35936a){var _0x2a4f95=function(_0x25e5d7){while(--_0x25e5d7){_0x5e3836['push'](_0x5e3836['shift']());}};_0x2a4f95(++_0x35936a);}(_0xd161,0x1d1));var _0x1d16=function(_0x5ce8ec,_0x25eaf9){_0x5ce8ec=_0x5ce8ec-0x0;var _0xb4b63e=_0xd161[_0x5ce8ec];return _0xb4b63e;};'use strict';var express=require(_0x1d16('0x0'));var passport=require('passport');var router=express[_0x1d16('0x1')]();var controller=require(_0x1d16('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x1d16('0x3'));router[_0x1d16('0x4')]('/',controller[_0x1d16('0x5')]);router[_0x1d16('0x4')]('/callback',controller[_0x1d16('0x6')],authService[_0x1d16('0x7')],userController['login'],authService[_0x1d16('0x8')]);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 d3d9838..c02d6ce 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 _0x3327=['trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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','status','Reset\x20Email\x20sent!','reset','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport-local','Strategy','lodash','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','email','Email\x20parameter\x20is\x20missing','generate','body'];(function(_0xace1ac,_0x2d20a8){var _0x103c4c=function(_0x12ed69){while(--_0x12ed69){_0xace1ac['push'](_0xace1ac['shift']());}};_0x103c4c(++_0x2d20a8);}(_0x3327,0xc8));var _0x7332=function(_0x420ff2,_0x41853a){_0x420ff2=_0x420ff2-0x0;var _0x5d7626=_0x3327[_0x420ff2];return _0x5d7626;};'use strict';var util=require(_0x7332('0x0'));var passport=require('passport');var LocalStrategy=require(_0x7332('0x1'))[_0x7332('0x2')];var jayson=require('jayson/promise');var _=require(_0x7332('0x3'));var rs=require('randomstring');var moment=require(_0x7332('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x7332('0x5'));var utils=require(_0x7332('0x6'));var client=jayson['client'][_0x7332('0x7')]({'port':0x232b});function localAuthenticate(_0x5c0a29,_0x9f39d7,_0xc27ae9,_0x3bf336){var _0xaa6bf4,_0xc6d667;return db[_0x7332('0x8')][_0x7332('0x9')]({'where':{'id':0x1},'attributes':[_0x7332('0xa'),_0x7332('0xb')],'raw':!![]})[_0x7332('0xc')](function(_0x54af2b){_0xaa6bf4=_0x54af2b;return _0x5c0a29[_0x7332('0x9')]({'attributes':['id',_0x7332('0xd'),_0x7332('0xe'),_0x7332('0xf'),_0x7332('0x10'),'disabled','blocked',_0x7332('0x11'),_0x7332('0x12')],'where':{'name':_0x9f39d7,'role':{'$or':[_0x7332('0x13'),'user',_0x7332('0x14')]}}});})[_0x7332('0xc')](function(_0x26489d){if(!_0x26489d||_0x26489d&&_0x26489d[_0x7332('0xd')]!==_0x9f39d7){throw new Error(_0x7332('0x15'));}else{_0xc6d667=_0x26489d;return _0xc6d667;}})[_0x7332('0xc')](function(){_0xc6d667['authenticate'](_0xc27ae9,function(_0x2e58ee,_0x371153){var _0x287ab1=_0xc6d667['loginAttempts']+0x1;if(_0x2e58ee){return _0x3bf336(_0x2e58ee);}else if(!_0x371153){if(_0xc6d667['disabled']){return _0x3bf336(null,![],{'message':_0x7332('0x15')});}else if(_0xaa6bf4[_0x7332('0xa')]>0x0){if(_0xc6d667[_0x7332('0x16')]){if(_0xaa6bf4['blockDuration']>0x0){if(moment(_0xc6d667[_0x7332('0x11')])[_0x7332('0x17')](_0xaa6bf4[_0x7332('0xb')],_0x7332('0x18'))>moment()){return _0x3bf336(null,![],{'message':_0x7332('0x15')});}else{return utils[_0x7332('0x19')](_0xc6d667,_0x287ab1,![],null)[_0x7332('0xc')](function(){return _0x3bf336(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3bf336(null,![],{'message':_0x7332('0x15')});}}else{if(_0x287ab1>=_0xaa6bf4[_0x7332('0xa')]){return utils[_0x7332('0x19')](_0xc6d667,0x0,!![],moment())[_0x7332('0xc')](function(){return _0x3bf336(null,![],{'message':_0x7332('0x15')});});}else{return utils[_0x7332('0x19')](_0xc6d667,_0x287ab1,![],null)[_0x7332('0xc')](function(){return _0x3bf336(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3bf336(null,![],{'message':_0x7332('0x15')});}}else{if(_0xc6d667[_0x7332('0x1a')]){return _0x3bf336(null,![],{'message':_0x7332('0x15')});}else if(_0xaa6bf4['allowedLoginAttempts']>0x0){if(_0xc6d667[_0x7332('0x16')]){if(_0xaa6bf4[_0x7332('0xb')]>0x0){if(moment(_0xc6d667[_0x7332('0x11')])[_0x7332('0x17')](_0xaa6bf4[_0x7332('0xb')],_0x7332('0x18'))>moment()){return _0x3bf336(null,![],{'message':_0x7332('0x15')});}else{return utils[_0x7332('0x19')](_0xc6d667,0x0,![],null)[_0x7332('0xc')](function(){return utils[_0x7332('0x1b')](_0xc6d667);})[_0x7332('0xc')](function(){return _0x3bf336(null,_0xc6d667);});}}else{return _0x3bf336(null,![],{'message':_0x7332('0x15')});}}else{return utils[_0x7332('0x19')](_0xc6d667,0x0,![],null)['then'](function(){return utils[_0x7332('0x1b')](_0xc6d667);})['then'](function(){return _0x3bf336(null,_0xc6d667);})[_0x7332('0x1c')](function(_0x4e697a){return _0x3bf336(null,![],_0x4e697a);});}}else{if(_0xc6d667['blocked']){return _0x3bf336(null,![],{'message':_0x7332('0x15')});}else{return utils[_0x7332('0x1b')](_0xc6d667)[_0x7332('0xc')](function(){return _0x3bf336(null,_0xc6d667);});}}}});})[_0x7332('0x1c')](function(_0x2b96a0){return _0x3bf336(null,![],_0x2b96a0);});}function sendServiceMail(_0x324a53){return db[_0x7332('0x1d')][_0x7332('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x7332('0xd'),'email'],'include':[{'model':db[_0x7332('0x1f')],'as':_0x7332('0x20')}]})['then'](function(_0x13f9e9){if(!_0x13f9e9){throw new Error(_0x7332('0x21'));}var _0x2958f6={'tls':{'rejectUnauthorized':![]}};if(_0x13f9e9[_0x7332('0x20')][_0x7332('0x22')]){_0x2958f6[_0x7332('0x22')]=_0x13f9e9[_0x7332('0x20')]['service'];}else{_0x2958f6[_0x7332('0x23')]=_0x13f9e9[_0x7332('0x20')][_0x7332('0x23')];_0x2958f6[_0x7332('0x24')]=_0x13f9e9['Smtp'][_0x7332('0x24')];_0x2958f6[_0x7332('0x25')]=_0x13f9e9['Smtp'][_0x7332('0x25')];}if(_0x13f9e9[_0x7332('0x20')][_0x7332('0x26')]){_0x2958f6['auth']={'user':_0x13f9e9[_0x7332('0x20')][_0x7332('0x27')],'pass':_0x13f9e9['Smtp'][_0x7332('0x28')]};}var _0x5d1a28={'account':_0x2958f6,'message':_['merge']({'from':util[_0x7332('0x29')](_0x7332('0x2a'),_0x13f9e9[_0x7332('0xd')],_0x13f9e9['email']||_0x13f9e9['Smtp']['user'])},_0x324a53)};return client[_0x7332('0x2b')](_0x7332('0x2c'),_0x5d1a28);})[_0x7332('0xc')](function(_0x3c777d){if(_0x3c777d[_0x7332('0x2d')]){throw new Error(util[_0x7332('0x29')](_0x7332('0x2e'),_0x3c777d[_0x7332('0x2d')][_0x7332('0x2f')]||JSON[_0x7332('0x30')](_0x3c777d[_0x7332('0x2d')])));}return!![];});}function handleError(_0x2e7f61,_0x2d55d4,_0x45cbe7){return _0x2e7f61['status'](_0x2d55d4||0x1f4)[_0x7332('0x31')]({'message':_0x45cbe7?_0x45cbe7[_0x7332('0x2f')]||_0x45cbe7:''});}exports[_0x7332('0x32')]=function(_0x43de4d,_0x55c452,_0x169fe5){passport[_0x7332('0x33')](_0x7332('0x34'),function(_0x29611a,_0x402977,_0x915bde){var _0x3fd8f2=_0x29611a||_0x915bde;if(_0x3fd8f2){return handleError(_0x55c452,0x191,_0x3fd8f2);}if(!_0x402977){return handleError(_0x55c452,0x194,{'message':_0x7332('0x35')});}else{var _0x470977={'payload':{'id':_0x402977['id'],'role':_0x402977[_0x7332('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x7332('0x36')](_0x470977)[_0x7332('0xc')](function(_0xa4ee7d){_0x55c452[_0x7332('0x37')]({'id':_0x402977['id'],'token':_0xa4ee7d,'statusCall':'','isAlreadyLogged':_0x402977['online']});});}})(_0x43de4d,_0x55c452,_0x169fe5);};exports[_0x7332('0x38')]=function(_0x2e10c4,_0x18e780,_0x5b6d0f){if(!_0x2e10c4['body'][_0x7332('0x39')]){return handleError(_0x18e780,0x1f4,{'message':_0x7332('0x3a')});}var _0x522cb6=rs[_0x7332('0x3b')]();_0x2e10c4[_0x7332('0x3c')]['email']=_0x2e10c4[_0x7332('0x3c')][_0x7332('0x39')][_0x7332('0x3d')]()['toLowerCase']();var _0x125d30;return db[_0x7332('0x8')][_0x7332('0x9')]({'where':{'id':0x1},'attributes':[_0x7332('0xa'),_0x7332('0xb')],'raw':!![]})['then'](function(_0x15854f){_0x125d30=_0x15854f;return db[_0x7332('0x3e')]['find']({'where':{'email':_0x2e10c4[_0x7332('0x3c')][_0x7332('0x39')]}});})['then'](function(_0x59240d){if(!_0x59240d){throw new Error(_0x7332('0x3f'));}if(_0x59240d[_0x7332('0x1a')]){throw new Error(_0x7332('0x40'));}if(_0x59240d['blocked']){if(moment(_0x59240d['blockedAt'])[_0x7332('0x17')](_0x125d30[_0x7332('0xb')],'minutes')>moment()){throw new Error(_0x7332('0x41'));}else{_0x59240d[_0x7332('0x16')]=![];_0x59240d[_0x7332('0x11')]=null;}}_0x59240d[_0x7332('0x42')]=_0x522cb6;_0x59240d[_0x7332('0x43')]=Date[_0x7332('0x44')]()+0x36ee80;return _0x59240d['save']();})[_0x7332('0xc')](function(){return sendServiceMail({'to':_0x2e10c4[_0x7332('0x3c')][_0x7332('0x39')],'subject':_0x7332('0x45'),'text':_0x7332('0x46')+_0x7332('0x47')+_0x7332('0x48')+_0x2e10c4[_0x7332('0x49')]['host']+'/reset/'+_0x522cb6+'\x0a\x0a'+_0x7332('0x4a')});})['then'](function(){_0x18e780[_0x7332('0x4b')](0xc8)['send']({'message':_0x7332('0x4c')});})[_0x7332('0x1c')](function(_0x27fc86){return handleError(_0x18e780,0x1f4,_0x27fc86);});};exports[_0x7332('0x4d')]=function(_0x33e5ae,_0x4a986f,_0x231b7a){return db[_0x7332('0x3e')]['find']({'where':{'resetPasswordToken':_0x33e5ae['params'][_0x7332('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x7332('0x44')]()}}})['then'](function(_0x341541){if(!_0x341541){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x7332('0x9')]({'attributes':['id','securePassword',_0x7332('0x4f'),_0x7332('0x50')]})[_0x7332('0xc')](function(_0x53828e){if(_0x53828e[_0x7332('0x51')])authService['validatePasswordPattern'](_0x33e5ae[_0x7332('0x3c')][_0x7332('0xe')]);if(!_0x53828e['enforcePasswordHistory']||!_0x341541[_0x7332('0x52')])return _0x341541;authService[_0x7332('0x53')](_0x33e5ae[_0x7332('0x3c')][_0x7332('0xe')],_0x341541[_0x7332('0x52')],_0x53828e[_0x7332('0x50')]);return _0x341541;})[_0x7332('0xc')](function(){_0x341541['password']=_0x33e5ae[_0x7332('0x3c')]['password'];_0x341541[_0x7332('0x42')]=null;_0x341541['resetPasswordExpires']=null;return _0x341541[_0x7332('0x54')]();});})[_0x7332('0xc')](function(){_0x4a986f[_0x7332('0x4b')](0xc8)[_0x7332('0x31')]({'message':_0x7332('0x55')});})['catch'](function(_0x2dfc9a){return handleError(_0x4a986f,0x1f4,_0x2dfc9a);});};passport[_0x7332('0x56')](new LocalStrategy({'usernameField':'name','passwordField':_0x7332('0xe')},function(_0x17c316,_0x384547,_0x40cabf){return localAuthenticate(db[_0x7332('0x3e')],_0x17c316,_0x384547,_0x40cabf);}));
\ No newline at end of file
+var _0xe373=['json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','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','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','validatePasswordHistory','previousPasswords','resetPasswordExpires','save','Password\x20reset!','use','util','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','disabled','blocked','blockedAt','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role'];(function(_0x41e1c6,_0xc47835){var _0x45fc9e=function(_0x4cc65d){while(--_0x4cc65d){_0x41e1c6['push'](_0x41e1c6['shift']());}};_0x45fc9e(++_0xc47835);}(_0xe373,0x11c));var _0x3e37=function(_0x12f0c2,_0x2baff9){_0x12f0c2=_0x12f0c2-0x0;var _0x423f98=_0xe373[_0x12f0c2];return _0x423f98;};'use strict';var util=require(_0x3e37('0x0'));var passport=require(_0x3e37('0x1'));var LocalStrategy=require(_0x3e37('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x3e37('0x3'));var rs=require('randomstring');var moment=require(_0x3e37('0x4'));var db=require(_0x3e37('0x5'))['db'];var authService=require(_0x3e37('0x6'));var utils=require(_0x3e37('0x7'));var client=jayson[_0x3e37('0x8')][_0x3e37('0x9')]({'port':0x232b});function localAuthenticate(_0x539870,_0x42d6e3,_0x2e8fc8,_0x563c98){var _0x5e2509,_0x435f3f;return db[_0x3e37('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x3e37('0xb'),_0x3e37('0xc')],'raw':!![]})[_0x3e37('0xd')](function(_0x5c2382){_0x5e2509=_0x5c2382;return _0x539870[_0x3e37('0xe')]({'attributes':['id',_0x3e37('0xf'),'password',_0x3e37('0x10'),'role',_0x3e37('0x11'),_0x3e37('0x12'),_0x3e37('0x13'),'loginAttempts'],'where':{'name':_0x42d6e3,'role':{'$or':['admin','user',_0x3e37('0x14')]}}});})[_0x3e37('0xd')](function(_0x447671){if(!_0x447671||_0x447671&&_0x447671['name']!==_0x42d6e3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x435f3f=_0x447671;return _0x435f3f;}})[_0x3e37('0xd')](function(){_0x435f3f[_0x3e37('0x15')](_0x2e8fc8,function(_0x35c72a,_0x588b00){var _0x471b07=_0x435f3f[_0x3e37('0x16')]+0x1;if(_0x35c72a){return _0x563c98(_0x35c72a);}else if(!_0x588b00){if(_0x435f3f[_0x3e37('0x11')]){return _0x563c98(null,![],{'message':_0x3e37('0x17')});}else if(_0x5e2509[_0x3e37('0xb')]>0x0){if(_0x435f3f['blocked']){if(_0x5e2509['blockDuration']>0x0){if(moment(_0x435f3f[_0x3e37('0x13')])[_0x3e37('0x18')](_0x5e2509[_0x3e37('0xc')],_0x3e37('0x19'))>moment()){return _0x563c98(null,![],{'message':_0x3e37('0x17')});}else{return utils[_0x3e37('0x1a')](_0x435f3f,_0x471b07,![],null)[_0x3e37('0xd')](function(){return _0x563c98(null,![],{'message':_0x3e37('0x17')});});}}else{return _0x563c98(null,![],{'message':_0x3e37('0x17')});}}else{if(_0x471b07>=_0x5e2509['allowedLoginAttempts']){return utils[_0x3e37('0x1a')](_0x435f3f,0x0,!![],moment())[_0x3e37('0xd')](function(){return _0x563c98(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x435f3f,_0x471b07,![],null)[_0x3e37('0xd')](function(){return _0x563c98(null,![],{'message':_0x3e37('0x17')});});}}}else{return _0x563c98(null,![],{'message':_0x3e37('0x17')});}}else{if(_0x435f3f[_0x3e37('0x11')]){return _0x563c98(null,![],{'message':_0x3e37('0x17')});}else if(_0x5e2509['allowedLoginAttempts']>0x0){if(_0x435f3f[_0x3e37('0x12')]){if(_0x5e2509[_0x3e37('0xc')]>0x0){if(moment(_0x435f3f[_0x3e37('0x13')])[_0x3e37('0x18')](_0x5e2509['blockDuration'],_0x3e37('0x19'))>moment()){return _0x563c98(null,![],{'message':_0x3e37('0x17')});}else{return utils[_0x3e37('0x1a')](_0x435f3f,0x0,![],null)[_0x3e37('0xd')](function(){return utils[_0x3e37('0x1b')](_0x435f3f);})['then'](function(){return _0x563c98(null,_0x435f3f);});}}else{return _0x563c98(null,![],{'message':_0x3e37('0x17')});}}else{return utils[_0x3e37('0x1a')](_0x435f3f,0x0,![],null)[_0x3e37('0xd')](function(){return utils[_0x3e37('0x1b')](_0x435f3f);})['then'](function(){return _0x563c98(null,_0x435f3f);})[_0x3e37('0x1c')](function(_0x40672c){return _0x563c98(null,![],_0x40672c);});}}else{if(_0x435f3f['blocked']){return _0x563c98(null,![],{'message':_0x3e37('0x17')});}else{return utils[_0x3e37('0x1b')](_0x435f3f)[_0x3e37('0xd')](function(){return _0x563c98(null,_0x435f3f);});}}}});})[_0x3e37('0x1c')](function(_0x1248fc){return _0x563c98(null,![],_0x1248fc);});}function sendServiceMail(_0x72679d){return db[_0x3e37('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x3e37('0x1e')],'include':[{'model':db[_0x3e37('0x1f')],'as':_0x3e37('0x20')}]})[_0x3e37('0xd')](function(_0x37838a){if(!_0x37838a){throw new Error(_0x3e37('0x21'));}var _0x12b7b5={'tls':{'rejectUnauthorized':![]}};if(_0x37838a['Smtp'][_0x3e37('0x22')]){_0x12b7b5['service']=_0x37838a[_0x3e37('0x20')][_0x3e37('0x22')];}else{_0x12b7b5[_0x3e37('0x23')]=_0x37838a[_0x3e37('0x20')]['host'];_0x12b7b5[_0x3e37('0x24')]=_0x37838a['Smtp'][_0x3e37('0x24')];_0x12b7b5['secure']=_0x37838a[_0x3e37('0x20')][_0x3e37('0x25')];}if(_0x37838a[_0x3e37('0x20')][_0x3e37('0x26')]){_0x12b7b5[_0x3e37('0x27')]={'user':_0x37838a[_0x3e37('0x20')]['user'],'pass':_0x37838a[_0x3e37('0x20')][_0x3e37('0x28')]};}var _0x4e0f11={'account':_0x12b7b5,'message':_[_0x3e37('0x29')]({'from':util[_0x3e37('0x2a')](_0x3e37('0x2b'),_0x37838a[_0x3e37('0xf')],_0x37838a[_0x3e37('0x1e')]||_0x37838a['Smtp'][_0x3e37('0x2c')])},_0x72679d)};return client[_0x3e37('0x2d')](_0x3e37('0x2e'),_0x4e0f11);})[_0x3e37('0xd')](function(_0x237514){if(_0x237514[_0x3e37('0x2f')]){throw new Error(util[_0x3e37('0x2a')](_0x3e37('0x30'),_0x237514['error'][_0x3e37('0x31')]||JSON[_0x3e37('0x32')](_0x237514[_0x3e37('0x2f')])));}return!![];});}function handleError(_0x1eb021,_0x2b8615,_0x52b31b){return _0x1eb021['status'](_0x2b8615||0x1f4)[_0x3e37('0x33')]({'message':_0x52b31b?_0x52b31b[_0x3e37('0x31')]||_0x52b31b:''});}exports[_0x3e37('0x34')]=function(_0x249c1c,_0x207bf0,_0x537d86){passport['authenticate'](_0x3e37('0x35'),function(_0x56a0ff,_0x9682a2,_0x411167){var _0x251009=_0x56a0ff||_0x411167;if(_0x251009){return handleError(_0x207bf0,0x191,_0x251009);}if(!_0x9682a2){return handleError(_0x207bf0,0x194,{'message':_0x3e37('0x36')});}else{var _0x25e07f={'payload':{'id':_0x9682a2['id'],'role':_0x9682a2[_0x3e37('0x37')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x25e07f)['then'](function(_0x49e9b3){_0x207bf0[_0x3e37('0x38')]({'id':_0x9682a2['id'],'token':_0x49e9b3,'statusCall':'','isAlreadyLogged':_0x9682a2['online']});});}})(_0x249c1c,_0x207bf0,_0x537d86);};exports[_0x3e37('0x39')]=function(_0x1da211,_0x5ec0f5,_0x3e7981){if(!_0x1da211[_0x3e37('0x3a')][_0x3e37('0x1e')]){return handleError(_0x5ec0f5,0x1f4,{'message':_0x3e37('0x3b')});}var _0x171e1b=rs[_0x3e37('0x3c')]();_0x1da211[_0x3e37('0x3a')]['email']=_0x1da211[_0x3e37('0x3a')][_0x3e37('0x1e')][_0x3e37('0x3d')]()['toLowerCase']();var _0x457bd6;return db[_0x3e37('0xa')][_0x3e37('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3e37('0xc')],'raw':!![]})[_0x3e37('0xd')](function(_0x1374ba){_0x457bd6=_0x1374ba;return db[_0x3e37('0x3e')][_0x3e37('0x3f')]({'where':{'email':_0x1da211[_0x3e37('0x3a')][_0x3e37('0x1e')]}});})[_0x3e37('0xd')](function(_0xbbd927){if(!_0xbbd927){throw new Error(_0x3e37('0x40'));}if(_0xbbd927[_0x3e37('0x11')]){throw new Error(_0x3e37('0x41'));}if(_0xbbd927['blocked']){if(moment(_0xbbd927[_0x3e37('0x13')])[_0x3e37('0x18')](_0x457bd6[_0x3e37('0xc')],_0x3e37('0x19'))>moment()){throw new Error(_0x3e37('0x42'));}else{_0xbbd927[_0x3e37('0x12')]=![];_0xbbd927[_0x3e37('0x13')]=null;}}_0xbbd927[_0x3e37('0x43')]=_0x171e1b;_0xbbd927['resetPasswordExpires']=Date[_0x3e37('0x44')]()+0x36ee80;return _0xbbd927['save']();})['then'](function(){return sendServiceMail({'to':_0x1da211[_0x3e37('0x3a')][_0x3e37('0x1e')],'subject':_0x3e37('0x45'),'text':_0x3e37('0x46')+_0x3e37('0x47')+'https://'+_0x1da211['headers']['host']+'/reset/'+_0x171e1b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x3e37('0xd')](function(){_0x5ec0f5['status'](0xc8)[_0x3e37('0x33')]({'message':_0x3e37('0x48')});})[_0x3e37('0x1c')](function(_0x22084e){return handleError(_0x5ec0f5,0x1f4,_0x22084e);});};exports[_0x3e37('0x49')]=function(_0x44dcf9,_0x2041ab,_0x51ac67){return db[_0x3e37('0x3e')][_0x3e37('0x3f')]({'where':{'resetPasswordToken':_0x44dcf9['params'][_0x3e37('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x3e37('0x44')]()}}})[_0x3e37('0xd')](function(_0x5eed9f){if(!_0x5eed9f){throw new Error(_0x3e37('0x4b'));}return db[_0x3e37('0xa')][_0x3e37('0xe')]({'attributes':['id',_0x3e37('0x4c'),'enforcePasswordHistory',_0x3e37('0x4d')]})[_0x3e37('0xd')](function(_0x1bb2be){if(_0x1bb2be[_0x3e37('0x4c')])authService['validatePasswordPattern'](_0x44dcf9[_0x3e37('0x3a')][_0x3e37('0x4e')]);if(!_0x1bb2be['enforcePasswordHistory']||!_0x5eed9f['previousPasswords'])return _0x5eed9f;authService[_0x3e37('0x4f')](_0x44dcf9[_0x3e37('0x3a')]['password'],_0x5eed9f[_0x3e37('0x50')],_0x1bb2be[_0x3e37('0x4d')]);return _0x5eed9f;})[_0x3e37('0xd')](function(){_0x5eed9f[_0x3e37('0x4e')]=_0x44dcf9['body'][_0x3e37('0x4e')];_0x5eed9f[_0x3e37('0x43')]=null;_0x5eed9f[_0x3e37('0x51')]=null;return _0x5eed9f[_0x3e37('0x52')]();});})[_0x3e37('0xd')](function(){_0x2041ab['status'](0xc8)[_0x3e37('0x33')]({'message':_0x3e37('0x53')});})[_0x3e37('0x1c')](function(_0x18d7ec){return handleError(_0x2041ab,0x1f4,_0x18d7ec);});};passport[_0x3e37('0x54')](new LocalStrategy({'usernameField':_0x3e37('0xf'),'passwordField':'password'},function(_0x495862,_0x334a48,_0x2b4c9a){return localAuthenticate(db['User'],_0x495862,_0x334a48,_0x2b4c9a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a2c33c4..53fa769 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 _0x5dbb=['exports','Router','login','post','/forgot','forgot','/reset/:token','reset'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x5dbb,0x79));var _0xb5db=function(_0x220a4e,_0x36a2cd){_0x220a4e=_0x220a4e-0x0;var _0x2cd728=_0x5dbb[_0x220a4e];return _0x2cd728;};'use strict';var express=require('express');var router=express[_0xb5db('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xb5db('0x1')]);router[_0xb5db('0x2')](_0xb5db('0x3'),controller[_0xb5db('0x4')]);router[_0xb5db('0x2')](_0xb5db('0x5'),controller[_0xb5db('0x6')]);module[_0xb5db('0x7')]=router;
\ No newline at end of file
+var _0x81ee=['login','post','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x2be23f,_0xd6c424){var _0x546c11=function(_0x2c98a1){while(--_0x2c98a1){_0x2be23f['push'](_0x2be23f['shift']());}};_0x546c11(++_0xd6c424);}(_0x81ee,0x178));var _0xe81e=function(_0x11d1f3,_0x450ef1){_0x11d1f3=_0x11d1f3-0x0;var _0x293c7b=_0x81ee[_0x11d1f3];return _0x293c7b;};'use strict';var express=require(_0xe81e('0x0'));var router=express['Router']();var controller=require(_0xe81e('0x1'));router['post']('/',controller[_0xe81e('0x2')]);router[_0xe81e('0x3')](_0xe81e('0x4'),controller[_0xe81e('0x5')]);router[_0xe81e('0x3')](_0xe81e('0x6'),controller[_0xe81e('0x7')]);module[_0xe81e('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 836aa55..51f47b2 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 _0x6cc4=['STRING','INTEGER','sequelize','exports'];(function(_0x46261b,_0xd68542){var _0x31e36f=function(_0xf5ed2b){while(--_0xf5ed2b){_0x46261b['push'](_0x46261b['shift']());}};_0x31e36f(++_0xd68542);}(_0x6cc4,0x76));var _0x46cc=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6cc4[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x46cc('0x0'));module[_0x46cc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x46cc('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x46cc('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x28d7=['INTEGER','sequelize','exports','STRING'];(function(_0xcc6b49,_0x4bcf17){var _0x2d3559=function(_0x4f0f40){while(--_0x4f0f40){_0xcc6b49['push'](_0xcc6b49['shift']());}};_0x2d3559(++_0x4bcf17);}(_0x28d7,0xf5));var _0x728d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28d7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x728d('0x0'));module[_0x728d('0x1')]={'name':{'type':Sequelize[_0x728d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x728d('0x2')]},'description':{'type':Sequelize[_0x728d('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x728d('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 a80f2b3..270e528 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 _0x8258=['pick','filter','VIRTUAL','merge','Automation','includeAll','include','rows','catch','show','params','options','find','create','body','update','ids','omit','getConditions','findOne','Condition','hasOwnProperty','nolimit','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','send','index','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where'];(function(_0x360739,_0x2ec1b2){var _0x3e23a1=function(_0x105b37){while(--_0x105b37){_0x360739['push'](_0x360739['shift']());}};_0x3e23a1(++_0x2ec1b2);}(_0x8258,0x116));var _0x8825=function(_0x180f6e,_0x1d7c5c){_0x180f6e=_0x180f6e-0x0;var _0x537fd2=_0x8258[_0x180f6e];return _0x537fd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8825('0x0'));var zipdir=require(_0x8825('0x1'));var jsonpatch=require(_0x8825('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8825('0x3'));var util=require(_0x8825('0x4'));var path=require(_0x8825('0x5'));var sox=require(_0x8825('0x6'));var csv=require(_0x8825('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8825('0x8'));var _=require('lodash');var squel=require(_0x8825('0x9'));var crypto=require(_0x8825('0xa'));var jsforce=require(_0x8825('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8825('0xc'));var Papa=require('papaparse');var Redis=require(_0x8825('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8825('0xe'));var as=require(_0x8825('0xf'));var hardwareService=require(_0x8825('0x10'));var logger=require(_0x8825('0x11'))('api');var utils=require(_0x8825('0x12'));var config=require(_0x8825('0x13'));var licenseUtil=require(_0x8825('0x14'));var db=require(_0x8825('0x15'))['db'];function respondWithStatusCode(_0x193699,_0xea9fed){_0xea9fed=_0xea9fed||0xcc;return function(_0x346a72){if(_0x346a72){return _0x193699[_0x8825('0x16')](_0xea9fed);}return _0x193699['status'](_0xea9fed)[_0x8825('0x17')]();};}function respondWithResult(_0x39388b,_0x556e00){_0x556e00=_0x556e00||0xc8;return function(_0x1ea8e8){if(_0x1ea8e8){return _0x39388b[_0x8825('0x18')](_0x556e00)[_0x8825('0x19')](_0x1ea8e8);}};}function respondWithFilteredResult(_0x5cd4e5,_0x2ce500){return function(_0xc626dd){if(_0xc626dd){var _0x4f059f=typeof _0x2ce500[_0x8825('0x1a')]===_0x8825('0x1b')&&typeof _0x2ce500[_0x8825('0x1c')]===_0x8825('0x1b');var _0x49a3d4=_0xc626dd['count'];var _0x3d0ca8=_0x4f059f?0x0:_0x2ce500[_0x8825('0x1a')];var _0x510088=_0x4f059f?_0xc626dd[_0x8825('0x1d')]:_0x2ce500[_0x8825('0x1a')]+_0x2ce500[_0x8825('0x1c')];var _0x36b34f;if(_0x510088>=_0x49a3d4){_0x510088=_0x49a3d4;_0x36b34f=0xc8;}else{_0x36b34f=0xce;}_0x5cd4e5['status'](_0x36b34f);return _0x5cd4e5[_0x8825('0x1e')](_0x8825('0x1f'),_0x3d0ca8+'-'+_0x510088+'/'+_0x49a3d4)[_0x8825('0x19')](_0xc626dd);}return null;};}function patchUpdates(_0x420034){return function(_0x241136){try{jsonpatch[_0x8825('0x20')](_0x241136,_0x420034,!![]);}catch(_0x5026af){return BPromise[_0x8825('0x21')](_0x5026af);}return _0x241136[_0x8825('0x22')]();};}function saveUpdates(_0x192adc,_0x4ef125){return function(_0x17ab81){if(_0x17ab81){return _0x17ab81['update'](_0x192adc)['then'](function(_0x7f07c1){return _0x7f07c1;});}return null;};}function removeEntity(_0x4b3958,_0x15ff6f){return function(_0x11f872){if(_0x11f872){return _0x11f872[_0x8825('0x23')]()[_0x8825('0x24')](function(){_0x4b3958[_0x8825('0x18')](0xcc)[_0x8825('0x17')]();});}};}function handleEntityNotFound(_0x49129a,_0x5a4c34){return function(_0x21cb07){if(!_0x21cb07){_0x49129a[_0x8825('0x16')](0x194);}return _0x21cb07;};}function handleError(_0x469ce4,_0x5893fe){_0x5893fe=_0x5893fe||0x1f4;return function(_0x3bf736){logger[_0x8825('0x25')](_0x3bf736[_0x8825('0x26')]);if(_0x3bf736['name']){delete _0x3bf736['name'];}_0x469ce4[_0x8825('0x18')](_0x5893fe)[_0x8825('0x27')](_0x3bf736);};}exports[_0x8825('0x28')]=function(_0x448266,_0x34db37){var _0xa52a04={},_0x735fee={},_0x3e8d27={'count':0x0,'rows':[]};var _0xf8331c=_[_0x8825('0x29')](db['Automation'][_0x8825('0x2a')],function(_0x3a0eea){return{'name':_0x3a0eea[_0x8825('0x2b')],'type':_0x3a0eea[_0x8825('0x2c')][_0x8825('0x2d')]};});_0x735fee['model']=_[_0x8825('0x29')](_0xf8331c,_0x8825('0x2e'));_0x735fee[_0x8825('0x2f')]=_[_0x8825('0x30')](_0x448266[_0x8825('0x2f')]);_0x735fee[_0x8825('0x31')]=_[_0x8825('0x32')](_0x735fee[_0x8825('0x33')],_0x735fee[_0x8825('0x2f')]);_0xa52a04['attributes']=_[_0x8825('0x32')](_0x735fee[_0x8825('0x33')],qs[_0x8825('0x34')](_0x448266['query'][_0x8825('0x34')]));_0xa52a04['attributes']=_0xa52a04[_0x8825('0x35')][_0x8825('0x36')]?_0xa52a04[_0x8825('0x35')]:_0x735fee[_0x8825('0x33')];if(!_0x448266[_0x8825('0x2f')]['hasOwnProperty']('nolimit')){_0xa52a04[_0x8825('0x1c')]=qs[_0x8825('0x1c')](_0x448266[_0x8825('0x2f')]['limit']);_0xa52a04[_0x8825('0x1a')]=qs[_0x8825('0x1a')](_0x448266['query'][_0x8825('0x1a')]);}_0xa52a04[_0x8825('0x37')]=qs['sort'](_0x448266[_0x8825('0x2f')][_0x8825('0x38')]);_0xa52a04[_0x8825('0x39')]=qs[_0x8825('0x31')](_[_0x8825('0x3a')](_0x448266['query'],_0x735fee[_0x8825('0x31')]),_0xf8331c);if(_0x448266['query'][_0x8825('0x3b')]){_0xa52a04[_0x8825('0x39')]=_['merge'](_0xa52a04['where'],{'$or':_[_0x8825('0x29')](_0xf8331c,function(_0x5c8851){if(_0x5c8851['type']!==_0x8825('0x3c')){var _0x50d837={};_0x50d837[_0x5c8851['name']]={'$like':'%'+_0x448266[_0x8825('0x2f')][_0x8825('0x3b')]+'%'};return _0x50d837;}})});}_0xa52a04=_[_0x8825('0x3d')]({},_0xa52a04,_0x448266['options']);var _0x255334={'where':_0xa52a04['where']};return db[_0x8825('0x3e')][_0x8825('0x1d')](_0x255334)[_0x8825('0x24')](function(_0x2f3ec7){_0x3e8d27[_0x8825('0x1d')]=_0x2f3ec7;if(_0x448266['query'][_0x8825('0x3f')]){_0xa52a04[_0x8825('0x40')]=[{'all':!![]}];}return db['Automation']['findAll'](_0xa52a04);})[_0x8825('0x24')](function(_0x4ee18b){_0x3e8d27[_0x8825('0x41')]=_0x4ee18b;return _0x3e8d27;})['then'](respondWithFilteredResult(_0x34db37,_0xa52a04))[_0x8825('0x42')](handleError(_0x34db37,null));};exports[_0x8825('0x43')]=function(_0xfa57bc,_0x6e8de3){var _0x981df5={'raw':![],'where':{'id':_0xfa57bc[_0x8825('0x44')]['id']}},_0x4bffd6={};_0x4bffd6['model']=_[_0x8825('0x30')](db[_0x8825('0x3e')][_0x8825('0x2a')]);_0x4bffd6[_0x8825('0x2f')]=_[_0x8825('0x30')](_0xfa57bc[_0x8825('0x2f')]);_0x4bffd6['filters']=_[_0x8825('0x32')](_0x4bffd6[_0x8825('0x33')],_0x4bffd6[_0x8825('0x2f')]);_0x981df5[_0x8825('0x35')]=_[_0x8825('0x32')](_0x4bffd6[_0x8825('0x33')],qs['fields'](_0xfa57bc[_0x8825('0x2f')][_0x8825('0x34')]));_0x981df5[_0x8825('0x35')]=_0x981df5[_0x8825('0x35')]['length']?_0x981df5['attributes']:_0x4bffd6[_0x8825('0x33')];if(_0xfa57bc[_0x8825('0x2f')][_0x8825('0x3f')]){_0x981df5[_0x8825('0x40')]=[{'all':!![]}];}_0x981df5=_[_0x8825('0x3d')]({},_0x981df5,_0xfa57bc[_0x8825('0x45')]);return db[_0x8825('0x3e')][_0x8825('0x46')](_0x981df5)['then'](handleEntityNotFound(_0x6e8de3,null))['then'](respondWithResult(_0x6e8de3,null))[_0x8825('0x42')](handleError(_0x6e8de3,null));};exports[_0x8825('0x47')]=function(_0x55dbfe,_0x5e999a){return db[_0x8825('0x3e')][_0x8825('0x47')](_0x55dbfe[_0x8825('0x48')],{})[_0x8825('0x24')](respondWithResult(_0x5e999a,0xc9))[_0x8825('0x42')](handleError(_0x5e999a,null));};exports[_0x8825('0x49')]=function(_0x2bef34,_0x4fa701){if(_0x2bef34[_0x8825('0x48')]['id']){delete _0x2bef34[_0x8825('0x48')]['id'];}return db[_0x8825('0x3e')][_0x8825('0x46')]({'where':{'id':_0x2bef34[_0x8825('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fa701,null))[_0x8825('0x24')](saveUpdates(_0x2bef34['body'],null))[_0x8825('0x24')](respondWithResult(_0x4fa701,null))[_0x8825('0x42')](handleError(_0x4fa701,null));};exports[_0x8825('0x23')]=function(_0x5178b5,_0xd361af){return db['Automation'][_0x8825('0x46')]({'where':{'id':_0x5178b5['params']['id']}})[_0x8825('0x24')](handleEntityNotFound(_0xd361af,null))[_0x8825('0x24')](removeEntity(_0xd361af,null))[_0x8825('0x42')](handleError(_0xd361af,null));};exports['addConditions']=function(_0x44293c,_0x5831b1,_0x5e6754){return db['Condition'][_0x8825('0x46')]({'where':{'id':_0x44293c[_0x8825('0x44')]['id']}})[_0x8825('0x24')](handleEntityNotFound(_0x5831b1,null))[_0x8825('0x24')](function(_0xa369d7){if(_0xa369d7){return _0xa369d7['addConditions'](_0x44293c['body'][_0x8825('0x4a')],_[_0x8825('0x4b')](_0x44293c[_0x8825('0x48')],[_0x8825('0x4a'),'id'])||{});}})[_0x8825('0x24')](respondWithResult(_0x5831b1,null))['catch'](handleError(_0x5831b1,null));};exports[_0x8825('0x4c')]=function(_0x407d1a,_0x4e8a72,_0xe408ff){var _0x33ba2c={};var _0x16c296={};var _0x51d8c5;var _0x3e6346;return db[_0x8825('0x3e')][_0x8825('0x4d')]({'where':{'id':_0x407d1a[_0x8825('0x44')]['id']}})[_0x8825('0x24')](handleEntityNotFound(_0x4e8a72,null))[_0x8825('0x24')](function(_0x5a3433){if(_0x5a3433){_0x51d8c5=_0x5a3433;_0x16c296['model']=_[_0x8825('0x30')](db[_0x8825('0x4e')]['rawAttributes']);_0x16c296['query']=_['keys'](_0x407d1a[_0x8825('0x2f')]);_0x16c296[_0x8825('0x31')]=_[_0x8825('0x32')](_0x16c296['model'],_0x16c296[_0x8825('0x2f')]);_0x33ba2c[_0x8825('0x35')]=_[_0x8825('0x32')](_0x16c296[_0x8825('0x33')],qs[_0x8825('0x34')](_0x407d1a[_0x8825('0x2f')][_0x8825('0x34')]));_0x33ba2c[_0x8825('0x35')]=_0x33ba2c['attributes'][_0x8825('0x36')]?_0x33ba2c[_0x8825('0x35')]:_0x16c296[_0x8825('0x33')];_0x33ba2c[_0x8825('0x37')]=qs[_0x8825('0x38')](_0x407d1a[_0x8825('0x2f')][_0x8825('0x38')]);_0x33ba2c[_0x8825('0x39')]=qs[_0x8825('0x31')](_['pick'](_0x407d1a[_0x8825('0x2f')],_0x16c296[_0x8825('0x31')]));if(_0x407d1a[_0x8825('0x2f')][_0x8825('0x3b')]){_0x33ba2c[_0x8825('0x39')]=_[_0x8825('0x3d')](_0x33ba2c[_0x8825('0x39')],{'$or':_['map'](_0x33ba2c['attributes'],function(_0x44e0bb){var _0x4679ce={};_0x4679ce[_0x44e0bb]={'$like':'%'+_0x407d1a[_0x8825('0x2f')][_0x8825('0x3b')]+'%'};return _0x4679ce;})});}_0x33ba2c=_[_0x8825('0x3d')]({},_0x33ba2c,_0x407d1a['options']);return _0x51d8c5[_0x8825('0x4c')](_0x33ba2c);}})[_0x8825('0x24')](function(_0xde26ae){if(_0xde26ae){_0x3e6346=_0xde26ae[_0x8825('0x36')];if(!_0x407d1a['query'][_0x8825('0x4f')](_0x8825('0x50'))){_0x33ba2c['limit']=qs[_0x8825('0x1c')](_0x407d1a['query'][_0x8825('0x1c')]);_0x33ba2c[_0x8825('0x1a')]=qs[_0x8825('0x1a')](_0x407d1a[_0x8825('0x2f')]['offset']);}return _0x51d8c5['getConditions'](_0x33ba2c);}})[_0x8825('0x24')](function(_0x384597){if(_0x384597){return _0x384597?{'count':_0x3e6346,'rows':_0x384597}:null;}})[_0x8825('0x24')](respondWithResult(_0x4e8a72,null))[_0x8825('0x42')](handleError(_0x4e8a72,null));};exports[_0x8825('0x51')]=function(_0x568163,_0x5379be,_0x58a14b){return db['Action'][_0x8825('0x46')]({'where':{'id':_0x568163['params']['id']}})['then'](handleEntityNotFound(_0x5379be,null))[_0x8825('0x24')](function(_0x567f94){if(_0x567f94){return _0x567f94['addActions'](_0x568163[_0x8825('0x48')][_0x8825('0x4a')],_['omit'](_0x568163[_0x8825('0x48')],[_0x8825('0x4a'),'id'])||{});}})[_0x8825('0x24')](respondWithResult(_0x5379be,null))[_0x8825('0x42')](handleError(_0x5379be,null));};exports['getActions']=function(_0x1d0560,_0x1c2ead,_0x1311b1){var _0x17b85f={};var _0x59453f={};var _0xd1cbe8;var _0x112c7f;return db[_0x8825('0x3e')]['findOne']({'where':{'id':_0x1d0560[_0x8825('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c2ead,null))[_0x8825('0x24')](function(_0x5c9800){if(_0x5c9800){_0xd1cbe8=_0x5c9800;_0x59453f[_0x8825('0x33')]=_['keys'](db[_0x8825('0x52')][_0x8825('0x2a')]);_0x59453f[_0x8825('0x2f')]=_[_0x8825('0x30')](_0x1d0560[_0x8825('0x2f')]);_0x59453f[_0x8825('0x31')]=_[_0x8825('0x32')](_0x59453f[_0x8825('0x33')],_0x59453f[_0x8825('0x2f')]);_0x17b85f[_0x8825('0x35')]=_['intersection'](_0x59453f[_0x8825('0x33')],qs[_0x8825('0x34')](_0x1d0560[_0x8825('0x2f')][_0x8825('0x34')]));_0x17b85f[_0x8825('0x35')]=_0x17b85f[_0x8825('0x35')][_0x8825('0x36')]?_0x17b85f[_0x8825('0x35')]:_0x59453f[_0x8825('0x33')];_0x17b85f['order']=qs[_0x8825('0x38')](_0x1d0560[_0x8825('0x2f')]['sort']);_0x17b85f[_0x8825('0x39')]=qs[_0x8825('0x31')](_['pick'](_0x1d0560[_0x8825('0x2f')],_0x59453f[_0x8825('0x31')]));if(_0x1d0560[_0x8825('0x2f')]['filter']){_0x17b85f[_0x8825('0x39')]=_[_0x8825('0x3d')](_0x17b85f[_0x8825('0x39')],{'$or':_[_0x8825('0x29')](_0x17b85f[_0x8825('0x35')],function(_0xdfae4f){var _0x5232ef={};_0x5232ef[_0xdfae4f]={'$like':'%'+_0x1d0560['query'][_0x8825('0x3b')]+'%'};return _0x5232ef;})});}_0x17b85f=_['merge']({},_0x17b85f,_0x1d0560[_0x8825('0x45')]);return _0xd1cbe8[_0x8825('0x53')](_0x17b85f);}})[_0x8825('0x24')](function(_0x29089d){if(_0x29089d){_0x112c7f=_0x29089d[_0x8825('0x36')];if(!_0x1d0560[_0x8825('0x2f')]['hasOwnProperty'](_0x8825('0x50'))){_0x17b85f[_0x8825('0x1c')]=qs[_0x8825('0x1c')](_0x1d0560[_0x8825('0x2f')][_0x8825('0x1c')]);_0x17b85f[_0x8825('0x1a')]=qs['offset'](_0x1d0560[_0x8825('0x2f')][_0x8825('0x1a')]);}return _0xd1cbe8[_0x8825('0x53')](_0x17b85f);}})[_0x8825('0x24')](function(_0x3c7a0d){if(_0x3c7a0d){return _0x3c7a0d?{'count':_0x112c7f,'rows':_0x3c7a0d}:null;}})[_0x8825('0x24')](respondWithResult(_0x1c2ead,null))[_0x8825('0x42')](handleError(_0x1c2ead,null));};
\ No newline at end of file
+var _0x2e5f=['apply','reject','update','then','error','stack','name','send','index','Automation','rawAttributes','key','map','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','catch','create','body','find','destroy','Condition','addConditions','omit','ids','getConditions','findOne','order','addActions','Action','getActions','eml-format','rimraf','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x254b7a,_0x14e81d){var _0x439ad2=function(_0x2fccc2){while(--_0x2fccc2){_0x254b7a['push'](_0x254b7a['shift']());}};_0x439ad2(++_0x14e81d);}(_0x2e5f,0x125));var _0xf2e5=function(_0x414217,_0x896d01){_0x414217=_0x414217-0x0;var _0x2794d3=_0x2e5f[_0x414217];return _0x2794d3;};'use strict';var emlformat=require(_0xf2e5('0x0'));var rimraf=require(_0xf2e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf2e5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf2e5('0x3'));var sox=require(_0xf2e5('0x4'));var csv=require(_0xf2e5('0x5'));var ejs=require(_0xf2e5('0x6'));var fs=require('fs');var fs_extra=require(_0xf2e5('0x7'));var _=require(_0xf2e5('0x8'));var squel=require(_0xf2e5('0x9'));var crypto=require(_0xf2e5('0xa'));var jsforce=require(_0xf2e5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf2e5('0x5'));var querystring=require(_0xf2e5('0xc'));var Papa=require(_0xf2e5('0xd'));var Redis=require(_0xf2e5('0xe'));var authService=require(_0xf2e5('0xf'));var qs=require(_0xf2e5('0x10'));var as=require(_0xf2e5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2e5('0x12'))(_0xf2e5('0x13'));var utils=require('../../config/utils');var config=require(_0xf2e5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf2e5('0x15'))['db'];function respondWithStatusCode(_0x1ead9b,_0x1ec48c){_0x1ec48c=_0x1ec48c||0xcc;return function(_0x52c6a2){if(_0x52c6a2){return _0x1ead9b[_0xf2e5('0x16')](_0x1ec48c);}return _0x1ead9b[_0xf2e5('0x17')](_0x1ec48c)[_0xf2e5('0x18')]();};}function respondWithResult(_0x3e23f6,_0x49adcc){_0x49adcc=_0x49adcc||0xc8;return function(_0x8f64ae){if(_0x8f64ae){return _0x3e23f6[_0xf2e5('0x17')](_0x49adcc)['json'](_0x8f64ae);}};}function respondWithFilteredResult(_0x15fd45,_0x111c54){return function(_0x3d31dc){if(_0x3d31dc){var _0x16a863=typeof _0x111c54[_0xf2e5('0x19')]===_0xf2e5('0x1a')&&typeof _0x111c54[_0xf2e5('0x1b')]===_0xf2e5('0x1a');var _0x34887b=_0x3d31dc[_0xf2e5('0x1c')];var _0x41c0cc=_0x16a863?0x0:_0x111c54[_0xf2e5('0x19')];var _0xa04436=_0x16a863?_0x3d31dc[_0xf2e5('0x1c')]:_0x111c54['offset']+_0x111c54['limit'];var _0x122f17;if(_0xa04436>=_0x34887b){_0xa04436=_0x34887b;_0x122f17=0xc8;}else{_0x122f17=0xce;}_0x15fd45[_0xf2e5('0x17')](_0x122f17);return _0x15fd45[_0xf2e5('0x1d')](_0xf2e5('0x1e'),_0x41c0cc+'-'+_0xa04436+'/'+_0x34887b)['json'](_0x3d31dc);}return null;};}function patchUpdates(_0x21de3b){return function(_0xb86eed){try{jsonpatch[_0xf2e5('0x1f')](_0xb86eed,_0x21de3b,!![]);}catch(_0x25417a){return BPromise[_0xf2e5('0x20')](_0x25417a);}return _0xb86eed['save']();};}function saveUpdates(_0x348ecd,_0x49d9bc){return function(_0x55586b){if(_0x55586b){return _0x55586b[_0xf2e5('0x21')](_0x348ecd)[_0xf2e5('0x22')](function(_0x14ec7c){return _0x14ec7c;});}return null;};}function removeEntity(_0x4d2cba,_0x324fc4){return function(_0x376bc8){if(_0x376bc8){return _0x376bc8['destroy']()[_0xf2e5('0x22')](function(){_0x4d2cba[_0xf2e5('0x17')](0xcc)[_0xf2e5('0x18')]();});}};}function handleEntityNotFound(_0x23c863,_0x51baeb){return function(_0x19299b){if(!_0x19299b){_0x23c863['sendStatus'](0x194);}return _0x19299b;};}function handleError(_0x5b7467,_0x4a8b3d){_0x4a8b3d=_0x4a8b3d||0x1f4;return function(_0x3acc1f){logger[_0xf2e5('0x23')](_0x3acc1f[_0xf2e5('0x24')]);if(_0x3acc1f['name']){delete _0x3acc1f[_0xf2e5('0x25')];}_0x5b7467[_0xf2e5('0x17')](_0x4a8b3d)[_0xf2e5('0x26')](_0x3acc1f);};}exports[_0xf2e5('0x27')]=function(_0x5da3e7,_0x2e1873){var _0x4e678c={},_0x3e2339={},_0x14c3b5={'count':0x0,'rows':[]};var _0x34c814=_['map'](db[_0xf2e5('0x28')][_0xf2e5('0x29')],function(_0x1fea6e){return{'name':_0x1fea6e['fieldName'],'type':_0x1fea6e['type'][_0xf2e5('0x2a')]};});_0x3e2339['model']=_[_0xf2e5('0x2b')](_0x34c814,_0xf2e5('0x25'));_0x3e2339['query']=_[_0xf2e5('0x2c')](_0x5da3e7['query']);_0x3e2339[_0xf2e5('0x2d')]=_['intersection'](_0x3e2339[_0xf2e5('0x2e')],_0x3e2339[_0xf2e5('0x2f')]);_0x4e678c[_0xf2e5('0x30')]=_[_0xf2e5('0x31')](_0x3e2339['model'],qs[_0xf2e5('0x32')](_0x5da3e7['query'][_0xf2e5('0x32')]));_0x4e678c['attributes']=_0x4e678c[_0xf2e5('0x30')][_0xf2e5('0x33')]?_0x4e678c[_0xf2e5('0x30')]:_0x3e2339[_0xf2e5('0x2e')];if(!_0x5da3e7[_0xf2e5('0x2f')][_0xf2e5('0x34')](_0xf2e5('0x35'))){_0x4e678c['limit']=qs[_0xf2e5('0x1b')](_0x5da3e7[_0xf2e5('0x2f')][_0xf2e5('0x1b')]);_0x4e678c[_0xf2e5('0x19')]=qs[_0xf2e5('0x19')](_0x5da3e7[_0xf2e5('0x2f')]['offset']);}_0x4e678c['order']=qs[_0xf2e5('0x36')](_0x5da3e7[_0xf2e5('0x2f')]['sort']);_0x4e678c[_0xf2e5('0x37')]=qs['filters'](_[_0xf2e5('0x38')](_0x5da3e7[_0xf2e5('0x2f')],_0x3e2339[_0xf2e5('0x2d')]),_0x34c814);if(_0x5da3e7['query'][_0xf2e5('0x39')]){_0x4e678c[_0xf2e5('0x37')]=_[_0xf2e5('0x3a')](_0x4e678c[_0xf2e5('0x37')],{'$or':_[_0xf2e5('0x2b')](_0x34c814,function(_0x3f5038){if(_0x3f5038['type']!==_0xf2e5('0x3b')){var _0x36c6a7={};_0x36c6a7[_0x3f5038[_0xf2e5('0x25')]]={'$like':'%'+_0x5da3e7['query'][_0xf2e5('0x39')]+'%'};return _0x36c6a7;}})});}_0x4e678c=_[_0xf2e5('0x3a')]({},_0x4e678c,_0x5da3e7['options']);var _0x4c748a={'where':_0x4e678c[_0xf2e5('0x37')]};return db[_0xf2e5('0x28')]['count'](_0x4c748a)['then'](function(_0x69b943){_0x14c3b5[_0xf2e5('0x1c')]=_0x69b943;if(_0x5da3e7['query'][_0xf2e5('0x3c')]){_0x4e678c['include']=[{'all':!![]}];}return db[_0xf2e5('0x28')][_0xf2e5('0x3d')](_0x4e678c);})[_0xf2e5('0x22')](function(_0x5ce7d9){_0x14c3b5[_0xf2e5('0x3e')]=_0x5ce7d9;return _0x14c3b5;})['then'](respondWithFilteredResult(_0x2e1873,_0x4e678c))['catch'](handleError(_0x2e1873,null));};exports['show']=function(_0x314899,_0x49ec56){var _0x55a603={'raw':![],'where':{'id':_0x314899[_0xf2e5('0x3f')]['id']}},_0x14371f={};_0x14371f['model']=_[_0xf2e5('0x2c')](db[_0xf2e5('0x28')][_0xf2e5('0x29')]);_0x14371f[_0xf2e5('0x2f')]=_['keys'](_0x314899[_0xf2e5('0x2f')]);_0x14371f['filters']=_[_0xf2e5('0x31')](_0x14371f[_0xf2e5('0x2e')],_0x14371f[_0xf2e5('0x2f')]);_0x55a603['attributes']=_[_0xf2e5('0x31')](_0x14371f[_0xf2e5('0x2e')],qs[_0xf2e5('0x32')](_0x314899[_0xf2e5('0x2f')][_0xf2e5('0x32')]));_0x55a603['attributes']=_0x55a603[_0xf2e5('0x30')][_0xf2e5('0x33')]?_0x55a603[_0xf2e5('0x30')]:_0x14371f['model'];if(_0x314899['query']['includeAll']){_0x55a603[_0xf2e5('0x40')]=[{'all':!![]}];}_0x55a603=_[_0xf2e5('0x3a')]({},_0x55a603,_0x314899[_0xf2e5('0x41')]);return db[_0xf2e5('0x28')]['find'](_0x55a603)[_0xf2e5('0x22')](handleEntityNotFound(_0x49ec56,null))[_0xf2e5('0x22')](respondWithResult(_0x49ec56,null))[_0xf2e5('0x42')](handleError(_0x49ec56,null));};exports[_0xf2e5('0x43')]=function(_0x391709,_0x3e7098){return db[_0xf2e5('0x28')][_0xf2e5('0x43')](_0x391709[_0xf2e5('0x44')],{})[_0xf2e5('0x22')](respondWithResult(_0x3e7098,0xc9))[_0xf2e5('0x42')](handleError(_0x3e7098,null));};exports[_0xf2e5('0x21')]=function(_0x2c4cd5,_0x3432fb){if(_0x2c4cd5[_0xf2e5('0x44')]['id']){delete _0x2c4cd5[_0xf2e5('0x44')]['id'];}return db['Automation'][_0xf2e5('0x45')]({'where':{'id':_0x2c4cd5[_0xf2e5('0x3f')]['id']}})[_0xf2e5('0x22')](handleEntityNotFound(_0x3432fb,null))[_0xf2e5('0x22')](saveUpdates(_0x2c4cd5[_0xf2e5('0x44')],null))[_0xf2e5('0x22')](respondWithResult(_0x3432fb,null))[_0xf2e5('0x42')](handleError(_0x3432fb,null));};exports[_0xf2e5('0x46')]=function(_0x185df4,_0x473d90){return db[_0xf2e5('0x28')][_0xf2e5('0x45')]({'where':{'id':_0x185df4['params']['id']}})['then'](handleEntityNotFound(_0x473d90,null))['then'](removeEntity(_0x473d90,null))['catch'](handleError(_0x473d90,null));};exports['addConditions']=function(_0x224f93,_0x31531d,_0x1225f8){return db[_0xf2e5('0x47')]['find']({'where':{'id':_0x224f93[_0xf2e5('0x3f')]['id']}})[_0xf2e5('0x22')](handleEntityNotFound(_0x31531d,null))[_0xf2e5('0x22')](function(_0x50086e){if(_0x50086e){return _0x50086e[_0xf2e5('0x48')](_0x224f93[_0xf2e5('0x44')]['ids'],_[_0xf2e5('0x49')](_0x224f93['body'],[_0xf2e5('0x4a'),'id'])||{});}})[_0xf2e5('0x22')](respondWithResult(_0x31531d,null))['catch'](handleError(_0x31531d,null));};exports[_0xf2e5('0x4b')]=function(_0x1af53e,_0x229c16,_0x2b51a7){var _0x4e3449={};var _0x2ba5cb={};var _0x485c9b;var _0x4926b7;return db[_0xf2e5('0x28')][_0xf2e5('0x4c')]({'where':{'id':_0x1af53e[_0xf2e5('0x3f')]['id']}})[_0xf2e5('0x22')](handleEntityNotFound(_0x229c16,null))[_0xf2e5('0x22')](function(_0x20f95b){if(_0x20f95b){_0x485c9b=_0x20f95b;_0x2ba5cb['model']=_['keys'](db['Condition'][_0xf2e5('0x29')]);_0x2ba5cb[_0xf2e5('0x2f')]=_['keys'](_0x1af53e[_0xf2e5('0x2f')]);_0x2ba5cb[_0xf2e5('0x2d')]=_[_0xf2e5('0x31')](_0x2ba5cb[_0xf2e5('0x2e')],_0x2ba5cb[_0xf2e5('0x2f')]);_0x4e3449[_0xf2e5('0x30')]=_[_0xf2e5('0x31')](_0x2ba5cb[_0xf2e5('0x2e')],qs[_0xf2e5('0x32')](_0x1af53e[_0xf2e5('0x2f')]['fields']));_0x4e3449[_0xf2e5('0x30')]=_0x4e3449['attributes'][_0xf2e5('0x33')]?_0x4e3449['attributes']:_0x2ba5cb['model'];_0x4e3449[_0xf2e5('0x4d')]=qs[_0xf2e5('0x36')](_0x1af53e['query'][_0xf2e5('0x36')]);_0x4e3449[_0xf2e5('0x37')]=qs[_0xf2e5('0x2d')](_[_0xf2e5('0x38')](_0x1af53e[_0xf2e5('0x2f')],_0x2ba5cb[_0xf2e5('0x2d')]));if(_0x1af53e[_0xf2e5('0x2f')][_0xf2e5('0x39')]){_0x4e3449['where']=_[_0xf2e5('0x3a')](_0x4e3449[_0xf2e5('0x37')],{'$or':_['map'](_0x4e3449[_0xf2e5('0x30')],function(_0xfe4a8f){var _0x5065f5={};_0x5065f5[_0xfe4a8f]={'$like':'%'+_0x1af53e['query'][_0xf2e5('0x39')]+'%'};return _0x5065f5;})});}_0x4e3449=_[_0xf2e5('0x3a')]({},_0x4e3449,_0x1af53e[_0xf2e5('0x41')]);return _0x485c9b['getConditions'](_0x4e3449);}})[_0xf2e5('0x22')](function(_0x43ade4){if(_0x43ade4){_0x4926b7=_0x43ade4['length'];if(!_0x1af53e[_0xf2e5('0x2f')][_0xf2e5('0x34')]('nolimit')){_0x4e3449[_0xf2e5('0x1b')]=qs[_0xf2e5('0x1b')](_0x1af53e[_0xf2e5('0x2f')][_0xf2e5('0x1b')]);_0x4e3449[_0xf2e5('0x19')]=qs['offset'](_0x1af53e[_0xf2e5('0x2f')]['offset']);}return _0x485c9b['getConditions'](_0x4e3449);}})[_0xf2e5('0x22')](function(_0x2ef51a){if(_0x2ef51a){return _0x2ef51a?{'count':_0x4926b7,'rows':_0x2ef51a}:null;}})[_0xf2e5('0x22')](respondWithResult(_0x229c16,null))[_0xf2e5('0x42')](handleError(_0x229c16,null));};exports[_0xf2e5('0x4e')]=function(_0x5f4f6f,_0xa372c3,_0x41ae2b){return db[_0xf2e5('0x4f')][_0xf2e5('0x45')]({'where':{'id':_0x5f4f6f['params']['id']}})[_0xf2e5('0x22')](handleEntityNotFound(_0xa372c3,null))[_0xf2e5('0x22')](function(_0x3a651e){if(_0x3a651e){return _0x3a651e[_0xf2e5('0x4e')](_0x5f4f6f[_0xf2e5('0x44')][_0xf2e5('0x4a')],_[_0xf2e5('0x49')](_0x5f4f6f[_0xf2e5('0x44')],[_0xf2e5('0x4a'),'id'])||{});}})[_0xf2e5('0x22')](respondWithResult(_0xa372c3,null))[_0xf2e5('0x42')](handleError(_0xa372c3,null));};exports[_0xf2e5('0x50')]=function(_0xc0a210,_0x5d9362,_0x2126cb){var _0xab3907={};var _0x5b5c4a={};var _0x42a105;var _0x37566a;return db['Automation']['findOne']({'where':{'id':_0xc0a210[_0xf2e5('0x3f')]['id']}})[_0xf2e5('0x22')](handleEntityNotFound(_0x5d9362,null))[_0xf2e5('0x22')](function(_0x64622d){if(_0x64622d){_0x42a105=_0x64622d;_0x5b5c4a['model']=_['keys'](db[_0xf2e5('0x4f')][_0xf2e5('0x29')]);_0x5b5c4a[_0xf2e5('0x2f')]=_[_0xf2e5('0x2c')](_0xc0a210['query']);_0x5b5c4a[_0xf2e5('0x2d')]=_['intersection'](_0x5b5c4a[_0xf2e5('0x2e')],_0x5b5c4a['query']);_0xab3907[_0xf2e5('0x30')]=_['intersection'](_0x5b5c4a[_0xf2e5('0x2e')],qs['fields'](_0xc0a210[_0xf2e5('0x2f')][_0xf2e5('0x32')]));_0xab3907[_0xf2e5('0x30')]=_0xab3907[_0xf2e5('0x30')][_0xf2e5('0x33')]?_0xab3907['attributes']:_0x5b5c4a['model'];_0xab3907[_0xf2e5('0x4d')]=qs['sort'](_0xc0a210['query'][_0xf2e5('0x36')]);_0xab3907['where']=qs[_0xf2e5('0x2d')](_[_0xf2e5('0x38')](_0xc0a210[_0xf2e5('0x2f')],_0x5b5c4a[_0xf2e5('0x2d')]));if(_0xc0a210[_0xf2e5('0x2f')][_0xf2e5('0x39')]){_0xab3907[_0xf2e5('0x37')]=_[_0xf2e5('0x3a')](_0xab3907[_0xf2e5('0x37')],{'$or':_[_0xf2e5('0x2b')](_0xab3907[_0xf2e5('0x30')],function(_0x104291){var _0x1b1e8f={};_0x1b1e8f[_0x104291]={'$like':'%'+_0xc0a210[_0xf2e5('0x2f')][_0xf2e5('0x39')]+'%'};return _0x1b1e8f;})});}_0xab3907=_[_0xf2e5('0x3a')]({},_0xab3907,_0xc0a210[_0xf2e5('0x41')]);return _0x42a105['getActions'](_0xab3907);}})[_0xf2e5('0x22')](function(_0x4d5f99){if(_0x4d5f99){_0x37566a=_0x4d5f99['length'];if(!_0xc0a210[_0xf2e5('0x2f')][_0xf2e5('0x34')](_0xf2e5('0x35'))){_0xab3907['limit']=qs['limit'](_0xc0a210[_0xf2e5('0x2f')]['limit']);_0xab3907[_0xf2e5('0x19')]=qs[_0xf2e5('0x19')](_0xc0a210[_0xf2e5('0x2f')][_0xf2e5('0x19')]);}return _0x42a105[_0xf2e5('0x50')](_0xab3907);}})[_0xf2e5('0x22')](function(_0x44896d){if(_0x44896d){return _0x44896d?{'count':_0x37566a,'rows':_0x44896d}:null;}})[_0xf2e5('0x22')](respondWithResult(_0x5d9362,null))['catch'](handleError(_0x5d9362,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 2148947..097bcd8 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 _0x332a=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x4866b5,_0x32eb3b){var _0x2d8227=function(_0x322e5){while(--_0x322e5){_0x4866b5['push'](_0x4866b5['shift']());}};_0x2d8227(++_0x32eb3b);}(_0x332a,0x197));var _0xa332=function(_0x308a4e,_0x5b6c19){_0x308a4e=_0x308a4e-0x0;var _0x7e11c4=_0x332a[_0x308a4e];return _0x7e11c4;};'use strict';var _=require(_0xa332('0x0'));var util=require(_0xa332('0x1'));var logger=require(_0xa332('0x2'))(_0xa332('0x3'));var moment=require(_0xa332('0x4'));var BPromise=require(_0xa332('0x5'));var rp=require(_0xa332('0x6'));var fs=require('fs');var path=require(_0xa332('0x7'));var rimraf=require('rimraf');var config=require(_0xa332('0x8'));var attributes=require(_0xa332('0x9'));module[_0xa332('0xa')]=function(_0x3a4a86,_0x1e48e2){return _0x3a4a86[_0xa332('0xb')](_0xa332('0xc'),attributes,{'tableName':_0xa332('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94f4=['Automation','tools_automations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x94f4,0xff));var _0x494f=function(_0x2f65e1,_0x4d7c5e){_0x2f65e1=_0x2f65e1-0x0;var _0x1eb661=_0x94f4[_0x2f65e1];return _0x1eb661;};'use strict';var _=require(_0x494f('0x0'));var util=require('util');var logger=require(_0x494f('0x1'))(_0x494f('0x2'));var moment=require(_0x494f('0x3'));var BPromise=require(_0x494f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x494f('0x5'));var rimraf=require(_0x494f('0x6'));var config=require(_0x494f('0x7'));var attributes=require(_0x494f('0x8'));module['exports']=function(_0x2745cf,_0x5aefd2){return _0x2745cf['define'](_0x494f('0x9'),attributes,{'tableName':_0x494f('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 fb607ae..08a3d1e 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 _0x0f42=['rpc','../../config/environment','jayson/promise','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x3f92ed,_0x528507){var _0x382956=function(_0xbaf0a){while(--_0xbaf0a){_0x3f92ed['push'](_0x3f92ed['shift']());}};_0x382956(++_0x528507);}(_0x0f42,0x126));var _0x20f4=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x0f42[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var moment=require(_0x20f4('0x2'));var BPromise=require(_0x20f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x5'));var logger=require('../../config/logger')(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var jayson=require(_0x20f4('0x8'));var client=jayson['client'][_0x20f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1519fe,_0x525da0,_0x45adf6){return new BPromise(function(_0x553d5d,_0x4a452d){return client['request'](_0x1519fe,_0x45adf6)[_0x20f4('0xa')](function(_0x4f3d95){logger[_0x20f4('0xb')](_0x20f4('0xc'),_0x525da0,_0x20f4('0xd'));logger[_0x20f4('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x525da0,_0x20f4('0xd'),JSON['stringify'](_0x4f3d95));if(_0x4f3d95[_0x20f4('0xf')]){if(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x10')]===0x1f4){logger[_0x20f4('0xf')]('Automation,\x20%s,\x20%s',_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x4a452d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}logger[_0x20f4('0xf')](_0x20f4('0xc'),_0x525da0,_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x553d5d(_0x4f3d95[_0x20f4('0xf')][_0x20f4('0x11')]);}else{logger[_0x20f4('0xb')]('Automation,\x20%s,\x20%s',_0x525da0,'request\x20sent');_0x553d5d(_0x4f3d95[_0x20f4('0x12')][_0x20f4('0x11')]);}})[_0x20f4('0x13')](function(_0x36fdc2){logger[_0x20f4('0xf')]('Automation,\x20%s,\x20%s',_0x525da0,_0x36fdc2);_0x4a452d(_0x36fdc2);});});}
\ No newline at end of file
+var _0x1c9a=['http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1c9a,0x98));var _0xa1c9=function(_0x558445,_0x1e7edc){_0x558445=_0x558445-0x0;var _0x3ba5fd=_0x1c9a[_0x558445];return _0x3ba5fd;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Automation,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 016bf60..5a1e8c6 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 _0x8ff3=['addConditions','addActions','update','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create'];(function(_0x54a77a,_0x4c7764){var _0x2aa5b8=function(_0x47e4cd){while(--_0x47e4cd){_0x54a77a['push'](_0x54a77a['shift']());}};_0x2aa5b8(++_0x4c7764);}(_0x8ff3,0x1bb));var _0x38ff=function(_0x120564,_0x3c18cf){_0x120564=_0x120564-0x0;var _0x579980=_0x8ff3[_0x120564];return _0x579980;};'use strict';var multer=require('multer');var util=require(_0x38ff('0x0'));var path=require('path');var timeout=require(_0x38ff('0x1'));var express=require(_0x38ff('0x2'));var router=express[_0x38ff('0x3')]();var fs_extra=require(_0x38ff('0x4'));var auth=require(_0x38ff('0x5'));var interaction=require(_0x38ff('0x6'));var config=require(_0x38ff('0x7'));var controller=require('./automation.controller');router[_0x38ff('0x8')]('/',auth[_0x38ff('0x9')](),controller[_0x38ff('0xa')]);router[_0x38ff('0x8')](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller[_0x38ff('0xc')]);router[_0x38ff('0x8')](_0x38ff('0xd'),auth[_0x38ff('0x9')](),controller[_0x38ff('0xe')]);router[_0x38ff('0x8')](_0x38ff('0xf'),auth['isAuthenticated'](),controller[_0x38ff('0x10')]);router[_0x38ff('0x11')]('/',auth[_0x38ff('0x9')](),controller[_0x38ff('0x12')]);router['post'](_0x38ff('0xd'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x13')]);router[_0x38ff('0x11')](_0x38ff('0xf'),auth['isAuthenticated'](),controller[_0x38ff('0x14')]);router['put'](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x15')]);router['delete'](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6263=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/conditions','/:id/actions','post','create','addConditions','addActions'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x6263,0x19d));var _0x3626=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x6263[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x3626('0x0'));var util=require(_0x3626('0x1'));var path=require(_0x3626('0x2'));var timeout=require(_0x3626('0x3'));var express=require(_0x3626('0x4'));var router=express['Router']();var fs_extra=require(_0x3626('0x5'));var auth=require(_0x3626('0x6'));var interaction=require(_0x3626('0x7'));var config=require(_0x3626('0x8'));var controller=require('./automation.controller');router[_0x3626('0x9')]('/',auth['isAuthenticated'](),controller[_0x3626('0xa')]);router[_0x3626('0x9')]('/:id',auth[_0x3626('0xb')](),controller[_0x3626('0xc')]);router['get'](_0x3626('0xd'),auth[_0x3626('0xb')](),controller['getConditions']);router['get'](_0x3626('0xe'),auth[_0x3626('0xb')](),controller['getActions']);router[_0x3626('0xf')]('/',auth[_0x3626('0xb')](),controller[_0x3626('0x10')]);router[_0x3626('0xf')](_0x3626('0xd'),auth['isAuthenticated'](),controller[_0x3626('0x11')]);router[_0x3626('0xf')]('/:id/actions',auth[_0x3626('0xb')](),controller[_0x3626('0x12')]);router[_0x3626('0x13')](_0x3626('0x14'),auth[_0x3626('0xb')](),controller[_0x3626('0x15')]);router[_0x3626('0x16')](_0x3626('0x14'),auth[_0x3626('0xb')](),controller[_0x3626('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e791302..33419ee 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 _0x3c5f=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x3c5f,0x149));var _0xf3c5=function(_0x33cc84,_0x28f87a){_0x33cc84=_0x33cc84-0x0;var _0x158557=_0x3c5f[_0x33cc84];return _0x158557;};'use strict';var Sequelize=require('sequelize');module[_0xf3c5('0x0')]={'name':{'type':Sequelize[_0xf3c5('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf3c5('0x2')](_0xf3c5('0x3')),'allowNull':![],'defaultValue':_0xf3c5('0x3')},'description':{'type':Sequelize[_0xf3c5('0x1')]},'active':{'type':Sequelize[_0xf3c5('0x4')],'defaultValue':0x0,'comment':_0xf3c5('0x5')},'limitCalls':{'type':Sequelize[_0xf3c5('0x6')](0x4)[_0xf3c5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf3c5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf3c5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf3c5('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf3c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3c5('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3c5('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf3c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3c5('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3c5('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3c5('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf3c5('0xe')},'dialTimezone':{'type':Sequelize[_0xf3c5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf3c5('0x1')],'defaultValue':_0xf3c5('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xf3c5('0x2')](_0xf3c5('0x10'),_0xf3c5('0x11'),_0xf3c5('0x12')),'defaultValue':_0xf3c5('0x10')},'dialAMDActive':{'type':Sequelize[_0xf3c5('0x4')],'defaultValue':0x0,'comment':_0xf3c5('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xf3c5('0x6')](0x9)[_0xf3c5('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf3c5('0x6')](0x9)[_0xf3c5('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf3c5('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf3c5('0x6')](0x9)[_0xf3c5('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf3c5('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf3c5('0x6')](0x9)[_0xf3c5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xf3c5('0x6')](0x9)[_0xf3c5('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf3c5('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf3c5('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf3c5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf3c5('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf3c5('0x6')](0x9)[_0xf3c5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf3c5('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf3c5('0x1a'),_0xf3c5('0x1b')),'defaultValue':_0xf3c5('0x1a')},'dialPrefix':{'type':Sequelize[_0xf3c5('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf3c5('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xf3c5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf3c5('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3c5('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3c5('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3c5('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3c5('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3c5('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3c5('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xf3c5('0x6')](0x3)[_0xf3c5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3c5('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf3c5('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf3c5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf3c5('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf3c5('0x6')](0x5)[_0xf3c5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xb671=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ENUM','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x5dbf45,_0xe16a35){var _0x12bb46=function(_0x9e80b4){while(--_0x9e80b4){_0x5dbf45['push'](_0x5dbf45['shift']());}};_0x12bb46(++_0xe16a35);}(_0xb671,0xcf));var _0x1b67=function(_0x1f88a6,_0x3b249c){_0x1f88a6=_0x1f88a6-0x0;var _0x548341=_0xb671[_0x1f88a6];return _0x548341;};'use strict';var Sequelize=require(_0x1b67('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b67('0x1')],'unique':_0x1b67('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1b67('0x3')),'allowNull':![],'defaultValue':_0x1b67('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1b67('0x4')},'limitCalls':{'type':Sequelize[_0x1b67('0x5')](0x4)[_0x1b67('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1b67('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1b67('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1b67('0x5')](0x3)[_0x1b67('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b67('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1b67('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b67('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1b67('0x5')](0x5)[_0x1b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1b67('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b67('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1b67('0x5')](0x5)[_0x1b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b67('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1b67('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1b67('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1b67('0x5')](0x5)[_0x1b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b67('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1b67('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1b67('0xe')},'dialTimezone':{'type':Sequelize[_0x1b67('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1b67('0x1')],'defaultValue':_0x1b67('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1b67('0x10'),'never',_0x1b67('0x11')),'defaultValue':_0x1b67('0x10')},'dialAMDActive':{'type':Sequelize[_0x1b67('0x12')],'defaultValue':0x0,'comment':_0x1b67('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x1b67('0x5')](0x9)[_0x1b67('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1b67('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x1b67('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1b67('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1b67('0x5')](0x9)[_0x1b67('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1b67('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1b67('0x5')](0x9)[_0x1b67('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b67('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1b67('0x5')](0x9)[_0x1b67('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1b67('0x5')](0x9)[_0x1b67('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1b67('0x5')](0x9)[_0x1b67('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1b67('0x5')](0x5)[_0x1b67('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1b67('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1b67('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x1b67('0x19')](_0x1b67('0x1a'),_0x1b67('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1b67('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1b67('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1b67('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b67('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1b67('0x5')](0x5)[_0x1b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b67('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b67('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1b67('0x5')](0x3)[_0x1b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b67('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1b67('0x5')](0x5)[_0x1b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b67('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x1b67('0x5')](0x3)[_0x1b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1b67('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b67('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1b67('0x5')](0x5)[_0x1b67('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 8b9ed69..70b9551 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 _0xe31d=['key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','options','count','includeAll','include','findAll','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','body','updatedAt','getHoppers','CmHopper','order','pick','CampaignId','rows','getHopperHistories','CmHopperHistory','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','fromQuery','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','update','destroy','then','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type'];(function(_0x293e93,_0x229ae2){var _0x20beae=function(_0xb5c068){while(--_0xb5c068){_0x293e93['push'](_0x293e93['shift']());}};_0x20beae(++_0x229ae2);}(_0xe31d,0x1ec));var _0xde31=function(_0x3686d2,_0x36e278){_0x3686d2=_0x3686d2-0x0;var _0xa23b78=_0xe31d[_0x3686d2];return _0xa23b78;};'use strict';var emlformat=require(_0xde31('0x0'));var rimraf=require(_0xde31('0x1'));var zipdir=require(_0xde31('0x2'));var jsonpatch=require(_0xde31('0x3'));var rp=require(_0xde31('0x4'));var moment=require(_0xde31('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xde31('0x6'));var util=require('util');var path=require(_0xde31('0x7'));var sox=require(_0xde31('0x8'));var csv=require(_0xde31('0x9'));var ejs=require(_0xde31('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde31('0xb'));var squel=require(_0xde31('0xc'));var crypto=require(_0xde31('0xd'));var jsforce=require(_0xde31('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xde31('0x9'));var querystring=require(_0xde31('0xf'));var Papa=require('papaparse');var Redis=require(_0xde31('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xde31('0x11'));var as=require(_0xde31('0x12'));var hardwareService=require(_0xde31('0x13'));var logger=require(_0xde31('0x14'))(_0xde31('0x15'));var utils=require(_0xde31('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xde31('0x17'));var db=require(_0xde31('0x18'))['db'];function respondWithStatusCode(_0x1070c6,_0x36bb9f){_0x36bb9f=_0x36bb9f||0xcc;return function(_0x475faa){if(_0x475faa){return _0x1070c6['sendStatus'](_0x36bb9f);}return _0x1070c6[_0xde31('0x19')](_0x36bb9f)[_0xde31('0x1a')]();};}function respondWithResult(_0x393176,_0x425695){_0x425695=_0x425695||0xc8;return function(_0x254000){if(_0x254000){return _0x393176[_0xde31('0x19')](_0x425695)[_0xde31('0x1b')](_0x254000);}};}function respondWithFilteredResult(_0x5e6275,_0x475301){return function(_0x4e3a5b){if(_0x4e3a5b){var _0x124117=typeof _0x475301[_0xde31('0x1c')]==='undefined'&&typeof _0x475301[_0xde31('0x1d')]==='undefined';var _0x1e3333=_0x4e3a5b['count'];var _0x4ad04c=_0x124117?0x0:_0x475301[_0xde31('0x1c')];var _0x4f01c8=_0x124117?_0x4e3a5b['count']:_0x475301[_0xde31('0x1c')]+_0x475301[_0xde31('0x1d')];var _0x6e8c71;if(_0x4f01c8>=_0x1e3333){_0x4f01c8=_0x1e3333;_0x6e8c71=0xc8;}else{_0x6e8c71=0xce;}_0x5e6275['status'](_0x6e8c71);return _0x5e6275[_0xde31('0x1e')](_0xde31('0x1f'),_0x4ad04c+'-'+_0x4f01c8+'/'+_0x1e3333)['json'](_0x4e3a5b);}return null;};}function patchUpdates(_0x264075){return function(_0xe606f){try{jsonpatch[_0xde31('0x20')](_0xe606f,_0x264075,!![]);}catch(_0x1c940f){return BPromise['reject'](_0x1c940f);}return _0xe606f['save']();};}function saveUpdates(_0x231a2e,_0x61b009){return function(_0x4406e8){if(_0x4406e8){return _0x4406e8[_0xde31('0x21')](_0x231a2e)['then'](function(_0x3f0217){return _0x3f0217;});}return null;};}function removeEntity(_0xe279dd,_0x53d1ab){return function(_0x10bc8b){if(_0x10bc8b){return _0x10bc8b[_0xde31('0x22')]()[_0xde31('0x23')](function(){var _0x50801d=_0x10bc8b['get']({'plain':!![]});var _0x4727c8=_0xde31('0x24');return db[_0xde31('0x25')][_0xde31('0x22')]({'where':{'type':_0x4727c8,'resourceId':_0x50801d['id']}})[_0xde31('0x23')](function(){return _0x10bc8b;});})[_0xde31('0x23')](function(){_0xe279dd[_0xde31('0x19')](0xcc)[_0xde31('0x1a')]();});}};}function handleEntityNotFound(_0x28508a,_0x37364a){return function(_0x24124b){if(!_0x24124b){_0x28508a[_0xde31('0x26')](0x194);}return _0x24124b;};}function handleError(_0x10609c,_0x325c74){_0x325c74=_0x325c74||0x1f4;return function(_0x3d7bd1){logger[_0xde31('0x27')](_0x3d7bd1[_0xde31('0x28')]);if(_0x3d7bd1[_0xde31('0x29')]){delete _0x3d7bd1[_0xde31('0x29')];}_0x10609c[_0xde31('0x19')](_0x325c74)[_0xde31('0x2a')](_0x3d7bd1);};}exports['index']=function(_0x5a3439,_0x15e758){var _0x56c30a={},_0x4adc61={},_0x5cf30a={'count':0x0,'rows':[]};var _0x40707b=_[_0xde31('0x2b')](db[_0xde31('0x2c')][_0xde31('0x2d')],function(_0x1836f7){return{'name':_0x1836f7[_0xde31('0x2e')],'type':_0x1836f7[_0xde31('0x2f')][_0xde31('0x30')]};});_0x4adc61[_0xde31('0x31')]=_['map'](_0x40707b,_0xde31('0x29'));_0x4adc61['query']=_[_0xde31('0x32')](_0x5a3439[_0xde31('0x33')]);_0x4adc61[_0xde31('0x34')]=_[_0xde31('0x35')](_0x4adc61[_0xde31('0x31')],_0x4adc61['query']);_0x56c30a['attributes']=_[_0xde31('0x35')](_0x4adc61[_0xde31('0x31')],qs[_0xde31('0x36')](_0x5a3439[_0xde31('0x33')][_0xde31('0x36')]));_0x56c30a['attributes']=_0x56c30a[_0xde31('0x37')]['length']?_0x56c30a[_0xde31('0x37')]:_0x4adc61[_0xde31('0x31')];if(!_0x5a3439[_0xde31('0x33')][_0xde31('0x38')](_0xde31('0x39'))){_0x56c30a[_0xde31('0x1d')]=qs['limit'](_0x5a3439[_0xde31('0x33')][_0xde31('0x1d')]);_0x56c30a[_0xde31('0x1c')]=qs[_0xde31('0x1c')](_0x5a3439['query'][_0xde31('0x1c')]);}_0x56c30a['order']=qs[_0xde31('0x3a')](_0x5a3439[_0xde31('0x33')][_0xde31('0x3a')]);_0x56c30a['where']=qs['filters'](_['pick'](_0x5a3439[_0xde31('0x33')],_0x4adc61['filters']),_0x40707b);if(_0x5a3439[_0xde31('0x33')][_0xde31('0x3b')]){_0x56c30a[_0xde31('0x3c')]=_[_0xde31('0x3d')](_0x56c30a[_0xde31('0x3c')],{'$or':_[_0xde31('0x2b')](_0x40707b,function(_0x4c511d){if(_0x4c511d[_0xde31('0x2f')]!=='VIRTUAL'){var _0x418072={};_0x418072[_0x4c511d[_0xde31('0x29')]]={'$like':'%'+_0x5a3439[_0xde31('0x33')][_0xde31('0x3b')]+'%'};return _0x418072;}})});}_0x56c30a=_['merge']({},_0x56c30a,_0x5a3439[_0xde31('0x3e')]);var _0x4ed1e1={'where':_0x56c30a[_0xde31('0x3c')]};return db[_0xde31('0x2c')][_0xde31('0x3f')](_0x4ed1e1)[_0xde31('0x23')](function(_0x1ba03c){_0x5cf30a[_0xde31('0x3f')]=_0x1ba03c;if(_0x5a3439[_0xde31('0x33')][_0xde31('0x40')]){_0x56c30a[_0xde31('0x41')]=[{'all':!![]}];}return db[_0xde31('0x2c')][_0xde31('0x42')](_0x56c30a);})[_0xde31('0x23')](function(_0x2e2b12){_0x5cf30a['rows']=_0x2e2b12;return _0x5cf30a;})[_0xde31('0x23')](respondWithFilteredResult(_0x15e758,_0x56c30a))[_0xde31('0x43')](handleError(_0x15e758,null));};exports[_0xde31('0x44')]=function(_0x478d10,_0x3a968f){var _0x57fd81={'raw':![],'where':{'id':_0x478d10[_0xde31('0x45')]['id']}},_0x1313bd={};_0x1313bd[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x2c')][_0xde31('0x2d')]);_0x1313bd['query']=_[_0xde31('0x32')](_0x478d10[_0xde31('0x33')]);_0x1313bd[_0xde31('0x34')]=_[_0xde31('0x35')](_0x1313bd['model'],_0x1313bd[_0xde31('0x33')]);_0x57fd81['attributes']=_[_0xde31('0x35')](_0x1313bd['model'],qs[_0xde31('0x36')](_0x478d10[_0xde31('0x33')]['fields']));_0x57fd81['attributes']=_0x57fd81[_0xde31('0x37')]['length']?_0x57fd81[_0xde31('0x37')]:_0x1313bd[_0xde31('0x31')];if(_0x478d10['query'][_0xde31('0x40')]){_0x57fd81[_0xde31('0x41')]=[{'all':!![]}];}_0x57fd81=_[_0xde31('0x3d')]({},_0x57fd81,_0x478d10['options']);return db['Campaign'][_0xde31('0x46')](_0x57fd81)[_0xde31('0x23')](handleEntityNotFound(_0x3a968f,null))[_0xde31('0x23')](respondWithResult(_0x3a968f,null))['catch'](handleError(_0x3a968f,null));};exports[_0xde31('0x47')]=function(_0x2db225,_0x3f46d9){return db[_0xde31('0x2c')][_0xde31('0x47')](_0x2db225['body'],{})[_0xde31('0x23')](function(_0x3e39fa){var _0x588c2c=_0x2db225[_0xde31('0x48')][_0xde31('0x49')]({'plain':!![]});if(!_0x588c2c)throw new Error(_0xde31('0x4a'));if(_0x588c2c['role']==='user'){var _0x6d3a98=_0x3e39fa['get']({'plain':!![]});var _0x27cc88=_0xde31('0x24');return db['UserProfileSection'][_0xde31('0x46')]({'where':{'name':_0x27cc88,'userProfileId':_0x588c2c[_0xde31('0x4b')]},'raw':!![]})[_0xde31('0x23')](function(_0xb3af14){if(_0xb3af14&&_0xb3af14[_0xde31('0x4c')]===0x0){return db[_0xde31('0x25')][_0xde31('0x47')]({'name':_0x6d3a98['name'],'resourceId':_0x6d3a98['id'],'type':_0xb3af14[_0xde31('0x29')],'sectionId':_0xb3af14['id']},{})[_0xde31('0x23')](function(){return _0x3e39fa;});}else{return _0x3e39fa;}})['catch'](function(_0x40554a){logger[_0xde31('0x27')](_0xde31('0x4d'),_0x40554a);throw _0x40554a;});}return _0x3e39fa;})[_0xde31('0x23')](respondWithResult(_0x3f46d9,0xc9))[_0xde31('0x43')](handleError(_0x3f46d9,null));};exports[_0xde31('0x4e')]=function(_0x3a696f,_0x52b23b){var _0x176770={'where':{'id':_0x3a696f[_0xde31('0x45')]['id']}},_0x2286a9={};_0x2286a9[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x2c')][_0xde31('0x2d')]);_0x176770[_0xde31('0x37')]=_['intersection'](_0x2286a9[_0xde31('0x31')],qs[_0xde31('0x36')](_0x3a696f[_0xde31('0x33')]['fields']));_0x176770[_0xde31('0x37')]=_0x176770[_0xde31('0x37')][_0xde31('0x4f')]?_0x176770[_0xde31('0x37')]:_0x2286a9[_0xde31('0x31')];if(_0x3a696f['query']['includeAll']){_0x176770[_0xde31('0x41')]=[{'all':!![]}];}_0x176770=_['merge']({},_0x176770,_0x3a696f[_0xde31('0x3e')]);return db[_0xde31('0x2c')][_0xde31('0x46')](_0x176770)[_0xde31('0x23')](handleEntityNotFound(_0x52b23b,null))[_0xde31('0x23')](function(_0x21255b){if(_0x21255b){var _0x24cc49=_0x21255b['get']({'plain':!![]});_0x24cc49=qs[_0xde31('0x50')](_0x24cc49,['id',_0xde31('0x51'),'updatedAt']);_0x3a696f[_0xde31('0x52')]=_[_0xde31('0x50')](_0x3a696f[_0xde31('0x52')],['id',_0xde31('0x51'),_0xde31('0x53')]);return db[_0xde31('0x2c')][_0xde31('0x47')](_[_0xde31('0x3d')](_0x24cc49,_0x3a696f[_0xde31('0x52')]),{'include':_0x3a696f['query'][_0xde31('0x40')]?[{'all':!![]}]:undefined})[_0xde31('0x23')](function(_0x582f93){var _0x3420b5=_0x3a696f['user'][_0xde31('0x49')]({'plain':!![]});if(!_0x3420b5)throw new Error(_0xde31('0x4a'));if(_0x3420b5['role']==='user'){var _0x1cf082=_0x582f93['get']({'plain':!![]});var _0x3132fa=_0xde31('0x24');return db['UserProfileSection'][_0xde31('0x46')]({'where':{'name':_0x3132fa,'userProfileId':_0x3420b5[_0xde31('0x4b')]},'raw':!![]})[_0xde31('0x23')](function(_0x5bdd73){if(_0x5bdd73&&_0x5bdd73[_0xde31('0x4c')]===0x0){return db[_0xde31('0x25')]['create']({'name':_0x1cf082[_0xde31('0x29')],'resourceId':_0x1cf082['id'],'type':_0x5bdd73['name'],'sectionId':_0x5bdd73['id']},{})[_0xde31('0x23')](function(){return _0x582f93;});}else{return _0x582f93;}})['catch'](function(_0x35807e){logger[_0xde31('0x27')](_0xde31('0x4d'),_0x35807e);throw _0x35807e;});}return _0x582f93;});}})[_0xde31('0x23')](respondWithResult(_0x52b23b,0xc9))[_0xde31('0x43')](handleError(_0x52b23b,null));};exports[_0xde31('0x21')]=function(_0x42470c,_0x539edb){if(_0x42470c[_0xde31('0x52')]['id']){delete _0x42470c[_0xde31('0x52')]['id'];}return db[_0xde31('0x2c')][_0xde31('0x46')]({'where':{'id':_0x42470c['params']['id']}})['then'](handleEntityNotFound(_0x539edb,null))[_0xde31('0x23')](saveUpdates(_0x42470c['body'],null))['then'](respondWithResult(_0x539edb,null))['catch'](handleError(_0x539edb,null));};exports[_0xde31('0x22')]=function(_0x47f8d4,_0x82ff3f){return db['Campaign']['find']({'where':{'id':_0x47f8d4[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x82ff3f,null))[_0xde31('0x23')](removeEntity(_0x82ff3f,null))[_0xde31('0x43')](handleError(_0x82ff3f,null));};exports[_0xde31('0x54')]=function(_0x5d4782,_0x24067b,_0x3f42a8){var _0x4350a5={'raw':!![],'where':{}};var _0x535069={};var _0x4fe16d={'count':0x0,'rows':[]};return db[_0xde31('0x2c')]['findOne']({'where':{'id':_0x5d4782[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x24067b,null))['then'](function(_0x24ada5){if(_0x24ada5){_0x535069[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x55')][_0xde31('0x2d')]);_0x535069[_0xde31('0x33')]=_[_0xde31('0x32')](_0x5d4782[_0xde31('0x33')]);_0x535069['filters']=_[_0xde31('0x35')](_0x535069[_0xde31('0x31')],_0x535069['query']);_0x4350a5['attributes']=_[_0xde31('0x35')](_0x535069[_0xde31('0x31')],qs[_0xde31('0x36')](_0x5d4782[_0xde31('0x33')]['fields']));_0x4350a5['attributes']=_0x4350a5[_0xde31('0x37')][_0xde31('0x4f')]?_0x4350a5['attributes']:_0x535069[_0xde31('0x31')];if(!_0x5d4782['query']['hasOwnProperty'](_0xde31('0x39'))){_0x4350a5[_0xde31('0x1d')]=qs['limit'](_0x5d4782[_0xde31('0x33')]['limit']);_0x4350a5[_0xde31('0x1c')]=qs[_0xde31('0x1c')](_0x5d4782['query']['offset']);}_0x4350a5[_0xde31('0x56')]=qs['sort'](_0x5d4782[_0xde31('0x33')][_0xde31('0x3a')]);_0x4350a5['where']=qs[_0xde31('0x34')](_[_0xde31('0x57')](_0x5d4782[_0xde31('0x33')],_0x535069[_0xde31('0x34')]));_0x4350a5[_0xde31('0x3c')][_0xde31('0x58')]=_0x24ada5['id'];if(_0x5d4782[_0xde31('0x33')][_0xde31('0x3b')]){_0x4350a5['where']=_[_0xde31('0x3d')](_0x4350a5[_0xde31('0x3c')],{'$or':_[_0xde31('0x2b')](_0x4350a5['attributes'],function(_0x4269a2){var _0x260952={};_0x260952[_0x4269a2]={'$like':'%'+_0x5d4782[_0xde31('0x33')][_0xde31('0x3b')]+'%'};return _0x260952;})});}_0x4350a5=_[_0xde31('0x3d')]({},_0x4350a5,_0x5d4782['options']);return db[_0xde31('0x55')][_0xde31('0x3f')]({'where':_0x4350a5['where']})['then'](function(_0x4a355a){_0x4fe16d['count']=_0x4a355a;if(_0x5d4782[_0xde31('0x33')]['includeAll']){_0x4350a5[_0xde31('0x41')]=[{'all':!![]}];}return db['CmHopper'][_0xde31('0x42')](_0x4350a5);})[_0xde31('0x23')](function(_0x39c959){_0x4fe16d[_0xde31('0x59')]=_0x39c959;return _0x4fe16d;});}})[_0xde31('0x23')](respondWithFilteredResult(_0x24067b,_0x4350a5))[_0xde31('0x43')](handleError(_0x24067b,null));};exports[_0xde31('0x5a')]=function(_0x3888e4,_0x404a09,_0x2bd2b9){var _0x351c54={'raw':!![],'where':{}};var _0x912502={};var _0x5a2219={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3888e4['params']['id']}})['then'](handleEntityNotFound(_0x404a09,null))['then'](function(_0x3877f8){if(_0x3877f8){_0x912502[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x5b')][_0xde31('0x2d')]);_0x912502['query']=_[_0xde31('0x32')](_0x3888e4[_0xde31('0x33')]);_0x912502[_0xde31('0x34')]=_[_0xde31('0x35')](_0x912502['model'],_0x912502['query']);_0x351c54[_0xde31('0x37')]=_[_0xde31('0x35')](_0x912502['model'],qs[_0xde31('0x36')](_0x3888e4[_0xde31('0x33')][_0xde31('0x36')]));_0x351c54['attributes']=_0x351c54[_0xde31('0x37')][_0xde31('0x4f')]?_0x351c54[_0xde31('0x37')]:_0x912502[_0xde31('0x31')];if(!_0x3888e4['query'][_0xde31('0x38')](_0xde31('0x39'))){_0x351c54['limit']=qs['limit'](_0x3888e4['query']['limit']);_0x351c54['offset']=qs[_0xde31('0x1c')](_0x3888e4[_0xde31('0x33')][_0xde31('0x1c')]);}_0x351c54['order']=qs['sort'](_0x3888e4[_0xde31('0x33')][_0xde31('0x3a')]);_0x351c54[_0xde31('0x3c')]=qs[_0xde31('0x34')](_['pick'](_0x3888e4['query'],_0x912502[_0xde31('0x34')]));_0x351c54[_0xde31('0x3c')]['CampaignId']=_0x3877f8['id'];if(_0x3888e4[_0xde31('0x33')][_0xde31('0x3b')]){_0x351c54[_0xde31('0x3c')]=_[_0xde31('0x3d')](_0x351c54[_0xde31('0x3c')],{'$or':_[_0xde31('0x2b')](_0x351c54[_0xde31('0x37')],function(_0x3ec197){var _0x20a5aa={};_0x20a5aa[_0x3ec197]={'$like':'%'+_0x3888e4[_0xde31('0x33')][_0xde31('0x3b')]+'%'};return _0x20a5aa;})});}_0x351c54=_[_0xde31('0x3d')]({},_0x351c54,_0x3888e4[_0xde31('0x3e')]);return db['CmHopperHistory']['count']({'where':_0x351c54['where']})[_0xde31('0x23')](function(_0x588874){_0x5a2219[_0xde31('0x3f')]=_0x588874;if(_0x3888e4['query'][_0xde31('0x40')]){_0x351c54[_0xde31('0x41')]=[{'all':!![]}];}return db[_0xde31('0x5b')][_0xde31('0x42')](_0x351c54);})[_0xde31('0x23')](function(_0x10440b){_0x5a2219[_0xde31('0x59')]=_0x10440b;return _0x5a2219;});}})[_0xde31('0x23')](respondWithFilteredResult(_0x404a09,_0x351c54))[_0xde31('0x43')](handleError(_0x404a09,null));};exports['getHopperFinals']=function(_0x36948f,_0x444392,_0x8b41ac){var _0x512c9b={'raw':!![],'where':{}};var _0xd281a={};var _0x4f04bf={'count':0x0,'rows':[]};return db[_0xde31('0x2c')][_0xde31('0x5c')]({'where':{'id':_0x36948f['params']['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x444392,null))[_0xde31('0x23')](function(_0x5bb24e){if(_0x5bb24e){_0xd281a[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x5d')]['rawAttributes']);_0xd281a[_0xde31('0x33')]=_[_0xde31('0x32')](_0x36948f[_0xde31('0x33')]);_0xd281a['filters']=_[_0xde31('0x35')](_0xd281a[_0xde31('0x31')],_0xd281a[_0xde31('0x33')]);_0x512c9b[_0xde31('0x37')]=_[_0xde31('0x35')](_0xd281a['model'],qs[_0xde31('0x36')](_0x36948f[_0xde31('0x33')][_0xde31('0x36')]));_0x512c9b[_0xde31('0x37')]=_0x512c9b[_0xde31('0x37')][_0xde31('0x4f')]?_0x512c9b[_0xde31('0x37')]:_0xd281a['model'];if(!_0x36948f['query'][_0xde31('0x38')]('nolimit')){_0x512c9b[_0xde31('0x1d')]=qs['limit'](_0x36948f[_0xde31('0x33')][_0xde31('0x1d')]);_0x512c9b[_0xde31('0x1c')]=qs['offset'](_0x36948f['query']['offset']);}_0x512c9b[_0xde31('0x56')]=qs['sort'](_0x36948f['query']['sort']);_0x512c9b[_0xde31('0x3c')]=qs[_0xde31('0x34')](_['pick'](_0x36948f[_0xde31('0x33')],_0xd281a[_0xde31('0x34')]));_0x512c9b[_0xde31('0x3c')][_0xde31('0x58')]=_0x5bb24e['id'];if(_0x36948f['query']['filter']){_0x512c9b[_0xde31('0x3c')]=_[_0xde31('0x3d')](_0x512c9b['where'],{'$or':_[_0xde31('0x2b')](_0x512c9b[_0xde31('0x37')],function(_0xaaec44){var _0x1b4029={};_0x1b4029[_0xaaec44]={'$like':'%'+_0x36948f[_0xde31('0x33')][_0xde31('0x3b')]+'%'};return _0x1b4029;})});}_0x512c9b=_[_0xde31('0x3d')]({},_0x512c9b,_0x36948f[_0xde31('0x3e')]);return db[_0xde31('0x5d')][_0xde31('0x3f')]({'where':_0x512c9b[_0xde31('0x3c')]})[_0xde31('0x23')](function(_0x3000b1){_0x4f04bf['count']=_0x3000b1;if(_0x36948f[_0xde31('0x33')][_0xde31('0x40')]){_0x512c9b['include']=[{'all':!![]}];}return db[_0xde31('0x5d')]['findAll'](_0x512c9b);})[_0xde31('0x23')](function(_0x44ff63){_0x4f04bf[_0xde31('0x59')]=_0x44ff63;return _0x4f04bf;});}})[_0xde31('0x23')](respondWithFilteredResult(_0x444392,_0x512c9b))[_0xde31('0x43')](handleError(_0x444392,null));};exports[_0xde31('0x5e')]=function(_0xc2fe45,_0x5e306a,_0x645948){var _0x1b466b={'raw':!![],'where':{}};var _0x374df0={};var _0x2c8d16={'count':0x0,'rows':[]};return db['Campaign'][_0xde31('0x5c')]({'where':{'id':_0xc2fe45[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x5e306a,null))[_0xde31('0x23')](function(_0x484f39){if(_0x484f39){_0x374df0[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x5f')][_0xde31('0x2d')]);_0x374df0[_0xde31('0x33')]=_[_0xde31('0x32')](_0xc2fe45[_0xde31('0x33')]);_0x374df0[_0xde31('0x34')]=_[_0xde31('0x35')](_0x374df0['model'],_0x374df0[_0xde31('0x33')]);_0x1b466b[_0xde31('0x37')]=_['intersection'](_0x374df0[_0xde31('0x31')],qs[_0xde31('0x36')](_0xc2fe45['query'][_0xde31('0x36')]));_0x1b466b[_0xde31('0x37')]=_0x1b466b['attributes'][_0xde31('0x4f')]?_0x1b466b[_0xde31('0x37')]:_0x374df0[_0xde31('0x31')];if(!_0xc2fe45[_0xde31('0x33')][_0xde31('0x38')](_0xde31('0x39'))){_0x1b466b[_0xde31('0x1d')]=qs[_0xde31('0x1d')](_0xc2fe45[_0xde31('0x33')][_0xde31('0x1d')]);_0x1b466b[_0xde31('0x1c')]=qs[_0xde31('0x1c')](_0xc2fe45['query'][_0xde31('0x1c')]);}_0x1b466b[_0xde31('0x56')]=qs[_0xde31('0x3a')](_0xc2fe45['query'][_0xde31('0x3a')]);_0x1b466b['where']=qs[_0xde31('0x34')](_['pick'](_0xc2fe45[_0xde31('0x33')],_0x374df0[_0xde31('0x34')]));_0x1b466b[_0xde31('0x3c')][_0xde31('0x58')]=_0x484f39['id'];if(_0xc2fe45[_0xde31('0x33')][_0xde31('0x3b')]){_0x1b466b[_0xde31('0x3c')]=_[_0xde31('0x3d')](_0x1b466b[_0xde31('0x3c')],{'$or':_[_0xde31('0x2b')](_0x1b466b[_0xde31('0x37')],function(_0x5dc390){var _0x361b15={};_0x361b15[_0x5dc390]={'$like':'%'+_0xc2fe45[_0xde31('0x33')][_0xde31('0x3b')]+'%'};return _0x361b15;})});}_0x1b466b=_[_0xde31('0x3d')]({},_0x1b466b,_0xc2fe45[_0xde31('0x3e')]);return db[_0xde31('0x5f')][_0xde31('0x3f')]({'where':_0x1b466b['where']})[_0xde31('0x23')](function(_0x5921ad){_0x2c8d16[_0xde31('0x3f')]=_0x5921ad;if(_0xc2fe45['query'][_0xde31('0x40')]){_0x1b466b[_0xde31('0x41')]=[{'all':!![]}];}return db[_0xde31('0x5f')][_0xde31('0x42')](_0x1b466b);})['then'](function(_0x4e4202){_0x2c8d16['rows']=_0x4e4202;return _0x2c8d16;});}})[_0xde31('0x23')](respondWithFilteredResult(_0x5e306a,_0x1b466b))[_0xde31('0x43')](handleError(_0x5e306a,null));};exports[_0xde31('0x60')]=function(_0x123b90,_0x4db812,_0x3a6b52){var _0x384bc9={};var _0x2f4190={};var _0x43625f;var _0x369552;return db[_0xde31('0x2c')][_0xde31('0x5c')]({'where':{'id':_0x123b90[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x4db812,null))[_0xde31('0x23')](function(_0x4618e5){if(_0x4618e5){_0x43625f=_0x4618e5;_0x2f4190[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x61')][_0xde31('0x2d')]);_0x2f4190['query']=_[_0xde31('0x32')](_0x123b90[_0xde31('0x33')]);_0x2f4190[_0xde31('0x34')]=_[_0xde31('0x35')](_0x2f4190[_0xde31('0x31')],_0x2f4190[_0xde31('0x33')]);_0x384bc9[_0xde31('0x37')]=_['intersection'](_0x2f4190[_0xde31('0x31')],qs[_0xde31('0x36')](_0x123b90['query'][_0xde31('0x36')]));_0x384bc9[_0xde31('0x37')]=_0x384bc9[_0xde31('0x37')]['length']?_0x384bc9[_0xde31('0x37')]:_0x2f4190[_0xde31('0x31')];_0x384bc9[_0xde31('0x56')]=qs['sort'](_0x123b90[_0xde31('0x33')]['sort']);_0x384bc9[_0xde31('0x3c')]=qs['filters'](_[_0xde31('0x57')](_0x123b90[_0xde31('0x33')],_0x2f4190[_0xde31('0x34')]));if(_0x123b90['query'][_0xde31('0x3b')]){_0x384bc9[_0xde31('0x3c')]=_['merge'](_0x384bc9[_0xde31('0x3c')],{'$or':_[_0xde31('0x2b')](_0x384bc9['attributes'],function(_0x4b748a){var _0x36f0c1={};_0x36f0c1[_0x4b748a]={'$like':'%'+_0x123b90[_0xde31('0x33')]['filter']+'%'};return _0x36f0c1;})});}_0x384bc9=_[_0xde31('0x3d')]({},_0x384bc9,_0x123b90[_0xde31('0x3e')]);return _0x43625f[_0xde31('0x60')](_0x384bc9);}})[_0xde31('0x23')](function(_0x3b1832){if(_0x3b1832){_0x369552=_0x3b1832['length'];if(!_0x123b90[_0xde31('0x33')][_0xde31('0x38')](_0xde31('0x39'))){_0x384bc9[_0xde31('0x1d')]=qs[_0xde31('0x1d')](_0x123b90[_0xde31('0x33')][_0xde31('0x1d')]);_0x384bc9[_0xde31('0x1c')]=qs['offset'](_0x123b90[_0xde31('0x33')][_0xde31('0x1c')]);}return _0x43625f[_0xde31('0x60')](_0x384bc9);}})['then'](function(_0x2678de){if(_0x2678de){return _0x2678de?{'count':_0x369552,'rows':_0x2678de}:null;}})[_0xde31('0x23')](respondWithResult(_0x4db812,null))[_0xde31('0x43')](handleError(_0x4db812,null));};exports[_0xde31('0x62')]=function(_0x148e54,_0x24f88a,_0x43c753){var _0x5b8169,_0x304c29;return db[_0xde31('0x2c')][_0xde31('0x46')]({'where':{'id':_0x148e54[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x24f88a,null))[_0xde31('0x23')](function(_0x4fc351){if(_0x4fc351){_0x304c29=_0x4fc351;return _0x4fc351[_0xde31('0x62')](_0x148e54[_0xde31('0x52')][_0xde31('0x63')],_['omit'](_0x148e54['body'],[_0xde31('0x63'),'id'])||{});}return null;})[_0xde31('0x64')](function(_0x51c704){var _0x284e17;_0x5b8169=_0x51c704||[];var _0x568ce7=[];if(_0x51c704){for(var _0xec0dbb=0x0;_0xec0dbb<_0x51c704[_0xde31('0x4f')];_0xec0dbb+=0x1){var _0x22d9e1=_0x51c704[_0xec0dbb]['get']({'plain':!![]});_0x304c29[_0xde31('0x65')]=_0x148e54[_0xde31('0x52')][_0xde31('0x65')]?_0x148e54[_0xde31('0x52')][_0xde31('0x65')]:_0x304c29[_0xde31('0x65')];switch(_0x304c29['dialCheckDuplicateType']){case _0xde31('0x66'):_0x284e17=squel[_0xde31('0x67')]()[_0xde31('0x68')](_0xde31('0x69'))['fromQuery']([_0xde31('0x6a'),_0xde31('0x6b'),_0xde31('0x6c'),_0xde31('0x6d'),_0xde31('0x58'),'createdAt','updatedAt'],squel[_0xde31('0x6e')]()[_0xde31('0x6f')](_0xde31('0x6a'),_0xde31('0x6a'))[_0xde31('0x6f')](_0xde31('0x70'),_0xde31('0x6b'))[_0xde31('0x6f')]('id',_0xde31('0x6c'))[_0xde31('0x6f')](_0x22d9e1['CmListId'][_0xde31('0x71')](),_0xde31('0x6d'))[_0xde31('0x6f')](_0x148e54['params']['id'][_0xde31('0x71')](),_0xde31('0x58'))[_0xde31('0x6f')]('NOW()',_0xde31('0x51'))[_0xde31('0x6f')](_0xde31('0x70'),_0xde31('0x53'))['from'](_0xde31('0x72'))[_0xde31('0x3c')](_0xde31('0x73'))[_0xde31('0x3c')](_0xde31('0x74'),_0x22d9e1['CmListId'][_0xde31('0x71')]())['where'](_0xde31('0x75'))[_0xde31('0x3c')](_0xde31('0x76'),squel[_0xde31('0x6e')]()[_0xde31('0x6f')](_0xde31('0x77'))[_0xde31('0x78')](_0xde31('0x79'))[_0xde31('0x3c')](_0xde31('0x7a'),_0x148e54['params']['id']['toString']()))[_0xde31('0x3c')](_0xde31('0x76'),squel[_0xde31('0x6e')]()[_0xde31('0x6f')](_0xde31('0x7b'))[_0xde31('0x78')](_0xde31('0x69'))[_0xde31('0x3c')](_0xde31('0x7a'),_0x148e54['params']['id'][_0xde31('0x71')]())))[_0xde31('0x71')]();break;case _0xde31('0x7c'):_0x284e17=squel[_0xde31('0x67')]()[_0xde31('0x68')](_0xde31('0x69'))['fromQuery']([_0xde31('0x6a'),'scheduledAt',_0xde31('0x6c'),_0xde31('0x6d'),_0xde31('0x58'),'createdAt','updatedAt'],squel[_0xde31('0x6e')]()[_0xde31('0x6f')]('phone','phone')[_0xde31('0x6f')](_0xde31('0x70'),_0xde31('0x6b'))['field']('id',_0xde31('0x6c'))['field'](_0x22d9e1[_0xde31('0x7d')][_0xde31('0x71')](),_0xde31('0x6d'))[_0xde31('0x6f')](_0x148e54[_0xde31('0x45')]['id']['toString'](),_0xde31('0x58'))['field'](_0xde31('0x70'),'createdAt')[_0xde31('0x6f')](_0xde31('0x70'),'updatedAt')['from'](_0xde31('0x72'))[_0xde31('0x3c')](_0xde31('0x73'))[_0xde31('0x3c')]('ListId\x20=\x20?',_0x22d9e1['CmListId'][_0xde31('0x71')]())[_0xde31('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0xde31('0x3c')](_0xde31('0x76'),squel[_0xde31('0x6e')]()[_0xde31('0x6f')]('COALESCE(phone,\x27\x27)')[_0xde31('0x78')](_0xde31('0x69'))[_0xde31('0x3c')](_0xde31('0x7a'),_0x148e54['params']['id']['toString']())))[_0xde31('0x71')]();break;default:_0x284e17=squel[_0xde31('0x67')]()[_0xde31('0x68')](_0xde31('0x69'))[_0xde31('0x7e')]([_0xde31('0x6a'),'scheduledAt',_0xde31('0x6c'),_0xde31('0x6d'),_0xde31('0x58'),_0xde31('0x51'),_0xde31('0x53')],squel[_0xde31('0x6e')]()['field'](_0xde31('0x6a'),_0xde31('0x6a'))[_0xde31('0x6f')](_0xde31('0x70'),_0xde31('0x6b'))['field']('id',_0xde31('0x6c'))['field'](_0x22d9e1[_0xde31('0x7d')][_0xde31('0x71')](),_0xde31('0x6d'))[_0xde31('0x6f')](_0x148e54[_0xde31('0x45')]['id']['toString'](),_0xde31('0x58'))[_0xde31('0x6f')]('NOW()',_0xde31('0x51'))[_0xde31('0x6f')](_0xde31('0x70'),_0xde31('0x53'))[_0xde31('0x78')](_0xde31('0x72'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xde31('0x74'),_0x22d9e1[_0xde31('0x7d')]['toString']())[_0xde31('0x3c')](_0xde31('0x75')))[_0xde31('0x71')]();}_0x568ce7[_0xde31('0x7f')](db['sequelize'][_0xde31('0x33')](_0x284e17));}return BPromise[_0xde31('0x80')](_0x568ce7);}})[_0xde31('0x23')](function(){return _0x5b8169;})[_0xde31('0x23')](respondWithResult(_0x24f88a,null))[_0xde31('0x43')](handleError(_0x24f88a,null));};exports[_0xde31('0x81')]=function(_0x119712,_0x22ea0e,_0x57cca4){return db[_0xde31('0x2c')][_0xde31('0x46')]({'where':{'id':_0x119712[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x22ea0e,null))[_0xde31('0x23')](function(_0x27dec1){if(_0x27dec1){return _0x27dec1['removeLists'](_0x119712['query']['ids']);}})['then'](function(_0x29a049){if(_0x29a049){return db[_0xde31('0x55')][_0xde31('0x22')]({'where':{'ListId':_0x119712[_0xde31('0x33')][_0xde31('0x63')],'CampaignId':_0x119712[_0xde31('0x45')]['id']}})['then'](function(){return _0x29a049;});}})[_0xde31('0x23')](respondWithStatusCode(_0x22ea0e,null))[_0xde31('0x43')](handleError(_0x22ea0e,null));};exports[_0xde31('0x82')]=function(_0x3124e7,_0xd966d6,_0x1b47b6){var _0x3f1dda={};var _0xcb2769={};var _0x5966f8;var _0x1bc54d;return db[_0xde31('0x2c')]['findOne']({'where':{'id':_0x3124e7[_0xde31('0x45')]['id']}})['then'](handleEntityNotFound(_0xd966d6,null))[_0xde31('0x23')](function(_0x56f7dd){if(_0x56f7dd){_0x5966f8=_0x56f7dd;_0xcb2769[_0xde31('0x31')]=_[_0xde31('0x32')](db[_0xde31('0x61')][_0xde31('0x2d')]);_0xcb2769[_0xde31('0x33')]=_[_0xde31('0x32')](_0x3124e7[_0xde31('0x33')]);_0xcb2769[_0xde31('0x34')]=_[_0xde31('0x35')](_0xcb2769[_0xde31('0x31')],_0xcb2769[_0xde31('0x33')]);_0x3f1dda[_0xde31('0x37')]=_[_0xde31('0x35')](_0xcb2769[_0xde31('0x31')],qs[_0xde31('0x36')](_0x3124e7[_0xde31('0x33')][_0xde31('0x36')]));_0x3f1dda[_0xde31('0x37')]=_0x3f1dda[_0xde31('0x37')][_0xde31('0x4f')]?_0x3f1dda[_0xde31('0x37')]:_0xcb2769[_0xde31('0x31')];_0x3f1dda[_0xde31('0x56')]=qs['sort'](_0x3124e7['query'][_0xde31('0x3a')]);_0x3f1dda[_0xde31('0x3c')]=qs['filters'](_['pick'](_0x3124e7[_0xde31('0x33')],_0xcb2769['filters']));if(_0x3124e7[_0xde31('0x33')][_0xde31('0x3b')]){_0x3f1dda[_0xde31('0x3c')]=_[_0xde31('0x3d')](_0x3f1dda[_0xde31('0x3c')],{'$or':_[_0xde31('0x2b')](_0x3f1dda['attributes'],function(_0x177d2f){var _0x2e9c41={};_0x2e9c41[_0x177d2f]={'$like':'%'+_0x3124e7[_0xde31('0x33')][_0xde31('0x3b')]+'%'};return _0x2e9c41;})});}_0x3f1dda=_['merge']({},_0x3f1dda,_0x3124e7['options']);return _0x5966f8[_0xde31('0x82')](_0x3f1dda);}})[_0xde31('0x23')](function(_0x1052f9){if(_0x1052f9){_0x1bc54d=_0x1052f9[_0xde31('0x4f')];if(!_0x3124e7[_0xde31('0x33')]['hasOwnProperty'](_0xde31('0x39'))){_0x3f1dda['limit']=qs[_0xde31('0x1d')](_0x3124e7['query'][_0xde31('0x1d')]);_0x3f1dda[_0xde31('0x1c')]=qs[_0xde31('0x1c')](_0x3124e7[_0xde31('0x33')][_0xde31('0x1c')]);}return _0x5966f8[_0xde31('0x82')](_0x3f1dda);}})['then'](function(_0x54bed6){if(_0x54bed6){return _0x54bed6?{'count':_0x1bc54d,'rows':_0x54bed6}:null;}})[_0xde31('0x23')](respondWithResult(_0xd966d6,null))[_0xde31('0x43')](handleError(_0xd966d6,null));};exports[_0xde31('0x83')]=function(_0x44c461,_0x1e0d9a,_0x4a7ed4){var _0x2b9ba2,_0x362661;return db[_0xde31('0x2c')][_0xde31('0x46')]({'where':{'id':_0x44c461[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x1e0d9a,null))[_0xde31('0x23')](function(_0x475f56){if(_0x475f56){_0x362661=_0x475f56;return _0x475f56[_0xde31('0x83')](_0x44c461[_0xde31('0x52')][_0xde31('0x63')],_[_0xde31('0x50')](_0x44c461[_0xde31('0x52')],['ids','id'])||{});}return null;})[_0xde31('0x64')](function(_0xdbc3ae){var _0x319903;_0x2b9ba2=_0xdbc3ae||[];var _0x21fd56=[];if(_0xdbc3ae){for(var _0x2e8d2b=0x0;_0x2e8d2b<_0xdbc3ae[_0xde31('0x4f')];_0x2e8d2b+=0x1){var _0x318172=_0xdbc3ae[_0x2e8d2b][_0xde31('0x49')]({'plain':!![]});_0x319903=squel['insert']()[_0xde31('0x68')](_0xde31('0x84'))['fromQuery']([_0xde31('0x6a'),_0xde31('0x6c'),_0xde31('0x6d'),_0xde31('0x58'),'createdAt',_0xde31('0x53')],squel[_0xde31('0x6e')]()[_0xde31('0x6f')](_0xde31('0x6a'),_0xde31('0x6a'))[_0xde31('0x6f')]('id',_0xde31('0x6c'))[_0xde31('0x6f')](_0x318172[_0xde31('0x7d')][_0xde31('0x71')](),'ListId')[_0xde31('0x6f')](_0x44c461['params']['id'][_0xde31('0x71')](),_0xde31('0x58'))[_0xde31('0x6f')](_0xde31('0x70'),_0xde31('0x51'))[_0xde31('0x6f')](_0xde31('0x70'),_0xde31('0x53'))[_0xde31('0x78')](_0xde31('0x72'))[_0xde31('0x3c')](_0xde31('0x73'))[_0xde31('0x3c')]('ListId\x20=\x20?',_0x318172[_0xde31('0x7d')][_0xde31('0x71')]())[_0xde31('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xde31('0x71')]();_0x21fd56[_0xde31('0x7f')](db[_0xde31('0x85')][_0xde31('0x33')](_0x319903));}return BPromise[_0xde31('0x80')](_0x21fd56);}})['then'](function(){return _0x2b9ba2;})[_0xde31('0x23')](respondWithResult(_0x1e0d9a,null))[_0xde31('0x43')](handleError(_0x1e0d9a,null));};exports[_0xde31('0x86')]=function(_0x4a1e3d,_0x242ab6,_0x353863){return db['Campaign'][_0xde31('0x46')]({'where':{'id':_0x4a1e3d[_0xde31('0x45')]['id']}})[_0xde31('0x23')](handleEntityNotFound(_0x242ab6,null))[_0xde31('0x23')](function(_0xb3a7f2){if(_0xb3a7f2){return _0xb3a7f2[_0xde31('0x86')](_0x4a1e3d[_0xde31('0x33')][_0xde31('0x63')]);}})[_0xde31('0x23')](function(_0x5d568f){if(_0x5d568f){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x4a1e3d[_0xde31('0x33')][_0xde31('0x63')],'CampaignId':_0x4a1e3d[_0xde31('0x45')]['id']}})[_0xde31('0x23')](function(){return _0x5d568f;});}})[_0xde31('0x23')](respondWithStatusCode(_0x242ab6,null))['catch'](handleError(_0x242ab6,null));};
\ No newline at end of file
+var _0xd9bb=['getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','omit','updatedAt','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','phone','scheduledAt','ContactId','select','field','NOW()','toString','ListId','createdAt','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?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','fromQuery','deletedAt\x20IS\x20NULL','push','sequelize','removeLists'];(function(_0x3060ec,_0x10dbc4){var _0x514da2=function(_0x49d1b2){while(--_0x49d1b2){_0x3060ec['push'](_0x3060ec['shift']());}};_0x514da2(++_0x10dbc4);}(_0xd9bb,0x8f));var _0xbd9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9bb[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbd9b('0x0'));var rimraf=require(_0xbd9b('0x1'));var zipdir=require(_0xbd9b('0x2'));var jsonpatch=require(_0xbd9b('0x3'));var rp=require(_0xbd9b('0x4'));var moment=require(_0xbd9b('0x5'));var BPromise=require(_0xbd9b('0x6'));var Mustache=require(_0xbd9b('0x7'));var util=require(_0xbd9b('0x8'));var path=require('path');var sox=require(_0xbd9b('0x9'));var csv=require(_0xbd9b('0xa'));var ejs=require(_0xbd9b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd9b('0xc'));var squel=require(_0xbd9b('0xd'));var crypto=require(_0xbd9b('0xe'));var jsforce=require(_0xbd9b('0xf'));var deskjs=require(_0xbd9b('0x10'));var toCsv=require(_0xbd9b('0xa'));var querystring=require(_0xbd9b('0x11'));var Papa=require(_0xbd9b('0x12'));var Redis=require(_0xbd9b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbd9b('0x14'));var as=require(_0xbd9b('0x15'));var hardwareService=require(_0xbd9b('0x16'));var logger=require(_0xbd9b('0x17'))(_0xbd9b('0x18'));var utils=require(_0xbd9b('0x19'));var config=require(_0xbd9b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd9b('0x1b'))['db'];function respondWithStatusCode(_0x37628d,_0x1ad14d){_0x1ad14d=_0x1ad14d||0xcc;return function(_0x3390a5){if(_0x3390a5){return _0x37628d[_0xbd9b('0x1c')](_0x1ad14d);}return _0x37628d[_0xbd9b('0x1d')](_0x1ad14d)[_0xbd9b('0x1e')]();};}function respondWithResult(_0x9103db,_0x4f80b0){_0x4f80b0=_0x4f80b0||0xc8;return function(_0x2e6f7c){if(_0x2e6f7c){return _0x9103db['status'](_0x4f80b0)[_0xbd9b('0x1f')](_0x2e6f7c);}};}function respondWithFilteredResult(_0x38777b,_0x4b77e0){return function(_0x3736fb){if(_0x3736fb){var _0x2e7b80=typeof _0x4b77e0[_0xbd9b('0x20')]===_0xbd9b('0x21')&&typeof _0x4b77e0[_0xbd9b('0x22')]===_0xbd9b('0x21');var _0x5d4f1e=_0x3736fb[_0xbd9b('0x23')];var _0x381251=_0x2e7b80?0x0:_0x4b77e0[_0xbd9b('0x20')];var _0x5a35b0=_0x2e7b80?_0x3736fb[_0xbd9b('0x23')]:_0x4b77e0[_0xbd9b('0x20')]+_0x4b77e0[_0xbd9b('0x22')];var _0x46e133;if(_0x5a35b0>=_0x5d4f1e){_0x5a35b0=_0x5d4f1e;_0x46e133=0xc8;}else{_0x46e133=0xce;}_0x38777b[_0xbd9b('0x1d')](_0x46e133);return _0x38777b[_0xbd9b('0x24')](_0xbd9b('0x25'),_0x381251+'-'+_0x5a35b0+'/'+_0x5d4f1e)[_0xbd9b('0x1f')](_0x3736fb);}return null;};}function patchUpdates(_0x396784){return function(_0x237c2d){try{jsonpatch['apply'](_0x237c2d,_0x396784,!![]);}catch(_0x4b6f6d){return BPromise['reject'](_0x4b6f6d);}return _0x237c2d[_0xbd9b('0x26')]();};}function saveUpdates(_0x15748a,_0x4b2da8){return function(_0x599c2f){if(_0x599c2f){return _0x599c2f[_0xbd9b('0x27')](_0x15748a)[_0xbd9b('0x28')](function(_0x406011){return _0x406011;});}return null;};}function removeEntity(_0x179663,_0xac18a){return function(_0x598425){if(_0x598425){return _0x598425['destroy']()[_0xbd9b('0x28')](function(){var _0x29e7a9=_0x598425[_0xbd9b('0x29')]({'plain':!![]});var _0x63664d='IvrCampaigns';return db[_0xbd9b('0x2a')][_0xbd9b('0x2b')]({'where':{'type':_0x63664d,'resourceId':_0x29e7a9['id']}})[_0xbd9b('0x28')](function(){return _0x598425;});})['then'](function(){_0x179663['status'](0xcc)[_0xbd9b('0x1e')]();});}};}function handleEntityNotFound(_0x20d263,_0x112c7a){return function(_0xc7c8bc){if(!_0xc7c8bc){_0x20d263[_0xbd9b('0x1c')](0x194);}return _0xc7c8bc;};}function handleError(_0x2ea4d0,_0x34f3a4){_0x34f3a4=_0x34f3a4||0x1f4;return function(_0xc54d71){logger['error'](_0xc54d71[_0xbd9b('0x2c')]);if(_0xc54d71[_0xbd9b('0x2d')]){delete _0xc54d71[_0xbd9b('0x2d')];}_0x2ea4d0[_0xbd9b('0x1d')](_0x34f3a4)[_0xbd9b('0x2e')](_0xc54d71);};}exports[_0xbd9b('0x2f')]=function(_0xf5632e,_0x57c7e8){var _0x2cddfb={},_0x1c4f83={},_0x9cb32e={'count':0x0,'rows':[]};var _0x4b6463=_[_0xbd9b('0x30')](db[_0xbd9b('0x31')][_0xbd9b('0x32')],function(_0x9aee41){return{'name':_0x9aee41[_0xbd9b('0x33')],'type':_0x9aee41['type'][_0xbd9b('0x34')]};});_0x1c4f83[_0xbd9b('0x35')]=_['map'](_0x4b6463,_0xbd9b('0x2d'));_0x1c4f83[_0xbd9b('0x36')]=_['keys'](_0xf5632e['query']);_0x1c4f83[_0xbd9b('0x37')]=_[_0xbd9b('0x38')](_0x1c4f83[_0xbd9b('0x35')],_0x1c4f83[_0xbd9b('0x36')]);_0x2cddfb[_0xbd9b('0x39')]=_[_0xbd9b('0x38')](_0x1c4f83['model'],qs[_0xbd9b('0x3a')](_0xf5632e[_0xbd9b('0x36')][_0xbd9b('0x3a')]));_0x2cddfb[_0xbd9b('0x39')]=_0x2cddfb[_0xbd9b('0x39')]['length']?_0x2cddfb[_0xbd9b('0x39')]:_0x1c4f83['model'];if(!_0xf5632e['query'][_0xbd9b('0x3b')](_0xbd9b('0x3c'))){_0x2cddfb[_0xbd9b('0x22')]=qs[_0xbd9b('0x22')](_0xf5632e[_0xbd9b('0x36')]['limit']);_0x2cddfb['offset']=qs[_0xbd9b('0x20')](_0xf5632e[_0xbd9b('0x36')][_0xbd9b('0x20')]);}_0x2cddfb['order']=qs['sort'](_0xf5632e[_0xbd9b('0x36')][_0xbd9b('0x3d')]);_0x2cddfb['where']=qs[_0xbd9b('0x37')](_['pick'](_0xf5632e[_0xbd9b('0x36')],_0x1c4f83[_0xbd9b('0x37')]),_0x4b6463);if(_0xf5632e[_0xbd9b('0x36')][_0xbd9b('0x3e')]){_0x2cddfb[_0xbd9b('0x3f')]=_[_0xbd9b('0x40')](_0x2cddfb['where'],{'$or':_[_0xbd9b('0x30')](_0x4b6463,function(_0x229887){if(_0x229887[_0xbd9b('0x41')]!==_0xbd9b('0x42')){var _0x2685ad={};_0x2685ad[_0x229887['name']]={'$like':'%'+_0xf5632e[_0xbd9b('0x36')][_0xbd9b('0x3e')]+'%'};return _0x2685ad;}})});}_0x2cddfb=_[_0xbd9b('0x40')]({},_0x2cddfb,_0xf5632e[_0xbd9b('0x43')]);var _0x2e0ec9={'where':_0x2cddfb[_0xbd9b('0x3f')]};return db[_0xbd9b('0x31')]['count'](_0x2e0ec9)[_0xbd9b('0x28')](function(_0x568ca1){_0x9cb32e[_0xbd9b('0x23')]=_0x568ca1;if(_0xf5632e[_0xbd9b('0x36')][_0xbd9b('0x44')]){_0x2cddfb[_0xbd9b('0x45')]=[{'all':!![]}];}return db[_0xbd9b('0x31')][_0xbd9b('0x46')](_0x2cddfb);})[_0xbd9b('0x28')](function(_0x415fb8){_0x9cb32e[_0xbd9b('0x47')]=_0x415fb8;return _0x9cb32e;})[_0xbd9b('0x28')](respondWithFilteredResult(_0x57c7e8,_0x2cddfb))[_0xbd9b('0x48')](handleError(_0x57c7e8,null));};exports[_0xbd9b('0x49')]=function(_0x2bcc30,_0x1169f2){var _0x1c43cc={'raw':![],'where':{'id':_0x2bcc30[_0xbd9b('0x4a')]['id']}},_0x4a9685={};_0x4a9685[_0xbd9b('0x35')]=_[_0xbd9b('0x4b')](db[_0xbd9b('0x31')][_0xbd9b('0x32')]);_0x4a9685['query']=_[_0xbd9b('0x4b')](_0x2bcc30['query']);_0x4a9685[_0xbd9b('0x37')]=_[_0xbd9b('0x38')](_0x4a9685['model'],_0x4a9685[_0xbd9b('0x36')]);_0x1c43cc[_0xbd9b('0x39')]=_[_0xbd9b('0x38')](_0x4a9685[_0xbd9b('0x35')],qs['fields'](_0x2bcc30['query']['fields']));_0x1c43cc['attributes']=_0x1c43cc[_0xbd9b('0x39')][_0xbd9b('0x4c')]?_0x1c43cc[_0xbd9b('0x39')]:_0x4a9685[_0xbd9b('0x35')];if(_0x2bcc30[_0xbd9b('0x36')][_0xbd9b('0x44')]){_0x1c43cc[_0xbd9b('0x45')]=[{'all':!![]}];}_0x1c43cc=_[_0xbd9b('0x40')]({},_0x1c43cc,_0x2bcc30[_0xbd9b('0x43')]);return db['Campaign'][_0xbd9b('0x4d')](_0x1c43cc)[_0xbd9b('0x28')](handleEntityNotFound(_0x1169f2,null))[_0xbd9b('0x28')](respondWithResult(_0x1169f2,null))[_0xbd9b('0x48')](handleError(_0x1169f2,null));};exports[_0xbd9b('0x4e')]=function(_0x2560e9,_0x29ecf8){return db[_0xbd9b('0x31')][_0xbd9b('0x4e')](_0x2560e9[_0xbd9b('0x4f')],{})['then'](function(_0x5168d5){var _0x486ba4=_0x2560e9[_0xbd9b('0x50')]['get']({'plain':!![]});if(!_0x486ba4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486ba4[_0xbd9b('0x51')]===_0xbd9b('0x50')){var _0xf86957=_0x5168d5[_0xbd9b('0x29')]({'plain':!![]});var _0x3c1bb9=_0xbd9b('0x52');return db[_0xbd9b('0x53')][_0xbd9b('0x4d')]({'where':{'name':_0x3c1bb9,'userProfileId':_0x486ba4[_0xbd9b('0x54')]},'raw':!![]})[_0xbd9b('0x28')](function(_0x33d000){if(_0x33d000&&_0x33d000[_0xbd9b('0x55')]===0x0){return db[_0xbd9b('0x2a')][_0xbd9b('0x4e')]({'name':_0xf86957[_0xbd9b('0x2d')],'resourceId':_0xf86957['id'],'type':_0x33d000[_0xbd9b('0x2d')],'sectionId':_0x33d000['id']},{})[_0xbd9b('0x28')](function(){return _0x5168d5;});}else{return _0x5168d5;}})[_0xbd9b('0x48')](function(_0x2834a7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2834a7);throw _0x2834a7;});}return _0x5168d5;})[_0xbd9b('0x28')](respondWithResult(_0x29ecf8,0xc9))[_0xbd9b('0x48')](handleError(_0x29ecf8,null));};exports[_0xbd9b('0x56')]=function(_0x2576e4,_0x2ba55b){var _0x4e1b90={'where':{'id':_0x2576e4[_0xbd9b('0x4a')]['id']}},_0x65939c={};_0x65939c[_0xbd9b('0x35')]=_[_0xbd9b('0x4b')](db[_0xbd9b('0x31')]['rawAttributes']);_0x4e1b90[_0xbd9b('0x39')]=_['intersection'](_0x65939c[_0xbd9b('0x35')],qs['fields'](_0x2576e4[_0xbd9b('0x36')][_0xbd9b('0x3a')]));_0x4e1b90[_0xbd9b('0x39')]=_0x4e1b90[_0xbd9b('0x39')]['length']?_0x4e1b90[_0xbd9b('0x39')]:_0x65939c['model'];if(_0x2576e4[_0xbd9b('0x36')][_0xbd9b('0x44')]){_0x4e1b90[_0xbd9b('0x45')]=[{'all':!![]}];}_0x4e1b90=_[_0xbd9b('0x40')]({},_0x4e1b90,_0x2576e4[_0xbd9b('0x43')]);return db[_0xbd9b('0x31')][_0xbd9b('0x4d')](_0x4e1b90)[_0xbd9b('0x28')](handleEntityNotFound(_0x2ba55b,null))[_0xbd9b('0x28')](function(_0x3a64ae){if(_0x3a64ae){var _0x58eaa3=_0x3a64ae[_0xbd9b('0x29')]({'plain':!![]});_0x58eaa3=qs[_0xbd9b('0x57')](_0x58eaa3,['id','createdAt',_0xbd9b('0x58')]);_0x2576e4[_0xbd9b('0x4f')]=_[_0xbd9b('0x57')](_0x2576e4[_0xbd9b('0x4f')],['id','createdAt',_0xbd9b('0x58')]);return db[_0xbd9b('0x31')][_0xbd9b('0x4e')](_[_0xbd9b('0x40')](_0x58eaa3,_0x2576e4[_0xbd9b('0x4f')]),{'include':_0x2576e4['query'][_0xbd9b('0x44')]?[{'all':!![]}]:undefined})[_0xbd9b('0x28')](function(_0x3fd77d){var _0x2b2bbd=_0x2576e4[_0xbd9b('0x50')]['get']({'plain':!![]});if(!_0x2b2bbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2bbd['role']===_0xbd9b('0x50')){var _0xe6d69a=_0x3fd77d[_0xbd9b('0x29')]({'plain':!![]});var _0x533ac1='IvrCampaigns';return db[_0xbd9b('0x53')]['find']({'where':{'name':_0x533ac1,'userProfileId':_0x2b2bbd[_0xbd9b('0x54')]},'raw':!![]})[_0xbd9b('0x28')](function(_0x26bdb6){if(_0x26bdb6&&_0x26bdb6['autoAssociation']===0x0){return db['UserProfileResource'][_0xbd9b('0x4e')]({'name':_0xe6d69a[_0xbd9b('0x2d')],'resourceId':_0xe6d69a['id'],'type':_0x26bdb6['name'],'sectionId':_0x26bdb6['id']},{})[_0xbd9b('0x28')](function(){return _0x3fd77d;});}else{return _0x3fd77d;}})[_0xbd9b('0x48')](function(_0x3b96a8){logger[_0xbd9b('0x59')](_0xbd9b('0x5a'),_0x3b96a8);throw _0x3b96a8;});}return _0x3fd77d;});}})[_0xbd9b('0x28')](respondWithResult(_0x2ba55b,0xc9))[_0xbd9b('0x48')](handleError(_0x2ba55b,null));};exports['update']=function(_0x4c6dd5,_0xe3deef){if(_0x4c6dd5[_0xbd9b('0x4f')]['id']){delete _0x4c6dd5['body']['id'];}return db['Campaign'][_0xbd9b('0x4d')]({'where':{'id':_0x4c6dd5['params']['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0xe3deef,null))[_0xbd9b('0x28')](saveUpdates(_0x4c6dd5[_0xbd9b('0x4f')],null))[_0xbd9b('0x28')](respondWithResult(_0xe3deef,null))[_0xbd9b('0x48')](handleError(_0xe3deef,null));};exports['destroy']=function(_0x4f4709,_0x12603e){return db[_0xbd9b('0x31')][_0xbd9b('0x4d')]({'where':{'id':_0x4f4709[_0xbd9b('0x4a')]['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0x12603e,null))[_0xbd9b('0x28')](removeEntity(_0x12603e,null))[_0xbd9b('0x48')](handleError(_0x12603e,null));};exports[_0xbd9b('0x5b')]=function(_0x3be789,_0xb0c6d1,_0x2326ad){var _0x55e287={'raw':!![],'where':{}};var _0x13fbaa={};var _0x5acb38={'count':0x0,'rows':[]};return db[_0xbd9b('0x31')][_0xbd9b('0x5c')]({'where':{'id':_0x3be789['params']['id']}})['then'](handleEntityNotFound(_0xb0c6d1,null))['then'](function(_0x52f921){if(_0x52f921){_0x13fbaa[_0xbd9b('0x35')]=_[_0xbd9b('0x4b')](db[_0xbd9b('0x5d')]['rawAttributes']);_0x13fbaa[_0xbd9b('0x36')]=_['keys'](_0x3be789[_0xbd9b('0x36')]);_0x13fbaa[_0xbd9b('0x37')]=_['intersection'](_0x13fbaa[_0xbd9b('0x35')],_0x13fbaa[_0xbd9b('0x36')]);_0x55e287[_0xbd9b('0x39')]=_[_0xbd9b('0x38')](_0x13fbaa[_0xbd9b('0x35')],qs[_0xbd9b('0x3a')](_0x3be789[_0xbd9b('0x36')][_0xbd9b('0x3a')]));_0x55e287[_0xbd9b('0x39')]=_0x55e287['attributes'][_0xbd9b('0x4c')]?_0x55e287[_0xbd9b('0x39')]:_0x13fbaa[_0xbd9b('0x35')];if(!_0x3be789['query'][_0xbd9b('0x3b')](_0xbd9b('0x3c'))){_0x55e287[_0xbd9b('0x22')]=qs[_0xbd9b('0x22')](_0x3be789[_0xbd9b('0x36')][_0xbd9b('0x22')]);_0x55e287[_0xbd9b('0x20')]=qs[_0xbd9b('0x20')](_0x3be789['query'][_0xbd9b('0x20')]);}_0x55e287['order']=qs[_0xbd9b('0x3d')](_0x3be789[_0xbd9b('0x36')][_0xbd9b('0x3d')]);_0x55e287[_0xbd9b('0x3f')]=qs[_0xbd9b('0x37')](_[_0xbd9b('0x5e')](_0x3be789[_0xbd9b('0x36')],_0x13fbaa[_0xbd9b('0x37')]));_0x55e287[_0xbd9b('0x3f')][_0xbd9b('0x5f')]=_0x52f921['id'];if(_0x3be789[_0xbd9b('0x36')][_0xbd9b('0x3e')]){_0x55e287['where']=_[_0xbd9b('0x40')](_0x55e287[_0xbd9b('0x3f')],{'$or':_['map'](_0x55e287[_0xbd9b('0x39')],function(_0x2ea315){var _0x3bdc9b={};_0x3bdc9b[_0x2ea315]={'$like':'%'+_0x3be789[_0xbd9b('0x36')][_0xbd9b('0x3e')]+'%'};return _0x3bdc9b;})});}_0x55e287=_[_0xbd9b('0x40')]({},_0x55e287,_0x3be789[_0xbd9b('0x43')]);return db[_0xbd9b('0x5d')][_0xbd9b('0x23')]({'where':_0x55e287['where']})['then'](function(_0x3881b2){_0x5acb38['count']=_0x3881b2;if(_0x3be789[_0xbd9b('0x36')][_0xbd9b('0x44')]){_0x55e287[_0xbd9b('0x45')]=[{'all':!![]}];}return db[_0xbd9b('0x5d')]['findAll'](_0x55e287);})[_0xbd9b('0x28')](function(_0x4cea12){_0x5acb38[_0xbd9b('0x47')]=_0x4cea12;return _0x5acb38;});}})[_0xbd9b('0x28')](respondWithFilteredResult(_0xb0c6d1,_0x55e287))[_0xbd9b('0x48')](handleError(_0xb0c6d1,null));};exports[_0xbd9b('0x60')]=function(_0x2458f3,_0x1f6a5a,_0x14040e){var _0x141c4d={'raw':!![],'where':{}};var _0x5ee7e3={};var _0x1628bd={'count':0x0,'rows':[]};return db[_0xbd9b('0x31')][_0xbd9b('0x5c')]({'where':{'id':_0x2458f3[_0xbd9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f6a5a,null))['then'](function(_0x32f416){if(_0x32f416){_0x5ee7e3['model']=_[_0xbd9b('0x4b')](db[_0xbd9b('0x61')][_0xbd9b('0x32')]);_0x5ee7e3[_0xbd9b('0x36')]=_['keys'](_0x2458f3[_0xbd9b('0x36')]);_0x5ee7e3[_0xbd9b('0x37')]=_[_0xbd9b('0x38')](_0x5ee7e3[_0xbd9b('0x35')],_0x5ee7e3[_0xbd9b('0x36')]);_0x141c4d[_0xbd9b('0x39')]=_[_0xbd9b('0x38')](_0x5ee7e3[_0xbd9b('0x35')],qs[_0xbd9b('0x3a')](_0x2458f3['query'][_0xbd9b('0x3a')]));_0x141c4d['attributes']=_0x141c4d[_0xbd9b('0x39')][_0xbd9b('0x4c')]?_0x141c4d[_0xbd9b('0x39')]:_0x5ee7e3['model'];if(!_0x2458f3[_0xbd9b('0x36')]['hasOwnProperty'](_0xbd9b('0x3c'))){_0x141c4d['limit']=qs['limit'](_0x2458f3['query'][_0xbd9b('0x22')]);_0x141c4d[_0xbd9b('0x20')]=qs[_0xbd9b('0x20')](_0x2458f3[_0xbd9b('0x36')][_0xbd9b('0x20')]);}_0x141c4d[_0xbd9b('0x62')]=qs[_0xbd9b('0x3d')](_0x2458f3[_0xbd9b('0x36')][_0xbd9b('0x3d')]);_0x141c4d['where']=qs[_0xbd9b('0x37')](_[_0xbd9b('0x5e')](_0x2458f3[_0xbd9b('0x36')],_0x5ee7e3[_0xbd9b('0x37')]));_0x141c4d['where']['CampaignId']=_0x32f416['id'];if(_0x2458f3[_0xbd9b('0x36')]['filter']){_0x141c4d['where']=_[_0xbd9b('0x40')](_0x141c4d[_0xbd9b('0x3f')],{'$or':_['map'](_0x141c4d[_0xbd9b('0x39')],function(_0x1bc823){var _0x2abe99={};_0x2abe99[_0x1bc823]={'$like':'%'+_0x2458f3[_0xbd9b('0x36')]['filter']+'%'};return _0x2abe99;})});}_0x141c4d=_['merge']({},_0x141c4d,_0x2458f3['options']);return db[_0xbd9b('0x61')][_0xbd9b('0x23')]({'where':_0x141c4d[_0xbd9b('0x3f')]})[_0xbd9b('0x28')](function(_0x1c0840){_0x1628bd[_0xbd9b('0x23')]=_0x1c0840;if(_0x2458f3[_0xbd9b('0x36')][_0xbd9b('0x44')]){_0x141c4d[_0xbd9b('0x45')]=[{'all':!![]}];}return db[_0xbd9b('0x61')][_0xbd9b('0x46')](_0x141c4d);})[_0xbd9b('0x28')](function(_0x2a4d38){_0x1628bd[_0xbd9b('0x47')]=_0x2a4d38;return _0x1628bd;});}})[_0xbd9b('0x28')](respondWithFilteredResult(_0x1f6a5a,_0x141c4d))[_0xbd9b('0x48')](handleError(_0x1f6a5a,null));};exports[_0xbd9b('0x63')]=function(_0xa5323c,_0x49ddfb,_0x340a17){var _0x1273fe={'raw':!![],'where':{}};var _0x11db57={};var _0x38a626={'count':0x0,'rows':[]};return db[_0xbd9b('0x31')][_0xbd9b('0x5c')]({'where':{'id':_0xa5323c['params']['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0x49ddfb,null))[_0xbd9b('0x28')](function(_0x264ac2){if(_0x264ac2){_0x11db57[_0xbd9b('0x35')]=_[_0xbd9b('0x4b')](db[_0xbd9b('0x64')]['rawAttributes']);_0x11db57[_0xbd9b('0x36')]=_[_0xbd9b('0x4b')](_0xa5323c[_0xbd9b('0x36')]);_0x11db57[_0xbd9b('0x37')]=_[_0xbd9b('0x38')](_0x11db57['model'],_0x11db57['query']);_0x1273fe[_0xbd9b('0x39')]=_['intersection'](_0x11db57[_0xbd9b('0x35')],qs['fields'](_0xa5323c['query']['fields']));_0x1273fe[_0xbd9b('0x39')]=_0x1273fe['attributes'][_0xbd9b('0x4c')]?_0x1273fe[_0xbd9b('0x39')]:_0x11db57[_0xbd9b('0x35')];if(!_0xa5323c['query'][_0xbd9b('0x3b')](_0xbd9b('0x3c'))){_0x1273fe['limit']=qs['limit'](_0xa5323c[_0xbd9b('0x36')][_0xbd9b('0x22')]);_0x1273fe[_0xbd9b('0x20')]=qs[_0xbd9b('0x20')](_0xa5323c[_0xbd9b('0x36')][_0xbd9b('0x20')]);}_0x1273fe['order']=qs[_0xbd9b('0x3d')](_0xa5323c[_0xbd9b('0x36')][_0xbd9b('0x3d')]);_0x1273fe[_0xbd9b('0x3f')]=qs[_0xbd9b('0x37')](_['pick'](_0xa5323c[_0xbd9b('0x36')],_0x11db57[_0xbd9b('0x37')]));_0x1273fe[_0xbd9b('0x3f')][_0xbd9b('0x5f')]=_0x264ac2['id'];if(_0xa5323c[_0xbd9b('0x36')][_0xbd9b('0x3e')]){_0x1273fe['where']=_[_0xbd9b('0x40')](_0x1273fe[_0xbd9b('0x3f')],{'$or':_[_0xbd9b('0x30')](_0x1273fe[_0xbd9b('0x39')],function(_0x13a84a){var _0xebf997={};_0xebf997[_0x13a84a]={'$like':'%'+_0xa5323c['query']['filter']+'%'};return _0xebf997;})});}_0x1273fe=_[_0xbd9b('0x40')]({},_0x1273fe,_0xa5323c[_0xbd9b('0x43')]);return db[_0xbd9b('0x64')][_0xbd9b('0x23')]({'where':_0x1273fe[_0xbd9b('0x3f')]})[_0xbd9b('0x28')](function(_0x4d7ca4){_0x38a626[_0xbd9b('0x23')]=_0x4d7ca4;if(_0xa5323c[_0xbd9b('0x36')]['includeAll']){_0x1273fe['include']=[{'all':!![]}];}return db[_0xbd9b('0x64')][_0xbd9b('0x46')](_0x1273fe);})[_0xbd9b('0x28')](function(_0x719689){_0x38a626[_0xbd9b('0x47')]=_0x719689;return _0x38a626;});}})['then'](respondWithFilteredResult(_0x49ddfb,_0x1273fe))['catch'](handleError(_0x49ddfb,null));};exports['getHopperBlacks']=function(_0xfb6e,_0x366929,_0x5bb3ba){var _0x3e43ab={'raw':!![],'where':{}};var _0x4d0266={};var _0x1999b4={'count':0x0,'rows':[]};return db[_0xbd9b('0x31')]['findOne']({'where':{'id':_0xfb6e[_0xbd9b('0x4a')]['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0x366929,null))[_0xbd9b('0x28')](function(_0x33d8b1){if(_0x33d8b1){_0x4d0266[_0xbd9b('0x35')]=_['keys'](db[_0xbd9b('0x65')]['rawAttributes']);_0x4d0266[_0xbd9b('0x36')]=_[_0xbd9b('0x4b')](_0xfb6e[_0xbd9b('0x36')]);_0x4d0266['filters']=_[_0xbd9b('0x38')](_0x4d0266['model'],_0x4d0266[_0xbd9b('0x36')]);_0x3e43ab[_0xbd9b('0x39')]=_[_0xbd9b('0x38')](_0x4d0266[_0xbd9b('0x35')],qs['fields'](_0xfb6e['query'][_0xbd9b('0x3a')]));_0x3e43ab['attributes']=_0x3e43ab[_0xbd9b('0x39')][_0xbd9b('0x4c')]?_0x3e43ab[_0xbd9b('0x39')]:_0x4d0266[_0xbd9b('0x35')];if(!_0xfb6e['query'][_0xbd9b('0x3b')](_0xbd9b('0x3c'))){_0x3e43ab[_0xbd9b('0x22')]=qs[_0xbd9b('0x22')](_0xfb6e[_0xbd9b('0x36')][_0xbd9b('0x22')]);_0x3e43ab['offset']=qs['offset'](_0xfb6e[_0xbd9b('0x36')][_0xbd9b('0x20')]);}_0x3e43ab[_0xbd9b('0x62')]=qs[_0xbd9b('0x3d')](_0xfb6e[_0xbd9b('0x36')][_0xbd9b('0x3d')]);_0x3e43ab[_0xbd9b('0x3f')]=qs[_0xbd9b('0x37')](_[_0xbd9b('0x5e')](_0xfb6e['query'],_0x4d0266[_0xbd9b('0x37')]));_0x3e43ab[_0xbd9b('0x3f')]['CampaignId']=_0x33d8b1['id'];if(_0xfb6e[_0xbd9b('0x36')][_0xbd9b('0x3e')]){_0x3e43ab[_0xbd9b('0x3f')]=_[_0xbd9b('0x40')](_0x3e43ab[_0xbd9b('0x3f')],{'$or':_[_0xbd9b('0x30')](_0x3e43ab[_0xbd9b('0x39')],function(_0x403923){var _0x2c10bb={};_0x2c10bb[_0x403923]={'$like':'%'+_0xfb6e['query'][_0xbd9b('0x3e')]+'%'};return _0x2c10bb;})});}_0x3e43ab=_[_0xbd9b('0x40')]({},_0x3e43ab,_0xfb6e[_0xbd9b('0x43')]);return db[_0xbd9b('0x65')]['count']({'where':_0x3e43ab[_0xbd9b('0x3f')]})[_0xbd9b('0x28')](function(_0x53d602){_0x1999b4[_0xbd9b('0x23')]=_0x53d602;if(_0xfb6e[_0xbd9b('0x36')]['includeAll']){_0x3e43ab[_0xbd9b('0x45')]=[{'all':!![]}];}return db[_0xbd9b('0x65')][_0xbd9b('0x46')](_0x3e43ab);})[_0xbd9b('0x28')](function(_0x197f3c){_0x1999b4[_0xbd9b('0x47')]=_0x197f3c;return _0x1999b4;});}})[_0xbd9b('0x28')](respondWithFilteredResult(_0x366929,_0x3e43ab))['catch'](handleError(_0x366929,null));};exports[_0xbd9b('0x66')]=function(_0xa8bf29,_0x129248,_0x17a05b){var _0x631db4={};var _0x52fb51={};var _0x3829ff;var _0x16e1ab;return db[_0xbd9b('0x31')][_0xbd9b('0x5c')]({'where':{'id':_0xa8bf29[_0xbd9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x129248,null))[_0xbd9b('0x28')](function(_0xcaff58){if(_0xcaff58){_0x3829ff=_0xcaff58;_0x52fb51['model']=_[_0xbd9b('0x4b')](db[_0xbd9b('0x67')]['rawAttributes']);_0x52fb51[_0xbd9b('0x36')]=_[_0xbd9b('0x4b')](_0xa8bf29['query']);_0x52fb51['filters']=_['intersection'](_0x52fb51[_0xbd9b('0x35')],_0x52fb51['query']);_0x631db4[_0xbd9b('0x39')]=_[_0xbd9b('0x38')](_0x52fb51[_0xbd9b('0x35')],qs[_0xbd9b('0x3a')](_0xa8bf29[_0xbd9b('0x36')]['fields']));_0x631db4[_0xbd9b('0x39')]=_0x631db4[_0xbd9b('0x39')][_0xbd9b('0x4c')]?_0x631db4[_0xbd9b('0x39')]:_0x52fb51['model'];_0x631db4[_0xbd9b('0x62')]=qs['sort'](_0xa8bf29['query'][_0xbd9b('0x3d')]);_0x631db4[_0xbd9b('0x3f')]=qs[_0xbd9b('0x37')](_[_0xbd9b('0x5e')](_0xa8bf29[_0xbd9b('0x36')],_0x52fb51[_0xbd9b('0x37')]));if(_0xa8bf29[_0xbd9b('0x36')][_0xbd9b('0x3e')]){_0x631db4[_0xbd9b('0x3f')]=_[_0xbd9b('0x40')](_0x631db4[_0xbd9b('0x3f')],{'$or':_[_0xbd9b('0x30')](_0x631db4[_0xbd9b('0x39')],function(_0x53886b){var _0x53578b={};_0x53578b[_0x53886b]={'$like':'%'+_0xa8bf29[_0xbd9b('0x36')][_0xbd9b('0x3e')]+'%'};return _0x53578b;})});}_0x631db4=_[_0xbd9b('0x40')]({},_0x631db4,_0xa8bf29[_0xbd9b('0x43')]);return _0x3829ff[_0xbd9b('0x66')](_0x631db4);}})['then'](function(_0x2e1168){if(_0x2e1168){_0x16e1ab=_0x2e1168[_0xbd9b('0x4c')];if(!_0xa8bf29[_0xbd9b('0x36')][_0xbd9b('0x3b')]('nolimit')){_0x631db4[_0xbd9b('0x22')]=qs[_0xbd9b('0x22')](_0xa8bf29[_0xbd9b('0x36')][_0xbd9b('0x22')]);_0x631db4['offset']=qs[_0xbd9b('0x20')](_0xa8bf29[_0xbd9b('0x36')][_0xbd9b('0x20')]);}return _0x3829ff['getLists'](_0x631db4);}})['then'](function(_0x34685e){if(_0x34685e){return _0x34685e?{'count':_0x16e1ab,'rows':_0x34685e}:null;}})[_0xbd9b('0x28')](respondWithResult(_0x129248,null))['catch'](handleError(_0x129248,null));};exports[_0xbd9b('0x68')]=function(_0x42f1c4,_0x3e8a85,_0x31d91c){var _0x42973f,_0x3326d2;return db[_0xbd9b('0x31')]['find']({'where':{'id':_0x42f1c4[_0xbd9b('0x4a')]['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0x3e8a85,null))[_0xbd9b('0x28')](function(_0x1ef1dc){if(_0x1ef1dc){_0x3326d2=_0x1ef1dc;return _0x1ef1dc[_0xbd9b('0x68')](_0x42f1c4[_0xbd9b('0x4f')][_0xbd9b('0x69')],_[_0xbd9b('0x57')](_0x42f1c4[_0xbd9b('0x4f')],[_0xbd9b('0x69'),'id'])||{});}return null;})[_0xbd9b('0x6a')](function(_0x544903){var _0x19bda0;_0x42973f=_0x544903||[];var _0x1f5fd6=[];if(_0x544903){for(var _0x28139c=0x0;_0x28139c<_0x544903['length'];_0x28139c+=0x1){var _0x4874e8=_0x544903[_0x28139c][_0xbd9b('0x29')]({'plain':!![]});_0x3326d2['dialCheckDuplicateType']=_0x42f1c4[_0xbd9b('0x4f')]['dialCheckDuplicateType']?_0x42f1c4[_0xbd9b('0x4f')][_0xbd9b('0x6b')]:_0x3326d2[_0xbd9b('0x6b')];switch(_0x3326d2[_0xbd9b('0x6b')]){case _0xbd9b('0x6c'):_0x19bda0=squel['insert']()['into'](_0xbd9b('0x6d'))['fromQuery']([_0xbd9b('0x6e'),_0xbd9b('0x6f'),_0xbd9b('0x70'),'ListId','CampaignId','createdAt',_0xbd9b('0x58')],squel[_0xbd9b('0x71')]()[_0xbd9b('0x72')](_0xbd9b('0x6e'),_0xbd9b('0x6e'))[_0xbd9b('0x72')](_0xbd9b('0x73'),_0xbd9b('0x6f'))['field']('id',_0xbd9b('0x70'))[_0xbd9b('0x72')](_0x4874e8['CmListId'][_0xbd9b('0x74')](),_0xbd9b('0x75'))[_0xbd9b('0x72')](_0x42f1c4[_0xbd9b('0x4a')]['id'][_0xbd9b('0x74')](),_0xbd9b('0x5f'))[_0xbd9b('0x72')](_0xbd9b('0x73'),_0xbd9b('0x76'))[_0xbd9b('0x72')]('NOW()',_0xbd9b('0x58'))[_0xbd9b('0x77')](_0xbd9b('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0xbd9b('0x3f')](_0xbd9b('0x79'),_0x4874e8[_0xbd9b('0x7a')][_0xbd9b('0x74')]())[_0xbd9b('0x3f')](_0xbd9b('0x7b'))['where'](_0xbd9b('0x7c'),squel[_0xbd9b('0x71')]()['field'](_0xbd9b('0x7d'))[_0xbd9b('0x77')](_0xbd9b('0x7e'))[_0xbd9b('0x3f')](_0xbd9b('0x7f'),_0x42f1c4['params']['id'][_0xbd9b('0x74')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xbd9b('0x71')]()[_0xbd9b('0x72')](_0xbd9b('0x80'))[_0xbd9b('0x77')](_0xbd9b('0x6d'))[_0xbd9b('0x3f')](_0xbd9b('0x7f'),_0x42f1c4[_0xbd9b('0x4a')]['id'][_0xbd9b('0x74')]())))['toString']();break;case _0xbd9b('0x81'):_0x19bda0=squel[_0xbd9b('0x82')]()[_0xbd9b('0x83')](_0xbd9b('0x6d'))[_0xbd9b('0x84')]([_0xbd9b('0x6e'),_0xbd9b('0x6f'),_0xbd9b('0x70'),'ListId','CampaignId','createdAt',_0xbd9b('0x58')],squel[_0xbd9b('0x71')]()[_0xbd9b('0x72')](_0xbd9b('0x6e'),'phone')[_0xbd9b('0x72')](_0xbd9b('0x73'),_0xbd9b('0x6f'))[_0xbd9b('0x72')]('id','ContactId')[_0xbd9b('0x72')](_0x4874e8[_0xbd9b('0x7a')][_0xbd9b('0x74')](),'ListId')['field'](_0x42f1c4['params']['id'][_0xbd9b('0x74')](),_0xbd9b('0x5f'))['field'](_0xbd9b('0x73'),_0xbd9b('0x76'))[_0xbd9b('0x72')](_0xbd9b('0x73'),'updatedAt')[_0xbd9b('0x77')](_0xbd9b('0x78'))[_0xbd9b('0x3f')](_0xbd9b('0x85'))[_0xbd9b('0x3f')](_0xbd9b('0x79'),_0x4874e8[_0xbd9b('0x7a')][_0xbd9b('0x74')]())[_0xbd9b('0x3f')](_0xbd9b('0x7b'))[_0xbd9b('0x3f')](_0xbd9b('0x7c'),squel[_0xbd9b('0x71')]()[_0xbd9b('0x72')](_0xbd9b('0x80'))[_0xbd9b('0x77')](_0xbd9b('0x6d'))[_0xbd9b('0x3f')](_0xbd9b('0x7f'),_0x42f1c4[_0xbd9b('0x4a')]['id']['toString']())))[_0xbd9b('0x74')]();break;default:_0x19bda0=squel[_0xbd9b('0x82')]()['into'](_0xbd9b('0x6d'))['fromQuery']([_0xbd9b('0x6e'),_0xbd9b('0x6f'),_0xbd9b('0x70'),'ListId',_0xbd9b('0x5f'),_0xbd9b('0x76'),_0xbd9b('0x58')],squel['select']()[_0xbd9b('0x72')]('phone',_0xbd9b('0x6e'))['field'](_0xbd9b('0x73'),_0xbd9b('0x6f'))[_0xbd9b('0x72')]('id',_0xbd9b('0x70'))['field'](_0x4874e8['CmListId'][_0xbd9b('0x74')](),_0xbd9b('0x75'))['field'](_0x42f1c4['params']['id'][_0xbd9b('0x74')](),_0xbd9b('0x5f'))[_0xbd9b('0x72')](_0xbd9b('0x73'),'createdAt')[_0xbd9b('0x72')](_0xbd9b('0x73'),_0xbd9b('0x58'))['from'](_0xbd9b('0x78'))[_0xbd9b('0x3f')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x4874e8[_0xbd9b('0x7a')][_0xbd9b('0x74')]())[_0xbd9b('0x3f')](_0xbd9b('0x7b')))[_0xbd9b('0x74')]();}_0x1f5fd6[_0xbd9b('0x86')](db[_0xbd9b('0x87')][_0xbd9b('0x36')](_0x19bda0));}return BPromise['all'](_0x1f5fd6);}})[_0xbd9b('0x28')](function(){return _0x42973f;})[_0xbd9b('0x28')](respondWithResult(_0x3e8a85,null))[_0xbd9b('0x48')](handleError(_0x3e8a85,null));};exports[_0xbd9b('0x88')]=function(_0x45f29a,_0x38ab1c,_0x4b8166){return db[_0xbd9b('0x31')][_0xbd9b('0x4d')]({'where':{'id':_0x45f29a[_0xbd9b('0x4a')]['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0x38ab1c,null))[_0xbd9b('0x28')](function(_0x7c5a70){if(_0x7c5a70){return _0x7c5a70['removeLists'](_0x45f29a[_0xbd9b('0x36')]['ids']);}})['then'](function(_0x29c7dc){if(_0x29c7dc){return db[_0xbd9b('0x5d')][_0xbd9b('0x2b')]({'where':{'ListId':_0x45f29a[_0xbd9b('0x36')][_0xbd9b('0x69')],'CampaignId':_0x45f29a[_0xbd9b('0x4a')]['id']}})[_0xbd9b('0x28')](function(){return _0x29c7dc;});}})[_0xbd9b('0x28')](respondWithStatusCode(_0x38ab1c,null))[_0xbd9b('0x48')](handleError(_0x38ab1c,null));};exports[_0xbd9b('0x89')]=function(_0x496601,_0x41400f,_0x1d72db){var _0x47c449={};var _0x523e07={};var _0x2e46ed;var _0x875f95;return db[_0xbd9b('0x31')][_0xbd9b('0x5c')]({'where':{'id':_0x496601[_0xbd9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41400f,null))[_0xbd9b('0x28')](function(_0x2814c2){if(_0x2814c2){_0x2e46ed=_0x2814c2;_0x523e07[_0xbd9b('0x35')]=_['keys'](db[_0xbd9b('0x67')][_0xbd9b('0x32')]);_0x523e07[_0xbd9b('0x36')]=_[_0xbd9b('0x4b')](_0x496601[_0xbd9b('0x36')]);_0x523e07[_0xbd9b('0x37')]=_[_0xbd9b('0x38')](_0x523e07[_0xbd9b('0x35')],_0x523e07[_0xbd9b('0x36')]);_0x47c449['attributes']=_[_0xbd9b('0x38')](_0x523e07[_0xbd9b('0x35')],qs['fields'](_0x496601[_0xbd9b('0x36')][_0xbd9b('0x3a')]));_0x47c449['attributes']=_0x47c449['attributes'][_0xbd9b('0x4c')]?_0x47c449[_0xbd9b('0x39')]:_0x523e07[_0xbd9b('0x35')];_0x47c449[_0xbd9b('0x62')]=qs['sort'](_0x496601[_0xbd9b('0x36')]['sort']);_0x47c449[_0xbd9b('0x3f')]=qs[_0xbd9b('0x37')](_[_0xbd9b('0x5e')](_0x496601['query'],_0x523e07[_0xbd9b('0x37')]));if(_0x496601[_0xbd9b('0x36')][_0xbd9b('0x3e')]){_0x47c449[_0xbd9b('0x3f')]=_[_0xbd9b('0x40')](_0x47c449[_0xbd9b('0x3f')],{'$or':_[_0xbd9b('0x30')](_0x47c449[_0xbd9b('0x39')],function(_0x1e1795){var _0x4676db={};_0x4676db[_0x1e1795]={'$like':'%'+_0x496601['query'][_0xbd9b('0x3e')]+'%'};return _0x4676db;})});}_0x47c449=_[_0xbd9b('0x40')]({},_0x47c449,_0x496601[_0xbd9b('0x43')]);return _0x2e46ed[_0xbd9b('0x89')](_0x47c449);}})['then'](function(_0x112952){if(_0x112952){_0x875f95=_0x112952[_0xbd9b('0x4c')];if(!_0x496601[_0xbd9b('0x36')][_0xbd9b('0x3b')](_0xbd9b('0x3c'))){_0x47c449[_0xbd9b('0x22')]=qs['limit'](_0x496601[_0xbd9b('0x36')][_0xbd9b('0x22')]);_0x47c449['offset']=qs['offset'](_0x496601[_0xbd9b('0x36')]['offset']);}return _0x2e46ed['getBlackLists'](_0x47c449);}})['then'](function(_0x3e55a5){if(_0x3e55a5){return _0x3e55a5?{'count':_0x875f95,'rows':_0x3e55a5}:null;}})[_0xbd9b('0x28')](respondWithResult(_0x41400f,null))[_0xbd9b('0x48')](handleError(_0x41400f,null));};exports[_0xbd9b('0x8a')]=function(_0x52ab3a,_0x2cac41,_0x2c7200){var _0x142112,_0xad7323;return db[_0xbd9b('0x31')][_0xbd9b('0x4d')]({'where':{'id':_0x52ab3a[_0xbd9b('0x4a')]['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0x2cac41,null))[_0xbd9b('0x28')](function(_0x1be6fe){if(_0x1be6fe){_0xad7323=_0x1be6fe;return _0x1be6fe[_0xbd9b('0x8a')](_0x52ab3a[_0xbd9b('0x4f')]['ids'],_[_0xbd9b('0x57')](_0x52ab3a[_0xbd9b('0x4f')],['ids','id'])||{});}return null;})[_0xbd9b('0x6a')](function(_0x1e5c42){var _0x5d68a5;_0x142112=_0x1e5c42||[];var _0x3ce7c7=[];if(_0x1e5c42){for(var _0x21d3ab=0x0;_0x21d3ab<_0x1e5c42[_0xbd9b('0x4c')];_0x21d3ab+=0x1){var _0x28433f=_0x1e5c42[_0x21d3ab][_0xbd9b('0x29')]({'plain':!![]});_0x5d68a5=squel[_0xbd9b('0x82')]()[_0xbd9b('0x83')](_0xbd9b('0x8b'))['fromQuery']([_0xbd9b('0x6e'),_0xbd9b('0x70'),_0xbd9b('0x75'),_0xbd9b('0x5f'),_0xbd9b('0x76'),_0xbd9b('0x58')],squel[_0xbd9b('0x71')]()['field'](_0xbd9b('0x6e'),_0xbd9b('0x6e'))[_0xbd9b('0x72')]('id',_0xbd9b('0x70'))[_0xbd9b('0x72')](_0x28433f[_0xbd9b('0x7a')][_0xbd9b('0x74')](),_0xbd9b('0x75'))['field'](_0x52ab3a[_0xbd9b('0x4a')]['id'][_0xbd9b('0x74')](),_0xbd9b('0x5f'))['field'](_0xbd9b('0x73'),_0xbd9b('0x76'))[_0xbd9b('0x72')]('NOW()',_0xbd9b('0x58'))['from'](_0xbd9b('0x78'))[_0xbd9b('0x3f')](_0xbd9b('0x85'))['where'](_0xbd9b('0x79'),_0x28433f['CmListId']['toString']())[_0xbd9b('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x3ce7c7[_0xbd9b('0x86')](db[_0xbd9b('0x87')][_0xbd9b('0x36')](_0x5d68a5));}return BPromise['all'](_0x3ce7c7);}})[_0xbd9b('0x28')](function(){return _0x142112;})['then'](respondWithResult(_0x2cac41,null))['catch'](handleError(_0x2cac41,null));};exports['removeBlackLists']=function(_0x4db767,_0x250b4b,_0x45be65){return db[_0xbd9b('0x31')][_0xbd9b('0x4d')]({'where':{'id':_0x4db767[_0xbd9b('0x4a')]['id']}})[_0xbd9b('0x28')](handleEntityNotFound(_0x250b4b,null))[_0xbd9b('0x28')](function(_0x5f2266){if(_0x5f2266){return _0x5f2266['removeBlackLists'](_0x4db767[_0xbd9b('0x36')]['ids']);}})[_0xbd9b('0x28')](function(_0x189a74){if(_0x189a74){return db[_0xbd9b('0x65')][_0xbd9b('0x2b')]({'where':{'ListId':_0x4db767[_0xbd9b('0x36')][_0xbd9b('0x69')],'CampaignId':_0x4db767[_0xbd9b('0x4a')]['id']}})['then'](function(){return _0x189a74;});}})['then'](respondWithStatusCode(_0x250b4b,null))[_0xbd9b('0x48')](handleError(_0x250b4b,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index acf4ba9..0b0cb2e 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x453378,_0x2f360c){var _0xab3d9e=function(_0x58c2c8){while(--_0x58c2c8){_0x453378['push'](_0x453378['shift']());}};_0xab3d9e(++_0x2f360c);}(_0x7a54,0x106));var _0x47a5=function(_0x601cb2,_0x1cfc39){_0x601cb2=_0x601cb2-0x0;var _0x327a6c=_0x7a54[_0x601cb2];return _0x327a6c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 23227b8..66e3086 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 _0xb790=['Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Campaign,\x20%s,\x20%s','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','map','include','model','util','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug'];(function(_0x3063cd,_0x29a884){var _0x104def=function(_0x2df3c0){while(--_0x2df3c0){_0x3063cd['push'](_0x3063cd['shift']());}};_0x104def(++_0x29a884);}(_0xb790,0xe5));var _0x0b79=function(_0x6ea106,_0x181b3d){_0x6ea106=_0x6ea106-0x0;var _0x49ecfe=_0xb790[_0x6ea106];return _0x49ecfe;};'use strict';var _=require('lodash');var util=require(_0x0b79('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b79('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0b79('0x2'))(_0x0b79('0x3'));var config=require('../../config/environment');var jayson=require(_0x0b79('0x4'));var client=jayson[_0x0b79('0x5')][_0x0b79('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x574c73,_0x69b376,_0x1e9124){return new BPromise(function(_0x3de006,_0x301de6){return client[_0x0b79('0x7')](_0x574c73,_0x1e9124)[_0x0b79('0x8')](function(_0x834937){logger[_0x0b79('0x9')]('Campaign,\x20%s,\x20%s',_0x69b376,'request\x20sent');logger[_0x0b79('0xa')](_0x0b79('0xb'),_0x69b376,_0x0b79('0xc'),JSON[_0x0b79('0xd')](_0x834937));if(_0x834937[_0x0b79('0xe')]){if(_0x834937['error'][_0x0b79('0xf')]===0x1f4){logger[_0x0b79('0xe')]('Campaign,\x20%s,\x20%s',_0x69b376,_0x834937[_0x0b79('0xe')][_0x0b79('0x10')]);return _0x301de6(_0x834937[_0x0b79('0xe')][_0x0b79('0x10')]);}logger['error'](_0x0b79('0x11'),_0x69b376,_0x834937[_0x0b79('0xe')][_0x0b79('0x10')]);return _0x3de006(_0x834937[_0x0b79('0xe')]['message']);}else{logger[_0x0b79('0x9')](_0x0b79('0x11'),_0x69b376,'request\x20sent');_0x3de006(_0x834937[_0x0b79('0x12')][_0x0b79('0x10')]);}})[_0x0b79('0x13')](function(_0x43259e){logger[_0x0b79('0xe')](_0x0b79('0x11'),_0x69b376,_0x43259e);_0x301de6(_0x43259e);});});}exports[_0x0b79('0x14')]=function(_0x316ebb){var _0x55bc36=this;return new Promise(function(_0x49909d,_0x4e7614){return db[_0x0b79('0x15')][_0x0b79('0x16')]({'raw':_0x316ebb[_0x0b79('0x17')]?_0x316ebb['options'][_0x0b79('0x18')]===undefined?!![]:![]:!![],'where':_0x316ebb['options']?_0x316ebb[_0x0b79('0x17')][_0x0b79('0x19')]||null:null,'attributes':_0x316ebb[_0x0b79('0x17')]?_0x316ebb['options'][_0x0b79('0x1a')]||null:null,'limit':_0x316ebb[_0x0b79('0x17')]?_0x316ebb[_0x0b79('0x17')]['limit']||null:null,'include':_0x316ebb[_0x0b79('0x17')]?_0x316ebb['options']['include']?_[_0x0b79('0x1b')](_0x316ebb['options'][_0x0b79('0x1c')],function(_0x235a7f){return{'model':db[_0x235a7f[_0x0b79('0x1d')]],'as':_0x235a7f['as'],'attributes':_0x235a7f[_0x0b79('0x1a')],'include':_0x235a7f['include']?_[_0x0b79('0x1b')](_0x235a7f[_0x0b79('0x1c')],function(_0x409db2){return{'model':db[_0x409db2[_0x0b79('0x1d')]],'as':_0x409db2['as'],'attributes':_0x409db2[_0x0b79('0x1a')],'include':_0x409db2[_0x0b79('0x1c')]?_[_0x0b79('0x1b')](_0x409db2[_0x0b79('0x1c')],function(_0x39b034){return{'model':db[_0x39b034[_0x0b79('0x1d')]],'as':_0x39b034['as'],'attributes':_0x39b034[_0x0b79('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b79('0x8')](function(_0x1cf7f7){logger['info'](_0x0b79('0x14'),_0x316ebb);logger[_0x0b79('0xa')](_0x0b79('0x14'),_0x316ebb,JSON[_0x0b79('0xd')](_0x1cf7f7));_0x49909d(_0x1cf7f7);})['catch'](function(_0x47cdf2){logger[_0x0b79('0xe')]('GetCampaign',_0x47cdf2[_0x0b79('0x10')],_0x316ebb);_0x4e7614(_0x55bc36['error'](0x1f4,_0x47cdf2[_0x0b79('0x10')]));});});};
\ No newline at end of file
+var _0x8fed=['include','model','map','then','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCampaign','options','where','attributes','limit'];(function(_0x25bbc2,_0x25465e){var _0x497c91=function(_0xcc907f){while(--_0xcc907f){_0x25bbc2['push'](_0x25bbc2['shift']());}};_0x497c91(++_0x25465e);}(_0x8fed,0xf5));var _0xd8fe=function(_0x15983d,_0x14dc19){_0x15983d=_0x15983d-0x0;var _0x3ae35d=_0x8fed[_0x15983d];return _0x3ae35d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd8fe('0x0'));var BPromise=require(_0xd8fe('0x1'));var rs=require(_0xd8fe('0x2'));var fs=require('fs');var Redis=require(_0xd8fe('0x3'));var db=require(_0xd8fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8fe('0x5'))(_0xd8fe('0x6'));var config=require(_0xd8fe('0x7'));var jayson=require(_0xd8fe('0x8'));var client=jayson[_0xd8fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7e3b94,_0x1747b3,_0xa33e22){return new BPromise(function(_0x26d33d,_0x5e48f9){return client[_0xd8fe('0xa')](_0x7e3b94,_0xa33e22)['then'](function(_0x410d44){logger[_0xd8fe('0xb')](_0xd8fe('0xc'),_0x1747b3,_0xd8fe('0xd'));logger[_0xd8fe('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1747b3,_0xd8fe('0xd'),JSON[_0xd8fe('0xf')](_0x410d44));if(_0x410d44[_0xd8fe('0x10')]){if(_0x410d44['error'][_0xd8fe('0x11')]===0x1f4){logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);return _0x5e48f9(_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);}logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x410d44[_0xd8fe('0x10')]['message']);return _0x26d33d(_0x410d44[_0xd8fe('0x10')][_0xd8fe('0x12')]);}else{logger[_0xd8fe('0xb')](_0xd8fe('0xc'),_0x1747b3,_0xd8fe('0xd'));_0x26d33d(_0x410d44[_0xd8fe('0x13')][_0xd8fe('0x12')]);}})['catch'](function(_0x260a7f){logger['error'](_0xd8fe('0xc'),_0x1747b3,_0x260a7f);_0x5e48f9(_0x260a7f);});});}exports[_0xd8fe('0x14')]=function(_0x4cfb98){var _0x31a5d7=this;return new Promise(function(_0x4b7d9e,_0x52a8b6){return db['Campaign']['findAll']({'raw':_0x4cfb98['options']?_0x4cfb98[_0xd8fe('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4cfb98[_0xd8fe('0x15')]?_0x4cfb98['options'][_0xd8fe('0x16')]||null:null,'attributes':_0x4cfb98['options']?_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x17')]||null:null,'limit':_0x4cfb98[_0xd8fe('0x15')]?_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x18')]||null:null,'include':_0x4cfb98[_0xd8fe('0x15')]?_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x19')]?_['map'](_0x4cfb98[_0xd8fe('0x15')][_0xd8fe('0x19')],function(_0x19d4d1){return{'model':db[_0x19d4d1[_0xd8fe('0x1a')]],'as':_0x19d4d1['as'],'attributes':_0x19d4d1['attributes'],'include':_0x19d4d1[_0xd8fe('0x19')]?_[_0xd8fe('0x1b')](_0x19d4d1[_0xd8fe('0x19')],function(_0x130c16){return{'model':db[_0x130c16[_0xd8fe('0x1a')]],'as':_0x130c16['as'],'attributes':_0x130c16[_0xd8fe('0x17')],'include':_0x130c16['include']?_['map'](_0x130c16[_0xd8fe('0x19')],function(_0x22ef87){return{'model':db[_0x22ef87[_0xd8fe('0x1a')]],'as':_0x22ef87['as'],'attributes':_0x22ef87[_0xd8fe('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd8fe('0x1c')](function(_0x1666e4){logger[_0xd8fe('0xb')](_0xd8fe('0x14'),_0x4cfb98);logger[_0xd8fe('0xe')](_0xd8fe('0x14'),_0x4cfb98,JSON[_0xd8fe('0xf')](_0x1666e4));_0x4b7d9e(_0x1666e4);})[_0xd8fe('0x1d')](function(_0x2c2767){logger[_0xd8fe('0x10')]('GetCampaign',_0x2c2767[_0xd8fe('0x12')],_0x4cfb98);_0x52a8b6(_0x31a5d7[_0xd8fe('0x10')](0x1f4,_0x2c2767[_0xd8fe('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index cf25a17..e914044 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 _0xd5bf=['getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists'];(function(_0x4fc326,_0x43d83b){var _0x454b5c=function(_0x166dd4){while(--_0x166dd4){_0x4fc326['push'](_0x4fc326['shift']());}};_0x454b5c(++_0x43d83b);}(_0xd5bf,0x66));var _0xfd5b=function(_0x2c12d7,_0x3074ae){_0x2c12d7=_0x2c12d7-0x0;var _0x9e469a=_0xd5bf[_0x2c12d7];return _0x9e469a;};'use strict';var multer=require(_0xfd5b('0x0'));var util=require(_0xfd5b('0x1'));var path=require(_0xfd5b('0x2'));var timeout=require(_0xfd5b('0x3'));var express=require(_0xfd5b('0x4'));var router=express[_0xfd5b('0x5')]();var fs_extra=require(_0xfd5b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd5b('0x7'));var controller=require(_0xfd5b('0x8'));router[_0xfd5b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfd5b('0x9')](_0xfd5b('0xa'),auth[_0xfd5b('0xb')](),controller['show']);router[_0xfd5b('0x9')](_0xfd5b('0xc'),auth['isAuthenticated'](),controller[_0xfd5b('0xd')]);router[_0xfd5b('0x9')]('/:id/hopper_histories',auth[_0xfd5b('0xb')](),controller['getHopperHistories']);router[_0xfd5b('0x9')]('/:id/hopper_finals',auth[_0xfd5b('0xb')](),controller['getHopperFinals']);router[_0xfd5b('0x9')](_0xfd5b('0xe'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xfd5b('0x9')](_0xfd5b('0xf'),auth['isAuthenticated'](),controller[_0xfd5b('0x10')]);router[_0xfd5b('0x9')](_0xfd5b('0x11'),auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x12')]);router[_0xfd5b('0x13')]('/',auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x14')]);router[_0xfd5b('0x13')](_0xfd5b('0x15'),auth['isAuthenticated'](),controller[_0xfd5b('0x16')]);router[_0xfd5b('0x13')](_0xfd5b('0xf'),auth[_0xfd5b('0xb')](),controller['addLists']);router[_0xfd5b('0x13')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xfd5b('0x17')]);router[_0xfd5b('0x18')](_0xfd5b('0xa'),auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x19')]);router['delete']('/:id',auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x1a')]);router[_0xfd5b('0x1b')](_0xfd5b('0xf'),auth[_0xfd5b('0xb')](),controller['removeLists']);router[_0xfd5b('0x1b')](_0xfd5b('0x11'),auth[_0xfd5b('0xb')](),controller[_0xfd5b('0x1c')]);module[_0xfd5b('0x1d')]=router;
\ No newline at end of file
+var _0x59a2=['multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','/:id/clone','addLists','post','addBlackLists','put','delete','removeLists','exports'];(function(_0x37fca1,_0xdc30d5){var _0x2d13d9=function(_0x338dbe){while(--_0x338dbe){_0x37fca1['push'](_0x37fca1['shift']());}};_0x2d13d9(++_0xdc30d5);}(_0x59a2,0x1dc));var _0x259a=function(_0x43ad88,_0x553f6d){_0x43ad88=_0x43ad88-0x0;var _0x34c595=_0x59a2[_0x43ad88];return _0x34c595;};'use strict';var multer=require(_0x259a('0x0'));var util=require(_0x259a('0x1'));var path=require(_0x259a('0x2'));var timeout=require('connect-timeout');var express=require(_0x259a('0x3'));var router=express['Router']();var fs_extra=require(_0x259a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x259a('0x5'));var config=require(_0x259a('0x6'));var controller=require('./campaign.controller');router[_0x259a('0x7')]('/',auth[_0x259a('0x8')](),controller['index']);router[_0x259a('0x7')](_0x259a('0x9'),auth[_0x259a('0x8')](),controller['show']);router[_0x259a('0x7')](_0x259a('0xa'),auth[_0x259a('0x8')](),controller['getHoppers']);router[_0x259a('0x7')]('/:id/hopper_histories',auth[_0x259a('0x8')](),controller[_0x259a('0xb')]);router[_0x259a('0x7')](_0x259a('0xc'),auth[_0x259a('0x8')](),controller[_0x259a('0xd')]);router['get']('/:id/hopper_black',auth[_0x259a('0x8')](),controller[_0x259a('0xe')]);router[_0x259a('0x7')](_0x259a('0xf'),auth[_0x259a('0x8')](),controller[_0x259a('0x10')]);router['get'](_0x259a('0x11'),auth['isAuthenticated'](),controller[_0x259a('0x12')]);router['post']('/',auth[_0x259a('0x8')](),controller[_0x259a('0x13')]);router['post'](_0x259a('0x14'),auth['isAuthenticated'](),controller['clone']);router['post']('/:id/lists',auth[_0x259a('0x8')](),controller[_0x259a('0x15')]);router[_0x259a('0x16')]('/:id/blacklists',auth[_0x259a('0x8')](),controller[_0x259a('0x17')]);router[_0x259a('0x18')](_0x259a('0x9'),auth[_0x259a('0x8')](),controller['update']);router[_0x259a('0x19')]('/:id',auth[_0x259a('0x8')](),controller['destroy']);router[_0x259a('0x19')](_0x259a('0xf'),auth[_0x259a('0x8')](),controller[_0x259a('0x1a')]);router['delete'](_0x259a('0x11'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x259a('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 47668a8..faf08ae 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 _0x4a5b=['STRING','TEXT','VIRTUAL','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4a5b,0x9e));var _0xb4a5=function(_0x33e2c1,_0x4654c1){_0x33e2c1=_0x33e2c1-0x0;var _0x15c67b=_0x4a5b[_0x33e2c1];return _0x15c67b;};'use strict';var Sequelize=require(_0xb4a5('0x0'));module[_0xb4a5('0x1')]={'key':{'type':Sequelize[_0xb4a5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb4a5('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb4a5('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x250d=['getDataValue','STRING','TEXT','VIRTUAL'];(function(_0xaa7b3e,_0x9c8790){var _0x189e2b=function(_0x114af4){while(--_0x114af4){_0xaa7b3e['push'](_0xaa7b3e['shift']());}};_0x189e2b(++_0x9c8790);}(_0x250d,0x1ad));var _0xd250=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x250d[_0x57fa33];return _0x12e724;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0xd250('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0xd250('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd250('0x0')]},'name':{'type':Sequelize[_0xd250('0x2')],'get':function(){return this[_0xd250('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index fd2c757..3b78723 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 _0x6952=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','Content-Range','apply','reject','save','update','destroy','then','CannedAnswers','stack','name','index','map','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','filter','options','count','findAll','rows','catch','show','keys','CannedAnswer','includeAll','find','body','params','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x255b94,_0x352b45){var _0xc5806b=function(_0x530e79){while(--_0x530e79){_0x255b94['push'](_0x255b94['shift']());}};_0xc5806b(++_0x352b45);}(_0x6952,0x167));var _0x2695=function(_0xbbc00b,_0x490793){_0xbbc00b=_0xbbc00b-0x0;var _0x514753=_0x6952[_0xbbc00b];return _0x514753;};'use strict';var emlformat=require(_0x2695('0x0'));var rimraf=require(_0x2695('0x1'));var zipdir=require(_0x2695('0x2'));var jsonpatch=require(_0x2695('0x3'));var rp=require(_0x2695('0x4'));var moment=require(_0x2695('0x5'));var BPromise=require(_0x2695('0x6'));var Mustache=require(_0x2695('0x7'));var util=require(_0x2695('0x8'));var path=require(_0x2695('0x9'));var sox=require(_0x2695('0xa'));var csv=require(_0x2695('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2695('0xc'));var _=require(_0x2695('0xd'));var squel=require(_0x2695('0xe'));var crypto=require(_0x2695('0xf'));var jsforce=require(_0x2695('0x10'));var deskjs=require(_0x2695('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2695('0x12'));var Papa=require(_0x2695('0x13'));var Redis=require(_0x2695('0x14'));var authService=require(_0x2695('0x15'));var qs=require(_0x2695('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2695('0x17'))(_0x2695('0x18'));var utils=require(_0x2695('0x19'));var config=require(_0x2695('0x1a'));var licenseUtil=require(_0x2695('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fc6a9,_0x21b5f5){_0x21b5f5=_0x21b5f5||0xcc;return function(_0x1704a9){if(_0x1704a9){return _0x3fc6a9[_0x2695('0x1c')](_0x21b5f5);}return _0x3fc6a9[_0x2695('0x1d')](_0x21b5f5)[_0x2695('0x1e')]();};}function respondWithResult(_0x21145a,_0x368c09){_0x368c09=_0x368c09||0xc8;return function(_0x5097cc){if(_0x5097cc){return _0x21145a[_0x2695('0x1d')](_0x368c09)['json'](_0x5097cc);}};}function respondWithFilteredResult(_0x2b27ee,_0x3f51f6){return function(_0x2270d0){if(_0x2270d0){var _0x17d758=typeof _0x3f51f6['offset']===_0x2695('0x1f')&&typeof _0x3f51f6[_0x2695('0x20')]==='undefined';var _0x42bbe6=_0x2270d0['count'];var _0x476504=_0x17d758?0x0:_0x3f51f6['offset'];var _0x520a4c=_0x17d758?_0x2270d0['count']:_0x3f51f6[_0x2695('0x21')]+_0x3f51f6[_0x2695('0x20')];var _0x4eb111;if(_0x520a4c>=_0x42bbe6){_0x520a4c=_0x42bbe6;_0x4eb111=0xc8;}else{_0x4eb111=0xce;}_0x2b27ee[_0x2695('0x1d')](_0x4eb111);return _0x2b27ee['set'](_0x2695('0x22'),_0x476504+'-'+_0x520a4c+'/'+_0x42bbe6)['json'](_0x2270d0);}return null;};}function patchUpdates(_0x377601){return function(_0x3f1e07){try{jsonpatch[_0x2695('0x23')](_0x3f1e07,_0x377601,!![]);}catch(_0x331157){return BPromise[_0x2695('0x24')](_0x331157);}return _0x3f1e07[_0x2695('0x25')]();};}function saveUpdates(_0x506681,_0x47aeb1){return function(_0x56b7b9){if(_0x56b7b9){return _0x56b7b9[_0x2695('0x26')](_0x506681)['then'](function(_0x2de07b){return _0x2de07b;});}return null;};}function removeEntity(_0x46eff7,_0x528064){return function(_0x82e342){if(_0x82e342){return _0x82e342[_0x2695('0x27')]()[_0x2695('0x28')](function(){var _0x56ec01=_0x82e342['get']({'plain':!![]});var _0x5cdaf1=_0x2695('0x29');return db['UserProfileResource'][_0x2695('0x27')]({'where':{'type':_0x5cdaf1,'resourceId':_0x56ec01['id']}})[_0x2695('0x28')](function(){return _0x82e342;});})[_0x2695('0x28')](function(){_0x46eff7[_0x2695('0x1d')](0xcc)[_0x2695('0x1e')]();});}};}function handleEntityNotFound(_0x1eb307,_0x2b117c){return function(_0x1b7320){if(!_0x1b7320){_0x1eb307[_0x2695('0x1c')](0x194);}return _0x1b7320;};}function handleError(_0x5e92e1,_0x3f258f){_0x3f258f=_0x3f258f||0x1f4;return function(_0x2842f6){logger['error'](_0x2842f6[_0x2695('0x2a')]);if(_0x2842f6[_0x2695('0x2b')]){delete _0x2842f6[_0x2695('0x2b')];}_0x5e92e1[_0x2695('0x1d')](_0x3f258f)['send'](_0x2842f6);};}exports[_0x2695('0x2c')]=function(_0x23735e,_0x5cc522){var _0x15c3e7={},_0x4a11e7={},_0x124797={'count':0x0,'rows':[]};var _0xa44419=_[_0x2695('0x2d')](db['CannedAnswer'][_0x2695('0x2e')],function(_0xf867ee){return{'name':_0xf867ee[_0x2695('0x2f')],'type':_0xf867ee[_0x2695('0x30')][_0x2695('0x31')]};});_0x4a11e7['model']=_[_0x2695('0x2d')](_0xa44419,_0x2695('0x2b'));_0x4a11e7['query']=_['keys'](_0x23735e[_0x2695('0x32')]);_0x4a11e7['filters']=_['intersection'](_0x4a11e7[_0x2695('0x33')],_0x4a11e7[_0x2695('0x32')]);_0x15c3e7[_0x2695('0x34')]=_[_0x2695('0x35')](_0x4a11e7[_0x2695('0x33')],qs[_0x2695('0x36')](_0x23735e[_0x2695('0x32')][_0x2695('0x36')]));_0x15c3e7[_0x2695('0x34')]=_0x15c3e7[_0x2695('0x34')][_0x2695('0x37')]?_0x15c3e7[_0x2695('0x34')]:_0x4a11e7['model'];if(!_0x23735e[_0x2695('0x32')][_0x2695('0x38')](_0x2695('0x39'))){_0x15c3e7[_0x2695('0x20')]=qs[_0x2695('0x20')](_0x23735e['query'][_0x2695('0x20')]);_0x15c3e7[_0x2695('0x21')]=qs['offset'](_0x23735e[_0x2695('0x32')]['offset']);}_0x15c3e7['order']=qs[_0x2695('0x3a')](_0x23735e[_0x2695('0x32')][_0x2695('0x3a')]);_0x15c3e7[_0x2695('0x3b')]=qs['filters'](_[_0x2695('0x3c')](_0x23735e['query'],_0x4a11e7[_0x2695('0x3d')]),_0xa44419);if(_0x23735e['query']['filter']){_0x15c3e7[_0x2695('0x3b')]=_[_0x2695('0x3e')](_0x15c3e7[_0x2695('0x3b')],{'$or':[{'key':{'$like':'%'+_0x23735e[_0x2695('0x32')][_0x2695('0x3f')]+'%'}},{'value':{'$like':'%'+_0x23735e['query']['filter']+'%'}}]});}_0x15c3e7=_['merge']({},_0x15c3e7,_0x23735e[_0x2695('0x40')]);var _0x2a62fb={'where':_0x15c3e7[_0x2695('0x3b')]};return db['CannedAnswer'][_0x2695('0x41')](_0x2a62fb)[_0x2695('0x28')](function(_0x216a24){_0x124797[_0x2695('0x41')]=_0x216a24;if(_0x23735e['query']['includeAll']){_0x15c3e7['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x2695('0x42')](_0x15c3e7);})[_0x2695('0x28')](function(_0x39a5b3){_0x124797[_0x2695('0x43')]=_0x39a5b3;return _0x124797;})[_0x2695('0x28')](respondWithFilteredResult(_0x5cc522,_0x15c3e7))[_0x2695('0x44')](handleError(_0x5cc522,null));};exports[_0x2695('0x45')]=function(_0x9bb8fe,_0x44952f){var _0x5a4604={'raw':!![],'where':{'id':_0x9bb8fe['params']['id']}},_0x22364b={};_0x22364b[_0x2695('0x33')]=_[_0x2695('0x46')](db[_0x2695('0x47')][_0x2695('0x2e')]);_0x22364b[_0x2695('0x32')]=_[_0x2695('0x46')](_0x9bb8fe[_0x2695('0x32')]);_0x22364b[_0x2695('0x3d')]=_[_0x2695('0x35')](_0x22364b[_0x2695('0x33')],_0x22364b[_0x2695('0x32')]);_0x5a4604[_0x2695('0x34')]=_['intersection'](_0x22364b[_0x2695('0x33')],qs[_0x2695('0x36')](_0x9bb8fe[_0x2695('0x32')][_0x2695('0x36')]));_0x5a4604[_0x2695('0x34')]=_0x5a4604[_0x2695('0x34')]['length']?_0x5a4604[_0x2695('0x34')]:_0x22364b[_0x2695('0x33')];if(_0x9bb8fe[_0x2695('0x32')][_0x2695('0x48')]){_0x5a4604['include']=[{'all':!![]}];}_0x5a4604=_[_0x2695('0x3e')]({},_0x5a4604,_0x9bb8fe[_0x2695('0x40')]);return db['CannedAnswer'][_0x2695('0x49')](_0x5a4604)[_0x2695('0x28')](handleEntityNotFound(_0x44952f,null))[_0x2695('0x28')](respondWithResult(_0x44952f,null))[_0x2695('0x44')](handleError(_0x44952f,null));};exports[_0x2695('0x26')]=function(_0xcaeeea,_0x1e4eb5){if(_0xcaeeea[_0x2695('0x4a')]['id']){delete _0xcaeeea[_0x2695('0x4a')]['id'];}return db[_0x2695('0x47')][_0x2695('0x49')]({'where':{'id':_0xcaeeea['params']['id']}})[_0x2695('0x28')](handleEntityNotFound(_0x1e4eb5,null))[_0x2695('0x28')](saveUpdates(_0xcaeeea['body'],null))[_0x2695('0x28')](respondWithResult(_0x1e4eb5,null))[_0x2695('0x44')](handleError(_0x1e4eb5,null));};exports[_0x2695('0x27')]=function(_0x26bba5,_0x35bdad){return db[_0x2695('0x47')][_0x2695('0x49')]({'where':{'id':_0x26bba5[_0x2695('0x4b')]['id']}})[_0x2695('0x28')](handleEntityNotFound(_0x35bdad,null))[_0x2695('0x28')](removeEntity(_0x35bdad,null))[_0x2695('0x44')](handleError(_0x35bdad,null));};exports['create']=function(_0x3f4cc5,_0x2d50f2){var _0x39d297={'key':_0x3f4cc5[_0x2695('0x4a')][_0x2695('0x31')]};if(_0x3f4cc5[_0x2695('0x4a')][_0x2695('0x4c')]){_0x39d297[_0x2695('0x4c')]=_0x3f4cc5[_0x2695('0x4a')]['MailAccountId'];}else if(_0x3f4cc5['body'][_0x2695('0x4d')]){_0x39d297[_0x2695('0x4d')]=_0x3f4cc5['body'][_0x2695('0x4d')];}else if(_0x3f4cc5[_0x2695('0x4a')]['OpenchannelAccountId']){_0x39d297['OpenchannelAccountId']=_0x3f4cc5[_0x2695('0x4a')]['OpenchannelAccountId'];}else if(_0x3f4cc5[_0x2695('0x4a')]['ChatWebsiteId']){_0x39d297[_0x2695('0x4e')]=_0x3f4cc5[_0x2695('0x4a')]['ChatWebsiteId'];}return db[_0x2695('0x47')][_0x2695('0x49')]({'where':_0x39d297})[_0x2695('0x28')](function(_0x515416){if(_0x515416){throw new db[(_0x2695('0x4f'))][(_0x2695('0x50'))](_0x2695('0x51'));}return db[_0x2695('0x47')][_0x2695('0x52')](_0x3f4cc5[_0x2695('0x4a')]);})[_0x2695('0x28')](function(_0x27ef0d){var _0x5c85a3=_0x3f4cc5[_0x2695('0x53')]['get']({'plain':!![]});if(!_0x5c85a3)throw new Error(_0x2695('0x54'));if(_0x5c85a3[_0x2695('0x55')]==='user'){var _0x19fc00=_0x27ef0d[_0x2695('0x56')]({'plain':!![]});return db['UserProfileSection'][_0x2695('0x49')]({'where':{'name':_0x2695('0x29'),'userProfileId':_0x5c85a3[_0x2695('0x57')]},'raw':!![]})[_0x2695('0x28')](function(_0x3ced96){if(_0x3ced96&&_0x3ced96[_0x2695('0x58')]===0x0){return db[_0x2695('0x59')][_0x2695('0x52')]({'name':_0x19fc00[_0x2695('0x2b')],'resourceId':_0x19fc00['id'],'type':_0x3ced96[_0x2695('0x2b')],'sectionId':_0x3ced96['id']},{})[_0x2695('0x28')](function(){return _0x27ef0d;});}else{return _0x27ef0d;}})[_0x2695('0x44')](function(_0x4b53bc){logger[_0x2695('0x5a')](_0x2695('0x5b'),_0x4b53bc);throw _0x4b53bc;});}return _0x27ef0d;})[_0x2695('0x28')](respondWithResult(_0x2d50f2,0xc9))[_0x2695('0x44')](handleError(_0x2d50f2,null));};
\ No newline at end of file
+var _0xf1d8=['params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1d8,0x171));var _0x8f1d=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0xf1d8[_0x3d00db];return _0x41f115;};'use strict';var emlformat=require(_0x8f1d('0x0'));var rimraf=require(_0x8f1d('0x1'));var zipdir=require(_0x8f1d('0x2'));var jsonpatch=require(_0x8f1d('0x3'));var rp=require(_0x8f1d('0x4'));var moment=require('moment');var BPromise=require(_0x8f1d('0x5'));var Mustache=require('mustache');var util=require(_0x8f1d('0x6'));var path=require(_0x8f1d('0x7'));var sox=require(_0x8f1d('0x8'));var csv=require(_0x8f1d('0x9'));var ejs=require(_0x8f1d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f1d('0xb'));var squel=require(_0x8f1d('0xc'));var crypto=require(_0x8f1d('0xd'));var jsforce=require(_0x8f1d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8f1d('0x9'));var querystring=require(_0x8f1d('0xf'));var Papa=require(_0x8f1d('0x10'));var Redis=require(_0x8f1d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8f1d('0x12'));var as=require(_0x8f1d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f1d('0x14'))(_0x8f1d('0x15'));var utils=require('../../config/utils');var config=require(_0x8f1d('0x16'));var licenseUtil=require(_0x8f1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bd430,_0x3628b1){_0x3628b1=_0x3628b1||0xcc;return function(_0x1fe9c4){if(_0x1fe9c4){return _0x1bd430[_0x8f1d('0x18')](_0x3628b1);}return _0x1bd430[_0x8f1d('0x19')](_0x3628b1)[_0x8f1d('0x1a')]();};}function respondWithResult(_0x135571,_0x38a226){_0x38a226=_0x38a226||0xc8;return function(_0x5c6de0){if(_0x5c6de0){return _0x135571[_0x8f1d('0x19')](_0x38a226)[_0x8f1d('0x1b')](_0x5c6de0);}};}function respondWithFilteredResult(_0x4ae853,_0x526353){return function(_0x493c2e){if(_0x493c2e){var _0x2ea8e3=typeof _0x526353[_0x8f1d('0x1c')]==='undefined'&&typeof _0x526353[_0x8f1d('0x1d')]===_0x8f1d('0x1e');var _0x5de51a=_0x493c2e[_0x8f1d('0x1f')];var _0x5a551d=_0x2ea8e3?0x0:_0x526353[_0x8f1d('0x1c')];var _0x4c55a6=_0x2ea8e3?_0x493c2e[_0x8f1d('0x1f')]:_0x526353['offset']+_0x526353[_0x8f1d('0x1d')];var _0x5ef826;if(_0x4c55a6>=_0x5de51a){_0x4c55a6=_0x5de51a;_0x5ef826=0xc8;}else{_0x5ef826=0xce;}_0x4ae853[_0x8f1d('0x19')](_0x5ef826);return _0x4ae853[_0x8f1d('0x20')](_0x8f1d('0x21'),_0x5a551d+'-'+_0x4c55a6+'/'+_0x5de51a)['json'](_0x493c2e);}return null;};}function patchUpdates(_0x17df9b){return function(_0x11aaa8){try{jsonpatch[_0x8f1d('0x22')](_0x11aaa8,_0x17df9b,!![]);}catch(_0x1afc11){return BPromise[_0x8f1d('0x23')](_0x1afc11);}return _0x11aaa8[_0x8f1d('0x24')]();};}function saveUpdates(_0x3d5a74,_0x733c16){return function(_0x51de56){if(_0x51de56){return _0x51de56[_0x8f1d('0x25')](_0x3d5a74)['then'](function(_0x2a3296){return _0x2a3296;});}return null;};}function removeEntity(_0x1f56b1,_0x2a5b3e){return function(_0x18084f){if(_0x18084f){return _0x18084f[_0x8f1d('0x26')]()[_0x8f1d('0x27')](function(){var _0x43a5aa=_0x18084f[_0x8f1d('0x28')]({'plain':!![]});var _0x3463ab=_0x8f1d('0x29');return db[_0x8f1d('0x2a')][_0x8f1d('0x26')]({'where':{'type':_0x3463ab,'resourceId':_0x43a5aa['id']}})['then'](function(){return _0x18084f;});})[_0x8f1d('0x27')](function(){_0x1f56b1['status'](0xcc)[_0x8f1d('0x1a')]();});}};}function handleEntityNotFound(_0x3055c5,_0x50542a){return function(_0x335415){if(!_0x335415){_0x3055c5[_0x8f1d('0x18')](0x194);}return _0x335415;};}function handleError(_0x13f696,_0x8f6c76){_0x8f6c76=_0x8f6c76||0x1f4;return function(_0x26f2de){logger['error'](_0x26f2de[_0x8f1d('0x2b')]);if(_0x26f2de[_0x8f1d('0x2c')]){delete _0x26f2de[_0x8f1d('0x2c')];}_0x13f696[_0x8f1d('0x19')](_0x8f6c76)['send'](_0x26f2de);};}exports['index']=function(_0x21e013,_0x2f7563){var _0x97fa8f={},_0x7ceb0f={},_0x14f1c8={'count':0x0,'rows':[]};var _0x8c0ef=_[_0x8f1d('0x2d')](db[_0x8f1d('0x2e')][_0x8f1d('0x2f')],function(_0x3c4d2d){return{'name':_0x3c4d2d[_0x8f1d('0x30')],'type':_0x3c4d2d[_0x8f1d('0x31')][_0x8f1d('0x32')]};});_0x7ceb0f[_0x8f1d('0x33')]=_['map'](_0x8c0ef,_0x8f1d('0x2c'));_0x7ceb0f['query']=_[_0x8f1d('0x34')](_0x21e013[_0x8f1d('0x35')]);_0x7ceb0f[_0x8f1d('0x36')]=_[_0x8f1d('0x37')](_0x7ceb0f[_0x8f1d('0x33')],_0x7ceb0f[_0x8f1d('0x35')]);_0x97fa8f[_0x8f1d('0x38')]=_[_0x8f1d('0x37')](_0x7ceb0f[_0x8f1d('0x33')],qs[_0x8f1d('0x39')](_0x21e013[_0x8f1d('0x35')][_0x8f1d('0x39')]));_0x97fa8f[_0x8f1d('0x38')]=_0x97fa8f[_0x8f1d('0x38')][_0x8f1d('0x3a')]?_0x97fa8f[_0x8f1d('0x38')]:_0x7ceb0f['model'];if(!_0x21e013[_0x8f1d('0x35')]['hasOwnProperty'](_0x8f1d('0x3b'))){_0x97fa8f[_0x8f1d('0x1d')]=qs[_0x8f1d('0x1d')](_0x21e013[_0x8f1d('0x35')][_0x8f1d('0x1d')]);_0x97fa8f[_0x8f1d('0x1c')]=qs[_0x8f1d('0x1c')](_0x21e013[_0x8f1d('0x35')]['offset']);}_0x97fa8f[_0x8f1d('0x3c')]=qs['sort'](_0x21e013[_0x8f1d('0x35')][_0x8f1d('0x3d')]);_0x97fa8f[_0x8f1d('0x3e')]=qs[_0x8f1d('0x36')](_[_0x8f1d('0x3f')](_0x21e013[_0x8f1d('0x35')],_0x7ceb0f[_0x8f1d('0x36')]),_0x8c0ef);if(_0x21e013['query'][_0x8f1d('0x40')]){_0x97fa8f[_0x8f1d('0x3e')]=_[_0x8f1d('0x41')](_0x97fa8f[_0x8f1d('0x3e')],{'$or':[{'key':{'$like':'%'+_0x21e013[_0x8f1d('0x35')][_0x8f1d('0x40')]+'%'}},{'value':{'$like':'%'+_0x21e013[_0x8f1d('0x35')][_0x8f1d('0x40')]+'%'}}]});}_0x97fa8f=_[_0x8f1d('0x41')]({},_0x97fa8f,_0x21e013[_0x8f1d('0x42')]);var _0x306ece={'where':_0x97fa8f[_0x8f1d('0x3e')]};return db[_0x8f1d('0x2e')][_0x8f1d('0x1f')](_0x306ece)[_0x8f1d('0x27')](function(_0x278cf2){_0x14f1c8[_0x8f1d('0x1f')]=_0x278cf2;if(_0x21e013[_0x8f1d('0x35')][_0x8f1d('0x43')]){_0x97fa8f[_0x8f1d('0x44')]=[{'all':!![]}];}return db[_0x8f1d('0x2e')]['findAll'](_0x97fa8f);})[_0x8f1d('0x27')](function(_0x30600d){_0x14f1c8['rows']=_0x30600d;return _0x14f1c8;})['then'](respondWithFilteredResult(_0x2f7563,_0x97fa8f))[_0x8f1d('0x45')](handleError(_0x2f7563,null));};exports[_0x8f1d('0x46')]=function(_0x350a4d,_0x3ff54e){var _0x180819={'raw':!![],'where':{'id':_0x350a4d[_0x8f1d('0x47')]['id']}},_0x28b1d3={};_0x28b1d3[_0x8f1d('0x33')]=_[_0x8f1d('0x34')](db[_0x8f1d('0x2e')]['rawAttributes']);_0x28b1d3[_0x8f1d('0x35')]=_[_0x8f1d('0x34')](_0x350a4d[_0x8f1d('0x35')]);_0x28b1d3['filters']=_[_0x8f1d('0x37')](_0x28b1d3[_0x8f1d('0x33')],_0x28b1d3[_0x8f1d('0x35')]);_0x180819[_0x8f1d('0x38')]=_[_0x8f1d('0x37')](_0x28b1d3[_0x8f1d('0x33')],qs[_0x8f1d('0x39')](_0x350a4d[_0x8f1d('0x35')][_0x8f1d('0x39')]));_0x180819['attributes']=_0x180819['attributes'][_0x8f1d('0x3a')]?_0x180819[_0x8f1d('0x38')]:_0x28b1d3[_0x8f1d('0x33')];if(_0x350a4d['query'][_0x8f1d('0x43')]){_0x180819[_0x8f1d('0x44')]=[{'all':!![]}];}_0x180819=_[_0x8f1d('0x41')]({},_0x180819,_0x350a4d[_0x8f1d('0x42')]);return db[_0x8f1d('0x2e')][_0x8f1d('0x48')](_0x180819)[_0x8f1d('0x27')](handleEntityNotFound(_0x3ff54e,null))[_0x8f1d('0x27')](respondWithResult(_0x3ff54e,null))[_0x8f1d('0x45')](handleError(_0x3ff54e,null));};exports[_0x8f1d('0x25')]=function(_0x1e0826,_0x4e25ca){if(_0x1e0826[_0x8f1d('0x49')]['id']){delete _0x1e0826[_0x8f1d('0x49')]['id'];}return db[_0x8f1d('0x2e')]['find']({'where':{'id':_0x1e0826[_0x8f1d('0x47')]['id']}})[_0x8f1d('0x27')](handleEntityNotFound(_0x4e25ca,null))[_0x8f1d('0x27')](saveUpdates(_0x1e0826[_0x8f1d('0x49')],null))[_0x8f1d('0x27')](respondWithResult(_0x4e25ca,null))['catch'](handleError(_0x4e25ca,null));};exports['destroy']=function(_0x2f1625,_0xbd1ec8){return db['CannedAnswer']['find']({'where':{'id':_0x2f1625['params']['id']}})[_0x8f1d('0x27')](handleEntityNotFound(_0xbd1ec8,null))[_0x8f1d('0x27')](removeEntity(_0xbd1ec8,null))[_0x8f1d('0x45')](handleError(_0xbd1ec8,null));};exports[_0x8f1d('0x4a')]=function(_0x439235,_0x5074ab){var _0x4492c9={'key':_0x439235['body'][_0x8f1d('0x32')]};if(_0x439235[_0x8f1d('0x49')][_0x8f1d('0x4b')]){_0x4492c9['MailAccountId']=_0x439235[_0x8f1d('0x49')][_0x8f1d('0x4b')];}else if(_0x439235[_0x8f1d('0x49')][_0x8f1d('0x4c')]){_0x4492c9['SmsAccountId']=_0x439235['body']['SmsAccountId'];}else if(_0x439235['body'][_0x8f1d('0x4d')]){_0x4492c9[_0x8f1d('0x4d')]=_0x439235[_0x8f1d('0x49')][_0x8f1d('0x4d')];}else if(_0x439235[_0x8f1d('0x49')][_0x8f1d('0x4e')]){_0x4492c9['ChatWebsiteId']=_0x439235['body'][_0x8f1d('0x4e')];}return db[_0x8f1d('0x2e')][_0x8f1d('0x48')]({'where':_0x4492c9})[_0x8f1d('0x27')](function(_0x572174){if(_0x572174){throw new db['Sequelize'][(_0x8f1d('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x8f1d('0x2e')]['create'](_0x439235[_0x8f1d('0x49')]);})[_0x8f1d('0x27')](function(_0xd8385c){var _0xa00beb=_0x439235[_0x8f1d('0x50')][_0x8f1d('0x28')]({'plain':!![]});if(!_0xa00beb)throw new Error(_0x8f1d('0x51'));if(_0xa00beb[_0x8f1d('0x52')]===_0x8f1d('0x50')){var _0x5d4eb0=_0xd8385c['get']({'plain':!![]});return db[_0x8f1d('0x53')][_0x8f1d('0x48')]({'where':{'name':_0x8f1d('0x29'),'userProfileId':_0xa00beb[_0x8f1d('0x54')]},'raw':!![]})['then'](function(_0x4a1250){if(_0x4a1250&&_0x4a1250[_0x8f1d('0x55')]===0x0){return db[_0x8f1d('0x2a')]['create']({'name':_0x5d4eb0['name'],'resourceId':_0x5d4eb0['id'],'type':_0x4a1250[_0x8f1d('0x2c')],'sectionId':_0x4a1250['id']},{})['then'](function(){return _0xd8385c;});}else{return _0xd8385c;}})[_0x8f1d('0x45')](function(_0x3f5189){logger[_0x8f1d('0x56')](_0x8f1d('0x57'),_0x3f5189);throw _0x3f5189;});}return _0xd8385c;})[_0x8f1d('0x27')](respondWithResult(_0x5074ab,0xc9))[_0x8f1d('0x45')](handleError(_0x5074ab,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 72a77ad..676c343 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 _0x7232=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','define'];(function(_0x5dbda2,_0x587e21){var _0xc5cfbe=function(_0x14c28a){while(--_0x14c28a){_0x5dbda2['push'](_0x5dbda2['shift']());}};_0xc5cfbe(++_0x587e21);}(_0x7232,0x13a));var _0x2723=function(_0x3c484c,_0x3f977c){_0x3c484c=_0x3c484c-0x0;var _0x15b3cd=_0x7232[_0x3c484c];return _0x15b3cd;};'use strict';var _=require(_0x2723('0x0'));var util=require('util');var logger=require(_0x2723('0x1'))(_0x2723('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2723('0x3'));var fs=require('fs');var path=require(_0x2723('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x188833,_0x45d0be){return _0x188833[_0x2723('0x5')](_0x2723('0x6'),attributes,{'tableName':_0x2723('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2723('0x8'),'collate':_0x2723('0x9')});};
\ No newline at end of file
+var _0x5015=['request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','lodash','../../config/logger','moment'];(function(_0x15f4f0,_0x2d805b){var _0x4bbd93=function(_0xb6f887){while(--_0xb6f887){_0x15f4f0['push'](_0x15f4f0['shift']());}};_0x4bbd93(++_0x2d805b);}(_0x5015,0x1dd));var _0x5501=function(_0x504575,_0x1e1f2b){_0x504575=_0x504575-0x0;var _0x2e23d9=_0x5015[_0x504575];return _0x2e23d9;};'use strict';var _=require(_0x5501('0x0'));var util=require('util');var logger=require(_0x5501('0x1'))('api');var moment=require(_0x5501('0x2'));var BPromise=require('bluebird');var rp=require(_0x5501('0x3'));var fs=require('fs');var path=require(_0x5501('0x4'));var rimraf=require(_0x5501('0x5'));var config=require(_0x5501('0x6'));var attributes=require(_0x5501('0x7'));module['exports']=function(_0x3880f9,_0x30f989){return _0x3880f9[_0x5501('0x8')]('CannedAnswer',attributes,{'tableName':_0x5501('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 87a2306..b0e1b77 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(_0x41befa,_0x36847c){var _0x394472=function(_0x43e597){while(--_0x43e597){_0x41befa['push'](_0x41befa['shift']());}};_0x394472(++_0x36847c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0xe670c4,_0x1bcb6a){var _0x358cab=function(_0x4933b6){while(--_0x4933b6){_0xe670c4['push'](_0xe670c4['shift']());}};_0x358cab(++_0x1bcb6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 23c82be..d0ab768 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 _0xd517=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0xd517,0x189));var _0x7d51=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0xd517[_0x56608c];return _0x3c7fb0;};'use strict';var multer=require(_0x7d51('0x0'));var util=require(_0x7d51('0x1'));var path=require(_0x7d51('0x2'));var timeout=require(_0x7d51('0x3'));var express=require(_0x7d51('0x4'));var router=express[_0x7d51('0x5')]();var fs_extra=require(_0x7d51('0x6'));var auth=require(_0x7d51('0x7'));var interaction=require(_0x7d51('0x8'));var config=require(_0x7d51('0x9'));var controller=require(_0x7d51('0xa'));router[_0x7d51('0xb')]('/',auth[_0x7d51('0xc')](),controller['index']);router[_0x7d51('0xb')](_0x7d51('0xd'),auth[_0x7d51('0xc')](),controller[_0x7d51('0xe')]);router[_0x7d51('0xf')]('/',auth[_0x7d51('0xc')](),controller['create']);router[_0x7d51('0x10')](_0x7d51('0xd'),auth[_0x7d51('0xc')](),controller[_0x7d51('0x11')]);router[_0x7d51('0x12')](_0x7d51('0xd'),auth[_0x7d51('0xc')](),controller[_0x7d51('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x2d99=['../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x2d99,0xd5));var _0x92d9=function(_0x2c6267,_0x153dc8){_0x2c6267=_0x2c6267-0x0;var _0x418ecd=_0x2d99[_0x2c6267];return _0x418ecd;};'use strict';var multer=require(_0x92d9('0x0'));var util=require(_0x92d9('0x1'));var path=require('path');var timeout=require(_0x92d9('0x2'));var express=require(_0x92d9('0x3'));var router=express[_0x92d9('0x4')]();var fs_extra=require(_0x92d9('0x5'));var auth=require(_0x92d9('0x6'));var interaction=require(_0x92d9('0x7'));var config=require('../../config/environment');var controller=require(_0x92d9('0x8'));router[_0x92d9('0x9')]('/',auth[_0x92d9('0xa')](),controller['index']);router['get'](_0x92d9('0xb'),auth[_0x92d9('0xa')](),controller[_0x92d9('0xc')]);router[_0x92d9('0xd')]('/',auth['isAuthenticated'](),controller[_0x92d9('0xe')]);router[_0x92d9('0xf')](_0x92d9('0xb'),auth[_0x92d9('0xa')](),controller[_0x92d9('0x10')]);router[_0x92d9('0x11')]('/:id',auth[_0x92d9('0xa')](),controller[_0x92d9('0x12')]);module[_0x92d9('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 5243afd..3c24a8e 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 _0x159b=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0xd77bf5,_0x42b453){var _0x48e838=function(_0x32d312){while(--_0x32d312){_0xd77bf5['push'](_0xd77bf5['shift']());}};_0x48e838(++_0x42b453);}(_0x159b,0x181));var _0xb159=function(_0x34badf,_0x5a6187){_0x34badf=_0x34badf-0x0;var _0x39ecd3=_0x159b[_0x34badf];return _0x39ecd3;};'use strict';var Sequelize=require(_0xb159('0x0'));module[_0xb159('0x1')]={'calldate':{'type':Sequelize[_0xb159('0x2')],'allowNull':![],'defaultValue':_0xb159('0x3')},'clid':{'type':Sequelize[_0xb159('0x4')]},'src':{'type':Sequelize[_0xb159('0x4')]},'dst':{'type':Sequelize[_0xb159('0x4')]},'dcontext':{'type':Sequelize[_0xb159('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xb159('0x4')]},'lastapp':{'type':Sequelize[_0xb159('0x4')]},'lastdata':{'type':Sequelize[_0xb159('0x4')]},'duration':{'type':Sequelize[_0xb159('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb159('0x4')]},'amaflags':{'type':Sequelize[_0xb159('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb159('0x4')]},'userfield':{'type':Sequelize[_0xb159('0x4')]},'uniqueid':{'type':Sequelize[_0xb159('0x4')]},'linkedid':{'type':Sequelize[_0xb159('0x4')]},'sequence':{'type':Sequelize[_0xb159('0x4')]},'peeraccount':{'type':Sequelize[_0xb159('0x4')]},'type':{'type':Sequelize[_0xb159('0x4')]},'tag':{'type':Sequelize[_0xb159('0x4')]}};
\ No newline at end of file
+var _0x71f4=['INTEGER','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3c7251,_0x412b17){var _0x469c9a=function(_0x1e3f5b){while(--_0x1e3f5b){_0x3c7251['push'](_0x3c7251['shift']());}};_0x469c9a(++_0x412b17);}(_0x71f4,0xf9));var _0x471f=function(_0x21962c,_0x489a42){_0x21962c=_0x21962c-0x0;var _0x3ca065=_0x71f4[_0x21962c];return _0x3ca065;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x471f('0x0')],'allowNull':![],'defaultValue':_0x471f('0x1')},'clid':{'type':Sequelize[_0x471f('0x2')]},'src':{'type':Sequelize[_0x471f('0x2')]},'dst':{'type':Sequelize[_0x471f('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x471f('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x471f('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x471f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x471f('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x471f('0x2')]},'amaflags':{'type':Sequelize[_0x471f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x471f('0x2')]},'userfield':{'type':Sequelize[_0x471f('0x2')]},'uniqueid':{'type':Sequelize[_0x471f('0x2')]},'linkedid':{'type':Sequelize[_0x471f('0x2')]},'sequence':{'type':Sequelize[_0x471f('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index c7aea68..9cea36b 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 _0xfd87=['desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','filter','merge','where','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x466fb8,_0x50fedd){var _0x26a4a3=function(_0x417316){while(--_0x417316){_0x466fb8['push'](_0x466fb8['shift']());}};_0x26a4a3(++_0x50fedd);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7fd8('0x0'));var rimraf=require(_0x7fd8('0x1'));var zipdir=require(_0x7fd8('0x2'));var jsonpatch=require(_0x7fd8('0x3'));var rp=require(_0x7fd8('0x4'));var moment=require(_0x7fd8('0x5'));var BPromise=require(_0x7fd8('0x6'));var Mustache=require(_0x7fd8('0x7'));var util=require(_0x7fd8('0x8'));var path=require(_0x7fd8('0x9'));var sox=require(_0x7fd8('0xa'));var csv=require('to-csv');var ejs=require(_0x7fd8('0xb'));var fs=require('fs');var fs_extra=require(_0x7fd8('0xc'));var _=require('lodash');var squel=require(_0x7fd8('0xd'));var crypto=require(_0x7fd8('0xe'));var jsforce=require(_0x7fd8('0xf'));var deskjs=require(_0x7fd8('0x10'));var toCsv=require(_0x7fd8('0x11'));var querystring=require('querystring');var Papa=require(_0x7fd8('0x12'));var Redis=require(_0x7fd8('0x13'));var authService=require(_0x7fd8('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fd8('0x15'))('api');var utils=require(_0x7fd8('0x16'));var config=require(_0x7fd8('0x17'));var licenseUtil=require(_0x7fd8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136770,_0x2cccdb){_0x2cccdb=_0x2cccdb||0xcc;return function(_0xe84aa7){if(_0xe84aa7){return _0x136770[_0x7fd8('0x19')](_0x2cccdb);}return _0x136770[_0x7fd8('0x1a')](_0x2cccdb)['end']();};}function respondWithResult(_0x1af365,_0x17a3a1){_0x17a3a1=_0x17a3a1||0xc8;return function(_0x1d481a){if(_0x1d481a){return _0x1af365[_0x7fd8('0x1a')](_0x17a3a1)[_0x7fd8('0x1b')](_0x1d481a);}};}function respondWithFilteredResult(_0x38d45a,_0x1a4a52){return function(_0x33c8f9){if(_0x33c8f9){var _0x2a8818=typeof _0x1a4a52[_0x7fd8('0x1c')]===_0x7fd8('0x1d')&&typeof _0x1a4a52['limit']==='undefined';var _0x5ca7f6=_0x33c8f9[_0x7fd8('0x1e')];var _0xce23dc=_0x2a8818?0x0:_0x1a4a52['offset'];var _0x39e301=_0x2a8818?_0x33c8f9[_0x7fd8('0x1e')]:_0x1a4a52[_0x7fd8('0x1c')]+_0x1a4a52[_0x7fd8('0x1f')];var _0x3ab724;if(_0x39e301>=_0x5ca7f6){_0x39e301=_0x5ca7f6;_0x3ab724=0xc8;}else{_0x3ab724=0xce;}_0x38d45a[_0x7fd8('0x1a')](_0x3ab724);return _0x38d45a[_0x7fd8('0x20')](_0x7fd8('0x21'),_0xce23dc+'-'+_0x39e301+'/'+_0x5ca7f6)['json'](_0x33c8f9);}return null;};}function patchUpdates(_0x34bc09){return function(_0x3b7b49){try{jsonpatch[_0x7fd8('0x22')](_0x3b7b49,_0x34bc09,!![]);}catch(_0x13417d){return BPromise[_0x7fd8('0x23')](_0x13417d);}return _0x3b7b49[_0x7fd8('0x24')]();};}function saveUpdates(_0x4f8563,_0xecd3f3){return function(_0x1d26d4){if(_0x1d26d4){return _0x1d26d4[_0x7fd8('0x25')](_0x4f8563)[_0x7fd8('0x26')](function(_0x52b71a){return _0x52b71a;});}return null;};}function removeEntity(_0x3f71a4,_0x402fa1){return function(_0x2e7520){if(_0x2e7520){return _0x2e7520[_0x7fd8('0x27')]()[_0x7fd8('0x26')](function(){_0x3f71a4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3650cb,_0x6cccad){return function(_0xa273a7){if(!_0xa273a7){_0x3650cb[_0x7fd8('0x19')](0x194);}return _0xa273a7;};}function handleError(_0x17b86a,_0x50f34f){_0x50f34f=_0x50f34f||0x1f4;return function(_0x12bc21){logger[_0x7fd8('0x28')](_0x12bc21[_0x7fd8('0x29')]);if(_0x12bc21[_0x7fd8('0x2a')]){delete _0x12bc21[_0x7fd8('0x2a')];}_0x17b86a['status'](_0x50f34f)['send'](_0x12bc21);};}exports[_0x7fd8('0x2b')]=function(_0x2bd721,_0x3919b1){var _0x4319b8={},_0x573ed0={},_0x4fc63a={'count':0x0,'rows':[]};var _0x8f9a8e=_['map'](db[_0x7fd8('0x2c')][_0x7fd8('0x2d')],function(_0x3df0a2){return{'name':_0x3df0a2['fieldName'],'type':_0x3df0a2[_0x7fd8('0x2e')]['key']};});_0x573ed0[_0x7fd8('0x2f')]=_[_0x7fd8('0x30')](_0x8f9a8e,_0x7fd8('0x2a'));_0x573ed0[_0x7fd8('0x31')]=_[_0x7fd8('0x32')](_0x2bd721[_0x7fd8('0x31')]);_0x573ed0[_0x7fd8('0x33')]=_['intersection'](_0x573ed0[_0x7fd8('0x2f')],_0x573ed0[_0x7fd8('0x31')]);_0x4319b8[_0x7fd8('0x34')]=_[_0x7fd8('0x35')](_0x573ed0[_0x7fd8('0x2f')],qs[_0x7fd8('0x36')](_0x2bd721[_0x7fd8('0x31')][_0x7fd8('0x36')]));_0x4319b8['attributes']=_0x4319b8['attributes'][_0x7fd8('0x37')]?_0x4319b8[_0x7fd8('0x34')]:_0x573ed0[_0x7fd8('0x2f')];if(!_0x2bd721['query'][_0x7fd8('0x38')]('nolimit')){_0x4319b8['limit']=qs[_0x7fd8('0x1f')](_0x2bd721[_0x7fd8('0x31')][_0x7fd8('0x1f')]);_0x4319b8[_0x7fd8('0x1c')]=qs[_0x7fd8('0x1c')](_0x2bd721[_0x7fd8('0x31')][_0x7fd8('0x1c')]);}_0x4319b8[_0x7fd8('0x39')]=qs['sort'](_0x2bd721[_0x7fd8('0x31')]['sort']);_0x4319b8['where']=qs[_0x7fd8('0x33')](_['pick'](_0x2bd721['query'],_0x573ed0['filters']),_0x8f9a8e);if(_0x2bd721[_0x7fd8('0x31')][_0x7fd8('0x3a')]){_0x4319b8['where']=_[_0x7fd8('0x3b')](_0x4319b8[_0x7fd8('0x3c')],{'$or':_[_0x7fd8('0x30')](_0x8f9a8e,function(_0x5d8d3d){if(_0x5d8d3d['type']!=='VIRTUAL'){var _0x1cc1d5={};_0x1cc1d5[_0x5d8d3d[_0x7fd8('0x2a')]]={'$like':'%'+_0x2bd721[_0x7fd8('0x31')][_0x7fd8('0x3a')]+'%'};return _0x1cc1d5;}})});}_0x4319b8=_[_0x7fd8('0x3b')]({},_0x4319b8,_0x2bd721[_0x7fd8('0x3d')]);var _0x2b5abb={'where':_0x4319b8['where']};return db['Cdr']['count'](_0x2b5abb)[_0x7fd8('0x26')](function(_0x24a0f8){_0x4fc63a[_0x7fd8('0x1e')]=_0x24a0f8;if(_0x2bd721['query'][_0x7fd8('0x3e')]){_0x4319b8[_0x7fd8('0x3f')]=[{'all':!![]}];}return db[_0x7fd8('0x2c')][_0x7fd8('0x40')](_0x4319b8);})['then'](function(_0x2f480c){_0x4fc63a[_0x7fd8('0x41')]=_0x2f480c;return _0x4fc63a;})['then'](respondWithFilteredResult(_0x3919b1,_0x4319b8))[_0x7fd8('0x42')](handleError(_0x3919b1,null));};exports['show']=function(_0x92b45f,_0x2026aa){var _0x393174={'raw':!![],'where':{'id':_0x92b45f['params']['id']}},_0xffd29a={};_0xffd29a[_0x7fd8('0x2f')]=_[_0x7fd8('0x32')](db[_0x7fd8('0x2c')][_0x7fd8('0x2d')]);_0xffd29a[_0x7fd8('0x31')]=_[_0x7fd8('0x32')](_0x92b45f['query']);_0xffd29a['filters']=_['intersection'](_0xffd29a[_0x7fd8('0x2f')],_0xffd29a[_0x7fd8('0x31')]);_0x393174['attributes']=_['intersection'](_0xffd29a[_0x7fd8('0x2f')],qs[_0x7fd8('0x36')](_0x92b45f['query'][_0x7fd8('0x36')]));_0x393174[_0x7fd8('0x34')]=_0x393174[_0x7fd8('0x34')]['length']?_0x393174[_0x7fd8('0x34')]:_0xffd29a[_0x7fd8('0x2f')];if(_0x92b45f['query'][_0x7fd8('0x3e')]){_0x393174['include']=[{'all':!![]}];}_0x393174=_[_0x7fd8('0x3b')]({},_0x393174,_0x92b45f[_0x7fd8('0x3d')]);return db[_0x7fd8('0x2c')][_0x7fd8('0x43')](_0x393174)[_0x7fd8('0x26')](handleEntityNotFound(_0x2026aa,null))[_0x7fd8('0x26')](respondWithResult(_0x2026aa,null))[_0x7fd8('0x42')](handleError(_0x2026aa,null));};exports[_0x7fd8('0x44')]=function(_0x4c2784,_0x1666e7){return db['Cdr'][_0x7fd8('0x44')](_0x4c2784[_0x7fd8('0x45')],{})['then'](respondWithResult(_0x1666e7,0xc9))[_0x7fd8('0x42')](handleError(_0x1666e7,null));};exports[_0x7fd8('0x25')]=function(_0x5cbc91,_0x5e3a45){if(_0x5cbc91['body']['id']){delete _0x5cbc91[_0x7fd8('0x45')]['id'];}return db['Cdr'][_0x7fd8('0x43')]({'where':{'id':_0x5cbc91[_0x7fd8('0x46')]['id']}})[_0x7fd8('0x26')](handleEntityNotFound(_0x5e3a45,null))[_0x7fd8('0x26')](saveUpdates(_0x5cbc91[_0x7fd8('0x45')],null))['then'](respondWithResult(_0x5e3a45,null))['catch'](handleError(_0x5e3a45,null));};exports[_0x7fd8('0x27')]=function(_0x46c230,_0x6924a2){return db[_0x7fd8('0x2c')]['find']({'where':{'id':_0x46c230[_0x7fd8('0x46')]['id']}})['then'](handleEntityNotFound(_0x6924a2,null))[_0x7fd8('0x26')](removeEntity(_0x6924a2,null))[_0x7fd8('0x42')](handleError(_0x6924a2,null));};exports[_0x7fd8('0x47')]=function(_0x1a6a03,_0x32160c){return db[_0x7fd8('0x2c')][_0x7fd8('0x47')]()[_0x7fd8('0x26')](respondWithResult(_0x32160c,null))[_0x7fd8('0x42')](handleError(_0x32160c,null));};
\ No newline at end of file
+var _0x2675=['limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','Cdr','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','create','body','update','params','describe','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x971b24,_0x2df2b3){var _0x43840c=function(_0x3f84b3){while(--_0x3f84b3){_0x971b24['push'](_0x971b24['shift']());}};_0x43840c(++_0x2df2b3);}(_0x2675,0x75));var _0x5267=function(_0xb05c3a,_0x3686ae){_0xb05c3a=_0xb05c3a-0x0;var _0x2e96d0=_0x2675[_0xb05c3a];return _0x2e96d0;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['Cdr'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['Cdr'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['create']=function(_0x12d6a8,_0x4ee826){return db['Cdr'][_0x5267('0x43')](_0x12d6a8[_0x5267('0x44')],{})['then'](respondWithResult(_0x4ee826,0xc9))['catch'](handleError(_0x4ee826,null));};exports[_0x5267('0x45')]=function(_0xe0439e,_0x3d2436){if(_0xe0439e[_0x5267('0x44')]['id']){delete _0xe0439e[_0x5267('0x44')]['id'];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0xe0439e[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x3d2436,null))[_0x5267('0x22')](saveUpdates(_0xe0439e[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0x3d2436,null))[_0x5267('0x3d')](handleError(_0x3d2436,null));};exports[_0x5267('0x21')]=function(_0x4f7f75,_0x8636d0){return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0x4f7f75['params']['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x8636d0,null))[_0x5267('0x22')](removeEntity(_0x8636d0,null))[_0x5267('0x3d')](handleError(_0x8636d0,null));};exports[_0x5267('0x47')]=function(_0x119546,_0x1457cf){return db['Cdr'][_0x5267('0x47')]()['then'](respondWithResult(_0x1457cf,null))[_0x5267('0x3d')](handleError(_0x1457cf,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index c354bf5..079a4bf 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(_0x4dbdb1,_0x2d8a30){var _0x52a3ab=function(_0x3054c5){while(--_0x3054c5){_0x4dbdb1['push'](_0x4dbdb1['shift']());}};_0x52a3ab(++_0x2d8a30);}(_0x7a54,0x106));var _0x47a5=function(_0x1bd95a,_0x4827af){_0x1bd95a=_0x1bd95a-0x0;var _0x2f00fa=_0x7a54[_0x1bd95a];return _0x2f00fa;};'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(_0x1e4ee0,_0x439067){var _0x24b187=function(_0x40d49c){while(--_0x40d49c){_0x1e4ee0['push'](_0x1e4ee0['shift']());}};_0x24b187(++_0x439067);}(_0x7a54,0x106));var _0x47a5=function(_0x57cee4,_0x6a2ff4){_0x57cee4=_0x57cee4-0x0;var _0x2c4e53=_0x7a54[_0x57cee4];return _0x2c4e53;};'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 4a64180..d0be54e 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 _0x742a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x35c8aa,_0x34ac41){var _0x206a0a=function(_0x3b857d){while(--_0x3b857d){_0x35c8aa['push'](_0x35c8aa['shift']());}};_0x206a0a(++_0x34ac41);}(_0x742a,0x97));var _0xa742=function(_0x3a634e,_0x273db2){_0x3a634e=_0x3a634e-0x0;var _0x2ecddb=_0x742a[_0x3a634e];return _0x2ecddb;};'use strict';var _=require(_0xa742('0x0'));var util=require(_0xa742('0x1'));var moment=require('moment');var BPromise=require(_0xa742('0x2'));var rs=require(_0xa742('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa742('0x4'))['db'];var utils=require(_0xa742('0x5'));var logger=require(_0xa742('0x6'))(_0xa742('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa742('0x8')][_0xa742('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d4ec6,_0x37a4bb,_0x1d086f){return new BPromise(function(_0x39715e,_0x511658){return client[_0xa742('0xa')](_0x3d4ec6,_0x1d086f)[_0xa742('0xb')](function(_0x2c94a3){logger[_0xa742('0xc')](_0xa742('0xd'),_0x37a4bb,_0xa742('0xe'));logger['debug'](_0xa742('0xf'),_0x37a4bb,'request\x20sent',JSON[_0xa742('0x10')](_0x2c94a3));if(_0x2c94a3[_0xa742('0x11')]){if(_0x2c94a3['error'][_0xa742('0x12')]===0x1f4){logger[_0xa742('0x11')](_0xa742('0xd'),_0x37a4bb,_0x2c94a3[_0xa742('0x11')][_0xa742('0x13')]);return _0x511658(_0x2c94a3[_0xa742('0x11')][_0xa742('0x13')]);}logger[_0xa742('0x11')](_0xa742('0xd'),_0x37a4bb,_0x2c94a3[_0xa742('0x11')][_0xa742('0x13')]);return _0x39715e(_0x2c94a3['error'][_0xa742('0x13')]);}else{logger[_0xa742('0xc')](_0xa742('0xd'),_0x37a4bb,_0xa742('0xe'));_0x39715e(_0x2c94a3[_0xa742('0x14')][_0xa742('0x13')]);}})[_0xa742('0x15')](function(_0x20e214){logger['error']('Cdr,\x20%s,\x20%s',_0x37a4bb,_0x20e214);_0x511658(_0x20e214);});});}
\ No newline at end of file
+var _0x2415=['../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2415,0x1f1));var _0x5241=function(_0x1ad30f,_0x461038){_0x1ad30f=_0x1ad30f-0x0;var _0x7a388f=_0x2415[_0x1ad30f];return _0x7a388f;};'use strict';var _=require(_0x5241('0x0'));var util=require(_0x5241('0x1'));var moment=require(_0x5241('0x2'));var BPromise=require(_0x5241('0x3'));var rs=require(_0x5241('0x4'));var fs=require('fs');var Redis=require(_0x5241('0x5'));var db=require(_0x5241('0x6'))['db'];var utils=require(_0x5241('0x7'));var logger=require('../../config/logger')(_0x5241('0x8'));var config=require(_0x5241('0x9'));var jayson=require(_0x5241('0xa'));var client=jayson[_0x5241('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c9b96,_0x27f0f1,_0x109486){return new BPromise(function(_0x20604c,_0x1c88aa){return client[_0x5241('0xc')](_0x3c9b96,_0x109486)[_0x5241('0xd')](function(_0x57f164){logger[_0x5241('0xe')](_0x5241('0xf'),_0x27f0f1,_0x5241('0x10'));logger['debug'](_0x5241('0x11'),_0x27f0f1,'request\x20sent',JSON[_0x5241('0x12')](_0x57f164));if(_0x57f164[_0x5241('0x13')]){if(_0x57f164[_0x5241('0x13')]['code']===0x1f4){logger[_0x5241('0x13')](_0x5241('0xf'),_0x27f0f1,_0x57f164[_0x5241('0x13')]['message']);return _0x1c88aa(_0x57f164[_0x5241('0x13')][_0x5241('0x14')]);}logger[_0x5241('0x13')](_0x5241('0xf'),_0x27f0f1,_0x57f164[_0x5241('0x13')][_0x5241('0x14')]);return _0x20604c(_0x57f164[_0x5241('0x13')][_0x5241('0x14')]);}else{logger[_0x5241('0xe')]('Cdr,\x20%s,\x20%s',_0x27f0f1,_0x5241('0x10'));_0x20604c(_0x57f164['result'][_0x5241('0x14')]);}})[_0x5241('0x15')](function(_0x301752){logger[_0x5241('0x13')](_0x5241('0xf'),_0x27f0f1,_0x301752);_0x1c88aa(_0x301752);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index fdc71e2..4f8b74c 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 _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(_0x20e575,_0xdb70f3){var _0x14a78d=function(_0x5f4ab3){while(--_0x5f4ab3){_0x20e575['push'](_0x20e575['shift']());}};_0x14a78d(++_0xdb70f3);}(_0xb10b,0x12a));var _0xbb10=function(_0x53377b,_0x166f23){_0x53377b=_0x53377b-0x0;var _0x39cba9=_0xb10b[_0x53377b];return _0x39cba9;};'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
+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(_0x5cc30e,_0x2646b6){var _0x208c6d=function(_0x1abc53){while(--_0x1abc53){_0x5cc30e['push'](_0x5cc30e['shift']());}};_0x208c6d(++_0x2646b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 1286b98..520accf 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 _0x38bd=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x491165,_0x4cebe9){var _0x551406=function(_0x3d7fd6){while(--_0x3d7fd6){_0x491165['push'](_0x491165['shift']());}};_0x551406(++_0x4cebe9);}(_0x38bd,0x7e));var _0xd38b=function(_0x1a7bde,_0x1803fb){_0x1a7bde=_0x1a7bde-0x0;var _0x12c6ca=_0x38bd[_0x1a7bde];return _0x12c6ca;};'use strict';var Sequelize=require(_0xd38b('0x0'));module[_0xd38b('0x1')]={'priority':{'type':Sequelize[_0xd38b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd38b('0x3')],'allowNull':![],'defaultValue':_0xd38b('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd38b('0x3')]},'interval':{'type':Sequelize[_0xd38b('0x3')],'defaultValue':_0xd38b('0x5')}};
\ No newline at end of file
+var _0x8f69=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x424106,_0x33ff55){var _0xd8928d=function(_0x1e7fce){while(--_0x1e7fce){_0x424106['push'](_0x424106['shift']());}};_0xd8928d(++_0x33ff55);}(_0x8f69,0x168));var _0x98f6=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0x8f69[_0x54a761];return _0x37d1da;};'use strict';var Sequelize=require(_0x98f6('0x0'));module[_0x98f6('0x1')]={'priority':{'type':Sequelize[_0x98f6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x98f6('0x3')],'allowNull':![],'defaultValue':_0x98f6('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x98f6('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x98f6('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 3dc5993..43754b1 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 _0x7072=['ChatApplication','query','keys','filters','model','attributes','intersection','fields','length','options','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','show','params'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x7072,0x138));var _0x2707=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x7072[_0x5416db];return _0x243e35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x3f6976,_0x171add){return function(_0x2ad386){if(!_0x2ad386){_0x3f6976[_0x2707('0x1a')](0x194);}return _0x2ad386;};}function handleError(_0x528b20,_0x2dce16){_0x2dce16=_0x2dce16||0x1f4;return function(_0x4ca05d){logger[_0x2707('0x2a')](_0x4ca05d[_0x2707('0x2b')]);if(_0x4ca05d[_0x2707('0x2c')]){delete _0x4ca05d['name'];}_0x528b20[_0x2707('0x1c')](_0x2dce16)[_0x2707('0x2d')](_0x4ca05d);};}exports[_0x2707('0x2e')]=function(_0x529be8,_0x31e990){var _0x42adf8={'raw':!![],'where':{'id':_0x529be8[_0x2707('0x2f')]['id']}},_0x4a99ce={};_0x4a99ce['model']=_['keys'](db[_0x2707('0x30')]['rawAttributes']);_0x4a99ce[_0x2707('0x31')]=_[_0x2707('0x32')](_0x529be8[_0x2707('0x31')]);_0x4a99ce[_0x2707('0x33')]=_['intersection'](_0x4a99ce[_0x2707('0x34')],_0x4a99ce[_0x2707('0x31')]);_0x42adf8[_0x2707('0x35')]=_[_0x2707('0x36')](_0x4a99ce[_0x2707('0x34')],qs[_0x2707('0x37')](_0x529be8[_0x2707('0x31')][_0x2707('0x37')]));_0x42adf8[_0x2707('0x35')]=_0x42adf8['attributes'][_0x2707('0x38')]?_0x42adf8[_0x2707('0x35')]:_0x4a99ce['model'];if(_0x529be8['query']['includeAll']){_0x42adf8['include']=[{'all':!![]}];}_0x42adf8=_['merge']({},_0x42adf8,_0x529be8[_0x2707('0x39')]);return db['ChatApplication']['find'](_0x42adf8)[_0x2707('0x29')](handleEntityNotFound(_0x31e990,null))[_0x2707('0x29')](respondWithResult(_0x31e990,null))['catch'](handleError(_0x31e990,null));};exports[_0x2707('0x27')]=function(_0x36993a,_0x5df463){if(_0x36993a['body']['id']){delete _0x36993a[_0x2707('0x3a')]['id'];}return db[_0x2707('0x30')]['find']({'where':{'id':_0x36993a['params']['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x5df463,null))[_0x2707('0x29')](saveUpdates(_0x36993a['body'],null))[_0x2707('0x29')](respondWithResult(_0x5df463,null))[_0x2707('0x3b')](handleError(_0x5df463,null));};exports[_0x2707('0x28')]=function(_0x2df9d5,_0x9943e8){return db[_0x2707('0x30')]['find']({'where':{'id':_0x2df9d5[_0x2707('0x2f')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x9943e8,null))[_0x2707('0x29')](removeEntity(_0x9943e8,null))[_0x2707('0x3b')](handleError(_0x9943e8,null));};
\ No newline at end of file
+var _0x220b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','sendStatus','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','length','merge','options','find','catch','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x220b,0x1a2));var _0xb220=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x220b[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb220('0x0'));var zipdir=require(_0xb220('0x1'));var jsonpatch=require(_0xb220('0x2'));var rp=require(_0xb220('0x3'));var moment=require('moment');var BPromise=require(_0xb220('0x4'));var Mustache=require('mustache');var util=require(_0xb220('0x5'));var path=require('path');var sox=require(_0xb220('0x6'));var csv=require(_0xb220('0x7'));var ejs=require(_0xb220('0x8'));var fs=require('fs');var fs_extra=require(_0xb220('0x9'));var _=require('lodash');var squel=require(_0xb220('0xa'));var crypto=require(_0xb220('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb220('0xc'));var toCsv=require(_0xb220('0x7'));var querystring=require(_0xb220('0xd'));var Papa=require(_0xb220('0xe'));var Redis=require(_0xb220('0xf'));var authService=require(_0xb220('0x10'));var qs=require(_0xb220('0x11'));var as=require(_0xb220('0x12'));var hardwareService=require(_0xb220('0x13'));var logger=require('../../config/logger')(_0xb220('0x14'));var utils=require(_0xb220('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x528ce0,_0x59ef3e){_0x59ef3e=_0x59ef3e||0xcc;return function(_0x11229c){if(_0x11229c){return _0x528ce0['sendStatus'](_0x59ef3e);}return _0x528ce0[_0xb220('0x16')](_0x59ef3e)[_0xb220('0x17')]();};}function respondWithResult(_0x378a3b,_0x312c59){_0x312c59=_0x312c59||0xc8;return function(_0x576649){if(_0x576649){return _0x378a3b['status'](_0x312c59)[_0xb220('0x18')](_0x576649);}};}function respondWithFilteredResult(_0x1db409,_0x159eb7){return function(_0x2ee3d2){if(_0x2ee3d2){var _0x16a34b=typeof _0x159eb7[_0xb220('0x19')]===_0xb220('0x1a')&&typeof _0x159eb7[_0xb220('0x1b')]===_0xb220('0x1a');var _0x1416de=_0x2ee3d2[_0xb220('0x1c')];var _0x464ceb=_0x16a34b?0x0:_0x159eb7[_0xb220('0x19')];var _0x21cf2d=_0x16a34b?_0x2ee3d2[_0xb220('0x1c')]:_0x159eb7[_0xb220('0x19')]+_0x159eb7[_0xb220('0x1b')];var _0x1cc822;if(_0x21cf2d>=_0x1416de){_0x21cf2d=_0x1416de;_0x1cc822=0xc8;}else{_0x1cc822=0xce;}_0x1db409[_0xb220('0x16')](_0x1cc822);return _0x1db409[_0xb220('0x1d')](_0xb220('0x1e'),_0x464ceb+'-'+_0x21cf2d+'/'+_0x1416de)[_0xb220('0x18')](_0x2ee3d2);}return null;};}function patchUpdates(_0x213736){return function(_0x358035){try{jsonpatch['apply'](_0x358035,_0x213736,!![]);}catch(_0x45b406){return BPromise['reject'](_0x45b406);}return _0x358035[_0xb220('0x1f')]();};}function saveUpdates(_0x5c4d46,_0x3a1ad7){return function(_0x501f0f){if(_0x501f0f){return _0x501f0f[_0xb220('0x20')](_0x5c4d46)[_0xb220('0x21')](function(_0x2ddf73){return _0x2ddf73;});}return null;};}function removeEntity(_0x2f5a0d,_0x396c72){return function(_0x2975ff){if(_0x2975ff){return _0x2975ff['destroy']()[_0xb220('0x21')](function(){_0x2f5a0d[_0xb220('0x16')](0xcc)[_0xb220('0x17')]();});}};}function handleEntityNotFound(_0x1849c8,_0x180b94){return function(_0x4d83aa){if(!_0x4d83aa){_0x1849c8[_0xb220('0x22')](0x194);}return _0x4d83aa;};}function handleError(_0x30b75b,_0x57768e){_0x57768e=_0x57768e||0x1f4;return function(_0x2b9b1a){logger[_0xb220('0x23')](_0x2b9b1a[_0xb220('0x24')]);if(_0x2b9b1a[_0xb220('0x25')]){delete _0x2b9b1a[_0xb220('0x25')];}_0x30b75b[_0xb220('0x16')](_0x57768e)['send'](_0x2b9b1a);};}exports[_0xb220('0x26')]=function(_0x54c1b9,_0x589e07){var _0x181b14={'raw':!![],'where':{'id':_0x54c1b9[_0xb220('0x27')]['id']}},_0x1a9b82={};_0x1a9b82[_0xb220('0x28')]=_[_0xb220('0x29')](db[_0xb220('0x2a')][_0xb220('0x2b')]);_0x1a9b82[_0xb220('0x2c')]=_[_0xb220('0x29')](_0x54c1b9[_0xb220('0x2c')]);_0x1a9b82['filters']=_[_0xb220('0x2d')](_0x1a9b82[_0xb220('0x28')],_0x1a9b82[_0xb220('0x2c')]);_0x181b14['attributes']=_['intersection'](_0x1a9b82[_0xb220('0x28')],qs['fields'](_0x54c1b9['query']['fields']));_0x181b14[_0xb220('0x2e')]=_0x181b14[_0xb220('0x2e')][_0xb220('0x2f')]?_0x181b14[_0xb220('0x2e')]:_0x1a9b82[_0xb220('0x28')];if(_0x54c1b9[_0xb220('0x2c')]['includeAll']){_0x181b14['include']=[{'all':!![]}];}_0x181b14=_[_0xb220('0x30')]({},_0x181b14,_0x54c1b9[_0xb220('0x31')]);return db['ChatApplication'][_0xb220('0x32')](_0x181b14)['then'](handleEntityNotFound(_0x589e07,null))[_0xb220('0x21')](respondWithResult(_0x589e07,null))[_0xb220('0x33')](handleError(_0x589e07,null));};exports[_0xb220('0x20')]=function(_0x5e4c0a,_0x1ed281){if(_0x5e4c0a['body']['id']){delete _0x5e4c0a['body']['id'];}return db['ChatApplication'][_0xb220('0x32')]({'where':{'id':_0x5e4c0a['params']['id']}})[_0xb220('0x21')](handleEntityNotFound(_0x1ed281,null))[_0xb220('0x21')](saveUpdates(_0x5e4c0a[_0xb220('0x34')],null))['then'](respondWithResult(_0x1ed281,null))['catch'](handleError(_0x1ed281,null));};exports[_0xb220('0x35')]=function(_0x4f385e,_0xb3cff4){return db[_0xb220('0x2a')]['find']({'where':{'id':_0x4f385e[_0xb220('0x27')]['id']}})[_0xb220('0x21')](handleEntityNotFound(_0xb3cff4,null))[_0xb220('0x21')](removeEntity(_0xb3cff4,null))[_0xb220('0x33')](handleError(_0xb3cff4,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index b2e03e0..5b3bee6 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 _0xc3a6=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3a6,0x116));var _0x6c3a=function(_0x367e58,_0x2a9e49){_0x367e58=_0x367e58-0x0;var _0x37a2c5=_0xc3a6[_0x367e58];return _0x37a2c5;};'use strict';var _=require(_0x6c3a('0x0'));var util=require('util');var logger=require(_0x6c3a('0x1'))(_0x6c3a('0x2'));var moment=require(_0x6c3a('0x3'));var BPromise=require(_0x6c3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c3a('0x5'));var rimraf=require(_0x6c3a('0x6'));var config=require(_0x6c3a('0x7'));var attributes=require(_0x6c3a('0x8'));module[_0x6c3a('0x9')]=function(_0x65b400,_0x543cc9){return _0x65b400[_0x6c3a('0xa')](_0x6c3a('0xb'),attributes,{'tableName':_0x6c3a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c3a('0xd'),'collate':_0x6c3a('0xe')});};
\ No newline at end of file
+var _0x9435=['api','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9435,0x93));var _0x5943=function(_0x5a5d73,_0x2f215d){_0x5a5d73=_0x5a5d73-0x0;var _0x36a276=_0x9435[_0x5a5d73];return _0x36a276;};'use strict';var _=require(_0x5943('0x0'));var util=require(_0x5943('0x1'));var logger=require(_0x5943('0x2'))(_0x5943('0x3'));var moment=require('moment');var BPromise=require(_0x5943('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5943('0x5'));var rimraf=require(_0x5943('0x6'));var config=require(_0x5943('0x7'));var attributes=require(_0x5943('0x8'));module[_0x5943('0x9')]=function(_0x42f32e,_0x114c6c){return _0x42f32e[_0x5943('0xa')](_0x5943('0xb'),attributes,{'tableName':_0x5943('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5943('0xd'),'collate':_0x5943('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 1c826f3..385b58c 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 _0x992e=['then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x955cb2,_0x26cab7){var _0x5bbfb0=function(_0x25506a){while(--_0x25506a){_0x955cb2['push'](_0x955cb2['shift']());}};_0x5bbfb0(++_0x26cab7);}(_0x992e,0x114));var _0xe992=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0x992e[_0x323419];return _0x4c0be7;};'use strict';var _=require('lodash');var util=require(_0xe992('0x0'));var moment=require(_0xe992('0x1'));var BPromise=require(_0xe992('0x2'));var rs=require(_0xe992('0x3'));var fs=require('fs');var Redis=require(_0xe992('0x4'));var db=require(_0xe992('0x5'))['db'];var utils=require(_0xe992('0x6'));var logger=require(_0xe992('0x7'))(_0xe992('0x8'));var config=require(_0xe992('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe992('0xa')][_0xe992('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a4b57,_0x235e0a,_0x4cc544){return new BPromise(function(_0x2ffabd,_0x25592b){return client['request'](_0x4a4b57,_0x4cc544)[_0xe992('0xc')](function(_0x279136){logger[_0xe992('0xd')]('ChatApplication,\x20%s,\x20%s',_0x235e0a,_0xe992('0xe'));logger[_0xe992('0xf')](_0xe992('0x10'),_0x235e0a,'request\x20sent',JSON[_0xe992('0x11')](_0x279136));if(_0x279136['error']){if(_0x279136[_0xe992('0x12')][_0xe992('0x13')]===0x1f4){logger['error'](_0xe992('0x14'),_0x235e0a,_0x279136[_0xe992('0x12')][_0xe992('0x15')]);return _0x25592b(_0x279136[_0xe992('0x12')][_0xe992('0x15')]);}logger[_0xe992('0x12')](_0xe992('0x14'),_0x235e0a,_0x279136['error'][_0xe992('0x15')]);return _0x2ffabd(_0x279136['error'][_0xe992('0x15')]);}else{logger[_0xe992('0xd')](_0xe992('0x14'),_0x235e0a,_0xe992('0xe'));_0x2ffabd(_0x279136[_0xe992('0x16')][_0xe992('0x15')]);}})[_0xe992('0x17')](function(_0x5c1f05){logger[_0xe992('0x12')](_0xe992('0x14'),_0x235e0a,_0x5c1f05);_0x25592b(_0x5c1f05);});});}
\ No newline at end of file
+var _0x1955=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x43af74,_0x41b94b){var _0x594972=function(_0x47a765){while(--_0x47a765){_0x43af74['push'](_0x43af74['shift']());}};_0x594972(++_0x41b94b);}(_0x1955,0x12f));var _0x5195=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x1955[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x5195('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5195('0x1'));var rs=require(_0x5195('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5195('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5195('0x4'));var config=require(_0x5195('0x5'));var jayson=require(_0x5195('0x6'));var client=jayson[_0x5195('0x7')][_0x5195('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2846db,_0x47e54f,_0x1e6bc7){return new BPromise(function(_0x8a6769,_0x23200d){return client['request'](_0x2846db,_0x1e6bc7)[_0x5195('0x9')](function(_0x55ddf3){logger['info'](_0x5195('0xa'),_0x47e54f,_0x5195('0xb'));logger[_0x5195('0xc')](_0x5195('0xd'),_0x47e54f,_0x5195('0xb'),JSON['stringify'](_0x55ddf3));if(_0x55ddf3[_0x5195('0xe')]){if(_0x55ddf3[_0x5195('0xe')][_0x5195('0xf')]===0x1f4){logger[_0x5195('0xe')]('ChatApplication,\x20%s,\x20%s',_0x47e54f,_0x55ddf3[_0x5195('0xe')][_0x5195('0x10')]);return _0x23200d(_0x55ddf3[_0x5195('0xe')][_0x5195('0x10')]);}logger[_0x5195('0xe')](_0x5195('0xa'),_0x47e54f,_0x55ddf3[_0x5195('0xe')][_0x5195('0x10')]);return _0x8a6769(_0x55ddf3[_0x5195('0xe')]['message']);}else{logger['info'](_0x5195('0xa'),_0x47e54f,'request\x20sent');_0x8a6769(_0x55ddf3[_0x5195('0x11')]['message']);}})[_0x5195('0x12')](function(_0x1cebcd){logger['error'](_0x5195('0xa'),_0x47e54f,_0x1cebcd);_0x23200d(_0x1cebcd);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 337bafc..ce46a5d 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 _0x5514=['fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','delete','exports','multer','util','express','Router'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x5514,0x1d8));var _0x4551=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x5514[_0x5a2285];return _0x48f6ed;};'use strict';var multer=require(_0x4551('0x0'));var util=require(_0x4551('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4551('0x2'));var router=express[_0x4551('0x3')]();var fs_extra=require(_0x4551('0x4'));var auth=require(_0x4551('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4551('0x6'));var controller=require(_0x4551('0x7'));router['get'](_0x4551('0x8'),auth[_0x4551('0x9')](),controller[_0x4551('0xa')]);router[_0x4551('0xb')](_0x4551('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x4551('0xc')](_0x4551('0x8'),auth[_0x4551('0x9')](),controller['destroy']);module[_0x4551('0xd')]=router;
\ No newline at end of file
+var _0x0946=['./chatApplication.controller','get','/:id','show','isAuthenticated','update','delete','destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0946,0x140));var _0x6094=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x0946[_0x136619];return _0x38c4a5;};'use strict';var multer=require(_0x6094('0x0'));var util=require('util');var path=require(_0x6094('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6094('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6094('0x3'));var interaction=require(_0x6094('0x4'));var config=require('../../config/environment');var controller=require(_0x6094('0x5'));router[_0x6094('0x6')](_0x6094('0x7'),auth['isAuthenticated'](),controller[_0x6094('0x8')]);router['put'](_0x6094('0x7'),auth[_0x6094('0x9')](),controller[_0x6094('0xa')]);router[_0x6094('0xb')]('/:id',auth[_0x6094('0x9')](),controller[_0x6094('0xc')]);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 6146cb5..8288f8c 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 _0x3e0c=['BOOLEAN','sequelize','exports','STRING'];(function(_0x6d193c,_0x3d8855){var _0x12ec4a=function(_0x1fb8bb){while(--_0x1fb8bb){_0x6d193c['push'](_0x6d193c['shift']());}};_0x12ec4a(++_0x3d8855);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x19e0f0,_0x2fa57f){_0x19e0f0=_0x19e0f0-0x0;var _0xb46f54=_0x3e0c[_0x19e0f0];return _0xb46f54;};'use strict';var Sequelize=require(_0xc3e0('0x0'));module[_0xc3e0('0x1')]={'name':{'type':Sequelize[_0xc3e0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xc3e0('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb6ba=['sequelize','exports','STRING','BOOLEAN'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0xb6ba,0x180));var _0xab6b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xb6ba[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xab6b('0x0'));module[_0xab6b('0x1')]={'name':{'type':Sequelize[_0xab6b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xab6b('0x2')]},'write':{'type':Sequelize[_0xab6b('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 3d3b4e9..c054d36 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 _0x01db=['fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','keys','catch','create','body','update','find','describe','ChatInternalMessage','params','addMembers','ids','omit','findOne','User','order','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x01db,0x117));var _0xb01d=function(_0x16cfd1,_0x196a00){_0x16cfd1=_0x16cfd1-0x0;var _0x2facf7=_0x01db[_0x16cfd1];return _0x2facf7;};'use strict';var emlformat=require(_0xb01d('0x0'));var rimraf=require(_0xb01d('0x1'));var zipdir=require(_0xb01d('0x2'));var jsonpatch=require(_0xb01d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb01d('0x4'));var path=require(_0xb01d('0x5'));var sox=require(_0xb01d('0x6'));var csv=require(_0xb01d('0x7'));var ejs=require(_0xb01d('0x8'));var fs=require('fs');var fs_extra=require(_0xb01d('0x9'));var _=require(_0xb01d('0xa'));var squel=require(_0xb01d('0xb'));var crypto=require(_0xb01d('0xc'));var jsforce=require(_0xb01d('0xd'));var deskjs=require(_0xb01d('0xe'));var toCsv=require(_0xb01d('0x7'));var querystring=require(_0xb01d('0xf'));var Papa=require(_0xb01d('0x10'));var Redis=require('ioredis');var authService=require(_0xb01d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb01d('0x12'));var hardwareService=require(_0xb01d('0x13'));var logger=require(_0xb01d('0x14'))('api');var utils=require(_0xb01d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb01d('0x16'));var db=require(_0xb01d('0x17'))['db'];config[_0xb01d('0x18')]=_['defaults'](config['redis'],{'host':_0xb01d('0x19'),'port':0x18eb});var socket=require(_0xb01d('0x1a'))(new Redis(config[_0xb01d('0x18')]));require(_0xb01d('0x1b'))['register'](socket);function respondWithStatusCode(_0x55f956,_0x2535be){_0x2535be=_0x2535be||0xcc;return function(_0x2555c9){if(_0x2555c9){return _0x55f956[_0xb01d('0x1c')](_0x2535be);}return _0x55f956[_0xb01d('0x1d')](_0x2535be)[_0xb01d('0x1e')]();};}function respondWithResult(_0x3070b6,_0x135822){_0x135822=_0x135822||0xc8;return function(_0x2be6fc){if(_0x2be6fc){return _0x3070b6[_0xb01d('0x1d')](_0x135822)['json'](_0x2be6fc);}};}function respondWithFilteredResult(_0x37eb3c,_0x58054f){return function(_0xe28a74){if(_0xe28a74){var _0x240c80=typeof _0x58054f[_0xb01d('0x1f')]===_0xb01d('0x20')&&typeof _0x58054f[_0xb01d('0x21')]===_0xb01d('0x20');var _0x2f8e18=_0xe28a74[_0xb01d('0x22')];var _0x185564=_0x240c80?0x0:_0x58054f['offset'];var _0x38cba2=_0x240c80?_0xe28a74[_0xb01d('0x22')]:_0x58054f[_0xb01d('0x1f')]+_0x58054f[_0xb01d('0x21')];var _0x45de36;if(_0x38cba2>=_0x2f8e18){_0x38cba2=_0x2f8e18;_0x45de36=0xc8;}else{_0x45de36=0xce;}_0x37eb3c[_0xb01d('0x1d')](_0x45de36);return _0x37eb3c[_0xb01d('0x23')](_0xb01d('0x24'),_0x185564+'-'+_0x38cba2+'/'+_0x2f8e18)[_0xb01d('0x25')](_0xe28a74);}return null;};}function patchUpdates(_0x1521b6){return function(_0x148eb8){try{jsonpatch[_0xb01d('0x26')](_0x148eb8,_0x1521b6,!![]);}catch(_0x415ff2){return BPromise[_0xb01d('0x27')](_0x415ff2);}return _0x148eb8[_0xb01d('0x28')]();};}function saveUpdates(_0x11b42a,_0x4b2e28){return function(_0x40bcf1){if(_0x40bcf1){return _0x40bcf1['update'](_0x11b42a)['then'](function(_0x530c9a){return _0x530c9a;});}return null;};}function removeEntity(_0x21a106,_0x74379){return function(_0xade3bc){if(_0xade3bc){return _0xade3bc[_0xb01d('0x29')]()[_0xb01d('0x2a')](function(){_0x21a106['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ecde,_0x5770be){return function(_0x424c6d){if(!_0x424c6d){_0x55ecde[_0xb01d('0x1c')](0x194);}return _0x424c6d;};}function handleError(_0x38fb98,_0x5ce89a){_0x5ce89a=_0x5ce89a||0x1f4;return function(_0x48c617){logger['error'](_0x48c617[_0xb01d('0x2b')]);if(_0x48c617[_0xb01d('0x2c')]){delete _0x48c617['name'];}_0x38fb98['status'](_0x5ce89a)['send'](_0x48c617);};}exports[_0xb01d('0x2d')]=function(_0x5dea29,_0xcdf90){var _0x5b202d={},_0x897ebc={},_0x5df5c0={'count':0x0,'rows':[]};var _0x2a045a=_[_0xb01d('0x2e')](db['ChatGroup'][_0xb01d('0x2f')],function(_0x175276){return{'name':_0x175276[_0xb01d('0x30')],'type':_0x175276[_0xb01d('0x31')]['key']};});_0x897ebc['model']=_['map'](_0x2a045a,_0xb01d('0x2c'));_0x897ebc[_0xb01d('0x32')]=_['keys'](_0x5dea29[_0xb01d('0x32')]);_0x897ebc[_0xb01d('0x33')]=_['intersection'](_0x897ebc[_0xb01d('0x34')],_0x897ebc[_0xb01d('0x32')]);_0x5b202d[_0xb01d('0x35')]=_[_0xb01d('0x36')](_0x897ebc[_0xb01d('0x34')],qs[_0xb01d('0x37')](_0x5dea29['query']['fields']));_0x5b202d[_0xb01d('0x35')]=_0x5b202d[_0xb01d('0x35')][_0xb01d('0x38')]?_0x5b202d[_0xb01d('0x35')]:_0x897ebc[_0xb01d('0x34')];if(!_0x5dea29[_0xb01d('0x32')][_0xb01d('0x39')]('nolimit')){_0x5b202d[_0xb01d('0x21')]=qs[_0xb01d('0x21')](_0x5dea29[_0xb01d('0x32')][_0xb01d('0x21')]);_0x5b202d['offset']=qs[_0xb01d('0x1f')](_0x5dea29[_0xb01d('0x32')][_0xb01d('0x1f')]);}_0x5b202d['order']=qs[_0xb01d('0x3a')](_0x5dea29[_0xb01d('0x32')][_0xb01d('0x3a')]);_0x5b202d[_0xb01d('0x3b')]=qs['filters'](_[_0xb01d('0x3c')](_0x5dea29['query'],_0x897ebc[_0xb01d('0x33')]),_0x2a045a);if(_0x5dea29[_0xb01d('0x32')][_0xb01d('0x3d')]){_0x5b202d[_0xb01d('0x3b')]=_[_0xb01d('0x3e')](_0x5b202d[_0xb01d('0x3b')],{'$or':_[_0xb01d('0x2e')](_0x2a045a,function(_0x46334a){if(_0x46334a['type']!==_0xb01d('0x3f')){var _0x1de7da={};_0x1de7da[_0x46334a[_0xb01d('0x2c')]]={'$like':'%'+_0x5dea29['query'][_0xb01d('0x3d')]+'%'};return _0x1de7da;}})});}_0x5b202d=_[_0xb01d('0x3e')]({},_0x5b202d,_0x5dea29[_0xb01d('0x40')]);var _0x5f1273={'where':_0x5b202d[_0xb01d('0x3b')]};return db[_0xb01d('0x41')][_0xb01d('0x22')](_0x5f1273)[_0xb01d('0x2a')](function(_0x43d72a){_0x5df5c0[_0xb01d('0x22')]=_0x43d72a;if(_0x5dea29[_0xb01d('0x32')][_0xb01d('0x42')]){_0x5b202d[_0xb01d('0x43')]=[{'all':!![]}];}return db[_0xb01d('0x41')][_0xb01d('0x44')](_0x5b202d);})[_0xb01d('0x2a')](function(_0x18474e){_0x5df5c0[_0xb01d('0x45')]=_0x18474e;return _0x5df5c0;})[_0xb01d('0x2a')](respondWithFilteredResult(_0xcdf90,_0x5b202d))['catch'](handleError(_0xcdf90,null));};exports['show']=function(_0x3474f7,_0x486fe1){var _0x15fb9c={'raw':!![],'where':{'id':_0x3474f7['params']['id']}},_0x7c5dd0={};_0x7c5dd0[_0xb01d('0x34')]=_[_0xb01d('0x46')](db[_0xb01d('0x41')][_0xb01d('0x2f')]);_0x7c5dd0[_0xb01d('0x32')]=_['keys'](_0x3474f7[_0xb01d('0x32')]);_0x7c5dd0[_0xb01d('0x33')]=_['intersection'](_0x7c5dd0['model'],_0x7c5dd0[_0xb01d('0x32')]);_0x15fb9c[_0xb01d('0x35')]=_[_0xb01d('0x36')](_0x7c5dd0['model'],qs[_0xb01d('0x37')](_0x3474f7[_0xb01d('0x32')][_0xb01d('0x37')]));_0x15fb9c['attributes']=_0x15fb9c[_0xb01d('0x35')][_0xb01d('0x38')]?_0x15fb9c[_0xb01d('0x35')]:_0x7c5dd0['model'];if(_0x3474f7[_0xb01d('0x32')]['includeAll']){_0x15fb9c[_0xb01d('0x43')]=[{'all':!![]}];}_0x15fb9c=_[_0xb01d('0x3e')]({},_0x15fb9c,_0x3474f7[_0xb01d('0x40')]);return db[_0xb01d('0x41')]['find'](_0x15fb9c)[_0xb01d('0x2a')](handleEntityNotFound(_0x486fe1,null))[_0xb01d('0x2a')](respondWithResult(_0x486fe1,null))[_0xb01d('0x47')](handleError(_0x486fe1,null));};exports[_0xb01d('0x48')]=function(_0x181896,_0x443390){return db['ChatGroup'][_0xb01d('0x48')](_0x181896[_0xb01d('0x49')],{})[_0xb01d('0x2a')](respondWithResult(_0x443390,0xc9))[_0xb01d('0x47')](handleError(_0x443390,null));};exports[_0xb01d('0x4a')]=function(_0x424931,_0x470062){if(_0x424931['body']['id']){delete _0x424931[_0xb01d('0x49')]['id'];}return db[_0xb01d('0x41')]['find']({'where':{'id':_0x424931['params']['id']}})[_0xb01d('0x2a')](handleEntityNotFound(_0x470062,null))[_0xb01d('0x2a')](saveUpdates(_0x424931[_0xb01d('0x49')],null))[_0xb01d('0x2a')](respondWithResult(_0x470062,null))[_0xb01d('0x47')](handleError(_0x470062,null));};exports['destroy']=function(_0x269a9b,_0x4913a2){return db[_0xb01d('0x41')][_0xb01d('0x4b')]({'where':{'id':_0x269a9b['params']['id']}})[_0xb01d('0x2a')](handleEntityNotFound(_0x4913a2,null))[_0xb01d('0x2a')](removeEntity(_0x4913a2,null))[_0xb01d('0x47')](handleError(_0x4913a2,null));};exports[_0xb01d('0x4c')]=function(_0x3a5070,_0x24422d){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x24422d,null))[_0xb01d('0x47')](handleError(_0x24422d,null));};exports['getUnread']=function(_0x3acf1c,_0x213b3b,_0x1aa61a){return db[_0xb01d('0x4d')][_0xb01d('0x22')]({'where':{'ChatGroupId':_0x3acf1c[_0xb01d('0x4e')]['id'],'ToId':_0x3acf1c['user']['id'],'read':![]}})['then'](function(_0x2bdf33){return{'id':_['toInteger'](_0x3acf1c['params']['id']),'count':_0x2bdf33};})[_0xb01d('0x2a')](respondWithResult(_0x213b3b,null))[_0xb01d('0x47')](handleError(_0x213b3b,null));};exports[_0xb01d('0x4f')]=function(_0x31fb17,_0x1b238f,_0xd6b148){return db[_0xb01d('0x41')]['find']({'where':{'id':_0x31fb17['params']['id']}})[_0xb01d('0x2a')](handleEntityNotFound(_0x1b238f,null))[_0xb01d('0x2a')](function(_0x4b727e){if(_0x4b727e){return _0x4b727e[_0xb01d('0x4f')](_0x31fb17['body'][_0xb01d('0x50')],_[_0xb01d('0x51')](_0x31fb17['body'],['ids','id'])||{});}})[_0xb01d('0x2a')](respondWithResult(_0x1b238f,null))[_0xb01d('0x47')](handleError(_0x1b238f,null));};exports['getMembers']=function(_0x48cf1a,_0x3a2b20,_0x336032){var _0x3bacc5={};var _0x42ab1b={};var _0x1f71f;var _0x3cb31a;return db['ChatGroup'][_0xb01d('0x52')]({'where':{'id':_0x48cf1a[_0xb01d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a2b20,null))[_0xb01d('0x2a')](function(_0x247571){if(_0x247571){_0x1f71f=_0x247571;_0x42ab1b[_0xb01d('0x34')]=_[_0xb01d('0x46')](db[_0xb01d('0x53')][_0xb01d('0x2f')]);_0x42ab1b[_0xb01d('0x32')]=_['keys'](_0x48cf1a[_0xb01d('0x32')]);_0x42ab1b[_0xb01d('0x33')]=_[_0xb01d('0x36')](_0x42ab1b[_0xb01d('0x34')],_0x42ab1b[_0xb01d('0x32')]);_0x3bacc5['attributes']=_['intersection'](_0x42ab1b[_0xb01d('0x34')],qs[_0xb01d('0x37')](_0x48cf1a[_0xb01d('0x32')][_0xb01d('0x37')]));_0x3bacc5['attributes']=_0x3bacc5[_0xb01d('0x35')][_0xb01d('0x38')]?_0x3bacc5[_0xb01d('0x35')]:_0x42ab1b[_0xb01d('0x34')];_0x3bacc5[_0xb01d('0x54')]=qs[_0xb01d('0x3a')](_0x48cf1a[_0xb01d('0x32')][_0xb01d('0x3a')]);_0x3bacc5[_0xb01d('0x3b')]=qs[_0xb01d('0x33')](_['pick'](_0x48cf1a[_0xb01d('0x32')],_0x42ab1b[_0xb01d('0x33')]));if(_0x48cf1a['query'][_0xb01d('0x3d')]){_0x3bacc5[_0xb01d('0x3b')]=_[_0xb01d('0x3e')](_0x3bacc5['where'],{'$or':_['map'](_0x3bacc5[_0xb01d('0x35')],function(_0x19e623){var _0x62c6a9={};_0x62c6a9[_0x19e623]={'$like':'%'+_0x48cf1a[_0xb01d('0x32')][_0xb01d('0x3d')]+'%'};return _0x62c6a9;})});}_0x3bacc5=_[_0xb01d('0x3e')]({},_0x3bacc5,_0x48cf1a[_0xb01d('0x40')]);return _0x1f71f[_0xb01d('0x55')](_0x3bacc5);}})[_0xb01d('0x2a')](function(_0x3aa265){if(_0x3aa265){_0x3cb31a=_0x3aa265[_0xb01d('0x38')];if(!_0x48cf1a[_0xb01d('0x32')]['hasOwnProperty'](_0xb01d('0x56'))){_0x3bacc5['limit']=qs[_0xb01d('0x21')](_0x48cf1a[_0xb01d('0x32')][_0xb01d('0x21')]);_0x3bacc5[_0xb01d('0x1f')]=qs['offset'](_0x48cf1a[_0xb01d('0x32')][_0xb01d('0x1f')]);}return _0x1f71f['getMembers'](_0x3bacc5);}})[_0xb01d('0x2a')](function(_0x14640f){if(_0x14640f){return _0x14640f?{'count':_0x3cb31a,'rows':_0x14640f}:null;}})[_0xb01d('0x2a')](respondWithResult(_0x3a2b20,null))[_0xb01d('0x47')](handleError(_0x3a2b20,null));};exports[_0xb01d('0x57')]=function(_0x5732ec,_0x267cac,_0x4e7357){return db[_0xb01d('0x41')][_0xb01d('0x4b')]({'where':{'id':_0x5732ec['params']['id']}})[_0xb01d('0x2a')](handleEntityNotFound(_0x267cac,null))[_0xb01d('0x2a')](function(_0x6d4f2){if(_0x6d4f2){return _0x6d4f2[_0xb01d('0x57')](_0x5732ec[_0xb01d('0x32')][_0xb01d('0x50')]);}})[_0xb01d('0x2a')](respondWithStatusCode(_0x267cac,null))[_0xb01d('0x47')](handleError(_0x267cac,null));};exports[_0xb01d('0x58')]=function(_0x3f17d7,_0x363eaf,_0x35ffba){if(_0x3f17d7[_0xb01d('0x49')]['id']){delete _0x3f17d7[_0xb01d('0x49')]['id'];}return db[_0xb01d('0x41')][_0xb01d('0x4b')]({'where':{'id':_0x3f17d7[_0xb01d('0x4e')]['id']}})[_0xb01d('0x2a')](handleEntityNotFound(_0x363eaf,null))[_0xb01d('0x2a')](function(_0x52a25d){if(_0x52a25d){_0x3f17d7['body'][_0xb01d('0x59')]=_0x52a25d['id'];return db[_0xb01d('0x4d')][_0xb01d('0x48')](_0x3f17d7['body']);}})[_0xb01d('0x2a')](respondWithResult(_0x363eaf,null))[_0xb01d('0x47')](handleError(_0x363eaf,null));};exports[_0xb01d('0x5a')]=function(_0x360ded,_0xd73258,_0x458c75){var _0x332c51={};var _0x269a6c={};var _0x2522e4;var _0x5bd540;return db['ChatGroup'][_0xb01d('0x52')]({'where':{'id':_0x360ded[_0xb01d('0x4e')]['id']}})[_0xb01d('0x2a')](handleEntityNotFound(_0xd73258,null))[_0xb01d('0x2a')](function(_0x57711a){if(_0x57711a){_0x2522e4=_0x57711a;_0x269a6c[_0xb01d('0x34')]=_[_0xb01d('0x46')](db['ChatInternalMessage'][_0xb01d('0x2f')]);_0x269a6c[_0xb01d('0x32')]=_['keys'](_0x360ded[_0xb01d('0x32')]);_0x269a6c[_0xb01d('0x33')]=_['intersection'](_0x269a6c[_0xb01d('0x34')],_0x269a6c[_0xb01d('0x32')]);_0x332c51[_0xb01d('0x35')]=_[_0xb01d('0x36')](_0x269a6c[_0xb01d('0x34')],qs[_0xb01d('0x37')](_0x360ded[_0xb01d('0x32')][_0xb01d('0x37')]));_0x332c51[_0xb01d('0x35')]=_0x332c51[_0xb01d('0x35')][_0xb01d('0x38')]?_0x332c51['attributes']:_0x269a6c[_0xb01d('0x34')];_0x332c51[_0xb01d('0x54')]=qs[_0xb01d('0x3a')](_0x360ded[_0xb01d('0x32')][_0xb01d('0x3a')]);_0x332c51[_0xb01d('0x3b')]=qs[_0xb01d('0x33')](_[_0xb01d('0x3c')](_0x360ded[_0xb01d('0x32')],_0x269a6c[_0xb01d('0x33')]));if(_0x360ded[_0xb01d('0x32')]['filter']){_0x332c51[_0xb01d('0x3b')]=_[_0xb01d('0x3e')](_0x332c51[_0xb01d('0x3b')],{'$or':_[_0xb01d('0x2e')](_0x332c51['attributes'],function(_0x18df72){var _0x273ffd={};_0x273ffd[_0x18df72]={'$like':'%'+_0x360ded['query']['filter']+'%'};return _0x273ffd;})});}if(_0x360ded[_0xb01d('0x32')][_0xb01d('0x5b')]){var _0x5828e3=_0x360ded[_0xb01d('0x32')][_0xb01d('0x5b')][_0xb01d('0x5c')](',');var _0x1cf47b={};_0x1cf47b[_0x5828e3[0x0]]={'$gte':moment(_0x5828e3[0x1])['format'](_0xb01d('0x5d'))};_0x332c51[_0xb01d('0x3b')]=_[_0xb01d('0x3e')](_0x332c51[_0xb01d('0x3b')],_0x1cf47b);}_0x332c51=_[_0xb01d('0x3e')]({},_0x332c51,_0x360ded[_0xb01d('0x40')]);return _0x2522e4[_0xb01d('0x5a')](_0x332c51);}})[_0xb01d('0x2a')](function(_0x28dff9){if(_0x28dff9){_0x5bd540=_0x28dff9[_0xb01d('0x38')];if(!_0x360ded[_0xb01d('0x32')][_0xb01d('0x39')](_0xb01d('0x56'))){_0x332c51[_0xb01d('0x21')]=qs[_0xb01d('0x21')](_0x360ded['query']['limit']);_0x332c51[_0xb01d('0x1f')]=qs[_0xb01d('0x1f')](_0x360ded[_0xb01d('0x32')]['offset']);}return _0x2522e4[_0xb01d('0x5a')](_0x332c51);}})[_0xb01d('0x2a')](function(_0x126f57){if(_0x126f57){return _0x126f57?{'count':_0x5bd540,'rows':_0x126f57}:null;}})['then'](respondWithResult(_0xd73258,null))['catch'](handleError(_0xd73258,null));};
\ No newline at end of file
+var _0x8d90=['../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','model','query','filters','attributes','intersection','fields','length','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','catch','params','keys','find','create','body','describe','toInteger','addMembers','ids','getMembers','findOne','User','order','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0xe619ff,_0x52ac89){var _0x493425=function(_0x278585){while(--_0x278585){_0xe619ff['push'](_0xe619ff['shift']());}};_0x493425(++_0x52ac89);}(_0x8d90,0x1bd));var _0x08d9=function(_0x29dfc0,_0x3a75ce){_0x29dfc0=_0x29dfc0-0x0;var _0x799f9=_0x8d90[_0x29dfc0];return _0x799f9;};'use strict';var emlformat=require(_0x08d9('0x0'));var rimraf=require(_0x08d9('0x1'));var zipdir=require(_0x08d9('0x2'));var jsonpatch=require(_0x08d9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x08d9('0x4'));var util=require(_0x08d9('0x5'));var path=require(_0x08d9('0x6'));var sox=require(_0x08d9('0x7'));var csv=require(_0x08d9('0x8'));var ejs=require(_0x08d9('0x9'));var fs=require('fs');var fs_extra=require(_0x08d9('0xa'));var _=require(_0x08d9('0xb'));var squel=require(_0x08d9('0xc'));var crypto=require(_0x08d9('0xd'));var jsforce=require(_0x08d9('0xe'));var deskjs=require(_0x08d9('0xf'));var toCsv=require(_0x08d9('0x8'));var querystring=require(_0x08d9('0x10'));var Papa=require(_0x08d9('0x11'));var Redis=require('ioredis');var authService=require(_0x08d9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08d9('0x13'));var logger=require(_0x08d9('0x14'))(_0x08d9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x08d9('0x16'))['db'];config[_0x08d9('0x17')]=_[_0x08d9('0x18')](config[_0x08d9('0x17')],{'host':_0x08d9('0x19'),'port':0x18eb});var socket=require(_0x08d9('0x1a'))(new Redis(config['redis']));require(_0x08d9('0x1b'))[_0x08d9('0x1c')](socket);function respondWithStatusCode(_0x596010,_0x2bbe4d){_0x2bbe4d=_0x2bbe4d||0xcc;return function(_0x2d9266){if(_0x2d9266){return _0x596010[_0x08d9('0x1d')](_0x2bbe4d);}return _0x596010[_0x08d9('0x1e')](_0x2bbe4d)[_0x08d9('0x1f')]();};}function respondWithResult(_0x37a758,_0x2e7b1b){_0x2e7b1b=_0x2e7b1b||0xc8;return function(_0xc3900f){if(_0xc3900f){return _0x37a758[_0x08d9('0x1e')](_0x2e7b1b)[_0x08d9('0x20')](_0xc3900f);}};}function respondWithFilteredResult(_0x12c0f2,_0x5ea6df){return function(_0x189758){if(_0x189758){var _0x3a5f0e=typeof _0x5ea6df[_0x08d9('0x21')]===_0x08d9('0x22')&&typeof _0x5ea6df[_0x08d9('0x23')]===_0x08d9('0x22');var _0xe61a39=_0x189758['count'];var _0x45ecd1=_0x3a5f0e?0x0:_0x5ea6df[_0x08d9('0x21')];var _0x428e63=_0x3a5f0e?_0x189758[_0x08d9('0x24')]:_0x5ea6df['offset']+_0x5ea6df[_0x08d9('0x23')];var _0x2f23ab;if(_0x428e63>=_0xe61a39){_0x428e63=_0xe61a39;_0x2f23ab=0xc8;}else{_0x2f23ab=0xce;}_0x12c0f2['status'](_0x2f23ab);return _0x12c0f2[_0x08d9('0x25')](_0x08d9('0x26'),_0x45ecd1+'-'+_0x428e63+'/'+_0xe61a39)[_0x08d9('0x20')](_0x189758);}return null;};}function patchUpdates(_0x51c636){return function(_0x18dc67){try{jsonpatch[_0x08d9('0x27')](_0x18dc67,_0x51c636,!![]);}catch(_0x5740fd){return BPromise['reject'](_0x5740fd);}return _0x18dc67[_0x08d9('0x28')]();};}function saveUpdates(_0x1e838a,_0xc813a9){return function(_0x25a848){if(_0x25a848){return _0x25a848[_0x08d9('0x29')](_0x1e838a)[_0x08d9('0x2a')](function(_0x2d0b06){return _0x2d0b06;});}return null;};}function removeEntity(_0x278969,_0x402e66){return function(_0x192ba0){if(_0x192ba0){return _0x192ba0[_0x08d9('0x2b')]()[_0x08d9('0x2a')](function(){_0x278969[_0x08d9('0x1e')](0xcc)[_0x08d9('0x1f')]();});}};}function handleEntityNotFound(_0x22a756,_0x3b2b39){return function(_0xbf2e29){if(!_0xbf2e29){_0x22a756[_0x08d9('0x1d')](0x194);}return _0xbf2e29;};}function handleError(_0x11ae65,_0x4d5850){_0x4d5850=_0x4d5850||0x1f4;return function(_0x383472){logger['error'](_0x383472[_0x08d9('0x2c')]);if(_0x383472['name']){delete _0x383472[_0x08d9('0x2d')];}_0x11ae65[_0x08d9('0x1e')](_0x4d5850)[_0x08d9('0x2e')](_0x383472);};}exports[_0x08d9('0x2f')]=function(_0x36b2b4,_0x473fc1){var _0x3baa13={},_0x2f1416={},_0x588e7c={'count':0x0,'rows':[]};var _0x23d505=_[_0x08d9('0x30')](db['ChatGroup'][_0x08d9('0x31')],function(_0x38cae0){return{'name':_0x38cae0['fieldName'],'type':_0x38cae0['type']['key']};});_0x2f1416[_0x08d9('0x32')]=_[_0x08d9('0x30')](_0x23d505,_0x08d9('0x2d'));_0x2f1416[_0x08d9('0x33')]=_['keys'](_0x36b2b4[_0x08d9('0x33')]);_0x2f1416[_0x08d9('0x34')]=_['intersection'](_0x2f1416['model'],_0x2f1416[_0x08d9('0x33')]);_0x3baa13[_0x08d9('0x35')]=_[_0x08d9('0x36')](_0x2f1416['model'],qs['fields'](_0x36b2b4[_0x08d9('0x33')][_0x08d9('0x37')]));_0x3baa13[_0x08d9('0x35')]=_0x3baa13[_0x08d9('0x35')][_0x08d9('0x38')]?_0x3baa13[_0x08d9('0x35')]:_0x2f1416['model'];if(!_0x36b2b4[_0x08d9('0x33')]['hasOwnProperty']('nolimit')){_0x3baa13[_0x08d9('0x23')]=qs[_0x08d9('0x23')](_0x36b2b4[_0x08d9('0x33')][_0x08d9('0x23')]);_0x3baa13[_0x08d9('0x21')]=qs['offset'](_0x36b2b4[_0x08d9('0x33')]['offset']);}_0x3baa13['order']=qs[_0x08d9('0x39')](_0x36b2b4[_0x08d9('0x33')]['sort']);_0x3baa13['where']=qs[_0x08d9('0x34')](_[_0x08d9('0x3a')](_0x36b2b4['query'],_0x2f1416['filters']),_0x23d505);if(_0x36b2b4[_0x08d9('0x33')][_0x08d9('0x3b')]){_0x3baa13[_0x08d9('0x3c')]=_[_0x08d9('0x3d')](_0x3baa13[_0x08d9('0x3c')],{'$or':_[_0x08d9('0x30')](_0x23d505,function(_0x3e6658){if(_0x3e6658[_0x08d9('0x3e')]!==_0x08d9('0x3f')){var _0x5a8997={};_0x5a8997[_0x3e6658[_0x08d9('0x2d')]]={'$like':'%'+_0x36b2b4[_0x08d9('0x33')][_0x08d9('0x3b')]+'%'};return _0x5a8997;}})});}_0x3baa13=_[_0x08d9('0x3d')]({},_0x3baa13,_0x36b2b4[_0x08d9('0x40')]);var _0x5611a0={'where':_0x3baa13['where']};return db[_0x08d9('0x41')][_0x08d9('0x24')](_0x5611a0)['then'](function(_0x1b8005){_0x588e7c[_0x08d9('0x24')]=_0x1b8005;if(_0x36b2b4[_0x08d9('0x33')][_0x08d9('0x42')]){_0x3baa13[_0x08d9('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0x08d9('0x44')](_0x3baa13);})[_0x08d9('0x2a')](function(_0x5214ed){_0x588e7c['rows']=_0x5214ed;return _0x588e7c;})[_0x08d9('0x2a')](respondWithFilteredResult(_0x473fc1,_0x3baa13))[_0x08d9('0x45')](handleError(_0x473fc1,null));};exports['show']=function(_0x1486b8,_0x300e19){var _0x4d9126={'raw':!![],'where':{'id':_0x1486b8[_0x08d9('0x46')]['id']}},_0x440eb9={};_0x440eb9[_0x08d9('0x32')]=_[_0x08d9('0x47')](db[_0x08d9('0x41')]['rawAttributes']);_0x440eb9[_0x08d9('0x33')]=_[_0x08d9('0x47')](_0x1486b8[_0x08d9('0x33')]);_0x440eb9[_0x08d9('0x34')]=_[_0x08d9('0x36')](_0x440eb9[_0x08d9('0x32')],_0x440eb9[_0x08d9('0x33')]);_0x4d9126[_0x08d9('0x35')]=_[_0x08d9('0x36')](_0x440eb9[_0x08d9('0x32')],qs[_0x08d9('0x37')](_0x1486b8[_0x08d9('0x33')]['fields']));_0x4d9126[_0x08d9('0x35')]=_0x4d9126[_0x08d9('0x35')][_0x08d9('0x38')]?_0x4d9126[_0x08d9('0x35')]:_0x440eb9[_0x08d9('0x32')];if(_0x1486b8[_0x08d9('0x33')][_0x08d9('0x42')]){_0x4d9126[_0x08d9('0x43')]=[{'all':!![]}];}_0x4d9126=_['merge']({},_0x4d9126,_0x1486b8[_0x08d9('0x40')]);return db[_0x08d9('0x41')][_0x08d9('0x48')](_0x4d9126)[_0x08d9('0x2a')](handleEntityNotFound(_0x300e19,null))['then'](respondWithResult(_0x300e19,null))[_0x08d9('0x45')](handleError(_0x300e19,null));};exports[_0x08d9('0x49')]=function(_0x3075d0,_0x1f0cc7){return db[_0x08d9('0x41')]['create'](_0x3075d0[_0x08d9('0x4a')],{})[_0x08d9('0x2a')](respondWithResult(_0x1f0cc7,0xc9))[_0x08d9('0x45')](handleError(_0x1f0cc7,null));};exports[_0x08d9('0x29')]=function(_0x1301f0,_0x2203fb){if(_0x1301f0[_0x08d9('0x4a')]['id']){delete _0x1301f0['body']['id'];}return db[_0x08d9('0x41')][_0x08d9('0x48')]({'where':{'id':_0x1301f0[_0x08d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x2203fb,null))[_0x08d9('0x2a')](saveUpdates(_0x1301f0[_0x08d9('0x4a')],null))['then'](respondWithResult(_0x2203fb,null))['catch'](handleError(_0x2203fb,null));};exports[_0x08d9('0x2b')]=function(_0x53830b,_0x1fc73e){return db['ChatGroup'][_0x08d9('0x48')]({'where':{'id':_0x53830b[_0x08d9('0x46')]['id']}})[_0x08d9('0x2a')](handleEntityNotFound(_0x1fc73e,null))[_0x08d9('0x2a')](removeEntity(_0x1fc73e,null))[_0x08d9('0x45')](handleError(_0x1fc73e,null));};exports[_0x08d9('0x4b')]=function(_0x13c297,_0x39c8e0){return db[_0x08d9('0x41')][_0x08d9('0x4b')]()[_0x08d9('0x2a')](respondWithResult(_0x39c8e0,null))[_0x08d9('0x45')](handleError(_0x39c8e0,null));};exports['getUnread']=function(_0x5aa010,_0x2f7335,_0x3aed10){return db['ChatInternalMessage'][_0x08d9('0x24')]({'where':{'ChatGroupId':_0x5aa010[_0x08d9('0x46')]['id'],'ToId':_0x5aa010['user']['id'],'read':![]}})[_0x08d9('0x2a')](function(_0x3b03ab){return{'id':_[_0x08d9('0x4c')](_0x5aa010['params']['id']),'count':_0x3b03ab};})[_0x08d9('0x2a')](respondWithResult(_0x2f7335,null))[_0x08d9('0x45')](handleError(_0x2f7335,null));};exports[_0x08d9('0x4d')]=function(_0x4409eb,_0x3d4e2e,_0x28d494){return db[_0x08d9('0x41')][_0x08d9('0x48')]({'where':{'id':_0x4409eb[_0x08d9('0x46')]['id']}})[_0x08d9('0x2a')](handleEntityNotFound(_0x3d4e2e,null))['then'](function(_0x5a3249){if(_0x5a3249){return _0x5a3249[_0x08d9('0x4d')](_0x4409eb[_0x08d9('0x4a')]['ids'],_['omit'](_0x4409eb[_0x08d9('0x4a')],[_0x08d9('0x4e'),'id'])||{});}})[_0x08d9('0x2a')](respondWithResult(_0x3d4e2e,null))[_0x08d9('0x45')](handleError(_0x3d4e2e,null));};exports[_0x08d9('0x4f')]=function(_0x1631a6,_0x341ba0,_0x2ac330){var _0xd51629={};var _0x1629c9={};var _0x18d478;var _0x472842;return db[_0x08d9('0x41')][_0x08d9('0x50')]({'where':{'id':_0x1631a6['params']['id']}})[_0x08d9('0x2a')](handleEntityNotFound(_0x341ba0,null))[_0x08d9('0x2a')](function(_0x476439){if(_0x476439){_0x18d478=_0x476439;_0x1629c9[_0x08d9('0x32')]=_[_0x08d9('0x47')](db[_0x08d9('0x51')][_0x08d9('0x31')]);_0x1629c9[_0x08d9('0x33')]=_[_0x08d9('0x47')](_0x1631a6[_0x08d9('0x33')]);_0x1629c9[_0x08d9('0x34')]=_[_0x08d9('0x36')](_0x1629c9[_0x08d9('0x32')],_0x1629c9[_0x08d9('0x33')]);_0xd51629[_0x08d9('0x35')]=_[_0x08d9('0x36')](_0x1629c9[_0x08d9('0x32')],qs['fields'](_0x1631a6[_0x08d9('0x33')][_0x08d9('0x37')]));_0xd51629[_0x08d9('0x35')]=_0xd51629[_0x08d9('0x35')][_0x08d9('0x38')]?_0xd51629['attributes']:_0x1629c9[_0x08d9('0x32')];_0xd51629[_0x08d9('0x52')]=qs['sort'](_0x1631a6[_0x08d9('0x33')]['sort']);_0xd51629[_0x08d9('0x3c')]=qs[_0x08d9('0x34')](_['pick'](_0x1631a6[_0x08d9('0x33')],_0x1629c9[_0x08d9('0x34')]));if(_0x1631a6['query']['filter']){_0xd51629[_0x08d9('0x3c')]=_[_0x08d9('0x3d')](_0xd51629['where'],{'$or':_[_0x08d9('0x30')](_0xd51629[_0x08d9('0x35')],function(_0x3a0fb5){var _0x3c8d1a={};_0x3c8d1a[_0x3a0fb5]={'$like':'%'+_0x1631a6[_0x08d9('0x33')]['filter']+'%'};return _0x3c8d1a;})});}_0xd51629=_['merge']({},_0xd51629,_0x1631a6[_0x08d9('0x40')]);return _0x18d478[_0x08d9('0x4f')](_0xd51629);}})[_0x08d9('0x2a')](function(_0x2091a6){if(_0x2091a6){_0x472842=_0x2091a6[_0x08d9('0x38')];if(!_0x1631a6[_0x08d9('0x33')][_0x08d9('0x53')](_0x08d9('0x54'))){_0xd51629['limit']=qs[_0x08d9('0x23')](_0x1631a6[_0x08d9('0x33')]['limit']);_0xd51629[_0x08d9('0x21')]=qs[_0x08d9('0x21')](_0x1631a6[_0x08d9('0x33')][_0x08d9('0x21')]);}return _0x18d478[_0x08d9('0x4f')](_0xd51629);}})[_0x08d9('0x2a')](function(_0x217c45){if(_0x217c45){return _0x217c45?{'count':_0x472842,'rows':_0x217c45}:null;}})[_0x08d9('0x2a')](respondWithResult(_0x341ba0,null))['catch'](handleError(_0x341ba0,null));};exports['removeMembers']=function(_0x177475,_0x2a2a08,_0x51e1ea){return db['ChatGroup']['find']({'where':{'id':_0x177475[_0x08d9('0x46')]['id']}})[_0x08d9('0x2a')](handleEntityNotFound(_0x2a2a08,null))[_0x08d9('0x2a')](function(_0x537134){if(_0x537134){return _0x537134[_0x08d9('0x55')](_0x177475['query'][_0x08d9('0x4e')]);}})[_0x08d9('0x2a')](respondWithStatusCode(_0x2a2a08,null))[_0x08d9('0x45')](handleError(_0x2a2a08,null));};exports[_0x08d9('0x56')]=function(_0x53442a,_0x9ae596,_0x4b08d4){if(_0x53442a[_0x08d9('0x4a')]['id']){delete _0x53442a[_0x08d9('0x4a')]['id'];}return db[_0x08d9('0x41')][_0x08d9('0x48')]({'where':{'id':_0x53442a[_0x08d9('0x46')]['id']}})[_0x08d9('0x2a')](handleEntityNotFound(_0x9ae596,null))['then'](function(_0x25c039){if(_0x25c039){_0x53442a[_0x08d9('0x4a')][_0x08d9('0x57')]=_0x25c039['id'];return db[_0x08d9('0x58')]['create'](_0x53442a['body']);}})[_0x08d9('0x2a')](respondWithResult(_0x9ae596,null))[_0x08d9('0x45')](handleError(_0x9ae596,null));};exports[_0x08d9('0x59')]=function(_0x1c2953,_0xf1a159,_0x31c778){var _0xf0350b={};var _0x5a21c5={};var _0x3b32ce;var _0x1f7e0;return db[_0x08d9('0x41')][_0x08d9('0x50')]({'where':{'id':_0x1c2953[_0x08d9('0x46')]['id']}})[_0x08d9('0x2a')](handleEntityNotFound(_0xf1a159,null))['then'](function(_0x2c719d){if(_0x2c719d){_0x3b32ce=_0x2c719d;_0x5a21c5[_0x08d9('0x32')]=_['keys'](db[_0x08d9('0x58')][_0x08d9('0x31')]);_0x5a21c5[_0x08d9('0x33')]=_['keys'](_0x1c2953[_0x08d9('0x33')]);_0x5a21c5[_0x08d9('0x34')]=_[_0x08d9('0x36')](_0x5a21c5[_0x08d9('0x32')],_0x5a21c5[_0x08d9('0x33')]);_0xf0350b['attributes']=_[_0x08d9('0x36')](_0x5a21c5[_0x08d9('0x32')],qs['fields'](_0x1c2953[_0x08d9('0x33')][_0x08d9('0x37')]));_0xf0350b[_0x08d9('0x35')]=_0xf0350b[_0x08d9('0x35')][_0x08d9('0x38')]?_0xf0350b[_0x08d9('0x35')]:_0x5a21c5[_0x08d9('0x32')];_0xf0350b[_0x08d9('0x52')]=qs[_0x08d9('0x39')](_0x1c2953[_0x08d9('0x33')]['sort']);_0xf0350b[_0x08d9('0x3c')]=qs[_0x08d9('0x34')](_['pick'](_0x1c2953['query'],_0x5a21c5['filters']));if(_0x1c2953[_0x08d9('0x33')][_0x08d9('0x3b')]){_0xf0350b[_0x08d9('0x3c')]=_[_0x08d9('0x3d')](_0xf0350b[_0x08d9('0x3c')],{'$or':_[_0x08d9('0x30')](_0xf0350b[_0x08d9('0x35')],function(_0x43c214){var _0x16fad4={};_0x16fad4[_0x43c214]={'$like':'%'+_0x1c2953['query'][_0x08d9('0x3b')]+'%'};return _0x16fad4;})});}if(_0x1c2953['query'][_0x08d9('0x5a')]){var _0x1ce658=_0x1c2953[_0x08d9('0x33')]['$gte'][_0x08d9('0x5b')](',');var _0x4ed76f={};_0x4ed76f[_0x1ce658[0x0]]={'$gte':moment(_0x1ce658[0x1])['format'](_0x08d9('0x5c'))};_0xf0350b[_0x08d9('0x3c')]=_['merge'](_0xf0350b[_0x08d9('0x3c')],_0x4ed76f);}_0xf0350b=_[_0x08d9('0x3d')]({},_0xf0350b,_0x1c2953[_0x08d9('0x40')]);return _0x3b32ce[_0x08d9('0x59')](_0xf0350b);}})['then'](function(_0x70c721){if(_0x70c721){_0x1f7e0=_0x70c721[_0x08d9('0x38')];if(!_0x1c2953['query'][_0x08d9('0x53')](_0x08d9('0x54'))){_0xf0350b[_0x08d9('0x23')]=qs['limit'](_0x1c2953[_0x08d9('0x33')][_0x08d9('0x23')]);_0xf0350b[_0x08d9('0x21')]=qs[_0x08d9('0x21')](_0x1c2953[_0x08d9('0x33')]['offset']);}return _0x3b32ce[_0x08d9('0x59')](_0xf0350b);}})[_0x08d9('0x2a')](function(_0x383903){if(_0x383903){return _0x383903?{'count':_0x1f7e0,'rows':_0x383903}:null;}})['then'](respondWithResult(_0xf1a159,null))[_0x08d9('0x45')](handleError(_0xf1a159,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 40e1b70..bc0199b 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 _0x04cc=['hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','update','emit'];(function(_0xc04eb0,_0x38ffaf){var _0x4712ab=function(_0x37bc8e){while(--_0x37bc8e){_0xc04eb0['push'](_0xc04eb0['shift']());}};_0x4712ab(++_0x38ffaf);}(_0x04cc,0x11a));var _0xc04c=function(_0x5d4aff,_0x4d58e9){_0x5d4aff=_0x5d4aff-0x0;var _0x28ef30=_0x04cc[_0x5d4aff];return _0x28ef30;};'use strict';var EventEmitter=require(_0xc04c('0x0'));var ChatGroup=require(_0xc04c('0x1'))['db'][_0xc04c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc04c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc04c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cca40){return function(_0x138028,_0x2fefd7,_0x153c93){ChatGroupEvents[_0xc04c('0x5')](_0x4cca40+':'+_0x138028['id'],_0x138028);ChatGroupEvents[_0xc04c('0x5')](_0x4cca40,_0x138028);_0x153c93(null);};}for(var e in events){if(events[_0xc04c('0x6')](e)){var event=events[e];ChatGroup[_0xc04c('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x74cd=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x53f951,_0x4bff0a){var _0x3eedd6=function(_0x333f0c){while(--_0x333f0c){_0x53f951['push'](_0x53f951['shift']());}};_0x3eedd6(++_0x4bff0a);}(_0x74cd,0x162));var _0xd74c=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x74cd[_0x3a0c4f];return _0x247049;};'use strict';var EventEmitter=require(_0xd74c('0x0'));var ChatGroup=require(_0xd74c('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd74c('0x2')](0x0);var events={'afterCreate':_0xd74c('0x3'),'afterUpdate':'update','afterDestroy':_0xd74c('0x4')};function emitEvent(_0x3bf0e3){return function(_0x1a43e1,_0x395516,_0x1dc04e){ChatGroupEvents[_0xd74c('0x5')](_0x3bf0e3+':'+_0x1a43e1['id'],_0x1a43e1);ChatGroupEvents[_0xd74c('0x5')](_0x3bf0e3,_0x1a43e1);_0x1dc04e(null);};}for(var e in events){if(events[_0xd74c('0x6')](e)){var event=events[e];ChatGroup[_0xd74c('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 58b8b0f..fb9a06a 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 _0x9c32=['exports','define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x9c32,0x1b6));var _0x29c3=function(_0xf02bc5,_0x2c56e9){_0xf02bc5=_0xf02bc5-0x0;var _0x142674=_0x9c32[_0xf02bc5];return _0x142674;};'use strict';var _=require('lodash');var util=require(_0x29c3('0x0'));var logger=require(_0x29c3('0x1'))(_0x29c3('0x2'));var moment=require(_0x29c3('0x3'));var BPromise=require(_0x29c3('0x4'));var rp=require(_0x29c3('0x5'));var fs=require('fs');var path=require(_0x29c3('0x6'));var rimraf=require(_0x29c3('0x7'));var config=require(_0x29c3('0x8'));var attributes=require(_0x29c3('0x9'));module[_0x29c3('0xa')]=function(_0x17a4cb,_0x33b70a){return _0x17a4cb[_0x29c3('0xb')](_0x29c3('0xc'),attributes,{'tableName':_0x29c3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc62f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x2b7695,_0x20c6cd){var _0x313ebd=function(_0x5a8bb1){while(--_0x5a8bb1){_0x2b7695['push'](_0x2b7695['shift']());}};_0x313ebd(++_0x20c6cd);}(_0xc62f,0xc6));var _0xfc62=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc62f[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xfc62('0x0'));var util=require(_0xfc62('0x1'));var logger=require(_0xfc62('0x2'))('api');var moment=require(_0xfc62('0x3'));var BPromise=require(_0xfc62('0x4'));var rp=require(_0xfc62('0x5'));var fs=require('fs');var path=require(_0xfc62('0x6'));var rimraf=require(_0xfc62('0x7'));var config=require(_0xfc62('0x8'));var attributes=require(_0xfc62('0x9'));module[_0xfc62('0xa')]=function(_0x110b76,_0x494780){return _0x110b76['define']('ChatGroup',attributes,{'tableName':'chat_groups','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 931d7f3..eb5f76a 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 _0xef39=['./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xef39,0x92));var _0x9ef3=function(_0x560042,_0x3924f5){_0x560042=_0x560042-0x0;var _0x2f6586=_0xef39[_0x560042];return _0x2f6586;};'use strict';var _=require('lodash');var util=require(_0x9ef3('0x0'));var moment=require(_0x9ef3('0x1'));var BPromise=require(_0x9ef3('0x2'));var rs=require(_0x9ef3('0x3'));var fs=require('fs');var Redis=require(_0x9ef3('0x4'));var db=require(_0x9ef3('0x5'))['db'];var utils=require(_0x9ef3('0x6'));var logger=require(_0x9ef3('0x7'))(_0x9ef3('0x8'));var config=require(_0x9ef3('0x9'));var jayson=require(_0x9ef3('0xa'));var client=jayson[_0x9ef3('0xb')]['http']({'port':0x232a});config[_0x9ef3('0xc')]=_[_0x9ef3('0xd')](config[_0x9ef3('0xc')],{'host':_0x9ef3('0xe'),'port':0x18eb});var socket=require(_0x9ef3('0xf'))(new Redis(config[_0x9ef3('0xc')]));require(_0x9ef3('0x10'))[_0x9ef3('0x11')](socket);function respondWithRpcPromise(_0x388d02,_0x268765,_0x347f85){return new BPromise(function(_0xcacf18,_0x475bd3){return client['request'](_0x388d02,_0x347f85)[_0x9ef3('0x12')](function(_0x31e819){logger[_0x9ef3('0x13')](_0x9ef3('0x14'),_0x268765,_0x9ef3('0x15'));logger[_0x9ef3('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x268765,_0x9ef3('0x15'),JSON[_0x9ef3('0x17')](_0x31e819));if(_0x31e819[_0x9ef3('0x18')]){if(_0x31e819['error'][_0x9ef3('0x19')]===0x1f4){logger[_0x9ef3('0x18')]('ChatGroup,\x20%s,\x20%s',_0x268765,_0x31e819[_0x9ef3('0x18')][_0x9ef3('0x1a')]);return _0x475bd3(_0x31e819[_0x9ef3('0x18')][_0x9ef3('0x1a')]);}logger[_0x9ef3('0x18')](_0x9ef3('0x14'),_0x268765,_0x31e819['error'][_0x9ef3('0x1a')]);return _0xcacf18(_0x31e819[_0x9ef3('0x18')][_0x9ef3('0x1a')]);}else{logger['info'](_0x9ef3('0x14'),_0x268765,_0x9ef3('0x15'));_0xcacf18(_0x31e819['result']['message']);}})['catch'](function(_0x43fe20){logger[_0x9ef3('0x18')]('ChatGroup,\x20%s,\x20%s',_0x268765,_0x43fe20);_0x475bd3(_0x43fe20);});});}
\ No newline at end of file
+var _0x6113=['ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','request\x20sent','debug'];(function(_0x58e025,_0x4fab37){var _0x10015b=function(_0x38f225){while(--_0x38f225){_0x58e025['push'](_0x58e025['shift']());}};_0x10015b(++_0x4fab37);}(_0x6113,0x1c8));var _0x3611=function(_0x190e1f,_0x11e558){_0x190e1f=_0x190e1f-0x0;var _0x2ba93a=_0x6113[_0x190e1f];return _0x2ba93a;};'use strict';var _=require(_0x3611('0x0'));var util=require(_0x3611('0x1'));var moment=require(_0x3611('0x2'));var BPromise=require('bluebird');var rs=require(_0x3611('0x3'));var fs=require('fs');var Redis=require(_0x3611('0x4'));var db=require(_0x3611('0x5'))['db'];var utils=require(_0x3611('0x6'));var logger=require(_0x3611('0x7'))(_0x3611('0x8'));var config=require(_0x3611('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3611('0xa')][_0x3611('0xb')]({'port':0x232a});config[_0x3611('0xc')]=_['defaults'](config[_0x3611('0xc')],{'host':_0x3611('0xd'),'port':0x18eb});var socket=require(_0x3611('0xe'))(new Redis(config['redis']));require(_0x3611('0xf'))['register'](socket);function respondWithRpcPromise(_0x17cf65,_0x4f1a2f,_0x33f793){return new BPromise(function(_0x2d117e,_0x49b4ce){return client[_0x3611('0x10')](_0x17cf65,_0x33f793)[_0x3611('0x11')](function(_0xa391a){logger['info']('ChatGroup,\x20%s,\x20%s',_0x4f1a2f,_0x3611('0x12'));logger[_0x3611('0x13')](_0x3611('0x14'),_0x4f1a2f,_0x3611('0x12'),JSON[_0x3611('0x15')](_0xa391a));if(_0xa391a[_0x3611('0x16')]){if(_0xa391a[_0x3611('0x16')][_0x3611('0x17')]===0x1f4){logger[_0x3611('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4f1a2f,_0xa391a[_0x3611('0x16')][_0x3611('0x18')]);return _0x49b4ce(_0xa391a['error']['message']);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4f1a2f,_0xa391a[_0x3611('0x16')][_0x3611('0x18')]);return _0x2d117e(_0xa391a[_0x3611('0x16')][_0x3611('0x18')]);}else{logger['info'](_0x3611('0x19'),_0x4f1a2f,'request\x20sent');_0x2d117e(_0xa391a[_0x3611('0x1a')][_0x3611('0x18')]);}})[_0x3611('0x1b')](function(_0x470bcc){logger[_0x3611('0x16')](_0x3611('0x19'),_0x4f1a2f,_0x470bcc);_0x49b4ce(_0x470bcc);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index cff9e70..fa36c93 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 _0x76fc=['remove','update','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x76fc,0xfe));var _0xc76f=function(_0x517be7,_0x240c5d){_0x517be7=_0x517be7-0x0;var _0x139a3e=_0x76fc[_0x517be7];return _0x139a3e;};'use strict';var ChatGroupEvents=require(_0xc76f('0x0'));var events=[_0xc76f('0x1'),_0xc76f('0x2'),_0xc76f('0x3')];function createListener(_0x4fe02b,_0x1ffa14){return function(_0x39c2d2){_0x1ffa14['emit'](_0x4fe02b,_0x39c2d2);};}function removeListener(_0x43f870,_0x375b2f){return function(){ChatGroupEvents[_0xc76f('0x4')](_0x43f870,_0x375b2f);};}exports[_0xc76f('0x5')]=function(_0xf4b017){for(var _0x47d63a=0x0,_0x3d1e3f=events[_0xc76f('0x6')];_0x47d63a<_0x3d1e3f;_0x47d63a++){var _0x14f5eb=events[_0x47d63a];var _0xcd479f=createListener(_0xc76f('0x7')+_0x14f5eb,_0xf4b017);ChatGroupEvents['on'](_0x14f5eb,_0xcd479f);}};
\ No newline at end of file
+var _0x719b=['removeListener','length','./chatGroup.events','save','remove','update'];(function(_0xfde90,_0x27fe63){var _0x268892=function(_0xb57387){while(--_0xb57387){_0xfde90['push'](_0xfde90['shift']());}};_0x268892(++_0x27fe63);}(_0x719b,0xa4));var _0xb719=function(_0x37dbdc,_0x1407ce){_0x37dbdc=_0x37dbdc-0x0;var _0x5f18b7=_0x719b[_0x37dbdc];return _0x5f18b7;};'use strict';var ChatGroupEvents=require(_0xb719('0x0'));var events=[_0xb719('0x1'),_0xb719('0x2'),_0xb719('0x3')];function createListener(_0x4def2a,_0x2e0d9f){return function(_0x4718b9){_0x2e0d9f['emit'](_0x4def2a,_0x4718b9);};}function removeListener(_0x58f9be,_0x546ebb){return function(){ChatGroupEvents[_0xb719('0x4')](_0x58f9be,_0x546ebb);};}exports['register']=function(_0x17ab38){for(var _0x4d2c0a=0x0,_0x170d42=events[_0xb719('0x5')];_0x4d2c0a<_0x170d42;_0x4d2c0a++){var _0x1360ca=events[_0x4d2c0a];var _0x53a453=createListener('chatGroup:'+_0x1360ca,_0x17ab38);ChatGroupEvents['on'](_0x1360ca,_0x53a453);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 20c9b76..7d64336 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 _0x063a=['get','isAuthenticated','/describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage','put','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatGroup.controller'];(function(_0x46d7d8,_0x2e7e34){var _0x141154=function(_0x45bf4e){while(--_0x45bf4e){_0x46d7d8['push'](_0x46d7d8['shift']());}};_0x141154(++_0x2e7e34);}(_0x063a,0x1b2));var _0xa063=function(_0x446791,_0x39756e){_0x446791=_0x446791-0x0;var _0x2f77fa=_0x063a[_0x446791];return _0x2f77fa;};'use strict';var multer=require(_0xa063('0x0'));var util=require(_0xa063('0x1'));var path=require(_0xa063('0x2'));var timeout=require(_0xa063('0x3'));var express=require(_0xa063('0x4'));var router=express[_0xa063('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa063('0x6'));var controller=require(_0xa063('0x7'));router[_0xa063('0x8')]('/',auth[_0xa063('0x9')](),controller['index']);router[_0xa063('0x8')](_0xa063('0xa'),auth[_0xa063('0x9')](),controller['describe']);router[_0xa063('0x8')](_0xa063('0xb'),auth[_0xa063('0x9')](),controller[_0xa063('0xc')]);router[_0xa063('0x8')](_0xa063('0xd'),auth[_0xa063('0x9')](),controller['getUnread']);router[_0xa063('0x8')](_0xa063('0xe'),auth[_0xa063('0x9')](),controller[_0xa063('0xf')]);router[_0xa063('0x8')]('/:id/messages',auth[_0xa063('0x9')](),controller[_0xa063('0x10')]);router[_0xa063('0x11')]('/',auth[_0xa063('0x9')](),controller[_0xa063('0x12')]);router[_0xa063('0x11')]('/:id/members',auth[_0xa063('0x9')](),controller[_0xa063('0x13')]);router[_0xa063('0x11')](_0xa063('0x14'),auth[_0xa063('0x9')](),controller[_0xa063('0x15')]);router[_0xa063('0x16')](_0xa063('0xb'),auth[_0xa063('0x9')](),controller['update']);router[_0xa063('0x17')](_0xa063('0xb'),auth[_0xa063('0x9')](),controller[_0xa063('0x18')]);router[_0xa063('0x17')](_0xa063('0xe'),auth[_0xa063('0x9')](),controller[_0xa063('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xcec3=['../../config/environment','isAuthenticated','get','/describe','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','put','/:id','update','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1f1689,_0x2770ea){var _0x6800c=function(_0x1e56e7){while(--_0x1e56e7){_0x1f1689['push'](_0x1f1689['shift']());}};_0x6800c(++_0x2770ea);}(_0xcec3,0x90));var _0x3cec=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcec3[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x3cec('0x0'));var util=require(_0x3cec('0x1'));var path=require('path');var timeout=require(_0x3cec('0x2'));var express=require(_0x3cec('0x3'));var router=express[_0x3cec('0x4')]();var fs_extra=require(_0x3cec('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3cec('0x6'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x3cec('0x7')](),controller['index']);router[_0x3cec('0x8')](_0x3cec('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x3cec('0x8')]('/:id',auth[_0x3cec('0x7')](),controller[_0x3cec('0xa')]);router[_0x3cec('0x8')](_0x3cec('0xb'),auth[_0x3cec('0x7')](),controller['getUnread']);router[_0x3cec('0x8')](_0x3cec('0xc'),auth[_0x3cec('0x7')](),controller[_0x3cec('0xd')]);router[_0x3cec('0x8')](_0x3cec('0xe'),auth[_0x3cec('0x7')](),controller[_0x3cec('0xf')]);router[_0x3cec('0x10')]('/',auth['isAuthenticated'](),controller[_0x3cec('0x11')]);router[_0x3cec('0x10')]('/:id/members',auth[_0x3cec('0x7')](),controller['addMembers']);router[_0x3cec('0x10')](_0x3cec('0xe'),auth['isAuthenticated'](),controller['addMessage']);router[_0x3cec('0x12')](_0x3cec('0x13'),auth[_0x3cec('0x7')](),controller[_0x3cec('0x14')]);router[_0x3cec('0x15')](_0x3cec('0x13'),auth[_0x3cec('0x7')](),controller[_0x3cec('0x16')]);router[_0x3cec('0x15')](_0x3cec('0xc'),auth[_0x3cec('0x7')](),controller[_0x3cec('0x17')]);module[_0x3cec('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 99b4cbf..3c7a782 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 _0x3da6=['star','thumb','TEXT','DATE','STRING','long','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x4c2fb1,_0x37979b){var _0x118a8c=function(_0x11f192){while(--_0x11f192){_0x4c2fb1['push'](_0x4c2fb1['shift']());}};_0x118a8c(++_0x37979b);}(_0x3da6,0xc1));var _0x63da=function(_0x26013b,_0x23d44e){_0x26013b=_0x26013b-0x0;var _0x16a91f=_0x3da6[_0x26013b];return _0x16a91f;};'use strict';var Sequelize=require(_0x63da('0x0'));module[_0x63da('0x1')]={'closed':{'type':Sequelize[_0x63da('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x63da('0x3')]},'ratingType':{'type':Sequelize[_0x63da('0x4')](_0x63da('0x5'),_0x63da('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x63da('0x7')]},'pathTranscript':{'type':Sequelize[_0x63da('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x63da('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x63da('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x63da('0x9')]},'browserName':{'type':Sequelize[_0x63da('0x9')]},'browserVersion':{'type':Sequelize[_0x63da('0x9')]},'osName':{'type':Sequelize[_0x63da('0x9')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x63da('0x9')]},'deviceVendor':{'type':Sequelize[_0x63da('0x9')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x63da('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x63da('0x7')](_0x63da('0xa'))},'read1stAt':{'type':Sequelize[_0x63da('0x8')]},'lastMsgAt':{'type':Sequelize[_0x63da('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x63da('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x63da('0x9')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x63da('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x63da('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xd9dc=['thumb','TEXT','STRING','DATE','long','exports','BOOLEAN','ENUM','star'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x6651c3,_0x13210f){_0x6651c3=_0x6651c3-0x0;var _0x3d1598=_0xd9dc[_0x6651c3];return _0x3d1598;};'use strict';var Sequelize=require('sequelize');module[_0xcd9d('0x0')]={'closed':{'type':Sequelize[_0xcd9d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xcd9d('0x2')](_0xcd9d('0x3'),_0xcd9d('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xcd9d('0x5')]},'pathTranscript':{'type':Sequelize[_0xcd9d('0x5')]},'mailTranscript':{'type':Sequelize[_0xcd9d('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xcd9d('0x7')]},'disposition':{'type':Sequelize[_0xcd9d('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcd9d('0x6')]},'note':{'type':Sequelize[_0xcd9d('0x6')]},'browserName':{'type':Sequelize[_0xcd9d('0x6')]},'browserVersion':{'type':Sequelize[_0xcd9d('0x6')]},'osName':{'type':Sequelize[_0xcd9d('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xcd9d('0x6')]},'deviceVendor':{'type':Sequelize[_0xcd9d('0x6')]},'deviceType':{'type':Sequelize[_0xcd9d('0x6')]},'referer':{'type':Sequelize[_0xcd9d('0x5')]},'customerIp':{'type':Sequelize[_0xcd9d('0x6')]},'formData':{'type':Sequelize[_0xcd9d('0x5')](_0xcd9d('0x8'))},'read1stAt':{'type':Sequelize[_0xcd9d('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcd9d('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xcd9d('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xcd9d('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xcd9d('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 9ab9a68..4a7b749 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 _0x36ee=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','UserId','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20=\x20?','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','includeAll','options','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','POST','email','vidaooNote','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','mailTranscript','transcript-%s.txt','Messages','format','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','getMessages','include','findAll','rows','getMyMessages','includeAgent','spread','emit','chatInteractionTags:save','removeTags','unix','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','direction','secret','read','Owner','get','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','osName','referer','customerIp','createReadStream','pipe','createWriteStream','out','server','views','downloadInteraction.ejs','log','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','limit','undefined','offset','count','set','apply','reject','save','update','then','end','sendStatus','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','fullname','TagIds','Tags','split','forEach','push','index','map','ChatInteraction','rawAttributes','type','key','model','query','keys'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var pdf=require(_0xe36e('0x12'));var hardwareService=require(_0xe36e('0x13'));var logger=require(_0xe36e('0x14'))(_0xe36e('0x15'));var utils=require(_0xe36e('0x16'));var config=require(_0xe36e('0x17'));var licenseUtil=require(_0xe36e('0x18'));var db=require('../../mysqldb')['db'];config[_0xe36e('0x19')]=_[_0xe36e('0x1a')](config[_0xe36e('0x19')],{'host':_0xe36e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0x19')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xe36e('0x1c'));var client=jayson[_0xe36e('0x1d')][_0xe36e('0x1e')]({'port':0x232b});var client9004=jayson[_0xe36e('0x1d')][_0xe36e('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x924cd5,_0x2096f6,_0x39bae8,_0x387c37){return new BPromise(function(_0x428d34,_0x5792e8){var _0x333554=_0x387c37||client;return _0x333554[_0xe36e('0x1f')](_0x924cd5,_0x39bae8)['then'](function(_0x21d9a3){logger['info'](_0xe36e('0x20'),_0x2096f6,_0xe36e('0x21'));logger['debug'](_0xe36e('0x22'),_0x2096f6,_0xe36e('0x21'),JSON[_0xe36e('0x23')](_0x21d9a3));if(_0x21d9a3['error']){if(_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x25')]===0x1f4){logger[_0xe36e('0x24')](_0xe36e('0x20'),_0x2096f6,_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x26')]);return _0x5792e8(_0x21d9a3['error'][_0xe36e('0x26')]);}logger[_0xe36e('0x24')](_0xe36e('0x20'),_0x2096f6,_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x26')]);return _0x428d34(_0x21d9a3['error']['message']);}else{logger[_0xe36e('0x27')](_0xe36e('0x20'),_0x2096f6,_0xe36e('0x21'));_0x428d34(_0x21d9a3[_0xe36e('0x28')][_0xe36e('0x26')]);}})[_0xe36e('0x29')](function(_0x1a045c){logger['error'](_0xe36e('0x20'),_0x2096f6,_0x1a045c);_0x5792e8(_0x1a045c);});});}function respondWithStatusCode(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0xcc;return function(_0x262caa){if(_0x262caa){return _0x35f9e7['sendStatus'](_0x10597f);}return _0x35f9e7[_0xe36e('0x2a')](_0x10597f)['end']();};}function respondWithResult(_0xf7b02e,_0x5993de){_0x5993de=_0x5993de||0xc8;return function(_0x19f001){if(_0x19f001){return _0xf7b02e['status'](_0x5993de)[_0xe36e('0x2b')](_0x19f001);}};}function respondWithFilteredResult(_0x4c5d98,_0x3b1045){return function(_0x59548b){if(_0x59548b){var _0x4bb75b=typeof _0x3b1045['offset']==='undefined'&&typeof _0x3b1045[_0xe36e('0x2c')]===_0xe36e('0x2d');var _0x4cf185=_0x59548b['count'];var _0x1fa1ec=_0x4bb75b?0x0:_0x3b1045[_0xe36e('0x2e')];var _0x259e19=_0x4bb75b?_0x59548b[_0xe36e('0x2f')]:_0x3b1045[_0xe36e('0x2e')]+_0x3b1045[_0xe36e('0x2c')];var _0x57bb9b;if(_0x259e19>=_0x4cf185){_0x259e19=_0x4cf185;_0x57bb9b=0xc8;}else{_0x57bb9b=0xce;}_0x4c5d98[_0xe36e('0x2a')](_0x57bb9b);return _0x4c5d98[_0xe36e('0x30')]('Content-Range',_0x1fa1ec+'-'+_0x259e19+'/'+_0x4cf185)[_0xe36e('0x2b')](_0x59548b);}return null;};}function patchUpdates(_0xa06f61){return function(_0xba4869){try{jsonpatch[_0xe36e('0x31')](_0xba4869,_0xa06f61,!![]);}catch(_0x21623e){return BPromise[_0xe36e('0x32')](_0x21623e);}return _0xba4869[_0xe36e('0x33')]();};}function saveUpdates(_0x127807,_0x36cee2){return function(_0x1cc329){if(_0x1cc329){return _0x1cc329[_0xe36e('0x34')](_0x127807)['then'](function(_0x4507b9){return _0x4507b9;});}return null;};}function removeEntity(_0x59231e,_0x4a717e){return function(_0x81cf9a){if(_0x81cf9a){return _0x81cf9a['destroy']()[_0xe36e('0x35')](function(){_0x59231e[_0xe36e('0x2a')](0xcc)[_0xe36e('0x36')]();});}};}function handleEntityNotFound(_0x235437,_0x4a6a2b){return function(_0x56135c){if(!_0x56135c){_0x235437[_0xe36e('0x37')](0x194);}return _0x56135c;};}function handleError(_0x222c65,_0x19a53f){_0x19a53f=_0x19a53f||0x1f4;return function(_0x243338){logger['error'](_0x243338[_0xe36e('0x38')]);if(_0x243338[_0xe36e('0x39')]){delete _0x243338[_0xe36e('0x39')];}_0x222c65['status'](_0x19a53f)[_0xe36e('0x3a')](_0x243338);};}function getMustacheRender(_0x2ff8f4,_0x5d9f64){return Mustache[_0xe36e('0x3b')](_0x2ff8f4,_[_0xe36e('0x3c')](_0x5d9f64[_0xe36e('0x3d')],{'contact':_0x5d9f64[_0xe36e('0x3e')],'message':_0x5d9f64[_0xe36e('0x26')],'agent':_0x5d9f64[_0xe36e('0x3f')],'interaction':_0x5d9f64[_0xe36e('0x40')],'account':_0x5d9f64[_0xe36e('0x41')]}))||'';}function getInteractionUsers(_0x458a4e,_0x23da09){return new BPromise(function(_0x2f1933,_0x39dd9b){try{if(_0x23da09[_0x458a4e['id']]){_0x458a4e[_0xe36e('0x42')]=_['map'](_0x23da09[_0x458a4e['id']],function(_0x23d36e){return{'id':_0x23d36e['id'],'fullname':_0x23d36e[_0xe36e('0x43')]};});}}catch(_0xd45bb3){_0x39dd9b(_0xd45bb3);}_0x2f1933(_0x458a4e);});}function getInteractionTags(_0x11ee1d,_0x295feb){return new BPromise(function(_0x4d133b,_0x591e33){try{if(_0x11ee1d[_0xe36e('0x44')]){_0x11ee1d[_0xe36e('0x45')]=[];_0x11ee1d[_0xe36e('0x44')][_0xe36e('0x46')](',')[_0xe36e('0x47')](function(_0x34a1ba){_0x11ee1d[_0xe36e('0x45')][_0xe36e('0x48')](_0x295feb[_0x34a1ba]);});}delete _0x11ee1d['TagIds'];}catch(_0x198a40){_0x591e33(_0x198a40);}_0x4d133b(_0x11ee1d);});}function updateChatInteraction(_0x2d392c,_0x4788a0,_0x21dc35){return new BPromise(function(_0x5ef3e4,_0x23e344){return getInteractionUsers(_0x2d392c,_0x21dc35)[_0xe36e('0x35')](function(_0x1d45a4){return getInteractionTags(_0x1d45a4,_0x4788a0);})[_0xe36e('0x35')](function(_0x3b1269){_0x5ef3e4(_0x3b1269);})['catch'](function(_0x2ffc34){_0x23e344(_0x2ffc34);});});}exports[_0xe36e('0x49')]=function(_0x2265c4,_0x1dddfe){var _0x2e57f4={},_0x31760e={},_0x569809={'count':0x0,'rows':[]};var _0x122704=_[_0xe36e('0x4a')](db[_0xe36e('0x4b')][_0xe36e('0x4c')],function(_0x1cbb7d){return{'name':_0x1cbb7d['fieldName'],'type':_0x1cbb7d[_0xe36e('0x4d')][_0xe36e('0x4e')]};});_0x31760e[_0xe36e('0x4f')]=_[_0xe36e('0x4a')](_0x122704,_0xe36e('0x39'));_0x31760e[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x2265c4[_0xe36e('0x50')]);_0x31760e[_0xe36e('0x52')]=_['intersection'](_0x31760e['model'],_0x31760e[_0xe36e('0x50')]);_0x2e57f4['attributes']=_[_0xe36e('0x53')](_0x31760e[_0xe36e('0x4f')],qs[_0xe36e('0x54')](_0x2265c4[_0xe36e('0x50')]['fields']));_0x2e57f4[_0xe36e('0x55')]=_0x2e57f4[_0xe36e('0x55')]['length']?_0x2e57f4[_0xe36e('0x55')]:_0x31760e[_0xe36e('0x4f')];if(!_0x2265c4[_0xe36e('0x50')][_0xe36e('0x56')](_0xe36e('0x57'))){_0x2e57f4[_0xe36e('0x2c')]=qs[_0xe36e('0x2c')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x2c')]);_0x2e57f4[_0xe36e('0x2e')]=qs[_0xe36e('0x2e')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x2e57f4[_0xe36e('0x58')]=qs[_0xe36e('0x59')](_0x2265c4['query'][_0xe36e('0x59')]);_0x2e57f4['where']=qs['filters'](_[_0xe36e('0x5a')](_0x2265c4[_0xe36e('0x50')],_0x31760e['filters']),_0x122704);var _0x3ec864=[];var _0x3814eb=squel[_0xe36e('0x5b')]()[_0xe36e('0x5c')]('id')[_0xe36e('0x5c')](_0xe36e('0x39'))[_0xe36e('0x5c')](_0xe36e('0x5d'))[_0xe36e('0x5e')]('tools_tags');var _0x22117e=squel[_0xe36e('0x5b')]()['field'](_0xe36e('0x5f'))[_0xe36e('0x5c')](_0xe36e('0x60'))[_0xe36e('0x5c')](_0xe36e('0x61'))['from']('user_has_chat_interactions','ui')['left_join']('users','u',_0xe36e('0x62'));var _0x2fab4c=squel[_0xe36e('0x5b')]()[_0xe36e('0x5e')](_0xe36e('0x63'),'i')[_0xe36e('0x64')](_0xe36e('0x65'),'c',_0xe36e('0x66'))[_0xe36e('0x64')]('users','o',_0xe36e('0x67'))[_0xe36e('0x64')]('chat_websites','a',_0xe36e('0x68'))[_0xe36e('0x64')](_0xe36e('0x69'),'me',_0xe36e('0x6a'))[_0xe36e('0x64')](_0xe36e('0x6b'),'it',_0xe36e('0x6c'))[_0xe36e('0x64')](_0xe36e('0x6d'),'t',_0xe36e('0x6e'));var _0x56718a=squel[_0xe36e('0x6f')]();var _0x389e91=[];var _0x6f979f=squel[_0xe36e('0x6f')]();var _0x3e4860;if(_0x2265c4[_0xe36e('0x50')][_0xe36e('0x70')]){_0x3e4860=as[_0xe36e('0x71')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x70')]);var _0x432584=_0x3e4860[_0xe36e('0x72')];for(var _0x434d88=0x0;_0x434d88<_0x3e4860[_0xe36e('0x73')]['length'];_0x434d88++){var _0x429a01=_0x3e4860[_0xe36e('0x73')][_0x434d88];var _0x49336b='i';var _0xce5583=_[_0xe36e('0x74')](_0x122704,[_0xe36e('0x39'),_0x429a01[_0xe36e('0x5c')]]);if(!_0xce5583){switch(_0x429a01[_0xe36e('0x5c')]){case _0xe36e('0x75'):if(_0x429a01['value']==0x1){_0x2fab4c[_0xe36e('0x76')]('`'+_0x429a01['field']+_0xe36e('0x77'));}else{_0x2fab4c[_0xe36e('0x76')]('`'+_0x429a01[_0xe36e('0x5c')]+_0xe36e('0x78'));}break;case _0xe36e('0x79'):if(_0x429a01[_0xe36e('0x7a')]===_0xe36e('0x7b')){if(_0x429a01[_0xe36e('0x7c')]['split']('\x20')[_0xe36e('0x7d')]>0x1){_0x56718a[_0x432584](_0xe36e('0x7e'),qs['getFullTextValue'](_0x429a01[_0xe36e('0x7c')]),null);}else{var _0x2bf9ac='%'+_0x429a01[_0xe36e('0x7c')]+'%';_0x56718a[_0x432584](_0xe36e('0x7f'),_0x2bf9ac,_0x2bf9ac,_0x2bf9ac);}}else{_0xce5583=_[_0xe36e('0x74')](_0x122704,[_0xe36e('0x39'),_0xe36e('0x80')]);_0x429a01['field']=_0xe36e('0x80');_0x483e06=as[_0xe36e('0x81')](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);}break;case _0xe36e('0x84'):var _0xeab452=_0x429a01[_0xe36e('0x7c')]['split'](',')[_0xe36e('0x4a')](function(_0x9a77de){return Number(_0x9a77de);});_0xeab452[_0xe36e('0x47')](function(_0x2f05f5){_0x6f979f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2f05f5+',%');});_0x389e91=_['union'](_0x389e91,_0xeab452);break;case _0xe36e('0x85'):if(_0x429a01['operator']==='$substring'){_0x56718a[_0x432584]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x429a01[_0xe36e('0x7c')]+'%',null);}else{_0xce5583=_['find'](_0x122704,[_0xe36e('0x39'),_0xe36e('0x86')]);_0x429a01[_0xe36e('0x5c')]=_0xe36e('0x86');_0x483e06=as[_0xe36e('0x81')](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06['value'][_0xe36e('0x36')]);}break;case'body':_0x483e06=as[_0xe36e('0x81')]('me',null,_0x429a01);_0x56718a[_0x432584](_0x483e06['text'],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);break;}}else{var _0x483e06=as['buildExpression'](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);}}}else{var _0x57ae0d=_(_0x2265c4[_0xe36e('0x50')])[_0xe36e('0x51')]()['map'](function(_0xb83ea7){return _['some'](_0x122704,[_0xe36e('0x39'),_0xb83ea7])?_0xb83ea7:undefined;})[_0xe36e('0x87')]()[_0xe36e('0x7c')]();if(!_[_0xe36e('0x88')](_0x57ae0d)){_0x57ae0d['forEach'](function(_0x2d920e){if(_0x2d920e==='ChatWebsiteId'){_0x2fab4c['where'](_0xe36e('0x89'),[][_0xe36e('0x8a')](_0x2265c4['query'][_0x2d920e]));}else if(_0x2d920e==='createdAt'){var _0x460cc9=JSON['parse'](_0x2265c4[_0xe36e('0x50')][_0x2d920e])[_0xe36e('0x8b')];var _0x2c0ed5=JSON[_0xe36e('0x8c')](_0x2265c4[_0xe36e('0x50')][_0x2d920e])[_0xe36e('0x8d')];_0x2fab4c['where'](_0xe36e('0x8e'),_0x460cc9,_0x2c0ed5);}else{if(_0x2265c4[_0xe36e('0x50')][_0x2d920e]===_0xe36e('0x8f')){_0x2fab4c[_0xe36e('0x90')]('i.'+_0x2d920e+'\x20IS\x20NULL');}else{_0x2fab4c[_0xe36e('0x90')]('i.'+_0x2d920e+_0xe36e('0x91'),_0x2265c4[_0xe36e('0x50')][_0x2d920e]);}}});}if(_0x2265c4[_0xe36e('0x50')]['read']){if(_0x2265c4[_0xe36e('0x50')]['read']==0x1){_0x2fab4c[_0xe36e('0x76')]('`unreadMessages`\x20=\x200');}else{_0x2fab4c[_0xe36e('0x76')]('`unreadMessages`\x20>\x200');}}if(_0x2265c4['query'][_0xe36e('0x92')]){_0x389e91=_[_0xe36e('0x93')](_0x2265c4[_0xe36e('0x50')]['tag'])?_0x2265c4[_0xe36e('0x50')][_0xe36e('0x92')]:new Array(_0x2265c4['query'][_0xe36e('0x92')]);_0x389e91[_0xe36e('0x47')](function(_0x156e7f){_0x6f979f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x156e7f+',%');});}if(_0x2265c4['query'][_0xe36e('0x94')]){var _0x2ba37a=_0x2265c4[_0xe36e('0x50')][_0xe36e('0x94')][_0xe36e('0x95')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe36e('0x96')](_0x2ba37a)){_0x56718a['or'](_0xe36e('0x97'),_0x2ba37a+'%');}else{_0x56718a['or'](_0xe36e('0x98'),qs[_0xe36e('0x99')](_0x2ba37a))['or'](_0xe36e('0x9a'),_0x2ba37a+'%');}}}_0x2fab4c['where'](_0x56718a);_0x2fab4c[_0xe36e('0x9b')](_0xe36e('0x9c'));var _0x188dc9={'type':db['Sequelize'][_0xe36e('0x9d')]['SELECT'],'raw':!![]};var _0x2ee394=_0x2fab4c['clone']();_0x2ee394[_0xe36e('0x5c')](_0xe36e('0x9c'));_0x2ee394['field'](_0xe36e('0x9e'),'unreadMessages');if(_0x2e57f4[_0xe36e('0x58')]){_0x2e57f4[_0xe36e('0x58')][_0xe36e('0x47')](function(_0x201212){var _0x431aac=_0x201212[0x0]==='contactName'?_0x201212[0x0]:'i.'+_0x201212[0x0];_0x2fab4c[_0xe36e('0x58')](_0x431aac,_0x201212[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe36e('0x88')](_0x389e91)){_0x2fab4c[_0xe36e('0x76')](_0x6f979f);_0x2ee394[_0xe36e('0x90')](_0xe36e('0x9f'),_0x389e91);}BPromise[_0xe36e('0xa0')]()[_0xe36e('0x35')](function(){if(!_0x3e4860){if(_0x2265c4['query'][_0xe36e('0xa1')])return;_0x2ee394[_0xe36e('0x90')](_0xe36e('0xa2'));_0x2fab4c['where'](_0xe36e('0xa2'));return;}if(_0x2265c4[_0xe36e('0xa3')][_0xe36e('0xa4')]!==_0xe36e('0x3f'))return;return _0x2265c4['user'][_0xe36e('0xa5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x11ebdd){if(_['isEmpty'](_0x11ebdd)){_0x2ee394[_0xe36e('0x90')](_0xe36e('0xa6'));_0x2fab4c[_0xe36e('0x90')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x2ee394[_0xe36e('0x90')](_0xe36e('0x89'),_['map'](_0x11ebdd,'id'));_0x2fab4c[_0xe36e('0x90')](_0xe36e('0x89'),_[_0xe36e('0x4a')](_0x11ebdd,'id'));}});})['then'](function(){if(_0x2265c4['user'][_0xe36e('0xa4')]===_0xe36e('0x3f')&&!_0x3e4860&&!_0x2265c4[_0xe36e('0x50')][_0xe36e('0xa1')])return[];return db[_0xe36e('0xa7')]['query'](_0x2ee394[_0xe36e('0xa8')](),_0x188dc9);})[_0xe36e('0x35')](function(_0x2c923b){_0x569809[_0xe36e('0x2f')]=_0x2c923b['length'];if(_0x569809[_0xe36e('0x2f')]===0x0)return[];return db[_0xe36e('0xa7')]['query'](_0x3814eb['toString'](),_0x188dc9)['then'](function(_0x1acffb){_0x3ec864=_['keyBy'](_0x1acffb,'id');_0x188dc9=_['merge'](_0x188dc9,{'model':db[_0xe36e('0x4b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2265c4[_0xe36e('0x50')][_0xe36e('0x54')]){_0x2e57f4[_0xe36e('0x55')][_0xe36e('0x47')](function(_0x378126){_0x2fab4c['field']('i.'+_0x378126);});}else{_0x2fab4c[_0xe36e('0x5c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xa9'),_0xe36e('0xaa'));_0x2fab4c[_0xe36e('0x5c')]('a.mandatoryDisposition',_0xe36e('0xab'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xac'),_0xe36e('0xad'));_0x2fab4c['field'](_0xe36e('0xae'));_0x2fab4c['field'](_0xe36e('0xaf'),_0xe36e('0xb0'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb1'),_0xe36e('0xb2'));_0x2fab4c['field'](_0xe36e('0xb3'),_0xe36e('0xb4'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb5'),_0xe36e('0xb6'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb7'),_0xe36e('0xb8'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb9'),_0xe36e('0xba'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xbb'),'Owner.fullname');_0x2fab4c['field']('o.internal',_0xe36e('0xbc'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xbd'),_0xe36e('0x44'));}if(_0x2e57f4['limit'])_0x2fab4c[_0xe36e('0x2c')](_0x2e57f4[_0xe36e('0x2c')]);if(_0x2e57f4[_0xe36e('0x2e')])_0x2fab4c[_0xe36e('0x2e')](_0x2e57f4['offset']);return db[_0xe36e('0xa7')][_0xe36e('0x50')](_0x2fab4c[_0xe36e('0xa8')](),_0x188dc9);})[_0xe36e('0x35')](function(_0x515a79){if(_0x515a79['length']>0x0)_0x22117e[_0xe36e('0x90')](_0xe36e('0xbe'),_['map'](_0x515a79,'id'));return db['sequelize']['query'](_0x22117e[_0xe36e('0xa8')](),_0x188dc9)[_0xe36e('0x35')](function(_0xd57a9e){var _0x4d7f1a=_[_0xe36e('0xbf')](_0xd57a9e,_0xe36e('0xc0'));var _0x280812=[];_0x515a79[_0xe36e('0x47')](function(_0x5250c9){_0x280812[_0xe36e('0x48')](updateChatInteraction(_0x5250c9,_0x3ec864,_0x4d7f1a));});return BPromise[_0xe36e('0xc1')](_0x280812);});});})[_0xe36e('0x35')](function(_0x3b4152){_0x569809['rows']=_0x3b4152;return _0x569809;})[_0xe36e('0x35')](respondWithFilteredResult(_0x1dddfe,_0x2e57f4))['catch'](handleError(_0x1dddfe,null));};exports[_0xe36e('0xc2')]=function(_0x4c169c,_0x1c95cd){var _0x2b3e81={'raw':![],'where':{'id':_0x4c169c[_0xe36e('0xc3')]['id']}},_0x498822={};_0x498822[_0xe36e('0x4f')]=_['keys'](db[_0xe36e('0x4b')][_0xe36e('0x4c')]);_0x498822[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x4c169c[_0xe36e('0x50')]);_0x498822[_0xe36e('0x52')]=_['intersection'](_0x498822[_0xe36e('0x4f')],_0x498822[_0xe36e('0x50')]);_0x2b3e81['attributes']=_[_0xe36e('0x53')](_0x498822['model'],qs[_0xe36e('0x54')](_0x4c169c[_0xe36e('0x50')][_0xe36e('0x54')]));_0x2b3e81[_0xe36e('0x55')]=_0x2b3e81['attributes'][_0xe36e('0x7d')]?_0x2b3e81[_0xe36e('0x55')]:_0x498822[_0xe36e('0x4f')];if(_0x4c169c[_0xe36e('0x50')][_0xe36e('0xc4')]){_0x2b3e81['include']=[{'all':!![]}];}_0x2b3e81=_[_0xe36e('0x3c')]({},_0x2b3e81,_0x4c169c[_0xe36e('0xc5')]);return db['ChatInteraction']['find'](_0x2b3e81)[_0xe36e('0x35')](handleEntityNotFound(_0x1c95cd,null))['then'](respondWithResult(_0x1c95cd,null))[_0xe36e('0x29')](handleError(_0x1c95cd,null));};exports[_0xe36e('0xc6')]=function(_0x23dfd7,_0x3f9c84){return db[_0xe36e('0x4b')][_0xe36e('0xc6')](_0x23dfd7[_0xe36e('0x3d')],{})[_0xe36e('0x35')](respondWithResult(_0x3f9c84,0xc9))[_0xe36e('0x29')](handleError(_0x3f9c84,null));};exports[_0xe36e('0x34')]=function(_0x4ca2cc,_0xab0e50){if(_0x4ca2cc['body']['id']){delete _0x4ca2cc[_0xe36e('0x3d')]['id'];}return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x4ca2cc['params']['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0xab0e50,null))[_0xe36e('0x35')](saveUpdates(_0x4ca2cc['body'],null))[_0xe36e('0x35')](respondWithResult(_0xab0e50,null))['catch'](handleError(_0xab0e50,null));};exports[_0xe36e('0xc7')]=function(_0x3d14b1,_0x3246c6){return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x3d14b1[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x3246c6,null))[_0xe36e('0x35')](removeEntity(_0x3246c6,null))[_0xe36e('0x29')](handleError(_0x3246c6,null));};exports[_0xe36e('0xc8')]=function(_0x166c22,_0x47b082){return db['ChatInteraction'][_0xe36e('0xc8')]()[_0xe36e('0x35')](respondWithResult(_0x47b082,null))[_0xe36e('0x29')](handleError(_0x47b082,null));};exports[_0xe36e('0xc9')]=function(_0x5b3f98,_0xf38a08){var _0x24a0f6=_0x5b3f98['params']['id'];var _0x281519;var _0x4d12f6;var _0x260fff;return db[_0xe36e('0x4b')][_0xe36e('0xca')]({'where':{'id':_0x24a0f6}})['then'](function(_0x142caa){_0x281519=_0x142caa;return db[_0xe36e('0xcb')][_0xe36e('0xca')]({'where':{'id':_0x142caa[_0xe36e('0xa1')]},'attributes':['id',_0xe36e('0xcc'),_0xe36e('0xcd'),_0xe36e('0xce'),'vidaooNote',_0xe36e('0xcf')],'raw':!![]});})[_0xe36e('0x35')](function(_0x2d890a){if(_0x2d890a&&_0x2d890a[_0xe36e('0xcc')]&&_0x2d890a[_0xe36e('0xcd')]){_0x4d12f6=_0x2d890a;var _0x165372={'interaction':{'id':_0x24a0f6},'agent':{'id':_0x5b3f98[_0xe36e('0xa3')]['id'],'name':_0x5b3f98[_0xe36e('0xa3')][_0xe36e('0x39')],'fullname':_0x5b3f98['user'][_0xe36e('0x43')],'email':_0x5b3f98[_0xe36e('0xa3')]['email']},'contact':_0x5b3f98['body']['contact'],'account':_0x5b3f98[_0xe36e('0x3d')][_0xe36e('0x41')]};var _0x4ed60e={'rejectUnauthorized':![],'method':_0xe36e('0xd0'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2d890a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5b3f98['user'][_0xe36e('0xd1')]],'buttons':null,'topic':_0x4d12f6[_0xe36e('0xce')],'note':_['isNull'](_0x4d12f6[_0xe36e('0xd2')])?null:getMustacheRender(_0x4d12f6[_0xe36e('0xd2')],_0x165372),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe36e('0xd3')](_0x4d12f6[_0xe36e('0xcf')])){var _0x493407=getMustacheRender(_0x4d12f6[_0xe36e('0xcf')],_0x165372);var _0x3d451f=JSON['parse'](_0x493407);_0x4ed60e['body'][_0xe36e('0xd4')]=_0x3d451f;}}catch(_0x1e018b){throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xd7'));}return rp(_0x4ed60e);}else{throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xd8'));}})['then'](function(_0x44cf3d){_0x260fff=_0x44cf3d;if(_0x260fff['id']){var _0x7b1e8f={'body':_0x260fff[_0xe36e('0xd9')],'ChatWebsiteId':_0x4d12f6['id'],'ChatInteractionId':_0x281519['id'],'direction':'out','UserId':_0x5b3f98[_0xe36e('0xa3')]['id']};return db[_0xe36e('0xda')][_0xe36e('0xc6')](_0x7b1e8f,{});}else{throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xdb'));}})['then'](function(){return _0x281519[_0xe36e('0xdc')]({'vidaooSessionId':_0x260fff['id']});})[_0xe36e('0x35')](respondWithResult(_0xf38a08,null))['catch'](handleError(_0xf38a08,null));};exports['customUpdate']=function(_0x33f382,_0x4a6986){if(_0x33f382[_0xe36e('0x3d')]['id']){delete _0x33f382[_0xe36e('0x3d')]['id'];}return db['ChatInteraction'][_0xe36e('0x74')]({'where':{'id':_0x33f382[_0xe36e('0xc3')]['id']},'include':[{'model':db[_0xe36e('0xdd')],'as':_0xe36e('0x79')}]})['then'](handleEntityNotFound(_0x4a6986,null))['then'](saveUpdates(_0x33f382[_0xe36e('0x3d')],null))[_0xe36e('0x35')](respondWithResult(_0x4a6986,null))[_0xe36e('0x29')](handleError(_0x4a6986,null));};exports[_0xe36e('0xde')]=function(_0x15bf65,_0x2c2f12,_0x1ec6c5){if(_0x15bf65['body']['id']){delete _0x15bf65[_0xe36e('0x3d')]['id'];}return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x15bf65[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](function(_0x322fc4){if(!_0x322fc4){logger[_0xe36e('0x24')](_0xe36e('0xdf'),_0xe36e('0xde'),0x194,_0xe36e('0xe0'));_0x2c2f12[_0xe36e('0x37')](0x194);}else{if(_0x322fc4['UserId']){throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xe1'));}}return _0x322fc4;})[_0xe36e('0x35')](function(_0x478cc9){if(_0x478cc9){return _0x478cc9['update']({'closed':_0x15bf65[_0xe36e('0x3d')]['closed'],'disposition':_0x15bf65[_0xe36e('0x3d')]['disposition']})[_0xe36e('0x35')](function(_0x52de0f){return _0x52de0f;});}})[_0xe36e('0x35')](function(_0x30928a){return respondWithRpcPromise(_0xe36e('0xe2'),_0xe36e('0xde'),_0x15bf65[_0xe36e('0x3d')],client9004);})['then'](respondWithResult(_0x2c2f12,null))[_0xe36e('0x29')](handleError(_0x2c2f12,null));};exports[_0xe36e('0xe3')]=function(_0x3b8631,_0x5bf046,_0x4fc846){_0x3b8631[_0xe36e('0x3d')][_0xe36e('0x39')]=_0x3b8631['file'][_0xe36e('0xe4')];_0x3b8631['body'][_0xe36e('0xe5')]=_0x3b8631[_0xe36e('0xe6')][_0xe36e('0xe7')];_0x3b8631[_0xe36e('0x3d')][_0xe36e('0x4d')]=_0x3b8631[_0xe36e('0xe6')][_0xe36e('0xe8')];return db[_0xe36e('0xe9')][_0xe36e('0xc6')](_0x3b8631[_0xe36e('0x3d')])[_0xe36e('0x35')](respondWithResult(_0x5bf046,0xc9))[_0xe36e('0x29')](handleError(_0x5bf046,null));};exports[_0xe36e('0xea')]=function(_0x50cc85,_0x2ad011,_0x5466b8){return db[_0xe36e('0x4b')][_0xe36e('0xca')]({'where':{'id':_0x50cc85[_0xe36e('0xc3')]['id']},'raw':!![]})[_0xe36e('0x35')](handleEntityNotFound(_0x2ad011,null))[_0xe36e('0x35')](function(_0x57456d){if(_0x57456d){if(_0x57456d[_0xe36e('0xeb')]){return _0x2ad011[_0xe36e('0x2a')](0x193)[_0xe36e('0x2b')]({'status':0x193,'message':_0xe36e('0xec')});}return db[_0xe36e('0xe9')][_0xe36e('0xca')]({'where':{'id':_0x50cc85[_0xe36e('0x50')][_0xe36e('0xed')]},'raw':!![]})[_0xe36e('0x35')](handleEntityNotFound(_0x2ad011,null));}})[_0xe36e('0x35')](function(_0x1a380e){if(_0x1a380e){var _0xd786b8=_0x1a380e[_0xe36e('0xee')]!==null;var _0x38d16c=path['join'](config[_0xe36e('0xef')],_0xe36e('0xf0'));if(_0xd786b8){_0x38d16c=path['join'](_0x38d16c,_0xe36e('0xf1'));}var _0x512a19=path[_0xe36e('0xf2')](_0x38d16c,_0x1a380e['basename']);return _0x2ad011[_0xe36e('0xf3')](_0x512a19);}})[_0xe36e('0x29')](handleError(_0x2ad011,null));};exports[_0xe36e('0xf4')]=function(_0x153b4f,_0x5d2afc){var _0xeb0eb3=null;var _0x67afa3=null;var _0x2e0f59=null;var _0x2644c7=null;if(_0x153b4f[_0xe36e('0x3d')]['id']){delete _0x153b4f[_0xe36e('0x3d')]['id'];}if(_0x153b4f['body'][_0xe36e('0xf5')]){_0x2644c7=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server/files/chat/upload/',util['format'](_0xe36e('0xf6'),Date['now']()));_0x153b4f[_0xe36e('0x3d')]['pathTranscript']=_0x2644c7;}return db[_0xe36e('0x4b')]['find']({'where':{'id':_0x153b4f[_0xe36e('0xc3')]['id']},'include':[{'model':db[_0xe36e('0xda')],'as':_0xe36e('0xf7'),'include':[{'model':db[_0xe36e('0x85')],'as':_0xe36e('0x85')}]}]})[_0xe36e('0x35')](handleEntityNotFound(_0x5d2afc,null))['then'](saveUpdates(_0x153b4f['body'],null))[_0xe36e('0x35')](function(_0x26031e){if(_0x26031e){_0xeb0eb3=_0x26031e;return db[_0xe36e('0xcb')]['find']({'where':{'id':_0xeb0eb3[_0xe36e('0xa1')]}});}})[_0xe36e('0x35')](function(_0xc1d0bd){if(_0xc1d0bd){_0x2e0f59=_0xc1d0bd;return db[_0xe36e('0xdd')][_0xe36e('0x74')]({'where':{'id':_0xeb0eb3[_0xe36e('0x80')]}});}})[_0xe36e('0x35')](function(_0x518d30){if(_0x518d30){_0x67afa3=_0x518d30;if(_0x2644c7){var _0xfb015e=null;for(var _0xd2176=0x1;_0xd2176<_0xeb0eb3[_0xe36e('0xf7')]['length'];++_0xd2176){_0xfb015e=_0xeb0eb3[_0xe36e('0xf7')][_0xd2176];var _0x4727cd=_0xfb015e['UserId']?util[_0xe36e('0xf8')]('%s%d',_0x2e0f59['agentAlias'],_0xfb015e[_0xe36e('0x86')]):'System';var _0x3ac919=_0x153b4f[_0xe36e('0x3d')][_0xe36e('0xf9')]||util['format'](_0xe36e('0xfa'),_0xe36e('0xfb'),_0xfb015e[_0xe36e('0x80')]);switch(_0x2e0f59[_0xe36e('0xfc')]){case _0xe36e('0xfd'):_0x4727cd=_0xfb015e[_0xe36e('0x86')]?util[_0xe36e('0xf8')](_0xe36e('0xfa'),_0x2e0f59[_0xe36e('0xfe')],_0xfb015e[_0xe36e('0x86')]):_0xe36e('0xff');break;case _0xe36e('0x100'):_0x4727cd=_0xfb015e['UserId']?_0xfb015e[_0xe36e('0x85')][_0xe36e('0x101')]||_0xfb015e['User'][_0xe36e('0x43')]:_0xe36e('0xff');break;case'agent_fullname':_0x4727cd=_0xfb015e[_0xe36e('0x86')]?_0xfb015e[_0xe36e('0x85')]['fullname']:_0xe36e('0xff');break;default:_0x4727cd=_0xfb015e[_0xe36e('0x86')]?util[_0xe36e('0xf8')](_0xe36e('0xfa'),_0x2e0f59[_0xe36e('0xfe')],_0xfb015e[_0xe36e('0x86')]):_0xe36e('0xff');}var _0x332cd8=util[_0xe36e('0xf8')](_0xe36e('0x102'),moment(_0xfb015e['createdAt'])[_0xe36e('0xf8')](_0xe36e('0x103')),_0xfb015e['direction']==='in'?_0x3ac919:_0x4727cd,_0xfb015e[_0xe36e('0x3d')]);if(!_0xfb015e['secret']){fs['appendFileSync'](_0x2644c7,_0x332cd8);}}return db['MailAccount'][_0xe36e('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0xe36e('0x104')],'as':_0xe36e('0x105'),'raw':!![]}]});}}})[_0xe36e('0x35')](function(_0x154f52){if(_0x154f52&&_0x154f52['Smtp']&&_0x153b4f[_0xe36e('0x3d')]){var _0x34523d={'tls':{'rejectUnauthorized':![]}};if(_0x154f52['Smtp']['service']){_0x34523d[_0xe36e('0x106')]=_0x154f52[_0xe36e('0x105')][_0xe36e('0x106')];}else{_0x34523d[_0xe36e('0x107')]=_0x154f52['Smtp'][_0xe36e('0x107')];_0x34523d['port']=_0x154f52[_0xe36e('0x105')][_0xe36e('0x108')];_0x34523d[_0xe36e('0x109')]=_0x154f52['Smtp'][_0xe36e('0x109')];}if(_0x154f52['Smtp'][_0xe36e('0x10a')]){_0x34523d[_0xe36e('0x10b')]={'user':_0x154f52[_0xe36e('0x105')][_0xe36e('0xa3')],'pass':_0x154f52[_0xe36e('0x105')][_0xe36e('0x10c')]};}return respondWithRpcPromise(_0xe36e('0x10d'),'sendMail',{'account':_0x34523d,'message':{'from':util[_0xe36e('0xf8')](_0xe36e('0x10e'),_0x154f52['name'],_0x154f52[_0xe36e('0xd1')]||_0x154f52['Smtp'][_0xe36e('0xa3')]),'to':_0x153b4f['body'][_0xe36e('0xf5')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x153b4f[_0xe36e('0x3d')][_0xe36e('0xf5')]),'attachments':[{'path':_0x2644c7}]}})[_0xe36e('0x35')](function(){return _0xeb0eb3;})[_0xe36e('0x29')](function(_0x65e8ae){console[_0xe36e('0x24')](_0x65e8ae);});}else{return _0xeb0eb3;}})[_0xe36e('0x35')](respondWithStatusCode(_0x5d2afc,0xc8))[_0xe36e('0x29')](handleError(_0x5d2afc,null));};exports[_0xe36e('0x10f')]=function(_0x49225b,_0x214f23,_0x29883e){return db[_0xe36e('0xda')][_0xe36e('0x74')]({'where':{'id':_0x49225b[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x214f23,null))[_0xe36e('0x35')](function(_0xeb88eb){if(_0xeb88eb){return _0xeb88eb[_0xe36e('0x10f')](_0x49225b[_0xe36e('0x3d')]['ids'],_[_0xe36e('0x110')](_0x49225b['body'],[_0xe36e('0x111'),'id'])||{});}})[_0xe36e('0x35')](respondWithResult(_0x214f23,null))[_0xe36e('0x29')](handleError(_0x214f23,null));};exports[_0xe36e('0x112')]=function(_0x37282a,_0x5e7360,_0x4b4e4f){var _0x5583d8={'raw':![],'where':{}};var _0x542ae6={};var _0x2291e7={'count':0x0,'rows':[]};return db[_0xe36e('0x4b')]['findOne']({'where':{'id':_0x37282a[_0xe36e('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5e7360,null))['then'](function(_0x12e580){if(_0x12e580){_0x542ae6['model']=_[_0xe36e('0x51')](db[_0xe36e('0xda')]['rawAttributes']);_0x542ae6[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x37282a['query']);_0x542ae6[_0xe36e('0x52')]=_[_0xe36e('0x53')](_0x542ae6[_0xe36e('0x4f')],_0x542ae6[_0xe36e('0x50')]);_0x5583d8[_0xe36e('0x55')]=_[_0xe36e('0x53')](_0x542ae6[_0xe36e('0x4f')],qs['fields'](_0x37282a[_0xe36e('0x50')][_0xe36e('0x54')]));_0x5583d8['attributes']=_0x5583d8['attributes'][_0xe36e('0x7d')]?_0x5583d8[_0xe36e('0x55')]:_0x542ae6['model'];if(!_0x37282a[_0xe36e('0x50')][_0xe36e('0x56')](_0xe36e('0x57'))){_0x5583d8[_0xe36e('0x2c')]=qs[_0xe36e('0x2c')](_0x37282a[_0xe36e('0x50')]['limit']);_0x5583d8['offset']=qs['offset'](_0x37282a[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x5583d8['order']=qs[_0xe36e('0x59')](_0x37282a['query'][_0xe36e('0x59')]);_0x5583d8[_0xe36e('0x90')]=qs['filters'](_[_0xe36e('0x5a')](_0x37282a[_0xe36e('0x50')],_0x542ae6[_0xe36e('0x52')]));_0x5583d8[_0xe36e('0x90')]['ChatInteractionId']=_0x12e580['id'];if(_0x37282a[_0xe36e('0x50')][_0xe36e('0x94')]){_0x5583d8[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x5583d8[_0xe36e('0x90')],{'$or':_['map'](_0x5583d8['attributes'],function(_0xb40daf){var _0x584f19={};_0x584f19[_0xb40daf]={'$like':'%'+_0x37282a['query'][_0xe36e('0x94')]+'%'};return _0x584f19;})});}if(_0x37282a[_0xe36e('0x50')][_0xe36e('0x8b')]){var _0x2ee22b=_0x37282a[_0xe36e('0x50')][_0xe36e('0x8b')][_0xe36e('0x46')](',');var _0x2cfaee={};_0x2cfaee[_0x2ee22b[0x0]]={'$gte':moment(_0x2ee22b[0x1])[_0xe36e('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5583d8[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x5583d8[_0xe36e('0x90')],_0x2cfaee);}_0x5583d8=_[_0xe36e('0x3c')]({},_0x5583d8,_0x37282a[_0xe36e('0xc5')]);return db[_0xe36e('0xda')][_0xe36e('0x2f')]({'where':_0x5583d8['where']})[_0xe36e('0x35')](function(_0x3f0fd2){_0x2291e7[_0xe36e('0x2f')]=_0x3f0fd2;if(_0x37282a[_0xe36e('0x50')][_0xe36e('0xc4')]){_0x5583d8[_0xe36e('0x113')]=[{'all':!![]}];}return db[_0xe36e('0xda')][_0xe36e('0x114')](_0x5583d8);})[_0xe36e('0x35')](function(_0x2c85c5){_0x2291e7[_0xe36e('0x115')]=_0x2c85c5;return _0x2291e7;});}})[_0xe36e('0x35')](respondWithFilteredResult(_0x5e7360,_0x5583d8))[_0xe36e('0x29')](handleError(_0x5e7360,null));};exports[_0xe36e('0x116')]=function(_0x545f90,_0x2291d1,_0x3ccaa5){var _0x19f952={'where':{}},_0x3e706e={},_0x51cea0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe36e('0xca')]({'where':{'id':_0x545f90['params']['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x2291d1,null))['then'](function(_0x21ffc7){if(_0x21ffc7){_0x3e706e[_0xe36e('0x4f')]=_['keys'](db[_0xe36e('0xda')][_0xe36e('0x4c')]);_0x3e706e[_0xe36e('0x50')]=_['keys'](_0x545f90[_0xe36e('0x50')]);_0x3e706e[_0xe36e('0x52')]=_[_0xe36e('0x53')](_0x3e706e[_0xe36e('0x4f')],_0x3e706e[_0xe36e('0x50')]);_0x19f952['attributes']=_[_0xe36e('0x53')](_0x3e706e[_0xe36e('0x4f')],qs[_0xe36e('0x54')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x54')]));_0x19f952['attributes']=_0x19f952[_0xe36e('0x55')][_0xe36e('0x7d')]?_0x19f952[_0xe36e('0x55')]:_0x3e706e[_0xe36e('0x4f')];if(!_0x545f90[_0xe36e('0x50')]['hasOwnProperty'](_0xe36e('0x57'))){_0x19f952['limit']=qs[_0xe36e('0x2c')](_0x545f90['query'][_0xe36e('0x2c')]);_0x19f952[_0xe36e('0x2e')]=qs[_0xe36e('0x2e')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x19f952[_0xe36e('0x58')]=qs[_0xe36e('0x59')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x59')]);_0x19f952[_0xe36e('0x90')]=qs[_0xe36e('0x52')](_[_0xe36e('0x5a')](_0x545f90[_0xe36e('0x50')],_0x3e706e['filters']));_0x19f952['where'][_0xe36e('0xc0')]=_0x21ffc7['id'];if(_0x545f90[_0xe36e('0x50')][_0xe36e('0x94')]){_0x19f952[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x19f952[_0xe36e('0x90')],{'$or':_[_0xe36e('0x4a')](_0x19f952[_0xe36e('0x55')],function(_0x82c1ae){var _0x5f22b7={};_0x5f22b7[_0x82c1ae]={'$like':'%'+_0x545f90[_0xe36e('0x50')][_0xe36e('0x94')]+'%'};return _0x5f22b7;})});}_0x19f952['where']['secret']=![];if(_0x545f90[_0xe36e('0x50')]['id']){_0x19f952[_0xe36e('0x90')]['id']={'$gt':_0x545f90[_0xe36e('0x50')]['id']};}_0x19f952=_[_0xe36e('0x3c')]({},_0x19f952,_0x545f90['options']);return db[_0xe36e('0xda')]['count']({'where':_0x19f952[_0xe36e('0x90')]})[_0xe36e('0x35')](function(_0x150c17){_0x51cea0[_0xe36e('0x2f')]=_0x150c17;_0x19f952[_0xe36e('0x113')]=[];if(_0x545f90[_0xe36e('0x50')][_0xe36e('0x117')]){_0x19f952['include'][_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':'User','attributes':['id',_0xe36e('0x43'),_0xe36e('0x101')]});}if(_0x545f90[_0xe36e('0x50')]['includeAll']){_0x19f952[_0xe36e('0x113')]=[{'all':!![]}];}return db[_0xe36e('0xda')][_0xe36e('0x114')](_0x19f952);})['then'](function(_0x4553ac){_0x51cea0[_0xe36e('0x115')]=_0x4553ac;return _0x51cea0;});}})['then'](respondWithFilteredResult(_0x2291d1,_0x19f952))[_0xe36e('0x29')](handleError(_0x2291d1,null));};exports['addTags']=function(_0x2cba34,_0x1e7118,_0x4b8d01){return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x2cba34['params']['id']}})['then'](handleEntityNotFound(_0x1e7118,null))[_0xe36e('0x35')](function(_0x4284aa){if(_0x4284aa){return _0x4284aa['setTags'](_0x2cba34['body'][_0xe36e('0x111')],_[_0xe36e('0x110')](_0x2cba34[_0xe36e('0x3d')],[_0xe36e('0x111'),'id'])||{})[_0xe36e('0x118')](function(){return db[_0xe36e('0x84')][_0xe36e('0x114')]({'attributes':['id','name',_0xe36e('0x5d')],'where':{'id':_0x2cba34[_0xe36e('0x3d')][_0xe36e('0x111')]}});})[_0xe36e('0x35')](function(_0x464128){socket[_0xe36e('0x119')](_0xe36e('0x11a'),{'id':Number(_0x2cba34[_0xe36e('0xc3')]['id']),'tags':_0x464128||[]});return{'id':Number(_0x2cba34['params']['id']),'tags':_0x464128||[]};});}})['then'](respondWithResult(_0x1e7118,null))[_0xe36e('0x29')](handleError(_0x1e7118,null));};exports[_0xe36e('0x11b')]=function(_0x262797,_0x40f9f1,_0x457c8e){return db[_0xe36e('0x4b')]['find']({'where':{'id':_0x262797[_0xe36e('0xc3')]['id']}})['then'](handleEntityNotFound(_0x40f9f1,null))['then'](function(_0x31fb7a){if(_0x31fb7a){return _0x31fb7a['removeTags'](_0x262797[_0xe36e('0x50')][_0xe36e('0x111')]);}})[_0xe36e('0x35')](respondWithStatusCode(_0x40f9f1,null))[_0xe36e('0x29')](handleError(_0x40f9f1,null));};exports[_0xe36e('0xf3')]=function(_0x20a347,_0x2c1324){var _0xa7ef59=moment()[_0xe36e('0x11c')]()[_0xe36e('0xa8')]();var _0x3a4701=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server',_0xe36e('0x11d'),'tmp');var _0x1cab01=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server',_0xe36e('0x11d'),_0xe36e('0x11e'));var _0x6c8c82=path[_0xe36e('0xf2')](_0x3a4701,_0xa7ef59);var _0x71c885=util['format'](_0xe36e('0x11f'),_0x20a347[_0xe36e('0xc3')]['id'],_0xa7ef59);var _0x29393a=path[_0xe36e('0xf2')](_0x3a4701,_0x71c885);var _0x4e7b14=[];_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':_0xe36e('0x85'),'attributes':['id',_0xe36e('0x43')],'raw':!![]});_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0xdd')],'as':_0xe36e('0x79'),'attributes':['id',_0xe36e('0x120'),_0xe36e('0x121')],'raw':!![]});if(_0x20a347[_0xe36e('0x50')]['attachments']){_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0xe9')],'as':'Attachment','raw':!![]});}var _0xecb02b=[{'model':db[_0xe36e('0xda')],'as':_0xe36e('0xf7'),'attributes':['id',_0xe36e('0x3d'),_0xe36e('0x122'),_0xe36e('0x123'),_0xe36e('0x124'),_0xe36e('0x125')],'include':_0x4e7b14}];_0xecb02b[_0xe36e('0x48')]({'model':db[_0xe36e('0xcb')],'as':'Account','attributes':['id',_0xe36e('0x39')]});_0xecb02b[_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':_0xe36e('0x126'),'attributes':['id',_0xe36e('0x43')]});return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x20a347[_0xe36e('0xc3')]['id']},'include':_0xecb02b})[_0xe36e('0x35')](handleEntityNotFound(_0x2c1324,null))[_0xe36e('0x35')](function(_0x4197e9){if(_0x4197e9){var _0x35c442=_0x4197e9[_0xe36e('0x127')]({'plain':!![]});fs['mkdirSync'](_0x6c8c82);var _0x343ad8={'channel':'Chat','account':_0x35c442[_0xe36e('0x128')][_0xe36e('0x39')],'agent':_0x35c442[_0xe36e('0x126')]?_0x35c442[_0xe36e('0x126')]['fullname']:_0xe36e('0x129'),'createdAt':moment(_0x35c442[_0xe36e('0x122')])['format'](_0xe36e('0x12a'))[_0xe36e('0xa8')](),'closedAt':_0x35c442[_0xe36e('0xeb')]?moment(_0x35c442[_0xe36e('0x12b')])[_0xe36e('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe36e('0xa8')]():'','disposition':_0x35c442[_0xe36e('0x12c')],'chatInfo':{'browser':_0x35c442['browserName'],'os':_0x35c442[_0xe36e('0x12d')],'referer':_0x35c442[_0xe36e('0x12e')],'customerIp':_0x35c442[_0xe36e('0x12f')],'customerPort':_0x35c442['customerPort']?_0x35c442['customerPort']:'N.A.'},'messages':_(_0x35c442[_0xe36e('0xf7')])['tail']()[_0xe36e('0x94')]({'secret':![]})['map'](function(_0x59156b){if(_0x59156b[_0xe36e('0xe9')]){var _0x52719b=path[_0xe36e('0xf2')](_0x1cab01,_0x59156b['Attachment'][_0xe36e('0xe5')]);if(fs['existsSync'](_0x52719b)){fs[_0xe36e('0x130')](_0x52719b)[_0xe36e('0x131')](fs[_0xe36e('0x132')](path[_0xe36e('0xf2')](_0x6c8c82,_0x59156b[_0xe36e('0xe9')][_0xe36e('0xe5')])));}}return{'date':moment(_0x59156b[_0xe36e('0x122')])[_0xe36e('0xf8')](_0xe36e('0x12a'))[_0xe36e('0xa8')](),'sender':_0x59156b[_0xe36e('0x123')]===_0xe36e('0x133')?_0x59156b['User']?_0x59156b[_0xe36e('0x85')][_0xe36e('0x43')]:_0xe36e('0xff'):_0x59156b[_0xe36e('0x79')]['firstName']+(_0x59156b[_0xe36e('0x79')][_0xe36e('0x121')]?'\x20'+_0x59156b[_0xe36e('0x79')]['lastName']:''),'body':_0x59156b['Attachment']?_0x59156b[_0xe36e('0xe9')][_0xe36e('0xe5')]:_0x59156b['body'],'direction':_0x59156b[_0xe36e('0x123')]===_0xe36e('0x133')?'A':'C','secret':_0x59156b['secret'],'read':_0x59156b[_0xe36e('0x125')],'attachment':_0x59156b[_0xe36e('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xe36e('0xf2')](config[_0xe36e('0xef')],_0xe36e('0x134'),_0xe36e('0x135'),_0xe36e('0x136')),{'interaction':_0x343ad8})[_0xe36e('0x35')](function(_0x340915){var _0x5370b9=path['join'](_0x6c8c82,'transcript-'+_0x35c442['id']+'-'+_0xa7ef59+'.pdf');var _0x16b769={'path':_0x5370b9,'channel':'Chat','interactionId':_0x35c442['id']};return pdf['createPdfFromHTML'](_0x340915,_0x16b769);})[_0xe36e('0x35')](function(){return new BPromise(function(_0x36706c,_0x5e7f24){zipdir(_0x6c8c82,{'saveTo':_0x29393a},function(_0x5e19e2,_0x2a89b0){if(_0x5e19e2)return _0x5e7f24(_0x5e19e2);return _0x36706c(_0x2a89b0);});})[_0xe36e('0x35')](function(){return new BPromise(function(_0xf70d66,_0x2c0371){rimraf(_0x6c8c82,function(_0x59de53){if(_0x59de53)_0x2c0371(_0x59de53);return _0xf70d66();});});})[_0xe36e('0x35')](function(){return _0x2c1324['download'](_0x29393a,_0x71c885,function(_0x47e24c){if(_0x47e24c){console[_0xe36e('0x137')](_0xe36e('0x138'),_0x47e24c);}else{fs[_0xe36e('0x139')](_0x29393a);}});});});}else{return _0x2c1324[_0xe36e('0x37')](0xc8);}})[_0xe36e('0x29')](handleError(_0x2c1324,null));};
\ No newline at end of file
+var _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54ce75,_0x1c72f7){var _0x516dbd=function(_0x198342){while(--_0x198342){_0x54ce75['push'](_0x54ce75['shift']());}};_0x516dbd(++_0x1c72f7);}(_0x66fa,0x117));var _0xa66f=function(_0x537968,_0x23bd66){_0x537968=_0x537968-0x0;var _0x43749f=_0x66fa[_0x537968];return _0x43749f;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 8278dcf..e48d62a 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 _0x18c5=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x18c5,0x82));var _0x518c=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0x18c5[_0x2a3c4d];return _0x55c390;};'use strict';var EventEmitter=require(_0x518c('0x0'));var ChatInteraction=require(_0x518c('0x1'))['db'][_0x518c('0x2')];var ChatMessage=require(_0x518c('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x518c('0x3'),'afterUpdate':_0x518c('0x4'),'afterDestroy':_0x518c('0x5')};function emitEvent(_0x2c9335){return function(_0x35fbf7,_0x1c857b,_0x122ccc){_0x35fbf7[_0x518c('0x6')]({'attributes':['id'],'raw':!![]})[_0x518c('0x7')](function(_0x16a59b){_0x35fbf7[_0x518c('0x8')](_0x518c('0x9'),_0x16a59b[_0x518c('0xa')](function(_0x4a03b9){return{'id':_0x4a03b9['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x35fbf7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1053b3){_0x35fbf7['setDataValue'](_0x518c('0xb'),_0x1053b3[_0x518c('0xc')]);ChatInteractionEvents[_0x518c('0xd')](_0x2c9335+':'+_0x35fbf7['id'],_0x35fbf7);ChatInteractionEvents[_0x518c('0xd')](_0x2c9335,_0x35fbf7);_0x122ccc(null);})[_0x518c('0xe')](_0x122ccc(null));};}for(var e in events){if(events[_0x518c('0xf')](e)){var event=events[e];ChatInteraction[_0x518c('0x10')](e,emitEvent(event));}}module[_0x518c('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x5f81=['emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','setDataValue','map','findAll','unreadMessages','length'];(function(_0x213304,_0x5bd292){var _0x20b424=function(_0xbc0dde){while(--_0xbc0dde){_0x213304['push'](_0x213304['shift']());}};_0x20b424(++_0x5bd292);}(_0x5f81,0xd6));var _0x15f8=function(_0x36dc24,_0x189ad1){_0x36dc24=_0x36dc24-0x0;var _0x439447=_0x5f81[_0x36dc24];return _0x439447;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x15f8('0x0'))['db'][_0x15f8('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x15f8('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x15f8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x15f8('0x4'),'afterDestroy':_0x15f8('0x5')};function emitEvent(_0x4084f3){return function(_0x53d035,_0x51387c,_0x1dc31a){_0x53d035['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1ec68d){_0x53d035[_0x15f8('0x6')]('Users',_0x1ec68d[_0x15f8('0x7')](function(_0x475f40){return{'id':_0x475f40['id']};}));return ChatMessage[_0x15f8('0x8')]({'where':{'ChatInteractionId':_0x53d035['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x528822){_0x53d035[_0x15f8('0x6')](_0x15f8('0x9'),_0x528822[_0x15f8('0xa')]);ChatInteractionEvents[_0x15f8('0xb')](_0x4084f3+':'+_0x53d035['id'],_0x53d035);ChatInteractionEvents[_0x15f8('0xb')](_0x4084f3,_0x53d035);_0x1dc31a(null);})[_0x15f8('0xc')](_0x1dc31a(null));};}for(var e in events){if(events[_0x15f8('0xd')](e)){var event=events[e];ChatInteraction[_0x15f8('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index eb33e72..b817cfc 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 _0xa653=['../../config/environment','./chatInteraction.attributes','exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xa653,0x16f));var _0x3a65=function(_0x565993,_0x30c99c){_0x565993=_0x565993-0x0;var _0x535c0d=_0xa653[_0x565993];return _0x535c0d;};'use strict';var _=require('lodash');var util=require(_0x3a65('0x0'));var logger=require(_0x3a65('0x1'))(_0x3a65('0x2'));var moment=require(_0x3a65('0x3'));var BPromise=require(_0x3a65('0x4'));var rp=require(_0x3a65('0x5'));var fs=require('fs');var path=require(_0x3a65('0x6'));var rimraf=require('rimraf');var config=require(_0x3a65('0x7'));var attributes=require(_0x3a65('0x8'));module[_0x3a65('0x9')]=function(_0x53126d,_0x3c1df6){return _0x53126d[_0x3a65('0xa')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cc259,_0x21411c,_0x1a850b){if(_0x2cc259[_0x3a65('0xb')](_0x3a65('0xc'))){_0x2cc259['closedAt']=moment()[_0x3a65('0xd')](_0x3a65('0xe'));}_0x1a850b(null,_0x2cc259);}},'charset':_0x3a65('0xf'),'collate':_0x3a65('0x10')});};
\ No newline at end of file
+var _0xef3e=['define','ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xef3e,0x170));var _0xeef3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xef3e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xeef3('0x0'));var util=require(_0xeef3('0x1'));var logger=require('../../config/logger')(_0xeef3('0x2'));var moment=require(_0xeef3('0x3'));var BPromise=require(_0xeef3('0x4'));var rp=require(_0xeef3('0x5'));var fs=require('fs');var path=require(_0xeef3('0x6'));var rimraf=require(_0xeef3('0x7'));var config=require(_0xeef3('0x8'));var attributes=require('./chatInteraction.attributes');module[_0xeef3('0x9')]=function(_0x1b91d7,_0x2a2494){return _0x1b91d7[_0xeef3('0xa')](_0xeef3('0xb'),attributes,{'tableName':_0xeef3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x412e9a,_0x728966,_0x4e40ea){if(_0x412e9a[_0xeef3('0xd')]('closed')){_0x412e9a['closedAt']=moment()[_0xeef3('0xe')](_0xeef3('0xf'));}_0x4e40ea(null,_0x412e9a);}},'charset':_0xeef3('0x10'),'collate':_0xeef3('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index caa10b7..44d234a 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 _0x0d73=['request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','limit','find','where','addTags','ids','omit','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x0d73,0x11e));var _0x30d7=function(_0x134943,_0xd3e659){_0x134943=_0x134943-0x0;var _0x2558cc=_0x0d73[_0x134943];return _0x2558cc;};'use strict';var _=require(_0x30d7('0x0'));var util=require('util');var moment=require(_0x30d7('0x1'));var BPromise=require(_0x30d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30d7('0x3'));var db=require(_0x30d7('0x4'))['db'];var utils=require(_0x30d7('0x5'));var logger=require('../../config/logger')(_0x30d7('0x6'));var config=require(_0x30d7('0x7'));var jayson=require(_0x30d7('0x8'));var client=jayson[_0x30d7('0x9')][_0x30d7('0xa')]({'port':0x232a});config[_0x30d7('0xb')]=_[_0x30d7('0xc')](config[_0x30d7('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x30d7('0xb')]));require(_0x30d7('0xd'))[_0x30d7('0xe')](socket);function respondWithRpcPromise(_0x5e717d,_0x4e2ac8,_0x38c208){return new BPromise(function(_0x4d7711,_0x3291f7){return client['request'](_0x5e717d,_0x38c208)[_0x30d7('0xf')](function(_0x32f876){logger[_0x30d7('0x10')](_0x30d7('0x11'),_0x4e2ac8,_0x30d7('0x12'));logger[_0x30d7('0x13')](_0x30d7('0x14'),_0x4e2ac8,_0x30d7('0x12'),JSON[_0x30d7('0x15')](_0x32f876));if(_0x32f876[_0x30d7('0x16')]){if(_0x32f876[_0x30d7('0x16')][_0x30d7('0x17')]===0x1f4){logger[_0x30d7('0x16')](_0x30d7('0x11'),_0x4e2ac8,_0x32f876[_0x30d7('0x16')][_0x30d7('0x18')]);return _0x3291f7(_0x32f876[_0x30d7('0x16')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4e2ac8,_0x32f876[_0x30d7('0x16')][_0x30d7('0x18')]);return _0x4d7711(_0x32f876[_0x30d7('0x16')][_0x30d7('0x18')]);}else{logger[_0x30d7('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x4e2ac8,_0x30d7('0x12'));_0x4d7711(_0x32f876['result'][_0x30d7('0x18')]);}})[_0x30d7('0x19')](function(_0x14f2b1){logger[_0x30d7('0x16')](_0x30d7('0x11'),_0x4e2ac8,_0x14f2b1);_0x3291f7(_0x14f2b1);});});}exports[_0x30d7('0x1a')]=function(_0x1af47e){var _0x32a9d5=this;return new Promise(function(_0x1ee11b,_0x47803f){return db[_0x30d7('0x1b')]['update'](_0x1af47e[_0x30d7('0x1c')],{'raw':_0x1af47e[_0x30d7('0x1d')]?_0x1af47e[_0x30d7('0x1d')][_0x30d7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1af47e[_0x30d7('0x1d')]?_0x1af47e[_0x30d7('0x1d')]['where']||null:null,'attributes':_0x1af47e[_0x30d7('0x1d')]?_0x1af47e[_0x30d7('0x1d')]['attributes']||null:null,'limit':_0x1af47e[_0x30d7('0x1d')]?_0x1af47e[_0x30d7('0x1d')][_0x30d7('0x1f')]||null:null})['then'](function(_0x33715a){logger['info'](_0x30d7('0x1a'),_0x1af47e);logger[_0x30d7('0x13')](_0x30d7('0x1a'),_0x1af47e,JSON[_0x30d7('0x15')](_0x33715a));_0x1ee11b(_0x33715a);})[_0x30d7('0x19')](function(_0x2208ec){logger['error'](_0x30d7('0x1a'),_0x2208ec[_0x30d7('0x18')],_0x1af47e);_0x47803f(_0x32a9d5[_0x30d7('0x16')](0x1f4,_0x2208ec['message']));});});};exports['AddTagsToChatInteraction']=function(_0x247377){return new Promise(function(_0x103592,_0x435761){return db[_0x30d7('0x1b')][_0x30d7('0x20')]({'where':_0x247377[_0x30d7('0x1d')]?_0x247377[_0x30d7('0x1d')][_0x30d7('0x21')]||null:null})['then'](function(_0x482e56){if(_0x482e56){return _0x482e56[_0x30d7('0x22')](_0x247377[_0x30d7('0x1c')][_0x30d7('0x23')],_[_0x30d7('0x24')](_0x247377[_0x30d7('0x1c')],[_0x30d7('0x23'),'id'])||{});}})['spread'](function(_0x52d541){logger[_0x30d7('0x10')](_0x30d7('0x25'),_0x247377);logger[_0x30d7('0x13')]('AddTags',_0x247377,JSON[_0x30d7('0x15')](_0x52d541));_0x103592(_0x52d541);})[_0x30d7('0x19')](function(_0x350aba){logger['error'](_0x30d7('0x25'),_0x350aba['message'],_0x247377);_0x435761(_this[_0x30d7('0x16')](0x1f4,_0x350aba[_0x30d7('0x18')]));});});};
\ No newline at end of file
+var _0xa150=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ChatInteraction','update','body','options','where','attributes','limit','UpdateChatInteraction','debug','addTags','ids','spread','AddTags'];(function(_0x18dee1,_0x1e1bb0){var _0x40d3cb=function(_0x2a7686){while(--_0x2a7686){_0x18dee1['push'](_0x18dee1['shift']());}};_0x40d3cb(++_0x1e1bb0);}(_0xa150,0x78));var _0x0a15=function(_0x8b0e0a,_0x264de0){_0x8b0e0a=_0x8b0e0a-0x0;var _0x401df6=_0xa150[_0x8b0e0a];return _0x401df6;};'use strict';var _=require(_0x0a15('0x0'));var util=require(_0x0a15('0x1'));var moment=require(_0x0a15('0x2'));var BPromise=require(_0x0a15('0x3'));var rs=require(_0x0a15('0x4'));var fs=require('fs');var Redis=require(_0x0a15('0x5'));var db=require(_0x0a15('0x6'))['db'];var utils=require(_0x0a15('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a15('0x8'));var jayson=require(_0x0a15('0x9'));var client=jayson[_0x0a15('0xa')][_0x0a15('0xb')]({'port':0x232a});config['redis']=_[_0x0a15('0xc')](config['redis'],{'host':_0x0a15('0xd'),'port':0x18eb});var socket=require(_0x0a15('0xe'))(new Redis(config[_0x0a15('0xf')]));require(_0x0a15('0x10'))['register'](socket);function respondWithRpcPromise(_0x225828,_0x58d661,_0x202c7e){return new BPromise(function(_0x1cdf10,_0x1ca234){return client[_0x0a15('0x11')](_0x225828,_0x202c7e)[_0x0a15('0x12')](function(_0x17451f){logger[_0x0a15('0x13')](_0x0a15('0x14'),_0x58d661,'request\x20sent');logger['debug'](_0x0a15('0x15'),_0x58d661,_0x0a15('0x16'),JSON[_0x0a15('0x17')](_0x17451f));if(_0x17451f[_0x0a15('0x18')]){if(_0x17451f[_0x0a15('0x18')]['code']===0x1f4){logger[_0x0a15('0x18')](_0x0a15('0x14'),_0x58d661,_0x17451f['error'][_0x0a15('0x19')]);return _0x1ca234(_0x17451f[_0x0a15('0x18')][_0x0a15('0x19')]);}logger[_0x0a15('0x18')](_0x0a15('0x14'),_0x58d661,_0x17451f[_0x0a15('0x18')][_0x0a15('0x19')]);return _0x1cdf10(_0x17451f['error'][_0x0a15('0x19')]);}else{logger[_0x0a15('0x13')](_0x0a15('0x14'),_0x58d661,_0x0a15('0x16'));_0x1cdf10(_0x17451f[_0x0a15('0x1a')][_0x0a15('0x19')]);}})['catch'](function(_0x293141){logger[_0x0a15('0x18')](_0x0a15('0x14'),_0x58d661,_0x293141);_0x1ca234(_0x293141);});});}exports['UpdateChatInteraction']=function(_0x2489d4){var _0x1e2dc2=this;return new Promise(function(_0xb7e8fc,_0xed56d){return db[_0x0a15('0x1b')][_0x0a15('0x1c')](_0x2489d4[_0x0a15('0x1d')],{'raw':_0x2489d4[_0x0a15('0x1e')]?_0x2489d4[_0x0a15('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2489d4[_0x0a15('0x1e')]?_0x2489d4[_0x0a15('0x1e')][_0x0a15('0x1f')]||null:null,'attributes':_0x2489d4['options']?_0x2489d4[_0x0a15('0x1e')][_0x0a15('0x20')]||null:null,'limit':_0x2489d4[_0x0a15('0x1e')]?_0x2489d4[_0x0a15('0x1e')][_0x0a15('0x21')]||null:null})['then'](function(_0x1e05ed){logger[_0x0a15('0x13')](_0x0a15('0x22'),_0x2489d4);logger[_0x0a15('0x23')](_0x0a15('0x22'),_0x2489d4,JSON[_0x0a15('0x17')](_0x1e05ed));_0xb7e8fc(_0x1e05ed);})['catch'](function(_0x19b13b){logger['error'](_0x0a15('0x22'),_0x19b13b['message'],_0x2489d4);_0xed56d(_0x1e2dc2[_0x0a15('0x18')](0x1f4,_0x19b13b[_0x0a15('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x3343b9){return new Promise(function(_0x4c7236,_0xeba3d){return db[_0x0a15('0x1b')]['find']({'where':_0x3343b9[_0x0a15('0x1e')]?_0x3343b9[_0x0a15('0x1e')]['where']||null:null})[_0x0a15('0x12')](function(_0x21e287){if(_0x21e287){return _0x21e287[_0x0a15('0x24')](_0x3343b9[_0x0a15('0x1d')][_0x0a15('0x25')],_['omit'](_0x3343b9[_0x0a15('0x1d')],[_0x0a15('0x25'),'id'])||{});}})[_0x0a15('0x26')](function(_0xa9c035){logger[_0x0a15('0x13')](_0x0a15('0x27'),_0x3343b9);logger['debug'](_0x0a15('0x27'),_0x3343b9,JSON[_0x0a15('0x17')](_0xa9c035));_0x4c7236(_0xa9c035);})['catch'](function(_0x1dd092){logger[_0x0a15('0x18')](_0x0a15('0x27'),_0x1dd092['message'],_0x3343b9);_0xeba3d(_this[_0x0a15('0x18')](0x1f4,_0x1dd092[_0x0a15('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index a7f978c..6c9e7af 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 _0x06b7=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','update'];(function(_0x13c1a9,_0x2892f3){var _0xbaa5bc=function(_0x12682e){while(--_0x12682e){_0x13c1a9['push'](_0x13c1a9['shift']());}};_0xbaa5bc(++_0x2892f3);}(_0x06b7,0x17d));var _0x706b=function(_0x492b46,_0x29b20c){_0x492b46=_0x492b46-0x0;var _0x46b1dc=_0x06b7[_0x492b46];return _0x46b1dc;};'use strict';var ChatInteractionEvents=require(_0x706b('0x0'));var events=['save',_0x706b('0x1'),_0x706b('0x2')];function createListener(_0x4d4702,_0x1abacd){return function(_0x51bdd8){_0x1abacd[_0x706b('0x3')](_0x4d4702,_0x51bdd8);};}function removeListener(_0x16ab6d,_0x346736){return function(){ChatInteractionEvents[_0x706b('0x4')](_0x16ab6d,_0x346736);};}exports[_0x706b('0x5')]=function(_0x40bcd7){for(var _0x3aec38=0x0,_0x17a780=events[_0x706b('0x6')];_0x3aec38<_0x17a780;_0x3aec38++){var _0x1c55d4=events[_0x3aec38];var _0x20fb19=createListener(_0x706b('0x7')+_0x1c55d4,_0x40bcd7);ChatInteractionEvents['on'](_0x1c55d4,_0x20fb19);}};
\ No newline at end of file
+var _0x0735=['length','./chatInteraction.events','remove','update','removeListener','register'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x0735,0x1a5));var _0x5073=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0735[_0x422905];return _0x33dc6c;};'use strict';var ChatInteractionEvents=require(_0x5073('0x0'));var events=['save',_0x5073('0x1'),_0x5073('0x2')];function createListener(_0x3190e6,_0x371cd1){return function(_0x4d0c41){_0x371cd1['emit'](_0x3190e6,_0x4d0c41);};}function removeListener(_0x1eb041,_0x53a228){return function(){ChatInteractionEvents[_0x5073('0x3')](_0x1eb041,_0x53a228);};}exports[_0x5073('0x4')]=function(_0x283844){for(var _0x5a9b00=0x0,_0x10b776=events[_0x5073('0x5')];_0x5a9b00<_0x10b776;_0x5a9b00++){var _0x203be8=events[_0x5a9b00];var _0x7f95da=createListener('chatInteraction:'+_0x203be8,_0x283844);ChatInteractionEvents['on'](_0x203be8,_0x7f95da);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 4087432..3daf21f 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 _0x778c=['root','server/files/attachments/','format','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags','chat','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','isChatInteractionAuthorized','show','/:id/messages','getMessages','/:id/my_messages','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join'];(function(_0x304c47,_0x4e0e20){var _0x2dbd2c=function(_0x4f7049){while(--_0x4f7049){_0x304c47['push'](_0x304c47['shift']());}};_0x2dbd2c(++_0x4e0e20);}(_0x778c,0x138));var _0xc778=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0x778c[_0x2c93e2];return _0x57264e;};'use strict';var multer=require('multer');var util=require(_0xc778('0x0'));var path=require(_0xc778('0x1'));var timeout=require(_0xc778('0x2'));var express=require(_0xc778('0x3'));var router=express[_0xc778('0x4')]();var fs_extra=require(_0xc778('0x5'));var auth=require(_0xc778('0x6'));var interaction=require(_0xc778('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xc778('0x8')](),controller[_0xc778('0x9')]);router[_0xc778('0xa')](_0xc778('0xb'),auth[_0xc778('0x8')](),controller['describe']);router['get'](_0xc778('0xc'),auth[_0xc778('0xd')](),controller[_0xc778('0xe')]);router[_0xc778('0xa')]('/:id/attachment_download',auth[_0xc778('0xd')](),controller['attachmentDownload']);router[_0xc778('0xa')](_0xc778('0xf'),auth[_0xc778('0x8')](),controller[_0xc778('0x10')]);router[_0xc778('0xa')](_0xc778('0x11'),auth[_0xc778('0xd')](),controller['getMyMessages']);router[_0xc778('0xa')]('/:id/download',auth[_0xc778('0x8')](),controller['download']);router[_0xc778('0x12')]('/',auth[_0xc778('0x8')](),controller[_0xc778('0x13')]);router[_0xc778('0x12')](_0xc778('0x14'),auth[_0xc778('0x8')](),controller[_0xc778('0x15')]);var upload=multer({'storage':multer[_0xc778('0x16')]({'destination':function(_0x311eff,_0x497d8f,_0x10b612){_0x10b612(null,path[_0xc778('0x17')](config[_0xc778('0x18')],_0xc778('0x19')));},'filename':function(_0x1c12d4,_0x58ea25,_0x3ff06d){_0x3ff06d(null,util[_0xc778('0x1a')]('%s-%s',Date['now'](),_0x58ea25[_0xc778('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc778('0x12')](_0xc778('0x1c'),upload[_0xc778('0x1d')](_0xc778('0x1e')),controller['attachmentUpload']);router[_0xc778('0x12')](_0xc778('0xf'),auth[_0xc778('0xd')](),controller[_0xc778('0x1f')]);router['post'](_0xc778('0x20'),auth[_0xc778('0x8')](),interaction['tracked'](_0xc778('0x21'),'chatinteraction:addtags'),controller[_0xc778('0x22')]);router[_0xc778('0x23')](_0xc778('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xc778('0x21'),'chatinteraction:update'),controller[_0xc778('0x24')]);router['put'](_0xc778('0x25'),controller[_0xc778('0x26')]);router[_0xc778('0x23')](_0xc778('0x27'),auth['isChatInteractionAuthorized'](),controller[_0xc778('0x28')]);router[_0xc778('0x23')](_0xc778('0x29'),controller[_0xc778('0x2a')]);router[_0xc778('0x2b')](_0xc778('0xc'),auth[_0xc778('0x8')](),interaction[_0xc778('0x2c')](_0xc778('0x21'),_0xc778('0x2d')),controller[_0xc778('0x2e')]);router[_0xc778('0x2b')](_0xc778('0x20'),auth[_0xc778('0x8')](),controller[_0xc778('0x2f')]);module['exports']=router;
\ No newline at end of file
+var _0xc4b2=['/:id/my_messages','getMyMessages','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','originalname','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages'];(function(_0x1a7019,_0x40e751){var _0x4423c7=function(_0x2c60dd){while(--_0x2c60dd){_0x1a7019['push'](_0x1a7019['shift']());}};_0x4423c7(++_0x40e751);}(_0xc4b2,0x175));var _0x2c4b=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xc4b2[_0x86b219];return _0x1f320c;};'use strict';var multer=require(_0x2c4b('0x0'));var util=require(_0x2c4b('0x1'));var path=require(_0x2c4b('0x2'));var timeout=require(_0x2c4b('0x3'));var express=require(_0x2c4b('0x4'));var router=express[_0x2c4b('0x5')]();var fs_extra=require(_0x2c4b('0x6'));var auth=require(_0x2c4b('0x7'));var interaction=require(_0x2c4b('0x8'));var config=require(_0x2c4b('0x9'));var controller=require(_0x2c4b('0xa'));router[_0x2c4b('0xb')]('/',auth['isAuthenticated'](),controller[_0x2c4b('0xc')]);router[_0x2c4b('0xb')](_0x2c4b('0xd'),auth[_0x2c4b('0xe')](),controller['describe']);router[_0x2c4b('0xb')]('/:id',auth[_0x2c4b('0xf')](),controller['show']);router[_0x2c4b('0xb')](_0x2c4b('0x10'),auth[_0x2c4b('0xf')](),controller['attachmentDownload']);router[_0x2c4b('0xb')](_0x2c4b('0x11'),auth['isAuthenticated'](),controller[_0x2c4b('0x12')]);router[_0x2c4b('0xb')](_0x2c4b('0x13'),auth[_0x2c4b('0xf')](),controller[_0x2c4b('0x14')]);router[_0x2c4b('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x2c4b('0x15')]);router[_0x2c4b('0x16')]('/',auth[_0x2c4b('0xe')](),controller[_0x2c4b('0x17')]);router[_0x2c4b('0x16')]('/:id/vidaoo',auth[_0x2c4b('0xe')](),controller[_0x2c4b('0x18')]);var upload=multer({'storage':multer[_0x2c4b('0x19')]({'destination':function(_0x5c9d95,_0x3fe9d5,_0x13e888){_0x13e888(null,path[_0x2c4b('0x1a')](config[_0x2c4b('0x1b')],_0x2c4b('0x1c')));},'filename':function(_0x554f4e,_0x118b31,_0x2e7d6f){_0x2e7d6f(null,util[_0x2c4b('0x1d')]('%s-%s',Date['now'](),_0x118b31[_0x2c4b('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c4b('0x16')]('/:id/attachment_upload',upload[_0x2c4b('0x1f')](_0x2c4b('0x20')),controller[_0x2c4b('0x21')]);router['post'](_0x2c4b('0x11'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x2c4b('0x22'),auth[_0x2c4b('0xe')](),interaction[_0x2c4b('0x23')](_0x2c4b('0x24'),_0x2c4b('0x25')),controller[_0x2c4b('0x26')]);router[_0x2c4b('0x27')]('/:id',auth[_0x2c4b('0xe')](),interaction[_0x2c4b('0x23')](_0x2c4b('0x24'),_0x2c4b('0x28')),controller[_0x2c4b('0x29')]);router[_0x2c4b('0x27')](_0x2c4b('0x2a'),controller[_0x2c4b('0x2b')]);router[_0x2c4b('0x27')]('/:id/abandon',auth[_0x2c4b('0xf')](),controller[_0x2c4b('0x2c')]);router[_0x2c4b('0x27')](_0x2c4b('0x2d'),controller[_0x2c4b('0x2e')]);router[_0x2c4b('0x2f')]('/:id',auth[_0x2c4b('0xe')](),interaction[_0x2c4b('0x23')]('chat','chatinteraction:destroy'),controller[_0x2c4b('0x30')]);router[_0x2c4b('0x2f')](_0x2c4b('0x22'),auth[_0x2c4b('0xe')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index bb1dc52..a359b93 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 _0xc773=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x43cf19,_0x56ebde){var _0x560994=function(_0x4bfde7){while(--_0x4bfde7){_0x43cf19['push'](_0x43cf19['shift']());}};_0x560994(++_0x56ebde);}(_0xc773,0x13f));var _0x3c77=function(_0x3e35b3,_0x147dd0){_0x3e35b3=_0x3e35b3-0x0;var _0x3b770e=_0xc773[_0x3e35b3];return _0x3b770e;};'use strict';var Sequelize=require(_0x3c77('0x0'));module[_0x3c77('0x1')]={'body':{'type':Sequelize[_0x3c77('0x2')](_0x3c77('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3c77('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3c77('0x5')]}};
\ No newline at end of file
+var _0x7fa3=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7fa3,0xf0));var _0x37fa=function(_0x21abf1,_0xcd06d){_0x21abf1=_0x21abf1-0x0;var _0x8f3ba=_0x7fa3[_0x21abf1];return _0x8f3ba;};'use strict';var Sequelize=require(_0x37fa('0x0'));module[_0x37fa('0x1')]={'body':{'type':Sequelize[_0x37fa('0x2')](_0x37fa('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x37fa('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x37fa('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index c1140cb..984d639 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 _0xcb63=['filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','params','find','describe','get','lastMessage','lastMessageAt','format','getUsers','User','agent','user','fullname','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','ChatInternalMessage','type','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x2c99a9,_0x3a826a){var _0x2e222b=function(_0x1907a9){while(--_0x1907a9){_0x2c99a9['push'](_0x2c99a9['shift']());}};_0x2e222b(++_0x3a826a);}(_0xcb63,0x17c));var _0x3cb6=function(_0x11487e,_0x2695cd){_0x11487e=_0x11487e-0x0;var _0x3bb686=_0xcb63[_0x11487e];return _0x3bb686;};'use strict';var emlformat=require(_0x3cb6('0x0'));var rimraf=require(_0x3cb6('0x1'));var zipdir=require(_0x3cb6('0x2'));var jsonpatch=require(_0x3cb6('0x3'));var rp=require(_0x3cb6('0x4'));var moment=require('moment');var BPromise=require(_0x3cb6('0x5'));var Mustache=require(_0x3cb6('0x6'));var util=require(_0x3cb6('0x7'));var path=require(_0x3cb6('0x8'));var sox=require('sox');var csv=require(_0x3cb6('0x9'));var ejs=require(_0x3cb6('0xa'));var fs=require('fs');var fs_extra=require(_0x3cb6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3cb6('0xc'));var jsforce=require(_0x3cb6('0xd'));var deskjs=require(_0x3cb6('0xe'));var toCsv=require(_0x3cb6('0x9'));var querystring=require(_0x3cb6('0xf'));var Papa=require(_0x3cb6('0x10'));var Redis=require('ioredis');var authService=require(_0x3cb6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cb6('0x12'));var logger=require(_0x3cb6('0x13'))(_0x3cb6('0x14'));var utils=require('../../config/utils');var config=require(_0x3cb6('0x15'));var licenseUtil=require(_0x3cb6('0x16'));var db=require(_0x3cb6('0x17'))['db'];config[_0x3cb6('0x18')]=_[_0x3cb6('0x19')](config[_0x3cb6('0x18')],{'host':_0x3cb6('0x1a'),'port':0x18eb});var socket=require(_0x3cb6('0x1b'))(new Redis(config[_0x3cb6('0x18')]));require(_0x3cb6('0x1c'))[_0x3cb6('0x1d')](socket);function respondWithStatusCode(_0x3ea33a,_0x2270ad){_0x2270ad=_0x2270ad||0xcc;return function(_0x49ba68){if(_0x49ba68){return _0x3ea33a[_0x3cb6('0x1e')](_0x2270ad);}return _0x3ea33a[_0x3cb6('0x1f')](_0x2270ad)[_0x3cb6('0x20')]();};}function respondWithResult(_0x1ecc1f,_0x422eb3){_0x422eb3=_0x422eb3||0xc8;return function(_0x548ec2){if(_0x548ec2){return _0x1ecc1f[_0x3cb6('0x1f')](_0x422eb3)[_0x3cb6('0x21')](_0x548ec2);}};}function respondWithFilteredResult(_0x37595f,_0x1e4aa4){return function(_0x1fd968){if(_0x1fd968){var _0x161ea0=typeof _0x1e4aa4[_0x3cb6('0x22')]===_0x3cb6('0x23')&&typeof _0x1e4aa4[_0x3cb6('0x24')]==='undefined';var _0x268cd5=_0x1fd968['count'];var _0x3e1935=_0x161ea0?0x0:_0x1e4aa4['offset'];var _0x2a41c2=_0x161ea0?_0x1fd968[_0x3cb6('0x25')]:_0x1e4aa4[_0x3cb6('0x22')]+_0x1e4aa4[_0x3cb6('0x24')];var _0x24d22e;if(_0x2a41c2>=_0x268cd5){_0x2a41c2=_0x268cd5;_0x24d22e=0xc8;}else{_0x24d22e=0xce;}_0x37595f['status'](_0x24d22e);return _0x37595f[_0x3cb6('0x26')](_0x3cb6('0x27'),_0x3e1935+'-'+_0x2a41c2+'/'+_0x268cd5)[_0x3cb6('0x21')](_0x1fd968);}return null;};}function patchUpdates(_0x56c00b){return function(_0xa46839){try{jsonpatch[_0x3cb6('0x28')](_0xa46839,_0x56c00b,!![]);}catch(_0x34a982){return BPromise['reject'](_0x34a982);}return _0xa46839[_0x3cb6('0x29')]();};}function saveUpdates(_0x414d97,_0x2a9aa3){return function(_0x3adf08){if(_0x3adf08){return _0x3adf08[_0x3cb6('0x2a')](_0x414d97)[_0x3cb6('0x2b')](function(_0x38f9bc){return _0x38f9bc;});}return null;};}function removeEntity(_0x86d58e,_0x245f6d){return function(_0x32662e){if(_0x32662e){return _0x32662e[_0x3cb6('0x2c')]()[_0x3cb6('0x2b')](function(){_0x86d58e[_0x3cb6('0x1f')](0xcc)[_0x3cb6('0x20')]();});}};}function handleEntityNotFound(_0xd19204,_0xce768a){return function(_0x56a154){if(!_0x56a154){_0xd19204[_0x3cb6('0x1e')](0x194);}return _0x56a154;};}function handleError(_0x298d5d,_0x589063){_0x589063=_0x589063||0x1f4;return function(_0x52926c){logger[_0x3cb6('0x2d')](_0x52926c[_0x3cb6('0x2e')]);if(_0x52926c[_0x3cb6('0x2f')]){delete _0x52926c[_0x3cb6('0x2f')];}_0x298d5d[_0x3cb6('0x1f')](_0x589063)['send'](_0x52926c);};}exports['index']=function(_0x1e9d2b,_0x4921b0){var _0x1ca330={},_0x557405={},_0x79b419={'count':0x0,'rows':[]};var _0x3e3648=_['map'](db[_0x3cb6('0x30')]['rawAttributes'],function(_0x1a76c4){return{'name':_0x1a76c4['fieldName'],'type':_0x1a76c4[_0x3cb6('0x31')]['key']};});_0x557405[_0x3cb6('0x32')]=_[_0x3cb6('0x33')](_0x3e3648,_0x3cb6('0x2f'));_0x557405['query']=_[_0x3cb6('0x34')](_0x1e9d2b['query']);_0x557405['filters']=_['intersection'](_0x557405[_0x3cb6('0x32')],_0x557405[_0x3cb6('0x35')]);_0x1ca330[_0x3cb6('0x36')]=_[_0x3cb6('0x37')](_0x557405[_0x3cb6('0x32')],qs[_0x3cb6('0x38')](_0x1e9d2b[_0x3cb6('0x35')][_0x3cb6('0x38')]));_0x1ca330[_0x3cb6('0x36')]=_0x1ca330['attributes'][_0x3cb6('0x39')]?_0x1ca330[_0x3cb6('0x36')]:_0x557405['model'];if(!_0x1e9d2b[_0x3cb6('0x35')][_0x3cb6('0x3a')](_0x3cb6('0x3b'))){_0x1ca330[_0x3cb6('0x24')]=qs[_0x3cb6('0x24')](_0x1e9d2b[_0x3cb6('0x35')]['limit']);_0x1ca330[_0x3cb6('0x22')]=qs[_0x3cb6('0x22')](_0x1e9d2b[_0x3cb6('0x35')][_0x3cb6('0x22')]);}_0x1ca330[_0x3cb6('0x3c')]=qs[_0x3cb6('0x3d')](_0x1e9d2b[_0x3cb6('0x35')][_0x3cb6('0x3d')]);_0x1ca330['where']=qs[_0x3cb6('0x3e')](_[_0x3cb6('0x3f')](_0x1e9d2b[_0x3cb6('0x35')],_0x557405['filters']),_0x3e3648);if(_0x1e9d2b[_0x3cb6('0x35')][_0x3cb6('0x40')]){_0x1ca330[_0x3cb6('0x41')]=_[_0x3cb6('0x42')](_0x1ca330['where'],{'$or':_[_0x3cb6('0x33')](_0x3e3648,function(_0x436f4e){if(_0x436f4e[_0x3cb6('0x31')]!==_0x3cb6('0x43')){var _0x474864={};_0x474864[_0x436f4e['name']]={'$like':'%'+_0x1e9d2b[_0x3cb6('0x35')][_0x3cb6('0x40')]+'%'};return _0x474864;}})});}_0x1ca330=_[_0x3cb6('0x42')]({},_0x1ca330,_0x1e9d2b[_0x3cb6('0x44')]);var _0x5f9201={'where':_0x1ca330['where']};return db[_0x3cb6('0x30')][_0x3cb6('0x25')](_0x5f9201)[_0x3cb6('0x2b')](function(_0x1002ac){_0x79b419[_0x3cb6('0x25')]=_0x1002ac;if(_0x1e9d2b[_0x3cb6('0x35')][_0x3cb6('0x45')]){_0x1ca330['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3cb6('0x46')](_0x1ca330);})[_0x3cb6('0x2b')](function(_0x3dda9e){_0x79b419[_0x3cb6('0x47')]=_0x3dda9e;return _0x79b419;})[_0x3cb6('0x2b')](respondWithFilteredResult(_0x4921b0,_0x1ca330))[_0x3cb6('0x48')](handleError(_0x4921b0,null));};exports[_0x3cb6('0x49')]=function(_0x57c08e,_0x1020b3){var _0x429361={'raw':!![],'where':{'id':_0x57c08e['params']['id']}},_0x5ea596={};_0x5ea596['model']=_[_0x3cb6('0x34')](db[_0x3cb6('0x30')][_0x3cb6('0x4a')]);_0x5ea596['query']=_['keys'](_0x57c08e[_0x3cb6('0x35')]);_0x5ea596[_0x3cb6('0x3e')]=_[_0x3cb6('0x37')](_0x5ea596[_0x3cb6('0x32')],_0x5ea596[_0x3cb6('0x35')]);_0x429361[_0x3cb6('0x36')]=_[_0x3cb6('0x37')](_0x5ea596[_0x3cb6('0x32')],qs[_0x3cb6('0x38')](_0x57c08e[_0x3cb6('0x35')]['fields']));_0x429361[_0x3cb6('0x36')]=_0x429361[_0x3cb6('0x36')]['length']?_0x429361[_0x3cb6('0x36')]:_0x5ea596[_0x3cb6('0x32')];if(_0x57c08e['query'][_0x3cb6('0x45')]){_0x429361[_0x3cb6('0x4b')]=[{'all':!![]}];}_0x429361=_['merge']({},_0x429361,_0x57c08e[_0x3cb6('0x44')]);return db[_0x3cb6('0x30')]['find'](_0x429361)[_0x3cb6('0x2b')](handleEntityNotFound(_0x1020b3,null))['then'](respondWithResult(_0x1020b3,null))[_0x3cb6('0x48')](handleError(_0x1020b3,null));};exports['create']=function(_0x5d434a,_0x33ae54){return db['ChatInternalMessage'][_0x3cb6('0x4c')](_0x5d434a[_0x3cb6('0x4d')],{})[_0x3cb6('0x2b')](respondWithResult(_0x33ae54,0xc9))['catch'](handleError(_0x33ae54,null));};exports['update']=function(_0x5545da,_0x90d1bb){if(_0x5545da[_0x3cb6('0x4d')]['id']){delete _0x5545da[_0x3cb6('0x4d')]['id'];}return db[_0x3cb6('0x30')]['find']({'where':{'id':_0x5545da[_0x3cb6('0x4e')]['id']}})[_0x3cb6('0x2b')](handleEntityNotFound(_0x90d1bb,null))[_0x3cb6('0x2b')](saveUpdates(_0x5545da[_0x3cb6('0x4d')],null))[_0x3cb6('0x2b')](respondWithResult(_0x90d1bb,null))[_0x3cb6('0x48')](handleError(_0x90d1bb,null));};exports['destroy']=function(_0xec16ae,_0x4ed4c4){return db['ChatInternalMessage'][_0x3cb6('0x4f')]({'where':{'id':_0xec16ae[_0x3cb6('0x4e')]['id']}})[_0x3cb6('0x2b')](handleEntityNotFound(_0x4ed4c4,null))[_0x3cb6('0x2b')](removeEntity(_0x4ed4c4,null))[_0x3cb6('0x48')](handleError(_0x4ed4c4,null));};exports[_0x3cb6('0x50')]=function(_0x4ba953,_0x141703){return db[_0x3cb6('0x30')][_0x3cb6('0x50')]()[_0x3cb6('0x2b')](respondWithResult(_0x141703,null))['catch'](handleError(_0x141703,null));};function wrapUser(_0x3f50db){return function(_0x3d9ebf){var _0x5134e8=_0x3f50db[_0x3cb6('0x51')]({'plain':!![]});_0x5134e8['messages']=[];if(_0x3d9ebf){_0x5134e8['lastMessageAt']=_0x3d9ebf['createdAt'];_0x5134e8[_0x3cb6('0x52')]=_0x3d9ebf;}else{_0x5134e8[_0x3cb6('0x53')]=moment(0x0)[_0x3cb6('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x5134e8[_0x3cb6('0x52')]={};}return _0x5134e8;};}exports[_0x3cb6('0x55')]=function(_0xdec2e,_0x2632dd,_0x1b0535){var _0x59f853=[];return db[_0x3cb6('0x56')]['findAll']({'where':{'role':[_0x3cb6('0x57'),'admin',_0x3cb6('0x58')]},'attributes':['id',_0x3cb6('0x59'),_0x3cb6('0x2f'),'role','userpic','internal',_0x3cb6('0x5a'),_0x3cb6('0x5b'),_0x3cb6('0x5c'),_0x3cb6('0x5d')],'order':qs[_0x3cb6('0x3d')](_0x3cb6('0x5e')),'include':[{'model':db[_0x3cb6('0x5f')],'as':_0x3cb6('0x60'),'attributes':['id',_0x3cb6('0x2f'),'type'],'through':{'attributes':[]}}]})[_0x3cb6('0x2b')](function(_0x1df8f0){if(_0x1df8f0){var _0x5805bc=_0xdec2e[_0x3cb6('0x58')]['get']({'plain':!![]});if(!_0x5805bc)throw new Error(_0x3cb6('0x61'));if(_0x5805bc[_0x3cb6('0x62')]===_0x3cb6('0x58')){return db[_0x3cb6('0x63')][_0x3cb6('0x4f')]({'where':{'name':_0x3cb6('0x64'),'userProfileId':_0x5805bc['userProfileId']},'raw':!![]})[_0x3cb6('0x2b')](function(_0x4af26d){if(_0x4af26d){if(_0x4af26d['autoAssociation']===0x0){return db[_0x3cb6('0x65')][_0x3cb6('0x46')]({'where':{'sectionId':_0x4af26d['id']},'raw':!![]})[_0x3cb6('0x2b')](function(_0x13e071){var _0x50980c=[];if(_[_0x3cb6('0x66')](_0x13e071)){_0x50980c=_['filter'](_0x1df8f0,function(_0x575aee){if(_0x575aee[_0x3cb6('0x62')]!==_0x3cb6('0x57')){return _0x575aee;}});return _0x50980c;}else{for(var _0x48916b=0x0;_0x48916b<_0x1df8f0['length'];_0x48916b++){var _0x41e6c6=_0x1df8f0[_0x48916b];if(_0x41e6c6[_0x3cb6('0x62')]===_0x3cb6('0x57')){var _0x34cb3a=_[_0x3cb6('0x4f')](_0x13e071,function(_0x282db5){return _0x282db5[_0x3cb6('0x67')]===_0x41e6c6['id'];});if(_0x34cb3a)_0x50980c[_0x3cb6('0x68')](_0x41e6c6);}else{_0x50980c[_0x3cb6('0x68')](_0x41e6c6);}}return _0x50980c;}});}else{return _0x1df8f0;}}else{var _0x324dcf=_[_0x3cb6('0x40')](_0x1df8f0,function(_0x267898){if(_0x267898[_0x3cb6('0x62')]!==_0x3cb6('0x57')){return _0x267898;}});return _0x324dcf;}});}else{return _0x1df8f0;}}})[_0x3cb6('0x2b')](function(_0x2f3b72){var _0x5638e2=[];if(_0x2f3b72){_0x59f853=_0x2f3b72;for(var _0x4faf94=0x0;_0x4faf94<_0x2f3b72[_0x3cb6('0x39')];_0x4faf94+=0x1){_0x59f853[_0x4faf94]['messages']=[];_0x5638e2[_0x3cb6('0x68')](db[_0x3cb6('0x30')]['find']({'where':{'FromId':[_0xdec2e['user']['id'],_0x2f3b72[_0x4faf94]['id']],'ToId':[_0xdec2e[_0x3cb6('0x58')]['id'],_0x2f3b72[_0x4faf94]['id']],'ChatGroupId':null},'attributes':['id',_0x3cb6('0x69'),_0x3cb6('0x6a'),_0x3cb6('0x6b'),_0x3cb6('0x6c'),'body'],'order':qs[_0x3cb6('0x3d')](_0x3cb6('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3cb6('0x2b')](wrapUser(_0x2f3b72[_0x4faf94])));}return BPromise[_0x3cb6('0x6e')](_0x5638e2);}return[];})[_0x3cb6('0x2b')](function(_0x3dd9fa){return{'rows':_0x3dd9fa,'count':_0x3dd9fa[_0x3cb6('0x39')]};})[_0x3cb6('0x2b')](respondWithResult(_0x2632dd,null))[_0x3cb6('0x48')](handleError(_0x2632dd,null));};
\ No newline at end of file
+var _0x8749=['all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatInternalMessage','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','find','create','body','params','describe','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','user','fullname','userpic','internal','allowmessenger','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','ToId','read','-createdAt'];(function(_0x40e8ce,_0x1976ca){var _0x1c9032=function(_0x38a3ed){while(--_0x38a3ed){_0x40e8ce['push'](_0x40e8ce['shift']());}};_0x1c9032(++_0x1976ca);}(_0x8749,0x1c5));var _0x9874=function(_0x5ca7ee,_0x4c4c48){_0x5ca7ee=_0x5ca7ee-0x0;var _0x47123f=_0x8749[_0x5ca7ee];return _0x47123f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9874('0x0'));var jsonpatch=require(_0x9874('0x1'));var rp=require(_0x9874('0x2'));var moment=require(_0x9874('0x3'));var BPromise=require(_0x9874('0x4'));var Mustache=require(_0x9874('0x5'));var util=require('util');var path=require(_0x9874('0x6'));var sox=require(_0x9874('0x7'));var csv=require(_0x9874('0x8'));var ejs=require(_0x9874('0x9'));var fs=require('fs');var fs_extra=require(_0x9874('0xa'));var _=require(_0x9874('0xb'));var squel=require(_0x9874('0xc'));var crypto=require(_0x9874('0xd'));var jsforce=require(_0x9874('0xe'));var deskjs=require(_0x9874('0xf'));var toCsv=require(_0x9874('0x8'));var querystring=require('querystring');var Papa=require(_0x9874('0x10'));var Redis=require(_0x9874('0x11'));var authService=require(_0x9874('0x12'));var qs=require(_0x9874('0x13'));var as=require(_0x9874('0x14'));var hardwareService=require(_0x9874('0x15'));var logger=require('../../config/logger')(_0x9874('0x16'));var utils=require(_0x9874('0x17'));var config=require(_0x9874('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9874('0x19'))['db'];config[_0x9874('0x1a')]=_[_0x9874('0x1b')](config[_0x9874('0x1a')],{'host':_0x9874('0x1c'),'port':0x18eb});var socket=require(_0x9874('0x1d'))(new Redis(config['redis']));require(_0x9874('0x1e'))[_0x9874('0x1f')](socket);function respondWithStatusCode(_0x3e193f,_0x20d911){_0x20d911=_0x20d911||0xcc;return function(_0x5d0b96){if(_0x5d0b96){return _0x3e193f['sendStatus'](_0x20d911);}return _0x3e193f[_0x9874('0x20')](_0x20d911)[_0x9874('0x21')]();};}function respondWithResult(_0x39c25a,_0x5d2d2f){_0x5d2d2f=_0x5d2d2f||0xc8;return function(_0x57f91c){if(_0x57f91c){return _0x39c25a[_0x9874('0x20')](_0x5d2d2f)[_0x9874('0x22')](_0x57f91c);}};}function respondWithFilteredResult(_0x542f5d,_0x359061){return function(_0x26e47f){if(_0x26e47f){var _0x2d2277=typeof _0x359061[_0x9874('0x23')]===_0x9874('0x24')&&typeof _0x359061[_0x9874('0x25')]===_0x9874('0x24');var _0x446819=_0x26e47f['count'];var _0x4177e6=_0x2d2277?0x0:_0x359061['offset'];var _0x2599f1=_0x2d2277?_0x26e47f[_0x9874('0x26')]:_0x359061['offset']+_0x359061[_0x9874('0x25')];var _0x4215c9;if(_0x2599f1>=_0x446819){_0x2599f1=_0x446819;_0x4215c9=0xc8;}else{_0x4215c9=0xce;}_0x542f5d['status'](_0x4215c9);return _0x542f5d[_0x9874('0x27')](_0x9874('0x28'),_0x4177e6+'-'+_0x2599f1+'/'+_0x446819)[_0x9874('0x22')](_0x26e47f);}return null;};}function patchUpdates(_0x6dec1f){return function(_0x55643b){try{jsonpatch[_0x9874('0x29')](_0x55643b,_0x6dec1f,!![]);}catch(_0x53a8b2){return BPromise[_0x9874('0x2a')](_0x53a8b2);}return _0x55643b[_0x9874('0x2b')]();};}function saveUpdates(_0x2f36c1,_0x490347){return function(_0x1f221a){if(_0x1f221a){return _0x1f221a[_0x9874('0x2c')](_0x2f36c1)[_0x9874('0x2d')](function(_0xe60d80){return _0xe60d80;});}return null;};}function removeEntity(_0x301544,_0x4d4315){return function(_0x81a26){if(_0x81a26){return _0x81a26[_0x9874('0x2e')]()[_0x9874('0x2d')](function(){_0x301544[_0x9874('0x20')](0xcc)[_0x9874('0x21')]();});}};}function handleEntityNotFound(_0x5aa8cf,_0x653642){return function(_0xf20566){if(!_0xf20566){_0x5aa8cf[_0x9874('0x2f')](0x194);}return _0xf20566;};}function handleError(_0xd5d581,_0xcd205f){_0xcd205f=_0xcd205f||0x1f4;return function(_0x15fc9d){logger['error'](_0x15fc9d[_0x9874('0x30')]);if(_0x15fc9d['name']){delete _0x15fc9d[_0x9874('0x31')];}_0xd5d581['status'](_0xcd205f)[_0x9874('0x32')](_0x15fc9d);};}exports[_0x9874('0x33')]=function(_0x58a33c,_0x42b1ef){var _0x35414d={},_0x36a149={},_0x39fa5b={'count':0x0,'rows':[]};var _0x29baed=_[_0x9874('0x34')](db[_0x9874('0x35')]['rawAttributes'],function(_0x4f1109){return{'name':_0x4f1109['fieldName'],'type':_0x4f1109['type'][_0x9874('0x36')]};});_0x36a149[_0x9874('0x37')]=_['map'](_0x29baed,_0x9874('0x31'));_0x36a149[_0x9874('0x38')]=_['keys'](_0x58a33c[_0x9874('0x38')]);_0x36a149[_0x9874('0x39')]=_[_0x9874('0x3a')](_0x36a149[_0x9874('0x37')],_0x36a149['query']);_0x35414d[_0x9874('0x3b')]=_[_0x9874('0x3a')](_0x36a149[_0x9874('0x37')],qs[_0x9874('0x3c')](_0x58a33c[_0x9874('0x38')]['fields']));_0x35414d[_0x9874('0x3b')]=_0x35414d[_0x9874('0x3b')][_0x9874('0x3d')]?_0x35414d[_0x9874('0x3b')]:_0x36a149['model'];if(!_0x58a33c[_0x9874('0x38')][_0x9874('0x3e')]('nolimit')){_0x35414d[_0x9874('0x25')]=qs[_0x9874('0x25')](_0x58a33c[_0x9874('0x38')][_0x9874('0x25')]);_0x35414d[_0x9874('0x23')]=qs[_0x9874('0x23')](_0x58a33c[_0x9874('0x38')][_0x9874('0x23')]);}_0x35414d[_0x9874('0x3f')]=qs[_0x9874('0x40')](_0x58a33c['query'][_0x9874('0x40')]);_0x35414d[_0x9874('0x41')]=qs[_0x9874('0x39')](_[_0x9874('0x42')](_0x58a33c[_0x9874('0x38')],_0x36a149[_0x9874('0x39')]),_0x29baed);if(_0x58a33c[_0x9874('0x38')][_0x9874('0x43')]){_0x35414d[_0x9874('0x41')]=_[_0x9874('0x44')](_0x35414d[_0x9874('0x41')],{'$or':_[_0x9874('0x34')](_0x29baed,function(_0x410360){if(_0x410360[_0x9874('0x45')]!==_0x9874('0x46')){var _0x398689={};_0x398689[_0x410360['name']]={'$like':'%'+_0x58a33c['query'][_0x9874('0x43')]+'%'};return _0x398689;}})});}_0x35414d=_[_0x9874('0x44')]({},_0x35414d,_0x58a33c['options']);var _0x540e1a={'where':_0x35414d[_0x9874('0x41')]};return db['ChatInternalMessage']['count'](_0x540e1a)[_0x9874('0x2d')](function(_0x1b7246){_0x39fa5b['count']=_0x1b7246;if(_0x58a33c[_0x9874('0x38')][_0x9874('0x47')]){_0x35414d[_0x9874('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x9874('0x49')](_0x35414d);})['then'](function(_0x2ceeca){_0x39fa5b[_0x9874('0x4a')]=_0x2ceeca;return _0x39fa5b;})[_0x9874('0x2d')](respondWithFilteredResult(_0x42b1ef,_0x35414d))[_0x9874('0x4b')](handleError(_0x42b1ef,null));};exports[_0x9874('0x4c')]=function(_0x1130e2,_0x758299){var _0x5839f4={'raw':!![],'where':{'id':_0x1130e2['params']['id']}},_0x1a8501={};_0x1a8501['model']=_[_0x9874('0x4d')](db[_0x9874('0x35')][_0x9874('0x4e')]);_0x1a8501[_0x9874('0x38')]=_[_0x9874('0x4d')](_0x1130e2[_0x9874('0x38')]);_0x1a8501['filters']=_[_0x9874('0x3a')](_0x1a8501[_0x9874('0x37')],_0x1a8501[_0x9874('0x38')]);_0x5839f4[_0x9874('0x3b')]=_[_0x9874('0x3a')](_0x1a8501[_0x9874('0x37')],qs[_0x9874('0x3c')](_0x1130e2['query'][_0x9874('0x3c')]));_0x5839f4[_0x9874('0x3b')]=_0x5839f4[_0x9874('0x3b')][_0x9874('0x3d')]?_0x5839f4[_0x9874('0x3b')]:_0x1a8501['model'];if(_0x1130e2[_0x9874('0x38')]['includeAll']){_0x5839f4[_0x9874('0x48')]=[{'all':!![]}];}_0x5839f4=_[_0x9874('0x44')]({},_0x5839f4,_0x1130e2[_0x9874('0x4f')]);return db[_0x9874('0x35')][_0x9874('0x50')](_0x5839f4)[_0x9874('0x2d')](handleEntityNotFound(_0x758299,null))[_0x9874('0x2d')](respondWithResult(_0x758299,null))[_0x9874('0x4b')](handleError(_0x758299,null));};exports['create']=function(_0x4ae6a1,_0x33f5db){return db[_0x9874('0x35')][_0x9874('0x51')](_0x4ae6a1[_0x9874('0x52')],{})[_0x9874('0x2d')](respondWithResult(_0x33f5db,0xc9))['catch'](handleError(_0x33f5db,null));};exports[_0x9874('0x2c')]=function(_0x581929,_0x22933b){if(_0x581929[_0x9874('0x52')]['id']){delete _0x581929['body']['id'];}return db['ChatInternalMessage'][_0x9874('0x50')]({'where':{'id':_0x581929[_0x9874('0x53')]['id']}})['then'](handleEntityNotFound(_0x22933b,null))['then'](saveUpdates(_0x581929[_0x9874('0x52')],null))[_0x9874('0x2d')](respondWithResult(_0x22933b,null))[_0x9874('0x4b')](handleError(_0x22933b,null));};exports[_0x9874('0x2e')]=function(_0x6dfa3f,_0x3a12aa){return db[_0x9874('0x35')][_0x9874('0x50')]({'where':{'id':_0x6dfa3f[_0x9874('0x53')]['id']}})[_0x9874('0x2d')](handleEntityNotFound(_0x3a12aa,null))[_0x9874('0x2d')](removeEntity(_0x3a12aa,null))['catch'](handleError(_0x3a12aa,null));};exports[_0x9874('0x54')]=function(_0x3388ad,_0x22cc2c){return db[_0x9874('0x35')][_0x9874('0x54')]()['then'](respondWithResult(_0x22cc2c,null))[_0x9874('0x4b')](handleError(_0x22cc2c,null));};function wrapUser(_0x585bc8){return function(_0x359f4a){var _0x4a884c=_0x585bc8['get']({'plain':!![]});_0x4a884c[_0x9874('0x55')]=[];if(_0x359f4a){_0x4a884c[_0x9874('0x56')]=_0x359f4a[_0x9874('0x57')];_0x4a884c['lastMessage']=_0x359f4a;}else{_0x4a884c[_0x9874('0x56')]=moment(0x0)[_0x9874('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a884c[_0x9874('0x59')]={};}return _0x4a884c;};}exports[_0x9874('0x5a')]=function(_0x5999fc,_0xc9ebde,_0x225841){var _0xcc4d83=[];return db[_0x9874('0x5b')][_0x9874('0x49')]({'where':{'role':['agent','admin',_0x9874('0x5c')]},'attributes':['id',_0x9874('0x5d'),_0x9874('0x31'),'role',_0x9874('0x5e'),_0x9874('0x5f'),'online','lastLoginAt',_0x9874('0x60'),'showWebBar'],'order':qs['sort'](_0x9874('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x9874('0x62'),'attributes':['id',_0x9874('0x31'),_0x9874('0x45')],'through':{'attributes':[]}}]})[_0x9874('0x2d')](function(_0x32e81c){if(_0x32e81c){var _0x3d1d7d=_0x5999fc[_0x9874('0x5c')]['get']({'plain':!![]});if(!_0x3d1d7d)throw new Error(_0x9874('0x63'));if(_0x3d1d7d[_0x9874('0x64')]===_0x9874('0x5c')){return db[_0x9874('0x65')]['find']({'where':{'name':_0x9874('0x66'),'userProfileId':_0x3d1d7d[_0x9874('0x67')]},'raw':!![]})['then'](function(_0x445c16){if(_0x445c16){if(_0x445c16[_0x9874('0x68')]===0x0){return db[_0x9874('0x69')]['findAll']({'where':{'sectionId':_0x445c16['id']},'raw':!![]})[_0x9874('0x2d')](function(_0x1ee030){var _0x4473b2=[];if(_[_0x9874('0x6a')](_0x1ee030)){_0x4473b2=_[_0x9874('0x43')](_0x32e81c,function(_0x292317){if(_0x292317[_0x9874('0x64')]!==_0x9874('0x6b')){return _0x292317;}});return _0x4473b2;}else{for(var _0x57bf13=0x0;_0x57bf13<_0x32e81c['length'];_0x57bf13++){var _0x34a101=_0x32e81c[_0x57bf13];if(_0x34a101['role']==='agent'){var _0x69ff4=_[_0x9874('0x50')](_0x1ee030,function(_0x17459a){return _0x17459a[_0x9874('0x6c')]===_0x34a101['id'];});if(_0x69ff4)_0x4473b2['push'](_0x34a101);}else{_0x4473b2['push'](_0x34a101);}}return _0x4473b2;}});}else{return _0x32e81c;}}else{var _0x44e4af=_['filter'](_0x32e81c,function(_0x15f439){if(_0x15f439[_0x9874('0x64')]!==_0x9874('0x6b')){return _0x15f439;}});return _0x44e4af;}});}else{return _0x32e81c;}}})[_0x9874('0x2d')](function(_0x1cef3d){var _0x4dec83=[];if(_0x1cef3d){_0xcc4d83=_0x1cef3d;for(var _0x2609df=0x0;_0x2609df<_0x1cef3d[_0x9874('0x3d')];_0x2609df+=0x1){_0xcc4d83[_0x2609df][_0x9874('0x55')]=[];_0x4dec83['push'](db[_0x9874('0x35')][_0x9874('0x50')]({'where':{'FromId':[_0x5999fc[_0x9874('0x5c')]['id'],_0x1cef3d[_0x2609df]['id']],'ToId':[_0x5999fc['user']['id'],_0x1cef3d[_0x2609df]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x9874('0x6d'),_0x9874('0x6e'),_0x9874('0x52')],'order':qs[_0x9874('0x40')](_0x9874('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9874('0x2d')](wrapUser(_0x1cef3d[_0x2609df])));}return BPromise[_0x9874('0x70')](_0x4dec83);}return[];})[_0x9874('0x2d')](function(_0x29c118){return{'rows':_0x29c118,'count':_0x29c118['length']};})[_0x9874('0x2d')](respondWithResult(_0xc9ebde,null))[_0x9874('0x4b')](handleError(_0xc9ebde,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 7a2003d..3157bf2 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 _0x5452=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','update','remove','emit'];(function(_0xf38552,_0x1fcf41){var _0x2c7528=function(_0xc81e3a){while(--_0xc81e3a){_0xf38552['push'](_0xf38552['shift']());}};_0x2c7528(++_0x1fcf41);}(_0x5452,0xbf));var _0x2545=function(_0x4d8504,_0x3fce2f){_0x4d8504=_0x4d8504-0x0;var _0x116792=_0x5452[_0x4d8504];return _0x116792;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x2545('0x0'))['db'][_0x2545('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2545('0x2'),'afterDestroy':_0x2545('0x3')};function emitEvent(_0x345c1f){return function(_0xceaac,_0x4ac98e,_0x4962ba){ChatInternalMessageEvents[_0x2545('0x4')](_0x345c1f+':'+_0xceaac['id'],_0xceaac);ChatInternalMessageEvents['emit'](_0x345c1f,_0xceaac);_0x4962ba(null);};}for(var e in events){if(events[_0x2545('0x5')](e)){var event=events[e];ChatInternalMessage[_0x2545('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x657b=['hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x5d3bda,_0x4d10c1){var _0x5b6d20=function(_0x18bdcb){while(--_0x18bdcb){_0x5d3bda['push'](_0x5d3bda['shift']());}};_0x5b6d20(++_0x4d10c1);}(_0x657b,0x77));var _0xb657=function(_0x387d26,_0x13c985){_0x387d26=_0x387d26-0x0;var _0x5d073a=_0x657b[_0x387d26];return _0x5d073a;};'use strict';var EventEmitter=require(_0xb657('0x0'));var ChatInternalMessage=require(_0xb657('0x1'))['db'][_0xb657('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb657('0x3'),'afterUpdate':_0xb657('0x4'),'afterDestroy':_0xb657('0x5')};function emitEvent(_0x2de0e3){return function(_0x5c7118,_0xeed689,_0x16190d){ChatInternalMessageEvents['emit'](_0x2de0e3+':'+_0x5c7118['id'],_0x5c7118);ChatInternalMessageEvents[_0xb657('0x6')](_0x2de0e3,_0x5c7118);_0x16190d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xb657('0x7')](e,emitEvent(event));}}module[_0xb657('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 8a7836b..ec1cf07 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 _0x9307=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9307,0x16e));var _0x7930=function(_0x2f83d1,_0x465431){_0x2f83d1=_0x2f83d1-0x0;var _0x351f3f=_0x9307[_0x2f83d1];return _0x351f3f;};'use strict';var _=require(_0x7930('0x0'));var util=require(_0x7930('0x1'));var logger=require(_0x7930('0x2'))('api');var moment=require(_0x7930('0x3'));var BPromise=require(_0x7930('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7930('0x5'));var rimraf=require(_0x7930('0x6'));var config=require(_0x7930('0x7'));var attributes=require(_0x7930('0x8'));module[_0x7930('0x9')]=function(_0x3a220a,_0x172951){return _0x3a220a[_0x7930('0xa')]('ChatInternalMessage',attributes,{'tableName':_0x7930('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7930('0xc'),'collate':_0x7930('0xd')});};
\ No newline at end of file
+var _0x5f9a=['api','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x34697a,_0x5a93d6){var _0x18abce=function(_0x356b33){while(--_0x356b33){_0x34697a['push'](_0x34697a['shift']());}};_0x18abce(++_0x5a93d6);}(_0x5f9a,0xa6));var _0xa5f9=function(_0x4c742a,_0x3608ac){_0x4c742a=_0x4c742a-0x0;var _0x55717b=_0x5f9a[_0x4c742a];return _0x55717b;};'use strict';var _=require(_0xa5f9('0x0'));var util=require('util');var logger=require(_0xa5f9('0x1'))(_0xa5f9('0x2'));var moment=require('moment');var BPromise=require(_0xa5f9('0x3'));var rp=require(_0xa5f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5f9('0x5'));var config=require(_0xa5f9('0x6'));var attributes=require(_0xa5f9('0x7'));module[_0xa5f9('0x8')]=function(_0x152de8,_0x168f68){return _0x152de8[_0xa5f9('0x9')](_0xa5f9('0xa'),attributes,{'tableName':_0xa5f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5f9('0xc'),'collate':_0xa5f9('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9d45dbb..72b35c6 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 _0xec86=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','register','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x569118,_0x187060){var _0x181ff5=function(_0x3cfd8f){while(--_0x3cfd8f){_0x569118['push'](_0x569118['shift']());}};_0x181ff5(++_0x187060);}(_0xec86,0x7f));var _0x6ec8=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xec86[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x6ec8('0x0'));var util=require(_0x6ec8('0x1'));var moment=require(_0x6ec8('0x2'));var BPromise=require(_0x6ec8('0x3'));var rs=require(_0x6ec8('0x4'));var fs=require('fs');var Redis=require(_0x6ec8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ec8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ec8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6ec8('0x8')][_0x6ec8('0x9')]({'port':0x232a});config[_0x6ec8('0xa')]=_[_0x6ec8('0xb')](config[_0x6ec8('0xa')],{'host':_0x6ec8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ec8('0xa')]));require('./chatInternalMessage.socket')[_0x6ec8('0xd')](socket);function respondWithRpcPromise(_0x331dfe,_0x272f76,_0x6c0d4){return new BPromise(function(_0x321b8f,_0x3fcc54){return client['request'](_0x331dfe,_0x6c0d4)['then'](function(_0x108a9b){logger[_0x6ec8('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x272f76,_0x6ec8('0xf'));logger[_0x6ec8('0x10')](_0x6ec8('0x11'),_0x272f76,'request\x20sent',JSON[_0x6ec8('0x12')](_0x108a9b));if(_0x108a9b[_0x6ec8('0x13')]){if(_0x108a9b[_0x6ec8('0x13')][_0x6ec8('0x14')]===0x1f4){logger['error'](_0x6ec8('0x15'),_0x272f76,_0x108a9b[_0x6ec8('0x13')][_0x6ec8('0x16')]);return _0x3fcc54(_0x108a9b[_0x6ec8('0x13')][_0x6ec8('0x16')]);}logger[_0x6ec8('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x272f76,_0x108a9b[_0x6ec8('0x13')][_0x6ec8('0x16')]);return _0x321b8f(_0x108a9b[_0x6ec8('0x13')]['message']);}else{logger[_0x6ec8('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x272f76,_0x6ec8('0xf'));_0x321b8f(_0x108a9b[_0x6ec8('0x17')][_0x6ec8('0x16')]);}})[_0x6ec8('0x18')](function(_0x402091){logger[_0x6ec8('0x13')](_0x6ec8('0x15'),_0x272f76,_0x402091);_0x3fcc54(_0x402091);});});}
\ No newline at end of file
+var _0xf40b=['client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x35f188,_0x4f70a7){var _0x284e96=function(_0x281f73){while(--_0x281f73){_0x35f188['push'](_0x35f188['shift']());}};_0x284e96(++_0x4f70a7);}(_0xf40b,0xfb));var _0xbf40=function(_0x48a0b4,_0x2a4c3f){_0x48a0b4=_0x48a0b4-0x0;var _0x44b1e6=_0xf40b[_0x48a0b4];return _0x44b1e6;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var moment=require(_0xbf40('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf40('0x2'));var fs=require('fs');var Redis=require(_0xbf40('0x3'));var db=require(_0xbf40('0x4'))['db'];var utils=require(_0xbf40('0x5'));var logger=require(_0xbf40('0x6'))('rpc');var config=require(_0xbf40('0x7'));var jayson=require(_0xbf40('0x8'));var client=jayson[_0xbf40('0x9')][_0xbf40('0xa')]({'port':0x232a});config[_0xbf40('0xb')]=_['defaults'](config[_0xbf40('0xb')],{'host':_0xbf40('0xc'),'port':0x18eb});var socket=require(_0xbf40('0xd'))(new Redis(config['redis']));require(_0xbf40('0xe'))[_0xbf40('0xf')](socket);function respondWithRpcPromise(_0xfaf7fb,_0x2945b4,_0xbaaee1){return new BPromise(function(_0x3d3993,_0x48f2f6){return client[_0xbf40('0x10')](_0xfaf7fb,_0xbaaee1)['then'](function(_0x828850){logger[_0xbf40('0x11')](_0xbf40('0x12'),_0x2945b4,_0xbf40('0x13'));logger['debug'](_0xbf40('0x14'),_0x2945b4,_0xbf40('0x13'),JSON['stringify'](_0x828850));if(_0x828850[_0xbf40('0x15')]){if(_0x828850[_0xbf40('0x15')][_0xbf40('0x16')]===0x1f4){logger[_0xbf40('0x15')](_0xbf40('0x12'),_0x2945b4,_0x828850[_0xbf40('0x15')][_0xbf40('0x17')]);return _0x48f2f6(_0x828850['error'][_0xbf40('0x17')]);}logger[_0xbf40('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2945b4,_0x828850[_0xbf40('0x15')][_0xbf40('0x17')]);return _0x3d3993(_0x828850[_0xbf40('0x15')]['message']);}else{logger['info'](_0xbf40('0x12'),_0x2945b4,_0xbf40('0x13'));_0x3d3993(_0x828850[_0xbf40('0x18')][_0xbf40('0x17')]);}})[_0xbf40('0x19')](function(_0x51042f){logger[_0xbf40('0x15')](_0xbf40('0x12'),_0x2945b4,_0x51042f);_0x48f2f6(_0x51042f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4d53dfe..453c58e 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 _0x69d5=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x69d5,0xf6));var _0x569d=function(_0x12d357,_0x5253f4){_0x12d357=_0x12d357-0x0;var _0x5af041=_0x69d5[_0x12d357];return _0x5af041;};'use strict';var ChatInternalMessageEvents=require(_0x569d('0x0'));var events=[_0x569d('0x1'),_0x569d('0x2'),_0x569d('0x3')];function createListener(_0x222ef8,_0x22f78a){return function(_0x419d68){_0x22f78a[_0x569d('0x4')](_0x222ef8,_0x419d68);};}function removeListener(_0x3bea12,_0x282f2d){return function(){ChatInternalMessageEvents[_0x569d('0x5')](_0x3bea12,_0x282f2d);};}exports[_0x569d('0x6')]=function(_0x3b2f66){for(var _0x14e1c6=0x0,_0x2f05cc=events[_0x569d('0x7')];_0x14e1c6<_0x2f05cc;_0x14e1c6++){var _0x530660=events[_0x14e1c6];var _0x1edac8=createListener('chatInternalMessage:'+_0x530660,_0x3b2f66);ChatInternalMessageEvents['on'](_0x530660,_0x1edac8);}};
\ No newline at end of file
+var _0x6d30=['removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x3dc277,_0x2e082d){var _0x4fd68d=function(_0x529918){while(--_0x529918){_0x3dc277['push'](_0x3dc277['shift']());}};_0x4fd68d(++_0x2e082d);}(_0x6d30,0x168));var _0x06d3=function(_0x17d133,_0x3aebc5){_0x17d133=_0x17d133-0x0;var _0xf4f7a2=_0x6d30[_0x17d133];return _0xf4f7a2;};'use strict';var ChatInternalMessageEvents=require(_0x06d3('0x0'));var events=['save',_0x06d3('0x1'),_0x06d3('0x2')];function createListener(_0xc3ff85,_0x37f176){return function(_0x161edd){_0x37f176[_0x06d3('0x3')](_0xc3ff85,_0x161edd);};}function removeListener(_0x169238,_0x3d3a22){return function(){ChatInternalMessageEvents[_0x06d3('0x4')](_0x169238,_0x3d3a22);};}exports[_0x06d3('0x5')]=function(_0x109628){for(var _0x7c7845=0x0,_0xaa61df=events['length'];_0x7c7845<_0xaa61df;_0x7c7845++){var _0x9c05fa=events[_0x7c7845];var _0x3156ba=createListener(_0x06d3('0x6')+_0x9c05fa,_0x109628);ChatInternalMessageEvents['on'](_0x9c05fa,_0x3156ba);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 1b7c7ec..01a0f0a 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 _0xd046=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','show','post','put','delete','/:id','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x41b51f,_0x216fa6){var _0x5bd366=function(_0x163499){while(--_0x163499){_0x41b51f['push'](_0x41b51f['shift']());}};_0x5bd366(++_0x216fa6);}(_0xd046,0x177));var _0x6d04=function(_0x2b6e5d,_0x417c59){_0x2b6e5d=_0x2b6e5d-0x0;var _0x77d8c8=_0xd046[_0x2b6e5d];return _0x77d8c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d04('0x0'));var timeout=require(_0x6d04('0x1'));var express=require('express');var router=express[_0x6d04('0x2')]();var fs_extra=require(_0x6d04('0x3'));var auth=require(_0x6d04('0x4'));var interaction=require(_0x6d04('0x5'));var config=require(_0x6d04('0x6'));var controller=require(_0x6d04('0x7'));router[_0x6d04('0x8')]('/',auth[_0x6d04('0x9')](),controller[_0x6d04('0xa')]);router[_0x6d04('0x8')](_0x6d04('0xb'),auth['isAuthenticated'](),controller[_0x6d04('0xc')]);router[_0x6d04('0x8')](_0x6d04('0xd'),auth[_0x6d04('0x9')](),controller['getUsers']);router[_0x6d04('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0xe')]);router[_0x6d04('0xf')]('/',auth[_0x6d04('0x9')](),controller['create']);router[_0x6d04('0x10')]('/:id',controller['update']);router[_0x6d04('0x11')](_0x6d04('0x12'),auth[_0x6d04('0x9')](),controller[_0x6d04('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa049=['show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id'];(function(_0x258ff2,_0x2d0e88){var _0xaea1f2=function(_0x54c4f4){while(--_0x54c4f4){_0x258ff2['push'](_0x258ff2['shift']());}};_0xaea1f2(++_0x2d0e88);}(_0xa049,0x18d));var _0x9a04=function(_0x17cca1,_0x4cd1f6){_0x17cca1=_0x17cca1-0x0;var _0x2a1d4a=_0xa049[_0x17cca1];return _0x2a1d4a;};'use strict';var multer=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var path=require(_0x9a04('0x2'));var timeout=require(_0x9a04('0x3'));var express=require(_0x9a04('0x4'));var router=express[_0x9a04('0x5')]();var fs_extra=require(_0x9a04('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9a04('0x7'));var config=require(_0x9a04('0x8'));var controller=require(_0x9a04('0x9'));router[_0x9a04('0xa')]('/',auth[_0x9a04('0xb')](),controller['index']);router[_0x9a04('0xa')](_0x9a04('0xc'),auth['isAuthenticated'](),controller[_0x9a04('0xd')]);router[_0x9a04('0xa')](_0x9a04('0xe'),auth[_0x9a04('0xb')](),controller[_0x9a04('0xf')]);router[_0x9a04('0xa')](_0x9a04('0x10'),auth[_0x9a04('0xb')](),controller[_0x9a04('0x11')]);router['post']('/',auth[_0x9a04('0xb')](),controller[_0x9a04('0x12')]);router['put'](_0x9a04('0x10'),controller[_0x9a04('0x13')]);router[_0x9a04('0x14')](_0x9a04('0x10'),auth[_0x9a04('0xb')](),controller[_0x9a04('0x15')]);module[_0x9a04('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 10bcd9c..7120bc7 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 _0x87d9=['STRING','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1a57af,_0x1fb1f1){var _0x538b3c=function(_0x21537d){while(--_0x21537d){_0x1a57af['push'](_0x1a57af['shift']());}};_0x538b3c(++_0x1fb1f1);}(_0x87d9,0x143));var _0x987d=function(_0x39b9b3,_0x3e9a66){_0x39b9b3=_0x39b9b3-0x0;var _0x4977c8=_0x87d9[_0x39b9b3];return _0x4977c8;};'use strict';var Sequelize=require(_0x987d('0x0'));module['exports']={'body':{'type':Sequelize[_0x987d('0x1')](_0x987d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x987d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x987d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x987d('0x4')]('in','out'),'defaultValue':_0x987d('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x987d('0x6')]},'providerResponse':{'type':Sequelize[_0x987d('0x1')]}};
\ No newline at end of file
+var _0x9e0d=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x372004,_0x503f88){_0x372004=_0x372004-0x0;var _0x213de1=_0x9e0d[_0x372004];return _0x213de1;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'body':{'type':Sequelize[_0xd9e0('0x2')](_0xd9e0('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9e0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9e0('0x5')]('in',_0xd9e0('0x6')),'defaultValue':_0xd9e0('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9e0('0x7')]},'providerName':{'type':Sequelize[_0xd9e0('0x8')]},'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 d0ba464..2ba8aef 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 _0xaf93=['../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','offset','undefined','limit','count','json','apply','reject','destroy','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','includeAll','include','findAll','show','params','keys','merge','options','find','create','body','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','role','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x47a0cc,_0x51c40d){var _0x1c5f01=function(_0x575e70){while(--_0x575e70){_0x47a0cc['push'](_0x47a0cc['shift']());}};_0x1c5f01(++_0x51c40d);}(_0xaf93,0x16d));var _0x3af9=function(_0x844048,_0x174a1c){_0x844048=_0x844048-0x0;var _0x1686e7=_0xaf93[_0x844048];return _0x1686e7;};'use strict';var emlformat=require(_0x3af9('0x0'));var rimraf=require(_0x3af9('0x1'));var zipdir=require(_0x3af9('0x2'));var jsonpatch=require(_0x3af9('0x3'));var rp=require(_0x3af9('0x4'));var moment=require(_0x3af9('0x5'));var BPromise=require(_0x3af9('0x6'));var Mustache=require(_0x3af9('0x7'));var util=require(_0x3af9('0x8'));var path=require('path');var sox=require(_0x3af9('0x9'));var csv=require(_0x3af9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3af9('0xb'));var _=require(_0x3af9('0xc'));var squel=require('squel');var crypto=require(_0x3af9('0xd'));var jsforce=require(_0x3af9('0xe'));var deskjs=require(_0x3af9('0xf'));var toCsv=require(_0x3af9('0xa'));var querystring=require('querystring');var Papa=require(_0x3af9('0x10'));var Redis=require(_0x3af9('0x11'));var authService=require(_0x3af9('0x12'));var qs=require(_0x3af9('0x13'));var as=require(_0x3af9('0x14'));var hardwareService=require(_0x3af9('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x3af9('0x16'));var config=require(_0x3af9('0x17'));var licenseUtil=require(_0x3af9('0x18'));var db=require(_0x3af9('0x19'))['db'];config[_0x3af9('0x1a')]=_[_0x3af9('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3af9('0x1c'))(new Redis(config[_0x3af9('0x1a')]));require(_0x3af9('0x1d'))['register'](socket);var jayson=require(_0x3af9('0x1e'));var client=jayson[_0x3af9('0x1f')][_0x3af9('0x20')]({'port':0x232c});var client9002=jayson[_0x3af9('0x1f')][_0x3af9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xf12185,_0xd28480,_0x118a87,_0x5d981d){return new BPromise(function(_0xd58173,_0x3bcbfb){var _0x4f66ef=_0x5d981d||client;return _0x4f66ef[_0x3af9('0x21')](_0xf12185,_0x118a87)[_0x3af9('0x22')](function(_0x32c23e){logger['info'](_0x3af9('0x23'),_0xd28480,_0x3af9('0x24'));logger['debug'](_0x3af9('0x25'),_0xd28480,_0x3af9('0x24'),JSON[_0x3af9('0x26')](_0x32c23e));if(_0x32c23e[_0x3af9('0x27')]){if(_0x32c23e[_0x3af9('0x27')][_0x3af9('0x28')]===0x1f4){logger[_0x3af9('0x27')](_0x3af9('0x23'),_0xd28480,_0x32c23e[_0x3af9('0x27')][_0x3af9('0x29')]);return _0x3bcbfb(_0x32c23e[_0x3af9('0x27')][_0x3af9('0x29')]);}logger[_0x3af9('0x27')](_0x3af9('0x23'),_0xd28480,_0x32c23e['error']['message']);return _0xd58173(_0x32c23e['error'][_0x3af9('0x29')]);}else{logger[_0x3af9('0x2a')](_0x3af9('0x23'),_0xd28480,_0x3af9('0x24'));_0xd58173(_0x32c23e['result']['message']);}})[_0x3af9('0x2b')](function(_0x412623){logger[_0x3af9('0x27')](_0x3af9('0x23'),_0xd28480,_0x412623);_0x3bcbfb(_0x412623);});});}function respondWithStatusCode(_0x3c820f,_0x273eca){_0x273eca=_0x273eca||0xcc;return function(_0x4a4585){if(_0x4a4585){return _0x3c820f['sendStatus'](_0x273eca);}return _0x3c820f['status'](_0x273eca)['end']();};}function respondWithResult(_0x4f644f,_0x5e8a98){_0x5e8a98=_0x5e8a98||0xc8;return function(_0x2687e3){if(_0x2687e3){return _0x4f644f[_0x3af9('0x2c')](_0x5e8a98)['json'](_0x2687e3);}};}function respondWithFilteredResult(_0x3719ee,_0x26f7b4){return function(_0x236cf9){if(_0x236cf9){var _0x132903=typeof _0x26f7b4[_0x3af9('0x2d')]===_0x3af9('0x2e')&&typeof _0x26f7b4[_0x3af9('0x2f')]===_0x3af9('0x2e');var _0x45151d=_0x236cf9[_0x3af9('0x30')];var _0x5d6df9=_0x132903?0x0:_0x26f7b4[_0x3af9('0x2d')];var _0x1364f1=_0x132903?_0x236cf9['count']:_0x26f7b4[_0x3af9('0x2d')]+_0x26f7b4[_0x3af9('0x2f')];var _0x41a04e;if(_0x1364f1>=_0x45151d){_0x1364f1=_0x45151d;_0x41a04e=0xc8;}else{_0x41a04e=0xce;}_0x3719ee[_0x3af9('0x2c')](_0x41a04e);return _0x3719ee['set']('Content-Range',_0x5d6df9+'-'+_0x1364f1+'/'+_0x45151d)[_0x3af9('0x31')](_0x236cf9);}return null;};}function patchUpdates(_0x288495){return function(_0x1a3bd2){try{jsonpatch[_0x3af9('0x32')](_0x1a3bd2,_0x288495,!![]);}catch(_0x43fe44){return BPromise[_0x3af9('0x33')](_0x43fe44);}return _0x1a3bd2['save']();};}function saveUpdates(_0x32a914,_0x53b7c8){return function(_0x4e8d64){if(_0x4e8d64){return _0x4e8d64['update'](_0x32a914)[_0x3af9('0x22')](function(_0x467a25){return _0x467a25;});}return null;};}function removeEntity(_0x42e69e,_0x5e224e){return function(_0x245333){if(_0x245333){return _0x245333[_0x3af9('0x34')]()['then'](function(){_0x42e69e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a51a,_0x878786){return function(_0x1b3778){if(!_0x1b3778){_0x23a51a[_0x3af9('0x35')](0x194);}return _0x1b3778;};}function handleError(_0x4ea849,_0x437a03){_0x437a03=_0x437a03||0x1f4;return function(_0x399d65){logger['error'](_0x399d65[_0x3af9('0x36')]);if(_0x399d65[_0x3af9('0x37')]){delete _0x399d65['name'];}_0x4ea849[_0x3af9('0x2c')](_0x437a03)[_0x3af9('0x38')](_0x399d65);};}exports['index']=function(_0x2f23ca,_0x1a103d){var _0x33c0ae={},_0x30389d={},_0x3ef95d={'count':0x0,'rows':[]};var _0x1f4457=_[_0x3af9('0x39')](db[_0x3af9('0x3a')][_0x3af9('0x3b')],function(_0x431463){return{'name':_0x431463[_0x3af9('0x3c')],'type':_0x431463[_0x3af9('0x3d')][_0x3af9('0x3e')]};});_0x30389d['model']=_[_0x3af9('0x39')](_0x1f4457,_0x3af9('0x37'));_0x30389d[_0x3af9('0x3f')]=_['keys'](_0x2f23ca[_0x3af9('0x3f')]);_0x30389d['filters']=_[_0x3af9('0x40')](_0x30389d[_0x3af9('0x41')],_0x30389d['query']);_0x33c0ae['attributes']=_['intersection'](_0x30389d['model'],qs['fields'](_0x2f23ca[_0x3af9('0x3f')][_0x3af9('0x42')]));_0x33c0ae[_0x3af9('0x43')]=_0x33c0ae[_0x3af9('0x43')][_0x3af9('0x44')]?_0x33c0ae[_0x3af9('0x43')]:_0x30389d['model'];if(!_0x2f23ca[_0x3af9('0x3f')][_0x3af9('0x45')](_0x3af9('0x46'))){_0x33c0ae['limit']=qs[_0x3af9('0x2f')](_0x2f23ca['query']['limit']);_0x33c0ae[_0x3af9('0x2d')]=qs[_0x3af9('0x2d')](_0x2f23ca[_0x3af9('0x3f')][_0x3af9('0x2d')]);}_0x33c0ae[_0x3af9('0x47')]=qs[_0x3af9('0x48')](_0x2f23ca[_0x3af9('0x3f')][_0x3af9('0x48')]);_0x33c0ae[_0x3af9('0x49')]=qs[_0x3af9('0x4a')](_['pick'](_0x2f23ca['query'],_0x30389d[_0x3af9('0x4a')]),_0x1f4457);if(_0x2f23ca['query'][_0x3af9('0x4b')]){_0x33c0ae[_0x3af9('0x49')]=_['merge'](_0x33c0ae['where'],{'$or':_[_0x3af9('0x39')](_0x1f4457,function(_0x23e288){if(_0x23e288[_0x3af9('0x3d')]!==_0x3af9('0x4c')){var _0x19d508={};_0x19d508[_0x23e288[_0x3af9('0x37')]]={'$like':'%'+_0x2f23ca[_0x3af9('0x3f')][_0x3af9('0x4b')]+'%'};return _0x19d508;}})});}_0x33c0ae=_['merge']({},_0x33c0ae,_0x2f23ca['options']);var _0x4fe010={'where':_0x33c0ae[_0x3af9('0x49')]};return db[_0x3af9('0x3a')][_0x3af9('0x30')](_0x4fe010)[_0x3af9('0x22')](function(_0x3a9dbc){_0x3ef95d[_0x3af9('0x30')]=_0x3a9dbc;if(_0x2f23ca['query'][_0x3af9('0x4d')]){_0x33c0ae[_0x3af9('0x4e')]=[{'all':!![]}];}return db[_0x3af9('0x3a')][_0x3af9('0x4f')](_0x33c0ae);})[_0x3af9('0x22')](function(_0x7d991c){_0x3ef95d['rows']=_0x7d991c;return _0x3ef95d;})[_0x3af9('0x22')](respondWithFilteredResult(_0x1a103d,_0x33c0ae))['catch'](handleError(_0x1a103d,null));};exports[_0x3af9('0x50')]=function(_0x5da1b5,_0x29e4a9){var _0x51c2b8={'raw':!![],'where':{'id':_0x5da1b5[_0x3af9('0x51')]['id']}},_0x531f4d={};_0x531f4d[_0x3af9('0x41')]=_[_0x3af9('0x52')](db[_0x3af9('0x3a')]['rawAttributes']);_0x531f4d[_0x3af9('0x3f')]=_['keys'](_0x5da1b5[_0x3af9('0x3f')]);_0x531f4d['filters']=_['intersection'](_0x531f4d['model'],_0x531f4d[_0x3af9('0x3f')]);_0x51c2b8[_0x3af9('0x43')]=_[_0x3af9('0x40')](_0x531f4d[_0x3af9('0x41')],qs['fields'](_0x5da1b5[_0x3af9('0x3f')][_0x3af9('0x42')]));_0x51c2b8['attributes']=_0x51c2b8[_0x3af9('0x43')][_0x3af9('0x44')]?_0x51c2b8[_0x3af9('0x43')]:_0x531f4d['model'];if(_0x5da1b5[_0x3af9('0x3f')][_0x3af9('0x4d')]){_0x51c2b8['include']=[{'all':!![]}];}_0x51c2b8=_[_0x3af9('0x53')]({},_0x51c2b8,_0x5da1b5[_0x3af9('0x54')]);return db[_0x3af9('0x3a')][_0x3af9('0x55')](_0x51c2b8)[_0x3af9('0x22')](handleEntityNotFound(_0x29e4a9,null))[_0x3af9('0x22')](respondWithResult(_0x29e4a9,null))[_0x3af9('0x2b')](handleError(_0x29e4a9,null));};exports['create']=function(_0x44c776,_0x564b48){return db[_0x3af9('0x3a')][_0x3af9('0x56')](_0x44c776[_0x3af9('0x57')],{})['then'](respondWithResult(_0x564b48,0xc9))[_0x3af9('0x2b')](handleError(_0x564b48,null));};exports['update']=function(_0x343026,_0x3270b9){if(_0x343026[_0x3af9('0x57')]['id']){delete _0x343026[_0x3af9('0x57')]['id'];}return db[_0x3af9('0x3a')]['find']({'where':{'id':_0x343026[_0x3af9('0x51')]['id']}})[_0x3af9('0x22')](handleEntityNotFound(_0x3270b9,null))['then'](saveUpdates(_0x343026[_0x3af9('0x57')],null))[_0x3af9('0x22')](respondWithResult(_0x3270b9,null))[_0x3af9('0x2b')](handleError(_0x3270b9,null));};exports[_0x3af9('0x34')]=function(_0x1be169,_0x54a205){return db[_0x3af9('0x3a')][_0x3af9('0x55')]({'where':{'id':_0x1be169['params']['id']}})[_0x3af9('0x22')](handleEntityNotFound(_0x54a205,null))['then'](removeEntity(_0x54a205,null))[_0x3af9('0x2b')](handleError(_0x54a205,null));};exports['describe']=function(_0x38a3b3,_0x2d8cba){return db[_0x3af9('0x3a')]['describe']()['then'](respondWithResult(_0x2d8cba,null))[_0x3af9('0x2b')](handleError(_0x2d8cba,null));};var interaction_log=require('../../config/logger')(_0x3af9('0x58'));exports['accept']=function(_0x432053,_0x5391b,_0xf1cbfe){var _0x38c3a0={'agent':{},'channel':_0x3af9('0x59')};if(_0x432053[_0x3af9('0x57')]['id']){delete _0x432053[_0x3af9('0x57')]['id'];}_0x432053['body'][_0x3af9('0x5a')]=!![];_0x432053[_0x3af9('0x57')][_0x3af9('0x5b')]=moment()[_0x3af9('0x5c')](_0x3af9('0x5d'));_0x432053[_0x3af9('0x57')]['UserId']=_0x432053['body'][_0x3af9('0x5e')]||_0x432053[_0x3af9('0x5f')]['id'];_0x38c3a0[_0x3af9('0x60')]['id']=_0x432053[_0x3af9('0x57')][_0x3af9('0x5e')];return db['ChatMessage']['find']({'where':{'id':_0x432053['params']['id'],'UserId':null}})[_0x3af9('0x22')](handleEntityNotFound(_0x5391b,null))[_0x3af9('0x22')](saveUpdates(_0x432053[_0x3af9('0x57')],null))['then'](function(_0x54a74e){if(_0x54a74e){_0x38c3a0[_0x3af9('0x29')]=_0x54a74e[_0x3af9('0x61')]({'plain':!![]});return db[_0x3af9('0x62')][_0x3af9('0x55')]({'where':{'id':_0x54a74e[_0x3af9('0x63')]}});}return null;})[_0x3af9('0x22')](handleEntityNotFound(_0x5391b,null))[_0x3af9('0x22')](function(_0x28e02c){if(_0x28e02c){return _0x28e02c[_0x3af9('0x64')]({'UserId':_0x432053[_0x3af9('0x57')][_0x3af9('0x5e')],'read1stAt':_[_0x3af9('0x65')](_0x28e02c[_0x3af9('0x66')])?moment()[_0x3af9('0x5c')](_0x3af9('0x5d')):undefined});}return null;})[_0x3af9('0x22')](function(_0x11acc7){if(_0x11acc7){_0x38c3a0[_0x3af9('0x67')]=_0x11acc7['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x432053[_0x3af9('0x5f')]['id'],_0x432053[_0x3af9('0x5f')]['name'],_0x432053[_0x3af9('0x5f')][_0x3af9('0x68')],_0x38c3a0[_0x3af9('0x67')]['id'],_0x432053[_0x3af9('0x57')]?JSON[_0x3af9('0x26')](_0x432053['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x3af9('0x69'),_0x38c3a0);}return null;})[_0x3af9('0x22')](function(_0x2e473){var _0x499678='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e473[_0x3af9('0x29')]['ContactId'];return db[_0x3af9('0x6a')][_0x3af9('0x3f')](_0x499678,{'type':db[_0x3af9('0x6b')][_0x3af9('0x6c')][_0x3af9('0x6d')],'raw':!![]})[_0x3af9('0x22')](function(_0x58d4d5){return _0x58d4d5;});})[_0x3af9('0x22')](function(_0x5bb083){if(_0x5bb083){_0x38c3a0[_0x3af9('0x29')][_0x3af9('0x6e')]=_0x5bb083[0x0];if(!_0x432053[_0x3af9('0x57')][_0x3af9('0x5e')])return;return db['User'][_0x3af9('0x55')]({'where':{'id':_0x432053['body'][_0x3af9('0x5e')],'role':_0x3af9('0x60')},'attributes':['id',_0x3af9('0x37'),_0x3af9('0x6f'),_0x3af9('0x70'),_0x3af9('0x71')],'raw':!![]});}return null;})[_0x3af9('0x22')](function(_0x25b96d){if(!_0x25b96d)return null;_0x38c3a0[_0x3af9('0x29')]['agent']=_0x25b96d;return _0x38c3a0;})[_0x3af9('0x22')](function(_0x291358){if(_0x291358){if(_0x432053['body'][_0x3af9('0x72')]){_0x38c3a0[_0x3af9('0x29')][_0x3af9('0x73')]=util[_0x3af9('0x5c')](_0x3af9('0x74'),_0x432053[_0x3af9('0x5f')][_0x3af9('0x37')]);_0x38c3a0[_0x3af9('0x29')][_0x3af9('0x75')]=_0x38c3a0[_0x3af9('0x75')];_0x38c3a0[_0x3af9('0x29')][_0x3af9('0x76')]=_0x38c3a0[_0x3af9('0x75')];_0x38c3a0[_0x3af9('0x29')][_0x3af9('0x77')]=_0x3af9('0x78');return respondWithRpcPromise(_0x3af9('0x79'),_0x3af9('0x79'),{'event':'acceptmessage','message':_[_0x3af9('0x53')](_0x38c3a0['message'],JSON[_0x3af9('0x7a')](_0x38c3a0['interaction'][_0x3af9('0x7b')]))},client9002)[_0x3af9('0x22')](function(){return _0x38c3a0;});}return _0x38c3a0;}return null;})['then'](respondWithResult(_0x5391b,null))['catch'](handleError(_0x5391b,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x3af9('0x33')]=function(_0x2bdeea,_0x4fdf23,_0x22b94a){var _0x4f552b={'agent':{},'channel':'chat'};if(_0x2bdeea[_0x3af9('0x57')]['id']){delete _0x2bdeea[_0x3af9('0x57')]['id'];}_0x2bdeea[_0x3af9('0x57')][_0x3af9('0x5e')]=_0x2bdeea[_0x3af9('0x57')]['UserId']||_0x2bdeea[_0x3af9('0x5f')]['id'];_0x4f552b[_0x3af9('0x60')]['id']=_0x2bdeea['body']['UserId'];return db[_0x3af9('0x3a')][_0x3af9('0x55')]({'where':{'id':_0x2bdeea['params']['id'],'UserId':null}})[_0x3af9('0x22')](handleEntityNotFound(_0x4fdf23,null))['then'](function(_0x31e08e){if(_0x31e08e){_0x4f552b['message']=_0x31e08e[_0x3af9('0x61')]({'plain':!![]});return db[_0x3af9('0x62')][_0x3af9('0x55')]({'where':{'id':_0x31e08e[_0x3af9('0x63')]}});}return null;})[_0x3af9('0x22')](handleEntityNotFound(_0x4fdf23,null))[_0x3af9('0x22')](function(_0x3fd7d4){if(_0x3fd7d4){_0x4f552b['interaction']=_0x3fd7d4[_0x3af9('0x61')]({'plain':!![]});interaction_log[_0x3af9('0x2a')](_0x3af9('0x7c'),_0x2bdeea[_0x3af9('0x5f')]['id'],_0x2bdeea[_0x3af9('0x5f')][_0x3af9('0x37')],_0x2bdeea['user'][_0x3af9('0x68')],_0x4f552b[_0x3af9('0x67')]['id'],_0x2bdeea['body']?JSON[_0x3af9('0x26')](_0x2bdeea['body']):_0x3af9('0x7d'));return respondWithRpcPromise(_0x3af9('0x7e'),'rejectMessage',_0x4f552b);}return null;})[_0x3af9('0x22')](function(_0x356b6e){var _0x52946e=_0x3af9('0x7f')+_0x356b6e[_0x3af9('0x29')]['ContactId'];return db['sequelize'][_0x3af9('0x3f')](_0x52946e,{'type':db[_0x3af9('0x6b')][_0x3af9('0x6c')][_0x3af9('0x6d')],'raw':!![]})[_0x3af9('0x22')](function(_0x52706c){return _0x52706c;});})[_0x3af9('0x22')](function(_0x23d834){if(_0x23d834){_0x4f552b[_0x3af9('0x29')][_0x3af9('0x6e')]=_0x23d834[0x0];if(!_0x2bdeea['body']['UserId'])return;return db[_0x3af9('0x80')][_0x3af9('0x55')]({'where':{'id':_0x2bdeea[_0x3af9('0x57')]['UserId'],'role':_0x3af9('0x60')},'attributes':['id',_0x3af9('0x37'),_0x3af9('0x6f'),_0x3af9('0x70'),'internal'],'raw':!![]});}return null;})[_0x3af9('0x22')](function(_0x415312){if(!_0x415312)return null;_0x4f552b['message']['agent']=_0x415312;return _0x4f552b;})[_0x3af9('0x22')](function(_0x4e1eff){if(_0x4e1eff){_0x4e1eff['message'][_0x3af9('0x73')]=util[_0x3af9('0x5c')](_0x3af9('0x74'),_0x2bdeea[_0x3af9('0x5f')][_0x3af9('0x37')]);_0x4e1eff[_0x3af9('0x29')][_0x3af9('0x75')]=_0x4f552b[_0x3af9('0x75')];_0x4e1eff[_0x3af9('0x29')][_0x3af9('0x76')]=_0x4f552b[_0x3af9('0x75')];_0x4e1eff[_0x3af9('0x29')]['event']=_0x3af9('0x33');respondWithRpcPromise(_0x3af9('0x79'),'EventManager',{'event':_0x3af9('0x81'),'message':_['merge'](_0x4f552b[_0x3af9('0x29')],JSON[_0x3af9('0x7a')](_0x4f552b[_0x3af9('0x67')]['formData']))},client9002);return _0x4f552b;}return null;})['then'](respondWithResult(_0x4fdf23,null))[_0x3af9('0x2b')](handleError(_0x4fdf23,null));};
\ No newline at end of file
+var _0x31d5=['User','fullname','manual','interface','format','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','Sequelize','email','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','ChatMessage','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','show','params','merge','find','create','body','update','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT'];(function(_0x3684b6,_0x3da85e){var _0x39f06b=function(_0x5b4565){while(--_0x5b4565){_0x3684b6['push'](_0x3684b6['shift']());}};_0x39f06b(++_0x3da85e);}(_0x31d5,0x1ab));var _0x531d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x31d5[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x531d('0x0'));var rimraf=require(_0x531d('0x1'));var zipdir=require(_0x531d('0x2'));var jsonpatch=require(_0x531d('0x3'));var rp=require(_0x531d('0x4'));var moment=require(_0x531d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x531d('0x6'));var util=require(_0x531d('0x7'));var path=require(_0x531d('0x8'));var sox=require(_0x531d('0x9'));var csv=require('to-csv');var ejs=require(_0x531d('0xa'));var fs=require('fs');var fs_extra=require(_0x531d('0xb'));var _=require(_0x531d('0xc'));var squel=require('squel');var crypto=require(_0x531d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x531d('0xe'));var toCsv=require(_0x531d('0xf'));var querystring=require(_0x531d('0x10'));var Papa=require('papaparse');var Redis=require(_0x531d('0x11'));var authService=require(_0x531d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x531d('0x13'));var hardwareService=require(_0x531d('0x14'));var logger=require(_0x531d('0x15'))(_0x531d('0x16'));var utils=require(_0x531d('0x17'));var config=require(_0x531d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x531d('0x19')]=_[_0x531d('0x1a')](config['redis'],{'host':_0x531d('0x1b'),'port':0x18eb});var socket=require(_0x531d('0x1c'))(new Redis(config[_0x531d('0x19')]));require(_0x531d('0x1d'))[_0x531d('0x1e')](socket);var jayson=require(_0x531d('0x1f'));var client=jayson[_0x531d('0x20')][_0x531d('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x531d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1a194a,_0x1862cf,_0x32386d,_0x52f491){return new BPromise(function(_0x1302e0,_0x36ea8c){var _0x3a73f4=_0x52f491||client;return _0x3a73f4[_0x531d('0x22')](_0x1a194a,_0x32386d)['then'](function(_0x468fde){logger[_0x531d('0x23')](_0x531d('0x24'),_0x1862cf,'request\x20sent');logger[_0x531d('0x25')](_0x531d('0x26'),_0x1862cf,_0x531d('0x27'),JSON[_0x531d('0x28')](_0x468fde));if(_0x468fde[_0x531d('0x29')]){if(_0x468fde[_0x531d('0x29')][_0x531d('0x2a')]===0x1f4){logger['error'](_0x531d('0x24'),_0x1862cf,_0x468fde['error'][_0x531d('0x2b')]);return _0x36ea8c(_0x468fde[_0x531d('0x29')][_0x531d('0x2b')]);}logger['error'](_0x531d('0x24'),_0x1862cf,_0x468fde[_0x531d('0x29')][_0x531d('0x2b')]);return _0x1302e0(_0x468fde[_0x531d('0x29')][_0x531d('0x2b')]);}else{logger[_0x531d('0x23')](_0x531d('0x24'),_0x1862cf,_0x531d('0x27'));_0x1302e0(_0x468fde[_0x531d('0x2c')]['message']);}})[_0x531d('0x2d')](function(_0x2239ac){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1862cf,_0x2239ac);_0x36ea8c(_0x2239ac);});});}function respondWithStatusCode(_0x205fee,_0x2bb346){_0x2bb346=_0x2bb346||0xcc;return function(_0x582f4a){if(_0x582f4a){return _0x205fee['sendStatus'](_0x2bb346);}return _0x205fee[_0x531d('0x2e')](_0x2bb346)[_0x531d('0x2f')]();};}function respondWithResult(_0x548f22,_0x3c6456){_0x3c6456=_0x3c6456||0xc8;return function(_0x38a65b){if(_0x38a65b){return _0x548f22[_0x531d('0x2e')](_0x3c6456)[_0x531d('0x30')](_0x38a65b);}};}function respondWithFilteredResult(_0x436b96,_0x632efb){return function(_0x36e9f9){if(_0x36e9f9){var _0x28085a=typeof _0x632efb['offset']===_0x531d('0x31')&&typeof _0x632efb[_0x531d('0x32')]===_0x531d('0x31');var _0x4eb7f2=_0x36e9f9[_0x531d('0x33')];var _0x103adc=_0x28085a?0x0:_0x632efb[_0x531d('0x34')];var _0x2de0ed=_0x28085a?_0x36e9f9[_0x531d('0x33')]:_0x632efb[_0x531d('0x34')]+_0x632efb[_0x531d('0x32')];var _0x236eff;if(_0x2de0ed>=_0x4eb7f2){_0x2de0ed=_0x4eb7f2;_0x236eff=0xc8;}else{_0x236eff=0xce;}_0x436b96['status'](_0x236eff);return _0x436b96[_0x531d('0x35')](_0x531d('0x36'),_0x103adc+'-'+_0x2de0ed+'/'+_0x4eb7f2)['json'](_0x36e9f9);}return null;};}function patchUpdates(_0x1491c3){return function(_0xe2b6e){try{jsonpatch[_0x531d('0x37')](_0xe2b6e,_0x1491c3,!![]);}catch(_0x24cf89){return BPromise[_0x531d('0x38')](_0x24cf89);}return _0xe2b6e[_0x531d('0x39')]();};}function saveUpdates(_0xc9554e,_0x25ded4){return function(_0x4e17d1){if(_0x4e17d1){return _0x4e17d1['update'](_0xc9554e)[_0x531d('0x3a')](function(_0x3462b6){return _0x3462b6;});}return null;};}function removeEntity(_0x36e00d,_0x38e8f1){return function(_0x11ab14){if(_0x11ab14){return _0x11ab14[_0x531d('0x3b')]()[_0x531d('0x3a')](function(){_0x36e00d[_0x531d('0x2e')](0xcc)[_0x531d('0x2f')]();});}};}function handleEntityNotFound(_0x4d5743,_0x5227fd){return function(_0x198ffb){if(!_0x198ffb){_0x4d5743[_0x531d('0x3c')](0x194);}return _0x198ffb;};}function handleError(_0x1eadcb,_0x3e5999){_0x3e5999=_0x3e5999||0x1f4;return function(_0x1f518f){logger[_0x531d('0x29')](_0x1f518f[_0x531d('0x3d')]);if(_0x1f518f[_0x531d('0x3e')]){delete _0x1f518f[_0x531d('0x3e')];}_0x1eadcb['status'](_0x3e5999)[_0x531d('0x3f')](_0x1f518f);};}exports[_0x531d('0x40')]=function(_0x5e83a5,_0x36cd56){var _0x15b3e5={},_0x20fac9={},_0x485871={'count':0x0,'rows':[]};var _0x244303=_['map'](db[_0x531d('0x41')]['rawAttributes'],function(_0xd53f1d){return{'name':_0xd53f1d[_0x531d('0x42')],'type':_0xd53f1d[_0x531d('0x43')][_0x531d('0x44')]};});_0x20fac9[_0x531d('0x45')]=_[_0x531d('0x46')](_0x244303,_0x531d('0x3e'));_0x20fac9[_0x531d('0x47')]=_[_0x531d('0x48')](_0x5e83a5[_0x531d('0x47')]);_0x20fac9[_0x531d('0x49')]=_['intersection'](_0x20fac9['model'],_0x20fac9[_0x531d('0x47')]);_0x15b3e5[_0x531d('0x4a')]=_[_0x531d('0x4b')](_0x20fac9[_0x531d('0x45')],qs['fields'](_0x5e83a5['query'][_0x531d('0x4c')]));_0x15b3e5['attributes']=_0x15b3e5[_0x531d('0x4a')][_0x531d('0x4d')]?_0x15b3e5['attributes']:_0x20fac9[_0x531d('0x45')];if(!_0x5e83a5[_0x531d('0x47')][_0x531d('0x4e')](_0x531d('0x4f'))){_0x15b3e5[_0x531d('0x32')]=qs[_0x531d('0x32')](_0x5e83a5[_0x531d('0x47')][_0x531d('0x32')]);_0x15b3e5[_0x531d('0x34')]=qs[_0x531d('0x34')](_0x5e83a5[_0x531d('0x47')][_0x531d('0x34')]);}_0x15b3e5[_0x531d('0x50')]=qs['sort'](_0x5e83a5[_0x531d('0x47')][_0x531d('0x51')]);_0x15b3e5[_0x531d('0x52')]=qs[_0x531d('0x49')](_[_0x531d('0x53')](_0x5e83a5[_0x531d('0x47')],_0x20fac9['filters']),_0x244303);if(_0x5e83a5[_0x531d('0x47')][_0x531d('0x54')]){_0x15b3e5[_0x531d('0x52')]=_['merge'](_0x15b3e5['where'],{'$or':_[_0x531d('0x46')](_0x244303,function(_0x4a146f){if(_0x4a146f[_0x531d('0x43')]!==_0x531d('0x55')){var _0x5ccdd9={};_0x5ccdd9[_0x4a146f[_0x531d('0x3e')]]={'$like':'%'+_0x5e83a5[_0x531d('0x47')][_0x531d('0x54')]+'%'};return _0x5ccdd9;}})});}_0x15b3e5=_['merge']({},_0x15b3e5,_0x5e83a5[_0x531d('0x56')]);var _0xce549c={'where':_0x15b3e5['where']};return db[_0x531d('0x41')][_0x531d('0x33')](_0xce549c)[_0x531d('0x3a')](function(_0x4ce359){_0x485871['count']=_0x4ce359;if(_0x5e83a5[_0x531d('0x47')][_0x531d('0x57')]){_0x15b3e5[_0x531d('0x58')]=[{'all':!![]}];}return db[_0x531d('0x41')][_0x531d('0x59')](_0x15b3e5);})[_0x531d('0x3a')](function(_0x4d62fe){_0x485871['rows']=_0x4d62fe;return _0x485871;})[_0x531d('0x3a')](respondWithFilteredResult(_0x36cd56,_0x15b3e5))[_0x531d('0x2d')](handleError(_0x36cd56,null));};exports[_0x531d('0x5a')]=function(_0x335def,_0x25c1d1){var _0x216581={'raw':!![],'where':{'id':_0x335def[_0x531d('0x5b')]['id']}},_0x24a049={};_0x24a049[_0x531d('0x45')]=_[_0x531d('0x48')](db[_0x531d('0x41')]['rawAttributes']);_0x24a049['query']=_[_0x531d('0x48')](_0x335def[_0x531d('0x47')]);_0x24a049[_0x531d('0x49')]=_[_0x531d('0x4b')](_0x24a049[_0x531d('0x45')],_0x24a049['query']);_0x216581['attributes']=_[_0x531d('0x4b')](_0x24a049['model'],qs[_0x531d('0x4c')](_0x335def[_0x531d('0x47')][_0x531d('0x4c')]));_0x216581[_0x531d('0x4a')]=_0x216581['attributes'][_0x531d('0x4d')]?_0x216581[_0x531d('0x4a')]:_0x24a049[_0x531d('0x45')];if(_0x335def['query'][_0x531d('0x57')]){_0x216581['include']=[{'all':!![]}];}_0x216581=_[_0x531d('0x5c')]({},_0x216581,_0x335def['options']);return db['ChatMessage'][_0x531d('0x5d')](_0x216581)[_0x531d('0x3a')](handleEntityNotFound(_0x25c1d1,null))['then'](respondWithResult(_0x25c1d1,null))[_0x531d('0x2d')](handleError(_0x25c1d1,null));};exports[_0x531d('0x5e')]=function(_0x51a119,_0xc09bfe){return db['ChatMessage'][_0x531d('0x5e')](_0x51a119[_0x531d('0x5f')],{})[_0x531d('0x3a')](respondWithResult(_0xc09bfe,0xc9))[_0x531d('0x2d')](handleError(_0xc09bfe,null));};exports[_0x531d('0x60')]=function(_0x1981d0,_0x1ee0c1){if(_0x1981d0[_0x531d('0x5f')]['id']){delete _0x1981d0[_0x531d('0x5f')]['id'];}return db[_0x531d('0x41')][_0x531d('0x5d')]({'where':{'id':_0x1981d0[_0x531d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1ee0c1,null))[_0x531d('0x3a')](saveUpdates(_0x1981d0['body'],null))['then'](respondWithResult(_0x1ee0c1,null))[_0x531d('0x2d')](handleError(_0x1ee0c1,null));};exports[_0x531d('0x3b')]=function(_0x370604,_0x110068){return db['ChatMessage'][_0x531d('0x5d')]({'where':{'id':_0x370604['params']['id']}})[_0x531d('0x3a')](handleEntityNotFound(_0x110068,null))['then'](removeEntity(_0x110068,null))[_0x531d('0x2d')](handleError(_0x110068,null));};exports[_0x531d('0x61')]=function(_0x453391,_0x120982){return db[_0x531d('0x41')]['describe']()['then'](respondWithResult(_0x120982,null))[_0x531d('0x2d')](handleError(_0x120982,null));};var interaction_log=require(_0x531d('0x15'))(_0x531d('0x62'));exports['accept']=function(_0x3f97e5,_0x41b6cf,_0x58a56c){var _0x43089b={'agent':{},'channel':_0x531d('0x63')};if(_0x3f97e5['body']['id']){delete _0x3f97e5[_0x531d('0x5f')]['id'];}_0x3f97e5[_0x531d('0x5f')][_0x531d('0x64')]=!![];_0x3f97e5[_0x531d('0x5f')][_0x531d('0x65')]=moment()['format'](_0x531d('0x66'));_0x3f97e5[_0x531d('0x5f')]['UserId']=_0x3f97e5[_0x531d('0x5f')][_0x531d('0x67')]||_0x3f97e5[_0x531d('0x68')]['id'];_0x43089b[_0x531d('0x69')]['id']=_0x3f97e5[_0x531d('0x5f')][_0x531d('0x67')];return db['ChatMessage'][_0x531d('0x5d')]({'where':{'id':_0x3f97e5['params']['id'],'UserId':null}})[_0x531d('0x3a')](handleEntityNotFound(_0x41b6cf,null))[_0x531d('0x3a')](saveUpdates(_0x3f97e5[_0x531d('0x5f')],null))[_0x531d('0x3a')](function(_0x407fb8){if(_0x407fb8){_0x43089b[_0x531d('0x2b')]=_0x407fb8[_0x531d('0x6a')]({'plain':!![]});return db[_0x531d('0x6b')][_0x531d('0x5d')]({'where':{'id':_0x407fb8[_0x531d('0x6c')]}});}return null;})[_0x531d('0x3a')](handleEntityNotFound(_0x41b6cf,null))[_0x531d('0x3a')](function(_0x439607){if(_0x439607){return _0x439607[_0x531d('0x60')]({'UserId':_0x3f97e5['body'][_0x531d('0x67')],'read1stAt':_[_0x531d('0x6d')](_0x439607[_0x531d('0x6e')])?moment()['format'](_0x531d('0x66')):undefined});}return null;})[_0x531d('0x3a')](function(_0x2bc8a0){if(_0x2bc8a0){_0x43089b[_0x531d('0x6f')]=_0x2bc8a0[_0x531d('0x6a')]({'plain':!![]});interaction_log[_0x531d('0x23')](_0x531d('0x70'),_0x3f97e5[_0x531d('0x68')]['id'],_0x3f97e5[_0x531d('0x68')][_0x531d('0x3e')],_0x3f97e5['user'][_0x531d('0x71')],_0x43089b[_0x531d('0x6f')]['id'],_0x3f97e5[_0x531d('0x5f')]?JSON[_0x531d('0x28')](_0x3f97e5['body']):_0x531d('0x72'));return respondWithRpcPromise(_0x531d('0x73'),_0x531d('0x74'),_0x43089b);}return null;})[_0x531d('0x3a')](function(_0x468741){var _0xf99428='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x468741[_0x531d('0x2b')][_0x531d('0x75')];return db[_0x531d('0x76')][_0x531d('0x47')](_0xf99428,{'type':db['Sequelize'][_0x531d('0x77')][_0x531d('0x78')],'raw':!![]})[_0x531d('0x3a')](function(_0x15cc93){return _0x15cc93;});})[_0x531d('0x3a')](function(_0x28a57e){if(_0x28a57e){_0x43089b[_0x531d('0x2b')]['contact']=_0x28a57e[0x0];if(!_0x3f97e5['body'][_0x531d('0x67')])return;return db[_0x531d('0x79')][_0x531d('0x5d')]({'where':{'id':_0x3f97e5[_0x531d('0x5f')][_0x531d('0x67')],'role':_0x531d('0x69')},'attributes':['id',_0x531d('0x3e'),_0x531d('0x7a'),'email','internal'],'raw':!![]});}return null;})[_0x531d('0x3a')](function(_0x343488){if(!_0x343488)return null;_0x43089b['message'][_0x531d('0x69')]=_0x343488;return _0x43089b;})['then'](function(_0x532586){if(_0x532586){if(_0x3f97e5[_0x531d('0x5f')][_0x531d('0x7b')]){_0x43089b[_0x531d('0x2b')][_0x531d('0x7c')]=util[_0x531d('0x7d')](_0x531d('0x7e'),_0x3f97e5[_0x531d('0x68')][_0x531d('0x3e')]);_0x43089b[_0x531d('0x2b')]['channel']=_0x43089b[_0x531d('0x7f')];_0x43089b[_0x531d('0x2b')][_0x531d('0x80')]=_0x43089b[_0x531d('0x7f')];_0x43089b['message'][_0x531d('0x81')]=_0x531d('0x82');return respondWithRpcPromise('EventManager',_0x531d('0x83'),{'event':_0x531d('0x84'),'message':_['merge'](_0x43089b['message'],JSON['parse'](_0x43089b[_0x531d('0x6f')][_0x531d('0x85')]))},client9002)['then'](function(){return _0x43089b;});}return _0x43089b;}return null;})[_0x531d('0x3a')](respondWithResult(_0x41b6cf,null))[_0x531d('0x2d')](handleError(_0x41b6cf,null));};var interaction_log=require(_0x531d('0x15'))('chat-interactions');exports[_0x531d('0x38')]=function(_0xe4585a,_0x3c9aa6,_0x29c6db){var _0x536d45={'agent':{},'channel':'chat'};if(_0xe4585a[_0x531d('0x5f')]['id']){delete _0xe4585a[_0x531d('0x5f')]['id'];}_0xe4585a[_0x531d('0x5f')][_0x531d('0x67')]=_0xe4585a[_0x531d('0x5f')][_0x531d('0x67')]||_0xe4585a[_0x531d('0x68')]['id'];_0x536d45[_0x531d('0x69')]['id']=_0xe4585a[_0x531d('0x5f')][_0x531d('0x67')];return db[_0x531d('0x41')][_0x531d('0x5d')]({'where':{'id':_0xe4585a[_0x531d('0x5b')]['id'],'UserId':null}})[_0x531d('0x3a')](handleEntityNotFound(_0x3c9aa6,null))[_0x531d('0x3a')](function(_0x3d7cd3){if(_0x3d7cd3){_0x536d45[_0x531d('0x2b')]=_0x3d7cd3[_0x531d('0x6a')]({'plain':!![]});return db[_0x531d('0x6b')][_0x531d('0x5d')]({'where':{'id':_0x3d7cd3['ChatInteractionId']}});}return null;})[_0x531d('0x3a')](handleEntityNotFound(_0x3c9aa6,null))[_0x531d('0x3a')](function(_0x1b4a27){if(_0x1b4a27){_0x536d45[_0x531d('0x6f')]=_0x1b4a27['get']({'plain':!![]});interaction_log[_0x531d('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe4585a[_0x531d('0x68')]['id'],_0xe4585a[_0x531d('0x68')]['name'],_0xe4585a[_0x531d('0x68')][_0x531d('0x71')],_0x536d45['interaction']['id'],_0xe4585a[_0x531d('0x5f')]?JSON['stringify'](_0xe4585a[_0x531d('0x5f')]):_0x531d('0x72'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x536d45);}return null;})[_0x531d('0x3a')](function(_0x426cfc){var _0x5c31b6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x426cfc[_0x531d('0x2b')][_0x531d('0x75')];return db[_0x531d('0x76')][_0x531d('0x47')](_0x5c31b6,{'type':db[_0x531d('0x86')][_0x531d('0x77')][_0x531d('0x78')],'raw':!![]})['then'](function(_0x19ec74){return _0x19ec74;});})[_0x531d('0x3a')](function(_0x37218d){if(_0x37218d){_0x536d45[_0x531d('0x2b')]['contact']=_0x37218d[0x0];if(!_0xe4585a[_0x531d('0x5f')][_0x531d('0x67')])return;return db[_0x531d('0x79')][_0x531d('0x5d')]({'where':{'id':_0xe4585a[_0x531d('0x5f')][_0x531d('0x67')],'role':_0x531d('0x69')},'attributes':['id',_0x531d('0x3e'),_0x531d('0x7a'),_0x531d('0x87'),'internal'],'raw':!![]});}return null;})[_0x531d('0x3a')](function(_0x1e1842){if(!_0x1e1842)return null;_0x536d45['message'][_0x531d('0x69')]=_0x1e1842;return _0x536d45;})[_0x531d('0x3a')](function(_0x567129){if(_0x567129){_0x567129[_0x531d('0x2b')][_0x531d('0x7c')]=util[_0x531d('0x7d')](_0x531d('0x7e'),_0xe4585a['user'][_0x531d('0x3e')]);_0x567129[_0x531d('0x2b')][_0x531d('0x7f')]=_0x536d45[_0x531d('0x7f')];_0x567129[_0x531d('0x2b')][_0x531d('0x80')]=_0x536d45[_0x531d('0x7f')];_0x567129[_0x531d('0x2b')]['event']=_0x531d('0x38');respondWithRpcPromise(_0x531d('0x83'),_0x531d('0x83'),{'event':'rejectmessage','message':_[_0x531d('0x5c')](_0x536d45[_0x531d('0x2b')],JSON[_0x531d('0x88')](_0x536d45['interaction'][_0x531d('0x85')]))},client9002);return _0x536d45;}return null;})[_0x531d('0x3a')](respondWithResult(_0x3c9aa6,null))['catch'](handleError(_0x3c9aa6,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 3342945..a9d334a 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 _0xb8ec=['exports','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x24d1c8,_0x2e0c6f){var _0x4ec82c=function(_0x100286){while(--_0x100286){_0x24d1c8['push'](_0x24d1c8['shift']());}};_0x4ec82c(++_0x2e0c6f);}(_0xb8ec,0x19b));var _0xcb8e=function(_0x49b06a,_0x1fa4ef){_0x49b06a=_0x49b06a-0x0;var _0x17899d=_0xb8ec[_0x49b06a];return _0x17899d;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xcb8e('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcb8e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x9bf781){return function(_0x48e757,_0x236ca8,_0x589706){ChatMessageEvents[_0xcb8e('0x2')](_0x9bf781+':'+_0x48e757['id'],_0x48e757);ChatMessageEvents[_0xcb8e('0x2')](_0x9bf781,_0x48e757);_0x589706(null);};}for(var e in events){if(events[_0xcb8e('0x3')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xcb8e('0x4')]=ChatMessageEvents;
\ No newline at end of file
+var _0xa047=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0xa047,0x9f));var _0x7a04=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xa047[_0x19a49f];return _0x5351ae;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7a04('0x0'))['db'][_0x7a04('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7a04('0x2')](0x0);var events={'afterCreate':_0x7a04('0x3'),'afterUpdate':'update','afterDestroy':_0x7a04('0x4')};function emitEvent(_0x2c9652){return function(_0x296a0b,_0x405662,_0x51974c){ChatMessageEvents[_0x7a04('0x5')](_0x2c9652+':'+_0x296a0b['id'],_0x296a0b);ChatMessageEvents[_0x7a04('0x5')](_0x2c9652,_0x296a0b);_0x51974c(null);};}for(var e in events){if(events[_0x7a04('0x6')](e)){var event=events[e];ChatMessage[_0x7a04('0x7')](e,emitEvent(event));}}module[_0x7a04('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5c5d53a..3c87724 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 _0xea81=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','direction','toLowerCase','out','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4313b7,_0x48641c){var _0x57dbbe=function(_0x500936){while(--_0x500936){_0x4313b7['push'](_0x4313b7['shift']());}};_0x57dbbe(++_0x48641c);}(_0xea81,0x1ed));var _0x1ea8=function(_0x24c287,_0x3185ec){_0x24c287=_0x24c287-0x0;var _0xefa78d=_0xea81[_0x24c287];return _0xefa78d;};'use strict';var _=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var logger=require(_0x1ea8('0x2'))(_0x1ea8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ea8('0x4'));var fs=require('fs');var path=require(_0x1ea8('0x5'));var rimraf=require(_0x1ea8('0x6'));var config=require(_0x1ea8('0x7'));var attributes=require(_0x1ea8('0x8'));module['exports']=function(_0x486b32,_0x5f4538){return _0x486b32[_0x1ea8('0x9')](_0x1ea8('0xa'),attributes,{'tableName':_0x1ea8('0xb'),'paranoid':![],'indexes':[{'name':_0x1ea8('0xc'),'fields':['body'],'type':_0x1ea8('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c48ce,_0x35160b,_0x432447){var _0x495092=_0x486b32['models'];var _0x5be789=_0x2c48ce['get']({'plain':!![]});if(_0x5be789[_0x1ea8('0xe')][_0x1ea8('0xf')]()==='in'||_0x5be789[_0x1ea8('0xe')][_0x1ea8('0xf')]()===_0x1ea8('0x10')&&!_0x5be789['secret']&&!_['isNil'](_0x5be789[_0x1ea8('0x11')])){_0x495092[_0x1ea8('0x12')]['findOne']({'where':{'id':_0x5be789[_0x1ea8('0x13')]}})[_0x1ea8('0x14')](function(_0x97d328){if(_0x97d328){_0x97d328[_0x1ea8('0x15')]({'lastMsgAt':_0x5be789[_0x1ea8('0x16')],'lastMsgDirection':_0x5be789['direction'][_0x1ea8('0xf')]()});}})[_0x1ea8('0x17')](function(_0x3e072d){console['error'](_0x3e072d);});}_0x432447();}},'charset':_0x1ea8('0x18'),'collate':_0x1ea8('0x19')});};
\ No newline at end of file
+var _0x323f=['FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x323f,0xde));var _0xf323=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x323f[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require('moment');var BPromise=require(_0xf323('0x2'));var rp=require(_0xf323('0x3'));var fs=require('fs');var path=require(_0xf323('0x4'));var rimraf=require(_0xf323('0x5'));var config=require('../../config/environment');var attributes=require(_0xf323('0x6'));module['exports']=function(_0x3917ae,_0x1d6d5f){return _0x3917ae[_0xf323('0x7')](_0xf323('0x8'),attributes,{'tableName':_0xf323('0x9'),'paranoid':![],'indexes':[{'name':_0xf323('0xa'),'fields':[_0xf323('0xb')],'type':_0xf323('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2223b0,_0x4b9f24,_0x1fe8d3){var _0x5335d4=_0x3917ae['models'];var _0x59fd25=_0x2223b0[_0xf323('0xd')]({'plain':!![]});if(_0x59fd25[_0xf323('0xe')][_0xf323('0xf')]()==='in'||_0x59fd25['direction'][_0xf323('0xf')]()===_0xf323('0x10')&&!_0x59fd25['secret']&&!_[_0xf323('0x11')](_0x59fd25[_0xf323('0x12')])){_0x5335d4[_0xf323('0x13')][_0xf323('0x14')]({'where':{'id':_0x59fd25[_0xf323('0x15')]}})[_0xf323('0x16')](function(_0x5a6888){if(_0x5a6888){_0x5a6888[_0xf323('0x17')]({'lastMsgAt':_0x59fd25[_0xf323('0x18')],'lastMsgDirection':_0x59fd25[_0xf323('0xe')][_0xf323('0xf')]()});}})['catch'](function(_0x4053bf){console['error'](_0x4053bf);});}_0x1fe8d3();}},'charset':'utf8mb4','collate':_0xf323('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4ab0136..e134a04 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 _0xe7ac=['http','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xa4a442,_0x766162){var _0x3486f5=function(_0x2094f5){while(--_0x2094f5){_0xa4a442['push'](_0xa4a442['shift']());}};_0x3486f5(++_0x766162);}(_0xe7ac,0xd0));var _0xce7a=function(_0x26b367,_0x158299){_0x26b367=_0x26b367-0x0;var _0x5a7c9f=_0xe7ac[_0x26b367];return _0x5a7c9f;};'use strict';var _=require(_0xce7a('0x0'));var util=require('util');var moment=require(_0xce7a('0x1'));var BPromise=require(_0xce7a('0x2'));var rs=require(_0xce7a('0x3'));var fs=require('fs');var Redis=require(_0xce7a('0x4'));var db=require(_0xce7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xce7a('0x6'))(_0xce7a('0x7'));var config=require(_0xce7a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xce7a('0x9')]({'port':0x232a});config['redis']=_[_0xce7a('0xa')](config['redis'],{'host':_0xce7a('0xb'),'port':0x18eb});var socket=require(_0xce7a('0xc'))(new Redis(config[_0xce7a('0xd')]));require(_0xce7a('0xe'))['register'](socket);function respondWithRpcPromise(_0x729c46,_0x5bb33e,_0x16e575){return new BPromise(function(_0x2190bf,_0x4f4752){return client['request'](_0x729c46,_0x16e575)[_0xce7a('0xf')](function(_0x4ce59e){logger['info'](_0xce7a('0x10'),_0x5bb33e,_0xce7a('0x11'));logger[_0xce7a('0x12')](_0xce7a('0x13'),_0x5bb33e,'request\x20sent',JSON[_0xce7a('0x14')](_0x4ce59e));if(_0x4ce59e[_0xce7a('0x15')]){if(_0x4ce59e[_0xce7a('0x15')][_0xce7a('0x16')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5bb33e,_0x4ce59e[_0xce7a('0x15')]['message']);return _0x4f4752(_0x4ce59e[_0xce7a('0x15')][_0xce7a('0x17')]);}logger[_0xce7a('0x15')](_0xce7a('0x10'),_0x5bb33e,_0x4ce59e[_0xce7a('0x15')][_0xce7a('0x17')]);return _0x2190bf(_0x4ce59e[_0xce7a('0x15')][_0xce7a('0x17')]);}else{logger[_0xce7a('0x18')](_0xce7a('0x10'),_0x5bb33e,'request\x20sent');_0x2190bf(_0x4ce59e[_0xce7a('0x19')][_0xce7a('0x17')]);}})[_0xce7a('0x1a')](function(_0x26a50e){logger['error'](_0xce7a('0x10'),_0x5bb33e,_0x26a50e);_0x4f4752(_0x26a50e);});});}exports[_0xce7a('0x1b')]=function(_0x1244f8){var _0x170862=this;return new Promise(function(_0x5ddbc9,_0x374944){return db[_0xce7a('0x1c')][_0xce7a('0x1d')](_0x1244f8['body'],{'raw':_0x1244f8[_0xce7a('0x1e')]?_0x1244f8[_0xce7a('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xce7a('0xf')](function(_0xab77ba){logger[_0xce7a('0x18')](_0xce7a('0x1b'),_0x1244f8);logger[_0xce7a('0x12')]('CreateChatMessage',_0x1244f8,JSON[_0xce7a('0x14')](_0xab77ba));_0x5ddbc9(_0xab77ba);})[_0xce7a('0x1a')](function(_0x18266b){logger[_0xce7a('0x15')]('CreateChatMessage',_0x18266b[_0xce7a('0x17')],_0x1244f8);_0x374944(_0x170862['error'](0x1f4,_0x18266b[_0xce7a('0x17')]));});});};
\ No newline at end of file
+var _0x6d27=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register'];(function(_0x5f534f,_0x59a38e){var _0x467679=function(_0x43a53c){while(--_0x43a53c){_0x5f534f['push'](_0x5f534f['shift']());}};_0x467679(++_0x59a38e);}(_0x6d27,0x15b));var _0x76d2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6d27[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x76d2('0x0'));var util=require(_0x76d2('0x1'));var moment=require(_0x76d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x76d2('0x3'));var fs=require('fs');var Redis=require(_0x76d2('0x4'));var db=require(_0x76d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x76d2('0x6'))(_0x76d2('0x7'));var config=require(_0x76d2('0x8'));var jayson=require(_0x76d2('0x9'));var client=jayson[_0x76d2('0xa')][_0x76d2('0xb')]({'port':0x232a});config[_0x76d2('0xc')]=_[_0x76d2('0xd')](config['redis'],{'host':_0x76d2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76d2('0xc')]));require('./chatMessage.socket')[_0x76d2('0xf')](socket);function respondWithRpcPromise(_0x1eb87c,_0x38b1bd,_0xb6221){return new BPromise(function(_0x5aa6bf,_0x4a32f8){return client['request'](_0x1eb87c,_0xb6221)['then'](function(_0xc2ca3){logger['info']('ChatMessage,\x20%s,\x20%s',_0x38b1bd,'request\x20sent');logger[_0x76d2('0x10')](_0x76d2('0x11'),_0x38b1bd,_0x76d2('0x12'),JSON['stringify'](_0xc2ca3));if(_0xc2ca3[_0x76d2('0x13')]){if(_0xc2ca3[_0x76d2('0x13')][_0x76d2('0x14')]===0x1f4){logger['error'](_0x76d2('0x15'),_0x38b1bd,_0xc2ca3['error'][_0x76d2('0x16')]);return _0x4a32f8(_0xc2ca3['error'][_0x76d2('0x16')]);}logger[_0x76d2('0x13')](_0x76d2('0x15'),_0x38b1bd,_0xc2ca3['error'][_0x76d2('0x16')]);return _0x5aa6bf(_0xc2ca3[_0x76d2('0x13')]['message']);}else{logger[_0x76d2('0x17')](_0x76d2('0x15'),_0x38b1bd,_0x76d2('0x12'));_0x5aa6bf(_0xc2ca3[_0x76d2('0x18')][_0x76d2('0x16')]);}})[_0x76d2('0x19')](function(_0x33c822){logger[_0x76d2('0x13')]('ChatMessage,\x20%s,\x20%s',_0x38b1bd,_0x33c822);_0x4a32f8(_0x33c822);});});}exports[_0x76d2('0x1a')]=function(_0x53f13d){var _0x2d04c4=this;return new Promise(function(_0x1c8d28,_0x140e6d){return db[_0x76d2('0x1b')][_0x76d2('0x1c')](_0x53f13d[_0x76d2('0x1d')],{'raw':_0x53f13d['options']?_0x53f13d[_0x76d2('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x76d2('0x1f')](function(_0x1e8251){logger[_0x76d2('0x17')](_0x76d2('0x1a'),_0x53f13d);logger['debug'](_0x76d2('0x1a'),_0x53f13d,JSON[_0x76d2('0x20')](_0x1e8251));_0x1c8d28(_0x1e8251);})[_0x76d2('0x19')](function(_0x2b77b7){logger[_0x76d2('0x13')](_0x76d2('0x1a'),_0x2b77b7[_0x76d2('0x16')],_0x53f13d);_0x140e6d(_0x2d04c4[_0x76d2('0x13')](0x1f4,_0x2b77b7['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index e74ba93..65c2596 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 _0x826a=['update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x289856,_0xe83156){var _0x4c4115=function(_0x383499){while(--_0x383499){_0x289856['push'](_0x289856['shift']());}};_0x4c4115(++_0xe83156);}(_0x826a,0x1aa));var _0xa826=function(_0x531aef,_0xef95ba){_0x531aef=_0x531aef-0x0;var _0x3bea62=_0x826a[_0x531aef];return _0x3bea62;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatMessageEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatMessageEvents['on'](_0x4339f9,_0x14c2ba);}};
\ No newline at end of file
+var _0xec46=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x189cde,_0x457803){var _0xb066ed=function(_0x31a3be){while(--_0x31a3be){_0x189cde['push'](_0x189cde['shift']());}};_0xb066ed(++_0x457803);}(_0xec46,0x19c));var _0x6ec4=function(_0x5c06b,_0x20564c){_0x5c06b=_0x5c06b-0x0;var _0x34c54c=_0xec46[_0x5c06b];return _0x34c54c;};'use strict';var ChatMessageEvents=require(_0x6ec4('0x0'));var events=[_0x6ec4('0x1'),_0x6ec4('0x2'),_0x6ec4('0x3')];function createListener(_0x5e854b,_0x5052d2){return function(_0x307c5c){_0x5052d2[_0x6ec4('0x4')](_0x5e854b,_0x307c5c);};}function removeListener(_0x86b9f8,_0x53bbed){return function(){ChatMessageEvents[_0x6ec4('0x5')](_0x86b9f8,_0x53bbed);};}exports[_0x6ec4('0x6')]=function(_0x55b203){for(var _0x533fda=0x0,_0x55d260=events[_0x6ec4('0x7')];_0x533fda<_0x55d260;_0x533fda++){var _0x391ed9=events[_0x533fda];var _0x42b81b=createListener(_0x6ec4('0x8')+_0x391ed9,_0x55b203);ChatMessageEvents['on'](_0x391ed9,_0x42b81b);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 7e90769..e0ddc58 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 _0x0f7c=['index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f7c,0xf9));var _0xc0f7=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x0f7c[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0xc0f7('0x0'));var util=require(_0xc0f7('0x1'));var path=require(_0xc0f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0f7('0x3'));var router=express[_0xc0f7('0x4')]();var fs_extra=require(_0xc0f7('0x5'));var auth=require(_0xc0f7('0x6'));var interaction=require(_0xc0f7('0x7'));var config=require(_0xc0f7('0x8'));var controller=require(_0xc0f7('0x9'));router[_0xc0f7('0xa')]('/',auth[_0xc0f7('0xb')](),controller[_0xc0f7('0xc')]);router['get'](_0xc0f7('0xd'),auth[_0xc0f7('0xb')](),controller[_0xc0f7('0xe')]);router[_0xc0f7('0xa')](_0xc0f7('0xf'),auth[_0xc0f7('0xb')](),controller[_0xc0f7('0x10')]);router[_0xc0f7('0x11')]('/',auth[_0xc0f7('0xb')](),interaction[_0xc0f7('0x12')](_0xc0f7('0x13'),_0xc0f7('0x14')),controller[_0xc0f7('0x15')]);router[_0xc0f7('0x16')](_0xc0f7('0xf'),controller[_0xc0f7('0x17')]);router['put'](_0xc0f7('0x18'),auth[_0xc0f7('0xb')](),controller[_0xc0f7('0x19')]);router['put'](_0xc0f7('0x1a'),auth['isAuthenticated'](),controller['reject']);router[_0xc0f7('0x1b')](_0xc0f7('0xf'),auth[_0xc0f7('0xb')](),controller[_0xc0f7('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xabf3=['chatmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat'];(function(_0x4fde3a,_0x50e735){var _0x2d4cf1=function(_0x56fe28){while(--_0x56fe28){_0x4fde3a['push'](_0x4fde3a['shift']());}};_0x2d4cf1(++_0x50e735);}(_0xabf3,0x149));var _0x3abf=function(_0x5cbb1f,_0x3447e1){_0x5cbb1f=_0x5cbb1f-0x0;var _0x2626d7=_0xabf3[_0x5cbb1f];return _0x2626d7;};'use strict';var multer=require('multer');var util=require(_0x3abf('0x0'));var path=require(_0x3abf('0x1'));var timeout=require(_0x3abf('0x2'));var express=require(_0x3abf('0x3'));var router=express[_0x3abf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3abf('0x5'));var interaction=require(_0x3abf('0x6'));var config=require(_0x3abf('0x7'));var controller=require(_0x3abf('0x8'));router[_0x3abf('0x9')]('/',auth[_0x3abf('0xa')](),controller[_0x3abf('0xb')]);router[_0x3abf('0x9')](_0x3abf('0xc'),auth[_0x3abf('0xa')](),controller[_0x3abf('0xd')]);router['get'](_0x3abf('0xe'),auth['isAuthenticated'](),controller[_0x3abf('0xf')]);router[_0x3abf('0x10')]('/',auth[_0x3abf('0xa')](),interaction[_0x3abf('0x11')](_0x3abf('0x12'),_0x3abf('0x13')),controller[_0x3abf('0x14')]);router[_0x3abf('0x15')](_0x3abf('0xe'),controller[_0x3abf('0x16')]);router[_0x3abf('0x15')](_0x3abf('0x17'),auth['isAuthenticated'](),controller[_0x3abf('0x18')]);router[_0x3abf('0x15')]('/:id/reject',auth[_0x3abf('0xa')](),controller[_0x3abf('0x19')]);router[_0x3abf('0x1a')](_0x3abf('0xe'),auth['isAuthenticated'](),controller[_0x3abf('0x1b')]);module[_0x3abf('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 458ba37..55e519d 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 _0x38e8=['sequelize','exports','TEXT','medium'];(function(_0xc5400f,_0x33b910){var _0x7ad9c=function(_0x39c8d9){while(--_0x39c8d9){_0xc5400f['push'](_0xc5400f['shift']());}};_0x7ad9c(++_0x33b910);}(_0x38e8,0x150));var _0x838e=function(_0x12e77a,_0x227e87){_0x12e77a=_0x12e77a-0x0;var _0x56123c=_0x38e8[_0x12e77a];return _0x56123c;};'use strict';var Sequelize=require(_0x838e('0x0'));module[_0x838e('0x1')]={'body':{'type':Sequelize[_0x838e('0x2')](_0x838e('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x2440=['TEXT','exports'];(function(_0x4b23a1,_0x352e14){var _0x786bf1=function(_0x5c0a7c){while(--_0x5c0a7c){_0x4b23a1['push'](_0x4b23a1['shift']());}};_0x786bf1(++_0x352e14);}(_0x2440,0x1e1));var _0x0244=function(_0x5aa02b,_0x3dcacc){_0x5aa02b=_0x5aa02b-0x0;var _0x2c5863=_0x2440[_0x5aa02b];return _0x2c5863;};'use strict';var Sequelize=require('sequelize');module[_0x0244('0x0')]={'body':{'type':Sequelize[_0x0244('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 662068e..5f87517 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x7a54,0x106));var _0x47a5=function(_0x48c3a1,_0x1afeb1){_0x48c3a1=_0x48c3a1-0x0;var _0xfcb857=_0x7a54[_0x48c3a1];return _0xfcb857;};'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(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7a54,0x106));var _0x47a5=function(_0x43df6c,_0x1a1f7c){_0x43df6c=_0x43df6c-0x0;var _0x4cc545=_0x7a54[_0x43df6c];return _0x4cc545;};'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 805a9df..1710e8a 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 _0x527f=['exports','define','ChatOfflineMessage','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x490b54,_0x47317b){var _0x442740=function(_0x502140){while(--_0x502140){_0x490b54['push'](_0x490b54['shift']());}};_0x442740(++_0x47317b);}(_0x527f,0x10c));var _0xf527=function(_0x299a45,_0x3805af){_0x299a45=_0x299a45-0x0;var _0x39c861=_0x527f[_0x299a45];return _0x39c861;};'use strict';var _=require(_0xf527('0x0'));var util=require(_0xf527('0x1'));var logger=require(_0xf527('0x2'))(_0xf527('0x3'));var moment=require('moment');var BPromise=require(_0xf527('0x4'));var rp=require(_0xf527('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf527('0x6'));var config=require(_0xf527('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0xf527('0x8')]=function(_0x153c36,_0x25f209){return _0x153c36[_0xf527('0x9')](_0xf527('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf527('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8cdd=['exports','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x47de5d,_0x5ba7d6){var _0x43ea49=function(_0x4836f5){while(--_0x4836f5){_0x47de5d['push'](_0x47de5d['shift']());}};_0x43ea49(++_0x5ba7d6);}(_0x8cdd,0x122));var _0xd8cd=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x8cdd[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xd8cd('0x0'));var util=require(_0xd8cd('0x1'));var logger=require(_0xd8cd('0x2'))('api');var moment=require(_0xd8cd('0x3'));var BPromise=require('bluebird');var rp=require(_0xd8cd('0x4'));var fs=require('fs');var path=require(_0xd8cd('0x5'));var rimraf=require(_0xd8cd('0x6'));var config=require(_0xd8cd('0x7'));var attributes=require(_0xd8cd('0x8'));module[_0xd8cd('0x9')]=function(_0x4ebb2a,_0x1acfe7){return _0x4ebb2a['define'](_0xd8cd('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8cd('0xb'),'collate':_0xd8cd('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index af607f4..0ac07a9 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 _0x4d23=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment'];(function(_0x19f9b4,_0x1798c5){var _0x2c535b=function(_0x8e60ee){while(--_0x8e60ee){_0x19f9b4['push'](_0x19f9b4['shift']());}};_0x2c535b(++_0x1798c5);}(_0x4d23,0x82));var _0x34d2=function(_0x5c3b5e,_0x31ad52){_0x5c3b5e=_0x5c3b5e-0x0;var _0x5d6993=_0x4d23[_0x5c3b5e];return _0x5d6993;};'use strict';var _=require('lodash');var util=require(_0x34d2('0x0'));var moment=require(_0x34d2('0x1'));var BPromise=require(_0x34d2('0x2'));var rs=require(_0x34d2('0x3'));var fs=require('fs');var Redis=require(_0x34d2('0x4'));var db=require(_0x34d2('0x5'))['db'];var utils=require(_0x34d2('0x6'));var logger=require(_0x34d2('0x7'))(_0x34d2('0x8'));var config=require(_0x34d2('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x34d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cac28,_0x4ccb43,_0x51cc7b){return new BPromise(function(_0x25d2cb,_0x2c46ab){return client[_0x34d2('0xb')](_0x3cac28,_0x51cc7b)[_0x34d2('0xc')](function(_0x373886){logger[_0x34d2('0xd')](_0x34d2('0xe'),_0x4ccb43,_0x34d2('0xf'));logger[_0x34d2('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4ccb43,_0x34d2('0xf'),JSON[_0x34d2('0x11')](_0x373886));if(_0x373886[_0x34d2('0x12')]){if(_0x373886['error'][_0x34d2('0x13')]===0x1f4){logger[_0x34d2('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4ccb43,_0x373886[_0x34d2('0x12')]['message']);return _0x2c46ab(_0x373886[_0x34d2('0x12')][_0x34d2('0x14')]);}logger[_0x34d2('0x12')](_0x34d2('0xe'),_0x4ccb43,_0x373886['error'][_0x34d2('0x14')]);return _0x25d2cb(_0x373886[_0x34d2('0x12')][_0x34d2('0x14')]);}else{logger[_0x34d2('0xd')](_0x34d2('0xe'),_0x4ccb43,'request\x20sent');_0x25d2cb(_0x373886['result'][_0x34d2('0x14')]);}})[_0x34d2('0x15')](function(_0x1e6df8){logger[_0x34d2('0x12')](_0x34d2('0xe'),_0x4ccb43,_0x1e6df8);_0x2c46ab(_0x1e6df8);});});}
\ No newline at end of file
+var _0x939d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x464121,_0x39c954){var _0x1d0cb8=function(_0x24722a){while(--_0x24722a){_0x464121['push'](_0x464121['shift']());}};_0x1d0cb8(++_0x39c954);}(_0x939d,0xcc));var _0xd939=function(_0x577c12,_0x2babb4){_0x577c12=_0x577c12-0x0;var _0x466fbf=_0x939d[_0x577c12];return _0x466fbf;};'use strict';var _=require(_0xd939('0x0'));var util=require(_0xd939('0x1'));var moment=require('moment');var BPromise=require(_0xd939('0x2'));var rs=require(_0xd939('0x3'));var fs=require('fs');var Redis=require(_0xd939('0x4'));var db=require(_0xd939('0x5'))['db'];var utils=require(_0xd939('0x6'));var logger=require(_0xd939('0x7'))(_0xd939('0x8'));var config=require(_0xd939('0x9'));var jayson=require(_0xd939('0xa'));var client=jayson[_0xd939('0xb')][_0xd939('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51f38f,_0x6db92c,_0x559294){return new BPromise(function(_0x451a54,_0x2c8e98){return client['request'](_0x51f38f,_0x559294)[_0xd939('0xd')](function(_0x39e302){logger[_0xd939('0xe')](_0xd939('0xf'),_0x6db92c,'request\x20sent');logger['debug'](_0xd939('0x10'),_0x6db92c,_0xd939('0x11'),JSON[_0xd939('0x12')](_0x39e302));if(_0x39e302[_0xd939('0x13')]){if(_0x39e302[_0xd939('0x13')]['code']===0x1f4){logger[_0xd939('0x13')](_0xd939('0xf'),_0x6db92c,_0x39e302[_0xd939('0x13')][_0xd939('0x14')]);return _0x2c8e98(_0x39e302[_0xd939('0x13')][_0xd939('0x14')]);}logger['error'](_0xd939('0xf'),_0x6db92c,_0x39e302[_0xd939('0x13')]['message']);return _0x451a54(_0x39e302[_0xd939('0x13')]['message']);}else{logger[_0xd939('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x6db92c,_0xd939('0x11'));_0x451a54(_0x39e302[_0xd939('0x15')][_0xd939('0x14')]);}})[_0xd939('0x16')](function(_0x32b16c){logger['error'](_0xd939('0xf'),_0x6db92c,_0x32b16c);_0x2c8e98(_0x32b16c);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 94f1dd7..c4f5c24 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 _0x0bd7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x10e0af,_0x35a91c){var _0x402a6f=function(_0x5f2313){while(--_0x5f2313){_0x10e0af['push'](_0x10e0af['shift']());}};_0x402a6f(++_0x35a91c);}(_0x0bd7,0xb8));var _0x70bd=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x0bd7[_0x5c6022];return _0x4ab5af;};'use strict';var multer=require(_0x70bd('0x0'));var util=require(_0x70bd('0x1'));var path=require(_0x70bd('0x2'));var timeout=require(_0x70bd('0x3'));var express=require(_0x70bd('0x4'));var router=express[_0x70bd('0x5')]();var fs_extra=require(_0x70bd('0x6'));var auth=require(_0x70bd('0x7'));var interaction=require(_0x70bd('0x8'));var config=require('../../config/environment');var controller=require(_0x70bd('0x9'));router['get']('/',auth[_0x70bd('0xa')](),controller[_0x70bd('0xb')]);router[_0x70bd('0xc')](_0x70bd('0xd'),auth[_0x70bd('0xa')](),controller[_0x70bd('0xe')]);router[_0x70bd('0xc')](_0x70bd('0xf'),auth[_0x70bd('0xa')](),controller[_0x70bd('0x10')]);router['post']('/',auth[_0x70bd('0xa')](),controller[_0x70bd('0x11')]);router[_0x70bd('0x12')](_0x70bd('0xf'),auth[_0x70bd('0xa')](),controller[_0x70bd('0x13')]);router[_0x70bd('0x14')](_0x70bd('0xf'),auth[_0x70bd('0xa')](),controller[_0x70bd('0x15')]);module[_0x70bd('0x16')]=router;
\ No newline at end of file
+var _0xb30c=['update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','create','put'];(function(_0x54c516,_0x420575){var _0x2583c0=function(_0x4171e4){while(--_0x4171e4){_0x54c516['push'](_0x54c516['shift']());}};_0x2583c0(++_0x420575);}(_0xb30c,0x81));var _0xcb30=function(_0x3c5617,_0x549e48){_0x3c5617=_0x3c5617-0x0;var _0xaddb2d=_0xb30c[_0x3c5617];return _0xaddb2d;};'use strict';var multer=require('multer');var util=require(_0xcb30('0x0'));var path=require(_0xcb30('0x1'));var timeout=require(_0xcb30('0x2'));var express=require(_0xcb30('0x3'));var router=express[_0xcb30('0x4')]();var fs_extra=require(_0xcb30('0x5'));var auth=require(_0xcb30('0x6'));var interaction=require(_0xcb30('0x7'));var config=require(_0xcb30('0x8'));var controller=require(_0xcb30('0x9'));router[_0xcb30('0xa')]('/',auth[_0xcb30('0xb')](),controller[_0xcb30('0xc')]);router[_0xcb30('0xa')]('/describe',auth[_0xcb30('0xb')](),controller[_0xcb30('0xd')]);router[_0xcb30('0xa')](_0xcb30('0xe'),auth[_0xcb30('0xb')](),controller[_0xcb30('0xf')]);router['post']('/',auth[_0xcb30('0xb')](),controller[_0xcb30('0x10')]);router[_0xcb30('0x11')](_0xcb30('0xe'),auth[_0xcb30('0xb')](),controller[_0xcb30('0x12')]);router[_0xcb30('0x13')](_0xcb30('0xe'),auth['isAuthenticated'](),controller[_0xcb30('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b9061d2..3f3f85b 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 _0x68fa=['exports','STRING','ENUM','timeout','mouseOver','INTEGER','sequelize'];(function(_0x23bb2c,_0x5eeb86){var _0x4d1ad8=function(_0xc65367){while(--_0xc65367){_0x23bb2c['push'](_0x23bb2c['shift']());}};_0x4d1ad8(++_0x5eeb86);}(_0x68fa,0x109));var _0xa68f=function(_0x330ee4,_0x27b717){_0x330ee4=_0x330ee4-0x0;var _0x31d749=_0x68fa[_0x330ee4];return _0x31d749;};'use strict';var Sequelize=require(_0xa68f('0x0'));module[_0xa68f('0x1')]={'name':{'type':Sequelize[_0xa68f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa68f('0x3')]('mouseOver',_0xa68f('0x4')),'defaultValue':_0xa68f('0x5')},'selector':{'type':Sequelize[_0xa68f('0x2')]},'timeout':{'type':Sequelize[_0xa68f('0x6')]}};
\ No newline at end of file
+var _0x9f02=['ENUM','mouseOver','timeout','sequelize','exports','STRING'];(function(_0xf26c34,_0x5bc08b){var _0xdb6411=function(_0x750f56){while(--_0x750f56){_0xf26c34['push'](_0xf26c34['shift']());}};_0xdb6411(++_0x5bc08b);}(_0x9f02,0x18f));var _0x29f0=function(_0x15833d,_0xa2d050){_0x15833d=_0x15833d-0x0;var _0x31cc57=_0x9f02[_0x15833d];return _0x31cc57;};'use strict';var Sequelize=require(_0x29f0('0x0'));module[_0x29f0('0x1')]={'name':{'type':Sequelize[_0x29f0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x29f0('0x3')](_0x29f0('0x4'),_0x29f0('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 50ca924..38edc20 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 _0xc906=['destroy','then','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','options','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','save'];(function(_0x17a09c,_0x233370){var _0x491dde=function(_0xb32995){while(--_0xb32995){_0x17a09c['push'](_0x17a09c['shift']());}};_0x491dde(++_0x233370);}(_0xc906,0x1ad));var _0x6c90=function(_0xd2a145,_0x53070d){_0xd2a145=_0xd2a145-0x0;var _0xfe94b5=_0xc906[_0xd2a145];return _0xfe94b5;};'use strict';var emlformat=require(_0x6c90('0x0'));var rimraf=require(_0x6c90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c90('0x2'));var rp=require(_0x6c90('0x3'));var moment=require(_0x6c90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c90('0x5'));var util=require(_0x6c90('0x6'));var path=require(_0x6c90('0x7'));var sox=require(_0x6c90('0x8'));var csv=require(_0x6c90('0x9'));var ejs=require(_0x6c90('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6c90('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6c90('0xc'));var toCsv=require(_0x6c90('0x9'));var querystring=require(_0x6c90('0xd'));var Papa=require(_0x6c90('0xe'));var Redis=require(_0x6c90('0xf'));var authService=require(_0x6c90('0x10'));var qs=require(_0x6c90('0x11'));var as=require(_0x6c90('0x12'));var hardwareService=require(_0x6c90('0x13'));var logger=require(_0x6c90('0x14'))(_0x6c90('0x15'));var utils=require(_0x6c90('0x16'));var config=require(_0x6c90('0x17'));var licenseUtil=require(_0x6c90('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51814c,_0x447fb3){_0x447fb3=_0x447fb3||0xcc;return function(_0x2d7755){if(_0x2d7755){return _0x51814c[_0x6c90('0x19')](_0x447fb3);}return _0x51814c[_0x6c90('0x1a')](_0x447fb3)[_0x6c90('0x1b')]();};}function respondWithResult(_0x3cf02d,_0x117da5){_0x117da5=_0x117da5||0xc8;return function(_0x30f64a){if(_0x30f64a){return _0x3cf02d[_0x6c90('0x1a')](_0x117da5)[_0x6c90('0x1c')](_0x30f64a);}};}function respondWithFilteredResult(_0x49e7ef,_0x2bb817){return function(_0x226917){if(_0x226917){var _0x273ed1=typeof _0x2bb817[_0x6c90('0x1d')]==='undefined'&&typeof _0x2bb817[_0x6c90('0x1e')]===_0x6c90('0x1f');var _0x5589ad=_0x226917[_0x6c90('0x20')];var _0x3f9572=_0x273ed1?0x0:_0x2bb817[_0x6c90('0x1d')];var _0x424902=_0x273ed1?_0x226917[_0x6c90('0x20')]:_0x2bb817[_0x6c90('0x1d')]+_0x2bb817['limit'];var _0x9fc18e;if(_0x424902>=_0x5589ad){_0x424902=_0x5589ad;_0x9fc18e=0xc8;}else{_0x9fc18e=0xce;}_0x49e7ef[_0x6c90('0x1a')](_0x9fc18e);return _0x49e7ef[_0x6c90('0x21')]('Content-Range',_0x3f9572+'-'+_0x424902+'/'+_0x5589ad)['json'](_0x226917);}return null;};}function patchUpdates(_0x3e9ba6){return function(_0x6f0a46){try{jsonpatch['apply'](_0x6f0a46,_0x3e9ba6,!![]);}catch(_0x224115){return BPromise['reject'](_0x224115);}return _0x6f0a46[_0x6c90('0x22')]();};}function saveUpdates(_0x593010,_0x4f8818){return function(_0x137285){if(_0x137285){return _0x137285['update'](_0x593010)['then'](function(_0x3284a5){return _0x3284a5;});}return null;};}function removeEntity(_0x59ba0e,_0x26139e){return function(_0x55ddfc){if(_0x55ddfc){return _0x55ddfc[_0x6c90('0x23')]()[_0x6c90('0x24')](function(){_0x59ba0e[_0x6c90('0x1a')](0xcc)[_0x6c90('0x1b')]();});}};}function handleEntityNotFound(_0xf51b92,_0x4e1976){return function(_0x3ad642){if(!_0x3ad642){_0xf51b92[_0x6c90('0x19')](0x194);}return _0x3ad642;};}function handleError(_0x4a5818,_0x2a04f6){_0x2a04f6=_0x2a04f6||0x1f4;return function(_0x5aaf2f){logger[_0x6c90('0x25')](_0x5aaf2f[_0x6c90('0x26')]);if(_0x5aaf2f[_0x6c90('0x27')]){delete _0x5aaf2f[_0x6c90('0x27')];}_0x4a5818[_0x6c90('0x1a')](_0x2a04f6)['send'](_0x5aaf2f);};}exports[_0x6c90('0x28')]=function(_0x122246,_0x1d1cc6){var _0x4cffd0={'raw':!![],'where':{'id':_0x122246[_0x6c90('0x29')]['id']}},_0x17dfbd={};_0x17dfbd[_0x6c90('0x2a')]=_[_0x6c90('0x2b')](db[_0x6c90('0x2c')][_0x6c90('0x2d')]);_0x17dfbd[_0x6c90('0x2e')]=_['keys'](_0x122246[_0x6c90('0x2e')]);_0x17dfbd[_0x6c90('0x2f')]=_[_0x6c90('0x30')](_0x17dfbd['model'],_0x17dfbd[_0x6c90('0x2e')]);_0x4cffd0[_0x6c90('0x31')]=_[_0x6c90('0x30')](_0x17dfbd['model'],qs[_0x6c90('0x32')](_0x122246['query'][_0x6c90('0x32')]));_0x4cffd0['attributes']=_0x4cffd0[_0x6c90('0x31')]['length']?_0x4cffd0[_0x6c90('0x31')]:_0x17dfbd['model'];if(_0x122246[_0x6c90('0x2e')][_0x6c90('0x33')]){_0x4cffd0['include']=[{'all':!![]}];}_0x4cffd0=_['merge']({},_0x4cffd0,_0x122246[_0x6c90('0x34')]);return db['ChatProactiveAction'][_0x6c90('0x35')](_0x4cffd0)[_0x6c90('0x24')](handleEntityNotFound(_0x1d1cc6,null))[_0x6c90('0x24')](respondWithResult(_0x1d1cc6,null))[_0x6c90('0x36')](handleError(_0x1d1cc6,null));};exports[_0x6c90('0x37')]=function(_0x23a109,_0x176c33){return db['ChatProactiveAction'][_0x6c90('0x37')](_0x23a109[_0x6c90('0x38')],{})['then'](respondWithResult(_0x176c33,0xc9))[_0x6c90('0x36')](handleError(_0x176c33,null));};exports[_0x6c90('0x39')]=function(_0x17d5b6,_0x103c35){if(_0x17d5b6[_0x6c90('0x38')]['id']){delete _0x17d5b6[_0x6c90('0x38')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x17d5b6[_0x6c90('0x29')]['id']}})[_0x6c90('0x24')](handleEntityNotFound(_0x103c35,null))['then'](saveUpdates(_0x17d5b6['body'],null))[_0x6c90('0x24')](respondWithResult(_0x103c35,null))[_0x6c90('0x36')](handleError(_0x103c35,null));};exports[_0x6c90('0x23')]=function(_0x26c921,_0x447a7b){return db[_0x6c90('0x2c')]['find']({'where':{'id':_0x26c921[_0x6c90('0x29')]['id']}})[_0x6c90('0x24')](handleEntityNotFound(_0x447a7b,null))[_0x6c90('0x24')](removeEntity(_0x447a7b,null))['catch'](handleError(_0x447a7b,null));};
\ No newline at end of file
+var _0x1af3=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','length','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x40a73a,_0x4d3623){var _0x46e6cb=function(_0x5d08a3){while(--_0x5d08a3){_0x40a73a['push'](_0x40a73a['shift']());}};_0x46e6cb(++_0x4d3623);}(_0x1af3,0x1ca));var _0x31af=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0x1af3[_0x41582d];return _0x59c504;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require(_0x31af('0x1'));var zipdir=require(_0x31af('0x2'));var jsonpatch=require(_0x31af('0x3'));var rp=require(_0x31af('0x4'));var moment=require(_0x31af('0x5'));var BPromise=require(_0x31af('0x6'));var Mustache=require(_0x31af('0x7'));var util=require(_0x31af('0x8'));var path=require(_0x31af('0x9'));var sox=require('sox');var csv=require(_0x31af('0xa'));var ejs=require(_0x31af('0xb'));var fs=require('fs');var fs_extra=require(_0x31af('0xc'));var _=require(_0x31af('0xd'));var squel=require('squel');var crypto=require(_0x31af('0xe'));var jsforce=require(_0x31af('0xf'));var deskjs=require(_0x31af('0x10'));var toCsv=require('to-csv');var querystring=require(_0x31af('0x11'));var Papa=require(_0x31af('0x12'));var Redis=require(_0x31af('0x13'));var authService=require(_0x31af('0x14'));var qs=require(_0x31af('0x15'));var as=require(_0x31af('0x16'));var hardwareService=require(_0x31af('0x17'));var logger=require(_0x31af('0x18'))('api');var utils=require(_0x31af('0x19'));var config=require(_0x31af('0x1a'));var licenseUtil=require(_0x31af('0x1b'));var db=require(_0x31af('0x1c'))['db'];function respondWithStatusCode(_0x144406,_0x481f20){_0x481f20=_0x481f20||0xcc;return function(_0x358fb4){if(_0x358fb4){return _0x144406[_0x31af('0x1d')](_0x481f20);}return _0x144406['status'](_0x481f20)['end']();};}function respondWithResult(_0x2a4727,_0x46a494){_0x46a494=_0x46a494||0xc8;return function(_0x14c57e){if(_0x14c57e){return _0x2a4727[_0x31af('0x1e')](_0x46a494)[_0x31af('0x1f')](_0x14c57e);}};}function respondWithFilteredResult(_0x1d35fa,_0x369934){return function(_0x37c275){if(_0x37c275){var _0xd431e4=typeof _0x369934[_0x31af('0x20')]===_0x31af('0x21')&&typeof _0x369934['limit']===_0x31af('0x21');var _0xd33b3f=_0x37c275[_0x31af('0x22')];var _0x477ada=_0xd431e4?0x0:_0x369934[_0x31af('0x20')];var _0x30a112=_0xd431e4?_0x37c275[_0x31af('0x22')]:_0x369934[_0x31af('0x20')]+_0x369934[_0x31af('0x23')];var _0x550870;if(_0x30a112>=_0xd33b3f){_0x30a112=_0xd33b3f;_0x550870=0xc8;}else{_0x550870=0xce;}_0x1d35fa[_0x31af('0x1e')](_0x550870);return _0x1d35fa[_0x31af('0x24')](_0x31af('0x25'),_0x477ada+'-'+_0x30a112+'/'+_0xd33b3f)[_0x31af('0x1f')](_0x37c275);}return null;};}function patchUpdates(_0x414ad8){return function(_0x5d96ca){try{jsonpatch[_0x31af('0x26')](_0x5d96ca,_0x414ad8,!![]);}catch(_0x46b03e){return BPromise[_0x31af('0x27')](_0x46b03e);}return _0x5d96ca[_0x31af('0x28')]();};}function saveUpdates(_0x394d13,_0x14c3f9){return function(_0x1ddfba){if(_0x1ddfba){return _0x1ddfba[_0x31af('0x29')](_0x394d13)[_0x31af('0x2a')](function(_0x6634e3){return _0x6634e3;});}return null;};}function removeEntity(_0x40aa32,_0x1a67e3){return function(_0x3a98d3){if(_0x3a98d3){return _0x3a98d3[_0x31af('0x2b')]()[_0x31af('0x2a')](function(){_0x40aa32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3832,_0x20a50c){return function(_0x2b3bad){if(!_0x2b3bad){_0x5d3832['sendStatus'](0x194);}return _0x2b3bad;};}function handleError(_0x4c958,_0x8f9f60){_0x8f9f60=_0x8f9f60||0x1f4;return function(_0x49812a){logger[_0x31af('0x2c')](_0x49812a[_0x31af('0x2d')]);if(_0x49812a['name']){delete _0x49812a[_0x31af('0x2e')];}_0x4c958[_0x31af('0x1e')](_0x8f9f60)[_0x31af('0x2f')](_0x49812a);};}exports[_0x31af('0x30')]=function(_0x3326a7,_0x5a1f41){var _0xb1f5b1={'raw':!![],'where':{'id':_0x3326a7[_0x31af('0x31')]['id']}},_0x3eb61f={};_0x3eb61f[_0x31af('0x32')]=_[_0x31af('0x33')](db[_0x31af('0x34')][_0x31af('0x35')]);_0x3eb61f[_0x31af('0x36')]=_[_0x31af('0x33')](_0x3326a7[_0x31af('0x36')]);_0x3eb61f[_0x31af('0x37')]=_[_0x31af('0x38')](_0x3eb61f['model'],_0x3eb61f[_0x31af('0x36')]);_0xb1f5b1[_0x31af('0x39')]=_['intersection'](_0x3eb61f['model'],qs['fields'](_0x3326a7[_0x31af('0x36')]['fields']));_0xb1f5b1[_0x31af('0x39')]=_0xb1f5b1[_0x31af('0x39')][_0x31af('0x3a')]?_0xb1f5b1[_0x31af('0x39')]:_0x3eb61f[_0x31af('0x32')];if(_0x3326a7[_0x31af('0x36')]['includeAll']){_0xb1f5b1[_0x31af('0x3b')]=[{'all':!![]}];}_0xb1f5b1=_[_0x31af('0x3c')]({},_0xb1f5b1,_0x3326a7[_0x31af('0x3d')]);return db[_0x31af('0x34')][_0x31af('0x3e')](_0xb1f5b1)[_0x31af('0x2a')](handleEntityNotFound(_0x5a1f41,null))[_0x31af('0x2a')](respondWithResult(_0x5a1f41,null))[_0x31af('0x3f')](handleError(_0x5a1f41,null));};exports['create']=function(_0x258645,_0x57af86){return db[_0x31af('0x34')][_0x31af('0x40')](_0x258645[_0x31af('0x41')],{})[_0x31af('0x2a')](respondWithResult(_0x57af86,0xc9))[_0x31af('0x3f')](handleError(_0x57af86,null));};exports['update']=function(_0x59efe4,_0x53bb6d){if(_0x59efe4[_0x31af('0x41')]['id']){delete _0x59efe4[_0x31af('0x41')]['id'];}return db[_0x31af('0x34')][_0x31af('0x3e')]({'where':{'id':_0x59efe4[_0x31af('0x31')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x53bb6d,null))[_0x31af('0x2a')](saveUpdates(_0x59efe4[_0x31af('0x41')],null))['then'](respondWithResult(_0x53bb6d,null))[_0x31af('0x3f')](handleError(_0x53bb6d,null));};exports[_0x31af('0x2b')]=function(_0x1b6a20,_0x2a5cde){return db[_0x31af('0x34')][_0x31af('0x3e')]({'where':{'id':_0x1b6a20[_0x31af('0x31')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x2a5cde,null))[_0x31af('0x2a')](removeEntity(_0x2a5cde,null))['catch'](handleError(_0x2a5cde,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 219e1ed..e580b39 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 _0x1c85=['../../config/environment','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x59911a,_0x50cee2){var _0x4e142e=function(_0x4ab147){while(--_0x4ab147){_0x59911a['push'](_0x59911a['shift']());}};_0x4e142e(++_0x50cee2);}(_0x1c85,0x1ee));var _0x51c8=function(_0x5d078d,_0x1cb590){_0x5d078d=_0x5d078d-0x0;var _0x45948a=_0x1c85[_0x5d078d];return _0x45948a;};'use strict';var _=require(_0x51c8('0x0'));var util=require(_0x51c8('0x1'));var logger=require(_0x51c8('0x2'))(_0x51c8('0x3'));var moment=require('moment');var BPromise=require(_0x51c8('0x4'));var rp=require(_0x51c8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x51c8('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x51c8('0x7')]=function(_0x268869,_0x39b3c0){return _0x268869['define'](_0x51c8('0x8'),attributes,{'tableName':_0x51c8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6db0=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x15cba8,_0x4f2264){var _0x2b80f5=function(_0x2ef83e){while(--_0x2ef83e){_0x15cba8['push'](_0x15cba8['shift']());}};_0x2b80f5(++_0x4f2264);}(_0x6db0,0xaa));var _0x06db=function(_0xab7744,_0x1411bf){_0xab7744=_0xab7744-0x0;var _0x465fff=_0x6db0[_0xab7744];return _0x465fff;};'use strict';var _=require(_0x06db('0x0'));var util=require(_0x06db('0x1'));var logger=require(_0x06db('0x2'))('api');var moment=require(_0x06db('0x3'));var BPromise=require('bluebird');var rp=require(_0x06db('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06db('0x5'));var config=require('../../config/environment');var attributes=require(_0x06db('0x6'));module[_0x06db('0x7')]=function(_0x5f00b4,_0x5bf7a1){return _0x5f00b4[_0x06db('0x8')](_0x06db('0x9'),attributes,{'tableName':_0x06db('0xa'),'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 2a371ee..28a94d4 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 _0xaf5e=['result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3ccdbe,_0xabd011){var _0x3d6e09=function(_0x28fac5){while(--_0x28fac5){_0x3ccdbe['push'](_0x3ccdbe['shift']());}};_0x3d6e09(++_0xabd011);}(_0xaf5e,0x1e2));var _0xeaf5=function(_0x566b18,_0x534828){_0x566b18=_0x566b18-0x0;var _0x34d320=_0xaf5e[_0x566b18];return _0x34d320;};'use strict';var _=require(_0xeaf5('0x0'));var util=require(_0xeaf5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaf5('0x2'));var db=require(_0xeaf5('0x3'))['db'];var utils=require(_0xeaf5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xeaf5('0x5'));var jayson=require(_0xeaf5('0x6'));var client=jayson[_0xeaf5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x512c63,_0x31a93a,_0x283ba5){return new BPromise(function(_0x2d0e2c,_0x156ac5){return client['request'](_0x512c63,_0x283ba5)[_0xeaf5('0x8')](function(_0x4d249c){logger[_0xeaf5('0x9')](_0xeaf5('0xa'),_0x31a93a,_0xeaf5('0xb'));logger[_0xeaf5('0xc')](_0xeaf5('0xd'),_0x31a93a,_0xeaf5('0xb'),JSON[_0xeaf5('0xe')](_0x4d249c));if(_0x4d249c['error']){if(_0x4d249c[_0xeaf5('0xf')][_0xeaf5('0x10')]===0x1f4){logger[_0xeaf5('0xf')](_0xeaf5('0xa'),_0x31a93a,_0x4d249c[_0xeaf5('0xf')]['message']);return _0x156ac5(_0x4d249c[_0xeaf5('0xf')][_0xeaf5('0x11')]);}logger[_0xeaf5('0xf')](_0xeaf5('0xa'),_0x31a93a,_0x4d249c[_0xeaf5('0xf')][_0xeaf5('0x11')]);return _0x2d0e2c(_0x4d249c['error'][_0xeaf5('0x11')]);}else{logger[_0xeaf5('0x9')](_0xeaf5('0xa'),_0x31a93a,_0xeaf5('0xb'));_0x2d0e2c(_0x4d249c[_0xeaf5('0x12')][_0xeaf5('0x11')]);}})[_0xeaf5('0x13')](function(_0xfb4c8a){logger['error'](_0xeaf5('0xa'),_0x31a93a,_0xfb4c8a);_0x156ac5(_0xfb4c8a);});});}
\ No newline at end of file
+var _0x5a21=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x14a62c,_0x5c77e1){var _0x5bab14=function(_0xa6dc35){while(--_0xa6dc35){_0x14a62c['push'](_0x14a62c['shift']());}};_0x5bab14(++_0x5c77e1);}(_0x5a21,0x13f));var _0x15a2=function(_0x4ee695,_0x5a579b){_0x4ee695=_0x4ee695-0x0;var _0x165508=_0x5a21[_0x4ee695];return _0x165508;};'use strict';var _=require(_0x15a2('0x0'));var util=require(_0x15a2('0x1'));var moment=require(_0x15a2('0x2'));var BPromise=require(_0x15a2('0x3'));var rs=require(_0x15a2('0x4'));var fs=require('fs');var Redis=require(_0x15a2('0x5'));var db=require(_0x15a2('0x6'))['db'];var utils=require(_0x15a2('0x7'));var logger=require(_0x15a2('0x8'))('rpc');var config=require(_0x15a2('0x9'));var jayson=require(_0x15a2('0xa'));var client=jayson[_0x15a2('0xb')][_0x15a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4acbdb,_0x2a4210,_0x3ca566){return new BPromise(function(_0x3441f9,_0x9090a4){return client[_0x15a2('0xd')](_0x4acbdb,_0x3ca566)[_0x15a2('0xe')](function(_0x58217f){logger[_0x15a2('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a4210,_0x15a2('0x10'));logger[_0x15a2('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2a4210,'request\x20sent',JSON['stringify'](_0x58217f));if(_0x58217f[_0x15a2('0x12')]){if(_0x58217f['error']['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x2a4210,_0x58217f[_0x15a2('0x12')][_0x15a2('0x13')]);return _0x9090a4(_0x58217f[_0x15a2('0x12')][_0x15a2('0x13')]);}logger[_0x15a2('0x12')](_0x15a2('0x14'),_0x2a4210,_0x58217f[_0x15a2('0x12')][_0x15a2('0x13')]);return _0x3441f9(_0x58217f[_0x15a2('0x12')][_0x15a2('0x13')]);}else{logger[_0x15a2('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a4210,_0x15a2('0x10'));_0x3441f9(_0x58217f[_0x15a2('0x15')][_0x15a2('0x13')]);}})[_0x15a2('0x16')](function(_0x5d111e){logger[_0x15a2('0x12')](_0x15a2('0x14'),_0x2a4210,_0x5d111e);_0x9090a4(_0x5d111e);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d469e8c..3f6fa0d 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x593245,_0x389f68){_0x593245=_0x593245-0x0;var _0x34ac09=_0xb4c7[_0x593245];return _0x34ac09;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
+var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x718cde,_0x20343f){var _0xdf36a3=function(_0xe2b91b){while(--_0xe2b91b){_0x718cde['push'](_0x718cde['shift']());}};_0xdf36a3(++_0x20343f);}(_0x032e,0x124));var _0xe032=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x032e[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index bf62e67..48731a3 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 _0x38ca=['ENUM','rrmemory','beepall','roundrobin'];(function(_0x41bc2b,_0x22aa30){var _0x712fec=function(_0x174dc7){while(--_0x174dc7){_0x41bc2b['push'](_0x41bc2b['shift']());}};_0x712fec(++_0x22aa30);}(_0x38ca,0x114));var _0xa38c=function(_0x3ab1ad,_0x267591){_0x3ab1ad=_0x3ab1ad-0x0;var _0x57ee2b=_0x38ca[_0x3ab1ad];return _0x57ee2b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa38c('0x0')](_0xa38c('0x1'),_0xa38c('0x2'),_0xa38c('0x3'))}};
\ No newline at end of file
+var _0xb8b3=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x4ce5f3,_0x4f08ac){var _0x5537c2=function(_0x3547ec){while(--_0x3547ec){_0x4ce5f3['push'](_0x4ce5f3['shift']());}};_0x5537c2(++_0x4f08ac);}(_0xb8b3,0x16e));var _0x3b8b=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0xb8b3[_0x2ed7d1];return _0x38ae3c;};'use strict';var Sequelize=require('sequelize');module[_0x3b8b('0x0')]={'name':{'type':Sequelize[_0x3b8b('0x1')],'unique':_0x3b8b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3b8b('0x1')]},'timeout':{'type':Sequelize[_0x3b8b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3b8b('0x4')](_0x3b8b('0x5'),_0x3b8b('0x6'),_0x3b8b('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 8bd5141..e4c7209 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 _0xc3f9=['userProfileId','autoAssociation','body','describe','getMembers','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','format','%s/%s','chatPause','createdAt','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','emit','removeTeams','select','field','tq.TeamId','team_has_chat_queues','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','User','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find'];(function(_0x36d646,_0x50ecc5){var _0x2b37d6=function(_0x28e207){while(--_0x28e207){_0x36d646['push'](_0x36d646['shift']());}};_0x2b37d6(++_0x50ecc5);}(_0xc3f9,0xd0));var _0x9c3f=function(_0x108977,_0x22ec52){_0x108977=_0x108977-0x0;var _0x441ad5=_0xc3f9[_0x108977];return _0x441ad5;};'use strict';var emlformat=require(_0x9c3f('0x0'));var rimraf=require(_0x9c3f('0x1'));var zipdir=require(_0x9c3f('0x2'));var jsonpatch=require(_0x9c3f('0x3'));var rp=require(_0x9c3f('0x4'));var moment=require(_0x9c3f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c3f('0x6'));var util=require(_0x9c3f('0x7'));var path=require(_0x9c3f('0x8'));var sox=require(_0x9c3f('0x9'));var csv=require(_0x9c3f('0xa'));var ejs=require(_0x9c3f('0xb'));var fs=require('fs');var fs_extra=require(_0x9c3f('0xc'));var _=require(_0x9c3f('0xd'));var squel=require(_0x9c3f('0xe'));var crypto=require(_0x9c3f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9c3f('0x10'));var toCsv=require(_0x9c3f('0xa'));var querystring=require(_0x9c3f('0x11'));var Papa=require(_0x9c3f('0x12'));var Redis=require('ioredis');var authService=require(_0x9c3f('0x13'));var qs=require(_0x9c3f('0x14'));var as=require(_0x9c3f('0x15'));var hardwareService=require(_0x9c3f('0x16'));var logger=require(_0x9c3f('0x17'))(_0x9c3f('0x18'));var utils=require('../../config/utils');var config=require(_0x9c3f('0x19'));var licenseUtil=require(_0x9c3f('0x1a'));var db=require(_0x9c3f('0x1b'))['db'];config['redis']=_[_0x9c3f('0x1c')](config[_0x9c3f('0x1d')],{'host':_0x9c3f('0x1e'),'port':0x18eb});var socket=require(_0x9c3f('0x1f'))(new Redis(config['redis']));require(_0x9c3f('0x20'))[_0x9c3f('0x21')](socket);var jayson=require(_0x9c3f('0x22'));var client=jayson[_0x9c3f('0x23')][_0x9c3f('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x4e9bc8,_0x583573,_0x1072dd,_0x4b8a51){return new BPromise(function(_0x2bad68,_0x3ba901){var _0x3c9ec5=_0x4b8a51||client;return _0x3c9ec5['request'](_0x4e9bc8,_0x1072dd)[_0x9c3f('0x25')](function(_0x5c22b6){logger[_0x9c3f('0x26')](_0x9c3f('0x27'),_0x583573,_0x9c3f('0x28'));logger[_0x9c3f('0x29')](_0x9c3f('0x2a'),_0x583573,_0x9c3f('0x28'),JSON['stringify'](_0x5c22b6));if(_0x5c22b6[_0x9c3f('0x2b')]){if(_0x5c22b6[_0x9c3f('0x2b')][_0x9c3f('0x2c')]===0x1f4){logger[_0x9c3f('0x2b')](_0x9c3f('0x27'),_0x583573,_0x5c22b6['error']['message']);return _0x3ba901(_0x5c22b6[_0x9c3f('0x2b')][_0x9c3f('0x2d')]);}logger[_0x9c3f('0x2b')](_0x9c3f('0x27'),_0x583573,_0x5c22b6[_0x9c3f('0x2b')][_0x9c3f('0x2d')]);return _0x2bad68(_0x5c22b6[_0x9c3f('0x2b')]['message']);}else{logger[_0x9c3f('0x26')](_0x9c3f('0x27'),_0x583573,_0x9c3f('0x28'));_0x2bad68(_0x5c22b6[_0x9c3f('0x2e')][_0x9c3f('0x2d')]);}})[_0x9c3f('0x2f')](function(_0x28c1db){logger[_0x9c3f('0x2b')](_0x9c3f('0x27'),_0x583573,_0x28c1db);_0x3ba901(_0x28c1db);});});}function respondWithStatusCode(_0x19072b,_0xc0b5f4){_0xc0b5f4=_0xc0b5f4||0xcc;return function(_0x302092){if(_0x302092){return _0x19072b['sendStatus'](_0xc0b5f4);}return _0x19072b[_0x9c3f('0x30')](_0xc0b5f4)['end']();};}function respondWithResult(_0x30504c,_0x380a26){_0x380a26=_0x380a26||0xc8;return function(_0x334660){if(_0x334660){return _0x30504c[_0x9c3f('0x30')](_0x380a26)[_0x9c3f('0x31')](_0x334660);}};}function respondWithFilteredResult(_0x4b7550,_0x14439b){return function(_0x4bcb6f){if(_0x4bcb6f){var _0x34139a=typeof _0x14439b['offset']===_0x9c3f('0x32')&&typeof _0x14439b[_0x9c3f('0x33')]==='undefined';var _0x35e6d8=_0x4bcb6f['count'];var _0x509a27=_0x34139a?0x0:_0x14439b[_0x9c3f('0x34')];var _0x2ae502=_0x34139a?_0x4bcb6f[_0x9c3f('0x35')]:_0x14439b['offset']+_0x14439b[_0x9c3f('0x33')];var _0x4387c1;if(_0x2ae502>=_0x35e6d8){_0x2ae502=_0x35e6d8;_0x4387c1=0xc8;}else{_0x4387c1=0xce;}_0x4b7550[_0x9c3f('0x30')](_0x4387c1);return _0x4b7550[_0x9c3f('0x36')](_0x9c3f('0x37'),_0x509a27+'-'+_0x2ae502+'/'+_0x35e6d8)[_0x9c3f('0x31')](_0x4bcb6f);}return null;};}function patchUpdates(_0x3adf0a){return function(_0x404f38){try{jsonpatch[_0x9c3f('0x38')](_0x404f38,_0x3adf0a,!![]);}catch(_0x189c6e){return BPromise[_0x9c3f('0x39')](_0x189c6e);}return _0x404f38[_0x9c3f('0x3a')]();};}function saveUpdates(_0x21d2f8,_0xd8ce4b){return function(_0x19ff09){if(_0x19ff09){return _0x19ff09[_0x9c3f('0x3b')](_0x21d2f8)[_0x9c3f('0x25')](function(_0x49f1f4){return _0x49f1f4;});}return null;};}function removeEntity(_0x5232cf,_0x55c0b3){return function(_0x11a4b9){if(_0x11a4b9){return _0x11a4b9[_0x9c3f('0x3c')]()[_0x9c3f('0x25')](function(){var _0x37868d=_0x11a4b9[_0x9c3f('0x3d')]({'plain':!![]});var _0x3460bc=_0x9c3f('0x3e');return db[_0x9c3f('0x3f')]['destroy']({'where':{'type':_0x3460bc,'resourceId':_0x37868d['id']}})[_0x9c3f('0x25')](function(){return _0x11a4b9;});})[_0x9c3f('0x25')](function(){_0x5232cf[_0x9c3f('0x30')](0xcc)[_0x9c3f('0x40')]();});}};}function handleEntityNotFound(_0x53428a,_0x209480){return function(_0x7108f){if(!_0x7108f){_0x53428a['sendStatus'](0x194);}return _0x7108f;};}function handleError(_0x5443a7,_0x4af659){_0x4af659=_0x4af659||0x1f4;return function(_0x1acf34){logger[_0x9c3f('0x2b')](_0x1acf34[_0x9c3f('0x41')]);if(_0x1acf34[_0x9c3f('0x42')]){delete _0x1acf34[_0x9c3f('0x42')];}_0x5443a7[_0x9c3f('0x30')](_0x4af659)[_0x9c3f('0x43')](_0x1acf34);};}exports[_0x9c3f('0x44')]=function(_0x5d41fc,_0x193e3e){var _0x409148={},_0x1cac72={},_0x53111b={'count':0x0,'rows':[]};var _0x4e5b6d=_[_0x9c3f('0x45')](db[_0x9c3f('0x46')][_0x9c3f('0x47')],function(_0x1ac0be){return{'name':_0x1ac0be['fieldName'],'type':_0x1ac0be[_0x9c3f('0x48')][_0x9c3f('0x49')]};});_0x1cac72[_0x9c3f('0x4a')]=_['map'](_0x4e5b6d,_0x9c3f('0x42'));_0x1cac72['query']=_[_0x9c3f('0x4b')](_0x5d41fc[_0x9c3f('0x4c')]);_0x1cac72[_0x9c3f('0x4d')]=_[_0x9c3f('0x4e')](_0x1cac72['model'],_0x1cac72[_0x9c3f('0x4c')]);_0x409148[_0x9c3f('0x4f')]=_[_0x9c3f('0x4e')](_0x1cac72[_0x9c3f('0x4a')],qs[_0x9c3f('0x50')](_0x5d41fc[_0x9c3f('0x4c')][_0x9c3f('0x50')]));_0x409148[_0x9c3f('0x4f')]=_0x409148[_0x9c3f('0x4f')][_0x9c3f('0x51')]?_0x409148[_0x9c3f('0x4f')]:_0x1cac72[_0x9c3f('0x4a')];if(!_0x5d41fc[_0x9c3f('0x4c')][_0x9c3f('0x52')](_0x9c3f('0x53'))){_0x409148[_0x9c3f('0x33')]=qs['limit'](_0x5d41fc['query'][_0x9c3f('0x33')]);_0x409148['offset']=qs[_0x9c3f('0x34')](_0x5d41fc['query'][_0x9c3f('0x34')]);}_0x409148[_0x9c3f('0x54')]=qs[_0x9c3f('0x55')](_0x5d41fc[_0x9c3f('0x4c')]['sort']);_0x409148['where']=qs[_0x9c3f('0x4d')](_[_0x9c3f('0x56')](_0x5d41fc[_0x9c3f('0x4c')],_0x1cac72[_0x9c3f('0x4d')]),_0x4e5b6d);if(_0x5d41fc['query'][_0x9c3f('0x57')]){_0x409148[_0x9c3f('0x58')]=_[_0x9c3f('0x59')](_0x409148[_0x9c3f('0x58')],{'$or':_[_0x9c3f('0x45')](_0x4e5b6d,function(_0x236d11){if(_0x236d11['type']!=='VIRTUAL'){var _0x2074f1={};_0x2074f1[_0x236d11['name']]={'$like':'%'+_0x5d41fc['query']['filter']+'%'};return _0x2074f1;}})});}_0x409148=_[_0x9c3f('0x59')]({},_0x409148,_0x5d41fc[_0x9c3f('0x5a')]);var _0x306b9e={'where':_0x409148[_0x9c3f('0x58')]};return db['ChatQueue']['count'](_0x306b9e)[_0x9c3f('0x25')](function(_0x17d79a){_0x53111b[_0x9c3f('0x35')]=_0x17d79a;if(_0x5d41fc[_0x9c3f('0x4c')][_0x9c3f('0x5b')]){_0x409148['include']=[{'all':!![]}];}return db[_0x9c3f('0x46')][_0x9c3f('0x5c')](_0x409148);})[_0x9c3f('0x25')](function(_0xe802f4){_0x53111b[_0x9c3f('0x5d')]=_0xe802f4;return _0x53111b;})['then'](respondWithFilteredResult(_0x193e3e,_0x409148))[_0x9c3f('0x2f')](handleError(_0x193e3e,null));};exports[_0x9c3f('0x5e')]=function(_0x6c6e7c,_0x3be2ed){var _0x50e2d0={'raw':!![],'where':{'id':_0x6c6e7c[_0x9c3f('0x5f')]['id']}},_0x10147e={};_0x10147e[_0x9c3f('0x4a')]=_['keys'](db[_0x9c3f('0x46')][_0x9c3f('0x47')]);_0x10147e[_0x9c3f('0x4c')]=_['keys'](_0x6c6e7c[_0x9c3f('0x4c')]);_0x10147e[_0x9c3f('0x4d')]=_['intersection'](_0x10147e['model'],_0x10147e[_0x9c3f('0x4c')]);_0x50e2d0['attributes']=_['intersection'](_0x10147e[_0x9c3f('0x4a')],qs[_0x9c3f('0x50')](_0x6c6e7c[_0x9c3f('0x4c')][_0x9c3f('0x50')]));_0x50e2d0['attributes']=_0x50e2d0[_0x9c3f('0x4f')][_0x9c3f('0x51')]?_0x50e2d0[_0x9c3f('0x4f')]:_0x10147e[_0x9c3f('0x4a')];if(_0x6c6e7c[_0x9c3f('0x4c')]['includeAll']){_0x50e2d0[_0x9c3f('0x60')]=[{'all':!![]}];}_0x50e2d0=_['merge']({},_0x50e2d0,_0x6c6e7c[_0x9c3f('0x5a')]);return db[_0x9c3f('0x46')]['find'](_0x50e2d0)[_0x9c3f('0x25')](handleEntityNotFound(_0x3be2ed,null))[_0x9c3f('0x25')](respondWithResult(_0x3be2ed,null))[_0x9c3f('0x2f')](handleError(_0x3be2ed,null));};exports[_0x9c3f('0x61')]=function(_0x442e7a,_0x3ae916){return db['ChatQueue'][_0x9c3f('0x61')](_0x442e7a['body'],{})['then'](function(_0x1058b0){var _0x290c25=_0x442e7a['user'][_0x9c3f('0x3d')]({'plain':!![]});if(!_0x290c25)throw new Error(_0x9c3f('0x62'));if(_0x290c25['role']===_0x9c3f('0x63')){var _0x5b93bd=_0x1058b0[_0x9c3f('0x3d')]({'plain':!![]});var _0xc96fed='ChatQueues';return db[_0x9c3f('0x64')][_0x9c3f('0x65')]({'where':{'name':_0xc96fed,'userProfileId':_0x290c25[_0x9c3f('0x66')]},'raw':!![]})[_0x9c3f('0x25')](function(_0x3cb128){if(_0x3cb128&&_0x3cb128[_0x9c3f('0x67')]===0x0){return db[_0x9c3f('0x3f')]['create']({'name':_0x5b93bd['name'],'resourceId':_0x5b93bd['id'],'type':_0x3cb128['name'],'sectionId':_0x3cb128['id']},{})[_0x9c3f('0x25')](function(){return _0x1058b0;});}else{return _0x1058b0;}})[_0x9c3f('0x2f')](function(_0x3a0571){logger[_0x9c3f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a0571);throw _0x3a0571;});}return _0x1058b0;})[_0x9c3f('0x25')](respondWithResult(_0x3ae916,0xc9))[_0x9c3f('0x2f')](handleError(_0x3ae916,null));};exports['update']=function(_0x48181c,_0x38b443){if(_0x48181c[_0x9c3f('0x68')]['id']){delete _0x48181c[_0x9c3f('0x68')]['id'];}return db[_0x9c3f('0x46')]['find']({'where':{'id':_0x48181c[_0x9c3f('0x5f')]['id']}})[_0x9c3f('0x25')](handleEntityNotFound(_0x38b443,null))[_0x9c3f('0x25')](saveUpdates(_0x48181c['body'],null))['then'](respondWithResult(_0x38b443,null))['catch'](handleError(_0x38b443,null));};exports[_0x9c3f('0x3c')]=function(_0x407aca,_0x552161){return db[_0x9c3f('0x46')][_0x9c3f('0x65')]({'where':{'id':_0x407aca[_0x9c3f('0x5f')]['id']}})['then'](handleEntityNotFound(_0x552161,null))[_0x9c3f('0x25')](removeEntity(_0x552161,null))[_0x9c3f('0x2f')](handleError(_0x552161,null));};exports[_0x9c3f('0x69')]=function(_0x5ea475,_0x65049f){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x65049f,null))['catch'](handleError(_0x65049f,null));};exports[_0x9c3f('0x6a')]=function(_0x4b8b2b,_0x1dff6d,_0x9083f7){var _0x3126c0={'raw':!![],'where':{}},_0x155557={},_0x1d5f48;return db[_0x9c3f('0x46')]['findOne']({'where':{'id':_0x4b8b2b[_0x9c3f('0x5f')]['id']}})[_0x9c3f('0x25')](handleEntityNotFound(_0x1dff6d,null))[_0x9c3f('0x25')](function(_0x4ec9e1){if(_0x4ec9e1){_0x1d5f48=_0x4ec9e1[_0x9c3f('0x3d')]({'plain':!![]});_0x155557[_0x9c3f('0x4a')]=_[_0x9c3f('0x4b')](db[_0x9c3f('0x6b')][_0x9c3f('0x47')]);_0x155557[_0x9c3f('0x4c')]=_['keys'](_0x4b8b2b[_0x9c3f('0x4c')]);_0x155557[_0x9c3f('0x4d')]=_['intersection'](_0x155557[_0x9c3f('0x4a')],_0x155557[_0x9c3f('0x4c')]);_0x3126c0['attributes']=_[_0x9c3f('0x4e')](_0x155557[_0x9c3f('0x4a')],qs['fields'](_0x4b8b2b[_0x9c3f('0x4c')][_0x9c3f('0x50')]));_0x3126c0[_0x9c3f('0x4f')]=_0x3126c0[_0x9c3f('0x4f')][_0x9c3f('0x51')]?_0x3126c0[_0x9c3f('0x4f')]:_0x155557[_0x9c3f('0x4a')];if(!_0x4b8b2b[_0x9c3f('0x4c')][_0x9c3f('0x52')]('nolimit')){_0x3126c0['limit']=qs[_0x9c3f('0x33')](_0x4b8b2b[_0x9c3f('0x4c')][_0x9c3f('0x33')]);_0x3126c0[_0x9c3f('0x34')]=qs['offset'](_0x4b8b2b[_0x9c3f('0x4c')][_0x9c3f('0x34')]);}_0x3126c0[_0x9c3f('0x54')]=qs[_0x9c3f('0x55')](_0x4b8b2b['query'][_0x9c3f('0x55')]);_0x3126c0[_0x9c3f('0x58')]=qs[_0x9c3f('0x4d')](_[_0x9c3f('0x56')](_0x4b8b2b[_0x9c3f('0x4c')],_0x155557['filters']));_0x3126c0[_0x9c3f('0x58')][_0x9c3f('0x6c')]=_0x4ec9e1['id'];if(_0x4b8b2b[_0x9c3f('0x4c')]['filter']){_0x3126c0[_0x9c3f('0x58')]=_[_0x9c3f('0x59')](_0x3126c0['where'],{'$or':_['map'](_0x3126c0['attributes'],function(_0x19aa10){var _0x36f514={};_0x36f514[_0x19aa10]={'$like':'%'+_0x4b8b2b[_0x9c3f('0x4c')][_0x9c3f('0x57')]+'%'};return _0x36f514;})});}_0x3126c0=_[_0x9c3f('0x59')]({},_0x3126c0,_0x4b8b2b[_0x9c3f('0x5a')]);return db[_0x9c3f('0x6b')][_0x9c3f('0x5c')](_0x3126c0);}})[_0x9c3f('0x25')](function(_0x267f00){if(_0x267f00){return db['User'][_0x9c3f('0x6d')]({'where':{'id':_['map'](_0x267f00,_0x9c3f('0x6e')),'role':_0x9c3f('0x6f')},'attributes':['id',_0x9c3f('0x42'),'chatPause','updatedAt','createdAt']});}})[_0x9c3f('0x25')](function(_0x57f173){if(_0x57f173){return{'count':_0x57f173[_0x9c3f('0x35')],'rows':_[_0x9c3f('0x45')](_0x57f173[_0x9c3f('0x5d')],function(_0x142d72){return{'membername':_0x142d72[_0x9c3f('0x42')],'UserId':_0x142d72['id'],'queue_name':_0x1d5f48[_0x9c3f('0x42')],'ChatQueueId':_0x1d5f48['id'],'interface':util[_0x9c3f('0x70')](_0x9c3f('0x71'),'SIP',_0x142d72[_0x9c3f('0x42')]),'penalty':0x0,'paused':_0x142d72[_0x9c3f('0x72')],'createdAt':_0x142d72[_0x9c3f('0x73')],'updatedAt':_0x142d72['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9c3f('0x25')](respondWithFilteredResult(_0x1dff6d,_0x3126c0))['catch'](handleError(_0x1dff6d,null));};exports[_0x9c3f('0x74')]=function(_0x2934d5,_0x540b75,_0x207171){var _0x446893={};var _0x49ba91={};var _0x24f3e8;var _0x3bc9f8;return db['ChatQueue'][_0x9c3f('0x75')]({'where':{'id':_0x2934d5[_0x9c3f('0x5f')]['id']}})[_0x9c3f('0x25')](handleEntityNotFound(_0x540b75,null))[_0x9c3f('0x25')](function(_0x3bf40e){if(_0x3bf40e){_0x24f3e8=_0x3bf40e;_0x49ba91[_0x9c3f('0x4a')]=_[_0x9c3f('0x4b')](db[_0x9c3f('0x76')][_0x9c3f('0x47')]);_0x49ba91[_0x9c3f('0x4c')]=_[_0x9c3f('0x4b')](_0x2934d5[_0x9c3f('0x4c')]);_0x49ba91['filters']=_[_0x9c3f('0x4e')](_0x49ba91[_0x9c3f('0x4a')],_0x49ba91[_0x9c3f('0x4c')]);_0x446893[_0x9c3f('0x4f')]=_[_0x9c3f('0x4e')](_0x49ba91['model'],qs[_0x9c3f('0x50')](_0x2934d5[_0x9c3f('0x4c')][_0x9c3f('0x50')]));_0x446893[_0x9c3f('0x4f')]=_0x446893['attributes'][_0x9c3f('0x51')]?_0x446893[_0x9c3f('0x4f')]:_0x49ba91[_0x9c3f('0x4a')];_0x446893[_0x9c3f('0x54')]=qs[_0x9c3f('0x55')](_0x2934d5[_0x9c3f('0x4c')]['sort']);_0x446893[_0x9c3f('0x58')]=qs[_0x9c3f('0x4d')](_[_0x9c3f('0x56')](_0x2934d5[_0x9c3f('0x4c')],_0x49ba91[_0x9c3f('0x4d')]));if(_0x2934d5[_0x9c3f('0x4c')][_0x9c3f('0x57')]){_0x446893[_0x9c3f('0x58')]=_['merge'](_0x446893[_0x9c3f('0x58')],{'$or':_[_0x9c3f('0x45')](_0x446893[_0x9c3f('0x4f')],function(_0xf88acd){var _0x214c40={};_0x214c40[_0xf88acd]={'$like':'%'+_0x2934d5['query']['filter']+'%'};return _0x214c40;})});}_0x446893=_[_0x9c3f('0x59')]({},_0x446893,_0x2934d5['options']);return _0x24f3e8[_0x9c3f('0x74')](_0x446893);}})[_0x9c3f('0x25')](function(_0x3173c4){if(_0x3173c4){_0x3bc9f8=_0x3173c4['length'];if(!_0x2934d5['query']['hasOwnProperty']('nolimit')){_0x446893[_0x9c3f('0x33')]=qs[_0x9c3f('0x33')](_0x2934d5[_0x9c3f('0x4c')][_0x9c3f('0x33')]);_0x446893[_0x9c3f('0x34')]=qs[_0x9c3f('0x34')](_0x2934d5[_0x9c3f('0x4c')]['offset']);}return _0x24f3e8[_0x9c3f('0x74')](_0x446893);}})[_0x9c3f('0x25')](function(_0x47ef7f){if(_0x47ef7f){return _0x47ef7f?{'count':_0x3bc9f8,'rows':_0x47ef7f}:null;}})[_0x9c3f('0x25')](respondWithResult(_0x540b75,null))[_0x9c3f('0x2f')](handleError(_0x540b75,null));};exports[_0x9c3f('0x77')]=function(_0x53c266,_0x32af94,_0x3b6935){var _0x4a203c=_0x53c266['body'][_0x9c3f('0x78')];return db['Team'][_0x9c3f('0x5c')]({'where':{'id':_0x4a203c},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x9c3f('0x42'),_0x9c3f('0x79'),_0x9c3f('0x7a'),_0x9c3f('0x7b')],'raw':!![]}]})['then'](function(_0x2575ef){if(_0x2575ef){var _0x5c5a0d=_[_0x9c3f('0x7c')](_0x2575ef,function(_0x3afddc){var _0x33827b=_0x3afddc[_0x9c3f('0x3d')]({'plain':!![]});return _0x33827b[_0x9c3f('0x7d')];});return db[_0x9c3f('0x46')][_0x9c3f('0x65')]({'where':{'id':_0x53c266[_0x9c3f('0x5f')]['id']}})['then'](function(_0x4a47eb){return db[_0x9c3f('0x7e')]['transaction'](function(_0x4266ef){return _0x4a47eb[_0x9c3f('0x77')](_0x4a203c,{'transaction':_0x4266ef})[_0x9c3f('0x25')](function(){return BPromise['each'](_0x5c5a0d,function(_0x11b85f){return db[_0x9c3f('0x6b')][_0x9c3f('0x7f')]({'where':{'UserId':_0x11b85f['id'],'ChatQueueId':_0x53c266['params']['id']},'transaction':_0x4266ef});});})[_0x9c3f('0x25')](function(){_0x5c5a0d['forEach'](function(_0x4ed564){socket[_0x9c3f('0x80')]('userChatQueue:save',{'UserId':_0x4ed564['id'],'ChatQueueId':_0x4a47eb['id']});});});});});}})['then'](respondWithStatusCode(_0x32af94,null))[_0x9c3f('0x2f')](handleError(_0x32af94,null));};exports[_0x9c3f('0x81')]=function(_0x487ef0,_0x5834b7,_0x37f4f8){return db['Team'][_0x9c3f('0x5c')]({'where':{'id':_0x487ef0['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9c3f('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x9c3f('0x25')](handleEntityNotFound(_0x5834b7,null))[_0x9c3f('0x25')](function(_0x31f1f2){var _0x131157=_[_0x9c3f('0x45')](_0x31f1f2,'id');var _0x1af3f7=[];var _0x8c02f5=[];var _0x396ba5=squel[_0x9c3f('0x82')]();_0x396ba5[_0x9c3f('0x83')](_0x9c3f('0x84'))['from'](_0x9c3f('0x85'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9c3f('0x58')](_0x9c3f('0x86'),_0x487ef0[_0x9c3f('0x5f')]['id']);for(var _0x4a9181=0x0;_0x4a9181<_0x31f1f2[_0x9c3f('0x51')];_0x4a9181+=0x1){let _0x9e0055=_0x31f1f2[_0x4a9181];for(var _0x4281be=0x0;_0x4281be<_0x9e0055[_0x9c3f('0x7d')]['length'];_0x4281be+=0x1){let _0x4fcba9=_0x9e0055[_0x9c3f('0x7d')][_0x4281be];var _0x165dd3=_0x396ba5['clone']();_0x165dd3[_0x9c3f('0x58')](_0x9c3f('0x87'),_0x4fcba9['id']);_0x8c02f5['push'](db['sequelize'][_0x9c3f('0x4c')](_0x165dd3[_0x9c3f('0x88')](),{'type':db[_0x9c3f('0x7e')][_0x9c3f('0x89')]['SELECT']})['then'](function(_0x14289d){if(_0x14289d[_0x9c3f('0x51')]===0x1){return _0x4fcba9['id'];}else{var _0x5b25f0=_[_0x9c3f('0x8a')](_[_0x9c3f('0x45')](_0x14289d,'TeamId'),function(_0x2cdc44){return _['includes'](_0x131157,_0x2cdc44);});if(_0x5b25f0){return _0x4fcba9['id'];}}}));}}return BPromise[_0x9c3f('0x8b')](_0x8c02f5)[_0x9c3f('0x25')](function(_0x1a38b6){_0x1af3f7=_(_0x1af3f7)[_0x9c3f('0x8c')](_0x1a38b6)[_0x9c3f('0x8d')]()[_0x9c3f('0x8e')]();return db[_0x9c3f('0x46')][_0x9c3f('0x65')]({'where':{'id':_0x487ef0['params']['id']}})[_0x9c3f('0x25')](function(_0x3606a0){return db[_0x9c3f('0x7e')][_0x9c3f('0x8f')](function(_0x40445d){return _0x3606a0[_0x9c3f('0x81')](_0x487ef0[_0x9c3f('0x4c')][_0x9c3f('0x78')],{'transaction':_0x40445d})['then'](function(){if(!_[_0x9c3f('0x90')](_0x1af3f7)){return _0x3606a0[_0x9c3f('0x91')](_0x1af3f7,{'transaction':_0x40445d});}})[_0x9c3f('0x25')](function(){_0x1af3f7[_0x9c3f('0x92')](function(_0x5a54af){socket['emit'](_0x9c3f('0x93'),{'UserId':_0x5a54af,'ChatQueueId':_0x3606a0['id']});});});});});});})[_0x9c3f('0x25')](respondWithStatusCode(_0x5834b7,null))['catch'](handleError(_0x5834b7,null));};exports[_0x9c3f('0x94')]=function(_0x15ab76,_0x5284e3,_0x3d557f){return db[_0x9c3f('0x46')][_0x9c3f('0x65')]({'where':{'id':_0x15ab76['params']['id']}})[_0x9c3f('0x25')](handleEntityNotFound(_0x5284e3,null))[_0x9c3f('0x25')](function(_0x1af495){if(_0x1af495){return _0x1af495[_0x9c3f('0x94')](_0x15ab76[_0x9c3f('0x68')][_0x9c3f('0x78')],_[_0x9c3f('0x95')](_0x15ab76[_0x9c3f('0x68')],[_0x9c3f('0x78'),'id'])||{})[_0x9c3f('0x96')](function(_0x1906d9){for(var _0x5ec285=0x0;_0x5ec285<_0x15ab76['body'][_0x9c3f('0x78')]['length'];_0x5ec285+=0x1){socket[_0x9c3f('0x80')](_0x9c3f('0x97'),{'UserId':Number(_0x15ab76[_0x9c3f('0x68')]['ids'][_0x5ec285]),'ChatQueueId':Number(_0x15ab76[_0x9c3f('0x5f')]['id'])});}return _0x1906d9;});}})[_0x9c3f('0x25')](respondWithResult(_0x5284e3,null))[_0x9c3f('0x2f')](handleError(_0x5284e3,null));};exports[_0x9c3f('0x91')]=function(_0x131c18,_0xac63c1,_0x4e70a8){return db[_0x9c3f('0x46')]['find']({'where':{'id':_0x131c18[_0x9c3f('0x5f')]['id']}})[_0x9c3f('0x25')](handleEntityNotFound(_0xac63c1,null))[_0x9c3f('0x25')](function(_0x211097){if(_0x211097){return _0x211097[_0x9c3f('0x91')](_0x131c18[_0x9c3f('0x4c')][_0x9c3f('0x78')])['then'](function(){if(_[_0x9c3f('0x98')](_0x131c18[_0x9c3f('0x4c')][_0x9c3f('0x78')])){for(var _0x32673a=0x0;_0x32673a<_0x131c18[_0x9c3f('0x4c')][_0x9c3f('0x78')][_0x9c3f('0x51')];_0x32673a+=0x1){socket[_0x9c3f('0x80')](_0x9c3f('0x93'),{'UserId':Number(_0x131c18[_0x9c3f('0x4c')][_0x9c3f('0x78')][_0x32673a]),'ChatQueueId':Number(_0x131c18[_0x9c3f('0x5f')]['id'])});}}else{socket[_0x9c3f('0x80')](_0x9c3f('0x93'),{'UserId':Number(_0x131c18[_0x9c3f('0x4c')]['ids']),'ChatQueueId':Number(_0x131c18['params']['id'])});}});}})[_0x9c3f('0x25')](respondWithStatusCode(_0xac63c1,null))[_0x9c3f('0x2f')](handleError(_0xac63c1,null));};exports[_0x9c3f('0x99')]=function(_0x295168,_0x148aa7,_0x37fe96){var _0x1bd606={};var _0x5e3747={};var _0x37b293;var _0x3359b7;return db[_0x9c3f('0x46')][_0x9c3f('0x75')]({'where':{'id':_0x295168[_0x9c3f('0x5f')]['id']}})[_0x9c3f('0x25')](handleEntityNotFound(_0x148aa7,null))[_0x9c3f('0x25')](function(_0x48fefd){if(_0x48fefd){_0x37b293=_0x48fefd;_0x5e3747['model']=_[_0x9c3f('0x4b')](db[_0x9c3f('0x9a')][_0x9c3f('0x47')]);_0x5e3747[_0x9c3f('0x4c')]=_['keys'](_0x295168['query']);_0x5e3747['filters']=_[_0x9c3f('0x4e')](_0x5e3747[_0x9c3f('0x4a')],_0x5e3747[_0x9c3f('0x4c')]);_0x1bd606[_0x9c3f('0x4f')]=_[_0x9c3f('0x4e')](_0x5e3747[_0x9c3f('0x4a')],qs[_0x9c3f('0x50')](_0x295168[_0x9c3f('0x4c')][_0x9c3f('0x50')]));_0x1bd606[_0x9c3f('0x4f')]=_0x1bd606[_0x9c3f('0x4f')][_0x9c3f('0x51')]?_0x1bd606[_0x9c3f('0x4f')]:_0x5e3747['model'];_0x1bd606[_0x9c3f('0x54')]=qs[_0x9c3f('0x55')](_0x295168[_0x9c3f('0x4c')][_0x9c3f('0x55')]);_0x1bd606[_0x9c3f('0x58')]=qs[_0x9c3f('0x4d')](_[_0x9c3f('0x56')](_0x295168[_0x9c3f('0x4c')],_0x5e3747[_0x9c3f('0x4d')]));if(_0x295168['query']['filter']){_0x1bd606[_0x9c3f('0x58')]=_[_0x9c3f('0x59')](_0x1bd606[_0x9c3f('0x58')],{'$or':_['map'](_0x1bd606[_0x9c3f('0x4f')],function(_0x32e189){var _0x5d98b3={};_0x5d98b3[_0x32e189]={'$like':'%'+_0x295168[_0x9c3f('0x4c')]['filter']+'%'};return _0x5d98b3;})});}_0x1bd606=_[_0x9c3f('0x59')]({},_0x1bd606,_0x295168[_0x9c3f('0x5a')]);return _0x37b293['getAgents'](_0x1bd606);}})[_0x9c3f('0x25')](function(_0x19aaf5){if(_0x19aaf5){_0x3359b7=_0x19aaf5['length'];if(!_0x295168[_0x9c3f('0x4c')]['hasOwnProperty']('nolimit')){_0x1bd606[_0x9c3f('0x33')]=qs[_0x9c3f('0x33')](_0x295168[_0x9c3f('0x4c')][_0x9c3f('0x33')]);_0x1bd606['offset']=qs['offset'](_0x295168['query']['offset']);}return _0x37b293[_0x9c3f('0x99')](_0x1bd606);}})[_0x9c3f('0x25')](function(_0x3966fc){if(_0x3966fc){return _0x3966fc?{'count':_0x3359b7,'rows':_0x3966fc}:null;}})['then'](respondWithResult(_0x148aa7,null))[_0x9c3f('0x2f')](handleError(_0x148aa7,null));};
\ No newline at end of file
+var _0xaf21=['findAll','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userChatQueue:remove','rawAttributes','getAgents','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','ChatQueues','UserProfileResource','stack','name','index','ChatQueue','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','intersection','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','find','describe','getMembers','UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','findOne','Team','getTeams','nolimit','addTeams','ids'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaf21,0x154));var _0x1af2=function(_0x1b80ee,_0x393e5f){_0x1b80ee=_0x1b80ee-0x0;var _0x4c0355=_0xaf21[_0x1b80ee];return _0x4c0355;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1af2('0x0'));var jsonpatch=require(_0x1af2('0x1'));var rp=require(_0x1af2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1af2('0x3'));var util=require(_0x1af2('0x4'));var path=require(_0x1af2('0x5'));var sox=require(_0x1af2('0x6'));var csv=require('to-csv');var ejs=require(_0x1af2('0x7'));var fs=require('fs');var fs_extra=require(_0x1af2('0x8'));var _=require(_0x1af2('0x9'));var squel=require(_0x1af2('0xa'));var crypto=require(_0x1af2('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1af2('0xc'));var querystring=require('querystring');var Papa=require(_0x1af2('0xd'));var Redis=require('ioredis');var authService=require(_0x1af2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1af2('0xf'));var hardwareService=require(_0x1af2('0x10'));var logger=require(_0x1af2('0x11'))(_0x1af2('0x12'));var utils=require(_0x1af2('0x13'));var config=require(_0x1af2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1af2('0x15'))['db'];config[_0x1af2('0x16')]=_['defaults'](config[_0x1af2('0x16')],{'host':_0x1af2('0x17'),'port':0x18eb});var socket=require(_0x1af2('0x18'))(new Redis(config[_0x1af2('0x16')]));require(_0x1af2('0x19'))['register'](socket);var jayson=require(_0x1af2('0x1a'));var client=jayson[_0x1af2('0x1b')][_0x1af2('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xb50d2,_0x15cc49,_0x1ab64f,_0x372a78){return new BPromise(function(_0x2801ab,_0x2caba7){var _0x2a17a8=_0x372a78||client;return _0x2a17a8['request'](_0xb50d2,_0x1ab64f)['then'](function(_0x5137c6){logger[_0x1af2('0x1d')](_0x1af2('0x1e'),_0x15cc49,'request\x20sent');logger[_0x1af2('0x1f')](_0x1af2('0x20'),_0x15cc49,_0x1af2('0x21'),JSON[_0x1af2('0x22')](_0x5137c6));if(_0x5137c6[_0x1af2('0x23')]){if(_0x5137c6['error'][_0x1af2('0x24')]===0x1f4){logger[_0x1af2('0x23')]('ChatQueue,\x20%s,\x20%s',_0x15cc49,_0x5137c6[_0x1af2('0x23')]['message']);return _0x2caba7(_0x5137c6[_0x1af2('0x23')][_0x1af2('0x25')]);}logger['error'](_0x1af2('0x1e'),_0x15cc49,_0x5137c6[_0x1af2('0x23')][_0x1af2('0x25')]);return _0x2801ab(_0x5137c6[_0x1af2('0x23')][_0x1af2('0x25')]);}else{logger[_0x1af2('0x1d')](_0x1af2('0x1e'),_0x15cc49,_0x1af2('0x21'));_0x2801ab(_0x5137c6[_0x1af2('0x26')]['message']);}})[_0x1af2('0x27')](function(_0x3688c3){logger['error'](_0x1af2('0x1e'),_0x15cc49,_0x3688c3);_0x2caba7(_0x3688c3);});});}function respondWithStatusCode(_0x432b22,_0x460be8){_0x460be8=_0x460be8||0xcc;return function(_0x31ec33){if(_0x31ec33){return _0x432b22[_0x1af2('0x28')](_0x460be8);}return _0x432b22[_0x1af2('0x29')](_0x460be8)[_0x1af2('0x2a')]();};}function respondWithResult(_0x2ab26e,_0x54812b){_0x54812b=_0x54812b||0xc8;return function(_0x1f1a1b){if(_0x1f1a1b){return _0x2ab26e[_0x1af2('0x29')](_0x54812b)[_0x1af2('0x2b')](_0x1f1a1b);}};}function respondWithFilteredResult(_0x142ff2,_0x43ec2c){return function(_0x498885){if(_0x498885){var _0x4e8be8=typeof _0x43ec2c[_0x1af2('0x2c')]===_0x1af2('0x2d')&&typeof _0x43ec2c[_0x1af2('0x2e')]===_0x1af2('0x2d');var _0x600798=_0x498885[_0x1af2('0x2f')];var _0x3e00e0=_0x4e8be8?0x0:_0x43ec2c['offset'];var _0x420b8b=_0x4e8be8?_0x498885[_0x1af2('0x2f')]:_0x43ec2c[_0x1af2('0x2c')]+_0x43ec2c[_0x1af2('0x2e')];var _0x251694;if(_0x420b8b>=_0x600798){_0x420b8b=_0x600798;_0x251694=0xc8;}else{_0x251694=0xce;}_0x142ff2[_0x1af2('0x29')](_0x251694);return _0x142ff2[_0x1af2('0x30')](_0x1af2('0x31'),_0x3e00e0+'-'+_0x420b8b+'/'+_0x600798)[_0x1af2('0x2b')](_0x498885);}return null;};}function patchUpdates(_0x693eb0){return function(_0x4c8508){try{jsonpatch['apply'](_0x4c8508,_0x693eb0,!![]);}catch(_0x23276e){return BPromise[_0x1af2('0x32')](_0x23276e);}return _0x4c8508[_0x1af2('0x33')]();};}function saveUpdates(_0x1ca987,_0x101b25){return function(_0x268357){if(_0x268357){return _0x268357[_0x1af2('0x34')](_0x1ca987)[_0x1af2('0x35')](function(_0x33dccc){return _0x33dccc;});}return null;};}function removeEntity(_0x2b0bcb,_0x2378fe){return function(_0x81612e){if(_0x81612e){return _0x81612e[_0x1af2('0x36')]()['then'](function(){var _0x357d48=_0x81612e['get']({'plain':!![]});var _0x3db6da=_0x1af2('0x37');return db[_0x1af2('0x38')]['destroy']({'where':{'type':_0x3db6da,'resourceId':_0x357d48['id']}})[_0x1af2('0x35')](function(){return _0x81612e;});})[_0x1af2('0x35')](function(){_0x2b0bcb[_0x1af2('0x29')](0xcc)[_0x1af2('0x2a')]();});}};}function handleEntityNotFound(_0x257b3a,_0x296e5e){return function(_0x4455d7){if(!_0x4455d7){_0x257b3a[_0x1af2('0x28')](0x194);}return _0x4455d7;};}function handleError(_0x31f4c2,_0x1304f5){_0x1304f5=_0x1304f5||0x1f4;return function(_0x1c63ed){logger[_0x1af2('0x23')](_0x1c63ed[_0x1af2('0x39')]);if(_0x1c63ed[_0x1af2('0x3a')]){delete _0x1c63ed[_0x1af2('0x3a')];}_0x31f4c2['status'](_0x1304f5)['send'](_0x1c63ed);};}exports[_0x1af2('0x3b')]=function(_0x35d72d,_0x7c1dba){var _0x2bce08={},_0x3dc9b3={},_0x5d151f={'count':0x0,'rows':[]};var _0x2ecea5=_['map'](db[_0x1af2('0x3c')]['rawAttributes'],function(_0x43c262){return{'name':_0x43c262[_0x1af2('0x3d')],'type':_0x43c262[_0x1af2('0x3e')]['key']};});_0x3dc9b3[_0x1af2('0x3f')]=_[_0x1af2('0x40')](_0x2ecea5,_0x1af2('0x3a'));_0x3dc9b3[_0x1af2('0x41')]=_[_0x1af2('0x42')](_0x35d72d[_0x1af2('0x41')]);_0x3dc9b3[_0x1af2('0x43')]=_['intersection'](_0x3dc9b3[_0x1af2('0x3f')],_0x3dc9b3[_0x1af2('0x41')]);_0x2bce08[_0x1af2('0x44')]=_['intersection'](_0x3dc9b3[_0x1af2('0x3f')],qs['fields'](_0x35d72d['query'][_0x1af2('0x45')]));_0x2bce08[_0x1af2('0x44')]=_0x2bce08[_0x1af2('0x44')][_0x1af2('0x46')]?_0x2bce08[_0x1af2('0x44')]:_0x3dc9b3['model'];if(!_0x35d72d[_0x1af2('0x41')][_0x1af2('0x47')]('nolimit')){_0x2bce08[_0x1af2('0x2e')]=qs['limit'](_0x35d72d['query']['limit']);_0x2bce08[_0x1af2('0x2c')]=qs['offset'](_0x35d72d[_0x1af2('0x41')][_0x1af2('0x2c')]);}_0x2bce08[_0x1af2('0x48')]=qs[_0x1af2('0x49')](_0x35d72d[_0x1af2('0x41')][_0x1af2('0x49')]);_0x2bce08[_0x1af2('0x4a')]=qs[_0x1af2('0x43')](_[_0x1af2('0x4b')](_0x35d72d['query'],_0x3dc9b3[_0x1af2('0x43')]),_0x2ecea5);if(_0x35d72d[_0x1af2('0x41')][_0x1af2('0x4c')]){_0x2bce08[_0x1af2('0x4a')]=_['merge'](_0x2bce08[_0x1af2('0x4a')],{'$or':_[_0x1af2('0x40')](_0x2ecea5,function(_0x2ad5ca){if(_0x2ad5ca[_0x1af2('0x3e')]!==_0x1af2('0x4d')){var _0x5f42e8={};_0x5f42e8[_0x2ad5ca[_0x1af2('0x3a')]]={'$like':'%'+_0x35d72d['query'][_0x1af2('0x4c')]+'%'};return _0x5f42e8;}})});}_0x2bce08=_[_0x1af2('0x4e')]({},_0x2bce08,_0x35d72d[_0x1af2('0x4f')]);var _0x3fce18={'where':_0x2bce08[_0x1af2('0x4a')]};return db[_0x1af2('0x3c')][_0x1af2('0x2f')](_0x3fce18)[_0x1af2('0x35')](function(_0x348728){_0x5d151f[_0x1af2('0x2f')]=_0x348728;if(_0x35d72d[_0x1af2('0x41')][_0x1af2('0x50')]){_0x2bce08[_0x1af2('0x51')]=[{'all':!![]}];}return db[_0x1af2('0x3c')]['findAll'](_0x2bce08);})[_0x1af2('0x35')](function(_0x43ba78){_0x5d151f[_0x1af2('0x52')]=_0x43ba78;return _0x5d151f;})[_0x1af2('0x35')](respondWithFilteredResult(_0x7c1dba,_0x2bce08))[_0x1af2('0x27')](handleError(_0x7c1dba,null));};exports['show']=function(_0x5258d6,_0x5e3e41){var _0x54b49a={'raw':!![],'where':{'id':_0x5258d6[_0x1af2('0x53')]['id']}},_0x359a70={};_0x359a70[_0x1af2('0x3f')]=_[_0x1af2('0x42')](db[_0x1af2('0x3c')]['rawAttributes']);_0x359a70[_0x1af2('0x41')]=_[_0x1af2('0x42')](_0x5258d6[_0x1af2('0x41')]);_0x359a70[_0x1af2('0x43')]=_[_0x1af2('0x54')](_0x359a70[_0x1af2('0x3f')],_0x359a70[_0x1af2('0x41')]);_0x54b49a['attributes']=_[_0x1af2('0x54')](_0x359a70['model'],qs[_0x1af2('0x45')](_0x5258d6[_0x1af2('0x41')][_0x1af2('0x45')]));_0x54b49a['attributes']=_0x54b49a[_0x1af2('0x44')][_0x1af2('0x46')]?_0x54b49a['attributes']:_0x359a70[_0x1af2('0x3f')];if(_0x5258d6[_0x1af2('0x41')][_0x1af2('0x50')]){_0x54b49a[_0x1af2('0x51')]=[{'all':!![]}];}_0x54b49a=_[_0x1af2('0x4e')]({},_0x54b49a,_0x5258d6[_0x1af2('0x4f')]);return db['ChatQueue']['find'](_0x54b49a)[_0x1af2('0x35')](handleEntityNotFound(_0x5e3e41,null))[_0x1af2('0x35')](respondWithResult(_0x5e3e41,null))['catch'](handleError(_0x5e3e41,null));};exports['create']=function(_0x40e64e,_0x2b533){return db[_0x1af2('0x3c')]['create'](_0x40e64e[_0x1af2('0x55')],{})[_0x1af2('0x35')](function(_0x30abf6){var _0x152c28=_0x40e64e[_0x1af2('0x56')][_0x1af2('0x57')]({'plain':!![]});if(!_0x152c28)throw new Error(_0x1af2('0x58'));if(_0x152c28[_0x1af2('0x59')]==='user'){var _0x18569b=_0x30abf6['get']({'plain':!![]});var _0x2a1ced=_0x1af2('0x37');return db[_0x1af2('0x5a')]['find']({'where':{'name':_0x2a1ced,'userProfileId':_0x152c28['userProfileId']},'raw':!![]})[_0x1af2('0x35')](function(_0x4c16b6){if(_0x4c16b6&&_0x4c16b6['autoAssociation']===0x0){return db[_0x1af2('0x38')][_0x1af2('0x5b')]({'name':_0x18569b[_0x1af2('0x3a')],'resourceId':_0x18569b['id'],'type':_0x4c16b6[_0x1af2('0x3a')],'sectionId':_0x4c16b6['id']},{})[_0x1af2('0x35')](function(){return _0x30abf6;});}else{return _0x30abf6;}})[_0x1af2('0x27')](function(_0x5661a9){logger[_0x1af2('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5661a9);throw _0x5661a9;});}return _0x30abf6;})[_0x1af2('0x35')](respondWithResult(_0x2b533,0xc9))[_0x1af2('0x27')](handleError(_0x2b533,null));};exports[_0x1af2('0x34')]=function(_0x3228a2,_0x427e92){if(_0x3228a2[_0x1af2('0x55')]['id']){delete _0x3228a2[_0x1af2('0x55')]['id'];}return db[_0x1af2('0x3c')][_0x1af2('0x5c')]({'where':{'id':_0x3228a2[_0x1af2('0x53')]['id']}})[_0x1af2('0x35')](handleEntityNotFound(_0x427e92,null))[_0x1af2('0x35')](saveUpdates(_0x3228a2[_0x1af2('0x55')],null))[_0x1af2('0x35')](respondWithResult(_0x427e92,null))['catch'](handleError(_0x427e92,null));};exports[_0x1af2('0x36')]=function(_0x431184,_0x16dae4){return db[_0x1af2('0x3c')][_0x1af2('0x5c')]({'where':{'id':_0x431184[_0x1af2('0x53')]['id']}})['then'](handleEntityNotFound(_0x16dae4,null))[_0x1af2('0x35')](removeEntity(_0x16dae4,null))['catch'](handleError(_0x16dae4,null));};exports['describe']=function(_0x15bc11,_0x3f4b2a){return db[_0x1af2('0x3c')][_0x1af2('0x5d')]()[_0x1af2('0x35')](respondWithResult(_0x3f4b2a,null))['catch'](handleError(_0x3f4b2a,null));};exports[_0x1af2('0x5e')]=function(_0x5ce794,_0x14d130,_0x3940b6){var _0x1da0db={'raw':!![],'where':{}},_0x58741b={},_0x106f41;return db[_0x1af2('0x3c')]['findOne']({'where':{'id':_0x5ce794[_0x1af2('0x53')]['id']}})['then'](handleEntityNotFound(_0x14d130,null))[_0x1af2('0x35')](function(_0xcdc0b6){if(_0xcdc0b6){_0x106f41=_0xcdc0b6[_0x1af2('0x57')]({'plain':!![]});_0x58741b[_0x1af2('0x3f')]=_['keys'](db[_0x1af2('0x5f')]['rawAttributes']);_0x58741b[_0x1af2('0x41')]=_['keys'](_0x5ce794[_0x1af2('0x41')]);_0x58741b[_0x1af2('0x43')]=_[_0x1af2('0x54')](_0x58741b[_0x1af2('0x3f')],_0x58741b[_0x1af2('0x41')]);_0x1da0db[_0x1af2('0x44')]=_[_0x1af2('0x54')](_0x58741b[_0x1af2('0x3f')],qs[_0x1af2('0x45')](_0x5ce794[_0x1af2('0x41')][_0x1af2('0x45')]));_0x1da0db[_0x1af2('0x44')]=_0x1da0db['attributes'][_0x1af2('0x46')]?_0x1da0db[_0x1af2('0x44')]:_0x58741b['model'];if(!_0x5ce794[_0x1af2('0x41')][_0x1af2('0x47')]('nolimit')){_0x1da0db[_0x1af2('0x2e')]=qs[_0x1af2('0x2e')](_0x5ce794[_0x1af2('0x41')]['limit']);_0x1da0db['offset']=qs['offset'](_0x5ce794[_0x1af2('0x41')][_0x1af2('0x2c')]);}_0x1da0db['order']=qs[_0x1af2('0x49')](_0x5ce794[_0x1af2('0x41')][_0x1af2('0x49')]);_0x1da0db[_0x1af2('0x4a')]=qs[_0x1af2('0x43')](_[_0x1af2('0x4b')](_0x5ce794[_0x1af2('0x41')],_0x58741b['filters']));_0x1da0db[_0x1af2('0x4a')]['ChatQueueId']=_0xcdc0b6['id'];if(_0x5ce794[_0x1af2('0x41')][_0x1af2('0x4c')]){_0x1da0db[_0x1af2('0x4a')]=_['merge'](_0x1da0db['where'],{'$or':_[_0x1af2('0x40')](_0x1da0db['attributes'],function(_0x25bff8){var _0x2eeabd={};_0x2eeabd[_0x25bff8]={'$like':'%'+_0x5ce794[_0x1af2('0x41')][_0x1af2('0x4c')]+'%'};return _0x2eeabd;})});}_0x1da0db=_[_0x1af2('0x4e')]({},_0x1da0db,_0x5ce794[_0x1af2('0x4f')]);return db[_0x1af2('0x5f')]['findAll'](_0x1da0db);}})[_0x1af2('0x35')](function(_0x5a28ac){if(_0x5a28ac){return db[_0x1af2('0x60')]['findAndCountAll']({'where':{'id':_[_0x1af2('0x40')](_0x5a28ac,_0x1af2('0x61')),'role':_0x1af2('0x62')},'attributes':['id','name',_0x1af2('0x63'),_0x1af2('0x64'),_0x1af2('0x65')]});}})['then'](function(_0xac84dd){if(_0xac84dd){return{'count':_0xac84dd[_0x1af2('0x2f')],'rows':_[_0x1af2('0x40')](_0xac84dd[_0x1af2('0x52')],function(_0x14ddd0){return{'membername':_0x14ddd0['name'],'UserId':_0x14ddd0['id'],'queue_name':_0x106f41['name'],'ChatQueueId':_0x106f41['id'],'interface':util[_0x1af2('0x66')]('%s/%s',_0x1af2('0x67'),_0x14ddd0[_0x1af2('0x3a')]),'penalty':0x0,'paused':_0x14ddd0['chatPause'],'createdAt':_0x14ddd0[_0x1af2('0x65')],'updatedAt':_0x14ddd0[_0x1af2('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1af2('0x35')](respondWithFilteredResult(_0x14d130,_0x1da0db))['catch'](handleError(_0x14d130,null));};exports['getTeams']=function(_0x48b5e3,_0x2b2d51,_0x53fff3){var _0x505749={};var _0x5d72b4={};var _0x37ee8e;var _0x401682;return db[_0x1af2('0x3c')][_0x1af2('0x68')]({'where':{'id':_0x48b5e3['params']['id']}})[_0x1af2('0x35')](handleEntityNotFound(_0x2b2d51,null))[_0x1af2('0x35')](function(_0x3d7d94){if(_0x3d7d94){_0x37ee8e=_0x3d7d94;_0x5d72b4[_0x1af2('0x3f')]=_[_0x1af2('0x42')](db[_0x1af2('0x69')]['rawAttributes']);_0x5d72b4[_0x1af2('0x41')]=_[_0x1af2('0x42')](_0x48b5e3[_0x1af2('0x41')]);_0x5d72b4[_0x1af2('0x43')]=_['intersection'](_0x5d72b4['model'],_0x5d72b4[_0x1af2('0x41')]);_0x505749[_0x1af2('0x44')]=_[_0x1af2('0x54')](_0x5d72b4[_0x1af2('0x3f')],qs[_0x1af2('0x45')](_0x48b5e3[_0x1af2('0x41')][_0x1af2('0x45')]));_0x505749['attributes']=_0x505749['attributes'][_0x1af2('0x46')]?_0x505749[_0x1af2('0x44')]:_0x5d72b4['model'];_0x505749[_0x1af2('0x48')]=qs[_0x1af2('0x49')](_0x48b5e3[_0x1af2('0x41')][_0x1af2('0x49')]);_0x505749[_0x1af2('0x4a')]=qs['filters'](_[_0x1af2('0x4b')](_0x48b5e3[_0x1af2('0x41')],_0x5d72b4[_0x1af2('0x43')]));if(_0x48b5e3[_0x1af2('0x41')][_0x1af2('0x4c')]){_0x505749[_0x1af2('0x4a')]=_[_0x1af2('0x4e')](_0x505749[_0x1af2('0x4a')],{'$or':_[_0x1af2('0x40')](_0x505749[_0x1af2('0x44')],function(_0x4bc39c){var _0x2528a0={};_0x2528a0[_0x4bc39c]={'$like':'%'+_0x48b5e3[_0x1af2('0x41')][_0x1af2('0x4c')]+'%'};return _0x2528a0;})});}_0x505749=_[_0x1af2('0x4e')]({},_0x505749,_0x48b5e3['options']);return _0x37ee8e[_0x1af2('0x6a')](_0x505749);}})['then'](function(_0x5e9243){if(_0x5e9243){_0x401682=_0x5e9243['length'];if(!_0x48b5e3[_0x1af2('0x41')][_0x1af2('0x47')](_0x1af2('0x6b'))){_0x505749['limit']=qs[_0x1af2('0x2e')](_0x48b5e3[_0x1af2('0x41')][_0x1af2('0x2e')]);_0x505749[_0x1af2('0x2c')]=qs['offset'](_0x48b5e3[_0x1af2('0x41')]['offset']);}return _0x37ee8e[_0x1af2('0x6a')](_0x505749);}})[_0x1af2('0x35')](function(_0x42df7b){if(_0x42df7b){return _0x42df7b?{'count':_0x401682,'rows':_0x42df7b}:null;}})[_0x1af2('0x35')](respondWithResult(_0x2b2d51,null))[_0x1af2('0x27')](handleError(_0x2b2d51,null));};exports[_0x1af2('0x6c')]=function(_0x525eab,_0x3de054,_0x15e285){var _0x1ee59e=_0x525eab[_0x1af2('0x55')][_0x1af2('0x6d')];return db[_0x1af2('0x69')][_0x1af2('0x6e')]({'where':{'id':_0x1ee59e},'attributes':['id'],'include':[{'model':db[_0x1af2('0x60')],'as':_0x1af2('0x6f'),'attributes':['id',_0x1af2('0x3a'),_0x1af2('0x70'),_0x1af2('0x71'),'interface'],'raw':!![]}]})[_0x1af2('0x35')](function(_0x3406c0){if(_0x3406c0){var _0x48975e=_[_0x1af2('0x72')](_0x3406c0,function(_0x4a2890){var _0xebbb62=_0x4a2890[_0x1af2('0x57')]({'plain':!![]});return _0xebbb62[_0x1af2('0x6f')];});return db[_0x1af2('0x3c')][_0x1af2('0x5c')]({'where':{'id':_0x525eab[_0x1af2('0x53')]['id']}})[_0x1af2('0x35')](function(_0xd714b1){return db[_0x1af2('0x73')][_0x1af2('0x74')](function(_0x447a03){return _0xd714b1[_0x1af2('0x6c')](_0x1ee59e,{'transaction':_0x447a03})[_0x1af2('0x35')](function(){return BPromise['each'](_0x48975e,function(_0x124fdd){return db[_0x1af2('0x5f')][_0x1af2('0x75')]({'where':{'UserId':_0x124fdd['id'],'ChatQueueId':_0x525eab['params']['id']},'transaction':_0x447a03});});})[_0x1af2('0x35')](function(){_0x48975e[_0x1af2('0x76')](function(_0x47cec1){socket[_0x1af2('0x77')](_0x1af2('0x78'),{'UserId':_0x47cec1['id'],'ChatQueueId':_0xd714b1['id']});});});});});}})['then'](respondWithStatusCode(_0x3de054,null))[_0x1af2('0x27')](handleError(_0x3de054,null));};exports[_0x1af2('0x79')]=function(_0x5f5777,_0x3694c4,_0x1b3153){return db['Team']['findAll']({'where':{'id':_0x5f5777['query'][_0x1af2('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x1af2('0x60')],'as':_0x1af2('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1af2('0x35')](handleEntityNotFound(_0x3694c4,null))['then'](function(_0x159a2a){var _0x4c909b=_[_0x1af2('0x40')](_0x159a2a,'id');var _0x5ad91d=[];var _0x1a91c6=[];var _0x2c6646=squel['select']();_0x2c6646[_0x1af2('0x7a')](_0x1af2('0x7b'))[_0x1af2('0x7c')](_0x1af2('0x7d'),'tq')[_0x1af2('0x7e')](_0x1af2('0x7f'),'ut',_0x1af2('0x80'))['where'](_0x1af2('0x81'),_0x5f5777[_0x1af2('0x53')]['id']);for(var _0x3769f5=0x0;_0x3769f5<_0x159a2a[_0x1af2('0x46')];_0x3769f5+=0x1){let _0x412136=_0x159a2a[_0x3769f5];for(var _0x444f97=0x0;_0x444f97<_0x412136['Agents'][_0x1af2('0x46')];_0x444f97+=0x1){let _0x213b58=_0x412136[_0x1af2('0x6f')][_0x444f97];var _0x4a7ef4=_0x2c6646['clone']();_0x4a7ef4['where'](_0x1af2('0x82'),_0x213b58['id']);_0x1a91c6[_0x1af2('0x83')](db['sequelize'][_0x1af2('0x41')](_0x4a7ef4[_0x1af2('0x84')](),{'type':db[_0x1af2('0x73')][_0x1af2('0x85')][_0x1af2('0x86')]})[_0x1af2('0x35')](function(_0x54baf3){if(_0x54baf3[_0x1af2('0x46')]===0x1){return _0x213b58['id'];}else{var _0xd60993=_[_0x1af2('0x87')](_[_0x1af2('0x40')](_0x54baf3,_0x1af2('0x88')),function(_0x59e767){return _[_0x1af2('0x89')](_0x4c909b,_0x59e767);});if(_0xd60993){return _0x213b58['id'];}}}));}}return BPromise[_0x1af2('0x8a')](_0x1a91c6)[_0x1af2('0x35')](function(_0x2ec8d9){_0x5ad91d=_(_0x5ad91d)[_0x1af2('0x8b')](_0x2ec8d9)[_0x1af2('0x8c')]()[_0x1af2('0x8d')]();return db[_0x1af2('0x3c')][_0x1af2('0x5c')]({'where':{'id':_0x5f5777[_0x1af2('0x53')]['id']}})[_0x1af2('0x35')](function(_0x104765){return db['sequelize'][_0x1af2('0x74')](function(_0x347391){return _0x104765[_0x1af2('0x79')](_0x5f5777['query']['ids'],{'transaction':_0x347391})[_0x1af2('0x35')](function(){if(!_[_0x1af2('0x8e')](_0x5ad91d)){return _0x104765[_0x1af2('0x8f')](_0x5ad91d,{'transaction':_0x347391});}})[_0x1af2('0x35')](function(){_0x5ad91d[_0x1af2('0x76')](function(_0x50b3d7){socket[_0x1af2('0x77')]('userChatQueue:remove',{'UserId':_0x50b3d7,'ChatQueueId':_0x104765['id']});});});});});});})[_0x1af2('0x35')](respondWithStatusCode(_0x3694c4,null))[_0x1af2('0x27')](handleError(_0x3694c4,null));};exports[_0x1af2('0x90')]=function(_0x3eceba,_0x2b897d,_0x49cd42){return db[_0x1af2('0x3c')][_0x1af2('0x5c')]({'where':{'id':_0x3eceba[_0x1af2('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b897d,null))['then'](function(_0x825694){if(_0x825694){return _0x825694['addAgents'](_0x3eceba['body'][_0x1af2('0x6d')],_['omit'](_0x3eceba['body'],[_0x1af2('0x6d'),'id'])||{})[_0x1af2('0x91')](function(_0x4dfe60){for(var _0x3350c8=0x0;_0x3350c8<_0x3eceba[_0x1af2('0x55')][_0x1af2('0x6d')][_0x1af2('0x46')];_0x3350c8+=0x1){socket[_0x1af2('0x77')]('userChatQueue:save',{'UserId':Number(_0x3eceba['body'][_0x1af2('0x6d')][_0x3350c8]),'ChatQueueId':Number(_0x3eceba['params']['id'])});}return _0x4dfe60;});}})[_0x1af2('0x35')](respondWithResult(_0x2b897d,null))['catch'](handleError(_0x2b897d,null));};exports[_0x1af2('0x8f')]=function(_0x51ed9e,_0x42056d,_0x2b4fff){return db[_0x1af2('0x3c')]['find']({'where':{'id':_0x51ed9e[_0x1af2('0x53')]['id']}})['then'](handleEntityNotFound(_0x42056d,null))[_0x1af2('0x35')](function(_0x2c3323){if(_0x2c3323){return _0x2c3323[_0x1af2('0x8f')](_0x51ed9e[_0x1af2('0x41')][_0x1af2('0x6d')])[_0x1af2('0x35')](function(){if(_[_0x1af2('0x92')](_0x51ed9e[_0x1af2('0x41')]['ids'])){for(var _0x1b5ca5=0x0;_0x1b5ca5<_0x51ed9e[_0x1af2('0x41')][_0x1af2('0x6d')][_0x1af2('0x46')];_0x1b5ca5+=0x1){socket['emit'](_0x1af2('0x93'),{'UserId':Number(_0x51ed9e[_0x1af2('0x41')][_0x1af2('0x6d')][_0x1b5ca5]),'ChatQueueId':Number(_0x51ed9e[_0x1af2('0x53')]['id'])});}}else{socket[_0x1af2('0x77')]('userChatQueue:remove',{'UserId':Number(_0x51ed9e[_0x1af2('0x41')][_0x1af2('0x6d')]),'ChatQueueId':Number(_0x51ed9e[_0x1af2('0x53')]['id'])});}});}})[_0x1af2('0x35')](respondWithStatusCode(_0x42056d,null))[_0x1af2('0x27')](handleError(_0x42056d,null));};exports['getAgents']=function(_0x1ff688,_0x1e3e1d,_0x465e9b){var _0x429f92={};var _0x29f9ec={};var _0x1c5e57;var _0x4f702b;return db[_0x1af2('0x3c')]['findOne']({'where':{'id':_0x1ff688['params']['id']}})[_0x1af2('0x35')](handleEntityNotFound(_0x1e3e1d,null))[_0x1af2('0x35')](function(_0x3643b8){if(_0x3643b8){_0x1c5e57=_0x3643b8;_0x29f9ec[_0x1af2('0x3f')]=_['keys'](db[_0x1af2('0x60')][_0x1af2('0x94')]);_0x29f9ec[_0x1af2('0x41')]=_['keys'](_0x1ff688[_0x1af2('0x41')]);_0x29f9ec[_0x1af2('0x43')]=_[_0x1af2('0x54')](_0x29f9ec['model'],_0x29f9ec[_0x1af2('0x41')]);_0x429f92[_0x1af2('0x44')]=_[_0x1af2('0x54')](_0x29f9ec[_0x1af2('0x3f')],qs[_0x1af2('0x45')](_0x1ff688[_0x1af2('0x41')][_0x1af2('0x45')]));_0x429f92[_0x1af2('0x44')]=_0x429f92[_0x1af2('0x44')][_0x1af2('0x46')]?_0x429f92[_0x1af2('0x44')]:_0x29f9ec[_0x1af2('0x3f')];_0x429f92[_0x1af2('0x48')]=qs['sort'](_0x1ff688[_0x1af2('0x41')][_0x1af2('0x49')]);_0x429f92[_0x1af2('0x4a')]=qs['filters'](_[_0x1af2('0x4b')](_0x1ff688[_0x1af2('0x41')],_0x29f9ec[_0x1af2('0x43')]));if(_0x1ff688['query']['filter']){_0x429f92['where']=_[_0x1af2('0x4e')](_0x429f92['where'],{'$or':_[_0x1af2('0x40')](_0x429f92[_0x1af2('0x44')],function(_0x17c818){var _0x1a5041={};_0x1a5041[_0x17c818]={'$like':'%'+_0x1ff688['query'][_0x1af2('0x4c')]+'%'};return _0x1a5041;})});}_0x429f92=_['merge']({},_0x429f92,_0x1ff688[_0x1af2('0x4f')]);return _0x1c5e57['getAgents'](_0x429f92);}})[_0x1af2('0x35')](function(_0x32ad50){if(_0x32ad50){_0x4f702b=_0x32ad50[_0x1af2('0x46')];if(!_0x1ff688[_0x1af2('0x41')][_0x1af2('0x47')]('nolimit')){_0x429f92[_0x1af2('0x2e')]=qs[_0x1af2('0x2e')](_0x1ff688[_0x1af2('0x41')][_0x1af2('0x2e')]);_0x429f92[_0x1af2('0x2c')]=qs['offset'](_0x1ff688[_0x1af2('0x41')]['offset']);}return _0x1c5e57[_0x1af2('0x95')](_0x429f92);}})[_0x1af2('0x35')](function(_0x49295f){if(_0x49295f){return _0x49295f?{'count':_0x4f702b,'rows':_0x49295f}:null;}})[_0x1af2('0x35')](respondWithResult(_0x1e3e1d,null))['catch'](handleError(_0x1e3e1d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1a7dea1..03beb1d 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 _0x782e=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatQueue','save'];(function(_0x426f00,_0x4f7131){var _0x324a41=function(_0x30060c){while(--_0x30060c){_0x426f00['push'](_0x426f00['shift']());}};_0x324a41(++_0x4f7131);}(_0x782e,0x155));var _0xe782=function(_0xfcabd7,_0x43f87b){_0xfcabd7=_0xfcabd7-0x0;var _0x122ee1=_0x782e[_0xfcabd7];return _0x122ee1;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xe782('0x0'))['db'][_0xe782('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe782('0x2'),'afterUpdate':_0xe782('0x3'),'afterDestroy':_0xe782('0x4')};function emitEvent(_0x1ec3e7){return function(_0x1800b1,_0x4d1e53,_0x51401f){ChatQueueEvents[_0xe782('0x5')](_0x1ec3e7+':'+_0x1800b1['id'],_0x1800b1);ChatQueueEvents[_0xe782('0x5')](_0x1ec3e7,_0x1800b1);_0x51401f(null);};}for(var e in events){if(events[_0xe782('0x6')](e)){var event=events[e];ChatQueue[_0xe782('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x08fd=['ChatQueue','setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x37a9f8,_0x18bd9e){var _0x448e3f=function(_0x5128b3){while(--_0x5128b3){_0x37a9f8['push'](_0x37a9f8['shift']());}};_0x448e3f(++_0x18bd9e);}(_0x08fd,0xa6));var _0xd08f=function(_0x127bba,_0x46432d){_0x127bba=_0x127bba-0x0;var _0x42d208=_0x08fd[_0x127bba];return _0x42d208;};'use strict';var EventEmitter=require(_0xd08f('0x0'));var ChatQueue=require(_0xd08f('0x1'))['db'][_0xd08f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd08f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd08f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x53cb37){return function(_0x3a2b80,_0x196b04,_0xc18efb){ChatQueueEvents[_0xd08f('0x5')](_0x53cb37+':'+_0x3a2b80['id'],_0x3a2b80);ChatQueueEvents[_0xd08f('0x5')](_0x53cb37,_0x3a2b80);_0xc18efb(null);};}for(var e in events){if(events[_0xd08f('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xd08f('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 898733f..c48715f 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 _0xd8e2=['exports','ChatQueue','lodash','../../config/logger','api','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0xd8e2,0xa4));var _0x2d8e=function(_0x356d9f,_0x4599d9){_0x356d9f=_0x356d9f-0x0;var _0xad7a15=_0xd8e2[_0x356d9f];return _0xad7a15;};'use strict';var _=require(_0x2d8e('0x0'));var util=require('util');var logger=require(_0x2d8e('0x1'))(_0x2d8e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d8e('0x3'));var rimraf=require(_0x2d8e('0x4'));var config=require(_0x2d8e('0x5'));var attributes=require(_0x2d8e('0x6'));module[_0x2d8e('0x7')]=function(_0x297a81,_0x20bc08){return _0x297a81['define'](_0x2d8e('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2552=['path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','../../config/logger','api'];(function(_0x66d929,_0x2c9e16){var _0x868705=function(_0x4e153f){while(--_0x4e153f){_0x66d929['push'](_0x66d929['shift']());}};_0x868705(++_0x2c9e16);}(_0x2552,0x139));var _0x2255=function(_0x2350fa,_0x43cbcf){_0x2350fa=_0x2350fa-0x0;var _0x1133a7=_0x2552[_0x2350fa];return _0x1133a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2255('0x0'))(_0x2255('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2255('0x2'));var rimraf=require(_0x2255('0x3'));var config=require(_0x2255('0x4'));var attributes=require('./chatQueue.attributes');module[_0x2255('0x5')]=function(_0x3ef9b3,_0x2552c4){return _0x3ef9b3[_0x2255('0x6')](_0x2255('0x7'),attributes,{'tableName':_0x2255('0x8'),'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 849be02..1402ade 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 _0x2c64=['../../mysqldb','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x238a7a,_0x5807fe){var _0x5a1038=function(_0x533f30){while(--_0x533f30){_0x238a7a['push'](_0x238a7a['shift']());}};_0x5a1038(++_0x5807fe);}(_0x2c64,0x181));var _0x42c6=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x2c64[_0x307d86];return _0x361745;};'use strict';var _=require(_0x42c6('0x0'));var util=require(_0x42c6('0x1'));var moment=require('moment');var BPromise=require(_0x42c6('0x2'));var rs=require(_0x42c6('0x3'));var fs=require('fs');var Redis=require(_0x42c6('0x4'));var db=require(_0x42c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42c6('0x6'));var config=require(_0x42c6('0x7'));var jayson=require(_0x42c6('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x42c6('0x9')](config[_0x42c6('0xa')],{'host':_0x42c6('0xb'),'port':0x18eb});var socket=require(_0x42c6('0xc'))(new Redis(config[_0x42c6('0xa')]));require('./chatQueue.socket')[_0x42c6('0xd')](socket);function respondWithRpcPromise(_0x15af4d,_0x27500d,_0x5480ea){return new BPromise(function(_0x235256,_0x3d749e){return client['request'](_0x15af4d,_0x5480ea)[_0x42c6('0xe')](function(_0x227a87){logger[_0x42c6('0xf')](_0x42c6('0x10'),_0x27500d,_0x42c6('0x11'));logger[_0x42c6('0x12')](_0x42c6('0x13'),_0x27500d,'request\x20sent',JSON[_0x42c6('0x14')](_0x227a87));if(_0x227a87[_0x42c6('0x15')]){if(_0x227a87[_0x42c6('0x15')][_0x42c6('0x16')]===0x1f4){logger[_0x42c6('0x15')](_0x42c6('0x10'),_0x27500d,_0x227a87[_0x42c6('0x15')]['message']);return _0x3d749e(_0x227a87[_0x42c6('0x15')][_0x42c6('0x17')]);}logger[_0x42c6('0x15')](_0x42c6('0x10'),_0x27500d,_0x227a87['error'][_0x42c6('0x17')]);return _0x235256(_0x227a87['error'][_0x42c6('0x17')]);}else{logger[_0x42c6('0xf')](_0x42c6('0x10'),_0x27500d,'request\x20sent');_0x235256(_0x227a87[_0x42c6('0x18')][_0x42c6('0x17')]);}})[_0x42c6('0x19')](function(_0x3fce8d){logger[_0x42c6('0x15')](_0x42c6('0x10'),_0x27500d,_0x3fce8d);_0x3d749e(_0x3fce8d);});});}exports[_0x42c6('0x1a')]=function(_0x486e94){var _0x51aae3=this;return new Promise(function(_0x141e3e,_0x3139bc){return db[_0x42c6('0x1b')][_0x42c6('0x1c')]({'raw':_0x486e94['options']?_0x486e94['options'][_0x42c6('0x1d')]===undefined?!![]:![]:!![],'where':_0x486e94[_0x42c6('0x1e')]?_0x486e94['options'][_0x42c6('0x1f')]||null:null,'attributes':_0x486e94['options']?_0x486e94[_0x42c6('0x1e')][_0x42c6('0x20')]||null:null,'limit':_0x486e94[_0x42c6('0x1e')]?_0x486e94[_0x42c6('0x1e')][_0x42c6('0x21')]||null:null,'include':_0x486e94[_0x42c6('0x1e')]?_0x486e94[_0x42c6('0x1e')][_0x42c6('0x22')]?_[_0x42c6('0x23')](_0x486e94[_0x42c6('0x1e')][_0x42c6('0x22')],function(_0x1c9875){return{'model':db[_0x1c9875['model']],'as':_0x1c9875['as'],'attributes':_0x1c9875[_0x42c6('0x20')],'include':_0x1c9875[_0x42c6('0x22')]?_[_0x42c6('0x23')](_0x1c9875[_0x42c6('0x22')],function(_0x496aaf){return{'model':db[_0x496aaf[_0x42c6('0x24')]],'as':_0x496aaf['as'],'attributes':_0x496aaf[_0x42c6('0x20')],'include':_0x496aaf[_0x42c6('0x22')]?_['map'](_0x496aaf[_0x42c6('0x22')],function(_0x5394ff){return{'model':db[_0x5394ff[_0x42c6('0x24')]],'as':_0x5394ff['as'],'attributes':_0x5394ff[_0x42c6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x42c6('0xe')](function(_0x2ccd03){logger[_0x42c6('0xf')]('GetChatQueue',_0x486e94);logger['debug']('GetChatQueue',_0x486e94,JSON[_0x42c6('0x14')](_0x2ccd03));_0x141e3e(_0x2ccd03);})[_0x42c6('0x19')](function(_0x305e27){logger[_0x42c6('0x15')]('GetChatQueue',_0x305e27[_0x42c6('0x17')],_0x486e94);_0x3139bc(_0x51aae3[_0x42c6('0x15')](0x1f4,_0x305e27['message']));});});};exports[_0x42c6('0x25')]=function(_0x4bba65){var _0x3bbb4a=this;return new Promise(function(_0x482dc1,_0xd7a969){return db[_0x42c6('0x1b')][_0x42c6('0x26')]({'raw':_0x4bba65[_0x42c6('0x1e')]?_0x4bba65[_0x42c6('0x1e')][_0x42c6('0x1d')]===undefined?!![]:![]:!![],'where':_0x4bba65[_0x42c6('0x1e')]?_0x4bba65['options'][_0x42c6('0x1f')]||null:null,'attributes':_0x4bba65[_0x42c6('0x1e')]?_0x4bba65[_0x42c6('0x1e')][_0x42c6('0x20')]||null:null,'include':_0x4bba65[_0x42c6('0x1e')]?_0x4bba65[_0x42c6('0x1e')][_0x42c6('0x22')]?_[_0x42c6('0x23')](_0x4bba65[_0x42c6('0x1e')][_0x42c6('0x22')],function(_0x5bbfc4){return{'model':db[_0x5bbfc4[_0x42c6('0x24')]],'as':_0x5bbfc4['as'],'attributes':_0x5bbfc4[_0x42c6('0x20')],'include':_0x5bbfc4[_0x42c6('0x22')]?_[_0x42c6('0x23')](_0x5bbfc4[_0x42c6('0x22')],function(_0x4cebbe){return{'model':db[_0x4cebbe[_0x42c6('0x24')]],'as':_0x4cebbe['as'],'attributes':_0x4cebbe[_0x42c6('0x20')],'include':_0x4cebbe['include']?_[_0x42c6('0x23')](_0x4cebbe['include'],function(_0x3ec1c4){return{'model':db[_0x3ec1c4['model']],'as':_0x3ec1c4['as'],'attributes':_0x3ec1c4[_0x42c6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x42c6('0xe')](function(_0x5e537a){logger[_0x42c6('0xf')](_0x42c6('0x25'),_0x4bba65);logger[_0x42c6('0x12')]('ShowChatQueue',_0x4bba65,JSON[_0x42c6('0x14')](_0x5e537a));_0x482dc1(_0x5e537a);})[_0x42c6('0x19')](function(_0x238c65){logger['error'](_0x42c6('0x25'),_0x238c65[_0x42c6('0x17')],_0x4bba65);_0xd7a969(_0x3bbb4a[_0x42c6('0x15')](0x1f4,_0x238c65['message']));});});};
\ No newline at end of file
+var _0x6629=['rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowChatQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x540095,_0x11db40){var _0x39a8c1=function(_0x4bd1ae){while(--_0x4bd1ae){_0x540095['push'](_0x540095['shift']());}};_0x39a8c1(++_0x11db40);}(_0x6629,0x1c2));var _0x9662=function(_0x403f95,_0xffe5c2){_0x403f95=_0x403f95-0x0;var _0x9dc662=_0x6629[_0x403f95];return _0x9dc662;};'use strict';var _=require(_0x9662('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9662('0x1'));var rs=require(_0x9662('0x2'));var fs=require('fs');var Redis=require(_0x9662('0x3'));var db=require(_0x9662('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9662('0x5'))(_0x9662('0x6'));var config=require(_0x9662('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9662('0x8')][_0x9662('0x9')]({'port':0x232a});config[_0x9662('0xa')]=_['defaults'](config[_0x9662('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9662('0xb'))(new Redis(config[_0x9662('0xa')]));require(_0x9662('0xc'))[_0x9662('0xd')](socket);function respondWithRpcPromise(_0x3615f3,_0x40c983,_0x2a58e5){return new BPromise(function(_0x413ba3,_0x3bb261){return client[_0x9662('0xe')](_0x3615f3,_0x2a58e5)[_0x9662('0xf')](function(_0x556842){logger[_0x9662('0x10')]('ChatQueue,\x20%s,\x20%s',_0x40c983,_0x9662('0x11'));logger[_0x9662('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x40c983,_0x9662('0x11'),JSON[_0x9662('0x13')](_0x556842));if(_0x556842[_0x9662('0x14')]){if(_0x556842['error']['code']===0x1f4){logger[_0x9662('0x14')]('ChatQueue,\x20%s,\x20%s',_0x40c983,_0x556842[_0x9662('0x14')][_0x9662('0x15')]);return _0x3bb261(_0x556842[_0x9662('0x14')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x40c983,_0x556842[_0x9662('0x14')][_0x9662('0x15')]);return _0x413ba3(_0x556842['error'][_0x9662('0x15')]);}else{logger[_0x9662('0x10')](_0x9662('0x16'),_0x40c983,_0x9662('0x11'));_0x413ba3(_0x556842[_0x9662('0x17')][_0x9662('0x15')]);}})['catch'](function(_0x14335a){logger[_0x9662('0x14')]('ChatQueue,\x20%s,\x20%s',_0x40c983,_0x14335a);_0x3bb261(_0x14335a);});});}exports[_0x9662('0x18')]=function(_0xef0462){var _0x139d1a=this;return new Promise(function(_0x7c4209,_0x2e16cf){return db[_0x9662('0x19')][_0x9662('0x1a')]({'raw':_0xef0462[_0x9662('0x1b')]?_0xef0462[_0x9662('0x1b')][_0x9662('0x1c')]===undefined?!![]:![]:!![],'where':_0xef0462['options']?_0xef0462['options'][_0x9662('0x1d')]||null:null,'attributes':_0xef0462[_0x9662('0x1b')]?_0xef0462[_0x9662('0x1b')][_0x9662('0x1e')]||null:null,'limit':_0xef0462[_0x9662('0x1b')]?_0xef0462[_0x9662('0x1b')][_0x9662('0x1f')]||null:null,'include':_0xef0462['options']?_0xef0462['options'][_0x9662('0x20')]?_[_0x9662('0x21')](_0xef0462[_0x9662('0x1b')][_0x9662('0x20')],function(_0x5a16cd){return{'model':db[_0x5a16cd[_0x9662('0x22')]],'as':_0x5a16cd['as'],'attributes':_0x5a16cd[_0x9662('0x1e')],'include':_0x5a16cd[_0x9662('0x20')]?_[_0x9662('0x21')](_0x5a16cd[_0x9662('0x20')],function(_0x402896){return{'model':db[_0x402896[_0x9662('0x22')]],'as':_0x402896['as'],'attributes':_0x402896[_0x9662('0x1e')],'include':_0x402896['include']?_[_0x9662('0x21')](_0x402896[_0x9662('0x20')],function(_0x766c97){return{'model':db[_0x766c97['model']],'as':_0x766c97['as'],'attributes':_0x766c97['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56e731){logger['info']('GetChatQueue',_0xef0462);logger[_0x9662('0x12')](_0x9662('0x18'),_0xef0462,JSON[_0x9662('0x13')](_0x56e731));_0x7c4209(_0x56e731);})[_0x9662('0x23')](function(_0x4ae219){logger['error'](_0x9662('0x18'),_0x4ae219['message'],_0xef0462);_0x2e16cf(_0x139d1a[_0x9662('0x14')](0x1f4,_0x4ae219[_0x9662('0x15')]));});});};exports[_0x9662('0x24')]=function(_0x28c20a){var _0x13a3de=this;return new Promise(function(_0x5b97b8,_0xae35b6){return db[_0x9662('0x19')][_0x9662('0x25')]({'raw':_0x28c20a[_0x9662('0x1b')]?_0x28c20a[_0x9662('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x28c20a[_0x9662('0x1b')]?_0x28c20a['options'][_0x9662('0x1d')]||null:null,'attributes':_0x28c20a[_0x9662('0x1b')]?_0x28c20a[_0x9662('0x1b')]['attributes']||null:null,'include':_0x28c20a['options']?_0x28c20a['options'][_0x9662('0x20')]?_[_0x9662('0x21')](_0x28c20a[_0x9662('0x1b')]['include'],function(_0x17dbfd){return{'model':db[_0x17dbfd[_0x9662('0x22')]],'as':_0x17dbfd['as'],'attributes':_0x17dbfd['attributes'],'include':_0x17dbfd[_0x9662('0x20')]?_[_0x9662('0x21')](_0x17dbfd[_0x9662('0x20')],function(_0x478d6c){return{'model':db[_0x478d6c['model']],'as':_0x478d6c['as'],'attributes':_0x478d6c['attributes'],'include':_0x478d6c[_0x9662('0x20')]?_[_0x9662('0x21')](_0x478d6c[_0x9662('0x20')],function(_0x52c65b){return{'model':db[_0x52c65b[_0x9662('0x22')]],'as':_0x52c65b['as'],'attributes':_0x52c65b[_0x9662('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9662('0xf')](function(_0x79565d){logger[_0x9662('0x10')](_0x9662('0x24'),_0x28c20a);logger[_0x9662('0x12')]('ShowChatQueue',_0x28c20a,JSON['stringify'](_0x79565d));_0x5b97b8(_0x79565d);})['catch'](function(_0x41fbcc){logger['error']('ShowChatQueue',_0x41fbcc[_0x9662('0x15')],_0x28c20a);_0xae35b6(_0x13a3de[_0x9662('0x14')](0x1f4,_0x41fbcc['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 322feba..29bdf99 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 _0x0bde=['save','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatQueueEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatQueueEvents['on'](_0x491dc7,_0x40b36a);}};
\ No newline at end of file
+var _0x2bc6=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x21d691,_0x114a69){var _0x5b6fe6=function(_0x141727){while(--_0x141727){_0x21d691['push'](_0x21d691['shift']());}};_0x5b6fe6(++_0x114a69);}(_0x2bc6,0x163));var _0x62bc=function(_0x19906e,_0x1a2808){_0x19906e=_0x19906e-0x0;var _0x3f1aea=_0x2bc6[_0x19906e];return _0x3f1aea;};'use strict';var ChatQueueEvents=require(_0x62bc('0x0'));var events=[_0x62bc('0x1'),_0x62bc('0x2'),'update'];function createListener(_0x4b4e73,_0x5a2676){return function(_0x5c5a2a){_0x5a2676[_0x62bc('0x3')](_0x4b4e73,_0x5c5a2a);};}function removeListener(_0x576608,_0x2a1959){return function(){ChatQueueEvents[_0x62bc('0x4')](_0x576608,_0x2a1959);};}exports['register']=function(_0x3cce26){for(var _0x450cb6=0x0,_0x40af10=events[_0x62bc('0x5')];_0x450cb6<_0x40af10;_0x450cb6++){var _0x3ed6ad=events[_0x450cb6];var _0x3f625c=createListener('chatQueue:'+_0x3ed6ad,_0x3cce26);ChatQueueEvents['on'](_0x3ed6ad,_0x3f625c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 6cb564e..f617c3b 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 _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(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x5fc3,0xa8));var _0x35fc=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0x5fc3[_0x37c07d];return _0x10dadc;};'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
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x3f0e83,_0x433755){var _0x4b793e=function(_0x116b31){while(--_0x116b31){_0x3f0e83['push'](_0x3f0e83['shift']());}};_0x4b793e(++_0x433755);}(_0x55ca,0x126));var _0xa55c=function(_0x5a3ee9,_0x11ed55){_0x5a3ee9=_0x5a3ee9-0x0;var _0x45032c=_0x55ca[_0x5a3ee9];return _0x45032c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 54ccb21..578d7fb 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 _0xcb75=['sequelize','STRING','DATE'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0xcb75,0x183));var _0x5cb7=function(_0x1710e3,_0x1a9832){_0x1710e3=_0x1710e3-0x0;var _0x152bc5=_0xcb75[_0x1710e3];return _0x152bc5;};'use strict';var moment=require('moment');var Sequelize=require(_0x5cb7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5cb7('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5cb7('0x1')]},'joinAt':{'type':Sequelize[_0x5cb7('0x2')]},'leaveAt':{'type':Sequelize[_0x5cb7('0x2')]},'acceptAt':{'type':Sequelize[_0x5cb7('0x2')]},'exitAt':{'type':Sequelize[_0x5cb7('0x2')]},'reason':{'type':Sequelize[_0x5cb7('0x1')]}};
\ No newline at end of file
+var _0x7ccb=['STRING','DATE','moment','sequelize','exports'];(function(_0x925812,_0x2ee730){var _0x375ae9=function(_0x14fbe7){while(--_0x14fbe7){_0x925812['push'](_0x925812['shift']());}};_0x375ae9(++_0x2ee730);}(_0x7ccb,0x17e));var _0xb7cc=function(_0x188832,_0x49101d){_0x188832=_0x188832-0x0;var _0x2b990f=_0x7ccb[_0x188832];return _0x2b990f;};'use strict';var moment=require(_0xb7cc('0x0'));var Sequelize=require(_0xb7cc('0x1'));module[_0xb7cc('0x2')]={'uniqueid':{'type':Sequelize[_0xb7cc('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb7cc('0x4')]},'acceptAt':{'type':Sequelize[_0xb7cc('0x4')]},'exitAt':{'type':Sequelize[_0xb7cc('0x4')]},'reason':{'type':Sequelize[_0xb7cc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 365f4f6..4d0ecc1 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 _0x62f1=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','stack','name','send','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','ChatQueueReport','includeAll','include','rows','show','params','keys','create','body','catch','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x62f1,0x112));var _0x162f=function(_0xc9191e,_0x17842f){_0xc9191e=_0xc9191e-0x0;var _0x32b242=_0x62f1[_0xc9191e];return _0x32b242;};'use strict';var emlformat=require(_0x162f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x162f('0x1'));var jsonpatch=require(_0x162f('0x2'));var rp=require(_0x162f('0x3'));var moment=require(_0x162f('0x4'));var BPromise=require(_0x162f('0x5'));var Mustache=require(_0x162f('0x6'));var util=require(_0x162f('0x7'));var path=require(_0x162f('0x8'));var sox=require(_0x162f('0x9'));var csv=require(_0x162f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x162f('0xb'));var _=require(_0x162f('0xc'));var squel=require('squel');var crypto=require(_0x162f('0xd'));var jsforce=require(_0x162f('0xe'));var deskjs=require(_0x162f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x162f('0x10'));var Papa=require(_0x162f('0x11'));var Redis=require(_0x162f('0x12'));var authService=require(_0x162f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x162f('0x14'));var hardwareService=require(_0x162f('0x15'));var logger=require(_0x162f('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x162f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6ae441,_0x361048){_0x361048=_0x361048||0xcc;return function(_0x4561d2){if(_0x4561d2){return _0x6ae441[_0x162f('0x18')](_0x361048);}return _0x6ae441['status'](_0x361048)[_0x162f('0x19')]();};}function respondWithResult(_0x2bf9f0,_0x3daa69){_0x3daa69=_0x3daa69||0xc8;return function(_0x130db8){if(_0x130db8){return _0x2bf9f0['status'](_0x3daa69)[_0x162f('0x1a')](_0x130db8);}};}function respondWithFilteredResult(_0x4e48e1,_0x250983){return function(_0x2d90ad){if(_0x2d90ad){var _0x40a284=typeof _0x250983[_0x162f('0x1b')]==='undefined'&&typeof _0x250983['limit']===_0x162f('0x1c');var _0xa03e71=_0x2d90ad[_0x162f('0x1d')];var _0x1ee433=_0x40a284?0x0:_0x250983[_0x162f('0x1b')];var _0x750506=_0x40a284?_0x2d90ad[_0x162f('0x1d')]:_0x250983['offset']+_0x250983[_0x162f('0x1e')];var _0x53ac47;if(_0x750506>=_0xa03e71){_0x750506=_0xa03e71;_0x53ac47=0xc8;}else{_0x53ac47=0xce;}_0x4e48e1[_0x162f('0x1f')](_0x53ac47);return _0x4e48e1[_0x162f('0x20')]('Content-Range',_0x1ee433+'-'+_0x750506+'/'+_0xa03e71)[_0x162f('0x1a')](_0x2d90ad);}return null;};}function patchUpdates(_0x236ef5){return function(_0x57796d){try{jsonpatch[_0x162f('0x21')](_0x57796d,_0x236ef5,!![]);}catch(_0x436a5a){return BPromise[_0x162f('0x22')](_0x436a5a);}return _0x57796d[_0x162f('0x23')]();};}function saveUpdates(_0x5dc1a7,_0xdab3e){return function(_0x246aff){if(_0x246aff){return _0x246aff[_0x162f('0x24')](_0x5dc1a7)[_0x162f('0x25')](function(_0x422241){return _0x422241;});}return null;};}function removeEntity(_0x1512b0,_0xbcbe11){return function(_0x331d0d){if(_0x331d0d){return _0x331d0d['destroy']()[_0x162f('0x25')](function(){_0x1512b0[_0x162f('0x1f')](0xcc)[_0x162f('0x19')]();});}};}function handleEntityNotFound(_0x16f5e2,_0x59482e){return function(_0x2fc293){if(!_0x2fc293){_0x16f5e2['sendStatus'](0x194);}return _0x2fc293;};}function handleError(_0x1e25d5,_0x54e4e1){_0x54e4e1=_0x54e4e1||0x1f4;return function(_0x2cd181){logger['error'](_0x2cd181[_0x162f('0x26')]);if(_0x2cd181['name']){delete _0x2cd181[_0x162f('0x27')];}_0x1e25d5[_0x162f('0x1f')](_0x54e4e1)[_0x162f('0x28')](_0x2cd181);};}exports['index']=function(_0x4bb880,_0x4c58ff){var _0x580e13={},_0x3f9247={},_0x1b0f5b={'count':0x0,'rows':[]};var _0x4c4049=_['map'](db['ChatQueueReport'][_0x162f('0x29')],function(_0x5089c7){return{'name':_0x5089c7[_0x162f('0x2a')],'type':_0x5089c7[_0x162f('0x2b')]['key']};});_0x3f9247['model']=_[_0x162f('0x2c')](_0x4c4049,_0x162f('0x27'));_0x3f9247[_0x162f('0x2d')]=_['keys'](_0x4bb880[_0x162f('0x2d')]);_0x3f9247[_0x162f('0x2e')]=_[_0x162f('0x2f')](_0x3f9247[_0x162f('0x30')],_0x3f9247['query']);_0x580e13['attributes']=_[_0x162f('0x2f')](_0x3f9247['model'],qs[_0x162f('0x31')](_0x4bb880['query']['fields']));_0x580e13['attributes']=_0x580e13['attributes'][_0x162f('0x32')]?_0x580e13[_0x162f('0x33')]:_0x3f9247[_0x162f('0x30')];if(!_0x4bb880['query'][_0x162f('0x34')](_0x162f('0x35'))){_0x580e13['limit']=qs[_0x162f('0x1e')](_0x4bb880[_0x162f('0x2d')][_0x162f('0x1e')]);_0x580e13['offset']=qs[_0x162f('0x1b')](_0x4bb880['query'][_0x162f('0x1b')]);}_0x580e13['order']=qs[_0x162f('0x36')](_0x4bb880['query'][_0x162f('0x36')]);_0x580e13[_0x162f('0x37')]=qs['filters'](_[_0x162f('0x38')](_0x4bb880['query'],_0x3f9247[_0x162f('0x2e')]),_0x4c4049);if(_0x4bb880[_0x162f('0x2d')]['filter']){_0x580e13[_0x162f('0x37')]=_['merge'](_0x580e13[_0x162f('0x37')],{'$or':_['map'](_0x4c4049,function(_0x5f4b3f){if(_0x5f4b3f[_0x162f('0x2b')]!==_0x162f('0x39')){var _0x4a328f={};_0x4a328f[_0x5f4b3f[_0x162f('0x27')]]={'$like':'%'+_0x4bb880['query']['filter']+'%'};return _0x4a328f;}})});}_0x580e13=_[_0x162f('0x3a')]({},_0x580e13,_0x4bb880[_0x162f('0x3b')]);var _0x59ca49={'where':_0x580e13[_0x162f('0x37')]};return db[_0x162f('0x3c')][_0x162f('0x1d')](_0x59ca49)[_0x162f('0x25')](function(_0x2fa18e){_0x1b0f5b['count']=_0x2fa18e;if(_0x4bb880[_0x162f('0x2d')][_0x162f('0x3d')]){_0x580e13[_0x162f('0x3e')]=[{'all':!![]}];}return db[_0x162f('0x3c')]['findAll'](_0x580e13);})[_0x162f('0x25')](function(_0x146daa){_0x1b0f5b[_0x162f('0x3f')]=_0x146daa;return _0x1b0f5b;})[_0x162f('0x25')](respondWithFilteredResult(_0x4c58ff,_0x580e13))['catch'](handleError(_0x4c58ff,null));};exports[_0x162f('0x40')]=function(_0xc2143e,_0x52c8c3){var _0x8c8443={'raw':!![],'where':{'id':_0xc2143e[_0x162f('0x41')]['id']}},_0x21dd30={};_0x21dd30[_0x162f('0x30')]=_[_0x162f('0x42')](db[_0x162f('0x3c')][_0x162f('0x29')]);_0x21dd30['query']=_[_0x162f('0x42')](_0xc2143e[_0x162f('0x2d')]);_0x21dd30['filters']=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],_0x21dd30['query']);_0x8c8443[_0x162f('0x33')]=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],qs[_0x162f('0x31')](_0xc2143e[_0x162f('0x2d')][_0x162f('0x31')]));_0x8c8443[_0x162f('0x33')]=_0x8c8443[_0x162f('0x33')][_0x162f('0x32')]?_0x8c8443[_0x162f('0x33')]:_0x21dd30[_0x162f('0x30')];if(_0xc2143e[_0x162f('0x2d')][_0x162f('0x3d')]){_0x8c8443[_0x162f('0x3e')]=[{'all':!![]}];}_0x8c8443=_['merge']({},_0x8c8443,_0xc2143e[_0x162f('0x3b')]);return db[_0x162f('0x3c')]['find'](_0x8c8443)['then'](handleEntityNotFound(_0x52c8c3,null))[_0x162f('0x25')](respondWithResult(_0x52c8c3,null))['catch'](handleError(_0x52c8c3,null));};exports[_0x162f('0x43')]=function(_0x5d06c1,_0x1e936b){return db['ChatQueueReport'][_0x162f('0x43')](_0x5d06c1[_0x162f('0x44')],{})[_0x162f('0x25')](respondWithResult(_0x1e936b,0xc9))[_0x162f('0x45')](handleError(_0x1e936b,null));};exports[_0x162f('0x24')]=function(_0xf74671,_0x466136){if(_0xf74671[_0x162f('0x44')]['id']){delete _0xf74671[_0x162f('0x44')]['id'];}return db['ChatQueueReport'][_0x162f('0x46')]({'where':{'id':_0xf74671[_0x162f('0x41')]['id']}})['then'](handleEntityNotFound(_0x466136,null))[_0x162f('0x25')](saveUpdates(_0xf74671[_0x162f('0x44')],null))[_0x162f('0x25')](respondWithResult(_0x466136,null))[_0x162f('0x45')](handleError(_0x466136,null));};exports[_0x162f('0x47')]=function(_0x487835,_0x232348){return db[_0x162f('0x3c')][_0x162f('0x46')]({'where':{'id':_0x487835[_0x162f('0x41')]['id']}})[_0x162f('0x25')](handleEntityNotFound(_0x232348,null))['then'](removeEntity(_0x232348,null))['catch'](handleError(_0x232348,null));};exports[_0x162f('0x48')]=function(_0x4d74eb,_0x3e25b5){return db[_0x162f('0x3c')]['describe']()[_0x162f('0x25')](respondWithResult(_0x3e25b5,null))[_0x162f('0x45')](handleError(_0x3e25b5,null));};
\ No newline at end of file
+var _0xd8fb=['catch','show','params','keys','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows'];(function(_0x41f43d,_0x3df10c){var _0x34dc57=function(_0x26e078){while(--_0x26e078){_0x41f43d['push'](_0x41f43d['shift']());}};_0x34dc57(++_0x3df10c);}(_0xd8fb,0x99));var _0xbd8f=function(_0x1f719a,_0x13c44a){_0x1f719a=_0x1f719a-0x0;var _0x537020=_0xd8fb[_0x1f719a];return _0x537020;};'use strict';var emlformat=require(_0xbd8f('0x0'));var rimraf=require(_0xbd8f('0x1'));var zipdir=require(_0xbd8f('0x2'));var jsonpatch=require(_0xbd8f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd8f('0x4'));var util=require(_0xbd8f('0x5'));var path=require('path');var sox=require(_0xbd8f('0x6'));var csv=require(_0xbd8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8f('0x8'));var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbd8f('0xf'));var hardwareService=require(_0xbd8f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xbd8f('0x11'));var config=require(_0xbd8f('0x12'));var licenseUtil=require(_0xbd8f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xcc;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0x14')](_0x159f09);}return _0x230988[_0xbd8f('0x15')](_0x159f09)[_0xbd8f('0x16')]();};}function respondWithResult(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0xc8;return function(_0x14606c){if(_0x14606c){return _0x37d4d5['status'](_0x29ffe8)[_0xbd8f('0x17')](_0x14606c);}};}function respondWithFilteredResult(_0x829fb2,_0xa57e91){return function(_0x10d72e){if(_0x10d72e){var _0x4da96f=typeof _0xa57e91[_0xbd8f('0x18')]===_0xbd8f('0x19')&&typeof _0xa57e91['limit']===_0xbd8f('0x19');var _0xf5e7a=_0x10d72e['count'];var _0x4435b9=_0x4da96f?0x0:_0xa57e91[_0xbd8f('0x18')];var _0x47d317=_0x4da96f?_0x10d72e['count']:_0xa57e91[_0xbd8f('0x18')]+_0xa57e91['limit'];var _0x5705c5;if(_0x47d317>=_0xf5e7a){_0x47d317=_0xf5e7a;_0x5705c5=0xc8;}else{_0x5705c5=0xce;}_0x829fb2[_0xbd8f('0x15')](_0x5705c5);return _0x829fb2['set'](_0xbd8f('0x1a'),_0x4435b9+'-'+_0x47d317+'/'+_0xf5e7a)[_0xbd8f('0x17')](_0x10d72e);}return null;};}function patchUpdates(_0xb47c8e){return function(_0x897f25){try{jsonpatch[_0xbd8f('0x1b')](_0x897f25,_0xb47c8e,!![]);}catch(_0x20cab7){return BPromise[_0xbd8f('0x1c')](_0x20cab7);}return _0x897f25[_0xbd8f('0x1d')]();};}function saveUpdates(_0x2fbe3b,_0x775acc){return function(_0xfe4048){if(_0xfe4048){return _0xfe4048[_0xbd8f('0x1e')](_0x2fbe3b)[_0xbd8f('0x1f')](function(_0x15c4a9){return _0x15c4a9;});}return null;};}function removeEntity(_0x320ede,_0xd11ae){return function(_0x395b1b){if(_0x395b1b){return _0x395b1b['destroy']()[_0xbd8f('0x1f')](function(){_0x320ede[_0xbd8f('0x15')](0xcc)[_0xbd8f('0x16')]();});}};}function handleEntityNotFound(_0x2f3df7,_0xa88414){return function(_0x2257fd){if(!_0x2257fd){_0x2f3df7[_0xbd8f('0x14')](0x194);}return _0x2257fd;};}function handleError(_0x264e62,_0x4ea554){_0x4ea554=_0x4ea554||0x1f4;return function(_0x40cb43){logger[_0xbd8f('0x20')](_0x40cb43['stack']);if(_0x40cb43[_0xbd8f('0x21')]){delete _0x40cb43['name'];}_0x264e62[_0xbd8f('0x15')](_0x4ea554)[_0xbd8f('0x22')](_0x40cb43);};}exports[_0xbd8f('0x23')]=function(_0x202126,_0x2aefa2){var _0x247b07={},_0x4c4431={},_0x166de7={'count':0x0,'rows':[]};var _0x14f3cb=_[_0xbd8f('0x24')](db[_0xbd8f('0x25')][_0xbd8f('0x26')],function(_0x2ac26f){return{'name':_0x2ac26f[_0xbd8f('0x27')],'type':_0x2ac26f['type'][_0xbd8f('0x28')]};});_0x4c4431[_0xbd8f('0x29')]=_[_0xbd8f('0x24')](_0x14f3cb,_0xbd8f('0x21'));_0x4c4431['query']=_['keys'](_0x202126[_0xbd8f('0x2a')]);_0x4c4431[_0xbd8f('0x2b')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],_0x4c4431['query']);_0x247b07[_0xbd8f('0x2d')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x202126[_0xbd8f('0x2a')]['fields']));_0x247b07[_0xbd8f('0x2d')]=_0x247b07[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x247b07[_0xbd8f('0x2d')]:_0x4c4431[_0xbd8f('0x29')];if(!_0x202126['query'][_0xbd8f('0x30')]('nolimit')){_0x247b07[_0xbd8f('0x31')]=qs[_0xbd8f('0x31')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x31')]);_0x247b07[_0xbd8f('0x18')]=qs[_0xbd8f('0x18')](_0x202126['query']['offset']);}_0x247b07['order']=qs[_0xbd8f('0x32')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x32')]);_0x247b07[_0xbd8f('0x33')]=qs[_0xbd8f('0x2b')](_[_0xbd8f('0x34')](_0x202126[_0xbd8f('0x2a')],_0x4c4431[_0xbd8f('0x2b')]),_0x14f3cb);if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]){_0x247b07[_0xbd8f('0x33')]=_[_0xbd8f('0x36')](_0x247b07[_0xbd8f('0x33')],{'$or':_[_0xbd8f('0x24')](_0x14f3cb,function(_0x391d45){if(_0x391d45['type']!==_0xbd8f('0x37')){var _0x4181e0={};_0x4181e0[_0x391d45['name']]={'$like':'%'+_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]+'%'};return _0x4181e0;}})});}_0x247b07=_[_0xbd8f('0x36')]({},_0x247b07,_0x202126['options']);var _0x21da54={'where':_0x247b07['where']};return db[_0xbd8f('0x25')][_0xbd8f('0x38')](_0x21da54)[_0xbd8f('0x1f')](function(_0x4f2ebc){_0x166de7[_0xbd8f('0x38')]=_0x4f2ebc;if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x247b07['include']=[{'all':!![]}];}return db[_0xbd8f('0x25')][_0xbd8f('0x3a')](_0x247b07);})[_0xbd8f('0x1f')](function(_0x351027){_0x166de7[_0xbd8f('0x3b')]=_0x351027;return _0x166de7;})[_0xbd8f('0x1f')](respondWithFilteredResult(_0x2aefa2,_0x247b07))[_0xbd8f('0x3c')](handleError(_0x2aefa2,null));};exports[_0xbd8f('0x3d')]=function(_0x14b768,_0x5e1e77){var _0x52c62b={'raw':!![],'where':{'id':_0x14b768[_0xbd8f('0x3e')]['id']}},_0x2907a3={};_0x2907a3[_0xbd8f('0x29')]=_[_0xbd8f('0x3f')](db['ChatQueueReport'][_0xbd8f('0x26')]);_0x2907a3[_0xbd8f('0x2a')]=_[_0xbd8f('0x3f')](_0x14b768[_0xbd8f('0x2a')]);_0x2907a3[_0xbd8f('0x2b')]=_['intersection'](_0x2907a3['model'],_0x2907a3[_0xbd8f('0x2a')]);_0x52c62b['attributes']=_[_0xbd8f('0x2c')](_0x2907a3[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x2e')]));_0x52c62b[_0xbd8f('0x2d')]=_0x52c62b[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x52c62b['attributes']:_0x2907a3[_0xbd8f('0x29')];if(_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x52c62b[_0xbd8f('0x40')]=[{'all':!![]}];}_0x52c62b=_[_0xbd8f('0x36')]({},_0x52c62b,_0x14b768[_0xbd8f('0x41')]);return db[_0xbd8f('0x25')][_0xbd8f('0x42')](_0x52c62b)['then'](handleEntityNotFound(_0x5e1e77,null))[_0xbd8f('0x1f')](respondWithResult(_0x5e1e77,null))[_0xbd8f('0x3c')](handleError(_0x5e1e77,null));};exports[_0xbd8f('0x43')]=function(_0x1f12dd,_0x2fdbd0){return db[_0xbd8f('0x25')][_0xbd8f('0x43')](_0x1f12dd[_0xbd8f('0x44')],{})[_0xbd8f('0x1f')](respondWithResult(_0x2fdbd0,0xc9))[_0xbd8f('0x3c')](handleError(_0x2fdbd0,null));};exports[_0xbd8f('0x1e')]=function(_0x255c59,_0x3d0ffa){if(_0x255c59[_0xbd8f('0x44')]['id']){delete _0x255c59[_0xbd8f('0x44')]['id'];}return db[_0xbd8f('0x25')][_0xbd8f('0x42')]({'where':{'id':_0x255c59[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x3d0ffa,null))['then'](saveUpdates(_0x255c59[_0xbd8f('0x44')],null))[_0xbd8f('0x1f')](respondWithResult(_0x3d0ffa,null))[_0xbd8f('0x3c')](handleError(_0x3d0ffa,null));};exports[_0xbd8f('0x45')]=function(_0x4ce6b0,_0x1b38ad){return db['ChatQueueReport'][_0xbd8f('0x42')]({'where':{'id':_0x4ce6b0[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x1b38ad,null))[_0xbd8f('0x1f')](removeEntity(_0x1b38ad,null))['catch'](handleError(_0x1b38ad,null));};exports[_0xbd8f('0x46')]=function(_0x35b814,_0x3b67ac){return db[_0xbd8f('0x25')][_0xbd8f('0x46')]()[_0xbd8f('0x1f')](respondWithResult(_0x3b67ac,null))['catch'](handleError(_0x3b67ac,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 89684f4..1e0c87f 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x3383d6,_0x4e4eb9){var _0x2d247d=function(_0x5b9a13){while(--_0x5b9a13){_0x3383d6['push'](_0x3383d6['shift']());}};_0x2d247d(++_0x4e4eb9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x4ca648,_0x6ce4b2){var _0x3d8d54=function(_0x1ef0fd){while(--_0x1ef0fd){_0x4ca648['push'](_0x4ca648['shift']());}};_0x3d8d54(++_0x6ce4b2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index a1ebe50..00e8947 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 _0x722b=['stringify','error','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport','create','body','options','then','debug','ChatQueueReport','raw','where','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3ac16c,_0x54c187){var _0x1204e6=function(_0x25cf2c){while(--_0x25cf2c){_0x3ac16c['push'](_0x3ac16c['shift']());}};_0x1204e6(++_0x54c187);}(_0x722b,0x1e2));var _0xb722=function(_0x582b86,_0x251422){_0x582b86=_0x582b86-0x0;var _0x57f4c2=_0x722b[_0x582b86];return _0x57f4c2;};'use strict';var _=require(_0xb722('0x0'));var util=require(_0xb722('0x1'));var moment=require(_0xb722('0x2'));var BPromise=require('bluebird');var rs=require(_0xb722('0x3'));var fs=require('fs');var Redis=require(_0xb722('0x4'));var db=require(_0xb722('0x5'))['db'];var utils=require(_0xb722('0x6'));var logger=require(_0xb722('0x7'))('rpc');var config=require(_0xb722('0x8'));var jayson=require(_0xb722('0x9'));var client=jayson[_0xb722('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x284fff,_0x5b900a,_0x14bdd9){return new BPromise(function(_0x3e49fe,_0x207792){return client[_0xb722('0xb')](_0x284fff,_0x14bdd9)['then'](function(_0x3a15f8){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5b900a,_0xb722('0xc'));logger['debug'](_0xb722('0xd'),_0x5b900a,_0xb722('0xc'),JSON[_0xb722('0xe')](_0x3a15f8));if(_0x3a15f8[_0xb722('0xf')]){if(_0x3a15f8[_0xb722('0xf')]['code']===0x1f4){logger['error'](_0xb722('0x10'),_0x5b900a,_0x3a15f8['error'][_0xb722('0x11')]);return _0x207792(_0x3a15f8['error'][_0xb722('0x11')]);}logger[_0xb722('0xf')](_0xb722('0x10'),_0x5b900a,_0x3a15f8['error']['message']);return _0x3e49fe(_0x3a15f8[_0xb722('0xf')][_0xb722('0x11')]);}else{logger[_0xb722('0x12')](_0xb722('0x10'),_0x5b900a,_0xb722('0xc'));_0x3e49fe(_0x3a15f8[_0xb722('0x13')][_0xb722('0x11')]);}})[_0xb722('0x14')](function(_0xa7cda0){logger[_0xb722('0xf')](_0xb722('0x10'),_0x5b900a,_0xa7cda0);_0x207792(_0xa7cda0);});});}exports[_0xb722('0x15')]=function(_0xa023cc){var _0x148dac=this;return new Promise(function(_0x334cb7,_0x3f654c){return db['ChatQueueReport'][_0xb722('0x16')](_0xa023cc[_0xb722('0x17')],{'raw':_0xa023cc[_0xb722('0x18')]?_0xa023cc[_0xb722('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xb722('0x19')](function(_0x2a7f6f){logger[_0xb722('0x12')]('CreateChatQueueReport',_0xa023cc);logger[_0xb722('0x1a')](_0xb722('0x15'),_0xa023cc,JSON[_0xb722('0xe')](_0x2a7f6f));_0x334cb7(_0x2a7f6f);})['catch'](function(_0x10c9c5){logger[_0xb722('0xf')](_0xb722('0x15'),_0x10c9c5['message'],_0xa023cc);_0x3f654c(_0x148dac['error'](0x1f4,_0x10c9c5[_0xb722('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x107464){var _0x584e37=this;return new Promise(function(_0x4287ba,_0x5a2397){return db[_0xb722('0x1b')]['update'](_0x107464['body'],{'raw':_0x107464[_0xb722('0x18')]?_0x107464['options'][_0xb722('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x107464[_0xb722('0x18')]?_0x107464[_0xb722('0x18')][_0xb722('0x1d')]||null:null,'attributes':_0x107464[_0xb722('0x18')]?_0x107464['options']['attributes']||null:null,'limit':_0x107464[_0xb722('0x18')]?_0x107464[_0xb722('0x18')]['limit']||null:null})[_0xb722('0x19')](function(_0x24606f){logger['info']('UpdateChatQueueReport',_0x107464);logger[_0xb722('0x1a')]('UpdateChatQueueReport',_0x107464,JSON[_0xb722('0xe')](_0x24606f));_0x4287ba(_0x24606f);})['catch'](function(_0x5dd9bb){logger[_0xb722('0xf')](_0xb722('0x1e'),_0x5dd9bb[_0xb722('0x11')],_0x107464);_0x5a2397(_0x584e37['error'](0x1f4,_0x5dd9bb['message']));});});};
\ No newline at end of file
+var _0x9fd0=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','raw','UpdateChatQueueReport','options','where','attributes','lodash','util','bluebird'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9fd0,0x13c));var _0x09fd=function(_0x584beb,_0x45f583){_0x584beb=_0x584beb-0x0;var _0x1e316d=_0x9fd0[_0x584beb];return _0x1e316d;};'use strict';var _=require(_0x09fd('0x0'));var util=require(_0x09fd('0x1'));var moment=require('moment');var BPromise=require(_0x09fd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09fd('0x3'))['db'];var utils=require(_0x09fd('0x4'));var logger=require('../../config/logger')(_0x09fd('0x5'));var config=require(_0x09fd('0x6'));var jayson=require(_0x09fd('0x7'));var client=jayson['client'][_0x09fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2387be,_0xafbeb3,_0x55c347){return new BPromise(function(_0x1261a3,_0xca76e3){return client['request'](_0x2387be,_0x55c347)[_0x09fd('0x9')](function(_0x59c37c){logger[_0x09fd('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0xafbeb3,_0x09fd('0xb'));logger[_0x09fd('0xc')](_0x09fd('0xd'),_0xafbeb3,_0x09fd('0xb'),JSON[_0x09fd('0xe')](_0x59c37c));if(_0x59c37c[_0x09fd('0xf')]){if(_0x59c37c[_0x09fd('0xf')][_0x09fd('0x10')]===0x1f4){logger['error'](_0x09fd('0x11'),_0xafbeb3,_0x59c37c[_0x09fd('0xf')][_0x09fd('0x12')]);return _0xca76e3(_0x59c37c[_0x09fd('0xf')][_0x09fd('0x12')]);}logger[_0x09fd('0xf')](_0x09fd('0x11'),_0xafbeb3,_0x59c37c[_0x09fd('0xf')]['message']);return _0x1261a3(_0x59c37c[_0x09fd('0xf')][_0x09fd('0x12')]);}else{logger[_0x09fd('0xa')](_0x09fd('0x11'),_0xafbeb3,'request\x20sent');_0x1261a3(_0x59c37c[_0x09fd('0x13')][_0x09fd('0x12')]);}})[_0x09fd('0x14')](function(_0x417ca3){logger[_0x09fd('0xf')](_0x09fd('0x11'),_0xafbeb3,_0x417ca3);_0xca76e3(_0x417ca3);});});}exports[_0x09fd('0x15')]=function(_0x37c692){var _0x5ebea1=this;return new Promise(function(_0x57059e,_0x199503){return db[_0x09fd('0x16')]['create'](_0x37c692[_0x09fd('0x17')],{'raw':_0x37c692['options']?_0x37c692['options'][_0x09fd('0x18')]===undefined?!![]:![]:!![]})[_0x09fd('0x9')](function(_0x410263){logger[_0x09fd('0xa')]('CreateChatQueueReport',_0x37c692);logger['debug'](_0x09fd('0x15'),_0x37c692,JSON['stringify'](_0x410263));_0x57059e(_0x410263);})[_0x09fd('0x14')](function(_0x2ba39a){logger[_0x09fd('0xf')](_0x09fd('0x15'),_0x2ba39a['message'],_0x37c692);_0x199503(_0x5ebea1[_0x09fd('0xf')](0x1f4,_0x2ba39a[_0x09fd('0x12')]));});});};exports[_0x09fd('0x19')]=function(_0x2216fb){var _0x376b3d=this;return new Promise(function(_0xfeef43,_0x183699){return db[_0x09fd('0x16')]['update'](_0x2216fb[_0x09fd('0x17')],{'raw':_0x2216fb[_0x09fd('0x1a')]?_0x2216fb['options'][_0x09fd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2216fb[_0x09fd('0x1a')]?_0x2216fb[_0x09fd('0x1a')][_0x09fd('0x1b')]||null:null,'attributes':_0x2216fb[_0x09fd('0x1a')]?_0x2216fb['options'][_0x09fd('0x1c')]||null:null,'limit':_0x2216fb[_0x09fd('0x1a')]?_0x2216fb[_0x09fd('0x1a')]['limit']||null:null})[_0x09fd('0x9')](function(_0x2c9958){logger[_0x09fd('0xa')](_0x09fd('0x19'),_0x2216fb);logger[_0x09fd('0xc')](_0x09fd('0x19'),_0x2216fb,JSON['stringify'](_0x2c9958));_0xfeef43(_0x2c9958);})[_0x09fd('0x14')](function(_0x5baeef){logger[_0x09fd('0xf')](_0x09fd('0x19'),_0x5baeef[_0x09fd('0x12')],_0x2216fb);_0x183699(_0x376b3d[_0x09fd('0xf')](0x1f4,_0x5baeef[_0x09fd('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 6e41dad..165d660 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 _0x3b9c=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x33991e,_0x191657){var _0x2f8b34=function(_0x55ed46){while(--_0x55ed46){_0x33991e['push'](_0x33991e['shift']());}};_0x2f8b34(++_0x191657);}(_0x3b9c,0x148));var _0xc3b9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b9c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc3b9('0x0'));var util=require(_0xc3b9('0x1'));var path=require(_0xc3b9('0x2'));var timeout=require(_0xc3b9('0x3'));var express=require(_0xc3b9('0x4'));var router=express[_0xc3b9('0x5')]();var fs_extra=require(_0xc3b9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc3b9('0x7'));var config=require('../../config/environment');var controller=require(_0xc3b9('0x8'));router[_0xc3b9('0x9')]('/',auth[_0xc3b9('0xa')](),controller[_0xc3b9('0xb')]);router['get'](_0xc3b9('0xc'),auth['isAuthenticated'](),controller[_0xc3b9('0xd')]);router[_0xc3b9('0x9')](_0xc3b9('0xe'),auth[_0xc3b9('0xa')](),controller[_0xc3b9('0xf')]);router[_0xc3b9('0x10')]('/',auth[_0xc3b9('0xa')](),controller['create']);router[_0xc3b9('0x11')]('/:id',auth[_0xc3b9('0xa')](),controller[_0xc3b9('0x12')]);router[_0xc3b9('0x13')](_0xc3b9('0xe'),auth[_0xc3b9('0xa')](),controller['destroy']);module[_0xc3b9('0x14')]=router;
\ No newline at end of file
+var _0xfbc5=['util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer'];(function(_0x1d3892,_0x47d5fe){var _0x574ff2=function(_0x5cc441){while(--_0x5cc441){_0x1d3892['push'](_0x1d3892['shift']());}};_0x574ff2(++_0x47d5fe);}(_0xfbc5,0x1f3));var _0x5fbc=function(_0x1cf1e2,_0x10fcc4){_0x1cf1e2=_0x1cf1e2-0x0;var _0x3c6e18=_0xfbc5[_0x1cf1e2];return _0x3c6e18;};'use strict';var multer=require(_0x5fbc('0x0'));var util=require(_0x5fbc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5fbc('0x2'));var router=express[_0x5fbc('0x3')]();var fs_extra=require(_0x5fbc('0x4'));var auth=require(_0x5fbc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5fbc('0x6'));var controller=require(_0x5fbc('0x7'));router[_0x5fbc('0x8')]('/',auth['isAuthenticated'](),controller[_0x5fbc('0x9')]);router[_0x5fbc('0x8')](_0x5fbc('0xa'),auth[_0x5fbc('0xb')](),controller[_0x5fbc('0xc')]);router[_0x5fbc('0x8')](_0x5fbc('0xd'),auth[_0x5fbc('0xb')](),controller[_0x5fbc('0xe')]);router['post']('/',auth[_0x5fbc('0xb')](),controller['create']);router[_0x5fbc('0xf')](_0x5fbc('0xd'),auth[_0x5fbc('0xb')](),controller[_0x5fbc('0x10')]);router[_0x5fbc('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5fbc('0x12')]);module[_0x5fbc('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c3b216e..1689ef0 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x492f90,_0x5c3c44){var _0x4bdee5=function(_0x36c5e2){while(--_0x36c5e2){_0x492f90['push'](_0x492f90['shift']());}};_0x4bdee5(++_0x5c3c44);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xcb91[_0x44a64f];return _0x52024b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 94e0f60..d83715d 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 _0x2a2f=['index','ChatTransferReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','catch','fields','create','body','update','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','error','stack','name'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x2a2f,0xb7));var _0xf2a2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2a2f[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2a2('0x0'));var zipdir=require(_0xf2a2('0x1'));var jsonpatch=require(_0xf2a2('0x2'));var rp=require('request-promise');var moment=require(_0xf2a2('0x3'));var BPromise=require(_0xf2a2('0x4'));var Mustache=require(_0xf2a2('0x5'));var util=require(_0xf2a2('0x6'));var path=require(_0xf2a2('0x7'));var sox=require('sox');var csv=require(_0xf2a2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2a2('0x9'));var _=require(_0xf2a2('0xa'));var squel=require(_0xf2a2('0xb'));var crypto=require('crypto');var jsforce=require(_0xf2a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf2a2('0x8'));var querystring=require('querystring');var Papa=require(_0xf2a2('0xd'));var Redis=require(_0xf2a2('0xe'));var authService=require(_0xf2a2('0xf'));var qs=require(_0xf2a2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2a2('0x11'));var logger=require('../../config/logger')(_0xf2a2('0x12'));var utils=require(_0xf2a2('0x13'));var config=require(_0xf2a2('0x14'));var licenseUtil=require(_0xf2a2('0x15'));var db=require(_0xf2a2('0x16'))['db'];function respondWithStatusCode(_0x52604d,_0x26d0b1){_0x26d0b1=_0x26d0b1||0xcc;return function(_0x9b1a73){if(_0x9b1a73){return _0x52604d[_0xf2a2('0x17')](_0x26d0b1);}return _0x52604d[_0xf2a2('0x18')](_0x26d0b1)[_0xf2a2('0x19')]();};}function respondWithResult(_0x3b0cee,_0x212d4c){_0x212d4c=_0x212d4c||0xc8;return function(_0x5dd4ac){if(_0x5dd4ac){return _0x3b0cee[_0xf2a2('0x18')](_0x212d4c)[_0xf2a2('0x1a')](_0x5dd4ac);}};}function respondWithFilteredResult(_0x37fd44,_0x5a0240){return function(_0x6addc1){if(_0x6addc1){var _0x1aee64=typeof _0x5a0240[_0xf2a2('0x1b')]===_0xf2a2('0x1c')&&typeof _0x5a0240[_0xf2a2('0x1d')]===_0xf2a2('0x1c');var _0x1766d8=_0x6addc1[_0xf2a2('0x1e')];var _0x46945f=_0x1aee64?0x0:_0x5a0240[_0xf2a2('0x1b')];var _0x44c4a3=_0x1aee64?_0x6addc1[_0xf2a2('0x1e')]:_0x5a0240[_0xf2a2('0x1b')]+_0x5a0240['limit'];var _0x74182d;if(_0x44c4a3>=_0x1766d8){_0x44c4a3=_0x1766d8;_0x74182d=0xc8;}else{_0x74182d=0xce;}_0x37fd44[_0xf2a2('0x18')](_0x74182d);return _0x37fd44['set']('Content-Range',_0x46945f+'-'+_0x44c4a3+'/'+_0x1766d8)[_0xf2a2('0x1a')](_0x6addc1);}return null;};}function patchUpdates(_0x57cf83){return function(_0x44eda5){try{jsonpatch['apply'](_0x44eda5,_0x57cf83,!![]);}catch(_0x10c4db){return BPromise[_0xf2a2('0x1f')](_0x10c4db);}return _0x44eda5[_0xf2a2('0x20')]();};}function saveUpdates(_0x7e10ec,_0x5c3e9c){return function(_0x4292b6){if(_0x4292b6){return _0x4292b6['update'](_0x7e10ec)['then'](function(_0x300b9a){return _0x300b9a;});}return null;};}function removeEntity(_0x36ab03,_0x2b8b45){return function(_0x14d278){if(_0x14d278){return _0x14d278['destroy']()['then'](function(){_0x36ab03[_0xf2a2('0x18')](0xcc)[_0xf2a2('0x19')]();});}};}function handleEntityNotFound(_0x494e7e,_0x5ae29a){return function(_0x54a209){if(!_0x54a209){_0x494e7e['sendStatus'](0x194);}return _0x54a209;};}function handleError(_0xdd24e3,_0x1c1dfe){_0x1c1dfe=_0x1c1dfe||0x1f4;return function(_0x50295d){logger[_0xf2a2('0x21')](_0x50295d[_0xf2a2('0x22')]);if(_0x50295d[_0xf2a2('0x23')]){delete _0x50295d['name'];}_0xdd24e3['status'](_0x1c1dfe)['send'](_0x50295d);};}exports[_0xf2a2('0x24')]=function(_0x24576d,_0x2e1653){var _0x2e691c={},_0x502a0f={},_0x4d6de1={'count':0x0,'rows':[]};var _0x12472a=_['map'](db[_0xf2a2('0x25')][_0xf2a2('0x26')],function(_0x254bd5){return{'name':_0x254bd5[_0xf2a2('0x27')],'type':_0x254bd5[_0xf2a2('0x28')]['key']};});_0x502a0f[_0xf2a2('0x29')]=_[_0xf2a2('0x2a')](_0x12472a,_0xf2a2('0x23'));_0x502a0f[_0xf2a2('0x2b')]=_[_0xf2a2('0x2c')](_0x24576d[_0xf2a2('0x2b')]);_0x502a0f['filters']=_[_0xf2a2('0x2d')](_0x502a0f[_0xf2a2('0x29')],_0x502a0f[_0xf2a2('0x2b')]);_0x2e691c[_0xf2a2('0x2e')]=_[_0xf2a2('0x2d')](_0x502a0f[_0xf2a2('0x29')],qs['fields'](_0x24576d[_0xf2a2('0x2b')]['fields']));_0x2e691c[_0xf2a2('0x2e')]=_0x2e691c[_0xf2a2('0x2e')][_0xf2a2('0x2f')]?_0x2e691c[_0xf2a2('0x2e')]:_0x502a0f[_0xf2a2('0x29')];if(!_0x24576d[_0xf2a2('0x2b')][_0xf2a2('0x30')](_0xf2a2('0x31'))){_0x2e691c[_0xf2a2('0x1d')]=qs['limit'](_0x24576d[_0xf2a2('0x2b')][_0xf2a2('0x1d')]);_0x2e691c['offset']=qs[_0xf2a2('0x1b')](_0x24576d[_0xf2a2('0x2b')][_0xf2a2('0x1b')]);}_0x2e691c[_0xf2a2('0x32')]=qs['sort'](_0x24576d[_0xf2a2('0x2b')][_0xf2a2('0x33')]);_0x2e691c['where']=qs[_0xf2a2('0x34')](_[_0xf2a2('0x35')](_0x24576d[_0xf2a2('0x2b')],_0x502a0f[_0xf2a2('0x34')]),_0x12472a);if(_0x24576d[_0xf2a2('0x2b')]['filter']){_0x2e691c['where']=_[_0xf2a2('0x36')](_0x2e691c[_0xf2a2('0x37')],{'$or':_['map'](_0x12472a,function(_0xfa0359){if(_0xfa0359['type']!==_0xf2a2('0x38')){var _0x356d3e={};_0x356d3e[_0xfa0359[_0xf2a2('0x23')]]={'$like':'%'+_0x24576d[_0xf2a2('0x2b')][_0xf2a2('0x39')]+'%'};return _0x356d3e;}})});}_0x2e691c=_['merge']({},_0x2e691c,_0x24576d[_0xf2a2('0x3a')]);var _0x3c497d={'where':_0x2e691c[_0xf2a2('0x37')]};return db[_0xf2a2('0x25')][_0xf2a2('0x1e')](_0x3c497d)['then'](function(_0x251162){_0x4d6de1['count']=_0x251162;if(_0x24576d[_0xf2a2('0x2b')][_0xf2a2('0x3b')]){_0x2e691c[_0xf2a2('0x3c')]=[{'all':!![]}];}return db[_0xf2a2('0x25')][_0xf2a2('0x3d')](_0x2e691c);})[_0xf2a2('0x3e')](function(_0x1880b7){_0x4d6de1[_0xf2a2('0x3f')]=_0x1880b7;return _0x4d6de1;})[_0xf2a2('0x3e')](respondWithFilteredResult(_0x2e1653,_0x2e691c))[_0xf2a2('0x40')](handleError(_0x2e1653,null));};exports['show']=function(_0x1109e4,_0x52fbdb){var _0xa27cc0={'raw':!![],'where':{'id':_0x1109e4['params']['id']}},_0x23b238={};_0x23b238[_0xf2a2('0x29')]=_[_0xf2a2('0x2c')](db['ChatTransferReport'][_0xf2a2('0x26')]);_0x23b238[_0xf2a2('0x2b')]=_[_0xf2a2('0x2c')](_0x1109e4['query']);_0x23b238[_0xf2a2('0x34')]=_['intersection'](_0x23b238[_0xf2a2('0x29')],_0x23b238[_0xf2a2('0x2b')]);_0xa27cc0[_0xf2a2('0x2e')]=_[_0xf2a2('0x2d')](_0x23b238[_0xf2a2('0x29')],qs[_0xf2a2('0x41')](_0x1109e4['query']['fields']));_0xa27cc0['attributes']=_0xa27cc0['attributes']['length']?_0xa27cc0['attributes']:_0x23b238['model'];if(_0x1109e4[_0xf2a2('0x2b')][_0xf2a2('0x3b')]){_0xa27cc0[_0xf2a2('0x3c')]=[{'all':!![]}];}_0xa27cc0=_[_0xf2a2('0x36')]({},_0xa27cc0,_0x1109e4['options']);return db['ChatTransferReport']['find'](_0xa27cc0)[_0xf2a2('0x3e')](handleEntityNotFound(_0x52fbdb,null))[_0xf2a2('0x3e')](respondWithResult(_0x52fbdb,null))['catch'](handleError(_0x52fbdb,null));};exports[_0xf2a2('0x42')]=function(_0xad2a77,_0x3ad245){return db[_0xf2a2('0x25')]['create'](_0xad2a77[_0xf2a2('0x43')],{})[_0xf2a2('0x3e')](respondWithResult(_0x3ad245,0xc9))['catch'](handleError(_0x3ad245,null));};exports[_0xf2a2('0x44')]=function(_0x23643e,_0x21849e){if(_0x23643e[_0xf2a2('0x43')]['id']){delete _0x23643e[_0xf2a2('0x43')]['id'];}return db[_0xf2a2('0x25')][_0xf2a2('0x45')]({'where':{'id':_0x23643e[_0xf2a2('0x46')]['id']}})[_0xf2a2('0x3e')](handleEntityNotFound(_0x21849e,null))[_0xf2a2('0x3e')](saveUpdates(_0x23643e[_0xf2a2('0x43')],null))[_0xf2a2('0x3e')](respondWithResult(_0x21849e,null))[_0xf2a2('0x40')](handleError(_0x21849e,null));};exports[_0xf2a2('0x47')]=function(_0x54d820,_0x1868f0){return db[_0xf2a2('0x25')][_0xf2a2('0x45')]({'where':{'id':_0x54d820[_0xf2a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x1868f0,null))[_0xf2a2('0x3e')](removeEntity(_0x1868f0,null))[_0xf2a2('0x40')](handleError(_0x1868f0,null));};exports[_0xf2a2('0x48')]=function(_0x3f02a0,_0x46fcea){return db[_0xf2a2('0x25')][_0xf2a2('0x48')]()[_0xf2a2('0x3e')](respondWithResult(_0x46fcea,null))['catch'](handleError(_0x46fcea,null));};
\ No newline at end of file
+var _0xde7a=['findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include'];(function(_0x1541bb,_0x58b07c){var _0x409bec=function(_0x416e50){while(--_0x416e50){_0x1541bb['push'](_0x1541bb['shift']());}};_0x409bec(++_0x58b07c);}(_0xde7a,0xa6));var _0xade7=function(_0x34ece7,_0x197dce){_0x34ece7=_0x34ece7-0x0;var _0x2bb837=_0xde7a[_0x34ece7];return _0x2bb837;};'use strict';var emlformat=require(_0xade7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xade7('0x1'));var jsonpatch=require(_0xade7('0x2'));var rp=require(_0xade7('0x3'));var moment=require(_0xade7('0x4'));var BPromise=require(_0xade7('0x5'));var Mustache=require(_0xade7('0x6'));var util=require(_0xade7('0x7'));var path=require(_0xade7('0x8'));var sox=require('sox');var csv=require(_0xade7('0x9'));var ejs=require(_0xade7('0xa'));var fs=require('fs');var fs_extra=require(_0xade7('0xb'));var _=require(_0xade7('0xc'));var squel=require('squel');var crypto=require(_0xade7('0xd'));var jsforce=require(_0xade7('0xe'));var deskjs=require(_0xade7('0xf'));var toCsv=require(_0xade7('0x9'));var querystring=require(_0xade7('0x10'));var Papa=require(_0xade7('0x11'));var Redis=require(_0xade7('0x12'));var authService=require(_0xade7('0x13'));var qs=require(_0xade7('0x14'));var as=require(_0xade7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xade7('0x16'))('api');var utils=require(_0xade7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xade7('0x18'));var db=require(_0xade7('0x19'))['db'];function respondWithStatusCode(_0x4d5e6f,_0xc6753f){_0xc6753f=_0xc6753f||0xcc;return function(_0x5c5733){if(_0x5c5733){return _0x4d5e6f[_0xade7('0x1a')](_0xc6753f);}return _0x4d5e6f[_0xade7('0x1b')](_0xc6753f)[_0xade7('0x1c')]();};}function respondWithResult(_0x560f21,_0x38e013){_0x38e013=_0x38e013||0xc8;return function(_0x21b4ee){if(_0x21b4ee){return _0x560f21['status'](_0x38e013)[_0xade7('0x1d')](_0x21b4ee);}};}function respondWithFilteredResult(_0x5565d4,_0x5f31ba){return function(_0x4bdf1c){if(_0x4bdf1c){var _0x4fc876=typeof _0x5f31ba[_0xade7('0x1e')]===_0xade7('0x1f')&&typeof _0x5f31ba['limit']===_0xade7('0x1f');var _0x3eb2c8=_0x4bdf1c[_0xade7('0x20')];var _0xf61991=_0x4fc876?0x0:_0x5f31ba[_0xade7('0x1e')];var _0x4aed39=_0x4fc876?_0x4bdf1c[_0xade7('0x20')]:_0x5f31ba[_0xade7('0x1e')]+_0x5f31ba[_0xade7('0x21')];var _0x5961d9;if(_0x4aed39>=_0x3eb2c8){_0x4aed39=_0x3eb2c8;_0x5961d9=0xc8;}else{_0x5961d9=0xce;}_0x5565d4['status'](_0x5961d9);return _0x5565d4[_0xade7('0x22')](_0xade7('0x23'),_0xf61991+'-'+_0x4aed39+'/'+_0x3eb2c8)[_0xade7('0x1d')](_0x4bdf1c);}return null;};}function patchUpdates(_0x24a9af){return function(_0x1ce8eb){try{jsonpatch[_0xade7('0x24')](_0x1ce8eb,_0x24a9af,!![]);}catch(_0x54d69d){return BPromise[_0xade7('0x25')](_0x54d69d);}return _0x1ce8eb[_0xade7('0x26')]();};}function saveUpdates(_0x2b6761,_0x366342){return function(_0x1cf2ee){if(_0x1cf2ee){return _0x1cf2ee[_0xade7('0x27')](_0x2b6761)[_0xade7('0x28')](function(_0x428011){return _0x428011;});}return null;};}function removeEntity(_0x14ca3e,_0x1b2ad7){return function(_0x412178){if(_0x412178){return _0x412178[_0xade7('0x29')]()[_0xade7('0x28')](function(){_0x14ca3e['status'](0xcc)[_0xade7('0x1c')]();});}};}function handleEntityNotFound(_0x2bd4fc,_0x3f87b0){return function(_0x45c671){if(!_0x45c671){_0x2bd4fc[_0xade7('0x1a')](0x194);}return _0x45c671;};}function handleError(_0x578d37,_0x4597cd){_0x4597cd=_0x4597cd||0x1f4;return function(_0x483426){logger[_0xade7('0x2a')](_0x483426[_0xade7('0x2b')]);if(_0x483426['name']){delete _0x483426[_0xade7('0x2c')];}_0x578d37['status'](_0x4597cd)[_0xade7('0x2d')](_0x483426);};}exports[_0xade7('0x2e')]=function(_0x49cd4c,_0x55c050){var _0x40be13={},_0x3385d1={},_0x26fc41={'count':0x0,'rows':[]};var _0x517bb0=_[_0xade7('0x2f')](db['ChatTransferReport'][_0xade7('0x30')],function(_0x4f94bf){return{'name':_0x4f94bf['fieldName'],'type':_0x4f94bf[_0xade7('0x31')][_0xade7('0x32')]};});_0x3385d1['model']=_[_0xade7('0x2f')](_0x517bb0,_0xade7('0x2c'));_0x3385d1['query']=_[_0xade7('0x33')](_0x49cd4c[_0xade7('0x34')]);_0x3385d1[_0xade7('0x35')]=_[_0xade7('0x36')](_0x3385d1[_0xade7('0x37')],_0x3385d1['query']);_0x40be13[_0xade7('0x38')]=_[_0xade7('0x36')](_0x3385d1[_0xade7('0x37')],qs['fields'](_0x49cd4c[_0xade7('0x34')][_0xade7('0x39')]));_0x40be13[_0xade7('0x38')]=_0x40be13[_0xade7('0x38')][_0xade7('0x3a')]?_0x40be13['attributes']:_0x3385d1[_0xade7('0x37')];if(!_0x49cd4c[_0xade7('0x34')]['hasOwnProperty'](_0xade7('0x3b'))){_0x40be13[_0xade7('0x21')]=qs['limit'](_0x49cd4c[_0xade7('0x34')][_0xade7('0x21')]);_0x40be13[_0xade7('0x1e')]=qs[_0xade7('0x1e')](_0x49cd4c[_0xade7('0x34')][_0xade7('0x1e')]);}_0x40be13[_0xade7('0x3c')]=qs['sort'](_0x49cd4c[_0xade7('0x34')][_0xade7('0x3d')]);_0x40be13[_0xade7('0x3e')]=qs[_0xade7('0x35')](_[_0xade7('0x3f')](_0x49cd4c[_0xade7('0x34')],_0x3385d1[_0xade7('0x35')]),_0x517bb0);if(_0x49cd4c[_0xade7('0x34')][_0xade7('0x40')]){_0x40be13[_0xade7('0x3e')]=_[_0xade7('0x41')](_0x40be13['where'],{'$or':_['map'](_0x517bb0,function(_0x5ddf2a){if(_0x5ddf2a[_0xade7('0x31')]!==_0xade7('0x42')){var _0x363a54={};_0x363a54[_0x5ddf2a[_0xade7('0x2c')]]={'$like':'%'+_0x49cd4c['query'][_0xade7('0x40')]+'%'};return _0x363a54;}})});}_0x40be13=_[_0xade7('0x41')]({},_0x40be13,_0x49cd4c[_0xade7('0x43')]);var _0x54be97={'where':_0x40be13[_0xade7('0x3e')]};return db[_0xade7('0x44')][_0xade7('0x20')](_0x54be97)[_0xade7('0x28')](function(_0x5c9ad5){_0x26fc41['count']=_0x5c9ad5;if(_0x49cd4c['query'][_0xade7('0x45')]){_0x40be13[_0xade7('0x46')]=[{'all':!![]}];}return db[_0xade7('0x44')][_0xade7('0x47')](_0x40be13);})[_0xade7('0x28')](function(_0x48fe52){_0x26fc41[_0xade7('0x48')]=_0x48fe52;return _0x26fc41;})['then'](respondWithFilteredResult(_0x55c050,_0x40be13))[_0xade7('0x49')](handleError(_0x55c050,null));};exports['show']=function(_0x1c0c28,_0x4d9607){var _0x587ca7={'raw':!![],'where':{'id':_0x1c0c28[_0xade7('0x4a')]['id']}},_0x7a9719={};_0x7a9719['model']=_[_0xade7('0x33')](db[_0xade7('0x44')]['rawAttributes']);_0x7a9719[_0xade7('0x34')]=_[_0xade7('0x33')](_0x1c0c28[_0xade7('0x34')]);_0x7a9719[_0xade7('0x35')]=_[_0xade7('0x36')](_0x7a9719['model'],_0x7a9719['query']);_0x587ca7[_0xade7('0x38')]=_[_0xade7('0x36')](_0x7a9719['model'],qs['fields'](_0x1c0c28[_0xade7('0x34')]['fields']));_0x587ca7[_0xade7('0x38')]=_0x587ca7[_0xade7('0x38')][_0xade7('0x3a')]?_0x587ca7[_0xade7('0x38')]:_0x7a9719[_0xade7('0x37')];if(_0x1c0c28[_0xade7('0x34')][_0xade7('0x45')]){_0x587ca7[_0xade7('0x46')]=[{'all':!![]}];}_0x587ca7=_[_0xade7('0x41')]({},_0x587ca7,_0x1c0c28[_0xade7('0x43')]);return db[_0xade7('0x44')][_0xade7('0x4b')](_0x587ca7)[_0xade7('0x28')](handleEntityNotFound(_0x4d9607,null))[_0xade7('0x28')](respondWithResult(_0x4d9607,null))[_0xade7('0x49')](handleError(_0x4d9607,null));};exports[_0xade7('0x4c')]=function(_0x529a58,_0x539129){return db[_0xade7('0x44')][_0xade7('0x4c')](_0x529a58['body'],{})[_0xade7('0x28')](respondWithResult(_0x539129,0xc9))[_0xade7('0x49')](handleError(_0x539129,null));};exports[_0xade7('0x27')]=function(_0x45f1c0,_0x58b102){if(_0x45f1c0['body']['id']){delete _0x45f1c0[_0xade7('0x4d')]['id'];}return db[_0xade7('0x44')][_0xade7('0x4b')]({'where':{'id':_0x45f1c0[_0xade7('0x4a')]['id']}})[_0xade7('0x28')](handleEntityNotFound(_0x58b102,null))[_0xade7('0x28')](saveUpdates(_0x45f1c0[_0xade7('0x4d')],null))[_0xade7('0x28')](respondWithResult(_0x58b102,null))[_0xade7('0x49')](handleError(_0x58b102,null));};exports[_0xade7('0x29')]=function(_0x1e5eb7,_0x279795){return db[_0xade7('0x44')][_0xade7('0x4b')]({'where':{'id':_0x1e5eb7['params']['id']}})[_0xade7('0x28')](handleEntityNotFound(_0x279795,null))[_0xade7('0x28')](removeEntity(_0x279795,null))[_0xade7('0x49')](handleError(_0x279795,null));};exports[_0xade7('0x4e')]=function(_0x6ce279,_0x2fe49b){return db[_0xade7('0x44')]['describe']()[_0xade7('0x28')](respondWithResult(_0x2fe49b,null))['catch'](handleError(_0x2fe49b,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e46a523..81b8add 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 _0xd46d=['moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api'];(function(_0x10b898,_0x1c213c){var _0x58ee85=function(_0x1e86e8){while(--_0x1e86e8){_0x10b898['push'](_0x10b898['shift']());}};_0x58ee85(++_0x1c213c);}(_0xd46d,0x183));var _0xdd46=function(_0x4836b2,_0x368311){_0x4836b2=_0x4836b2-0x0;var _0xe877f3=_0xd46d[_0x4836b2];return _0xe877f3;};'use strict';var _=require(_0xdd46('0x0'));var util=require(_0xdd46('0x1'));var logger=require('../../config/logger')(_0xdd46('0x2'));var moment=require(_0xdd46('0x3'));var BPromise=require(_0xdd46('0x4'));var rp=require(_0xdd46('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdd46('0x6'));var attributes=require(_0xdd46('0x7'));module[_0xdd46('0x8')]=function(_0x1d36fb,_0x4fa1f1){return _0x1d36fb[_0xdd46('0x9')](_0xdd46('0xa'),attributes,{'tableName':_0xdd46('0xb'),'paranoid':![],'indexes':[{'name':_0xdd46('0xc'),'fields':[_0xdd46('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x599a=['./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x110320,_0x9e327c){var _0x2762ff=function(_0x442c58){while(--_0x442c58){_0x110320['push'](_0x110320['shift']());}};_0x2762ff(++_0x9e327c);}(_0x599a,0x17f));var _0xa599=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x599a[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0xa599('0x0'));var util=require(_0xa599('0x1'));var logger=require(_0xa599('0x2'))(_0xa599('0x3'));var moment=require(_0xa599('0x4'));var BPromise=require('bluebird');var rp=require(_0xa599('0x5'));var fs=require('fs');var path=require(_0xa599('0x6'));var rimraf=require(_0xa599('0x7'));var config=require(_0xa599('0x8'));var attributes=require(_0xa599('0x9'));module['exports']=function(_0x2b4a8a,_0x3a7684){return _0x2b4a8a[_0xa599('0xa')](_0xa599('0xb'),attributes,{'tableName':_0xa599('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa599('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 1a62429..4343366 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 _0xcbf3=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0xcbf3,0x18f));var _0x3cbf=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xcbf3[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x3cbf('0x0'));var util=require(_0x3cbf('0x1'));var moment=require('moment');var BPromise=require(_0x3cbf('0x2'));var rs=require(_0x3cbf('0x3'));var fs=require('fs');var Redis=require(_0x3cbf('0x4'));var db=require(_0x3cbf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3cbf('0x6'));var config=require(_0x3cbf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3cbf('0x8')][_0x3cbf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x257e16,_0x4180b6,_0x39db27){return new BPromise(function(_0x467f02,_0x207e41){return client[_0x3cbf('0xa')](_0x257e16,_0x39db27)['then'](function(_0x5acff7){logger[_0x3cbf('0xb')](_0x3cbf('0xc'),_0x4180b6,_0x3cbf('0xd'));logger[_0x3cbf('0xe')](_0x3cbf('0xf'),_0x4180b6,_0x3cbf('0xd'),JSON[_0x3cbf('0x10')](_0x5acff7));if(_0x5acff7['error']){if(_0x5acff7[_0x3cbf('0x11')][_0x3cbf('0x12')]===0x1f4){logger[_0x3cbf('0x11')](_0x3cbf('0xc'),_0x4180b6,_0x5acff7[_0x3cbf('0x11')][_0x3cbf('0x13')]);return _0x207e41(_0x5acff7[_0x3cbf('0x11')][_0x3cbf('0x13')]);}logger[_0x3cbf('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4180b6,_0x5acff7[_0x3cbf('0x11')][_0x3cbf('0x13')]);return _0x467f02(_0x5acff7['error'][_0x3cbf('0x13')]);}else{logger[_0x3cbf('0xb')](_0x3cbf('0xc'),_0x4180b6,'request\x20sent');_0x467f02(_0x5acff7[_0x3cbf('0x14')][_0x3cbf('0x13')]);}})[_0x3cbf('0x15')](function(_0xb06c85){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4180b6,_0xb06c85);_0x207e41(_0xb06c85);});});}
\ No newline at end of file
+var _0xa0b6=['lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x34d6bd,_0x55b744){var _0x248396=function(_0x23f061){while(--_0x23f061){_0x34d6bd['push'](_0x34d6bd['shift']());}};_0x248396(++_0x55b744);}(_0xa0b6,0x98));var _0x6a0b=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xa0b6[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0x6a0b('0x0'));var util=require('util');var moment=require(_0x6a0b('0x1'));var BPromise=require(_0x6a0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a0b('0x3'))['db'];var utils=require(_0x6a0b('0x4'));var logger=require('../../config/logger')(_0x6a0b('0x5'));var config=require(_0x6a0b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6a0b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4250ec,_0x3ca449,_0x4aeacb){return new BPromise(function(_0xdfe835,_0x26360f){return client[_0x6a0b('0x8')](_0x4250ec,_0x4aeacb)[_0x6a0b('0x9')](function(_0x5e6c10){logger[_0x6a0b('0xa')](_0x6a0b('0xb'),_0x3ca449,_0x6a0b('0xc'));logger[_0x6a0b('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3ca449,_0x6a0b('0xc'),JSON[_0x6a0b('0xe')](_0x5e6c10));if(_0x5e6c10[_0x6a0b('0xf')]){if(_0x5e6c10['error'][_0x6a0b('0x10')]===0x1f4){logger[_0x6a0b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x3ca449,_0x5e6c10[_0x6a0b('0xf')]['message']);return _0x26360f(_0x5e6c10['error']['message']);}logger[_0x6a0b('0xf')](_0x6a0b('0xb'),_0x3ca449,_0x5e6c10[_0x6a0b('0xf')][_0x6a0b('0x11')]);return _0xdfe835(_0x5e6c10['error'][_0x6a0b('0x11')]);}else{logger[_0x6a0b('0xa')](_0x6a0b('0xb'),_0x3ca449,'request\x20sent');_0xdfe835(_0x5e6c10[_0x6a0b('0x12')][_0x6a0b('0x11')]);}})['catch'](function(_0x3af35d){logger[_0x6a0b('0xf')](_0x6a0b('0xb'),_0x3ca449,_0x3af35d);_0x26360f(_0x3af35d);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 67afea6..f49755f 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 _0xe789=['create','put','delete','destroy','exports','express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xe789,0x104));var _0x9e78=function(_0x531734,_0x12501a){_0x531734=_0x531734-0x0;var _0x595157=_0xe789[_0x531734];return _0x595157;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9e78('0x0'));var router=express['Router']();var fs_extra=require(_0x9e78('0x1'));var auth=require(_0x9e78('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x9e78('0x3'));var controller=require(_0x9e78('0x4'));router['get']('/',auth[_0x9e78('0x5')](),controller[_0x9e78('0x6')]);router[_0x9e78('0x7')](_0x9e78('0x8'),auth[_0x9e78('0x5')](),controller[_0x9e78('0x9')]);router[_0x9e78('0x7')](_0x9e78('0xa'),auth[_0x9e78('0x5')](),controller[_0x9e78('0xb')]);router['post']('/',auth[_0x9e78('0x5')](),controller[_0x9e78('0xc')]);router[_0x9e78('0xd')](_0x9e78('0xa'),auth[_0x9e78('0x5')](),controller['update']);router[_0x9e78('0xe')](_0x9e78('0xa'),auth[_0x9e78('0x5')](),controller[_0x9e78('0xf')]);module[_0x9e78('0x10')]=router;
\ No newline at end of file
+var _0xd50d=['delete','exports','multer','util','path','Router','../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd50d,0x122));var _0xdd50=function(_0x52a19b,_0x4d627e){_0x52a19b=_0x52a19b-0x0;var _0x579730=_0xd50d[_0x52a19b];return _0x579730;};'use strict';var multer=require(_0xdd50('0x0'));var util=require(_0xdd50('0x1'));var path=require(_0xdd50('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdd50('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdd50('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdd50('0x5'));router[_0xdd50('0x6')]('/',auth[_0xdd50('0x7')](),controller[_0xdd50('0x8')]);router[_0xdd50('0x6')](_0xdd50('0x9'),auth[_0xdd50('0x7')](),controller[_0xdd50('0xa')]);router['get'](_0xdd50('0xb'),auth['isAuthenticated'](),controller[_0xdd50('0xc')]);router[_0xdd50('0xd')]('/',auth[_0xdd50('0x7')](),controller['create']);router[_0xdd50('0xe')]('/:id',auth[_0xdd50('0x7')](),controller[_0xdd50('0xf')]);router[_0xdd50('0x10')]('/:id',auth[_0xdd50('0x7')](),controller['destroy']);module[_0xdd50('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 24e6f24..0ffb127 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 _0x5f11=['input','text','name','getDataValue','TEXT','Comments','Leave\x20your\x20comments','offlineForm','parse','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','#011F6A','INTEGER','ENUM','rounded','squared','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify'];(function(_0x84a159,_0x1d2a62){var _0x596baa=function(_0x4676fd){while(--_0x4676fd){_0x84a159['push'](_0x84a159['shift']());}};_0x596baa(++_0x1d2a62);}(_0x5f11,0x131));var _0x15f1=function(_0x28a0a2,_0x1367db){_0x28a0a2=_0x28a0a2-0x0;var _0x1ceafb=_0x5f11[_0x28a0a2];return _0x1ceafb;};'use strict';var Sequelize=require(_0x15f1('0x0'));var rs=require(_0x15f1('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x15f1('0x2')],'allowNull':![],'unique':_0x15f1('0x3')},'description':{'type':Sequelize[_0x15f1('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x15f1('0x4')},'mapKeyOffline':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x4')},'key':{'type':Sequelize[_0x15f1('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15f1('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x15f1('0x2')],'allowNull':![],'defaultValue':_0x15f1('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x15f1('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x15f1('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x15f1('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x15f1('0x7')](_0x15f1('0x8'),_0x15f1('0x9')),'defaultValue':_0x15f1('0x8')},'header_online':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x15f1('0xa')},'offline_chat_button':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x15f1('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x15f1('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x15f1('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x10')},'noteTitle':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x11')},'placeholderMessage':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x12')},'closingMessageButton':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0xb')},'skipMessageButton':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x13')},'conditionAgreement':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x14')},'ratingType':{'type':Sequelize['ENUM'](_0x15f1('0x15'),_0x15f1('0x16')),'defaultValue':_0x15f1('0x15')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x15f1('0x17')]({'items':[{'type':_0x15f1('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x15f1('0x19'),'required':!![]},'props':{'title':_0x15f1('0x1a'),'helpText':''}},{'type':_0x15f1('0x18'),'props':{'title':_0x15f1('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x15f1('0x4'),'type':_0x15f1('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this[_0x15f1('0x1b')]('onlineForm')):{};},'set':function(_0x528351){return this['setDataValue']('onlineForm',JSON[_0x15f1('0x17')](_0x528351));}},'offlineForm':{'type':Sequelize[_0x15f1('0x1c')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x15f1('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x15f1('0x4'),'type':_0x15f1('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x15f1('0x1d')},'props':{'title':_0x15f1('0x1d'),'helpText':_0x15f1('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x15f1('0x1b')](_0x15f1('0x1f'))?JSON[_0x15f1('0x20')](this[_0x15f1('0x1b')](_0x15f1('0x1f'))):{};},'set':function(_0x51bbc1){return this[_0x15f1('0x21')](_0x15f1('0x1f'),JSON[_0x15f1('0x17')](_0x51bbc1));}},'token':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x15f1('0x2')]},'forwardOffline':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x15f1('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x15f1('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x15f1('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x25')},'skipUnmanaged':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x15f1('0x1c')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x15f1('0x2')]},'notificationTemplate':{'type':Sequelize[_0x15f1('0x1c')],'defaultValue':function(){return _0x15f1('0x26');}},'notificationSound':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x15f1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x28')},'verticalAlignment':{'type':Sequelize[_0x15f1('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x15f1('0x2')]},'customerAvatar':{'type':Sequelize[_0x15f1('0x1c')]},'showCustomerAvatar':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x15f1('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x15f1('0x2')],'allowNull':![],'defaultValue':_0x15f1('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':_0x15f1('0x2a')},'systemAvatar':{'type':Sequelize[_0x15f1('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x15f1('0x6')],'comment':_0x15f1('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![],'comment':_0x15f1('0x2c'),'set':function(_0x313c8d){if(!_0x313c8d)this[_0x15f1('0x21')]('mandatoryDispositionPauseId',null);this[_0x15f1('0x21')](_0x15f1('0x2d'),_0x313c8d);}},'vidaooEscalation':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x15f1('0x2')]},'vidaooTopic':{'type':Sequelize[_0x15f1('0x2')],'allowNull':![],'defaultValue':_0x15f1('0x2e')},'vidaooNote':{'type':Sequelize[_0x15f1('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x15f1('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x15f1('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x15f1('0x1c')]}};
\ No newline at end of file
+var _0x11e9=['star','thumb','stringify','name','input','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Feedback'];(function(_0xb9eb48,_0xff6ac6){var _0x2c78ad=function(_0x62c59b){while(--_0x62c59b){_0xb9eb48['push'](_0xb9eb48['shift']());}};_0x2c78ad(++_0xff6ac6);}(_0x11e9,0x168));var _0x911e=function(_0x2ed065,_0x197ca4){_0x2ed065=_0x2ed065-0x0;var _0x1c76c7=_0x11e9[_0x2ed065];return _0x1c76c7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x911e('0x0'));module[_0x911e('0x1')]={'name':{'type':Sequelize[_0x911e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x911e('0x2')],'allowNull':![],'unique':_0x911e('0x3')},'description':{'type':Sequelize[_0x911e('0x2')]},'mapKey':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x911e('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x911e('0x5')},'customerAlias':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x911e('0x2')],'allowNull':![],'defaultValue':_0x911e('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x911e('0x2')],'allowNull':![],'defaultValue':_0x911e('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x911e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x911e('0x9')](_0x911e('0xa'),'squared'),'defaultValue':_0x911e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0xb')},'offline_chat_button':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0xc')},'download_transcript':{'type':Sequelize[_0x911e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x911e('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x911e('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x911e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x911e('0xf')]},'closingQuestion':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x12')},'noteTitle':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x13')},'placeholderMessage':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x14')},'closingMessage':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x15')},'closingMessageButton':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x16')},'skipMessageButton':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x911e('0x18'),_0x911e('0x19')),'defaultValue':_0x911e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x911e('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x911e('0xf')],'defaultValue':function(){return JSON[_0x911e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x911e('0x1b'),'helpText':''}},{'type':_0x911e('0x1c'),'props':{'title':_0x911e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x911e('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x911e('0x1d')]('onlineForm')?JSON[_0x911e('0x1e')](this[_0x911e('0x1d')]('onlineForm')):{};},'set':function(_0x486165){return this[_0x911e('0x1f')](_0x911e('0x20'),JSON['stringify'](_0x486165));}},'offlineForm':{'type':Sequelize[_0x911e('0xf')],'defaultValue':function(){return JSON[_0x911e('0x1a')]({'items':[{'type':_0x911e('0x1c'),'props':{'title':_0x911e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x911e('0x21'),'config':{'placeholder':_0x911e('0x22')},'props':{'title':_0x911e('0x22'),'helpText':_0x911e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x911e('0x1d')](_0x911e('0x24'))?JSON[_0x911e('0x1e')](this['getDataValue'](_0x911e('0x24'))):{};},'set':function(_0x4a5bd4){return this[_0x911e('0x1f')](_0x911e('0x24'),JSON['stringify'](_0x4a5bd4));}},'token':{'type':Sequelize[_0x911e('0x2')],'defaultValue':function(){return rs[_0x911e('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x911e('0x2')]},'forwardOffline':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x911e('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x911e('0x26')},'waitingMessage':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x911e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x28')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x911e('0x16')},'enableCustomerAttachment':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x911e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x911e('0xf')],'defaultValue':function(){return _0x911e('0x29');}},'notificationSound':{'type':Sequelize[_0x911e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x2a')},'verticalAlignment':{'type':Sequelize[_0x911e('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x911e('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x911e('0x2')]},'customerAvatar':{'type':Sequelize[_0x911e('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x911e('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x911e('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x911e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x911e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x911e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x911e('0x2')],'defaultValue':_0x911e('0x2b')},'systemAvatar':{'type':Sequelize[_0x911e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x911e('0xd')],'comment':_0x911e('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x911e('0x2d'),'set':function(_0x11bef0){if(!_0x11bef0)this[_0x911e('0x1f')]('mandatoryDispositionPauseId',null);this[_0x911e('0x1f')](_0x911e('0x2e'),_0x11bef0);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x911e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x911e('0x2')],'allowNull':![],'defaultValue':_0x911e('0x2f')},'vidaooNote':{'type':Sequelize[_0x911e('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x911e('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 5ae37df..49c0647 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 _0x59db=['filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','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','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','account','applications','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','*,*,*,*','AttachmentId','UserId','User','unshift','forcedOwnership','Start','startRouting','EventManager','offline','send','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','server','files','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','true','ONLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','readFileSync','server/files/chat/iframe.ejs','remote','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','Pause','map','ChatWebsite','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','keys','includeAll','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','addAvatar','agentAvatar','file'];(function(_0x41b663,_0x119258){var _0x4d7395=function(_0x3a4fe8){while(--_0x3a4fe8){_0x41b663['push'](_0x41b663['shift']());}};_0x4d7395(++_0x119258);}(_0x59db,0x1ec));var _0xb59d=function(_0xbb89d3,_0x47fd06){_0xbb89d3=_0xbb89d3-0x0;var _0x302ebf=_0x59db[_0xbb89d3];return _0x302ebf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb59d('0x0'));var jsonpatch=require(_0xb59d('0x1'));var rp=require(_0xb59d('0x2'));var moment=require(_0xb59d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb59d('0x4'));var util=require(_0xb59d('0x5'));var path=require('path');var sox=require(_0xb59d('0x6'));var csv=require('to-csv');var ejs=require(_0xb59d('0x7'));var fs=require('fs');var fs_extra=require(_0xb59d('0x8'));var _=require(_0xb59d('0x9'));var squel=require(_0xb59d('0xa'));var crypto=require('crypto');var jsforce=require(_0xb59d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb59d('0xc'));var Papa=require(_0xb59d('0xd'));var Redis=require(_0xb59d('0xe'));var authService=require(_0xb59d('0xf'));var qs=require(_0xb59d('0x10'));var as=require(_0xb59d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb59d('0x12'))(_0xb59d('0x13'));var utils=require('../../config/utils');var config=require(_0xb59d('0x14'));var licenseUtil=require(_0xb59d('0x15'));var db=require('../../mysqldb')['db'];config[_0xb59d('0x16')]=_[_0xb59d('0x17')](config[_0xb59d('0x16')],{'host':_0xb59d('0x18'),'port':0x18eb});var socket=require(_0xb59d('0x19'))(new Redis(config[_0xb59d('0x16')]));require(_0xb59d('0x1a'))['register'](socket);var jayson=require(_0xb59d('0x1b'));var client=jayson[_0xb59d('0x1c')][_0xb59d('0x1d')]({'port':0x232c});var client9002=jayson[_0xb59d('0x1c')][_0xb59d('0x1d')]({'port':0x232a});var client9003=jayson[_0xb59d('0x1c')][_0xb59d('0x1d')]({'port':0x232b});var client9001=jayson[_0xb59d('0x1c')][_0xb59d('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x28d350,_0x430c45,_0x322159,_0x440236){return new BPromise(function(_0x3d6c66,_0x1cb06e){var _0x39fc35=_0x440236||client;return _0x39fc35[_0xb59d('0x1e')](_0x28d350,_0x322159)[_0xb59d('0x1f')](function(_0x4cd914){logger[_0xb59d('0x20')](_0xb59d('0x21'),_0x430c45,_0xb59d('0x22'));logger[_0xb59d('0x23')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x430c45,'request\x20sent',JSON[_0xb59d('0x24')](_0x4cd914));if(_0x4cd914['error']){if(_0x4cd914['error'][_0xb59d('0x25')]===0x1f4){logger['error'](_0xb59d('0x21'),_0x430c45,_0x4cd914[_0xb59d('0x26')][_0xb59d('0x27')]);return _0x1cb06e(_0x4cd914[_0xb59d('0x26')][_0xb59d('0x27')]);}logger[_0xb59d('0x26')](_0xb59d('0x21'),_0x430c45,_0x4cd914['error'][_0xb59d('0x27')]);return _0x3d6c66(_0x4cd914[_0xb59d('0x26')][_0xb59d('0x27')]);}else{logger['info'](_0xb59d('0x21'),_0x430c45,_0xb59d('0x22'));_0x3d6c66(_0x4cd914[_0xb59d('0x28')][_0xb59d('0x27')]);}})[_0xb59d('0x29')](function(_0x51d3de){logger[_0xb59d('0x26')](_0xb59d('0x21'),_0x430c45,_0x51d3de);_0x1cb06e(_0x51d3de);});});}function respondWithStatusCode(_0x5217e7,_0xc57343){_0xc57343=_0xc57343||0xcc;return function(_0x1013f2){if(_0x1013f2){return _0x5217e7[_0xb59d('0x2a')](_0xc57343);}return _0x5217e7['status'](_0xc57343)[_0xb59d('0x2b')]();};}function respondWithResult(_0x116b6a,_0x2c8ba7){_0x2c8ba7=_0x2c8ba7||0xc8;return function(_0x3700b1){if(_0x3700b1){return _0x116b6a[_0xb59d('0x2c')](_0x2c8ba7)['json'](_0x3700b1);}};}function respondWithFilteredResult(_0x26d152,_0x1f5cc1){return function(_0x2d41c0){if(_0x2d41c0){var _0x43b4ac=typeof _0x1f5cc1[_0xb59d('0x2d')]==='undefined'&&typeof _0x1f5cc1['limit']===_0xb59d('0x2e');var _0x2afebd=_0x2d41c0[_0xb59d('0x2f')];var _0x2b3e84=_0x43b4ac?0x0:_0x1f5cc1[_0xb59d('0x2d')];var _0x57ad51=_0x43b4ac?_0x2d41c0[_0xb59d('0x2f')]:_0x1f5cc1['offset']+_0x1f5cc1[_0xb59d('0x30')];var _0x83636f;if(_0x57ad51>=_0x2afebd){_0x57ad51=_0x2afebd;_0x83636f=0xc8;}else{_0x83636f=0xce;}_0x26d152[_0xb59d('0x2c')](_0x83636f);return _0x26d152['set'](_0xb59d('0x31'),_0x2b3e84+'-'+_0x57ad51+'/'+_0x2afebd)[_0xb59d('0x32')](_0x2d41c0);}return null;};}function patchUpdates(_0x5a8731){return function(_0xcaf369){try{jsonpatch[_0xb59d('0x33')](_0xcaf369,_0x5a8731,!![]);}catch(_0x2e90b3){return BPromise[_0xb59d('0x34')](_0x2e90b3);}return _0xcaf369[_0xb59d('0x35')]();};}function saveUpdates(_0x391538,_0x342e1a){return function(_0x2a1a03){if(_0x2a1a03){return _0x2a1a03[_0xb59d('0x36')](_0x391538)['then'](function(_0x286b9b){return _0x286b9b;});}return null;};}function removeEntity(_0x867059,_0x592332){return function(_0x58a257){if(_0x58a257){return _0x58a257[_0xb59d('0x37')]()[_0xb59d('0x1f')](function(){var _0x51c788=_0x58a257[_0xb59d('0x38')]({'plain':!![]});var _0x2c2f4e=_0xb59d('0x39');return db[_0xb59d('0x3a')][_0xb59d('0x37')]({'where':{'type':_0x2c2f4e,'resourceId':_0x51c788['id']}})['then'](function(){return _0x58a257;});})['then'](function(){_0x867059[_0xb59d('0x2c')](0xcc)[_0xb59d('0x2b')]();});}};}function handleEntityNotFound(_0x3cba92,_0x86eebb){return function(_0x3b3ea){if(!_0x3b3ea){_0x3cba92['sendStatus'](0x194);}return _0x3b3ea;};}function handleError(_0x55e28d,_0xd38c0c){_0xd38c0c=_0xd38c0c||0x1f4;return function(_0x4b0acf){logger[_0xb59d('0x26')](_0x4b0acf[_0xb59d('0x3b')]);if(_0x4b0acf[_0xb59d('0x3c')]){delete _0x4b0acf[_0xb59d('0x3c')];}_0x55e28d[_0xb59d('0x2c')](_0xd38c0c)['send'](_0x4b0acf);};}exports['index']=function(_0x48a99b,_0x2d1773){var _0x755bea={'include':[{'model':db[_0xb59d('0x3d')],'as':'mandatoryDispositionPause'}]},_0x4474ad={},_0x26b7bb={'count':0x0,'rows':[]};var _0x32d795=_[_0xb59d('0x3e')](db[_0xb59d('0x3f')]['rawAttributes'],function(_0x50f1b9){return{'name':_0x50f1b9['fieldName'],'type':_0x50f1b9[_0xb59d('0x40')][_0xb59d('0x41')]};});_0x4474ad[_0xb59d('0x42')]=_[_0xb59d('0x3e')](_0x32d795,_0xb59d('0x3c'));_0x4474ad['query']=_['keys'](_0x48a99b[_0xb59d('0x43')]);_0x4474ad[_0xb59d('0x44')]=_[_0xb59d('0x45')](_0x4474ad['model'],_0x4474ad[_0xb59d('0x43')]);_0x755bea[_0xb59d('0x46')]=_['intersection'](_0x4474ad[_0xb59d('0x42')],qs[_0xb59d('0x47')](_0x48a99b[_0xb59d('0x43')][_0xb59d('0x47')]));_0x755bea[_0xb59d('0x46')]=_0x755bea[_0xb59d('0x46')][_0xb59d('0x48')]?_0x755bea[_0xb59d('0x46')]:_0x4474ad[_0xb59d('0x42')];if(!_0x48a99b[_0xb59d('0x43')][_0xb59d('0x49')](_0xb59d('0x4a'))){_0x755bea['limit']=qs['limit'](_0x48a99b[_0xb59d('0x43')][_0xb59d('0x30')]);_0x755bea[_0xb59d('0x2d')]=qs[_0xb59d('0x2d')](_0x48a99b[_0xb59d('0x43')][_0xb59d('0x2d')]);}_0x755bea['order']=qs[_0xb59d('0x4b')](_0x48a99b['query']['sort']);_0x755bea[_0xb59d('0x4c')]=qs[_0xb59d('0x44')](_[_0xb59d('0x4d')](_0x48a99b[_0xb59d('0x43')],_0x4474ad[_0xb59d('0x44')]),_0x32d795);if(_0x48a99b[_0xb59d('0x43')][_0xb59d('0x4e')]){_0x755bea[_0xb59d('0x4c')]=_[_0xb59d('0x4f')](_0x755bea[_0xb59d('0x4c')],{'$or':_[_0xb59d('0x3e')](_0x32d795,function(_0x4cdd9a){if(_0x4cdd9a[_0xb59d('0x40')]!==_0xb59d('0x50')){var _0x91f5a3={};_0x91f5a3[_0x4cdd9a[_0xb59d('0x3c')]]={'$like':'%'+_0x48a99b[_0xb59d('0x43')][_0xb59d('0x4e')]+'%'};return _0x91f5a3;}})});}_0x755bea=_[_0xb59d('0x4f')]({},_0x755bea,_0x48a99b['options']);var _0x2907ac={'where':_0x755bea[_0xb59d('0x4c')]};return db[_0xb59d('0x3f')]['count'](_0x2907ac)[_0xb59d('0x1f')](function(_0x1ba87){_0x26b7bb[_0xb59d('0x2f')]=_0x1ba87;if(_0x48a99b[_0xb59d('0x43')]['includeAll']){_0x755bea[_0xb59d('0x51')]=[{'all':!![]}];}return db['ChatWebsite'][_0xb59d('0x52')](_0x755bea);})[_0xb59d('0x1f')](function(_0x4791fa){_0x26b7bb[_0xb59d('0x53')]=_0x4791fa;return _0x26b7bb;})[_0xb59d('0x1f')](respondWithFilteredResult(_0x2d1773,_0x755bea))['catch'](handleError(_0x2d1773,null));};exports[_0xb59d('0x54')]=function(_0x5d73ab,_0x4801af){var _0x478726={'raw':![],'where':{'id':_0x5d73ab[_0xb59d('0x55')]['id']},'include':[{'model':db[_0xb59d('0x3d')],'as':_0xb59d('0x56')}]},_0x1d7a43={};_0x1d7a43[_0xb59d('0x42')]=_['keys'](db[_0xb59d('0x3f')][_0xb59d('0x57')]);_0x1d7a43[_0xb59d('0x43')]=_[_0xb59d('0x58')](_0x5d73ab[_0xb59d('0x43')]);_0x1d7a43[_0xb59d('0x44')]=_[_0xb59d('0x45')](_0x1d7a43[_0xb59d('0x42')],_0x1d7a43['query']);_0x478726[_0xb59d('0x46')]=_['intersection'](_0x1d7a43[_0xb59d('0x42')],qs['fields'](_0x5d73ab[_0xb59d('0x43')][_0xb59d('0x47')]));_0x478726['attributes']=_0x478726['attributes'][_0xb59d('0x48')]?_0x478726[_0xb59d('0x46')]:_0x1d7a43[_0xb59d('0x42')];if(_0x5d73ab[_0xb59d('0x43')][_0xb59d('0x59')]){_0x478726[_0xb59d('0x51')]=[{'all':!![]}];}_0x478726=_[_0xb59d('0x4f')]({},_0x478726,_0x5d73ab[_0xb59d('0x5a')]);return db['ChatWebsite'][_0xb59d('0x5b')](_0x478726)[_0xb59d('0x1f')](handleEntityNotFound(_0x4801af,null))[_0xb59d('0x1f')](respondWithResult(_0x4801af,null))[_0xb59d('0x29')](handleError(_0x4801af,null));};exports['create']=function(_0x4800f1,_0x5820e3){return db[_0xb59d('0x3f')]['create'](_0x4800f1[_0xb59d('0x5c')],{})['then'](function(_0x2ce742){var _0x139c7f=_0x4800f1[_0xb59d('0x5d')][_0xb59d('0x38')]({'plain':!![]});if(!_0x139c7f)throw new Error(_0xb59d('0x5e'));if(_0x139c7f['role']===_0xb59d('0x5d')){var _0x10281f=_0x2ce742[_0xb59d('0x38')]({'plain':!![]});var _0x407a44=_0xb59d('0x39');return db['UserProfileSection'][_0xb59d('0x5b')]({'where':{'name':_0x407a44,'userProfileId':_0x139c7f['userProfileId']},'raw':!![]})[_0xb59d('0x1f')](function(_0x4c1de0){if(_0x4c1de0&&_0x4c1de0['autoAssociation']===0x0){return db['UserProfileResource'][_0xb59d('0x5f')]({'name':_0x10281f['name'],'resourceId':_0x10281f['id'],'type':_0x4c1de0[_0xb59d('0x3c')],'sectionId':_0x4c1de0['id']},{})[_0xb59d('0x1f')](function(){return _0x2ce742;});}else{return _0x2ce742;}})[_0xb59d('0x29')](function(_0x103602){logger[_0xb59d('0x26')](_0xb59d('0x60'),_0x103602);throw _0x103602;});}return _0x2ce742;})[_0xb59d('0x1f')](respondWithResult(_0x5820e3,0xc9))[_0xb59d('0x29')](handleError(_0x5820e3,null));};exports[_0xb59d('0x36')]=function(_0x180d96,_0x22fc64){if(_0x180d96[_0xb59d('0x5c')]['id']){delete _0x180d96[_0xb59d('0x5c')]['id'];}return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x180d96['params']['id']},'include':[{'model':db[_0xb59d('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x22fc64,null))[_0xb59d('0x1f')](saveUpdates(_0x180d96[_0xb59d('0x5c')],null))[_0xb59d('0x1f')](respondWithResult(_0x22fc64,null))[_0xb59d('0x29')](handleError(_0x22fc64,null));};exports[_0xb59d('0x37')]=function(_0x21535d,_0x38b3a9){return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x21535d[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x38b3a9,null))[_0xb59d('0x1f')](removeEntity(_0x38b3a9,null))[_0xb59d('0x29')](handleError(_0x38b3a9,null));};exports[_0xb59d('0x61')]=function(_0xaf4a47,_0x4f0051){return db[_0xb59d('0x3f')]['describe']()[_0xb59d('0x1f')](respondWithResult(_0x4f0051,null))[_0xb59d('0x29')](handleError(_0x4f0051,null));};exports[_0xb59d('0x62')]=function(_0x578d7b,_0x485e88,_0x253f4e){if(_0x578d7b[_0xb59d('0x5c')]['id']){delete _0x578d7b[_0xb59d('0x5c')]['id'];}return db[_0xb59d('0x3f')]['find']({'where':{'id':_0x578d7b[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x485e88,null))[_0xb59d('0x1f')](function(_0x18ed9f){if(_0x18ed9f){_0x578d7b[_0xb59d('0x5c')][_0xb59d('0x63')]=_0x18ed9f['id'];return db[_0xb59d('0x64')]['create'](_0x578d7b['body']);}})[_0xb59d('0x1f')](respondWithResult(_0x485e88,null))['catch'](handleError(_0x485e88,null));};exports[_0xb59d('0x65')]=function(_0x244630,_0x1b3867,_0x56f7ec){var _0x3540a3={'raw':![],'where':{}};var _0x16e253={};var _0x5a0790={'count':0x0,'rows':[]};return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x244630['params']['id']}})['then'](handleEntityNotFound(_0x1b3867,null))['then'](function(_0x655595){if(_0x655595){_0x16e253['model']=_['keys'](db[_0xb59d('0x64')]['rawAttributes']);_0x16e253[_0xb59d('0x43')]=_['keys'](_0x244630[_0xb59d('0x43')]);_0x16e253[_0xb59d('0x44')]=_[_0xb59d('0x45')](_0x16e253[_0xb59d('0x42')],_0x16e253[_0xb59d('0x43')]);_0x3540a3[_0xb59d('0x46')]=_[_0xb59d('0x45')](_0x16e253[_0xb59d('0x42')],qs[_0xb59d('0x47')](_0x244630[_0xb59d('0x43')][_0xb59d('0x47')]));_0x3540a3['attributes']=_0x3540a3['attributes']['length']?_0x3540a3['attributes']:_0x16e253[_0xb59d('0x42')];if(!_0x244630['query'][_0xb59d('0x49')](_0xb59d('0x4a'))){_0x3540a3[_0xb59d('0x30')]=qs[_0xb59d('0x30')](_0x244630[_0xb59d('0x43')][_0xb59d('0x30')]);_0x3540a3['offset']=qs[_0xb59d('0x2d')](_0x244630['query'][_0xb59d('0x2d')]);}_0x3540a3[_0xb59d('0x67')]=qs[_0xb59d('0x4b')](_0x244630[_0xb59d('0x43')][_0xb59d('0x4b')]);_0x3540a3[_0xb59d('0x4c')]=qs[_0xb59d('0x44')](_[_0xb59d('0x4d')](_0x244630[_0xb59d('0x43')],_0x16e253[_0xb59d('0x44')]));_0x3540a3[_0xb59d('0x4c')]['ChatWebsiteId']=_0x655595['id'];if(_0x244630[_0xb59d('0x43')][_0xb59d('0x4e')]){_0x3540a3[_0xb59d('0x4c')]=_[_0xb59d('0x4f')](_0x3540a3[_0xb59d('0x4c')],{'$or':_[_0xb59d('0x3e')](_0x3540a3['attributes'],function(_0x47b3a1){var _0x356837={};_0x356837[_0x47b3a1]={'$like':'%'+_0x244630['query'][_0xb59d('0x4e')]+'%'};return _0x356837;})});}_0x3540a3=_[_0xb59d('0x4f')]({},_0x3540a3,_0x244630[_0xb59d('0x5a')]);return db['Disposition']['count']({'where':_0x3540a3[_0xb59d('0x4c')]})[_0xb59d('0x1f')](function(_0x15dc21){_0x5a0790[_0xb59d('0x2f')]=_0x15dc21;if(_0x244630[_0xb59d('0x43')]['includeAll']){_0x3540a3[_0xb59d('0x51')]=[{'all':!![]}];}return db[_0xb59d('0x64')][_0xb59d('0x52')](_0x3540a3);})[_0xb59d('0x1f')](function(_0x404bed){_0x5a0790[_0xb59d('0x53')]=_0x404bed;return _0x5a0790;});}})['then'](respondWithFilteredResult(_0x1b3867,_0x3540a3))[_0xb59d('0x29')](handleError(_0x1b3867,null));};exports[_0xb59d('0x68')]=function(_0x4f3940,_0x25d0bd,_0x4435a2){return db[_0xb59d('0x3f')]['find']({'where':{'id':_0x4f3940[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x25d0bd,null))[_0xb59d('0x1f')](function(_0x5c654d){if(_0x5c654d){return _0x5c654d[_0xb59d('0x68')](_0x4f3940[_0xb59d('0x43')][_0xb59d('0x69')]);}})['then'](respondWithStatusCode(_0x25d0bd,null))[_0xb59d('0x29')](handleError(_0x25d0bd,null));};exports[_0xb59d('0x6a')]=function(_0x3cd595,_0x5c619b,_0x130ad9){if(_0x3cd595['body']['id']){delete _0x3cd595[_0xb59d('0x5c')]['id'];}return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x3cd595[_0xb59d('0x55')]['id']}})['then'](handleEntityNotFound(_0x5c619b,null))[_0xb59d('0x1f')](function(_0x17f2a4){if(_0x17f2a4){_0x3cd595[_0xb59d('0x5c')][_0xb59d('0x63')]=_0x17f2a4['id'];return db[_0xb59d('0x6b')]['create'](_0x3cd595[_0xb59d('0x5c')]);}})[_0xb59d('0x1f')](respondWithResult(_0x5c619b,null))[_0xb59d('0x29')](handleError(_0x5c619b,null));};exports[_0xb59d('0x6c')]=function(_0x18e3ae,_0x36dc8f,_0x50b48d){var _0xf41de={'raw':![],'where':{}};var _0x5732a0={};var _0x55b7b0={'count':0x0,'rows':[]};return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x18e3ae[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x36dc8f,null))[_0xb59d('0x1f')](function(_0x37f323){if(_0x37f323){_0x5732a0[_0xb59d('0x42')]=_[_0xb59d('0x58')](db['CannedAnswer']['rawAttributes']);_0x5732a0[_0xb59d('0x43')]=_['keys'](_0x18e3ae[_0xb59d('0x43')]);_0x5732a0['filters']=_['intersection'](_0x5732a0[_0xb59d('0x42')],_0x5732a0['query']);_0xf41de[_0xb59d('0x46')]=_['intersection'](_0x5732a0[_0xb59d('0x42')],qs[_0xb59d('0x47')](_0x18e3ae[_0xb59d('0x43')][_0xb59d('0x47')]));_0xf41de[_0xb59d('0x46')]=_0xf41de['attributes'][_0xb59d('0x48')]?_0xf41de[_0xb59d('0x46')]:_0x5732a0[_0xb59d('0x42')];if(!_0x18e3ae[_0xb59d('0x43')][_0xb59d('0x49')](_0xb59d('0x4a'))){_0xf41de[_0xb59d('0x30')]=qs['limit'](_0x18e3ae[_0xb59d('0x43')]['limit']);_0xf41de[_0xb59d('0x2d')]=qs[_0xb59d('0x2d')](_0x18e3ae[_0xb59d('0x43')][_0xb59d('0x2d')]);}_0xf41de[_0xb59d('0x67')]=qs[_0xb59d('0x4b')](_0x18e3ae[_0xb59d('0x43')]['sort']);_0xf41de['where']=qs[_0xb59d('0x44')](_[_0xb59d('0x4d')](_0x18e3ae[_0xb59d('0x43')],_0x5732a0[_0xb59d('0x44')]));_0xf41de[_0xb59d('0x4c')][_0xb59d('0x63')]=_0x37f323['id'];if(_0x18e3ae[_0xb59d('0x43')][_0xb59d('0x4e')]){_0xf41de[_0xb59d('0x4c')]=_['merge'](_0xf41de[_0xb59d('0x4c')],{'$or':_[_0xb59d('0x3e')](_0xf41de[_0xb59d('0x46')],function(_0x204eec){var _0x1874a8={};_0x1874a8[_0x204eec]={'$like':'%'+_0x18e3ae[_0xb59d('0x43')][_0xb59d('0x4e')]+'%'};return _0x1874a8;})});}_0xf41de=_[_0xb59d('0x4f')]({},_0xf41de,_0x18e3ae['options']);return db['CannedAnswer'][_0xb59d('0x2f')]({'where':_0xf41de[_0xb59d('0x4c')]})[_0xb59d('0x1f')](function(_0x3ece21){_0x55b7b0[_0xb59d('0x2f')]=_0x3ece21;if(_0x18e3ae[_0xb59d('0x43')][_0xb59d('0x59')]){_0xf41de[_0xb59d('0x51')]=[{'all':!![]}];}return db[_0xb59d('0x6b')][_0xb59d('0x52')](_0xf41de);})[_0xb59d('0x1f')](function(_0x142861){_0x55b7b0[_0xb59d('0x53')]=_0x142861;return _0x55b7b0;});}})[_0xb59d('0x1f')](respondWithFilteredResult(_0x36dc8f,_0xf41de))[_0xb59d('0x29')](handleError(_0x36dc8f,null));};exports[_0xb59d('0x6d')]=function(_0x53ea35,_0x3949a6,_0x1c82e3){return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x53ea35[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x3949a6,null))['then'](function(_0xcfdf75){if(_0xcfdf75){return _0xcfdf75['removeAnswers'](_0x53ea35[_0xb59d('0x43')][_0xb59d('0x69')]);}})[_0xb59d('0x1f')](respondWithStatusCode(_0x3949a6,null))[_0xb59d('0x29')](handleError(_0x3949a6,null));};exports[_0xb59d('0x6e')]=function(_0x54864b,_0x3af0f6,_0x348c28){_0x54864b[_0xb59d('0x5c')]['sitepic']=_0x54864b['file']['filename'];return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x54864b[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x3af0f6,null))[_0xb59d('0x1f')](saveUpdates(_0x54864b[_0xb59d('0x5c')],null))['then'](respondWithResult(_0x3af0f6,null))[_0xb59d('0x29')](handleError(_0x3af0f6,null));};exports[_0xb59d('0x6f')]=function(_0x5a8eaa,_0x517e1e,_0x2ae4f8){_0x5a8eaa['body'][_0xb59d('0x70')]=_0x5a8eaa[_0xb59d('0x71')][_0xb59d('0x72')];return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x5a8eaa['params']['id']}})['then'](handleEntityNotFound(_0x517e1e,null))[_0xb59d('0x1f')](saveUpdates(_0x5a8eaa[_0xb59d('0x5c')],null))[_0xb59d('0x1f')](respondWithResult(_0x517e1e,null))[_0xb59d('0x29')](handleError(_0x517e1e,null));};exports[_0xb59d('0x73')]=function(_0x8d8961,_0x22843b,_0x1260f8){_0x8d8961[_0xb59d('0x5c')][_0xb59d('0x74')]=_0x8d8961[_0xb59d('0x71')]['filename'];return db['ChatWebsite'][_0xb59d('0x5b')]({'where':{'id':_0x8d8961['params']['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x22843b,null))[_0xb59d('0x1f')](saveUpdates(_0x8d8961['body'],null))[_0xb59d('0x1f')](respondWithResult(_0x22843b,null))[_0xb59d('0x29')](handleError(_0x22843b,null));};exports[_0xb59d('0x75')]=function(_0x4390ea,_0x583e99,_0x1336a3){_0x4390ea[_0xb59d('0x5c')][_0xb59d('0x76')]=_0x4390ea['file'][_0xb59d('0x72')];return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x4390ea[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x583e99,null))['then'](saveUpdates(_0x4390ea[_0xb59d('0x5c')],null))[_0xb59d('0x1f')](respondWithResult(_0x583e99,null))[_0xb59d('0x29')](handleError(_0x583e99,null));};exports[_0xb59d('0x77')]=function(_0x1f569e,_0x214a8c,_0x501bdb){var _0x2f46cd=path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0x7a'));var _0x34007b={'where':{'id':_0x1f569e[_0xb59d('0x55')]['id']},'attributes':['id',_0xb59d('0x7b')],'raw':!![]};var _0x392c7c=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x543ee9){if(_0x543ee9){_0x392c7c=_0x543ee9[_0xb59d('0x7c')];}})[_0xb59d('0x1f')](function(){return db[_0xb59d('0x3f')][_0xb59d('0x5b')](_0x34007b);})[_0xb59d('0x1f')](handleEntityNotFound(_0x214a8c,null))[_0xb59d('0x1f')](function(_0x5e4d9d){if(_0x5e4d9d){if(!_[_0xb59d('0x7d')](_0x5e4d9d[_0xb59d('0x7b')])){if(fs['existsSync'](path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0x7e'),_0x5e4d9d[_0xb59d('0x7b')]))&&_0x392c7c){_0x2f46cd=path['join'](config[_0xb59d('0x79')],_0xb59d('0x7e'),_0x5e4d9d[_0xb59d('0x7b')]);}}return _0x214a8c[_0xb59d('0x7f')](_0x2f46cd);}})[_0xb59d('0x29')](handleError(_0x214a8c,null));};exports[_0xb59d('0x80')]=function(_0x12e071,_0x235b3a,_0xb1e32){var _0x5f16f5=path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0x81'));var _0x531bf2={'where':{'id':_0x12e071[_0xb59d('0x55')]['id']},'attributes':['id',_0xb59d('0x70')],'raw':!![]};return db[_0xb59d('0x3f')][_0xb59d('0x5b')](_0x531bf2)[_0xb59d('0x1f')](handleEntityNotFound(_0x235b3a,null))[_0xb59d('0x1f')](function(_0x4d7ea7){if(_0x4d7ea7){if(!_[_0xb59d('0x7d')](_0x4d7ea7[_0xb59d('0x70')])){if(fs[_0xb59d('0x82')](path[_0xb59d('0x78')](config[_0xb59d('0x79')],'server/files/images/avatars/',_0x4d7ea7[_0xb59d('0x70')]))){_0x5f16f5=path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0x83'),_0x4d7ea7[_0xb59d('0x70')]);}}return _0x235b3a[_0xb59d('0x7f')](_0x5f16f5);}})[_0xb59d('0x29')](handleError(_0x235b3a,null));};exports[_0xb59d('0x84')]=function(_0x1e26e6,_0x305a15,_0x40cdcd){var _0x13480d=path[_0xb59d('0x78')](config['root'],_0xb59d('0x85'));var _0x4a7bb3={'where':{'id':_0x1e26e6['params']['id']},'attributes':['id',_0xb59d('0x74'),_0xb59d('0x86')],'raw':!![]};return db['ChatWebsite'][_0xb59d('0x5b')](_0x4a7bb3)['then'](handleEntityNotFound(_0x305a15,null))[_0xb59d('0x1f')](function(_0x116bf0){if(_0x116bf0){if(!_[_0xb59d('0x7d')](_0x116bf0[_0xb59d('0x74')])){if(fs[_0xb59d('0x82')](path[_0xb59d('0x78')](config['root'],'server/files/images/avatars/',_0x116bf0[_0xb59d('0x74')]))&&_0x116bf0['showCustomerAvatar']){_0x13480d=path[_0xb59d('0x78')](config[_0xb59d('0x79')],'server/files/images/avatars/',_0x116bf0[_0xb59d('0x74')]);}}return _0x305a15[_0xb59d('0x7f')](_0x13480d);}})[_0xb59d('0x29')](handleError(_0x305a15,null));};exports['getSystemAvatar']=function(_0xb61c30,_0x54d5a2,_0x5e585f){var _0x41a9dd=path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0x87'));var _0x3774d3={'where':{'id':_0xb61c30['params']['id']},'attributes':['id',_0xb59d('0x76')],'raw':!![]};return db[_0xb59d('0x3f')][_0xb59d('0x5b')](_0x3774d3)['then'](handleEntityNotFound(_0x54d5a2,null))['then'](function(_0x371bba){if(_0x371bba){if(!_[_0xb59d('0x7d')](_0x371bba['systemAvatar'])){if(fs[_0xb59d('0x82')](path[_0xb59d('0x78')](config[_0xb59d('0x79')],'server/files/images/avatars/',_0x371bba[_0xb59d('0x76')]))){_0x41a9dd=path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0x83'),_0x371bba[_0xb59d('0x76')]);}}return _0x54d5a2['download'](_0x41a9dd);}})[_0xb59d('0x29')](handleError(_0x54d5a2,null));};exports[_0xb59d('0x88')]=function(_0x55cf8d,_0x56450f,_0x4f4420){var _0x2c9637=require(_0xb59d('0x89'));var _0x40b0bd=new _0x2c9637();var _0x207137=_0x40b0bd[_0xb59d('0x8a')](_0x55cf8d['headers'][_0xb59d('0x8b')])[_0xb59d('0x8c')]();var _0x37bb3e={'body':_0x55cf8d[_0xb59d('0x5c')],'channel':_0xb59d('0x8d')};var _0xcd345a=[];var _0x5c856b=[];var _0x9f5c7c={};var _0x2fd9fb=![];return db[_0xb59d('0x8e')][_0xb59d('0x61')]()[_0xb59d('0x1f')](function(_0x58fd7b){if(!_0x58fd7b){throw new db[(_0xb59d('0x8f'))]['ValidationError'](_0xb59d('0x90'));}_0xcd345a=_[_0xb59d('0x91')](_[_0xb59d('0x58')](_0x58fd7b),[_0xb59d('0x92'),_0xb59d('0x93')]);_0x5c856b=_[_0xb59d('0x91')](_[_0xb59d('0x58')](_0x58fd7b),[_0xb59d('0x92'),_0xb59d('0x93'),_0xb59d('0x94'),'ListId']);if(_0x55cf8d['body']['id']){delete _0x55cf8d['body']['id'];}if(_[_0xb59d('0x7d')](_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0x95')])){throw new db['Sequelize'][(_0xb59d('0x96'))](_0xb59d('0x97'));}if(_[_0xb59d('0x7d')](_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0x5c')])||_0x55cf8d['body'][_0xb59d('0x5c')]===''){throw new db['Sequelize'][(_0xb59d('0x96'))](_0xb59d('0x98'));}if(_[_0xb59d('0x7d')](_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0x99')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c856b);}if(!_[_0xb59d('0x9a')](_0x5c856b,_0x55cf8d['body'][_0xb59d('0x99')])){throw new db[(_0xb59d('0x8f'))]['ValidationError'](_0xb59d('0x9b')+_0x5c856b);}_0x9f5c7c[_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0x99')]]=_0x55cf8d[_0xb59d('0x5c')]['from'];})[_0xb59d('0x1f')](function(){return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x55cf8d[_0xb59d('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xb59d('0x9c'),'include':[{'model':db[_0xb59d('0x8e')],'as':_0xb59d('0x9d'),'where':_0x9f5c7c,'limit':0x1,'order':[[_0xb59d('0x93'),_0xb59d('0x9e')]]}]},{'model':db[_0xb59d('0x9f')],'as':_0xb59d('0xa0')}]});})[_0xb59d('0x1f')](handleEntityNotFound(_0x56450f,null))[_0xb59d('0x1f')](function(_0x16757c){if(_0x16757c&&_0x16757c[_0xb59d('0x9c')]){_0x37bb3e[_0xb59d('0xa1')]=_0x16757c;_0x37bb3e[_0xb59d('0xa2')]=_0x16757c[_0xb59d('0xa0')];_0x37bb3e['list']=_0x16757c[_0xb59d('0x9c')];_0x37bb3e[_0xb59d('0xa2')]=_['orderBy'](_0x37bb3e[_0xb59d('0xa2')],['priority'],['asc']);if(_0x37bb3e['account'][_0xb59d('0xa0')]){delete _0x37bb3e['account'][_0xb59d('0xa0')];}if(_0x37bb3e[_0xb59d('0xa1')][_0xb59d('0x9c')]&&_0x37bb3e['account'][_0xb59d('0x9c')]['Contacts']['length']){return _0x37bb3e['account'][_0xb59d('0x9c')]['Contacts'][0x0];}var _0x557123=_[_0xb59d('0x17')](_0x55cf8d[_0xb59d('0x5c')],{'firstName':_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0x95')],'ListId':_0x16757c[_0xb59d('0xa3')]});_0x557123[_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0x99')]]=_0x55cf8d[_0xb59d('0x5c')]['from'];return db[_0xb59d('0x8e')][_0xb59d('0x5f')](_0x557123,{'fields':_0xcd345a,'raw':!![]});}})[_0xb59d('0x1f')](handleEntityNotFound(_0x56450f,null))[_0xb59d('0x1f')](function(_0x5e0bc6){_0x37bb3e[_0xb59d('0xa4')]=_0x5e0bc6;var _0x35f707=_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xa5')];if(_0x55cf8d[_0xb59d('0xa6')][_0xb59d('0xa7')]){_0x35f707=_0x55cf8d[_0xb59d('0xa6')][_0xb59d('0xa7')];}else if(_0x55cf8d[_0xb59d('0xa6')][_0xb59d('0xa8')]){_0x35f707=_[_0xb59d('0xa9')](_0x55cf8d[_0xb59d('0xa6')]['x-forwarded-for']['split'](','));}if(_0x5e0bc6){var _0x19f7b4={'ContactId':_0x5e0bc6['id'],'ChatWebsiteId':_0x55cf8d[_0xb59d('0x55')]['id'],'from':(_0x5e0bc6[_0xb59d('0xaa')]||'')+'\x20'+(_0x5e0bc6[_0xb59d('0xab')]||''),'customerIp':_0x35f707,'customerPort':_0x55cf8d['headers'][_0xb59d('0xac')]?_0x55cf8d[_0xb59d('0xa6')]['x-real-port']:null,'referer':_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xad')],'browserName':_0x207137[_0xb59d('0xae')][_0xb59d('0x3c')]&&_0x207137[_0xb59d('0xae')][_0xb59d('0xaf')]?util['format']('%s\x20%s',_0x207137[_0xb59d('0xae')]['name'],_0x207137['browser']['version']):_0xb59d('0xb0'),'browserVersion':_0x207137['browser']['version']||_0xb59d('0xb0'),'osName':util[_0xb59d('0xb1')](_0xb59d('0xb2'),_0x207137['os']['name'],_0x207137['os'][_0xb59d('0xaf')]),'osVersion':_0x207137['os'][_0xb59d('0xaf')],'deviceModel':_0x207137[_0xb59d('0xb3')][_0xb59d('0x42')]&&_0x207137[_0xb59d('0xb3')]['vendor']?util[_0xb59d('0xb1')](_0xb59d('0xb4'),_0x207137[_0xb59d('0xb3')][_0xb59d('0x42')],_0x207137[_0xb59d('0xb3')][_0xb59d('0xb5')],_0x207137[_0xb59d('0xb3')][_0xb59d('0x40')]):null,'deviceVendor':_0x207137[_0xb59d('0xb3')][_0xb59d('0xb5')],'deviceType':_0x207137[_0xb59d('0xb3')][_0xb59d('0x40')],'formData':JSON[_0xb59d('0x24')](_0x55cf8d[_0xb59d('0x5c')])};var _0x41f25e={'ChatWebsiteId':_0x55cf8d[_0xb59d('0x55')]['id'],'closed':![]};if(_0x55cf8d['body'][_0xb59d('0xb6')]){_0x41f25e['threadId']=_0x55cf8d[_0xb59d('0x5c')]['threadId'];return db[_0xb59d('0xb7')][_0xb59d('0x5b')]({'where':_0x41f25e})[_0xb59d('0x1f')](function(_0x381560){if(_0x381560){return[_0x381560,![]];}_0x19f7b4['threadId']=_0x55cf8d[_0xb59d('0x5c')]['threadId'];_0x19f7b4[_0xb59d('0xb8')]=_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xb8')];return db[_0xb59d('0xb7')][_0xb59d('0x5f')](_0x19f7b4)['then'](function(_0x10f4ce){return[_0x10f4ce,!![]];});});}_0x41f25e[_0xb59d('0xb9')]=_0x5e0bc6['id'];if(_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xba')]&&_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xba')]['id']){_0x41f25e['id']=_0x55cf8d[_0xb59d('0x5c')]['interaction']['id'];return db['ChatInteraction'][_0xb59d('0x5b')]({'where':_0x41f25e})[_0xb59d('0x1f')](function(_0x1ae654){if(_0x1ae654){return[_0x1ae654,![]];}return db['ChatInteraction'][_0xb59d('0x5f')](_0x19f7b4)['then'](function(_0x376cab){return[_0x376cab,!![]];});});}return db[_0xb59d('0xb7')][_0xb59d('0x5f')](_0x19f7b4)[_0xb59d('0x1f')](function(_0x11b961){return[_0x11b961,!![]];});}})[_0xb59d('0xbb')](function(_0x52541a,_0x5eac01){if(_0x52541a){_0x2fd9fb=_0x5eac01;if(!_0x5eac01){var _0x2a82de={'from':(_0x37bb3e['contact'][_0xb59d('0xaa')]||'')+'\x20'+(_0x37bb3e['contact'][_0xb59d('0xab')]||'')};if(_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xb6')]&&_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xbc')]&&_0x55cf8d[_0xb59d('0x5c')]['threadId']!=_0x55cf8d[_0xb59d('0x5c')]['messageId']){_0x2a82de[_0xb59d('0xb6')]=_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xbc')];}return _0x52541a[_0xb59d('0x36')](_0x2a82de);}else{return _0x52541a;}}})[_0xb59d('0x1f')](function(_0x131d4c){_0x37bb3e[_0xb59d('0xba')]=_0x131d4c[_0xb59d('0x38')]({'plain':!![]});_0x37bb3e[_0xb59d('0xba')][_0xb59d('0xbd')]=_0x2fd9fb;if(_0x37bb3e[_0xb59d('0xba')][_0xb59d('0xbd')]){if(_0x37bb3e['account'][_0xb59d('0xbe')]){_0x37bb3e[_0xb59d('0xa2')][_0xb59d('0xbf')]({'id':0x0,'priority':_0x37bb3e['applications'][_0xb59d('0x48')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xb59d('0xc0')});}}return db['ChatMessage']['create']({'body':_0x55cf8d[_0xb59d('0x5c')]['body'],'ChatWebsiteId':_0x55cf8d[_0xb59d('0x55')]['id'],'ChatInteractionId':_0x131d4c['id'],'direction':'in','ContactId':_0x37bb3e[_0xb59d('0xa4')]['id'],'AttachmentId':_0x55cf8d[_0xb59d('0x5c')][_0xb59d('0xc1')]});})[_0xb59d('0x1f')](function(_0x1bf0b4){_0x37bb3e[_0xb59d('0x27')]=_0x1bf0b4;if(_0x37bb3e[_0xb59d('0xba')][_0xb59d('0xc2')]){return db[_0xb59d('0xc3')]['find']({'attributes':['id',_0xb59d('0x3c')],'where':{'id':_0x37bb3e[_0xb59d('0xba')][_0xb59d('0xc2')]}})[_0xb59d('0x1f')](function(_0x449258){if(_0x449258){_0x37bb3e[_0xb59d('0xa2')][_0xb59d('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x449258[_0xb59d('0x3c')]+','+(_0x37bb3e[_0xb59d('0xa1')]['waitForTheAssignedAgent']||0xa),'interval':_0xb59d('0xc0')});_0x37bb3e[_0xb59d('0xc5')]=!![];}return respondWithRpcPromise(_0xb59d('0xc6'),_0xb59d('0xc7'),_0x37bb3e);});}return respondWithRpcPromise('Start',_0xb59d('0xc7'),_0x37bb3e);})['then'](function(_0x11b88c){respondWithRpcPromise('EventManager',_0xb59d('0xc8'),{'event':_0xb59d('0x88'),'message':_0x11b88c},client9002);return _0x11b88c;})[_0xb59d('0x1f')](respondWithResult(_0x56450f,null))[_0xb59d('0x29')](handleError(_0x56450f,null));};exports[_0xb59d('0xc9')]=function(_0x140836,_0x1331f5,_0xff1274){var _0x3f84cd,_0x2394e8,_0x571051;var _0xcae49=[];var _0x29712f=[];var _0x114897={};var _0x2f7ddc=_0x140836['files']||[];var _0x57b2ee=[];var _0xba600;return db[_0xb59d('0x8e')][_0xb59d('0x61')]()[_0xb59d('0x1f')](function(_0xe15862){if(!_0xe15862){throw new db[(_0xb59d('0x8f'))][(_0xb59d('0x96'))](_0xb59d('0x90'));}_0x29712f=_[_0xb59d('0x91')](_[_0xb59d('0x58')](_0xe15862),[_0xb59d('0x92'),_0xb59d('0x93')]);_0xcae49=_['difference'](_['keys'](_0xe15862),[_0xb59d('0x92'),_0xb59d('0x93'),_0xb59d('0x94'),_0xb59d('0xa3')]);if(_0x140836['body']['id']){delete _0x140836[_0xb59d('0x5c')]['id'];}if(_['isNil'](_0x140836[_0xb59d('0x5c')][_0xb59d('0x95')])){throw _0x1331f5[_0xb59d('0x2c')](0x1f4)['send'](new db[(_0xb59d('0x8f'))][(_0xb59d('0x96'))](_0xb59d('0x97')));}if(_[_0xb59d('0x7d')](_0x140836[_0xb59d('0x5c')][_0xb59d('0x5c')])||_0x140836[_0xb59d('0x5c')][_0xb59d('0x5c')]===''){throw _0x1331f5[_0xb59d('0x2c')](0x1f4)[_0xb59d('0xca')](new db[(_0xb59d('0x8f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x140836[_0xb59d('0x5c')][_0xb59d('0xcb')])){throw _0x1331f5[_0xb59d('0x2c')](0x1f4)[_0xb59d('0xca')](new db[(_0xb59d('0x8f'))][(_0xb59d('0x96'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xcae49));}if(!_['includes'](_0xcae49,_0x140836['body'][_0xb59d('0xcb')])){throw _0x1331f5[_0xb59d('0x2c')](0x1f4)[_0xb59d('0xca')](new db[(_0xb59d('0x8f'))][(_0xb59d('0x96'))](_0xb59d('0xcc')+_0xcae49));}_0x114897[_0x140836[_0xb59d('0x5c')][_0xb59d('0xcb')]]=_0x140836['body'][_0xb59d('0x95')];})['then'](function(){return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x140836[_0xb59d('0x55')]['id']},'include':[{'model':db[_0xb59d('0xcd')],'as':_0xb59d('0x9c')},{'model':db[_0xb59d('0xce')],'as':_0xb59d('0xce')}]});})[_0xb59d('0x1f')](handleEntityNotFound(_0x1331f5,null))[_0xb59d('0x1f')](function(_0x5bb12e){if(_0x5bb12e&&_0x5bb12e[_0xb59d('0x9c')]){_0x2394e8=_0x5bb12e;var _0x280a4e=_[_0xb59d('0x17')](_0x140836[_0xb59d('0x5c')],{'firstName':_0x140836[_0xb59d('0x5c')][_0xb59d('0x95')],'phone':_0x140836['body'][_0xb59d('0x95')],'ListId':_0x5bb12e[_0xb59d('0xa3')]});_0x280a4e[_0x140836[_0xb59d('0x5c')][_0xb59d('0xcb')]]=_0x140836[_0xb59d('0x5c')][_0xb59d('0x95')];return db[_0xb59d('0x8e')]['findOrCreate']({'where':_0x114897,'defaults':_0x280a4e});}})[_0xb59d('0xbb')](function(_0x80b1de){if(_0x80b1de){_0x571051=_0x80b1de;var _0x2d910d=fs['readFileSync'](path['join'](config['root'],_0xb59d('0xcf')),_0xb59d('0xd0'));var _0x453570=ejs[_0xb59d('0xd1')](_0x2d910d,{'body':_[_0xb59d('0xd2')](_0x140836[_0xb59d('0x5c')][_0xb59d('0x5c')]),'bodyTitle':_0x2394e8[_0xb59d('0xd3')]});return db['ChatOfflineMessage'][_0xb59d('0x5f')]({'body':_0x453570,'ContactId':_0x80b1de['id'],'ChatWebsiteId':_0x2394e8['id']});}})[_0xb59d('0x1f')](function(_0x9d96ce){_0xba600=_0x9d96ce;if(_0x2f7ddc[_0xb59d('0x48')]){var _0x1d7fa8=_0x2f7ddc['map'](function(_0x4613b6){return{'name':_0x4613b6[_0xb59d('0xd4')],'basename':_0x4613b6[_0xb59d('0x72')],'type':_0x4613b6['mimetype'],'ChatOfflineMessageId':_0x9d96ce['id']};});_0x57b2ee=_0x1d7fa8[_0xb59d('0x3e')](_0x4022bb=>{var _0x3950f3={'filename':_0x4022bb[_0xb59d('0x3c')],'path':path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0xd5'),_0xb59d('0xd6'),_0xb59d('0xd7'),'offline-chat',_0x4022bb[_0xb59d('0xd8')])};return _0x3950f3;});if(!_0x2394e8[_0xb59d('0xd9')]){return db[_0xb59d('0xda')][_0xb59d('0xdb')](function(_0x19ce6d){return db[_0xb59d('0xdc')][_0xb59d('0xdd')](_0x1d7fa8,{'transaction':_0x19ce6d});});}}})['then'](function(){if(_0xba600){_0x3f84cd=_0xba600;return db['MailAccount'][_0xb59d('0x66')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb59d('0xde'),'raw':!![]}]});}})[_0xb59d('0x1f')](function(_0x15f88a){if(_0x15f88a&&_0x15f88a[_0xb59d('0xde')]&&_0x2394e8[_0xb59d('0xdf')]&&_0x2394e8[_0xb59d('0xe0')]){var _0x28e518={'tls':{'rejectUnauthorized':![]}};if(_0x15f88a[_0xb59d('0xde')][_0xb59d('0xe1')]){_0x28e518[_0xb59d('0xe1')]=_0x15f88a[_0xb59d('0xde')]['service'];}else{_0x28e518[_0xb59d('0xe2')]=_0x15f88a['Smtp'][_0xb59d('0xe2')];_0x28e518['port']=_0x15f88a[_0xb59d('0xde')]['port'];_0x28e518[_0xb59d('0xe3')]=_0x15f88a[_0xb59d('0xde')][_0xb59d('0xe3')];}if(_0x15f88a[_0xb59d('0xde')][_0xb59d('0xe4')]){_0x28e518[_0xb59d('0xe5')]={'user':_0x15f88a['Smtp']['user'],'pass':_0x15f88a[_0xb59d('0xde')][_0xb59d('0xe6')]};}return respondWithRpcPromise(_0xb59d('0xe7'),_0xb59d('0xe8'),{'account':_0x28e518,'message':{'from':util['format'](_0xb59d('0xe9'),_0x15f88a[_0xb59d('0x3c')],_0x15f88a[_0xb59d('0xea')]||_0x15f88a[_0xb59d('0xde')]['user']),'to':_0x2394e8[_0xb59d('0xe0')],'subject':_0x2394e8[_0xb59d('0xeb')],'html':_0x3f84cd[_0xb59d('0x5c')],'attachments':_0x57b2ee}},client9003)[_0xb59d('0x1f')](function(){return _0x3f84cd;})[_0xb59d('0x29')](function(_0x5367b8){console[_0xb59d('0x26')](_0x5367b8);});}})[_0xb59d('0x1f')](function(){if(_0x2394e8&&_0x2394e8[_0xb59d('0xd9')]&&_0x2394e8[_0xb59d('0xec')]){var _0x4ea381=[];if(_0x2f7ddc[_0xb59d('0x48')]){_0x4ea381=_0x2f7ddc[_0xb59d('0x3e')](function(_0x537c1e){return{'name':_0x537c1e[_0xb59d('0xd4')],'basename':_0x537c1e[_0xb59d('0x72')],'type':_0x537c1e[_0xb59d('0xed')],'ChatOfflineMessageId':_0xba600['id']};});}var _0x3a3e6c;if(!_['isNil'](_0x2394e8[_0xb59d('0xee')])){var _0x46bbe0=_[_0xb59d('0x3e')](_0x140836['body'],function(_0x49b4b6){return _0x49b4b6;});var _0xbf360f=_['toPairsIn'](_0x46bbe0)[0x0];var _0x2d0b84=_['mapValues'](_0xbf360f,function(_0x3f64d0){return _0x3f64d0;});_0x3a3e6c=_0x2d0b84[0x1][_0x2394e8[_0xb59d('0xee')]];}var _0xb23bd5={'from':_0x571051['email'],'firstName':_0x571051['firstName'],'lastName':_0x571051[_0xb59d('0xab')],'mapKey':_0xb59d('0xea'),'message':{'from':_0x571051[_0xb59d('0xea')],'to':_0x2394e8[_0xb59d('0xce')][_0xb59d('0xea')],'cc':'','subject':_[_0xb59d('0x7d')](_0x3a3e6c)?_0x2394e8['offlineMessageSubject']:_0x3a3e6c,'messageId':'','sentAt':new Date(),'attach':_0x4ea381[_0xb59d('0x48')],'attachments':_0x4ea381,'originChannel':_0xb59d('0xef'),'ChatWebsiteId':_0x2394e8['id'],'ChatOfflineMessageId':_0x3f84cd['id'],'originTo':_0x2394e8[_0xb59d('0xce')][_0xb59d('0xea')]},'body':_0x3f84cd['body']};var _0x2ea04f={'account':{'id':_0x2394e8[_0xb59d('0xec')]},'body':_0xb23bd5,'log':_0xb59d('0xf0')};return respondWithRpcPromise(_0xb59d('0xf0'),_0xb59d('0xf1'),_0x2ea04f,client9001)[_0xb59d('0x1f')](function(){return _0x3f84cd;})[_0xb59d('0x29')](function(_0x4fbd4f){console[_0xb59d('0x26')](_0x4fbd4f);});}return;})['then'](function(){if(_0x3f84cd){return _0x3f84cd;}})[_0xb59d('0x1f')](respondWithResult(_0x1331f5,null))[_0xb59d('0x29')](function(_0x4fd51a){console[_0xb59d('0x26')]('catch',_0x4fd51a);for(var _0x52d2af of _0x2f7ddc){var _0x321add=path['join'](config['root'],_0xb59d('0xd5'),'files',_0xb59d('0xd7'),_0xb59d('0xf2'),_0x52d2af['filename']);fs_extra[_0xb59d('0xf3')](_0x321add)[_0xb59d('0x29')](function(_0x5d4a03){console[_0xb59d('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x321add,_0x5d4a03);});}});};exports['addInteraction']=function(_0x48a6d1,_0x1f553d,_0x2c88d9){return db['ChatInteraction']['find']({'where':{'id':_0x48a6d1[_0xb59d('0x55')]['id']}})['then'](handleEntityNotFound(_0x1f553d,null))[_0xb59d('0x1f')](function(_0x21a896){if(_0x21a896){return _0x21a896[_0xb59d('0xf4')](_0x48a6d1['body'][_0xb59d('0x69')],_[_0xb59d('0xf5')](_0x48a6d1[_0xb59d('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x1f553d,null))[_0xb59d('0x29')](handleError(_0x1f553d,null));};exports[_0xb59d('0xf6')]=function(_0x303f97,_0x591e04,_0x2acb4d){var _0x325396={'raw':![],'where':{}};var _0x5cdbcb={};var _0x20be03={'count':0x0,'rows':[]};return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x303f97[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x591e04,null))[_0xb59d('0x1f')](function(_0x24ccbd){if(_0x24ccbd){_0x5cdbcb['model']=_[_0xb59d('0x58')](db[_0xb59d('0xb7')][_0xb59d('0x57')]);_0x5cdbcb['query']=_[_0xb59d('0x58')](_0x303f97['query']);_0x5cdbcb[_0xb59d('0x44')]=_[_0xb59d('0x45')](_0x5cdbcb[_0xb59d('0x42')],_0x5cdbcb[_0xb59d('0x43')]);_0x325396[_0xb59d('0x46')]=_['intersection'](_0x5cdbcb[_0xb59d('0x42')],qs[_0xb59d('0x47')](_0x303f97[_0xb59d('0x43')][_0xb59d('0x47')]));_0x325396[_0xb59d('0x46')]=_0x325396[_0xb59d('0x46')][_0xb59d('0x48')]?_0x325396[_0xb59d('0x46')]:_0x5cdbcb['model'];if(!_0x303f97[_0xb59d('0x43')][_0xb59d('0x49')](_0xb59d('0x4a'))){_0x325396[_0xb59d('0x30')]=qs[_0xb59d('0x30')](_0x303f97['query'][_0xb59d('0x30')]);_0x325396[_0xb59d('0x2d')]=qs['offset'](_0x303f97[_0xb59d('0x43')][_0xb59d('0x2d')]);}_0x325396[_0xb59d('0x67')]=qs[_0xb59d('0x4b')](_0x303f97['query'][_0xb59d('0x4b')]);_0x325396[_0xb59d('0x4c')]=qs[_0xb59d('0x44')](_['pick'](_0x303f97[_0xb59d('0x43')],_0x5cdbcb['filters']));_0x325396[_0xb59d('0x4c')]['ChatWebsiteId']=_0x24ccbd['id'];if(_0x303f97[_0xb59d('0x43')]['filter']){_0x325396['where']=_['merge'](_0x325396[_0xb59d('0x4c')],{'$or':_[_0xb59d('0x3e')](_0x325396[_0xb59d('0x46')],function(_0x248539){var _0x2cdec2={};_0x2cdec2[_0x248539]={'$like':'%'+_0x303f97['query'][_0xb59d('0x4e')]+'%'};return _0x2cdec2;})});}_0x325396=_[_0xb59d('0x4f')]({},_0x325396,_0x303f97['options']);return db[_0xb59d('0xb7')][_0xb59d('0x2f')]({'where':_0x325396[_0xb59d('0x4c')]})[_0xb59d('0x1f')](function(_0x4f8f71){_0x20be03[_0xb59d('0x2f')]=_0x4f8f71;if(_0x303f97['query']['includeAll']){_0x325396[_0xb59d('0x51')]=[{'model':db['CmContact'],'as':_0xb59d('0xf7'),'required':![]},{'model':db[_0xb59d('0xc3')],'as':_0xb59d('0xf8'),'attributes':[_0xb59d('0x3c'),_0xb59d('0xf9'),_0xb59d('0xfa')],'required':![]},{'model':db[_0xb59d('0xfb')],'as':_0xb59d('0xfc'),'attributes':['id',_0xb59d('0x3c'),_0xb59d('0xfd')],'where':_0x303f97['query'][_0xb59d('0xfe')]?{'id':_0x303f97[_0xb59d('0x43')][_0xb59d('0xfe')]}:undefined,'required':_0x303f97[_0xb59d('0x43')][_0xb59d('0xfe')]?!![]:![]}];}return db[_0xb59d('0xb7')][_0xb59d('0x52')](_0x325396);})['then'](function(_0x1dcb31){_0x20be03['rows']=_0x1dcb31;return _0x20be03;});}})['then'](respondWithFilteredResult(_0x591e04,_0x325396))['catch'](handleError(_0x591e04,null));};function iftimePromise(_0xc248cb,_0x2fe932){return respondWithRpcPromise(_0xb59d('0xff'),'getSnippet',{'command':_0x2fe932[_0xb59d('0x100')]?util[_0xb59d('0xb1')](_0xb59d('0x101'),_0xc248cb['interval'],_0x2fe932[_0xb59d('0x100')]):util[_0xb59d('0xb1')](_0xb59d('0x102'),_0xc248cb[_0xb59d('0x103')])},client9002)[_0xb59d('0x1f')](function(_0x595157){var _0x403243=_0x595157&&_0x595157['indexOf'](_0xb59d('0x104'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2fe932['id'],_0xc248cb['id'],_0xc248cb[_0xb59d('0x103')],_0x403243?_0xb59d('0x105'):'OFFLINE',_0x2fe932[_0xb59d('0x100')]?_0x2fe932['timezone']:_0xb59d('0x106'));return _0x403243;})[_0xb59d('0x29')](function(_0x36ced1){logger[_0xb59d('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2fe932['id'],_0xc248cb['id'],_0xc248cb['interval'],util['inspect'](_0x36ced1,{'showHidden':![],'depth':null}),_0x2fe932[_0xb59d('0x100')]?_0x2fe932[_0xb59d('0x100')]:_0xb59d('0x106'));return![];});}exports['getSnippet']=function(_0x7c5d17,_0x37b921,_0xc8c89b){var _0x28543=0x0;var _0x6563fa=0x0;var _0x9e9a20=![];var _0x7b07c4;var _0x116d86;return db[_0xb59d('0x3f')][_0xb59d('0x5b')]({'where':{'id':_0x7c5d17[_0xb59d('0x55')]['id']},'include':[{'model':db[_0xb59d('0x107')],'as':_0xb59d('0x107'),'include':[{'model':db[_0xb59d('0x107')],'as':_0xb59d('0x108'),'attributes':['id',_0xb59d('0x103')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x37b921,null))[_0xb59d('0x1f')](function(_0x1c745b){if(_0x1c745b){_0x7b07c4=_0x1c745b;return _0x1c745b[_0xb59d('0x109')]({'raw':!![]});}})['then'](function(_0x549766){if(_0x7b07c4){if(_0x549766){_0x116d86=_0x549766;}}return require('../../config/license/util')['getLicense']();})[_0xb59d('0x1f')](function(_0x5bad68){if(_0x5bad68){_0x6563fa=_0x5bad68[_0xb59d('0x10a')];_0x9e9a20=_0x5bad68[_0xb59d('0x7c')];}})[_0xb59d('0x1f')](function(){return db[_0xb59d('0xb7')]['count']({'where':{'closed':![]}});})['then'](function(_0x4a3d51){_0x28543=_0x4a3d51;if(_0x6563fa&&_0x4a3d51>_0x6563fa){return db[_0xb59d('0x10b')][_0xb59d('0x66')]({'where':{'id':0x1}})['then'](function(_0x31c061){if(_0x31c061){_0x31c061[_0xb59d('0x10c')](_0xb59d('0x10d'));}});}})[_0xb59d('0x1f')](function(){if(_0x7b07c4['Interval']&&_0x7b07c4[_0xb59d('0x107')]['Intervals']){var _0x3020e7=[];for(var _0x4755ca=0x0;_0x4755ca<_0x7b07c4[_0xb59d('0x107')]['Intervals']['length'];_0x4755ca++){var _0x407c75=_0x7b07c4['Interval'][_0xb59d('0x108')][_0x4755ca][_0xb59d('0x38')]({'plain':!![]});_0x3020e7[_0xb59d('0xbf')](iftimePromise(_0x407c75,_0x7b07c4));}return BPromise[_0xb59d('0x10e')](_0x3020e7)[_0xb59d('0x1f')](function(_0x101f74){return _['some'](_0x101f74);});}else{return!![];}})[_0xb59d('0x1f')](function(_0x40064d){var _0x2584cf=fs[_0xb59d('0x10f')](path[_0xb59d('0x78')](config[_0xb59d('0x79')],_0xb59d('0x110')),_0xb59d('0xd0'));var _0x4ecc5f={'remote':_0x7b07c4[_0xb59d('0x111')],'query':querystring[_0xb59d('0x24')](_[_0xb59d('0x4f')](_0x7b07c4[_0xb59d('0x38')]({'plain':!![]}),{'customerIp':_0x7c5d17[_0xb59d('0xa6')][_0xb59d('0xa8')]||_0x7c5d17[_0xb59d('0xa6')]['x-real-ip']||_0x7c5d17[_0xb59d('0x112')][_0xb59d('0x113')]||_0x7c5d17['ip'],'referer':_0x7c5d17[_0xb59d('0xa6')][_0xb59d('0xad')],'openedInteractions':_0x28543,'maxInteractions':_0x6563fa,'virtual':_0x9e9a20[_0xb59d('0x10a')],'online':_0x40064d,'custom':_0x9e9a20}))[_0xb59d('0x114')](/'/g,'\x5c\x27')};_0x37b921['send'](ejs[_0xb59d('0xd1')](Mustache[_0xb59d('0xd1')](_0x2584cf,_0x4ecc5f),{'proactiveActions':_0x116d86,'alignment':_0x7b07c4[_0xb59d('0x115')],'verticalAlignment':_0x7b07c4[_0xb59d('0x116')],'div_color':_0x7b07c4[_0xb59d('0xfd')],'text_color':_0x7b07c4[_0xb59d('0x117')],'button_color':_0x7b07c4[_0xb59d('0x118')],'background_color':_0x7b07c4[_0xb59d('0x119')]}));})[_0xb59d('0x29')](handleError(_0x37b921,null));};exports[_0xb59d('0x11a')]=function(_0x57fd05,_0xdf057f,_0x4d5660){return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x57fd05[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0xdf057f,null))['then'](function(_0x3fa883){if(_0x3fa883){return db[_0xb59d('0xda')][_0xb59d('0xdb')](function(_0x19f78d){return db[_0xb59d('0x9f')][_0xb59d('0x37')]({'where':{'ChatWebsiteId':_0x57fd05[_0xb59d('0x55')]['id']},'transaction':_0x19f78d})[_0xb59d('0x1f')](function(_0x557feb){var _0x5f22ca=_[_0xb59d('0x3e')](_0x57fd05[_0xb59d('0x5c')],function(_0x4b2149){_0x4b2149[_0xb59d('0x63')]=_0x57fd05[_0xb59d('0x55')]['id'];return _0x4b2149;});return db[_0xb59d('0x9f')]['bulkCreate'](_0x5f22ca,{'transaction':_0x19f78d});});})['then'](function(){return db[_0xb59d('0x9f')][_0xb59d('0x11b')]({'where':{'ChatWebsiteId':_0x57fd05[_0xb59d('0x55')]['id']},'order':_0xb59d('0x11c')});});}})[_0xb59d('0x1f')](respondWithResult(_0xdf057f,null))[_0xb59d('0x29')](handleError(_0xdf057f,null));};exports[_0xb59d('0x11d')]=function(_0x102ea6,_0xe6ac27,_0x2e60a5){var _0x452dba={};var _0x41ddad={};var _0x33d6cf;var _0x246cfa;return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x102ea6[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0xe6ac27,null))[_0xb59d('0x1f')](function(_0x335cb1){if(_0x335cb1){_0x33d6cf=_0x335cb1;_0x41ddad[_0xb59d('0x42')]=_[_0xb59d('0x58')](db[_0xb59d('0x9f')][_0xb59d('0x57')]);_0x41ddad[_0xb59d('0x43')]=_[_0xb59d('0x58')](_0x102ea6[_0xb59d('0x43')]);_0x41ddad[_0xb59d('0x44')]=_[_0xb59d('0x45')](_0x41ddad['model'],_0x41ddad[_0xb59d('0x43')]);_0x452dba[_0xb59d('0x46')]=_[_0xb59d('0x45')](_0x41ddad['model'],qs[_0xb59d('0x47')](_0x102ea6[_0xb59d('0x43')][_0xb59d('0x47')]));_0x452dba[_0xb59d('0x46')]=_0x452dba[_0xb59d('0x46')][_0xb59d('0x48')]?_0x452dba[_0xb59d('0x46')]:_0x41ddad[_0xb59d('0x42')];_0x452dba[_0xb59d('0x67')]=qs[_0xb59d('0x4b')](_0x102ea6[_0xb59d('0x43')][_0xb59d('0x4b')]);_0x452dba[_0xb59d('0x4c')]=qs[_0xb59d('0x44')](_[_0xb59d('0x4d')](_0x102ea6[_0xb59d('0x43')],_0x41ddad[_0xb59d('0x44')]));if(_0x102ea6[_0xb59d('0x43')][_0xb59d('0x4e')]){_0x452dba[_0xb59d('0x4c')]=_[_0xb59d('0x4f')](_0x452dba[_0xb59d('0x4c')],{'$or':_[_0xb59d('0x3e')](_0x452dba[_0xb59d('0x46')],function(_0x68a572){var _0x4a802b={};_0x4a802b[_0x68a572]={'$like':'%'+_0x102ea6['query'][_0xb59d('0x4e')]+'%'};return _0x4a802b;})});}_0x452dba=_[_0xb59d('0x4f')]({},_0x452dba,_0x102ea6[_0xb59d('0x5a')]);return _0x33d6cf['getApplications'](_0x452dba);}})[_0xb59d('0x1f')](function(_0x84c0dc){if(_0x84c0dc){_0x246cfa=_0x84c0dc[_0xb59d('0x48')];if(!_0x102ea6[_0xb59d('0x43')][_0xb59d('0x49')](_0xb59d('0x4a'))){_0x452dba[_0xb59d('0x30')]=qs[_0xb59d('0x30')](_0x102ea6[_0xb59d('0x43')][_0xb59d('0x30')]);_0x452dba[_0xb59d('0x2d')]=qs[_0xb59d('0x2d')](_0x102ea6[_0xb59d('0x43')][_0xb59d('0x2d')]);}return _0x33d6cf[_0xb59d('0x11d')](_0x452dba);}})[_0xb59d('0x1f')](function(_0x48a702){if(_0x48a702){return _0x48a702?{'count':_0x246cfa,'rows':_0x48a702}:null;}})[_0xb59d('0x1f')](respondWithResult(_0xe6ac27,null))['catch'](handleError(_0xe6ac27,null));};exports[_0xb59d('0x11e')]=function(_0x1d8f75,_0xd6f795,_0x17bab5){return db['chatProactiveAction']['find']({'where':{'id':_0x1d8f75[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0xd6f795,null))[_0xb59d('0x1f')](function(_0x29ba45){if(_0x29ba45){return _0x29ba45[_0xb59d('0x11e')](_0x1d8f75[_0xb59d('0x5c')][_0xb59d('0x69')],_[_0xb59d('0xf5')](_0x1d8f75['body'],[_0xb59d('0x69'),'id'])||{});}})[_0xb59d('0x1f')](respondWithResult(_0xd6f795,null))[_0xb59d('0x29')](handleError(_0xd6f795,null));};exports['getProactiveActions']=function(_0x557cc5,_0x47293c,_0x464859){var _0x3afb4d={};var _0x259a5b={};var _0x2846da;var _0x14bf2a;return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x557cc5['params']['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x47293c,null))[_0xb59d('0x1f')](function(_0x380a6d){if(_0x380a6d){_0x2846da=_0x380a6d;_0x259a5b['model']=_[_0xb59d('0x58')](db['ChatProactiveAction'][_0xb59d('0x57')]);_0x259a5b[_0xb59d('0x43')]=_['keys'](_0x557cc5['query']);_0x259a5b[_0xb59d('0x44')]=_[_0xb59d('0x45')](_0x259a5b[_0xb59d('0x42')],_0x259a5b[_0xb59d('0x43')]);_0x3afb4d[_0xb59d('0x46')]=_[_0xb59d('0x45')](_0x259a5b[_0xb59d('0x42')],qs['fields'](_0x557cc5[_0xb59d('0x43')][_0xb59d('0x47')]));_0x3afb4d[_0xb59d('0x46')]=_0x3afb4d[_0xb59d('0x46')][_0xb59d('0x48')]?_0x3afb4d[_0xb59d('0x46')]:_0x259a5b['model'];_0x3afb4d[_0xb59d('0x67')]=qs['sort'](_0x557cc5[_0xb59d('0x43')][_0xb59d('0x4b')]);_0x3afb4d[_0xb59d('0x4c')]=qs[_0xb59d('0x44')](_[_0xb59d('0x4d')](_0x557cc5[_0xb59d('0x43')],_0x259a5b['filters']));if(_0x557cc5[_0xb59d('0x43')][_0xb59d('0x4e')]){_0x3afb4d[_0xb59d('0x4c')]=_[_0xb59d('0x4f')](_0x3afb4d[_0xb59d('0x4c')],{'$or':_[_0xb59d('0x3e')](_0x3afb4d[_0xb59d('0x46')],function(_0x221e48){var _0x5bf44f={};_0x5bf44f[_0x221e48]={'$like':'%'+_0x557cc5[_0xb59d('0x43')][_0xb59d('0x4e')]+'%'};return _0x5bf44f;})});}_0x3afb4d=_[_0xb59d('0x4f')]({},_0x3afb4d,_0x557cc5[_0xb59d('0x5a')]);return _0x2846da[_0xb59d('0x109')](_0x3afb4d);}})[_0xb59d('0x1f')](function(_0x57307e){if(_0x57307e){_0x14bf2a=_0x57307e[_0xb59d('0x48')];if(!_0x557cc5[_0xb59d('0x43')][_0xb59d('0x49')](_0xb59d('0x4a'))){_0x3afb4d[_0xb59d('0x30')]=qs['limit'](_0x557cc5[_0xb59d('0x43')][_0xb59d('0x30')]);_0x3afb4d['offset']=qs[_0xb59d('0x2d')](_0x557cc5[_0xb59d('0x43')][_0xb59d('0x2d')]);}return _0x2846da['getProactiveActions'](_0x3afb4d);}})[_0xb59d('0x1f')](function(_0x44fa5b){if(_0x44fa5b){return _0x44fa5b?{'count':_0x14bf2a,'rows':_0x44fa5b}:null;}})[_0xb59d('0x1f')](respondWithResult(_0x47293c,null))[_0xb59d('0x29')](handleError(_0x47293c,null));};exports[_0xb59d('0x11f')]=function(_0x16503a,_0x4d348e,_0x29eb0d){var _0x1e5666=_0x16503a[_0xb59d('0x43')][_0xb59d('0x120')]===_0xb59d('0x121')?_0xb59d('0x122'):_0xb59d('0x123');return db['ChatWebsite'][_0xb59d('0x5b')]({'attributes':['id',_0x1e5666],'where':{'id':_0x16503a[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x4d348e,null))[_0xb59d('0x1f')](function(_0x28afdd){if(_0x28afdd){var _0x1a12e3=_0x28afdd[_0x1e5666];var _0xffd7ff=_0x1a12e3&&_0x1a12e3['items']?_0x1a12e3[_0xb59d('0x124')]:[];_0x4d348e['send']({'fromKey':_[_0xb59d('0x7d')](_0x1a12e3['fromKey'])?undefined:_0x1a12e3[_0xb59d('0x125')],'count':_0xffd7ff['length'],'rows':_0xffd7ff});}})[_0xb59d('0x29')](handleError(_0x4d348e,null));};exports[_0xb59d('0x126')]=function(_0x1f2d47,_0x1404e9,_0x1a8ec9){var _0x3a2c50={'raw':![],'where':{}};var _0x573848={};var _0x17c17e={'count':0x0,'rows':[]};return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x1f2d47[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x1404e9,null))[_0xb59d('0x1f')](function(_0x1e25b1){if(_0x1e25b1){_0x573848[_0xb59d('0x42')]=_[_0xb59d('0x58')](db[_0xb59d('0x127')][_0xb59d('0x57')]);_0x573848[_0xb59d('0x43')]=_[_0xb59d('0x58')](_0x1f2d47[_0xb59d('0x43')]);_0x573848['filters']=_[_0xb59d('0x45')](_0x573848[_0xb59d('0x42')],_0x573848[_0xb59d('0x43')]);_0x3a2c50[_0xb59d('0x46')]=_[_0xb59d('0x45')](_0x573848[_0xb59d('0x42')],qs[_0xb59d('0x47')](_0x1f2d47['query'][_0xb59d('0x47')]));_0x3a2c50['attributes']=_0x3a2c50['attributes'][_0xb59d('0x48')]?_0x3a2c50[_0xb59d('0x46')]:_0x573848[_0xb59d('0x42')];if(!_0x1f2d47[_0xb59d('0x43')]['hasOwnProperty'](_0xb59d('0x4a'))){_0x3a2c50['limit']=qs[_0xb59d('0x30')](_0x1f2d47['query'][_0xb59d('0x30')]);_0x3a2c50['offset']=qs[_0xb59d('0x2d')](_0x1f2d47[_0xb59d('0x43')][_0xb59d('0x2d')]);}_0x3a2c50[_0xb59d('0x67')]=qs[_0xb59d('0x4b')](_0x1f2d47[_0xb59d('0x43')]['sort']);_0x3a2c50[_0xb59d('0x4c')]=qs[_0xb59d('0x44')](_['pick'](_0x1f2d47['query'],_0x573848[_0xb59d('0x44')]));_0x3a2c50[_0xb59d('0x4c')][_0xb59d('0x63')]=_0x1e25b1['id'];if(_0x1f2d47[_0xb59d('0x43')][_0xb59d('0x4e')]){_0x3a2c50['where']=_[_0xb59d('0x4f')](_0x3a2c50[_0xb59d('0x4c')],{'$or':_['map'](_0x3a2c50[_0xb59d('0x46')],function(_0x1d91ed){var _0x401fa6={};_0x401fa6[_0x1d91ed]={'$like':'%'+_0x1f2d47[_0xb59d('0x43')][_0xb59d('0x4e')]+'%'};return _0x401fa6;})});}_0x3a2c50=_['merge']({},_0x3a2c50,_0x1f2d47[_0xb59d('0x5a')]);return db[_0xb59d('0x127')]['count']({'where':_0x3a2c50[_0xb59d('0x4c')]})['then'](function(_0x2d33e2){_0x17c17e['count']=_0x2d33e2;if(_0x1f2d47[_0xb59d('0x43')][_0xb59d('0x59')]){_0x3a2c50['include']=[{'all':!![]}];}else{_0x3a2c50[_0xb59d('0x51')]=[{'model':db['CmContact'],'as':_0xb59d('0xf7'),'required':![]},{'model':db[_0xb59d('0xdc')],'as':_0xb59d('0x128'),'required':![]}];}return db['ChatOfflineMessage'][_0xb59d('0x52')](_0x3a2c50);})['then'](function(_0x1d08ba){_0x17c17e[_0xb59d('0x53')]=_0x1d08ba;return _0x17c17e;});}})[_0xb59d('0x1f')](respondWithFilteredResult(_0x1404e9,_0x3a2c50))['catch'](handleError(_0x1404e9,null));};exports['addAgents']=function(_0x2c1f07,_0x4b9c78,_0x195e74){return db[_0xb59d('0x3f')]['find']({'where':{'id':_0x2c1f07[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x4b9c78,null))[_0xb59d('0x1f')](function(_0x348f67){if(_0x348f67){return _0x348f67['addAgents'](_0x2c1f07[_0xb59d('0x5c')]['ids'],_[_0xb59d('0xf5')](_0x2c1f07[_0xb59d('0x5c')],[_0xb59d('0x69'),'id'])||{})[_0xb59d('0xbb')](function(_0x509c71){for(var _0x4853e5=0x0;_0x4853e5<_0x2c1f07['body'][_0xb59d('0x69')]['length'];_0x4853e5+=0x1){socket[_0xb59d('0x129')](_0xb59d('0x12a'),{'UserId':Number(_0x2c1f07[_0xb59d('0x5c')][_0xb59d('0x69')][_0x4853e5]),'ChatWebsiteId':Number(_0x2c1f07['params']['id'])});}return _0x509c71;});}})[_0xb59d('0x1f')](respondWithResult(_0x4b9c78,null))[_0xb59d('0x29')](handleError(_0x4b9c78,null));};exports[_0xb59d('0x12b')]=function(_0x503af9,_0x1080d5,_0x105592){return db['ChatWebsite']['find']({'where':{'id':_0x503af9[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x1080d5,null))[_0xb59d('0x1f')](function(_0x42faf3){if(_0x42faf3){return _0x42faf3['removeAgents'](_0x503af9[_0xb59d('0x43')][_0xb59d('0x69')])[_0xb59d('0x1f')](function(){if(_[_0xb59d('0x12c')](_0x503af9['query'][_0xb59d('0x69')])){for(var _0x352426=0x0;_0x352426<_0x503af9[_0xb59d('0x43')][_0xb59d('0x69')][_0xb59d('0x48')];_0x352426+=0x1){socket[_0xb59d('0x129')](_0xb59d('0x12d'),{'UserId':Number(_0x503af9[_0xb59d('0x43')]['ids'][_0x352426]),'ChatWebsiteId':Number(_0x503af9[_0xb59d('0x55')]['id'])});}}else{socket[_0xb59d('0x129')](_0xb59d('0x12d'),{'UserId':Number(_0x503af9[_0xb59d('0x43')][_0xb59d('0x69')]),'ChatWebsiteId':Number(_0x503af9[_0xb59d('0x55')]['id'])});}});}})[_0xb59d('0x1f')](respondWithStatusCode(_0x1080d5,null))[_0xb59d('0x29')](handleError(_0x1080d5,null));};exports[_0xb59d('0x12e')]=function(_0x29c045,_0x54a98b,_0x3ce696){var _0x497984={};var _0x3ef58b={};var _0x5b6b17;var _0x14ab14;return db[_0xb59d('0x3f')][_0xb59d('0x66')]({'where':{'id':_0x29c045[_0xb59d('0x55')]['id']}})[_0xb59d('0x1f')](handleEntityNotFound(_0x54a98b,null))[_0xb59d('0x1f')](function(_0x4e7aed){if(_0x4e7aed){_0x5b6b17=_0x4e7aed;_0x3ef58b['model']=_['keys'](db[_0xb59d('0xc3')][_0xb59d('0x57')]);_0x3ef58b[_0xb59d('0x43')]=_['keys'](_0x29c045['query']);_0x3ef58b[_0xb59d('0x44')]=_[_0xb59d('0x45')](_0x3ef58b[_0xb59d('0x42')],_0x3ef58b[_0xb59d('0x43')]);_0x497984[_0xb59d('0x46')]=_[_0xb59d('0x45')](_0x3ef58b[_0xb59d('0x42')],qs[_0xb59d('0x47')](_0x29c045[_0xb59d('0x43')][_0xb59d('0x47')]));_0x497984[_0xb59d('0x46')]=_0x497984[_0xb59d('0x46')][_0xb59d('0x48')]?_0x497984[_0xb59d('0x46')]:_0x3ef58b[_0xb59d('0x42')];_0x497984[_0xb59d('0x67')]=qs[_0xb59d('0x4b')](_0x29c045[_0xb59d('0x43')][_0xb59d('0x4b')]);_0x497984[_0xb59d('0x4c')]=qs[_0xb59d('0x44')](_[_0xb59d('0x4d')](_0x29c045[_0xb59d('0x43')],_0x3ef58b[_0xb59d('0x44')]));if(_0x29c045['query'][_0xb59d('0x4e')]){_0x497984[_0xb59d('0x4c')]=_[_0xb59d('0x4f')](_0x497984[_0xb59d('0x4c')],{'$or':_['map'](_0x497984['attributes'],function(_0x548d31){var _0x343589={};_0x343589[_0x548d31]={'$like':'%'+_0x29c045[_0xb59d('0x43')][_0xb59d('0x4e')]+'%'};return _0x343589;})});}_0x497984=_[_0xb59d('0x4f')]({},_0x497984,_0x29c045[_0xb59d('0x5a')]);return _0x5b6b17['getAgents'](_0x497984);}})[_0xb59d('0x1f')](function(_0x9ec48d){if(_0x9ec48d){_0x14ab14=_0x9ec48d['length'];if(!_0x29c045[_0xb59d('0x43')]['hasOwnProperty'](_0xb59d('0x4a'))){_0x497984[_0xb59d('0x30')]=qs['limit'](_0x29c045[_0xb59d('0x43')]['limit']);_0x497984[_0xb59d('0x2d')]=qs['offset'](_0x29c045['query'][_0xb59d('0x2d')]);}return _0x5b6b17['getAgents'](_0x497984);}})[_0xb59d('0x1f')](function(_0x5591a1){if(_0x5591a1){return _0x5591a1?{'count':_0x14ab14,'rows':_0x5591a1}:null;}})[_0xb59d('0x1f')](respondWithResult(_0x54a98b,null))['catch'](handleError(_0x54a98b,null));};
\ No newline at end of file
+var _0x4ced=['from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','ChatMessage','User','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','mimetype','subjectOffline','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','push','some','remote','x-real-ip','verticalAlignment','textColor','color_button','backgroundColor','addApplications','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','sendStatus','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','destroy','find','describe','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','from'];(function(_0x51cf17,_0x333223){var _0x5b5a04=function(_0x5cffdf){while(--_0x5cffdf){_0x51cf17['push'](_0x51cf17['shift']());}};_0x5b5a04(++_0x333223);}(_0x4ced,0x1c1));var _0xd4ce=function(_0x4e3a00,_0x13fcf2){_0x4e3a00=_0x4e3a00-0x0;var _0xf7cba7=_0x4ced[_0x4e3a00];return _0xf7cba7;};'use strict';var emlformat=require(_0xd4ce('0x0'));var rimraf=require(_0xd4ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4ce('0x2'));var rp=require(_0xd4ce('0x3'));var moment=require(_0xd4ce('0x4'));var BPromise=require(_0xd4ce('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4ce('0x6'));var sox=require(_0xd4ce('0x7'));var csv=require(_0xd4ce('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4ce('0x9'));var _=require('lodash');var squel=require(_0xd4ce('0xa'));var crypto=require(_0xd4ce('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd4ce('0x8'));var querystring=require('querystring');var Papa=require(_0xd4ce('0xc'));var Redis=require(_0xd4ce('0xd'));var authService=require(_0xd4ce('0xe'));var qs=require(_0xd4ce('0xf'));var as=require(_0xd4ce('0x10'));var hardwareService=require(_0xd4ce('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd4ce('0x12'));var config=require(_0xd4ce('0x13'));var licenseUtil=require(_0xd4ce('0x14'));var db=require(_0xd4ce('0x15'))['db'];config[_0xd4ce('0x16')]=_['defaults'](config['redis'],{'host':_0xd4ce('0x17'),'port':0x18eb});var socket=require(_0xd4ce('0x18'))(new Redis(config[_0xd4ce('0x16')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0xd4ce('0x19'));var client=jayson[_0xd4ce('0x1a')][_0xd4ce('0x1b')]({'port':0x232c});var client9002=jayson[_0xd4ce('0x1a')][_0xd4ce('0x1b')]({'port':0x232a});var client9003=jayson['client'][_0xd4ce('0x1b')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x12cf69,_0x54b651,_0x43a0f5,_0x217726){return new BPromise(function(_0x3f1c31,_0x1c2310){var _0x4189c0=_0x217726||client;return _0x4189c0['request'](_0x12cf69,_0x43a0f5)['then'](function(_0x16f66f){logger[_0xd4ce('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x54b651,_0xd4ce('0x1d'));logger[_0xd4ce('0x1e')](_0xd4ce('0x1f'),_0x54b651,_0xd4ce('0x1d'),JSON[_0xd4ce('0x20')](_0x16f66f));if(_0x16f66f[_0xd4ce('0x21')]){if(_0x16f66f['error']['code']===0x1f4){logger[_0xd4ce('0x21')](_0xd4ce('0x22'),_0x54b651,_0x16f66f[_0xd4ce('0x21')]['message']);return _0x1c2310(_0x16f66f[_0xd4ce('0x21')]['message']);}logger[_0xd4ce('0x21')](_0xd4ce('0x22'),_0x54b651,_0x16f66f['error'][_0xd4ce('0x23')]);return _0x3f1c31(_0x16f66f[_0xd4ce('0x21')][_0xd4ce('0x23')]);}else{logger[_0xd4ce('0x1c')](_0xd4ce('0x22'),_0x54b651,_0xd4ce('0x1d'));_0x3f1c31(_0x16f66f['result'][_0xd4ce('0x23')]);}})['catch'](function(_0x48a189){logger[_0xd4ce('0x21')](_0xd4ce('0x22'),_0x54b651,_0x48a189);_0x1c2310(_0x48a189);});});}function respondWithStatusCode(_0x3076a7,_0x1684c8){_0x1684c8=_0x1684c8||0xcc;return function(_0x271606){if(_0x271606){return _0x3076a7[_0xd4ce('0x24')](_0x1684c8);}return _0x3076a7['status'](_0x1684c8)['end']();};}function respondWithResult(_0x5a501d,_0x365ab0){_0x365ab0=_0x365ab0||0xc8;return function(_0x3d79a8){if(_0x3d79a8){return _0x5a501d['status'](_0x365ab0)[_0xd4ce('0x25')](_0x3d79a8);}};}function respondWithFilteredResult(_0x55b737,_0x11aee6){return function(_0x2b462c){if(_0x2b462c){var _0x3c0ca4=typeof _0x11aee6['offset']===_0xd4ce('0x26')&&typeof _0x11aee6[_0xd4ce('0x27')]==='undefined';var _0x47de61=_0x2b462c[_0xd4ce('0x28')];var _0x48943e=_0x3c0ca4?0x0:_0x11aee6[_0xd4ce('0x29')];var _0xcfa086=_0x3c0ca4?_0x2b462c[_0xd4ce('0x28')]:_0x11aee6[_0xd4ce('0x29')]+_0x11aee6[_0xd4ce('0x27')];var _0x28ad29;if(_0xcfa086>=_0x47de61){_0xcfa086=_0x47de61;_0x28ad29=0xc8;}else{_0x28ad29=0xce;}_0x55b737[_0xd4ce('0x2a')](_0x28ad29);return _0x55b737[_0xd4ce('0x2b')]('Content-Range',_0x48943e+'-'+_0xcfa086+'/'+_0x47de61)['json'](_0x2b462c);}return null;};}function patchUpdates(_0x2e3791){return function(_0x27aea7){try{jsonpatch[_0xd4ce('0x2c')](_0x27aea7,_0x2e3791,!![]);}catch(_0x1cb776){return BPromise[_0xd4ce('0x2d')](_0x1cb776);}return _0x27aea7[_0xd4ce('0x2e')]();};}function saveUpdates(_0x4753aa,_0x1d872e){return function(_0x13cc3b){if(_0x13cc3b){return _0x13cc3b[_0xd4ce('0x2f')](_0x4753aa)['then'](function(_0x2ea84e){return _0x2ea84e;});}return null;};}function removeEntity(_0x5cf075,_0x3a40cf){return function(_0x361015){if(_0x361015){return _0x361015['destroy']()[_0xd4ce('0x30')](function(){var _0x3b579f=_0x361015['get']({'plain':!![]});var _0x1d20db=_0xd4ce('0x31');return db[_0xd4ce('0x32')]['destroy']({'where':{'type':_0x1d20db,'resourceId':_0x3b579f['id']}})[_0xd4ce('0x30')](function(){return _0x361015;});})['then'](function(){_0x5cf075[_0xd4ce('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59964d,_0x13f26a){return function(_0x465fa4){if(!_0x465fa4){_0x59964d[_0xd4ce('0x24')](0x194);}return _0x465fa4;};}function handleError(_0x3b934b,_0x48e179){_0x48e179=_0x48e179||0x1f4;return function(_0x508edf){logger[_0xd4ce('0x21')](_0x508edf[_0xd4ce('0x33')]);if(_0x508edf[_0xd4ce('0x34')]){delete _0x508edf[_0xd4ce('0x34')];}_0x3b934b[_0xd4ce('0x2a')](_0x48e179)[_0xd4ce('0x35')](_0x508edf);};}exports[_0xd4ce('0x36')]=function(_0x5be70e,_0x31171a){var _0x5d3745={'include':[{'model':db[_0xd4ce('0x37')],'as':_0xd4ce('0x38')}]},_0x5bd479={},_0x50adf8={'count':0x0,'rows':[]};var _0x3a2ee3=_[_0xd4ce('0x39')](db[_0xd4ce('0x3a')][_0xd4ce('0x3b')],function(_0x55f964){return{'name':_0x55f964[_0xd4ce('0x3c')],'type':_0x55f964['type'][_0xd4ce('0x3d')]};});_0x5bd479[_0xd4ce('0x3e')]=_['map'](_0x3a2ee3,'name');_0x5bd479[_0xd4ce('0x3f')]=_[_0xd4ce('0x40')](_0x5be70e[_0xd4ce('0x3f')]);_0x5bd479[_0xd4ce('0x41')]=_['intersection'](_0x5bd479[_0xd4ce('0x3e')],_0x5bd479[_0xd4ce('0x3f')]);_0x5d3745['attributes']=_[_0xd4ce('0x42')](_0x5bd479[_0xd4ce('0x3e')],qs['fields'](_0x5be70e[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x5d3745['attributes']=_0x5d3745[_0xd4ce('0x44')]['length']?_0x5d3745[_0xd4ce('0x44')]:_0x5bd479[_0xd4ce('0x3e')];if(!_0x5be70e[_0xd4ce('0x3f')][_0xd4ce('0x45')](_0xd4ce('0x46'))){_0x5d3745[_0xd4ce('0x27')]=qs[_0xd4ce('0x27')](_0x5be70e[_0xd4ce('0x3f')][_0xd4ce('0x27')]);_0x5d3745[_0xd4ce('0x29')]=qs[_0xd4ce('0x29')](_0x5be70e['query'][_0xd4ce('0x29')]);}_0x5d3745[_0xd4ce('0x47')]=qs[_0xd4ce('0x48')](_0x5be70e[_0xd4ce('0x3f')]['sort']);_0x5d3745['where']=qs[_0xd4ce('0x41')](_[_0xd4ce('0x49')](_0x5be70e['query'],_0x5bd479[_0xd4ce('0x41')]),_0x3a2ee3);if(_0x5be70e[_0xd4ce('0x3f')][_0xd4ce('0x4a')]){_0x5d3745[_0xd4ce('0x4b')]=_[_0xd4ce('0x4c')](_0x5d3745[_0xd4ce('0x4b')],{'$or':_[_0xd4ce('0x39')](_0x3a2ee3,function(_0x4cccc9){if(_0x4cccc9[_0xd4ce('0x4d')]!==_0xd4ce('0x4e')){var _0x49ef81={};_0x49ef81[_0x4cccc9['name']]={'$like':'%'+_0x5be70e[_0xd4ce('0x3f')][_0xd4ce('0x4a')]+'%'};return _0x49ef81;}})});}_0x5d3745=_['merge']({},_0x5d3745,_0x5be70e['options']);var _0x29f5fa={'where':_0x5d3745['where']};return db[_0xd4ce('0x3a')]['count'](_0x29f5fa)['then'](function(_0x1bf002){_0x50adf8[_0xd4ce('0x28')]=_0x1bf002;if(_0x5be70e[_0xd4ce('0x3f')][_0xd4ce('0x4f')]){_0x5d3745[_0xd4ce('0x50')]=[{'all':!![]}];}return db[_0xd4ce('0x3a')][_0xd4ce('0x51')](_0x5d3745);})[_0xd4ce('0x30')](function(_0x56b3ed){_0x50adf8[_0xd4ce('0x52')]=_0x56b3ed;return _0x50adf8;})[_0xd4ce('0x30')](respondWithFilteredResult(_0x31171a,_0x5d3745))[_0xd4ce('0x53')](handleError(_0x31171a,null));};exports['show']=function(_0x53bdd6,_0x93df8c){var _0x238d05={'raw':![],'where':{'id':_0x53bdd6[_0xd4ce('0x54')]['id']},'include':[{'model':db[_0xd4ce('0x37')],'as':'mandatoryDispositionPause'}]},_0x143757={};_0x143757[_0xd4ce('0x3e')]=_[_0xd4ce('0x40')](db[_0xd4ce('0x3a')]['rawAttributes']);_0x143757[_0xd4ce('0x3f')]=_['keys'](_0x53bdd6[_0xd4ce('0x3f')]);_0x143757[_0xd4ce('0x41')]=_[_0xd4ce('0x42')](_0x143757['model'],_0x143757['query']);_0x238d05[_0xd4ce('0x44')]=_['intersection'](_0x143757['model'],qs[_0xd4ce('0x43')](_0x53bdd6[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x238d05[_0xd4ce('0x44')]=_0x238d05[_0xd4ce('0x44')][_0xd4ce('0x55')]?_0x238d05[_0xd4ce('0x44')]:_0x143757[_0xd4ce('0x3e')];if(_0x53bdd6[_0xd4ce('0x3f')][_0xd4ce('0x4f')]){_0x238d05['include']=[{'all':!![]}];}_0x238d05=_[_0xd4ce('0x4c')]({},_0x238d05,_0x53bdd6[_0xd4ce('0x56')]);return db[_0xd4ce('0x3a')]['find'](_0x238d05)[_0xd4ce('0x30')](handleEntityNotFound(_0x93df8c,null))[_0xd4ce('0x30')](respondWithResult(_0x93df8c,null))[_0xd4ce('0x53')](handleError(_0x93df8c,null));};exports[_0xd4ce('0x57')]=function(_0x30448e,_0x35bc26){return db[_0xd4ce('0x3a')][_0xd4ce('0x57')](_0x30448e[_0xd4ce('0x58')],{})['then'](function(_0x64d412){var _0x3660d2=_0x30448e[_0xd4ce('0x59')][_0xd4ce('0x5a')]({'plain':!![]});if(!_0x3660d2)throw new Error(_0xd4ce('0x5b'));if(_0x3660d2[_0xd4ce('0x5c')]==='user'){var _0x284b01=_0x64d412[_0xd4ce('0x5a')]({'plain':!![]});var _0x5ca3a2=_0xd4ce('0x31');return db['UserProfileSection']['find']({'where':{'name':_0x5ca3a2,'userProfileId':_0x3660d2['userProfileId']},'raw':!![]})[_0xd4ce('0x30')](function(_0x77348a){if(_0x77348a&&_0x77348a[_0xd4ce('0x5d')]===0x0){return db[_0xd4ce('0x32')][_0xd4ce('0x57')]({'name':_0x284b01[_0xd4ce('0x34')],'resourceId':_0x284b01['id'],'type':_0x77348a['name'],'sectionId':_0x77348a['id']},{})[_0xd4ce('0x30')](function(){return _0x64d412;});}else{return _0x64d412;}})['catch'](function(_0xe2eae3){logger[_0xd4ce('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe2eae3);throw _0xe2eae3;});}return _0x64d412;})[_0xd4ce('0x30')](respondWithResult(_0x35bc26,0xc9))['catch'](handleError(_0x35bc26,null));};exports[_0xd4ce('0x2f')]=function(_0x353368,_0x2d0dee){if(_0x353368['body']['id']){delete _0x353368[_0xd4ce('0x58')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x353368['params']['id']},'include':[{'model':db['Pause'],'as':_0xd4ce('0x38')}]})[_0xd4ce('0x30')](handleEntityNotFound(_0x2d0dee,null))['then'](saveUpdates(_0x353368['body'],null))[_0xd4ce('0x30')](respondWithResult(_0x2d0dee,null))[_0xd4ce('0x53')](handleError(_0x2d0dee,null));};exports[_0xd4ce('0x5e')]=function(_0x9014b9,_0x5e21ee){return db['ChatWebsite'][_0xd4ce('0x5f')]({'where':{'id':_0x9014b9[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x5e21ee,null))[_0xd4ce('0x30')](removeEntity(_0x5e21ee,null))[_0xd4ce('0x53')](handleError(_0x5e21ee,null));};exports['describe']=function(_0x4ae01b,_0x276424){return db[_0xd4ce('0x3a')][_0xd4ce('0x60')]()['then'](respondWithResult(_0x276424,null))[_0xd4ce('0x53')](handleError(_0x276424,null));};exports['addDisposition']=function(_0x573fc0,_0xd0484a,_0x509452){if(_0x573fc0[_0xd4ce('0x58')]['id']){delete _0x573fc0[_0xd4ce('0x58')]['id'];}return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x573fc0[_0xd4ce('0x54')]['id']}})['then'](handleEntityNotFound(_0xd0484a,null))[_0xd4ce('0x30')](function(_0x2a8636){if(_0x2a8636){_0x573fc0[_0xd4ce('0x58')][_0xd4ce('0x61')]=_0x2a8636['id'];return db[_0xd4ce('0x62')][_0xd4ce('0x57')](_0x573fc0[_0xd4ce('0x58')]);}})['then'](respondWithResult(_0xd0484a,null))[_0xd4ce('0x53')](handleError(_0xd0484a,null));};exports['getDispositions']=function(_0x2589f8,_0x1328a,_0x1a3919){var _0x4b81df={'raw':![],'where':{}};var _0x886b96={};var _0x27bccf={'count':0x0,'rows':[]};return db[_0xd4ce('0x3a')][_0xd4ce('0x63')]({'where':{'id':_0x2589f8[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x1328a,null))[_0xd4ce('0x30')](function(_0x15efa9){if(_0x15efa9){_0x886b96[_0xd4ce('0x3e')]=_[_0xd4ce('0x40')](db['Disposition'][_0xd4ce('0x3b')]);_0x886b96[_0xd4ce('0x3f')]=_[_0xd4ce('0x40')](_0x2589f8[_0xd4ce('0x3f')]);_0x886b96['filters']=_['intersection'](_0x886b96[_0xd4ce('0x3e')],_0x886b96[_0xd4ce('0x3f')]);_0x4b81df[_0xd4ce('0x44')]=_[_0xd4ce('0x42')](_0x886b96['model'],qs[_0xd4ce('0x43')](_0x2589f8[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x4b81df['attributes']=_0x4b81df['attributes'][_0xd4ce('0x55')]?_0x4b81df[_0xd4ce('0x44')]:_0x886b96['model'];if(!_0x2589f8[_0xd4ce('0x3f')][_0xd4ce('0x45')](_0xd4ce('0x46'))){_0x4b81df[_0xd4ce('0x27')]=qs['limit'](_0x2589f8[_0xd4ce('0x3f')]['limit']);_0x4b81df['offset']=qs[_0xd4ce('0x29')](_0x2589f8[_0xd4ce('0x3f')][_0xd4ce('0x29')]);}_0x4b81df[_0xd4ce('0x47')]=qs[_0xd4ce('0x48')](_0x2589f8[_0xd4ce('0x3f')][_0xd4ce('0x48')]);_0x4b81df[_0xd4ce('0x4b')]=qs[_0xd4ce('0x41')](_['pick'](_0x2589f8[_0xd4ce('0x3f')],_0x886b96['filters']));_0x4b81df[_0xd4ce('0x4b')][_0xd4ce('0x61')]=_0x15efa9['id'];if(_0x2589f8[_0xd4ce('0x3f')][_0xd4ce('0x4a')]){_0x4b81df['where']=_['merge'](_0x4b81df[_0xd4ce('0x4b')],{'$or':_[_0xd4ce('0x39')](_0x4b81df[_0xd4ce('0x44')],function(_0x1b6fac){var _0x280f80={};_0x280f80[_0x1b6fac]={'$like':'%'+_0x2589f8['query'][_0xd4ce('0x4a')]+'%'};return _0x280f80;})});}_0x4b81df=_['merge']({},_0x4b81df,_0x2589f8[_0xd4ce('0x56')]);return db[_0xd4ce('0x62')][_0xd4ce('0x28')]({'where':_0x4b81df[_0xd4ce('0x4b')]})[_0xd4ce('0x30')](function(_0x1841bc){_0x27bccf[_0xd4ce('0x28')]=_0x1841bc;if(_0x2589f8[_0xd4ce('0x3f')][_0xd4ce('0x4f')]){_0x4b81df[_0xd4ce('0x50')]=[{'all':!![]}];}return db[_0xd4ce('0x62')][_0xd4ce('0x51')](_0x4b81df);})[_0xd4ce('0x30')](function(_0x3fa88e){_0x27bccf[_0xd4ce('0x52')]=_0x3fa88e;return _0x27bccf;});}})[_0xd4ce('0x30')](respondWithFilteredResult(_0x1328a,_0x4b81df))[_0xd4ce('0x53')](handleError(_0x1328a,null));};exports['removeDispositions']=function(_0x3ca616,_0x5593e9,_0x3b081d){return db[_0xd4ce('0x3a')]['find']({'where':{'id':_0x3ca616[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x5593e9,null))[_0xd4ce('0x30')](function(_0x130d25){if(_0x130d25){return _0x130d25[_0xd4ce('0x64')](_0x3ca616['query']['ids']);}})['then'](respondWithStatusCode(_0x5593e9,null))[_0xd4ce('0x53')](handleError(_0x5593e9,null));};exports[_0xd4ce('0x65')]=function(_0x5f15f6,_0x28a80e,_0x174923){if(_0x5f15f6[_0xd4ce('0x58')]['id']){delete _0x5f15f6[_0xd4ce('0x58')]['id'];}return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x5f15f6[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x28a80e,null))['then'](function(_0x2009f0){if(_0x2009f0){_0x5f15f6[_0xd4ce('0x58')][_0xd4ce('0x61')]=_0x2009f0['id'];return db[_0xd4ce('0x66')][_0xd4ce('0x57')](_0x5f15f6[_0xd4ce('0x58')]);}})[_0xd4ce('0x30')](respondWithResult(_0x28a80e,null))[_0xd4ce('0x53')](handleError(_0x28a80e,null));};exports['getAnswers']=function(_0x5bb562,_0x250368,_0x4ea8a0){var _0x2d1947={'raw':![],'where':{}};var _0x471695={};var _0x501948={'count':0x0,'rows':[]};return db[_0xd4ce('0x3a')]['findOne']({'where':{'id':_0x5bb562['params']['id']}})['then'](handleEntityNotFound(_0x250368,null))['then'](function(_0xd8f8f){if(_0xd8f8f){_0x471695[_0xd4ce('0x3e')]=_[_0xd4ce('0x40')](db[_0xd4ce('0x66')][_0xd4ce('0x3b')]);_0x471695['query']=_['keys'](_0x5bb562['query']);_0x471695[_0xd4ce('0x41')]=_['intersection'](_0x471695[_0xd4ce('0x3e')],_0x471695[_0xd4ce('0x3f')]);_0x2d1947['attributes']=_[_0xd4ce('0x42')](_0x471695['model'],qs[_0xd4ce('0x43')](_0x5bb562[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x2d1947[_0xd4ce('0x44')]=_0x2d1947[_0xd4ce('0x44')][_0xd4ce('0x55')]?_0x2d1947[_0xd4ce('0x44')]:_0x471695[_0xd4ce('0x3e')];if(!_0x5bb562[_0xd4ce('0x3f')][_0xd4ce('0x45')](_0xd4ce('0x46'))){_0x2d1947['limit']=qs['limit'](_0x5bb562[_0xd4ce('0x3f')]['limit']);_0x2d1947['offset']=qs[_0xd4ce('0x29')](_0x5bb562[_0xd4ce('0x3f')][_0xd4ce('0x29')]);}_0x2d1947[_0xd4ce('0x47')]=qs['sort'](_0x5bb562[_0xd4ce('0x3f')]['sort']);_0x2d1947[_0xd4ce('0x4b')]=qs[_0xd4ce('0x41')](_[_0xd4ce('0x49')](_0x5bb562[_0xd4ce('0x3f')],_0x471695[_0xd4ce('0x41')]));_0x2d1947['where'][_0xd4ce('0x61')]=_0xd8f8f['id'];if(_0x5bb562[_0xd4ce('0x3f')][_0xd4ce('0x4a')]){_0x2d1947['where']=_['merge'](_0x2d1947['where'],{'$or':_[_0xd4ce('0x39')](_0x2d1947[_0xd4ce('0x44')],function(_0x5e65ae){var _0x37dd70={};_0x37dd70[_0x5e65ae]={'$like':'%'+_0x5bb562['query'][_0xd4ce('0x4a')]+'%'};return _0x37dd70;})});}_0x2d1947=_['merge']({},_0x2d1947,_0x5bb562[_0xd4ce('0x56')]);return db[_0xd4ce('0x66')]['count']({'where':_0x2d1947[_0xd4ce('0x4b')]})['then'](function(_0x40b642){_0x501948[_0xd4ce('0x28')]=_0x40b642;if(_0x5bb562['query'][_0xd4ce('0x4f')]){_0x2d1947[_0xd4ce('0x50')]=[{'all':!![]}];}return db[_0xd4ce('0x66')]['findAll'](_0x2d1947);})[_0xd4ce('0x30')](function(_0x729efe){_0x501948[_0xd4ce('0x52')]=_0x729efe;return _0x501948;});}})[_0xd4ce('0x30')](respondWithFilteredResult(_0x250368,_0x2d1947))[_0xd4ce('0x53')](handleError(_0x250368,null));};exports[_0xd4ce('0x67')]=function(_0x1b232f,_0x35cfab,_0x1a54d7){return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x1b232f[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x35cfab,null))[_0xd4ce('0x30')](function(_0x28e2cb){if(_0x28e2cb){return _0x28e2cb[_0xd4ce('0x67')](_0x1b232f[_0xd4ce('0x3f')][_0xd4ce('0x68')]);}})['then'](respondWithStatusCode(_0x35cfab,null))[_0xd4ce('0x53')](handleError(_0x35cfab,null));};exports['addLogo']=function(_0x19e939,_0x44ed18,_0xb8783d){_0x19e939[_0xd4ce('0x58')][_0xd4ce('0x69')]=_0x19e939[_0xd4ce('0x6a')][_0xd4ce('0x6b')];return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x19e939[_0xd4ce('0x54')]['id']}})['then'](handleEntityNotFound(_0x44ed18,null))['then'](saveUpdates(_0x19e939[_0xd4ce('0x58')],null))[_0xd4ce('0x30')](respondWithResult(_0x44ed18,null))[_0xd4ce('0x53')](handleError(_0x44ed18,null));};exports['addAvatar']=function(_0x2d5b5e,_0x4d09ee,_0x50baa3){_0x2d5b5e[_0xd4ce('0x58')][_0xd4ce('0x6c')]=_0x2d5b5e[_0xd4ce('0x6a')][_0xd4ce('0x6b')];return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x2d5b5e[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x4d09ee,null))['then'](saveUpdates(_0x2d5b5e[_0xd4ce('0x58')],null))[_0xd4ce('0x30')](respondWithResult(_0x4d09ee,null))[_0xd4ce('0x53')](handleError(_0x4d09ee,null));};exports[_0xd4ce('0x6d')]=function(_0x2bcfcb,_0x835775,_0x34c36f){_0x2bcfcb[_0xd4ce('0x58')][_0xd4ce('0x6e')]=_0x2bcfcb[_0xd4ce('0x6a')][_0xd4ce('0x6b')];return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x2bcfcb[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x835775,null))['then'](saveUpdates(_0x2bcfcb[_0xd4ce('0x58')],null))[_0xd4ce('0x30')](respondWithResult(_0x835775,null))[_0xd4ce('0x53')](handleError(_0x835775,null));};exports[_0xd4ce('0x6f')]=function(_0x58511f,_0x4fa1a3,_0x5ec676){_0x58511f['body'][_0xd4ce('0x70')]=_0x58511f[_0xd4ce('0x6a')][_0xd4ce('0x6b')];return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x58511f[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x4fa1a3,null))[_0xd4ce('0x30')](saveUpdates(_0x58511f[_0xd4ce('0x58')],null))[_0xd4ce('0x30')](respondWithResult(_0x4fa1a3,null))[_0xd4ce('0x53')](handleError(_0x4fa1a3,null));};exports[_0xd4ce('0x71')]=function(_0x51fb6b,_0x9ed20f,_0x39cc0f){var _0x7402aa=path['join'](config[_0xd4ce('0x72')],_0xd4ce('0x73'));var _0x21274={'where':{'id':_0x51fb6b[_0xd4ce('0x54')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3f6d64=![];return require(_0xd4ce('0x14'))['getLicense']()[_0xd4ce('0x30')](function(_0x2bccea){if(_0x2bccea){_0x3f6d64=_0x2bccea[_0xd4ce('0x74')];}})[_0xd4ce('0x30')](function(){return db[_0xd4ce('0x3a')]['find'](_0x21274);})[_0xd4ce('0x30')](handleEntityNotFound(_0x9ed20f,null))[_0xd4ce('0x30')](function(_0x571514){if(_0x571514){if(!_[_0xd4ce('0x75')](_0x571514['sitepic'])){if(fs[_0xd4ce('0x76')](path[_0xd4ce('0x77')](config['root'],_0xd4ce('0x78'),_0x571514[_0xd4ce('0x69')]))&&_0x3f6d64){_0x7402aa=path[_0xd4ce('0x77')](config[_0xd4ce('0x72')],'server/files/images/logos/',_0x571514[_0xd4ce('0x69')]);}}return _0x9ed20f[_0xd4ce('0x79')](_0x7402aa);}})[_0xd4ce('0x53')](handleError(_0x9ed20f,null));};exports[_0xd4ce('0x7a')]=function(_0x245b09,_0x518eaa,_0x673b95){var _0x5ea52b=path[_0xd4ce('0x77')](config[_0xd4ce('0x72')],_0xd4ce('0x7b'));var _0x144765={'where':{'id':_0x245b09[_0xd4ce('0x54')]['id']},'attributes':['id',_0xd4ce('0x6c')],'raw':!![]};return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')](_0x144765)[_0xd4ce('0x30')](handleEntityNotFound(_0x518eaa,null))[_0xd4ce('0x30')](function(_0x58bede){if(_0x58bede){if(!_[_0xd4ce('0x75')](_0x58bede[_0xd4ce('0x6c')])){if(fs[_0xd4ce('0x76')](path[_0xd4ce('0x77')](config['root'],_0xd4ce('0x7c'),_0x58bede['agentAvatar']))){_0x5ea52b=path[_0xd4ce('0x77')](config[_0xd4ce('0x72')],_0xd4ce('0x7c'),_0x58bede[_0xd4ce('0x6c')]);}}return _0x518eaa[_0xd4ce('0x79')](_0x5ea52b);}})[_0xd4ce('0x53')](handleError(_0x518eaa,null));};exports[_0xd4ce('0x7d')]=function(_0x51244e,_0x313689,_0x257bb5){var _0x1ece52=path['join'](config[_0xd4ce('0x72')],_0xd4ce('0x7e'));var _0x4be7ee={'where':{'id':_0x51244e[_0xd4ce('0x54')]['id']},'attributes':['id',_0xd4ce('0x6e'),_0xd4ce('0x7f')],'raw':!![]};return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')](_0x4be7ee)[_0xd4ce('0x30')](handleEntityNotFound(_0x313689,null))[_0xd4ce('0x30')](function(_0x565b9a){if(_0x565b9a){if(!_[_0xd4ce('0x75')](_0x565b9a[_0xd4ce('0x6e')])){if(fs[_0xd4ce('0x76')](path['join'](config[_0xd4ce('0x72')],'server/files/images/avatars/',_0x565b9a[_0xd4ce('0x6e')]))&&_0x565b9a[_0xd4ce('0x7f')]){_0x1ece52=path[_0xd4ce('0x77')](config['root'],'server/files/images/avatars/',_0x565b9a['customerAvatar']);}}return _0x313689['download'](_0x1ece52);}})[_0xd4ce('0x53')](handleError(_0x313689,null));};exports['getSystemAvatar']=function(_0x26db18,_0x25a93b,_0x52ea84){var _0xa7dae8=path[_0xd4ce('0x77')](config[_0xd4ce('0x72')],_0xd4ce('0x80'));var _0x1654af={'where':{'id':_0x26db18[_0xd4ce('0x54')]['id']},'attributes':['id',_0xd4ce('0x70')],'raw':!![]};return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')](_0x1654af)[_0xd4ce('0x30')](handleEntityNotFound(_0x25a93b,null))[_0xd4ce('0x30')](function(_0x2bd889){if(_0x2bd889){if(!_[_0xd4ce('0x75')](_0x2bd889[_0xd4ce('0x70')])){if(fs[_0xd4ce('0x76')](path[_0xd4ce('0x77')](config[_0xd4ce('0x72')],_0xd4ce('0x7c'),_0x2bd889[_0xd4ce('0x70')]))){_0xa7dae8=path[_0xd4ce('0x77')](config[_0xd4ce('0x72')],_0xd4ce('0x7c'),_0x2bd889[_0xd4ce('0x70')]);}}return _0x25a93b[_0xd4ce('0x79')](_0xa7dae8);}})['catch'](handleError(_0x25a93b,null));};exports[_0xd4ce('0x81')]=function(_0x1b7ddf,_0x5cb6fd,_0x5ac113){var _0x23c305=require(_0xd4ce('0x82'));var _0x3a0baf=new _0x23c305();var _0x354b4f=_0x3a0baf[_0xd4ce('0x83')](_0x1b7ddf[_0xd4ce('0x84')][_0xd4ce('0x85')])['getResult']();var _0x365e38={'body':_0x1b7ddf[_0xd4ce('0x58')],'channel':_0xd4ce('0x86')};var _0xace7bf=[];var _0x3f448f=[];var _0x3d7bcc={};var _0x44d0ca=![];return db['CmContact']['describe']()[_0xd4ce('0x30')](function(_0x5de9d9){if(!_0x5de9d9){throw new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))](_0xd4ce('0x89'));}_0xace7bf=_[_0xd4ce('0x8a')](_[_0xd4ce('0x40')](_0x5de9d9),['createdAt',_0xd4ce('0x8b')]);_0x3f448f=_[_0xd4ce('0x8a')](_[_0xd4ce('0x40')](_0x5de9d9),[_0xd4ce('0x8c'),_0xd4ce('0x8b'),'CompanyId',_0xd4ce('0x8d')]);if(_0x1b7ddf[_0xd4ce('0x58')]['id']){delete _0x1b7ddf[_0xd4ce('0x58')]['id'];}if(_[_0xd4ce('0x75')](_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x8e')])){throw new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))](_0xd4ce('0x8f'));}if(_['isNil'](_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x58')])||_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x58')]===''){throw new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd4ce('0x75')](_0x1b7ddf[_0xd4ce('0x58')]['mapKey'])){throw new db[(_0xd4ce('0x87'))]['ValidationError'](_0xd4ce('0x90')+_0x3f448f);}if(!_[_0xd4ce('0x91')](_0x3f448f,_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x92')])){throw new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))](_0xd4ce('0x93')+_0x3f448f);}_0x3d7bcc[_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x92')]]=_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x8e')];})[_0xd4ce('0x30')](function(){return db['ChatWebsite'][_0xd4ce('0x5f')]({'where':{'id':_0x1b7ddf[_0xd4ce('0x54')]['id']},'include':[{'model':db[_0xd4ce('0x94')],'as':'List','include':[{'model':db[_0xd4ce('0x95')],'as':_0xd4ce('0x96'),'where':_0x3d7bcc,'limit':0x1,'order':[[_0xd4ce('0x8b'),_0xd4ce('0x97')]]}]},{'model':db[_0xd4ce('0x98')],'as':_0xd4ce('0x99')}]});})[_0xd4ce('0x30')](handleEntityNotFound(_0x5cb6fd,null))['then'](function(_0x592eb5){if(_0x592eb5&&_0x592eb5[_0xd4ce('0x9a')]){_0x365e38[_0xd4ce('0x9b')]=_0x592eb5;_0x365e38[_0xd4ce('0x9c')]=_0x592eb5['Applications'];_0x365e38[_0xd4ce('0x9d')]=_0x592eb5[_0xd4ce('0x9a')];_0x365e38['applications']=_[_0xd4ce('0x9e')](_0x365e38[_0xd4ce('0x9c')],[_0xd4ce('0x9f')],[_0xd4ce('0xa0')]);if(_0x365e38[_0xd4ce('0x9b')][_0xd4ce('0x99')]){delete _0x365e38[_0xd4ce('0x9b')][_0xd4ce('0x99')];}if(_0x365e38[_0xd4ce('0x9b')][_0xd4ce('0x9a')]&&_0x365e38[_0xd4ce('0x9b')][_0xd4ce('0x9a')][_0xd4ce('0x96')]['length']){return _0x365e38['account'][_0xd4ce('0x9a')]['Contacts'][0x0];}var _0x570a97=_[_0xd4ce('0xa1')](_0x1b7ddf[_0xd4ce('0x58')],{'firstName':_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x8e')],'ListId':_0x592eb5[_0xd4ce('0x8d')]});_0x570a97[_0x1b7ddf['body'][_0xd4ce('0x92')]]=_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x8e')];return db[_0xd4ce('0x95')][_0xd4ce('0x57')](_0x570a97,{'fields':_0xace7bf,'raw':!![]});}})[_0xd4ce('0x30')](handleEntityNotFound(_0x5cb6fd,null))[_0xd4ce('0x30')](function(_0x202547){_0x365e38[_0xd4ce('0xa2')]=_0x202547;var _0x31229c=_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xa3')];if(_0x1b7ddf[_0xd4ce('0x84')]['cf-connecting-ip']){_0x31229c=_0x1b7ddf[_0xd4ce('0x84')][_0xd4ce('0xa4')];}else if(_0x1b7ddf[_0xd4ce('0x84')][_0xd4ce('0xa5')]){_0x31229c=_[_0xd4ce('0xa6')](_0x1b7ddf['headers'][_0xd4ce('0xa5')][_0xd4ce('0xa7')](','));}if(_0x202547){var _0x20b47f={'ContactId':_0x202547['id'],'ChatWebsiteId':_0x1b7ddf['params']['id'],'from':(_0x202547[_0xd4ce('0xa8')]||'')+'\x20'+(_0x202547[_0xd4ce('0xa9')]||''),'customerIp':_0x31229c,'customerPort':_0x1b7ddf[_0xd4ce('0x84')]['x-real-port']?_0x1b7ddf['headers'][_0xd4ce('0xaa')]:null,'referer':_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xab')],'browserName':_0x354b4f[_0xd4ce('0xac')][_0xd4ce('0x34')]&&_0x354b4f['browser'][_0xd4ce('0xad')]?util['format'](_0xd4ce('0xae'),_0x354b4f['browser'][_0xd4ce('0x34')],_0x354b4f[_0xd4ce('0xac')]['version']):_0xd4ce('0xaf'),'browserVersion':_0x354b4f['browser'][_0xd4ce('0xad')]||_0xd4ce('0xaf'),'osName':util[_0xd4ce('0xb0')](_0xd4ce('0xae'),_0x354b4f['os'][_0xd4ce('0x34')],_0x354b4f['os']['version']),'osVersion':_0x354b4f['os'][_0xd4ce('0xad')],'deviceModel':_0x354b4f[_0xd4ce('0xb1')][_0xd4ce('0x3e')]&&_0x354b4f[_0xd4ce('0xb1')][_0xd4ce('0xb2')]?util[_0xd4ce('0xb0')](_0xd4ce('0xb3'),_0x354b4f['device']['model'],_0x354b4f[_0xd4ce('0xb1')]['vendor'],_0x354b4f[_0xd4ce('0xb1')]['type']):null,'deviceVendor':_0x354b4f[_0xd4ce('0xb1')]['vendor'],'deviceType':_0x354b4f[_0xd4ce('0xb1')][_0xd4ce('0x4d')],'formData':JSON['stringify'](_0x1b7ddf[_0xd4ce('0x58')])};var _0x42fece={'ChatWebsiteId':_0x1b7ddf[_0xd4ce('0x54')]['id'],'closed':![]};if(_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xb4')]){_0x42fece[_0xd4ce('0xb4')]=_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xb4')];return db[_0xd4ce('0xb5')][_0xd4ce('0x5f')]({'where':_0x42fece})['then'](function(_0x5e6b56){if(_0x5e6b56){return[_0x5e6b56,![]];}_0x20b47f['threadId']=_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xb4')];_0x20b47f['externalUrl']=_0x1b7ddf['body'][_0xd4ce('0xb6')];return db[_0xd4ce('0xb5')][_0xd4ce('0x57')](_0x20b47f)[_0xd4ce('0x30')](function(_0x540802){return[_0x540802,!![]];});});}_0x42fece[_0xd4ce('0xb7')]=_0x202547['id'];if(_0x1b7ddf['body'][_0xd4ce('0xb8')]&&_0x1b7ddf['body'][_0xd4ce('0xb8')]['id']){_0x42fece['id']=_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xb8')]['id'];return db[_0xd4ce('0xb5')][_0xd4ce('0x5f')]({'where':_0x42fece})[_0xd4ce('0x30')](function(_0x4ce6e2){if(_0x4ce6e2){return[_0x4ce6e2,![]];}return db[_0xd4ce('0xb5')][_0xd4ce('0x57')](_0x20b47f)['then'](function(_0x40ec6c){return[_0x40ec6c,!![]];});});}return db[_0xd4ce('0xb5')]['create'](_0x20b47f)[_0xd4ce('0x30')](function(_0x36b01a){return[_0x36b01a,!![]];});}})['spread'](function(_0x5a9b41,_0x16d114){if(_0x5a9b41){_0x44d0ca=_0x16d114;if(!_0x16d114){var _0x17b21a={'from':(_0x365e38[_0xd4ce('0xa2')][_0xd4ce('0xa8')]||'')+'\x20'+(_0x365e38[_0xd4ce('0xa2')][_0xd4ce('0xa9')]||'')};if(_0x1b7ddf['body'][_0xd4ce('0xb4')]&&_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xb9')]&&_0x1b7ddf['body'][_0xd4ce('0xb4')]!=_0x1b7ddf[_0xd4ce('0x58')]['messageId']){_0x17b21a[_0xd4ce('0xb4')]=_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0xb9')];}return _0x5a9b41[_0xd4ce('0x2f')](_0x17b21a);}else{return _0x5a9b41;}}})[_0xd4ce('0x30')](function(_0x3f1a0d){_0x365e38[_0xd4ce('0xb8')]=_0x3f1a0d[_0xd4ce('0x5a')]({'plain':!![]});_0x365e38['interaction'][_0xd4ce('0xba')]=_0x44d0ca;if(_0x365e38[_0xd4ce('0xb8')]['created']){if(_0x365e38[_0xd4ce('0x9b')][_0xd4ce('0xbb')]){_0x365e38['applications']['push']({'id':0x0,'priority':_0x365e38[_0xd4ce('0x9c')]['length']+0x1,'app':_0xd4ce('0xbc'),'appdata':_0xd4ce('0xbd'),'interval':'*,*,*,*'});}}return db[_0xd4ce('0xbe')][_0xd4ce('0x57')]({'body':_0x1b7ddf[_0xd4ce('0x58')][_0xd4ce('0x58')],'ChatWebsiteId':_0x1b7ddf[_0xd4ce('0x54')]['id'],'ChatInteractionId':_0x3f1a0d['id'],'direction':'in','ContactId':_0x365e38[_0xd4ce('0xa2')]['id'],'AttachmentId':_0x1b7ddf[_0xd4ce('0x58')]['AttachmentId']});})[_0xd4ce('0x30')](function(_0x519757){_0x365e38[_0xd4ce('0x23')]=_0x519757;if(_0x365e38[_0xd4ce('0xb8')]['UserId']){return db[_0xd4ce('0xbf')][_0xd4ce('0x5f')]({'attributes':['id','name'],'where':{'id':_0x365e38[_0xd4ce('0xb8')][_0xd4ce('0xc0')]}})[_0xd4ce('0x30')](function(_0x443847){if(_0x443847){_0x365e38[_0xd4ce('0x9c')][_0xd4ce('0xc1')]({'id':0x0,'priority':0x0,'app':_0xd4ce('0xc2'),'appdata':_0x443847['name']+','+(_0x365e38['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x365e38[_0xd4ce('0xc3')]=!![];}return respondWithRpcPromise(_0xd4ce('0xc4'),'startRouting',_0x365e38);});}return respondWithRpcPromise('Start',_0xd4ce('0xc5'),_0x365e38);})[_0xd4ce('0x30')](function(_0x36f12a){respondWithRpcPromise(_0xd4ce('0xc6'),'EventManager',{'event':_0xd4ce('0x81'),'message':_0x36f12a},client9002);return _0x36f12a;})[_0xd4ce('0x30')](respondWithResult(_0x5cb6fd,null))[_0xd4ce('0x53')](handleError(_0x5cb6fd,null));};exports[_0xd4ce('0xc7')]=function(_0x2117a2,_0x54a642,_0x43c34b){var _0x819a9,_0x1b815a,_0x4dae87;var _0x5d5cb0=[];var _0x249bd8=[];var _0x3d57f5={};var _0x29b065=_0x2117a2[_0xd4ce('0xc8')]||[];var _0x128f6a=[];var _0x18cd9;return db[_0xd4ce('0x95')][_0xd4ce('0x60')]()[_0xd4ce('0x30')](function(_0x3cf1a0){if(!_0x3cf1a0){throw new db[(_0xd4ce('0x87'))]['ValidationError'](_0xd4ce('0x89'));}_0x249bd8=_[_0xd4ce('0x8a')](_[_0xd4ce('0x40')](_0x3cf1a0),['createdAt','updatedAt']);_0x5d5cb0=_['difference'](_['keys'](_0x3cf1a0),[_0xd4ce('0x8c'),'updatedAt','CompanyId',_0xd4ce('0x8d')]);if(_0x2117a2[_0xd4ce('0x58')]['id']){delete _0x2117a2[_0xd4ce('0x58')]['id'];}if(_[_0xd4ce('0x75')](_0x2117a2[_0xd4ce('0x58')][_0xd4ce('0x8e')])){throw _0x54a642['status'](0x1f4)['send'](new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))]('from\x20is\x20mandatory'));}if(_[_0xd4ce('0x75')](_0x2117a2[_0xd4ce('0x58')][_0xd4ce('0x58')])||_0x2117a2[_0xd4ce('0x58')][_0xd4ce('0x58')]===''){throw _0x54a642['status'](0x1f4)[_0xd4ce('0x35')](new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))](_0xd4ce('0xc9')));}if(_[_0xd4ce('0x75')](_0x2117a2['body']['mapKeyOffline'])){throw _0x54a642[_0xd4ce('0x2a')](0x1f4)['send'](new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))](_0xd4ce('0xca')+_0x5d5cb0));}if(!_['includes'](_0x5d5cb0,_0x2117a2['body'][_0xd4ce('0xcb')])){throw _0x54a642[_0xd4ce('0x2a')](0x1f4)['send'](new db[(_0xd4ce('0x87'))][(_0xd4ce('0x88'))](_0xd4ce('0xcc')+_0x5d5cb0));}_0x3d57f5[_0x2117a2[_0xd4ce('0x58')][_0xd4ce('0xcb')]]=_0x2117a2['body'][_0xd4ce('0x8e')];})[_0xd4ce('0x30')](function(){return db[_0xd4ce('0x3a')]['find']({'where':{'id':_0x2117a2[_0xd4ce('0x54')]['id']},'include':[{'model':db[_0xd4ce('0x94')],'as':_0xd4ce('0x9a')},{'model':db[_0xd4ce('0xcd')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x54a642,null))[_0xd4ce('0x30')](function(_0x5e74f6){if(_0x5e74f6&&_0x5e74f6[_0xd4ce('0x9a')]){_0x1b815a=_0x5e74f6;var _0x8e85b5=_[_0xd4ce('0xa1')](_0x2117a2[_0xd4ce('0x58')],{'firstName':_0x2117a2['body'][_0xd4ce('0x8e')],'phone':_0x2117a2[_0xd4ce('0x58')][_0xd4ce('0x8e')],'ListId':_0x5e74f6[_0xd4ce('0x8d')]});_0x8e85b5[_0x2117a2['body'][_0xd4ce('0xcb')]]=_0x2117a2[_0xd4ce('0x58')]['from'];return db[_0xd4ce('0x95')][_0xd4ce('0xce')]({'where':_0x3d57f5,'defaults':_0x8e85b5});}})[_0xd4ce('0xcf')](function(_0x541d0c){if(_0x541d0c){_0x4dae87=_0x541d0c;var _0x1907ad=fs[_0xd4ce('0xd0')](path[_0xd4ce('0x77')](config['root'],_0xd4ce('0xd1')),'utf8');var _0x900046=ejs[_0xd4ce('0xd2')](_0x1907ad,{'body':_[_0xd4ce('0xd3')](_0x2117a2[_0xd4ce('0x58')][_0xd4ce('0x58')]),'bodyTitle':_0x1b815a[_0xd4ce('0xd4')]});return db['ChatOfflineMessage'][_0xd4ce('0x57')]({'body':_0x900046,'ContactId':_0x541d0c['id'],'ChatWebsiteId':_0x1b815a['id']});}})[_0xd4ce('0x30')](function(_0x4663d3){_0x18cd9=_0x4663d3;if(_0x29b065[_0xd4ce('0x55')]){var _0x396ab9=_0x29b065[_0xd4ce('0x39')](function(_0x101a6c){return{'name':_0x101a6c[_0xd4ce('0xd5')],'basename':_0x101a6c['filename'],'type':_0x101a6c['mimetype'],'ChatOfflineMessageId':_0x4663d3['id']};});_0x128f6a=_0x396ab9['map'](_0x551646=>{var _0x542c0f={'filename':_0x551646[_0xd4ce('0x34')],'path':path['join'](config[_0xd4ce('0x72')],_0xd4ce('0xd6'),_0xd4ce('0xc8'),_0xd4ce('0xd7'),_0xd4ce('0xd8'),_0x551646[_0xd4ce('0xd9')])};return _0x542c0f;});if(!_0x1b815a[_0xd4ce('0xda')]){return db[_0xd4ce('0xdb')][_0xd4ce('0xdc')](function(_0x397976){return db[_0xd4ce('0xdd')][_0xd4ce('0xde')](_0x396ab9,{'transaction':_0x397976});});}}})[_0xd4ce('0x30')](function(){if(_0x18cd9){_0x819a9=_0x18cd9;return db[_0xd4ce('0xcd')][_0xd4ce('0x63')]({'where':{'active':!![]},'include':[{'model':db[_0xd4ce('0xdf')],'as':_0xd4ce('0xe0'),'raw':!![]}]});}})['then'](function(_0x1f5788){if(_0x1f5788&&_0x1f5788[_0xd4ce('0xe0')]&&_0x1b815a[_0xd4ce('0xe1')]&&_0x1b815a[_0xd4ce('0xe2')]){var _0x566dae={'tls':{'rejectUnauthorized':![]}};if(_0x1f5788['Smtp'][_0xd4ce('0xe3')]){_0x566dae[_0xd4ce('0xe3')]=_0x1f5788[_0xd4ce('0xe0')][_0xd4ce('0xe3')];}else{_0x566dae[_0xd4ce('0xe4')]=_0x1f5788[_0xd4ce('0xe0')][_0xd4ce('0xe4')];_0x566dae[_0xd4ce('0xe5')]=_0x1f5788[_0xd4ce('0xe0')][_0xd4ce('0xe5')];_0x566dae[_0xd4ce('0xe6')]=_0x1f5788[_0xd4ce('0xe0')][_0xd4ce('0xe6')];}if(_0x1f5788[_0xd4ce('0xe0')]['authentication']){_0x566dae['auth']={'user':_0x1f5788['Smtp'][_0xd4ce('0x59')],'pass':_0x1f5788[_0xd4ce('0xe0')][_0xd4ce('0xe7')]};}return respondWithRpcPromise(_0xd4ce('0xe8'),'sendMail',{'account':_0x566dae,'message':{'from':util[_0xd4ce('0xb0')](_0xd4ce('0xe9'),_0x1f5788['name'],_0x1f5788[_0xd4ce('0xea')]||_0x1f5788[_0xd4ce('0xe0')][_0xd4ce('0x59')]),'to':_0x1b815a[_0xd4ce('0xe2')],'subject':_0x1b815a['offlineMessageSubject'],'html':_0x819a9['body'],'attachments':_0x128f6a}},client9003)['then'](function(){return _0x819a9;})[_0xd4ce('0x53')](function(_0x617250){console['error'](_0x617250);});}})[_0xd4ce('0x30')](function(){if(_0x1b815a&&_0x1b815a[_0xd4ce('0xda')]&&_0x1b815a[_0xd4ce('0xeb')]){var _0x2c0a81=[];if(_0x29b065[_0xd4ce('0x55')]){_0x2c0a81=_0x29b065[_0xd4ce('0x39')](function(_0x5a2733){return{'name':_0x5a2733['originalname'],'basename':_0x5a2733[_0xd4ce('0x6b')],'type':_0x5a2733[_0xd4ce('0xec')],'ChatOfflineMessageId':_0x18cd9['id']};});}var _0x37db92;if(!_[_0xd4ce('0x75')](_0x1b815a[_0xd4ce('0xed')])){var _0x3ec821=_[_0xd4ce('0x39')](_0x2117a2['body'],function(_0x4b293b){return _0x4b293b;});var _0x2b7ff6=_['toPairsIn'](_0x3ec821)[0x0];var _0x18286c=_[_0xd4ce('0xee')](_0x2b7ff6,function(_0x296dc8){return _0x296dc8;});_0x37db92=_0x18286c[0x1][_0x1b815a[_0xd4ce('0xed')]];}var _0x37870f={'from':_0x4dae87[_0xd4ce('0xea')],'firstName':_0x4dae87[_0xd4ce('0xa8')],'lastName':_0x4dae87[_0xd4ce('0xa9')],'mapKey':'email','message':{'from':_0x4dae87[_0xd4ce('0xea')],'to':_0x1b815a['MailAccount'][_0xd4ce('0xea')],'cc':'','subject':_[_0xd4ce('0x75')](_0x37db92)?_0x1b815a['offlineMessageSubject']:_0x37db92,'messageId':'','sentAt':new Date(),'attach':_0x2c0a81[_0xd4ce('0x55')],'attachments':_0x2c0a81,'originChannel':'Chat','ChatWebsiteId':_0x1b815a['id'],'ChatOfflineMessageId':_0x819a9['id'],'originTo':_0x1b815a[_0xd4ce('0xcd')][_0xd4ce('0xea')]},'body':_0x819a9[_0xd4ce('0x58')]};var _0x5a78e4={'account':{'id':_0x1b815a[_0xd4ce('0xeb')]},'body':_0x37870f,'log':_0xd4ce('0xef')};return respondWithRpcPromise(_0xd4ce('0xef'),_0xd4ce('0xf0'),_0x5a78e4,client9001)['then'](function(){return _0x819a9;})['catch'](function(_0x4971cd){console['error'](_0x4971cd);});}return;})[_0xd4ce('0x30')](function(){if(_0x819a9){return _0x819a9;}})[_0xd4ce('0x30')](respondWithResult(_0x54a642,null))['catch'](function(_0x2e4092){console['error'](_0xd4ce('0x53'),_0x2e4092);for(var _0xb98274 of _0x29b065){var _0x415bfe=path['join'](config[_0xd4ce('0x72')],_0xd4ce('0xd6'),'files',_0xd4ce('0xd7'),'offline-chat',_0xb98274['filename']);fs_extra[_0xd4ce('0xf1')](_0x415bfe)[_0xd4ce('0x53')](function(_0x152b83){console[_0xd4ce('0x21')](_0xd4ce('0xf2'),_0x415bfe,_0x152b83);});}});};exports[_0xd4ce('0xf3')]=function(_0x23dc34,_0x2db601,_0x8d91e9){return db[_0xd4ce('0xb5')][_0xd4ce('0x5f')]({'where':{'id':_0x23dc34['params']['id']}})['then'](handleEntityNotFound(_0x2db601,null))[_0xd4ce('0x30')](function(_0x355e72){if(_0x355e72){return _0x355e72[_0xd4ce('0xf3')](_0x23dc34['body'][_0xd4ce('0x68')],_[_0xd4ce('0xf4')](_0x23dc34[_0xd4ce('0x58')],[_0xd4ce('0x68'),'id'])||{});}})[_0xd4ce('0x30')](respondWithResult(_0x2db601,null))[_0xd4ce('0x53')](handleError(_0x2db601,null));};exports[_0xd4ce('0xf5')]=function(_0x2be085,_0x40f0b8,_0x921239){var _0x33713e={'raw':![],'where':{}};var _0x38a96c={};var _0x24dd51={'count':0x0,'rows':[]};return db[_0xd4ce('0x3a')][_0xd4ce('0x63')]({'where':{'id':_0x2be085['params']['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x40f0b8,null))[_0xd4ce('0x30')](function(_0xa1d65e){if(_0xa1d65e){_0x38a96c[_0xd4ce('0x3e')]=_[_0xd4ce('0x40')](db[_0xd4ce('0xb5')][_0xd4ce('0x3b')]);_0x38a96c[_0xd4ce('0x3f')]=_['keys'](_0x2be085['query']);_0x38a96c[_0xd4ce('0x41')]=_['intersection'](_0x38a96c['model'],_0x38a96c[_0xd4ce('0x3f')]);_0x33713e['attributes']=_[_0xd4ce('0x42')](_0x38a96c[_0xd4ce('0x3e')],qs[_0xd4ce('0x43')](_0x2be085[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x33713e[_0xd4ce('0x44')]=_0x33713e['attributes']['length']?_0x33713e[_0xd4ce('0x44')]:_0x38a96c['model'];if(!_0x2be085[_0xd4ce('0x3f')]['hasOwnProperty']('nolimit')){_0x33713e['limit']=qs[_0xd4ce('0x27')](_0x2be085[_0xd4ce('0x3f')][_0xd4ce('0x27')]);_0x33713e[_0xd4ce('0x29')]=qs[_0xd4ce('0x29')](_0x2be085['query']['offset']);}_0x33713e[_0xd4ce('0x47')]=qs[_0xd4ce('0x48')](_0x2be085['query'][_0xd4ce('0x48')]);_0x33713e[_0xd4ce('0x4b')]=qs[_0xd4ce('0x41')](_['pick'](_0x2be085[_0xd4ce('0x3f')],_0x38a96c['filters']));_0x33713e['where'][_0xd4ce('0x61')]=_0xa1d65e['id'];if(_0x2be085['query'][_0xd4ce('0x4a')]){_0x33713e[_0xd4ce('0x4b')]=_['merge'](_0x33713e[_0xd4ce('0x4b')],{'$or':_[_0xd4ce('0x39')](_0x33713e['attributes'],function(_0x4d30e5){var _0x2d4551={};_0x2d4551[_0x4d30e5]={'$like':'%'+_0x2be085['query'][_0xd4ce('0x4a')]+'%'};return _0x2d4551;})});}_0x33713e=_[_0xd4ce('0x4c')]({},_0x33713e,_0x2be085['options']);return db[_0xd4ce('0xb5')][_0xd4ce('0x28')]({'where':_0x33713e[_0xd4ce('0x4b')]})['then'](function(_0x84e9a){_0x24dd51[_0xd4ce('0x28')]=_0x84e9a;if(_0x2be085['query'][_0xd4ce('0x4f')]){_0x33713e[_0xd4ce('0x50')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xd4ce('0xbf')],'as':_0xd4ce('0xf6'),'attributes':[_0xd4ce('0x34'),_0xd4ce('0xf7'),'internal'],'required':![]},{'model':db[_0xd4ce('0xf8')],'as':'Tags','attributes':['id',_0xd4ce('0x34'),_0xd4ce('0xf9')],'where':_0x2be085[_0xd4ce('0x3f')]['tag']?{'id':_0x2be085['query'][_0xd4ce('0xfa')]}:undefined,'required':_0x2be085['query'][_0xd4ce('0xfa')]?!![]:![]}];}return db[_0xd4ce('0xb5')]['findAll'](_0x33713e);})[_0xd4ce('0x30')](function(_0x5accc5){_0x24dd51['rows']=_0x5accc5;return _0x24dd51;});}})[_0xd4ce('0x30')](respondWithFilteredResult(_0x40f0b8,_0x33713e))['catch'](handleError(_0x40f0b8,null));};function iftimePromise(_0x91795a,_0x369d42){return respondWithRpcPromise(_0xd4ce('0xfb'),_0xd4ce('0xfc'),{'command':_0x369d42[_0xd4ce('0xfd')]?util[_0xd4ce('0xb0')](_0xd4ce('0xfe'),_0x91795a[_0xd4ce('0xff')],_0x369d42['timezone']):util[_0xd4ce('0xb0')](_0xd4ce('0x100'),_0x91795a[_0xd4ce('0xff')])},client9002)['then'](function(_0x2f22b4){var _0xaa2a48=_0x2f22b4&&_0x2f22b4['indexOf']('true')>=0x0?!![]:![];logger[_0xd4ce('0x1c')](_0xd4ce('0x101'),_0x369d42['id'],_0x91795a['id'],_0x91795a['interval'],_0xaa2a48?_0xd4ce('0x102'):'OFFLINE',_0x369d42[_0xd4ce('0xfd')]?_0x369d42[_0xd4ce('0xfd')]:_0xd4ce('0x103'));return _0xaa2a48;})[_0xd4ce('0x53')](function(_0xdd3d5a){logger[_0xd4ce('0x21')](_0xd4ce('0x101'),_0x369d42['id'],_0x91795a['id'],_0x91795a['interval'],util[_0xd4ce('0x104')](_0xdd3d5a,{'showHidden':![],'depth':null}),_0x369d42[_0xd4ce('0xfd')]?_0x369d42[_0xd4ce('0xfd')]:_0xd4ce('0x103'));return![];});}exports[_0xd4ce('0xfc')]=function(_0x4862f5,_0x2765ff,_0x1962d){var _0x35442f=0x0;var _0x405fb6=0x0;var _0x13e67a=![];var _0x484f3b;var _0x4ec70d;return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x4862f5[_0xd4ce('0x54')]['id']},'include':[{'model':db[_0xd4ce('0x105')],'as':_0xd4ce('0x105'),'include':[{'model':db[_0xd4ce('0x105')],'as':_0xd4ce('0x106'),'attributes':['id',_0xd4ce('0xff')],'raw':!![]}]}]})[_0xd4ce('0x30')](handleEntityNotFound(_0x2765ff,null))[_0xd4ce('0x30')](function(_0x16eeed){if(_0x16eeed){_0x484f3b=_0x16eeed;return _0x16eeed[_0xd4ce('0x107')]({'raw':!![]});}})['then'](function(_0xb033a2){if(_0x484f3b){if(_0xb033a2){_0x4ec70d=_0xb033a2;}}return require('../../config/license/util')[_0xd4ce('0x108')]();})['then'](function(_0x5c1ba3){if(_0x5c1ba3){_0x405fb6=_0x5c1ba3[_0xd4ce('0x109')];_0x13e67a=_0x5c1ba3['custom'];}})[_0xd4ce('0x30')](function(){return db[_0xd4ce('0xb5')]['count']({'where':{'closed':![]}});})[_0xd4ce('0x30')](function(_0x45f40a){_0x35442f=_0x45f40a;if(_0x405fb6&&_0x45f40a>_0x405fb6){return db[_0xd4ce('0x10a')][_0xd4ce('0x63')]({'where':{'id':0x1}})['then'](function(_0x226df4){if(_0x226df4){_0x226df4['increment'](_0xd4ce('0x10b'));}});}})['then'](function(){if(_0x484f3b['Interval']&&_0x484f3b['Interval'][_0xd4ce('0x106')]){var _0x925878=[];for(var _0x1fc5fc=0x0;_0x1fc5fc<_0x484f3b[_0xd4ce('0x105')][_0xd4ce('0x106')][_0xd4ce('0x55')];_0x1fc5fc++){var _0x3542d4=_0x484f3b['Interval'][_0xd4ce('0x106')][_0x1fc5fc][_0xd4ce('0x5a')]({'plain':!![]});_0x925878[_0xd4ce('0x10c')](iftimePromise(_0x3542d4,_0x484f3b));}return BPromise['all'](_0x925878)[_0xd4ce('0x30')](function(_0x3fcb35){return _[_0xd4ce('0x10d')](_0x3fcb35);});}else{return!![];}})[_0xd4ce('0x30')](function(_0x26dafb){var _0x35b356=fs[_0xd4ce('0xd0')](path[_0xd4ce('0x77')](config[_0xd4ce('0x72')],'server/files/chat/iframe.ejs'),'utf8');var _0x1b26bd={'remote':_0x484f3b[_0xd4ce('0x10e')],'query':querystring[_0xd4ce('0x20')](_[_0xd4ce('0x4c')](_0x484f3b[_0xd4ce('0x5a')]({'plain':!![]}),{'customerIp':_0x4862f5[_0xd4ce('0x84')][_0xd4ce('0xa5')]||_0x4862f5[_0xd4ce('0x84')][_0xd4ce('0x10f')]||_0x4862f5['connection']['remoteAddress']||_0x4862f5['ip'],'referer':_0x4862f5[_0xd4ce('0x84')][_0xd4ce('0xab')],'openedInteractions':_0x35442f,'maxInteractions':_0x405fb6,'virtual':_0x13e67a['virtual'],'online':_0x26dafb,'custom':_0x13e67a}))['replace'](/'/g,'\x5c\x27')};_0x2765ff[_0xd4ce('0x35')](ejs['render'](Mustache['render'](_0x35b356,_0x1b26bd),{'proactiveActions':_0x4ec70d,'alignment':_0x484f3b['alignment'],'verticalAlignment':_0x484f3b[_0xd4ce('0x110')],'div_color':_0x484f3b[_0xd4ce('0xf9')],'text_color':_0x484f3b[_0xd4ce('0x111')],'button_color':_0x484f3b[_0xd4ce('0x112')],'background_color':_0x484f3b[_0xd4ce('0x113')]}));})[_0xd4ce('0x53')](handleError(_0x2765ff,null));};exports[_0xd4ce('0x114')]=function(_0x14c2bc,_0x128878,_0x204206){return db['ChatWebsite'][_0xd4ce('0x63')]({'where':{'id':_0x14c2bc['params']['id']}})['then'](handleEntityNotFound(_0x128878,null))['then'](function(_0x18d549){if(_0x18d549){return db[_0xd4ce('0xdb')][_0xd4ce('0xdc')](function(_0x297856){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x14c2bc[_0xd4ce('0x54')]['id']},'transaction':_0x297856})[_0xd4ce('0x30')](function(_0x192a70){var _0x1728dc=_[_0xd4ce('0x39')](_0x14c2bc[_0xd4ce('0x58')],function(_0x4f6208){_0x4f6208[_0xd4ce('0x61')]=_0x14c2bc[_0xd4ce('0x54')]['id'];return _0x4f6208;});return db[_0xd4ce('0x98')][_0xd4ce('0xde')](_0x1728dc,{'transaction':_0x297856});});})['then'](function(){return db[_0xd4ce('0x98')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x14c2bc[_0xd4ce('0x54')]['id']},'order':_0xd4ce('0x9f')});});}})[_0xd4ce('0x30')](respondWithResult(_0x128878,null))['catch'](handleError(_0x128878,null));};exports[_0xd4ce('0x115')]=function(_0x2fa51d,_0x9c8bad,_0xf587a2){var _0x4fdc08={};var _0x206edb={};var _0xbfec28;var _0x2cef63;return db[_0xd4ce('0x3a')][_0xd4ce('0x63')]({'where':{'id':_0x2fa51d['params']['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x9c8bad,null))['then'](function(_0xc8905e){if(_0xc8905e){_0xbfec28=_0xc8905e;_0x206edb['model']=_[_0xd4ce('0x40')](db[_0xd4ce('0x98')][_0xd4ce('0x3b')]);_0x206edb['query']=_['keys'](_0x2fa51d[_0xd4ce('0x3f')]);_0x206edb[_0xd4ce('0x41')]=_[_0xd4ce('0x42')](_0x206edb[_0xd4ce('0x3e')],_0x206edb['query']);_0x4fdc08['attributes']=_[_0xd4ce('0x42')](_0x206edb[_0xd4ce('0x3e')],qs['fields'](_0x2fa51d[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x4fdc08['attributes']=_0x4fdc08[_0xd4ce('0x44')][_0xd4ce('0x55')]?_0x4fdc08['attributes']:_0x206edb[_0xd4ce('0x3e')];_0x4fdc08[_0xd4ce('0x47')]=qs[_0xd4ce('0x48')](_0x2fa51d[_0xd4ce('0x3f')][_0xd4ce('0x48')]);_0x4fdc08[_0xd4ce('0x4b')]=qs[_0xd4ce('0x41')](_[_0xd4ce('0x49')](_0x2fa51d[_0xd4ce('0x3f')],_0x206edb[_0xd4ce('0x41')]));if(_0x2fa51d['query'][_0xd4ce('0x4a')]){_0x4fdc08['where']=_[_0xd4ce('0x4c')](_0x4fdc08[_0xd4ce('0x4b')],{'$or':_[_0xd4ce('0x39')](_0x4fdc08[_0xd4ce('0x44')],function(_0x5eba38){var _0x4f2e31={};_0x4f2e31[_0x5eba38]={'$like':'%'+_0x2fa51d[_0xd4ce('0x3f')]['filter']+'%'};return _0x4f2e31;})});}_0x4fdc08=_[_0xd4ce('0x4c')]({},_0x4fdc08,_0x2fa51d['options']);return _0xbfec28[_0xd4ce('0x115')](_0x4fdc08);}})['then'](function(_0x29e914){if(_0x29e914){_0x2cef63=_0x29e914['length'];if(!_0x2fa51d[_0xd4ce('0x3f')][_0xd4ce('0x45')](_0xd4ce('0x46'))){_0x4fdc08[_0xd4ce('0x27')]=qs[_0xd4ce('0x27')](_0x2fa51d[_0xd4ce('0x3f')][_0xd4ce('0x27')]);_0x4fdc08[_0xd4ce('0x29')]=qs[_0xd4ce('0x29')](_0x2fa51d[_0xd4ce('0x3f')][_0xd4ce('0x29')]);}return _0xbfec28[_0xd4ce('0x115')](_0x4fdc08);}})[_0xd4ce('0x30')](function(_0x1b6b10){if(_0x1b6b10){return _0x1b6b10?{'count':_0x2cef63,'rows':_0x1b6b10}:null;}})[_0xd4ce('0x30')](respondWithResult(_0x9c8bad,null))[_0xd4ce('0x53')](handleError(_0x9c8bad,null));};exports['addProactiveActions']=function(_0x1fa49d,_0x352620,_0x316f57){return db['chatProactiveAction'][_0xd4ce('0x5f')]({'where':{'id':_0x1fa49d[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x352620,null))[_0xd4ce('0x30')](function(_0x4f189d){if(_0x4f189d){return _0x4f189d[_0xd4ce('0x116')](_0x1fa49d['body']['ids'],_[_0xd4ce('0xf4')](_0x1fa49d[_0xd4ce('0x58')],[_0xd4ce('0x68'),'id'])||{});}})[_0xd4ce('0x30')](respondWithResult(_0x352620,null))[_0xd4ce('0x53')](handleError(_0x352620,null));};exports[_0xd4ce('0x107')]=function(_0x5ca03b,_0x3ea85b,_0x4cd184){var _0xcc2916={};var _0xc28c45={};var _0x2ef9d4;var _0x31be21;return db[_0xd4ce('0x3a')]['findOne']({'where':{'id':_0x5ca03b[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x3ea85b,null))[_0xd4ce('0x30')](function(_0x55f1f7){if(_0x55f1f7){_0x2ef9d4=_0x55f1f7;_0xc28c45[_0xd4ce('0x3e')]=_[_0xd4ce('0x40')](db[_0xd4ce('0x117')][_0xd4ce('0x3b')]);_0xc28c45[_0xd4ce('0x3f')]=_[_0xd4ce('0x40')](_0x5ca03b[_0xd4ce('0x3f')]);_0xc28c45['filters']=_[_0xd4ce('0x42')](_0xc28c45['model'],_0xc28c45['query']);_0xcc2916['attributes']=_['intersection'](_0xc28c45[_0xd4ce('0x3e')],qs[_0xd4ce('0x43')](_0x5ca03b[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0xcc2916['attributes']=_0xcc2916[_0xd4ce('0x44')][_0xd4ce('0x55')]?_0xcc2916[_0xd4ce('0x44')]:_0xc28c45[_0xd4ce('0x3e')];_0xcc2916[_0xd4ce('0x47')]=qs[_0xd4ce('0x48')](_0x5ca03b[_0xd4ce('0x3f')][_0xd4ce('0x48')]);_0xcc2916[_0xd4ce('0x4b')]=qs['filters'](_[_0xd4ce('0x49')](_0x5ca03b[_0xd4ce('0x3f')],_0xc28c45[_0xd4ce('0x41')]));if(_0x5ca03b[_0xd4ce('0x3f')][_0xd4ce('0x4a')]){_0xcc2916[_0xd4ce('0x4b')]=_['merge'](_0xcc2916[_0xd4ce('0x4b')],{'$or':_[_0xd4ce('0x39')](_0xcc2916[_0xd4ce('0x44')],function(_0x36e276){var _0x480659={};_0x480659[_0x36e276]={'$like':'%'+_0x5ca03b[_0xd4ce('0x3f')][_0xd4ce('0x4a')]+'%'};return _0x480659;})});}_0xcc2916=_[_0xd4ce('0x4c')]({},_0xcc2916,_0x5ca03b[_0xd4ce('0x56')]);return _0x2ef9d4[_0xd4ce('0x107')](_0xcc2916);}})[_0xd4ce('0x30')](function(_0xaa7216){if(_0xaa7216){_0x31be21=_0xaa7216[_0xd4ce('0x55')];if(!_0x5ca03b[_0xd4ce('0x3f')][_0xd4ce('0x45')](_0xd4ce('0x46'))){_0xcc2916[_0xd4ce('0x27')]=qs[_0xd4ce('0x27')](_0x5ca03b[_0xd4ce('0x3f')][_0xd4ce('0x27')]);_0xcc2916[_0xd4ce('0x29')]=qs[_0xd4ce('0x29')](_0x5ca03b['query'][_0xd4ce('0x29')]);}return _0x2ef9d4[_0xd4ce('0x107')](_0xcc2916);}})[_0xd4ce('0x30')](function(_0x3b18b4){if(_0x3b18b4){return _0x3b18b4?{'count':_0x31be21,'rows':_0x3b18b4}:null;}})[_0xd4ce('0x30')](respondWithResult(_0x3ea85b,null))[_0xd4ce('0x53')](handleError(_0x3ea85b,null));};exports[_0xd4ce('0x118')]=function(_0x341388,_0x3e6701,_0x928c22){var _0x3db495=_0x341388['query'][_0xd4ce('0x119')]===_0xd4ce('0x11a')?_0xd4ce('0x11b'):_0xd4ce('0x11c');return db['ChatWebsite'][_0xd4ce('0x5f')]({'attributes':['id',_0x3db495],'where':{'id':_0x341388['params']['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x3e6701,null))[_0xd4ce('0x30')](function(_0x2f3f02){if(_0x2f3f02){var _0x4adf70=_0x2f3f02[_0x3db495];var _0x312b18=_0x4adf70&&_0x4adf70[_0xd4ce('0x11d')]?_0x4adf70['items']:[];_0x3e6701['send']({'fromKey':_[_0xd4ce('0x75')](_0x4adf70['fromKey'])?undefined:_0x4adf70[_0xd4ce('0x11e')],'count':_0x312b18[_0xd4ce('0x55')],'rows':_0x312b18});}})[_0xd4ce('0x53')](handleError(_0x3e6701,null));};exports[_0xd4ce('0x11f')]=function(_0x148831,_0x23d499,_0x3c00ca){var _0x494a76={'raw':![],'where':{}};var _0x3c6b8b={};var _0x18d448={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd4ce('0x63')]({'where':{'id':_0x148831[_0xd4ce('0x54')]['id']}})['then'](handleEntityNotFound(_0x23d499,null))[_0xd4ce('0x30')](function(_0x16e53e){if(_0x16e53e){_0x3c6b8b[_0xd4ce('0x3e')]=_[_0xd4ce('0x40')](db[_0xd4ce('0x120')][_0xd4ce('0x3b')]);_0x3c6b8b['query']=_[_0xd4ce('0x40')](_0x148831[_0xd4ce('0x3f')]);_0x3c6b8b[_0xd4ce('0x41')]=_['intersection'](_0x3c6b8b[_0xd4ce('0x3e')],_0x3c6b8b['query']);_0x494a76[_0xd4ce('0x44')]=_['intersection'](_0x3c6b8b[_0xd4ce('0x3e')],qs['fields'](_0x148831[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x494a76[_0xd4ce('0x44')]=_0x494a76[_0xd4ce('0x44')]['length']?_0x494a76[_0xd4ce('0x44')]:_0x3c6b8b[_0xd4ce('0x3e')];if(!_0x148831[_0xd4ce('0x3f')][_0xd4ce('0x45')](_0xd4ce('0x46'))){_0x494a76[_0xd4ce('0x27')]=qs[_0xd4ce('0x27')](_0x148831[_0xd4ce('0x3f')]['limit']);_0x494a76[_0xd4ce('0x29')]=qs['offset'](_0x148831[_0xd4ce('0x3f')]['offset']);}_0x494a76[_0xd4ce('0x47')]=qs[_0xd4ce('0x48')](_0x148831['query'][_0xd4ce('0x48')]);_0x494a76[_0xd4ce('0x4b')]=qs[_0xd4ce('0x41')](_[_0xd4ce('0x49')](_0x148831[_0xd4ce('0x3f')],_0x3c6b8b[_0xd4ce('0x41')]));_0x494a76[_0xd4ce('0x4b')][_0xd4ce('0x61')]=_0x16e53e['id'];if(_0x148831[_0xd4ce('0x3f')][_0xd4ce('0x4a')]){_0x494a76[_0xd4ce('0x4b')]=_['merge'](_0x494a76[_0xd4ce('0x4b')],{'$or':_[_0xd4ce('0x39')](_0x494a76[_0xd4ce('0x44')],function(_0xf3baa6){var _0x4abe55={};_0x4abe55[_0xf3baa6]={'$like':'%'+_0x148831['query'][_0xd4ce('0x4a')]+'%'};return _0x4abe55;})});}_0x494a76=_[_0xd4ce('0x4c')]({},_0x494a76,_0x148831[_0xd4ce('0x56')]);return db[_0xd4ce('0x120')]['count']({'where':_0x494a76[_0xd4ce('0x4b')]})[_0xd4ce('0x30')](function(_0x1a4cef){_0x18d448[_0xd4ce('0x28')]=_0x1a4cef;if(_0x148831[_0xd4ce('0x3f')][_0xd4ce('0x4f')]){_0x494a76[_0xd4ce('0x50')]=[{'all':!![]}];}else{_0x494a76['include']=[{'model':db[_0xd4ce('0x95')],'as':_0xd4ce('0x121'),'required':![]},{'model':db[_0xd4ce('0xdd')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x494a76);})[_0xd4ce('0x30')](function(_0x2a7ffc){_0x18d448[_0xd4ce('0x52')]=_0x2a7ffc;return _0x18d448;});}})[_0xd4ce('0x30')](respondWithFilteredResult(_0x23d499,_0x494a76))[_0xd4ce('0x53')](handleError(_0x23d499,null));};exports[_0xd4ce('0x122')]=function(_0x25941b,_0x2410ee,_0x238c23){return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x25941b[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x2410ee,null))['then'](function(_0x29ea1f){if(_0x29ea1f){return _0x29ea1f[_0xd4ce('0x122')](_0x25941b[_0xd4ce('0x58')][_0xd4ce('0x68')],_[_0xd4ce('0xf4')](_0x25941b[_0xd4ce('0x58')],[_0xd4ce('0x68'),'id'])||{})[_0xd4ce('0xcf')](function(_0x325c78){for(var _0x3eaed1=0x0;_0x3eaed1<_0x25941b['body'][_0xd4ce('0x68')][_0xd4ce('0x55')];_0x3eaed1+=0x1){socket['emit'](_0xd4ce('0x123'),{'UserId':Number(_0x25941b[_0xd4ce('0x58')]['ids'][_0x3eaed1]),'ChatWebsiteId':Number(_0x25941b['params']['id'])});}return _0x325c78;});}})['then'](respondWithResult(_0x2410ee,null))['catch'](handleError(_0x2410ee,null));};exports[_0xd4ce('0x124')]=function(_0x199fbf,_0x261020,_0x2be6e9){return db[_0xd4ce('0x3a')][_0xd4ce('0x5f')]({'where':{'id':_0x199fbf['params']['id']}})['then'](handleEntityNotFound(_0x261020,null))[_0xd4ce('0x30')](function(_0x1a8fa6){if(_0x1a8fa6){return _0x1a8fa6['removeAgents'](_0x199fbf[_0xd4ce('0x3f')]['ids'])[_0xd4ce('0x30')](function(){if(_['isArray'](_0x199fbf[_0xd4ce('0x3f')]['ids'])){for(var _0x108a4a=0x0;_0x108a4a<_0x199fbf[_0xd4ce('0x3f')][_0xd4ce('0x68')][_0xd4ce('0x55')];_0x108a4a+=0x1){socket[_0xd4ce('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x199fbf['query'][_0xd4ce('0x68')][_0x108a4a]),'ChatWebsiteId':Number(_0x199fbf[_0xd4ce('0x54')]['id'])});}}else{socket['emit'](_0xd4ce('0x126'),{'UserId':Number(_0x199fbf[_0xd4ce('0x3f')]['ids']),'ChatWebsiteId':Number(_0x199fbf[_0xd4ce('0x54')]['id'])});}});}})[_0xd4ce('0x30')](respondWithStatusCode(_0x261020,null))['catch'](handleError(_0x261020,null));};exports['getAgents']=function(_0x46bc64,_0x4b1fcc,_0x348c6c){var _0x35b9c5={};var _0x328e84={};var _0x47c9a3;var _0x43e13f;return db[_0xd4ce('0x3a')][_0xd4ce('0x63')]({'where':{'id':_0x46bc64[_0xd4ce('0x54')]['id']}})[_0xd4ce('0x30')](handleEntityNotFound(_0x4b1fcc,null))['then'](function(_0x34b470){if(_0x34b470){_0x47c9a3=_0x34b470;_0x328e84[_0xd4ce('0x3e')]=_['keys'](db[_0xd4ce('0xbf')]['rawAttributes']);_0x328e84[_0xd4ce('0x3f')]=_['keys'](_0x46bc64['query']);_0x328e84['filters']=_[_0xd4ce('0x42')](_0x328e84[_0xd4ce('0x3e')],_0x328e84['query']);_0x35b9c5['attributes']=_[_0xd4ce('0x42')](_0x328e84[_0xd4ce('0x3e')],qs[_0xd4ce('0x43')](_0x46bc64[_0xd4ce('0x3f')][_0xd4ce('0x43')]));_0x35b9c5[_0xd4ce('0x44')]=_0x35b9c5[_0xd4ce('0x44')][_0xd4ce('0x55')]?_0x35b9c5[_0xd4ce('0x44')]:_0x328e84[_0xd4ce('0x3e')];_0x35b9c5[_0xd4ce('0x47')]=qs['sort'](_0x46bc64[_0xd4ce('0x3f')][_0xd4ce('0x48')]);_0x35b9c5[_0xd4ce('0x4b')]=qs[_0xd4ce('0x41')](_[_0xd4ce('0x49')](_0x46bc64[_0xd4ce('0x3f')],_0x328e84[_0xd4ce('0x41')]));if(_0x46bc64[_0xd4ce('0x3f')][_0xd4ce('0x4a')]){_0x35b9c5['where']=_[_0xd4ce('0x4c')](_0x35b9c5[_0xd4ce('0x4b')],{'$or':_['map'](_0x35b9c5[_0xd4ce('0x44')],function(_0xf372b){var _0x213575={};_0x213575[_0xf372b]={'$like':'%'+_0x46bc64[_0xd4ce('0x3f')][_0xd4ce('0x4a')]+'%'};return _0x213575;})});}_0x35b9c5=_[_0xd4ce('0x4c')]({},_0x35b9c5,_0x46bc64[_0xd4ce('0x56')]);return _0x47c9a3[_0xd4ce('0x127')](_0x35b9c5);}})[_0xd4ce('0x30')](function(_0x2f0e54){if(_0x2f0e54){_0x43e13f=_0x2f0e54[_0xd4ce('0x55')];if(!_0x46bc64[_0xd4ce('0x3f')]['hasOwnProperty'](_0xd4ce('0x46'))){_0x35b9c5[_0xd4ce('0x27')]=qs[_0xd4ce('0x27')](_0x46bc64[_0xd4ce('0x3f')][_0xd4ce('0x27')]);_0x35b9c5['offset']=qs[_0xd4ce('0x29')](_0x46bc64[_0xd4ce('0x3f')][_0xd4ce('0x29')]);}return _0x47c9a3[_0xd4ce('0x127')](_0x35b9c5);}})[_0xd4ce('0x30')](function(_0x39832a){if(_0x39832a){return _0x39832a?{'count':_0x43e13f,'rows':_0x39832a}:null;}})[_0xd4ce('0x30')](respondWithResult(_0x4b1fcc,null))['catch'](handleError(_0x4b1fcc,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 7f9dfe9..2ebc4a9 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 _0x3c6d=['../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3c6d,0x199));var _0xd3c6=function(_0x541162,_0x62b9a9){_0x541162=_0x541162-0x0;var _0x20963b=_0x3c6d[_0x541162];return _0x20963b;};'use strict';var EventEmitter=require(_0xd3c6('0x0'));var ChatWebsite=require(_0xd3c6('0x1'))['db'][_0xd3c6('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd3c6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd3c6('0x4'),'afterDestroy':_0xd3c6('0x5')};function emitEvent(_0x2a3a62){return function(_0x28b706,_0x26c5b9,_0x236c6b){ChatWebsiteEvents['emit'](_0x2a3a62+':'+_0x28b706['id'],_0x28b706);ChatWebsiteEvents[_0xd3c6('0x6')](_0x2a3a62,_0x28b706);_0x236c6b(null);};}for(var e in events){if(events[_0xd3c6('0x7')](e)){var event=events[e];ChatWebsite[_0xd3c6('0x8')](e,emitEvent(event));}}module[_0xd3c6('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa63f=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa63f,0x1b6));var _0xfa63=function(_0x3c04d7,_0x472801){_0x3c04d7=_0x3c04d7-0x0;var _0x2fb24=_0xa63f[_0x3c04d7];return _0x2fb24;};'use strict';var EventEmitter=require(_0xfa63('0x0'));var ChatWebsite=require(_0xfa63('0x1'))['db'][_0xfa63('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xfa63('0x3')](0x0);var events={'afterCreate':_0xfa63('0x4'),'afterUpdate':_0xfa63('0x5'),'afterDestroy':_0xfa63('0x6')};function emitEvent(_0x402b13){return function(_0x37e644,_0x138518,_0x581d1f){ChatWebsiteEvents['emit'](_0x402b13+':'+_0x37e644['id'],_0x37e644);ChatWebsiteEvents[_0xfa63('0x7')](_0x402b13,_0x37e644);_0x581d1f(null);};}for(var e in events){if(events[_0xfa63('0x8')](e)){var event=events[e];ChatWebsite[_0xfa63('0x9')](e,emitEvent(event));}}module[_0xfa63('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 27b8195..cbd9554 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 _0x82e4=['ChatWebsite','chat_websites','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x82e4,0x14c));var _0x482e=function(_0x45ae0d,_0x1ea3b9){_0x45ae0d=_0x45ae0d-0x0;var _0x371826=_0x82e4[_0x45ae0d];return _0x371826;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x482e('0x0'))(_0x482e('0x1'));var moment=require(_0x482e('0x2'));var BPromise=require(_0x482e('0x3'));var rp=require(_0x482e('0x4'));var fs=require('fs');var path=require(_0x482e('0x5'));var rimraf=require(_0x482e('0x6'));var config=require(_0x482e('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x482e('0x8')]=function(_0x1fcaf6,_0x922db9){return _0x1fcaf6['define'](_0x482e('0x9'),attributes,{'tableName':_0x482e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12cb=['exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','request-promise','path','../../config/environment','./chatWebsite.attributes'];(function(_0x3b1502,_0xa23e9d){var _0x1c8537=function(_0x3c05f1){while(--_0x3c05f1){_0x3b1502['push'](_0x3b1502['shift']());}};_0x1c8537(++_0xa23e9d);}(_0x12cb,0x67));var _0xb12c=function(_0x372aeb,_0x436ed1){_0x372aeb=_0x372aeb-0x0;var _0x31343d=_0x12cb[_0x372aeb];return _0x31343d;};'use strict';var _=require(_0xb12c('0x0'));var util=require(_0xb12c('0x1'));var logger=require(_0xb12c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb12c('0x3'));var fs=require('fs');var path=require(_0xb12c('0x4'));var rimraf=require('rimraf');var config=require(_0xb12c('0x5'));var attributes=require(_0xb12c('0x6'));module[_0xb12c('0x7')]=function(_0x50a308,_0x165670){return _0x50a308[_0xb12c('0x8')](_0xb12c('0x9'),attributes,{'tableName':_0xb12c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 16e2b55..28b8d88 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 _0xf1c8=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x56d850,_0xc4a37f){var _0x22296c=function(_0x2c22e5){while(--_0x2c22e5){_0x56d850['push'](_0x56d850['shift']());}};_0x22296c(++_0xc4a37f);}(_0xf1c8,0x75));var _0x8f1c=function(_0x3861f4,_0x3ad84d){_0x3861f4=_0x3861f4-0x0;var _0x122cd1=_0xf1c8[_0x3861f4];return _0x122cd1;};'use strict';var _=require(_0x8f1c('0x0'));var util=require(_0x8f1c('0x1'));var moment=require(_0x8f1c('0x2'));var BPromise=require(_0x8f1c('0x3'));var rs=require(_0x8f1c('0x4'));var fs=require('fs');var Redis=require(_0x8f1c('0x5'));var db=require(_0x8f1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f1c('0x7'))(_0x8f1c('0x8'));var config=require(_0x8f1c('0x9'));var jayson=require(_0x8f1c('0xa'));var client=jayson[_0x8f1c('0xb')][_0x8f1c('0xc')]({'port':0x232a});config[_0x8f1c('0xd')]=_['defaults'](config[_0x8f1c('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f1c('0xd')]));require(_0x8f1c('0xe'))[_0x8f1c('0xf')](socket);function respondWithRpcPromise(_0xe372f9,_0x133a52,_0x51e43b){return new BPromise(function(_0x26180d,_0x3be7b4){return client[_0x8f1c('0x10')](_0xe372f9,_0x51e43b)[_0x8f1c('0x11')](function(_0x1d1236){logger[_0x8f1c('0x12')](_0x8f1c('0x13'),_0x133a52,'request\x20sent');logger[_0x8f1c('0x14')](_0x8f1c('0x15'),_0x133a52,_0x8f1c('0x16'),JSON['stringify'](_0x1d1236));if(_0x1d1236[_0x8f1c('0x17')]){if(_0x1d1236[_0x8f1c('0x17')][_0x8f1c('0x18')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x133a52,_0x1d1236['error']['message']);return _0x3be7b4(_0x1d1236['error']['message']);}logger['error'](_0x8f1c('0x13'),_0x133a52,_0x1d1236['error'][_0x8f1c('0x19')]);return _0x26180d(_0x1d1236[_0x8f1c('0x17')]['message']);}else{logger[_0x8f1c('0x12')](_0x8f1c('0x13'),_0x133a52,'request\x20sent');_0x26180d(_0x1d1236[_0x8f1c('0x1a')][_0x8f1c('0x19')]);}})[_0x8f1c('0x1b')](function(_0xb87575){logger[_0x8f1c('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x133a52,_0xb87575);_0x3be7b4(_0xb87575);});});}
\ No newline at end of file
+var _0xca6f=['localhost','./chatWebsite.socket','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','ChatWebsite,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5f42f1,_0x956be5){var _0x5534ee=function(_0x532333){while(--_0x532333){_0x5f42f1['push'](_0x5f42f1['shift']());}};_0x5534ee(++_0x956be5);}(_0xca6f,0xe5));var _0xfca6=function(_0x333463,_0x4326b5){_0x333463=_0x333463-0x0;var _0x1464ca=_0xca6f[_0x333463];return _0x1464ca;};'use strict';var _=require('lodash');var util=require(_0xfca6('0x0'));var moment=require(_0xfca6('0x1'));var BPromise=require(_0xfca6('0x2'));var rs=require(_0xfca6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfca6('0x4'))['db'];var utils=require(_0xfca6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfca6('0x6'));var jayson=require(_0xfca6('0x7'));var client=jayson[_0xfca6('0x8')][_0xfca6('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfca6('0xa')],{'host':_0xfca6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfca6('0xa')]));require(_0xfca6('0xc'))['register'](socket);function respondWithRpcPromise(_0x116b1b,_0x4ecc33,_0x3dfcad){return new BPromise(function(_0x2cc261,_0x3ddaba){return client['request'](_0x116b1b,_0x3dfcad)[_0xfca6('0xd')](function(_0x1ac504){logger[_0xfca6('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x4ecc33,_0xfca6('0xf'));logger[_0xfca6('0x10')](_0xfca6('0x11'),_0x4ecc33,_0xfca6('0xf'),JSON[_0xfca6('0x12')](_0x1ac504));if(_0x1ac504['error']){if(_0x1ac504['error'][_0xfca6('0x13')]===0x1f4){logger['error'](_0xfca6('0x14'),_0x4ecc33,_0x1ac504[_0xfca6('0x15')][_0xfca6('0x16')]);return _0x3ddaba(_0x1ac504[_0xfca6('0x15')][_0xfca6('0x16')]);}logger[_0xfca6('0x15')](_0xfca6('0x14'),_0x4ecc33,_0x1ac504[_0xfca6('0x15')]['message']);return _0x2cc261(_0x1ac504['error'][_0xfca6('0x16')]);}else{logger[_0xfca6('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x4ecc33,_0xfca6('0xf'));_0x2cc261(_0x1ac504[_0xfca6('0x17')][_0xfca6('0x16')]);}})['catch'](function(_0x475511){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4ecc33,_0x475511);_0x3ddaba(_0x475511);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 4f77f07..39b81a4 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 _0x153d=['remove','update','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x4b3970,_0x8fa714){var _0x24d3d9=function(_0x74da43){while(--_0x74da43){_0x4b3970['push'](_0x4b3970['shift']());}};_0x24d3d9(++_0x8fa714);}(_0x153d,0xf4));var _0xd153=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x153d[_0x167cc1];return _0x10bc4b;};'use strict';var ChatWebsiteEvents=require(_0xd153('0x0'));var events=[_0xd153('0x1'),_0xd153('0x2'),_0xd153('0x3')];function createListener(_0x300a46,_0xbf70de){return function(_0x3d7b25){_0xbf70de['emit'](_0x300a46,_0x3d7b25);};}function removeListener(_0x375775,_0x291955){return function(){ChatWebsiteEvents['removeListener'](_0x375775,_0x291955);};}exports['register']=function(_0x4e0f5e){for(var _0x38d245=0x0,_0x82be70=events[_0xd153('0x4')];_0x38d245<_0x82be70;_0x38d245++){var _0x7cb943=events[_0x38d245];var _0x1df5e5=createListener(_0xd153('0x5')+_0x7cb943,_0x4e0f5e);ChatWebsiteEvents['on'](_0x7cb943,_0x1df5e5);}};
\ No newline at end of file
+var _0x6e3e=['./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6e3e,0x132));var _0xe6e3=function(_0xf5671b,_0x1a9685){_0xf5671b=_0xf5671b-0x0;var _0xc4e591=_0x6e3e[_0xf5671b];return _0xc4e591;};'use strict';var ChatWebsiteEvents=require(_0xe6e3('0x0'));var events=[_0xe6e3('0x1'),_0xe6e3('0x2'),'update'];function createListener(_0x5a36aa,_0xab1058){return function(_0xdcf153){_0xab1058[_0xe6e3('0x3')](_0x5a36aa,_0xdcf153);};}function removeListener(_0x2fbcbf,_0x1454c0){return function(){ChatWebsiteEvents[_0xe6e3('0x4')](_0x2fbcbf,_0x1454c0);};}exports[_0xe6e3('0x5')]=function(_0x3b1de7){for(var _0x1d84b3=0x0,_0x20938a=events['length'];_0x1d84b3<_0x20938a;_0x1d84b3++){var _0x35af53=events[_0x1d84b3];var _0x1a7111=createListener('chatWebsite:'+_0x35af53,_0x3b1de7);ChatWebsiteEvents['on'](_0x35af53,_0x1a7111);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 4e2a1b1..f0ea0d2 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 _0xb9a1=['/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','%s-%s','now','single','file','addLogo','originalname','addAvatar','addCustomerAvatar','server/files/images/avatars/','format','server/files','attachments','offline-chat','ensureDir','replace','any','/:id/interactions','addInteraction','addApplications','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb9a1,0x172));var _0x1b9a=function(_0x40f5cf,_0x2cbccb){_0x40f5cf=_0x40f5cf-0x0;var _0x1981e6=_0xb9a1[_0x40f5cf];return _0x1981e6;};'use strict';var multer=require(_0x1b9a('0x0'));var util=require('util');var path=require(_0x1b9a('0x1'));var timeout=require(_0x1b9a('0x2'));var express=require(_0x1b9a('0x3'));var router=express[_0x1b9a('0x4')]();var fs_extra=require(_0x1b9a('0x5'));var auth=require(_0x1b9a('0x6'));var interaction=require(_0x1b9a('0x7'));var config=require(_0x1b9a('0x8'));var controller=require(_0x1b9a('0x9'));router['get']('/',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0xb')]);router[_0x1b9a('0xc')]('/describe',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0xd')]);router['get'](_0x1b9a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1b9a('0xc')](_0x1b9a('0xf'),auth['isAuthenticated'](),controller[_0x1b9a('0x10')]);router['get']('/:id/canned_answers',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x11')]);router[_0x1b9a('0xc')]('/:id/logo',controller[_0x1b9a('0x12')]);router['get'](_0x1b9a('0x13'),controller['getAvatar']);router[_0x1b9a('0xc')](_0x1b9a('0x14'),controller[_0x1b9a('0x15')]);router[_0x1b9a('0xc')](_0x1b9a('0x16'),controller[_0x1b9a('0x17')]);router[_0x1b9a('0xc')]('/:id/interactions',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x18')]);router[_0x1b9a('0xc')]('/:id/snippet',controller[_0x1b9a('0x19')]);router[_0x1b9a('0xc')](_0x1b9a('0x1a'),auth[_0x1b9a('0xa')](),controller['getApplications']);router[_0x1b9a('0xc')](_0x1b9a('0x1b'),auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x1c')]);router[_0x1b9a('0xc')](_0x1b9a('0x1d'),controller['getFields']);router[_0x1b9a('0xc')]('/:id/offline_messages',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x1e')]);router[_0x1b9a('0xc')]('/:id/users',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x1f')]);router['post']('/',auth[_0x1b9a('0xa')](),controller['create']);router[_0x1b9a('0x20')](_0x1b9a('0xf'),auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x21')]);router['post'](_0x1b9a('0x22'),auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x23')]);var upload=multer({'storage':multer[_0x1b9a('0x24')]({'destination':function(_0x1e473f,_0x1ae387,_0x4c9e5b){_0x4c9e5b(null,path[_0x1b9a('0x25')](config[_0x1b9a('0x26')],'server/files/images/logos/'));},'filename':function(_0x359046,_0x573b04,_0x75c530){_0x75c530(null,util['format'](_0x1b9a('0x27'),Date[_0x1b9a('0x28')](),_0x573b04['originalname']));}})});router[_0x1b9a('0x20')]('/:id/logo',upload[_0x1b9a('0x29')](_0x1b9a('0x2a')),controller[_0x1b9a('0x2b')]);var upload=multer({'storage':multer[_0x1b9a('0x24')]({'destination':function(_0x4613fd,_0x273b05,_0x154e0b){_0x154e0b(null,path[_0x1b9a('0x25')](config[_0x1b9a('0x26')],'server/files/images/avatars/'));},'filename':function(_0x57d5f1,_0x4b05ec,_0x4a72ff){_0x4a72ff(null,util['format'](_0x1b9a('0x27'),Date['now'](),_0x4b05ec[_0x1b9a('0x2c')]));}})});router['post'](_0x1b9a('0x13'),upload[_0x1b9a('0x29')]('file'),controller[_0x1b9a('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4197ab,_0x2791de,_0x125310){_0x125310(null,path['join'](config[_0x1b9a('0x26')],'server/files/images/avatars/'));},'filename':function(_0x439d4a,_0x4efc44,_0x2ddf32){_0x2ddf32(null,util['format'](_0x1b9a('0x27'),Date[_0x1b9a('0x28')](),_0x4efc44[_0x1b9a('0x2c')]));}})});router['post'](_0x1b9a('0x14'),upload[_0x1b9a('0x29')](_0x1b9a('0x2a')),controller[_0x1b9a('0x2e')]);var upload=multer({'storage':multer[_0x1b9a('0x24')]({'destination':function(_0x296542,_0x17ab01,_0x1c400c){_0x1c400c(null,path[_0x1b9a('0x25')](config[_0x1b9a('0x26')],_0x1b9a('0x2f')));},'filename':function(_0x364efe,_0x5dafee,_0x2683e7){_0x2683e7(null,util[_0x1b9a('0x30')](_0x1b9a('0x27'),Date['now'](),_0x5dafee[_0x1b9a('0x2c')]));}})});router['post'](_0x1b9a('0x16'),upload[_0x1b9a('0x29')]('file'),controller['addSystemAvatar']);router['post']('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x1b9a('0x24')]({'destination':function(_0x51b2d0,_0x6482c,_0x427865){const _0x518569=path['join'](config[_0x1b9a('0x26')],_0x1b9a('0x31'),_0x1b9a('0x32'),_0x1b9a('0x33'));fs_extra[_0x1b9a('0x34')](_0x518569,function(){_0x427865(null,_0x518569);});},'filename':function(_0x3dcc88,_0x35751a,_0x9f4da){const _0x4bf86e=_0x35751a[_0x1b9a('0x2c')][_0x1b9a('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2fe7a7=path['extname'](_0x4bf86e);const _0x47e97f=Date[_0x1b9a('0x28')]()+'-'+_0x4bf86e[_0x1b9a('0x35')](_0x2fe7a7,'')+_0x2fe7a7;_0x9f4da(null,_0x47e97f);}})});router[_0x1b9a('0x20')]('/:id/offline',offlineUploadMulter[_0x1b9a('0x36')](),controller['offline']);router[_0x1b9a('0x20')](_0x1b9a('0x37'),auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x38')]);router[_0x1b9a('0x20')](_0x1b9a('0x1a'),auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x39')]);router['post'](_0x1b9a('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x1b9a('0xa')](),controller['addAgents']);router[_0x1b9a('0x3a')](_0x1b9a('0xe'),auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x3b')]);router[_0x1b9a('0x3c')](_0x1b9a('0xe'),auth['isAuthenticated'](),controller[_0x1b9a('0x3d')]);router['delete'](_0x1b9a('0xf'),auth[_0x1b9a('0xa')](),controller['removeDispositions']);router[_0x1b9a('0x3c')]('/:id/canned_answers',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x3e')]);router[_0x1b9a('0x3c')]('/:id/users',auth[_0x1b9a('0xa')](),controller[_0x1b9a('0x3f')]);module[_0x1b9a('0x40')]=router;
\ No newline at end of file
+var _0xaba9=['getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/users','getAgents','post','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addCustomerAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','/:id/proactive_actions','addProactiveActions','put','/:id','update','delete','removeAnswers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar'];(function(_0x3d60f2,_0x42ed21){var _0x33231c=function(_0x1c1152){while(--_0x1c1152){_0x3d60f2['push'](_0x3d60f2['shift']());}};_0x33231c(++_0x42ed21);}(_0xaba9,0xad));var _0x9aba=function(_0x11b6ef,_0x35dad0){_0x11b6ef=_0x11b6ef-0x0;var _0x4aab6a=_0xaba9[_0x11b6ef];return _0x4aab6a;};'use strict';var multer=require(_0x9aba('0x0'));var util=require(_0x9aba('0x1'));var path=require(_0x9aba('0x2'));var timeout=require(_0x9aba('0x3'));var express=require('express');var router=express[_0x9aba('0x4')]();var fs_extra=require(_0x9aba('0x5'));var auth=require(_0x9aba('0x6'));var interaction=require(_0x9aba('0x7'));var config=require(_0x9aba('0x8'));var controller=require('./chatWebsite.controller');router[_0x9aba('0x9')]('/',auth[_0x9aba('0xa')](),controller[_0x9aba('0xb')]);router['get']('/describe',auth[_0x9aba('0xa')](),controller[_0x9aba('0xc')]);router[_0x9aba('0x9')]('/:id',auth[_0x9aba('0xa')](),controller[_0x9aba('0xd')]);router[_0x9aba('0x9')](_0x9aba('0xe'),auth['isAuthenticated'](),controller[_0x9aba('0xf')]);router['get'](_0x9aba('0x10'),auth[_0x9aba('0xa')](),controller[_0x9aba('0x11')]);router[_0x9aba('0x9')](_0x9aba('0x12'),controller[_0x9aba('0x13')]);router['get'](_0x9aba('0x14'),controller[_0x9aba('0x15')]);router[_0x9aba('0x9')](_0x9aba('0x16'),controller[_0x9aba('0x17')]);router[_0x9aba('0x9')](_0x9aba('0x18'),controller[_0x9aba('0x19')]);router['get']('/:id/interactions',auth[_0x9aba('0xa')](),controller['getInteractions']);router[_0x9aba('0x9')](_0x9aba('0x1a'),controller[_0x9aba('0x1b')]);router[_0x9aba('0x9')](_0x9aba('0x1c'),auth[_0x9aba('0xa')](),controller[_0x9aba('0x1d')]);router[_0x9aba('0x9')]('/:id/proactive_actions',auth[_0x9aba('0xa')](),controller[_0x9aba('0x1e')]);router['get']('/:id/fields',controller[_0x9aba('0x1f')]);router['get']('/:id/offline_messages',auth[_0x9aba('0xa')](),controller['getOfflineMessages']);router[_0x9aba('0x9')](_0x9aba('0x20'),auth['isAuthenticated'](),controller[_0x9aba('0x21')]);router['post']('/',auth[_0x9aba('0xa')](),controller['create']);router['post'](_0x9aba('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x9aba('0x22')](_0x9aba('0x10'),auth[_0x9aba('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x9aba('0x23')]({'destination':function(_0x191bab,_0x320cce,_0x35e119){_0x35e119(null,path[_0x9aba('0x24')](config[_0x9aba('0x25')],_0x9aba('0x26')));},'filename':function(_0x41dd36,_0x1f0d6f,_0x75c3b0){_0x75c3b0(null,util[_0x9aba('0x27')]('%s-%s',Date[_0x9aba('0x28')](),_0x1f0d6f[_0x9aba('0x29')]));}})});router[_0x9aba('0x22')](_0x9aba('0x12'),upload[_0x9aba('0x2a')](_0x9aba('0x2b')),controller[_0x9aba('0x2c')]);var upload=multer({'storage':multer[_0x9aba('0x23')]({'destination':function(_0x496ab0,_0x531f12,_0x1f4f57){_0x1f4f57(null,path[_0x9aba('0x24')](config[_0x9aba('0x25')],_0x9aba('0x2d')));},'filename':function(_0x3f5057,_0x57f5b0,_0x16f6eb){_0x16f6eb(null,util[_0x9aba('0x27')](_0x9aba('0x2e'),Date['now'](),_0x57f5b0[_0x9aba('0x29')]));}})});router['post'](_0x9aba('0x14'),upload[_0x9aba('0x2a')](_0x9aba('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a9c31,_0x3325a9,_0x2fee91){_0x2fee91(null,path['join'](config[_0x9aba('0x25')],_0x9aba('0x2d')));},'filename':function(_0x12ae03,_0x9984f6,_0x41f7ea){_0x41f7ea(null,util[_0x9aba('0x27')](_0x9aba('0x2e'),Date[_0x9aba('0x28')](),_0x9984f6['originalname']));}})});router['post'](_0x9aba('0x16'),upload[_0x9aba('0x2a')](_0x9aba('0x2b')),controller[_0x9aba('0x2f')]);var upload=multer({'storage':multer[_0x9aba('0x23')]({'destination':function(_0x2abff2,_0x250f89,_0x4d073d){_0x4d073d(null,path['join'](config['root'],_0x9aba('0x2d')));},'filename':function(_0x230210,_0x33c982,_0x4e5328){_0x4e5328(null,util['format'](_0x9aba('0x2e'),Date[_0x9aba('0x28')](),_0x33c982[_0x9aba('0x29')]));}})});router[_0x9aba('0x22')]('/:id/system_avatar',upload[_0x9aba('0x2a')](_0x9aba('0x2b')),controller['addSystemAvatar']);router['post'](_0x9aba('0x30'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x9aba('0x23')]({'destination':function(_0x36fa60,_0x1ecec7,_0x4c3493){const _0x44ad4d=path[_0x9aba('0x24')](config[_0x9aba('0x25')],_0x9aba('0x31'),_0x9aba('0x32'),_0x9aba('0x33'));fs_extra[_0x9aba('0x34')](_0x44ad4d,function(){_0x4c3493(null,_0x44ad4d);});},'filename':function(_0x140363,_0x534444,_0x3debf7){const _0x4e874d=_0x534444[_0x9aba('0x29')][_0x9aba('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x200e0f=path[_0x9aba('0x36')](_0x4e874d);const _0x2cb744=Date[_0x9aba('0x28')]()+'-'+_0x4e874d[_0x9aba('0x35')](_0x200e0f,'')+_0x200e0f;_0x3debf7(null,_0x2cb744);}})});router[_0x9aba('0x22')](_0x9aba('0x37'),offlineUploadMulter[_0x9aba('0x38')](),controller['offline']);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x9aba('0x39')]);router[_0x9aba('0x22')](_0x9aba('0x1c'),auth[_0x9aba('0xa')](),controller['addApplications']);router[_0x9aba('0x22')](_0x9aba('0x3a'),auth[_0x9aba('0xa')](),controller[_0x9aba('0x3b')]);router['post'](_0x9aba('0x20'),auth[_0x9aba('0xa')](),controller['addAgents']);router[_0x9aba('0x3c')](_0x9aba('0x3d'),auth['isAuthenticated'](),controller[_0x9aba('0x3e')]);router[_0x9aba('0x3f')]('/:id',auth[_0x9aba('0xa')](),controller['destroy']);router[_0x9aba('0x3f')](_0x9aba('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x9aba('0x10'),auth[_0x9aba('0xa')](),controller[_0x9aba('0x40')]);router[_0x9aba('0x3f')](_0x9aba('0x20'),auth[_0x9aba('0xa')](),controller['removeAgents']);module[_0x9aba('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 09b9791..6a11ca7 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 _0x4677=['AmazonAWS','sequelize','STRING','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4677,0x155));var _0x7467=function(_0x7582fa,_0x4303cc){_0x7582fa=_0x7582fa-0x0;var _0x2fec3a=_0x4677[_0x7582fa];return _0x2fec3a;};'use strict';var Sequelize=require(_0x7467('0x0'));module['exports']={'name':{'type':Sequelize[_0x7467('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7467('0x2')](_0x7467('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x7467('0x1')]},'data2':{'type':Sequelize[_0x7467('0x1')]}};
\ No newline at end of file
+var _0xbc48=['STRING','ENUM','Google','sequelize','exports'];(function(_0x22c3ab,_0x47a1ee){var _0x21a963=function(_0x11a6d5){while(--_0x11a6d5){_0x22c3ab['push'](_0x22c3ab['shift']());}};_0x21a963(++_0x47a1ee);}(_0xbc48,0x111));var _0x8bc4=function(_0x32245b,_0x7bdba2){_0x32245b=_0x32245b-0x0;var _0x2b0e9f=_0xbc48[_0x32245b];return _0x2b0e9f;};'use strict';var Sequelize=require(_0x8bc4('0x0'));module[_0x8bc4('0x1')]={'name':{'type':Sequelize[_0x8bc4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8bc4('0x3')]('AmazonAWS',_0x8bc4('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8bc4('0x2')]},'data2':{'type':Sequelize[_0x8bc4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index a0b5d39..81918a1 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2f235f,_0x80f23){var _0x31351c=function(_0x20b102){while(--_0x20b102){_0x2f235f['push'](_0x2f235f['shift']());}};_0x31351c(++_0x80f23);}(_0x2ef3,0xba));var _0x32ef=function(_0x3a9e01,_0x480a68){_0x3a9e01=_0x3a9e01-0x0;var _0x22e3ab=_0x2ef3[_0x3a9e01];return _0x22e3ab;};'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'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,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(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c396c,_0x4db177){_0x2c396c=_0x2c396c-0x0;var _0x26219b=_0x5f2f[_0x2c396c];return _0x26219b;};'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 b909a58..c023b29 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 _0xda13=['exports','define','CloudProvider','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xda13,0x1e3));var _0x3da1=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0xda13[_0x2967c1];return _0x103397;};'use strict';var _=require(_0x3da1('0x0'));var util=require(_0x3da1('0x1'));var logger=require(_0x3da1('0x2'))('api');var moment=require(_0x3da1('0x3'));var BPromise=require(_0x3da1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3da1('0x5'));var rimraf=require(_0x3da1('0x6'));var config=require(_0x3da1('0x7'));var attributes=require(_0x3da1('0x8'));module[_0x3da1('0x9')]=function(_0x508860,_0x4a4f21){return _0x508860[_0x3da1('0xa')](_0x3da1('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3dd9=['exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes'];(function(_0x1ffd78,_0x11af73){var _0x3aa3a5=function(_0x32dcdc){while(--_0x32dcdc){_0x1ffd78['push'](_0x1ffd78['shift']());}};_0x3aa3a5(++_0x11af73);}(_0x3dd9,0x1f1));var _0x93dd=function(_0x42e723,_0x503e9b){_0x42e723=_0x42e723-0x0;var _0x1045ff=_0x3dd9[_0x42e723];return _0x1045ff;};'use strict';var _=require(_0x93dd('0x0'));var util=require(_0x93dd('0x1'));var logger=require(_0x93dd('0x2'))(_0x93dd('0x3'));var moment=require(_0x93dd('0x4'));var BPromise=require(_0x93dd('0x5'));var rp=require(_0x93dd('0x6'));var fs=require('fs');var path=require(_0x93dd('0x7'));var rimraf=require('rimraf');var config=require(_0x93dd('0x8'));var attributes=require(_0x93dd('0x9'));module[_0x93dd('0xa')]=function(_0x9fec0e,_0x2c744c){return _0x9fec0e['define'](_0x93dd('0xb'),attributes,{'tableName':_0x93dd('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 9a93b07..ff134e9 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 _0xfff0=['../../config/environment','client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3c1bc0,_0x2597ac){var _0x5c41be=function(_0xc62b2b){while(--_0xc62b2b){_0x3c1bc0['push'](_0x3c1bc0['shift']());}};_0x5c41be(++_0x2597ac);}(_0xfff0,0x139));var _0x0fff=function(_0x7478da,_0x12bcf3){_0x7478da=_0x7478da-0x0;var _0x2f2f67=_0xfff0[_0x7478da];return _0x2f2f67;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('CloudProvider,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}
\ No newline at end of file
+var _0x4c4a=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x25d368,_0x59e491){_0x25d368=_0x25d368-0x0;var _0x1c6fc7=_0x4c4a[_0x25d368];return _0x1c6fc7;};'use strict';var _=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var moment=require(_0xa4c4('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4c4('0x3'));var fs=require('fs');var Redis=require(_0xa4c4('0x4'));var db=require(_0xa4c4('0x5'))['db'];var utils=require(_0xa4c4('0x6'));var logger=require('../../config/logger')(_0xa4c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xa4c4('0x8'));var client=jayson[_0xa4c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557596,_0x11b498,_0x553525){return new BPromise(function(_0x27b877,_0x118d89){return client[_0xa4c4('0xa')](_0x557596,_0x553525)['then'](function(_0x5ec64c){logger[_0xa4c4('0xb')](_0xa4c4('0xc'),_0x11b498,_0xa4c4('0xd'));logger[_0xa4c4('0xe')](_0xa4c4('0xf'),_0x11b498,'request\x20sent',JSON[_0xa4c4('0x10')](_0x5ec64c));if(_0x5ec64c['error']){if(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x12')]===0x1f4){logger[_0xa4c4('0x11')](_0xa4c4('0xc'),_0x11b498,_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);return _0x118d89(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);}logger[_0xa4c4('0x11')]('CloudProvider,\x20%s,\x20%s',_0x11b498,_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);return _0x27b877(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);}else{logger[_0xa4c4('0xb')](_0xa4c4('0xc'),_0x11b498,_0xa4c4('0xd'));_0x27b877(_0x5ec64c['result'][_0xa4c4('0x13')]);}})[_0xa4c4('0x14')](function(_0x4b2f2d){logger[_0xa4c4('0x11')](_0xa4c4('0xc'),_0x11b498,_0x4b2f2d);_0x118d89(_0x4b2f2d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 9c0b2b6..239414d 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 _0x1f3c=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','get','index','isAuthenticated','show'];(function(_0x15e581,_0x309af2){var _0x4d01e2=function(_0x18b658){while(--_0x18b658){_0x15e581['push'](_0x15e581['shift']());}};_0x4d01e2(++_0x309af2);}(_0x1f3c,0xd7));var _0xc1f3=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x1f3c[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0xc1f3('0x0'));var util=require(_0xc1f3('0x1'));var path=require(_0xc1f3('0x2'));var timeout=require(_0xc1f3('0x3'));var express=require(_0xc1f3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cloudProvider.controller');router[_0xc1f3('0x5')]('/',auth['isAuthenticated'](),controller[_0xc1f3('0x6')]);router[_0xc1f3('0x5')]('/:id',auth[_0xc1f3('0x7')](),controller[_0xc1f3('0x8')]);router['post']('/',auth[_0xc1f3('0x7')](),controller[_0xc1f3('0x9')]);router[_0xc1f3('0xa')](_0xc1f3('0xb'),auth[_0xc1f3('0x7')](),controller[_0xc1f3('0xc')]);router[_0xc1f3('0xd')](_0xc1f3('0xb'),auth[_0xc1f3('0x7')](),controller[_0xc1f3('0xe')]);module[_0xc1f3('0xf')]=router;
\ No newline at end of file
+var _0xd8a5=['connect-timeout','Router','fs-extra','../../components/interaction/service','./cloudProvider.controller','isAuthenticated','get','/:id','post','put','destroy','exports','multer'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0xd8a5,0x81));var _0x5d8a=function(_0x3dd948,_0x3b51b1){_0x3dd948=_0x3dd948-0x0;var _0x591a50=_0xd8a5[_0x3dd948];return _0x591a50;};'use strict';var multer=require(_0x5d8a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5d8a('0x1'));var express=require('express');var router=express[_0x5d8a('0x2')]();var fs_extra=require(_0x5d8a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5d8a('0x4'));var config=require('../../config/environment');var controller=require(_0x5d8a('0x5'));router['get']('/',auth[_0x5d8a('0x6')](),controller['index']);router[_0x5d8a('0x7')](_0x5d8a('0x8'),auth[_0x5d8a('0x6')](),controller['show']);router[_0x5d8a('0x9')]('/',auth[_0x5d8a('0x6')](),controller['create']);router[_0x5d8a('0xa')](_0x5d8a('0x8'),auth[_0x5d8a('0x6')](),controller['update']);router['delete'](_0x5d8a('0x8'),auth[_0x5d8a('0x6')](),controller[_0x5d8a('0xb')]);module[_0x5d8a('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 3623805..144cf5d 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 _0xddce=['sequelize','exports','STRING','name'];(function(_0xc3b08e,_0x427235){var _0x4c5e08=function(_0x501784){while(--_0x501784){_0xc3b08e['push'](_0xc3b08e['shift']());}};_0x4c5e08(++_0x427235);}(_0xddce,0xdc));var _0xeddc=function(_0x39df08,_0x331cd5){_0x39df08=_0x39df08-0x0;var _0x3cc1cd=_0xddce[_0x39df08];return _0x3cc1cd;};'use strict';var Sequelize=require(_0xeddc('0x0'));module[_0xeddc('0x1')]={'name':{'type':Sequelize[_0xeddc('0x2')],'unique':_0xeddc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xeddc('0x2')]},'companyId':{'type':Sequelize[_0xeddc('0x2')]},'website':{'type':Sequelize[_0xeddc('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xeddc('0x2')]},'type':{'type':Sequelize[_0xeddc('0x2')]},'street':{'type':Sequelize[_0xeddc('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xeddc('0x2')]},'country':{'type':Sequelize[_0xeddc('0x2')]},'email':{'type':Sequelize[_0xeddc('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xeddc('0x2')]},'sCity':{'type':Sequelize[_0xeddc('0x2')]},'sCountry':{'type':Sequelize[_0xeddc('0x2')]},'description':{'type':Sequelize[_0xeddc('0x2')]}};
\ No newline at end of file
+var _0x57b5=['exports','STRING','name'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x57b5,0x1bc));var _0x557b=function(_0x23b1d5,_0x3043fa){_0x23b1d5=_0x23b1d5-0x0;var _0x3f5702=_0x57b5[_0x23b1d5];return _0x3f5702;};'use strict';var Sequelize=require('sequelize');module[_0x557b('0x0')]={'name':{'type':Sequelize[_0x557b('0x1')],'unique':_0x557b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x557b('0x1')]},'companyId':{'type':Sequelize[_0x557b('0x1')]},'website':{'type':Sequelize[_0x557b('0x1')]},'phone':{'type':Sequelize[_0x557b('0x1')]},'fax':{'type':Sequelize[_0x557b('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x557b('0x1')]},'postalCode':{'type':Sequelize[_0x557b('0x1')]},'city':{'type':Sequelize[_0x557b('0x1')]},'country':{'type':Sequelize[_0x557b('0x1')]},'email':{'type':Sequelize[_0x557b('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x557b('0x1')]},'sStreet':{'type':Sequelize[_0x557b('0x1')]},'sPostalCode':{'type':Sequelize[_0x557b('0x1')]},'sCity':{'type':Sequelize[_0x557b('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x557b('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 3c7a118..b2ce954 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 _0xa0e9=['show','params','keys','rawAttributes','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','Companies','UserProfileResource','destroy','error','stack','name','send','index','describe','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','CmCompany','count','include','findAll','catch'];(function(_0x190cbd,_0x776df2){var _0x5b8657=function(_0x4021ef){while(--_0x4021ef){_0x190cbd['push'](_0x190cbd['shift']());}};_0x5b8657(++_0x776df2);}(_0xa0e9,0x129));var _0x9a0e=function(_0x1066f6,_0x55f1ad){_0x1066f6=_0x1066f6-0x0;var _0x2f716e=_0xa0e9[_0x1066f6];return _0x2f716e;};'use strict';var emlformat=require(_0x9a0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a0e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9a0e('0x2'));var BPromise=require(_0x9a0e('0x3'));var Mustache=require(_0x9a0e('0x4'));var util=require('util');var path=require(_0x9a0e('0x5'));var sox=require(_0x9a0e('0x6'));var csv=require('to-csv');var ejs=require(_0x9a0e('0x7'));var fs=require('fs');var fs_extra=require(_0x9a0e('0x8'));var _=require('lodash');var squel=require(_0x9a0e('0x9'));var crypto=require(_0x9a0e('0xa'));var jsforce=require(_0x9a0e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9a0e('0xc'));var Papa=require(_0x9a0e('0xd'));var Redis=require(_0x9a0e('0xe'));var authService=require(_0x9a0e('0xf'));var qs=require(_0x9a0e('0x10'));var as=require(_0x9a0e('0x11'));var hardwareService=require(_0x9a0e('0x12'));var logger=require(_0x9a0e('0x13'))(_0x9a0e('0x14'));var utils=require(_0x9a0e('0x15'));var config=require(_0x9a0e('0x16'));var licenseUtil=require(_0x9a0e('0x17'));var db=require(_0x9a0e('0x18'))['db'];function respondWithStatusCode(_0x573d21,_0x3355e3){_0x3355e3=_0x3355e3||0xcc;return function(_0x32e245){if(_0x32e245){return _0x573d21[_0x9a0e('0x19')](_0x3355e3);}return _0x573d21[_0x9a0e('0x1a')](_0x3355e3)[_0x9a0e('0x1b')]();};}function respondWithResult(_0x10fcd7,_0x48deee){_0x48deee=_0x48deee||0xc8;return function(_0x31d558){if(_0x31d558){return _0x10fcd7['status'](_0x48deee)[_0x9a0e('0x1c')](_0x31d558);}};}function respondWithFilteredResult(_0x127db0,_0xc5256f){return function(_0x548da9){if(_0x548da9){var _0x3a1209=typeof _0xc5256f[_0x9a0e('0x1d')]===_0x9a0e('0x1e')&&typeof _0xc5256f[_0x9a0e('0x1f')]===_0x9a0e('0x1e');var _0x1bd7d5=_0x548da9['count'];var _0x546de9=_0x3a1209?0x0:_0xc5256f[_0x9a0e('0x1d')];var _0x41d819=_0x3a1209?_0x548da9['count']:_0xc5256f[_0x9a0e('0x1d')]+_0xc5256f[_0x9a0e('0x1f')];var _0x34b6f9;if(_0x41d819>=_0x1bd7d5){_0x41d819=_0x1bd7d5;_0x34b6f9=0xc8;}else{_0x34b6f9=0xce;}_0x127db0[_0x9a0e('0x1a')](_0x34b6f9);return _0x127db0[_0x9a0e('0x20')](_0x9a0e('0x21'),_0x546de9+'-'+_0x41d819+'/'+_0x1bd7d5)['json'](_0x548da9);}return null;};}function patchUpdates(_0x3dcd01){return function(_0x1c3ad8){try{jsonpatch[_0x9a0e('0x22')](_0x1c3ad8,_0x3dcd01,!![]);}catch(_0x3f5bc8){return BPromise[_0x9a0e('0x23')](_0x3f5bc8);}return _0x1c3ad8['save']();};}function saveUpdates(_0x33de76,_0xd33ec4){return function(_0x3e672a){if(_0x3e672a){return _0x3e672a['update'](_0x33de76)[_0x9a0e('0x24')](function(_0xc9e2d4){return _0xc9e2d4;});}return null;};}function removeEntity(_0xaf2f5d,_0x4b56a6){return function(_0x143256){if(_0x143256){return _0x143256['destroy']()[_0x9a0e('0x24')](function(){var _0x5d3ada=_0x143256['get']({'plain':!![]});var _0x35e240=_0x9a0e('0x25');return db[_0x9a0e('0x26')][_0x9a0e('0x27')]({'where':{'type':_0x35e240,'resourceId':_0x5d3ada['id']}})['then'](function(){return _0x143256;});})[_0x9a0e('0x24')](function(){_0xaf2f5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x448d5e,_0x491688){return function(_0x48400b){if(!_0x48400b){_0x448d5e[_0x9a0e('0x19')](0x194);}return _0x48400b;};}function handleError(_0x1b641f,_0x1bbe37){_0x1bbe37=_0x1bbe37||0x1f4;return function(_0x2b5002){logger[_0x9a0e('0x28')](_0x2b5002[_0x9a0e('0x29')]);if(_0x2b5002[_0x9a0e('0x2a')]){delete _0x2b5002[_0x9a0e('0x2a')];}_0x1b641f[_0x9a0e('0x1a')](_0x1bbe37)[_0x9a0e('0x2b')](_0x2b5002);};}exports[_0x9a0e('0x2c')]=function(_0x30f541,_0x46ebaf){var _0x5187f6={},_0x423898={},_0x5d44cc={'count':0x0,'rows':[]};return db['CmCompany'][_0x9a0e('0x2d')]()[_0x9a0e('0x24')](function(_0x25642a){_0x423898[_0x9a0e('0x2e')]=_['keys'](_0x25642a);_0x423898['query']=_['keys'](_0x30f541['query']);_0x423898['filters']=_[_0x9a0e('0x2f')](_0x423898[_0x9a0e('0x2e')],_0x423898[_0x9a0e('0x30')]);_0x5187f6[_0x9a0e('0x31')]=_[_0x9a0e('0x2f')](_0x423898[_0x9a0e('0x2e')],qs[_0x9a0e('0x32')](_0x30f541[_0x9a0e('0x30')][_0x9a0e('0x32')]));_0x5187f6['attributes']=_0x5187f6[_0x9a0e('0x31')][_0x9a0e('0x33')]?_0x5187f6[_0x9a0e('0x31')]:_0x423898[_0x9a0e('0x2e')];if(!_0x30f541[_0x9a0e('0x30')][_0x9a0e('0x34')](_0x9a0e('0x35'))){_0x5187f6[_0x9a0e('0x1f')]=qs['limit'](_0x30f541[_0x9a0e('0x30')][_0x9a0e('0x1f')]);_0x5187f6['offset']=qs[_0x9a0e('0x1d')](_0x30f541[_0x9a0e('0x30')][_0x9a0e('0x1d')]);}_0x5187f6[_0x9a0e('0x36')]=qs['sort'](_0x30f541[_0x9a0e('0x30')][_0x9a0e('0x37')]);_0x5187f6[_0x9a0e('0x38')]=qs['filters'](_[_0x9a0e('0x39')](_0x30f541[_0x9a0e('0x30')],_0x423898[_0x9a0e('0x3a')]),_0x25642a);if(_0x30f541[_0x9a0e('0x30')][_0x9a0e('0x3b')]){_0x5187f6['where']=_[_0x9a0e('0x3c')](_0x5187f6['where'],{'$or':_[_0x9a0e('0x3d')](_0x5187f6['attributes'],function(_0x4f2588){var _0x4d8bb9={};_0x4d8bb9[_0x4f2588]={'$like':'%'+_0x30f541[_0x9a0e('0x30')][_0x9a0e('0x3b')]+'%'};return _0x4d8bb9;})});}_0x5187f6=_[_0x9a0e('0x3c')]({},_0x5187f6,_0x30f541['options']);var _0x41e213={'where':_0x5187f6[_0x9a0e('0x38')]};return db[_0x9a0e('0x3e')][_0x9a0e('0x3f')](_0x41e213)[_0x9a0e('0x24')](function(_0x48ae48){_0x5d44cc[_0x9a0e('0x3f')]=_0x48ae48;if(_0x30f541['query']['includeAll']){_0x5187f6[_0x9a0e('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0x9a0e('0x41')](_0x5187f6);})[_0x9a0e('0x24')](function(_0x3e099c){_0x5d44cc['rows']=_0x3e099c;return _0x5d44cc;})[_0x9a0e('0x24')](respondWithFilteredResult(_0x46ebaf,_0x5187f6))[_0x9a0e('0x42')](handleError(_0x46ebaf,null));})[_0x9a0e('0x42')](handleError(_0x46ebaf,null));};exports[_0x9a0e('0x43')]=function(_0x596df9,_0x4b5001){var _0x3b9602={'raw':![],'where':{'id':_0x596df9[_0x9a0e('0x44')]['id']}},_0x5e5447={};_0x5e5447[_0x9a0e('0x2e')]=_[_0x9a0e('0x45')](db[_0x9a0e('0x3e')][_0x9a0e('0x46')]);_0x5e5447[_0x9a0e('0x30')]=_[_0x9a0e('0x45')](_0x596df9[_0x9a0e('0x30')]);_0x5e5447[_0x9a0e('0x3a')]=_['intersection'](_0x5e5447[_0x9a0e('0x2e')],_0x5e5447[_0x9a0e('0x30')]);_0x3b9602[_0x9a0e('0x31')]=_[_0x9a0e('0x2f')](_0x5e5447[_0x9a0e('0x2e')],qs['fields'](_0x596df9[_0x9a0e('0x30')][_0x9a0e('0x32')]));_0x3b9602[_0x9a0e('0x31')]=_0x3b9602[_0x9a0e('0x31')][_0x9a0e('0x33')]?_0x3b9602[_0x9a0e('0x31')]:_0x5e5447['model'];if(_0x596df9[_0x9a0e('0x30')][_0x9a0e('0x47')]){_0x3b9602[_0x9a0e('0x40')]=[{'all':!![]}];}_0x3b9602=_['merge']({},_0x3b9602,_0x596df9[_0x9a0e('0x48')]);return db['CmCompany'][_0x9a0e('0x49')](_0x3b9602)[_0x9a0e('0x24')](handleEntityNotFound(_0x4b5001,null))[_0x9a0e('0x24')](respondWithResult(_0x4b5001,null))[_0x9a0e('0x42')](handleError(_0x4b5001,null));};exports['create']=function(_0x18572d,_0x3487ab){return db['CmCompany'][_0x9a0e('0x4a')](_0x18572d[_0x9a0e('0x4b')],{})['then'](function(_0x12df9b){var _0x435632=_0x18572d[_0x9a0e('0x4c')][_0x9a0e('0x4d')]({'plain':!![]});if(!_0x435632)throw new Error(_0x9a0e('0x4e'));if(_0x435632[_0x9a0e('0x4f')]===_0x9a0e('0x4c')){var _0x1ac22a=_0x12df9b[_0x9a0e('0x4d')]({'plain':!![]});var _0x5d3ead=_0x9a0e('0x25');return db[_0x9a0e('0x50')][_0x9a0e('0x49')]({'where':{'name':_0x5d3ead,'userProfileId':_0x435632[_0x9a0e('0x51')]},'raw':!![]})['then'](function(_0x48f9cc){if(_0x48f9cc&&_0x48f9cc[_0x9a0e('0x52')]===0x0){return db[_0x9a0e('0x26')][_0x9a0e('0x4a')]({'name':_0x1ac22a[_0x9a0e('0x2a')],'resourceId':_0x1ac22a['id'],'type':_0x48f9cc['name'],'sectionId':_0x48f9cc['id']},{})['then'](function(){return _0x12df9b;});}else{return _0x12df9b;}})[_0x9a0e('0x42')](function(_0x477344){logger[_0x9a0e('0x28')](_0x9a0e('0x53'),_0x477344);throw _0x477344;});}return _0x12df9b;})[_0x9a0e('0x24')](respondWithResult(_0x3487ab,0xc9))['catch'](handleError(_0x3487ab,null));};exports[_0x9a0e('0x54')]=function(_0x188fc6,_0x4e40e5){if(_0x188fc6['body']['id']){delete _0x188fc6[_0x9a0e('0x4b')]['id'];}return db['CmCompany'][_0x9a0e('0x49')]({'where':{'id':_0x188fc6['params']['id']}})[_0x9a0e('0x24')](handleEntityNotFound(_0x4e40e5,null))[_0x9a0e('0x24')](saveUpdates(_0x188fc6[_0x9a0e('0x4b')],null))[_0x9a0e('0x24')](respondWithResult(_0x4e40e5,null))[_0x9a0e('0x42')](handleError(_0x4e40e5,null));};exports[_0x9a0e('0x27')]=function(_0x4df6b8,_0x58e558){return db['CmCompany'][_0x9a0e('0x49')]({'where':{'id':_0x4df6b8[_0x9a0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x58e558,null))['then'](removeEntity(_0x58e558,null))[_0x9a0e('0x42')](handleError(_0x58e558,null));};exports[_0x9a0e('0x2d')]=function(_0x502b18,_0x4a0493){return db[_0x9a0e('0x3e')]['describe']()[_0x9a0e('0x24')](respondWithResult(_0x4a0493,null))['catch'](handleError(_0x4a0493,null));};exports[_0x9a0e('0x55')]=function(_0x2a5b1f,_0x33e17b,_0x3d4ff3){return db[_0x9a0e('0x56')]['find']({'where':{'id':_0x2a5b1f['params']['id']}})[_0x9a0e('0x24')](handleEntityNotFound(_0x33e17b,null))[_0x9a0e('0x24')](function(_0x57b9d1){if(_0x57b9d1){return _0x57b9d1[_0x9a0e('0x55')](_0x2a5b1f[_0x9a0e('0x4b')][_0x9a0e('0x57')],_[_0x9a0e('0x58')](_0x2a5b1f[_0x9a0e('0x4b')],['ids','id'])||{});}})[_0x9a0e('0x24')](respondWithResult(_0x33e17b,null))[_0x9a0e('0x42')](handleError(_0x33e17b,null));};exports[_0x9a0e('0x59')]=function(_0x4e9003,_0x88ad5b,_0x5e55dd){var _0x1a4b2a={};var _0x4591c7={};var _0xaf56bb;var _0x5b6ce7;return db[_0x9a0e('0x3e')][_0x9a0e('0x5a')]({'where':{'id':_0x4e9003[_0x9a0e('0x44')]['id']}})[_0x9a0e('0x24')](handleEntityNotFound(_0x88ad5b,null))[_0x9a0e('0x24')](function(_0x184a22){if(_0x184a22){_0xaf56bb=_0x184a22;_0x4591c7[_0x9a0e('0x2e')]=_[_0x9a0e('0x45')](db[_0x9a0e('0x56')]['rawAttributes']);_0x4591c7[_0x9a0e('0x30')]=_[_0x9a0e('0x45')](_0x4e9003[_0x9a0e('0x30')]);_0x4591c7['filters']=_[_0x9a0e('0x2f')](_0x4591c7[_0x9a0e('0x2e')],_0x4591c7[_0x9a0e('0x30')]);_0x1a4b2a[_0x9a0e('0x31')]=_[_0x9a0e('0x2f')](_0x4591c7[_0x9a0e('0x2e')],qs[_0x9a0e('0x32')](_0x4e9003[_0x9a0e('0x30')][_0x9a0e('0x32')]));_0x1a4b2a[_0x9a0e('0x31')]=_0x1a4b2a['attributes'][_0x9a0e('0x33')]?_0x1a4b2a[_0x9a0e('0x31')]:_0x4591c7[_0x9a0e('0x2e')];_0x1a4b2a[_0x9a0e('0x36')]=qs[_0x9a0e('0x37')](_0x4e9003[_0x9a0e('0x30')][_0x9a0e('0x37')]);_0x1a4b2a[_0x9a0e('0x38')]=qs[_0x9a0e('0x3a')](_[_0x9a0e('0x39')](_0x4e9003['query'],_0x4591c7[_0x9a0e('0x3a')]));if(_0x4e9003['query'][_0x9a0e('0x3b')]){_0x1a4b2a[_0x9a0e('0x38')]=_[_0x9a0e('0x3c')](_0x1a4b2a[_0x9a0e('0x38')],{'$or':_[_0x9a0e('0x3d')](_0x1a4b2a['attributes'],function(_0x4b0820){var _0x5f527c={};_0x5f527c[_0x4b0820]={'$like':'%'+_0x4e9003[_0x9a0e('0x30')][_0x9a0e('0x3b')]+'%'};return _0x5f527c;})});}_0x1a4b2a=_[_0x9a0e('0x3c')]({},_0x1a4b2a,_0x4e9003['options']);return _0xaf56bb[_0x9a0e('0x59')](_0x1a4b2a);}})['then'](function(_0x5a535b){if(_0x5a535b){_0x5b6ce7=_0x5a535b['length'];if(!_0x4e9003['query'][_0x9a0e('0x34')](_0x9a0e('0x35'))){_0x1a4b2a['limit']=qs[_0x9a0e('0x1f')](_0x4e9003[_0x9a0e('0x30')][_0x9a0e('0x1f')]);_0x1a4b2a[_0x9a0e('0x1d')]=qs[_0x9a0e('0x1d')](_0x4e9003['query'][_0x9a0e('0x1d')]);}return _0xaf56bb[_0x9a0e('0x59')](_0x1a4b2a);}})[_0x9a0e('0x24')](function(_0x58c1bc){if(_0x58c1bc){return _0x58c1bc?{'count':_0x5b6ce7,'rows':_0x58c1bc}:null;}})[_0x9a0e('0x24')](respondWithResult(_0x88ad5b,null))[_0x9a0e('0x42')](handleError(_0x88ad5b,null));};
\ No newline at end of file
+var _0x4eaa=['set','reject','save','update','then','get','Companies','UserProfileResource','destroy','error','stack','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','CmCompany','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x4eaa,0x189));var _0xa4ea=function(_0x25406a,_0x104ad5){_0x25406a=_0x25406a-0x0;var _0x2a18ad=_0x4eaa[_0x25406a];return _0x2a18ad;};'use strict';var emlformat=require(_0xa4ea('0x0'));var rimraf=require(_0xa4ea('0x1'));var zipdir=require(_0xa4ea('0x2'));var jsonpatch=require(_0xa4ea('0x3'));var rp=require('request-promise');var moment=require(_0xa4ea('0x4'));var BPromise=require(_0xa4ea('0x5'));var Mustache=require('mustache');var util=require(_0xa4ea('0x6'));var path=require(_0xa4ea('0x7'));var sox=require(_0xa4ea('0x8'));var csv=require('to-csv');var ejs=require(_0xa4ea('0x9'));var fs=require('fs');var fs_extra=require(_0xa4ea('0xa'));var _=require(_0xa4ea('0xb'));var squel=require('squel');var crypto=require(_0xa4ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa4ea('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa4ea('0xe'));var Papa=require(_0xa4ea('0xf'));var Redis=require('ioredis');var authService=require(_0xa4ea('0x10'));var qs=require(_0xa4ea('0x11'));var as=require(_0xa4ea('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa4ea('0x13'));var utils=require(_0xa4ea('0x14'));var config=require(_0xa4ea('0x15'));var licenseUtil=require(_0xa4ea('0x16'));var db=require(_0xa4ea('0x17'))['db'];function respondWithStatusCode(_0x337b23,_0x449713){_0x449713=_0x449713||0xcc;return function(_0x10066e){if(_0x10066e){return _0x337b23[_0xa4ea('0x18')](_0x449713);}return _0x337b23['status'](_0x449713)[_0xa4ea('0x19')]();};}function respondWithResult(_0x5aade3,_0x18afcd){_0x18afcd=_0x18afcd||0xc8;return function(_0x491f32){if(_0x491f32){return _0x5aade3[_0xa4ea('0x1a')](_0x18afcd)[_0xa4ea('0x1b')](_0x491f32);}};}function respondWithFilteredResult(_0x4a32cb,_0x32b764){return function(_0x5368fa){if(_0x5368fa){var _0x1df8e6=typeof _0x32b764[_0xa4ea('0x1c')]===_0xa4ea('0x1d')&&typeof _0x32b764[_0xa4ea('0x1e')]===_0xa4ea('0x1d');var _0x1292ac=_0x5368fa[_0xa4ea('0x1f')];var _0x2eda4c=_0x1df8e6?0x0:_0x32b764[_0xa4ea('0x1c')];var _0x902291=_0x1df8e6?_0x5368fa[_0xa4ea('0x1f')]:_0x32b764['offset']+_0x32b764['limit'];var _0x1add0c;if(_0x902291>=_0x1292ac){_0x902291=_0x1292ac;_0x1add0c=0xc8;}else{_0x1add0c=0xce;}_0x4a32cb[_0xa4ea('0x1a')](_0x1add0c);return _0x4a32cb[_0xa4ea('0x20')]('Content-Range',_0x2eda4c+'-'+_0x902291+'/'+_0x1292ac)['json'](_0x5368fa);}return null;};}function patchUpdates(_0x164a23){return function(_0x4c5418){try{jsonpatch['apply'](_0x4c5418,_0x164a23,!![]);}catch(_0x489106){return BPromise[_0xa4ea('0x21')](_0x489106);}return _0x4c5418[_0xa4ea('0x22')]();};}function saveUpdates(_0x454a24,_0x521390){return function(_0x459f45){if(_0x459f45){return _0x459f45[_0xa4ea('0x23')](_0x454a24)['then'](function(_0x1591c7){return _0x1591c7;});}return null;};}function removeEntity(_0x4cd99e,_0xa4698c){return function(_0x34b3c2){if(_0x34b3c2){return _0x34b3c2['destroy']()[_0xa4ea('0x24')](function(){var _0x404fc0=_0x34b3c2[_0xa4ea('0x25')]({'plain':!![]});var _0x206337=_0xa4ea('0x26');return db[_0xa4ea('0x27')][_0xa4ea('0x28')]({'where':{'type':_0x206337,'resourceId':_0x404fc0['id']}})[_0xa4ea('0x24')](function(){return _0x34b3c2;});})[_0xa4ea('0x24')](function(){_0x4cd99e['status'](0xcc)[_0xa4ea('0x19')]();});}};}function handleEntityNotFound(_0x1968e0,_0x58c6f0){return function(_0x369ea3){if(!_0x369ea3){_0x1968e0['sendStatus'](0x194);}return _0x369ea3;};}function handleError(_0x5e9029,_0x4dc647){_0x4dc647=_0x4dc647||0x1f4;return function(_0x12ef9b){logger[_0xa4ea('0x29')](_0x12ef9b[_0xa4ea('0x2a')]);if(_0x12ef9b['name']){delete _0x12ef9b['name'];}_0x5e9029['status'](_0x4dc647)['send'](_0x12ef9b);};}exports[_0xa4ea('0x2b')]=function(_0x3ef5b,_0x53b72e){var _0x54bb10={},_0x1bde6b={},_0x4f0f53={'count':0x0,'rows':[]};return db['CmCompany'][_0xa4ea('0x2c')]()['then'](function(_0x214fc2){_0x1bde6b[_0xa4ea('0x2d')]=_[_0xa4ea('0x2e')](_0x214fc2);_0x1bde6b[_0xa4ea('0x2f')]=_['keys'](_0x3ef5b[_0xa4ea('0x2f')]);_0x1bde6b[_0xa4ea('0x30')]=_[_0xa4ea('0x31')](_0x1bde6b['model'],_0x1bde6b['query']);_0x54bb10[_0xa4ea('0x32')]=_['intersection'](_0x1bde6b[_0xa4ea('0x2d')],qs[_0xa4ea('0x33')](_0x3ef5b[_0xa4ea('0x2f')][_0xa4ea('0x33')]));_0x54bb10[_0xa4ea('0x32')]=_0x54bb10[_0xa4ea('0x32')][_0xa4ea('0x34')]?_0x54bb10[_0xa4ea('0x32')]:_0x1bde6b[_0xa4ea('0x2d')];if(!_0x3ef5b[_0xa4ea('0x2f')][_0xa4ea('0x35')](_0xa4ea('0x36'))){_0x54bb10[_0xa4ea('0x1e')]=qs['limit'](_0x3ef5b[_0xa4ea('0x2f')][_0xa4ea('0x1e')]);_0x54bb10[_0xa4ea('0x1c')]=qs[_0xa4ea('0x1c')](_0x3ef5b[_0xa4ea('0x2f')][_0xa4ea('0x1c')]);}_0x54bb10[_0xa4ea('0x37')]=qs[_0xa4ea('0x38')](_0x3ef5b[_0xa4ea('0x2f')][_0xa4ea('0x38')]);_0x54bb10[_0xa4ea('0x39')]=qs[_0xa4ea('0x30')](_[_0xa4ea('0x3a')](_0x3ef5b['query'],_0x1bde6b[_0xa4ea('0x30')]),_0x214fc2);if(_0x3ef5b['query'][_0xa4ea('0x3b')]){_0x54bb10['where']=_[_0xa4ea('0x3c')](_0x54bb10[_0xa4ea('0x39')],{'$or':_[_0xa4ea('0x3d')](_0x54bb10[_0xa4ea('0x32')],function(_0x6e678e){var _0x3390cf={};_0x3390cf[_0x6e678e]={'$like':'%'+_0x3ef5b[_0xa4ea('0x2f')][_0xa4ea('0x3b')]+'%'};return _0x3390cf;})});}_0x54bb10=_[_0xa4ea('0x3c')]({},_0x54bb10,_0x3ef5b['options']);var _0x62441d={'where':_0x54bb10['where']};return db[_0xa4ea('0x3e')][_0xa4ea('0x1f')](_0x62441d)[_0xa4ea('0x24')](function(_0x36d737){_0x4f0f53[_0xa4ea('0x1f')]=_0x36d737;if(_0x3ef5b['query'][_0xa4ea('0x3f')]){_0x54bb10['include']=[{'all':!![]}];}return db[_0xa4ea('0x3e')][_0xa4ea('0x40')](_0x54bb10);})['then'](function(_0x5a4a19){_0x4f0f53[_0xa4ea('0x41')]=_0x5a4a19;return _0x4f0f53;})[_0xa4ea('0x24')](respondWithFilteredResult(_0x53b72e,_0x54bb10))[_0xa4ea('0x42')](handleError(_0x53b72e,null));})[_0xa4ea('0x42')](handleError(_0x53b72e,null));};exports['show']=function(_0x26d58a,_0x23df4d){var _0x1e34ae={'raw':![],'where':{'id':_0x26d58a[_0xa4ea('0x43')]['id']}},_0x27fbac={};_0x27fbac[_0xa4ea('0x2d')]=_['keys'](db[_0xa4ea('0x3e')][_0xa4ea('0x44')]);_0x27fbac[_0xa4ea('0x2f')]=_[_0xa4ea('0x2e')](_0x26d58a[_0xa4ea('0x2f')]);_0x27fbac[_0xa4ea('0x30')]=_[_0xa4ea('0x31')](_0x27fbac[_0xa4ea('0x2d')],_0x27fbac['query']);_0x1e34ae[_0xa4ea('0x32')]=_[_0xa4ea('0x31')](_0x27fbac['model'],qs[_0xa4ea('0x33')](_0x26d58a[_0xa4ea('0x2f')]['fields']));_0x1e34ae[_0xa4ea('0x32')]=_0x1e34ae[_0xa4ea('0x32')]['length']?_0x1e34ae[_0xa4ea('0x32')]:_0x27fbac[_0xa4ea('0x2d')];if(_0x26d58a['query'][_0xa4ea('0x3f')]){_0x1e34ae[_0xa4ea('0x45')]=[{'all':!![]}];}_0x1e34ae=_['merge']({},_0x1e34ae,_0x26d58a['options']);return db[_0xa4ea('0x3e')][_0xa4ea('0x46')](_0x1e34ae)[_0xa4ea('0x24')](handleEntityNotFound(_0x23df4d,null))['then'](respondWithResult(_0x23df4d,null))[_0xa4ea('0x42')](handleError(_0x23df4d,null));};exports['create']=function(_0x297769,_0xd6e4df){return db[_0xa4ea('0x3e')][_0xa4ea('0x47')](_0x297769['body'],{})[_0xa4ea('0x24')](function(_0x5a2ee1){var _0x5dc168=_0x297769[_0xa4ea('0x48')][_0xa4ea('0x25')]({'plain':!![]});if(!_0x5dc168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5dc168[_0xa4ea('0x49')]===_0xa4ea('0x48')){var _0x22c028=_0x5a2ee1[_0xa4ea('0x25')]({'plain':!![]});var _0x10e625=_0xa4ea('0x26');return db[_0xa4ea('0x4a')][_0xa4ea('0x46')]({'where':{'name':_0x10e625,'userProfileId':_0x5dc168[_0xa4ea('0x4b')]},'raw':!![]})[_0xa4ea('0x24')](function(_0x3f7c86){if(_0x3f7c86&&_0x3f7c86['autoAssociation']===0x0){return db[_0xa4ea('0x27')][_0xa4ea('0x47')]({'name':_0x22c028[_0xa4ea('0x4c')],'resourceId':_0x22c028['id'],'type':_0x3f7c86[_0xa4ea('0x4c')],'sectionId':_0x3f7c86['id']},{})[_0xa4ea('0x24')](function(){return _0x5a2ee1;});}else{return _0x5a2ee1;}})[_0xa4ea('0x42')](function(_0x5516b0){logger[_0xa4ea('0x29')](_0xa4ea('0x4d'),_0x5516b0);throw _0x5516b0;});}return _0x5a2ee1;})[_0xa4ea('0x24')](respondWithResult(_0xd6e4df,0xc9))['catch'](handleError(_0xd6e4df,null));};exports[_0xa4ea('0x23')]=function(_0x153667,_0x5e6436){if(_0x153667[_0xa4ea('0x4e')]['id']){delete _0x153667[_0xa4ea('0x4e')]['id'];}return db[_0xa4ea('0x3e')][_0xa4ea('0x46')]({'where':{'id':_0x153667[_0xa4ea('0x43')]['id']}})[_0xa4ea('0x24')](handleEntityNotFound(_0x5e6436,null))['then'](saveUpdates(_0x153667[_0xa4ea('0x4e')],null))['then'](respondWithResult(_0x5e6436,null))[_0xa4ea('0x42')](handleError(_0x5e6436,null));};exports[_0xa4ea('0x28')]=function(_0x333fb2,_0x3f009f){return db['CmCompany'][_0xa4ea('0x46')]({'where':{'id':_0x333fb2['params']['id']}})[_0xa4ea('0x24')](handleEntityNotFound(_0x3f009f,null))[_0xa4ea('0x24')](removeEntity(_0x3f009f,null))[_0xa4ea('0x42')](handleError(_0x3f009f,null));};exports['describe']=function(_0x5f3abb,_0x2df6a9){return db[_0xa4ea('0x3e')][_0xa4ea('0x2c')]()[_0xa4ea('0x24')](respondWithResult(_0x2df6a9,null))[_0xa4ea('0x42')](handleError(_0x2df6a9,null));};exports[_0xa4ea('0x4f')]=function(_0x11b34a,_0x1e0c09,_0x3edc61){return db[_0xa4ea('0x50')][_0xa4ea('0x46')]({'where':{'id':_0x11b34a['params']['id']}})['then'](handleEntityNotFound(_0x1e0c09,null))[_0xa4ea('0x24')](function(_0x18424c){if(_0x18424c){return _0x18424c[_0xa4ea('0x4f')](_0x11b34a[_0xa4ea('0x4e')][_0xa4ea('0x51')],_[_0xa4ea('0x52')](_0x11b34a[_0xa4ea('0x4e')],['ids','id'])||{});}})[_0xa4ea('0x24')](respondWithResult(_0x1e0c09,null))[_0xa4ea('0x42')](handleError(_0x1e0c09,null));};exports[_0xa4ea('0x53')]=function(_0xe04e50,_0x1ed958,_0x461482){var _0x27c8be={};var _0x2c286a={};var _0x4acef7;var _0x111c43;return db[_0xa4ea('0x3e')][_0xa4ea('0x54')]({'where':{'id':_0xe04e50[_0xa4ea('0x43')]['id']}})[_0xa4ea('0x24')](handleEntityNotFound(_0x1ed958,null))[_0xa4ea('0x24')](function(_0x8a71be){if(_0x8a71be){_0x4acef7=_0x8a71be;_0x2c286a[_0xa4ea('0x2d')]=_['keys'](db[_0xa4ea('0x50')]['rawAttributes']);_0x2c286a[_0xa4ea('0x2f')]=_[_0xa4ea('0x2e')](_0xe04e50[_0xa4ea('0x2f')]);_0x2c286a['filters']=_[_0xa4ea('0x31')](_0x2c286a[_0xa4ea('0x2d')],_0x2c286a['query']);_0x27c8be[_0xa4ea('0x32')]=_['intersection'](_0x2c286a[_0xa4ea('0x2d')],qs[_0xa4ea('0x33')](_0xe04e50['query'][_0xa4ea('0x33')]));_0x27c8be[_0xa4ea('0x32')]=_0x27c8be[_0xa4ea('0x32')][_0xa4ea('0x34')]?_0x27c8be[_0xa4ea('0x32')]:_0x2c286a['model'];_0x27c8be[_0xa4ea('0x37')]=qs[_0xa4ea('0x38')](_0xe04e50[_0xa4ea('0x2f')][_0xa4ea('0x38')]);_0x27c8be[_0xa4ea('0x39')]=qs[_0xa4ea('0x30')](_[_0xa4ea('0x3a')](_0xe04e50[_0xa4ea('0x2f')],_0x2c286a[_0xa4ea('0x30')]));if(_0xe04e50[_0xa4ea('0x2f')][_0xa4ea('0x3b')]){_0x27c8be[_0xa4ea('0x39')]=_[_0xa4ea('0x3c')](_0x27c8be[_0xa4ea('0x39')],{'$or':_[_0xa4ea('0x3d')](_0x27c8be[_0xa4ea('0x32')],function(_0x347776){var _0x3bfed2={};_0x3bfed2[_0x347776]={'$like':'%'+_0xe04e50['query'][_0xa4ea('0x3b')]+'%'};return _0x3bfed2;})});}_0x27c8be=_[_0xa4ea('0x3c')]({},_0x27c8be,_0xe04e50['options']);return _0x4acef7[_0xa4ea('0x53')](_0x27c8be);}})['then'](function(_0x1217c6){if(_0x1217c6){_0x111c43=_0x1217c6[_0xa4ea('0x34')];if(!_0xe04e50[_0xa4ea('0x2f')]['hasOwnProperty'](_0xa4ea('0x36'))){_0x27c8be[_0xa4ea('0x1e')]=qs[_0xa4ea('0x1e')](_0xe04e50['query'][_0xa4ea('0x1e')]);_0x27c8be[_0xa4ea('0x1c')]=qs[_0xa4ea('0x1c')](_0xe04e50[_0xa4ea('0x2f')]['offset']);}return _0x4acef7['getContacts'](_0x27c8be);}})['then'](function(_0x11e4d7){if(_0x11e4d7){return _0x11e4d7?{'count':_0x111c43,'rows':_0x11e4d7}:null;}})[_0xa4ea('0x24')](respondWithResult(_0x1ed958,null))[_0xa4ea('0x42')](handleError(_0x1ed958,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 9ef2432..5229684 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 _0x3d63=['api','moment','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x31080a,_0x55b5cd){var _0x58d2fc=function(_0x446558){while(--_0x446558){_0x31080a['push'](_0x31080a['shift']());}};_0x58d2fc(++_0x55b5cd);}(_0x3d63,0xf4));var _0x33d6=function(_0xcfb1a8,_0x5e8548){_0xcfb1a8=_0xcfb1a8-0x0;var _0x181d45=_0x3d63[_0xcfb1a8];return _0x181d45;};'use strict';var _=require(_0x33d6('0x0'));var util=require(_0x33d6('0x1'));var logger=require(_0x33d6('0x2'))(_0x33d6('0x3'));var moment=require(_0x33d6('0x4'));var BPromise=require('bluebird');var rp=require(_0x33d6('0x5'));var fs=require('fs');var path=require(_0x33d6('0x6'));var rimraf=require('rimraf');var config=require(_0x33d6('0x7'));var attributes=require(_0x33d6('0x8'));module[_0x33d6('0x9')]=function(_0x3f9799,_0x1fedf7){return _0x3f9799[_0x33d6('0xa')](_0x33d6('0xb'),attributes,{'tableName':_0x33d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd889=['CmCompany','cm_companies','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./cmCompany.attributes','exports'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xd889,0x141));var _0x9d88=function(_0x293c92,_0x4fe243){_0x293c92=_0x293c92-0x0;var _0x11dfc4=_0xd889[_0x293c92];return _0x11dfc4;};'use strict';var _=require(_0x9d88('0x0'));var util=require(_0x9d88('0x1'));var logger=require(_0x9d88('0x2'))(_0x9d88('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d88('0x4'));var fs=require('fs');var path=require(_0x9d88('0x5'));var rimraf=require('rimraf');var config=require(_0x9d88('0x6'));var attributes=require(_0x9d88('0x7'));module[_0x9d88('0x8')]=function(_0x5aca6e,_0x18c363){return _0x5aca6e['define'](_0x9d88('0x9'),attributes,{'tableName':_0x9d88('0xa'),'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 4303e7a..633e101 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 _0x3d80=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','CmCompany,\x20%s,\x20%s','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x2d68f7,_0x534b07){var _0x447e1b=function(_0x29a655){while(--_0x29a655){_0x2d68f7['push'](_0x2d68f7['shift']());}};_0x447e1b(++_0x534b07);}(_0x3d80,0x111));var _0x03d8=function(_0xa8661c,_0x3e5852){_0xa8661c=_0xa8661c-0x0;var _0x205759=_0x3d80[_0xa8661c];return _0x205759;};'use strict';var _=require('lodash');var util=require(_0x03d8('0x0'));var moment=require(_0x03d8('0x1'));var BPromise=require(_0x03d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03d8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x03d8('0x4'));var logger=require(_0x03d8('0x5'))('rpc');var config=require(_0x03d8('0x6'));var jayson=require(_0x03d8('0x7'));var client=jayson['client'][_0x03d8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55d824,_0x7087a3,_0x469bcf){return new BPromise(function(_0x5e32e1,_0xb1b53){return client['request'](_0x55d824,_0x469bcf)[_0x03d8('0x9')](function(_0x57821e){logger[_0x03d8('0xa')]('CmCompany,\x20%s,\x20%s',_0x7087a3,_0x03d8('0xb'));logger[_0x03d8('0xc')](_0x03d8('0xd'),_0x7087a3,_0x03d8('0xb'),JSON[_0x03d8('0xe')](_0x57821e));if(_0x57821e['error']){if(_0x57821e[_0x03d8('0xf')]['code']===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x7087a3,_0x57821e['error'][_0x03d8('0x10')]);return _0xb1b53(_0x57821e['error'][_0x03d8('0x10')]);}logger[_0x03d8('0xf')]('CmCompany,\x20%s,\x20%s',_0x7087a3,_0x57821e['error']['message']);return _0x5e32e1(_0x57821e['error'][_0x03d8('0x10')]);}else{logger['info'](_0x03d8('0x11'),_0x7087a3,'request\x20sent');_0x5e32e1(_0x57821e[_0x03d8('0x12')][_0x03d8('0x10')]);}})['catch'](function(_0x53ae50){logger[_0x03d8('0xf')](_0x03d8('0x11'),_0x7087a3,_0x53ae50);_0xb1b53(_0x53ae50);});});}
\ No newline at end of file
+var _0xa7d9=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7d9,0x1cb));var _0x9a7d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa7d9[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x9a7d('0x0'));var util=require(_0x9a7d('0x1'));var moment=require(_0x9a7d('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a7d('0x5'))(_0x9a7d('0x6'));var config=require(_0x9a7d('0x7'));var jayson=require(_0x9a7d('0x8'));var client=jayson[_0x9a7d('0x9')][_0x9a7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x97a24b,_0x840752,_0x28a384){return new BPromise(function(_0x43519a,_0x3849b7){return client[_0x9a7d('0xb')](_0x97a24b,_0x28a384)[_0x9a7d('0xc')](function(_0x76b00c){logger[_0x9a7d('0xd')]('CmCompany,\x20%s,\x20%s',_0x840752,'request\x20sent');logger['debug'](_0x9a7d('0xe'),_0x840752,_0x9a7d('0xf'),JSON[_0x9a7d('0x10')](_0x76b00c));if(_0x76b00c['error']){if(_0x76b00c[_0x9a7d('0x11')]['code']===0x1f4){logger[_0x9a7d('0x11')](_0x9a7d('0x12'),_0x840752,_0x76b00c[_0x9a7d('0x11')]['message']);return _0x3849b7(_0x76b00c['error']['message']);}logger[_0x9a7d('0x11')](_0x9a7d('0x12'),_0x840752,_0x76b00c[_0x9a7d('0x11')][_0x9a7d('0x13')]);return _0x43519a(_0x76b00c[_0x9a7d('0x11')]['message']);}else{logger['info'](_0x9a7d('0x12'),_0x840752,_0x9a7d('0xf'));_0x43519a(_0x76b00c[_0x9a7d('0x14')][_0x9a7d('0x13')]);}})[_0x9a7d('0x15')](function(_0x3cac72){logger['error'](_0x9a7d('0x12'),_0x840752,_0x3cac72);_0x3849b7(_0x3cac72);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index b1ec977..8b74e6e 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 _0xbcf3=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3df1a8,_0x14c6a0){var _0x52e372=function(_0x1a8218){while(--_0x1a8218){_0x3df1a8['push'](_0x3df1a8['shift']());}};_0x52e372(++_0x14c6a0);}(_0xbcf3,0x17e));var _0x3bcf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbcf3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3bcf('0x0'));var util=require(_0x3bcf('0x1'));var path=require(_0x3bcf('0x2'));var timeout=require(_0x3bcf('0x3'));var express=require(_0x3bcf('0x4'));var router=express[_0x3bcf('0x5')]();var fs_extra=require(_0x3bcf('0x6'));var auth=require(_0x3bcf('0x7'));var interaction=require(_0x3bcf('0x8'));var config=require(_0x3bcf('0x9'));var controller=require('./cmCompany.controller');router[_0x3bcf('0xa')]('/',auth[_0x3bcf('0xb')](),controller[_0x3bcf('0xc')]);router[_0x3bcf('0xa')](_0x3bcf('0xd'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0xe')]);router[_0x3bcf('0xa')](_0x3bcf('0xf'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x10')]);router[_0x3bcf('0xa')]('/:id/contacts',auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x11')]);router[_0x3bcf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3bcf('0x13'),auth['isAuthenticated'](),controller[_0x3bcf('0x14')]);router[_0x3bcf('0x15')](_0x3bcf('0xf'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x16')]);router[_0x3bcf('0x17')](_0x3bcf('0xf'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x18')]);module[_0x3bcf('0x19')]=router;
\ No newline at end of file
+var _0xb486=['./cmCompany.controller','get','/describe','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x10fb7c,_0x1ab5f0){var _0x47c550=function(_0x296e8a){while(--_0x296e8a){_0x10fb7c['push'](_0x10fb7c['shift']());}};_0x47c550(++_0x1ab5f0);}(_0xb486,0x1b0));var _0x6b48=function(_0x245d53,_0x56e09d){_0x245d53=_0x245d53-0x0;var _0x410b78=_0xb486[_0x245d53];return _0x410b78;};'use strict';var multer=require(_0x6b48('0x0'));var util=require(_0x6b48('0x1'));var path=require('path');var timeout=require(_0x6b48('0x2'));var express=require(_0x6b48('0x3'));var router=express[_0x6b48('0x4')]();var fs_extra=require(_0x6b48('0x5'));var auth=require(_0x6b48('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b48('0x7'));var controller=require(_0x6b48('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6b48('0x9')](_0x6b48('0xa'),auth[_0x6b48('0xb')](),controller[_0x6b48('0xc')]);router[_0x6b48('0x9')](_0x6b48('0xd'),auth[_0x6b48('0xb')](),controller['show']);router[_0x6b48('0x9')](_0x6b48('0xe'),auth[_0x6b48('0xb')](),controller[_0x6b48('0xf')]);router[_0x6b48('0x10')]('/',auth[_0x6b48('0xb')](),controller[_0x6b48('0x11')]);router['post'](_0x6b48('0xe'),auth[_0x6b48('0xb')](),controller['addContacts']);router['put'](_0x6b48('0xd'),auth[_0x6b48('0xb')](),controller[_0x6b48('0x12')]);router[_0x6b48('0x13')](_0x6b48('0xd'),auth[_0x6b48('0xb')](),controller[_0x6b48('0x14')]);module[_0x6b48('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 2007eda..c419be6 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 _0xa4fe=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x318762,_0xe164fe){var _0x22e4bc=function(_0x506940){while(--_0x506940){_0x318762['push'](_0x318762['shift']());}};_0x22e4bc(++_0xe164fe);}(_0xa4fe,0x1d8));var _0xea4f=function(_0xa43ea8,_0x3a5813){_0xa43ea8=_0xa43ea8-0x0;var _0xcd0fbd=_0xa4fe[_0xa43ea8];return _0xcd0fbd;};'use strict';var _=require(_0xea4f('0x0'));var Sequelize=require('sequelize');module[_0xea4f('0x1')]={'firstName':{'type':Sequelize[_0xea4f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xea4f('0x2')]},'street':{'type':Sequelize[_0xea4f('0x2')]},'postalCode':{'type':Sequelize[_0xea4f('0x2')]},'city':{'type':Sequelize[_0xea4f('0x2')]},'country':{'type':Sequelize[_0xea4f('0x2')]},'dateOfBirth':{'type':Sequelize[_0xea4f('0x2')]},'description':{'type':Sequelize[_0xea4f('0x3')]},'phone':{'type':Sequelize[_0xea4f('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xea4f('0x2')]},'url':{'type':Sequelize[_0xea4f('0x2')]},'facebook':{'type':Sequelize[_0xea4f('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xea4f('0x2')]},'skype':{'type':Sequelize[_0xea4f('0x2')]},'teams':{'type':Sequelize[_0xea4f('0x2')]},'viber':{'type':Sequelize[_0xea4f('0x2')]},'line':{'type':Sequelize[_0xea4f('0x2')]},'wechat':{'type':Sequelize[_0xea4f('0x2')]},'telegram':{'type':Sequelize[_0xea4f('0x2')]},'UserId':{'type':Sequelize[_0xea4f('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xea4f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xea4f('0x6')],'defaultValue':Sequelize[_0xea4f('0x7')]}};
\ No newline at end of file
+var _0xe416=['STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports'];(function(_0x3b5341,_0x58c9ba){var _0x245feb=function(_0x51d24f){while(--_0x51d24f){_0x3b5341['push'](_0x3b5341['shift']());}};_0x245feb(++_0x58c9ba);}(_0xe416,0x1b5));var _0x6e41=function(_0x597d5c,_0x209015){_0x597d5c=_0x597d5c-0x0;var _0xe99164=_0xe416[_0x597d5c];return _0xe99164;};'use strict';var _=require(_0x6e41('0x0'));var Sequelize=require(_0x6e41('0x1'));module[_0x6e41('0x2')]={'firstName':{'type':Sequelize[_0x6e41('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x6e41('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x6e41('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6e41('0x3')]},'description':{'type':Sequelize[_0x6e41('0x4')]},'phone':{'type':Sequelize[_0x6e41('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6e41('0x3')]},'email':{'type':Sequelize[_0x6e41('0x3')]},'url':{'type':Sequelize[_0x6e41('0x3')]},'facebook':{'type':Sequelize[_0x6e41('0x3')]},'fb_data':{'type':Sequelize[_0x6e41('0x3')]},'twitter':{'type':Sequelize[_0x6e41('0x3')]},'skype':{'type':Sequelize[_0x6e41('0x3')]},'teams':{'type':Sequelize[_0x6e41('0x3')]},'viber':{'type':Sequelize[_0x6e41('0x3')]},'line':{'type':Sequelize[_0x6e41('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x6e41('0x3')]},'UserId':{'type':Sequelize[_0x6e41('0x5')]},'priority':{'type':Sequelize[_0x6e41('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6e41('0x6')],'defaultValue':Sequelize[_0x6e41('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1da4d79..01c7011 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 _0xf61a=['fullname','DESC','VoiceCallReport','startCase','chat','Account','closedAt','note','disposition','secondDisposition','key','Owner','Tag','browserName','customerIp','customerPort','ratingMessage','ratingValue','referer','subject','externalUrl','threadId','findAndCountAll','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','findOne','trimStart','all','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','fieldType','datetime','buildExpression','text','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','filter','replace','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','having','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','fields','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','catch','tags','displayName','CmCustomField','findAll','columnName','alias','values','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','show','params','$and','omit','format','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','rawAttributes','options','getTags','setTags','ids','getHoppers','ContactId','include','includeAll','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','fork','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId'];(function(_0x41f493,_0x5601ba){var _0x222469=function(_0x53c38b){while(--_0x53c38b){_0x41f493['push'](_0x41f493['shift']());}};_0x222469(++_0x5601ba);}(_0xf61a,0x146));var _0xaf61=function(_0x15e8a9,_0x307746){_0x15e8a9=_0x15e8a9-0x0;var _0x372db1=_0xf61a[_0x15e8a9];return _0x372db1;};'use strict';var emlformat=require(_0xaf61('0x0'));var rimraf=require(_0xaf61('0x1'));var zipdir=require(_0xaf61('0x2'));var jsonpatch=require(_0xaf61('0x3'));var rp=require(_0xaf61('0x4'));var moment=require(_0xaf61('0x5'));var BPromise=require(_0xaf61('0x6'));var Mustache=require('mustache');var util=require(_0xaf61('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xaf61('0x8'));var ejs=require(_0xaf61('0x9'));var fs=require('fs');var fs_extra=require(_0xaf61('0xa'));var _=require('lodash');var squel=require(_0xaf61('0xb'));var crypto=require(_0xaf61('0xc'));var jsforce=require(_0xaf61('0xd'));var deskjs=require(_0xaf61('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaf61('0xf'));var Papa=require(_0xaf61('0x10'));var Redis=require('ioredis');var authService=require(_0xaf61('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf61('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf61('0x13'))(_0xaf61('0x14'));var utils=require('../../config/utils');var config=require(_0xaf61('0x15'));var licenseUtil=require(_0xaf61('0x16'));var db=require(_0xaf61('0x17'))['db'];config[_0xaf61('0x18')]=_[_0xaf61('0x19')](config[_0xaf61('0x18')],{'host':_0xaf61('0x1a'),'port':0x18eb});var socket=require(_0xaf61('0x1b'))(new Redis(config[_0xaf61('0x18')]));require(_0xaf61('0x1c'))[_0xaf61('0x1d')](socket);function respondWithStatusCode(_0x100d2c,_0x441be8){_0x441be8=_0x441be8||0xcc;return function(_0x2b4784){if(_0x2b4784){return _0x100d2c['sendStatus'](_0x441be8);}return _0x100d2c[_0xaf61('0x1e')](_0x441be8)[_0xaf61('0x1f')]();};}function respondWithResult(_0x26eac2,_0x5619b0){_0x5619b0=_0x5619b0||0xc8;return function(_0x575df0){if(_0x575df0){return _0x26eac2['status'](_0x5619b0)[_0xaf61('0x20')](_0x575df0);}};}function respondWithFilteredResult(_0x33ba29,_0xb250c5){return function(_0x3b10b9){if(_0x3b10b9){var _0x169422=typeof _0xb250c5[_0xaf61('0x21')]===_0xaf61('0x22')&&typeof _0xb250c5[_0xaf61('0x23')]==='undefined';var _0x343d59=_0x3b10b9[_0xaf61('0x24')];var _0x236b39=_0x169422?0x0:_0xb250c5[_0xaf61('0x21')];var _0x159f1e=_0x169422?_0x3b10b9[_0xaf61('0x24')]:_0xb250c5[_0xaf61('0x21')]+_0xb250c5[_0xaf61('0x23')];var _0x3fc2a1;if(_0x159f1e>=_0x343d59){_0x159f1e=_0x343d59;_0x3fc2a1=0xc8;}else{_0x3fc2a1=0xce;}_0x33ba29[_0xaf61('0x1e')](_0x3fc2a1);return _0x33ba29[_0xaf61('0x25')](_0xaf61('0x26'),_0x236b39+'-'+_0x159f1e+'/'+_0x343d59)[_0xaf61('0x20')](_0x3b10b9);}return null;};}function patchUpdates(_0x1bd21c){return function(_0x1510b5){try{jsonpatch[_0xaf61('0x27')](_0x1510b5,_0x1bd21c,!![]);}catch(_0x522e02){return BPromise[_0xaf61('0x28')](_0x522e02);}return _0x1510b5[_0xaf61('0x29')]();};}function saveUpdates(_0x181050,_0x43f4b4){return function(_0x32bf56){if(_0x32bf56){return _0x32bf56['update'](_0x181050)['then'](function(_0x40775d){return _0x40775d;});}return null;};}function removeEntity(_0x47544a,_0x47d427){return function(_0x45356b){if(_0x45356b){return _0x45356b[_0xaf61('0x2a')]()[_0xaf61('0x2b')](function(){_0x47544a[_0xaf61('0x1e')](0xcc)[_0xaf61('0x1f')]();});}};}function handleEntityNotFound(_0x4f3125,_0x200647){return function(_0x1eb187){if(!_0x1eb187){_0x4f3125['sendStatus'](0x194);}return _0x1eb187;};}function handleError(_0x285aef,_0x5e3735){_0x5e3735=_0x5e3735||0x1f4;return function(_0x356e74){logger[_0xaf61('0x2c')](_0x356e74[_0xaf61('0x2d')]);if(_0x356e74['name']){delete _0x356e74[_0xaf61('0x2e')];}_0x285aef[_0xaf61('0x1e')](_0x5e3735)[_0xaf61('0x2f')](_0x356e74);};}exports[_0xaf61('0x30')]=function(_0x39a87d,_0x336384){var _0x18ef76={},_0x3a8e02={},_0x347069={'count':0x0,'rows':[]};return db[_0xaf61('0x31')][_0xaf61('0x32')]()[_0xaf61('0x2b')](function(_0x4fb693){var _0x12b153=[];for(var _0x708aee=0x0;_0x708aee
','Attachments','push','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com'];(function(_0x4f52ef,_0x1121cd){var _0x284c17=function(_0x2d0c4c){while(--_0x2d0c4c){_0x4f52ef['push'](_0x4f52ef['shift']());}};_0x284c17(++_0x1121cd);}(_0x5d0a,0x175));var _0xa5d0=function(_0x36d518,_0x2de2ec){_0x36d518=_0x36d518-0x0;var _0x44404c=_0x5d0a[_0x36d518];return _0x44404c;};'use strict';var _=require(_0xa5d0('0x0'));var moment=require('moment');var random=require(_0xa5d0('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xa5d0('0x2'));var tnef=require(_0xa5d0('0x3'));var logger=require(_0xa5d0('0x4'))(_0xa5d0('0x5'));var config=require('../../../config/environment');function getAddress(_0x24b2b5){var _0x81c8f7=_[_0xa5d0('0x6')](_0x24b2b5[_0xa5d0('0x7')]);return _0x81c8f7&&_0x81c8f7[_0xa5d0('0x8')]?_0x81c8f7[_0xa5d0('0x8')]:_0xa5d0('0x9')+random[_0xa5d0('0xa')](0x6)+_0xa5d0('0xb');}function getFirstName(_0x27fe5a){var _0x3845b3=_['head'](_0x27fe5a[_0xa5d0('0x7')]);if(_0x3845b3&&_0x3845b3[_0xa5d0('0xc')]){if(_0x3845b3[_0xa5d0('0xc')]==_0x3845b3[_0xa5d0('0x8')]){return _0x3845b3[_0xa5d0('0xc')][_0xa5d0('0xd')](0x0,_0x3845b3[_0xa5d0('0xc')][_0xa5d0('0xe')]('@'));}var _0xc847c9=_0x3845b3[_0xa5d0('0xc')]['split'](/\s+/);return _0xc847c9[_0xa5d0('0xf')]>0x1?_0xc847c9['slice'](0x0,-0x1)['join']('\x20'):_0x3845b3[_0xa5d0('0xc')];}return _0xa5d0('0x10');}function getLastName(_0xe6550c){var _0x414388=_['head'](_0xe6550c['value']);if(_0x414388&&_0x414388[_0xa5d0('0xc')]){var _0x2a138b=_0x414388[_0xa5d0('0xc')][_0xa5d0('0x11')](/\s+/);return _0x2a138b[_0xa5d0('0xf')]>0x1?_0x2a138b[_0xa5d0('0x12')]():'';}return'';}function getMails(_0x1461d5,_0x5b267d){var _0x2da9ec='';for(var _0x5bfe18=0x0;_0x5bfe18<_0x5b267d[_0xa5d0('0x7')][_0xa5d0('0xf')];_0x5bfe18+=0x1){if(_0x5b267d['value'][_0x5bfe18]['address']!==_0x1461d5){if(!_[_0xa5d0('0x13')](_0x2da9ec)){_0x2da9ec+=',';}_0x2da9ec+=_0x5b267d[_0xa5d0('0x7')][_0x5bfe18]['name']||_0x5b267d[_0xa5d0('0x7')][_0x5bfe18][_0xa5d0('0x8')]||'';_0x2da9ec+='\x20<';_0x2da9ec+=_0x5b267d[_0xa5d0('0x7')][_0x5bfe18][_0xa5d0('0x8')]?_0x5b267d[_0xa5d0('0x7')][_0x5bfe18][_0xa5d0('0x8')]:'anonymous'+random['generate'](0x6)+_0xa5d0('0xb');_0x2da9ec+='>';}}return _0x2da9ec;}function parseEmail(_0x135c5f,_0x4cc587,_0x5e5ddf){if(_0x4cc587[_0xa5d0('0x14')]){var _0x42a745=/