From: Andrea Amorese
Date: Fri, 5 Nov 2021 13:49:12 +0000 (+0100)
Subject: Built motion from commit c0cddcae.|2.5.37
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=a839d313084389c44144250e79e477d1278ac8eb;p=motion2.git
Built motion from commit c0cddcae.|2.5.37
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 44e1814..4f3af23 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-11-05T13:29:56.970Z",
+ "time": "2021-11-05T13:40:46.278Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 7e98970..a6c7747 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-05T13:29:56.970Z",
+ "time": "2021-11-05T13:40:46.278Z",
"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 621726e..60b1508 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 _0xcd9e=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x2eea9a,_0x368daf){var _0x1ec61e=function(_0x1fc2fc){while(--_0x1fc2fc){_0x2eea9a['push'](_0x2eea9a['shift']());}};_0x1ec61e(++_0x368daf);}(_0xcd9e,0x6e));var _0xecd9=function(_0x3d4555,_0x32b1e6){_0x3d4555=_0x3d4555-0x0;var _0x12e5e5=_0xcd9e[_0x3d4555];return _0x12e5e5;};'use strict';var Sequelize=require(_0xecd9('0x0'));module[_0xecd9('0x1')]={'name':{'type':Sequelize[_0xecd9('0x2')],'get':function(_0x45376d){return this[_0xecd9('0x3')](_0xecd9('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xecd9('0x5'),_0xecd9('0x6'),'motionbar',_0xecd9('0x7'),_0xecd9('0x8'),_0xecd9('0x9'),_0xecd9('0xa'),_0xecd9('0xb')]],'msg':_0xecd9('0xc')}},'comment':_0xecd9('0xc')},'data1':{'type':Sequelize[_0xecd9('0xd')](0x1000),'comment':_0xecd9('0xe')},'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[_0xecd9('0xd')](0x1000),'comment':_0xecd9('0xf')},'data4':{'type':Sequelize[_0xecd9('0xd')](0x1000),'comments':_0xecd9('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0xecd9('0x11')}};
\ No newline at end of file
+var _0xa454=['jscripty','urlForward','browser','bot','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','motionbar'];(function(_0x19e44b,_0x561072){var _0x2efaa7=function(_0x3be7c5){while(--_0x3be7c5){_0x19e44b['push'](_0x19e44b['shift']());}};_0x2efaa7(++_0x561072);}(_0xa454,0xa3));var _0x4a45=function(_0x23cbde,_0x3579b2){_0x23cbde=_0x23cbde-0x0;var _0x1cc6b5=_0xa454[_0x23cbde];return _0x1cc6b5;};'use strict';var Sequelize=require(_0x4a45('0x0'));module[_0x4a45('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5e8d23){return this[_0x4a45('0x2')](_0x4a45('0x3'));}},'action':{'type':Sequelize[_0x4a45('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4a45('0x5'),'integration',_0x4a45('0x6'),_0x4a45('0x7'),_0x4a45('0x8'),_0x4a45('0x9'),_0x4a45('0xa'),'script']],'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[_0x4a45('0x4')](0x1000),'comment':_0x4a45('0xb')},'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[_0x4a45('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x4a45('0xc')},'data5':{'type':Sequelize[_0x4a45('0x4')](0x1000),'comments':_0x4a45('0xd')},'data6':{'type':Sequelize[_0x4a45('0x4')],'comments':_0x4a45('0xe')},'data7':{'type':Sequelize[_0x4a45('0xf')],'comments':_0x4a45('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index db0607b..83162e6 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 _0xf8a0=['count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','body','Action','find','catch','params','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0xf8a0,0x17b));var _0x0f8a=function(_0x2eb47c,_0x43bdf3){_0x2eb47c=_0x2eb47c-0x0;var _0x13097b=_0xf8a0[_0x2eb47c];return _0x13097b;};'use strict';var emlformat=require(_0x0f8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f8a('0x1'));var jsonpatch=require(_0x0f8a('0x2'));var rp=require('request-promise');var moment=require(_0x0f8a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0f8a('0x4'));var util=require('util');var path=require(_0x0f8a('0x5'));var sox=require(_0x0f8a('0x6'));var csv=require(_0x0f8a('0x7'));var ejs=require(_0x0f8a('0x8'));var fs=require('fs');var fs_extra=require(_0x0f8a('0x9'));var _=require('lodash');var squel=require(_0x0f8a('0xa'));var crypto=require(_0x0f8a('0xb'));var jsforce=require(_0x0f8a('0xc'));var deskjs=require(_0x0f8a('0xd'));var toCsv=require(_0x0f8a('0x7'));var querystring=require(_0x0f8a('0xe'));var Papa=require(_0x0f8a('0xf'));var Redis=require('ioredis');var authService=require(_0x0f8a('0x10'));var qs=require(_0x0f8a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f8a('0x12'));var logger=require('../../config/logger')(_0x0f8a('0x13'));var utils=require('../../config/utils');var config=require(_0x0f8a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f8a('0x15'))['db'];function respondWithStatusCode(_0xa6a4ac,_0x5575d6){_0x5575d6=_0x5575d6||0xcc;return function(_0x3d2e28){if(_0x3d2e28){return _0xa6a4ac[_0x0f8a('0x16')](_0x5575d6);}return _0xa6a4ac[_0x0f8a('0x17')](_0x5575d6)['end']();};}function respondWithResult(_0x53d3f6,_0xaf3d21){_0xaf3d21=_0xaf3d21||0xc8;return function(_0x9dc67){if(_0x9dc67){return _0x53d3f6[_0x0f8a('0x17')](_0xaf3d21)['json'](_0x9dc67);}};}function respondWithFilteredResult(_0x11a192,_0x3560b0){return function(_0x12fb51){if(_0x12fb51){var _0x2b85ce=typeof _0x3560b0[_0x0f8a('0x18')]===_0x0f8a('0x19')&&typeof _0x3560b0['limit']===_0x0f8a('0x19');var _0x58caf2=_0x12fb51[_0x0f8a('0x1a')];var _0x1db1e5=_0x2b85ce?0x0:_0x3560b0['offset'];var _0x51fa31=_0x2b85ce?_0x12fb51[_0x0f8a('0x1a')]:_0x3560b0['offset']+_0x3560b0[_0x0f8a('0x1b')];var _0x4b5e0b;if(_0x51fa31>=_0x58caf2){_0x51fa31=_0x58caf2;_0x4b5e0b=0xc8;}else{_0x4b5e0b=0xce;}_0x11a192[_0x0f8a('0x17')](_0x4b5e0b);return _0x11a192[_0x0f8a('0x1c')]('Content-Range',_0x1db1e5+'-'+_0x51fa31+'/'+_0x58caf2)['json'](_0x12fb51);}return null;};}function patchUpdates(_0x3eaa78){return function(_0x53daee){try{jsonpatch[_0x0f8a('0x1d')](_0x53daee,_0x3eaa78,!![]);}catch(_0x5f0b34){return BPromise[_0x0f8a('0x1e')](_0x5f0b34);}return _0x53daee[_0x0f8a('0x1f')]();};}function saveUpdates(_0x5a54fc,_0x4ad4a1){return function(_0x3b6259){if(_0x3b6259){return _0x3b6259[_0x0f8a('0x20')](_0x5a54fc)[_0x0f8a('0x21')](function(_0x2e6aac){return _0x2e6aac;});}return null;};}function removeEntity(_0x583c25,_0x3a97cb){return function(_0xbb543){if(_0xbb543){return _0xbb543[_0x0f8a('0x22')]()[_0x0f8a('0x21')](function(){_0x583c25[_0x0f8a('0x17')](0xcc)[_0x0f8a('0x23')]();});}};}function handleEntityNotFound(_0x3a544f,_0x3a21c0){return function(_0xc01ee9){if(!_0xc01ee9){_0x3a544f[_0x0f8a('0x16')](0x194);}return _0xc01ee9;};}function handleError(_0x908df3,_0x485f8a){_0x485f8a=_0x485f8a||0x1f4;return function(_0x4cf116){logger[_0x0f8a('0x24')](_0x4cf116[_0x0f8a('0x25')]);if(_0x4cf116[_0x0f8a('0x26')]){delete _0x4cf116[_0x0f8a('0x26')];}_0x908df3[_0x0f8a('0x17')](_0x485f8a)[_0x0f8a('0x27')](_0x4cf116);};}exports[_0x0f8a('0x20')]=function(_0x5ab245,_0x3f3873){if(_0x5ab245[_0x0f8a('0x28')]['id']){delete _0x5ab245['body']['id'];}return db[_0x0f8a('0x29')][_0x0f8a('0x2a')]({'where':{'id':_0x5ab245['params']['id']}})['then'](handleEntityNotFound(_0x3f3873,null))[_0x0f8a('0x21')](saveUpdates(_0x5ab245['body'],null))[_0x0f8a('0x21')](respondWithResult(_0x3f3873,null))[_0x0f8a('0x2b')](handleError(_0x3f3873,null));};exports[_0x0f8a('0x22')]=function(_0x113726,_0xd3d7bb){return db[_0x0f8a('0x29')][_0x0f8a('0x2a')]({'where':{'id':_0x113726[_0x0f8a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xd3d7bb,null))[_0x0f8a('0x21')](removeEntity(_0xd3d7bb,null))['catch'](handleError(_0xd3d7bb,null));};
\ No newline at end of file
+var _0x212a=['reject','save','update','then','error','name','send','body','Action','params','catch','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x26779f,_0x552286){var _0x2c943d=function(_0x5c947f){while(--_0x5c947f){_0x26779f['push'](_0x26779f['shift']());}};_0x2c943d(++_0x552286);}(_0x212a,0x1a1));var _0xa212=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x212a[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xa212('0x0'));var rimraf=require(_0xa212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa212('0x2'));var rp=require(_0xa212('0x3'));var moment=require('moment');var BPromise=require(_0xa212('0x4'));var Mustache=require(_0xa212('0x5'));var util=require(_0xa212('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa212('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa212('0x8'));var _=require(_0xa212('0x9'));var squel=require(_0xa212('0xa'));var crypto=require('crypto');var jsforce=require(_0xa212('0xb'));var deskjs=require(_0xa212('0xc'));var toCsv=require(_0xa212('0x7'));var querystring=require('querystring');var Papa=require(_0xa212('0xd'));var Redis=require(_0xa212('0xe'));var authService=require(_0xa212('0xf'));var qs=require(_0xa212('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa212('0x11'))('api');var utils=require(_0xa212('0x12'));var config=require(_0xa212('0x13'));var licenseUtil=require(_0xa212('0x14'));var db=require(_0xa212('0x15'))['db'];function respondWithStatusCode(_0x377c98,_0x572416){_0x572416=_0x572416||0xcc;return function(_0xf77f2){if(_0xf77f2){return _0x377c98[_0xa212('0x16')](_0x572416);}return _0x377c98[_0xa212('0x17')](_0x572416)[_0xa212('0x18')]();};}function respondWithResult(_0x36bb54,_0x159756){_0x159756=_0x159756||0xc8;return function(_0x279cb0){if(_0x279cb0){return _0x36bb54['status'](_0x159756)[_0xa212('0x19')](_0x279cb0);}};}function respondWithFilteredResult(_0x3d1933,_0xa3ae3d){return function(_0x3f79d4){if(_0x3f79d4){var _0x381caf=typeof _0xa3ae3d['offset']===_0xa212('0x1a')&&typeof _0xa3ae3d[_0xa212('0x1b')]===_0xa212('0x1a');var _0x43c9f8=_0x3f79d4[_0xa212('0x1c')];var _0x39bffc=_0x381caf?0x0:_0xa3ae3d[_0xa212('0x1d')];var _0x1b48e9=_0x381caf?_0x3f79d4[_0xa212('0x1c')]:_0xa3ae3d[_0xa212('0x1d')]+_0xa3ae3d['limit'];var _0x5641f;if(_0x1b48e9>=_0x43c9f8){_0x1b48e9=_0x43c9f8;_0x5641f=0xc8;}else{_0x5641f=0xce;}_0x3d1933[_0xa212('0x17')](_0x5641f);return _0x3d1933[_0xa212('0x1e')](_0xa212('0x1f'),_0x39bffc+'-'+_0x1b48e9+'/'+_0x43c9f8)[_0xa212('0x19')](_0x3f79d4);}return null;};}function patchUpdates(_0x47429b){return function(_0x15b58c){try{jsonpatch[_0xa212('0x20')](_0x15b58c,_0x47429b,!![]);}catch(_0x283fd1){return BPromise[_0xa212('0x21')](_0x283fd1);}return _0x15b58c[_0xa212('0x22')]();};}function saveUpdates(_0x5dc542,_0x16d92f){return function(_0x508911){if(_0x508911){return _0x508911[_0xa212('0x23')](_0x5dc542)[_0xa212('0x24')](function(_0x476115){return _0x476115;});}return null;};}function removeEntity(_0x3d739d,_0x578ed6){return function(_0x18c240){if(_0x18c240){return _0x18c240['destroy']()[_0xa212('0x24')](function(){_0x3d739d[_0xa212('0x17')](0xcc)[_0xa212('0x18')]();});}};}function handleEntityNotFound(_0x448f39,_0x9ca609){return function(_0x9bf3fe){if(!_0x9bf3fe){_0x448f39[_0xa212('0x16')](0x194);}return _0x9bf3fe;};}function handleError(_0x512a23,_0x2914d6){_0x2914d6=_0x2914d6||0x1f4;return function(_0x248f48){logger[_0xa212('0x25')](_0x248f48['stack']);if(_0x248f48[_0xa212('0x26')]){delete _0x248f48[_0xa212('0x26')];}_0x512a23[_0xa212('0x17')](_0x2914d6)[_0xa212('0x27')](_0x248f48);};}exports['update']=function(_0x38847b,_0x173bad){if(_0x38847b[_0xa212('0x28')]['id']){delete _0x38847b[_0xa212('0x28')]['id'];}return db[_0xa212('0x29')]['find']({'where':{'id':_0x38847b[_0xa212('0x2a')]['id']}})[_0xa212('0x24')](handleEntityNotFound(_0x173bad,null))[_0xa212('0x24')](saveUpdates(_0x38847b[_0xa212('0x28')],null))['then'](respondWithResult(_0x173bad,null))[_0xa212('0x2b')](handleError(_0x173bad,null));};exports['destroy']=function(_0xcba841,_0x4c285e){return db[_0xa212('0x29')][_0xa212('0x2c')]({'where':{'id':_0xcba841['params']['id']}})['then'](handleEntityNotFound(_0x4c285e,null))['then'](removeEntity(_0x4c285e,null))['catch'](handleError(_0x4c285e,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index a95a40d..9c1dc4e 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 _0x6856=['moment','bluebird','rimraf','../../config/environment','exports','define','Action','tools_actions','util','api'];(function(_0x47b381,_0x38cb74){var _0x1ee2c9=function(_0x566123){while(--_0x566123){_0x47b381['push'](_0x47b381['shift']());}};_0x1ee2c9(++_0x38cb74);}(_0x6856,0x13e));var _0x6685=function(_0x343e6d,_0x5cbea0){_0x343e6d=_0x343e6d-0x0;var _0xf2ea5b=_0x6856[_0x343e6d];return _0xf2ea5b;};'use strict';var _=require('lodash');var util=require(_0x6685('0x0'));var logger=require('../../config/logger')(_0x6685('0x1'));var moment=require(_0x6685('0x2'));var BPromise=require(_0x6685('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6685('0x4'));var config=require(_0x6685('0x5'));var attributes=require('./action.attributes');module[_0x6685('0x6')]=function(_0x5e9152,_0x2162dd){return _0x5e9152[_0x6685('0x7')](_0x6685('0x8'),attributes,{'tableName':_0x6685('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8452=['lodash','../../config/logger','api','bluebird','path','rimraf','exports','define','Action','tools_actions'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8452,0x154));var _0x2845=function(_0x236209,_0x51b840){_0x236209=_0x236209-0x0;var _0x2afd5b=_0x8452[_0x236209];return _0x2afd5b;};'use strict';var _=require(_0x2845('0x0'));var util=require('util');var logger=require(_0x2845('0x1'))(_0x2845('0x2'));var moment=require('moment');var BPromise=require(_0x2845('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2845('0x4'));var rimraf=require(_0x2845('0x5'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x2845('0x6')]=function(_0x3e8494,_0x2fa9ed){return _0x3e8494[_0x2845('0x7')](_0x2845('0x8'),attributes,{'tableName':_0x2845('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 68539de..5407bcc 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4853a9,_0x506436){_0x4853a9=_0x4853a9-0x0;var _0x2294c7=_0x1cb9[_0x4853a9];return _0x2294c7;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xf494,0x1c6));var _0x4f49=function(_0x1de023,_0x17334d){_0x1de023=_0x1de023-0x0;var _0x1b25ff=_0xf494[_0x1de023];return _0x1b25ff;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 3149bc5..1a0a715 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 _0x4561=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4561,0x125));var _0x1456=function(_0x3dabc0,_0x1c0f3e){_0x3dabc0=_0x3dabc0-0x0;var _0x5a3550=_0x4561[_0x3dabc0];return _0x5a3550;};'use strict';var multer=require(_0x1456('0x0'));var util=require(_0x1456('0x1'));var path=require('path');var timeout=require(_0x1456('0x2'));var express=require('express');var router=express[_0x1456('0x3')]();var fs_extra=require(_0x1456('0x4'));var auth=require(_0x1456('0x5'));var interaction=require(_0x1456('0x6'));var config=require(_0x1456('0x7'));var controller=require(_0x1456('0x8'));router[_0x1456('0x9')](_0x1456('0xa'),auth['isAuthenticated'](),controller[_0x1456('0xb')]);router[_0x1456('0xc')](_0x1456('0xa'),auth[_0x1456('0xd')](),controller[_0x1456('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xac59=['update','delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','/:id'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xac59,0x17e));var _0x9ac5=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xac59[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x9ac5('0x0'));var util=require(_0x9ac5('0x1'));var path=require(_0x9ac5('0x2'));var timeout=require(_0x9ac5('0x3'));var express=require(_0x9ac5('0x4'));var router=express[_0x9ac5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9ac5('0x6'));var interaction=require(_0x9ac5('0x7'));var config=require('../../config/environment');var controller=require(_0x9ac5('0x8'));router['put'](_0x9ac5('0x9'),auth['isAuthenticated'](),controller[_0x9ac5('0xa')]);router[_0x9ac5('0xb')]('/:id',auth[_0x9ac5('0xc')](),controller['destroy']);module[_0x9ac5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 28508d4..96e616e 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x1f7f1d,_0x401d09){var _0x44c5d2=function(_0x3c8e46){while(--_0x3c8e46){_0x1f7f1d['push'](_0x1f7f1d['shift']());}};_0x44c5d2(++_0x401d09);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x24d438,_0x2054a5){_0x24d438=_0x24d438-0x0;var _0x149d29=_0x9c5a[_0x24d438];return _0x149d29;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xbd51=['sequelize','STRING'];(function(_0xac1d19,_0x447fa8){var _0x1133e0=function(_0x44a661){while(--_0x44a661){_0xac1d19['push'](_0xac1d19['shift']());}};_0x1133e0(++_0x447fa8);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3e542d,_0x30face){_0x3e542d=_0x3e542d-0x0;var _0x5b385b=_0xbd51[_0x3e542d];return _0x5b385b;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index bd1f376..2bd89be 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 _0x39bc=['CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%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)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','AVG(%s)','HOUR(%s)','Sequelize','ValidationErrorItem','select','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','savename','countTable','COUNT(*)','sequelize','SELECT','runReport','MAX(%s)','ROUND(%s)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','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','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation'];(function(_0x45ce90,_0x114609){var _0x313c45=function(_0x55102a){while(--_0x55102a){_0x45ce90['push'](_0x45ce90['shift']());}};_0x313c45(++_0x114609);}(_0x39bc,0xf8));var _0xc39b=function(_0x2aefec,_0x44aafd){_0x2aefec=_0x2aefec-0x0;var _0x533057=_0x39bc[_0x2aefec];return _0x533057;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc39b('0x0'));var zipdir=require(_0xc39b('0x1'));var jsonpatch=require(_0xc39b('0x2'));var rp=require(_0xc39b('0x3'));var moment=require(_0xc39b('0x4'));var BPromise=require(_0xc39b('0x5'));var Mustache=require(_0xc39b('0x6'));var util=require('util');var path=require(_0xc39b('0x7'));var sox=require(_0xc39b('0x8'));var csv=require('to-csv');var ejs=require(_0xc39b('0x9'));var fs=require('fs');var fs_extra=require(_0xc39b('0xa'));var _=require(_0xc39b('0xb'));var squel=require(_0xc39b('0xc'));var crypto=require(_0xc39b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc39b('0xe'));var Papa=require(_0xc39b('0xf'));var Redis=require(_0xc39b('0x10'));var authService=require(_0xc39b('0x11'));var qs=require(_0xc39b('0x12'));var as=require(_0xc39b('0x13'));var hardwareService=require(_0xc39b('0x14'));var logger=require(_0xc39b('0x15'))(_0xc39b('0x16'));var utils=require(_0xc39b('0x17'));var config=require(_0xc39b('0x18'));var licenseUtil=require(_0xc39b('0x19'));var db=require(_0xc39b('0x1a'))['db'];var dbH=require(_0xc39b('0x1a'))[_0xc39b('0x1b')];function respondWithStatusCode(_0x6a991a,_0x4cd0ea){_0x4cd0ea=_0x4cd0ea||0xcc;return function(_0x2b608b){if(_0x2b608b){return _0x6a991a[_0xc39b('0x1c')](_0x4cd0ea);}return _0x6a991a[_0xc39b('0x1d')](_0x4cd0ea)[_0xc39b('0x1e')]();};}function respondWithResult(_0x56daa4,_0x1518ad){_0x1518ad=_0x1518ad||0xc8;return function(_0x4042fb){if(_0x4042fb){return _0x56daa4[_0xc39b('0x1d')](_0x1518ad)[_0xc39b('0x1f')](_0x4042fb);}};}function respondWithFilteredResult(_0x481672,_0x15c592){return function(_0x4f5455){if(_0x4f5455){var _0x3e7400=typeof _0x15c592[_0xc39b('0x20')]===_0xc39b('0x21')&&typeof _0x15c592['limit']===_0xc39b('0x21');var _0x3da9b8=_0x4f5455[_0xc39b('0x22')];var _0x30958a=_0x3e7400?0x0:_0x15c592[_0xc39b('0x20')];var _0x224b28=_0x3e7400?_0x4f5455[_0xc39b('0x22')]:_0x15c592[_0xc39b('0x20')]+_0x15c592[_0xc39b('0x23')];var _0x42483f;if(_0x224b28>=_0x3da9b8){_0x224b28=_0x3da9b8;_0x42483f=0xc8;}else{_0x42483f=0xce;}_0x481672[_0xc39b('0x1d')](_0x42483f);return _0x481672[_0xc39b('0x24')](_0xc39b('0x25'),_0x30958a+'-'+_0x224b28+'/'+_0x3da9b8)['json'](_0x4f5455);}return null;};}function patchUpdates(_0x10c266){return function(_0xfc8494){try{jsonpatch[_0xc39b('0x26')](_0xfc8494,_0x10c266,!![]);}catch(_0x20a7a6){return BPromise[_0xc39b('0x27')](_0x20a7a6);}return _0xfc8494[_0xc39b('0x28')]();};}function saveUpdates(_0x50b748,_0x39d059){return function(_0x459e9a){if(_0x459e9a){return _0x459e9a[_0xc39b('0x29')](_0x50b748)[_0xc39b('0x2a')](function(_0x407f44){return _0x407f44;});}return null;};}function removeEntity(_0x3d2f59,_0x5d6d2f){return function(_0x3e6989){if(_0x3e6989){return _0x3e6989[_0xc39b('0x2b')]()[_0xc39b('0x2a')](function(){var _0x4a7fe8=_0x3e6989[_0xc39b('0x2c')]({'plain':!![]});var _0x11f55e='CustomReports';return db[_0xc39b('0x2d')][_0xc39b('0x2b')]({'where':{'type':_0x11f55e,'resourceId':_0x4a7fe8['id']}})[_0xc39b('0x2a')](function(){return _0x3e6989;});})[_0xc39b('0x2a')](function(){_0x3d2f59[_0xc39b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4065ce,_0x24d3a8){return function(_0x2b5940){if(!_0x2b5940){_0x4065ce[_0xc39b('0x1c')](0x194);}return _0x2b5940;};}function handleError(_0x4889fa,_0x5bb88c){_0x5bb88c=_0x5bb88c||0x1f4;return function(_0xae7d10){logger[_0xc39b('0x2e')](_0xae7d10[_0xc39b('0x2f')]);if(_0xae7d10[_0xc39b('0x30')]){delete _0xae7d10[_0xc39b('0x30')];}_0x4889fa[_0xc39b('0x1d')](_0x5bb88c)['send'](_0xae7d10);};}exports[_0xc39b('0x31')]=function(_0x4a4231,_0x1c2580){var _0x238771={},_0xa0e7f1={},_0xcd336={'count':0x0,'rows':[]};var _0x22b2e6=_[_0xc39b('0x32')](db[_0xc39b('0x33')][_0xc39b('0x34')],function(_0x2b4b7c){return{'name':_0x2b4b7c[_0xc39b('0x35')],'type':_0x2b4b7c[_0xc39b('0x36')][_0xc39b('0x37')]};});_0xa0e7f1[_0xc39b('0x38')]=_['map'](_0x22b2e6,_0xc39b('0x30'));_0xa0e7f1[_0xc39b('0x39')]=_[_0xc39b('0x3a')](_0x4a4231['query']);_0xa0e7f1[_0xc39b('0x3b')]=_['intersection'](_0xa0e7f1[_0xc39b('0x38')],_0xa0e7f1['query']);_0x238771[_0xc39b('0x3c')]=_[_0xc39b('0x3d')](_0xa0e7f1[_0xc39b('0x38')],qs['fields'](_0x4a4231[_0xc39b('0x39')][_0xc39b('0x3e')]));_0x238771['attributes']=_0x238771[_0xc39b('0x3c')][_0xc39b('0x3f')]?_0x238771[_0xc39b('0x3c')]:_0xa0e7f1[_0xc39b('0x38')];if(!_0x4a4231['query']['hasOwnProperty'](_0xc39b('0x40'))){_0x238771[_0xc39b('0x23')]=qs[_0xc39b('0x23')](_0x4a4231['query'][_0xc39b('0x23')]);_0x238771[_0xc39b('0x20')]=qs[_0xc39b('0x20')](_0x4a4231['query'][_0xc39b('0x20')]);}_0x238771[_0xc39b('0x41')]=qs[_0xc39b('0x42')](_0x4a4231[_0xc39b('0x39')][_0xc39b('0x42')]);_0x238771['where']=qs[_0xc39b('0x3b')](_['pick'](_0x4a4231['query'],_0xa0e7f1[_0xc39b('0x3b')]),_0x22b2e6);if(_0x4a4231[_0xc39b('0x39')][_0xc39b('0x43')]){_0x238771[_0xc39b('0x44')]=_[_0xc39b('0x45')](_0x238771[_0xc39b('0x44')],{'$or':_[_0xc39b('0x32')](_0x22b2e6,function(_0x443eb8){if(_0x443eb8[_0xc39b('0x36')]!=='VIRTUAL'){var _0x19088d={};_0x19088d[_0x443eb8[_0xc39b('0x30')]]={'$like':'%'+_0x4a4231[_0xc39b('0x39')][_0xc39b('0x43')]+'%'};return _0x19088d;}})});}_0x238771=_['merge']({},_0x238771,_0x4a4231[_0xc39b('0x46')]);var _0x536f9={'where':_0x238771[_0xc39b('0x44')]};return db[_0xc39b('0x33')][_0xc39b('0x22')](_0x536f9)[_0xc39b('0x2a')](function(_0x388444){_0xcd336[_0xc39b('0x22')]=_0x388444;if(_0x4a4231[_0xc39b('0x39')]['includeAll']){_0x238771[_0xc39b('0x47')]=[{'all':!![]}];}return db[_0xc39b('0x33')][_0xc39b('0x48')](_0x238771);})[_0xc39b('0x2a')](function(_0x2050c9){_0xcd336['rows']=_0x2050c9;return _0xcd336;})[_0xc39b('0x2a')](respondWithFilteredResult(_0x1c2580,_0x238771))[_0xc39b('0x49')](handleError(_0x1c2580,null));};exports[_0xc39b('0x4a')]=function(_0x1cf902,_0x2a2111){var _0xdc9a7d={'raw':![],'where':{'id':_0x1cf902[_0xc39b('0x4b')]['id']}},_0x12d4d9={};_0x12d4d9[_0xc39b('0x38')]=_['keys'](db[_0xc39b('0x33')]['rawAttributes']);_0x12d4d9['query']=_['keys'](_0x1cf902[_0xc39b('0x39')]);_0x12d4d9[_0xc39b('0x3b')]=_[_0xc39b('0x3d')](_0x12d4d9['model'],_0x12d4d9[_0xc39b('0x39')]);_0xdc9a7d[_0xc39b('0x3c')]=_[_0xc39b('0x3d')](_0x12d4d9[_0xc39b('0x38')],qs[_0xc39b('0x3e')](_0x1cf902[_0xc39b('0x39')][_0xc39b('0x3e')]));_0xdc9a7d[_0xc39b('0x3c')]=_0xdc9a7d[_0xc39b('0x3c')][_0xc39b('0x3f')]?_0xdc9a7d[_0xc39b('0x3c')]:_0x12d4d9[_0xc39b('0x38')];if(_0x1cf902[_0xc39b('0x39')][_0xc39b('0x4c')]){_0xdc9a7d[_0xc39b('0x47')]=[{'all':!![]}];}_0xdc9a7d=_[_0xc39b('0x45')]({},_0xdc9a7d,_0x1cf902[_0xc39b('0x46')]);return db[_0xc39b('0x33')][_0xc39b('0x4d')](_0xdc9a7d)['then'](handleEntityNotFound(_0x2a2111,null))['then'](respondWithResult(_0x2a2111,null))[_0xc39b('0x49')](handleError(_0x2a2111,null));};exports[_0xc39b('0x4e')]=function(_0x328270,_0x2db38f){return db[_0xc39b('0x33')][_0xc39b('0x4e')](_0x328270[_0xc39b('0x4f')],{})[_0xc39b('0x2a')](function(_0x5f0474){var _0xfc1f86=_0x328270['user'][_0xc39b('0x2c')]({'plain':!![]});if(!_0xfc1f86)throw new Error(_0xc39b('0x50'));if(_0xfc1f86[_0xc39b('0x51')]===_0xc39b('0x52')){var _0xb3a3f=_0x5f0474[_0xc39b('0x2c')]({'plain':!![]});var _0x57d8a8=_0xc39b('0x53');return db['UserProfileSection'][_0xc39b('0x4d')]({'where':{'name':_0x57d8a8,'userProfileId':_0xfc1f86[_0xc39b('0x54')]},'raw':!![]})[_0xc39b('0x2a')](function(_0x69026c){if(_0x69026c&&_0x69026c[_0xc39b('0x55')]===0x0){return db[_0xc39b('0x2d')][_0xc39b('0x4e')]({'name':_0xb3a3f[_0xc39b('0x30')],'resourceId':_0xb3a3f['id'],'type':_0xc39b('0x56'),'sectionId':_0x69026c['id']},{})[_0xc39b('0x2a')](function(){return _0x5f0474;});}else{return _0x5f0474;}})[_0xc39b('0x49')](function(_0x513872){logger[_0xc39b('0x2e')](_0xc39b('0x57'),_0x513872);throw _0x513872;});}return _0x5f0474;})['then'](respondWithResult(_0x2db38f,0xc9))['catch'](handleError(_0x2db38f,null));};exports[_0xc39b('0x29')]=function(_0x35bcdd,_0x4e905d){if(_0x35bcdd[_0xc39b('0x4f')]['id']){delete _0x35bcdd[_0xc39b('0x4f')]['id'];}return db['AnalyticCustomReport'][_0xc39b('0x4d')]({'where':{'id':_0x35bcdd[_0xc39b('0x4b')]['id']}})[_0xc39b('0x2a')](handleEntityNotFound(_0x4e905d,null))[_0xc39b('0x2a')](saveUpdates(_0x35bcdd[_0xc39b('0x4f')],null))[_0xc39b('0x2a')](respondWithResult(_0x4e905d,null))[_0xc39b('0x49')](handleError(_0x4e905d,null));};exports[_0xc39b('0x2b')]=function(_0x2aa155,_0x369171){return db['AnalyticCustomReport']['find']({'where':{'id':_0x2aa155[_0xc39b('0x4b')]['id']}})[_0xc39b('0x2a')](handleEntityNotFound(_0x369171,null))[_0xc39b('0x2a')](removeEntity(_0x369171,null))['catch'](handleError(_0x369171,null));};exports[_0xc39b('0x58')]=function(_0x24d72c,_0x55465){var _0x4d3bd2=0xa;var _0x2e65d2=[_0xc39b('0x59'),_0xc39b('0x5a'),_0xc39b('0x5b'),_0xc39b('0x5c')];var _0x4fc03d={'SUM':_0xc39b('0x5d'),'COUNT':_0xc39b('0x5e'),'COUNT DISTINCT':_0xc39b('0x5f'),'MAX':'MAX(%s)','MIN':_0xc39b('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc39b('0x61'),'GROUP_CONCAT ASC':_0xc39b('0x62'),'GROUP_CONCAT DESC':_0xc39b('0x63')};var _0x26772c={'SEC_TO_TIME':_0xc39b('0x64'),'DATE':_0xc39b('0x65'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc39b('0x66')};var _0x500513=function(_0x143dd0){return!_['includes']([_0xc39b('0x67'),_0xc39b('0x68'),_0xc39b('0x69'),_0xc39b('0x6a')],_0x143dd0);};var _0x14f664=function(_0x433ced){if(!_0x433ced||!_0x433ced[_0xc39b('0x6b')]['length']){return'';}for(var _0x377f2a='(',_0x4a0e5b=0x0;_0x4a0e5b<_0x433ced[_0xc39b('0x6b')][_0xc39b('0x3f')];_0x4a0e5b+=0x1){_0x4a0e5b>0x0&&(_0x377f2a+='\x20'+_0x433ced[_0xc39b('0x6c')]+'\x20');_0x377f2a+=_0x433ced[_0xc39b('0x6b')][_0x4a0e5b][_0xc39b('0x6d')]?_0x14f664(_0x433ced[_0xc39b('0x6b')][_0x4a0e5b][_0xc39b('0x6d')]):_0x433ced[_0xc39b('0x6b')][_0x4a0e5b][_0xc39b('0x6e')]+'\x20'+_0x433ced[_0xc39b('0x6b')][_0x4a0e5b][_0xc39b('0x6f')]+(_0x500513(_0x433ced[_0xc39b('0x6b')][_0x4a0e5b][_0xc39b('0x6f')])?'\x20'+_0x433ced['rules'][_0x4a0e5b][_0xc39b('0x70')]:'');}return _0x377f2a+')';};var _0x226e19={'where':{'id':_0x24d72c[_0xc39b('0x4b')]['id']}},_0x5f22ce,_0xfb0f45,_0xe92990,_0x2ed2e3,_0x33a346;_0x226e19=_[_0xc39b('0x45')]({},_0x226e19,_0x24d72c[_0xc39b('0x46')]);return db[_0xc39b('0x33')][_0xc39b('0x4d')](_0x226e19)[_0xc39b('0x2a')](function(_0x26401a){if(_0x26401a){_0x5f22ce=_0x26401a;return _0x26401a[_0xc39b('0x71')]();}return null;})[_0xc39b('0x2a')](function(_0xf8506c){if(_0xf8506c){if(!_0xf8506c[_0xc39b('0x3f')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc39b('0x72'),0x193);}_0xfb0f45=_0xf8506c;return db[_0xc39b('0x73')][_0xc39b('0x48')]({'raw':!![]});}return null;})['then'](function(_0x103928){if(_0x103928){_0xe92990=_[_0xc39b('0x74')](_0x103928,'id');var _0x3aea8c;var _0x116faa=squel['select']();_0x116faa[_0xc39b('0x75')](_0x5f22ce[_0xc39b('0x76')]);for(var _0xb5782f=0x0;_0xb5782f<_0xfb0f45[_0xc39b('0x3f')];_0xb5782f+=0x1){_0x3aea8c=_0xfb0f45[_0xb5782f][_0xc39b('0x77')]?_0xe92990[_0xfb0f45[_0xb5782f][_0xc39b('0x77')]][_0xc39b('0x78')]:_0xfb0f45[_0xb5782f]['field'];_0x3aea8c=_0xfb0f45[_0xb5782f][_0xc39b('0x79')]?_[_0xc39b('0x7a')](_0x4fc03d[_0xfb0f45[_0xb5782f][_0xc39b('0x79')]],'%s',_0x3aea8c):_0x3aea8c;_0x3aea8c=_0xfb0f45[_0xb5782f][_0xc39b('0x7b')]?_[_0xc39b('0x7a')](_0x26772c[_0xfb0f45[_0xb5782f][_0xc39b('0x7b')]],'%s',_0x3aea8c):_0x3aea8c;if(_0xfb0f45[_0xb5782f][_0xc39b('0x7c')]){_0x116faa[_0xc39b('0x6d')](_0x3aea8c);}_0xfb0f45[_0xb5782f][_0xc39b('0x7d')]&&_0x116faa['order'](_0x3aea8c,_0xfb0f45[_0xb5782f]['orderBy']===_0xc39b('0x7e')?![]:!![]);_0x116faa[_0xc39b('0x6e')](_0x3aea8c,_0xfb0f45[_0xb5782f][_0xc39b('0x7f')]||_0x3aea8c);}if(_0x5f22ce[_0xc39b('0x80')]){_0x5f22ce['joins']=JSON[_0xc39b('0x81')](_0x5f22ce[_0xc39b('0x80')]);for(var _0x34a0c7=0x0;_0x34a0c7<_0x5f22ce[_0xc39b('0x80')][_0xc39b('0x3f')];_0x34a0c7+=0x1){if(_0x5f22ce[_0xc39b('0x80')][_0x34a0c7]['type']&&_[_0xc39b('0x82')](_0x2e65d2,_0x5f22ce[_0xc39b('0x80')][_0x34a0c7][_0xc39b('0x36')])&&_0x5f22ce['joins'][_0x34a0c7][_0xc39b('0x83')]&&_0x5f22ce[_0xc39b('0x80')][_0x34a0c7][_0xc39b('0x84')]&&_0x5f22ce['joins'][_0x34a0c7][_0xc39b('0x85')]){_0x116faa[_0x5f22ce['joins'][_0x34a0c7][_0xc39b('0x36')]](_0x5f22ce[_0xc39b('0x80')][_0x34a0c7]['foreignTable'],null,util['format'](_0xc39b('0x86'),_0x5f22ce['table'],_0x5f22ce[_0xc39b('0x80')][_0x34a0c7][_0xc39b('0x83')],_0x5f22ce[_0xc39b('0x80')][_0x34a0c7]['foreignTable'],_0x5f22ce[_0xc39b('0x80')][_0x34a0c7][_0xc39b('0x85')]));}}}if(_0x5f22ce[_0xc39b('0x87')]){_0x5f22ce[_0xc39b('0x87')]=JSON[_0xc39b('0x81')](_0x5f22ce[_0xc39b('0x87')]);_0x116faa[_0xc39b('0x44')](_0x14f664(_0x5f22ce[_0xc39b('0x87')]['group']));}_0x33a346=_0x116faa[_0xc39b('0x88')]();_0x116faa[_0xc39b('0x23')](_0x4d3bd2);_0x116faa[_0xc39b('0x20')](0x0);logger[_0xc39b('0x89')](_0xc39b('0x8a'),_0x116faa[_0xc39b('0x8b')]());return dbH['sequelize'][_0xc39b('0x39')](_0x116faa['toString'](),{'type':dbH['sequelize'][_0xc39b('0x8c')]['SELECT']});}})[_0xc39b('0x2a')](respondWithResult(_0x55465,null))[_0xc39b('0x49')](handleError(_0x55465,null));};function runReport(_0x373bd8,_0x152efe,_0x4c7231){var _0x4be968=_0x152efe[_0xc39b('0x30')];var _0x5adf8c=0xa;var _0x2eaf76=[_0xc39b('0x59'),_0xc39b('0x5a'),_0xc39b('0x5b'),_0xc39b('0x5c')];var _0xa1eb20={'SUM':_0xc39b('0x5d'),'COUNT':_0xc39b('0x5e'),'COUNT DISTINCT':_0xc39b('0x5f'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xc39b('0x8d'),'GROUP_CONCAT':_0xc39b('0x61'),'GROUP_CONCAT ASC':_0xc39b('0x62'),'GROUP_CONCAT DESC':_0xc39b('0x63')};var _0x23dc14={'SEC_TO_TIME':_0xc39b('0x64'),'DATE':'DATE(%s)','HOUR':_0xc39b('0x8e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc39b('0x66')};var _0x44fb35=function(_0x2d6e93){return!_[_0xc39b('0x82')]([_0xc39b('0x67'),_0xc39b('0x68'),_0xc39b('0x69'),_0xc39b('0x6a')],_0x2d6e93);};var _0x32f141=function(_0x4546f2){if(!_0x4546f2||!_0x4546f2['rules'][_0xc39b('0x3f')]){return'';}for(var _0x45ae8f='(',_0x34575a=0x0;_0x34575a<_0x4546f2[_0xc39b('0x6b')][_0xc39b('0x3f')];_0x34575a+=0x1){_0x34575a>0x0&&(_0x45ae8f+='\x20'+_0x4546f2[_0xc39b('0x6c')]+'\x20');_0x45ae8f+=_0x4546f2[_0xc39b('0x6b')][_0x34575a][_0xc39b('0x6d')]?_0x32f141(_0x4546f2[_0xc39b('0x6b')][_0x34575a][_0xc39b('0x6d')]):_0x4546f2[_0xc39b('0x6b')][_0x34575a][_0xc39b('0x6e')]+'\x20'+_0x4546f2[_0xc39b('0x6b')][_0x34575a]['condition']+(_0x44fb35(_0x4546f2['rules'][_0x34575a][_0xc39b('0x6f')])?'\x20'+_0x4546f2[_0xc39b('0x6b')][_0x34575a][_0xc39b('0x70')]:'');}return _0x45ae8f+')';};var _0x5ef6cd={'where':{'id':_0x373bd8['id']}},_0x350732,_0x5e84c8,_0x1a3a24,_0x85ea37,_0x3d3d98;_0x5ef6cd=_['merge']({},_0x5ef6cd,_0x4c7231);return db[_0xc39b('0x33')][_0xc39b('0x4d')](_0x5ef6cd)['then'](function(_0x3b4e4d){if(_0x3b4e4d){_0x350732=_0x3b4e4d;return _0x3b4e4d[_0xc39b('0x71')]();}return null;})[_0xc39b('0x2a')](function(_0x10dc29){if(_0x10dc29){if(!_0x10dc29[_0xc39b('0x3f')]){throw new db[(_0xc39b('0x8f'))][(_0xc39b('0x90'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5e84c8=_0x10dc29;return db['AnalyticMetric'][_0xc39b('0x48')]({'raw':!![]});}return null;})[_0xc39b('0x2a')](function(_0x59aa1b){if(_0x59aa1b){_0x1a3a24=_[_0xc39b('0x74')](_0x59aa1b,'id');var _0x6adf95;var _0x584424=squel[_0xc39b('0x91')]();_0x584424[_0xc39b('0x75')](_0x350732[_0xc39b('0x76')]);for(var _0x1f7000=0x0;_0x1f7000<_0x5e84c8[_0xc39b('0x3f')];_0x1f7000+=0x1){_0x6adf95=_0x5e84c8[_0x1f7000][_0xc39b('0x77')]?_0x1a3a24[_0x5e84c8[_0x1f7000]['MetricId']][_0xc39b('0x78')]:_0x5e84c8[_0x1f7000][_0xc39b('0x6e')];_0x6adf95=_0x5e84c8[_0x1f7000]['function']?_[_0xc39b('0x7a')](_0xa1eb20[_0x5e84c8[_0x1f7000][_0xc39b('0x79')]],'%s',_0x6adf95):_0x6adf95;_0x6adf95=_0x5e84c8[_0x1f7000][_0xc39b('0x7b')]?_[_0xc39b('0x7a')](_0x23dc14[_0x5e84c8[_0x1f7000]['format']],'%s',_0x6adf95):_0x6adf95;if(_0x5e84c8[_0x1f7000][_0xc39b('0x7c')]){_0x584424[_0xc39b('0x6d')](_0x6adf95);}_0x5e84c8[_0x1f7000][_0xc39b('0x7d')]&&_0x584424[_0xc39b('0x41')](_0x6adf95,_0x5e84c8[_0x1f7000][_0xc39b('0x7d')]===_0xc39b('0x7e')?![]:!![]);_0x584424[_0xc39b('0x6e')](_0x6adf95,_0x5e84c8[_0x1f7000]['alias']||_0x6adf95);}if(_0x350732['joins']){_0x350732['joins']=JSON[_0xc39b('0x81')](_0x350732[_0xc39b('0x80')]);for(var _0x1929f8=0x0;_0x1929f8<_0x350732['joins'][_0xc39b('0x3f')];_0x1929f8+=0x1){if(_0x350732[_0xc39b('0x80')][_0x1929f8][_0xc39b('0x36')]&&_[_0xc39b('0x82')](_0x2eaf76,_0x350732[_0xc39b('0x80')][_0x1929f8][_0xc39b('0x36')])&&_0x350732['joins'][_0x1929f8][_0xc39b('0x83')]&&_0x350732[_0xc39b('0x80')][_0x1929f8][_0xc39b('0x84')]&&_0x350732[_0xc39b('0x80')][_0x1929f8][_0xc39b('0x85')]){_0x584424[_0x350732[_0xc39b('0x80')][_0x1929f8][_0xc39b('0x36')]](_0x350732[_0xc39b('0x80')][_0x1929f8][_0xc39b('0x84')],null,util['format'](_0xc39b('0x86'),_0x350732[_0xc39b('0x76')],_0x350732['joins'][_0x1929f8][_0xc39b('0x83')],_0x350732[_0xc39b('0x80')][_0x1929f8]['foreignTable'],_0x350732['joins'][_0x1929f8]['foreignKey']));}}}if(_0x350732[_0xc39b('0x87')]){_0x350732['conditions']=JSON[_0xc39b('0x81')](_0x350732['conditions']);_0x584424[_0xc39b('0x44')](_0x32f141(_0x350732[_0xc39b('0x87')][_0xc39b('0x6d')]));}_0x3d3d98=_0x584424[_0xc39b('0x88')]();_0x584424[_0xc39b('0x23')](_0x5adf8c);_0x584424[_0xc39b('0x20')](0x0);return;}})['then'](function(){if(_0x152efe[_0xc39b('0x92')]===_0xc39b('0x93')){return null;}var _0x3afb6d=_[_0xc39b('0x45')](_0x152efe,{'name':_0x152efe['fullPath']||_0x152efe['name']||_0x350732[_0xc39b('0x30')],'basename':_0x4be968,'savename':util['format'](_0xc39b('0x94'),_0x152efe[_0xc39b('0x30')]||_0x350732[_0xc39b('0x30')],require(_0xc39b('0x95'))[_0xc39b('0x96')](0x4),_0x152efe['output']||_0xc39b('0x97')),'reportId':_0x350732['id'],'reportType':_0xc39b('0x98')});return db['AnalyticExtractedReport'][_0xc39b('0x4e')](_0x3afb6d,{'raw':!![]});})[_0xc39b('0x2a')](function(_0xf5ece6){if(_0x350732[_0xc39b('0x76')]===_0xc39b('0x99')){_0x3d3d98['where'](_0x350732[_0xc39b('0x76')]+_0xc39b('0x9a'),_0x152efe[_0xc39b('0x9b')],_0x152efe['endDate']);}else{_0x3d3d98[_0xc39b('0x44')](_0x350732[_0xc39b('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x152efe[_0xc39b('0x9b')],_0x152efe['endDate']);}if(_0xf5ece6){logger[_0xc39b('0x9c')](_0xc39b('0x9d'),_0x3d3d98['toString']());require(_0xc39b('0x9e'))['fork'](path[_0xc39b('0x59')](__dirname,'../../components/export/',_0xf5ece6[_0xc39b('0x92')]),[_0xf5ece6['id'],_0x3d3d98[_0xc39b('0x8b')](),path[_0xc39b('0x59')](__dirname,'../../files/reports',_0xf5ece6[_0xc39b('0x9f')]),_0x4be968]);return _0xf5ece6;}else{var _0x34013a=squel[_0xc39b('0x91')]();_0x34013a[_0xc39b('0x75')]('('+_0x3d3d98[_0xc39b('0x8b')]()+')',_0xc39b('0xa0'));_0x34013a[_0xc39b('0x6e')](_0xc39b('0xa1'),_0xc39b('0x22'));_0x3d3d98[_0xc39b('0x23')](_0x152efe[_0xc39b('0x23')]||_0x5adf8c);_0x3d3d98[_0xc39b('0x20')](_0x152efe['offset']||0x0);return dbH['sequelize'][_0xc39b('0x39')](_0x34013a[_0xc39b('0x8b')](),{'type':dbH[_0xc39b('0xa2')][_0xc39b('0x8c')]['SELECT']})[_0xc39b('0x2a')](function(_0xf7ddd0){if(!_0xf7ddd0[_0xc39b('0x3f')]){_0x85ea37=0x0;}else{_0x85ea37=_0xf7ddd0[0x0]['count']||0x0;}return dbH['sequelize'][_0xc39b('0x39')](_0x3d3d98[_0xc39b('0x8b')](),{'type':dbH[_0xc39b('0xa2')][_0xc39b('0x8c')][_0xc39b('0xa3')]});})[_0xc39b('0x2a')](function(_0x1994f8){return{'rows':_0x1994f8||[],'count':_0x85ea37};});}});}exports['run']=function(_0x294a46,_0x1c3fa9){return runReport(_0x294a46[_0xc39b('0x4b')],_0x294a46[_0xc39b('0x39')],_0x294a46['options'])[_0xc39b('0x2a')](respondWithResult(_0x1c3fa9,null))[_0xc39b('0x49')](handleError(_0x1c3fa9,null));};exports[_0xc39b('0xa4')]=runReport;exports[_0xc39b('0x39')]=function(_0x2846ad,_0x269d53){var _0x519681=0xa;var _0x2c65a4=[_0xc39b('0x59'),_0xc39b('0x5a'),_0xc39b('0x5b'),_0xc39b('0x5c')];var _0x1df6ae={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc39b('0x5f'),'MAX':_0xc39b('0xa5'),'MIN':_0xc39b('0x60'),'AVG':_0xc39b('0x8d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc39b('0x62'),'GROUP_CONCAT DESC':_0xc39b('0x63')};var _0x4b101d={'SEC_TO_TIME':_0xc39b('0x64'),'DATE':_0xc39b('0x65'),'HOUR':_0xc39b('0x8e'),'ROUND':_0xc39b('0xa6'),'UNIX_TIMESTAMP':_0xc39b('0x66')};var _0x53191d=function(_0x33e912){return!_[_0xc39b('0x82')]([_0xc39b('0x67'),'IS\x20NOT\x20NULL',_0xc39b('0x69'),_0xc39b('0x6a')],_0x33e912);};var _0xd36774=function(_0x5a82f4){if(!_0x5a82f4||!_0x5a82f4[_0xc39b('0x6b')][_0xc39b('0x3f')]){return'';}for(var _0x5dbc54='(',_0x256974=0x0;_0x256974<_0x5a82f4[_0xc39b('0x6b')][_0xc39b('0x3f')];_0x256974+=0x1){_0x256974>0x0&&(_0x5dbc54+='\x20'+_0x5a82f4[_0xc39b('0x6c')]+'\x20');_0x5dbc54+=_0x5a82f4[_0xc39b('0x6b')][_0x256974]['group']?_0xd36774(_0x5a82f4[_0xc39b('0x6b')][_0x256974][_0xc39b('0x6d')]):_0x5a82f4[_0xc39b('0x6b')][_0x256974][_0xc39b('0x6e')]+'\x20'+_0x5a82f4[_0xc39b('0x6b')][_0x256974][_0xc39b('0x6f')]+(_0x53191d(_0x5a82f4[_0xc39b('0x6b')][_0x256974][_0xc39b('0x6f')])?'\x20'+_0x5a82f4[_0xc39b('0x6b')][_0x256974][_0xc39b('0x70')]:'');}return _0x5dbc54+')';};var _0x2eb31f={'where':{'id':_0x2846ad['params']['id']}},_0x5162f1,_0x5b7f87,_0x26d947,_0xff510f,_0x515000;_0x2eb31f=_[_0xc39b('0x45')]({},_0x2eb31f,_0x2846ad['options']);return db[_0xc39b('0x33')]['find'](_0x2eb31f)['then'](function(_0x125e5e){if(_0x125e5e){_0x5162f1=_0x125e5e;return _0x125e5e[_0xc39b('0x71')]();}return null;})[_0xc39b('0x2a')](function(_0x1d13b4){if(_0x1d13b4){if(!_0x1d13b4[_0xc39b('0x3f')]){throw new db[(_0xc39b('0x8f'))][(_0xc39b('0x90'))](_0xc39b('0x72'),0x193);}_0x5b7f87=_0x1d13b4;return db[_0xc39b('0x73')][_0xc39b('0x48')]({'raw':!![]});}return null;})['then'](function(_0xc8b9a7){if(_0xc8b9a7){_0x26d947=_['keyBy'](_0xc8b9a7,'id');var _0x33c003;var _0x5aba9e=squel['select']();_0x5aba9e['from'](_0x5162f1['table']);for(var _0x38ccb7=0x0;_0x38ccb7<_0x5b7f87[_0xc39b('0x3f')];_0x38ccb7+=0x1){_0x33c003=_0x5b7f87[_0x38ccb7]['MetricId']?_0x26d947[_0x5b7f87[_0x38ccb7][_0xc39b('0x77')]][_0xc39b('0x78')]:_0x5b7f87[_0x38ccb7]['field'];_0x33c003=_0x5b7f87[_0x38ccb7][_0xc39b('0x79')]?_['replace'](_0x1df6ae[_0x5b7f87[_0x38ccb7][_0xc39b('0x79')]],'%s',_0x33c003):_0x33c003;_0x33c003=_0x5b7f87[_0x38ccb7]['format']?_[_0xc39b('0x7a')](_0x4b101d[_0x5b7f87[_0x38ccb7][_0xc39b('0x7b')]],'%s',_0x33c003):_0x33c003;if(_0x5b7f87[_0x38ccb7][_0xc39b('0x7c')]){_0x5aba9e[_0xc39b('0x6d')](_0x33c003);}_0x5b7f87[_0x38ccb7][_0xc39b('0x7d')]&&_0x5aba9e[_0xc39b('0x41')](_0x33c003,_0x5b7f87[_0x38ccb7][_0xc39b('0x7d')]==='DESC'?![]:!![]);_0x5aba9e[_0xc39b('0x6e')](_0x33c003,_0x5b7f87[_0x38ccb7][_0xc39b('0x7f')]||_0x33c003);}if(_0x5162f1[_0xc39b('0x80')]){_0x5162f1[_0xc39b('0x80')]=JSON[_0xc39b('0x81')](_0x5162f1[_0xc39b('0x80')]);for(var _0x283fb3=0x0;_0x283fb3<_0x5162f1[_0xc39b('0x80')]['length'];_0x283fb3+=0x1){if(_0x5162f1[_0xc39b('0x80')][_0x283fb3]['type']&&_[_0xc39b('0x82')](_0x2c65a4,_0x5162f1[_0xc39b('0x80')][_0x283fb3][_0xc39b('0x36')])&&_0x5162f1['joins'][_0x283fb3][_0xc39b('0x83')]&&_0x5162f1['joins'][_0x283fb3][_0xc39b('0x84')]&&_0x5162f1[_0xc39b('0x80')][_0x283fb3][_0xc39b('0x85')]){_0x5aba9e[_0x5162f1[_0xc39b('0x80')][_0x283fb3][_0xc39b('0x36')]](_0x5162f1['joins'][_0x283fb3][_0xc39b('0x84')],null,util['format'](_0xc39b('0x86'),_0x5162f1['table'],_0x5162f1[_0xc39b('0x80')][_0x283fb3]['parentKey'],_0x5162f1[_0xc39b('0x80')][_0x283fb3][_0xc39b('0x84')],_0x5162f1[_0xc39b('0x80')][_0x283fb3][_0xc39b('0x85')]));}}}if(_0x5162f1[_0xc39b('0x87')]){_0x5162f1[_0xc39b('0x87')]=JSON[_0xc39b('0x81')](_0x5162f1[_0xc39b('0x87')]);_0x5aba9e['where'](_0xd36774(_0x5162f1['conditions'][_0xc39b('0x6d')]));}_0x515000=_0x5aba9e['clone']();_0x5aba9e['limit'](_0x519681);_0x5aba9e[_0xc39b('0x20')](0x0);logger['debug'](_0xc39b('0x8a'),_0x5aba9e[_0xc39b('0x8b')]());return dbH[_0xc39b('0xa2')][_0xc39b('0x39')](_0x5aba9e['toString'](),{'type':dbH[_0xc39b('0xa2')][_0xc39b('0x8c')][_0xc39b('0xa3')]});}})[_0xc39b('0x2a')](function(){return{'sql':_0x515000['toString']()};})['then'](respondWithResult(_0x269d53,null))[_0xc39b('0x49')](handleError(_0x269d53,null));};
\ No newline at end of file
+var _0xc600=['then','destroy','get','CustomReports','UserProfileResource','sendStatus','name','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','include','findAll','rows','catch','intersection','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','find','userProfileId','autoAssociation','error','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','ValidationErrorItem','keyBy','select','from','metric','function','format','replace','groupBy','orderBy','order','field','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','DESC','output','%s-%s.%s','randomstring','generate','csv','custom','startDate','endDate','child_process','savename','countTable','COUNT(*)','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x319676,_0x1ad06a){var _0x143d3a=function(_0x378871){while(--_0x378871){_0x319676['push'](_0x319676['shift']());}};_0x143d3a(++_0x1ad06a);}(_0xc600,0x11a));var _0x0c60=function(_0x3b5080,_0x10775f){_0x3b5080=_0x3b5080-0x0;var _0x3195ec=_0xc600[_0x3b5080];return _0x3195ec;};'use strict';var emlformat=require(_0x0c60('0x0'));var rimraf=require(_0x0c60('0x1'));var zipdir=require(_0x0c60('0x2'));var jsonpatch=require(_0x0c60('0x3'));var rp=require(_0x0c60('0x4'));var moment=require(_0x0c60('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0c60('0x6'));var util=require(_0x0c60('0x7'));var path=require(_0x0c60('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0c60('0x9'));var fs=require('fs');var fs_extra=require(_0x0c60('0xa'));var _=require('lodash');var squel=require(_0x0c60('0xb'));var crypto=require(_0x0c60('0xc'));var jsforce=require(_0x0c60('0xd'));var deskjs=require(_0x0c60('0xe'));var toCsv=require(_0x0c60('0xf'));var querystring=require(_0x0c60('0x10'));var Papa=require(_0x0c60('0x11'));var Redis=require('ioredis');var authService=require(_0x0c60('0x12'));var qs=require(_0x0c60('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c60('0x14'))(_0x0c60('0x15'));var utils=require(_0x0c60('0x16'));var config=require(_0x0c60('0x17'));var licenseUtil=require(_0x0c60('0x18'));var db=require(_0x0c60('0x19'))['db'];var dbH=require(_0x0c60('0x19'))[_0x0c60('0x1a')];function respondWithStatusCode(_0x581c9e,_0x27327f){_0x27327f=_0x27327f||0xcc;return function(_0x13ce1f){if(_0x13ce1f){return _0x581c9e['sendStatus'](_0x27327f);}return _0x581c9e[_0x0c60('0x1b')](_0x27327f)[_0x0c60('0x1c')]();};}function respondWithResult(_0x3f24dd,_0x7daa6c){_0x7daa6c=_0x7daa6c||0xc8;return function(_0x13cba0){if(_0x13cba0){return _0x3f24dd[_0x0c60('0x1b')](_0x7daa6c)[_0x0c60('0x1d')](_0x13cba0);}};}function respondWithFilteredResult(_0x1f2865,_0x57355d){return function(_0x51a73b){if(_0x51a73b){var _0x3296ae=typeof _0x57355d[_0x0c60('0x1e')]===_0x0c60('0x1f')&&typeof _0x57355d[_0x0c60('0x20')]===_0x0c60('0x1f');var _0x4d3c23=_0x51a73b['count'];var _0x2bd5e8=_0x3296ae?0x0:_0x57355d[_0x0c60('0x1e')];var _0x2135c3=_0x3296ae?_0x51a73b[_0x0c60('0x21')]:_0x57355d[_0x0c60('0x1e')]+_0x57355d[_0x0c60('0x20')];var _0x4bc24;if(_0x2135c3>=_0x4d3c23){_0x2135c3=_0x4d3c23;_0x4bc24=0xc8;}else{_0x4bc24=0xce;}_0x1f2865['status'](_0x4bc24);return _0x1f2865[_0x0c60('0x22')](_0x0c60('0x23'),_0x2bd5e8+'-'+_0x2135c3+'/'+_0x4d3c23)['json'](_0x51a73b);}return null;};}function patchUpdates(_0x594680){return function(_0x581465){try{jsonpatch[_0x0c60('0x24')](_0x581465,_0x594680,!![]);}catch(_0x5346d8){return BPromise[_0x0c60('0x25')](_0x5346d8);}return _0x581465[_0x0c60('0x26')]();};}function saveUpdates(_0x20dca0,_0x3fc885){return function(_0x422439){if(_0x422439){return _0x422439[_0x0c60('0x27')](_0x20dca0)[_0x0c60('0x28')](function(_0x1ffe6c){return _0x1ffe6c;});}return null;};}function removeEntity(_0x25f760,_0xc19b3d){return function(_0xc2de13){if(_0xc2de13){return _0xc2de13[_0x0c60('0x29')]()[_0x0c60('0x28')](function(){var _0x14ffbe=_0xc2de13[_0x0c60('0x2a')]({'plain':!![]});var _0x3bdfa7=_0x0c60('0x2b');return db[_0x0c60('0x2c')][_0x0c60('0x29')]({'where':{'type':_0x3bdfa7,'resourceId':_0x14ffbe['id']}})[_0x0c60('0x28')](function(){return _0xc2de13;});})['then'](function(){_0x25f760[_0x0c60('0x1b')](0xcc)[_0x0c60('0x1c')]();});}};}function handleEntityNotFound(_0x2cdcc4,_0x51255c){return function(_0xd75015){if(!_0xd75015){_0x2cdcc4[_0x0c60('0x2d')](0x194);}return _0xd75015;};}function handleError(_0x2c178c,_0x5b7a08){_0x5b7a08=_0x5b7a08||0x1f4;return function(_0x4ee96e){logger['error'](_0x4ee96e['stack']);if(_0x4ee96e[_0x0c60('0x2e')]){delete _0x4ee96e[_0x0c60('0x2e')];}_0x2c178c[_0x0c60('0x1b')](_0x5b7a08)['send'](_0x4ee96e);};}exports[_0x0c60('0x2f')]=function(_0xeb9130,_0x43eb66){var _0x4c4ed3={},_0x33e527={},_0x5f0415={'count':0x0,'rows':[]};var _0x441e88=_[_0x0c60('0x30')](db[_0x0c60('0x31')][_0x0c60('0x32')],function(_0x1c94bc){return{'name':_0x1c94bc['fieldName'],'type':_0x1c94bc[_0x0c60('0x33')][_0x0c60('0x34')]};});_0x33e527[_0x0c60('0x35')]=_[_0x0c60('0x30')](_0x441e88,_0x0c60('0x2e'));_0x33e527[_0x0c60('0x36')]=_[_0x0c60('0x37')](_0xeb9130['query']);_0x33e527[_0x0c60('0x38')]=_['intersection'](_0x33e527[_0x0c60('0x35')],_0x33e527['query']);_0x4c4ed3[_0x0c60('0x39')]=_['intersection'](_0x33e527[_0x0c60('0x35')],qs['fields'](_0xeb9130['query'][_0x0c60('0x3a')]));_0x4c4ed3[_0x0c60('0x39')]=_0x4c4ed3[_0x0c60('0x39')][_0x0c60('0x3b')]?_0x4c4ed3[_0x0c60('0x39')]:_0x33e527[_0x0c60('0x35')];if(!_0xeb9130[_0x0c60('0x36')][_0x0c60('0x3c')](_0x0c60('0x3d'))){_0x4c4ed3[_0x0c60('0x20')]=qs[_0x0c60('0x20')](_0xeb9130[_0x0c60('0x36')][_0x0c60('0x20')]);_0x4c4ed3[_0x0c60('0x1e')]=qs[_0x0c60('0x1e')](_0xeb9130[_0x0c60('0x36')][_0x0c60('0x1e')]);}_0x4c4ed3['order']=qs[_0x0c60('0x3e')](_0xeb9130[_0x0c60('0x36')][_0x0c60('0x3e')]);_0x4c4ed3['where']=qs['filters'](_['pick'](_0xeb9130['query'],_0x33e527[_0x0c60('0x38')]),_0x441e88);if(_0xeb9130[_0x0c60('0x36')][_0x0c60('0x3f')]){_0x4c4ed3[_0x0c60('0x40')]=_['merge'](_0x4c4ed3[_0x0c60('0x40')],{'$or':_['map'](_0x441e88,function(_0x36ffbd){if(_0x36ffbd[_0x0c60('0x33')]!=='VIRTUAL'){var _0x837f84={};_0x837f84[_0x36ffbd[_0x0c60('0x2e')]]={'$like':'%'+_0xeb9130[_0x0c60('0x36')]['filter']+'%'};return _0x837f84;}})});}_0x4c4ed3=_[_0x0c60('0x41')]({},_0x4c4ed3,_0xeb9130['options']);var _0x6e2db2={'where':_0x4c4ed3[_0x0c60('0x40')]};return db[_0x0c60('0x31')][_0x0c60('0x21')](_0x6e2db2)['then'](function(_0x1af130){_0x5f0415['count']=_0x1af130;if(_0xeb9130[_0x0c60('0x36')]['includeAll']){_0x4c4ed3[_0x0c60('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x0c60('0x43')](_0x4c4ed3);})['then'](function(_0x1794c1){_0x5f0415[_0x0c60('0x44')]=_0x1794c1;return _0x5f0415;})[_0x0c60('0x28')](respondWithFilteredResult(_0x43eb66,_0x4c4ed3))[_0x0c60('0x45')](handleError(_0x43eb66,null));};exports['show']=function(_0x58ca5c,_0x408761){var _0x546a42={'raw':![],'where':{'id':_0x58ca5c['params']['id']}},_0x1ae0a1={};_0x1ae0a1[_0x0c60('0x35')]=_['keys'](db['AnalyticCustomReport'][_0x0c60('0x32')]);_0x1ae0a1['query']=_[_0x0c60('0x37')](_0x58ca5c[_0x0c60('0x36')]);_0x1ae0a1['filters']=_['intersection'](_0x1ae0a1[_0x0c60('0x35')],_0x1ae0a1[_0x0c60('0x36')]);_0x546a42[_0x0c60('0x39')]=_[_0x0c60('0x46')](_0x1ae0a1[_0x0c60('0x35')],qs['fields'](_0x58ca5c['query']['fields']));_0x546a42[_0x0c60('0x39')]=_0x546a42[_0x0c60('0x39')][_0x0c60('0x3b')]?_0x546a42[_0x0c60('0x39')]:_0x1ae0a1[_0x0c60('0x35')];if(_0x58ca5c[_0x0c60('0x36')][_0x0c60('0x47')]){_0x546a42['include']=[{'all':!![]}];}_0x546a42=_[_0x0c60('0x41')]({},_0x546a42,_0x58ca5c[_0x0c60('0x48')]);return db[_0x0c60('0x31')]['find'](_0x546a42)[_0x0c60('0x28')](handleEntityNotFound(_0x408761,null))['then'](respondWithResult(_0x408761,null))[_0x0c60('0x45')](handleError(_0x408761,null));};exports[_0x0c60('0x49')]=function(_0x18913b,_0x431f98){return db[_0x0c60('0x31')]['create'](_0x18913b[_0x0c60('0x4a')],{})[_0x0c60('0x28')](function(_0x412adb){var _0x1a0bdd=_0x18913b['user'][_0x0c60('0x2a')]({'plain':!![]});if(!_0x1a0bdd)throw new Error(_0x0c60('0x4b'));if(_0x1a0bdd[_0x0c60('0x4c')]===_0x0c60('0x4d')){var _0x51c965=_0x412adb[_0x0c60('0x2a')]({'plain':!![]});var _0x574c8c=_0x0c60('0x4e');return db['UserProfileSection'][_0x0c60('0x4f')]({'where':{'name':_0x574c8c,'userProfileId':_0x1a0bdd[_0x0c60('0x50')]},'raw':!![]})[_0x0c60('0x28')](function(_0x52dfd9){if(_0x52dfd9&&_0x52dfd9[_0x0c60('0x51')]===0x0){return db['UserProfileResource'][_0x0c60('0x49')]({'name':_0x51c965['name'],'resourceId':_0x51c965['id'],'type':_0x0c60('0x2b'),'sectionId':_0x52dfd9['id']},{})['then'](function(){return _0x412adb;});}else{return _0x412adb;}})[_0x0c60('0x45')](function(_0x466f20){logger[_0x0c60('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x466f20);throw _0x466f20;});}return _0x412adb;})[_0x0c60('0x28')](respondWithResult(_0x431f98,0xc9))['catch'](handleError(_0x431f98,null));};exports['update']=function(_0x208f6f,_0xb0b755){if(_0x208f6f[_0x0c60('0x4a')]['id']){delete _0x208f6f[_0x0c60('0x4a')]['id'];}return db[_0x0c60('0x31')][_0x0c60('0x4f')]({'where':{'id':_0x208f6f['params']['id']}})['then'](handleEntityNotFound(_0xb0b755,null))['then'](saveUpdates(_0x208f6f[_0x0c60('0x4a')],null))[_0x0c60('0x28')](respondWithResult(_0xb0b755,null))[_0x0c60('0x45')](handleError(_0xb0b755,null));};exports[_0x0c60('0x29')]=function(_0x1f17b6,_0x41d9de){return db['AnalyticCustomReport']['find']({'where':{'id':_0x1f17b6[_0x0c60('0x53')]['id']}})[_0x0c60('0x28')](handleEntityNotFound(_0x41d9de,null))['then'](removeEntity(_0x41d9de,null))[_0x0c60('0x45')](handleError(_0x41d9de,null));};exports[_0x0c60('0x54')]=function(_0x390b67,_0x56e835){var _0x5657aa=0xa;var _0x29adc4=[_0x0c60('0x55'),_0x0c60('0x56'),_0x0c60('0x57'),_0x0c60('0x58')];var _0x7370b8={'SUM':_0x0c60('0x59'),'COUNT':_0x0c60('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0c60('0x5b'),'MIN':_0x0c60('0x5c'),'AVG':_0x0c60('0x5d'),'GROUP_CONCAT':_0x0c60('0x5e'),'GROUP_CONCAT ASC':_0x0c60('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1030e5={'SEC_TO_TIME':_0x0c60('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x0c60('0x61'),'UNIX_TIMESTAMP':_0x0c60('0x62')};var _0x528db2=function(_0x12d505){return!_[_0x0c60('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x0c60('0x64')],_0x12d505);};var _0x3ad905=function(_0x32e136){if(!_0x32e136||!_0x32e136[_0x0c60('0x65')][_0x0c60('0x3b')]){return'';}for(var _0x5527ae='(',_0x583488=0x0;_0x583488<_0x32e136['rules'][_0x0c60('0x3b')];_0x583488+=0x1){_0x583488>0x0&&(_0x5527ae+='\x20'+_0x32e136[_0x0c60('0x66')]+'\x20');_0x5527ae+=_0x32e136[_0x0c60('0x65')][_0x583488][_0x0c60('0x67')]?_0x3ad905(_0x32e136['rules'][_0x583488][_0x0c60('0x67')]):_0x32e136[_0x0c60('0x65')][_0x583488]['field']+'\x20'+_0x32e136[_0x0c60('0x65')][_0x583488][_0x0c60('0x68')]+(_0x528db2(_0x32e136[_0x0c60('0x65')][_0x583488][_0x0c60('0x68')])?'\x20'+_0x32e136['rules'][_0x583488]['value']:'');}return _0x5527ae+')';};var _0x4a2d5a={'where':{'id':_0x390b67[_0x0c60('0x53')]['id']}},_0x376562,_0x13d9ec,_0x26426c,_0x4c6311,_0x276ec;_0x4a2d5a=_[_0x0c60('0x41')]({},_0x4a2d5a,_0x390b67[_0x0c60('0x48')]);return db[_0x0c60('0x31')][_0x0c60('0x4f')](_0x4a2d5a)['then'](function(_0x7dd78f){if(_0x7dd78f){_0x376562=_0x7dd78f;return _0x7dd78f[_0x0c60('0x69')]();}return null;})[_0x0c60('0x28')](function(_0x19bff0){if(_0x19bff0){if(!_0x19bff0[_0x0c60('0x3b')]){throw new db['Sequelize'][(_0x0c60('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x13d9ec=_0x19bff0;return db['AnalyticMetric'][_0x0c60('0x43')]({'raw':!![]});}return null;})[_0x0c60('0x28')](function(_0x23a6ab){if(_0x23a6ab){_0x26426c=_[_0x0c60('0x6b')](_0x23a6ab,'id');var _0x3e5d12;var _0x50655b=squel[_0x0c60('0x6c')]();_0x50655b[_0x0c60('0x6d')](_0x376562['table']);for(var _0x242c44=0x0;_0x242c44<_0x13d9ec[_0x0c60('0x3b')];_0x242c44+=0x1){_0x3e5d12=_0x13d9ec[_0x242c44]['MetricId']?_0x26426c[_0x13d9ec[_0x242c44]['MetricId']][_0x0c60('0x6e')]:_0x13d9ec[_0x242c44]['field'];_0x3e5d12=_0x13d9ec[_0x242c44][_0x0c60('0x6f')]?_['replace'](_0x7370b8[_0x13d9ec[_0x242c44][_0x0c60('0x6f')]],'%s',_0x3e5d12):_0x3e5d12;_0x3e5d12=_0x13d9ec[_0x242c44][_0x0c60('0x70')]?_[_0x0c60('0x71')](_0x1030e5[_0x13d9ec[_0x242c44][_0x0c60('0x70')]],'%s',_0x3e5d12):_0x3e5d12;if(_0x13d9ec[_0x242c44][_0x0c60('0x72')]){_0x50655b[_0x0c60('0x67')](_0x3e5d12);}_0x13d9ec[_0x242c44][_0x0c60('0x73')]&&_0x50655b[_0x0c60('0x74')](_0x3e5d12,_0x13d9ec[_0x242c44][_0x0c60('0x73')]==='DESC'?![]:!![]);_0x50655b[_0x0c60('0x75')](_0x3e5d12,_0x13d9ec[_0x242c44][_0x0c60('0x76')]||_0x3e5d12);}if(_0x376562[_0x0c60('0x77')]){_0x376562['joins']=JSON[_0x0c60('0x78')](_0x376562[_0x0c60('0x77')]);for(var _0x5074e0=0x0;_0x5074e0<_0x376562[_0x0c60('0x77')][_0x0c60('0x3b')];_0x5074e0+=0x1){if(_0x376562['joins'][_0x5074e0][_0x0c60('0x33')]&&_[_0x0c60('0x63')](_0x29adc4,_0x376562['joins'][_0x5074e0][_0x0c60('0x33')])&&_0x376562[_0x0c60('0x77')][_0x5074e0]['parentKey']&&_0x376562[_0x0c60('0x77')][_0x5074e0][_0x0c60('0x79')]&&_0x376562[_0x0c60('0x77')][_0x5074e0][_0x0c60('0x7a')]){_0x50655b[_0x376562['joins'][_0x5074e0][_0x0c60('0x33')]](_0x376562[_0x0c60('0x77')][_0x5074e0][_0x0c60('0x79')],null,util[_0x0c60('0x70')](_0x0c60('0x7b'),_0x376562[_0x0c60('0x7c')],_0x376562[_0x0c60('0x77')][_0x5074e0][_0x0c60('0x7d')],_0x376562[_0x0c60('0x77')][_0x5074e0]['foreignTable'],_0x376562[_0x0c60('0x77')][_0x5074e0][_0x0c60('0x7a')]));}}}if(_0x376562[_0x0c60('0x7e')]){_0x376562[_0x0c60('0x7e')]=JSON[_0x0c60('0x78')](_0x376562['conditions']);_0x50655b[_0x0c60('0x40')](_0x3ad905(_0x376562[_0x0c60('0x7e')]['group']));}_0x276ec=_0x50655b[_0x0c60('0x7f')]();_0x50655b[_0x0c60('0x20')](_0x5657aa);_0x50655b['offset'](0x0);logger[_0x0c60('0x80')]('Limited\x20Query:',_0x50655b[_0x0c60('0x81')]());return dbH['sequelize']['query'](_0x50655b[_0x0c60('0x81')](),{'type':dbH[_0x0c60('0x82')][_0x0c60('0x83')][_0x0c60('0x84')]});}})['then'](respondWithResult(_0x56e835,null))[_0x0c60('0x45')](handleError(_0x56e835,null));};function runReport(_0x15c2b3,_0x7110af,_0x44c5c2){var _0x18797a=_0x7110af[_0x0c60('0x2e')];var _0x128536=0xa;var _0x33ffe7=['join','left_join','right_join','cross_join'];var _0x4c5a80={'SUM':'SUM(%s)','COUNT':_0x0c60('0x5a'),'COUNT DISTINCT':_0x0c60('0x85'),'MAX':_0x0c60('0x5b'),'MIN':_0x0c60('0x5c'),'AVG':_0x0c60('0x5d'),'GROUP_CONCAT':_0x0c60('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0c60('0x86')};var _0x352100={'SEC_TO_TIME':_0x0c60('0x60'),'DATE':_0x0c60('0x87'),'HOUR':_0x0c60('0x88'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0c60('0x62')};var _0x18815a=function(_0x3936eb){return!_[_0x0c60('0x63')]([_0x0c60('0x89'),_0x0c60('0x8a'),_0x0c60('0x8b'),'IS\x20NOT\x20EMPTY'],_0x3936eb);};var _0x384c62=function(_0x547c45){if(!_0x547c45||!_0x547c45[_0x0c60('0x65')][_0x0c60('0x3b')]){return'';}for(var _0x4410d0='(',_0x71d6ed=0x0;_0x71d6ed<_0x547c45['rules'][_0x0c60('0x3b')];_0x71d6ed+=0x1){_0x71d6ed>0x0&&(_0x4410d0+='\x20'+_0x547c45[_0x0c60('0x66')]+'\x20');_0x4410d0+=_0x547c45[_0x0c60('0x65')][_0x71d6ed]['group']?_0x384c62(_0x547c45[_0x0c60('0x65')][_0x71d6ed][_0x0c60('0x67')]):_0x547c45['rules'][_0x71d6ed][_0x0c60('0x75')]+'\x20'+_0x547c45[_0x0c60('0x65')][_0x71d6ed][_0x0c60('0x68')]+(_0x18815a(_0x547c45['rules'][_0x71d6ed]['condition'])?'\x20'+_0x547c45[_0x0c60('0x65')][_0x71d6ed][_0x0c60('0x8c')]:'');}return _0x4410d0+')';};var _0x44cc77={'where':{'id':_0x15c2b3['id']}},_0x427c2f,_0xade455,_0x1b21cc,_0x47d5ab,_0x53b819;_0x44cc77=_['merge']({},_0x44cc77,_0x44c5c2);return db[_0x0c60('0x31')][_0x0c60('0x4f')](_0x44cc77)[_0x0c60('0x28')](function(_0x3465ee){if(_0x3465ee){_0x427c2f=_0x3465ee;return _0x3465ee[_0x0c60('0x69')]();}return null;})[_0x0c60('0x28')](function(_0x5f599c){if(_0x5f599c){if(!_0x5f599c['length']){throw new db[(_0x0c60('0x8d'))]['ValidationErrorItem'](_0x0c60('0x8e'),0x193);}_0xade455=_0x5f599c;return db[_0x0c60('0x8f')][_0x0c60('0x43')]({'raw':!![]});}return null;})[_0x0c60('0x28')](function(_0x947fc6){if(_0x947fc6){_0x1b21cc=_['keyBy'](_0x947fc6,'id');var _0x7e1fba;var _0x54bff8=squel['select']();_0x54bff8[_0x0c60('0x6d')](_0x427c2f['table']);for(var _0x56dc90=0x0;_0x56dc90<_0xade455['length'];_0x56dc90+=0x1){_0x7e1fba=_0xade455[_0x56dc90][_0x0c60('0x90')]?_0x1b21cc[_0xade455[_0x56dc90]['MetricId']]['metric']:_0xade455[_0x56dc90][_0x0c60('0x75')];_0x7e1fba=_0xade455[_0x56dc90][_0x0c60('0x6f')]?_[_0x0c60('0x71')](_0x4c5a80[_0xade455[_0x56dc90][_0x0c60('0x6f')]],'%s',_0x7e1fba):_0x7e1fba;_0x7e1fba=_0xade455[_0x56dc90]['format']?_[_0x0c60('0x71')](_0x352100[_0xade455[_0x56dc90][_0x0c60('0x70')]],'%s',_0x7e1fba):_0x7e1fba;if(_0xade455[_0x56dc90][_0x0c60('0x72')]){_0x54bff8[_0x0c60('0x67')](_0x7e1fba);}_0xade455[_0x56dc90][_0x0c60('0x73')]&&_0x54bff8[_0x0c60('0x74')](_0x7e1fba,_0xade455[_0x56dc90][_0x0c60('0x73')]===_0x0c60('0x91')?![]:!![]);_0x54bff8[_0x0c60('0x75')](_0x7e1fba,_0xade455[_0x56dc90][_0x0c60('0x76')]||_0x7e1fba);}if(_0x427c2f[_0x0c60('0x77')]){_0x427c2f['joins']=JSON[_0x0c60('0x78')](_0x427c2f[_0x0c60('0x77')]);for(var _0xde5e44=0x0;_0xde5e44<_0x427c2f['joins'][_0x0c60('0x3b')];_0xde5e44+=0x1){if(_0x427c2f[_0x0c60('0x77')][_0xde5e44][_0x0c60('0x33')]&&_[_0x0c60('0x63')](_0x33ffe7,_0x427c2f['joins'][_0xde5e44]['type'])&&_0x427c2f[_0x0c60('0x77')][_0xde5e44][_0x0c60('0x7d')]&&_0x427c2f[_0x0c60('0x77')][_0xde5e44][_0x0c60('0x79')]&&_0x427c2f[_0x0c60('0x77')][_0xde5e44][_0x0c60('0x7a')]){_0x54bff8[_0x427c2f['joins'][_0xde5e44][_0x0c60('0x33')]](_0x427c2f[_0x0c60('0x77')][_0xde5e44][_0x0c60('0x79')],null,util['format'](_0x0c60('0x7b'),_0x427c2f[_0x0c60('0x7c')],_0x427c2f[_0x0c60('0x77')][_0xde5e44][_0x0c60('0x7d')],_0x427c2f['joins'][_0xde5e44][_0x0c60('0x79')],_0x427c2f[_0x0c60('0x77')][_0xde5e44][_0x0c60('0x7a')]));}}}if(_0x427c2f[_0x0c60('0x7e')]){_0x427c2f[_0x0c60('0x7e')]=JSON['parse'](_0x427c2f['conditions']);_0x54bff8['where'](_0x384c62(_0x427c2f['conditions'][_0x0c60('0x67')]));}_0x53b819=_0x54bff8[_0x0c60('0x7f')]();_0x54bff8[_0x0c60('0x20')](_0x128536);_0x54bff8[_0x0c60('0x1e')](0x0);return;}})['then'](function(){if(_0x7110af[_0x0c60('0x92')]==='web'){return null;}var _0x17b855=_[_0x0c60('0x41')](_0x7110af,{'name':_0x7110af['fullPath']||_0x7110af[_0x0c60('0x2e')]||_0x427c2f[_0x0c60('0x2e')],'basename':_0x18797a,'savename':util['format'](_0x0c60('0x93'),_0x7110af[_0x0c60('0x2e')]||_0x427c2f[_0x0c60('0x2e')],require(_0x0c60('0x94'))[_0x0c60('0x95')](0x4),_0x7110af[_0x0c60('0x92')]||_0x0c60('0x96')),'reportId':_0x427c2f['id'],'reportType':_0x0c60('0x97')});return db['AnalyticExtractedReport'][_0x0c60('0x49')](_0x17b855,{'raw':!![]});})[_0x0c60('0x28')](function(_0xe30be2){if(_0x427c2f[_0x0c60('0x7c')]==='cdr'){_0x53b819[_0x0c60('0x40')](_0x427c2f[_0x0c60('0x7c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x7110af[_0x0c60('0x98')],_0x7110af[_0x0c60('0x99')]);}else{_0x53b819['where'](_0x427c2f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x7110af[_0x0c60('0x98')],_0x7110af[_0x0c60('0x99')]);}if(_0xe30be2){logger['info']('Run\x20Query:',_0x53b819[_0x0c60('0x81')]());require(_0x0c60('0x9a'))['fork'](path[_0x0c60('0x55')](__dirname,'../../components/export/',_0xe30be2[_0x0c60('0x92')]),[_0xe30be2['id'],_0x53b819['toString'](),path['join'](__dirname,'../../files/reports',_0xe30be2[_0x0c60('0x9b')]),_0x18797a]);return _0xe30be2;}else{var _0x595860=squel[_0x0c60('0x6c')]();_0x595860[_0x0c60('0x6d')]('('+_0x53b819['toString']()+')',_0x0c60('0x9c'));_0x595860['field'](_0x0c60('0x9d'),_0x0c60('0x21'));_0x53b819[_0x0c60('0x20')](_0x7110af[_0x0c60('0x20')]||_0x128536);_0x53b819['offset'](_0x7110af[_0x0c60('0x1e')]||0x0);return dbH[_0x0c60('0x82')][_0x0c60('0x36')](_0x595860[_0x0c60('0x81')](),{'type':dbH['sequelize'][_0x0c60('0x83')][_0x0c60('0x84')]})[_0x0c60('0x28')](function(_0xb8e400){if(!_0xb8e400['length']){_0x47d5ab=0x0;}else{_0x47d5ab=_0xb8e400[0x0][_0x0c60('0x21')]||0x0;}return dbH[_0x0c60('0x82')][_0x0c60('0x36')](_0x53b819[_0x0c60('0x81')](),{'type':dbH[_0x0c60('0x82')][_0x0c60('0x83')][_0x0c60('0x84')]});})[_0x0c60('0x28')](function(_0x237148){return{'rows':_0x237148||[],'count':_0x47d5ab};});}});}exports[_0x0c60('0x9e')]=function(_0x1fb7e9,_0x505fee){return runReport(_0x1fb7e9[_0x0c60('0x53')],_0x1fb7e9[_0x0c60('0x36')],_0x1fb7e9[_0x0c60('0x48')])['then'](respondWithResult(_0x505fee,null))[_0x0c60('0x45')](handleError(_0x505fee,null));};exports[_0x0c60('0x9f')]=runReport;exports[_0x0c60('0x36')]=function(_0x509181,_0x46dd45){var _0x12e2ed=0xa;var _0x748335=['join',_0x0c60('0x56'),'right_join',_0x0c60('0x58')];var _0x514f65={'SUM':_0x0c60('0x59'),'COUNT':_0x0c60('0x5a'),'COUNT DISTINCT':_0x0c60('0x85'),'MAX':_0x0c60('0x5b'),'MIN':'MIN(%s)','AVG':_0x0c60('0x5d'),'GROUP_CONCAT':_0x0c60('0x5e'),'GROUP_CONCAT ASC':_0x0c60('0x5f'),'GROUP_CONCAT DESC':_0x0c60('0x86')};var _0x5be827={'SEC_TO_TIME':_0x0c60('0x60'),'DATE':_0x0c60('0x87'),'HOUR':_0x0c60('0x88'),'ROUND':_0x0c60('0x61'),'UNIX_TIMESTAMP':_0x0c60('0x62')};var _0x32ba=function(_0x2b711e){return!_[_0x0c60('0x63')](['IS\x20NULL',_0x0c60('0x8a'),_0x0c60('0x8b'),_0x0c60('0x64')],_0x2b711e);};var _0xd15b65=function(_0x3d6972){if(!_0x3d6972||!_0x3d6972[_0x0c60('0x65')][_0x0c60('0x3b')]){return'';}for(var _0x53ba66='(',_0x15b186=0x0;_0x15b186<_0x3d6972[_0x0c60('0x65')][_0x0c60('0x3b')];_0x15b186+=0x1){_0x15b186>0x0&&(_0x53ba66+='\x20'+_0x3d6972[_0x0c60('0x66')]+'\x20');_0x53ba66+=_0x3d6972[_0x0c60('0x65')][_0x15b186][_0x0c60('0x67')]?_0xd15b65(_0x3d6972[_0x0c60('0x65')][_0x15b186][_0x0c60('0x67')]):_0x3d6972[_0x0c60('0x65')][_0x15b186]['field']+'\x20'+_0x3d6972[_0x0c60('0x65')][_0x15b186][_0x0c60('0x68')]+(_0x32ba(_0x3d6972[_0x0c60('0x65')][_0x15b186][_0x0c60('0x68')])?'\x20'+_0x3d6972['rules'][_0x15b186][_0x0c60('0x8c')]:'');}return _0x53ba66+')';};var _0x4275c5={'where':{'id':_0x509181[_0x0c60('0x53')]['id']}},_0xb87c1d,_0x31e2c7,_0x1c0bc7,_0x317ae9,_0x458e9c;_0x4275c5=_['merge']({},_0x4275c5,_0x509181[_0x0c60('0x48')]);return db[_0x0c60('0x31')][_0x0c60('0x4f')](_0x4275c5)[_0x0c60('0x28')](function(_0x9f537a){if(_0x9f537a){_0xb87c1d=_0x9f537a;return _0x9f537a[_0x0c60('0x69')]();}return null;})[_0x0c60('0x28')](function(_0x1beaa2){if(_0x1beaa2){if(!_0x1beaa2[_0x0c60('0x3b')]){throw new db[(_0x0c60('0x8d'))][(_0x0c60('0x6a'))](_0x0c60('0x8e'),0x193);}_0x31e2c7=_0x1beaa2;return db['AnalyticMetric'][_0x0c60('0x43')]({'raw':!![]});}return null;})[_0x0c60('0x28')](function(_0x65962){if(_0x65962){_0x1c0bc7=_[_0x0c60('0x6b')](_0x65962,'id');var _0xb5bde3;var _0x57187f=squel[_0x0c60('0x6c')]();_0x57187f['from'](_0xb87c1d[_0x0c60('0x7c')]);for(var _0x5d3980=0x0;_0x5d3980<_0x31e2c7['length'];_0x5d3980+=0x1){_0xb5bde3=_0x31e2c7[_0x5d3980][_0x0c60('0x90')]?_0x1c0bc7[_0x31e2c7[_0x5d3980][_0x0c60('0x90')]]['metric']:_0x31e2c7[_0x5d3980][_0x0c60('0x75')];_0xb5bde3=_0x31e2c7[_0x5d3980][_0x0c60('0x6f')]?_[_0x0c60('0x71')](_0x514f65[_0x31e2c7[_0x5d3980][_0x0c60('0x6f')]],'%s',_0xb5bde3):_0xb5bde3;_0xb5bde3=_0x31e2c7[_0x5d3980][_0x0c60('0x70')]?_[_0x0c60('0x71')](_0x5be827[_0x31e2c7[_0x5d3980][_0x0c60('0x70')]],'%s',_0xb5bde3):_0xb5bde3;if(_0x31e2c7[_0x5d3980][_0x0c60('0x72')]){_0x57187f[_0x0c60('0x67')](_0xb5bde3);}_0x31e2c7[_0x5d3980]['orderBy']&&_0x57187f[_0x0c60('0x74')](_0xb5bde3,_0x31e2c7[_0x5d3980][_0x0c60('0x73')]==='DESC'?![]:!![]);_0x57187f['field'](_0xb5bde3,_0x31e2c7[_0x5d3980][_0x0c60('0x76')]||_0xb5bde3);}if(_0xb87c1d[_0x0c60('0x77')]){_0xb87c1d[_0x0c60('0x77')]=JSON[_0x0c60('0x78')](_0xb87c1d[_0x0c60('0x77')]);for(var _0x533cba=0x0;_0x533cba<_0xb87c1d['joins']['length'];_0x533cba+=0x1){if(_0xb87c1d['joins'][_0x533cba][_0x0c60('0x33')]&&_[_0x0c60('0x63')](_0x748335,_0xb87c1d[_0x0c60('0x77')][_0x533cba]['type'])&&_0xb87c1d['joins'][_0x533cba][_0x0c60('0x7d')]&&_0xb87c1d[_0x0c60('0x77')][_0x533cba][_0x0c60('0x79')]&&_0xb87c1d[_0x0c60('0x77')][_0x533cba]['foreignKey']){_0x57187f[_0xb87c1d[_0x0c60('0x77')][_0x533cba][_0x0c60('0x33')]](_0xb87c1d['joins'][_0x533cba][_0x0c60('0x79')],null,util[_0x0c60('0x70')](_0x0c60('0x7b'),_0xb87c1d['table'],_0xb87c1d[_0x0c60('0x77')][_0x533cba]['parentKey'],_0xb87c1d['joins'][_0x533cba][_0x0c60('0x79')],_0xb87c1d[_0x0c60('0x77')][_0x533cba]['foreignKey']));}}}if(_0xb87c1d['conditions']){_0xb87c1d['conditions']=JSON[_0x0c60('0x78')](_0xb87c1d[_0x0c60('0x7e')]);_0x57187f['where'](_0xd15b65(_0xb87c1d['conditions'][_0x0c60('0x67')]));}_0x458e9c=_0x57187f[_0x0c60('0x7f')]();_0x57187f['limit'](_0x12e2ed);_0x57187f[_0x0c60('0x1e')](0x0);logger[_0x0c60('0x80')](_0x0c60('0xa0'),_0x57187f[_0x0c60('0x81')]());return dbH[_0x0c60('0x82')][_0x0c60('0x36')](_0x57187f[_0x0c60('0x81')](),{'type':dbH['sequelize'][_0x0c60('0x83')][_0x0c60('0x84')]});}})[_0x0c60('0x28')](function(){return{'sql':_0x458e9c['toString']()};})[_0x0c60('0x28')](respondWithResult(_0x46dd45,null))['catch'](handleError(_0x46dd45,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index e17d599..2efb035 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 _0x6648=['AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0x6648,0xda));var _0x8664=function(_0xa93be7,_0x58e797){_0xa93be7=_0xa93be7-0x0;var _0x3ac526=_0x6648[_0xa93be7];return _0x3ac526;};'use strict';var _=require('lodash');var util=require(_0x8664('0x0'));var logger=require(_0x8664('0x1'))('api');var moment=require(_0x8664('0x2'));var BPromise=require(_0x8664('0x3'));var rp=require(_0x8664('0x4'));var fs=require('fs');var path=require(_0x8664('0x5'));var rimraf=require(_0x8664('0x6'));var config=require('../../config/environment');var attributes=require(_0x8664('0x7'));module[_0x8664('0x8')]=function(_0x487ae1,_0x2cf4a0){return _0x487ae1[_0x8664('0x9')](_0x8664('0xa'),attributes,{'tableName':_0x8664('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54a2=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x29b208,_0x4f1009){var _0xfcf716=function(_0x210d14){while(--_0x210d14){_0x29b208['push'](_0x29b208['shift']());}};_0xfcf716(++_0x4f1009);}(_0x54a2,0x91));var _0x254a=function(_0x363a2b,_0x2c51a2){_0x363a2b=_0x363a2b-0x0;var _0x2c720e=_0x54a2[_0x363a2b];return _0x2c720e;};'use strict';var _=require(_0x254a('0x0'));var util=require(_0x254a('0x1'));var logger=require(_0x254a('0x2'))(_0x254a('0x3'));var moment=require(_0x254a('0x4'));var BPromise=require(_0x254a('0x5'));var rp=require(_0x254a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x254a('0x7'));var config=require(_0x254a('0x8'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x5f27c3,_0x163dcb){return _0x5f27c3['define'](_0x254a('0x9'),attributes,{'tableName':_0x254a('0xa'),'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 4a34194..2aff523 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 _0xc902=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x1c1410,_0x4ef11d){var _0x717081=function(_0x4e19f0){while(--_0x4e19f0){_0x1c1410['push'](_0x1c1410['shift']());}};_0x717081(++_0x4ef11d);}(_0xc902,0x16b));var _0x2c90=function(_0x56cce9,_0x38855f){_0x56cce9=_0x56cce9-0x0;var _0x399741=_0xc902[_0x56cce9];return _0x399741;};'use strict';var _=require(_0x2c90('0x0'));var util=require('util');var moment=require(_0x2c90('0x1'));var BPromise=require(_0x2c90('0x2'));var rs=require(_0x2c90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c90('0x4'))['db'];var utils=require(_0x2c90('0x5'));var logger=require(_0x2c90('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2c90('0x7'));var client=jayson[_0x2c90('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1505a1,_0x519466,_0x1643ae){return new BPromise(function(_0x37e433,_0x3b028e){return client[_0x2c90('0x9')](_0x1505a1,_0x1643ae)[_0x2c90('0xa')](function(_0x2eac56){logger[_0x2c90('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x519466,_0x2c90('0xc'));logger['debug'](_0x2c90('0xd'),_0x519466,_0x2c90('0xc'),JSON[_0x2c90('0xe')](_0x2eac56));if(_0x2eac56['error']){if(_0x2eac56[_0x2c90('0xf')]['code']===0x1f4){logger[_0x2c90('0xf')](_0x2c90('0x10'),_0x519466,_0x2eac56['error'][_0x2c90('0x11')]);return _0x3b028e(_0x2eac56[_0x2c90('0xf')][_0x2c90('0x11')]);}logger[_0x2c90('0xf')](_0x2c90('0x10'),_0x519466,_0x2eac56['error'][_0x2c90('0x11')]);return _0x37e433(_0x2eac56[_0x2c90('0xf')][_0x2c90('0x11')]);}else{logger['info'](_0x2c90('0x10'),_0x519466,_0x2c90('0xc'));_0x37e433(_0x2eac56[_0x2c90('0x12')]['message']);}})[_0x2c90('0x13')](function(_0xec7bed){logger['error'](_0x2c90('0x10'),_0x519466,_0xec7bed);_0x3b028e(_0xec7bed);});});}
\ No newline at end of file
+var _0xa4e5=['../../config/logger','../../config/environment','jayson/promise','client','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xa4e5,0x162));var _0x5a4e=function(_0x3671d7,_0x586bbc){_0x3671d7=_0x3671d7-0x0;var _0xf9f6e6=_0xa4e5[_0x3671d7];return _0xf9f6e6;};'use strict';var _=require('lodash');var util=require(_0x5a4e('0x0'));var moment=require(_0x5a4e('0x1'));var BPromise=require(_0x5a4e('0x2'));var rs=require(_0x5a4e('0x3'));var fs=require('fs');var Redis=require(_0x5a4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a4e('0x5'));var logger=require(_0x5a4e('0x6'))('rpc');var config=require(_0x5a4e('0x7'));var jayson=require(_0x5a4e('0x8'));var client=jayson[_0x5a4e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd436,_0x26029e,_0x4c0449){return new BPromise(function(_0x59c3f5,_0x414ad6){return client['request'](_0x2dd436,_0x4c0449)[_0x5a4e('0xa')](function(_0x5d06c8){logger[_0x5a4e('0xb')](_0x5a4e('0xc'),_0x26029e,_0x5a4e('0xd'));logger[_0x5a4e('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x26029e,_0x5a4e('0xd'),JSON[_0x5a4e('0xf')](_0x5d06c8));if(_0x5d06c8['error']){if(_0x5d06c8[_0x5a4e('0x10')][_0x5a4e('0x11')]===0x1f4){logger[_0x5a4e('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x26029e,_0x5d06c8[_0x5a4e('0x10')][_0x5a4e('0x12')]);return _0x414ad6(_0x5d06c8[_0x5a4e('0x10')]['message']);}logger[_0x5a4e('0x10')](_0x5a4e('0xc'),_0x26029e,_0x5d06c8[_0x5a4e('0x10')]['message']);return _0x59c3f5(_0x5d06c8['error'][_0x5a4e('0x12')]);}else{logger[_0x5a4e('0xb')](_0x5a4e('0xc'),_0x26029e,_0x5a4e('0xd'));_0x59c3f5(_0x5d06c8[_0x5a4e('0x13')][_0x5a4e('0x12')]);}})['catch'](function(_0x3deb1f){logger[_0x5a4e('0x10')](_0x5a4e('0xc'),_0x26029e,_0x3deb1f);_0x414ad6(_0x3deb1f);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index c75501d..13933de 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 _0x0307=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x16616a,_0x37307e){var _0x44e5f0=function(_0x1dff7d){while(--_0x1dff7d){_0x16616a['push'](_0x16616a['shift']());}};_0x44e5f0(++_0x37307e);}(_0x0307,0x8b));var _0x7030=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x0307[_0x2fee96];return _0x2e6ad1;};'use strict';var multer=require(_0x7030('0x0'));var util=require('util');var path=require(_0x7030('0x1'));var timeout=require(_0x7030('0x2'));var express=require(_0x7030('0x3'));var router=express[_0x7030('0x4')]();var fs_extra=require(_0x7030('0x5'));var auth=require(_0x7030('0x6'));var interaction=require(_0x7030('0x7'));var config=require(_0x7030('0x8'));var controller=require(_0x7030('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7030('0xa')](_0x7030('0xb'),auth[_0x7030('0xc')](),controller[_0x7030('0xd')]);router['get'](_0x7030('0xe'),auth[_0x7030('0xc')](),controller[_0x7030('0xf')]);router[_0x7030('0xa')](_0x7030('0x10'),auth['isAuthenticated'](),controller[_0x7030('0x11')]);router['get'](_0x7030('0x12'),auth[_0x7030('0xc')](),controller[_0x7030('0x13')]);router[_0x7030('0x14')]('/',auth[_0x7030('0xc')](),controller[_0x7030('0x15')]);router[_0x7030('0x16')]('/:id',auth[_0x7030('0xc')](),controller[_0x7030('0x17')]);router[_0x7030('0x18')](_0x7030('0xb'),auth['isAuthenticated'](),controller[_0x7030('0x19')]);module[_0x7030('0x1a')]=router;
\ No newline at end of file
+var _0x2ec5=['get','isAuthenticated','index','show','/:id/preview','run','/:id/query','query','post','create','/:id','update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x4dccf2,_0x5cfcd7){var _0x12640e=function(_0x1fb2c7){while(--_0x1fb2c7){_0x4dccf2['push'](_0x4dccf2['shift']());}};_0x12640e(++_0x5cfcd7);}(_0x2ec5,0x116));var _0x52ec=function(_0x563a3b,_0x2a3ac4){_0x563a3b=_0x563a3b-0x0;var _0x146a95=_0x2ec5[_0x563a3b];return _0x146a95;};'use strict';var multer=require('multer');var util=require(_0x52ec('0x0'));var path=require('path');var timeout=require(_0x52ec('0x1'));var express=require(_0x52ec('0x2'));var router=express['Router']();var fs_extra=require(_0x52ec('0x3'));var auth=require(_0x52ec('0x4'));var interaction=require(_0x52ec('0x5'));var config=require(_0x52ec('0x6'));var controller=require(_0x52ec('0x7'));router[_0x52ec('0x8')]('/',auth[_0x52ec('0x9')](),controller[_0x52ec('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x52ec('0xb')]);router[_0x52ec('0x8')](_0x52ec('0xc'),auth[_0x52ec('0x9')](),controller['preview']);router['get']('/:id/run',auth[_0x52ec('0x9')](),controller[_0x52ec('0xd')]);router[_0x52ec('0x8')](_0x52ec('0xe'),auth['isAuthenticated'](),controller[_0x52ec('0xf')]);router[_0x52ec('0x10')]('/',auth['isAuthenticated'](),controller[_0x52ec('0x11')]);router['put'](_0x52ec('0x12'),auth[_0x52ec('0x9')](),controller[_0x52ec('0x13')]);router[_0x52ec('0x14')](_0x52ec('0x12'),auth[_0x52ec('0x9')](),controller['destroy']);module[_0x52ec('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 86d6b11..40fefc0 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x2675,0x75));var _0x5267=function(_0x41765e,_0x4d7b27){_0x41765e=_0x41765e-0x0;var _0x197ab9=_0x2675[_0x41765e];return _0x197ab9;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x5f5eb2,_0x3868f5){var _0x58df87=function(_0x91d228){while(--_0x91d228){_0x5f5eb2['push'](_0x5f5eb2['shift']());}};_0x58df87(++_0x3868f5);}(_0x2eb2,0x19f));var _0x22eb=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2eb2[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5b8f180..fda9227 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(_0x16a994,_0x27eb6b){var _0x221681=function(_0x327f4b){while(--_0x327f4b){_0x16a994['push'](_0x16a994['shift']());}};_0x221681(++_0x27eb6b);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6d38,0x1ef));var _0x86d3=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6d38[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 021d739..0f2be3b 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 _0xe3c0=['analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x1a3bd2,_0x344d4a){var _0x4222e6=function(_0x4a20c8){while(--_0x4a20c8){_0x1a3bd2['push'](_0x1a3bd2['shift']());}};_0x4222e6(++_0x344d4a);}(_0xe3c0,0x189));var _0x0e3c=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xe3c0[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x0e3c('0x0'));var util=require('util');var logger=require(_0x0e3c('0x1'))(_0x0e3c('0x2'));var moment=require(_0x0e3c('0x3'));var BPromise=require(_0x0e3c('0x4'));var rp=require(_0x0e3c('0x5'));var fs=require('fs');var path=require(_0x0e3c('0x6'));var rimraf=require(_0x0e3c('0x7'));var config=require(_0x0e3c('0x8'));var attributes=require(_0x0e3c('0x9'));module[_0x0e3c('0xa')]=function(_0x38ae92,_0x3f6b22){return _0x38ae92[_0x0e3c('0xb')](_0x0e3c('0xc'),attributes,{'tableName':_0x0e3c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13d0=['../../config/logger','api','moment','bluebird','request-promise','path','exports','AnalyticDefaultReport','analytics_default_reports','util'];(function(_0x5b2cff,_0x43db7a){var _0x1a1288=function(_0x5218c4){while(--_0x5218c4){_0x5b2cff['push'](_0x5b2cff['shift']());}};_0x1a1288(++_0x43db7a);}(_0x13d0,0xf9));var _0x013d=function(_0x18bb2d,_0xf07147){_0x18bb2d=_0x18bb2d-0x0;var _0x32b927=_0x13d0[_0x18bb2d];return _0x32b927;};'use strict';var _=require('lodash');var util=require(_0x013d('0x0'));var logger=require(_0x013d('0x1'))(_0x013d('0x2'));var moment=require(_0x013d('0x3'));var BPromise=require(_0x013d('0x4'));var rp=require(_0x013d('0x5'));var fs=require('fs');var path=require(_0x013d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x013d('0x7')]=function(_0x3986d9,_0x3a434b){return _0x3986d9['define'](_0x013d('0x8'),attributes,{'tableName':_0x013d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index cc1b41d..d88de2c 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 _0x403b=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x12c05d,_0x1b6332){var _0x19847d=function(_0x14e9e2){while(--_0x14e9e2){_0x12c05d['push'](_0x12c05d['shift']());}};_0x19847d(++_0x1b6332);}(_0x403b,0x112));var _0xb403=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x403b[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xb403('0x0'));var util=require(_0xb403('0x1'));var moment=require(_0xb403('0x2'));var BPromise=require(_0xb403('0x3'));var rs=require(_0xb403('0x4'));var fs=require('fs');var Redis=require(_0xb403('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb403('0x6'))(_0xb403('0x7'));var config=require(_0xb403('0x8'));var jayson=require(_0xb403('0x9'));var client=jayson['client'][_0xb403('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222c82,_0x4d1e0e,_0x2eab73){return new BPromise(function(_0x250b60,_0x59b416){return client[_0xb403('0xb')](_0x222c82,_0x2eab73)[_0xb403('0xc')](function(_0x56727f){logger[_0xb403('0xd')](_0xb403('0xe'),_0x4d1e0e,'request\x20sent');logger[_0xb403('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4d1e0e,_0xb403('0x10'),JSON[_0xb403('0x11')](_0x56727f));if(_0x56727f[_0xb403('0x12')]){if(_0x56727f['error'][_0xb403('0x13')]===0x1f4){logger[_0xb403('0x12')](_0xb403('0xe'),_0x4d1e0e,_0x56727f[_0xb403('0x12')][_0xb403('0x14')]);return _0x59b416(_0x56727f[_0xb403('0x12')][_0xb403('0x14')]);}logger[_0xb403('0x12')](_0xb403('0xe'),_0x4d1e0e,_0x56727f[_0xb403('0x12')]['message']);return _0x250b60(_0x56727f[_0xb403('0x12')][_0xb403('0x14')]);}else{logger[_0xb403('0xd')](_0xb403('0xe'),_0x4d1e0e,_0xb403('0x10'));_0x250b60(_0x56727f[_0xb403('0x15')][_0xb403('0x14')]);}})[_0xb403('0x16')](function(_0x380409){logger[_0xb403('0x12')](_0xb403('0xe'),_0x4d1e0e,_0x380409);_0x59b416(_0x380409);});});}
\ No newline at end of file
+var _0x11c1=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x5cdfd0,_0x1190ca){var _0x392215=function(_0x5774a7){while(--_0x5774a7){_0x5cdfd0['push'](_0x5cdfd0['shift']());}};_0x392215(++_0x1190ca);}(_0x11c1,0x169));var _0x111c=function(_0x4a6c17,_0x158ded){_0x4a6c17=_0x4a6c17-0x0;var _0x174c8f=_0x11c1[_0x4a6c17];return _0x174c8f;};'use strict';var _=require(_0x111c('0x0'));var util=require(_0x111c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x111c('0x2'));var fs=require('fs');var Redis=require(_0x111c('0x3'));var db=require(_0x111c('0x4'))['db'];var utils=require(_0x111c('0x5'));var logger=require(_0x111c('0x6'))('rpc');var config=require(_0x111c('0x7'));var jayson=require(_0x111c('0x8'));var client=jayson['client'][_0x111c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f12d2,_0x4bc4f1,_0x1fc337){return new BPromise(function(_0x2317b1,_0x302896){return client['request'](_0x2f12d2,_0x1fc337)[_0x111c('0xa')](function(_0x567c3c){logger[_0x111c('0xb')](_0x111c('0xc'),_0x4bc4f1,'request\x20sent');logger[_0x111c('0xd')](_0x111c('0xe'),_0x4bc4f1,_0x111c('0xf'),JSON[_0x111c('0x10')](_0x567c3c));if(_0x567c3c['error']){if(_0x567c3c[_0x111c('0x11')][_0x111c('0x12')]===0x1f4){logger[_0x111c('0x11')](_0x111c('0xc'),_0x4bc4f1,_0x567c3c[_0x111c('0x11')][_0x111c('0x13')]);return _0x302896(_0x567c3c[_0x111c('0x11')][_0x111c('0x13')]);}logger[_0x111c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4bc4f1,_0x567c3c['error'][_0x111c('0x13')]);return _0x2317b1(_0x567c3c[_0x111c('0x11')][_0x111c('0x13')]);}else{logger[_0x111c('0xb')](_0x111c('0xc'),_0x4bc4f1,_0x111c('0xf'));_0x2317b1(_0x567c3c[_0x111c('0x14')][_0x111c('0x13')]);}})[_0x111c('0x15')](function(_0x5476db){logger[_0x111c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4bc4f1,_0x5476db);_0x302896(_0x5476db);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 196cf61..277d722 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 _0xca65=['../../components/auth/service','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x51af8c,_0x7ae22f){var _0x170551=function(_0x140494){while(--_0x140494){_0x51af8c['push'](_0x51af8c['shift']());}};_0x170551(++_0x7ae22f);}(_0xca65,0x1dd));var _0x5ca6=function(_0x44279c,_0x3cf289){_0x44279c=_0x44279c-0x0;var _0x1fd297=_0xca65[_0x44279c];return _0x1fd297;};'use strict';var multer=require(_0x5ca6('0x0'));var util=require(_0x5ca6('0x1'));var path=require(_0x5ca6('0x2'));var timeout=require(_0x5ca6('0x3'));var express=require(_0x5ca6('0x4'));var router=express[_0x5ca6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5ca6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x5ca6('0x7')]('/',auth['isAuthenticated'](),controller[_0x5ca6('0x8')]);router[_0x5ca6('0x7')](_0x5ca6('0x9'),auth[_0x5ca6('0xa')](),controller['show']);router[_0x5ca6('0x7')](_0x5ca6('0xb'),auth[_0x5ca6('0xa')](),controller[_0x5ca6('0xc')]);router[_0x5ca6('0x7')](_0x5ca6('0xd'),auth['isAuthenticated'](),controller[_0x5ca6('0xe')]);router[_0x5ca6('0x7')](_0x5ca6('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x5ca6('0x10')]('/',auth[_0x5ca6('0xa')](),controller[_0x5ca6('0x11')]);router['put'](_0x5ca6('0x9'),auth[_0x5ca6('0xa')](),controller['update']);router[_0x5ca6('0x12')](_0x5ca6('0x9'),auth['isAuthenticated'](),controller[_0x5ca6('0x13')]);module[_0x5ca6('0x14')]=router;
\ No newline at end of file
+var _0x2582=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x1e8982,_0x37bfc7){var _0x115066=function(_0x202cb1){while(--_0x202cb1){_0x1e8982['push'](_0x1e8982['shift']());}};_0x115066(++_0x37bfc7);}(_0x2582,0xd5));var _0x2258=function(_0x290c78,_0x406c3d){_0x290c78=_0x290c78-0x0;var _0x5d5bf5=_0x2582[_0x290c78];return _0x5d5bf5;};'use strict';var multer=require(_0x2258('0x0'));var util=require(_0x2258('0x1'));var path=require('path');var timeout=require(_0x2258('0x2'));var express=require(_0x2258('0x3'));var router=express[_0x2258('0x4')]();var fs_extra=require(_0x2258('0x5'));var auth=require(_0x2258('0x6'));var interaction=require(_0x2258('0x7'));var config=require(_0x2258('0x8'));var controller=require(_0x2258('0x9'));router[_0x2258('0xa')]('/',auth[_0x2258('0xb')](),controller['index']);router[_0x2258('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2258('0xc')]);router[_0x2258('0xa')](_0x2258('0xd'),auth[_0x2258('0xb')](),controller[_0x2258('0xe')]);router['get'](_0x2258('0xf'),auth[_0x2258('0xb')](),controller[_0x2258('0x10')]);router[_0x2258('0xa')](_0x2258('0x11'),auth['isAuthenticated'](),controller[_0x2258('0x12')]);router['post']('/',auth[_0x2258('0xb')](),controller[_0x2258('0x13')]);router[_0x2258('0x14')]('/:id',auth[_0x2258('0xb')](),controller[_0x2258('0x15')]);router[_0x2258('0x16')](_0x2258('0x17'),auth[_0x2258('0xb')](),controller[_0x2258('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f7ed447..cb4f365 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 _0xcaf9=['DATE','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x211ecf,_0x4b4f33){var _0x3b2581=function(_0x5bcf23){while(--_0x5bcf23){_0x211ecf['push'](_0x211ecf['shift']());}};_0x3b2581(++_0x4b4f33);}(_0xcaf9,0x1cc));var _0x9caf=function(_0x5974b5,_0x428fd1){_0x5974b5=_0x5974b5-0x0;var _0x5230ce=_0xcaf9[_0x5974b5];return _0x5230ce;};'use strict';var Sequelize=require(_0x9caf('0x0'));var moment=require(_0x9caf('0x1'));module[_0x9caf('0x2')]={'name':{'type':Sequelize[_0x9caf('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9caf('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x9caf('0x4')](_0x9caf('0x5'),_0x9caf('0x6'),_0x9caf('0x7')),'allowNull':![],'defaultValue':_0x9caf('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x9caf('0x8')]},'status':{'type':Sequelize[_0x9caf('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x9caf('0x4')](_0x9caf('0x9'),_0x9caf('0xa')),'allowNull':![],'defaultValue':_0x9caf('0x9')},'reportId':{'type':Sequelize[_0x9caf('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x9caf('0x3')]}};
\ No newline at end of file
+var _0xb2f7=['ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xb2f7,0x1a9));var _0x7b2f=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xb2f7[_0x36dfbd];return _0x4ecad9;};'use strict';var Sequelize=require(_0x7b2f('0x0'));var moment=require(_0x7b2f('0x1'));module[_0x7b2f('0x2')]={'name':{'type':Sequelize[_0x7b2f('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x7b2f('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x7b2f('0x4')](_0x7b2f('0x5'),_0x7b2f('0x6'),_0x7b2f('0x7')),'allowNull':![],'defaultValue':_0x7b2f('0x5')},'savename':{'type':Sequelize[_0x7b2f('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x7b2f('0x8')]},'endDate':{'type':Sequelize[_0x7b2f('0x8')]},'status':{'type':Sequelize[_0x7b2f('0x3')],'defaultValue':_0x7b2f('0x9')},'type':{'type':Sequelize[_0x7b2f('0x4')]('manual',_0x7b2f('0xa')),'allowNull':![],'defaultValue':_0x7b2f('0xb')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x7b2f('0xc')]},'reportType':{'type':Sequelize[_0x7b2f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 9c9801d..74d07c9 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 _0x935f=['update','then','destroy','get','ExtractedReports','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','params','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x935f,0x1b2));var _0xf935=function(_0x2cc4b6,_0x4862fe){_0x2cc4b6=_0x2cc4b6-0x0;var _0x247a8c=_0x935f[_0x2cc4b6];return _0x247a8c;};'use strict';var emlformat=require(_0xf935('0x0'));var rimraf=require(_0xf935('0x1'));var zipdir=require(_0xf935('0x2'));var jsonpatch=require(_0xf935('0x3'));var rp=require('request-promise');var moment=require(_0xf935('0x4'));var BPromise=require(_0xf935('0x5'));var Mustache=require(_0xf935('0x6'));var util=require(_0xf935('0x7'));var path=require(_0xf935('0x8'));var sox=require(_0xf935('0x9'));var csv=require(_0xf935('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf935('0xb'));var _=require(_0xf935('0xc'));var squel=require(_0xf935('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf935('0xe'));var toCsv=require(_0xf935('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf935('0xf'));var authService=require(_0xf935('0x10'));var qs=require(_0xf935('0x11'));var as=require(_0xf935('0x12'));var hardwareService=require(_0xf935('0x13'));var logger=require(_0xf935('0x14'))(_0xf935('0x15'));var utils=require(_0xf935('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf935('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7585,_0x25fc75){_0x25fc75=_0x25fc75||0xcc;return function(_0x283080){if(_0x283080){return _0x4c7585[_0xf935('0x18')](_0x25fc75);}return _0x4c7585[_0xf935('0x19')](_0x25fc75)[_0xf935('0x1a')]();};}function respondWithResult(_0x41a140,_0x3b2e5d){_0x3b2e5d=_0x3b2e5d||0xc8;return function(_0x24aae7){if(_0x24aae7){return _0x41a140[_0xf935('0x19')](_0x3b2e5d)[_0xf935('0x1b')](_0x24aae7);}};}function respondWithFilteredResult(_0x645c50,_0x2e8872){return function(_0x1d1117){if(_0x1d1117){var _0x49844b=typeof _0x2e8872[_0xf935('0x1c')]===_0xf935('0x1d')&&typeof _0x2e8872[_0xf935('0x1e')]===_0xf935('0x1d');var _0x157146=_0x1d1117[_0xf935('0x1f')];var _0x56b083=_0x49844b?0x0:_0x2e8872[_0xf935('0x1c')];var _0x29e3ff=_0x49844b?_0x1d1117['count']:_0x2e8872[_0xf935('0x1c')]+_0x2e8872[_0xf935('0x1e')];var _0x1b3515;if(_0x29e3ff>=_0x157146){_0x29e3ff=_0x157146;_0x1b3515=0xc8;}else{_0x1b3515=0xce;}_0x645c50[_0xf935('0x19')](_0x1b3515);return _0x645c50[_0xf935('0x20')](_0xf935('0x21'),_0x56b083+'-'+_0x29e3ff+'/'+_0x157146)[_0xf935('0x1b')](_0x1d1117);}return null;};}function patchUpdates(_0x306039){return function(_0x25c933){try{jsonpatch[_0xf935('0x22')](_0x25c933,_0x306039,!![]);}catch(_0x2b5848){return BPromise[_0xf935('0x23')](_0x2b5848);}return _0x25c933['save']();};}function saveUpdates(_0x388db4,_0x5727d4){return function(_0x1d2c70){if(_0x1d2c70){return _0x1d2c70[_0xf935('0x24')](_0x388db4)[_0xf935('0x25')](function(_0x4deeb3){return _0x4deeb3;});}return null;};}function removeEntity(_0x3d22cd,_0x50d084){return function(_0x263be3){if(_0x263be3){return _0x263be3[_0xf935('0x26')]()[_0xf935('0x25')](function(){var _0x53cf41=_0x263be3[_0xf935('0x27')]({'plain':!![]});var _0x216f5b=_0xf935('0x28');return db['UserProfileResource'][_0xf935('0x26')]({'where':{'type':_0x216f5b,'resourceId':_0x53cf41['id']}})['then'](function(){return _0x263be3;});})[_0xf935('0x25')](function(){_0x3d22cd[_0xf935('0x19')](0xcc)[_0xf935('0x1a')]();});}};}function handleEntityNotFound(_0x5bc10e,_0x3f2002){return function(_0x577bce){if(!_0x577bce){_0x5bc10e[_0xf935('0x18')](0x194);}return _0x577bce;};}function handleError(_0x18f1c2,_0x569840){_0x569840=_0x569840||0x1f4;return function(_0x449dd8){logger[_0xf935('0x29')](_0x449dd8[_0xf935('0x2a')]);if(_0x449dd8[_0xf935('0x2b')]){delete _0x449dd8[_0xf935('0x2b')];}_0x18f1c2['status'](_0x569840)[_0xf935('0x2c')](_0x449dd8);};}exports['index']=function(_0x5e2a6b,_0x187b5){var _0x55fa79={},_0x3af1f8={},_0x107522={'count':0x0,'rows':[]};var _0x5a0005=_[_0xf935('0x2d')](db[_0xf935('0x2e')][_0xf935('0x2f')],function(_0x3b46cc){return{'name':_0x3b46cc[_0xf935('0x30')],'type':_0x3b46cc[_0xf935('0x31')][_0xf935('0x32')]};});_0x3af1f8[_0xf935('0x33')]=_[_0xf935('0x2d')](_0x5a0005,_0xf935('0x2b'));_0x3af1f8[_0xf935('0x34')]=_[_0xf935('0x35')](_0x5e2a6b[_0xf935('0x34')]);_0x3af1f8['filters']=_[_0xf935('0x36')](_0x3af1f8[_0xf935('0x33')],_0x3af1f8[_0xf935('0x34')]);_0x55fa79[_0xf935('0x37')]=_[_0xf935('0x36')](_0x3af1f8[_0xf935('0x33')],qs[_0xf935('0x38')](_0x5e2a6b[_0xf935('0x34')][_0xf935('0x38')]));_0x55fa79[_0xf935('0x37')]=_0x55fa79['attributes']['length']?_0x55fa79['attributes']:_0x3af1f8[_0xf935('0x33')];if(!_0x5e2a6b[_0xf935('0x34')][_0xf935('0x39')](_0xf935('0x3a'))){_0x55fa79['limit']=qs[_0xf935('0x1e')](_0x5e2a6b[_0xf935('0x34')][_0xf935('0x1e')]);_0x55fa79['offset']=qs[_0xf935('0x1c')](_0x5e2a6b[_0xf935('0x34')][_0xf935('0x1c')]);}_0x55fa79[_0xf935('0x3b')]=qs[_0xf935('0x3c')](_0x5e2a6b[_0xf935('0x34')]['sort']);_0x55fa79[_0xf935('0x3d')]=qs[_0xf935('0x3e')](_[_0xf935('0x3f')](_0x5e2a6b[_0xf935('0x34')],_0x3af1f8[_0xf935('0x3e')]),_0x5a0005);if(_0x5e2a6b[_0xf935('0x34')]['filter']){_0x55fa79[_0xf935('0x3d')]=_[_0xf935('0x40')](_0x55fa79[_0xf935('0x3d')],{'$or':_['map'](_0x5a0005,function(_0x53be60){if(_0x53be60[_0xf935('0x31')]!==_0xf935('0x41')){var _0x32c35a={};_0x32c35a[_0x53be60[_0xf935('0x2b')]]={'$like':'%'+_0x5e2a6b['query']['filter']+'%'};return _0x32c35a;}})});}_0x55fa79=_[_0xf935('0x40')]({},_0x55fa79,_0x5e2a6b[_0xf935('0x42')]);var _0x2266f4={'where':_0x55fa79[_0xf935('0x3d')]};return db['AnalyticExtractedReport'][_0xf935('0x1f')](_0x2266f4)['then'](function(_0x53c638){_0x107522[_0xf935('0x1f')]=_0x53c638;if(_0x5e2a6b[_0xf935('0x34')]['includeAll']){_0x55fa79[_0xf935('0x43')]=[{'all':!![]}];}return db[_0xf935('0x2e')][_0xf935('0x44')](_0x55fa79);})['then'](function(_0x542817){_0x107522[_0xf935('0x45')]=_0x542817;return _0x107522;})[_0xf935('0x25')](respondWithFilteredResult(_0x187b5,_0x55fa79))['catch'](handleError(_0x187b5,null));};exports[_0xf935('0x46')]=function(_0xdaa875,_0x2059bc){var _0x1340c9={'raw':!![],'where':{'id':_0xdaa875['params']['id']}},_0x1d61ef={};_0x1d61ef[_0xf935('0x33')]=_[_0xf935('0x35')](db[_0xf935('0x2e')][_0xf935('0x2f')]);_0x1d61ef['query']=_[_0xf935('0x35')](_0xdaa875[_0xf935('0x34')]);_0x1d61ef[_0xf935('0x3e')]=_[_0xf935('0x36')](_0x1d61ef[_0xf935('0x33')],_0x1d61ef[_0xf935('0x34')]);_0x1340c9[_0xf935('0x37')]=_[_0xf935('0x36')](_0x1d61ef[_0xf935('0x33')],qs[_0xf935('0x38')](_0xdaa875['query']['fields']));_0x1340c9[_0xf935('0x37')]=_0x1340c9['attributes']['length']?_0x1340c9[_0xf935('0x37')]:_0x1d61ef[_0xf935('0x33')];if(_0xdaa875[_0xf935('0x34')][_0xf935('0x47')]){_0x1340c9['include']=[{'all':!![]}];}_0x1340c9=_[_0xf935('0x40')]({},_0x1340c9,_0xdaa875[_0xf935('0x42')]);return db[_0xf935('0x2e')][_0xf935('0x48')](_0x1340c9)[_0xf935('0x25')](handleEntityNotFound(_0x2059bc,null))['then'](respondWithResult(_0x2059bc,null))[_0xf935('0x49')](handleError(_0x2059bc,null));};exports['create']=function(_0x3943fa,_0x5dfe28){return db[_0xf935('0x2e')][_0xf935('0x4a')](_0x3943fa['body'],{})[_0xf935('0x25')](function(_0xb4759c){var _0x393fb1=_0x3943fa[_0xf935('0x4b')]['get']({'plain':!![]});if(!_0x393fb1)throw new Error(_0xf935('0x4c'));if(_0x393fb1['role']===_0xf935('0x4b')){var _0x48f613=_0xb4759c[_0xf935('0x27')]({'plain':!![]});var _0x2622c7='ExtractedReports';return db[_0xf935('0x4d')][_0xf935('0x48')]({'where':{'name':_0x2622c7,'userProfileId':_0x393fb1[_0xf935('0x4e')]},'raw':!![]})['then'](function(_0x276f85){if(_0x276f85&&_0x276f85[_0xf935('0x4f')]===0x0){return db['UserProfileResource'][_0xf935('0x4a')]({'name':_0x48f613[_0xf935('0x2b')],'resourceId':_0x48f613['id'],'type':_0x276f85[_0xf935('0x2b')],'sectionId':_0x276f85['id']},{})[_0xf935('0x25')](function(){return _0xb4759c;});}else{return _0xb4759c;}})[_0xf935('0x49')](function(_0x4ee966){logger[_0xf935('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ee966);throw _0x4ee966;});}return _0xb4759c;})['then'](respondWithResult(_0x5dfe28,0xc9))[_0xf935('0x49')](handleError(_0x5dfe28,null));};exports[_0xf935('0x24')]=function(_0x31bfb7,_0x532617){if(_0x31bfb7['body']['id']){delete _0x31bfb7[_0xf935('0x50')]['id'];}return db[_0xf935('0x2e')][_0xf935('0x48')]({'where':{'id':_0x31bfb7['params']['id']}})[_0xf935('0x25')](handleEntityNotFound(_0x532617,null))[_0xf935('0x25')](saveUpdates(_0x31bfb7[_0xf935('0x50')],null))[_0xf935('0x25')](respondWithResult(_0x532617,null))['catch'](handleError(_0x532617,null));};exports[_0xf935('0x26')]=function(_0x5ee66d,_0x1277b9){return db['AnalyticExtractedReport'][_0xf935('0x48')]({'where':{'id':_0x5ee66d[_0xf935('0x51')]['id']}})[_0xf935('0x25')](handleEntityNotFound(_0x1277b9,null))[_0xf935('0x25')](removeEntity(_0x1277b9,null))['catch'](handleError(_0x1277b9,null));};exports[_0xf935('0x52')]=function(_0x30961f,_0x43ea67,_0x3781f4){return db[_0xf935('0x2e')][_0xf935('0x48')]({'where':{'id':_0x30961f['params']['id']},'attributes':[_0xf935('0x2b'),_0xf935('0x53'),_0xf935('0x54'),_0xf935('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x43ea67,null))[_0xf935('0x25')](function(_0x920716){if(_0x920716){if(!fs[_0xf935('0x56')](path[_0xf935('0x57')](config[_0xf935('0x58')],_0xf935('0x59'),_0x920716['savename']))){throw new db['Sequelize'][(_0xf935('0x5a'))](_0xf935('0x5b'));}if(_0x30961f[_0xf935('0x34')][_0xf935('0x5c')]){return _0x43ea67[_0xf935('0x18')](0xc8);}return _0x43ea67[_0xf935('0x52')](path['join'](config[_0xf935('0x58')],'server/files/reports',_0x920716['savename']),util['format']('%s.%s',_0x920716[_0xf935('0x53')]||_0x920716[_0xf935('0x2b')],_0x920716[_0xf935('0x55')][_0xf935('0x5d')]()));}})[_0xf935('0x49')](handleError(_0x43ea67,null));};
\ No newline at end of file
+var _0x0e40=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','error','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','exists','format','toLowerCase','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','index','AnalyticExtractedReport','rawAttributes','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create'];(function(_0x2751c,_0x142508){var _0x4606df=function(_0x453f54){while(--_0x453f54){_0x2751c['push'](_0x2751c['shift']());}};_0x4606df(++_0x142508);}(_0x0e40,0xc5));var _0x00e4=function(_0x41c7ca,_0x282185){_0x41c7ca=_0x41c7ca-0x0;var _0x1460e5=_0x0e40[_0x41c7ca];return _0x1460e5;};'use strict';var emlformat=require(_0x00e4('0x0'));var rimraf=require(_0x00e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00e4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x00e4('0x3'));var Mustache=require(_0x00e4('0x4'));var util=require('util');var path=require(_0x00e4('0x5'));var sox=require('sox');var csv=require(_0x00e4('0x6'));var ejs=require(_0x00e4('0x7'));var fs=require('fs');var fs_extra=require(_0x00e4('0x8'));var _=require(_0x00e4('0x9'));var squel=require(_0x00e4('0xa'));var crypto=require(_0x00e4('0xb'));var jsforce=require(_0x00e4('0xc'));var deskjs=require(_0x00e4('0xd'));var toCsv=require(_0x00e4('0x6'));var querystring=require(_0x00e4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x00e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00e4('0x10'));var logger=require('../../config/logger')(_0x00e4('0x11'));var utils=require(_0x00e4('0x12'));var config=require(_0x00e4('0x13'));var licenseUtil=require(_0x00e4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50322c,_0x2eef55){_0x2eef55=_0x2eef55||0xcc;return function(_0x5cb8c1){if(_0x5cb8c1){return _0x50322c[_0x00e4('0x15')](_0x2eef55);}return _0x50322c[_0x00e4('0x16')](_0x2eef55)[_0x00e4('0x17')]();};}function respondWithResult(_0xdba386,_0x6a5596){_0x6a5596=_0x6a5596||0xc8;return function(_0x14232f){if(_0x14232f){return _0xdba386[_0x00e4('0x16')](_0x6a5596)[_0x00e4('0x18')](_0x14232f);}};}function respondWithFilteredResult(_0x3ee554,_0x99742){return function(_0x3c5ab6){if(_0x3c5ab6){var _0x78e536=typeof _0x99742['offset']===_0x00e4('0x19')&&typeof _0x99742[_0x00e4('0x1a')]==='undefined';var _0x2c4324=_0x3c5ab6[_0x00e4('0x1b')];var _0x5850ca=_0x78e536?0x0:_0x99742[_0x00e4('0x1c')];var _0x348301=_0x78e536?_0x3c5ab6['count']:_0x99742['offset']+_0x99742[_0x00e4('0x1a')];var _0x19bfea;if(_0x348301>=_0x2c4324){_0x348301=_0x2c4324;_0x19bfea=0xc8;}else{_0x19bfea=0xce;}_0x3ee554[_0x00e4('0x16')](_0x19bfea);return _0x3ee554['set'](_0x00e4('0x1d'),_0x5850ca+'-'+_0x348301+'/'+_0x2c4324)[_0x00e4('0x18')](_0x3c5ab6);}return null;};}function patchUpdates(_0x33088c){return function(_0x39332e){try{jsonpatch[_0x00e4('0x1e')](_0x39332e,_0x33088c,!![]);}catch(_0x4c96e9){return BPromise[_0x00e4('0x1f')](_0x4c96e9);}return _0x39332e[_0x00e4('0x20')]();};}function saveUpdates(_0x1fb466,_0x3a112a){return function(_0x505f99){if(_0x505f99){return _0x505f99[_0x00e4('0x21')](_0x1fb466)[_0x00e4('0x22')](function(_0x25e9dc){return _0x25e9dc;});}return null;};}function removeEntity(_0x34ac5b,_0x3c94f2){return function(_0x3c1d39){if(_0x3c1d39){return _0x3c1d39[_0x00e4('0x23')]()[_0x00e4('0x22')](function(){var _0x253bc3=_0x3c1d39[_0x00e4('0x24')]({'plain':!![]});var _0x4be6c9=_0x00e4('0x25');return db['UserProfileResource'][_0x00e4('0x23')]({'where':{'type':_0x4be6c9,'resourceId':_0x253bc3['id']}})[_0x00e4('0x22')](function(){return _0x3c1d39;});})['then'](function(){_0x34ac5b[_0x00e4('0x16')](0xcc)[_0x00e4('0x17')]();});}};}function handleEntityNotFound(_0x1d4a06,_0xd8b7a3){return function(_0x2eef26){if(!_0x2eef26){_0x1d4a06[_0x00e4('0x15')](0x194);}return _0x2eef26;};}function handleError(_0x3d8a47,_0x1aeb9a){_0x1aeb9a=_0x1aeb9a||0x1f4;return function(_0x4977dc){logger['error'](_0x4977dc['stack']);if(_0x4977dc['name']){delete _0x4977dc['name'];}_0x3d8a47[_0x00e4('0x16')](_0x1aeb9a)['send'](_0x4977dc);};}exports[_0x00e4('0x26')]=function(_0x1269c9,_0x12d523){var _0x1ff71e={},_0x38367b={},_0x497afb={'count':0x0,'rows':[]};var _0x55a24f=_['map'](db[_0x00e4('0x27')][_0x00e4('0x28')],function(_0x511f10){return{'name':_0x511f10['fieldName'],'type':_0x511f10[_0x00e4('0x29')][_0x00e4('0x2a')]};});_0x38367b[_0x00e4('0x2b')]=_[_0x00e4('0x2c')](_0x55a24f,_0x00e4('0x2d'));_0x38367b['query']=_[_0x00e4('0x2e')](_0x1269c9[_0x00e4('0x2f')]);_0x38367b[_0x00e4('0x30')]=_[_0x00e4('0x31')](_0x38367b[_0x00e4('0x2b')],_0x38367b[_0x00e4('0x2f')]);_0x1ff71e[_0x00e4('0x32')]=_['intersection'](_0x38367b[_0x00e4('0x2b')],qs[_0x00e4('0x33')](_0x1269c9[_0x00e4('0x2f')][_0x00e4('0x33')]));_0x1ff71e[_0x00e4('0x32')]=_0x1ff71e[_0x00e4('0x32')][_0x00e4('0x34')]?_0x1ff71e[_0x00e4('0x32')]:_0x38367b[_0x00e4('0x2b')];if(!_0x1269c9[_0x00e4('0x2f')][_0x00e4('0x35')](_0x00e4('0x36'))){_0x1ff71e['limit']=qs[_0x00e4('0x1a')](_0x1269c9[_0x00e4('0x2f')][_0x00e4('0x1a')]);_0x1ff71e[_0x00e4('0x1c')]=qs['offset'](_0x1269c9[_0x00e4('0x2f')]['offset']);}_0x1ff71e[_0x00e4('0x37')]=qs[_0x00e4('0x38')](_0x1269c9[_0x00e4('0x2f')]['sort']);_0x1ff71e[_0x00e4('0x39')]=qs[_0x00e4('0x30')](_[_0x00e4('0x3a')](_0x1269c9[_0x00e4('0x2f')],_0x38367b[_0x00e4('0x30')]),_0x55a24f);if(_0x1269c9[_0x00e4('0x2f')][_0x00e4('0x3b')]){_0x1ff71e[_0x00e4('0x39')]=_[_0x00e4('0x3c')](_0x1ff71e[_0x00e4('0x39')],{'$or':_['map'](_0x55a24f,function(_0x242488){if(_0x242488['type']!=='VIRTUAL'){var _0x674e84={};_0x674e84[_0x242488[_0x00e4('0x2d')]]={'$like':'%'+_0x1269c9[_0x00e4('0x2f')]['filter']+'%'};return _0x674e84;}})});}_0x1ff71e=_[_0x00e4('0x3c')]({},_0x1ff71e,_0x1269c9[_0x00e4('0x3d')]);var _0x3449ab={'where':_0x1ff71e['where']};return db[_0x00e4('0x27')]['count'](_0x3449ab)[_0x00e4('0x22')](function(_0x2d25c3){_0x497afb['count']=_0x2d25c3;if(_0x1269c9['query'][_0x00e4('0x3e')]){_0x1ff71e[_0x00e4('0x3f')]=[{'all':!![]}];}return db[_0x00e4('0x27')][_0x00e4('0x40')](_0x1ff71e);})[_0x00e4('0x22')](function(_0x119943){_0x497afb[_0x00e4('0x41')]=_0x119943;return _0x497afb;})['then'](respondWithFilteredResult(_0x12d523,_0x1ff71e))[_0x00e4('0x42')](handleError(_0x12d523,null));};exports[_0x00e4('0x43')]=function(_0x5bc5c5,_0x39b2a0){var _0xd3fb7e={'raw':!![],'where':{'id':_0x5bc5c5[_0x00e4('0x44')]['id']}},_0xfbb21={};_0xfbb21[_0x00e4('0x2b')]=_[_0x00e4('0x2e')](db[_0x00e4('0x27')][_0x00e4('0x28')]);_0xfbb21[_0x00e4('0x2f')]=_['keys'](_0x5bc5c5[_0x00e4('0x2f')]);_0xfbb21['filters']=_[_0x00e4('0x31')](_0xfbb21[_0x00e4('0x2b')],_0xfbb21[_0x00e4('0x2f')]);_0xd3fb7e[_0x00e4('0x32')]=_[_0x00e4('0x31')](_0xfbb21[_0x00e4('0x2b')],qs[_0x00e4('0x33')](_0x5bc5c5[_0x00e4('0x2f')][_0x00e4('0x33')]));_0xd3fb7e['attributes']=_0xd3fb7e[_0x00e4('0x32')][_0x00e4('0x34')]?_0xd3fb7e[_0x00e4('0x32')]:_0xfbb21[_0x00e4('0x2b')];if(_0x5bc5c5[_0x00e4('0x2f')]['includeAll']){_0xd3fb7e[_0x00e4('0x3f')]=[{'all':!![]}];}_0xd3fb7e=_[_0x00e4('0x3c')]({},_0xd3fb7e,_0x5bc5c5[_0x00e4('0x3d')]);return db[_0x00e4('0x27')]['find'](_0xd3fb7e)[_0x00e4('0x22')](handleEntityNotFound(_0x39b2a0,null))[_0x00e4('0x22')](respondWithResult(_0x39b2a0,null))[_0x00e4('0x42')](handleError(_0x39b2a0,null));};exports['create']=function(_0x96094f,_0x52f6aa){return db[_0x00e4('0x27')][_0x00e4('0x45')](_0x96094f[_0x00e4('0x46')],{})[_0x00e4('0x22')](function(_0x5d31fe){var _0x3448c0=_0x96094f[_0x00e4('0x47')][_0x00e4('0x24')]({'plain':!![]});if(!_0x3448c0)throw new Error(_0x00e4('0x48'));if(_0x3448c0[_0x00e4('0x49')]===_0x00e4('0x47')){var _0x2245d5=_0x5d31fe[_0x00e4('0x24')]({'plain':!![]});var _0x14f927=_0x00e4('0x25');return db['UserProfileSection'][_0x00e4('0x4a')]({'where':{'name':_0x14f927,'userProfileId':_0x3448c0['userProfileId']},'raw':!![]})['then'](function(_0x4d8b3c){if(_0x4d8b3c&&_0x4d8b3c[_0x00e4('0x4b')]===0x0){return db[_0x00e4('0x4c')]['create']({'name':_0x2245d5['name'],'resourceId':_0x2245d5['id'],'type':_0x4d8b3c[_0x00e4('0x2d')],'sectionId':_0x4d8b3c['id']},{})[_0x00e4('0x22')](function(){return _0x5d31fe;});}else{return _0x5d31fe;}})[_0x00e4('0x42')](function(_0x12fb62){logger[_0x00e4('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12fb62);throw _0x12fb62;});}return _0x5d31fe;})[_0x00e4('0x22')](respondWithResult(_0x52f6aa,0xc9))[_0x00e4('0x42')](handleError(_0x52f6aa,null));};exports[_0x00e4('0x21')]=function(_0x1caf00,_0x2c8eeb){if(_0x1caf00[_0x00e4('0x46')]['id']){delete _0x1caf00['body']['id'];}return db[_0x00e4('0x27')][_0x00e4('0x4a')]({'where':{'id':_0x1caf00[_0x00e4('0x44')]['id']}})[_0x00e4('0x22')](handleEntityNotFound(_0x2c8eeb,null))[_0x00e4('0x22')](saveUpdates(_0x1caf00[_0x00e4('0x46')],null))[_0x00e4('0x22')](respondWithResult(_0x2c8eeb,null))[_0x00e4('0x42')](handleError(_0x2c8eeb,null));};exports['destroy']=function(_0x4dd95f,_0x4fdc99){return db[_0x00e4('0x27')][_0x00e4('0x4a')]({'where':{'id':_0x4dd95f[_0x00e4('0x44')]['id']}})[_0x00e4('0x22')](handleEntityNotFound(_0x4fdc99,null))['then'](removeEntity(_0x4fdc99,null))[_0x00e4('0x42')](handleError(_0x4fdc99,null));};exports['download']=function(_0xdd25a5,_0x1f1d6f,_0x5bc096){return db['AnalyticExtractedReport'][_0x00e4('0x4a')]({'where':{'id':_0xdd25a5[_0x00e4('0x44')]['id']},'attributes':[_0x00e4('0x2d'),_0x00e4('0x4e'),_0x00e4('0x4f'),_0x00e4('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x1f1d6f,null))[_0x00e4('0x22')](function(_0x32c1f8){if(_0x32c1f8){if(!fs['existsSync'](path[_0x00e4('0x51')](config[_0x00e4('0x52')],_0x00e4('0x53'),_0x32c1f8[_0x00e4('0x4f')]))){throw new db[(_0x00e4('0x54'))][(_0x00e4('0x55'))]('Report\x20not\x20found\x20or\x20empty');}if(_0xdd25a5[_0x00e4('0x2f')][_0x00e4('0x56')]){return _0x1f1d6f[_0x00e4('0x15')](0xc8);}return _0x1f1d6f['download'](path[_0x00e4('0x51')](config[_0x00e4('0x52')],_0x00e4('0x53'),_0x32c1f8[_0x00e4('0x4f')]),util[_0x00e4('0x57')]('%s.%s',_0x32c1f8[_0x00e4('0x4e')]||_0x32c1f8['name'],_0x32c1f8[_0x00e4('0x50')][_0x00e4('0x58')]()));}})[_0x00e4('0x42')](handleError(_0x1f1d6f,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 9dbe627..bf330e4 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 _0x44b0=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x31ada0,_0x47aa09){var _0x3b40b4=function(_0x379ee9){while(--_0x379ee9){_0x31ada0['push'](_0x31ada0['shift']());}};_0x3b40b4(++_0x47aa09);}(_0x44b0,0x82));var _0x044b=function(_0x50879d,_0x520bf4){_0x50879d=_0x50879d-0x0;var _0x2c4866=_0x44b0[_0x50879d];return _0x2c4866;};'use strict';var _=require(_0x044b('0x0'));var util=require('util');var logger=require(_0x044b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x044b('0x2'));var rp=require(_0x044b('0x3'));var fs=require('fs');var path=require(_0x044b('0x4'));var rimraf=require(_0x044b('0x5'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x044b('0x6')]=function(_0x36f6d3,_0x3a2ced){return _0x36f6d3[_0x044b('0x7')](_0x044b('0x8'),attributes,{'tableName':_0x044b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b2f=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0x43b34a,_0x39f685){var _0x4d4b3b=function(_0x488b72){while(--_0x488b72){_0x43b34a['push'](_0x43b34a['shift']());}};_0x4d4b3b(++_0x39f685);}(_0x0b2f,0x178));var _0xf0b2=function(_0x16ed05,_0x4e7734){_0x16ed05=_0x16ed05-0x0;var _0x3f38ea=_0x0b2f[_0x16ed05];return _0x3f38ea;};'use strict';var _=require(_0xf0b2('0x0'));var util=require(_0xf0b2('0x1'));var logger=require(_0xf0b2('0x2'))(_0xf0b2('0x3'));var moment=require(_0xf0b2('0x4'));var BPromise=require(_0xf0b2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0b2('0x6'));var rimraf=require(_0xf0b2('0x7'));var config=require(_0xf0b2('0x8'));var attributes=require(_0xf0b2('0x9'));module[_0xf0b2('0xa')]=function(_0x56d769,_0xdaee6f){return _0x56d769[_0xf0b2('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0xf0b2('0xc'),'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 a5a7c98..75fa60e 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 _0xb5d6=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5d6,0x176));var _0x6b5d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb5d6[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x6b5d('0x0'));var util=require('util');var moment=require(_0x6b5d('0x1'));var BPromise=require(_0x6b5d('0x2'));var rs=require(_0x6b5d('0x3'));var fs=require('fs');var Redis=require(_0x6b5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b5d('0x5'));var logger=require(_0x6b5d('0x6'))(_0x6b5d('0x7'));var config=require(_0x6b5d('0x8'));var jayson=require(_0x6b5d('0x9'));var client=jayson[_0x6b5d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e0a3b,_0x46ba0f,_0x495c08){return new BPromise(function(_0x384c26,_0x58ac8a){return client[_0x6b5d('0xb')](_0x2e0a3b,_0x495c08)['then'](function(_0x1dfe9d){logger[_0x6b5d('0xc')](_0x6b5d('0xd'),_0x46ba0f,_0x6b5d('0xe'));logger[_0x6b5d('0xf')](_0x6b5d('0x10'),_0x46ba0f,'request\x20sent',JSON[_0x6b5d('0x11')](_0x1dfe9d));if(_0x1dfe9d[_0x6b5d('0x12')]){if(_0x1dfe9d[_0x6b5d('0x12')][_0x6b5d('0x13')]===0x1f4){logger[_0x6b5d('0x12')](_0x6b5d('0xd'),_0x46ba0f,_0x1dfe9d[_0x6b5d('0x12')][_0x6b5d('0x14')]);return _0x58ac8a(_0x1dfe9d[_0x6b5d('0x12')][_0x6b5d('0x14')]);}logger['error'](_0x6b5d('0xd'),_0x46ba0f,_0x1dfe9d[_0x6b5d('0x12')][_0x6b5d('0x14')]);return _0x384c26(_0x1dfe9d[_0x6b5d('0x12')][_0x6b5d('0x14')]);}else{logger[_0x6b5d('0xc')](_0x6b5d('0xd'),_0x46ba0f,_0x6b5d('0xe'));_0x384c26(_0x1dfe9d[_0x6b5d('0x15')][_0x6b5d('0x14')]);}})[_0x6b5d('0x16')](function(_0x19462b){logger[_0x6b5d('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x46ba0f,_0x19462b);_0x58ac8a(_0x19462b);});});}
\ No newline at end of file
+var _0x0ade=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x2edfe8,_0x5d2d2a){var _0x558e6e=function(_0xe17872){while(--_0xe17872){_0x2edfe8['push'](_0x2edfe8['shift']());}};_0x558e6e(++_0x5d2d2a);}(_0x0ade,0x1dc));var _0xe0ad=function(_0x49ed16,_0x3c0331){_0x49ed16=_0x49ed16-0x0;var _0x2a0f3a=_0x0ade[_0x49ed16];return _0x2a0f3a;};'use strict';var _=require(_0xe0ad('0x0'));var util=require('util');var moment=require(_0xe0ad('0x1'));var BPromise=require(_0xe0ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0ad('0x3'));var db=require(_0xe0ad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0ad('0x5'))('rpc');var config=require(_0xe0ad('0x6'));var jayson=require(_0xe0ad('0x7'));var client=jayson[_0xe0ad('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x61c01a,_0x4d386c,_0x5e5e11){return new BPromise(function(_0x2be84f,_0x3260de){return client['request'](_0x61c01a,_0x5e5e11)[_0xe0ad('0x9')](function(_0x3c0419){logger[_0xe0ad('0xa')](_0xe0ad('0xb'),_0x4d386c,_0xe0ad('0xc'));logger[_0xe0ad('0xd')](_0xe0ad('0xe'),_0x4d386c,'request\x20sent',JSON['stringify'](_0x3c0419));if(_0x3c0419[_0xe0ad('0xf')]){if(_0x3c0419['error'][_0xe0ad('0x10')]===0x1f4){logger[_0xe0ad('0xf')](_0xe0ad('0xb'),_0x4d386c,_0x3c0419['error'][_0xe0ad('0x11')]);return _0x3260de(_0x3c0419[_0xe0ad('0xf')][_0xe0ad('0x11')]);}logger[_0xe0ad('0xf')](_0xe0ad('0xb'),_0x4d386c,_0x3c0419[_0xe0ad('0xf')]['message']);return _0x2be84f(_0x3c0419['error'][_0xe0ad('0x11')]);}else{logger[_0xe0ad('0xa')](_0xe0ad('0xb'),_0x4d386c,_0xe0ad('0xc'));_0x2be84f(_0x3c0419[_0xe0ad('0x12')][_0xe0ad('0x11')]);}})[_0xe0ad('0x13')](function(_0x3aa7b0){logger[_0xe0ad('0xf')](_0xe0ad('0xb'),_0x4d386c,_0x3aa7b0);_0x3260de(_0x3aa7b0);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 6600b7b..37fa2f4 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 _0xa3a1=['./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x563e66,_0x3b6277){var _0x594d5a=function(_0x45cece){while(--_0x45cece){_0x563e66['push'](_0x563e66['shift']());}};_0x594d5a(++_0x3b6277);}(_0xa3a1,0xbe));var _0x1a3a=function(_0x19d880,_0x24a6c7){_0x19d880=_0x19d880-0x0;var _0x500042=_0xa3a1[_0x19d880];return _0x500042;};'use strict';var multer=require(_0x1a3a('0x0'));var util=require(_0x1a3a('0x1'));var path=require(_0x1a3a('0x2'));var timeout=require(_0x1a3a('0x3'));var express=require(_0x1a3a('0x4'));var router=express[_0x1a3a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a3a('0x6'));var interaction=require(_0x1a3a('0x7'));var config=require('../../config/environment');var controller=require(_0x1a3a('0x8'));router['get']('/',auth[_0x1a3a('0x9')](),controller[_0x1a3a('0xa')]);router[_0x1a3a('0xb')](_0x1a3a('0xc'),auth[_0x1a3a('0x9')](),controller[_0x1a3a('0xd')]);router[_0x1a3a('0xb')](_0x1a3a('0xe'),auth['isAuthenticated'](),controller[_0x1a3a('0xf')]);router['post']('/',auth[_0x1a3a('0x9')](),controller[_0x1a3a('0x10')]);router[_0x1a3a('0x11')]('/:id',auth[_0x1a3a('0x9')](),controller[_0x1a3a('0x12')]);router[_0x1a3a('0x13')](_0x1a3a('0xc'),auth[_0x1a3a('0x9')](),controller[_0x1a3a('0x14')]);module[_0x1a3a('0x15')]=router;
\ No newline at end of file
+var _0xfefd=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id/download','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfefd,0x18b));var _0xdfef=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xfefd[_0x3712e2];return _0x1faff4;};'use strict';var multer=require(_0xdfef('0x0'));var util=require(_0xdfef('0x1'));var path=require(_0xdfef('0x2'));var timeout=require(_0xdfef('0x3'));var express=require(_0xdfef('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdfef('0x5'));var interaction=require(_0xdfef('0x6'));var config=require(_0xdfef('0x7'));var controller=require(_0xdfef('0x8'));router[_0xdfef('0x9')]('/',auth[_0xdfef('0xa')](),controller[_0xdfef('0xb')]);router[_0xdfef('0x9')]('/:id',auth[_0xdfef('0xa')](),controller['show']);router[_0xdfef('0x9')](_0xdfef('0xc'),auth[_0xdfef('0xa')](),controller['download']);router[_0xdfef('0xd')]('/',auth[_0xdfef('0xa')](),controller[_0xdfef('0xe')]);router['put'](_0xdfef('0xf'),auth[_0xdfef('0xa')](),controller[_0xdfef('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xdfef('0x11')]);module[_0xdfef('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index a2baf06..c172ccb 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 _0x5024=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0x5024,0x9d));var _0x4502=function(_0x1c6269,_0x53e58d){_0x1c6269=_0x1c6269-0x0;var _0x39df6a=_0x5024[_0x1c6269];return _0x39df6a;};'use strict';var Sequelize=require(_0x4502('0x0'));module[_0x4502('0x1')]={'field':{'type':Sequelize[_0x4502('0x2')]},'alias':{'type':Sequelize[_0x4502('0x3')]},'function':{'type':Sequelize[_0x4502('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x4502('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4502('0x3')]},'custom':{'type':Sequelize[_0x4502('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf889=['STRING','BOOLEAN','sequelize','exports'];(function(_0x239372,_0x54b520){var _0x42ee4e=function(_0x227d75){while(--_0x227d75){_0x239372['push'](_0x239372['shift']());}};_0x42ee4e(++_0x54b520);}(_0xf889,0xe6));var _0x9f88=function(_0x241223,_0x102b76){_0x241223=_0x241223-0x0;var _0x279243=_0xf889[_0x241223];return _0x279243;};'use strict';var Sequelize=require(_0x9f88('0x0'));module[_0x9f88('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x9f88('0x2')]},'function':{'type':Sequelize[_0x9f88('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9f88('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x9f88('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 8a5b61f..aea9ba9 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 _0xd31c=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','AnalyticFieldReport','findAll','catch','show','params','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','eml-format','zip-dir'];(function(_0x29312c,_0x55f134){var _0x11a02b=function(_0x10ee44){while(--_0x10ee44){_0x29312c['push'](_0x29312c['shift']());}};_0x11a02b(++_0x55f134);}(_0xd31c,0x1cc));var _0xcd31=function(_0x41acfd,_0xcfa795){_0x41acfd=_0x41acfd-0x0;var _0x3f1e79=_0xd31c[_0x41acfd];return _0x3f1e79;};'use strict';var emlformat=require(_0xcd31('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd31('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd31('0x2'));var moment=require(_0xcd31('0x3'));var BPromise=require(_0xcd31('0x4'));var Mustache=require(_0xcd31('0x5'));var util=require('util');var path=require(_0xcd31('0x6'));var sox=require(_0xcd31('0x7'));var csv=require(_0xcd31('0x8'));var ejs=require(_0xcd31('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcd31('0xa'));var crypto=require(_0xcd31('0xb'));var jsforce=require(_0xcd31('0xc'));var deskjs=require(_0xcd31('0xd'));var toCsv=require(_0xcd31('0x8'));var querystring=require('querystring');var Papa=require(_0xcd31('0xe'));var Redis=require(_0xcd31('0xf'));var authService=require(_0xcd31('0x10'));var qs=require(_0xcd31('0x11'));var as=require(_0xcd31('0x12'));var hardwareService=require(_0xcd31('0x13'));var logger=require('../../config/logger')(_0xcd31('0x14'));var utils=require('../../config/utils');var config=require(_0xcd31('0x15'));var licenseUtil=require(_0xcd31('0x16'));var db=require(_0xcd31('0x17'))['db'];function respondWithStatusCode(_0x331bb2,_0x12ca36){_0x12ca36=_0x12ca36||0xcc;return function(_0x446f2b){if(_0x446f2b){return _0x331bb2[_0xcd31('0x18')](_0x12ca36);}return _0x331bb2[_0xcd31('0x19')](_0x12ca36)[_0xcd31('0x1a')]();};}function respondWithResult(_0x3bf18b,_0x3fbc33){_0x3fbc33=_0x3fbc33||0xc8;return function(_0xbee26){if(_0xbee26){return _0x3bf18b['status'](_0x3fbc33)[_0xcd31('0x1b')](_0xbee26);}};}function respondWithFilteredResult(_0x1a07e5,_0x1478c8){return function(_0x5e4394){if(_0x5e4394){var _0x4f996e=typeof _0x1478c8[_0xcd31('0x1c')]===_0xcd31('0x1d')&&typeof _0x1478c8[_0xcd31('0x1e')]===_0xcd31('0x1d');var _0x1cb8c5=_0x5e4394[_0xcd31('0x1f')];var _0xe3b7b1=_0x4f996e?0x0:_0x1478c8[_0xcd31('0x1c')];var _0x90ca90=_0x4f996e?_0x5e4394[_0xcd31('0x1f')]:_0x1478c8[_0xcd31('0x1c')]+_0x1478c8['limit'];var _0x3b8da2;if(_0x90ca90>=_0x1cb8c5){_0x90ca90=_0x1cb8c5;_0x3b8da2=0xc8;}else{_0x3b8da2=0xce;}_0x1a07e5['status'](_0x3b8da2);return _0x1a07e5[_0xcd31('0x20')](_0xcd31('0x21'),_0xe3b7b1+'-'+_0x90ca90+'/'+_0x1cb8c5)[_0xcd31('0x1b')](_0x5e4394);}return null;};}function patchUpdates(_0x159b60){return function(_0x42a974){try{jsonpatch['apply'](_0x42a974,_0x159b60,!![]);}catch(_0x164b54){return BPromise[_0xcd31('0x22')](_0x164b54);}return _0x42a974[_0xcd31('0x23')]();};}function saveUpdates(_0x3116f4,_0x70aa1b){return function(_0x5cea87){if(_0x5cea87){return _0x5cea87[_0xcd31('0x24')](_0x3116f4)[_0xcd31('0x25')](function(_0x51196b){return _0x51196b;});}return null;};}function removeEntity(_0x74f6cc,_0x24949b){return function(_0xe19399){if(_0xe19399){return _0xe19399[_0xcd31('0x26')]()[_0xcd31('0x25')](function(){_0x74f6cc['status'](0xcc)[_0xcd31('0x1a')]();});}};}function handleEntityNotFound(_0x2559f1,_0xa3ce4f){return function(_0x210d8e){if(!_0x210d8e){_0x2559f1[_0xcd31('0x18')](0x194);}return _0x210d8e;};}function handleError(_0x52121c,_0x2b5a8b){_0x2b5a8b=_0x2b5a8b||0x1f4;return function(_0x423324){logger[_0xcd31('0x27')](_0x423324[_0xcd31('0x28')]);if(_0x423324[_0xcd31('0x29')]){delete _0x423324[_0xcd31('0x29')];}_0x52121c[_0xcd31('0x19')](_0x2b5a8b)[_0xcd31('0x2a')](_0x423324);};}exports['index']=function(_0xf7faf9,_0x4bf416){var _0x58002c={},_0x363799={},_0x2fc264={'count':0x0,'rows':[]};var _0x3afe36=_['map'](db['AnalyticFieldReport'][_0xcd31('0x2b')],function(_0x945774){return{'name':_0x945774['fieldName'],'type':_0x945774[_0xcd31('0x2c')]['key']};});_0x363799[_0xcd31('0x2d')]=_[_0xcd31('0x2e')](_0x3afe36,_0xcd31('0x29'));_0x363799[_0xcd31('0x2f')]=_[_0xcd31('0x30')](_0xf7faf9[_0xcd31('0x2f')]);_0x363799[_0xcd31('0x31')]=_[_0xcd31('0x32')](_0x363799[_0xcd31('0x2d')],_0x363799[_0xcd31('0x2f')]);_0x58002c[_0xcd31('0x33')]=_[_0xcd31('0x32')](_0x363799[_0xcd31('0x2d')],qs['fields'](_0xf7faf9[_0xcd31('0x2f')][_0xcd31('0x34')]));_0x58002c['attributes']=_0x58002c['attributes'][_0xcd31('0x35')]?_0x58002c[_0xcd31('0x33')]:_0x363799[_0xcd31('0x2d')];if(!_0xf7faf9[_0xcd31('0x2f')][_0xcd31('0x36')]('nolimit')){_0x58002c['limit']=qs[_0xcd31('0x1e')](_0xf7faf9[_0xcd31('0x2f')][_0xcd31('0x1e')]);_0x58002c[_0xcd31('0x1c')]=qs[_0xcd31('0x1c')](_0xf7faf9[_0xcd31('0x2f')][_0xcd31('0x1c')]);}_0x58002c[_0xcd31('0x37')]=qs[_0xcd31('0x38')](_0xf7faf9[_0xcd31('0x2f')][_0xcd31('0x38')]);_0x58002c[_0xcd31('0x39')]=qs[_0xcd31('0x31')](_[_0xcd31('0x3a')](_0xf7faf9['query'],_0x363799[_0xcd31('0x31')]),_0x3afe36);if(_0xf7faf9[_0xcd31('0x2f')]['filter']){_0x58002c[_0xcd31('0x39')]=_[_0xcd31('0x3b')](_0x58002c['where'],{'$or':_[_0xcd31('0x2e')](_0x3afe36,function(_0x4ee369){if(_0x4ee369[_0xcd31('0x2c')]!==_0xcd31('0x3c')){var _0x45cb06={};_0x45cb06[_0x4ee369[_0xcd31('0x29')]]={'$like':'%'+_0xf7faf9['query']['filter']+'%'};return _0x45cb06;}})});}_0x58002c=_[_0xcd31('0x3b')]({},_0x58002c,_0xf7faf9['options']);var _0x2c1a6a={'where':_0x58002c['where']};return db['AnalyticFieldReport']['count'](_0x2c1a6a)['then'](function(_0x5db7ab){_0x2fc264['count']=_0x5db7ab;if(_0xf7faf9[_0xcd31('0x2f')][_0xcd31('0x3d')]){_0x58002c[_0xcd31('0x3e')]=[{'all':!![]}];}return db[_0xcd31('0x3f')][_0xcd31('0x40')](_0x58002c);})[_0xcd31('0x25')](function(_0x4d89f3){_0x2fc264['rows']=_0x4d89f3;return _0x2fc264;})[_0xcd31('0x25')](respondWithFilteredResult(_0x4bf416,_0x58002c))[_0xcd31('0x41')](handleError(_0x4bf416,null));};exports[_0xcd31('0x42')]=function(_0x5e2ae9,_0x26131c){var _0x5554ad={'raw':![],'where':{'id':_0x5e2ae9[_0xcd31('0x43')]['id']}},_0x50f50b={};_0x50f50b[_0xcd31('0x2d')]=_[_0xcd31('0x30')](db[_0xcd31('0x3f')][_0xcd31('0x2b')]);_0x50f50b[_0xcd31('0x2f')]=_[_0xcd31('0x30')](_0x5e2ae9[_0xcd31('0x2f')]);_0x50f50b[_0xcd31('0x31')]=_[_0xcd31('0x32')](_0x50f50b[_0xcd31('0x2d')],_0x50f50b[_0xcd31('0x2f')]);_0x5554ad[_0xcd31('0x33')]=_[_0xcd31('0x32')](_0x50f50b[_0xcd31('0x2d')],qs[_0xcd31('0x34')](_0x5e2ae9[_0xcd31('0x2f')][_0xcd31('0x34')]));_0x5554ad[_0xcd31('0x33')]=_0x5554ad[_0xcd31('0x33')][_0xcd31('0x35')]?_0x5554ad[_0xcd31('0x33')]:_0x50f50b[_0xcd31('0x2d')];if(_0x5e2ae9['query'][_0xcd31('0x3d')]){_0x5554ad['include']=[{'all':!![]}];}_0x5554ad=_[_0xcd31('0x3b')]({},_0x5554ad,_0x5e2ae9[_0xcd31('0x44')]);return db[_0xcd31('0x3f')][_0xcd31('0x45')](_0x5554ad)[_0xcd31('0x25')](handleEntityNotFound(_0x26131c,null))[_0xcd31('0x25')](respondWithResult(_0x26131c,null))['catch'](handleError(_0x26131c,null));};exports[_0xcd31('0x46')]=function(_0xda48d0,_0x2553c4){return db[_0xcd31('0x3f')][_0xcd31('0x46')](_0xda48d0[_0xcd31('0x47')],{})['then'](respondWithResult(_0x2553c4,0xc9))['catch'](handleError(_0x2553c4,null));};exports[_0xcd31('0x48')]=function(_0x3d5317,_0x338ce6){return db[_0xcd31('0x3f')][_0xcd31('0x48')](_0x3d5317[_0xcd31('0x47')],{'raw':![],'individualHooks':!![]})[_0xcd31('0x25')](respondWithResult(_0x338ce6,0xc9))['catch'](handleError(_0x338ce6,null));};exports[_0xcd31('0x24')]=function(_0x468694,_0x427162){if(_0x468694[_0xcd31('0x47')]['id']){delete _0x468694[_0xcd31('0x47')]['id'];}return db[_0xcd31('0x3f')][_0xcd31('0x45')]({'where':{'id':_0x468694[_0xcd31('0x43')]['id']}})[_0xcd31('0x25')](handleEntityNotFound(_0x427162,null))['then'](saveUpdates(_0x468694[_0xcd31('0x47')],null))[_0xcd31('0x25')](respondWithResult(_0x427162,null))[_0xcd31('0x41')](handleError(_0x427162,null));};exports['destroy']=function(_0x41205f,_0x524e16){return db['AnalyticFieldReport']['find']({'where':{'id':_0x41205f[_0xcd31('0x43')]['id']}})[_0xcd31('0x25')](handleEntityNotFound(_0x524e16,null))['then'](removeEntity(_0x524e16,null))[_0xcd31('0x41')](handleError(_0x524e16,null));};exports[_0xcd31('0x49')]=function(_0xe7fa3a,_0x3b019a){return db[_0xcd31('0x3f')][_0xcd31('0x26')]({'where':{'id':_0xe7fa3a[_0xcd31('0x2f')][_0xcd31('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3b019a,0xcc))[_0xcd31('0x41')](handleError(_0x3b019a,null));};exports[_0xcd31('0x4b')]=function(_0x2cbde6,_0x5b1f63,_0x4efa66){return db[_0xcd31('0x4c')]['findOne']({'where':{'id':_0x2cbde6[_0xcd31('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b1f63,null))[_0xcd31('0x25')](function(_0x25ba7c){if(_0x25ba7c){return db['sequelize']['transaction'](function(_0x34e1f6){return db[_0xcd31('0x3f')][_0xcd31('0x26')]({'where':{'CustomReportId':_0x2cbde6[_0xcd31('0x43')]['id']},'transaction':_0x34e1f6})[_0xcd31('0x25')](function(_0x223be0){var _0x76016f=_['map'](_0x2cbde6[_0xcd31('0x47')],function(_0x5108fd){delete _0x5108fd['id'];_0x5108fd['CustomReportId']=_0x2cbde6['params']['id'];return _0x5108fd;});return db[_0xcd31('0x3f')]['bulkCreate'](_0x76016f,{'transaction':_0x34e1f6});});})[_0xcd31('0x25')](function(){return db[_0xcd31('0x3f')][_0xcd31('0x40')]({'where':{'CustomReportId':_0x2cbde6['params']['id']}});});}})['then'](respondWithResult(_0x5b1f63,null))[_0xcd31('0x41')](handleError(_0x5b1f63,null));};
\ No newline at end of file
+var _0x322a=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','options','includeAll','include','findAll','catch','params','find','create','body','bulkCreate','bulkDestroy','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x235076,_0x2f08ff){var _0x55eeb3=function(_0x33e792){while(--_0x33e792){_0x235076['push'](_0x235076['shift']());}};_0x55eeb3(++_0x2f08ff);}(_0x322a,0xed));var _0xa322=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x322a[_0x365be9];return _0x185c12;};'use strict';var emlformat=require(_0xa322('0x0'));var rimraf=require(_0xa322('0x1'));var zipdir=require(_0xa322('0x2'));var jsonpatch=require(_0xa322('0x3'));var rp=require(_0xa322('0x4'));var moment=require(_0xa322('0x5'));var BPromise=require(_0xa322('0x6'));var Mustache=require(_0xa322('0x7'));var util=require(_0xa322('0x8'));var path=require('path');var sox=require(_0xa322('0x9'));var csv=require(_0xa322('0xa'));var ejs=require(_0xa322('0xb'));var fs=require('fs');var fs_extra=require(_0xa322('0xc'));var _=require(_0xa322('0xd'));var squel=require('squel');var crypto=require(_0xa322('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa322('0xf'));var toCsv=require(_0xa322('0xa'));var querystring=require(_0xa322('0x10'));var Papa=require(_0xa322('0x11'));var Redis=require(_0xa322('0x12'));var authService=require(_0xa322('0x13'));var qs=require(_0xa322('0x14'));var as=require(_0xa322('0x15'));var hardwareService=require(_0xa322('0x16'));var logger=require(_0xa322('0x17'))(_0xa322('0x18'));var utils=require(_0xa322('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa322('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c594a,_0x15e4f1){_0x15e4f1=_0x15e4f1||0xcc;return function(_0x5b3055){if(_0x5b3055){return _0x5c594a[_0xa322('0x1b')](_0x15e4f1);}return _0x5c594a[_0xa322('0x1c')](_0x15e4f1)[_0xa322('0x1d')]();};}function respondWithResult(_0x8df399,_0x5add81){_0x5add81=_0x5add81||0xc8;return function(_0x55e60f){if(_0x55e60f){return _0x8df399['status'](_0x5add81)[_0xa322('0x1e')](_0x55e60f);}};}function respondWithFilteredResult(_0xda2009,_0x5706e6){return function(_0x3f13a0){if(_0x3f13a0){var _0x53fb6a=typeof _0x5706e6[_0xa322('0x1f')]===_0xa322('0x20')&&typeof _0x5706e6['limit']===_0xa322('0x20');var _0x3abfbf=_0x3f13a0[_0xa322('0x21')];var _0x130522=_0x53fb6a?0x0:_0x5706e6[_0xa322('0x1f')];var _0x208e0f=_0x53fb6a?_0x3f13a0[_0xa322('0x21')]:_0x5706e6['offset']+_0x5706e6[_0xa322('0x22')];var _0x1dc354;if(_0x208e0f>=_0x3abfbf){_0x208e0f=_0x3abfbf;_0x1dc354=0xc8;}else{_0x1dc354=0xce;}_0xda2009[_0xa322('0x1c')](_0x1dc354);return _0xda2009[_0xa322('0x23')](_0xa322('0x24'),_0x130522+'-'+_0x208e0f+'/'+_0x3abfbf)[_0xa322('0x1e')](_0x3f13a0);}return null;};}function patchUpdates(_0x299267){return function(_0x4e6d0c){try{jsonpatch['apply'](_0x4e6d0c,_0x299267,!![]);}catch(_0x3f5de2){return BPromise[_0xa322('0x25')](_0x3f5de2);}return _0x4e6d0c[_0xa322('0x26')]();};}function saveUpdates(_0x1b1e3b,_0x3871a5){return function(_0x37698f){if(_0x37698f){return _0x37698f[_0xa322('0x27')](_0x1b1e3b)['then'](function(_0x18b8e1){return _0x18b8e1;});}return null;};}function removeEntity(_0xab068,_0x4d1f8c){return function(_0x1b2ea2){if(_0x1b2ea2){return _0x1b2ea2[_0xa322('0x28')]()[_0xa322('0x29')](function(){_0xab068[_0xa322('0x1c')](0xcc)[_0xa322('0x1d')]();});}};}function handleEntityNotFound(_0x4c4b2c,_0x482ed8){return function(_0x3cf078){if(!_0x3cf078){_0x4c4b2c['sendStatus'](0x194);}return _0x3cf078;};}function handleError(_0x20cd72,_0x47a297){_0x47a297=_0x47a297||0x1f4;return function(_0x2946c6){logger['error'](_0x2946c6[_0xa322('0x2a')]);if(_0x2946c6[_0xa322('0x2b')]){delete _0x2946c6[_0xa322('0x2b')];}_0x20cd72['status'](_0x47a297)[_0xa322('0x2c')](_0x2946c6);};}exports['index']=function(_0xa80e0e,_0x239287){var _0x2198ef={},_0x5e4dc6={},_0x52b0d6={'count':0x0,'rows':[]};var _0x54f910=_[_0xa322('0x2d')](db[_0xa322('0x2e')][_0xa322('0x2f')],function(_0x269613){return{'name':_0x269613[_0xa322('0x30')],'type':_0x269613['type'][_0xa322('0x31')]};});_0x5e4dc6[_0xa322('0x32')]=_[_0xa322('0x2d')](_0x54f910,_0xa322('0x2b'));_0x5e4dc6['query']=_[_0xa322('0x33')](_0xa80e0e[_0xa322('0x34')]);_0x5e4dc6[_0xa322('0x35')]=_[_0xa322('0x36')](_0x5e4dc6[_0xa322('0x32')],_0x5e4dc6[_0xa322('0x34')]);_0x2198ef[_0xa322('0x37')]=_[_0xa322('0x36')](_0x5e4dc6[_0xa322('0x32')],qs[_0xa322('0x38')](_0xa80e0e[_0xa322('0x34')]['fields']));_0x2198ef[_0xa322('0x37')]=_0x2198ef[_0xa322('0x37')][_0xa322('0x39')]?_0x2198ef['attributes']:_0x5e4dc6['model'];if(!_0xa80e0e[_0xa322('0x34')][_0xa322('0x3a')](_0xa322('0x3b'))){_0x2198ef['limit']=qs[_0xa322('0x22')](_0xa80e0e[_0xa322('0x34')][_0xa322('0x22')]);_0x2198ef[_0xa322('0x1f')]=qs[_0xa322('0x1f')](_0xa80e0e[_0xa322('0x34')][_0xa322('0x1f')]);}_0x2198ef[_0xa322('0x3c')]=qs['sort'](_0xa80e0e[_0xa322('0x34')][_0xa322('0x3d')]);_0x2198ef['where']=qs[_0xa322('0x35')](_[_0xa322('0x3e')](_0xa80e0e['query'],_0x5e4dc6[_0xa322('0x35')]),_0x54f910);if(_0xa80e0e[_0xa322('0x34')]['filter']){_0x2198ef[_0xa322('0x3f')]=_[_0xa322('0x40')](_0x2198ef[_0xa322('0x3f')],{'$or':_['map'](_0x54f910,function(_0x3871b9){if(_0x3871b9[_0xa322('0x41')]!=='VIRTUAL'){var _0x1a94f7={};_0x1a94f7[_0x3871b9[_0xa322('0x2b')]]={'$like':'%'+_0xa80e0e[_0xa322('0x34')]['filter']+'%'};return _0x1a94f7;}})});}_0x2198ef=_['merge']({},_0x2198ef,_0xa80e0e[_0xa322('0x42')]);var _0x32c60d={'where':_0x2198ef[_0xa322('0x3f')]};return db[_0xa322('0x2e')][_0xa322('0x21')](_0x32c60d)[_0xa322('0x29')](function(_0x48ed03){_0x52b0d6[_0xa322('0x21')]=_0x48ed03;if(_0xa80e0e['query'][_0xa322('0x43')]){_0x2198ef[_0xa322('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa322('0x45')](_0x2198ef);})[_0xa322('0x29')](function(_0x4b3b5c){_0x52b0d6['rows']=_0x4b3b5c;return _0x52b0d6;})[_0xa322('0x29')](respondWithFilteredResult(_0x239287,_0x2198ef))[_0xa322('0x46')](handleError(_0x239287,null));};exports['show']=function(_0x24eadc,_0x15d2a1){var _0x261f56={'raw':![],'where':{'id':_0x24eadc[_0xa322('0x47')]['id']}},_0x204a38={};_0x204a38[_0xa322('0x32')]=_[_0xa322('0x33')](db[_0xa322('0x2e')][_0xa322('0x2f')]);_0x204a38[_0xa322('0x34')]=_[_0xa322('0x33')](_0x24eadc[_0xa322('0x34')]);_0x204a38[_0xa322('0x35')]=_[_0xa322('0x36')](_0x204a38[_0xa322('0x32')],_0x204a38[_0xa322('0x34')]);_0x261f56[_0xa322('0x37')]=_[_0xa322('0x36')](_0x204a38['model'],qs['fields'](_0x24eadc['query'][_0xa322('0x38')]));_0x261f56[_0xa322('0x37')]=_0x261f56[_0xa322('0x37')][_0xa322('0x39')]?_0x261f56[_0xa322('0x37')]:_0x204a38[_0xa322('0x32')];if(_0x24eadc['query'][_0xa322('0x43')]){_0x261f56[_0xa322('0x44')]=[{'all':!![]}];}_0x261f56=_['merge']({},_0x261f56,_0x24eadc['options']);return db[_0xa322('0x2e')][_0xa322('0x48')](_0x261f56)[_0xa322('0x29')](handleEntityNotFound(_0x15d2a1,null))[_0xa322('0x29')](respondWithResult(_0x15d2a1,null))[_0xa322('0x46')](handleError(_0x15d2a1,null));};exports[_0xa322('0x49')]=function(_0x4dd91c,_0x2ec985){return db[_0xa322('0x2e')]['create'](_0x4dd91c[_0xa322('0x4a')],{})[_0xa322('0x29')](respondWithResult(_0x2ec985,0xc9))[_0xa322('0x46')](handleError(_0x2ec985,null));};exports[_0xa322('0x4b')]=function(_0x4bd799,_0x490549){return db[_0xa322('0x2e')]['bulkCreate'](_0x4bd799['body'],{'raw':![],'individualHooks':!![]})[_0xa322('0x29')](respondWithResult(_0x490549,0xc9))[_0xa322('0x46')](handleError(_0x490549,null));};exports[_0xa322('0x27')]=function(_0x3d24ce,_0x36b894){if(_0x3d24ce[_0xa322('0x4a')]['id']){delete _0x3d24ce[_0xa322('0x4a')]['id'];}return db[_0xa322('0x2e')][_0xa322('0x48')]({'where':{'id':_0x3d24ce[_0xa322('0x47')]['id']}})[_0xa322('0x29')](handleEntityNotFound(_0x36b894,null))[_0xa322('0x29')](saveUpdates(_0x3d24ce[_0xa322('0x4a')],null))[_0xa322('0x29')](respondWithResult(_0x36b894,null))[_0xa322('0x46')](handleError(_0x36b894,null));};exports[_0xa322('0x28')]=function(_0x4aaeab,_0xc090c7){return db[_0xa322('0x2e')]['find']({'where':{'id':_0x4aaeab[_0xa322('0x47')]['id']}})[_0xa322('0x29')](handleEntityNotFound(_0xc090c7,null))[_0xa322('0x29')](removeEntity(_0xc090c7,null))[_0xa322('0x46')](handleError(_0xc090c7,null));};exports[_0xa322('0x4c')]=function(_0x6a946f,_0x12c5d7){return db[_0xa322('0x2e')]['destroy']({'where':{'id':_0x6a946f[_0xa322('0x34')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xa322('0x29')](respondWithResult(_0x12c5d7,0xcc))['catch'](handleError(_0x12c5d7,null));};exports['addFields']=function(_0x649918,_0x323205,_0x398dab){return db['AnalyticCustomReport'][_0xa322('0x4d')]({'where':{'id':_0x649918[_0xa322('0x47')]['id']}})[_0xa322('0x29')](handleEntityNotFound(_0x323205,null))['then'](function(_0x5be01d){if(_0x5be01d){return db[_0xa322('0x4e')][_0xa322('0x4f')](function(_0x6ca579){return db['AnalyticFieldReport'][_0xa322('0x28')]({'where':{'CustomReportId':_0x649918['params']['id']},'transaction':_0x6ca579})['then'](function(_0x5b5f24){var _0x43dc47=_['map'](_0x649918[_0xa322('0x4a')],function(_0x43f4f7){delete _0x43f4f7['id'];_0x43f4f7[_0xa322('0x50')]=_0x649918[_0xa322('0x47')]['id'];return _0x43f4f7;});return db['AnalyticFieldReport'][_0xa322('0x4b')](_0x43dc47,{'transaction':_0x6ca579});});})[_0xa322('0x29')](function(){return db[_0xa322('0x2e')]['findAll']({'where':{'CustomReportId':_0x649918['params']['id']}});});}})[_0xa322('0x29')](respondWithResult(_0x323205,null))['catch'](handleError(_0x323205,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index c384f4d..b20623b 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 _0xe75e=['moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0xe75e,0x1c0));var _0xee75=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0xe75e[_0x54a761];return _0x37d1da;};'use strict';var _=require(_0xee75('0x0'));var util=require(_0xee75('0x1'));var logger=require(_0xee75('0x2'))('api');var moment=require(_0xee75('0x3'));var BPromise=require('bluebird');var rp=require(_0xee75('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee75('0x5'));var config=require(_0xee75('0x6'));var attributes=require(_0xee75('0x7'));module[_0xee75('0x8')]=function(_0xefc5dd,_0x120fd2){return _0xefc5dd[_0xee75('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xee75('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x156d=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x46fae2,_0x4ea16c){var _0xc524bf=function(_0x36f4c4){while(--_0x36f4c4){_0x46fae2['push'](_0x46fae2['shift']());}};_0xc524bf(++_0x4ea16c);}(_0x156d,0x88));var _0xd156=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x156d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd156('0x0'))(_0xd156('0x1'));var moment=require(_0xd156('0x2'));var BPromise=require(_0xd156('0x3'));var rp=require(_0xd156('0x4'));var fs=require('fs');var path=require(_0xd156('0x5'));var rimraf=require(_0xd156('0x6'));var config=require(_0xd156('0x7'));var attributes=require(_0xd156('0x8'));module[_0xd156('0x9')]=function(_0x50639a,_0x3e88e7){return _0x50639a[_0xd156('0xa')](_0xd156('0xb'),attributes,{'tableName':_0xd156('0xc'),'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 f80c355..912f95f 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 _0x03eb=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x482493,_0xbe84be){var _0x3b9e70=function(_0x47e013){while(--_0x47e013){_0x482493['push'](_0x482493['shift']());}};_0x3b9e70(++_0xbe84be);}(_0x03eb,0xf2));var _0xb03e=function(_0x1fc697,_0x2a2b1d){_0x1fc697=_0x1fc697-0x0;var _0x1b9f8f=_0x03eb[_0x1fc697];return _0x1b9f8f;};'use strict';var _=require(_0xb03e('0x0'));var util=require(_0xb03e('0x1'));var moment=require(_0xb03e('0x2'));var BPromise=require(_0xb03e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb03e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb03e('0x5'));var logger=require(_0xb03e('0x6'))(_0xb03e('0x7'));var config=require(_0xb03e('0x8'));var jayson=require(_0xb03e('0x9'));var client=jayson[_0xb03e('0xa')][_0xb03e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3320d8,_0x13aa9d,_0x3021e6){return new BPromise(function(_0x5e22c6,_0x4f2857){return client[_0xb03e('0xc')](_0x3320d8,_0x3021e6)[_0xb03e('0xd')](function(_0x21a791){logger[_0xb03e('0xe')](_0xb03e('0xf'),_0x13aa9d,'request\x20sent');logger['debug'](_0xb03e('0x10'),_0x13aa9d,_0xb03e('0x11'),JSON['stringify'](_0x21a791));if(_0x21a791[_0xb03e('0x12')]){if(_0x21a791['error'][_0xb03e('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x13aa9d,_0x21a791[_0xb03e('0x12')]['message']);return _0x4f2857(_0x21a791[_0xb03e('0x12')][_0xb03e('0x14')]);}logger[_0xb03e('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x13aa9d,_0x21a791[_0xb03e('0x12')][_0xb03e('0x14')]);return _0x5e22c6(_0x21a791[_0xb03e('0x12')]['message']);}else{logger[_0xb03e('0xe')](_0xb03e('0xf'),_0x13aa9d,_0xb03e('0x11'));_0x5e22c6(_0x21a791[_0xb03e('0x15')][_0xb03e('0x14')]);}})[_0xb03e('0x16')](function(_0x225711){logger[_0xb03e('0x12')](_0xb03e('0xf'),_0x13aa9d,_0x225711);_0x4f2857(_0x225711);});});}
\ No newline at end of file
+var _0x28aa=['http','request','then','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2435b1,_0x119921){var _0x36b189=function(_0xf8d103){while(--_0xf8d103){_0x2435b1['push'](_0x2435b1['shift']());}};_0x36b189(++_0x119921);}(_0x28aa,0x182));var _0xa28a=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x28aa[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0xa28a('0x0'));var util=require(_0xa28a('0x1'));var moment=require('moment');var BPromise=require(_0xa28a('0x2'));var rs=require(_0xa28a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa28a('0x4'))['db'];var utils=require(_0xa28a('0x5'));var logger=require('../../config/logger')(_0xa28a('0x6'));var config=require(_0xa28a('0x7'));var jayson=require(_0xa28a('0x8'));var client=jayson[_0xa28a('0x9')][_0xa28a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44184e,_0x34a80d,_0x542ddd){return new BPromise(function(_0x1024ed,_0x1bebc8){return client[_0xa28a('0xb')](_0x44184e,_0x542ddd)[_0xa28a('0xc')](function(_0x397000){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x34a80d,_0xa28a('0xd'));logger[_0xa28a('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x34a80d,'request\x20sent',JSON[_0xa28a('0xf')](_0x397000));if(_0x397000[_0xa28a('0x10')]){if(_0x397000[_0xa28a('0x10')][_0xa28a('0x11')]===0x1f4){logger[_0xa28a('0x10')](_0xa28a('0x12'),_0x34a80d,_0x397000[_0xa28a('0x10')][_0xa28a('0x13')]);return _0x1bebc8(_0x397000[_0xa28a('0x10')][_0xa28a('0x13')]);}logger[_0xa28a('0x10')](_0xa28a('0x12'),_0x34a80d,_0x397000[_0xa28a('0x10')][_0xa28a('0x13')]);return _0x1024ed(_0x397000['error'][_0xa28a('0x13')]);}else{logger[_0xa28a('0x14')](_0xa28a('0x12'),_0x34a80d,_0xa28a('0xd'));_0x1024ed(_0x397000['result'][_0xa28a('0x13')]);}})[_0xa28a('0x15')](function(_0x161476){logger[_0xa28a('0x10')](_0xa28a('0x12'),_0x34a80d,_0x161476);_0x1bebc8(_0x161476);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index e8dea96..c864265 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(_0x53311a,_0x59a37e){var _0x29a7c3=function(_0xf1c36a){while(--_0xf1c36a){_0x53311a['push'](_0x53311a['shift']());}};_0x29a7c3(++_0x59a37e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x3456,_0x58beb2){var _0x4015ea=function(_0x1df2b4){while(--_0x1df2b4){_0x3456['push'](_0x3456['shift']());}};_0x4015ea(++_0x58beb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 03c3cc6..b12076b 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 _0x8533=['TEXT','sequelize','exports','STRING'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0x8533,0x141));var _0x3853=function(_0x4c1ef2,_0x151329){_0x4c1ef2=_0x4c1ef2-0x0;var _0x18e3d8=_0x8533[_0x4c1ef2];return _0x18e3d8;};'use strict';var Sequelize=require(_0x3853('0x0'));module[_0x3853('0x1')]={'name':{'type':Sequelize[_0x3853('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x3853('0x2')]},'metric':{'type':Sequelize[_0x3853('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x56bd=['TEXT','exports','STRING','name'];(function(_0x42d789,_0x175d8f){var _0x13e40c=function(_0x40033e){while(--_0x40033e){_0x42d789['push'](_0x42d789['shift']());}};_0x13e40c(++_0x175d8f);}(_0x56bd,0xe9));var _0xd56b=function(_0x52afd8,_0x146bb8){_0x52afd8=_0x52afd8-0x0;var _0x25f938=_0x56bd[_0x52afd8];return _0x25f938;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'name':{'type':Sequelize[_0xd56b('0x1')],'allowNull':![],'unique':_0xd56b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd56b('0x3')]},'description':{'type':Sequelize[_0xd56b('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index a663cee..834d8f5 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x84ab,0x12f));var _0xb84a=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x84ab[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5f0627,_0x72504a){var _0x490fe6=function(_0x421e95){while(--_0x421e95){_0x5f0627['push'](_0x5f0627['shift']());}};_0x490fe6(++_0x72504a);}(_0x55ca,0x126));var _0xa55c=function(_0x46bb73,_0x44f394){_0x46bb73=_0x46bb73-0x0;var _0x44f271=_0x55ca[_0x46bb73];return _0x44f271;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 27c214f..779f70a 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 _0x6455=['request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2a3022,_0x2f328c){var _0x366c96=function(_0x264829){while(--_0x264829){_0x2a3022['push'](_0x2a3022['shift']());}};_0x366c96(++_0x2f328c);}(_0x6455,0x97));var _0x5645=function(_0x2b0478,_0x15228a){_0x2b0478=_0x2b0478-0x0;var _0x5a8a71=_0x6455[_0x2b0478];return _0x5a8a71;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe7de=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7de,0x165));var _0xee7d=function(_0x1a01ce,_0x2107bf){_0x1a01ce=_0x1a01ce-0x0;var _0x5ac25e=_0xe7de[_0x1a01ce];return _0x5ac25e;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var logger=require(_0xee7d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xee7d('0x3'));var rp=require(_0xee7d('0x4'));var fs=require('fs');var path=require(_0xee7d('0x5'));var rimraf=require(_0xee7d('0x6'));var config=require(_0xee7d('0x7'));var attributes=require(_0xee7d('0x8'));module[_0xee7d('0x9')]=function(_0x215ba4,_0x401cd0){return _0x215ba4[_0xee7d('0xa')](_0xee7d('0xb'),attributes,{'tableName':_0xee7d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 982220a..b17fb4e 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 _0xe7f8=['error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4c0a0e,_0x2e4b1a){var _0x284bd0=function(_0x3b4f3d){while(--_0x3b4f3d){_0x4c0a0e['push'](_0x4c0a0e['shift']());}};_0x284bd0(++_0x2e4b1a);}(_0xe7f8,0xb7));var _0x8e7f=function(_0x3cae65,_0x55ce92){_0x3cae65=_0x3cae65-0x0;var _0x1620d1=_0xe7f8[_0x3cae65];return _0x1620d1;};'use strict';var _=require(_0x8e7f('0x0'));var util=require(_0x8e7f('0x1'));var moment=require(_0x8e7f('0x2'));var BPromise=require(_0x8e7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e7f('0x4'));var db=require(_0x8e7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e7f('0x6'))('rpc');var config=require(_0x8e7f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8e7f('0x8')][_0x8e7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x250340,_0x334c22,_0xf5cf98){return new BPromise(function(_0x4a1418,_0x1afaac){return client[_0x8e7f('0xa')](_0x250340,_0xf5cf98)[_0x8e7f('0xb')](function(_0x388d61){logger[_0x8e7f('0xc')](_0x8e7f('0xd'),_0x334c22,_0x8e7f('0xe'));logger[_0x8e7f('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x334c22,'request\x20sent',JSON[_0x8e7f('0x10')](_0x388d61));if(_0x388d61[_0x8e7f('0x11')]){if(_0x388d61[_0x8e7f('0x11')][_0x8e7f('0x12')]===0x1f4){logger[_0x8e7f('0x11')](_0x8e7f('0xd'),_0x334c22,_0x388d61['error'][_0x8e7f('0x13')]);return _0x1afaac(_0x388d61[_0x8e7f('0x11')]['message']);}logger[_0x8e7f('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x334c22,_0x388d61[_0x8e7f('0x11')]['message']);return _0x4a1418(_0x388d61['error'][_0x8e7f('0x13')]);}else{logger['info'](_0x8e7f('0xd'),_0x334c22,_0x8e7f('0xe'));_0x4a1418(_0x388d61['result']['message']);}})['catch'](function(_0x27dd05){logger['error'](_0x8e7f('0xd'),_0x334c22,_0x27dd05);_0x1afaac(_0x27dd05);});});}
\ No newline at end of file
+var _0xb59a=['client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x41b0d4,_0x2d42ea){var _0x539360=function(_0xd28f6f){while(--_0xd28f6f){_0x41b0d4['push'](_0x41b0d4['shift']());}};_0x539360(++_0x2d42ea);}(_0xb59a,0xc0));var _0xab59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb59a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab59('0x0'));var util=require('util');var moment=require(_0xab59('0x1'));var BPromise=require(_0xab59('0x2'));var rs=require(_0xab59('0x3'));var fs=require('fs');var Redis=require(_0xab59('0x4'));var db=require(_0xab59('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xab59('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab59('0x7'));var client=jayson[_0xab59('0x8')][_0xab59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32f0ac,_0x13e0bb,_0x37497a){return new BPromise(function(_0x5bf84c,_0x55c0fa){return client[_0xab59('0xa')](_0x32f0ac,_0x37497a)[_0xab59('0xb')](function(_0x4e4ba6){logger[_0xab59('0xc')](_0xab59('0xd'),_0x13e0bb,_0xab59('0xe'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x13e0bb,_0xab59('0xe'),JSON[_0xab59('0xf')](_0x4e4ba6));if(_0x4e4ba6[_0xab59('0x10')]){if(_0x4e4ba6[_0xab59('0x10')][_0xab59('0x11')]===0x1f4){logger[_0xab59('0x10')](_0xab59('0xd'),_0x13e0bb,_0x4e4ba6[_0xab59('0x10')][_0xab59('0x12')]);return _0x55c0fa(_0x4e4ba6[_0xab59('0x10')][_0xab59('0x12')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x13e0bb,_0x4e4ba6['error'][_0xab59('0x12')]);return _0x5bf84c(_0x4e4ba6[_0xab59('0x10')][_0xab59('0x12')]);}else{logger['info'](_0xab59('0xd'),_0x13e0bb,_0xab59('0xe'));_0x5bf84c(_0x4e4ba6['result'][_0xab59('0x12')]);}})[_0xab59('0x13')](function(_0x70cdf2){logger[_0xab59('0x10')](_0xab59('0xd'),_0x13e0bb,_0x70cdf2);_0x55c0fa(_0x70cdf2);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 5cd080e..f1b9ebc 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 _0x0d4d=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','post','create'];(function(_0xa1600d,_0xfc6b98){var _0x38ba23=function(_0x2c997d){while(--_0x2c997d){_0xa1600d['push'](_0xa1600d['shift']());}};_0x38ba23(++_0xfc6b98);}(_0x0d4d,0x132));var _0xd0d4=function(_0x48089b,_0x2e6d68){_0x48089b=_0x48089b-0x0;var _0x1eeeaa=_0x0d4d[_0x48089b];return _0x1eeeaa;};'use strict';var multer=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var path=require(_0xd0d4('0x2'));var timeout=require(_0xd0d4('0x3'));var express=require(_0xd0d4('0x4'));var router=express[_0xd0d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd0d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0d4('0x7'));var controller=require(_0xd0d4('0x8'));router['get']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xa')]);router[_0xd0d4('0xb')]('/:id',auth[_0xd0d4('0x9')](),controller['show']);router[_0xd0d4('0xc')]('/',auth['isAuthenticated'](),controller[_0xd0d4('0xd')]);router[_0xd0d4('0xe')](_0xd0d4('0xf'),auth['isAuthenticated'](),controller[_0xd0d4('0x10')]);router[_0xd0d4('0x11')](_0xd0d4('0xf'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x12')]);module[_0xd0d4('0x13')]=router;
\ No newline at end of file
+var _0x891b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','exports','path'];(function(_0x504a3e,_0x220f95){var _0x35996e=function(_0x2ee74c){while(--_0x2ee74c){_0x504a3e['push'](_0x504a3e['shift']());}};_0x35996e(++_0x220f95);}(_0x891b,0xc5));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb891('0x0'));var timeout=require(_0xb891('0x1'));var express=require('express');var router=express[_0xb891('0x2')]();var fs_extra=require(_0xb891('0x3'));var auth=require(_0xb891('0x4'));var interaction=require(_0xb891('0x5'));var config=require('../../config/environment');var controller=require(_0xb891('0x6'));router[_0xb891('0x7')]('/',auth['isAuthenticated'](),controller[_0xb891('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb891('0x9')]);router[_0xb891('0xa')]('/',auth[_0xb891('0xb')](),controller[_0xb891('0xc')]);router[_0xb891('0xd')](_0xb891('0xe'),auth[_0xb891('0xb')](),controller['update']);router[_0xb891('0xf')](_0xb891('0xe'),auth[_0xb891('0xb')](),controller[_0xb891('0x10')]);module[_0xb891('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index c390c66..48b1854 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 _0x07a8=['TEXT','sequelize'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x07a8,0x141));var _0x807a=function(_0x3820ff,_0x17a634){_0x3820ff=_0x3820ff-0x0;var _0x3a0f7f=_0x07a8[_0x3820ff];return _0x3a0f7f;};'use strict';var Sequelize=require(_0x807a('0x0'));module['exports']={'tree':{'type':Sequelize[_0x807a('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x6e68=['TEXT','sequelize'];(function(_0xaed60,_0x4e9ee4){var _0x2d7850=function(_0x3d4043){while(--_0x3d4043){_0xaed60['push'](_0xaed60['shift']());}};_0x2d7850(++_0x4e9ee4);}(_0x6e68,0xc3));var _0x86e6=function(_0x2db6ed,_0xf467d9){_0x2db6ed=_0x2db6ed-0x0;var _0x53a474=_0x6e68[_0x2db6ed];return _0x53a474;};'use strict';var Sequelize=require(_0x86e6('0x0'));module['exports']={'tree':{'type':Sequelize[_0x86e6('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 4935f59..cf8b20a 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 _0x92b0=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2b4008,_0x50f999){var _0x4661cd=function(_0x41504c){while(--_0x41504c){_0x2b4008['push'](_0x2b4008['shift']());}};_0x4661cd(++_0x50f999);}(_0x92b0,0x1ee));var _0x092b=function(_0x4fc7bb,_0x105832){_0x4fc7bb=_0x4fc7bb-0x0;var _0x28e655=_0x92b0[_0x4fc7bb];return _0x28e655;};'use strict';var emlformat=require(_0x092b('0x0'));var rimraf=require(_0x092b('0x1'));var zipdir=require(_0x092b('0x2'));var jsonpatch=require(_0x092b('0x3'));var rp=require(_0x092b('0x4'));var moment=require(_0x092b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x092b('0x6'));var util=require(_0x092b('0x7'));var path=require(_0x092b('0x8'));var sox=require(_0x092b('0x9'));var csv=require(_0x092b('0xa'));var ejs=require(_0x092b('0xb'));var fs=require('fs');var fs_extra=require(_0x092b('0xc'));var _=require(_0x092b('0xd'));var squel=require(_0x092b('0xe'));var crypto=require(_0x092b('0xf'));var jsforce=require(_0x092b('0x10'));var deskjs=require(_0x092b('0x11'));var toCsv=require(_0x092b('0xa'));var querystring=require(_0x092b('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x092b('0x13'));var as=require(_0x092b('0x14'));var hardwareService=require(_0x092b('0x15'));var logger=require(_0x092b('0x16'))(_0x092b('0x17'));var utils=require(_0x092b('0x18'));var config=require(_0x092b('0x19'));var licenseUtil=require(_0x092b('0x1a'));var db=require(_0x092b('0x1b'))['db'];function respondWithStatusCode(_0x261b04,_0x20a891){_0x20a891=_0x20a891||0xcc;return function(_0xe67f43){if(_0xe67f43){return _0x261b04[_0x092b('0x1c')](_0x20a891);}return _0x261b04[_0x092b('0x1d')](_0x20a891)[_0x092b('0x1e')]();};}function respondWithResult(_0x511c0b,_0x1e3605){_0x1e3605=_0x1e3605||0xc8;return function(_0x106a0a){if(_0x106a0a){return _0x511c0b[_0x092b('0x1d')](_0x1e3605)[_0x092b('0x1f')](_0x106a0a);}};}function respondWithFilteredResult(_0x5ad749,_0xacd9cb){return function(_0xecaf7c){if(_0xecaf7c){var _0x467503=typeof _0xacd9cb[_0x092b('0x20')]===_0x092b('0x21')&&typeof _0xacd9cb[_0x092b('0x22')]===_0x092b('0x21');var _0xf4ab9c=_0xecaf7c['count'];var _0x299537=_0x467503?0x0:_0xacd9cb[_0x092b('0x20')];var _0x49149d=_0x467503?_0xecaf7c[_0x092b('0x23')]:_0xacd9cb['offset']+_0xacd9cb[_0x092b('0x22')];var _0x103579;if(_0x49149d>=_0xf4ab9c){_0x49149d=_0xf4ab9c;_0x103579=0xc8;}else{_0x103579=0xce;}_0x5ad749[_0x092b('0x1d')](_0x103579);return _0x5ad749['set'](_0x092b('0x24'),_0x299537+'-'+_0x49149d+'/'+_0xf4ab9c)[_0x092b('0x1f')](_0xecaf7c);}return null;};}function patchUpdates(_0x53c44d){return function(_0x3dc9bc){try{jsonpatch[_0x092b('0x25')](_0x3dc9bc,_0x53c44d,!![]);}catch(_0x474de2){return BPromise[_0x092b('0x26')](_0x474de2);}return _0x3dc9bc[_0x092b('0x27')]();};}function saveUpdates(_0x35c85f,_0x2efedf){return function(_0x2cff9f){if(_0x2cff9f){return _0x2cff9f[_0x092b('0x28')](_0x35c85f)[_0x092b('0x29')](function(_0x5cf8e1){return _0x5cf8e1;});}return null;};}function removeEntity(_0x163995,_0x4e2440){return function(_0x948492){if(_0x948492){return _0x948492[_0x092b('0x2a')]()['then'](function(){_0x163995[_0x092b('0x1d')](0xcc)[_0x092b('0x1e')]();});}};}function handleEntityNotFound(_0x1101c9,_0x28408c){return function(_0x4a3420){if(!_0x4a3420){_0x1101c9[_0x092b('0x1c')](0x194);}return _0x4a3420;};}function handleError(_0x43ceb0,_0x2d79e2){_0x2d79e2=_0x2d79e2||0x1f4;return function(_0x29c8ae){logger[_0x092b('0x2b')](_0x29c8ae['stack']);if(_0x29c8ae[_0x092b('0x2c')]){delete _0x29c8ae[_0x092b('0x2c')];}_0x43ceb0[_0x092b('0x1d')](_0x2d79e2)['send'](_0x29c8ae);};}exports['index']=function(_0x4cfdb9,_0x39cbdc){var _0x3362bd={},_0x1bb447={},_0x1bbb1a={'count':0x0,'rows':[]};var _0x3de5c4=_['map'](db[_0x092b('0x2d')][_0x092b('0x2e')],function(_0x385a7e){return{'name':_0x385a7e['fieldName'],'type':_0x385a7e[_0x092b('0x2f')][_0x092b('0x30')]};});_0x1bb447[_0x092b('0x31')]=_['map'](_0x3de5c4,_0x092b('0x2c'));_0x1bb447[_0x092b('0x32')]=_[_0x092b('0x33')](_0x4cfdb9[_0x092b('0x32')]);_0x1bb447[_0x092b('0x34')]=_[_0x092b('0x35')](_0x1bb447['model'],_0x1bb447[_0x092b('0x32')]);_0x3362bd[_0x092b('0x36')]=_[_0x092b('0x35')](_0x1bb447[_0x092b('0x31')],qs[_0x092b('0x37')](_0x4cfdb9[_0x092b('0x32')][_0x092b('0x37')]));_0x3362bd[_0x092b('0x36')]=_0x3362bd[_0x092b('0x36')][_0x092b('0x38')]?_0x3362bd[_0x092b('0x36')]:_0x1bb447[_0x092b('0x31')];if(!_0x4cfdb9['query']['hasOwnProperty'](_0x092b('0x39'))){_0x3362bd[_0x092b('0x22')]=qs['limit'](_0x4cfdb9['query']['limit']);_0x3362bd['offset']=qs[_0x092b('0x20')](_0x4cfdb9[_0x092b('0x32')][_0x092b('0x20')]);}_0x3362bd[_0x092b('0x3a')]=qs[_0x092b('0x3b')](_0x4cfdb9['query']['sort']);_0x3362bd['where']=qs[_0x092b('0x34')](_[_0x092b('0x3c')](_0x4cfdb9[_0x092b('0x32')],_0x1bb447[_0x092b('0x34')]),_0x3de5c4);if(_0x4cfdb9[_0x092b('0x32')][_0x092b('0x3d')]){_0x3362bd[_0x092b('0x3e')]=_[_0x092b('0x3f')](_0x3362bd['where'],{'$or':_['map'](_0x3de5c4,function(_0x2ad4f0){if(_0x2ad4f0[_0x092b('0x2f')]!==_0x092b('0x40')){var _0x7062a8={};_0x7062a8[_0x2ad4f0['name']]={'$like':'%'+_0x4cfdb9[_0x092b('0x32')][_0x092b('0x3d')]+'%'};return _0x7062a8;}})});}_0x3362bd=_['merge']({},_0x3362bd,_0x4cfdb9['options']);var _0x1fde21={'where':_0x3362bd['where']};return db[_0x092b('0x2d')][_0x092b('0x23')](_0x1fde21)['then'](function(_0x47daf9){_0x1bbb1a['count']=_0x47daf9;if(_0x4cfdb9[_0x092b('0x32')][_0x092b('0x41')]){_0x3362bd[_0x092b('0x42')]=[{'all':!![]}];}return db[_0x092b('0x2d')][_0x092b('0x43')](_0x3362bd);})[_0x092b('0x29')](function(_0x302291){_0x1bbb1a['rows']=_0x302291;return _0x1bbb1a;})[_0x092b('0x29')](respondWithFilteredResult(_0x39cbdc,_0x3362bd))[_0x092b('0x44')](handleError(_0x39cbdc,null));};exports[_0x092b('0x45')]=function(_0x1211b5,_0x4f1769){var _0x20a59f={'raw':!![],'where':{'id':_0x1211b5[_0x092b('0x46')]['id']}},_0x1dac16={};_0x1dac16['model']=_[_0x092b('0x33')](db[_0x092b('0x2d')][_0x092b('0x2e')]);_0x1dac16[_0x092b('0x32')]=_[_0x092b('0x33')](_0x1211b5[_0x092b('0x32')]);_0x1dac16[_0x092b('0x34')]=_[_0x092b('0x35')](_0x1dac16[_0x092b('0x31')],_0x1dac16[_0x092b('0x32')]);_0x20a59f['attributes']=_[_0x092b('0x35')](_0x1dac16[_0x092b('0x31')],qs[_0x092b('0x37')](_0x1211b5[_0x092b('0x32')][_0x092b('0x37')]));_0x20a59f[_0x092b('0x36')]=_0x20a59f['attributes'][_0x092b('0x38')]?_0x20a59f['attributes']:_0x1dac16[_0x092b('0x31')];if(_0x1211b5[_0x092b('0x32')][_0x092b('0x41')]){_0x20a59f[_0x092b('0x42')]=[{'all':!![]}];}_0x20a59f=_['merge']({},_0x20a59f,_0x1211b5[_0x092b('0x47')]);return db[_0x092b('0x2d')]['find'](_0x20a59f)[_0x092b('0x29')](handleEntityNotFound(_0x4f1769,null))[_0x092b('0x29')](respondWithResult(_0x4f1769,null))[_0x092b('0x44')](handleError(_0x4f1769,null));};exports['create']=function(_0x1883b4,_0xd840e4){return db[_0x092b('0x2d')][_0x092b('0x48')](_0x1883b4[_0x092b('0x49')],{})['then'](respondWithResult(_0xd840e4,0xc9))[_0x092b('0x44')](handleError(_0xd840e4,null));};exports[_0x092b('0x28')]=function(_0x34e234,_0x3c7dd5){if(_0x34e234[_0x092b('0x49')]['id']){delete _0x34e234['body']['id'];}return db[_0x092b('0x2d')]['find']({'where':{'id':_0x34e234['params']['id']}})[_0x092b('0x29')](handleEntityNotFound(_0x3c7dd5,null))['then'](saveUpdates(_0x34e234[_0x092b('0x49')],null))[_0x092b('0x29')](respondWithResult(_0x3c7dd5,null))[_0x092b('0x44')](handleError(_0x3c7dd5,null));};exports[_0x092b('0x2a')]=function(_0x2001a9,_0x28b88a){return db[_0x092b('0x2d')][_0x092b('0x4a')]({'where':{'id':_0x2001a9[_0x092b('0x46')]['id']}})[_0x092b('0x29')](handleEntityNotFound(_0x28b88a,null))[_0x092b('0x29')](removeEntity(_0x28b88a,null))[_0x092b('0x44')](handleError(_0x28b88a,null));};
\ No newline at end of file
+var _0x8159=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x56555a,_0x227c9d){var _0x29066e=function(_0x254c44){while(--_0x254c44){_0x56555a['push'](_0x56555a['shift']());}};_0x29066e(++_0x227c9d);}(_0x8159,0x8c));var _0x9815=function(_0x28ec9f,_0xee002f){_0x28ec9f=_0x28ec9f-0x0;var _0x31e62d=_0x8159[_0x28ec9f];return _0x31e62d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9815('0x0'));var zipdir=require(_0x9815('0x1'));var jsonpatch=require(_0x9815('0x2'));var rp=require('request-promise');var moment=require(_0x9815('0x3'));var BPromise=require(_0x9815('0x4'));var Mustache=require(_0x9815('0x5'));var util=require(_0x9815('0x6'));var path=require(_0x9815('0x7'));var sox=require(_0x9815('0x8'));var csv=require(_0x9815('0x9'));var ejs=require(_0x9815('0xa'));var fs=require('fs');var fs_extra=require(_0x9815('0xb'));var _=require(_0x9815('0xc'));var squel=require(_0x9815('0xd'));var crypto=require(_0x9815('0xe'));var jsforce=require(_0x9815('0xf'));var deskjs=require(_0x9815('0x10'));var toCsv=require(_0x9815('0x9'));var querystring=require(_0x9815('0x11'));var Papa=require(_0x9815('0x12'));var Redis=require(_0x9815('0x13'));var authService=require(_0x9815('0x14'));var qs=require(_0x9815('0x15'));var as=require(_0x9815('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9815('0x17'))(_0x9815('0x18'));var utils=require('../../config/utils');var config=require(_0x9815('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x487090,_0x5cccde){_0x5cccde=_0x5cccde||0xcc;return function(_0x85ac11){if(_0x85ac11){return _0x487090['sendStatus'](_0x5cccde);}return _0x487090[_0x9815('0x1a')](_0x5cccde)[_0x9815('0x1b')]();};}function respondWithResult(_0xf662cb,_0x4b67f2){_0x4b67f2=_0x4b67f2||0xc8;return function(_0xa25ac4){if(_0xa25ac4){return _0xf662cb['status'](_0x4b67f2)[_0x9815('0x1c')](_0xa25ac4);}};}function respondWithFilteredResult(_0x5e9ca7,_0x1c776d){return function(_0x474a51){if(_0x474a51){var _0x1e551d=typeof _0x1c776d[_0x9815('0x1d')]==='undefined'&&typeof _0x1c776d[_0x9815('0x1e')]===_0x9815('0x1f');var _0x5d4de9=_0x474a51['count'];var _0x2570aa=_0x1e551d?0x0:_0x1c776d[_0x9815('0x1d')];var _0x23599b=_0x1e551d?_0x474a51[_0x9815('0x20')]:_0x1c776d[_0x9815('0x1d')]+_0x1c776d[_0x9815('0x1e')];var _0x2c6a13;if(_0x23599b>=_0x5d4de9){_0x23599b=_0x5d4de9;_0x2c6a13=0xc8;}else{_0x2c6a13=0xce;}_0x5e9ca7[_0x9815('0x1a')](_0x2c6a13);return _0x5e9ca7['set'](_0x9815('0x21'),_0x2570aa+'-'+_0x23599b+'/'+_0x5d4de9)[_0x9815('0x1c')](_0x474a51);}return null;};}function patchUpdates(_0x33b939){return function(_0x42d081){try{jsonpatch[_0x9815('0x22')](_0x42d081,_0x33b939,!![]);}catch(_0x2ea574){return BPromise[_0x9815('0x23')](_0x2ea574);}return _0x42d081[_0x9815('0x24')]();};}function saveUpdates(_0x1d75a6,_0x57428b){return function(_0x5713d8){if(_0x5713d8){return _0x5713d8[_0x9815('0x25')](_0x1d75a6)[_0x9815('0x26')](function(_0x4e1d40){return _0x4e1d40;});}return null;};}function removeEntity(_0x7d8611,_0x281098){return function(_0x3e489b){if(_0x3e489b){return _0x3e489b[_0x9815('0x27')]()[_0x9815('0x26')](function(){_0x7d8611[_0x9815('0x1a')](0xcc)[_0x9815('0x1b')]();});}};}function handleEntityNotFound(_0x21cc31,_0x6b6cff){return function(_0x50a253){if(!_0x50a253){_0x21cc31[_0x9815('0x28')](0x194);}return _0x50a253;};}function handleError(_0x5b4655,_0x58fcc8){_0x58fcc8=_0x58fcc8||0x1f4;return function(_0x518e82){logger['error'](_0x518e82[_0x9815('0x29')]);if(_0x518e82['name']){delete _0x518e82[_0x9815('0x2a')];}_0x5b4655['status'](_0x58fcc8)[_0x9815('0x2b')](_0x518e82);};}exports[_0x9815('0x2c')]=function(_0x5426dc,_0x2fe93f){var _0x1914e8={},_0x338bc9={},_0x4a58ff={'count':0x0,'rows':[]};var _0xb32697=_[_0x9815('0x2d')](db['AnalyticTreeReport'][_0x9815('0x2e')],function(_0x5b9119){return{'name':_0x5b9119[_0x9815('0x2f')],'type':_0x5b9119[_0x9815('0x30')][_0x9815('0x31')]};});_0x338bc9[_0x9815('0x32')]=_[_0x9815('0x2d')](_0xb32697,_0x9815('0x2a'));_0x338bc9['query']=_['keys'](_0x5426dc[_0x9815('0x33')]);_0x338bc9[_0x9815('0x34')]=_['intersection'](_0x338bc9[_0x9815('0x32')],_0x338bc9['query']);_0x1914e8[_0x9815('0x35')]=_[_0x9815('0x36')](_0x338bc9[_0x9815('0x32')],qs[_0x9815('0x37')](_0x5426dc[_0x9815('0x33')][_0x9815('0x37')]));_0x1914e8['attributes']=_0x1914e8['attributes'][_0x9815('0x38')]?_0x1914e8[_0x9815('0x35')]:_0x338bc9[_0x9815('0x32')];if(!_0x5426dc[_0x9815('0x33')][_0x9815('0x39')](_0x9815('0x3a'))){_0x1914e8[_0x9815('0x1e')]=qs['limit'](_0x5426dc[_0x9815('0x33')][_0x9815('0x1e')]);_0x1914e8[_0x9815('0x1d')]=qs[_0x9815('0x1d')](_0x5426dc['query']['offset']);}_0x1914e8['order']=qs[_0x9815('0x3b')](_0x5426dc[_0x9815('0x33')][_0x9815('0x3b')]);_0x1914e8['where']=qs[_0x9815('0x34')](_[_0x9815('0x3c')](_0x5426dc[_0x9815('0x33')],_0x338bc9[_0x9815('0x34')]),_0xb32697);if(_0x5426dc['query'][_0x9815('0x3d')]){_0x1914e8[_0x9815('0x3e')]=_[_0x9815('0x3f')](_0x1914e8[_0x9815('0x3e')],{'$or':_[_0x9815('0x2d')](_0xb32697,function(_0x59ccd6){if(_0x59ccd6[_0x9815('0x30')]!==_0x9815('0x40')){var _0x5c491e={};_0x5c491e[_0x59ccd6[_0x9815('0x2a')]]={'$like':'%'+_0x5426dc[_0x9815('0x33')][_0x9815('0x3d')]+'%'};return _0x5c491e;}})});}_0x1914e8=_[_0x9815('0x3f')]({},_0x1914e8,_0x5426dc[_0x9815('0x41')]);var _0xac5b8a={'where':_0x1914e8['where']};return db[_0x9815('0x42')]['count'](_0xac5b8a)[_0x9815('0x26')](function(_0x256d4d){_0x4a58ff['count']=_0x256d4d;if(_0x5426dc[_0x9815('0x33')][_0x9815('0x43')]){_0x1914e8[_0x9815('0x44')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x9815('0x45')](_0x1914e8);})[_0x9815('0x26')](function(_0x56509a){_0x4a58ff['rows']=_0x56509a;return _0x4a58ff;})['then'](respondWithFilteredResult(_0x2fe93f,_0x1914e8))[_0x9815('0x46')](handleError(_0x2fe93f,null));};exports[_0x9815('0x47')]=function(_0x4580f7,_0x20feff){var _0x483032={'raw':!![],'where':{'id':_0x4580f7[_0x9815('0x48')]['id']}},_0x16a9d4={};_0x16a9d4[_0x9815('0x32')]=_['keys'](db['AnalyticTreeReport'][_0x9815('0x2e')]);_0x16a9d4[_0x9815('0x33')]=_['keys'](_0x4580f7[_0x9815('0x33')]);_0x16a9d4[_0x9815('0x34')]=_[_0x9815('0x36')](_0x16a9d4['model'],_0x16a9d4[_0x9815('0x33')]);_0x483032[_0x9815('0x35')]=_['intersection'](_0x16a9d4[_0x9815('0x32')],qs['fields'](_0x4580f7[_0x9815('0x33')]['fields']));_0x483032[_0x9815('0x35')]=_0x483032[_0x9815('0x35')][_0x9815('0x38')]?_0x483032[_0x9815('0x35')]:_0x16a9d4[_0x9815('0x32')];if(_0x4580f7[_0x9815('0x33')][_0x9815('0x43')]){_0x483032[_0x9815('0x44')]=[{'all':!![]}];}_0x483032=_[_0x9815('0x3f')]({},_0x483032,_0x4580f7['options']);return db[_0x9815('0x42')][_0x9815('0x49')](_0x483032)['then'](handleEntityNotFound(_0x20feff,null))[_0x9815('0x26')](respondWithResult(_0x20feff,null))[_0x9815('0x46')](handleError(_0x20feff,null));};exports[_0x9815('0x4a')]=function(_0x4bd13e,_0x37287f){return db['AnalyticTreeReport']['create'](_0x4bd13e[_0x9815('0x4b')],{})[_0x9815('0x26')](respondWithResult(_0x37287f,0xc9))['catch'](handleError(_0x37287f,null));};exports[_0x9815('0x25')]=function(_0x1320f5,_0x169371){if(_0x1320f5[_0x9815('0x4b')]['id']){delete _0x1320f5[_0x9815('0x4b')]['id'];}return db['AnalyticTreeReport'][_0x9815('0x49')]({'where':{'id':_0x1320f5[_0x9815('0x48')]['id']}})[_0x9815('0x26')](handleEntityNotFound(_0x169371,null))[_0x9815('0x26')](saveUpdates(_0x1320f5[_0x9815('0x4b')],null))['then'](respondWithResult(_0x169371,null))['catch'](handleError(_0x169371,null));};exports['destroy']=function(_0x5692a9,_0x2ffc96){return db[_0x9815('0x42')][_0x9815('0x49')]({'where':{'id':_0x5692a9[_0x9815('0x48')]['id']}})[_0x9815('0x26')](handleEntityNotFound(_0x2ffc96,null))[_0x9815('0x26')](removeEntity(_0x2ffc96,null))['catch'](handleError(_0x2ffc96,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 0394e69..1439e07 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 _0x8469=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x1fcb64,_0x5021f2){var _0x4fbfa1=function(_0x1153f7){while(--_0x1153f7){_0x1fcb64['push'](_0x1fcb64['shift']());}};_0x4fbfa1(++_0x5021f2);}(_0x8469,0xcf));var _0x9846=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x8469[_0x7ad123];return _0x37d073;};'use strict';var _=require(_0x9846('0x0'));var util=require(_0x9846('0x1'));var logger=require(_0x9846('0x2'))(_0x9846('0x3'));var moment=require(_0x9846('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9846('0x5'));var rimraf=require(_0x9846('0x6'));var config=require(_0x9846('0x7'));var attributes=require(_0x9846('0x8'));module[_0x9846('0x9')]=function(_0x12177c,_0x3a447a){return _0x12177c[_0x9846('0xa')](_0x9846('0xb'),attributes,{'tableName':_0x9846('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad65=['rimraf','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x55c521,_0x13d53f){var _0x3f7228=function(_0x17baba){while(--_0x17baba){_0x55c521['push'](_0x55c521['shift']());}};_0x3f7228(++_0x13d53f);}(_0xad65,0x101));var _0x5ad6=function(_0x2e5e2c,_0x23fd7e){_0x2e5e2c=_0x2e5e2c-0x0;var _0x3a25eb=_0xad65[_0x2e5e2c];return _0x3a25eb;};'use strict';var _=require(_0x5ad6('0x0'));var util=require('util');var logger=require(_0x5ad6('0x1'))(_0x5ad6('0x2'));var moment=require(_0x5ad6('0x3'));var BPromise=require(_0x5ad6('0x4'));var rp=require(_0x5ad6('0x5'));var fs=require('fs');var path=require(_0x5ad6('0x6'));var rimraf=require(_0x5ad6('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x5ad6('0x8')]=function(_0x1faebf,_0x2f7703){return _0x1faebf[_0x5ad6('0x9')](_0x5ad6('0xa'),attributes,{'tableName':'analytics_report_trees','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 6b5e46a..86ce305 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2acc55,_0x320ac3){var _0x160fb3=function(_0x387e0c){while(--_0x387e0c){_0x2acc55['push'](_0x2acc55['shift']());}};_0x160fb3(++_0x320ac3);}(_0xdb28,0x106));var _0x8db2=function(_0x4a9d11,_0x1c369d){_0x4a9d11=_0x4a9d11-0x0;var _0x867163=_0xdb28[_0x4a9d11];return _0x867163;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1e795d,_0x13c2c4){var _0x11dfda=function(_0xa4523e){while(--_0xa4523e){_0x1e795d['push'](_0x1e795d['shift']());}};_0x11dfda(++_0x13c2c4);}(_0xdb28,0x106));var _0x8db2=function(_0x2f5665,_0x3abcf1){_0x2f5665=_0x2f5665-0x0;var _0x3d7938=_0xdb28[_0x2f5665];return _0x3d7938;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index ab336d1..744b90f 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 _0x3ae9=['../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5a474c,_0x3d8725){var _0x5b8361=function(_0x2993f6){while(--_0x2993f6){_0x5a474c['push'](_0x5a474c['shift']());}};_0x5b8361(++_0x3d8725);}(_0x3ae9,0xaa));var _0x93ae=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x3ae9[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x93ae('0x0'));var util=require(_0x93ae('0x1'));var path=require('path');var timeout=require(_0x93ae('0x2'));var express=require('express');var router=express[_0x93ae('0x3')]();var fs_extra=require(_0x93ae('0x4'));var auth=require(_0x93ae('0x5'));var interaction=require(_0x93ae('0x6'));var config=require('../../config/environment');var controller=require(_0x93ae('0x7'));router[_0x93ae('0x8')]('/',auth[_0x93ae('0x9')](),controller[_0x93ae('0xa')]);router[_0x93ae('0x8')](_0x93ae('0xb'),auth['isAuthenticated'](),controller[_0x93ae('0xc')]);router['post']('/',auth[_0x93ae('0x9')](),controller[_0x93ae('0xd')]);router[_0x93ae('0xe')](_0x93ae('0xb'),auth[_0x93ae('0x9')](),controller['update']);router['delete'](_0x93ae('0xb'),auth[_0x93ae('0x9')](),controller['destroy']);module[_0x93ae('0xf')]=router;
\ No newline at end of file
+var _0x7810=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','create','put','delete','destroy','exports','multer','path'];(function(_0x422ed1,_0x5a4e91){var _0x7c9671=function(_0x3c93fc){while(--_0x3c93fc){_0x422ed1['push'](_0x422ed1['shift']());}};_0x7c9671(++_0x5a4e91);}(_0x7810,0x1e4));var _0x0781=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7810[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0781('0x0'));var util=require('util');var path=require(_0x0781('0x1'));var timeout=require(_0x0781('0x2'));var express=require('express');var router=express[_0x0781('0x3')]();var fs_extra=require(_0x0781('0x4'));var auth=require(_0x0781('0x5'));var interaction=require(_0x0781('0x6'));var config=require(_0x0781('0x7'));var controller=require(_0x0781('0x8'));router[_0x0781('0x9')]('/',auth['isAuthenticated'](),controller[_0x0781('0xa')]);router[_0x0781('0x9')](_0x0781('0xb'),auth[_0x0781('0xc')](),controller['show']);router['post']('/',auth[_0x0781('0xc')](),controller[_0x0781('0xd')]);router[_0x0781('0xe')](_0x0781('0xb'),auth[_0x0781('0xc')](),controller['update']);router[_0x0781('0xf')](_0x0781('0xb'),auth[_0x0781('0xc')](),controller[_0x0781('0x10')]);module[_0x0781('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index aa5ace1..d6f495b 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 _0x1542=['exports','STRING','sequelize'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x1542,0x116));var _0x2154=function(_0x4491aa,_0x2f8583){_0x4491aa=_0x4491aa-0x0;var _0x59f133=_0x1542[_0x4491aa];return _0x59f133;};'use strict';var Sequelize=require(_0x2154('0x0'));module[_0x2154('0x1')]={'name':{'type':Sequelize[_0x2154('0x2')]},'basename':{'type':Sequelize[_0x2154('0x2')]},'type':{'type':Sequelize[_0x2154('0x2')]}};
\ No newline at end of file
+var _0x5c4a=['STRING','exports'];(function(_0x4d4c99,_0x27de84){var _0x183f4e=function(_0x7ae96){while(--_0x7ae96){_0x4d4c99['push'](_0x4d4c99['shift']());}};_0x183f4e(++_0x27de84);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x397297,_0x537446){_0x397297=_0x397297-0x0;var _0x41fdc9=_0x5c4a[_0x397297];return _0x41fdc9;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'name':{'type':Sequelize[_0xa5c4('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa5c4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9e4b468..0233371 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 _0x056a=['catch','clone','get','omit','createdAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','root','offline-chat/','join','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','show','params','find'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x056a,0xc3));var _0xa056=function(_0x5ca77a,_0x1390b6){_0x5ca77a=_0x5ca77a-0x0;var _0x3a8fdc=_0x056a[_0x5ca77a];return _0x3a8fdc;};'use strict';var emlformat=require(_0xa056('0x0'));var rimraf=require(_0xa056('0x1'));var zipdir=require(_0xa056('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa056('0x3'));var moment=require(_0xa056('0x4'));var BPromise=require(_0xa056('0x5'));var Mustache=require(_0xa056('0x6'));var util=require('util');var path=require(_0xa056('0x7'));var sox=require(_0xa056('0x8'));var csv=require(_0xa056('0x9'));var ejs=require(_0xa056('0xa'));var fs=require('fs');var fs_extra=require(_0xa056('0xb'));var _=require(_0xa056('0xc'));var squel=require(_0xa056('0xd'));var crypto=require('crypto');var jsforce=require(_0xa056('0xe'));var deskjs=require(_0xa056('0xf'));var toCsv=require(_0xa056('0x9'));var querystring=require(_0xa056('0x10'));var Papa=require('papaparse');var Redis=require(_0xa056('0x11'));var authService=require(_0xa056('0x12'));var qs=require(_0xa056('0x13'));var as=require(_0xa056('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa056('0x15'))(_0xa056('0x16'));var utils=require(_0xa056('0x17'));var config=require(_0xa056('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa056('0x19'))['db'];function respondWithStatusCode(_0x415d93,_0x26b4e1){_0x26b4e1=_0x26b4e1||0xcc;return function(_0x431088){if(_0x431088){return _0x415d93[_0xa056('0x1a')](_0x26b4e1);}return _0x415d93[_0xa056('0x1b')](_0x26b4e1)[_0xa056('0x1c')]();};}function respondWithResult(_0x529b2f,_0x4fdcb0){_0x4fdcb0=_0x4fdcb0||0xc8;return function(_0x55e22b){if(_0x55e22b){return _0x529b2f[_0xa056('0x1b')](_0x4fdcb0)[_0xa056('0x1d')](_0x55e22b);}};}function respondWithFilteredResult(_0x7a92d4,_0x33a779){return function(_0x50e1d1){if(_0x50e1d1){var _0x30b909=typeof _0x33a779[_0xa056('0x1e')]===_0xa056('0x1f')&&typeof _0x33a779[_0xa056('0x20')]===_0xa056('0x1f');var _0x204ec3=_0x50e1d1[_0xa056('0x21')];var _0x291ef2=_0x30b909?0x0:_0x33a779[_0xa056('0x1e')];var _0x29810d=_0x30b909?_0x50e1d1[_0xa056('0x21')]:_0x33a779[_0xa056('0x1e')]+_0x33a779['limit'];var _0x3c0504;if(_0x29810d>=_0x204ec3){_0x29810d=_0x204ec3;_0x3c0504=0xc8;}else{_0x3c0504=0xce;}_0x7a92d4['status'](_0x3c0504);return _0x7a92d4[_0xa056('0x22')](_0xa056('0x23'),_0x291ef2+'-'+_0x29810d+'/'+_0x204ec3)[_0xa056('0x1d')](_0x50e1d1);}return null;};}function patchUpdates(_0x4a8c12){return function(_0x400ce5){try{jsonpatch[_0xa056('0x24')](_0x400ce5,_0x4a8c12,!![]);}catch(_0x19272a){return BPromise['reject'](_0x19272a);}return _0x400ce5[_0xa056('0x25')]();};}function saveUpdates(_0x402836,_0x1f8857){return function(_0xbbd2c3){if(_0xbbd2c3){return _0xbbd2c3['update'](_0x402836)['then'](function(_0x54c38a){return _0x54c38a;});}return null;};}function removeEntity(_0x3aaafb,_0x2c85df){return function(_0x381f1b){if(_0x381f1b){return _0x381f1b[_0xa056('0x26')]()[_0xa056('0x27')](function(){_0x3aaafb[_0xa056('0x1b')](0xcc)[_0xa056('0x1c')]();});}};}function handleEntityNotFound(_0x250eb6,_0x1c7a6e){return function(_0x5af229){if(!_0x5af229){_0x250eb6[_0xa056('0x1a')](0x194);}return _0x5af229;};}function handleError(_0x274c2f,_0x1db86e){_0x1db86e=_0x1db86e||0x1f4;return function(_0x4b30f0){logger['error'](_0x4b30f0[_0xa056('0x28')]);if(_0x4b30f0['name']){delete _0x4b30f0[_0xa056('0x29')];}_0x274c2f['status'](_0x1db86e)[_0xa056('0x2a')](_0x4b30f0);};}exports[_0xa056('0x2b')]=function(_0x1e2073,_0x842c07){var _0x471c3f={},_0x2a17e3={},_0x16ec4e={'count':0x0,'rows':[]};var _0x5c88d0=_[_0xa056('0x2c')](db[_0xa056('0x2d')][_0xa056('0x2e')],function(_0x5e6838){return{'name':_0x5e6838[_0xa056('0x2f')],'type':_0x5e6838[_0xa056('0x30')][_0xa056('0x31')]};});_0x2a17e3[_0xa056('0x32')]=_[_0xa056('0x2c')](_0x5c88d0,_0xa056('0x29'));_0x2a17e3[_0xa056('0x33')]=_['keys'](_0x1e2073[_0xa056('0x33')]);_0x2a17e3[_0xa056('0x34')]=_[_0xa056('0x35')](_0x2a17e3[_0xa056('0x32')],_0x2a17e3['query']);_0x471c3f[_0xa056('0x36')]=_[_0xa056('0x35')](_0x2a17e3[_0xa056('0x32')],qs[_0xa056('0x37')](_0x1e2073[_0xa056('0x33')][_0xa056('0x37')]));_0x471c3f[_0xa056('0x36')]=_0x471c3f[_0xa056('0x36')][_0xa056('0x38')]?_0x471c3f[_0xa056('0x36')]:_0x2a17e3[_0xa056('0x32')];if(!_0x1e2073[_0xa056('0x33')][_0xa056('0x39')](_0xa056('0x3a'))){_0x471c3f[_0xa056('0x20')]=qs['limit'](_0x1e2073['query'][_0xa056('0x20')]);_0x471c3f[_0xa056('0x1e')]=qs[_0xa056('0x1e')](_0x1e2073[_0xa056('0x33')][_0xa056('0x1e')]);}_0x471c3f[_0xa056('0x3b')]=qs[_0xa056('0x3c')](_0x1e2073['query']['sort']);_0x471c3f[_0xa056('0x3d')]=qs[_0xa056('0x34')](_[_0xa056('0x3e')](_0x1e2073[_0xa056('0x33')],_0x2a17e3[_0xa056('0x34')]),_0x5c88d0);if(_0x1e2073[_0xa056('0x33')]['filter']){_0x471c3f[_0xa056('0x3d')]=_[_0xa056('0x3f')](_0x471c3f[_0xa056('0x3d')],{'$or':_[_0xa056('0x2c')](_0x5c88d0,function(_0x19bb6a){if(_0x19bb6a[_0xa056('0x30')]!=='VIRTUAL'){var _0x24c627={};_0x24c627[_0x19bb6a[_0xa056('0x29')]]={'$like':'%'+_0x1e2073[_0xa056('0x33')][_0xa056('0x40')]+'%'};return _0x24c627;}})});}_0x471c3f=_[_0xa056('0x3f')]({},_0x471c3f,_0x1e2073[_0xa056('0x41')]);var _0x1de6b8={'where':_0x471c3f[_0xa056('0x3d')]};return db['Attachment'][_0xa056('0x21')](_0x1de6b8)[_0xa056('0x27')](function(_0x4203ec){_0x16ec4e[_0xa056('0x21')]=_0x4203ec;if(_0x1e2073['query'][_0xa056('0x42')]){_0x471c3f[_0xa056('0x43')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x471c3f);})['then'](function(_0x5d50c4){_0x16ec4e[_0xa056('0x44')]=_0x5d50c4;return _0x16ec4e;})[_0xa056('0x27')](respondWithFilteredResult(_0x842c07,_0x471c3f))['catch'](handleError(_0x842c07,null));};exports[_0xa056('0x45')]=function(_0x175d8a,_0x33f0c6){var _0x15e704={'raw':!![],'where':{'id':_0x175d8a[_0xa056('0x46')]['id']}},_0xd71257={};_0xd71257[_0xa056('0x32')]=_['keys'](db['Attachment'][_0xa056('0x2e')]);_0xd71257[_0xa056('0x33')]=_['keys'](_0x175d8a[_0xa056('0x33')]);_0xd71257[_0xa056('0x34')]=_[_0xa056('0x35')](_0xd71257['model'],_0xd71257[_0xa056('0x33')]);_0x15e704['attributes']=_['intersection'](_0xd71257[_0xa056('0x32')],qs[_0xa056('0x37')](_0x175d8a[_0xa056('0x33')][_0xa056('0x37')]));_0x15e704[_0xa056('0x36')]=_0x15e704[_0xa056('0x36')][_0xa056('0x38')]?_0x15e704[_0xa056('0x36')]:_0xd71257[_0xa056('0x32')];if(_0x175d8a[_0xa056('0x33')][_0xa056('0x42')]){_0x15e704[_0xa056('0x43')]=[{'all':!![]}];}_0x15e704=_[_0xa056('0x3f')]({},_0x15e704,_0x175d8a[_0xa056('0x41')]);return db[_0xa056('0x2d')][_0xa056('0x47')](_0x15e704)[_0xa056('0x27')](handleEntityNotFound(_0x33f0c6,null))[_0xa056('0x27')](respondWithResult(_0x33f0c6,null))[_0xa056('0x48')](handleError(_0x33f0c6,null));};exports[_0xa056('0x49')]=function(_0xdc4d5d,_0x14e7fd){var _0x3b4eab={'where':{'id':_0xdc4d5d[_0xa056('0x46')]['id']}},_0x13764c={};_0x13764c[_0xa056('0x32')]=_['keys'](db[_0xa056('0x2d')][_0xa056('0x2e')]);_0x3b4eab[_0xa056('0x36')]=_[_0xa056('0x35')](_0x13764c[_0xa056('0x32')],qs['fields'](_0xdc4d5d[_0xa056('0x33')]['fields']));_0x3b4eab[_0xa056('0x36')]=_0x3b4eab['attributes']['length']?_0x3b4eab[_0xa056('0x36')]:_0x13764c[_0xa056('0x32')];if(_0xdc4d5d[_0xa056('0x33')][_0xa056('0x42')]){_0x3b4eab['include']=[{'all':!![]}];}_0x3b4eab=_[_0xa056('0x3f')]({},_0x3b4eab,_0xdc4d5d[_0xa056('0x41')]);return db[_0xa056('0x2d')][_0xa056('0x47')](_0x3b4eab)[_0xa056('0x27')](handleEntityNotFound(_0x14e7fd,null))[_0xa056('0x27')](function(_0x676e94){if(_0x676e94){var _0x49b1b0=_0x676e94[_0xa056('0x4a')]({'plain':!![]});_0x49b1b0=qs[_0xa056('0x4b')](_0x49b1b0,['id',_0xa056('0x4c'),'updatedAt']);_0xdc4d5d[_0xa056('0x4d')]=_[_0xa056('0x4b')](_0xdc4d5d[_0xa056('0x4d')],['id',_0xa056('0x4c'),'updatedAt']);return db['Attachment'][_0xa056('0x4e')](_[_0xa056('0x3f')](_0x49b1b0,_0xdc4d5d['body']),{'include':_0xdc4d5d[_0xa056('0x33')][_0xa056('0x42')]?[{'all':!![]}]:undefined});}})[_0xa056('0x27')](respondWithResult(_0x14e7fd,0xc9))['catch'](handleError(_0x14e7fd,null));};exports['update']=function(_0x17ac97,_0x5d2837){if(_0x17ac97['body']['id']){delete _0x17ac97[_0xa056('0x4d')]['id'];}return db[_0xa056('0x2d')][_0xa056('0x47')]({'where':{'id':_0x17ac97[_0xa056('0x46')]['id']}})[_0xa056('0x27')](handleEntityNotFound(_0x5d2837,null))['then'](saveUpdates(_0x17ac97[_0xa056('0x4d')],null))[_0xa056('0x27')](respondWithResult(_0x5d2837,null))['catch'](handleError(_0x5d2837,null));};exports[_0xa056('0x26')]=function(_0x1deef0,_0x9a1ae0){return db[_0xa056('0x2d')][_0xa056('0x47')]({'where':{'id':_0x1deef0['params']['id']}})[_0xa056('0x27')](handleEntityNotFound(_0x9a1ae0,null))[_0xa056('0x27')](removeEntity(_0x9a1ae0,null))[_0xa056('0x48')](handleError(_0x9a1ae0,null));};exports[_0xa056('0x4e')]=function(_0x178691,_0x44ca76,_0x2174cf){_0x178691['body'][_0xa056('0x29')]=_0x178691['file'][_0xa056('0x4f')];_0x178691['body'][_0xa056('0x50')]=_0x178691[_0xa056('0x51')][_0xa056('0x52')];_0x178691[_0xa056('0x4d')]['type']=_0x178691[_0xa056('0x51')][_0xa056('0x53')];return db['Attachment']['create'](_0x178691['body'])[_0xa056('0x27')](respondWithResult(_0x44ca76,0xc9))[_0xa056('0x48')](handleError(_0x44ca76,null));};exports[_0xa056('0x54')]=function(_0x360b76,_0x520ec3,_0x137401){return db[_0xa056('0x2d')][_0xa056('0x55')]({'where':{'id':_0x360b76[_0xa056('0x46')]['id']},'raw':!![]})[_0xa056('0x27')](handleEntityNotFound(_0x520ec3,null))[_0xa056('0x27')](function(_0x302c95){if(_0x302c95){var _0x5a96f1=_0x302c95['ChatOfflineMessageId']!==null;var _0x54c242=path['join'](config[_0xa056('0x56')],'server/files/attachments/');if(_0x5a96f1){_0x54c242=path['join'](_0x54c242,_0xa056('0x57'));}var _0x16da30=path[_0xa056('0x58')](_0x54c242,_0x302c95[_0xa056('0x50')]);return _0x520ec3['download'](_0x16da30);}})[_0xa056('0x48')](handleError(_0x520ec3,null));};
\ No newline at end of file
+var _0x1962=['length','clone','find','get','omit','createdAt','body','updatedAt','create','catch','file','originalname','basename','mimetype','download','ChatOfflineMessageId','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','show','params'];(function(_0x21213d,_0x36ae13){var _0x184835=function(_0x4079ff){while(--_0x4079ff){_0x21213d['push'](_0x21213d['shift']());}};_0x184835(++_0x36ae13);}(_0x1962,0x166));var _0x2196=function(_0xc298ad,_0xea4dc2){_0xc298ad=_0xc298ad-0x0;var _0x11b2e6=_0x1962[_0xc298ad];return _0x11b2e6;};'use strict';var emlformat=require(_0x2196('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2196('0x1'));var rp=require(_0x2196('0x2'));var moment=require(_0x2196('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2196('0x4'));var path=require('path');var sox=require(_0x2196('0x5'));var csv=require(_0x2196('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2196('0x7'));var _=require('lodash');var squel=require(_0x2196('0x8'));var crypto=require('crypto');var jsforce=require(_0x2196('0x9'));var deskjs=require(_0x2196('0xa'));var toCsv=require(_0x2196('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2196('0xb'));var authService=require(_0x2196('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x2196('0xd'));var hardwareService=require(_0x2196('0xe'));var logger=require(_0x2196('0xf'))(_0x2196('0x10'));var utils=require(_0x2196('0x11'));var config=require(_0x2196('0x12'));var licenseUtil=require(_0x2196('0x13'));var db=require(_0x2196('0x14'))['db'];function respondWithStatusCode(_0x2993cc,_0x5942c5){_0x5942c5=_0x5942c5||0xcc;return function(_0x374032){if(_0x374032){return _0x2993cc[_0x2196('0x15')](_0x5942c5);}return _0x2993cc[_0x2196('0x16')](_0x5942c5)[_0x2196('0x17')]();};}function respondWithResult(_0x20d98,_0xcfc0e){_0xcfc0e=_0xcfc0e||0xc8;return function(_0x27e2e9){if(_0x27e2e9){return _0x20d98[_0x2196('0x16')](_0xcfc0e)[_0x2196('0x18')](_0x27e2e9);}};}function respondWithFilteredResult(_0x3a79d3,_0x2a70a9){return function(_0x5ef816){if(_0x5ef816){var _0x48275d=typeof _0x2a70a9[_0x2196('0x19')]==='undefined'&&typeof _0x2a70a9[_0x2196('0x1a')]===_0x2196('0x1b');var _0x17923b=_0x5ef816[_0x2196('0x1c')];var _0x66fa94=_0x48275d?0x0:_0x2a70a9[_0x2196('0x19')];var _0x59c0a0=_0x48275d?_0x5ef816['count']:_0x2a70a9[_0x2196('0x19')]+_0x2a70a9[_0x2196('0x1a')];var _0x1588b9;if(_0x59c0a0>=_0x17923b){_0x59c0a0=_0x17923b;_0x1588b9=0xc8;}else{_0x1588b9=0xce;}_0x3a79d3[_0x2196('0x16')](_0x1588b9);return _0x3a79d3[_0x2196('0x1d')](_0x2196('0x1e'),_0x66fa94+'-'+_0x59c0a0+'/'+_0x17923b)['json'](_0x5ef816);}return null;};}function patchUpdates(_0x2099e1){return function(_0x328320){try{jsonpatch[_0x2196('0x1f')](_0x328320,_0x2099e1,!![]);}catch(_0x40ba30){return BPromise[_0x2196('0x20')](_0x40ba30);}return _0x328320[_0x2196('0x21')]();};}function saveUpdates(_0x4cf0dd,_0x362435){return function(_0x12b306){if(_0x12b306){return _0x12b306[_0x2196('0x22')](_0x4cf0dd)[_0x2196('0x23')](function(_0x5b063a){return _0x5b063a;});}return null;};}function removeEntity(_0x5a4cb0,_0x211fe0){return function(_0x23d29d){if(_0x23d29d){return _0x23d29d[_0x2196('0x24')]()[_0x2196('0x23')](function(){_0x5a4cb0[_0x2196('0x16')](0xcc)[_0x2196('0x17')]();});}};}function handleEntityNotFound(_0x3c5734,_0x265d86){return function(_0x2d39cd){if(!_0x2d39cd){_0x3c5734[_0x2196('0x15')](0x194);}return _0x2d39cd;};}function handleError(_0x1338f2,_0x191834){_0x191834=_0x191834||0x1f4;return function(_0x62a80c){logger[_0x2196('0x25')](_0x62a80c[_0x2196('0x26')]);if(_0x62a80c[_0x2196('0x27')]){delete _0x62a80c['name'];}_0x1338f2[_0x2196('0x16')](_0x191834)[_0x2196('0x28')](_0x62a80c);};}exports['index']=function(_0x322b4a,_0x296f2f){var _0x566957={},_0xc32cbb={},_0x2914c1={'count':0x0,'rows':[]};var _0x35454b=_[_0x2196('0x29')](db[_0x2196('0x2a')][_0x2196('0x2b')],function(_0x359fac){return{'name':_0x359fac[_0x2196('0x2c')],'type':_0x359fac['type'][_0x2196('0x2d')]};});_0xc32cbb[_0x2196('0x2e')]=_[_0x2196('0x29')](_0x35454b,_0x2196('0x27'));_0xc32cbb[_0x2196('0x2f')]=_['keys'](_0x322b4a[_0x2196('0x2f')]);_0xc32cbb[_0x2196('0x30')]=_[_0x2196('0x31')](_0xc32cbb[_0x2196('0x2e')],_0xc32cbb['query']);_0x566957[_0x2196('0x32')]=_['intersection'](_0xc32cbb[_0x2196('0x2e')],qs[_0x2196('0x33')](_0x322b4a[_0x2196('0x2f')][_0x2196('0x33')]));_0x566957[_0x2196('0x32')]=_0x566957[_0x2196('0x32')]['length']?_0x566957[_0x2196('0x32')]:_0xc32cbb[_0x2196('0x2e')];if(!_0x322b4a[_0x2196('0x2f')]['hasOwnProperty'](_0x2196('0x34'))){_0x566957[_0x2196('0x1a')]=qs[_0x2196('0x1a')](_0x322b4a[_0x2196('0x2f')][_0x2196('0x1a')]);_0x566957[_0x2196('0x19')]=qs[_0x2196('0x19')](_0x322b4a['query'][_0x2196('0x19')]);}_0x566957[_0x2196('0x35')]=qs[_0x2196('0x36')](_0x322b4a['query']['sort']);_0x566957['where']=qs[_0x2196('0x30')](_[_0x2196('0x37')](_0x322b4a['query'],_0xc32cbb[_0x2196('0x30')]),_0x35454b);if(_0x322b4a[_0x2196('0x2f')][_0x2196('0x38')]){_0x566957[_0x2196('0x39')]=_[_0x2196('0x3a')](_0x566957[_0x2196('0x39')],{'$or':_[_0x2196('0x29')](_0x35454b,function(_0x3ea042){if(_0x3ea042[_0x2196('0x3b')]!=='VIRTUAL'){var _0x32d2c2={};_0x32d2c2[_0x3ea042[_0x2196('0x27')]]={'$like':'%'+_0x322b4a['query'][_0x2196('0x38')]+'%'};return _0x32d2c2;}})});}_0x566957=_[_0x2196('0x3a')]({},_0x566957,_0x322b4a[_0x2196('0x3c')]);var _0x24f377={'where':_0x566957[_0x2196('0x39')]};return db[_0x2196('0x2a')][_0x2196('0x1c')](_0x24f377)[_0x2196('0x23')](function(_0x26c6a2){_0x2914c1[_0x2196('0x1c')]=_0x26c6a2;if(_0x322b4a[_0x2196('0x2f')][_0x2196('0x3d')]){_0x566957[_0x2196('0x3e')]=[{'all':!![]}];}return db[_0x2196('0x2a')][_0x2196('0x3f')](_0x566957);})['then'](function(_0x26daa4){_0x2914c1[_0x2196('0x40')]=_0x26daa4;return _0x2914c1;})[_0x2196('0x23')](respondWithFilteredResult(_0x296f2f,_0x566957))['catch'](handleError(_0x296f2f,null));};exports[_0x2196('0x41')]=function(_0xb47fae,_0x182374){var _0x4b29fa={'raw':!![],'where':{'id':_0xb47fae[_0x2196('0x42')]['id']}},_0x568b92={};_0x568b92[_0x2196('0x2e')]=_['keys'](db[_0x2196('0x2a')][_0x2196('0x2b')]);_0x568b92[_0x2196('0x2f')]=_['keys'](_0xb47fae[_0x2196('0x2f')]);_0x568b92[_0x2196('0x30')]=_['intersection'](_0x568b92[_0x2196('0x2e')],_0x568b92['query']);_0x4b29fa['attributes']=_[_0x2196('0x31')](_0x568b92[_0x2196('0x2e')],qs[_0x2196('0x33')](_0xb47fae['query'][_0x2196('0x33')]));_0x4b29fa[_0x2196('0x32')]=_0x4b29fa['attributes'][_0x2196('0x43')]?_0x4b29fa[_0x2196('0x32')]:_0x568b92[_0x2196('0x2e')];if(_0xb47fae[_0x2196('0x2f')]['includeAll']){_0x4b29fa['include']=[{'all':!![]}];}_0x4b29fa=_[_0x2196('0x3a')]({},_0x4b29fa,_0xb47fae[_0x2196('0x3c')]);return db[_0x2196('0x2a')]['find'](_0x4b29fa)[_0x2196('0x23')](handleEntityNotFound(_0x182374,null))[_0x2196('0x23')](respondWithResult(_0x182374,null))['catch'](handleError(_0x182374,null));};exports[_0x2196('0x44')]=function(_0x317078,_0x2150b8){var _0x215dd9={'where':{'id':_0x317078[_0x2196('0x42')]['id']}},_0x18faf7={};_0x18faf7['model']=_['keys'](db['Attachment'][_0x2196('0x2b')]);_0x215dd9[_0x2196('0x32')]=_[_0x2196('0x31')](_0x18faf7[_0x2196('0x2e')],qs[_0x2196('0x33')](_0x317078[_0x2196('0x2f')]['fields']));_0x215dd9[_0x2196('0x32')]=_0x215dd9['attributes']['length']?_0x215dd9['attributes']:_0x18faf7[_0x2196('0x2e')];if(_0x317078[_0x2196('0x2f')][_0x2196('0x3d')]){_0x215dd9['include']=[{'all':!![]}];}_0x215dd9=_[_0x2196('0x3a')]({},_0x215dd9,_0x317078[_0x2196('0x3c')]);return db[_0x2196('0x2a')][_0x2196('0x45')](_0x215dd9)[_0x2196('0x23')](handleEntityNotFound(_0x2150b8,null))['then'](function(_0x458610){if(_0x458610){var _0x54b514=_0x458610[_0x2196('0x46')]({'plain':!![]});_0x54b514=qs[_0x2196('0x47')](_0x54b514,['id',_0x2196('0x48'),'updatedAt']);_0x317078[_0x2196('0x49')]=_[_0x2196('0x47')](_0x317078[_0x2196('0x49')],['id',_0x2196('0x48'),_0x2196('0x4a')]);return db['Attachment'][_0x2196('0x4b')](_[_0x2196('0x3a')](_0x54b514,_0x317078[_0x2196('0x49')]),{'include':_0x317078[_0x2196('0x2f')][_0x2196('0x3d')]?[{'all':!![]}]:undefined});}})[_0x2196('0x23')](respondWithResult(_0x2150b8,0xc9))[_0x2196('0x4c')](handleError(_0x2150b8,null));};exports[_0x2196('0x22')]=function(_0x533561,_0x3d3fe9){if(_0x533561[_0x2196('0x49')]['id']){delete _0x533561[_0x2196('0x49')]['id'];}return db[_0x2196('0x2a')][_0x2196('0x45')]({'where':{'id':_0x533561['params']['id']}})[_0x2196('0x23')](handleEntityNotFound(_0x3d3fe9,null))[_0x2196('0x23')](saveUpdates(_0x533561[_0x2196('0x49')],null))[_0x2196('0x23')](respondWithResult(_0x3d3fe9,null))[_0x2196('0x4c')](handleError(_0x3d3fe9,null));};exports[_0x2196('0x24')]=function(_0x399986,_0x52babf){return db[_0x2196('0x2a')][_0x2196('0x45')]({'where':{'id':_0x399986['params']['id']}})[_0x2196('0x23')](handleEntityNotFound(_0x52babf,null))[_0x2196('0x23')](removeEntity(_0x52babf,null))[_0x2196('0x4c')](handleError(_0x52babf,null));};exports[_0x2196('0x4b')]=function(_0x463d29,_0x1f0a23,_0x285b41){_0x463d29[_0x2196('0x49')]['name']=_0x463d29[_0x2196('0x4d')][_0x2196('0x4e')];_0x463d29[_0x2196('0x49')][_0x2196('0x4f')]=_0x463d29[_0x2196('0x4d')]['filename'];_0x463d29[_0x2196('0x49')][_0x2196('0x3b')]=_0x463d29[_0x2196('0x4d')][_0x2196('0x50')];return db[_0x2196('0x2a')]['create'](_0x463d29[_0x2196('0x49')])[_0x2196('0x23')](respondWithResult(_0x1f0a23,0xc9))[_0x2196('0x4c')](handleError(_0x1f0a23,null));};exports[_0x2196('0x51')]=function(_0x7a82ca,_0x195f6a,_0x2b53dc){return db[_0x2196('0x2a')]['findOne']({'where':{'id':_0x7a82ca[_0x2196('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x195f6a,null))[_0x2196('0x23')](function(_0x19bdd2){if(_0x19bdd2){var _0x8ef08e=_0x19bdd2[_0x2196('0x52')]!==null;var _0x346566=path['join'](config['root'],_0x2196('0x53'));if(_0x8ef08e){_0x346566=path['join'](_0x346566,_0x2196('0x54'));}var _0xcd001e=path['join'](_0x346566,_0x19bdd2[_0x2196('0x4f')]);return _0x195f6a[_0x2196('0x51')](_0xcd001e);}})['catch'](handleError(_0x195f6a,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8dd9fcd..3c7a64c 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 _0xa03f=['path','rimraf','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xa03f,0x162));var _0xfa03=function(_0x33ca9f,_0x4e57b7){_0x33ca9f=_0x33ca9f-0x0;var _0x575e19=_0xa03f[_0x33ca9f];return _0x575e19;};'use strict';var _=require(_0xfa03('0x0'));var util=require(_0xfa03('0x1'));var logger=require(_0xfa03('0x2'))(_0xfa03('0x3'));var moment=require(_0xfa03('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa03('0x5'));var fs=require('fs');var path=require(_0xfa03('0x6'));var rimraf=require(_0xfa03('0x7'));var config=require('../../config/environment');var attributes=require(_0xfa03('0x8'));module[_0xfa03('0x9')]=function(_0x272aff,_0x28b39a){return _0x272aff[_0xfa03('0xa')](_0xfa03('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b6d=['exports','define','Attachment','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x2b6d,0x157));var _0xd2b6=function(_0x59a029,_0x544a34){_0x59a029=_0x59a029-0x0;var _0x278e37=_0x2b6d[_0x59a029];return _0x278e37;};'use strict';var _=require(_0xd2b6('0x0'));var util=require('util');var logger=require(_0xd2b6('0x1'))(_0xd2b6('0x2'));var moment=require(_0xd2b6('0x3'));var BPromise=require(_0xd2b6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2b6('0x5'));var rimraf=require('rimraf');var config=require(_0xd2b6('0x6'));var attributes=require('./attachment.attributes');module[_0xd2b6('0x7')]=function(_0x2f027b,_0x2405df){return _0x2f027b[_0xd2b6('0x8')](_0xd2b6('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index b3a32c3..8b5abf1 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 _0xde50=['randomstring','ioredis','../../config/utils','rpc','http','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','moment','bluebird'];(function(_0x449135,_0x461965){var _0x282b71=function(_0xd7ce24){while(--_0xd7ce24){_0x449135['push'](_0x449135['shift']());}};_0x282b71(++_0x461965);}(_0xde50,0x140));var _0x0de5=function(_0x214f6b,_0x21bdd0){_0x214f6b=_0x214f6b-0x0;var _0x20fdb2=_0xde50[_0x214f6b];return _0x20fdb2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0de5('0x0'));var BPromise=require(_0x0de5('0x1'));var rs=require(_0x0de5('0x2'));var fs=require('fs');var Redis=require(_0x0de5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de5('0x4'));var logger=require('../../config/logger')(_0x0de5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0de5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2714e3,_0x2a5d94,_0x57410e){return new BPromise(function(_0xe3ac44,_0x4d5f0e){return client['request'](_0x2714e3,_0x57410e)['then'](function(_0x396293){logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,'request\x20sent');logger[_0x0de5('0x9')](_0x0de5('0xa'),_0x2a5d94,'request\x20sent',JSON[_0x0de5('0xb')](_0x396293));if(_0x396293[_0x0de5('0xc')]){if(_0x396293[_0x0de5('0xc')]['code']===0x1f4){logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);return _0x4d5f0e(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293['error']['message']);return _0xe3ac44(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}else{logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,_0x0de5('0xe'));_0xe3ac44(_0x396293[_0x0de5('0xf')]['message']);}})[_0x0de5('0x10')](function(_0xeb58e1){logger[_0x0de5('0xc')](_0x0de5('0x8'),_0x2a5d94,_0xeb58e1);_0x4d5f0e(_0xeb58e1);});});}exports[_0x0de5('0x11')]=function(_0x2860e8){var _0x58ce66=this;return new Promise(function(_0x21e4b6,_0x48ba4e){return db[_0x0de5('0x12')][_0x0de5('0x13')](_0x2860e8[_0x0de5('0x14')],{'raw':_0x2860e8[_0x0de5('0x15')]?_0x2860e8['options'][_0x0de5('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x2a2abc){logger[_0x0de5('0x7')](_0x0de5('0x11'),_0x2860e8);logger['debug'](_0x0de5('0x11'),_0x2860e8,JSON[_0x0de5('0xb')](_0x2a2abc));_0x21e4b6(_0x2a2abc);})[_0x0de5('0x10')](function(_0x224745){logger['error'](_0x0de5('0x11'),_0x224745['message'],_0x2860e8);_0x48ba4e(_0x58ce66[_0x0de5('0xc')](0x1f4,_0x224745[_0x0de5('0xd')]));});});};
\ No newline at end of file
+var _0xf53f=['create','options','raw','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateAttachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf53f,0x8d));var _0xff53=function(_0x3fcaad,_0x3c83bf){_0x3fcaad=_0x3fcaad-0x0;var _0x112b23=_0xf53f[_0x3fcaad];return _0x112b23;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var moment=require(_0xff53('0x2'));var BPromise=require(_0xff53('0x3'));var rs=require(_0xff53('0x4'));var fs=require('fs');var Redis=require(_0xff53('0x5'));var db=require(_0xff53('0x6'))['db'];var utils=require(_0xff53('0x7'));var logger=require(_0xff53('0x8'))(_0xff53('0x9'));var config=require(_0xff53('0xa'));var jayson=require(_0xff53('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b397,_0x5751e7,_0x1c27bb){return new BPromise(function(_0x122746,_0x1bc4b3){return client['request'](_0x27b397,_0x1c27bb)['then'](function(_0x3c001d){logger['info'](_0xff53('0xc'),_0x5751e7,_0xff53('0xd'));logger['debug'](_0xff53('0xe'),_0x5751e7,_0xff53('0xd'),JSON['stringify'](_0x3c001d));if(_0x3c001d[_0xff53('0xf')]){if(_0x3c001d[_0xff53('0xf')][_0xff53('0x10')]===0x1f4){logger['error'](_0xff53('0xc'),_0x5751e7,_0x3c001d[_0xff53('0xf')][_0xff53('0x11')]);return _0x1bc4b3(_0x3c001d['error'][_0xff53('0x11')]);}logger[_0xff53('0xf')]('Attachment,\x20%s,\x20%s',_0x5751e7,_0x3c001d['error']['message']);return _0x122746(_0x3c001d['error'][_0xff53('0x11')]);}else{logger[_0xff53('0x12')](_0xff53('0xc'),_0x5751e7,'request\x20sent');_0x122746(_0x3c001d[_0xff53('0x13')]['message']);}})['catch'](function(_0x12e90b){logger[_0xff53('0xf')](_0xff53('0xc'),_0x5751e7,_0x12e90b);_0x1bc4b3(_0x12e90b);});});}exports[_0xff53('0x14')]=function(_0x38883f){var _0x319ce5=this;return new Promise(function(_0x14b502,_0x5e9ba6){return db['Attachment'][_0xff53('0x15')](_0x38883f['body'],{'raw':_0x38883f[_0xff53('0x16')]?_0x38883f[_0xff53('0x16')][_0xff53('0x17')]===undefined?!![]:![]:!![]})[_0xff53('0x18')](function(_0x39b3d1){logger[_0xff53('0x12')](_0xff53('0x14'),_0x38883f);logger[_0xff53('0x19')](_0xff53('0x14'),_0x38883f,JSON['stringify'](_0x39b3d1));_0x14b502(_0x39b3d1);})[_0xff53('0x1a')](function(_0x5cd878){logger['error']('CreateAttachment',_0x5cd878['message'],_0x38883f);_0x5e9ba6(_0x319ce5[_0xff53('0xf')](0x1f4,_0x5cd878[_0xff53('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 1e4281b..75d8c70 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x2e6d1d,_0x41bc01){_0x2e6d1d=_0x2e6d1d-0x0;var _0xb0f086=_0xdb28[_0x2e6d1d];return _0xb0f086;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=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(_0x1e6242,_0x5a70a6){var _0x19a588=function(_0x8f70ea){while(--_0x8f70ea){_0x1e6242['push'](_0x1e6242['shift']());}};_0x19a588(++_0x5a70a6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x36c20f,_0x22ff16){_0x36c20f=_0x36c20f-0x0;var _0x5bf69a=_0x5f2f[_0x36c20f];return _0x5bf69a;};'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 3a8827d..db36ce8 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 _0xe088=['passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','find','emails','admin','user','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','getLicense','lodash'];(function(_0x5bd265,_0x49eadd){var _0x372fdf=function(_0x36069b){while(--_0x36069b){_0x5bd265['push'](_0x5bd265['shift']());}};_0x372fdf(++_0x49eadd);}(_0xe088,0x83));var _0x8e08=function(_0x8958a2,_0x25ec6c){_0x8958a2=_0x8958a2-0x0;var _0x5dca35=_0xe088[_0x8958a2];return _0x5dca35;};'use strict';var _=require(_0x8e08('0x0'));var passport=require(_0x8e08('0x1'));var GoogleStrategy=require(_0x8e08('0x2'))[_0x8e08('0x3')];var moment=require(_0x8e08('0x4'));var db=require(_0x8e08('0x5'))['db'];var config=require(_0x8e08('0x6'));var signToken=require(_0x8e08('0x7'))[_0x8e08('0x8')];var utils=require(_0x8e08('0x9'));exports[_0x8e08('0xa')]=passport['authenticate'](_0x8e08('0xb'),{'failureRedirect':_0x8e08('0xc'),'scope':[_0x8e08('0xd'),_0x8e08('0xe')],'session':![]});exports['callback']=passport['authenticate']('google',{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x8e08('0xb')]?config[_0x8e08('0xb')]['clientID']:'id','clientSecret':config[_0x8e08('0xb')]?config['google'][_0x8e08('0xf')]:_0x8e08('0x10'),'callbackURL':config[_0x8e08('0xb')]?config[_0x8e08('0xb')][_0x8e08('0x11')]:''},function(_0x591297,_0x5d9401,_0x1b67be,_0x527cce){var _0x378b30,_0x189bf4;return db['Setting'][_0x8e08('0x12')]({'where':{'id':0x1},'attributes':[_0x8e08('0x13'),_0x8e08('0x14')],'raw':!![]})['then'](function(_0x30e9ee){_0x378b30=_0x30e9ee;return db['User'][_0x8e08('0x15')]({'where':{'email':_['map'](_0x1b67be[_0x8e08('0x16')],'value'),'role':{'$or':[_0x8e08('0x17'),_0x8e08('0x18'),_0x8e08('0x19')]}}});})[_0x8e08('0x1a')](function(_0x4dc8ae){_0x189bf4=_0x4dc8ae;if(_0x189bf4){if(_0x189bf4[_0x8e08('0x1b')]){return _0x527cce(_0x8e08('0x1c'));}else if(_0x378b30[_0x8e08('0x14')]>0x0){if(_0x189bf4[_0x8e08('0x1d')]){if(moment(_0x189bf4[_0x8e08('0x1e')])[_0x8e08('0x1f')](_0x378b30[_0x8e08('0x14')],'minutes')>moment()){return _0x527cce(_0x8e08('0x1c'));}else{return utils['clearBlockUser'](_0x189bf4,0x0,![],null)[_0x8e08('0x1a')](function(){return utils['getLicense'](_0x189bf4);})['then'](function(){return _0x527cce(null,_0x189bf4);});}}else{return utils['getLicense'](_0x189bf4)[_0x8e08('0x1a')](function(){return _0x527cce(null,_0x189bf4);});}}else{return utils[_0x8e08('0x20')](_0x189bf4)[_0x8e08('0x1a')](function(){return _0x527cce(null,_0x189bf4);});}}return _0x527cce(_0x8e08('0x1c'));})['catch'](function(_0x45b29f){_0x527cce(_0x45b29f);});}));
\ No newline at end of file
+var _0xcecc=['blockedAt','add','clearBlockUser','getLicense','lodash','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','email','callback','google','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked'];(function(_0x3edbec,_0x5ccb04){var _0x2fc51c=function(_0x19257d){while(--_0x19257d){_0x3edbec['push'](_0x3edbec['shift']());}};_0x2fc51c(++_0x5ccb04);}(_0xcecc,0x148));var _0xccec=function(_0xa75234,_0x2e9f29){_0xa75234=_0xa75234-0x0;var _0x596e0f=_0xcecc[_0xa75234];return _0x596e0f;};'use strict';var _=require(_0xccec('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0xccec('0x1')];var moment=require(_0xccec('0x2'));var db=require(_0xccec('0x3'))['db'];var config=require(_0xccec('0x4'));var signToken=require(_0xccec('0x5'))[_0xccec('0x6')];var utils=require(_0xccec('0x7'));exports[_0xccec('0x8')]=passport[_0xccec('0x9')]('google',{'failureRedirect':'/login','scope':['profile',_0xccec('0xa')],'session':![]});exports[_0xccec('0xb')]=passport['authenticate'](_0xccec('0xc'),{'failureRedirect':_0xccec('0xd'),'session':![]});passport[_0xccec('0xe')](new GoogleStrategy({'clientID':config[_0xccec('0xc')]?config[_0xccec('0xc')][_0xccec('0xf')]:'id','clientSecret':config[_0xccec('0xc')]?config[_0xccec('0xc')][_0xccec('0x10')]:_0xccec('0x11'),'callbackURL':config['google']?config[_0xccec('0xc')][_0xccec('0x12')]:''},function(_0x648c9c,_0x45ff0a,_0x4b8af2,_0x39e3e7){var _0x141fbc,_0x3b0e49;return db[_0xccec('0x13')][_0xccec('0x14')]({'where':{'id':0x1},'attributes':[_0xccec('0x15'),_0xccec('0x16')],'raw':!![]})[_0xccec('0x17')](function(_0x1abce6){_0x141fbc=_0x1abce6;return db[_0xccec('0x18')][_0xccec('0x19')]({'where':{'email':_[_0xccec('0x1a')](_0x4b8af2['emails'],'value'),'role':{'$or':[_0xccec('0x1b'),_0xccec('0x1c'),'agent']}}});})[_0xccec('0x17')](function(_0x2f0c95){_0x3b0e49=_0x2f0c95;if(_0x3b0e49){if(_0x3b0e49[_0xccec('0x1d')]){return _0x39e3e7(_0xccec('0x1e'));}else if(_0x141fbc[_0xccec('0x16')]>0x0){if(_0x3b0e49[_0xccec('0x1f')]){if(moment(_0x3b0e49[_0xccec('0x20')])[_0xccec('0x21')](_0x141fbc[_0xccec('0x16')],'minutes')>moment()){return _0x39e3e7(_0xccec('0x1e'));}else{return utils[_0xccec('0x22')](_0x3b0e49,0x0,![],null)[_0xccec('0x17')](function(){return utils[_0xccec('0x23')](_0x3b0e49);})[_0xccec('0x17')](function(){return _0x39e3e7(null,_0x3b0e49);});}}else{return utils['getLicense'](_0x3b0e49)[_0xccec('0x17')](function(){return _0x39e3e7(null,_0x3b0e49);});}}else{return utils['getLicense'](_0x3b0e49)[_0xccec('0x17')](function(){return _0x39e3e7(null,_0x3b0e49);});}}return _0x39e3e7(_0xccec('0x1e'));})['catch'](function(_0x30579a){_0x39e3e7(_0x30579a);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 54d05b8..899fb2c 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 _0xb613=['../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb613,0x152));var _0x3b61=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0xb613[_0x4d521e];return _0x3beb42;};'use strict';var express=require('express');var passport=require(_0x3b61('0x0'));var router=express[_0x3b61('0x1')]();var controller=require(_0x3b61('0x2'));var userController=require(_0x3b61('0x3'));var authService=require(_0x3b61('0x4'));router[_0x3b61('0x5')]('/',controller[_0x3b61('0x6')]);router[_0x3b61('0x5')]('/callback',controller[_0x3b61('0x7')],authService[_0x3b61('0x8')],userController[_0x3b61('0x6')],authService[_0x3b61('0x9')]);module[_0x3b61('0xa')]=router;
\ No newline at end of file
+var _0xb36f=['callback','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0xb36f,0x154));var _0xfb36=function(_0x245fda,_0x6e64b3){_0x245fda=_0x245fda-0x0;var _0x2b19cd=_0xb36f[_0x245fda];return _0x2b19cd;};'use strict';var express=require(_0xfb36('0x0'));var passport=require(_0xfb36('0x1'));var router=express['Router']();var controller=require(_0xfb36('0x2'));var userController=require(_0xfb36('0x3'));var authService=require(_0xfb36('0x4'));router[_0xfb36('0x5')]('/',controller[_0xfb36('0x6')]);router[_0xfb36('0x5')](_0xfb36('0x7'),controller[_0xfb36('0x8')],authService[_0xfb36('0x9')],userController[_0xfb36('0x6')],authService[_0xfb36('0xa')]);module[_0xfb36('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index f2bf053..1eaf3ca 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 _0xa047=['message','stringify','status','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','generate','trim','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','disabled','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','send','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','then','name','password','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','blockDuration','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xa047,0x1c5));var _0x7a04=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xa047[_0x68ee8b];return _0x5148f7;};'use strict';var util=require(_0x7a04('0x0'));var passport=require(_0x7a04('0x1'));var LocalStrategy=require(_0x7a04('0x2'))[_0x7a04('0x3')];var jayson=require('jayson/promise');var _=require(_0x7a04('0x4'));var rs=require('randomstring');var moment=require(_0x7a04('0x5'));var db=require(_0x7a04('0x6'))['db'];var authService=require(_0x7a04('0x7'));var utils=require(_0x7a04('0x8'));var client=jayson[_0x7a04('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x12564a,_0x3166ff,_0x1dc89f,_0x5c183c){var _0x10d92f,_0x10faf9;return db['Setting'][_0x7a04('0xa')]({'where':{'id':0x1},'attributes':[_0x7a04('0xb'),'blockDuration'],'raw':!![]})[_0x7a04('0xc')](function(_0x4d21d3){_0x10d92f=_0x4d21d3;return _0x12564a['findOne']({'attributes':['id',_0x7a04('0xd'),_0x7a04('0xe'),'salt','role','disabled',_0x7a04('0xf'),_0x7a04('0x10'),_0x7a04('0x11')],'where':{'name':_0x3166ff,'role':{'$or':[_0x7a04('0x12'),_0x7a04('0x13'),_0x7a04('0x14')]}}});})[_0x7a04('0xc')](function(_0x3a50e9){if(!_0x3a50e9||_0x3a50e9&&_0x3a50e9[_0x7a04('0xd')]!==_0x3166ff){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x10faf9=_0x3a50e9;return _0x10faf9;}})[_0x7a04('0xc')](function(){_0x10faf9[_0x7a04('0x15')](_0x1dc89f,function(_0x26d4bf,_0x377fa1){var _0x2bb838=_0x10faf9[_0x7a04('0x11')]+0x1;if(_0x26d4bf){return _0x5c183c(_0x26d4bf);}else if(!_0x377fa1){if(_0x10faf9['disabled']){return _0x5c183c(null,![],{'message':_0x7a04('0x16')});}else if(_0x10d92f[_0x7a04('0xb')]>0x0){if(_0x10faf9[_0x7a04('0xf')]){if(_0x10d92f['blockDuration']>0x0){if(moment(_0x10faf9['blockedAt'])[_0x7a04('0x17')](_0x10d92f[_0x7a04('0x18')],_0x7a04('0x19'))>moment()){return _0x5c183c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7a04('0x1a')](_0x10faf9,_0x2bb838,![],null)[_0x7a04('0xc')](function(){return _0x5c183c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5c183c(null,![],{'message':_0x7a04('0x16')});}}else{if(_0x2bb838>=_0x10d92f['allowedLoginAttempts']){return utils[_0x7a04('0x1a')](_0x10faf9,0x0,!![],moment())['then'](function(){return _0x5c183c(null,![],{'message':_0x7a04('0x16')});});}else{return utils[_0x7a04('0x1a')](_0x10faf9,_0x2bb838,![],null)['then'](function(){return _0x5c183c(null,![],{'message':_0x7a04('0x16')});});}}}else{return _0x5c183c(null,![],{'message':_0x7a04('0x16')});}}else{if(_0x10faf9['disabled']){return _0x5c183c(null,![],{'message':_0x7a04('0x16')});}else if(_0x10d92f[_0x7a04('0xb')]>0x0){if(_0x10faf9['blocked']){if(_0x10d92f[_0x7a04('0x18')]>0x0){if(moment(_0x10faf9[_0x7a04('0x10')])[_0x7a04('0x17')](_0x10d92f[_0x7a04('0x18')],_0x7a04('0x19'))>moment()){return _0x5c183c(null,![],{'message':_0x7a04('0x16')});}else{return utils[_0x7a04('0x1a')](_0x10faf9,0x0,![],null)[_0x7a04('0xc')](function(){return utils['getLicense'](_0x10faf9);})[_0x7a04('0xc')](function(){return _0x5c183c(null,_0x10faf9);});}}else{return _0x5c183c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x7a04('0x1a')](_0x10faf9,0x0,![],null)[_0x7a04('0xc')](function(){return utils[_0x7a04('0x1b')](_0x10faf9);})[_0x7a04('0xc')](function(){return _0x5c183c(null,_0x10faf9);})[_0x7a04('0x1c')](function(_0x1ff41b){return _0x5c183c(null,![],_0x1ff41b);});}}else{if(_0x10faf9[_0x7a04('0xf')]){return _0x5c183c(null,![],{'message':_0x7a04('0x16')});}else{return utils[_0x7a04('0x1b')](_0x10faf9)[_0x7a04('0xc')](function(){return _0x5c183c(null,_0x10faf9);});}}}});})[_0x7a04('0x1c')](function(_0x49a8d0){return _0x5c183c(null,![],_0x49a8d0);});}function sendServiceMail(_0xb9a6fe){return db['MailAccount'][_0x7a04('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x7a04('0xd'),_0x7a04('0x1e')],'include':[{'model':db[_0x7a04('0x1f')],'as':_0x7a04('0x20')}]})[_0x7a04('0xc')](function(_0x4ce6f2){if(!_0x4ce6f2){throw new Error(_0x7a04('0x21'));}var _0x487b74={'tls':{'rejectUnauthorized':![]}};if(_0x4ce6f2[_0x7a04('0x20')][_0x7a04('0x22')]){_0x487b74['service']=_0x4ce6f2[_0x7a04('0x20')][_0x7a04('0x22')];}else{_0x487b74['host']=_0x4ce6f2['Smtp'][_0x7a04('0x23')];_0x487b74[_0x7a04('0x24')]=_0x4ce6f2[_0x7a04('0x20')][_0x7a04('0x24')];_0x487b74[_0x7a04('0x25')]=_0x4ce6f2[_0x7a04('0x20')][_0x7a04('0x25')];}if(_0x4ce6f2[_0x7a04('0x20')]['authentication']){_0x487b74[_0x7a04('0x26')]={'user':_0x4ce6f2[_0x7a04('0x20')]['user'],'pass':_0x4ce6f2[_0x7a04('0x20')][_0x7a04('0x27')]};}var _0x1df634={'account':_0x487b74,'message':_[_0x7a04('0x28')]({'from':util[_0x7a04('0x29')](_0x7a04('0x2a'),_0x4ce6f2[_0x7a04('0xd')],_0x4ce6f2['email']||_0x4ce6f2[_0x7a04('0x20')][_0x7a04('0x13')])},_0xb9a6fe)};return client['request']('SendMail',_0x1df634);})[_0x7a04('0xc')](function(_0x4e10cd){if(_0x4e10cd[_0x7a04('0x2b')]){throw new Error(util['format'](_0x7a04('0x2c'),_0x4e10cd[_0x7a04('0x2b')][_0x7a04('0x2d')]||JSON[_0x7a04('0x2e')](_0x4e10cd[_0x7a04('0x2b')])));}return!![];});}function handleError(_0x6df715,_0x2b2531,_0x39ede8){return _0x6df715[_0x7a04('0x2f')](_0x2b2531||0x1f4)['send']({'message':_0x39ede8?_0x39ede8['message']||_0x39ede8:''});}exports['login']=function(_0x5dd834,_0x37b7bd,_0x564890){passport[_0x7a04('0x15')](_0x7a04('0x30'),function(_0x19f7ec,_0x38cf7d,_0x34f152){var _0x2fb643=_0x19f7ec||_0x34f152;if(_0x2fb643){return handleError(_0x37b7bd,0x191,_0x2fb643);}if(!_0x38cf7d){return handleError(_0x37b7bd,0x194,{'message':_0x7a04('0x31')});}else{var _0x4e7713={'payload':{'id':_0x38cf7d['id'],'role':_0x38cf7d[_0x7a04('0x32')]},'options':{'expiresIn':0x15180}};return authService[_0x7a04('0x33')](_0x4e7713)[_0x7a04('0xc')](function(_0x4fda19){_0x37b7bd[_0x7a04('0x34')]({'id':_0x38cf7d['id'],'token':_0x4fda19,'statusCall':'','isAlreadyLogged':_0x38cf7d[_0x7a04('0x35')]});});}})(_0x5dd834,_0x37b7bd,_0x564890);};exports[_0x7a04('0x36')]=function(_0x17d05c,_0x2dc001,_0x2db53e){if(!_0x17d05c[_0x7a04('0x37')][_0x7a04('0x1e')]){return handleError(_0x2dc001,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4811b7=rs[_0x7a04('0x38')]();_0x17d05c[_0x7a04('0x37')]['email']=_0x17d05c['body']['email'][_0x7a04('0x39')]()[_0x7a04('0x3a')]();var _0x295c5b;return db[_0x7a04('0x3b')][_0x7a04('0xa')]({'where':{'id':0x1},'attributes':[_0x7a04('0xb'),'blockDuration'],'raw':!![]})[_0x7a04('0xc')](function(_0x220829){_0x295c5b=_0x220829;return db['User']['find']({'where':{'email':_0x17d05c[_0x7a04('0x37')][_0x7a04('0x1e')]}});})[_0x7a04('0xc')](function(_0x27ada9){if(!_0x27ada9){throw new Error(_0x7a04('0x3c'));}if(_0x27ada9[_0x7a04('0x3d')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x27ada9[_0x7a04('0xf')]){if(moment(_0x27ada9[_0x7a04('0x10')])[_0x7a04('0x17')](_0x295c5b[_0x7a04('0x18')],_0x7a04('0x19'))>moment()){throw new Error(_0x7a04('0x3e'));}else{_0x27ada9[_0x7a04('0xf')]=![];_0x27ada9['blockedAt']=null;}}_0x27ada9[_0x7a04('0x3f')]=_0x4811b7;_0x27ada9[_0x7a04('0x40')]=Date['now']()+0x36ee80;return _0x27ada9['save']();})['then'](function(){return sendServiceMail({'to':_0x17d05c[_0x7a04('0x37')][_0x7a04('0x1e')],'subject':_0x7a04('0x41'),'text':_0x7a04('0x42')+_0x7a04('0x43')+'https://'+_0x17d05c['headers'][_0x7a04('0x23')]+_0x7a04('0x44')+_0x4811b7+'\x0a\x0a'+_0x7a04('0x45')});})[_0x7a04('0xc')](function(){_0x2dc001['status'](0xc8)['send']({'message':_0x7a04('0x46')});})['catch'](function(_0x19c1df){return handleError(_0x2dc001,0x1f4,_0x19c1df);});};exports['reset']=function(_0x467fcf,_0x143bcf,_0x41d12b){return db[_0x7a04('0x47')][_0x7a04('0x1d')]({'where':{'resetPasswordToken':_0x467fcf[_0x7a04('0x48')][_0x7a04('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x3cb8e7){if(!_0x3cb8e7){throw new Error(_0x7a04('0x4a'));}return db[_0x7a04('0x3b')][_0x7a04('0xa')]({'attributes':['id',_0x7a04('0x4b'),_0x7a04('0x4c'),_0x7a04('0x4d')]})[_0x7a04('0xc')](function(_0x5109f6){if(_0x5109f6['securePassword'])authService[_0x7a04('0x4e')](_0x467fcf[_0x7a04('0x37')]['password']);if(!_0x5109f6[_0x7a04('0x4c')]||!_0x3cb8e7['previousPasswords'])return _0x3cb8e7;authService['validatePasswordHistory'](_0x467fcf[_0x7a04('0x37')]['password'],_0x3cb8e7[_0x7a04('0x4f')],_0x5109f6[_0x7a04('0x4d')]);return _0x3cb8e7;})[_0x7a04('0xc')](function(){_0x3cb8e7['password']=_0x467fcf[_0x7a04('0x37')][_0x7a04('0xe')];_0x3cb8e7[_0x7a04('0x3f')]=null;_0x3cb8e7['resetPasswordExpires']=null;return _0x3cb8e7['save']();});})[_0x7a04('0xc')](function(){_0x143bcf[_0x7a04('0x2f')](0xc8)[_0x7a04('0x50')]({'message':_0x7a04('0x51')});})[_0x7a04('0x1c')](function(_0x3bbdd9){return handleError(_0x143bcf,0x1f4,_0x3bbdd9);});};passport[_0x7a04('0x52')](new LocalStrategy({'usernameField':_0x7a04('0xd'),'passwordField':_0x7a04('0xe')},function(_0x515b44,_0xd50a15,_0xdcc457){return localAuthenticate(db[_0x7a04('0x47')],_0x515b44,_0xd50a15,_0xdcc457);}));
\ No newline at end of file
+var _0x2962=['generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','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://','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','authenticate','blockDuration','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','MailAccount','find','name','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing'];(function(_0x49456e,_0x5e173f){var _0x304236=function(_0x19da52){while(--_0x19da52){_0x49456e['push'](_0x49456e['shift']());}};_0x304236(++_0x5e173f);}(_0x2962,0xca));var _0x2296=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2962[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x2296('0x0'));var passport=require(_0x2296('0x1'));var LocalStrategy=require(_0x2296('0x2'))[_0x2296('0x3')];var jayson=require('jayson/promise');var _=require(_0x2296('0x4'));var rs=require('randomstring');var moment=require(_0x2296('0x5'));var db=require(_0x2296('0x6'))['db'];var authService=require(_0x2296('0x7'));var utils=require(_0x2296('0x8'));var client=jayson[_0x2296('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x33bbaf,_0x3442b6,_0x1fc88f,_0x27ee7d){var _0x531ccd,_0xa32808;return db[_0x2296('0xa')][_0x2296('0xb')]({'where':{'id':0x1},'attributes':[_0x2296('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x20461c){_0x531ccd=_0x20461c;return _0x33bbaf[_0x2296('0xb')]({'attributes':['id','name',_0x2296('0xd'),_0x2296('0xe'),_0x2296('0xf'),_0x2296('0x10'),_0x2296('0x11'),_0x2296('0x12'),_0x2296('0x13')],'where':{'name':_0x3442b6,'role':{'$or':[_0x2296('0x14'),_0x2296('0x15'),_0x2296('0x16')]}}});})[_0x2296('0x17')](function(_0x12945f){if(!_0x12945f||_0x12945f&&_0x12945f['name']!==_0x3442b6){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xa32808=_0x12945f;return _0xa32808;}})[_0x2296('0x17')](function(){_0xa32808[_0x2296('0x18')](_0x1fc88f,function(_0x335e0a,_0x4549b5){var _0x1839fd=_0xa32808[_0x2296('0x13')]+0x1;if(_0x335e0a){return _0x27ee7d(_0x335e0a);}else if(!_0x4549b5){if(_0xa32808[_0x2296('0x10')]){return _0x27ee7d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x531ccd[_0x2296('0xc')]>0x0){if(_0xa32808[_0x2296('0x11')]){if(_0x531ccd[_0x2296('0x19')]>0x0){if(moment(_0xa32808[_0x2296('0x12')])[_0x2296('0x1a')](_0x531ccd[_0x2296('0x19')],_0x2296('0x1b'))>moment()){return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});}else{return utils[_0x2296('0x1d')](_0xa32808,_0x1839fd,![],null)[_0x2296('0x17')](function(){return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});});}}else{return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});}}else{if(_0x1839fd>=_0x531ccd['allowedLoginAttempts']){return utils[_0x2296('0x1d')](_0xa32808,0x0,!![],moment())['then'](function(){return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});});}else{return utils[_0x2296('0x1d')](_0xa32808,_0x1839fd,![],null)[_0x2296('0x17')](function(){return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});});}}}else{return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});}}else{if(_0xa32808[_0x2296('0x10')]){return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});}else if(_0x531ccd[_0x2296('0xc')]>0x0){if(_0xa32808[_0x2296('0x11')]){if(_0x531ccd[_0x2296('0x19')]>0x0){if(moment(_0xa32808[_0x2296('0x12')])[_0x2296('0x1a')](_0x531ccd[_0x2296('0x19')],'minutes')>moment()){return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});}else{return utils[_0x2296('0x1d')](_0xa32808,0x0,![],null)[_0x2296('0x17')](function(){return utils[_0x2296('0x1e')](_0xa32808);})[_0x2296('0x17')](function(){return _0x27ee7d(null,_0xa32808);});}}else{return _0x27ee7d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x2296('0x1d')](_0xa32808,0x0,![],null)[_0x2296('0x17')](function(){return utils[_0x2296('0x1e')](_0xa32808);})[_0x2296('0x17')](function(){return _0x27ee7d(null,_0xa32808);})['catch'](function(_0x3523b4){return _0x27ee7d(null,![],_0x3523b4);});}}else{if(_0xa32808[_0x2296('0x11')]){return _0x27ee7d(null,![],{'message':_0x2296('0x1c')});}else{return utils[_0x2296('0x1e')](_0xa32808)[_0x2296('0x17')](function(){return _0x27ee7d(null,_0xa32808);});}}}});})[_0x2296('0x1f')](function(_0x5e6396){return _0x27ee7d(null,![],_0x5e6396);});}function sendServiceMail(_0x5e8d09){return db[_0x2296('0x20')][_0x2296('0x21')]({'where':{'service':!![]},'attributes':['id',_0x2296('0x22'),_0x2296('0x23')],'include':[{'model':db[_0x2296('0x24')],'as':'Smtp'}]})[_0x2296('0x17')](function(_0x237cd3){if(!_0x237cd3){throw new Error(_0x2296('0x25'));}var _0x3df6b4={'tls':{'rejectUnauthorized':![]}};if(_0x237cd3[_0x2296('0x26')][_0x2296('0x27')]){_0x3df6b4['service']=_0x237cd3[_0x2296('0x26')][_0x2296('0x27')];}else{_0x3df6b4[_0x2296('0x28')]=_0x237cd3['Smtp'][_0x2296('0x28')];_0x3df6b4[_0x2296('0x29')]=_0x237cd3[_0x2296('0x26')]['port'];_0x3df6b4[_0x2296('0x2a')]=_0x237cd3[_0x2296('0x26')][_0x2296('0x2a')];}if(_0x237cd3['Smtp'][_0x2296('0x2b')]){_0x3df6b4[_0x2296('0x2c')]={'user':_0x237cd3['Smtp'][_0x2296('0x15')],'pass':_0x237cd3[_0x2296('0x26')][_0x2296('0x2d')]};}var _0x15ebbf={'account':_0x3df6b4,'message':_[_0x2296('0x2e')]({'from':util[_0x2296('0x2f')](_0x2296('0x30'),_0x237cd3['name'],_0x237cd3[_0x2296('0x23')]||_0x237cd3[_0x2296('0x26')][_0x2296('0x15')])},_0x5e8d09)};return client['request']('SendMail',_0x15ebbf);})[_0x2296('0x17')](function(_0x288a5b){if(_0x288a5b[_0x2296('0x31')]){throw new Error(util[_0x2296('0x2f')](_0x2296('0x32'),_0x288a5b[_0x2296('0x31')][_0x2296('0x33')]||JSON[_0x2296('0x34')](_0x288a5b['error'])));}return!![];});}function handleError(_0x53c2bf,_0x1987eb,_0x3fa4b2){return _0x53c2bf[_0x2296('0x35')](_0x1987eb||0x1f4)[_0x2296('0x36')]({'message':_0x3fa4b2?_0x3fa4b2['message']||_0x3fa4b2:''});}exports['login']=function(_0x158cd8,_0x50637c,_0x26ac06){passport[_0x2296('0x18')](_0x2296('0x37'),function(_0x469f6a,_0x5d1728,_0xc1415b){var _0x6b85a5=_0x469f6a||_0xc1415b;if(_0x6b85a5){return handleError(_0x50637c,0x191,_0x6b85a5);}if(!_0x5d1728){return handleError(_0x50637c,0x194,{'message':_0x2296('0x38')});}else{var _0x5abdea={'payload':{'id':_0x5d1728['id'],'role':_0x5d1728[_0x2296('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x2296('0x39')](_0x5abdea)['then'](function(_0x15f5b9){_0x50637c['json']({'id':_0x5d1728['id'],'token':_0x15f5b9,'statusCall':'','isAlreadyLogged':_0x5d1728[_0x2296('0x3a')]});});}})(_0x158cd8,_0x50637c,_0x26ac06);};exports[_0x2296('0x3b')]=function(_0x3232de,_0x5e6963,_0x49e61d){if(!_0x3232de[_0x2296('0x3c')][_0x2296('0x23')]){return handleError(_0x5e6963,0x1f4,{'message':_0x2296('0x3d')});}var _0x458171=rs[_0x2296('0x3e')]();_0x3232de[_0x2296('0x3c')]['email']=_0x3232de[_0x2296('0x3c')]['email'][_0x2296('0x3f')]()[_0x2296('0x40')]();var _0x4d9824;return db[_0x2296('0xa')][_0x2296('0xb')]({'where':{'id':0x1},'attributes':[_0x2296('0xc'),_0x2296('0x19')],'raw':!![]})[_0x2296('0x17')](function(_0x398a02){_0x4d9824=_0x398a02;return db[_0x2296('0x41')][_0x2296('0x21')]({'where':{'email':_0x3232de['body'][_0x2296('0x23')]}});})[_0x2296('0x17')](function(_0x510a4d){if(!_0x510a4d){throw new Error(_0x2296('0x42'));}if(_0x510a4d[_0x2296('0x10')]){throw new Error(_0x2296('0x43'));}if(_0x510a4d[_0x2296('0x11')]){if(moment(_0x510a4d['blockedAt'])[_0x2296('0x1a')](_0x4d9824[_0x2296('0x19')],'minutes')>moment()){throw new Error(_0x2296('0x44'));}else{_0x510a4d[_0x2296('0x11')]=![];_0x510a4d['blockedAt']=null;}}_0x510a4d['resetPasswordToken']=_0x458171;_0x510a4d['resetPasswordExpires']=Date[_0x2296('0x45')]()+0x36ee80;return _0x510a4d['save']();})[_0x2296('0x17')](function(){return sendServiceMail({'to':_0x3232de[_0x2296('0x3c')][_0x2296('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x2296('0x46')+_0x2296('0x47')+_0x2296('0x48')+_0x3232de['headers'][_0x2296('0x28')]+'/reset/'+_0x458171+'\x0a\x0a'+_0x2296('0x49')});})[_0x2296('0x17')](function(){_0x5e6963[_0x2296('0x35')](0xc8)[_0x2296('0x36')]({'message':_0x2296('0x4a')});})[_0x2296('0x1f')](function(_0x54b39a){return handleError(_0x5e6963,0x1f4,_0x54b39a);});};exports['reset']=function(_0x59b8f0,_0x51d556,_0x403e88){return db[_0x2296('0x41')][_0x2296('0x21')]({'where':{'resetPasswordToken':_0x59b8f0[_0x2296('0x4b')][_0x2296('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x38ca7e){if(!_0x38ca7e){throw new Error(_0x2296('0x4d'));}return db[_0x2296('0xa')]['findOne']({'attributes':['id','securePassword',_0x2296('0x4e'),_0x2296('0x4f')]})[_0x2296('0x17')](function(_0x24dc02){if(_0x24dc02[_0x2296('0x50')])authService['validatePasswordPattern'](_0x59b8f0[_0x2296('0x3c')]['password']);if(!_0x24dc02[_0x2296('0x4e')]||!_0x38ca7e[_0x2296('0x51')])return _0x38ca7e;authService[_0x2296('0x52')](_0x59b8f0[_0x2296('0x3c')][_0x2296('0xd')],_0x38ca7e[_0x2296('0x51')],_0x24dc02[_0x2296('0x4f')]);return _0x38ca7e;})[_0x2296('0x17')](function(){_0x38ca7e[_0x2296('0xd')]=_0x59b8f0[_0x2296('0x3c')][_0x2296('0xd')];_0x38ca7e[_0x2296('0x53')]=null;_0x38ca7e[_0x2296('0x54')]=null;return _0x38ca7e[_0x2296('0x55')]();});})[_0x2296('0x17')](function(){_0x51d556[_0x2296('0x35')](0xc8)['send']({'message':_0x2296('0x56')});})[_0x2296('0x1f')](function(_0x14caca){return handleError(_0x51d556,0x1f4,_0x14caca);});};passport[_0x2296('0x57')](new LocalStrategy({'usernameField':_0x2296('0x22'),'passwordField':_0x2296('0xd')},function(_0x36b5d3,_0x4f4595,_0x3d75c4){return localAuthenticate(db[_0x2296('0x41')],_0x36b5d3,_0x4f4595,_0x3d75c4);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 1c92206..ce8ea3d 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 _0xfd62=['post','/forgot','forgot','express','login'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xfd62,0x16b));var _0x2fd6=function(_0x1cf1e2,_0x4c28af){_0x1cf1e2=_0x1cf1e2-0x0;var _0x207ab9=_0xfd62[_0x1cf1e2];return _0x207ab9;};'use strict';var express=require(_0x2fd6('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x2fd6('0x1')]);router[_0x2fd6('0x2')](_0x2fd6('0x3'),controller[_0x2fd6('0x4')]);router[_0x2fd6('0x2')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0x3fff=['express','Router','./authLocal.controller','post','login','forgot','/reset/:token','reset'];(function(_0x3ebff7,_0x31cd5b){var _0x4eac05=function(_0x2e7695){while(--_0x2e7695){_0x3ebff7['push'](_0x3ebff7['shift']());}};_0x4eac05(++_0x31cd5b);}(_0x3fff,0xa8));var _0xf3ff=function(_0x319877,_0x53a027){_0x319877=_0x319877-0x0;var _0x24056d=_0x3fff[_0x319877];return _0x24056d;};'use strict';var express=require(_0xf3ff('0x0'));var router=express[_0xf3ff('0x1')]();var controller=require(_0xf3ff('0x2'));router[_0xf3ff('0x3')]('/',controller[_0xf3ff('0x4')]);router[_0xf3ff('0x3')]('/forgot',controller[_0xf3ff('0x5')]);router['post'](_0xf3ff('0x6'),controller[_0xf3ff('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index f2f2959..d5db5d7 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 _0x9143=['sequelize','exports','STRING'];(function(_0x5d4ca7,_0x19113b){var _0x3efc03=function(_0x59675b){while(--_0x59675b){_0x5d4ca7['push'](_0x5d4ca7['shift']());}};_0x3efc03(++_0x19113b);}(_0x9143,0x1a1));var _0x3914=function(_0xa326bb,_0x3682db){_0xa326bb=_0xa326bb-0x0;var _0x624f88=_0x9143[_0xa326bb];return _0x624f88;};'use strict';var Sequelize=require(_0x3914('0x0'));module[_0x3914('0x1')]={'name':{'type':Sequelize[_0x3914('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x95ae=['STRING','INTEGER','sequelize'];(function(_0x11f2f9,_0x24152b){var _0x226d6b=function(_0x2c196b){while(--_0x2c196b){_0x11f2f9['push'](_0x11f2f9['shift']());}};_0x226d6b(++_0x24152b);}(_0x95ae,0x13a));var _0xe95a=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x95ae[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0xe95a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe95a('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe95a('0x2')],'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 2d800dd..5c63d7e 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 _0xc4c6=['eml-format','rimraf','zip-dir','moment','mustache','util','path','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','find','create','body','Condition','addConditions','omit','ids','getConditions','findOne','nolimit','addActions','Action','getActions'];(function(_0x4da4ea,_0x2875d3){var _0x3cc102=function(_0x5549c2){while(--_0x5549c2){_0x4da4ea['push'](_0x4da4ea['shift']());}};_0x3cc102(++_0x2875d3);}(_0xc4c6,0x195));var _0x6c4c=function(_0x2551ad,_0x4d67c){_0x2551ad=_0x2551ad-0x0;var _0x522738=_0xc4c6[_0x2551ad];return _0x522738;};'use strict';var emlformat=require(_0x6c4c('0x0'));var rimraf=require(_0x6c4c('0x1'));var zipdir=require(_0x6c4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c4c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c4c('0x4'));var util=require(_0x6c4c('0x5'));var path=require(_0x6c4c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c4c('0x7'));var squel=require(_0x6c4c('0x8'));var crypto=require(_0x6c4c('0x9'));var jsforce=require(_0x6c4c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6c4c('0xb'));var querystring=require(_0x6c4c('0xc'));var Papa=require(_0x6c4c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c4c('0xe'));var as=require(_0x6c4c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c4c('0x10'))(_0x6c4c('0x11'));var utils=require(_0x6c4c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6c4c('0x13'));var db=require(_0x6c4c('0x14'))['db'];function respondWithStatusCode(_0x58a081,_0x5b28d4){_0x5b28d4=_0x5b28d4||0xcc;return function(_0x26a3af){if(_0x26a3af){return _0x58a081[_0x6c4c('0x15')](_0x5b28d4);}return _0x58a081[_0x6c4c('0x16')](_0x5b28d4)[_0x6c4c('0x17')]();};}function respondWithResult(_0x2867f5,_0x1542ad){_0x1542ad=_0x1542ad||0xc8;return function(_0x111ce1){if(_0x111ce1){return _0x2867f5[_0x6c4c('0x16')](_0x1542ad)[_0x6c4c('0x18')](_0x111ce1);}};}function respondWithFilteredResult(_0x16ab0e,_0x4dd4f7){return function(_0x2a233b){if(_0x2a233b){var _0x18dbc9=typeof _0x4dd4f7[_0x6c4c('0x19')]===_0x6c4c('0x1a')&&typeof _0x4dd4f7['limit']==='undefined';var _0x27aec0=_0x2a233b[_0x6c4c('0x1b')];var _0x32337e=_0x18dbc9?0x0:_0x4dd4f7[_0x6c4c('0x19')];var _0x42194d=_0x18dbc9?_0x2a233b[_0x6c4c('0x1b')]:_0x4dd4f7['offset']+_0x4dd4f7[_0x6c4c('0x1c')];var _0x4fa58d;if(_0x42194d>=_0x27aec0){_0x42194d=_0x27aec0;_0x4fa58d=0xc8;}else{_0x4fa58d=0xce;}_0x16ab0e[_0x6c4c('0x16')](_0x4fa58d);return _0x16ab0e[_0x6c4c('0x1d')](_0x6c4c('0x1e'),_0x32337e+'-'+_0x42194d+'/'+_0x27aec0)[_0x6c4c('0x18')](_0x2a233b);}return null;};}function patchUpdates(_0xf060cb){return function(_0x5999b0){try{jsonpatch[_0x6c4c('0x1f')](_0x5999b0,_0xf060cb,!![]);}catch(_0x23508b){return BPromise[_0x6c4c('0x20')](_0x23508b);}return _0x5999b0[_0x6c4c('0x21')]();};}function saveUpdates(_0x17b402,_0x4a415f){return function(_0x357c7d){if(_0x357c7d){return _0x357c7d[_0x6c4c('0x22')](_0x17b402)[_0x6c4c('0x23')](function(_0x3538cb){return _0x3538cb;});}return null;};}function removeEntity(_0x209b2e,_0x49098b){return function(_0x4e2a31){if(_0x4e2a31){return _0x4e2a31[_0x6c4c('0x24')]()['then'](function(){_0x209b2e[_0x6c4c('0x16')](0xcc)[_0x6c4c('0x17')]();});}};}function handleEntityNotFound(_0x68e88a,_0x221c34){return function(_0x2cb259){if(!_0x2cb259){_0x68e88a[_0x6c4c('0x15')](0x194);}return _0x2cb259;};}function handleError(_0x14294a,_0xc815bc){_0xc815bc=_0xc815bc||0x1f4;return function(_0x2794b7){logger['error'](_0x2794b7[_0x6c4c('0x25')]);if(_0x2794b7[_0x6c4c('0x26')]){delete _0x2794b7[_0x6c4c('0x26')];}_0x14294a['status'](_0xc815bc)[_0x6c4c('0x27')](_0x2794b7);};}exports[_0x6c4c('0x28')]=function(_0x904663,_0x1886d9){var _0x4743f9={},_0x1b36bf={},_0xc41203={'count':0x0,'rows':[]};var _0xb25257=_[_0x6c4c('0x29')](db[_0x6c4c('0x2a')][_0x6c4c('0x2b')],function(_0xb02a20){return{'name':_0xb02a20['fieldName'],'type':_0xb02a20[_0x6c4c('0x2c')][_0x6c4c('0x2d')]};});_0x1b36bf[_0x6c4c('0x2e')]=_[_0x6c4c('0x29')](_0xb25257,_0x6c4c('0x26'));_0x1b36bf['query']=_[_0x6c4c('0x2f')](_0x904663[_0x6c4c('0x30')]);_0x1b36bf['filters']=_[_0x6c4c('0x31')](_0x1b36bf['model'],_0x1b36bf[_0x6c4c('0x30')]);_0x4743f9[_0x6c4c('0x32')]=_[_0x6c4c('0x31')](_0x1b36bf['model'],qs[_0x6c4c('0x33')](_0x904663[_0x6c4c('0x30')]['fields']));_0x4743f9[_0x6c4c('0x32')]=_0x4743f9[_0x6c4c('0x32')][_0x6c4c('0x34')]?_0x4743f9[_0x6c4c('0x32')]:_0x1b36bf[_0x6c4c('0x2e')];if(!_0x904663['query'][_0x6c4c('0x35')]('nolimit')){_0x4743f9['limit']=qs['limit'](_0x904663[_0x6c4c('0x30')][_0x6c4c('0x1c')]);_0x4743f9[_0x6c4c('0x19')]=qs[_0x6c4c('0x19')](_0x904663[_0x6c4c('0x30')][_0x6c4c('0x19')]);}_0x4743f9[_0x6c4c('0x36')]=qs[_0x6c4c('0x37')](_0x904663[_0x6c4c('0x30')]['sort']);_0x4743f9[_0x6c4c('0x38')]=qs['filters'](_[_0x6c4c('0x39')](_0x904663[_0x6c4c('0x30')],_0x1b36bf[_0x6c4c('0x3a')]),_0xb25257);if(_0x904663[_0x6c4c('0x30')][_0x6c4c('0x3b')]){_0x4743f9[_0x6c4c('0x38')]=_[_0x6c4c('0x3c')](_0x4743f9['where'],{'$or':_['map'](_0xb25257,function(_0x5d2295){if(_0x5d2295['type']!==_0x6c4c('0x3d')){var _0x4dfeda={};_0x4dfeda[_0x5d2295['name']]={'$like':'%'+_0x904663[_0x6c4c('0x30')][_0x6c4c('0x3b')]+'%'};return _0x4dfeda;}})});}_0x4743f9=_[_0x6c4c('0x3c')]({},_0x4743f9,_0x904663[_0x6c4c('0x3e')]);var _0x28340a={'where':_0x4743f9['where']};return db[_0x6c4c('0x2a')][_0x6c4c('0x1b')](_0x28340a)[_0x6c4c('0x23')](function(_0x484048){_0xc41203[_0x6c4c('0x1b')]=_0x484048;if(_0x904663[_0x6c4c('0x30')]['includeAll']){_0x4743f9[_0x6c4c('0x3f')]=[{'all':!![]}];}return db[_0x6c4c('0x2a')]['findAll'](_0x4743f9);})[_0x6c4c('0x23')](function(_0x434223){_0xc41203[_0x6c4c('0x40')]=_0x434223;return _0xc41203;})[_0x6c4c('0x23')](respondWithFilteredResult(_0x1886d9,_0x4743f9))[_0x6c4c('0x41')](handleError(_0x1886d9,null));};exports[_0x6c4c('0x42')]=function(_0x55f3bb,_0xaf7a44){var _0x127274={'raw':![],'where':{'id':_0x55f3bb[_0x6c4c('0x43')]['id']}},_0x4420c0={};_0x4420c0[_0x6c4c('0x2e')]=_[_0x6c4c('0x2f')](db[_0x6c4c('0x2a')][_0x6c4c('0x2b')]);_0x4420c0[_0x6c4c('0x30')]=_[_0x6c4c('0x2f')](_0x55f3bb[_0x6c4c('0x30')]);_0x4420c0[_0x6c4c('0x3a')]=_[_0x6c4c('0x31')](_0x4420c0[_0x6c4c('0x2e')],_0x4420c0[_0x6c4c('0x30')]);_0x127274['attributes']=_['intersection'](_0x4420c0[_0x6c4c('0x2e')],qs[_0x6c4c('0x33')](_0x55f3bb[_0x6c4c('0x30')]['fields']));_0x127274['attributes']=_0x127274[_0x6c4c('0x32')]['length']?_0x127274[_0x6c4c('0x32')]:_0x4420c0['model'];if(_0x55f3bb[_0x6c4c('0x30')]['includeAll']){_0x127274[_0x6c4c('0x3f')]=[{'all':!![]}];}_0x127274=_[_0x6c4c('0x3c')]({},_0x127274,_0x55f3bb[_0x6c4c('0x3e')]);return db[_0x6c4c('0x2a')][_0x6c4c('0x44')](_0x127274)[_0x6c4c('0x23')](handleEntityNotFound(_0xaf7a44,null))[_0x6c4c('0x23')](respondWithResult(_0xaf7a44,null))[_0x6c4c('0x41')](handleError(_0xaf7a44,null));};exports[_0x6c4c('0x45')]=function(_0x1a7793,_0x1b69cf){return db[_0x6c4c('0x2a')]['create'](_0x1a7793['body'],{})[_0x6c4c('0x23')](respondWithResult(_0x1b69cf,0xc9))['catch'](handleError(_0x1b69cf,null));};exports[_0x6c4c('0x22')]=function(_0x55d6d2,_0x469b3a){if(_0x55d6d2[_0x6c4c('0x46')]['id']){delete _0x55d6d2[_0x6c4c('0x46')]['id'];}return db[_0x6c4c('0x2a')][_0x6c4c('0x44')]({'where':{'id':_0x55d6d2['params']['id']}})[_0x6c4c('0x23')](handleEntityNotFound(_0x469b3a,null))[_0x6c4c('0x23')](saveUpdates(_0x55d6d2[_0x6c4c('0x46')],null))['then'](respondWithResult(_0x469b3a,null))['catch'](handleError(_0x469b3a,null));};exports[_0x6c4c('0x24')]=function(_0x3e01ab,_0x1d5fdc){return db[_0x6c4c('0x2a')][_0x6c4c('0x44')]({'where':{'id':_0x3e01ab['params']['id']}})[_0x6c4c('0x23')](handleEntityNotFound(_0x1d5fdc,null))[_0x6c4c('0x23')](removeEntity(_0x1d5fdc,null))[_0x6c4c('0x41')](handleError(_0x1d5fdc,null));};exports['addConditions']=function(_0x2efd2a,_0x4a15b0,_0x227117){return db[_0x6c4c('0x47')][_0x6c4c('0x44')]({'where':{'id':_0x2efd2a[_0x6c4c('0x43')]['id']}})[_0x6c4c('0x23')](handleEntityNotFound(_0x4a15b0,null))['then'](function(_0x49e7f2){if(_0x49e7f2){return _0x49e7f2[_0x6c4c('0x48')](_0x2efd2a[_0x6c4c('0x46')]['ids'],_[_0x6c4c('0x49')](_0x2efd2a[_0x6c4c('0x46')],[_0x6c4c('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x4a15b0,null))[_0x6c4c('0x41')](handleError(_0x4a15b0,null));};exports[_0x6c4c('0x4b')]=function(_0x58fe91,_0x43465b,_0x2515b6){var _0x4cb294={};var _0x32ac08={};var _0xc88255;var _0x3534c7;return db[_0x6c4c('0x2a')][_0x6c4c('0x4c')]({'where':{'id':_0x58fe91[_0x6c4c('0x43')]['id']}})[_0x6c4c('0x23')](handleEntityNotFound(_0x43465b,null))['then'](function(_0x9d1cdd){if(_0x9d1cdd){_0xc88255=_0x9d1cdd;_0x32ac08['model']=_[_0x6c4c('0x2f')](db[_0x6c4c('0x47')][_0x6c4c('0x2b')]);_0x32ac08[_0x6c4c('0x30')]=_[_0x6c4c('0x2f')](_0x58fe91[_0x6c4c('0x30')]);_0x32ac08[_0x6c4c('0x3a')]=_[_0x6c4c('0x31')](_0x32ac08['model'],_0x32ac08[_0x6c4c('0x30')]);_0x4cb294[_0x6c4c('0x32')]=_[_0x6c4c('0x31')](_0x32ac08[_0x6c4c('0x2e')],qs['fields'](_0x58fe91[_0x6c4c('0x30')]['fields']));_0x4cb294[_0x6c4c('0x32')]=_0x4cb294[_0x6c4c('0x32')]['length']?_0x4cb294[_0x6c4c('0x32')]:_0x32ac08['model'];_0x4cb294['order']=qs[_0x6c4c('0x37')](_0x58fe91[_0x6c4c('0x30')][_0x6c4c('0x37')]);_0x4cb294[_0x6c4c('0x38')]=qs[_0x6c4c('0x3a')](_[_0x6c4c('0x39')](_0x58fe91[_0x6c4c('0x30')],_0x32ac08['filters']));if(_0x58fe91[_0x6c4c('0x30')][_0x6c4c('0x3b')]){_0x4cb294['where']=_[_0x6c4c('0x3c')](_0x4cb294['where'],{'$or':_[_0x6c4c('0x29')](_0x4cb294[_0x6c4c('0x32')],function(_0x403825){var _0x5c63b6={};_0x5c63b6[_0x403825]={'$like':'%'+_0x58fe91['query'][_0x6c4c('0x3b')]+'%'};return _0x5c63b6;})});}_0x4cb294=_['merge']({},_0x4cb294,_0x58fe91['options']);return _0xc88255[_0x6c4c('0x4b')](_0x4cb294);}})['then'](function(_0x465b41){if(_0x465b41){_0x3534c7=_0x465b41[_0x6c4c('0x34')];if(!_0x58fe91[_0x6c4c('0x30')]['hasOwnProperty'](_0x6c4c('0x4d'))){_0x4cb294[_0x6c4c('0x1c')]=qs[_0x6c4c('0x1c')](_0x58fe91[_0x6c4c('0x30')][_0x6c4c('0x1c')]);_0x4cb294['offset']=qs[_0x6c4c('0x19')](_0x58fe91['query'][_0x6c4c('0x19')]);}return _0xc88255[_0x6c4c('0x4b')](_0x4cb294);}})[_0x6c4c('0x23')](function(_0x5e75f2){if(_0x5e75f2){return _0x5e75f2?{'count':_0x3534c7,'rows':_0x5e75f2}:null;}})['then'](respondWithResult(_0x43465b,null))[_0x6c4c('0x41')](handleError(_0x43465b,null));};exports[_0x6c4c('0x4e')]=function(_0x20f537,_0x58abd0,_0x480d79){return db['Action'][_0x6c4c('0x44')]({'where':{'id':_0x20f537['params']['id']}})[_0x6c4c('0x23')](handleEntityNotFound(_0x58abd0,null))[_0x6c4c('0x23')](function(_0x3b21ed){if(_0x3b21ed){return _0x3b21ed[_0x6c4c('0x4e')](_0x20f537['body']['ids'],_['omit'](_0x20f537['body'],[_0x6c4c('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x58abd0,null))['catch'](handleError(_0x58abd0,null));};exports['getActions']=function(_0x1a8226,_0x40d091,_0x49f85a){var _0x52327a={};var _0x1cc734={};var _0xe1a49c;var _0x10cda0;return db[_0x6c4c('0x2a')][_0x6c4c('0x4c')]({'where':{'id':_0x1a8226[_0x6c4c('0x43')]['id']}})['then'](handleEntityNotFound(_0x40d091,null))['then'](function(_0x344ee2){if(_0x344ee2){_0xe1a49c=_0x344ee2;_0x1cc734['model']=_[_0x6c4c('0x2f')](db[_0x6c4c('0x4f')][_0x6c4c('0x2b')]);_0x1cc734['query']=_[_0x6c4c('0x2f')](_0x1a8226[_0x6c4c('0x30')]);_0x1cc734[_0x6c4c('0x3a')]=_[_0x6c4c('0x31')](_0x1cc734[_0x6c4c('0x2e')],_0x1cc734[_0x6c4c('0x30')]);_0x52327a[_0x6c4c('0x32')]=_[_0x6c4c('0x31')](_0x1cc734['model'],qs[_0x6c4c('0x33')](_0x1a8226[_0x6c4c('0x30')]['fields']));_0x52327a[_0x6c4c('0x32')]=_0x52327a['attributes'][_0x6c4c('0x34')]?_0x52327a['attributes']:_0x1cc734['model'];_0x52327a['order']=qs[_0x6c4c('0x37')](_0x1a8226['query']['sort']);_0x52327a[_0x6c4c('0x38')]=qs[_0x6c4c('0x3a')](_[_0x6c4c('0x39')](_0x1a8226[_0x6c4c('0x30')],_0x1cc734[_0x6c4c('0x3a')]));if(_0x1a8226[_0x6c4c('0x30')][_0x6c4c('0x3b')]){_0x52327a['where']=_[_0x6c4c('0x3c')](_0x52327a[_0x6c4c('0x38')],{'$or':_['map'](_0x52327a['attributes'],function(_0x1ee907){var _0x4573e2={};_0x4573e2[_0x1ee907]={'$like':'%'+_0x1a8226[_0x6c4c('0x30')][_0x6c4c('0x3b')]+'%'};return _0x4573e2;})});}_0x52327a=_[_0x6c4c('0x3c')]({},_0x52327a,_0x1a8226['options']);return _0xe1a49c[_0x6c4c('0x50')](_0x52327a);}})[_0x6c4c('0x23')](function(_0x3b8a2a){if(_0x3b8a2a){_0x10cda0=_0x3b8a2a[_0x6c4c('0x34')];if(!_0x1a8226[_0x6c4c('0x30')][_0x6c4c('0x35')](_0x6c4c('0x4d'))){_0x52327a[_0x6c4c('0x1c')]=qs[_0x6c4c('0x1c')](_0x1a8226[_0x6c4c('0x30')][_0x6c4c('0x1c')]);_0x52327a[_0x6c4c('0x19')]=qs[_0x6c4c('0x19')](_0x1a8226[_0x6c4c('0x30')][_0x6c4c('0x19')]);}return _0xe1a49c['getActions'](_0x52327a);}})[_0x6c4c('0x23')](function(_0x1b936c){if(_0x1b936c){return _0x1b936c?{'count':_0x10cda0,'rows':_0x1b936c}:null;}})['then'](respondWithResult(_0x40d091,null))[_0x6c4c('0x41')](handleError(_0x40d091,null));};
\ No newline at end of file
+var _0x9b92=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','Automation','addConditions','Condition','ids','omit','getConditions','findOne','order','Action','addActions','getActions'];(function(_0x4e38fb,_0x414e16){var _0x2b864d=function(_0x33de45){while(--_0x33de45){_0x4e38fb['push'](_0x4e38fb['shift']());}};_0x2b864d(++_0x414e16);}(_0x9b92,0x1ae));var _0x29b9=function(_0x16b53b,_0x245533){_0x16b53b=_0x16b53b-0x0;var _0x25c355=_0x9b92[_0x16b53b];return _0x25c355;};'use strict';var emlformat=require(_0x29b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29b9('0x1'));var jsonpatch=require(_0x29b9('0x2'));var rp=require(_0x29b9('0x3'));var moment=require(_0x29b9('0x4'));var BPromise=require(_0x29b9('0x5'));var Mustache=require(_0x29b9('0x6'));var util=require(_0x29b9('0x7'));var path=require('path');var sox=require(_0x29b9('0x8'));var csv=require(_0x29b9('0x9'));var ejs=require(_0x29b9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x29b9('0xb'));var squel=require('squel');var crypto=require(_0x29b9('0xc'));var jsforce=require(_0x29b9('0xd'));var deskjs=require(_0x29b9('0xe'));var toCsv=require(_0x29b9('0x9'));var querystring=require(_0x29b9('0xf'));var Papa=require(_0x29b9('0x10'));var Redis=require(_0x29b9('0x11'));var authService=require(_0x29b9('0x12'));var qs=require(_0x29b9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29b9('0x14'));var logger=require(_0x29b9('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x29b9('0x16'));var licenseUtil=require(_0x29b9('0x17'));var db=require(_0x29b9('0x18'))['db'];function respondWithStatusCode(_0x4b12ba,_0x5a3224){_0x5a3224=_0x5a3224||0xcc;return function(_0x426878){if(_0x426878){return _0x4b12ba['sendStatus'](_0x5a3224);}return _0x4b12ba['status'](_0x5a3224)[_0x29b9('0x19')]();};}function respondWithResult(_0x9287b0,_0x48bd7f){_0x48bd7f=_0x48bd7f||0xc8;return function(_0x58e1e4){if(_0x58e1e4){return _0x9287b0[_0x29b9('0x1a')](_0x48bd7f)['json'](_0x58e1e4);}};}function respondWithFilteredResult(_0x34360b,_0x327a7f){return function(_0x52784d){if(_0x52784d){var _0x11316a=typeof _0x327a7f['offset']===_0x29b9('0x1b')&&typeof _0x327a7f[_0x29b9('0x1c')]===_0x29b9('0x1b');var _0x20041c=_0x52784d[_0x29b9('0x1d')];var _0x341cb9=_0x11316a?0x0:_0x327a7f[_0x29b9('0x1e')];var _0x3711a0=_0x11316a?_0x52784d[_0x29b9('0x1d')]:_0x327a7f[_0x29b9('0x1e')]+_0x327a7f['limit'];var _0x4bd2d8;if(_0x3711a0>=_0x20041c){_0x3711a0=_0x20041c;_0x4bd2d8=0xc8;}else{_0x4bd2d8=0xce;}_0x34360b[_0x29b9('0x1a')](_0x4bd2d8);return _0x34360b[_0x29b9('0x1f')](_0x29b9('0x20'),_0x341cb9+'-'+_0x3711a0+'/'+_0x20041c)[_0x29b9('0x21')](_0x52784d);}return null;};}function patchUpdates(_0x1a6938){return function(_0x26533a){try{jsonpatch[_0x29b9('0x22')](_0x26533a,_0x1a6938,!![]);}catch(_0x192a37){return BPromise[_0x29b9('0x23')](_0x192a37);}return _0x26533a[_0x29b9('0x24')]();};}function saveUpdates(_0x174e5c,_0x11bd76){return function(_0x22994d){if(_0x22994d){return _0x22994d[_0x29b9('0x25')](_0x174e5c)[_0x29b9('0x26')](function(_0x183b30){return _0x183b30;});}return null;};}function removeEntity(_0x1fab48,_0x503396){return function(_0x22b1b6){if(_0x22b1b6){return _0x22b1b6[_0x29b9('0x27')]()[_0x29b9('0x26')](function(){_0x1fab48[_0x29b9('0x1a')](0xcc)[_0x29b9('0x19')]();});}};}function handleEntityNotFound(_0x1919dc,_0x172ad4){return function(_0x1d7b09){if(!_0x1d7b09){_0x1919dc[_0x29b9('0x28')](0x194);}return _0x1d7b09;};}function handleError(_0x2fea69,_0x36762d){_0x36762d=_0x36762d||0x1f4;return function(_0x5cc163){logger[_0x29b9('0x29')](_0x5cc163[_0x29b9('0x2a')]);if(_0x5cc163['name']){delete _0x5cc163[_0x29b9('0x2b')];}_0x2fea69[_0x29b9('0x1a')](_0x36762d)['send'](_0x5cc163);};}exports[_0x29b9('0x2c')]=function(_0x2a1616,_0x56db4e){var _0x571195={},_0x43e83c={},_0x5258a9={'count':0x0,'rows':[]};var _0xb7c3bf=_[_0x29b9('0x2d')](db['Automation'][_0x29b9('0x2e')],function(_0x35b482){return{'name':_0x35b482[_0x29b9('0x2f')],'type':_0x35b482[_0x29b9('0x30')]['key']};});_0x43e83c[_0x29b9('0x31')]=_[_0x29b9('0x2d')](_0xb7c3bf,_0x29b9('0x2b'));_0x43e83c[_0x29b9('0x32')]=_[_0x29b9('0x33')](_0x2a1616[_0x29b9('0x32')]);_0x43e83c['filters']=_[_0x29b9('0x34')](_0x43e83c[_0x29b9('0x31')],_0x43e83c[_0x29b9('0x32')]);_0x571195['attributes']=_['intersection'](_0x43e83c[_0x29b9('0x31')],qs[_0x29b9('0x35')](_0x2a1616['query'][_0x29b9('0x35')]));_0x571195[_0x29b9('0x36')]=_0x571195[_0x29b9('0x36')][_0x29b9('0x37')]?_0x571195[_0x29b9('0x36')]:_0x43e83c[_0x29b9('0x31')];if(!_0x2a1616[_0x29b9('0x32')][_0x29b9('0x38')](_0x29b9('0x39'))){_0x571195['limit']=qs[_0x29b9('0x1c')](_0x2a1616[_0x29b9('0x32')][_0x29b9('0x1c')]);_0x571195[_0x29b9('0x1e')]=qs[_0x29b9('0x1e')](_0x2a1616[_0x29b9('0x32')][_0x29b9('0x1e')]);}_0x571195['order']=qs[_0x29b9('0x3a')](_0x2a1616['query'][_0x29b9('0x3a')]);_0x571195[_0x29b9('0x3b')]=qs['filters'](_[_0x29b9('0x3c')](_0x2a1616['query'],_0x43e83c[_0x29b9('0x3d')]),_0xb7c3bf);if(_0x2a1616['query'][_0x29b9('0x3e')]){_0x571195[_0x29b9('0x3b')]=_['merge'](_0x571195[_0x29b9('0x3b')],{'$or':_[_0x29b9('0x2d')](_0xb7c3bf,function(_0x521376){if(_0x521376['type']!==_0x29b9('0x3f')){var _0x147eca={};_0x147eca[_0x521376[_0x29b9('0x2b')]]={'$like':'%'+_0x2a1616['query'][_0x29b9('0x3e')]+'%'};return _0x147eca;}})});}_0x571195=_[_0x29b9('0x40')]({},_0x571195,_0x2a1616[_0x29b9('0x41')]);var _0x50ab24={'where':_0x571195[_0x29b9('0x3b')]};return db['Automation'][_0x29b9('0x1d')](_0x50ab24)[_0x29b9('0x26')](function(_0x377a4a){_0x5258a9[_0x29b9('0x1d')]=_0x377a4a;if(_0x2a1616[_0x29b9('0x32')][_0x29b9('0x42')]){_0x571195[_0x29b9('0x43')]=[{'all':!![]}];}return db['Automation'][_0x29b9('0x44')](_0x571195);})[_0x29b9('0x26')](function(_0x3d9d06){_0x5258a9['rows']=_0x3d9d06;return _0x5258a9;})[_0x29b9('0x26')](respondWithFilteredResult(_0x56db4e,_0x571195))[_0x29b9('0x45')](handleError(_0x56db4e,null));};exports[_0x29b9('0x46')]=function(_0x46046a,_0x542fce){var _0x49ad49={'raw':![],'where':{'id':_0x46046a[_0x29b9('0x47')]['id']}},_0x2696e9={};_0x2696e9[_0x29b9('0x31')]=_[_0x29b9('0x33')](db['Automation'][_0x29b9('0x2e')]);_0x2696e9['query']=_[_0x29b9('0x33')](_0x46046a[_0x29b9('0x32')]);_0x2696e9[_0x29b9('0x3d')]=_[_0x29b9('0x34')](_0x2696e9[_0x29b9('0x31')],_0x2696e9[_0x29b9('0x32')]);_0x49ad49[_0x29b9('0x36')]=_['intersection'](_0x2696e9[_0x29b9('0x31')],qs['fields'](_0x46046a[_0x29b9('0x32')]['fields']));_0x49ad49[_0x29b9('0x36')]=_0x49ad49[_0x29b9('0x36')]['length']?_0x49ad49[_0x29b9('0x36')]:_0x2696e9[_0x29b9('0x31')];if(_0x46046a['query'][_0x29b9('0x42')]){_0x49ad49[_0x29b9('0x43')]=[{'all':!![]}];}_0x49ad49=_[_0x29b9('0x40')]({},_0x49ad49,_0x46046a[_0x29b9('0x41')]);return db['Automation'][_0x29b9('0x48')](_0x49ad49)[_0x29b9('0x26')](handleEntityNotFound(_0x542fce,null))[_0x29b9('0x26')](respondWithResult(_0x542fce,null))['catch'](handleError(_0x542fce,null));};exports[_0x29b9('0x49')]=function(_0x130cf4,_0x3cfcd1){return db['Automation']['create'](_0x130cf4[_0x29b9('0x4a')],{})[_0x29b9('0x26')](respondWithResult(_0x3cfcd1,0xc9))[_0x29b9('0x45')](handleError(_0x3cfcd1,null));};exports['update']=function(_0x208878,_0x1ce056){if(_0x208878['body']['id']){delete _0x208878[_0x29b9('0x4a')]['id'];}return db[_0x29b9('0x4b')]['find']({'where':{'id':_0x208878[_0x29b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ce056,null))[_0x29b9('0x26')](saveUpdates(_0x208878[_0x29b9('0x4a')],null))[_0x29b9('0x26')](respondWithResult(_0x1ce056,null))[_0x29b9('0x45')](handleError(_0x1ce056,null));};exports['destroy']=function(_0x2c35f2,_0x2afff1){return db[_0x29b9('0x4b')][_0x29b9('0x48')]({'where':{'id':_0x2c35f2[_0x29b9('0x47')]['id']}})[_0x29b9('0x26')](handleEntityNotFound(_0x2afff1,null))['then'](removeEntity(_0x2afff1,null))[_0x29b9('0x45')](handleError(_0x2afff1,null));};exports[_0x29b9('0x4c')]=function(_0x176996,_0x568c82,_0x4f87d6){return db[_0x29b9('0x4d')]['find']({'where':{'id':_0x176996[_0x29b9('0x47')]['id']}})[_0x29b9('0x26')](handleEntityNotFound(_0x568c82,null))[_0x29b9('0x26')](function(_0x17ed40){if(_0x17ed40){return _0x17ed40['addConditions'](_0x176996[_0x29b9('0x4a')][_0x29b9('0x4e')],_[_0x29b9('0x4f')](_0x176996['body'],[_0x29b9('0x4e'),'id'])||{});}})[_0x29b9('0x26')](respondWithResult(_0x568c82,null))[_0x29b9('0x45')](handleError(_0x568c82,null));};exports[_0x29b9('0x50')]=function(_0xd4b3ac,_0x39873e,_0x56fdf9){var _0x56e3ec={};var _0x5e9583={};var _0x4d3d93;var _0x38f6e3;return db[_0x29b9('0x4b')][_0x29b9('0x51')]({'where':{'id':_0xd4b3ac[_0x29b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x39873e,null))['then'](function(_0x100953){if(_0x100953){_0x4d3d93=_0x100953;_0x5e9583[_0x29b9('0x31')]=_['keys'](db['Condition'][_0x29b9('0x2e')]);_0x5e9583[_0x29b9('0x32')]=_[_0x29b9('0x33')](_0xd4b3ac['query']);_0x5e9583[_0x29b9('0x3d')]=_['intersection'](_0x5e9583[_0x29b9('0x31')],_0x5e9583[_0x29b9('0x32')]);_0x56e3ec[_0x29b9('0x36')]=_[_0x29b9('0x34')](_0x5e9583['model'],qs[_0x29b9('0x35')](_0xd4b3ac[_0x29b9('0x32')]['fields']));_0x56e3ec[_0x29b9('0x36')]=_0x56e3ec[_0x29b9('0x36')]['length']?_0x56e3ec[_0x29b9('0x36')]:_0x5e9583[_0x29b9('0x31')];_0x56e3ec[_0x29b9('0x52')]=qs['sort'](_0xd4b3ac[_0x29b9('0x32')]['sort']);_0x56e3ec[_0x29b9('0x3b')]=qs[_0x29b9('0x3d')](_[_0x29b9('0x3c')](_0xd4b3ac[_0x29b9('0x32')],_0x5e9583['filters']));if(_0xd4b3ac[_0x29b9('0x32')][_0x29b9('0x3e')]){_0x56e3ec[_0x29b9('0x3b')]=_[_0x29b9('0x40')](_0x56e3ec[_0x29b9('0x3b')],{'$or':_[_0x29b9('0x2d')](_0x56e3ec[_0x29b9('0x36')],function(_0x159ccd){var _0x3d8709={};_0x3d8709[_0x159ccd]={'$like':'%'+_0xd4b3ac[_0x29b9('0x32')]['filter']+'%'};return _0x3d8709;})});}_0x56e3ec=_[_0x29b9('0x40')]({},_0x56e3ec,_0xd4b3ac[_0x29b9('0x41')]);return _0x4d3d93[_0x29b9('0x50')](_0x56e3ec);}})['then'](function(_0x2113a3){if(_0x2113a3){_0x38f6e3=_0x2113a3['length'];if(!_0xd4b3ac[_0x29b9('0x32')][_0x29b9('0x38')]('nolimit')){_0x56e3ec[_0x29b9('0x1c')]=qs['limit'](_0xd4b3ac[_0x29b9('0x32')]['limit']);_0x56e3ec[_0x29b9('0x1e')]=qs[_0x29b9('0x1e')](_0xd4b3ac[_0x29b9('0x32')]['offset']);}return _0x4d3d93['getConditions'](_0x56e3ec);}})[_0x29b9('0x26')](function(_0x410620){if(_0x410620){return _0x410620?{'count':_0x38f6e3,'rows':_0x410620}:null;}})[_0x29b9('0x26')](respondWithResult(_0x39873e,null))[_0x29b9('0x45')](handleError(_0x39873e,null));};exports['addActions']=function(_0x517b6d,_0x142318,_0x517cb0){return db[_0x29b9('0x53')][_0x29b9('0x48')]({'where':{'id':_0x517b6d[_0x29b9('0x47')]['id']}})[_0x29b9('0x26')](handleEntityNotFound(_0x142318,null))[_0x29b9('0x26')](function(_0x7220b8){if(_0x7220b8){return _0x7220b8[_0x29b9('0x54')](_0x517b6d[_0x29b9('0x4a')][_0x29b9('0x4e')],_[_0x29b9('0x4f')](_0x517b6d[_0x29b9('0x4a')],[_0x29b9('0x4e'),'id'])||{});}})[_0x29b9('0x26')](respondWithResult(_0x142318,null))['catch'](handleError(_0x142318,null));};exports[_0x29b9('0x55')]=function(_0x3b31ba,_0x784976,_0x56fe3a){var _0x34292e={};var _0x266824={};var _0x24cad8;var _0x26eac6;return db['Automation']['findOne']({'where':{'id':_0x3b31ba[_0x29b9('0x47')]['id']}})[_0x29b9('0x26')](handleEntityNotFound(_0x784976,null))[_0x29b9('0x26')](function(_0x1ab7e6){if(_0x1ab7e6){_0x24cad8=_0x1ab7e6;_0x266824[_0x29b9('0x31')]=_[_0x29b9('0x33')](db['Action'][_0x29b9('0x2e')]);_0x266824[_0x29b9('0x32')]=_[_0x29b9('0x33')](_0x3b31ba[_0x29b9('0x32')]);_0x266824[_0x29b9('0x3d')]=_[_0x29b9('0x34')](_0x266824[_0x29b9('0x31')],_0x266824[_0x29b9('0x32')]);_0x34292e['attributes']=_[_0x29b9('0x34')](_0x266824[_0x29b9('0x31')],qs[_0x29b9('0x35')](_0x3b31ba[_0x29b9('0x32')][_0x29b9('0x35')]));_0x34292e['attributes']=_0x34292e[_0x29b9('0x36')][_0x29b9('0x37')]?_0x34292e[_0x29b9('0x36')]:_0x266824[_0x29b9('0x31')];_0x34292e[_0x29b9('0x52')]=qs['sort'](_0x3b31ba[_0x29b9('0x32')][_0x29b9('0x3a')]);_0x34292e[_0x29b9('0x3b')]=qs[_0x29b9('0x3d')](_[_0x29b9('0x3c')](_0x3b31ba[_0x29b9('0x32')],_0x266824[_0x29b9('0x3d')]));if(_0x3b31ba['query']['filter']){_0x34292e[_0x29b9('0x3b')]=_[_0x29b9('0x40')](_0x34292e['where'],{'$or':_[_0x29b9('0x2d')](_0x34292e[_0x29b9('0x36')],function(_0x31ed61){var _0x4f0a6a={};_0x4f0a6a[_0x31ed61]={'$like':'%'+_0x3b31ba['query']['filter']+'%'};return _0x4f0a6a;})});}_0x34292e=_['merge']({},_0x34292e,_0x3b31ba[_0x29b9('0x41')]);return _0x24cad8['getActions'](_0x34292e);}})[_0x29b9('0x26')](function(_0x596ec6){if(_0x596ec6){_0x26eac6=_0x596ec6['length'];if(!_0x3b31ba[_0x29b9('0x32')][_0x29b9('0x38')]('nolimit')){_0x34292e[_0x29b9('0x1c')]=qs[_0x29b9('0x1c')](_0x3b31ba[_0x29b9('0x32')][_0x29b9('0x1c')]);_0x34292e[_0x29b9('0x1e')]=qs['offset'](_0x3b31ba[_0x29b9('0x32')]['offset']);}return _0x24cad8[_0x29b9('0x55')](_0x34292e);}})[_0x29b9('0x26')](function(_0x5f07bd){if(_0x5f07bd){return _0x5f07bd?{'count':_0x26eac6,'rows':_0x5f07bd}:null;}})['then'](respondWithResult(_0x784976,null))[_0x29b9('0x45')](handleError(_0x784976,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e297af0..04463df 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 _0x0c36=['./automation.attributes','exports','define','Automation','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3968e2,_0x384b4f){var _0x14a327=function(_0x1956d6){while(--_0x1956d6){_0x3968e2['push'](_0x3968e2['shift']());}};_0x14a327(++_0x384b4f);}(_0x0c36,0x1f3));var _0x60c3=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x0c36[_0x2984d0];return _0x2885f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x60c3('0x0'))(_0x60c3('0x1'));var moment=require(_0x60c3('0x2'));var BPromise=require(_0x60c3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x60c3('0x4'));var rimraf=require(_0x60c3('0x5'));var config=require(_0x60c3('0x6'));var attributes=require(_0x60c3('0x7'));module[_0x60c3('0x8')]=function(_0x1d1a03,_0x28b8ba){return _0x1d1a03[_0x60c3('0x9')](_0x60c3('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66dc=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','../../config/logger','api','moment','bluebird'];(function(_0x5f2717,_0x4e6e4d){var _0x59abf3=function(_0x4ca208){while(--_0x4ca208){_0x5f2717['push'](_0x5f2717['shift']());}};_0x59abf3(++_0x4e6e4d);}(_0x66dc,0xe9));var _0xc66d=function(_0x5a6eeb,_0x2cff2c){_0x5a6eeb=_0x5a6eeb-0x0;var _0x324916=_0x66dc[_0x5a6eeb];return _0x324916;};'use strict';var _=require('lodash');var util=require(_0xc66d('0x0'));var logger=require(_0xc66d('0x1'))(_0xc66d('0x2'));var moment=require(_0xc66d('0x3'));var BPromise=require(_0xc66d('0x4'));var rp=require(_0xc66d('0x5'));var fs=require('fs');var path=require(_0xc66d('0x6'));var rimraf=require(_0xc66d('0x7'));var config=require(_0xc66d('0x8'));var attributes=require(_0xc66d('0x9'));module[_0xc66d('0xa')]=function(_0x5d83f1,_0x40393e){return _0x5d83f1[_0xc66d('0xb')](_0xc66d('0xc'),attributes,{'tableName':_0xc66d('0xd'),'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 2237a14..77f6a0e 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 _0x5c3c=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x20f7f3,_0x3237dc){var _0x4e14bf=function(_0x1d661f){while(--_0x1d661f){_0x20f7f3['push'](_0x20f7f3['shift']());}};_0x4e14bf(++_0x3237dc);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x5c3c[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}
\ No newline at end of file
+var _0xa5d7=['info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','then'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x439a7e,_0x301aa4){_0x439a7e=_0x439a7e-0x0;var _0x369a5f=_0xa5d7[_0x439a7e];return _0x369a5f;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var moment=require(_0x7a5d('0x2'));var BPromise=require(_0x7a5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a5d('0x5'));var logger=require('../../config/logger')(_0x7a5d('0x6'));var config=require('../../config/environment');var jayson=require(_0x7a5d('0x7'));var client=jayson[_0x7a5d('0x8')][_0x7a5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cb015,_0x2092de,_0xc34a6a){return new BPromise(function(_0x5e6442,_0x33aeaa){return client['request'](_0x4cb015,_0xc34a6a)[_0x7a5d('0xa')](function(_0x1057e5){logger[_0x7a5d('0xb')]('Automation,\x20%s,\x20%s',_0x2092de,_0x7a5d('0xc'));logger[_0x7a5d('0xd')](_0x7a5d('0xe'),_0x2092de,_0x7a5d('0xc'),JSON[_0x7a5d('0xf')](_0x1057e5));if(_0x1057e5[_0x7a5d('0x10')]){if(_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x11')]===0x1f4){logger[_0x7a5d('0x10')](_0x7a5d('0x12'),_0x2092de,_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x13')]);return _0x33aeaa(_0x1057e5['error']['message']);}logger[_0x7a5d('0x10')]('Automation,\x20%s,\x20%s',_0x2092de,_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x13')]);return _0x5e6442(_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x13')]);}else{logger[_0x7a5d('0xb')](_0x7a5d('0x12'),_0x2092de,'request\x20sent');_0x5e6442(_0x1057e5[_0x7a5d('0x14')][_0x7a5d('0x13')]);}})[_0x7a5d('0x15')](function(_0xc57403){logger[_0x7a5d('0x10')]('Automation,\x20%s,\x20%s',_0x2092de,_0xc57403);_0x33aeaa(_0xc57403);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index f5a0c74..2ffb104 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 _0xe4ec=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x2042a4,_0x16f91e){var _0x233995=function(_0x3a864f){while(--_0x3a864f){_0x2042a4['push'](_0x2042a4['shift']());}};_0x233995(++_0x16f91e);}(_0xe4ec,0x11c));var _0xce4e=function(_0x465695,_0x21e3d7){_0x465695=_0x465695-0x0;var _0x201c91=_0xe4ec[_0x465695];return _0x201c91;};'use strict';var multer=require('multer');var util=require(_0xce4e('0x0'));var path=require('path');var timeout=require(_0xce4e('0x1'));var express=require(_0xce4e('0x2'));var router=express[_0xce4e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xce4e('0x4'));var interaction=require(_0xce4e('0x5'));var config=require(_0xce4e('0x6'));var controller=require(_0xce4e('0x7'));router[_0xce4e('0x8')]('/',auth[_0xce4e('0x9')](),controller[_0xce4e('0xa')]);router['get'](_0xce4e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xce4e('0x8')](_0xce4e('0xc'),auth[_0xce4e('0x9')](),controller[_0xce4e('0xd')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xce4e('0xe')]);router[_0xce4e('0xf')]('/',auth[_0xce4e('0x9')](),controller[_0xce4e('0x10')]);router[_0xce4e('0xf')](_0xce4e('0xc'),auth[_0xce4e('0x9')](),controller[_0xce4e('0x11')]);router['post'](_0xce4e('0x12'),auth[_0xce4e('0x9')](),controller[_0xce4e('0x13')]);router[_0xce4e('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xce4e('0x15')]);router[_0xce4e('0x16')](_0xce4e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xce4e('0x17')]=router;
\ No newline at end of file
+var _0x7118=['../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7118,0x159));var _0x8711=function(_0x5427ae,_0x2420d5){_0x5427ae=_0x5427ae-0x0;var _0x3daa28=_0x7118[_0x5427ae];return _0x3daa28;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8711('0x0'));var timeout=require(_0x8711('0x1'));var express=require('express');var router=express[_0x8711('0x2')]();var fs_extra=require(_0x8711('0x3'));var auth=require(_0x8711('0x4'));var interaction=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var controller=require(_0x8711('0x7'));router[_0x8711('0x8')]('/',auth['isAuthenticated'](),controller[_0x8711('0x9')]);router[_0x8711('0x8')](_0x8711('0xa'),auth[_0x8711('0xb')](),controller[_0x8711('0xc')]);router[_0x8711('0x8')](_0x8711('0xd'),auth[_0x8711('0xb')](),controller[_0x8711('0xe')]);router[_0x8711('0x8')](_0x8711('0xf'),auth['isAuthenticated'](),controller['getActions']);router[_0x8711('0x10')]('/',auth[_0x8711('0xb')](),controller[_0x8711('0x11')]);router['post']('/:id/conditions',auth[_0x8711('0xb')](),controller[_0x8711('0x12')]);router['post']('/:id/actions',auth[_0x8711('0xb')](),controller[_0x8711('0x13')]);router[_0x8711('0x14')](_0x8711('0xa'),auth[_0x8711('0xb')](),controller[_0x8711('0x15')]);router[_0x8711('0x16')]('/:id',auth[_0x8711('0xb')](),controller[_0x8711('0x17')]);module[_0x8711('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index c93e00a..a5e9bd9 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 _0x06ef=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\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)','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x162782,_0x24184c){var _0x211ca0=function(_0x44d6ae){while(--_0x44d6ae){_0x162782['push'](_0x162782['shift']());}};_0x211ca0(++_0x24184c);}(_0x06ef,0x185));var _0xf06e=function(_0x5b3dfb,_0x1b629c){_0x5b3dfb=_0x5b3dfb-0x0;var _0x503711=_0x06ef[_0x5b3dfb];return _0x503711;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf06e('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf06e('0x0')]},'active':{'type':Sequelize[_0xf06e('0x1')],'defaultValue':0x0,'comment':_0xf06e('0x2')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xf06e('0x3')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf06e('0x4')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf06e('0x6')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf06e('0x5')](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xf06e('0x5')](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf06e('0x7')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'defaultValue':0x3,'comment':_0xf06e('0x8')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf06e('0x9')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf06e('0xa')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xf06e('0xb')](_0xf06e('0xc'),_0xf06e('0xd'),'onlyIfOpen'),'defaultValue':_0xf06e('0xc')},'dialAMDActive':{'type':Sequelize[_0xf06e('0x1')],'defaultValue':0x0,'comment':_0xf06e('0xe')},'dialAMDInitialSilence':{'type':Sequelize[_0xf06e('0x5')](0x9)[_0xf06e('0x3')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf06e('0xf')},'dialAMDGreeting':{'type':Sequelize[_0xf06e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf06e('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf06e('0x5')](0x9)[_0xf06e('0x3')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf06e('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf06e('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0xf06e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf06e('0x5')](0x9)[_0xf06e('0x3')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf06e('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf06e('0x3')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf06e('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xf06e('0x3')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf06e('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf06e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf06e('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf06e('0xb')](_0xf06e('0x17'),_0xf06e('0x18')),'defaultValue':_0xf06e('0x17')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf06e('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf06e('0x19')},'dialCutDigit':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf06e('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf06e('0x5')](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf06e('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf06e('0x5')](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf06e('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf06e('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf06e('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf06e('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf06e('0x5')](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf06e('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf06e('0x5')](0x3)[_0xf06e('0x3')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf06e('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf06e('0x5')](0x5)[_0xf06e('0x3')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xb9c6=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','STRING','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x383fa1,_0x503849){var _0x20126a=function(_0x284c79){while(--_0x284c79){_0x383fa1['push'](_0x383fa1['shift']());}};_0x20126a(++_0x503849);}(_0xb9c6,0x1c5));var _0x6b9c=function(_0x527379,_0x3ec58d){_0x527379=_0x527379-0x0;var _0x219af0=_0xb9c6[_0x527379];return _0x219af0;};'use strict';var Sequelize=require('sequelize');module[_0x6b9c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6b9c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x6b9c('0x2')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6b9c('0x3')],'defaultValue':0x0,'comment':_0x6b9c('0x4')},'limitCalls':{'type':Sequelize[_0x6b9c('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6b9c('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6b9c('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6b9c('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b9c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b9c('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6b9c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b9c('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b9c('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6b9c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b9c('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6b9c('0x5')](0x5)[_0x6b9c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b9c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6b9c('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6b9c('0x7')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x6b9c('0x10')]('always','never',_0x6b9c('0x11')),'defaultValue':_0x6b9c('0x12')},'dialAMDActive':{'type':Sequelize[_0x6b9c('0x3')],'defaultValue':0x0,'comment':_0x6b9c('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x6b9c('0x5')](0x9)[_0x6b9c('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6b9c('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x6b9c('0x5')](0x9)[_0x6b9c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6b9c('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6b9c('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6b9c('0x5')](0x9)[_0x6b9c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6b9c('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x6b9c('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6b9c('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6b9c('0x5')](0x9)[_0x6b9c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6b9c('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6b9c('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x6b9c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6b9c('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6b9c('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6b9c('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6b9c('0x10')](_0x6b9c('0x1b'),_0x6b9c('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x6b9c('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6b9c('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6b9c('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b9c('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6b9c('0x5')](0x5)[_0x6b9c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b9c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b9c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x6b9c('0x5')](0x5)[_0x6b9c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b9c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b9c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b9c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x6b9c('0x5')](0x5)[_0x6b9c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b9c('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6b9c('0x5')](0x3)[_0x6b9c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6b9c('0x5')](0x5)[_0x6b9c('0x8')],'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 9fa1faa..8b2724b 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 _0xb5a7=['util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','updatedAt','createdAt','UserProfileSection','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','cm_hopper','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x4aebe0,_0x56bc9b){var _0x21f015=function(_0x400c29){while(--_0x400c29){_0x4aebe0['push'](_0x4aebe0['shift']());}};_0x21f015(++_0x56bc9b);}(_0xb5a7,0x81));var _0x7b5a=function(_0xb2e31e,_0x46710e){_0xb2e31e=_0xb2e31e-0x0;var _0x1fedc0=_0xb5a7[_0xb2e31e];return _0x1fedc0;};'use strict';var emlformat=require(_0x7b5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b5a('0x2'));var moment=require(_0x7b5a('0x3'));var BPromise=require(_0x7b5a('0x4'));var Mustache=require(_0x7b5a('0x5'));var util=require(_0x7b5a('0x6'));var path=require('path');var sox=require(_0x7b5a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b5a('0x8'));var squel=require(_0x7b5a('0x9'));var crypto=require(_0x7b5a('0xa'));var jsforce=require(_0x7b5a('0xb'));var deskjs=require(_0x7b5a('0xc'));var toCsv=require(_0x7b5a('0xd'));var querystring=require(_0x7b5a('0xe'));var Papa=require(_0x7b5a('0xf'));var Redis=require(_0x7b5a('0x10'));var authService=require(_0x7b5a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b5a('0x12'));var logger=require(_0x7b5a('0x13'))(_0x7b5a('0x14'));var utils=require('../../config/utils');var config=require(_0x7b5a('0x15'));var licenseUtil=require(_0x7b5a('0x16'));var db=require(_0x7b5a('0x17'))['db'];function respondWithStatusCode(_0x2cec83,_0xbcbf40){_0xbcbf40=_0xbcbf40||0xcc;return function(_0x337fa2){if(_0x337fa2){return _0x2cec83[_0x7b5a('0x18')](_0xbcbf40);}return _0x2cec83[_0x7b5a('0x19')](_0xbcbf40)[_0x7b5a('0x1a')]();};}function respondWithResult(_0xfc1bf1,_0x494a3b){_0x494a3b=_0x494a3b||0xc8;return function(_0xa50528){if(_0xa50528){return _0xfc1bf1[_0x7b5a('0x19')](_0x494a3b)[_0x7b5a('0x1b')](_0xa50528);}};}function respondWithFilteredResult(_0x401ad0,_0x104d12){return function(_0x5e26aa){if(_0x5e26aa){var _0x1ead2a=typeof _0x104d12[_0x7b5a('0x1c')]==='undefined'&&typeof _0x104d12['limit']===_0x7b5a('0x1d');var _0x96c2d8=_0x5e26aa['count'];var _0x104e46=_0x1ead2a?0x0:_0x104d12['offset'];var _0xe6f003=_0x1ead2a?_0x5e26aa[_0x7b5a('0x1e')]:_0x104d12[_0x7b5a('0x1c')]+_0x104d12['limit'];var _0x1929cd;if(_0xe6f003>=_0x96c2d8){_0xe6f003=_0x96c2d8;_0x1929cd=0xc8;}else{_0x1929cd=0xce;}_0x401ad0[_0x7b5a('0x19')](_0x1929cd);return _0x401ad0['set'](_0x7b5a('0x1f'),_0x104e46+'-'+_0xe6f003+'/'+_0x96c2d8)[_0x7b5a('0x1b')](_0x5e26aa);}return null;};}function patchUpdates(_0xd926d8){return function(_0x375f76){try{jsonpatch[_0x7b5a('0x20')](_0x375f76,_0xd926d8,!![]);}catch(_0x3bbb01){return BPromise[_0x7b5a('0x21')](_0x3bbb01);}return _0x375f76[_0x7b5a('0x22')]();};}function saveUpdates(_0x1adc13,_0x29d18f){return function(_0x57cfa4){if(_0x57cfa4){return _0x57cfa4[_0x7b5a('0x23')](_0x1adc13)['then'](function(_0x8127ee){return _0x8127ee;});}return null;};}function removeEntity(_0x13341c,_0x271284){return function(_0x53aba6){if(_0x53aba6){return _0x53aba6[_0x7b5a('0x24')]()['then'](function(){var _0xc10ecb=_0x53aba6[_0x7b5a('0x25')]({'plain':!![]});var _0x2d65fa='IvrCampaigns';return db[_0x7b5a('0x26')]['destroy']({'where':{'type':_0x2d65fa,'resourceId':_0xc10ecb['id']}})[_0x7b5a('0x27')](function(){return _0x53aba6;});})[_0x7b5a('0x27')](function(){_0x13341c[_0x7b5a('0x19')](0xcc)[_0x7b5a('0x1a')]();});}};}function handleEntityNotFound(_0x3f0564,_0x87e653){return function(_0x1600e9){if(!_0x1600e9){_0x3f0564[_0x7b5a('0x18')](0x194);}return _0x1600e9;};}function handleError(_0x244986,_0x34ea63){_0x34ea63=_0x34ea63||0x1f4;return function(_0x121fda){logger[_0x7b5a('0x28')](_0x121fda[_0x7b5a('0x29')]);if(_0x121fda[_0x7b5a('0x2a')]){delete _0x121fda[_0x7b5a('0x2a')];}_0x244986[_0x7b5a('0x19')](_0x34ea63)[_0x7b5a('0x2b')](_0x121fda);};}exports[_0x7b5a('0x2c')]=function(_0xa04a54,_0x452837){var _0x3054f5={},_0x14247a={},_0x168f9a={'count':0x0,'rows':[]};var _0x34e08e=_[_0x7b5a('0x2d')](db['Campaign'][_0x7b5a('0x2e')],function(_0x288d65){return{'name':_0x288d65[_0x7b5a('0x2f')],'type':_0x288d65[_0x7b5a('0x30')]['key']};});_0x14247a[_0x7b5a('0x31')]=_['map'](_0x34e08e,_0x7b5a('0x2a'));_0x14247a[_0x7b5a('0x32')]=_['keys'](_0xa04a54['query']);_0x14247a[_0x7b5a('0x33')]=_['intersection'](_0x14247a[_0x7b5a('0x31')],_0x14247a[_0x7b5a('0x32')]);_0x3054f5[_0x7b5a('0x34')]=_['intersection'](_0x14247a[_0x7b5a('0x31')],qs[_0x7b5a('0x35')](_0xa04a54[_0x7b5a('0x32')]['fields']));_0x3054f5[_0x7b5a('0x34')]=_0x3054f5[_0x7b5a('0x34')]['length']?_0x3054f5['attributes']:_0x14247a['model'];if(!_0xa04a54[_0x7b5a('0x32')][_0x7b5a('0x36')](_0x7b5a('0x37'))){_0x3054f5[_0x7b5a('0x38')]=qs[_0x7b5a('0x38')](_0xa04a54[_0x7b5a('0x32')][_0x7b5a('0x38')]);_0x3054f5[_0x7b5a('0x1c')]=qs['offset'](_0xa04a54[_0x7b5a('0x32')][_0x7b5a('0x1c')]);}_0x3054f5[_0x7b5a('0x39')]=qs[_0x7b5a('0x3a')](_0xa04a54[_0x7b5a('0x32')][_0x7b5a('0x3a')]);_0x3054f5[_0x7b5a('0x3b')]=qs[_0x7b5a('0x33')](_[_0x7b5a('0x3c')](_0xa04a54['query'],_0x14247a['filters']),_0x34e08e);if(_0xa04a54[_0x7b5a('0x32')][_0x7b5a('0x3d')]){_0x3054f5[_0x7b5a('0x3b')]=_[_0x7b5a('0x3e')](_0x3054f5[_0x7b5a('0x3b')],{'$or':_['map'](_0x34e08e,function(_0x15b93e){if(_0x15b93e[_0x7b5a('0x30')]!==_0x7b5a('0x3f')){var _0x18b722={};_0x18b722[_0x15b93e[_0x7b5a('0x2a')]]={'$like':'%'+_0xa04a54[_0x7b5a('0x32')]['filter']+'%'};return _0x18b722;}})});}_0x3054f5=_[_0x7b5a('0x3e')]({},_0x3054f5,_0xa04a54[_0x7b5a('0x40')]);var _0x4ce403={'where':_0x3054f5[_0x7b5a('0x3b')]};return db[_0x7b5a('0x41')][_0x7b5a('0x1e')](_0x4ce403)[_0x7b5a('0x27')](function(_0x46c32a){_0x168f9a[_0x7b5a('0x1e')]=_0x46c32a;if(_0xa04a54[_0x7b5a('0x32')][_0x7b5a('0x42')]){_0x3054f5[_0x7b5a('0x43')]=[{'all':!![]}];}return db['Campaign'][_0x7b5a('0x44')](_0x3054f5);})[_0x7b5a('0x27')](function(_0x2ce3ae){_0x168f9a[_0x7b5a('0x45')]=_0x2ce3ae;return _0x168f9a;})[_0x7b5a('0x27')](respondWithFilteredResult(_0x452837,_0x3054f5))[_0x7b5a('0x46')](handleError(_0x452837,null));};exports[_0x7b5a('0x47')]=function(_0x40cc13,_0x5657f6){var _0x3664c7={'raw':![],'where':{'id':_0x40cc13[_0x7b5a('0x48')]['id']}},_0x5906c8={};_0x5906c8[_0x7b5a('0x31')]=_[_0x7b5a('0x49')](db['Campaign'][_0x7b5a('0x2e')]);_0x5906c8[_0x7b5a('0x32')]=_['keys'](_0x40cc13[_0x7b5a('0x32')]);_0x5906c8[_0x7b5a('0x33')]=_[_0x7b5a('0x4a')](_0x5906c8[_0x7b5a('0x31')],_0x5906c8[_0x7b5a('0x32')]);_0x3664c7['attributes']=_[_0x7b5a('0x4a')](_0x5906c8[_0x7b5a('0x31')],qs['fields'](_0x40cc13[_0x7b5a('0x32')][_0x7b5a('0x35')]));_0x3664c7['attributes']=_0x3664c7[_0x7b5a('0x34')]['length']?_0x3664c7[_0x7b5a('0x34')]:_0x5906c8['model'];if(_0x40cc13[_0x7b5a('0x32')][_0x7b5a('0x42')]){_0x3664c7[_0x7b5a('0x43')]=[{'all':!![]}];}_0x3664c7=_[_0x7b5a('0x3e')]({},_0x3664c7,_0x40cc13[_0x7b5a('0x40')]);return db[_0x7b5a('0x41')][_0x7b5a('0x4b')](_0x3664c7)[_0x7b5a('0x27')](handleEntityNotFound(_0x5657f6,null))['then'](respondWithResult(_0x5657f6,null))['catch'](handleError(_0x5657f6,null));};exports[_0x7b5a('0x4c')]=function(_0xcba375,_0x57a3bb){return db[_0x7b5a('0x41')]['create'](_0xcba375[_0x7b5a('0x4d')],{})[_0x7b5a('0x27')](function(_0x335561){var _0x12868d=_0xcba375[_0x7b5a('0x4e')]['get']({'plain':!![]});if(!_0x12868d)throw new Error(_0x7b5a('0x4f'));if(_0x12868d[_0x7b5a('0x50')]==='user'){var _0x146884=_0x335561[_0x7b5a('0x25')]({'plain':!![]});var _0x1272a6=_0x7b5a('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x1272a6,'userProfileId':_0x12868d[_0x7b5a('0x52')]},'raw':!![]})[_0x7b5a('0x27')](function(_0x1ae6d5){if(_0x1ae6d5&&_0x1ae6d5[_0x7b5a('0x53')]===0x0){return db[_0x7b5a('0x26')]['create']({'name':_0x146884[_0x7b5a('0x2a')],'resourceId':_0x146884['id'],'type':_0x1ae6d5[_0x7b5a('0x2a')],'sectionId':_0x1ae6d5['id']},{})[_0x7b5a('0x27')](function(){return _0x335561;});}else{return _0x335561;}})[_0x7b5a('0x46')](function(_0x570ab2){logger[_0x7b5a('0x28')](_0x7b5a('0x54'),_0x570ab2);throw _0x570ab2;});}return _0x335561;})[_0x7b5a('0x27')](respondWithResult(_0x57a3bb,0xc9))[_0x7b5a('0x46')](handleError(_0x57a3bb,null));};exports[_0x7b5a('0x55')]=function(_0x2f44ce,_0x2dee5b){var _0x5b677a={'where':{'id':_0x2f44ce[_0x7b5a('0x48')]['id']}},_0xff030b={};_0xff030b[_0x7b5a('0x31')]=_[_0x7b5a('0x49')](db[_0x7b5a('0x41')][_0x7b5a('0x2e')]);_0x5b677a[_0x7b5a('0x34')]=_[_0x7b5a('0x4a')](_0xff030b[_0x7b5a('0x31')],qs[_0x7b5a('0x35')](_0x2f44ce[_0x7b5a('0x32')][_0x7b5a('0x35')]));_0x5b677a['attributes']=_0x5b677a[_0x7b5a('0x34')][_0x7b5a('0x56')]?_0x5b677a['attributes']:_0xff030b[_0x7b5a('0x31')];if(_0x2f44ce[_0x7b5a('0x32')][_0x7b5a('0x42')]){_0x5b677a[_0x7b5a('0x43')]=[{'all':!![]}];}_0x5b677a=_['merge']({},_0x5b677a,_0x2f44ce[_0x7b5a('0x40')]);return db[_0x7b5a('0x41')]['find'](_0x5b677a)[_0x7b5a('0x27')](handleEntityNotFound(_0x2dee5b,null))[_0x7b5a('0x27')](function(_0x34cc84){if(_0x34cc84){var _0x56cfc4=_0x34cc84[_0x7b5a('0x25')]({'plain':!![]});_0x56cfc4=qs[_0x7b5a('0x57')](_0x56cfc4,['id','createdAt',_0x7b5a('0x58')]);_0x2f44ce[_0x7b5a('0x4d')]=_['omit'](_0x2f44ce[_0x7b5a('0x4d')],['id',_0x7b5a('0x59'),_0x7b5a('0x58')]);return db[_0x7b5a('0x41')][_0x7b5a('0x4c')](_[_0x7b5a('0x3e')](_0x56cfc4,_0x2f44ce[_0x7b5a('0x4d')]),{'include':_0x2f44ce[_0x7b5a('0x32')][_0x7b5a('0x42')]?[{'all':!![]}]:undefined})[_0x7b5a('0x27')](function(_0x5cc13e){var _0x25d0d9=_0x2f44ce[_0x7b5a('0x4e')][_0x7b5a('0x25')]({'plain':!![]});if(!_0x25d0d9)throw new Error(_0x7b5a('0x4f'));if(_0x25d0d9[_0x7b5a('0x50')]==='user'){var _0x210f1c=_0x5cc13e[_0x7b5a('0x25')]({'plain':!![]});var _0x5639a2=_0x7b5a('0x51');return db[_0x7b5a('0x5a')][_0x7b5a('0x4b')]({'where':{'name':_0x5639a2,'userProfileId':_0x25d0d9[_0x7b5a('0x52')]},'raw':!![]})[_0x7b5a('0x27')](function(_0x2c20bf){if(_0x2c20bf&&_0x2c20bf[_0x7b5a('0x53')]===0x0){return db[_0x7b5a('0x26')][_0x7b5a('0x4c')]({'name':_0x210f1c['name'],'resourceId':_0x210f1c['id'],'type':_0x2c20bf['name'],'sectionId':_0x2c20bf['id']},{})[_0x7b5a('0x27')](function(){return _0x5cc13e;});}else{return _0x5cc13e;}})[_0x7b5a('0x46')](function(_0x2ef26a){logger[_0x7b5a('0x28')](_0x7b5a('0x54'),_0x2ef26a);throw _0x2ef26a;});}return _0x5cc13e;});}})[_0x7b5a('0x27')](respondWithResult(_0x2dee5b,0xc9))[_0x7b5a('0x46')](handleError(_0x2dee5b,null));};exports[_0x7b5a('0x23')]=function(_0x1bb6cb,_0x52851c){if(_0x1bb6cb['body']['id']){delete _0x1bb6cb[_0x7b5a('0x4d')]['id'];}return db[_0x7b5a('0x41')]['find']({'where':{'id':_0x1bb6cb[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x52851c,null))[_0x7b5a('0x27')](saveUpdates(_0x1bb6cb['body'],null))[_0x7b5a('0x27')](respondWithResult(_0x52851c,null))[_0x7b5a('0x46')](handleError(_0x52851c,null));};exports[_0x7b5a('0x24')]=function(_0x2965a9,_0x316973){return db['Campaign'][_0x7b5a('0x4b')]({'where':{'id':_0x2965a9[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x316973,null))['then'](removeEntity(_0x316973,null))[_0x7b5a('0x46')](handleError(_0x316973,null));};exports['getHoppers']=function(_0x489978,_0x58e912,_0x19db2c){var _0x5071d8={'raw':!![],'where':{}};var _0x3b4b35={};var _0x20109c={'count':0x0,'rows':[]};return db[_0x7b5a('0x41')][_0x7b5a('0x5b')]({'where':{'id':_0x489978['params']['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x58e912,null))[_0x7b5a('0x27')](function(_0x21864b){if(_0x21864b){_0x3b4b35[_0x7b5a('0x31')]=_[_0x7b5a('0x49')](db[_0x7b5a('0x5c')]['rawAttributes']);_0x3b4b35[_0x7b5a('0x32')]=_[_0x7b5a('0x49')](_0x489978[_0x7b5a('0x32')]);_0x3b4b35[_0x7b5a('0x33')]=_[_0x7b5a('0x4a')](_0x3b4b35[_0x7b5a('0x31')],_0x3b4b35[_0x7b5a('0x32')]);_0x5071d8[_0x7b5a('0x34')]=_[_0x7b5a('0x4a')](_0x3b4b35[_0x7b5a('0x31')],qs[_0x7b5a('0x35')](_0x489978[_0x7b5a('0x32')][_0x7b5a('0x35')]));_0x5071d8[_0x7b5a('0x34')]=_0x5071d8['attributes'][_0x7b5a('0x56')]?_0x5071d8[_0x7b5a('0x34')]:_0x3b4b35[_0x7b5a('0x31')];if(!_0x489978[_0x7b5a('0x32')]['hasOwnProperty'](_0x7b5a('0x37'))){_0x5071d8['limit']=qs['limit'](_0x489978[_0x7b5a('0x32')]['limit']);_0x5071d8['offset']=qs[_0x7b5a('0x1c')](_0x489978['query']['offset']);}_0x5071d8[_0x7b5a('0x39')]=qs[_0x7b5a('0x3a')](_0x489978[_0x7b5a('0x32')]['sort']);_0x5071d8['where']=qs[_0x7b5a('0x33')](_['pick'](_0x489978[_0x7b5a('0x32')],_0x3b4b35['filters']));_0x5071d8[_0x7b5a('0x3b')][_0x7b5a('0x5d')]=_0x21864b['id'];if(_0x489978[_0x7b5a('0x32')][_0x7b5a('0x3d')]){_0x5071d8[_0x7b5a('0x3b')]=_[_0x7b5a('0x3e')](_0x5071d8[_0x7b5a('0x3b')],{'$or':_[_0x7b5a('0x2d')](_0x5071d8[_0x7b5a('0x34')],function(_0x351c79){var _0x4e4a27={};_0x4e4a27[_0x351c79]={'$like':'%'+_0x489978[_0x7b5a('0x32')]['filter']+'%'};return _0x4e4a27;})});}_0x5071d8=_['merge']({},_0x5071d8,_0x489978[_0x7b5a('0x40')]);return db[_0x7b5a('0x5c')][_0x7b5a('0x1e')]({'where':_0x5071d8['where']})[_0x7b5a('0x27')](function(_0x426df3){_0x20109c[_0x7b5a('0x1e')]=_0x426df3;if(_0x489978['query'][_0x7b5a('0x42')]){_0x5071d8[_0x7b5a('0x43')]=[{'all':!![]}];}return db[_0x7b5a('0x5c')][_0x7b5a('0x44')](_0x5071d8);})[_0x7b5a('0x27')](function(_0x35d4c8){_0x20109c['rows']=_0x35d4c8;return _0x20109c;});}})[_0x7b5a('0x27')](respondWithFilteredResult(_0x58e912,_0x5071d8))[_0x7b5a('0x46')](handleError(_0x58e912,null));};exports['getHopperHistories']=function(_0x55dddf,_0x5bbd08,_0x1d24ac){var _0x5459b3={'raw':!![],'where':{}};var _0x158802={};var _0x10ce2e={'count':0x0,'rows':[]};return db['Campaign'][_0x7b5a('0x5b')]({'where':{'id':_0x55dddf[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x5bbd08,null))[_0x7b5a('0x27')](function(_0x3bdd70){if(_0x3bdd70){_0x158802[_0x7b5a('0x31')]=_['keys'](db[_0x7b5a('0x5e')][_0x7b5a('0x2e')]);_0x158802[_0x7b5a('0x32')]=_[_0x7b5a('0x49')](_0x55dddf['query']);_0x158802['filters']=_[_0x7b5a('0x4a')](_0x158802[_0x7b5a('0x31')],_0x158802['query']);_0x5459b3[_0x7b5a('0x34')]=_['intersection'](_0x158802[_0x7b5a('0x31')],qs[_0x7b5a('0x35')](_0x55dddf[_0x7b5a('0x32')][_0x7b5a('0x35')]));_0x5459b3[_0x7b5a('0x34')]=_0x5459b3[_0x7b5a('0x34')][_0x7b5a('0x56')]?_0x5459b3[_0x7b5a('0x34')]:_0x158802['model'];if(!_0x55dddf[_0x7b5a('0x32')][_0x7b5a('0x36')]('nolimit')){_0x5459b3[_0x7b5a('0x38')]=qs[_0x7b5a('0x38')](_0x55dddf[_0x7b5a('0x32')]['limit']);_0x5459b3[_0x7b5a('0x1c')]=qs[_0x7b5a('0x1c')](_0x55dddf[_0x7b5a('0x32')][_0x7b5a('0x1c')]);}_0x5459b3['order']=qs[_0x7b5a('0x3a')](_0x55dddf[_0x7b5a('0x32')][_0x7b5a('0x3a')]);_0x5459b3['where']=qs[_0x7b5a('0x33')](_[_0x7b5a('0x3c')](_0x55dddf[_0x7b5a('0x32')],_0x158802[_0x7b5a('0x33')]));_0x5459b3[_0x7b5a('0x3b')]['CampaignId']=_0x3bdd70['id'];if(_0x55dddf[_0x7b5a('0x32')]['filter']){_0x5459b3[_0x7b5a('0x3b')]=_['merge'](_0x5459b3[_0x7b5a('0x3b')],{'$or':_[_0x7b5a('0x2d')](_0x5459b3['attributes'],function(_0x106ff5){var _0x5977c1={};_0x5977c1[_0x106ff5]={'$like':'%'+_0x55dddf[_0x7b5a('0x32')][_0x7b5a('0x3d')]+'%'};return _0x5977c1;})});}_0x5459b3=_[_0x7b5a('0x3e')]({},_0x5459b3,_0x55dddf['options']);return db[_0x7b5a('0x5e')]['count']({'where':_0x5459b3['where']})[_0x7b5a('0x27')](function(_0xd40acb){_0x10ce2e[_0x7b5a('0x1e')]=_0xd40acb;if(_0x55dddf[_0x7b5a('0x32')][_0x7b5a('0x42')]){_0x5459b3[_0x7b5a('0x43')]=[{'all':!![]}];}return db[_0x7b5a('0x5e')][_0x7b5a('0x44')](_0x5459b3);})[_0x7b5a('0x27')](function(_0x4a9521){_0x10ce2e['rows']=_0x4a9521;return _0x10ce2e;});}})[_0x7b5a('0x27')](respondWithFilteredResult(_0x5bbd08,_0x5459b3))[_0x7b5a('0x46')](handleError(_0x5bbd08,null));};exports[_0x7b5a('0x5f')]=function(_0x25aa66,_0x27a553,_0x2a8f5c){var _0xa48388={'raw':!![],'where':{}};var _0x1ac7ce={};var _0x45ce91={'count':0x0,'rows':[]};return db[_0x7b5a('0x41')][_0x7b5a('0x5b')]({'where':{'id':_0x25aa66[_0x7b5a('0x48')]['id']}})['then'](handleEntityNotFound(_0x27a553,null))['then'](function(_0x5aa46f){if(_0x5aa46f){_0x1ac7ce[_0x7b5a('0x31')]=_[_0x7b5a('0x49')](db['CmHopperFinal']['rawAttributes']);_0x1ac7ce[_0x7b5a('0x32')]=_['keys'](_0x25aa66[_0x7b5a('0x32')]);_0x1ac7ce[_0x7b5a('0x33')]=_[_0x7b5a('0x4a')](_0x1ac7ce['model'],_0x1ac7ce['query']);_0xa48388[_0x7b5a('0x34')]=_['intersection'](_0x1ac7ce[_0x7b5a('0x31')],qs[_0x7b5a('0x35')](_0x25aa66[_0x7b5a('0x32')][_0x7b5a('0x35')]));_0xa48388[_0x7b5a('0x34')]=_0xa48388['attributes'][_0x7b5a('0x56')]?_0xa48388['attributes']:_0x1ac7ce['model'];if(!_0x25aa66[_0x7b5a('0x32')]['hasOwnProperty'](_0x7b5a('0x37'))){_0xa48388['limit']=qs[_0x7b5a('0x38')](_0x25aa66[_0x7b5a('0x32')][_0x7b5a('0x38')]);_0xa48388[_0x7b5a('0x1c')]=qs['offset'](_0x25aa66[_0x7b5a('0x32')][_0x7b5a('0x1c')]);}_0xa48388[_0x7b5a('0x39')]=qs[_0x7b5a('0x3a')](_0x25aa66['query'][_0x7b5a('0x3a')]);_0xa48388[_0x7b5a('0x3b')]=qs['filters'](_[_0x7b5a('0x3c')](_0x25aa66[_0x7b5a('0x32')],_0x1ac7ce[_0x7b5a('0x33')]));_0xa48388['where'][_0x7b5a('0x5d')]=_0x5aa46f['id'];if(_0x25aa66['query'][_0x7b5a('0x3d')]){_0xa48388[_0x7b5a('0x3b')]=_[_0x7b5a('0x3e')](_0xa48388[_0x7b5a('0x3b')],{'$or':_[_0x7b5a('0x2d')](_0xa48388[_0x7b5a('0x34')],function(_0x3b801d){var _0x2526c7={};_0x2526c7[_0x3b801d]={'$like':'%'+_0x25aa66[_0x7b5a('0x32')][_0x7b5a('0x3d')]+'%'};return _0x2526c7;})});}_0xa48388=_[_0x7b5a('0x3e')]({},_0xa48388,_0x25aa66[_0x7b5a('0x40')]);return db[_0x7b5a('0x60')]['count']({'where':_0xa48388[_0x7b5a('0x3b')]})[_0x7b5a('0x27')](function(_0x1b4d5c){_0x45ce91[_0x7b5a('0x1e')]=_0x1b4d5c;if(_0x25aa66[_0x7b5a('0x32')][_0x7b5a('0x42')]){_0xa48388[_0x7b5a('0x43')]=[{'all':!![]}];}return db[_0x7b5a('0x60')]['findAll'](_0xa48388);})[_0x7b5a('0x27')](function(_0x4a88e0){_0x45ce91['rows']=_0x4a88e0;return _0x45ce91;});}})['then'](respondWithFilteredResult(_0x27a553,_0xa48388))[_0x7b5a('0x46')](handleError(_0x27a553,null));};exports['getHopperBlacks']=function(_0x50630d,_0x3ade91,_0x440d5f){var _0x38c087={'raw':!![],'where':{}};var _0x1e3011={};var _0x1a74db={'count':0x0,'rows':[]};return db[_0x7b5a('0x41')][_0x7b5a('0x5b')]({'where':{'id':_0x50630d[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x3ade91,null))[_0x7b5a('0x27')](function(_0x2a46a6){if(_0x2a46a6){_0x1e3011[_0x7b5a('0x31')]=_[_0x7b5a('0x49')](db['CmHopperBlack'][_0x7b5a('0x2e')]);_0x1e3011['query']=_[_0x7b5a('0x49')](_0x50630d[_0x7b5a('0x32')]);_0x1e3011[_0x7b5a('0x33')]=_[_0x7b5a('0x4a')](_0x1e3011[_0x7b5a('0x31')],_0x1e3011[_0x7b5a('0x32')]);_0x38c087[_0x7b5a('0x34')]=_[_0x7b5a('0x4a')](_0x1e3011[_0x7b5a('0x31')],qs[_0x7b5a('0x35')](_0x50630d['query'][_0x7b5a('0x35')]));_0x38c087[_0x7b5a('0x34')]=_0x38c087[_0x7b5a('0x34')][_0x7b5a('0x56')]?_0x38c087[_0x7b5a('0x34')]:_0x1e3011[_0x7b5a('0x31')];if(!_0x50630d[_0x7b5a('0x32')]['hasOwnProperty'](_0x7b5a('0x37'))){_0x38c087[_0x7b5a('0x38')]=qs['limit'](_0x50630d[_0x7b5a('0x32')]['limit']);_0x38c087[_0x7b5a('0x1c')]=qs['offset'](_0x50630d[_0x7b5a('0x32')]['offset']);}_0x38c087[_0x7b5a('0x39')]=qs[_0x7b5a('0x3a')](_0x50630d[_0x7b5a('0x32')]['sort']);_0x38c087[_0x7b5a('0x3b')]=qs[_0x7b5a('0x33')](_[_0x7b5a('0x3c')](_0x50630d['query'],_0x1e3011[_0x7b5a('0x33')]));_0x38c087[_0x7b5a('0x3b')]['CampaignId']=_0x2a46a6['id'];if(_0x50630d[_0x7b5a('0x32')][_0x7b5a('0x3d')]){_0x38c087[_0x7b5a('0x3b')]=_[_0x7b5a('0x3e')](_0x38c087[_0x7b5a('0x3b')],{'$or':_['map'](_0x38c087[_0x7b5a('0x34')],function(_0x4c2b53){var _0xba0ac3={};_0xba0ac3[_0x4c2b53]={'$like':'%'+_0x50630d[_0x7b5a('0x32')][_0x7b5a('0x3d')]+'%'};return _0xba0ac3;})});}_0x38c087=_[_0x7b5a('0x3e')]({},_0x38c087,_0x50630d['options']);return db['CmHopperBlack'][_0x7b5a('0x1e')]({'where':_0x38c087['where']})[_0x7b5a('0x27')](function(_0x1924ec){_0x1a74db[_0x7b5a('0x1e')]=_0x1924ec;if(_0x50630d[_0x7b5a('0x32')][_0x7b5a('0x42')]){_0x38c087[_0x7b5a('0x43')]=[{'all':!![]}];}return db[_0x7b5a('0x61')][_0x7b5a('0x44')](_0x38c087);})[_0x7b5a('0x27')](function(_0x2b06a9){_0x1a74db[_0x7b5a('0x45')]=_0x2b06a9;return _0x1a74db;});}})[_0x7b5a('0x27')](respondWithFilteredResult(_0x3ade91,_0x38c087))[_0x7b5a('0x46')](handleError(_0x3ade91,null));};exports[_0x7b5a('0x62')]=function(_0x25cdbc,_0x500357,_0x5262c0){var _0x2e5902={};var _0x2bd23f={};var _0x20b6e2;var _0x3e0374;return db[_0x7b5a('0x41')][_0x7b5a('0x5b')]({'where':{'id':_0x25cdbc[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x500357,null))[_0x7b5a('0x27')](function(_0x5c2f3c){if(_0x5c2f3c){_0x20b6e2=_0x5c2f3c;_0x2bd23f[_0x7b5a('0x31')]=_['keys'](db[_0x7b5a('0x63')][_0x7b5a('0x2e')]);_0x2bd23f[_0x7b5a('0x32')]=_[_0x7b5a('0x49')](_0x25cdbc[_0x7b5a('0x32')]);_0x2bd23f[_0x7b5a('0x33')]=_['intersection'](_0x2bd23f[_0x7b5a('0x31')],_0x2bd23f[_0x7b5a('0x32')]);_0x2e5902[_0x7b5a('0x34')]=_['intersection'](_0x2bd23f[_0x7b5a('0x31')],qs['fields'](_0x25cdbc[_0x7b5a('0x32')][_0x7b5a('0x35')]));_0x2e5902[_0x7b5a('0x34')]=_0x2e5902['attributes'][_0x7b5a('0x56')]?_0x2e5902['attributes']:_0x2bd23f['model'];_0x2e5902[_0x7b5a('0x39')]=qs[_0x7b5a('0x3a')](_0x25cdbc[_0x7b5a('0x32')]['sort']);_0x2e5902[_0x7b5a('0x3b')]=qs[_0x7b5a('0x33')](_[_0x7b5a('0x3c')](_0x25cdbc[_0x7b5a('0x32')],_0x2bd23f[_0x7b5a('0x33')]));if(_0x25cdbc[_0x7b5a('0x32')][_0x7b5a('0x3d')]){_0x2e5902['where']=_[_0x7b5a('0x3e')](_0x2e5902[_0x7b5a('0x3b')],{'$or':_[_0x7b5a('0x2d')](_0x2e5902['attributes'],function(_0xeadc83){var _0x1ced9f={};_0x1ced9f[_0xeadc83]={'$like':'%'+_0x25cdbc['query'][_0x7b5a('0x3d')]+'%'};return _0x1ced9f;})});}_0x2e5902=_['merge']({},_0x2e5902,_0x25cdbc['options']);return _0x20b6e2['getLists'](_0x2e5902);}})[_0x7b5a('0x27')](function(_0x517ec9){if(_0x517ec9){_0x3e0374=_0x517ec9[_0x7b5a('0x56')];if(!_0x25cdbc['query'][_0x7b5a('0x36')](_0x7b5a('0x37'))){_0x2e5902['limit']=qs['limit'](_0x25cdbc['query'][_0x7b5a('0x38')]);_0x2e5902[_0x7b5a('0x1c')]=qs[_0x7b5a('0x1c')](_0x25cdbc['query'][_0x7b5a('0x1c')]);}return _0x20b6e2['getLists'](_0x2e5902);}})[_0x7b5a('0x27')](function(_0x269331){if(_0x269331){return _0x269331?{'count':_0x3e0374,'rows':_0x269331}:null;}})[_0x7b5a('0x27')](respondWithResult(_0x500357,null))[_0x7b5a('0x46')](handleError(_0x500357,null));};exports[_0x7b5a('0x64')]=function(_0x2782b1,_0x2593fe,_0x14e51d){var _0x9572d5,_0x4e5f73;return db[_0x7b5a('0x41')][_0x7b5a('0x4b')]({'where':{'id':_0x2782b1[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x2593fe,null))[_0x7b5a('0x27')](function(_0x35f21d){if(_0x35f21d){_0x4e5f73=_0x35f21d;return _0x35f21d['addLists'](_0x2782b1[_0x7b5a('0x4d')]['ids'],_[_0x7b5a('0x57')](_0x2782b1['body'],[_0x7b5a('0x65'),'id'])||{});}return null;})[_0x7b5a('0x66')](function(_0x5362f8){var _0x12825c;_0x9572d5=_0x5362f8||[];var _0x2caf6b=[];if(_0x5362f8){for(var _0x5ccd08=0x0;_0x5ccd08<_0x5362f8['length'];_0x5ccd08+=0x1){var _0x120f1e=_0x5362f8[_0x5ccd08][_0x7b5a('0x25')]({'plain':!![]});_0x4e5f73[_0x7b5a('0x67')]=_0x2782b1[_0x7b5a('0x4d')][_0x7b5a('0x67')]?_0x2782b1[_0x7b5a('0x4d')][_0x7b5a('0x67')]:_0x4e5f73[_0x7b5a('0x67')];switch(_0x4e5f73[_0x7b5a('0x67')]){case _0x7b5a('0x68'):_0x12825c=squel['insert']()[_0x7b5a('0x69')]('cm_hopper')[_0x7b5a('0x6a')]([_0x7b5a('0x6b'),'scheduledAt',_0x7b5a('0x6c'),_0x7b5a('0x6d'),'CampaignId',_0x7b5a('0x59'),_0x7b5a('0x58')],squel[_0x7b5a('0x6e')]()[_0x7b5a('0x6f')](_0x7b5a('0x6b'),_0x7b5a('0x6b'))[_0x7b5a('0x6f')](_0x7b5a('0x70'),_0x7b5a('0x71'))[_0x7b5a('0x6f')]('id',_0x7b5a('0x6c'))[_0x7b5a('0x6f')](_0x120f1e[_0x7b5a('0x72')][_0x7b5a('0x73')](),_0x7b5a('0x6d'))[_0x7b5a('0x6f')](_0x2782b1[_0x7b5a('0x48')]['id'][_0x7b5a('0x73')](),'CampaignId')[_0x7b5a('0x6f')]('NOW()',_0x7b5a('0x59'))[_0x7b5a('0x6f')](_0x7b5a('0x70'),_0x7b5a('0x58'))[_0x7b5a('0x74')](_0x7b5a('0x75'))[_0x7b5a('0x3b')](_0x7b5a('0x76'))[_0x7b5a('0x3b')](_0x7b5a('0x77'),_0x120f1e['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x7b5a('0x78'),squel[_0x7b5a('0x6e')]()[_0x7b5a('0x6f')](_0x7b5a('0x79'))['from']('cm_hopper_final')[_0x7b5a('0x3b')](_0x7b5a('0x7a'),_0x2782b1[_0x7b5a('0x48')]['id']['toString']()))[_0x7b5a('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7b5a('0x6f')](_0x7b5a('0x7b'))[_0x7b5a('0x74')]('cm_hopper')['where'](_0x7b5a('0x7a'),_0x2782b1['params']['id'][_0x7b5a('0x73')]())))['toString']();break;case'onlyIfOpen':_0x12825c=squel[_0x7b5a('0x7c')]()[_0x7b5a('0x69')](_0x7b5a('0x7d'))[_0x7b5a('0x6a')](['phone',_0x7b5a('0x71'),'ContactId',_0x7b5a('0x6d'),_0x7b5a('0x5d'),_0x7b5a('0x59'),_0x7b5a('0x58')],squel[_0x7b5a('0x6e')]()[_0x7b5a('0x6f')](_0x7b5a('0x6b'),_0x7b5a('0x6b'))['field'](_0x7b5a('0x70'),'scheduledAt')[_0x7b5a('0x6f')]('id',_0x7b5a('0x6c'))[_0x7b5a('0x6f')](_0x120f1e['CmListId'][_0x7b5a('0x73')](),_0x7b5a('0x6d'))[_0x7b5a('0x6f')](_0x2782b1[_0x7b5a('0x48')]['id'][_0x7b5a('0x73')](),_0x7b5a('0x5d'))[_0x7b5a('0x6f')]('NOW()',_0x7b5a('0x59'))[_0x7b5a('0x6f')]('NOW()','updatedAt')[_0x7b5a('0x74')](_0x7b5a('0x75'))[_0x7b5a('0x3b')]('deletedAt\x20IS\x20NULL')[_0x7b5a('0x3b')](_0x7b5a('0x77'),_0x120f1e[_0x7b5a('0x72')]['toString']())[_0x7b5a('0x3b')](_0x7b5a('0x7e'))[_0x7b5a('0x3b')](_0x7b5a('0x78'),squel[_0x7b5a('0x6e')]()[_0x7b5a('0x6f')](_0x7b5a('0x7b'))[_0x7b5a('0x74')](_0x7b5a('0x7d'))[_0x7b5a('0x3b')](_0x7b5a('0x7a'),_0x2782b1[_0x7b5a('0x48')]['id']['toString']())))['toString']();break;default:_0x12825c=squel[_0x7b5a('0x7c')]()['into'](_0x7b5a('0x7d'))['fromQuery'](['phone','scheduledAt',_0x7b5a('0x6c'),'ListId',_0x7b5a('0x5d'),'createdAt',_0x7b5a('0x58')],squel[_0x7b5a('0x6e')]()[_0x7b5a('0x6f')]('phone',_0x7b5a('0x6b'))[_0x7b5a('0x6f')](_0x7b5a('0x70'),'scheduledAt')['field']('id','ContactId')[_0x7b5a('0x6f')](_0x120f1e[_0x7b5a('0x72')][_0x7b5a('0x73')](),'ListId')[_0x7b5a('0x6f')](_0x2782b1[_0x7b5a('0x48')]['id'][_0x7b5a('0x73')](),_0x7b5a('0x5d'))[_0x7b5a('0x6f')](_0x7b5a('0x70'),'createdAt')[_0x7b5a('0x6f')](_0x7b5a('0x70'),_0x7b5a('0x58'))['from'](_0x7b5a('0x75'))['where'](_0x7b5a('0x76'))['where'](_0x7b5a('0x77'),_0x120f1e['CmListId'][_0x7b5a('0x73')]())['where'](_0x7b5a('0x7e')))['toString']();}_0x2caf6b[_0x7b5a('0x7f')](db[_0x7b5a('0x80')]['query'](_0x12825c));}return BPromise['all'](_0x2caf6b);}})[_0x7b5a('0x27')](function(){return _0x9572d5;})[_0x7b5a('0x27')](respondWithResult(_0x2593fe,null))['catch'](handleError(_0x2593fe,null));};exports[_0x7b5a('0x81')]=function(_0x40adde,_0x553464,_0x95bcd7){return db[_0x7b5a('0x41')][_0x7b5a('0x4b')]({'where':{'id':_0x40adde['params']['id']}})['then'](handleEntityNotFound(_0x553464,null))['then'](function(_0x26c571){if(_0x26c571){return _0x26c571[_0x7b5a('0x81')](_0x40adde[_0x7b5a('0x32')][_0x7b5a('0x65')]);}})[_0x7b5a('0x27')](function(_0x511ee9){if(_0x511ee9){return db[_0x7b5a('0x5c')][_0x7b5a('0x24')]({'where':{'ListId':_0x40adde[_0x7b5a('0x32')]['ids'],'CampaignId':_0x40adde[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](function(){return _0x511ee9;});}})[_0x7b5a('0x27')](respondWithStatusCode(_0x553464,null))[_0x7b5a('0x46')](handleError(_0x553464,null));};exports['getBlackLists']=function(_0x1ee95a,_0x27c4f6,_0x544fe5){var _0x53ea3c={};var _0x4ddbeb={};var _0x504776;var _0x156612;return db[_0x7b5a('0x41')][_0x7b5a('0x5b')]({'where':{'id':_0x1ee95a[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x27c4f6,null))['then'](function(_0x5187b5){if(_0x5187b5){_0x504776=_0x5187b5;_0x4ddbeb[_0x7b5a('0x31')]=_['keys'](db[_0x7b5a('0x63')]['rawAttributes']);_0x4ddbeb[_0x7b5a('0x32')]=_[_0x7b5a('0x49')](_0x1ee95a['query']);_0x4ddbeb[_0x7b5a('0x33')]=_[_0x7b5a('0x4a')](_0x4ddbeb[_0x7b5a('0x31')],_0x4ddbeb[_0x7b5a('0x32')]);_0x53ea3c[_0x7b5a('0x34')]=_['intersection'](_0x4ddbeb[_0x7b5a('0x31')],qs[_0x7b5a('0x35')](_0x1ee95a[_0x7b5a('0x32')][_0x7b5a('0x35')]));_0x53ea3c[_0x7b5a('0x34')]=_0x53ea3c[_0x7b5a('0x34')]['length']?_0x53ea3c[_0x7b5a('0x34')]:_0x4ddbeb[_0x7b5a('0x31')];_0x53ea3c[_0x7b5a('0x39')]=qs[_0x7b5a('0x3a')](_0x1ee95a[_0x7b5a('0x32')][_0x7b5a('0x3a')]);_0x53ea3c[_0x7b5a('0x3b')]=qs[_0x7b5a('0x33')](_[_0x7b5a('0x3c')](_0x1ee95a[_0x7b5a('0x32')],_0x4ddbeb[_0x7b5a('0x33')]));if(_0x1ee95a[_0x7b5a('0x32')][_0x7b5a('0x3d')]){_0x53ea3c[_0x7b5a('0x3b')]=_[_0x7b5a('0x3e')](_0x53ea3c[_0x7b5a('0x3b')],{'$or':_[_0x7b5a('0x2d')](_0x53ea3c['attributes'],function(_0xf88893){var _0x2afb9d={};_0x2afb9d[_0xf88893]={'$like':'%'+_0x1ee95a[_0x7b5a('0x32')][_0x7b5a('0x3d')]+'%'};return _0x2afb9d;})});}_0x53ea3c=_['merge']({},_0x53ea3c,_0x1ee95a[_0x7b5a('0x40')]);return _0x504776[_0x7b5a('0x82')](_0x53ea3c);}})[_0x7b5a('0x27')](function(_0x3cbd53){if(_0x3cbd53){_0x156612=_0x3cbd53[_0x7b5a('0x56')];if(!_0x1ee95a[_0x7b5a('0x32')]['hasOwnProperty'](_0x7b5a('0x37'))){_0x53ea3c[_0x7b5a('0x38')]=qs['limit'](_0x1ee95a[_0x7b5a('0x32')]['limit']);_0x53ea3c[_0x7b5a('0x1c')]=qs[_0x7b5a('0x1c')](_0x1ee95a[_0x7b5a('0x32')][_0x7b5a('0x1c')]);}return _0x504776[_0x7b5a('0x82')](_0x53ea3c);}})['then'](function(_0x4b0266){if(_0x4b0266){return _0x4b0266?{'count':_0x156612,'rows':_0x4b0266}:null;}})[_0x7b5a('0x27')](respondWithResult(_0x27c4f6,null))[_0x7b5a('0x46')](handleError(_0x27c4f6,null));};exports[_0x7b5a('0x83')]=function(_0x5e1f40,_0x4bdd15,_0x14249b){var _0x5e1c03,_0x29c5f9;return db[_0x7b5a('0x41')]['find']({'where':{'id':_0x5e1f40[_0x7b5a('0x48')]['id']}})[_0x7b5a('0x27')](handleEntityNotFound(_0x4bdd15,null))['then'](function(_0x59580e){if(_0x59580e){_0x29c5f9=_0x59580e;return _0x59580e[_0x7b5a('0x83')](_0x5e1f40['body']['ids'],_['omit'](_0x5e1f40['body'],[_0x7b5a('0x65'),'id'])||{});}return null;})[_0x7b5a('0x66')](function(_0x27e78e){var _0x40a777;_0x5e1c03=_0x27e78e||[];var _0x308b52=[];if(_0x27e78e){for(var _0x2bef14=0x0;_0x2bef14<_0x27e78e['length'];_0x2bef14+=0x1){var _0xbc8970=_0x27e78e[_0x2bef14]['get']({'plain':!![]});_0x40a777=squel[_0x7b5a('0x7c')]()[_0x7b5a('0x69')](_0x7b5a('0x84'))[_0x7b5a('0x6a')]([_0x7b5a('0x6b'),_0x7b5a('0x6c'),_0x7b5a('0x6d'),_0x7b5a('0x5d'),_0x7b5a('0x59'),_0x7b5a('0x58')],squel[_0x7b5a('0x6e')]()[_0x7b5a('0x6f')](_0x7b5a('0x6b'),_0x7b5a('0x6b'))[_0x7b5a('0x6f')]('id',_0x7b5a('0x6c'))[_0x7b5a('0x6f')](_0xbc8970['CmListId'][_0x7b5a('0x73')](),_0x7b5a('0x6d'))[_0x7b5a('0x6f')](_0x5e1f40[_0x7b5a('0x48')]['id'][_0x7b5a('0x73')](),_0x7b5a('0x5d'))[_0x7b5a('0x6f')](_0x7b5a('0x70'),_0x7b5a('0x59'))[_0x7b5a('0x6f')](_0x7b5a('0x70'),_0x7b5a('0x58'))[_0x7b5a('0x74')](_0x7b5a('0x75'))[_0x7b5a('0x3b')](_0x7b5a('0x76'))['where'](_0x7b5a('0x77'),_0xbc8970['CmListId'][_0x7b5a('0x73')]())[_0x7b5a('0x3b')](_0x7b5a('0x7e')))[_0x7b5a('0x73')]();_0x308b52[_0x7b5a('0x7f')](db[_0x7b5a('0x80')]['query'](_0x40a777));}return BPromise[_0x7b5a('0x85')](_0x308b52);}})['then'](function(){return _0x5e1c03;})[_0x7b5a('0x27')](respondWithResult(_0x4bdd15,null))[_0x7b5a('0x46')](handleError(_0x4bdd15,null));};exports['removeBlackLists']=function(_0x48cd3c,_0x42df3e,_0x2b1a02){return db[_0x7b5a('0x41')][_0x7b5a('0x4b')]({'where':{'id':_0x48cd3c[_0x7b5a('0x48')]['id']}})['then'](handleEntityNotFound(_0x42df3e,null))[_0x7b5a('0x27')](function(_0x4e04cd){if(_0x4e04cd){return _0x4e04cd[_0x7b5a('0x86')](_0x48cd3c[_0x7b5a('0x32')]['ids']);}})[_0x7b5a('0x27')](function(_0x96f08d){if(_0x96f08d){return db[_0x7b5a('0x61')][_0x7b5a('0x24')]({'where':{'ListId':_0x48cd3c[_0x7b5a('0x32')][_0x7b5a('0x65')],'CampaignId':_0x48cd3c[_0x7b5a('0x48')]['id']}})['then'](function(){return _0x96f08d;});}})[_0x7b5a('0x27')](respondWithStatusCode(_0x42df3e,null))[_0x7b5a('0x46')](handleError(_0x42df3e,null));};
\ No newline at end of file
+var _0x2c28=['fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','NOW()','select','all','removeLists','getBlackLists','ids','push','sequelize','removeBlackLists','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','then','sendStatus','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','IvrCampaigns','getHoppers','findOne','CmHopper','CampaignId','filter','getHopperHistories','CmHopperHistory','sort','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper'];(function(_0x1d76c9,_0x51592f){var _0x52278f=function(_0x19b8b9){while(--_0x19b8b9){_0x1d76c9['push'](_0x1d76c9['shift']());}};_0x52278f(++_0x51592f);}(_0x2c28,0x12e));var _0x82c2=function(_0x2ec5b3,_0x43d52a){_0x2ec5b3=_0x2ec5b3-0x0;var _0x182a54=_0x2c28[_0x2ec5b3];return _0x182a54;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x82c2('0x0'));var rp=require('request-promise');var moment=require(_0x82c2('0x1'));var BPromise=require(_0x82c2('0x2'));var Mustache=require(_0x82c2('0x3'));var util=require('util');var path=require(_0x82c2('0x4'));var sox=require(_0x82c2('0x5'));var csv=require(_0x82c2('0x6'));var ejs=require(_0x82c2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82c2('0x8'));var squel=require(_0x82c2('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82c2('0xa'));var toCsv=require(_0x82c2('0x6'));var querystring=require(_0x82c2('0xb'));var Papa=require(_0x82c2('0xc'));var Redis=require(_0x82c2('0xd'));var authService=require(_0x82c2('0xe'));var qs=require(_0x82c2('0xf'));var as=require(_0x82c2('0x10'));var hardwareService=require(_0x82c2('0x11'));var logger=require(_0x82c2('0x12'))(_0x82c2('0x13'));var utils=require(_0x82c2('0x14'));var config=require(_0x82c2('0x15'));var licenseUtil=require(_0x82c2('0x16'));var db=require(_0x82c2('0x17'))['db'];function respondWithStatusCode(_0x5a7157,_0x386b84){_0x386b84=_0x386b84||0xcc;return function(_0x21273f){if(_0x21273f){return _0x5a7157['sendStatus'](_0x386b84);}return _0x5a7157[_0x82c2('0x18')](_0x386b84)[_0x82c2('0x19')]();};}function respondWithResult(_0x6d2b08,_0x15a885){_0x15a885=_0x15a885||0xc8;return function(_0x4b6f0d){if(_0x4b6f0d){return _0x6d2b08['status'](_0x15a885)['json'](_0x4b6f0d);}};}function respondWithFilteredResult(_0x3e4851,_0x68bb36){return function(_0x32b9b1){if(_0x32b9b1){var _0x5aba1f=typeof _0x68bb36[_0x82c2('0x1a')]==='undefined'&&typeof _0x68bb36[_0x82c2('0x1b')]===_0x82c2('0x1c');var _0xe3ceac=_0x32b9b1[_0x82c2('0x1d')];var _0x4eefb8=_0x5aba1f?0x0:_0x68bb36[_0x82c2('0x1a')];var _0x4104cc=_0x5aba1f?_0x32b9b1[_0x82c2('0x1d')]:_0x68bb36[_0x82c2('0x1a')]+_0x68bb36['limit'];var _0x408d2c;if(_0x4104cc>=_0xe3ceac){_0x4104cc=_0xe3ceac;_0x408d2c=0xc8;}else{_0x408d2c=0xce;}_0x3e4851[_0x82c2('0x18')](_0x408d2c);return _0x3e4851[_0x82c2('0x1e')](_0x82c2('0x1f'),_0x4eefb8+'-'+_0x4104cc+'/'+_0xe3ceac)[_0x82c2('0x20')](_0x32b9b1);}return null;};}function patchUpdates(_0x31e82f){return function(_0x40c328){try{jsonpatch[_0x82c2('0x21')](_0x40c328,_0x31e82f,!![]);}catch(_0x999e6f){return BPromise[_0x82c2('0x22')](_0x999e6f);}return _0x40c328['save']();};}function saveUpdates(_0x1506a9,_0x17e310){return function(_0x57bb4d){if(_0x57bb4d){return _0x57bb4d[_0x82c2('0x23')](_0x1506a9)['then'](function(_0x9ce931){return _0x9ce931;});}return null;};}function removeEntity(_0x487dbb,_0x426492){return function(_0x23c875){if(_0x23c875){return _0x23c875[_0x82c2('0x24')]()[_0x82c2('0x25')](function(){var _0x38e116=_0x23c875['get']({'plain':!![]});var _0x3c1911='IvrCampaigns';return db['UserProfileResource'][_0x82c2('0x24')]({'where':{'type':_0x3c1911,'resourceId':_0x38e116['id']}})[_0x82c2('0x25')](function(){return _0x23c875;});})[_0x82c2('0x25')](function(){_0x487dbb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18610c,_0x58f760){return function(_0x16bc93){if(!_0x16bc93){_0x18610c[_0x82c2('0x26')](0x194);}return _0x16bc93;};}function handleError(_0x1d4eb7,_0x168f37){_0x168f37=_0x168f37||0x1f4;return function(_0x4dc1dd){logger[_0x82c2('0x27')](_0x4dc1dd['stack']);if(_0x4dc1dd[_0x82c2('0x28')]){delete _0x4dc1dd[_0x82c2('0x28')];}_0x1d4eb7[_0x82c2('0x18')](_0x168f37)[_0x82c2('0x29')](_0x4dc1dd);};}exports[_0x82c2('0x2a')]=function(_0x3c0c58,_0x2ad22e){var _0x4e5825={},_0x54a65e={},_0x33e8d6={'count':0x0,'rows':[]};var _0x41584d=_[_0x82c2('0x2b')](db[_0x82c2('0x2c')][_0x82c2('0x2d')],function(_0x369a72){return{'name':_0x369a72[_0x82c2('0x2e')],'type':_0x369a72[_0x82c2('0x2f')][_0x82c2('0x30')]};});_0x54a65e[_0x82c2('0x31')]=_[_0x82c2('0x2b')](_0x41584d,_0x82c2('0x28'));_0x54a65e[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0x3c0c58['query']);_0x54a65e[_0x82c2('0x34')]=_['intersection'](_0x54a65e[_0x82c2('0x31')],_0x54a65e[_0x82c2('0x32')]);_0x4e5825[_0x82c2('0x35')]=_[_0x82c2('0x36')](_0x54a65e['model'],qs[_0x82c2('0x37')](_0x3c0c58[_0x82c2('0x32')][_0x82c2('0x37')]));_0x4e5825['attributes']=_0x4e5825[_0x82c2('0x35')][_0x82c2('0x38')]?_0x4e5825[_0x82c2('0x35')]:_0x54a65e[_0x82c2('0x31')];if(!_0x3c0c58[_0x82c2('0x32')][_0x82c2('0x39')](_0x82c2('0x3a'))){_0x4e5825[_0x82c2('0x1b')]=qs[_0x82c2('0x1b')](_0x3c0c58[_0x82c2('0x32')]['limit']);_0x4e5825['offset']=qs[_0x82c2('0x1a')](_0x3c0c58['query'][_0x82c2('0x1a')]);}_0x4e5825[_0x82c2('0x3b')]=qs['sort'](_0x3c0c58['query']['sort']);_0x4e5825[_0x82c2('0x3c')]=qs[_0x82c2('0x34')](_[_0x82c2('0x3d')](_0x3c0c58[_0x82c2('0x32')],_0x54a65e[_0x82c2('0x34')]),_0x41584d);if(_0x3c0c58[_0x82c2('0x32')]['filter']){_0x4e5825[_0x82c2('0x3c')]=_[_0x82c2('0x3e')](_0x4e5825[_0x82c2('0x3c')],{'$or':_['map'](_0x41584d,function(_0x140b9f){if(_0x140b9f['type']!==_0x82c2('0x3f')){var _0x1e1898={};_0x1e1898[_0x140b9f[_0x82c2('0x28')]]={'$like':'%'+_0x3c0c58[_0x82c2('0x32')]['filter']+'%'};return _0x1e1898;}})});}_0x4e5825=_[_0x82c2('0x3e')]({},_0x4e5825,_0x3c0c58[_0x82c2('0x40')]);var _0x396066={'where':_0x4e5825[_0x82c2('0x3c')]};return db[_0x82c2('0x2c')][_0x82c2('0x1d')](_0x396066)['then'](function(_0x4f19e7){_0x33e8d6[_0x82c2('0x1d')]=_0x4f19e7;if(_0x3c0c58[_0x82c2('0x32')][_0x82c2('0x41')]){_0x4e5825[_0x82c2('0x42')]=[{'all':!![]}];}return db[_0x82c2('0x2c')][_0x82c2('0x43')](_0x4e5825);})[_0x82c2('0x25')](function(_0x392cf8){_0x33e8d6[_0x82c2('0x44')]=_0x392cf8;return _0x33e8d6;})['then'](respondWithFilteredResult(_0x2ad22e,_0x4e5825))[_0x82c2('0x45')](handleError(_0x2ad22e,null));};exports[_0x82c2('0x46')]=function(_0x26bbd0,_0x321a80){var _0xe55b3c={'raw':![],'where':{'id':_0x26bbd0[_0x82c2('0x47')]['id']}},_0xaded8f={};_0xaded8f[_0x82c2('0x31')]=_[_0x82c2('0x33')](db[_0x82c2('0x2c')]['rawAttributes']);_0xaded8f[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0x26bbd0[_0x82c2('0x32')]);_0xaded8f['filters']=_['intersection'](_0xaded8f[_0x82c2('0x31')],_0xaded8f['query']);_0xe55b3c[_0x82c2('0x35')]=_[_0x82c2('0x36')](_0xaded8f[_0x82c2('0x31')],qs['fields'](_0x26bbd0[_0x82c2('0x32')][_0x82c2('0x37')]));_0xe55b3c[_0x82c2('0x35')]=_0xe55b3c[_0x82c2('0x35')][_0x82c2('0x38')]?_0xe55b3c['attributes']:_0xaded8f[_0x82c2('0x31')];if(_0x26bbd0[_0x82c2('0x32')][_0x82c2('0x41')]){_0xe55b3c[_0x82c2('0x42')]=[{'all':!![]}];}_0xe55b3c=_[_0x82c2('0x3e')]({},_0xe55b3c,_0x26bbd0[_0x82c2('0x40')]);return db[_0x82c2('0x2c')]['find'](_0xe55b3c)['then'](handleEntityNotFound(_0x321a80,null))['then'](respondWithResult(_0x321a80,null))[_0x82c2('0x45')](handleError(_0x321a80,null));};exports[_0x82c2('0x48')]=function(_0x209b90,_0x29c9fe){return db['Campaign'][_0x82c2('0x48')](_0x209b90[_0x82c2('0x49')],{})[_0x82c2('0x25')](function(_0x4ce7aa){var _0x5b52aa=_0x209b90[_0x82c2('0x4a')][_0x82c2('0x4b')]({'plain':!![]});if(!_0x5b52aa)throw new Error(_0x82c2('0x4c'));if(_0x5b52aa[_0x82c2('0x4d')]===_0x82c2('0x4a')){var _0x15879d=_0x4ce7aa[_0x82c2('0x4b')]({'plain':!![]});var _0x24c5d5='IvrCampaigns';return db[_0x82c2('0x4e')]['find']({'where':{'name':_0x24c5d5,'userProfileId':_0x5b52aa[_0x82c2('0x4f')]},'raw':!![]})['then'](function(_0x3f9dca){if(_0x3f9dca&&_0x3f9dca[_0x82c2('0x50')]===0x0){return db[_0x82c2('0x51')][_0x82c2('0x48')]({'name':_0x15879d['name'],'resourceId':_0x15879d['id'],'type':_0x3f9dca[_0x82c2('0x28')],'sectionId':_0x3f9dca['id']},{})[_0x82c2('0x25')](function(){return _0x4ce7aa;});}else{return _0x4ce7aa;}})[_0x82c2('0x45')](function(_0xb207e7){logger['error'](_0x82c2('0x52'),_0xb207e7);throw _0xb207e7;});}return _0x4ce7aa;})['then'](respondWithResult(_0x29c9fe,0xc9))['catch'](handleError(_0x29c9fe,null));};exports[_0x82c2('0x53')]=function(_0x5a63f3,_0x32dbe8){var _0x5d09f8={'where':{'id':_0x5a63f3[_0x82c2('0x47')]['id']}},_0x2b57a8={};_0x2b57a8['model']=_[_0x82c2('0x33')](db[_0x82c2('0x2c')]['rawAttributes']);_0x5d09f8[_0x82c2('0x35')]=_['intersection'](_0x2b57a8[_0x82c2('0x31')],qs[_0x82c2('0x37')](_0x5a63f3[_0x82c2('0x32')][_0x82c2('0x37')]));_0x5d09f8['attributes']=_0x5d09f8[_0x82c2('0x35')][_0x82c2('0x38')]?_0x5d09f8[_0x82c2('0x35')]:_0x2b57a8['model'];if(_0x5a63f3[_0x82c2('0x32')]['includeAll']){_0x5d09f8[_0x82c2('0x42')]=[{'all':!![]}];}_0x5d09f8=_[_0x82c2('0x3e')]({},_0x5d09f8,_0x5a63f3['options']);return db[_0x82c2('0x2c')][_0x82c2('0x54')](_0x5d09f8)[_0x82c2('0x25')](handleEntityNotFound(_0x32dbe8,null))[_0x82c2('0x25')](function(_0x4c2920){if(_0x4c2920){var _0x5c7254=_0x4c2920[_0x82c2('0x4b')]({'plain':!![]});_0x5c7254=qs[_0x82c2('0x55')](_0x5c7254,['id',_0x82c2('0x56'),_0x82c2('0x57')]);_0x5a63f3[_0x82c2('0x49')]=_[_0x82c2('0x55')](_0x5a63f3[_0x82c2('0x49')],['id',_0x82c2('0x56'),_0x82c2('0x57')]);return db[_0x82c2('0x2c')]['create'](_[_0x82c2('0x3e')](_0x5c7254,_0x5a63f3[_0x82c2('0x49')]),{'include':_0x5a63f3[_0x82c2('0x32')][_0x82c2('0x41')]?[{'all':!![]}]:undefined})[_0x82c2('0x25')](function(_0x3008ad){var _0x5bb472=_0x5a63f3[_0x82c2('0x4a')]['get']({'plain':!![]});if(!_0x5bb472)throw new Error(_0x82c2('0x4c'));if(_0x5bb472[_0x82c2('0x4d')]===_0x82c2('0x4a')){var _0x3bf3be=_0x3008ad[_0x82c2('0x4b')]({'plain':!![]});var _0x40639b=_0x82c2('0x58');return db['UserProfileSection'][_0x82c2('0x54')]({'where':{'name':_0x40639b,'userProfileId':_0x5bb472['userProfileId']},'raw':!![]})['then'](function(_0x1d5c0a){if(_0x1d5c0a&&_0x1d5c0a[_0x82c2('0x50')]===0x0){return db[_0x82c2('0x51')][_0x82c2('0x48')]({'name':_0x3bf3be['name'],'resourceId':_0x3bf3be['id'],'type':_0x1d5c0a[_0x82c2('0x28')],'sectionId':_0x1d5c0a['id']},{})[_0x82c2('0x25')](function(){return _0x3008ad;});}else{return _0x3008ad;}})[_0x82c2('0x45')](function(_0xccaf79){logger[_0x82c2('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xccaf79);throw _0xccaf79;});}return _0x3008ad;});}})[_0x82c2('0x25')](respondWithResult(_0x32dbe8,0xc9))[_0x82c2('0x45')](handleError(_0x32dbe8,null));};exports[_0x82c2('0x23')]=function(_0x2e6386,_0x31a921){if(_0x2e6386[_0x82c2('0x49')]['id']){delete _0x2e6386[_0x82c2('0x49')]['id'];}return db[_0x82c2('0x2c')][_0x82c2('0x54')]({'where':{'id':_0x2e6386[_0x82c2('0x47')]['id']}})['then'](handleEntityNotFound(_0x31a921,null))['then'](saveUpdates(_0x2e6386[_0x82c2('0x49')],null))[_0x82c2('0x25')](respondWithResult(_0x31a921,null))[_0x82c2('0x45')](handleError(_0x31a921,null));};exports['destroy']=function(_0x34eef5,_0x201f6b){return db[_0x82c2('0x2c')]['find']({'where':{'id':_0x34eef5[_0x82c2('0x47')]['id']}})['then'](handleEntityNotFound(_0x201f6b,null))['then'](removeEntity(_0x201f6b,null))[_0x82c2('0x45')](handleError(_0x201f6b,null));};exports[_0x82c2('0x59')]=function(_0x1caf9e,_0x5a09f8,_0x55e48f){var _0x42a9bc={'raw':!![],'where':{}};var _0x376a74={};var _0x48bb0e={'count':0x0,'rows':[]};return db[_0x82c2('0x2c')][_0x82c2('0x5a')]({'where':{'id':_0x1caf9e['params']['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x5a09f8,null))[_0x82c2('0x25')](function(_0x9ae841){if(_0x9ae841){_0x376a74[_0x82c2('0x31')]=_[_0x82c2('0x33')](db[_0x82c2('0x5b')]['rawAttributes']);_0x376a74[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0x1caf9e[_0x82c2('0x32')]);_0x376a74[_0x82c2('0x34')]=_['intersection'](_0x376a74[_0x82c2('0x31')],_0x376a74['query']);_0x42a9bc[_0x82c2('0x35')]=_[_0x82c2('0x36')](_0x376a74[_0x82c2('0x31')],qs[_0x82c2('0x37')](_0x1caf9e[_0x82c2('0x32')][_0x82c2('0x37')]));_0x42a9bc[_0x82c2('0x35')]=_0x42a9bc[_0x82c2('0x35')][_0x82c2('0x38')]?_0x42a9bc[_0x82c2('0x35')]:_0x376a74[_0x82c2('0x31')];if(!_0x1caf9e['query']['hasOwnProperty'](_0x82c2('0x3a'))){_0x42a9bc['limit']=qs[_0x82c2('0x1b')](_0x1caf9e[_0x82c2('0x32')]['limit']);_0x42a9bc[_0x82c2('0x1a')]=qs[_0x82c2('0x1a')](_0x1caf9e[_0x82c2('0x32')]['offset']);}_0x42a9bc[_0x82c2('0x3b')]=qs['sort'](_0x1caf9e[_0x82c2('0x32')]['sort']);_0x42a9bc[_0x82c2('0x3c')]=qs['filters'](_['pick'](_0x1caf9e[_0x82c2('0x32')],_0x376a74['filters']));_0x42a9bc[_0x82c2('0x3c')][_0x82c2('0x5c')]=_0x9ae841['id'];if(_0x1caf9e[_0x82c2('0x32')][_0x82c2('0x5d')]){_0x42a9bc[_0x82c2('0x3c')]=_[_0x82c2('0x3e')](_0x42a9bc[_0x82c2('0x3c')],{'$or':_[_0x82c2('0x2b')](_0x42a9bc[_0x82c2('0x35')],function(_0xec74e9){var _0xc72865={};_0xc72865[_0xec74e9]={'$like':'%'+_0x1caf9e[_0x82c2('0x32')]['filter']+'%'};return _0xc72865;})});}_0x42a9bc=_[_0x82c2('0x3e')]({},_0x42a9bc,_0x1caf9e[_0x82c2('0x40')]);return db['CmHopper']['count']({'where':_0x42a9bc[_0x82c2('0x3c')]})[_0x82c2('0x25')](function(_0x2713f7){_0x48bb0e[_0x82c2('0x1d')]=_0x2713f7;if(_0x1caf9e[_0x82c2('0x32')][_0x82c2('0x41')]){_0x42a9bc[_0x82c2('0x42')]=[{'all':!![]}];}return db[_0x82c2('0x5b')][_0x82c2('0x43')](_0x42a9bc);})[_0x82c2('0x25')](function(_0x46ac86){_0x48bb0e[_0x82c2('0x44')]=_0x46ac86;return _0x48bb0e;});}})[_0x82c2('0x25')](respondWithFilteredResult(_0x5a09f8,_0x42a9bc))[_0x82c2('0x45')](handleError(_0x5a09f8,null));};exports[_0x82c2('0x5e')]=function(_0x537914,_0x91699,_0xe341d0){var _0x46e141={'raw':!![],'where':{}};var _0x4809aa={};var _0x499804={'count':0x0,'rows':[]};return db[_0x82c2('0x2c')]['findOne']({'where':{'id':_0x537914['params']['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x91699,null))[_0x82c2('0x25')](function(_0x2ee2bd){if(_0x2ee2bd){_0x4809aa['model']=_['keys'](db[_0x82c2('0x5f')][_0x82c2('0x2d')]);_0x4809aa[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0x537914[_0x82c2('0x32')]);_0x4809aa[_0x82c2('0x34')]=_[_0x82c2('0x36')](_0x4809aa['model'],_0x4809aa['query']);_0x46e141[_0x82c2('0x35')]=_[_0x82c2('0x36')](_0x4809aa['model'],qs[_0x82c2('0x37')](_0x537914[_0x82c2('0x32')][_0x82c2('0x37')]));_0x46e141['attributes']=_0x46e141[_0x82c2('0x35')][_0x82c2('0x38')]?_0x46e141['attributes']:_0x4809aa['model'];if(!_0x537914['query']['hasOwnProperty']('nolimit')){_0x46e141[_0x82c2('0x1b')]=qs[_0x82c2('0x1b')](_0x537914[_0x82c2('0x32')][_0x82c2('0x1b')]);_0x46e141['offset']=qs[_0x82c2('0x1a')](_0x537914[_0x82c2('0x32')][_0x82c2('0x1a')]);}_0x46e141[_0x82c2('0x3b')]=qs['sort'](_0x537914[_0x82c2('0x32')][_0x82c2('0x60')]);_0x46e141[_0x82c2('0x3c')]=qs[_0x82c2('0x34')](_[_0x82c2('0x3d')](_0x537914[_0x82c2('0x32')],_0x4809aa['filters']));_0x46e141[_0x82c2('0x3c')]['CampaignId']=_0x2ee2bd['id'];if(_0x537914[_0x82c2('0x32')][_0x82c2('0x5d')]){_0x46e141['where']=_[_0x82c2('0x3e')](_0x46e141[_0x82c2('0x3c')],{'$or':_[_0x82c2('0x2b')](_0x46e141[_0x82c2('0x35')],function(_0x553c80){var _0x37e866={};_0x37e866[_0x553c80]={'$like':'%'+_0x537914[_0x82c2('0x32')][_0x82c2('0x5d')]+'%'};return _0x37e866;})});}_0x46e141=_[_0x82c2('0x3e')]({},_0x46e141,_0x537914[_0x82c2('0x40')]);return db[_0x82c2('0x5f')]['count']({'where':_0x46e141['where']})[_0x82c2('0x25')](function(_0x57d589){_0x499804[_0x82c2('0x1d')]=_0x57d589;if(_0x537914[_0x82c2('0x32')]['includeAll']){_0x46e141[_0x82c2('0x42')]=[{'all':!![]}];}return db[_0x82c2('0x5f')][_0x82c2('0x43')](_0x46e141);})[_0x82c2('0x25')](function(_0x41f02b){_0x499804[_0x82c2('0x44')]=_0x41f02b;return _0x499804;});}})[_0x82c2('0x25')](respondWithFilteredResult(_0x91699,_0x46e141))['catch'](handleError(_0x91699,null));};exports[_0x82c2('0x61')]=function(_0xf8cab4,_0xba4db5,_0x46752c){var _0x3e41af={'raw':!![],'where':{}};var _0x124723={};var _0xf85f1d={'count':0x0,'rows':[]};return db[_0x82c2('0x2c')][_0x82c2('0x5a')]({'where':{'id':_0xf8cab4[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0xba4db5,null))[_0x82c2('0x25')](function(_0x5e3637){if(_0x5e3637){_0x124723[_0x82c2('0x31')]=_['keys'](db[_0x82c2('0x62')][_0x82c2('0x2d')]);_0x124723[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0xf8cab4[_0x82c2('0x32')]);_0x124723[_0x82c2('0x34')]=_['intersection'](_0x124723[_0x82c2('0x31')],_0x124723['query']);_0x3e41af[_0x82c2('0x35')]=_[_0x82c2('0x36')](_0x124723[_0x82c2('0x31')],qs[_0x82c2('0x37')](_0xf8cab4[_0x82c2('0x32')][_0x82c2('0x37')]));_0x3e41af['attributes']=_0x3e41af[_0x82c2('0x35')][_0x82c2('0x38')]?_0x3e41af[_0x82c2('0x35')]:_0x124723[_0x82c2('0x31')];if(!_0xf8cab4['query'][_0x82c2('0x39')](_0x82c2('0x3a'))){_0x3e41af[_0x82c2('0x1b')]=qs['limit'](_0xf8cab4[_0x82c2('0x32')][_0x82c2('0x1b')]);_0x3e41af[_0x82c2('0x1a')]=qs[_0x82c2('0x1a')](_0xf8cab4['query']['offset']);}_0x3e41af[_0x82c2('0x3b')]=qs[_0x82c2('0x60')](_0xf8cab4[_0x82c2('0x32')][_0x82c2('0x60')]);_0x3e41af[_0x82c2('0x3c')]=qs['filters'](_[_0x82c2('0x3d')](_0xf8cab4['query'],_0x124723[_0x82c2('0x34')]));_0x3e41af[_0x82c2('0x3c')]['CampaignId']=_0x5e3637['id'];if(_0xf8cab4['query']['filter']){_0x3e41af[_0x82c2('0x3c')]=_['merge'](_0x3e41af[_0x82c2('0x3c')],{'$or':_[_0x82c2('0x2b')](_0x3e41af[_0x82c2('0x35')],function(_0x15c674){var _0x152907={};_0x152907[_0x15c674]={'$like':'%'+_0xf8cab4[_0x82c2('0x32')][_0x82c2('0x5d')]+'%'};return _0x152907;})});}_0x3e41af=_[_0x82c2('0x3e')]({},_0x3e41af,_0xf8cab4[_0x82c2('0x40')]);return db[_0x82c2('0x62')][_0x82c2('0x1d')]({'where':_0x3e41af[_0x82c2('0x3c')]})[_0x82c2('0x25')](function(_0x585712){_0xf85f1d['count']=_0x585712;if(_0xf8cab4[_0x82c2('0x32')][_0x82c2('0x41')]){_0x3e41af[_0x82c2('0x42')]=[{'all':!![]}];}return db[_0x82c2('0x62')][_0x82c2('0x43')](_0x3e41af);})[_0x82c2('0x25')](function(_0x13ad4b){_0xf85f1d[_0x82c2('0x44')]=_0x13ad4b;return _0xf85f1d;});}})[_0x82c2('0x25')](respondWithFilteredResult(_0xba4db5,_0x3e41af))['catch'](handleError(_0xba4db5,null));};exports[_0x82c2('0x63')]=function(_0x165e17,_0x473660,_0x5a5afe){var _0x5d0dcf={'raw':!![],'where':{}};var _0x18c91e={};var _0x4a7315={'count':0x0,'rows':[]};return db['Campaign'][_0x82c2('0x5a')]({'where':{'id':_0x165e17['params']['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x473660,null))['then'](function(_0x37da0a){if(_0x37da0a){_0x18c91e['model']=_[_0x82c2('0x33')](db[_0x82c2('0x64')]['rawAttributes']);_0x18c91e[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0x165e17[_0x82c2('0x32')]);_0x18c91e['filters']=_['intersection'](_0x18c91e['model'],_0x18c91e[_0x82c2('0x32')]);_0x5d0dcf[_0x82c2('0x35')]=_[_0x82c2('0x36')](_0x18c91e[_0x82c2('0x31')],qs[_0x82c2('0x37')](_0x165e17[_0x82c2('0x32')]['fields']));_0x5d0dcf[_0x82c2('0x35')]=_0x5d0dcf['attributes']['length']?_0x5d0dcf[_0x82c2('0x35')]:_0x18c91e['model'];if(!_0x165e17[_0x82c2('0x32')][_0x82c2('0x39')](_0x82c2('0x3a'))){_0x5d0dcf[_0x82c2('0x1b')]=qs[_0x82c2('0x1b')](_0x165e17[_0x82c2('0x32')]['limit']);_0x5d0dcf['offset']=qs[_0x82c2('0x1a')](_0x165e17[_0x82c2('0x32')][_0x82c2('0x1a')]);}_0x5d0dcf['order']=qs[_0x82c2('0x60')](_0x165e17[_0x82c2('0x32')][_0x82c2('0x60')]);_0x5d0dcf[_0x82c2('0x3c')]=qs[_0x82c2('0x34')](_[_0x82c2('0x3d')](_0x165e17[_0x82c2('0x32')],_0x18c91e[_0x82c2('0x34')]));_0x5d0dcf[_0x82c2('0x3c')]['CampaignId']=_0x37da0a['id'];if(_0x165e17['query'][_0x82c2('0x5d')]){_0x5d0dcf['where']=_[_0x82c2('0x3e')](_0x5d0dcf[_0x82c2('0x3c')],{'$or':_[_0x82c2('0x2b')](_0x5d0dcf[_0x82c2('0x35')],function(_0x11b785){var _0x49642e={};_0x49642e[_0x11b785]={'$like':'%'+_0x165e17[_0x82c2('0x32')][_0x82c2('0x5d')]+'%'};return _0x49642e;})});}_0x5d0dcf=_[_0x82c2('0x3e')]({},_0x5d0dcf,_0x165e17['options']);return db[_0x82c2('0x64')][_0x82c2('0x1d')]({'where':_0x5d0dcf['where']})[_0x82c2('0x25')](function(_0x32b653){_0x4a7315[_0x82c2('0x1d')]=_0x32b653;if(_0x165e17[_0x82c2('0x32')][_0x82c2('0x41')]){_0x5d0dcf[_0x82c2('0x42')]=[{'all':!![]}];}return db[_0x82c2('0x64')][_0x82c2('0x43')](_0x5d0dcf);})[_0x82c2('0x25')](function(_0x26398d){_0x4a7315['rows']=_0x26398d;return _0x4a7315;});}})[_0x82c2('0x25')](respondWithFilteredResult(_0x473660,_0x5d0dcf))[_0x82c2('0x45')](handleError(_0x473660,null));};exports[_0x82c2('0x65')]=function(_0x339fef,_0x351818,_0x3309cf){var _0x5436ac={};var _0x32f6b8={};var _0x138764;var _0x208f6c;return db[_0x82c2('0x2c')]['findOne']({'where':{'id':_0x339fef[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x351818,null))[_0x82c2('0x25')](function(_0x277e09){if(_0x277e09){_0x138764=_0x277e09;_0x32f6b8[_0x82c2('0x31')]=_[_0x82c2('0x33')](db[_0x82c2('0x66')][_0x82c2('0x2d')]);_0x32f6b8[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0x339fef['query']);_0x32f6b8[_0x82c2('0x34')]=_[_0x82c2('0x36')](_0x32f6b8[_0x82c2('0x31')],_0x32f6b8['query']);_0x5436ac[_0x82c2('0x35')]=_[_0x82c2('0x36')](_0x32f6b8['model'],qs[_0x82c2('0x37')](_0x339fef[_0x82c2('0x32')][_0x82c2('0x37')]));_0x5436ac[_0x82c2('0x35')]=_0x5436ac['attributes'][_0x82c2('0x38')]?_0x5436ac['attributes']:_0x32f6b8['model'];_0x5436ac[_0x82c2('0x3b')]=qs[_0x82c2('0x60')](_0x339fef[_0x82c2('0x32')]['sort']);_0x5436ac[_0x82c2('0x3c')]=qs[_0x82c2('0x34')](_[_0x82c2('0x3d')](_0x339fef['query'],_0x32f6b8[_0x82c2('0x34')]));if(_0x339fef['query'][_0x82c2('0x5d')]){_0x5436ac[_0x82c2('0x3c')]=_['merge'](_0x5436ac[_0x82c2('0x3c')],{'$or':_[_0x82c2('0x2b')](_0x5436ac[_0x82c2('0x35')],function(_0x252245){var _0x1e9bf9={};_0x1e9bf9[_0x252245]={'$like':'%'+_0x339fef[_0x82c2('0x32')][_0x82c2('0x5d')]+'%'};return _0x1e9bf9;})});}_0x5436ac=_[_0x82c2('0x3e')]({},_0x5436ac,_0x339fef[_0x82c2('0x40')]);return _0x138764[_0x82c2('0x65')](_0x5436ac);}})[_0x82c2('0x25')](function(_0x4ffbf8){if(_0x4ffbf8){_0x208f6c=_0x4ffbf8[_0x82c2('0x38')];if(!_0x339fef[_0x82c2('0x32')][_0x82c2('0x39')](_0x82c2('0x3a'))){_0x5436ac['limit']=qs[_0x82c2('0x1b')](_0x339fef[_0x82c2('0x32')][_0x82c2('0x1b')]);_0x5436ac[_0x82c2('0x1a')]=qs[_0x82c2('0x1a')](_0x339fef[_0x82c2('0x32')]['offset']);}return _0x138764[_0x82c2('0x65')](_0x5436ac);}})[_0x82c2('0x25')](function(_0x145669){if(_0x145669){return _0x145669?{'count':_0x208f6c,'rows':_0x145669}:null;}})[_0x82c2('0x25')](respondWithResult(_0x351818,null))[_0x82c2('0x45')](handleError(_0x351818,null));};exports[_0x82c2('0x67')]=function(_0x2d9d74,_0x2a9636,_0x5bde5f){var _0x3643d1,_0x2348d7;return db[_0x82c2('0x2c')][_0x82c2('0x54')]({'where':{'id':_0x2d9d74['params']['id']}})['then'](handleEntityNotFound(_0x2a9636,null))[_0x82c2('0x25')](function(_0x2ec5ab){if(_0x2ec5ab){_0x2348d7=_0x2ec5ab;return _0x2ec5ab['addLists'](_0x2d9d74[_0x82c2('0x49')]['ids'],_[_0x82c2('0x55')](_0x2d9d74['body'],['ids','id'])||{});}return null;})[_0x82c2('0x68')](function(_0x387666){var _0x14d9b7;_0x3643d1=_0x387666||[];var _0x3cde40=[];if(_0x387666){for(var _0x447074=0x0;_0x447074<_0x387666[_0x82c2('0x38')];_0x447074+=0x1){var _0x508296=_0x387666[_0x447074][_0x82c2('0x4b')]({'plain':!![]});_0x2348d7[_0x82c2('0x69')]=_0x2d9d74['body'][_0x82c2('0x69')]?_0x2d9d74[_0x82c2('0x49')]['dialCheckDuplicateType']:_0x2348d7[_0x82c2('0x69')];switch(_0x2348d7[_0x82c2('0x69')]){case _0x82c2('0x6a'):_0x14d9b7=squel[_0x82c2('0x6b')]()['into'](_0x82c2('0x6c'))[_0x82c2('0x6d')]([_0x82c2('0x6e'),_0x82c2('0x6f'),_0x82c2('0x70'),_0x82c2('0x71'),'CampaignId','createdAt',_0x82c2('0x57')],squel['select']()['field'](_0x82c2('0x6e'),'phone')[_0x82c2('0x72')]('NOW()',_0x82c2('0x6f'))[_0x82c2('0x72')]('id','ContactId')[_0x82c2('0x72')](_0x508296[_0x82c2('0x73')][_0x82c2('0x74')](),_0x82c2('0x71'))[_0x82c2('0x72')](_0x2d9d74[_0x82c2('0x47')]['id'][_0x82c2('0x74')](),_0x82c2('0x5c'))[_0x82c2('0x72')]('NOW()',_0x82c2('0x56'))[_0x82c2('0x72')]('NOW()','updatedAt')[_0x82c2('0x75')](_0x82c2('0x76'))['where'](_0x82c2('0x77'))[_0x82c2('0x3c')](_0x82c2('0x78'),_0x508296['CmListId'][_0x82c2('0x74')]())[_0x82c2('0x3c')](_0x82c2('0x79'))[_0x82c2('0x3c')](_0x82c2('0x7a'),squel['select']()[_0x82c2('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0x82c2('0x75')](_0x82c2('0x7b'))['where'](_0x82c2('0x7c'),_0x2d9d74['params']['id'][_0x82c2('0x74')]()))[_0x82c2('0x3c')](_0x82c2('0x7a'),squel['select']()[_0x82c2('0x72')](_0x82c2('0x7d'))[_0x82c2('0x75')](_0x82c2('0x6c'))[_0x82c2('0x3c')]('CampaignId\x20=\x20?',_0x2d9d74[_0x82c2('0x47')]['id'][_0x82c2('0x74')]())))[_0x82c2('0x74')]();break;case _0x82c2('0x7e'):_0x14d9b7=squel[_0x82c2('0x6b')]()[_0x82c2('0x7f')](_0x82c2('0x6c'))['fromQuery']([_0x82c2('0x6e'),_0x82c2('0x6f'),_0x82c2('0x70'),'ListId','CampaignId',_0x82c2('0x56'),'updatedAt'],squel['select']()[_0x82c2('0x72')]('phone','phone')[_0x82c2('0x72')](_0x82c2('0x80'),_0x82c2('0x6f'))['field']('id','ContactId')[_0x82c2('0x72')](_0x508296[_0x82c2('0x73')]['toString'](),_0x82c2('0x71'))[_0x82c2('0x72')](_0x2d9d74[_0x82c2('0x47')]['id']['toString'](),_0x82c2('0x5c'))[_0x82c2('0x72')](_0x82c2('0x80'),_0x82c2('0x56'))['field'](_0x82c2('0x80'),_0x82c2('0x57'))[_0x82c2('0x75')](_0x82c2('0x76'))[_0x82c2('0x3c')](_0x82c2('0x77'))[_0x82c2('0x3c')](_0x82c2('0x78'),_0x508296['CmListId']['toString']())[_0x82c2('0x3c')](_0x82c2('0x79'))[_0x82c2('0x3c')](_0x82c2('0x7a'),squel[_0x82c2('0x81')]()[_0x82c2('0x72')](_0x82c2('0x7d'))['from'](_0x82c2('0x6c'))['where']('CampaignId\x20=\x20?',_0x2d9d74[_0x82c2('0x47')]['id'][_0x82c2('0x74')]())))['toString']();break;default:_0x14d9b7=squel[_0x82c2('0x6b')]()[_0x82c2('0x7f')]('cm_hopper')[_0x82c2('0x6d')]([_0x82c2('0x6e'),_0x82c2('0x6f'),_0x82c2('0x70'),_0x82c2('0x71'),_0x82c2('0x5c'),_0x82c2('0x56'),'updatedAt'],squel[_0x82c2('0x81')]()[_0x82c2('0x72')](_0x82c2('0x6e'),_0x82c2('0x6e'))[_0x82c2('0x72')]('NOW()',_0x82c2('0x6f'))[_0x82c2('0x72')]('id',_0x82c2('0x70'))[_0x82c2('0x72')](_0x508296['CmListId'][_0x82c2('0x74')](),_0x82c2('0x71'))[_0x82c2('0x72')](_0x2d9d74[_0x82c2('0x47')]['id']['toString'](),_0x82c2('0x5c'))['field'](_0x82c2('0x80'),'createdAt')[_0x82c2('0x72')]('NOW()',_0x82c2('0x57'))[_0x82c2('0x75')]('cm_contacts')[_0x82c2('0x3c')](_0x82c2('0x77'))[_0x82c2('0x3c')](_0x82c2('0x78'),_0x508296[_0x82c2('0x73')]['toString']())[_0x82c2('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x3cde40['push'](db['sequelize'][_0x82c2('0x32')](_0x14d9b7));}return BPromise[_0x82c2('0x82')](_0x3cde40);}})[_0x82c2('0x25')](function(){return _0x3643d1;})[_0x82c2('0x25')](respondWithResult(_0x2a9636,null))[_0x82c2('0x45')](handleError(_0x2a9636,null));};exports['removeLists']=function(_0x1d7e1e,_0x359d9a,_0x490e63){return db[_0x82c2('0x2c')][_0x82c2('0x54')]({'where':{'id':_0x1d7e1e[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x359d9a,null))[_0x82c2('0x25')](function(_0xeacab3){if(_0xeacab3){return _0xeacab3[_0x82c2('0x83')](_0x1d7e1e[_0x82c2('0x32')]['ids']);}})[_0x82c2('0x25')](function(_0x77dd0b){if(_0x77dd0b){return db[_0x82c2('0x5b')][_0x82c2('0x24')]({'where':{'ListId':_0x1d7e1e[_0x82c2('0x32')]['ids'],'CampaignId':_0x1d7e1e[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](function(){return _0x77dd0b;});}})[_0x82c2('0x25')](respondWithStatusCode(_0x359d9a,null))['catch'](handleError(_0x359d9a,null));};exports['getBlackLists']=function(_0x215b9e,_0x134082,_0x5b067b){var _0x14158e={};var _0x4c7ee0={};var _0x2b27df;var _0x345650;return db[_0x82c2('0x2c')][_0x82c2('0x5a')]({'where':{'id':_0x215b9e[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x134082,null))[_0x82c2('0x25')](function(_0xf4f4e3){if(_0xf4f4e3){_0x2b27df=_0xf4f4e3;_0x4c7ee0[_0x82c2('0x31')]=_[_0x82c2('0x33')](db[_0x82c2('0x66')][_0x82c2('0x2d')]);_0x4c7ee0[_0x82c2('0x32')]=_[_0x82c2('0x33')](_0x215b9e[_0x82c2('0x32')]);_0x4c7ee0['filters']=_['intersection'](_0x4c7ee0[_0x82c2('0x31')],_0x4c7ee0[_0x82c2('0x32')]);_0x14158e['attributes']=_['intersection'](_0x4c7ee0[_0x82c2('0x31')],qs[_0x82c2('0x37')](_0x215b9e['query'][_0x82c2('0x37')]));_0x14158e[_0x82c2('0x35')]=_0x14158e[_0x82c2('0x35')][_0x82c2('0x38')]?_0x14158e[_0x82c2('0x35')]:_0x4c7ee0[_0x82c2('0x31')];_0x14158e[_0x82c2('0x3b')]=qs[_0x82c2('0x60')](_0x215b9e[_0x82c2('0x32')][_0x82c2('0x60')]);_0x14158e[_0x82c2('0x3c')]=qs[_0x82c2('0x34')](_[_0x82c2('0x3d')](_0x215b9e[_0x82c2('0x32')],_0x4c7ee0[_0x82c2('0x34')]));if(_0x215b9e[_0x82c2('0x32')][_0x82c2('0x5d')]){_0x14158e['where']=_[_0x82c2('0x3e')](_0x14158e['where'],{'$or':_[_0x82c2('0x2b')](_0x14158e[_0x82c2('0x35')],function(_0x285c3f){var _0x1d70dd={};_0x1d70dd[_0x285c3f]={'$like':'%'+_0x215b9e[_0x82c2('0x32')][_0x82c2('0x5d')]+'%'};return _0x1d70dd;})});}_0x14158e=_[_0x82c2('0x3e')]({},_0x14158e,_0x215b9e[_0x82c2('0x40')]);return _0x2b27df[_0x82c2('0x84')](_0x14158e);}})[_0x82c2('0x25')](function(_0x2e5be2){if(_0x2e5be2){_0x345650=_0x2e5be2['length'];if(!_0x215b9e[_0x82c2('0x32')]['hasOwnProperty'](_0x82c2('0x3a'))){_0x14158e[_0x82c2('0x1b')]=qs['limit'](_0x215b9e[_0x82c2('0x32')][_0x82c2('0x1b')]);_0x14158e[_0x82c2('0x1a')]=qs[_0x82c2('0x1a')](_0x215b9e['query'][_0x82c2('0x1a')]);}return _0x2b27df[_0x82c2('0x84')](_0x14158e);}})['then'](function(_0x1aafa5){if(_0x1aafa5){return _0x1aafa5?{'count':_0x345650,'rows':_0x1aafa5}:null;}})[_0x82c2('0x25')](respondWithResult(_0x134082,null))[_0x82c2('0x45')](handleError(_0x134082,null));};exports['addBlackLists']=function(_0x2e4c15,_0x2abafe,_0xe44c0b){var _0x593885,_0x5b24a1;return db[_0x82c2('0x2c')][_0x82c2('0x54')]({'where':{'id':_0x2e4c15[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x2abafe,null))[_0x82c2('0x25')](function(_0x2a35a1){if(_0x2a35a1){_0x5b24a1=_0x2a35a1;return _0x2a35a1['addBlackLists'](_0x2e4c15[_0x82c2('0x49')][_0x82c2('0x85')],_[_0x82c2('0x55')](_0x2e4c15['body'],[_0x82c2('0x85'),'id'])||{});}return null;})[_0x82c2('0x68')](function(_0x28d8a4){var _0x1dffb4;_0x593885=_0x28d8a4||[];var _0x378ada=[];if(_0x28d8a4){for(var _0x5edf46=0x0;_0x5edf46<_0x28d8a4[_0x82c2('0x38')];_0x5edf46+=0x1){var _0x3c8f7b=_0x28d8a4[_0x5edf46][_0x82c2('0x4b')]({'plain':!![]});_0x1dffb4=squel[_0x82c2('0x6b')]()[_0x82c2('0x7f')]('cm_hopper_black')[_0x82c2('0x6d')]([_0x82c2('0x6e'),_0x82c2('0x70'),_0x82c2('0x71'),_0x82c2('0x5c'),_0x82c2('0x56'),_0x82c2('0x57')],squel['select']()[_0x82c2('0x72')]('phone','phone')[_0x82c2('0x72')]('id','ContactId')[_0x82c2('0x72')](_0x3c8f7b[_0x82c2('0x73')]['toString'](),_0x82c2('0x71'))[_0x82c2('0x72')](_0x2e4c15[_0x82c2('0x47')]['id'][_0x82c2('0x74')](),'CampaignId')['field'](_0x82c2('0x80'),_0x82c2('0x56'))[_0x82c2('0x72')](_0x82c2('0x80'),_0x82c2('0x57'))['from'](_0x82c2('0x76'))[_0x82c2('0x3c')](_0x82c2('0x77'))[_0x82c2('0x3c')](_0x82c2('0x78'),_0x3c8f7b[_0x82c2('0x73')][_0x82c2('0x74')]())['where'](_0x82c2('0x79')))['toString']();_0x378ada[_0x82c2('0x86')](db[_0x82c2('0x87')]['query'](_0x1dffb4));}return BPromise['all'](_0x378ada);}})['then'](function(){return _0x593885;})[_0x82c2('0x25')](respondWithResult(_0x2abafe,null))[_0x82c2('0x45')](handleError(_0x2abafe,null));};exports[_0x82c2('0x88')]=function(_0x479f3f,_0x3376c3,_0x556900){return db['Campaign'][_0x82c2('0x54')]({'where':{'id':_0x479f3f[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](handleEntityNotFound(_0x3376c3,null))[_0x82c2('0x25')](function(_0x1e7d4f){if(_0x1e7d4f){return _0x1e7d4f[_0x82c2('0x88')](_0x479f3f[_0x82c2('0x32')][_0x82c2('0x85')]);}})['then'](function(_0x3582da){if(_0x3582da){return db[_0x82c2('0x64')][_0x82c2('0x24')]({'where':{'ListId':_0x479f3f[_0x82c2('0x32')][_0x82c2('0x85')],'CampaignId':_0x479f3f[_0x82c2('0x47')]['id']}})[_0x82c2('0x25')](function(){return _0x3582da;});}})[_0x82c2('0x25')](respondWithStatusCode(_0x3376c3,null))['catch'](handleError(_0x3376c3,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 26e0932..6a999fd 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 00f39aa..1a98ab9 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 _0xa3b9=['Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','Campaign','findAll','raw','where','options','attributes','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0xa3b9,0x112));var _0x9a3b=function(_0x413da3,_0xac67d4){_0x413da3=_0x413da3-0x0;var _0x14c946=_0xa3b9[_0x413da3];return _0x14c946;};'use strict';var _=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var moment=require(_0x9a3b('0x2'));var BPromise=require(_0x9a3b('0x3'));var rs=require(_0x9a3b('0x4'));var fs=require('fs');var Redis=require(_0x9a3b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a3b('0x6'));var logger=require(_0x9a3b('0x7'))(_0x9a3b('0x8'));var config=require(_0x9a3b('0x9'));var jayson=require(_0x9a3b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a6a0d,_0x2357b8,_0x242fbe){return new BPromise(function(_0x2da1e2,_0x204d1f){return client[_0x9a3b('0xb')](_0x3a6a0d,_0x242fbe)[_0x9a3b('0xc')](function(_0x593fef){logger[_0x9a3b('0xd')](_0x9a3b('0xe'),_0x2357b8,_0x9a3b('0xf'));logger[_0x9a3b('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2357b8,_0x9a3b('0xf'),JSON[_0x9a3b('0x11')](_0x593fef));if(_0x593fef[_0x9a3b('0x12')]){if(_0x593fef['error']['code']===0x1f4){logger[_0x9a3b('0x12')]('Campaign,\x20%s,\x20%s',_0x2357b8,_0x593fef['error'][_0x9a3b('0x13')]);return _0x204d1f(_0x593fef[_0x9a3b('0x12')]['message']);}logger[_0x9a3b('0x12')]('Campaign,\x20%s,\x20%s',_0x2357b8,_0x593fef[_0x9a3b('0x12')][_0x9a3b('0x13')]);return _0x2da1e2(_0x593fef[_0x9a3b('0x12')]['message']);}else{logger['info'](_0x9a3b('0xe'),_0x2357b8,'request\x20sent');_0x2da1e2(_0x593fef[_0x9a3b('0x14')][_0x9a3b('0x13')]);}})[_0x9a3b('0x15')](function(_0x43126b){logger[_0x9a3b('0x12')]('Campaign,\x20%s,\x20%s',_0x2357b8,_0x43126b);_0x204d1f(_0x43126b);});});}exports['GetCampaign']=function(_0xa2975){var _0x2dbf3b=this;return new Promise(function(_0x5c1af2,_0x22cbbb){return db[_0x9a3b('0x16')][_0x9a3b('0x17')]({'raw':_0xa2975['options']?_0xa2975['options'][_0x9a3b('0x18')]===undefined?!![]:![]:!![],'where':_0xa2975['options']?_0xa2975['options'][_0x9a3b('0x19')]||null:null,'attributes':_0xa2975[_0x9a3b('0x1a')]?_0xa2975[_0x9a3b('0x1a')][_0x9a3b('0x1b')]||null:null,'limit':_0xa2975[_0x9a3b('0x1a')]?_0xa2975[_0x9a3b('0x1a')]['limit']||null:null,'include':_0xa2975[_0x9a3b('0x1a')]?_0xa2975[_0x9a3b('0x1a')][_0x9a3b('0x1c')]?_[_0x9a3b('0x1d')](_0xa2975[_0x9a3b('0x1a')][_0x9a3b('0x1c')],function(_0x3b32d8){return{'model':db[_0x3b32d8[_0x9a3b('0x1e')]],'as':_0x3b32d8['as'],'attributes':_0x3b32d8['attributes'],'include':_0x3b32d8[_0x9a3b('0x1c')]?_[_0x9a3b('0x1d')](_0x3b32d8['include'],function(_0x58648d){return{'model':db[_0x58648d[_0x9a3b('0x1e')]],'as':_0x58648d['as'],'attributes':_0x58648d[_0x9a3b('0x1b')],'include':_0x58648d[_0x9a3b('0x1c')]?_[_0x9a3b('0x1d')](_0x58648d['include'],function(_0x895da0){return{'model':db[_0x895da0[_0x9a3b('0x1e')]],'as':_0x895da0['as'],'attributes':_0x895da0[_0x9a3b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9a3b('0xc')](function(_0x363f75){logger[_0x9a3b('0xd')]('GetCampaign',_0xa2975);logger[_0x9a3b('0x10')](_0x9a3b('0x1f'),_0xa2975,JSON[_0x9a3b('0x11')](_0x363f75));_0x5c1af2(_0x363f75);})[_0x9a3b('0x15')](function(_0x31d542){logger['error'](_0x9a3b('0x1f'),_0x31d542[_0x9a3b('0x13')],_0xa2975);_0x22cbbb(_0x2dbf3b[_0x9a3b('0x12')](0x1f4,_0x31d542[_0x9a3b('0x13')]));});});};
\ No newline at end of file
+var _0xc252=['raw','where','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options'];(function(_0x189a72,_0x4ac342){var _0x2b457a=function(_0x151b57){while(--_0x151b57){_0x189a72['push'](_0x189a72['shift']());}};_0x2b457a(++_0x4ac342);}(_0xc252,0x118));var _0x2c25=function(_0xcd2083,_0x44327f){_0xcd2083=_0xcd2083-0x0;var _0x25e4c5=_0xc252[_0xcd2083];return _0x25e4c5;};'use strict';var _=require(_0x2c25('0x0'));var util=require(_0x2c25('0x1'));var moment=require(_0x2c25('0x2'));var BPromise=require(_0x2c25('0x3'));var rs=require(_0x2c25('0x4'));var fs=require('fs');var Redis=require(_0x2c25('0x5'));var db=require(_0x2c25('0x6'))['db'];var utils=require(_0x2c25('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2c25('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2c25('0x9')][_0x2c25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39972f,_0x1ec60a,_0x5f1278){return new BPromise(function(_0x491314,_0x16f20){return client[_0x2c25('0xb')](_0x39972f,_0x5f1278)[_0x2c25('0xc')](function(_0x1f927e){logger[_0x2c25('0xd')](_0x2c25('0xe'),_0x1ec60a,_0x2c25('0xf'));logger['debug'](_0x2c25('0x10'),_0x1ec60a,'request\x20sent',JSON[_0x2c25('0x11')](_0x1f927e));if(_0x1f927e['error']){if(_0x1f927e[_0x2c25('0x12')][_0x2c25('0x13')]===0x1f4){logger['error'](_0x2c25('0xe'),_0x1ec60a,_0x1f927e[_0x2c25('0x12')]['message']);return _0x16f20(_0x1f927e['error'][_0x2c25('0x14')]);}logger[_0x2c25('0x12')](_0x2c25('0xe'),_0x1ec60a,_0x1f927e[_0x2c25('0x12')][_0x2c25('0x14')]);return _0x491314(_0x1f927e[_0x2c25('0x12')][_0x2c25('0x14')]);}else{logger[_0x2c25('0xd')](_0x2c25('0xe'),_0x1ec60a,'request\x20sent');_0x491314(_0x1f927e['result'][_0x2c25('0x14')]);}})[_0x2c25('0x15')](function(_0x8b04ce){logger['error'](_0x2c25('0xe'),_0x1ec60a,_0x8b04ce);_0x16f20(_0x8b04ce);});});}exports[_0x2c25('0x16')]=function(_0x28093a){var _0x19ff99=this;return new Promise(function(_0x4bfc1e,_0xe0af6){return db[_0x2c25('0x17')][_0x2c25('0x18')]({'raw':_0x28093a[_0x2c25('0x19')]?_0x28093a['options'][_0x2c25('0x1a')]===undefined?!![]:![]:!![],'where':_0x28093a['options']?_0x28093a['options'][_0x2c25('0x1b')]||null:null,'attributes':_0x28093a['options']?_0x28093a[_0x2c25('0x19')][_0x2c25('0x1c')]||null:null,'limit':_0x28093a[_0x2c25('0x19')]?_0x28093a[_0x2c25('0x19')][_0x2c25('0x1d')]||null:null,'include':_0x28093a[_0x2c25('0x19')]?_0x28093a[_0x2c25('0x19')][_0x2c25('0x1e')]?_[_0x2c25('0x1f')](_0x28093a[_0x2c25('0x19')][_0x2c25('0x1e')],function(_0x516ed1){return{'model':db[_0x516ed1['model']],'as':_0x516ed1['as'],'attributes':_0x516ed1[_0x2c25('0x1c')],'include':_0x516ed1['include']?_[_0x2c25('0x1f')](_0x516ed1[_0x2c25('0x1e')],function(_0x41c26b){return{'model':db[_0x41c26b[_0x2c25('0x20')]],'as':_0x41c26b['as'],'attributes':_0x41c26b[_0x2c25('0x1c')],'include':_0x41c26b['include']?_[_0x2c25('0x1f')](_0x41c26b[_0x2c25('0x1e')],function(_0x3f6906){return{'model':db[_0x3f6906['model']],'as':_0x3f6906['as'],'attributes':_0x3f6906[_0x2c25('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa7cbb6){logger[_0x2c25('0xd')]('GetCampaign',_0x28093a);logger[_0x2c25('0x21')](_0x2c25('0x16'),_0x28093a,JSON['stringify'](_0xa7cbb6));_0x4bfc1e(_0xa7cbb6);})[_0x2c25('0x15')](function(_0x4a8193){logger['error'](_0x2c25('0x16'),_0x4a8193[_0x2c25('0x14')],_0x28093a);_0xe0af6(_0x19ff99[_0x2c25('0x12')](0x1f4,_0x4a8193[_0x2c25('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index fac26dc..96889f8 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 _0x3fb1=['update','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put'];(function(_0x6c637d,_0x5e2962){var _0x24f6d1=function(_0x1c933a){while(--_0x1c933a){_0x6c637d['push'](_0x6c637d['shift']());}};_0x24f6d1(++_0x5e2962);}(_0x3fb1,0x15a));var _0x13fb=function(_0x36aa37,_0x3d6792){_0x36aa37=_0x36aa37-0x0;var _0xe63a10=_0x3fb1[_0x36aa37];return _0xe63a10;};'use strict';var multer=require('multer');var util=require(_0x13fb('0x0'));var path=require('path');var timeout=require(_0x13fb('0x1'));var express=require(_0x13fb('0x2'));var router=express['Router']();var fs_extra=require(_0x13fb('0x3'));var auth=require(_0x13fb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13fb('0x5'));router[_0x13fb('0x6')]('/',auth[_0x13fb('0x7')](),controller[_0x13fb('0x8')]);router[_0x13fb('0x6')](_0x13fb('0x9'),auth[_0x13fb('0x7')](),controller[_0x13fb('0xa')]);router[_0x13fb('0x6')](_0x13fb('0xb'),auth[_0x13fb('0x7')](),controller[_0x13fb('0xc')]);router['get'](_0x13fb('0xd'),auth[_0x13fb('0x7')](),controller[_0x13fb('0xe')]);router['get']('/:id/hopper_finals',auth[_0x13fb('0x7')](),controller[_0x13fb('0xf')]);router[_0x13fb('0x6')](_0x13fb('0x10'),auth[_0x13fb('0x7')](),controller[_0x13fb('0x11')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0x13fb('0x12')]);router[_0x13fb('0x6')](_0x13fb('0x13'),auth[_0x13fb('0x7')](),controller['getBlackLists']);router[_0x13fb('0x14')]('/',auth[_0x13fb('0x7')](),controller[_0x13fb('0x15')]);router['post'](_0x13fb('0x16'),auth[_0x13fb('0x7')](),controller[_0x13fb('0x17')]);router[_0x13fb('0x14')](_0x13fb('0x18'),auth['isAuthenticated'](),controller[_0x13fb('0x19')]);router[_0x13fb('0x14')](_0x13fb('0x13'),auth[_0x13fb('0x7')](),controller[_0x13fb('0x1a')]);router[_0x13fb('0x1b')](_0x13fb('0x9'),auth['isAuthenticated'](),controller[_0x13fb('0x1c')]);router[_0x13fb('0x1d')](_0x13fb('0x9'),auth[_0x13fb('0x7')](),controller[_0x13fb('0x1e')]);router[_0x13fb('0x1d')](_0x13fb('0x18'),auth['isAuthenticated'](),controller[_0x13fb('0x1f')]);router[_0x13fb('0x1d')](_0x13fb('0x13'),auth['isAuthenticated'](),controller[_0x13fb('0x20')]);module[_0x13fb('0x21')]=router;
\ No newline at end of file
+var _0x60ac=['addBlackLists','put','update','delete','/:id','destroy','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone'];(function(_0xc7a20f,_0x4af53f){var _0x344f6d=function(_0x4a100f){while(--_0x4a100f){_0xc7a20f['push'](_0xc7a20f['shift']());}};_0x344f6d(++_0x4af53f);}(_0x60ac,0xa2));var _0xc60a=function(_0x2cff40,_0x592d6f){_0x2cff40=_0x2cff40-0x0;var _0x43dd60=_0x60ac[_0x2cff40];return _0x43dd60;};'use strict';var multer=require('multer');var util=require(_0xc60a('0x0'));var path=require(_0xc60a('0x1'));var timeout=require(_0xc60a('0x2'));var express=require(_0xc60a('0x3'));var router=express[_0xc60a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc60a('0x5'));var interaction=require(_0xc60a('0x6'));var config=require('../../config/environment');var controller=require(_0xc60a('0x7'));router[_0xc60a('0x8')]('/',auth[_0xc60a('0x9')](),controller[_0xc60a('0xa')]);router[_0xc60a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc60a('0xb')]);router[_0xc60a('0x8')]('/:id/hoppers',auth[_0xc60a('0x9')](),controller[_0xc60a('0xc')]);router[_0xc60a('0x8')](_0xc60a('0xd'),auth[_0xc60a('0x9')](),controller[_0xc60a('0xe')]);router[_0xc60a('0x8')](_0xc60a('0xf'),auth[_0xc60a('0x9')](),controller[_0xc60a('0x10')]);router[_0xc60a('0x8')](_0xc60a('0x11'),auth[_0xc60a('0x9')](),controller['getHopperBlacks']);router[_0xc60a('0x8')](_0xc60a('0x12'),auth[_0xc60a('0x9')](),controller[_0xc60a('0x13')]);router[_0xc60a('0x8')](_0xc60a('0x14'),auth[_0xc60a('0x9')](),controller[_0xc60a('0x15')]);router[_0xc60a('0x16')]('/',auth[_0xc60a('0x9')](),controller['create']);router[_0xc60a('0x16')](_0xc60a('0x17'),auth[_0xc60a('0x9')](),controller['clone']);router[_0xc60a('0x16')](_0xc60a('0x12'),auth[_0xc60a('0x9')](),controller['addLists']);router[_0xc60a('0x16')](_0xc60a('0x14'),auth[_0xc60a('0x9')](),controller[_0xc60a('0x18')]);router[_0xc60a('0x19')]('/:id',auth[_0xc60a('0x9')](),controller[_0xc60a('0x1a')]);router[_0xc60a('0x1b')](_0xc60a('0x1c'),auth[_0xc60a('0x9')](),controller[_0xc60a('0x1d')]);router[_0xc60a('0x1b')](_0xc60a('0x12'),auth[_0xc60a('0x9')](),controller['removeLists']);router[_0xc60a('0x1b')](_0xc60a('0x14'),auth[_0xc60a('0x9')](),controller[_0xc60a('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index b3aa4f3..9592faf 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 _0x858d=['exports','STRING','key'];(function(_0x4a1777,_0x3c949f){var _0x393973=function(_0x945f66){while(--_0x945f66){_0x4a1777['push'](_0x4a1777['shift']());}};_0x393973(++_0x3c949f);}(_0x858d,0x19e));var _0xd858=function(_0x1cb236,_0x364b73){_0x1cb236=_0x1cb236-0x0;var _0x33f8d3=_0x858d[_0x1cb236];return _0x33f8d3;};'use strict';var Sequelize=require('sequelize');module[_0xd858('0x0')]={'key':{'type':Sequelize[_0xd858('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xd858('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xd858('0x2'));}}};
\ No newline at end of file
+var _0x4626=['exports','TEXT','STRING','VIRTUAL','key','sequelize'];(function(_0x1d2169,_0x2265f0){var _0x258247=function(_0x406bba){while(--_0x406bba){_0x1d2169['push'](_0x1d2169['shift']());}};_0x258247(++_0x2265f0);}(_0x4626,0xc5));var _0x6462=function(_0x494a3b,_0x3b2ee8){_0x494a3b=_0x494a3b-0x0;var _0x2da31c=_0x4626[_0x494a3b];return _0x2da31c;};'use strict';var Sequelize=require(_0x6462('0x0'));module[_0x6462('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6462('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6462('0x3')]},'name':{'type':Sequelize[_0x6462('0x4')],'get':function(){return this['getDataValue'](_0x6462('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 8737bc2..6715f9d 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 _0xfdda=['show','params','intersection','length','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xfdda,0xc2));var _0xafdd=function(_0x57f74a,_0x3f8b13){_0x57f74a=_0x57f74a-0x0;var _0x15b677=_0xfdda[_0x57f74a];return _0x15b677;};'use strict';var emlformat=require(_0xafdd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xafdd('0x1'));var moment=require(_0xafdd('0x2'));var BPromise=require(_0xafdd('0x3'));var Mustache=require(_0xafdd('0x4'));var util=require(_0xafdd('0x5'));var path=require(_0xafdd('0x6'));var sox=require(_0xafdd('0x7'));var csv=require(_0xafdd('0x8'));var ejs=require(_0xafdd('0x9'));var fs=require('fs');var fs_extra=require(_0xafdd('0xa'));var _=require(_0xafdd('0xb'));var squel=require(_0xafdd('0xc'));var crypto=require(_0xafdd('0xd'));var jsforce=require(_0xafdd('0xe'));var deskjs=require(_0xafdd('0xf'));var toCsv=require(_0xafdd('0x8'));var querystring=require(_0xafdd('0x10'));var Papa=require(_0xafdd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafdd('0x12'));var as=require(_0xafdd('0x13'));var hardwareService=require(_0xafdd('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xafdd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xafdd('0x16'));var db=require(_0xafdd('0x17'))['db'];function respondWithStatusCode(_0x56e015,_0x4df36c){_0x4df36c=_0x4df36c||0xcc;return function(_0x5e4fa8){if(_0x5e4fa8){return _0x56e015['sendStatus'](_0x4df36c);}return _0x56e015[_0xafdd('0x18')](_0x4df36c)[_0xafdd('0x19')]();};}function respondWithResult(_0x5411cd,_0x227a6d){_0x227a6d=_0x227a6d||0xc8;return function(_0x2b9ba1){if(_0x2b9ba1){return _0x5411cd[_0xafdd('0x18')](_0x227a6d)[_0xafdd('0x1a')](_0x2b9ba1);}};}function respondWithFilteredResult(_0x2e297e,_0x1fc542){return function(_0x10f07c){if(_0x10f07c){var _0x5cda9c=typeof _0x1fc542['offset']==='undefined'&&typeof _0x1fc542['limit']===_0xafdd('0x1b');var _0x5789d6=_0x10f07c[_0xafdd('0x1c')];var _0x49ae8f=_0x5cda9c?0x0:_0x1fc542[_0xafdd('0x1d')];var _0x585df3=_0x5cda9c?_0x10f07c[_0xafdd('0x1c')]:_0x1fc542['offset']+_0x1fc542[_0xafdd('0x1e')];var _0x11ece3;if(_0x585df3>=_0x5789d6){_0x585df3=_0x5789d6;_0x11ece3=0xc8;}else{_0x11ece3=0xce;}_0x2e297e[_0xafdd('0x18')](_0x11ece3);return _0x2e297e[_0xafdd('0x1f')](_0xafdd('0x20'),_0x49ae8f+'-'+_0x585df3+'/'+_0x5789d6)[_0xafdd('0x1a')](_0x10f07c);}return null;};}function patchUpdates(_0x582b09){return function(_0x2f8978){try{jsonpatch[_0xafdd('0x21')](_0x2f8978,_0x582b09,!![]);}catch(_0xeab8f6){return BPromise[_0xafdd('0x22')](_0xeab8f6);}return _0x2f8978[_0xafdd('0x23')]();};}function saveUpdates(_0x284ed3,_0x3decee){return function(_0x5c29ba){if(_0x5c29ba){return _0x5c29ba[_0xafdd('0x24')](_0x284ed3)[_0xafdd('0x25')](function(_0x1ec6d1){return _0x1ec6d1;});}return null;};}function removeEntity(_0x5c6ae4,_0x3f4302){return function(_0x32ca96){if(_0x32ca96){return _0x32ca96['destroy']()[_0xafdd('0x25')](function(){var _0x3bd928=_0x32ca96['get']({'plain':!![]});var _0x2f9be5=_0xafdd('0x26');return db[_0xafdd('0x27')][_0xafdd('0x28')]({'where':{'type':_0x2f9be5,'resourceId':_0x3bd928['id']}})[_0xafdd('0x25')](function(){return _0x32ca96;});})[_0xafdd('0x25')](function(){_0x5c6ae4[_0xafdd('0x18')](0xcc)[_0xafdd('0x19')]();});}};}function handleEntityNotFound(_0x229c13,_0x56856d){return function(_0x180ec3){if(!_0x180ec3){_0x229c13[_0xafdd('0x29')](0x194);}return _0x180ec3;};}function handleError(_0x334032,_0x1d2130){_0x1d2130=_0x1d2130||0x1f4;return function(_0x1423c5){logger[_0xafdd('0x2a')](_0x1423c5[_0xafdd('0x2b')]);if(_0x1423c5['name']){delete _0x1423c5[_0xafdd('0x2c')];}_0x334032[_0xafdd('0x18')](_0x1d2130)[_0xafdd('0x2d')](_0x1423c5);};}exports[_0xafdd('0x2e')]=function(_0x37943f,_0x562a65){var _0x3fda62={},_0x181c65={},_0x3cd90a={'count':0x0,'rows':[]};var _0x1734b1=_[_0xafdd('0x2f')](db[_0xafdd('0x30')][_0xafdd('0x31')],function(_0xe91dec){return{'name':_0xe91dec['fieldName'],'type':_0xe91dec[_0xafdd('0x32')][_0xafdd('0x33')]};});_0x181c65[_0xafdd('0x34')]=_[_0xafdd('0x2f')](_0x1734b1,_0xafdd('0x2c'));_0x181c65[_0xafdd('0x35')]=_[_0xafdd('0x36')](_0x37943f[_0xafdd('0x35')]);_0x181c65[_0xafdd('0x37')]=_['intersection'](_0x181c65[_0xafdd('0x34')],_0x181c65[_0xafdd('0x35')]);_0x3fda62[_0xafdd('0x38')]=_['intersection'](_0x181c65['model'],qs[_0xafdd('0x39')](_0x37943f[_0xafdd('0x35')]['fields']));_0x3fda62[_0xafdd('0x38')]=_0x3fda62[_0xafdd('0x38')]['length']?_0x3fda62[_0xafdd('0x38')]:_0x181c65['model'];if(!_0x37943f[_0xafdd('0x35')][_0xafdd('0x3a')]('nolimit')){_0x3fda62['limit']=qs[_0xafdd('0x1e')](_0x37943f['query']['limit']);_0x3fda62[_0xafdd('0x1d')]=qs[_0xafdd('0x1d')](_0x37943f['query'][_0xafdd('0x1d')]);}_0x3fda62[_0xafdd('0x3b')]=qs['sort'](_0x37943f[_0xafdd('0x35')]['sort']);_0x3fda62['where']=qs[_0xafdd('0x37')](_[_0xafdd('0x3c')](_0x37943f[_0xafdd('0x35')],_0x181c65[_0xafdd('0x37')]),_0x1734b1);if(_0x37943f[_0xafdd('0x35')][_0xafdd('0x3d')]){_0x3fda62[_0xafdd('0x3e')]=_[_0xafdd('0x3f')](_0x3fda62['where'],{'$or':[{'key':{'$like':'%'+_0x37943f[_0xafdd('0x35')][_0xafdd('0x3d')]+'%'}},{'value':{'$like':'%'+_0x37943f[_0xafdd('0x35')][_0xafdd('0x3d')]+'%'}}]});}_0x3fda62=_[_0xafdd('0x3f')]({},_0x3fda62,_0x37943f[_0xafdd('0x40')]);var _0x17dc25={'where':_0x3fda62['where']};return db['CannedAnswer'][_0xafdd('0x1c')](_0x17dc25)[_0xafdd('0x25')](function(_0x285e2d){_0x3cd90a['count']=_0x285e2d;if(_0x37943f[_0xafdd('0x35')][_0xafdd('0x41')]){_0x3fda62[_0xafdd('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0xafdd('0x43')](_0x3fda62);})[_0xafdd('0x25')](function(_0x57175c){_0x3cd90a[_0xafdd('0x44')]=_0x57175c;return _0x3cd90a;})[_0xafdd('0x25')](respondWithFilteredResult(_0x562a65,_0x3fda62))[_0xafdd('0x45')](handleError(_0x562a65,null));};exports[_0xafdd('0x46')]=function(_0x35d144,_0x1cdd4f){var _0x3b80d9={'raw':!![],'where':{'id':_0x35d144[_0xafdd('0x47')]['id']}},_0x315d09={};_0x315d09[_0xafdd('0x34')]=_['keys'](db[_0xafdd('0x30')][_0xafdd('0x31')]);_0x315d09[_0xafdd('0x35')]=_[_0xafdd('0x36')](_0x35d144['query']);_0x315d09[_0xafdd('0x37')]=_[_0xafdd('0x48')](_0x315d09['model'],_0x315d09[_0xafdd('0x35')]);_0x3b80d9[_0xafdd('0x38')]=_[_0xafdd('0x48')](_0x315d09['model'],qs[_0xafdd('0x39')](_0x35d144[_0xafdd('0x35')][_0xafdd('0x39')]));_0x3b80d9[_0xafdd('0x38')]=_0x3b80d9['attributes'][_0xafdd('0x49')]?_0x3b80d9[_0xafdd('0x38')]:_0x315d09['model'];if(_0x35d144[_0xafdd('0x35')]['includeAll']){_0x3b80d9[_0xafdd('0x42')]=[{'all':!![]}];}_0x3b80d9=_['merge']({},_0x3b80d9,_0x35d144['options']);return db[_0xafdd('0x30')][_0xafdd('0x4a')](_0x3b80d9)[_0xafdd('0x25')](handleEntityNotFound(_0x1cdd4f,null))[_0xafdd('0x25')](respondWithResult(_0x1cdd4f,null))['catch'](handleError(_0x1cdd4f,null));};exports[_0xafdd('0x24')]=function(_0x2c0843,_0x47a33d){if(_0x2c0843['body']['id']){delete _0x2c0843['body']['id'];}return db[_0xafdd('0x30')]['find']({'where':{'id':_0x2c0843[_0xafdd('0x47')]['id']}})[_0xafdd('0x25')](handleEntityNotFound(_0x47a33d,null))[_0xafdd('0x25')](saveUpdates(_0x2c0843[_0xafdd('0x4b')],null))[_0xafdd('0x25')](respondWithResult(_0x47a33d,null))[_0xafdd('0x45')](handleError(_0x47a33d,null));};exports[_0xafdd('0x28')]=function(_0x30c713,_0xff52b1){return db['CannedAnswer']['find']({'where':{'id':_0x30c713[_0xafdd('0x47')]['id']}})[_0xafdd('0x25')](handleEntityNotFound(_0xff52b1,null))[_0xafdd('0x25')](removeEntity(_0xff52b1,null))[_0xafdd('0x45')](handleError(_0xff52b1,null));};exports[_0xafdd('0x4c')]=function(_0x2a2038,_0x20b4c0){var _0x30ed27={'key':_0x2a2038[_0xafdd('0x4b')][_0xafdd('0x33')]};if(_0x2a2038[_0xafdd('0x4b')][_0xafdd('0x4d')]){_0x30ed27['MailAccountId']=_0x2a2038[_0xafdd('0x4b')]['MailAccountId'];}else if(_0x2a2038[_0xafdd('0x4b')][_0xafdd('0x4e')]){_0x30ed27[_0xafdd('0x4e')]=_0x2a2038[_0xafdd('0x4b')][_0xafdd('0x4e')];}else if(_0x2a2038[_0xafdd('0x4b')][_0xafdd('0x4f')]){_0x30ed27['OpenchannelAccountId']=_0x2a2038[_0xafdd('0x4b')][_0xafdd('0x4f')];}else if(_0x2a2038[_0xafdd('0x4b')]['ChatWebsiteId']){_0x30ed27[_0xafdd('0x50')]=_0x2a2038[_0xafdd('0x4b')]['ChatWebsiteId'];}return db[_0xafdd('0x30')]['find']({'where':_0x30ed27})[_0xafdd('0x25')](function(_0x47e85c){if(_0x47e85c){throw new db[(_0xafdd('0x51'))]['ValidationError'](_0xafdd('0x52'));}return db[_0xafdd('0x30')]['create'](_0x2a2038[_0xafdd('0x4b')]);})[_0xafdd('0x25')](function(_0x155940){var _0x48488a=_0x2a2038['user'][_0xafdd('0x53')]({'plain':!![]});if(!_0x48488a)throw new Error(_0xafdd('0x54'));if(_0x48488a['role']==='user'){var _0x5b8ed0=_0x155940[_0xafdd('0x53')]({'plain':!![]});return db[_0xafdd('0x55')][_0xafdd('0x4a')]({'where':{'name':'CannedAnswers','userProfileId':_0x48488a[_0xafdd('0x56')]},'raw':!![]})['then'](function(_0x3fd8a6){if(_0x3fd8a6&&_0x3fd8a6[_0xafdd('0x57')]===0x0){return db[_0xafdd('0x27')][_0xafdd('0x4c')]({'name':_0x5b8ed0[_0xafdd('0x2c')],'resourceId':_0x5b8ed0['id'],'type':_0x3fd8a6[_0xafdd('0x2c')],'sectionId':_0x3fd8a6['id']},{})[_0xafdd('0x25')](function(){return _0x155940;});}else{return _0x155940;}})[_0xafdd('0x45')](function(_0x403a8c){logger[_0xafdd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x403a8c);throw _0x403a8c;});}return _0x155940;})[_0xafdd('0x25')](respondWithResult(_0x20b4c0,0xc9))[_0xafdd('0x45')](handleError(_0x20b4c0,null));};
\ No newline at end of file
+var _0x30fe=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','intersection','length','find','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x159195,_0x371cc8){var _0x40f274=function(_0x2e00fe){while(--_0x2e00fe){_0x159195['push'](_0x159195['shift']());}};_0x40f274(++_0x371cc8);}(_0x30fe,0x102));var _0xe30f=function(_0x310693,_0x5eb0bf){_0x310693=_0x310693-0x0;var _0x2dd79c=_0x30fe[_0x310693];return _0x2dd79c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30f('0x0'));var zipdir=require(_0xe30f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe30f('0x2'));var BPromise=require(_0xe30f('0x3'));var Mustache=require(_0xe30f('0x4'));var util=require(_0xe30f('0x5'));var path=require(_0xe30f('0x6'));var sox=require('sox');var csv=require(_0xe30f('0x7'));var ejs=require(_0xe30f('0x8'));var fs=require('fs');var fs_extra=require(_0xe30f('0x9'));var _=require(_0xe30f('0xa'));var squel=require(_0xe30f('0xb'));var crypto=require(_0xe30f('0xc'));var jsforce=require(_0xe30f('0xd'));var deskjs=require(_0xe30f('0xe'));var toCsv=require(_0xe30f('0x7'));var querystring=require(_0xe30f('0xf'));var Papa=require(_0xe30f('0x10'));var Redis=require(_0xe30f('0x11'));var authService=require(_0xe30f('0x12'));var qs=require(_0xe30f('0x13'));var as=require(_0xe30f('0x14'));var hardwareService=require(_0xe30f('0x15'));var logger=require(_0xe30f('0x16'))(_0xe30f('0x17'));var utils=require('../../config/utils');var config=require(_0xe30f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe30f('0x19'))['db'];function respondWithStatusCode(_0x5722ec,_0x363251){_0x363251=_0x363251||0xcc;return function(_0x503a26){if(_0x503a26){return _0x5722ec[_0xe30f('0x1a')](_0x363251);}return _0x5722ec[_0xe30f('0x1b')](_0x363251)[_0xe30f('0x1c')]();};}function respondWithResult(_0x325e11,_0x9134c5){_0x9134c5=_0x9134c5||0xc8;return function(_0x1bfdaf){if(_0x1bfdaf){return _0x325e11[_0xe30f('0x1b')](_0x9134c5)[_0xe30f('0x1d')](_0x1bfdaf);}};}function respondWithFilteredResult(_0x1a54a7,_0x31d703){return function(_0xcb06fe){if(_0xcb06fe){var _0x599993=typeof _0x31d703[_0xe30f('0x1e')]===_0xe30f('0x1f')&&typeof _0x31d703['limit']===_0xe30f('0x1f');var _0x5a877b=_0xcb06fe[_0xe30f('0x20')];var _0x4b56ed=_0x599993?0x0:_0x31d703[_0xe30f('0x1e')];var _0xb958a=_0x599993?_0xcb06fe['count']:_0x31d703[_0xe30f('0x1e')]+_0x31d703[_0xe30f('0x21')];var _0x51184a;if(_0xb958a>=_0x5a877b){_0xb958a=_0x5a877b;_0x51184a=0xc8;}else{_0x51184a=0xce;}_0x1a54a7['status'](_0x51184a);return _0x1a54a7['set'](_0xe30f('0x22'),_0x4b56ed+'-'+_0xb958a+'/'+_0x5a877b)[_0xe30f('0x1d')](_0xcb06fe);}return null;};}function patchUpdates(_0x3ab664){return function(_0x3059a7){try{jsonpatch[_0xe30f('0x23')](_0x3059a7,_0x3ab664,!![]);}catch(_0x17b6f7){return BPromise['reject'](_0x17b6f7);}return _0x3059a7[_0xe30f('0x24')]();};}function saveUpdates(_0x346423,_0x291a36){return function(_0x21eaf9){if(_0x21eaf9){return _0x21eaf9[_0xe30f('0x25')](_0x346423)['then'](function(_0x8aa850){return _0x8aa850;});}return null;};}function removeEntity(_0xcf0c9c,_0xb9b25b){return function(_0x6fb27d){if(_0x6fb27d){return _0x6fb27d[_0xe30f('0x26')]()[_0xe30f('0x27')](function(){var _0x3eb55=_0x6fb27d[_0xe30f('0x28')]({'plain':!![]});var _0x5cc03b=_0xe30f('0x29');return db[_0xe30f('0x2a')][_0xe30f('0x26')]({'where':{'type':_0x5cc03b,'resourceId':_0x3eb55['id']}})[_0xe30f('0x27')](function(){return _0x6fb27d;});})[_0xe30f('0x27')](function(){_0xcf0c9c[_0xe30f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x625417,_0x22cdc1){return function(_0x32a045){if(!_0x32a045){_0x625417[_0xe30f('0x1a')](0x194);}return _0x32a045;};}function handleError(_0x3cd24e,_0x382ee4){_0x382ee4=_0x382ee4||0x1f4;return function(_0x2669d0){logger[_0xe30f('0x2b')](_0x2669d0[_0xe30f('0x2c')]);if(_0x2669d0[_0xe30f('0x2d')]){delete _0x2669d0[_0xe30f('0x2d')];}_0x3cd24e[_0xe30f('0x1b')](_0x382ee4)[_0xe30f('0x2e')](_0x2669d0);};}exports[_0xe30f('0x2f')]=function(_0x2571a9,_0x268a17){var _0x5cb57f={},_0x34d3ce={},_0x2674ee={'count':0x0,'rows':[]};var _0x814ade=_[_0xe30f('0x30')](db['CannedAnswer'][_0xe30f('0x31')],function(_0xa09ca3){return{'name':_0xa09ca3[_0xe30f('0x32')],'type':_0xa09ca3[_0xe30f('0x33')][_0xe30f('0x34')]};});_0x34d3ce[_0xe30f('0x35')]=_['map'](_0x814ade,_0xe30f('0x2d'));_0x34d3ce[_0xe30f('0x36')]=_[_0xe30f('0x37')](_0x2571a9[_0xe30f('0x36')]);_0x34d3ce['filters']=_['intersection'](_0x34d3ce[_0xe30f('0x35')],_0x34d3ce[_0xe30f('0x36')]);_0x5cb57f[_0xe30f('0x38')]=_['intersection'](_0x34d3ce[_0xe30f('0x35')],qs[_0xe30f('0x39')](_0x2571a9['query'][_0xe30f('0x39')]));_0x5cb57f[_0xe30f('0x38')]=_0x5cb57f['attributes']['length']?_0x5cb57f[_0xe30f('0x38')]:_0x34d3ce[_0xe30f('0x35')];if(!_0x2571a9['query'][_0xe30f('0x3a')]('nolimit')){_0x5cb57f[_0xe30f('0x21')]=qs[_0xe30f('0x21')](_0x2571a9['query'][_0xe30f('0x21')]);_0x5cb57f[_0xe30f('0x1e')]=qs[_0xe30f('0x1e')](_0x2571a9[_0xe30f('0x36')]['offset']);}_0x5cb57f[_0xe30f('0x3b')]=qs['sort'](_0x2571a9[_0xe30f('0x36')][_0xe30f('0x3c')]);_0x5cb57f[_0xe30f('0x3d')]=qs[_0xe30f('0x3e')](_[_0xe30f('0x3f')](_0x2571a9['query'],_0x34d3ce[_0xe30f('0x3e')]),_0x814ade);if(_0x2571a9[_0xe30f('0x36')][_0xe30f('0x40')]){_0x5cb57f['where']=_[_0xe30f('0x41')](_0x5cb57f[_0xe30f('0x3d')],{'$or':[{'key':{'$like':'%'+_0x2571a9[_0xe30f('0x36')][_0xe30f('0x40')]+'%'}},{'value':{'$like':'%'+_0x2571a9[_0xe30f('0x36')][_0xe30f('0x40')]+'%'}}]});}_0x5cb57f=_[_0xe30f('0x41')]({},_0x5cb57f,_0x2571a9[_0xe30f('0x42')]);var _0x2126cb={'where':_0x5cb57f[_0xe30f('0x3d')]};return db[_0xe30f('0x43')][_0xe30f('0x20')](_0x2126cb)['then'](function(_0x19b30e){_0x2674ee[_0xe30f('0x20')]=_0x19b30e;if(_0x2571a9['query'][_0xe30f('0x44')]){_0x5cb57f[_0xe30f('0x45')]=[{'all':!![]}];}return db[_0xe30f('0x43')][_0xe30f('0x46')](_0x5cb57f);})[_0xe30f('0x27')](function(_0xbb192){_0x2674ee[_0xe30f('0x47')]=_0xbb192;return _0x2674ee;})['then'](respondWithFilteredResult(_0x268a17,_0x5cb57f))[_0xe30f('0x48')](handleError(_0x268a17,null));};exports[_0xe30f('0x49')]=function(_0x33853d,_0x3f9e0b){var _0x26562a={'raw':!![],'where':{'id':_0x33853d['params']['id']}},_0x55050f={};_0x55050f[_0xe30f('0x35')]=_[_0xe30f('0x37')](db[_0xe30f('0x43')][_0xe30f('0x31')]);_0x55050f[_0xe30f('0x36')]=_['keys'](_0x33853d[_0xe30f('0x36')]);_0x55050f[_0xe30f('0x3e')]=_[_0xe30f('0x4a')](_0x55050f[_0xe30f('0x35')],_0x55050f[_0xe30f('0x36')]);_0x26562a[_0xe30f('0x38')]=_[_0xe30f('0x4a')](_0x55050f[_0xe30f('0x35')],qs[_0xe30f('0x39')](_0x33853d[_0xe30f('0x36')][_0xe30f('0x39')]));_0x26562a['attributes']=_0x26562a[_0xe30f('0x38')][_0xe30f('0x4b')]?_0x26562a[_0xe30f('0x38')]:_0x55050f[_0xe30f('0x35')];if(_0x33853d[_0xe30f('0x36')][_0xe30f('0x44')]){_0x26562a['include']=[{'all':!![]}];}_0x26562a=_[_0xe30f('0x41')]({},_0x26562a,_0x33853d[_0xe30f('0x42')]);return db['CannedAnswer']['find'](_0x26562a)[_0xe30f('0x27')](handleEntityNotFound(_0x3f9e0b,null))[_0xe30f('0x27')](respondWithResult(_0x3f9e0b,null))['catch'](handleError(_0x3f9e0b,null));};exports[_0xe30f('0x25')]=function(_0x1c3091,_0x3a80f2){if(_0x1c3091['body']['id']){delete _0x1c3091['body']['id'];}return db[_0xe30f('0x43')][_0xe30f('0x4c')]({'where':{'id':_0x1c3091['params']['id']}})['then'](handleEntityNotFound(_0x3a80f2,null))[_0xe30f('0x27')](saveUpdates(_0x1c3091['body'],null))[_0xe30f('0x27')](respondWithResult(_0x3a80f2,null))[_0xe30f('0x48')](handleError(_0x3a80f2,null));};exports[_0xe30f('0x26')]=function(_0x343902,_0x396dec){return db['CannedAnswer'][_0xe30f('0x4c')]({'where':{'id':_0x343902[_0xe30f('0x4d')]['id']}})[_0xe30f('0x27')](handleEntityNotFound(_0x396dec,null))['then'](removeEntity(_0x396dec,null))['catch'](handleError(_0x396dec,null));};exports[_0xe30f('0x4e')]=function(_0x930a33,_0x10d9c8){var _0x27669e={'key':_0x930a33['body'][_0xe30f('0x34')]};if(_0x930a33[_0xe30f('0x4f')]['MailAccountId']){_0x27669e[_0xe30f('0x50')]=_0x930a33[_0xe30f('0x4f')][_0xe30f('0x50')];}else if(_0x930a33['body'][_0xe30f('0x51')]){_0x27669e[_0xe30f('0x51')]=_0x930a33[_0xe30f('0x4f')][_0xe30f('0x51')];}else if(_0x930a33[_0xe30f('0x4f')][_0xe30f('0x52')]){_0x27669e[_0xe30f('0x52')]=_0x930a33['body'][_0xe30f('0x52')];}else if(_0x930a33['body'][_0xe30f('0x53')]){_0x27669e[_0xe30f('0x53')]=_0x930a33[_0xe30f('0x4f')][_0xe30f('0x53')];}return db['CannedAnswer'][_0xe30f('0x4c')]({'where':_0x27669e})[_0xe30f('0x27')](function(_0x584ea4){if(_0x584ea4){throw new db[(_0xe30f('0x54'))][(_0xe30f('0x55'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xe30f('0x43')][_0xe30f('0x4e')](_0x930a33[_0xe30f('0x4f')]);})[_0xe30f('0x27')](function(_0x5ce76a){var _0x248420=_0x930a33[_0xe30f('0x56')][_0xe30f('0x28')]({'plain':!![]});if(!_0x248420)throw new Error(_0xe30f('0x57'));if(_0x248420[_0xe30f('0x58')]==='user'){var _0x520478=_0x5ce76a[_0xe30f('0x28')]({'plain':!![]});return db[_0xe30f('0x59')][_0xe30f('0x4c')]({'where':{'name':_0xe30f('0x29'),'userProfileId':_0x248420[_0xe30f('0x5a')]},'raw':!![]})[_0xe30f('0x27')](function(_0x2cd3a3){if(_0x2cd3a3&&_0x2cd3a3['autoAssociation']===0x0){return db['UserProfileResource'][_0xe30f('0x4e')]({'name':_0x520478[_0xe30f('0x2d')],'resourceId':_0x520478['id'],'type':_0x2cd3a3['name'],'sectionId':_0x2cd3a3['id']},{})['then'](function(){return _0x5ce76a;});}else{return _0x5ce76a;}})['catch'](function(_0x55da6a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55da6a);throw _0x55da6a;});}return _0x5ce76a;})[_0xe30f('0x27')](respondWithResult(_0x10d9c8,0xc9))[_0xe30f('0x48')](handleError(_0x10d9c8,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 26ac684..ea06fb0 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 _0xd2c2=['moment','path','./cannedAnswer.attributes','exports','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1efbac,_0x13c2f2){var _0xe9f7b7=function(_0x45bcad){while(--_0x45bcad){_0x1efbac['push'](_0x1efbac['shift']());}};_0xe9f7b7(++_0x13c2f2);}(_0xd2c2,0x1ce));var _0x2d2c=function(_0x45dd86,_0x55aa6d){_0x45dd86=_0x45dd86-0x0;var _0x54c94e=_0xd2c2[_0x45dd86];return _0x54c94e;};'use strict';var _=require('lodash');var util=require(_0x2d2c('0x0'));var logger=require(_0x2d2c('0x1'))('api');var moment=require(_0x2d2c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d2c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2d2c('0x4'));module[_0x2d2c('0x5')]=function(_0x15dd46,_0x233922){return _0x15dd46['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d2c('0x6'),'collate':_0x2d2c('0x7')});};
\ No newline at end of file
+var _0x091a=['bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','util','../../config/logger','moment'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0x091a,0xc3));var _0xa091=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x091a[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0xa091('0x0'));var logger=require(_0xa091('0x1'))('api');var moment=require(_0xa091('0x2'));var BPromise=require(_0xa091('0x3'));var rp=require(_0xa091('0x4'));var fs=require('fs');var path=require(_0xa091('0x5'));var rimraf=require(_0xa091('0x6'));var config=require('../../config/environment');var attributes=require(_0xa091('0x7'));module['exports']=function(_0xb80f44,_0x533be7){return _0xb80f44[_0xa091('0x8')](_0xa091('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa091('0xa'),'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 ac2e781..ea9a443 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(_0x35840c,_0x67da0e){var _0x33a43b=function(_0x18c1c6){while(--_0x18c1c6){_0x35840c['push'](_0x35840c['shift']());}};_0x33a43b(++_0x67da0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x332f33,_0x4f2fc8){var _0x5da200=function(_0xf90735){while(--_0xf90735){_0x332f33['push'](_0x332f33['shift']());}};_0x5da200(++_0x4f2fc8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 06a2dfd..90291ae 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 _0x95bd=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','create'];(function(_0x107df9,_0x4d1825){var _0x2df84a=function(_0x3330ed){while(--_0x3330ed){_0x107df9['push'](_0x107df9['shift']());}};_0x2df84a(++_0x4d1825);}(_0x95bd,0x16a));var _0xd95b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x95bd[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xd95b('0x0'));var util=require(_0xd95b('0x1'));var path=require(_0xd95b('0x2'));var timeout=require(_0xd95b('0x3'));var express=require(_0xd95b('0x4'));var router=express[_0xd95b('0x5')]();var fs_extra=require(_0xd95b('0x6'));var auth=require(_0xd95b('0x7'));var interaction=require(_0xd95b('0x8'));var config=require(_0xd95b('0x9'));var controller=require(_0xd95b('0xa'));router[_0xd95b('0xb')]('/',auth[_0xd95b('0xc')](),controller[_0xd95b('0xd')]);router[_0xd95b('0xb')]('/:id',auth[_0xd95b('0xc')](),controller[_0xd95b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd95b('0xf')]);router[_0xd95b('0x10')](_0xd95b('0x11'),auth[_0xd95b('0xc')](),controller[_0xd95b('0x12')]);router[_0xd95b('0x13')](_0xd95b('0x11'),auth['isAuthenticated'](),controller[_0xd95b('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xcc1a=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','create','put','update','delete'];(function(_0xbbef15,_0x4c1afe){var _0x361b5c=function(_0x238f3d){while(--_0x238f3d){_0xbbef15['push'](_0xbbef15['shift']());}};_0x361b5c(++_0x4c1afe);}(_0xcc1a,0x87));var _0xacc1=function(_0x319e2e,_0x2f727f){_0x319e2e=_0x319e2e-0x0;var _0x302524=_0xcc1a[_0x319e2e];return _0x302524;};'use strict';var multer=require(_0xacc1('0x0'));var util=require(_0xacc1('0x1'));var path=require(_0xacc1('0x2'));var timeout=require(_0xacc1('0x3'));var express=require(_0xacc1('0x4'));var router=express[_0xacc1('0x5')]();var fs_extra=require(_0xacc1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xacc1('0x7'));var controller=require(_0xacc1('0x8'));router['get']('/',auth[_0xacc1('0x9')](),controller[_0xacc1('0xa')]);router[_0xacc1('0xb')](_0xacc1('0xc'),auth[_0xacc1('0x9')](),controller['show']);router['post']('/',auth[_0xacc1('0x9')](),controller[_0xacc1('0xd')]);router[_0xacc1('0xe')](_0xacc1('0xc'),auth[_0xacc1('0x9')](),controller[_0xacc1('0xf')]);router[_0xacc1('0x10')](_0xacc1('0xc'),auth[_0xacc1('0x9')](),controller[_0xacc1('0x11')]);module[_0xacc1('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4fdacbb..3f80087 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 _0xd382=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0xd382,0x1b6));var _0x2d38=function(_0x14ad51,_0x13b689){_0x14ad51=_0x14ad51-0x0;var _0xc5128d=_0xd382[_0x14ad51];return _0xc5128d;};'use strict';var Sequelize=require(_0x2d38('0x0'));module[_0x2d38('0x1')]={'calldate':{'type':Sequelize[_0x2d38('0x2')],'allowNull':![],'defaultValue':_0x2d38('0x3')},'clid':{'type':Sequelize[_0x2d38('0x4')]},'src':{'type':Sequelize[_0x2d38('0x4')]},'dst':{'type':Sequelize[_0x2d38('0x4')]},'dcontext':{'type':Sequelize[_0x2d38('0x4')]},'channel':{'type':Sequelize[_0x2d38('0x4')]},'dstchannel':{'type':Sequelize[_0x2d38('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2d38('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2d38('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2d38('0x4')]},'userfield':{'type':Sequelize[_0x2d38('0x4')]},'uniqueid':{'type':Sequelize[_0x2d38('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x2d38('0x4')]},'type':{'type':Sequelize[_0x2d38('0x4')]},'tag':{'type':Sequelize[_0x2d38('0x4')]}};
\ No newline at end of file
+var _0x8b4f=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x2675d2,_0x38d27){var _0x49d4c7=function(_0x54438f){while(--_0x54438f){_0x2675d2['push'](_0x2675d2['shift']());}};_0x49d4c7(++_0x38d27);}(_0x8b4f,0x19d));var _0xf8b4=function(_0x26a4ea,_0xa72fb8){_0x26a4ea=_0x26a4ea-0x0;var _0x1b669e=_0x8b4f[_0x26a4ea];return _0x1b669e;};'use strict';var Sequelize=require(_0xf8b4('0x0'));module[_0xf8b4('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xf8b4('0x2')},'clid':{'type':Sequelize[_0xf8b4('0x3')]},'src':{'type':Sequelize[_0xf8b4('0x3')]},'dst':{'type':Sequelize[_0xf8b4('0x3')]},'dcontext':{'type':Sequelize[_0xf8b4('0x3')]},'channel':{'type':Sequelize[_0xf8b4('0x3')]},'dstchannel':{'type':Sequelize[_0xf8b4('0x3')]},'lastapp':{'type':Sequelize[_0xf8b4('0x3')]},'lastdata':{'type':Sequelize[_0xf8b4('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf8b4('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf8b4('0x3')]},'amaflags':{'type':Sequelize[_0xf8b4('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xf8b4('0x3')]},'uniqueid':{'type':Sequelize[_0xf8b4('0x3')]},'linkedid':{'type':Sequelize[_0xf8b4('0x3')]},'sequence':{'type':Sequelize[_0xf8b4('0x3')]},'peeraccount':{'type':Sequelize[_0xf8b4('0x3')]},'type':{'type':Sequelize[_0xf8b4('0x3')]},'tag':{'type':Sequelize[_0xf8b4('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0eb0d71..b897f61 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 _0x6eed=['stack','name','index','map','Cdr','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','params','rawAttributes','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','end','error'];(function(_0xc581cc,_0x1e68d2){var _0x35bb90=function(_0x365361){while(--_0x365361){_0xc581cc['push'](_0xc581cc['shift']());}};_0x35bb90(++_0x1e68d2);}(_0x6eed,0xff));var _0xd6ee=function(_0x2e6b07,_0x581517){_0x2e6b07=_0x2e6b07-0x0;var _0x113ea9=_0x6eed[_0x2e6b07];return _0x113ea9;};'use strict';var emlformat=require(_0xd6ee('0x0'));var rimraf=require(_0xd6ee('0x1'));var zipdir=require(_0xd6ee('0x2'));var jsonpatch=require(_0xd6ee('0x3'));var rp=require(_0xd6ee('0x4'));var moment=require('moment');var BPromise=require(_0xd6ee('0x5'));var Mustache=require(_0xd6ee('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd6ee('0x7'));var csv=require(_0xd6ee('0x8'));var ejs=require(_0xd6ee('0x9'));var fs=require('fs');var fs_extra=require(_0xd6ee('0xa'));var _=require(_0xd6ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6ee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6ee('0xd'));var Redis=require(_0xd6ee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd6ee('0xf'));var as=require(_0xd6ee('0x10'));var hardwareService=require(_0xd6ee('0x11'));var logger=require(_0xd6ee('0x12'))('api');var utils=require(_0xd6ee('0x13'));var config=require(_0xd6ee('0x14'));var licenseUtil=require(_0xd6ee('0x15'));var db=require(_0xd6ee('0x16'))['db'];function respondWithStatusCode(_0x268dd1,_0x3fd1df){_0x3fd1df=_0x3fd1df||0xcc;return function(_0x48be63){if(_0x48be63){return _0x268dd1[_0xd6ee('0x17')](_0x3fd1df);}return _0x268dd1[_0xd6ee('0x18')](_0x3fd1df)['end']();};}function respondWithResult(_0x369b4a,_0x15918d){_0x15918d=_0x15918d||0xc8;return function(_0x2bf3b2){if(_0x2bf3b2){return _0x369b4a[_0xd6ee('0x18')](_0x15918d)[_0xd6ee('0x19')](_0x2bf3b2);}};}function respondWithFilteredResult(_0xe66d0d,_0x49bafc){return function(_0x1c2e51){if(_0x1c2e51){var _0xb99b70=typeof _0x49bafc[_0xd6ee('0x1a')]==='undefined'&&typeof _0x49bafc[_0xd6ee('0x1b')]==='undefined';var _0x3a82bf=_0x1c2e51[_0xd6ee('0x1c')];var _0x81d533=_0xb99b70?0x0:_0x49bafc['offset'];var _0x8a2718=_0xb99b70?_0x1c2e51['count']:_0x49bafc[_0xd6ee('0x1a')]+_0x49bafc['limit'];var _0x31ae0f;if(_0x8a2718>=_0x3a82bf){_0x8a2718=_0x3a82bf;_0x31ae0f=0xc8;}else{_0x31ae0f=0xce;}_0xe66d0d[_0xd6ee('0x18')](_0x31ae0f);return _0xe66d0d[_0xd6ee('0x1d')](_0xd6ee('0x1e'),_0x81d533+'-'+_0x8a2718+'/'+_0x3a82bf)[_0xd6ee('0x19')](_0x1c2e51);}return null;};}function patchUpdates(_0x4b33f1){return function(_0xe2f8c4){try{jsonpatch['apply'](_0xe2f8c4,_0x4b33f1,!![]);}catch(_0x17e011){return BPromise[_0xd6ee('0x1f')](_0x17e011);}return _0xe2f8c4[_0xd6ee('0x20')]();};}function saveUpdates(_0x1abedc,_0xec9287){return function(_0x48e6ad){if(_0x48e6ad){return _0x48e6ad['update'](_0x1abedc)[_0xd6ee('0x21')](function(_0x511c18){return _0x511c18;});}return null;};}function removeEntity(_0x2bae66,_0x519373){return function(_0x391844){if(_0x391844){return _0x391844[_0xd6ee('0x22')]()[_0xd6ee('0x21')](function(){_0x2bae66[_0xd6ee('0x18')](0xcc)[_0xd6ee('0x23')]();});}};}function handleEntityNotFound(_0x5476f2,_0x4b1926){return function(_0x2f438c){if(!_0x2f438c){_0x5476f2[_0xd6ee('0x17')](0x194);}return _0x2f438c;};}function handleError(_0x4edb7d,_0x2c9b30){_0x2c9b30=_0x2c9b30||0x1f4;return function(_0xa1e700){logger[_0xd6ee('0x24')](_0xa1e700[_0xd6ee('0x25')]);if(_0xa1e700[_0xd6ee('0x26')]){delete _0xa1e700[_0xd6ee('0x26')];}_0x4edb7d[_0xd6ee('0x18')](_0x2c9b30)['send'](_0xa1e700);};}exports[_0xd6ee('0x27')]=function(_0x124ab7,_0x50b786){var _0x5bcdd6={},_0x1578b3={},_0x4580a7={'count':0x0,'rows':[]};var _0xddca=_[_0xd6ee('0x28')](db[_0xd6ee('0x29')]['rawAttributes'],function(_0x414015){return{'name':_0x414015[_0xd6ee('0x2a')],'type':_0x414015[_0xd6ee('0x2b')]['key']};});_0x1578b3[_0xd6ee('0x2c')]=_[_0xd6ee('0x28')](_0xddca,_0xd6ee('0x26'));_0x1578b3['query']=_[_0xd6ee('0x2d')](_0x124ab7[_0xd6ee('0x2e')]);_0x1578b3[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],_0x1578b3[_0xd6ee('0x2e')]);_0x5bcdd6['attributes']=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x124ab7[_0xd6ee('0x2e')]['fields']));_0x5bcdd6[_0xd6ee('0x32')]=_0x5bcdd6[_0xd6ee('0x32')][_0xd6ee('0x33')]?_0x5bcdd6['attributes']:_0x1578b3['model'];if(!_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x34')](_0xd6ee('0x35'))){_0x5bcdd6[_0xd6ee('0x1b')]=qs[_0xd6ee('0x1b')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1b')]);_0x5bcdd6[_0xd6ee('0x1a')]=qs[_0xd6ee('0x1a')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1a')]);}_0x5bcdd6[_0xd6ee('0x36')]=qs[_0xd6ee('0x37')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x37')]);_0x5bcdd6['where']=qs[_0xd6ee('0x2f')](_[_0xd6ee('0x38')](_0x124ab7[_0xd6ee('0x2e')],_0x1578b3['filters']),_0xddca);if(_0x124ab7['query']['filter']){_0x5bcdd6['where']=_[_0xd6ee('0x39')](_0x5bcdd6[_0xd6ee('0x3a')],{'$or':_[_0xd6ee('0x28')](_0xddca,function(_0x2a6d2f){if(_0x2a6d2f[_0xd6ee('0x2b')]!==_0xd6ee('0x3b')){var _0x2c975a={};_0x2c975a[_0x2a6d2f['name']]={'$like':'%'+_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x3c')]+'%'};return _0x2c975a;}})});}_0x5bcdd6=_[_0xd6ee('0x39')]({},_0x5bcdd6,_0x124ab7[_0xd6ee('0x3d')]);var _0x407748={'where':_0x5bcdd6[_0xd6ee('0x3a')]};return db[_0xd6ee('0x29')][_0xd6ee('0x1c')](_0x407748)[_0xd6ee('0x21')](function(_0x24a7cb){_0x4580a7['count']=_0x24a7cb;if(_0x124ab7['query']['includeAll']){_0x5bcdd6[_0xd6ee('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0xd6ee('0x3f')](_0x5bcdd6);})[_0xd6ee('0x21')](function(_0x96aa7f){_0x4580a7[_0xd6ee('0x40')]=_0x96aa7f;return _0x4580a7;})[_0xd6ee('0x21')](respondWithFilteredResult(_0x50b786,_0x5bcdd6))['catch'](handleError(_0x50b786,null));};exports['show']=function(_0x4db1e9,_0x557936){var _0x3337a1={'raw':!![],'where':{'id':_0x4db1e9[_0xd6ee('0x41')]['id']}},_0xf38fc4={};_0xf38fc4[_0xd6ee('0x2c')]=_[_0xd6ee('0x2d')](db[_0xd6ee('0x29')][_0xd6ee('0x42')]);_0xf38fc4[_0xd6ee('0x2e')]=_[_0xd6ee('0x2d')](_0x4db1e9['query']);_0xf38fc4[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0xf38fc4['model'],_0xf38fc4[_0xd6ee('0x2e')]);_0x3337a1['attributes']=_['intersection'](_0xf38fc4[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x4db1e9[_0xd6ee('0x2e')][_0xd6ee('0x31')]));_0x3337a1[_0xd6ee('0x32')]=_0x3337a1[_0xd6ee('0x32')]['length']?_0x3337a1['attributes']:_0xf38fc4[_0xd6ee('0x2c')];if(_0x4db1e9[_0xd6ee('0x2e')]['includeAll']){_0x3337a1[_0xd6ee('0x3e')]=[{'all':!![]}];}_0x3337a1=_['merge']({},_0x3337a1,_0x4db1e9[_0xd6ee('0x3d')]);return db[_0xd6ee('0x29')][_0xd6ee('0x43')](_0x3337a1)[_0xd6ee('0x21')](handleEntityNotFound(_0x557936,null))[_0xd6ee('0x21')](respondWithResult(_0x557936,null))[_0xd6ee('0x44')](handleError(_0x557936,null));};exports[_0xd6ee('0x45')]=function(_0x1b02c4,_0x37c3ba){return db[_0xd6ee('0x29')][_0xd6ee('0x45')](_0x1b02c4['body'],{})[_0xd6ee('0x21')](respondWithResult(_0x37c3ba,0xc9))[_0xd6ee('0x44')](handleError(_0x37c3ba,null));};exports[_0xd6ee('0x46')]=function(_0x360e34,_0x418680){if(_0x360e34[_0xd6ee('0x47')]['id']){delete _0x360e34[_0xd6ee('0x47')]['id'];}return db[_0xd6ee('0x29')][_0xd6ee('0x43')]({'where':{'id':_0x360e34[_0xd6ee('0x41')]['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x418680,null))[_0xd6ee('0x21')](saveUpdates(_0x360e34['body'],null))[_0xd6ee('0x21')](respondWithResult(_0x418680,null))[_0xd6ee('0x44')](handleError(_0x418680,null));};exports[_0xd6ee('0x22')]=function(_0x52dfd3,_0x2f1bef){return db['Cdr'][_0xd6ee('0x43')]({'where':{'id':_0x52dfd3['params']['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x2f1bef,null))[_0xd6ee('0x21')](removeEntity(_0x2f1bef,null))['catch'](handleError(_0x2f1bef,null));};exports[_0xd6ee('0x48')]=function(_0x164df4,_0xaef499){return db['Cdr'][_0xd6ee('0x48')]()[_0xd6ee('0x21')](respondWithResult(_0xaef499,null))['catch'](handleError(_0xaef499,null));};
\ No newline at end of file
+var _0xe0c3=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x35ccc0,_0x10a8fc){var _0xa01659=function(_0x4114fd){while(--_0x4114fd){_0x35ccc0['push'](_0x35ccc0['shift']());}};_0xa01659(++_0x10a8fc);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];function respondWithStatusCode(_0x5dc732,_0x38b416){_0x38b416=_0x38b416||0xcc;return function(_0x491432){if(_0x491432){return _0x5dc732[_0x3e0c('0x1c')](_0x38b416);}return _0x5dc732[_0x3e0c('0x1d')](_0x38b416)['end']();};}function respondWithResult(_0x5f2654,_0x6d9c61){_0x6d9c61=_0x6d9c61||0xc8;return function(_0x409b2c){if(_0x409b2c){return _0x5f2654[_0x3e0c('0x1d')](_0x6d9c61)[_0x3e0c('0x1e')](_0x409b2c);}};}function respondWithFilteredResult(_0x15a269,_0x24fcf9){return function(_0x1947c2){if(_0x1947c2){var _0x274d75=typeof _0x24fcf9[_0x3e0c('0x1f')]===_0x3e0c('0x20')&&typeof _0x24fcf9[_0x3e0c('0x21')]==='undefined';var _0x58c498=_0x1947c2[_0x3e0c('0x22')];var _0x216993=_0x274d75?0x0:_0x24fcf9[_0x3e0c('0x1f')];var _0x41b19f=_0x274d75?_0x1947c2[_0x3e0c('0x22')]:_0x24fcf9[_0x3e0c('0x1f')]+_0x24fcf9['limit'];var _0x2e4a4a;if(_0x41b19f>=_0x58c498){_0x41b19f=_0x58c498;_0x2e4a4a=0xc8;}else{_0x2e4a4a=0xce;}_0x15a269[_0x3e0c('0x1d')](_0x2e4a4a);return _0x15a269[_0x3e0c('0x23')]('Content-Range',_0x216993+'-'+_0x41b19f+'/'+_0x58c498)[_0x3e0c('0x1e')](_0x1947c2);}return null;};}function patchUpdates(_0x5e3a93){return function(_0x479265){try{jsonpatch[_0x3e0c('0x24')](_0x479265,_0x5e3a93,!![]);}catch(_0x1f3bad){return BPromise[_0x3e0c('0x25')](_0x1f3bad);}return _0x479265[_0x3e0c('0x26')]();};}function saveUpdates(_0x4f8d38,_0x4cd447){return function(_0x3320c6){if(_0x3320c6){return _0x3320c6['update'](_0x4f8d38)['then'](function(_0x3fd7de){return _0x3fd7de;});}return null;};}function removeEntity(_0x1769b1,_0x44ce68){return function(_0x5bb7aa){if(_0x5bb7aa){return _0x5bb7aa[_0x3e0c('0x27')]()[_0x3e0c('0x28')](function(){_0x1769b1['status'](0xcc)[_0x3e0c('0x29')]();});}};}function handleEntityNotFound(_0x3de58b,_0x308fd5){return function(_0x1db945){if(!_0x1db945){_0x3de58b['sendStatus'](0x194);}return _0x1db945;};}function handleError(_0x412960,_0xc2f3cc){_0xc2f3cc=_0xc2f3cc||0x1f4;return function(_0x2c5fba){logger[_0x3e0c('0x2a')](_0x2c5fba['stack']);if(_0x2c5fba[_0x3e0c('0x2b')]){delete _0x2c5fba['name'];}_0x412960['status'](_0xc2f3cc)[_0x3e0c('0x2c')](_0x2c5fba);};}exports[_0x3e0c('0x2d')]=function(_0x4d3ce2,_0x16fb92){var _0x3f22b1={},_0x21d7a0={},_0x59c22f={'count':0x0,'rows':[]};var _0x44ecad=_[_0x3e0c('0x2e')](db['Cdr'][_0x3e0c('0x2f')],function(_0x2f31ad){return{'name':_0x2f31ad[_0x3e0c('0x30')],'type':_0x2f31ad[_0x3e0c('0x31')]['key']};});_0x21d7a0[_0x3e0c('0x32')]=_[_0x3e0c('0x2e')](_0x44ecad,_0x3e0c('0x2b'));_0x21d7a0['query']=_[_0x3e0c('0x33')](_0x4d3ce2[_0x3e0c('0x34')]);_0x21d7a0[_0x3e0c('0x35')]=_['intersection'](_0x21d7a0[_0x3e0c('0x32')],_0x21d7a0[_0x3e0c('0x34')]);_0x3f22b1[_0x3e0c('0x36')]=_[_0x3e0c('0x37')](_0x21d7a0[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x3f22b1[_0x3e0c('0x36')]=_0x3f22b1[_0x3e0c('0x36')][_0x3e0c('0x39')]?_0x3f22b1[_0x3e0c('0x36')]:_0x21d7a0[_0x3e0c('0x32')];if(!_0x4d3ce2[_0x3e0c('0x34')]['hasOwnProperty'](_0x3e0c('0x3a'))){_0x3f22b1[_0x3e0c('0x21')]=qs[_0x3e0c('0x21')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x21')]);_0x3f22b1[_0x3e0c('0x1f')]=qs[_0x3e0c('0x1f')](_0x4d3ce2[_0x3e0c('0x34')]['offset']);}_0x3f22b1['order']=qs[_0x3e0c('0x3b')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3b')]);_0x3f22b1[_0x3e0c('0x3c')]=qs[_0x3e0c('0x35')](_[_0x3e0c('0x3d')](_0x4d3ce2['query'],_0x21d7a0[_0x3e0c('0x35')]),_0x44ecad);if(_0x4d3ce2[_0x3e0c('0x34')]['filter']){_0x3f22b1['where']=_['merge'](_0x3f22b1[_0x3e0c('0x3c')],{'$or':_[_0x3e0c('0x2e')](_0x44ecad,function(_0x3d6ed7){if(_0x3d6ed7[_0x3e0c('0x31')]!==_0x3e0c('0x3e')){var _0x45ec69={};_0x45ec69[_0x3d6ed7[_0x3e0c('0x2b')]]={'$like':'%'+_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3f')]+'%'};return _0x45ec69;}})});}_0x3f22b1=_[_0x3e0c('0x40')]({},_0x3f22b1,_0x4d3ce2[_0x3e0c('0x41')]);var _0x20135d={'where':_0x3f22b1['where']};return db['Cdr']['count'](_0x20135d)[_0x3e0c('0x28')](function(_0x22fcd8){_0x59c22f['count']=_0x22fcd8;if(_0x4d3ce2['query'][_0x3e0c('0x42')]){_0x3f22b1[_0x3e0c('0x43')]=[{'all':!![]}];}return db[_0x3e0c('0x44')][_0x3e0c('0x45')](_0x3f22b1);})['then'](function(_0x2e562f){_0x59c22f[_0x3e0c('0x46')]=_0x2e562f;return _0x59c22f;})[_0x3e0c('0x28')](respondWithFilteredResult(_0x16fb92,_0x3f22b1))[_0x3e0c('0x47')](handleError(_0x16fb92,null));};exports[_0x3e0c('0x48')]=function(_0x4b5638,_0x1bc4b3){var _0x5f4274={'raw':!![],'where':{'id':_0x4b5638[_0x3e0c('0x49')]['id']}},_0x35111f={};_0x35111f['model']=_['keys'](db[_0x3e0c('0x44')][_0x3e0c('0x2f')]);_0x35111f['query']=_[_0x3e0c('0x33')](_0x4b5638[_0x3e0c('0x34')]);_0x35111f[_0x3e0c('0x35')]=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],_0x35111f[_0x3e0c('0x34')]);_0x5f4274['attributes']=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4b5638[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x5f4274[_0x3e0c('0x36')]=_0x5f4274['attributes'][_0x3e0c('0x39')]?_0x5f4274[_0x3e0c('0x36')]:_0x35111f[_0x3e0c('0x32')];if(_0x4b5638['query'][_0x3e0c('0x42')]){_0x5f4274[_0x3e0c('0x43')]=[{'all':!![]}];}_0x5f4274=_['merge']({},_0x5f4274,_0x4b5638[_0x3e0c('0x41')]);return db[_0x3e0c('0x44')][_0x3e0c('0x4a')](_0x5f4274)['then'](handleEntityNotFound(_0x1bc4b3,null))[_0x3e0c('0x28')](respondWithResult(_0x1bc4b3,null))[_0x3e0c('0x47')](handleError(_0x1bc4b3,null));};exports[_0x3e0c('0x4b')]=function(_0x2c7b8c,_0x109078){return db[_0x3e0c('0x44')][_0x3e0c('0x4b')](_0x2c7b8c[_0x3e0c('0x4c')],{})[_0x3e0c('0x28')](respondWithResult(_0x109078,0xc9))[_0x3e0c('0x47')](handleError(_0x109078,null));};exports[_0x3e0c('0x4d')]=function(_0x4efbf2,_0x20c9df){if(_0x4efbf2['body']['id']){delete _0x4efbf2['body']['id'];}return db[_0x3e0c('0x44')]['find']({'where':{'id':_0x4efbf2[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x20c9df,null))['then'](saveUpdates(_0x4efbf2[_0x3e0c('0x4c')],null))[_0x3e0c('0x28')](respondWithResult(_0x20c9df,null))['catch'](handleError(_0x20c9df,null));};exports[_0x3e0c('0x27')]=function(_0x3e04c9,_0x166203){return db[_0x3e0c('0x44')][_0x3e0c('0x4a')]({'where':{'id':_0x3e04c9[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x166203,null))[_0x3e0c('0x28')](removeEntity(_0x166203,null))[_0x3e0c('0x47')](handleError(_0x166203,null));};exports[_0x3e0c('0x4e')]=function(_0x4d0f77,_0x3743ae){return db[_0x3e0c('0x44')][_0x3e0c('0x4e')]()[_0x3e0c('0x28')](respondWithResult(_0x3743ae,null))[_0x3e0c('0x47')](handleError(_0x3743ae,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index ea5ad15..456b01a 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(_0x17db91,_0x2214d0){var _0x2f6f51=function(_0x4acb6a){while(--_0x4acb6a){_0x17db91['push'](_0x17db91['shift']());}};_0x2f6f51(++_0x2214d0);}(_0x7a54,0x106));var _0x47a5=function(_0x2ecb26,_0x2a8575){_0x2ecb26=_0x2ecb26-0x0;var _0x4d6651=_0x7a54[_0x2ecb26];return _0x4d6651;};'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(_0x3c1983,_0x4f1a86){var _0x195b59=function(_0x31aeed){while(--_0x31aeed){_0x3c1983['push'](_0x3c1983['shift']());}};_0x195b59(++_0x4f1a86);}(_0x7a54,0x106));var _0x47a5=function(_0x2bfa24,_0x145243){_0x2bfa24=_0x2bfa24-0x0;var _0x44349d=_0x7a54[_0x2bfa24];return _0x44349d;};'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 15b3220..27ad793 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 _0x555d=['request','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x555d,0x1d8));var _0xd555=function(_0x27c4da,_0x524970){_0x27c4da=_0x27c4da-0x0;var _0xdcb26f=_0x555d[_0x27c4da];return _0xdcb26f;};'use strict';var _=require(_0xd555('0x0'));var util=require(_0xd555('0x1'));var moment=require(_0xd555('0x2'));var BPromise=require(_0xd555('0x3'));var rs=require(_0xd555('0x4'));var fs=require('fs');var Redis=require(_0xd555('0x5'));var db=require(_0xd555('0x6'))['db'];var utils=require(_0xd555('0x7'));var logger=require(_0xd555('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd555('0x9'));var client=jayson[_0xd555('0xa')][_0xd555('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1018c5,_0x2c6faf,_0x35c04b){return new BPromise(function(_0x4fac1c,_0x5ed4b3){return client[_0xd555('0xc')](_0x1018c5,_0x35c04b)['then'](function(_0x4d2389){logger['info'](_0xd555('0xd'),_0x2c6faf,_0xd555('0xe'));logger[_0xd555('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2c6faf,_0xd555('0xe'),JSON['stringify'](_0x4d2389));if(_0x4d2389['error']){if(_0x4d2389[_0xd555('0x10')][_0xd555('0x11')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x2c6faf,_0x4d2389['error'][_0xd555('0x12')]);return _0x5ed4b3(_0x4d2389['error'][_0xd555('0x12')]);}logger[_0xd555('0x10')]('Cdr,\x20%s,\x20%s',_0x2c6faf,_0x4d2389['error'][_0xd555('0x12')]);return _0x4fac1c(_0x4d2389['error'][_0xd555('0x12')]);}else{logger[_0xd555('0x13')]('Cdr,\x20%s,\x20%s',_0x2c6faf,_0xd555('0xe'));_0x4fac1c(_0x4d2389[_0xd555('0x14')][_0xd555('0x12')]);}})[_0xd555('0x15')](function(_0xebcab8){logger[_0xd555('0x10')](_0xd555('0xd'),_0x2c6faf,_0xebcab8);_0x5ed4b3(_0xebcab8);});});}
\ No newline at end of file
+var _0x9c8a=['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','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x291113,_0x28da65){var _0x496e27=function(_0x5aa5de){while(--_0x5aa5de){_0x291113['push'](_0x291113['shift']());}};_0x496e27(++_0x28da65);}(_0x9c8a,0x1e9));var _0xa9c8=function(_0x40b9f6,_0xcdf026){_0x40b9f6=_0x40b9f6-0x0;var _0x229e6f=_0x9c8a[_0x40b9f6];return _0x229e6f;};'use strict';var _=require(_0xa9c8('0x0'));var util=require(_0xa9c8('0x1'));var moment=require(_0xa9c8('0x2'));var BPromise=require(_0xa9c8('0x3'));var rs=require(_0xa9c8('0x4'));var fs=require('fs');var Redis=require(_0xa9c8('0x5'));var db=require(_0xa9c8('0x6'))['db'];var utils=require(_0xa9c8('0x7'));var logger=require(_0xa9c8('0x8'))('rpc');var config=require(_0xa9c8('0x9'));var jayson=require(_0xa9c8('0xa'));var client=jayson[_0xa9c8('0xb')][_0xa9c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c991d,_0x4d56f5,_0x26c5d5){return new BPromise(function(_0x561562,_0x4ccac9){return client[_0xa9c8('0xd')](_0x2c991d,_0x26c5d5)[_0xa9c8('0xe')](function(_0x23f442){logger[_0xa9c8('0xf')](_0xa9c8('0x10'),_0x4d56f5,_0xa9c8('0x11'));logger['debug'](_0xa9c8('0x12'),_0x4d56f5,_0xa9c8('0x11'),JSON[_0xa9c8('0x13')](_0x23f442));if(_0x23f442[_0xa9c8('0x14')]){if(_0x23f442[_0xa9c8('0x14')][_0xa9c8('0x15')]===0x1f4){logger[_0xa9c8('0x14')]('Cdr,\x20%s,\x20%s',_0x4d56f5,_0x23f442[_0xa9c8('0x14')]['message']);return _0x4ccac9(_0x23f442[_0xa9c8('0x14')][_0xa9c8('0x16')]);}logger[_0xa9c8('0x14')](_0xa9c8('0x10'),_0x4d56f5,_0x23f442[_0xa9c8('0x14')]['message']);return _0x561562(_0x23f442[_0xa9c8('0x14')][_0xa9c8('0x16')]);}else{logger[_0xa9c8('0xf')]('Cdr,\x20%s,\x20%s',_0x4d56f5,_0xa9c8('0x11'));_0x561562(_0x23f442[_0xa9c8('0x17')][_0xa9c8('0x16')]);}})[_0xa9c8('0x18')](function(_0x52ef57){logger[_0xa9c8('0x14')](_0xa9c8('0x10'),_0x4d56f5,_0x52ef57);_0x4ccac9(_0x52ef57);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index dcb494b..6168768 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_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
+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(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_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 320c0d1..1c92763 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 _0xbf3b=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x133425,_0x2d60f2){var _0x45c4a4=function(_0x39b453){while(--_0x39b453){_0x133425['push'](_0x133425['shift']());}};_0x45c4a4(++_0x2d60f2);}(_0xbf3b,0xe5));var _0xbbf3=function(_0x27f494,_0x29b540){_0x27f494=_0x27f494-0x0;var _0x41a897=_0xbf3b[_0x27f494];return _0x41a897;};'use strict';var Sequelize=require('sequelize');module[_0xbbf3('0x0')]={'priority':{'type':Sequelize[_0xbbf3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbbf3('0x2')],'allowNull':![],'defaultValue':_0xbbf3('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbbf3('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbbf3('0x4')}};
\ No newline at end of file
+var _0x4d06=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4d06,0xaa));var _0x64d0=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x4d06[_0x81dcac];return _0xc7803b;};'use strict';var Sequelize=require(_0x64d0('0x0'));module[_0x64d0('0x1')]={'priority':{'type':Sequelize[_0x64d0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x64d0('0x3')],'allowNull':![],'defaultValue':_0x64d0('0x4')},'appdata':{'type':Sequelize[_0x64d0('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x64d0('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index e7652bd..7638dc1 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 _0x9a62=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','params','ChatApplication','rawAttributes','query','keys','filters','attributes','intersection','model','fields','length','includeAll','include','merge','options','find','catch','body','destroy','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce'];(function(_0xc242ef,_0x18213a){var _0x425590=function(_0x55049e){while(--_0x55049e){_0xc242ef['push'](_0xc242ef['shift']());}};_0x425590(++_0x18213a);}(_0x9a62,0x1bc));var _0x29a6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9a62[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29a6('0x0'));var zipdir=require(_0x29a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29a6('0x2'));var moment=require(_0x29a6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29a6('0x4'));var path=require(_0x29a6('0x5'));var sox=require(_0x29a6('0x6'));var csv=require(_0x29a6('0x7'));var ejs=require(_0x29a6('0x8'));var fs=require('fs');var fs_extra=require(_0x29a6('0x9'));var _=require(_0x29a6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x29a6('0xb'));var deskjs=require(_0x29a6('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x29a6('0xd'));var Redis=require(_0x29a6('0xe'));var authService=require(_0x29a6('0xf'));var qs=require(_0x29a6('0x10'));var as=require(_0x29a6('0x11'));var hardwareService=require(_0x29a6('0x12'));var logger=require(_0x29a6('0x13'))('api');var utils=require(_0x29a6('0x14'));var config=require(_0x29a6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e918f,_0x1d78fa){_0x1d78fa=_0x1d78fa||0xcc;return function(_0x7acc03){if(_0x7acc03){return _0x4e918f['sendStatus'](_0x1d78fa);}return _0x4e918f[_0x29a6('0x16')](_0x1d78fa)[_0x29a6('0x17')]();};}function respondWithResult(_0x535e3a,_0x50c663){_0x50c663=_0x50c663||0xc8;return function(_0x36d6fd){if(_0x36d6fd){return _0x535e3a[_0x29a6('0x16')](_0x50c663)['json'](_0x36d6fd);}};}function respondWithFilteredResult(_0x389255,_0x22378a){return function(_0x307dd9){if(_0x307dd9){var _0x4fef5c=typeof _0x22378a[_0x29a6('0x18')]===_0x29a6('0x19')&&typeof _0x22378a[_0x29a6('0x1a')]===_0x29a6('0x19');var _0x2ccb06=_0x307dd9[_0x29a6('0x1b')];var _0xa3d845=_0x4fef5c?0x0:_0x22378a[_0x29a6('0x18')];var _0x4c8cbc=_0x4fef5c?_0x307dd9[_0x29a6('0x1b')]:_0x22378a['offset']+_0x22378a[_0x29a6('0x1a')];var _0x35bc3b;if(_0x4c8cbc>=_0x2ccb06){_0x4c8cbc=_0x2ccb06;_0x35bc3b=0xc8;}else{_0x35bc3b=0xce;}_0x389255[_0x29a6('0x16')](_0x35bc3b);return _0x389255['set'](_0x29a6('0x1c'),_0xa3d845+'-'+_0x4c8cbc+'/'+_0x2ccb06)['json'](_0x307dd9);}return null;};}function patchUpdates(_0x4da844){return function(_0x5a8d55){try{jsonpatch[_0x29a6('0x1d')](_0x5a8d55,_0x4da844,!![]);}catch(_0x319573){return BPromise[_0x29a6('0x1e')](_0x319573);}return _0x5a8d55[_0x29a6('0x1f')]();};}function saveUpdates(_0x36c103,_0x552bc7){return function(_0x13341e){if(_0x13341e){return _0x13341e[_0x29a6('0x20')](_0x36c103)[_0x29a6('0x21')](function(_0x3ed7de){return _0x3ed7de;});}return null;};}function removeEntity(_0x46fcc7,_0x2dc6c0){return function(_0xedfa4){if(_0xedfa4){return _0xedfa4['destroy']()[_0x29a6('0x21')](function(){_0x46fcc7[_0x29a6('0x16')](0xcc)[_0x29a6('0x17')]();});}};}function handleEntityNotFound(_0x2280f7,_0x1798dd){return function(_0x17b835){if(!_0x17b835){_0x2280f7[_0x29a6('0x22')](0x194);}return _0x17b835;};}function handleError(_0x4ce577,_0x483d22){_0x483d22=_0x483d22||0x1f4;return function(_0x5a67df){logger[_0x29a6('0x23')](_0x5a67df[_0x29a6('0x24')]);if(_0x5a67df[_0x29a6('0x25')]){delete _0x5a67df[_0x29a6('0x25')];}_0x4ce577[_0x29a6('0x16')](_0x483d22)['send'](_0x5a67df);};}exports['show']=function(_0x31c2e4,_0x3607b3){var _0x4c5cb8={'raw':!![],'where':{'id':_0x31c2e4[_0x29a6('0x26')]['id']}},_0x454df0={};_0x454df0['model']=_['keys'](db[_0x29a6('0x27')][_0x29a6('0x28')]);_0x454df0[_0x29a6('0x29')]=_[_0x29a6('0x2a')](_0x31c2e4[_0x29a6('0x29')]);_0x454df0[_0x29a6('0x2b')]=_['intersection'](_0x454df0['model'],_0x454df0[_0x29a6('0x29')]);_0x4c5cb8[_0x29a6('0x2c')]=_[_0x29a6('0x2d')](_0x454df0[_0x29a6('0x2e')],qs[_0x29a6('0x2f')](_0x31c2e4[_0x29a6('0x29')][_0x29a6('0x2f')]));_0x4c5cb8['attributes']=_0x4c5cb8[_0x29a6('0x2c')][_0x29a6('0x30')]?_0x4c5cb8[_0x29a6('0x2c')]:_0x454df0[_0x29a6('0x2e')];if(_0x31c2e4[_0x29a6('0x29')][_0x29a6('0x31')]){_0x4c5cb8[_0x29a6('0x32')]=[{'all':!![]}];}_0x4c5cb8=_[_0x29a6('0x33')]({},_0x4c5cb8,_0x31c2e4[_0x29a6('0x34')]);return db['ChatApplication'][_0x29a6('0x35')](_0x4c5cb8)[_0x29a6('0x21')](handleEntityNotFound(_0x3607b3,null))[_0x29a6('0x21')](respondWithResult(_0x3607b3,null))[_0x29a6('0x36')](handleError(_0x3607b3,null));};exports[_0x29a6('0x20')]=function(_0x132029,_0x34a515){if(_0x132029['body']['id']){delete _0x132029['body']['id'];}return db['ChatApplication'][_0x29a6('0x35')]({'where':{'id':_0x132029[_0x29a6('0x26')]['id']}})[_0x29a6('0x21')](handleEntityNotFound(_0x34a515,null))[_0x29a6('0x21')](saveUpdates(_0x132029[_0x29a6('0x37')],null))[_0x29a6('0x21')](respondWithResult(_0x34a515,null))['catch'](handleError(_0x34a515,null));};exports[_0x29a6('0x38')]=function(_0x28f0bd,_0x539157){return db[_0x29a6('0x27')][_0x29a6('0x35')]({'where':{'id':_0x28f0bd['params']['id']}})[_0x29a6('0x21')](handleEntityNotFound(_0x539157,null))[_0x29a6('0x21')](removeEntity(_0x539157,null))[_0x29a6('0x36')](handleError(_0x539157,null));};
\ No newline at end of file
+var _0x2c54=['fields','length','attributes','includeAll','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','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/environment','../../config/license/util','../../mysqldb','end','json','limit','count','offset','status','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','keys','ChatApplication','query','intersection','model'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x2c54,0x136));var _0x42c5=function(_0x831d2a,_0x47b0b1){_0x831d2a=_0x831d2a-0x0;var _0x779be4=_0x2c54[_0x831d2a];return _0x779be4;};'use strict';var emlformat=require(_0x42c5('0x0'));var rimraf=require(_0x42c5('0x1'));var zipdir=require(_0x42c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42c5('0x3'));var moment=require(_0x42c5('0x4'));var BPromise=require(_0x42c5('0x5'));var Mustache=require(_0x42c5('0x6'));var util=require(_0x42c5('0x7'));var path=require(_0x42c5('0x8'));var sox=require('sox');var csv=require(_0x42c5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42c5('0xa'));var squel=require(_0x42c5('0xb'));var crypto=require(_0x42c5('0xc'));var jsforce=require(_0x42c5('0xd'));var deskjs=require(_0x42c5('0xe'));var toCsv=require(_0x42c5('0x9'));var querystring=require(_0x42c5('0xf'));var Papa=require(_0x42c5('0x10'));var Redis=require(_0x42c5('0x11'));var authService=require(_0x42c5('0x12'));var qs=require(_0x42c5('0x13'));var as=require(_0x42c5('0x14'));var hardwareService=require(_0x42c5('0x15'));var logger=require(_0x42c5('0x16'))(_0x42c5('0x17'));var utils=require(_0x42c5('0x18'));var config=require(_0x42c5('0x19'));var licenseUtil=require(_0x42c5('0x1a'));var db=require(_0x42c5('0x1b'))['db'];function respondWithStatusCode(_0x43793e,_0x18faec){_0x18faec=_0x18faec||0xcc;return function(_0x391716){if(_0x391716){return _0x43793e['sendStatus'](_0x18faec);}return _0x43793e['status'](_0x18faec)[_0x42c5('0x1c')]();};}function respondWithResult(_0xc17623,_0x337f2d){_0x337f2d=_0x337f2d||0xc8;return function(_0x1056de){if(_0x1056de){return _0xc17623['status'](_0x337f2d)[_0x42c5('0x1d')](_0x1056de);}};}function respondWithFilteredResult(_0x22d052,_0x5c9ac2){return function(_0x4efb1a){if(_0x4efb1a){var _0x323705=typeof _0x5c9ac2['offset']==='undefined'&&typeof _0x5c9ac2[_0x42c5('0x1e')]==='undefined';var _0x4eda79=_0x4efb1a[_0x42c5('0x1f')];var _0x3a2115=_0x323705?0x0:_0x5c9ac2[_0x42c5('0x20')];var _0x3f4172=_0x323705?_0x4efb1a[_0x42c5('0x1f')]:_0x5c9ac2[_0x42c5('0x20')]+_0x5c9ac2[_0x42c5('0x1e')];var _0x34f31b;if(_0x3f4172>=_0x4eda79){_0x3f4172=_0x4eda79;_0x34f31b=0xc8;}else{_0x34f31b=0xce;}_0x22d052[_0x42c5('0x21')](_0x34f31b);return _0x22d052[_0x42c5('0x22')](_0x42c5('0x23'),_0x3a2115+'-'+_0x3f4172+'/'+_0x4eda79)[_0x42c5('0x1d')](_0x4efb1a);}return null;};}function patchUpdates(_0x11c6e8){return function(_0x15035e){try{jsonpatch['apply'](_0x15035e,_0x11c6e8,!![]);}catch(_0x102294){return BPromise[_0x42c5('0x24')](_0x102294);}return _0x15035e[_0x42c5('0x25')]();};}function saveUpdates(_0x56fc64,_0x245e72){return function(_0x2533ff){if(_0x2533ff){return _0x2533ff['update'](_0x56fc64)[_0x42c5('0x26')](function(_0xd577c8){return _0xd577c8;});}return null;};}function removeEntity(_0x2d8143,_0x3166b5){return function(_0x119580){if(_0x119580){return _0x119580[_0x42c5('0x27')]()['then'](function(){_0x2d8143[_0x42c5('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x325184,_0x2b6ce7){return function(_0x5bd379){if(!_0x5bd379){_0x325184[_0x42c5('0x28')](0x194);}return _0x5bd379;};}function handleError(_0x53e81b,_0x27a6b5){_0x27a6b5=_0x27a6b5||0x1f4;return function(_0x45e9bf){logger[_0x42c5('0x29')](_0x45e9bf[_0x42c5('0x2a')]);if(_0x45e9bf[_0x42c5('0x2b')]){delete _0x45e9bf[_0x42c5('0x2b')];}_0x53e81b['status'](_0x27a6b5)[_0x42c5('0x2c')](_0x45e9bf);};}exports['show']=function(_0x16e198,_0x2daef6){var _0x23894d={'raw':!![],'where':{'id':_0x16e198['params']['id']}},_0x16dc94={};_0x16dc94['model']=_[_0x42c5('0x2d')](db[_0x42c5('0x2e')]['rawAttributes']);_0x16dc94[_0x42c5('0x2f')]=_['keys'](_0x16e198[_0x42c5('0x2f')]);_0x16dc94['filters']=_[_0x42c5('0x30')](_0x16dc94[_0x42c5('0x31')],_0x16dc94[_0x42c5('0x2f')]);_0x23894d['attributes']=_['intersection'](_0x16dc94[_0x42c5('0x31')],qs[_0x42c5('0x32')](_0x16e198[_0x42c5('0x2f')][_0x42c5('0x32')]));_0x23894d['attributes']=_0x23894d['attributes'][_0x42c5('0x33')]?_0x23894d[_0x42c5('0x34')]:_0x16dc94[_0x42c5('0x31')];if(_0x16e198[_0x42c5('0x2f')][_0x42c5('0x35')]){_0x23894d['include']=[{'all':!![]}];}_0x23894d=_[_0x42c5('0x36')]({},_0x23894d,_0x16e198[_0x42c5('0x37')]);return db['ChatApplication'][_0x42c5('0x38')](_0x23894d)['then'](handleEntityNotFound(_0x2daef6,null))[_0x42c5('0x26')](respondWithResult(_0x2daef6,null))[_0x42c5('0x39')](handleError(_0x2daef6,null));};exports['update']=function(_0x53f423,_0x565db6){if(_0x53f423['body']['id']){delete _0x53f423[_0x42c5('0x3a')]['id'];}return db[_0x42c5('0x2e')][_0x42c5('0x38')]({'where':{'id':_0x53f423[_0x42c5('0x3b')]['id']}})['then'](handleEntityNotFound(_0x565db6,null))[_0x42c5('0x26')](saveUpdates(_0x53f423[_0x42c5('0x3a')],null))[_0x42c5('0x26')](respondWithResult(_0x565db6,null))[_0x42c5('0x39')](handleError(_0x565db6,null));};exports['destroy']=function(_0x53dc30,_0x2c4c8d){return db['ChatApplication']['find']({'where':{'id':_0x53dc30['params']['id']}})[_0x42c5('0x26')](handleEntityNotFound(_0x2c4c8d,null))[_0x42c5('0x26')](removeEntity(_0x2c4c8d,null))[_0x42c5('0x39')](handleError(_0x2c4c8d,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index a313b3c..f283c18 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 _0xa34c=['request-promise','path','rimraf','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa34c,0x111));var _0xca34=function(_0x5c2145,_0x2a0a0a){_0x5c2145=_0x5c2145-0x0;var _0x21e161=_0xa34c[_0x5c2145];return _0x21e161;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xca34('0x0'))(_0xca34('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca34('0x2'));var fs=require('fs');var path=require(_0xca34('0x3'));var rimraf=require(_0xca34('0x4'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xca34('0x5')]=function(_0x3b4605,_0x3e44e2){return _0x3b4605[_0xca34('0x6')](_0xca34('0x7'),attributes,{'tableName':_0xca34('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca34('0x9'),'collate':_0xca34('0xa')});};
\ No newline at end of file
+var _0x6478=['bluebird','path','rimraf','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x6478,0x64));var _0x8647=function(_0x441195,_0x304a76){_0x441195=_0x441195-0x0;var _0x8de790=_0x6478[_0x441195];return _0x8de790;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var logger=require(_0x8647('0x2'))(_0x8647('0x3'));var moment=require('moment');var BPromise=require(_0x8647('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8647('0x5'));var rimraf=require(_0x8647('0x6'));var config=require('../../config/environment');var attributes=require(_0x8647('0x7'));module[_0x8647('0x8')]=function(_0x508131,_0x347eb2){return _0x508131['define'](_0x8647('0x9'),attributes,{'tableName':_0x8647('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8647('0xb'),'collate':_0x8647('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 80f161e..fc961bc 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 _0xacf8=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4d5179,_0x1275a1){var _0xe7d4d1=function(_0x482148){while(--_0x482148){_0x4d5179['push'](_0x4d5179['shift']());}};_0xe7d4d1(++_0x1275a1);}(_0xacf8,0x1b7));var _0x8acf=function(_0x4568a0,_0x3670bb){_0x4568a0=_0x4568a0-0x0;var _0x1bb2de=_0xacf8[_0x4568a0];return _0x1bb2de;};'use strict';var _=require(_0x8acf('0x0'));var util=require('util');var moment=require(_0x8acf('0x1'));var BPromise=require(_0x8acf('0x2'));var rs=require(_0x8acf('0x3'));var fs=require('fs');var Redis=require(_0x8acf('0x4'));var db=require(_0x8acf('0x5'))['db'];var utils=require(_0x8acf('0x6'));var logger=require(_0x8acf('0x7'))(_0x8acf('0x8'));var config=require(_0x8acf('0x9'));var jayson=require(_0x8acf('0xa'));var client=jayson['client'][_0x8acf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a0cfe,_0x44a27a,_0x8c3be9){return new BPromise(function(_0x3c420c,_0xa24d0f){return client[_0x8acf('0xc')](_0x2a0cfe,_0x8c3be9)[_0x8acf('0xd')](function(_0x58e499){logger[_0x8acf('0xe')]('ChatApplication,\x20%s,\x20%s',_0x44a27a,_0x8acf('0xf'));logger[_0x8acf('0x10')](_0x8acf('0x11'),_0x44a27a,'request\x20sent',JSON['stringify'](_0x58e499));if(_0x58e499[_0x8acf('0x12')]){if(_0x58e499['error'][_0x8acf('0x13')]===0x1f4){logger[_0x8acf('0x12')]('ChatApplication,\x20%s,\x20%s',_0x44a27a,_0x58e499['error'][_0x8acf('0x14')]);return _0xa24d0f(_0x58e499[_0x8acf('0x12')]['message']);}logger[_0x8acf('0x12')]('ChatApplication,\x20%s,\x20%s',_0x44a27a,_0x58e499['error'][_0x8acf('0x14')]);return _0x3c420c(_0x58e499['error'][_0x8acf('0x14')]);}else{logger[_0x8acf('0xe')]('ChatApplication,\x20%s,\x20%s',_0x44a27a,_0x8acf('0xf'));_0x3c420c(_0x58e499[_0x8acf('0x15')][_0x8acf('0x14')]);}})[_0x8acf('0x16')](function(_0x356ac1){logger[_0x8acf('0x12')]('ChatApplication,\x20%s,\x20%s',_0x44a27a,_0x356ac1);_0xa24d0f(_0x356ac1);});});}
\ No newline at end of file
+var _0xfb26=['error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1d0d13,_0x261e41){var _0x13c99d=function(_0x354536){while(--_0x354536){_0x1d0d13['push'](_0x1d0d13['shift']());}};_0x13c99d(++_0x261e41);}(_0xfb26,0x120));var _0x6fb2=function(_0x57c029,_0x302ebd){_0x57c029=_0x57c029-0x0;var _0x6b7d44=_0xfb26[_0x57c029];return _0x6b7d44;};'use strict';var _=require(_0x6fb2('0x0'));var util=require(_0x6fb2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6fb2('0x2'));var fs=require('fs');var Redis=require(_0x6fb2('0x3'));var db=require(_0x6fb2('0x4'))['db'];var utils=require(_0x6fb2('0x5'));var logger=require(_0x6fb2('0x6'))('rpc');var config=require(_0x6fb2('0x7'));var jayson=require(_0x6fb2('0x8'));var client=jayson[_0x6fb2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2da2,_0x27e5ab,_0xe10e3c){return new BPromise(function(_0x54f4cc,_0x30224a){return client['request'](_0x4a2da2,_0xe10e3c)[_0x6fb2('0xa')](function(_0x588493){logger[_0x6fb2('0xb')](_0x6fb2('0xc'),_0x27e5ab,_0x6fb2('0xd'));logger[_0x6fb2('0xe')](_0x6fb2('0xf'),_0x27e5ab,_0x6fb2('0xd'),JSON['stringify'](_0x588493));if(_0x588493[_0x6fb2('0x10')]){if(_0x588493[_0x6fb2('0x10')]['code']===0x1f4){logger[_0x6fb2('0x10')](_0x6fb2('0xc'),_0x27e5ab,_0x588493[_0x6fb2('0x10')][_0x6fb2('0x11')]);return _0x30224a(_0x588493[_0x6fb2('0x10')][_0x6fb2('0x11')]);}logger[_0x6fb2('0x10')](_0x6fb2('0xc'),_0x27e5ab,_0x588493['error'][_0x6fb2('0x11')]);return _0x54f4cc(_0x588493['error'][_0x6fb2('0x11')]);}else{logger[_0x6fb2('0xb')]('ChatApplication,\x20%s,\x20%s',_0x27e5ab,_0x6fb2('0xd'));_0x54f4cc(_0x588493['result'][_0x6fb2('0x11')]);}})[_0x6fb2('0x12')](function(_0x2e7cb6){logger[_0x6fb2('0x10')](_0x6fb2('0xc'),_0x27e5ab,_0x2e7cb6);_0x30224a(_0x2e7cb6);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 93df3ca..0894900 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 _0x1aa5=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','update','exports'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x1aa5,0xc3));var _0x51aa=function(_0x168d1e,_0x23934b){_0x168d1e=_0x168d1e-0x0;var _0x44e1e4=_0x1aa5[_0x168d1e];return _0x44e1e4;};'use strict';var multer=require(_0x51aa('0x0'));var util=require('util');var path=require(_0x51aa('0x1'));var timeout=require(_0x51aa('0x2'));var express=require(_0x51aa('0x3'));var router=express[_0x51aa('0x4')]();var fs_extra=require(_0x51aa('0x5'));var auth=require(_0x51aa('0x6'));var interaction=require(_0x51aa('0x7'));var config=require(_0x51aa('0x8'));var controller=require('./chatApplication.controller');router[_0x51aa('0x9')](_0x51aa('0xa'),auth['isAuthenticated'](),controller[_0x51aa('0xb')]);router['put'](_0x51aa('0xa'),auth[_0x51aa('0xc')](),controller[_0x51aa('0xd')]);router['delete']('/:id',auth[_0x51aa('0xc')](),controller['destroy']);module[_0x51aa('0xe')]=router;
\ No newline at end of file
+var _0x31bb=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','update','delete'];(function(_0x48d6b0,_0x51fdd2){var _0x238e8c=function(_0xb76765){while(--_0xb76765){_0x48d6b0['push'](_0x48d6b0['shift']());}};_0x238e8c(++_0x51fdd2);}(_0x31bb,0xf2));var _0xb31b=function(_0x5273e5,_0xa79850){_0x5273e5=_0x5273e5-0x0;var _0x33f3b3=_0x31bb[_0x5273e5];return _0x33f3b3;};'use strict';var multer=require('multer');var util=require(_0xb31b('0x0'));var path=require(_0xb31b('0x1'));var timeout=require(_0xb31b('0x2'));var express=require(_0xb31b('0x3'));var router=express[_0xb31b('0x4')]();var fs_extra=require(_0xb31b('0x5'));var auth=require(_0xb31b('0x6'));var interaction=require(_0xb31b('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xb31b('0x8')](_0xb31b('0x9'),auth[_0xb31b('0xa')](),controller[_0xb31b('0xb')]);router['put'](_0xb31b('0x9'),auth['isAuthenticated'](),controller[_0xb31b('0xc')]);router[_0xb31b('0xd')]('/:id',auth[_0xb31b('0xa')](),controller[_0xb31b('0xe')]);module[_0xb31b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index cd78888..0cdd86b 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 _0xd61c=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xd61c,0xb1));var _0xcd61=function(_0x38beb5,_0x2891c3){_0x38beb5=_0x38beb5-0x0;var _0x3f131d=_0xd61c[_0x38beb5];return _0x3f131d;};'use strict';var Sequelize=require(_0xcd61('0x0'));module[_0xcd61('0x1')]={'name':{'type':Sequelize[_0xcd61('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xcd61('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2e09=['sequelize','exports','STRING','BOOLEAN'];(function(_0x5f0179,_0x3777e9){var _0x2ee1d6=function(_0x15c593){while(--_0x15c593){_0x5f0179['push'](_0x5f0179['shift']());}};_0x2ee1d6(++_0x3777e9);}(_0x2e09,0xc8));var _0x92e0=function(_0x4810c3,_0x3cbbd4){_0x4810c3=_0x4810c3-0x0;var _0x3556ad=_0x2e09[_0x4810c3];return _0x3556ad;};'use strict';var Sequelize=require(_0x92e0('0x0'));module[_0x92e0('0x1')]={'name':{'type':Sequelize[_0x92e0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x92e0('0x2')]},'write':{'type':Sequelize[_0x92e0('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 db4803f..0b7f58f 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 _0xce4d=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','User','pick','getMembers','removeMembers','addMessage','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','ChatGroup'];(function(_0x4f697d,_0xbab271){var _0x139b6a=function(_0x541656){while(--_0x541656){_0x4f697d['push'](_0x4f697d['shift']());}};_0x139b6a(++_0xbab271);}(_0xce4d,0x1a7));var _0xdce4=function(_0x3bb6ec,_0x1d80af){_0x3bb6ec=_0x3bb6ec-0x0;var _0x129385=_0xce4d[_0x3bb6ec];return _0x129385;};'use strict';var emlformat=require(_0xdce4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdce4('0x1'));var jsonpatch=require(_0xdce4('0x2'));var rp=require(_0xdce4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdce4('0x4'));var util=require(_0xdce4('0x5'));var path=require(_0xdce4('0x6'));var sox=require(_0xdce4('0x7'));var csv=require(_0xdce4('0x8'));var ejs=require(_0xdce4('0x9'));var fs=require('fs');var fs_extra=require(_0xdce4('0xa'));var _=require(_0xdce4('0xb'));var squel=require('squel');var crypto=require(_0xdce4('0xc'));var jsforce=require(_0xdce4('0xd'));var deskjs=require(_0xdce4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdce4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdce4('0x10'));var as=require(_0xdce4('0x11'));var hardwareService=require(_0xdce4('0x12'));var logger=require(_0xdce4('0x13'))(_0xdce4('0x14'));var utils=require('../../config/utils');var config=require(_0xdce4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdce4('0x16'))['db'];config[_0xdce4('0x17')]=_['defaults'](config[_0xdce4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xdce4('0x18'))(new Redis(config[_0xdce4('0x17')]));require(_0xdce4('0x19'))['register'](socket);function respondWithStatusCode(_0x3823ba,_0x458668){_0x458668=_0x458668||0xcc;return function(_0x4ea570){if(_0x4ea570){return _0x3823ba[_0xdce4('0x1a')](_0x458668);}return _0x3823ba['status'](_0x458668)[_0xdce4('0x1b')]();};}function respondWithResult(_0x3ce238,_0x107102){_0x107102=_0x107102||0xc8;return function(_0x5e2842){if(_0x5e2842){return _0x3ce238['status'](_0x107102)[_0xdce4('0x1c')](_0x5e2842);}};}function respondWithFilteredResult(_0x4c05d5,_0x3af9b4){return function(_0x3fe779){if(_0x3fe779){var _0x1a59d3=typeof _0x3af9b4[_0xdce4('0x1d')]===_0xdce4('0x1e')&&typeof _0x3af9b4[_0xdce4('0x1f')]===_0xdce4('0x1e');var _0x467f3a=_0x3fe779[_0xdce4('0x20')];var _0x3d9f96=_0x1a59d3?0x0:_0x3af9b4[_0xdce4('0x1d')];var _0x136974=_0x1a59d3?_0x3fe779[_0xdce4('0x20')]:_0x3af9b4[_0xdce4('0x1d')]+_0x3af9b4[_0xdce4('0x1f')];var _0x31a002;if(_0x136974>=_0x467f3a){_0x136974=_0x467f3a;_0x31a002=0xc8;}else{_0x31a002=0xce;}_0x4c05d5[_0xdce4('0x21')](_0x31a002);return _0x4c05d5[_0xdce4('0x22')](_0xdce4('0x23'),_0x3d9f96+'-'+_0x136974+'/'+_0x467f3a)[_0xdce4('0x1c')](_0x3fe779);}return null;};}function patchUpdates(_0x14d66a){return function(_0x515151){try{jsonpatch[_0xdce4('0x24')](_0x515151,_0x14d66a,!![]);}catch(_0x509e00){return BPromise[_0xdce4('0x25')](_0x509e00);}return _0x515151[_0xdce4('0x26')]();};}function saveUpdates(_0x5049e2,_0x2957fd){return function(_0x4dd996){if(_0x4dd996){return _0x4dd996[_0xdce4('0x27')](_0x5049e2)[_0xdce4('0x28')](function(_0x7825dc){return _0x7825dc;});}return null;};}function removeEntity(_0x382e3a,_0x2835f5){return function(_0x15df4b){if(_0x15df4b){return _0x15df4b[_0xdce4('0x29')]()['then'](function(){_0x382e3a[_0xdce4('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e8c16,_0x11a6a5){return function(_0x27c0ce){if(!_0x27c0ce){_0x2e8c16[_0xdce4('0x1a')](0x194);}return _0x27c0ce;};}function handleError(_0x13f17c,_0x12bf47){_0x12bf47=_0x12bf47||0x1f4;return function(_0x1b309b){logger[_0xdce4('0x2a')](_0x1b309b['stack']);if(_0x1b309b['name']){delete _0x1b309b[_0xdce4('0x2b')];}_0x13f17c[_0xdce4('0x21')](_0x12bf47)['send'](_0x1b309b);};}exports[_0xdce4('0x2c')]=function(_0x50a1f6,_0x220aad){var _0x5d23cb={},_0x447684={},_0x3c5e09={'count':0x0,'rows':[]};var _0x493fdb=_[_0xdce4('0x2d')](db[_0xdce4('0x2e')][_0xdce4('0x2f')],function(_0x294a6e){return{'name':_0x294a6e[_0xdce4('0x30')],'type':_0x294a6e[_0xdce4('0x31')][_0xdce4('0x32')]};});_0x447684[_0xdce4('0x33')]=_[_0xdce4('0x2d')](_0x493fdb,_0xdce4('0x2b'));_0x447684[_0xdce4('0x34')]=_[_0xdce4('0x35')](_0x50a1f6[_0xdce4('0x34')]);_0x447684[_0xdce4('0x36')]=_[_0xdce4('0x37')](_0x447684[_0xdce4('0x33')],_0x447684[_0xdce4('0x34')]);_0x5d23cb['attributes']=_[_0xdce4('0x37')](_0x447684[_0xdce4('0x33')],qs[_0xdce4('0x38')](_0x50a1f6[_0xdce4('0x34')][_0xdce4('0x38')]));_0x5d23cb['attributes']=_0x5d23cb[_0xdce4('0x39')][_0xdce4('0x3a')]?_0x5d23cb[_0xdce4('0x39')]:_0x447684['model'];if(!_0x50a1f6[_0xdce4('0x34')][_0xdce4('0x3b')]('nolimit')){_0x5d23cb[_0xdce4('0x1f')]=qs[_0xdce4('0x1f')](_0x50a1f6[_0xdce4('0x34')][_0xdce4('0x1f')]);_0x5d23cb[_0xdce4('0x1d')]=qs['offset'](_0x50a1f6[_0xdce4('0x34')]['offset']);}_0x5d23cb[_0xdce4('0x3c')]=qs[_0xdce4('0x3d')](_0x50a1f6[_0xdce4('0x34')][_0xdce4('0x3d')]);_0x5d23cb[_0xdce4('0x3e')]=qs[_0xdce4('0x36')](_['pick'](_0x50a1f6[_0xdce4('0x34')],_0x447684['filters']),_0x493fdb);if(_0x50a1f6[_0xdce4('0x34')][_0xdce4('0x3f')]){_0x5d23cb['where']=_[_0xdce4('0x40')](_0x5d23cb[_0xdce4('0x3e')],{'$or':_[_0xdce4('0x2d')](_0x493fdb,function(_0x341b0a){if(_0x341b0a[_0xdce4('0x31')]!=='VIRTUAL'){var _0x4aa5b9={};_0x4aa5b9[_0x341b0a[_0xdce4('0x2b')]]={'$like':'%'+_0x50a1f6[_0xdce4('0x34')][_0xdce4('0x3f')]+'%'};return _0x4aa5b9;}})});}_0x5d23cb=_['merge']({},_0x5d23cb,_0x50a1f6[_0xdce4('0x41')]);var _0x12a162={'where':_0x5d23cb[_0xdce4('0x3e')]};return db[_0xdce4('0x2e')]['count'](_0x12a162)['then'](function(_0x18ad88){_0x3c5e09['count']=_0x18ad88;if(_0x50a1f6[_0xdce4('0x34')][_0xdce4('0x42')]){_0x5d23cb[_0xdce4('0x43')]=[{'all':!![]}];}return db[_0xdce4('0x2e')][_0xdce4('0x44')](_0x5d23cb);})[_0xdce4('0x28')](function(_0x5817c6){_0x3c5e09[_0xdce4('0x45')]=_0x5817c6;return _0x3c5e09;})[_0xdce4('0x28')](respondWithFilteredResult(_0x220aad,_0x5d23cb))[_0xdce4('0x46')](handleError(_0x220aad,null));};exports[_0xdce4('0x47')]=function(_0x296fa8,_0x1d04ce){var _0x20f64c={'raw':!![],'where':{'id':_0x296fa8[_0xdce4('0x48')]['id']}},_0xd703a7={};_0xd703a7[_0xdce4('0x33')]=_[_0xdce4('0x35')](db[_0xdce4('0x2e')][_0xdce4('0x2f')]);_0xd703a7['query']=_[_0xdce4('0x35')](_0x296fa8['query']);_0xd703a7[_0xdce4('0x36')]=_['intersection'](_0xd703a7[_0xdce4('0x33')],_0xd703a7[_0xdce4('0x34')]);_0x20f64c[_0xdce4('0x39')]=_['intersection'](_0xd703a7[_0xdce4('0x33')],qs['fields'](_0x296fa8[_0xdce4('0x34')][_0xdce4('0x38')]));_0x20f64c[_0xdce4('0x39')]=_0x20f64c[_0xdce4('0x39')][_0xdce4('0x3a')]?_0x20f64c[_0xdce4('0x39')]:_0xd703a7[_0xdce4('0x33')];if(_0x296fa8[_0xdce4('0x34')][_0xdce4('0x42')]){_0x20f64c['include']=[{'all':!![]}];}_0x20f64c=_['merge']({},_0x20f64c,_0x296fa8[_0xdce4('0x41')]);return db[_0xdce4('0x2e')][_0xdce4('0x49')](_0x20f64c)[_0xdce4('0x28')](handleEntityNotFound(_0x1d04ce,null))['then'](respondWithResult(_0x1d04ce,null))[_0xdce4('0x46')](handleError(_0x1d04ce,null));};exports[_0xdce4('0x4a')]=function(_0x37b4f6,_0x563c3f){return db[_0xdce4('0x2e')][_0xdce4('0x4a')](_0x37b4f6[_0xdce4('0x4b')],{})['then'](respondWithResult(_0x563c3f,0xc9))[_0xdce4('0x46')](handleError(_0x563c3f,null));};exports['update']=function(_0x23bf34,_0xc8613d){if(_0x23bf34['body']['id']){delete _0x23bf34['body']['id'];}return db[_0xdce4('0x2e')][_0xdce4('0x49')]({'where':{'id':_0x23bf34[_0xdce4('0x48')]['id']}})[_0xdce4('0x28')](handleEntityNotFound(_0xc8613d,null))['then'](saveUpdates(_0x23bf34[_0xdce4('0x4b')],null))[_0xdce4('0x28')](respondWithResult(_0xc8613d,null))['catch'](handleError(_0xc8613d,null));};exports[_0xdce4('0x29')]=function(_0x6eb4bf,_0x1abc70){return db[_0xdce4('0x2e')]['find']({'where':{'id':_0x6eb4bf[_0xdce4('0x48')]['id']}})[_0xdce4('0x28')](handleEntityNotFound(_0x1abc70,null))[_0xdce4('0x28')](removeEntity(_0x1abc70,null))[_0xdce4('0x46')](handleError(_0x1abc70,null));};exports[_0xdce4('0x4c')]=function(_0x72f91e,_0x3b2db9){return db[_0xdce4('0x2e')][_0xdce4('0x4c')]()['then'](respondWithResult(_0x3b2db9,null))[_0xdce4('0x46')](handleError(_0x3b2db9,null));};exports[_0xdce4('0x4d')]=function(_0x1dfa78,_0x396658,_0x1125a2){return db[_0xdce4('0x4e')][_0xdce4('0x20')]({'where':{'ChatGroupId':_0x1dfa78[_0xdce4('0x48')]['id'],'ToId':_0x1dfa78['user']['id'],'read':![]}})['then'](function(_0x46344d){return{'id':_[_0xdce4('0x4f')](_0x1dfa78[_0xdce4('0x48')]['id']),'count':_0x46344d};})[_0xdce4('0x28')](respondWithResult(_0x396658,null))['catch'](handleError(_0x396658,null));};exports[_0xdce4('0x50')]=function(_0x87d4e5,_0x149adf,_0x36833c){return db[_0xdce4('0x2e')][_0xdce4('0x49')]({'where':{'id':_0x87d4e5[_0xdce4('0x48')]['id']}})[_0xdce4('0x28')](handleEntityNotFound(_0x149adf,null))[_0xdce4('0x28')](function(_0x5e7533){if(_0x5e7533){return _0x5e7533[_0xdce4('0x50')](_0x87d4e5[_0xdce4('0x4b')][_0xdce4('0x51')],_[_0xdce4('0x52')](_0x87d4e5[_0xdce4('0x4b')],['ids','id'])||{});}})[_0xdce4('0x28')](respondWithResult(_0x149adf,null))[_0xdce4('0x46')](handleError(_0x149adf,null));};exports['getMembers']=function(_0x344f12,_0x361061,_0x7eba5b){var _0x339642={};var _0xfb25d7={};var _0x430bac;var _0x376415;return db['ChatGroup']['findOne']({'where':{'id':_0x344f12[_0xdce4('0x48')]['id']}})[_0xdce4('0x28')](handleEntityNotFound(_0x361061,null))[_0xdce4('0x28')](function(_0x28c748){if(_0x28c748){_0x430bac=_0x28c748;_0xfb25d7['model']=_[_0xdce4('0x35')](db[_0xdce4('0x53')]['rawAttributes']);_0xfb25d7[_0xdce4('0x34')]=_[_0xdce4('0x35')](_0x344f12[_0xdce4('0x34')]);_0xfb25d7['filters']=_[_0xdce4('0x37')](_0xfb25d7['model'],_0xfb25d7['query']);_0x339642[_0xdce4('0x39')]=_['intersection'](_0xfb25d7['model'],qs['fields'](_0x344f12['query'][_0xdce4('0x38')]));_0x339642['attributes']=_0x339642[_0xdce4('0x39')][_0xdce4('0x3a')]?_0x339642[_0xdce4('0x39')]:_0xfb25d7[_0xdce4('0x33')];_0x339642[_0xdce4('0x3c')]=qs[_0xdce4('0x3d')](_0x344f12[_0xdce4('0x34')][_0xdce4('0x3d')]);_0x339642[_0xdce4('0x3e')]=qs[_0xdce4('0x36')](_[_0xdce4('0x54')](_0x344f12[_0xdce4('0x34')],_0xfb25d7[_0xdce4('0x36')]));if(_0x344f12[_0xdce4('0x34')][_0xdce4('0x3f')]){_0x339642[_0xdce4('0x3e')]=_[_0xdce4('0x40')](_0x339642['where'],{'$or':_[_0xdce4('0x2d')](_0x339642[_0xdce4('0x39')],function(_0x4eb923){var _0x4b824f={};_0x4b824f[_0x4eb923]={'$like':'%'+_0x344f12[_0xdce4('0x34')][_0xdce4('0x3f')]+'%'};return _0x4b824f;})});}_0x339642=_[_0xdce4('0x40')]({},_0x339642,_0x344f12[_0xdce4('0x41')]);return _0x430bac[_0xdce4('0x55')](_0x339642);}})[_0xdce4('0x28')](function(_0x160872){if(_0x160872){_0x376415=_0x160872[_0xdce4('0x3a')];if(!_0x344f12[_0xdce4('0x34')][_0xdce4('0x3b')]('nolimit')){_0x339642[_0xdce4('0x1f')]=qs[_0xdce4('0x1f')](_0x344f12[_0xdce4('0x34')][_0xdce4('0x1f')]);_0x339642[_0xdce4('0x1d')]=qs[_0xdce4('0x1d')](_0x344f12[_0xdce4('0x34')][_0xdce4('0x1d')]);}return _0x430bac[_0xdce4('0x55')](_0x339642);}})[_0xdce4('0x28')](function(_0x47dee4){if(_0x47dee4){return _0x47dee4?{'count':_0x376415,'rows':_0x47dee4}:null;}})['then'](respondWithResult(_0x361061,null))[_0xdce4('0x46')](handleError(_0x361061,null));};exports['removeMembers']=function(_0x125859,_0x524be0,_0x2efe70){return db[_0xdce4('0x2e')]['find']({'where':{'id':_0x125859[_0xdce4('0x48')]['id']}})[_0xdce4('0x28')](handleEntityNotFound(_0x524be0,null))['then'](function(_0x2acc6c){if(_0x2acc6c){return _0x2acc6c[_0xdce4('0x56')](_0x125859[_0xdce4('0x34')][_0xdce4('0x51')]);}})[_0xdce4('0x28')](respondWithStatusCode(_0x524be0,null))[_0xdce4('0x46')](handleError(_0x524be0,null));};exports[_0xdce4('0x57')]=function(_0x5dade9,_0x34cd52,_0x3cd123){if(_0x5dade9[_0xdce4('0x4b')]['id']){delete _0x5dade9[_0xdce4('0x4b')]['id'];}return db[_0xdce4('0x2e')]['find']({'where':{'id':_0x5dade9['params']['id']}})[_0xdce4('0x28')](handleEntityNotFound(_0x34cd52,null))['then'](function(_0x180017){if(_0x180017){_0x5dade9[_0xdce4('0x4b')]['ChatGroupId']=_0x180017['id'];return db[_0xdce4('0x4e')][_0xdce4('0x4a')](_0x5dade9['body']);}})['then'](respondWithResult(_0x34cd52,null))[_0xdce4('0x46')](handleError(_0x34cd52,null));};exports['getMessages']=function(_0x1ce741,_0x180790,_0x4648dc){var _0xc69e07={};var _0x483cea={};var _0x1fecac;var _0x59dc7f;return db['ChatGroup'][_0xdce4('0x58')]({'where':{'id':_0x1ce741['params']['id']}})[_0xdce4('0x28')](handleEntityNotFound(_0x180790,null))[_0xdce4('0x28')](function(_0x399db3){if(_0x399db3){_0x1fecac=_0x399db3;_0x483cea[_0xdce4('0x33')]=_[_0xdce4('0x35')](db[_0xdce4('0x4e')][_0xdce4('0x2f')]);_0x483cea[_0xdce4('0x34')]=_[_0xdce4('0x35')](_0x1ce741['query']);_0x483cea[_0xdce4('0x36')]=_[_0xdce4('0x37')](_0x483cea[_0xdce4('0x33')],_0x483cea[_0xdce4('0x34')]);_0xc69e07[_0xdce4('0x39')]=_['intersection'](_0x483cea[_0xdce4('0x33')],qs[_0xdce4('0x38')](_0x1ce741[_0xdce4('0x34')][_0xdce4('0x38')]));_0xc69e07[_0xdce4('0x39')]=_0xc69e07[_0xdce4('0x39')][_0xdce4('0x3a')]?_0xc69e07[_0xdce4('0x39')]:_0x483cea[_0xdce4('0x33')];_0xc69e07['order']=qs['sort'](_0x1ce741[_0xdce4('0x34')][_0xdce4('0x3d')]);_0xc69e07[_0xdce4('0x3e')]=qs[_0xdce4('0x36')](_[_0xdce4('0x54')](_0x1ce741['query'],_0x483cea[_0xdce4('0x36')]));if(_0x1ce741[_0xdce4('0x34')]['filter']){_0xc69e07[_0xdce4('0x3e')]=_[_0xdce4('0x40')](_0xc69e07['where'],{'$or':_[_0xdce4('0x2d')](_0xc69e07[_0xdce4('0x39')],function(_0x1131c7){var _0x2ed4df={};_0x2ed4df[_0x1131c7]={'$like':'%'+_0x1ce741[_0xdce4('0x34')][_0xdce4('0x3f')]+'%'};return _0x2ed4df;})});}if(_0x1ce741['query'][_0xdce4('0x59')]){var _0x5d4830=_0x1ce741[_0xdce4('0x34')][_0xdce4('0x59')][_0xdce4('0x5a')](',');var _0x21635e={};_0x21635e[_0x5d4830[0x0]]={'$gte':moment(_0x5d4830[0x1])['format'](_0xdce4('0x5b'))};_0xc69e07[_0xdce4('0x3e')]=_[_0xdce4('0x40')](_0xc69e07['where'],_0x21635e);}_0xc69e07=_['merge']({},_0xc69e07,_0x1ce741[_0xdce4('0x41')]);return _0x1fecac[_0xdce4('0x5c')](_0xc69e07);}})[_0xdce4('0x28')](function(_0x264557){if(_0x264557){_0x59dc7f=_0x264557[_0xdce4('0x3a')];if(!_0x1ce741[_0xdce4('0x34')][_0xdce4('0x3b')](_0xdce4('0x5d'))){_0xc69e07[_0xdce4('0x1f')]=qs[_0xdce4('0x1f')](_0x1ce741[_0xdce4('0x34')]['limit']);_0xc69e07[_0xdce4('0x1d')]=qs[_0xdce4('0x1d')](_0x1ce741[_0xdce4('0x34')]['offset']);}return _0x1fecac[_0xdce4('0x5c')](_0xc69e07);}})[_0xdce4('0x28')](function(_0x2e8797){if(_0x2e8797){return _0x2e8797?{'count':_0x59dc7f,'rows':_0x2e8797}:null;}})[_0xdce4('0x28')](respondWithResult(_0x180790,null))[_0xdce4('0x46')](handleError(_0x180790,null));};
\ No newline at end of file
+var _0xf3a6=['order','sort','pick','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','merge','options','create','body','find','describe','toInteger','addMembers','ids','omit','getMembers','findOne','User','filter','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x4cd2ac,_0x25802a){var _0x294318=function(_0x3ecd7f){while(--_0x3ecd7f){_0x4cd2ac['push'](_0x4cd2ac['shift']());}};_0x294318(++_0x25802a);}(_0xf3a6,0x144));var _0x6f3a=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0xf3a6[_0x4191af];return _0x27bebf;};'use strict';var emlformat=require(_0x6f3a('0x0'));var rimraf=require(_0x6f3a('0x1'));var zipdir=require(_0x6f3a('0x2'));var jsonpatch=require(_0x6f3a('0x3'));var rp=require(_0x6f3a('0x4'));var moment=require(_0x6f3a('0x5'));var BPromise=require(_0x6f3a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6f3a('0x7'));var csv=require(_0x6f3a('0x8'));var ejs=require(_0x6f3a('0x9'));var fs=require('fs');var fs_extra=require(_0x6f3a('0xa'));var _=require(_0x6f3a('0xb'));var squel=require('squel');var crypto=require(_0x6f3a('0xc'));var jsforce=require(_0x6f3a('0xd'));var deskjs=require(_0x6f3a('0xe'));var toCsv=require(_0x6f3a('0x8'));var querystring=require(_0x6f3a('0xf'));var Papa=require('papaparse');var Redis=require(_0x6f3a('0x10'));var authService=require(_0x6f3a('0x11'));var qs=require(_0x6f3a('0x12'));var as=require(_0x6f3a('0x13'));var hardwareService=require(_0x6f3a('0x14'));var logger=require('../../config/logger')(_0x6f3a('0x15'));var utils=require(_0x6f3a('0x16'));var config=require(_0x6f3a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f3a('0x18'))['db'];config[_0x6f3a('0x19')]=_[_0x6f3a('0x1a')](config[_0x6f3a('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f3a('0x19')]));require(_0x6f3a('0x1b'))[_0x6f3a('0x1c')](socket);function respondWithStatusCode(_0x36aa47,_0x1a6314){_0x1a6314=_0x1a6314||0xcc;return function(_0x174855){if(_0x174855){return _0x36aa47[_0x6f3a('0x1d')](_0x1a6314);}return _0x36aa47[_0x6f3a('0x1e')](_0x1a6314)['end']();};}function respondWithResult(_0x5e5b8e,_0x2766a6){_0x2766a6=_0x2766a6||0xc8;return function(_0x4bf6c9){if(_0x4bf6c9){return _0x5e5b8e[_0x6f3a('0x1e')](_0x2766a6)[_0x6f3a('0x1f')](_0x4bf6c9);}};}function respondWithFilteredResult(_0x2c7931,_0x359b16){return function(_0x19cd5c){if(_0x19cd5c){var _0x41880c=typeof _0x359b16[_0x6f3a('0x20')]===_0x6f3a('0x21')&&typeof _0x359b16[_0x6f3a('0x22')]===_0x6f3a('0x21');var _0x3e32d3=_0x19cd5c[_0x6f3a('0x23')];var _0x10f6c5=_0x41880c?0x0:_0x359b16['offset'];var _0x1aa918=_0x41880c?_0x19cd5c['count']:_0x359b16['offset']+_0x359b16['limit'];var _0x30df8e;if(_0x1aa918>=_0x3e32d3){_0x1aa918=_0x3e32d3;_0x30df8e=0xc8;}else{_0x30df8e=0xce;}_0x2c7931[_0x6f3a('0x1e')](_0x30df8e);return _0x2c7931[_0x6f3a('0x24')](_0x6f3a('0x25'),_0x10f6c5+'-'+_0x1aa918+'/'+_0x3e32d3)[_0x6f3a('0x1f')](_0x19cd5c);}return null;};}function patchUpdates(_0x3dc652){return function(_0x35d427){try{jsonpatch[_0x6f3a('0x26')](_0x35d427,_0x3dc652,!![]);}catch(_0x346460){return BPromise[_0x6f3a('0x27')](_0x346460);}return _0x35d427['save']();};}function saveUpdates(_0x49c221,_0x11ebb7){return function(_0x123b41){if(_0x123b41){return _0x123b41[_0x6f3a('0x28')](_0x49c221)[_0x6f3a('0x29')](function(_0x10a89a){return _0x10a89a;});}return null;};}function removeEntity(_0x3f351a,_0x1febe4){return function(_0x356bdf){if(_0x356bdf){return _0x356bdf[_0x6f3a('0x2a')]()['then'](function(){_0x3f351a[_0x6f3a('0x1e')](0xcc)[_0x6f3a('0x2b')]();});}};}function handleEntityNotFound(_0x1dcd41,_0x2c08eb){return function(_0x492f4f){if(!_0x492f4f){_0x1dcd41[_0x6f3a('0x1d')](0x194);}return _0x492f4f;};}function handleError(_0x1894d7,_0x1d089b){_0x1d089b=_0x1d089b||0x1f4;return function(_0x182532){logger[_0x6f3a('0x2c')](_0x182532['stack']);if(_0x182532[_0x6f3a('0x2d')]){delete _0x182532[_0x6f3a('0x2d')];}_0x1894d7[_0x6f3a('0x1e')](_0x1d089b)['send'](_0x182532);};}exports[_0x6f3a('0x2e')]=function(_0x3fce3a,_0x349e53){var _0x1f7103={},_0x5d7125={},_0x4f7e5c={'count':0x0,'rows':[]};var _0x25087d=_[_0x6f3a('0x2f')](db[_0x6f3a('0x30')][_0x6f3a('0x31')],function(_0x3d9d3d){return{'name':_0x3d9d3d[_0x6f3a('0x32')],'type':_0x3d9d3d[_0x6f3a('0x33')]['key']};});_0x5d7125[_0x6f3a('0x34')]=_[_0x6f3a('0x2f')](_0x25087d,_0x6f3a('0x2d'));_0x5d7125[_0x6f3a('0x35')]=_[_0x6f3a('0x36')](_0x3fce3a['query']);_0x5d7125[_0x6f3a('0x37')]=_['intersection'](_0x5d7125[_0x6f3a('0x34')],_0x5d7125['query']);_0x1f7103['attributes']=_[_0x6f3a('0x38')](_0x5d7125[_0x6f3a('0x34')],qs[_0x6f3a('0x39')](_0x3fce3a['query'][_0x6f3a('0x39')]));_0x1f7103[_0x6f3a('0x3a')]=_0x1f7103['attributes'][_0x6f3a('0x3b')]?_0x1f7103[_0x6f3a('0x3a')]:_0x5d7125['model'];if(!_0x3fce3a[_0x6f3a('0x35')]['hasOwnProperty']('nolimit')){_0x1f7103[_0x6f3a('0x22')]=qs[_0x6f3a('0x22')](_0x3fce3a['query'][_0x6f3a('0x22')]);_0x1f7103['offset']=qs[_0x6f3a('0x20')](_0x3fce3a[_0x6f3a('0x35')]['offset']);}_0x1f7103[_0x6f3a('0x3c')]=qs[_0x6f3a('0x3d')](_0x3fce3a['query'][_0x6f3a('0x3d')]);_0x1f7103['where']=qs[_0x6f3a('0x37')](_[_0x6f3a('0x3e')](_0x3fce3a['query'],_0x5d7125[_0x6f3a('0x37')]),_0x25087d);if(_0x3fce3a[_0x6f3a('0x35')]['filter']){_0x1f7103[_0x6f3a('0x3f')]=_['merge'](_0x1f7103[_0x6f3a('0x3f')],{'$or':_[_0x6f3a('0x2f')](_0x25087d,function(_0x473420){if(_0x473420[_0x6f3a('0x33')]!==_0x6f3a('0x40')){var _0x45369e={};_0x45369e[_0x473420[_0x6f3a('0x2d')]]={'$like':'%'+_0x3fce3a['query']['filter']+'%'};return _0x45369e;}})});}_0x1f7103=_['merge']({},_0x1f7103,_0x3fce3a['options']);var _0x4e9968={'where':_0x1f7103[_0x6f3a('0x3f')]};return db[_0x6f3a('0x30')]['count'](_0x4e9968)[_0x6f3a('0x29')](function(_0x233137){_0x4f7e5c[_0x6f3a('0x23')]=_0x233137;if(_0x3fce3a[_0x6f3a('0x35')][_0x6f3a('0x41')]){_0x1f7103['include']=[{'all':!![]}];}return db[_0x6f3a('0x30')][_0x6f3a('0x42')](_0x1f7103);})[_0x6f3a('0x29')](function(_0x427e08){_0x4f7e5c[_0x6f3a('0x43')]=_0x427e08;return _0x4f7e5c;})[_0x6f3a('0x29')](respondWithFilteredResult(_0x349e53,_0x1f7103))[_0x6f3a('0x44')](handleError(_0x349e53,null));};exports[_0x6f3a('0x45')]=function(_0xe27e33,_0x11bef2){var _0x48fe2f={'raw':!![],'where':{'id':_0xe27e33[_0x6f3a('0x46')]['id']}},_0x416816={};_0x416816['model']=_[_0x6f3a('0x36')](db[_0x6f3a('0x30')][_0x6f3a('0x31')]);_0x416816[_0x6f3a('0x35')]=_[_0x6f3a('0x36')](_0xe27e33['query']);_0x416816['filters']=_[_0x6f3a('0x38')](_0x416816['model'],_0x416816[_0x6f3a('0x35')]);_0x48fe2f[_0x6f3a('0x3a')]=_[_0x6f3a('0x38')](_0x416816['model'],qs[_0x6f3a('0x39')](_0xe27e33[_0x6f3a('0x35')][_0x6f3a('0x39')]));_0x48fe2f[_0x6f3a('0x3a')]=_0x48fe2f[_0x6f3a('0x3a')]['length']?_0x48fe2f[_0x6f3a('0x3a')]:_0x416816['model'];if(_0xe27e33[_0x6f3a('0x35')][_0x6f3a('0x41')]){_0x48fe2f[_0x6f3a('0x47')]=[{'all':!![]}];}_0x48fe2f=_[_0x6f3a('0x48')]({},_0x48fe2f,_0xe27e33[_0x6f3a('0x49')]);return db[_0x6f3a('0x30')]['find'](_0x48fe2f)[_0x6f3a('0x29')](handleEntityNotFound(_0x11bef2,null))[_0x6f3a('0x29')](respondWithResult(_0x11bef2,null))[_0x6f3a('0x44')](handleError(_0x11bef2,null));};exports[_0x6f3a('0x4a')]=function(_0x38e708,_0x30ac40){return db[_0x6f3a('0x30')][_0x6f3a('0x4a')](_0x38e708[_0x6f3a('0x4b')],{})[_0x6f3a('0x29')](respondWithResult(_0x30ac40,0xc9))[_0x6f3a('0x44')](handleError(_0x30ac40,null));};exports[_0x6f3a('0x28')]=function(_0x4f96c7,_0x5ee088){if(_0x4f96c7['body']['id']){delete _0x4f96c7[_0x6f3a('0x4b')]['id'];}return db[_0x6f3a('0x30')][_0x6f3a('0x4c')]({'where':{'id':_0x4f96c7[_0x6f3a('0x46')]['id']}})[_0x6f3a('0x29')](handleEntityNotFound(_0x5ee088,null))[_0x6f3a('0x29')](saveUpdates(_0x4f96c7[_0x6f3a('0x4b')],null))['then'](respondWithResult(_0x5ee088,null))[_0x6f3a('0x44')](handleError(_0x5ee088,null));};exports[_0x6f3a('0x2a')]=function(_0x3b5c9c,_0x3df363){return db[_0x6f3a('0x30')][_0x6f3a('0x4c')]({'where':{'id':_0x3b5c9c[_0x6f3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x3df363,null))['then'](removeEntity(_0x3df363,null))[_0x6f3a('0x44')](handleError(_0x3df363,null));};exports[_0x6f3a('0x4d')]=function(_0x144a10,_0xb534b8){return db[_0x6f3a('0x30')][_0x6f3a('0x4d')]()['then'](respondWithResult(_0xb534b8,null))['catch'](handleError(_0xb534b8,null));};exports['getUnread']=function(_0x146963,_0x229c03,_0x728740){return db['ChatInternalMessage'][_0x6f3a('0x23')]({'where':{'ChatGroupId':_0x146963['params']['id'],'ToId':_0x146963['user']['id'],'read':![]}})[_0x6f3a('0x29')](function(_0x29ec26){return{'id':_[_0x6f3a('0x4e')](_0x146963[_0x6f3a('0x46')]['id']),'count':_0x29ec26};})['then'](respondWithResult(_0x229c03,null))[_0x6f3a('0x44')](handleError(_0x229c03,null));};exports[_0x6f3a('0x4f')]=function(_0x4f209c,_0x3f473a,_0x2ce7b3){return db[_0x6f3a('0x30')][_0x6f3a('0x4c')]({'where':{'id':_0x4f209c[_0x6f3a('0x46')]['id']}})[_0x6f3a('0x29')](handleEntityNotFound(_0x3f473a,null))[_0x6f3a('0x29')](function(_0x109c85){if(_0x109c85){return _0x109c85['addMembers'](_0x4f209c[_0x6f3a('0x4b')][_0x6f3a('0x50')],_[_0x6f3a('0x51')](_0x4f209c[_0x6f3a('0x4b')],[_0x6f3a('0x50'),'id'])||{});}})['then'](respondWithResult(_0x3f473a,null))[_0x6f3a('0x44')](handleError(_0x3f473a,null));};exports[_0x6f3a('0x52')]=function(_0xc16605,_0x27a7a8,_0x1552a5){var _0x54bb5a={};var _0x567c39={};var _0x37ddef;var _0x28b900;return db[_0x6f3a('0x30')][_0x6f3a('0x53')]({'where':{'id':_0xc16605[_0x6f3a('0x46')]['id']}})[_0x6f3a('0x29')](handleEntityNotFound(_0x27a7a8,null))[_0x6f3a('0x29')](function(_0x52e410){if(_0x52e410){_0x37ddef=_0x52e410;_0x567c39['model']=_[_0x6f3a('0x36')](db[_0x6f3a('0x54')][_0x6f3a('0x31')]);_0x567c39[_0x6f3a('0x35')]=_[_0x6f3a('0x36')](_0xc16605[_0x6f3a('0x35')]);_0x567c39[_0x6f3a('0x37')]=_[_0x6f3a('0x38')](_0x567c39[_0x6f3a('0x34')],_0x567c39['query']);_0x54bb5a[_0x6f3a('0x3a')]=_['intersection'](_0x567c39['model'],qs[_0x6f3a('0x39')](_0xc16605[_0x6f3a('0x35')][_0x6f3a('0x39')]));_0x54bb5a[_0x6f3a('0x3a')]=_0x54bb5a[_0x6f3a('0x3a')][_0x6f3a('0x3b')]?_0x54bb5a['attributes']:_0x567c39[_0x6f3a('0x34')];_0x54bb5a['order']=qs[_0x6f3a('0x3d')](_0xc16605[_0x6f3a('0x35')][_0x6f3a('0x3d')]);_0x54bb5a[_0x6f3a('0x3f')]=qs[_0x6f3a('0x37')](_['pick'](_0xc16605[_0x6f3a('0x35')],_0x567c39[_0x6f3a('0x37')]));if(_0xc16605[_0x6f3a('0x35')][_0x6f3a('0x55')]){_0x54bb5a['where']=_[_0x6f3a('0x48')](_0x54bb5a[_0x6f3a('0x3f')],{'$or':_[_0x6f3a('0x2f')](_0x54bb5a['attributes'],function(_0x4d7bad){var _0x302035={};_0x302035[_0x4d7bad]={'$like':'%'+_0xc16605[_0x6f3a('0x35')][_0x6f3a('0x55')]+'%'};return _0x302035;})});}_0x54bb5a=_[_0x6f3a('0x48')]({},_0x54bb5a,_0xc16605[_0x6f3a('0x49')]);return _0x37ddef['getMembers'](_0x54bb5a);}})['then'](function(_0x126f14){if(_0x126f14){_0x28b900=_0x126f14['length'];if(!_0xc16605['query'][_0x6f3a('0x56')](_0x6f3a('0x57'))){_0x54bb5a[_0x6f3a('0x22')]=qs[_0x6f3a('0x22')](_0xc16605[_0x6f3a('0x35')]['limit']);_0x54bb5a[_0x6f3a('0x20')]=qs['offset'](_0xc16605[_0x6f3a('0x35')][_0x6f3a('0x20')]);}return _0x37ddef['getMembers'](_0x54bb5a);}})[_0x6f3a('0x29')](function(_0x3c3ca8){if(_0x3c3ca8){return _0x3c3ca8?{'count':_0x28b900,'rows':_0x3c3ca8}:null;}})[_0x6f3a('0x29')](respondWithResult(_0x27a7a8,null))[_0x6f3a('0x44')](handleError(_0x27a7a8,null));};exports['removeMembers']=function(_0x14cbe4,_0x4581ec,_0x605dcc){return db['ChatGroup'][_0x6f3a('0x4c')]({'where':{'id':_0x14cbe4[_0x6f3a('0x46')]['id']}})[_0x6f3a('0x29')](handleEntityNotFound(_0x4581ec,null))['then'](function(_0x2f785d){if(_0x2f785d){return _0x2f785d[_0x6f3a('0x58')](_0x14cbe4['query'][_0x6f3a('0x50')]);}})[_0x6f3a('0x29')](respondWithStatusCode(_0x4581ec,null))['catch'](handleError(_0x4581ec,null));};exports[_0x6f3a('0x59')]=function(_0x178edc,_0xe4ef5e,_0x37c1fe){if(_0x178edc[_0x6f3a('0x4b')]['id']){delete _0x178edc[_0x6f3a('0x4b')]['id'];}return db[_0x6f3a('0x30')][_0x6f3a('0x4c')]({'where':{'id':_0x178edc[_0x6f3a('0x46')]['id']}})[_0x6f3a('0x29')](handleEntityNotFound(_0xe4ef5e,null))[_0x6f3a('0x29')](function(_0x4a2827){if(_0x4a2827){_0x178edc[_0x6f3a('0x4b')][_0x6f3a('0x5a')]=_0x4a2827['id'];return db[_0x6f3a('0x5b')][_0x6f3a('0x4a')](_0x178edc['body']);}})[_0x6f3a('0x29')](respondWithResult(_0xe4ef5e,null))[_0x6f3a('0x44')](handleError(_0xe4ef5e,null));};exports['getMessages']=function(_0x8498d1,_0x5a041a,_0x32c69d){var _0x3d88ce={};var _0xbbeef8={};var _0x2d3bb3;var _0x21f521;return db[_0x6f3a('0x30')][_0x6f3a('0x53')]({'where':{'id':_0x8498d1[_0x6f3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a041a,null))[_0x6f3a('0x29')](function(_0x1998f3){if(_0x1998f3){_0x2d3bb3=_0x1998f3;_0xbbeef8[_0x6f3a('0x34')]=_[_0x6f3a('0x36')](db[_0x6f3a('0x5b')][_0x6f3a('0x31')]);_0xbbeef8[_0x6f3a('0x35')]=_['keys'](_0x8498d1[_0x6f3a('0x35')]);_0xbbeef8[_0x6f3a('0x37')]=_[_0x6f3a('0x38')](_0xbbeef8['model'],_0xbbeef8['query']);_0x3d88ce['attributes']=_[_0x6f3a('0x38')](_0xbbeef8['model'],qs[_0x6f3a('0x39')](_0x8498d1['query']['fields']));_0x3d88ce[_0x6f3a('0x3a')]=_0x3d88ce[_0x6f3a('0x3a')][_0x6f3a('0x3b')]?_0x3d88ce[_0x6f3a('0x3a')]:_0xbbeef8[_0x6f3a('0x34')];_0x3d88ce[_0x6f3a('0x3c')]=qs['sort'](_0x8498d1[_0x6f3a('0x35')][_0x6f3a('0x3d')]);_0x3d88ce[_0x6f3a('0x3f')]=qs[_0x6f3a('0x37')](_[_0x6f3a('0x3e')](_0x8498d1[_0x6f3a('0x35')],_0xbbeef8['filters']));if(_0x8498d1[_0x6f3a('0x35')]['filter']){_0x3d88ce[_0x6f3a('0x3f')]=_[_0x6f3a('0x48')](_0x3d88ce[_0x6f3a('0x3f')],{'$or':_['map'](_0x3d88ce[_0x6f3a('0x3a')],function(_0x1ae3e5){var _0x550c55={};_0x550c55[_0x1ae3e5]={'$like':'%'+_0x8498d1[_0x6f3a('0x35')]['filter']+'%'};return _0x550c55;})});}if(_0x8498d1['query']['$gte']){var _0x37baf3=_0x8498d1['query'][_0x6f3a('0x5c')][_0x6f3a('0x5d')](',');var _0x4af6b0={};_0x4af6b0[_0x37baf3[0x0]]={'$gte':moment(_0x37baf3[0x1])['format'](_0x6f3a('0x5e'))};_0x3d88ce['where']=_[_0x6f3a('0x48')](_0x3d88ce['where'],_0x4af6b0);}_0x3d88ce=_['merge']({},_0x3d88ce,_0x8498d1['options']);return _0x2d3bb3[_0x6f3a('0x5f')](_0x3d88ce);}})['then'](function(_0x2e55fd){if(_0x2e55fd){_0x21f521=_0x2e55fd[_0x6f3a('0x3b')];if(!_0x8498d1[_0x6f3a('0x35')]['hasOwnProperty'](_0x6f3a('0x57'))){_0x3d88ce[_0x6f3a('0x22')]=qs['limit'](_0x8498d1[_0x6f3a('0x35')][_0x6f3a('0x22')]);_0x3d88ce[_0x6f3a('0x20')]=qs[_0x6f3a('0x20')](_0x8498d1[_0x6f3a('0x35')]['offset']);}return _0x2d3bb3['getMessages'](_0x3d88ce);}})[_0x6f3a('0x29')](function(_0x282ced){if(_0x282ced){return _0x282ced?{'count':_0x21f521,'rows':_0x282ced}:null;}})['then'](respondWithResult(_0x5a041a,null))[_0x6f3a('0x44')](handleError(_0x5a041a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 8189593..946a9f4 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 _0x3869=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x18b125,_0x5e9726){var _0x203201=function(_0x4e21c5){while(--_0x4e21c5){_0x18b125['push'](_0x18b125['shift']());}};_0x203201(++_0x5e9726);}(_0x3869,0x115));var _0x9386=function(_0x3c31d9,_0x1dc694){_0x3c31d9=_0x3c31d9-0x0;var _0x461922=_0x3869[_0x3c31d9];return _0x461922;};'use strict';var EventEmitter=require(_0x9386('0x0'));var ChatGroup=require(_0x9386('0x1'))['db'][_0x9386('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9386('0x3')](0x0);var events={'afterCreate':_0x9386('0x4'),'afterUpdate':_0x9386('0x5'),'afterDestroy':_0x9386('0x6')};function emitEvent(_0x3f7809){return function(_0x410ff8,_0x2afb08,_0x2f739a){ChatGroupEvents[_0x9386('0x7')](_0x3f7809+':'+_0x410ff8['id'],_0x410ff8);ChatGroupEvents[_0x9386('0x7')](_0x3f7809,_0x410ff8);_0x2f739a(null);};}for(var e in events){if(events[_0x9386('0x8')](e)){var event=events[e];ChatGroup[_0x9386('0x9')](e,emitEvent(event));}}module[_0x9386('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x04d5=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x71d2f1,_0xeecdf3){var _0x2a8807=function(_0x14b9e2){while(--_0x14b9e2){_0x71d2f1['push'](_0x71d2f1['shift']());}};_0x2a8807(++_0xeecdf3);}(_0x04d5,0xe1));var _0x504d=function(_0x164096,_0x56429e){_0x164096=_0x164096-0x0;var _0x47fa4d=_0x04d5[_0x164096];return _0x47fa4d;};'use strict';var EventEmitter=require(_0x504d('0x0'));var ChatGroup=require(_0x504d('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x504d('0x2')](0x0);var events={'afterCreate':_0x504d('0x3'),'afterUpdate':_0x504d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8a595d){return function(_0x219680,_0x2c5833,_0x3d083e){ChatGroupEvents[_0x504d('0x5')](_0x8a595d+':'+_0x219680['id'],_0x219680);ChatGroupEvents['emit'](_0x8a595d,_0x219680);_0x3d083e(null);};}for(var e in events){if(events[_0x504d('0x6')](e)){var event=events[e];ChatGroup[_0x504d('0x7')](e,emitEvent(event));}}module[_0x504d('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 02cbcec..8941d62 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 _0xa7c2=['request-promise','path','./chatGroup.attributes','exports','define','ChatGroup','../../config/logger','api','moment'];(function(_0x21fbb9,_0x3fc1f8){var _0x189ce5=function(_0x55a14b){while(--_0x55a14b){_0x21fbb9['push'](_0x21fbb9['shift']());}};_0x189ce5(++_0x3fc1f8);}(_0xa7c2,0x192));var _0x2a7c=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xa7c2[_0x45f951];return _0x24756c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2a7c('0x0'))(_0x2a7c('0x1'));var moment=require(_0x2a7c('0x2'));var BPromise=require('bluebird');var rp=require(_0x2a7c('0x3'));var fs=require('fs');var path=require(_0x2a7c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2a7c('0x5'));module[_0x2a7c('0x6')]=function(_0x1bccb5,_0x40e3ed){return _0x1bccb5[_0x2a7c('0x7')](_0x2a7c('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b75=['chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x36ccd9,_0x38cd05){var _0x2a4ffc=function(_0x545221){while(--_0x545221){_0x36ccd9['push'](_0x36ccd9['shift']());}};_0x2a4ffc(++_0x38cd05);}(_0x3b75,0x194));var _0x53b7=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0x3b75[_0x4bc4c8];return _0x3bb121;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var logger=require(_0x53b7('0x2'))(_0x53b7('0x3'));var moment=require(_0x53b7('0x4'));var BPromise=require('bluebird');var rp=require(_0x53b7('0x5'));var fs=require('fs');var path=require(_0x53b7('0x6'));var rimraf=require(_0x53b7('0x7'));var config=require(_0x53b7('0x8'));var attributes=require(_0x53b7('0x9'));module[_0x53b7('0xa')]=function(_0x222b0f,_0x128483){return _0x222b0f[_0x53b7('0xb')]('ChatGroup',attributes,{'tableName':_0x53b7('0xc'),'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 501d6f2..f7ae6b1 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 _0x1360=['request\x20sent','debug','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1360,0xd6));var _0x0136=function(_0x15e17c,_0x39f6c8){_0x15e17c=_0x15e17c-0x0;var _0x55d8c7=_0x1360[_0x15e17c];return _0x55d8c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0136('0x0'));var BPromise=require(_0x0136('0x1'));var rs=require(_0x0136('0x2'));var fs=require('fs');var Redis=require(_0x0136('0x3'));var db=require(_0x0136('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0136('0x5'))(_0x0136('0x6'));var config=require(_0x0136('0x7'));var jayson=require(_0x0136('0x8'));var client=jayson[_0x0136('0x9')][_0x0136('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0136('0xb')],{'host':_0x0136('0xc'),'port':0x18eb});var socket=require(_0x0136('0xd'))(new Redis(config[_0x0136('0xb')]));require(_0x0136('0xe'))[_0x0136('0xf')](socket);function respondWithRpcPromise(_0x1a6998,_0x16c9ee,_0x23bb49){return new BPromise(function(_0x1453f3,_0x5cdd79){return client[_0x0136('0x10')](_0x1a6998,_0x23bb49)[_0x0136('0x11')](function(_0x1f89fb){logger[_0x0136('0x12')](_0x0136('0x13'),_0x16c9ee,_0x0136('0x14'));logger[_0x0136('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x16c9ee,'request\x20sent',JSON['stringify'](_0x1f89fb));if(_0x1f89fb[_0x0136('0x16')]){if(_0x1f89fb[_0x0136('0x16')][_0x0136('0x17')]===0x1f4){logger[_0x0136('0x16')](_0x0136('0x13'),_0x16c9ee,_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);return _0x5cdd79(_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);}logger[_0x0136('0x16')]('ChatGroup,\x20%s,\x20%s',_0x16c9ee,_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);return _0x1453f3(_0x1f89fb['error'][_0x0136('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x16c9ee,_0x0136('0x14'));_0x1453f3(_0x1f89fb[_0x0136('0x19')]['message']);}})['catch'](function(_0x3d7595){logger['error']('ChatGroup,\x20%s,\x20%s',_0x16c9ee,_0x3d7595);_0x5cdd79(_0x3d7595);});});}
\ No newline at end of file
+var _0x1061=['code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1061,0x1b5));var _0x1106=function(_0x4be841,_0x1805d1){_0x4be841=_0x4be841-0x0;var _0x479ce8=_0x1061[_0x4be841];return _0x479ce8;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1106('0x1'));var fs=require('fs');var Redis=require(_0x1106('0x2'));var db=require(_0x1106('0x3'))['db'];var utils=require(_0x1106('0x4'));var logger=require(_0x1106('0x5'))(_0x1106('0x6'));var config=require(_0x1106('0x7'));var jayson=require(_0x1106('0x8'));var client=jayson['client'][_0x1106('0x9')]({'port':0x232a});config[_0x1106('0xa')]=_['defaults'](config['redis'],{'host':_0x1106('0xb'),'port':0x18eb});var socket=require(_0x1106('0xc'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x1106('0xd')](socket);function respondWithRpcPromise(_0x1058d1,_0x46837b,_0x3f940e){return new BPromise(function(_0x456967,_0x2f9a44){return client[_0x1106('0xe')](_0x1058d1,_0x3f940e)[_0x1106('0xf')](function(_0x362404){logger[_0x1106('0x10')]('ChatGroup,\x20%s,\x20%s',_0x46837b,_0x1106('0x11'));logger[_0x1106('0x12')](_0x1106('0x13'),_0x46837b,_0x1106('0x11'),JSON[_0x1106('0x14')](_0x362404));if(_0x362404[_0x1106('0x15')]){if(_0x362404[_0x1106('0x15')][_0x1106('0x16')]===0x1f4){logger[_0x1106('0x15')](_0x1106('0x17'),_0x46837b,_0x362404[_0x1106('0x15')][_0x1106('0x18')]);return _0x2f9a44(_0x362404[_0x1106('0x15')][_0x1106('0x18')]);}logger[_0x1106('0x15')](_0x1106('0x17'),_0x46837b,_0x362404[_0x1106('0x15')][_0x1106('0x18')]);return _0x456967(_0x362404['error']['message']);}else{logger[_0x1106('0x10')](_0x1106('0x17'),_0x46837b,_0x1106('0x11'));_0x456967(_0x362404[_0x1106('0x19')]['message']);}})[_0x1106('0x1a')](function(_0x3e4b0c){logger[_0x1106('0x15')](_0x1106('0x17'),_0x46837b,_0x3e4b0c);_0x2f9a44(_0x3e4b0c);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index fcdbb97..6caf6c3 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 _0x5cb3=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register'];(function(_0x585312,_0x4fa0b2){var _0x98911c=function(_0x56d196){while(--_0x56d196){_0x585312['push'](_0x585312['shift']());}};_0x98911c(++_0x4fa0b2);}(_0x5cb3,0x174));var _0x35cb=function(_0x3969e9,_0xe76b74){_0x3969e9=_0x3969e9-0x0;var _0x2c10be=_0x5cb3[_0x3969e9];return _0x2c10be;};'use strict';var ChatGroupEvents=require(_0x35cb('0x0'));var events=['save',_0x35cb('0x1'),_0x35cb('0x2')];function createListener(_0x2ae752,_0x4708ba){return function(_0x2cb6d6){_0x4708ba[_0x35cb('0x3')](_0x2ae752,_0x2cb6d6);};}function removeListener(_0x4c9c39,_0x4cbaa7){return function(){ChatGroupEvents[_0x35cb('0x4')](_0x4c9c39,_0x4cbaa7);};}exports[_0x35cb('0x5')]=function(_0x461fa0){for(var _0x4983d4=0x0,_0x2de43c=events['length'];_0x4983d4<_0x2de43c;_0x4983d4++){var _0x2431ae=events[_0x4983d4];var _0x5698d7=createListener(_0x35cb('0x6')+_0x2431ae,_0x461fa0);ChatGroupEvents['on'](_0x2431ae,_0x5698d7);}};
\ No newline at end of file
+var _0xce5c=['chatGroup:','./chatGroup.events','save','update','emit','register','length'];(function(_0x5029d5,_0x12c3fa){var _0x3f8a29=function(_0x513180){while(--_0x513180){_0x5029d5['push'](_0x5029d5['shift']());}};_0x3f8a29(++_0x12c3fa);}(_0xce5c,0x1dd));var _0xcce5=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0xce5c[_0x478c8a];return _0x3b6b3e;};'use strict';var ChatGroupEvents=require(_0xcce5('0x0'));var events=[_0xcce5('0x1'),'remove',_0xcce5('0x2')];function createListener(_0x3ec7e9,_0xc4ad76){return function(_0x44a05f){_0xc4ad76[_0xcce5('0x3')](_0x3ec7e9,_0x44a05f);};}function removeListener(_0x554d9b,_0x18c801){return function(){ChatGroupEvents['removeListener'](_0x554d9b,_0x18c801);};}exports[_0xcce5('0x4')]=function(_0x1d9e1d){for(var _0x5d7695=0x0,_0x565450=events[_0xcce5('0x5')];_0x5d7695<_0x565450;_0x5d7695++){var _0x482ea9=events[_0x5d7695];var _0x1bddb9=createListener(_0xcce5('0x6')+_0x482ea9,_0x1d9e1d);ChatGroupEvents['on'](_0x482ea9,_0x1bddb9);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 6d555a4..ba12ad0 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 _0x4852=['getMembers','/:id/messages','getMessages','post','addMembers','addMessage','update','destroy','removeMembers','util','path','connect-timeout','express','Router','fs-extra','./chatGroup.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','getUnread','/:id/members'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4852,0x10d));var _0x2485=function(_0x3bd1d4,_0x3fc053){_0x3bd1d4=_0x3bd1d4-0x0;var _0x11a08d=_0x4852[_0x3bd1d4];return _0x11a08d;};'use strict';var multer=require('multer');var util=require(_0x2485('0x0'));var path=require(_0x2485('0x1'));var timeout=require(_0x2485('0x2'));var express=require(_0x2485('0x3'));var router=express[_0x2485('0x4')]();var fs_extra=require(_0x2485('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2485('0x6'));router['get']('/',auth[_0x2485('0x7')](),controller[_0x2485('0x8')]);router['get'](_0x2485('0x9'),auth[_0x2485('0x7')](),controller[_0x2485('0xa')]);router[_0x2485('0xb')](_0x2485('0xc'),auth['isAuthenticated'](),controller[_0x2485('0xd')]);router[_0x2485('0xb')](_0x2485('0xe'),auth[_0x2485('0x7')](),controller[_0x2485('0xf')]);router[_0x2485('0xb')](_0x2485('0x10'),auth[_0x2485('0x7')](),controller[_0x2485('0x11')]);router[_0x2485('0xb')](_0x2485('0x12'),auth[_0x2485('0x7')](),controller[_0x2485('0x13')]);router[_0x2485('0x14')]('/',auth[_0x2485('0x7')](),controller['create']);router['post'](_0x2485('0x10'),auth[_0x2485('0x7')](),controller[_0x2485('0x15')]);router[_0x2485('0x14')]('/:id/messages',auth[_0x2485('0x7')](),controller[_0x2485('0x16')]);router['put'](_0x2485('0xc'),auth[_0x2485('0x7')](),controller[_0x2485('0x17')]);router['delete'](_0x2485('0xc'),auth[_0x2485('0x7')](),controller[_0x2485('0x18')]);router['delete'](_0x2485('0x10'),auth[_0x2485('0x7')](),controller[_0x2485('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xd518=['fs-extra','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','exports','path','Router'];(function(_0x12d423,_0x295982){var _0x32a7f5=function(_0x35f0d7){while(--_0x35f0d7){_0x12d423['push'](_0x12d423['shift']());}};_0x32a7f5(++_0x295982);}(_0xd518,0x1c6));var _0x8d51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd518[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d51('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d51('0x1')]();var fs_extra=require(_0x8d51('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d51('0x3'));var controller=require(_0x8d51('0x4'));router[_0x8d51('0x5')]('/',auth[_0x8d51('0x6')](),controller[_0x8d51('0x7')]);router[_0x8d51('0x5')](_0x8d51('0x8'),auth[_0x8d51('0x6')](),controller[_0x8d51('0x9')]);router[_0x8d51('0x5')](_0x8d51('0xa'),auth['isAuthenticated'](),controller[_0x8d51('0xb')]);router[_0x8d51('0x5')]('/:id/unread',auth['isAuthenticated'](),controller['getUnread']);router[_0x8d51('0x5')](_0x8d51('0xc'),auth[_0x8d51('0x6')](),controller[_0x8d51('0xd')]);router[_0x8d51('0x5')](_0x8d51('0xe'),auth[_0x8d51('0x6')](),controller[_0x8d51('0xf')]);router[_0x8d51('0x10')]('/',auth[_0x8d51('0x6')](),controller[_0x8d51('0x11')]);router[_0x8d51('0x10')]('/:id/members',auth[_0x8d51('0x6')](),controller[_0x8d51('0x12')]);router[_0x8d51('0x10')]('/:id/messages',auth[_0x8d51('0x6')](),controller[_0x8d51('0x13')]);router['put'](_0x8d51('0xa'),auth[_0x8d51('0x6')](),controller[_0x8d51('0x14')]);router[_0x8d51('0x15')](_0x8d51('0xa'),auth[_0x8d51('0x6')](),controller[_0x8d51('0x16')]);router[_0x8d51('0x15')](_0x8d51('0xc'),auth[_0x8d51('0x6')](),controller['removeMembers']);module[_0x8d51('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 607c3ae..47fd27c 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 _0xc584=['TEXT','DATE','STRING','long','ENUM','out','exports','BOOLEAN','star'];(function(_0x4a88d5,_0x542d24){var _0x5cbf97=function(_0x4f7309){while(--_0x4f7309){_0x4a88d5['push'](_0x4a88d5['shift']());}};_0x5cbf97(++_0x542d24);}(_0xc584,0xa8));var _0x4c58=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0xc584[_0x3f4dd9];return _0x31c54a;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'closed':{'type':Sequelize[_0x4c58('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x4c58('0x2'),'thumb'),'defaultValue':_0x4c58('0x2')},'ratingMessage':{'type':Sequelize[_0x4c58('0x3')]},'pathTranscript':{'type':Sequelize[_0x4c58('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4c58('0x4')]},'disposition':{'type':Sequelize[_0x4c58('0x5')]},'secondDisposition':{'type':Sequelize[_0x4c58('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4c58('0x5')]},'note':{'type':Sequelize[_0x4c58('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4c58('0x5')]},'deviceModel':{'type':Sequelize[_0x4c58('0x5')]},'deviceVendor':{'type':Sequelize[_0x4c58('0x5')]},'deviceType':{'type':Sequelize[_0x4c58('0x5')]},'referer':{'type':Sequelize[_0x4c58('0x3')]},'customerIp':{'type':Sequelize[_0x4c58('0x5')]},'formData':{'type':Sequelize[_0x4c58('0x3')](_0x4c58('0x6'))},'read1stAt':{'type':Sequelize[_0x4c58('0x4')]},'lastMsgAt':{'type':Sequelize[_0x4c58('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x4c58('0x7')]('in',_0x4c58('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4c58('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x657b=['TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x657b,0x131));var _0xb657=function(_0x9c7979,_0x23ebe3){_0x9c7979=_0x9c7979-0x0;var _0x3feb67=_0x657b[_0x9c7979];return _0x3feb67;};'use strict';var Sequelize=require(_0xb657('0x0'));module[_0xb657('0x1')]={'closed':{'type':Sequelize[_0xb657('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb657('0x3')]},'ratingType':{'type':Sequelize[_0xb657('0x4')]('star',_0xb657('0x5')),'defaultValue':_0xb657('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xb657('0x7')]},'mailTranscript':{'type':Sequelize[_0xb657('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb657('0x9')]},'disposition':{'type':Sequelize[_0xb657('0x8')]},'secondDisposition':{'type':Sequelize[_0xb657('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb657('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xb657('0x8')]},'osName':{'type':Sequelize[_0xb657('0x8')]},'osVersion':{'type':Sequelize[_0xb657('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xb657('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xb657('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xb657('0x7')](_0xb657('0xa'))},'read1stAt':{'type':Sequelize[_0xb657('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb657('0x4')]('in',_0xb657('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xb657('0x8')]},'customerPort':{'type':Sequelize[_0xb657('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xb657('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 2c72581..ab7e417 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 _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x3342da,_0x3238ee){var _0x32ee79=function(_0x4054eb){while(--_0x4054eb){_0x3342da['push'](_0x3342da['shift']());}};_0x32ee79(++_0x3238ee);}(_0x4fc2,0x111));var _0x24fc=function(_0x5d7583,_0x48a446){_0x5d7583=_0x5d7583-0x0;var _0x1e615c=_0x4fc2[_0x5d7583];return _0x1e615c;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));};
\ No newline at end of file
+var _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x5d91b6,_0x124e85){var _0x4070bd=function(_0x5e208a){while(--_0x5e208a){_0x5d91b6['push'](_0x5d91b6['shift']());}};_0x4070bd(++_0x124e85);}(_0x4fc2,0x111));var _0x24fc=function(_0x2d1840,_0x5dc27e){_0x2d1840=_0x2d1840-0x0;var _0xd06a88=_0x4fc2[_0x2d1840];return _0xd06a88;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 39a73e2..84cea7c 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 _0xc2d9=['remove','getUsers','then','Users','map','findAll','setDataValue','length','emit','hasOwnProperty','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0xc2d9,0x71));var _0x9c2d=function(_0x5eb58f,_0x2de089){_0x5eb58f=_0x5eb58f-0x0;var _0x539bb6=_0xc2d9[_0x5eb58f];return _0x539bb6;};'use strict';var EventEmitter=require(_0x9c2d('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x9c2d('0x1')];var ChatMessage=require(_0x9c2d('0x2'))['db'][_0x9c2d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c2d('0x4'),'afterUpdate':_0x9c2d('0x5'),'afterDestroy':_0x9c2d('0x6')};function emitEvent(_0x3db3f4){return function(_0x3b0ac0,_0x3c0d85,_0x4732c0){_0x3b0ac0[_0x9c2d('0x7')]({'attributes':['id'],'raw':!![]})[_0x9c2d('0x8')](function(_0x26e221){_0x3b0ac0['setDataValue'](_0x9c2d('0x9'),_0x26e221[_0x9c2d('0xa')](function(_0x290d4c){return{'id':_0x290d4c['id']};}));return ChatMessage[_0x9c2d('0xb')]({'where':{'ChatInteractionId':_0x3b0ac0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9c2d('0x8')](function(_0x2f6b12){_0x3b0ac0[_0x9c2d('0xc')]('unreadMessages',_0x2f6b12[_0x9c2d('0xd')]);ChatInteractionEvents['emit'](_0x3db3f4+':'+_0x3b0ac0['id'],_0x3b0ac0);ChatInteractionEvents[_0x9c2d('0xe')](_0x3db3f4,_0x3b0ac0);_0x4732c0(null);})['catch'](_0x4732c0(null));};}for(var e in events){if(events[_0x9c2d('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x9c2d('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb8fd=['../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','Users','map','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xb8fd,0xdc));var _0xdb8f=function(_0x2c3d24,_0x1f5e07){_0x2c3d24=_0x2c3d24-0x0;var _0x14fbef=_0xb8fd[_0x2c3d24];return _0x14fbef;};'use strict';var EventEmitter=require(_0xdb8f('0x0'));var ChatInteraction=require(_0xdb8f('0x1'))['db'][_0xdb8f('0x2')];var ChatMessage=require(_0xdb8f('0x1'))['db'][_0xdb8f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb8f('0x4'),'afterUpdate':_0xdb8f('0x5'),'afterDestroy':_0xdb8f('0x6')};function emitEvent(_0x192397){return function(_0x40b96a,_0x3edb4f,_0x1cd887){_0x40b96a[_0xdb8f('0x7')]({'attributes':['id'],'raw':!![]})[_0xdb8f('0x8')](function(_0x11239b){_0x40b96a[_0xdb8f('0x9')](_0xdb8f('0xa'),_0x11239b[_0xdb8f('0xb')](function(_0x384a12){return{'id':_0x384a12['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x40b96a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1a4fad){_0x40b96a['setDataValue']('unreadMessages',_0x1a4fad['length']);ChatInteractionEvents[_0xdb8f('0xc')](_0x192397+':'+_0x40b96a['id'],_0x40b96a);ChatInteractionEvents[_0xdb8f('0xc')](_0x192397,_0x40b96a);_0x1cd887(null);})[_0xdb8f('0xd')](_0x1cd887(null));};}for(var e in events){if(events[_0xdb8f('0xe')](e)){var event=events[e];ChatInteraction[_0xdb8f('0xf')](e,emitEvent(event));}}module[_0xdb8f('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 29ced3f..16fbbce 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 _0xcf4c=['exports','define','ChatInteraction','chat_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xcf4c,0xd8));var _0xccf4=function(_0x1cb514,_0x4fa2ce){_0x1cb514=_0x1cb514-0x0;var _0x139aed=_0xcf4c[_0x1cb514];return _0x139aed;};'use strict';var _=require('lodash');var util=require(_0xccf4('0x0'));var logger=require(_0xccf4('0x1'))(_0xccf4('0x2'));var moment=require('moment');var BPromise=require(_0xccf4('0x3'));var rp=require(_0xccf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccf4('0x5'));var config=require(_0xccf4('0x6'));var attributes=require(_0xccf4('0x7'));module[_0xccf4('0x8')]=function(_0x891393,_0x1b54fb){return _0x891393[_0xccf4('0x9')](_0xccf4('0xa'),attributes,{'tableName':_0xccf4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2828fe,_0x4dd70e,_0x4b1b4d){if(_0x2828fe['changed'](_0xccf4('0xc'))){_0x2828fe['closedAt']=moment()['format'](_0xccf4('0xd'));}_0x4b1b4d(null,_0x2828fe);}},'charset':_0xccf4('0xe'),'collate':_0xccf4('0xf')});};
\ No newline at end of file
+var _0x86ed=['moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0x86ed,0x9f));var _0xd86e=function(_0x13a7d8,_0x21ac15){_0x13a7d8=_0x13a7d8-0x0;var _0x869238=_0x86ed[_0x13a7d8];return _0x869238;};'use strict';var _=require(_0xd86e('0x0'));var util=require(_0xd86e('0x1'));var logger=require(_0xd86e('0x2'))('api');var moment=require(_0xd86e('0x3'));var BPromise=require(_0xd86e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd86e('0x5'));var rimraf=require(_0xd86e('0x6'));var config=require(_0xd86e('0x7'));var attributes=require(_0xd86e('0x8'));module[_0xd86e('0x9')]=function(_0x425f00,_0x35460e){return _0x425f00[_0xd86e('0xa')](_0xd86e('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4fc512,_0x4531ac,_0x52515b){if(_0x4fc512['changed'](_0xd86e('0xc'))){_0x4fc512[_0xd86e('0xd')]=moment()[_0xd86e('0xe')](_0xd86e('0xf'));}_0x52515b(null,_0x4fc512);}},'charset':_0xd86e('0x10'),'collate':_0xd86e('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d18a0d3..8ea51e1 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 _0x61b1=['socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','then','catch','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0x61b1,0xe7));var _0x161b=function(_0x864393,_0x1b9d2b){_0x864393=_0x864393-0x0;var _0x275730=_0x61b1[_0x864393];return _0x275730;};'use strict';var _=require(_0x161b('0x0'));var util=require(_0x161b('0x1'));var moment=require(_0x161b('0x2'));var BPromise=require(_0x161b('0x3'));var rs=require(_0x161b('0x4'));var fs=require('fs');var Redis=require(_0x161b('0x5'));var db=require(_0x161b('0x6'))['db'];var utils=require(_0x161b('0x7'));var logger=require('../../config/logger')(_0x161b('0x8'));var config=require(_0x161b('0x9'));var jayson=require(_0x161b('0xa'));var client=jayson[_0x161b('0xb')][_0x161b('0xc')]({'port':0x232a});config[_0x161b('0xd')]=_['defaults'](config['redis'],{'host':_0x161b('0xe'),'port':0x18eb});var socket=require(_0x161b('0xf'))(new Redis(config[_0x161b('0xd')]));require(_0x161b('0x10'))[_0x161b('0x11')](socket);function respondWithRpcPromise(_0x284cfd,_0x5da380,_0xaeda42){return new BPromise(function(_0xcd2289,_0x28a128){return client[_0x161b('0x12')](_0x284cfd,_0xaeda42)['then'](function(_0x21de7f){logger[_0x161b('0x13')](_0x161b('0x14'),_0x5da380,_0x161b('0x15'));logger[_0x161b('0x16')](_0x161b('0x17'),_0x5da380,_0x161b('0x15'),JSON[_0x161b('0x18')](_0x21de7f));if(_0x21de7f[_0x161b('0x19')]){if(_0x21de7f[_0x161b('0x19')]['code']===0x1f4){logger[_0x161b('0x19')](_0x161b('0x14'),_0x5da380,_0x21de7f[_0x161b('0x19')]['message']);return _0x28a128(_0x21de7f[_0x161b('0x19')][_0x161b('0x1a')]);}logger[_0x161b('0x19')](_0x161b('0x14'),_0x5da380,_0x21de7f[_0x161b('0x19')][_0x161b('0x1a')]);return _0xcd2289(_0x21de7f['error'][_0x161b('0x1a')]);}else{logger[_0x161b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x5da380,'request\x20sent');_0xcd2289(_0x21de7f['result']['message']);}})['catch'](function(_0x43b1c0){logger[_0x161b('0x19')](_0x161b('0x14'),_0x5da380,_0x43b1c0);_0x28a128(_0x43b1c0);});});}exports[_0x161b('0x1b')]=function(_0x1324b1){var _0x35bd6b=this;return new Promise(function(_0x3d6bed,_0x3357fe){return db[_0x161b('0x1c')][_0x161b('0x1d')](_0x1324b1[_0x161b('0x1e')],{'raw':_0x1324b1[_0x161b('0x1f')]?_0x1324b1['options'][_0x161b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1324b1['options']?_0x1324b1['options']['where']||null:null,'attributes':_0x1324b1[_0x161b('0x1f')]?_0x1324b1[_0x161b('0x1f')][_0x161b('0x21')]||null:null,'limit':_0x1324b1[_0x161b('0x1f')]?_0x1324b1[_0x161b('0x1f')][_0x161b('0x22')]||null:null})[_0x161b('0x23')](function(_0x444af6){logger[_0x161b('0x13')](_0x161b('0x1b'),_0x1324b1);logger[_0x161b('0x16')](_0x161b('0x1b'),_0x1324b1,JSON[_0x161b('0x18')](_0x444af6));_0x3d6bed(_0x444af6);})[_0x161b('0x24')](function(_0x463451){logger[_0x161b('0x19')](_0x161b('0x1b'),_0x463451[_0x161b('0x1a')],_0x1324b1);_0x3357fe(_0x35bd6b[_0x161b('0x19')](0x1f4,_0x463451['message']));});});};exports['AddTagsToChatInteraction']=function(_0x524b3b){return new Promise(function(_0x7828d9,_0x56b91b){return db[_0x161b('0x1c')]['find']({'where':_0x524b3b[_0x161b('0x1f')]?_0x524b3b[_0x161b('0x1f')]['where']||null:null})[_0x161b('0x23')](function(_0x5e425a){if(_0x5e425a){return _0x5e425a['addTags'](_0x524b3b[_0x161b('0x1e')][_0x161b('0x25')],_[_0x161b('0x26')](_0x524b3b['body'],[_0x161b('0x25'),'id'])||{});}})[_0x161b('0x27')](function(_0x789376){logger[_0x161b('0x13')](_0x161b('0x28'),_0x524b3b);logger['debug'](_0x161b('0x28'),_0x524b3b,JSON['stringify'](_0x789376));_0x7828d9(_0x789376);})[_0x161b('0x24')](function(_0x3b8f04){logger[_0x161b('0x19')]('AddTags',_0x3b8f04[_0x161b('0x1a')],_0x524b3b);_0x56b91b(_this['error'](0x1f4,_0x3b8f04[_0x161b('0x1a')]));});});};
\ No newline at end of file
+var _0x04a1=['addTags','omit','ids','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','limit'];(function(_0x3b21f3,_0x1ff01a){var _0x346838=function(_0x365589){while(--_0x365589){_0x3b21f3['push'](_0x3b21f3['shift']());}};_0x346838(++_0x1ff01a);}(_0x04a1,0x74));var _0x104a=function(_0xcdf426,_0x4cf680){_0xcdf426=_0xcdf426-0x0;var _0x10c664=_0x04a1[_0xcdf426];return _0x10c664;};'use strict';var _=require('lodash');var util=require(_0x104a('0x0'));var moment=require(_0x104a('0x1'));var BPromise=require(_0x104a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x104a('0x3'))['db'];var utils=require(_0x104a('0x4'));var logger=require(_0x104a('0x5'))(_0x104a('0x6'));var config=require(_0x104a('0x7'));var jayson=require(_0x104a('0x8'));var client=jayson[_0x104a('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x104a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x104a('0xb'))(new Redis(config['redis']));require(_0x104a('0xc'))['register'](socket);function respondWithRpcPromise(_0xa514db,_0x3c3c51,_0x5defd7){return new BPromise(function(_0x4bad64,_0x99f409){return client[_0x104a('0xd')](_0xa514db,_0x5defd7)[_0x104a('0xe')](function(_0x180457){logger[_0x104a('0xf')](_0x104a('0x10'),_0x3c3c51,_0x104a('0x11'));logger[_0x104a('0x12')](_0x104a('0x13'),_0x3c3c51,_0x104a('0x11'),JSON[_0x104a('0x14')](_0x180457));if(_0x180457[_0x104a('0x15')]){if(_0x180457[_0x104a('0x15')][_0x104a('0x16')]===0x1f4){logger[_0x104a('0x15')](_0x104a('0x10'),_0x3c3c51,_0x180457[_0x104a('0x15')][_0x104a('0x17')]);return _0x99f409(_0x180457[_0x104a('0x15')]['message']);}logger['error'](_0x104a('0x10'),_0x3c3c51,_0x180457[_0x104a('0x15')][_0x104a('0x17')]);return _0x4bad64(_0x180457['error']['message']);}else{logger[_0x104a('0xf')](_0x104a('0x10'),_0x3c3c51,_0x104a('0x11'));_0x4bad64(_0x180457['result']['message']);}})[_0x104a('0x18')](function(_0x3a6d38){logger['error'](_0x104a('0x10'),_0x3c3c51,_0x3a6d38);_0x99f409(_0x3a6d38);});});}exports[_0x104a('0x19')]=function(_0x3607c0){var _0x3a4763=this;return new Promise(function(_0xe7d49f,_0x46bbc6){return db[_0x104a('0x1a')]['update'](_0x3607c0[_0x104a('0x1b')],{'raw':_0x3607c0['options']?_0x3607c0[_0x104a('0x1c')][_0x104a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3607c0[_0x104a('0x1c')]?_0x3607c0[_0x104a('0x1c')][_0x104a('0x1e')]||null:null,'attributes':_0x3607c0[_0x104a('0x1c')]?_0x3607c0['options']['attributes']||null:null,'limit':_0x3607c0[_0x104a('0x1c')]?_0x3607c0[_0x104a('0x1c')][_0x104a('0x1f')]||null:null})[_0x104a('0xe')](function(_0x454005){logger[_0x104a('0xf')]('UpdateChatInteraction',_0x3607c0);logger['debug'](_0x104a('0x19'),_0x3607c0,JSON[_0x104a('0x14')](_0x454005));_0xe7d49f(_0x454005);})[_0x104a('0x18')](function(_0xcfa596){logger[_0x104a('0x15')]('UpdateChatInteraction',_0xcfa596['message'],_0x3607c0);_0x46bbc6(_0x3a4763['error'](0x1f4,_0xcfa596[_0x104a('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x812cd){return new Promise(function(_0x44efef,_0x185a8d){return db['ChatInteraction']['find']({'where':_0x812cd[_0x104a('0x1c')]?_0x812cd[_0x104a('0x1c')][_0x104a('0x1e')]||null:null})[_0x104a('0xe')](function(_0x3cb6a4){if(_0x3cb6a4){return _0x3cb6a4[_0x104a('0x20')](_0x812cd[_0x104a('0x1b')]['ids'],_[_0x104a('0x21')](_0x812cd[_0x104a('0x1b')],[_0x104a('0x22'),'id'])||{});}})[_0x104a('0x23')](function(_0x1d3221){logger[_0x104a('0xf')](_0x104a('0x24'),_0x812cd);logger['debug'](_0x104a('0x24'),_0x812cd,JSON[_0x104a('0x14')](_0x1d3221));_0x44efef(_0x1d3221);})[_0x104a('0x18')](function(_0x1bd8ea){logger[_0x104a('0x15')](_0x104a('0x24'),_0x1bd8ea[_0x104a('0x17')],_0x812cd);_0x185a8d(_this[_0x104a('0x15')](0x1f4,_0x1bd8ea[_0x104a('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d8889c2..b5ff9c1 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 _0x2873=['./chatInteraction.events','save','emit','removeListener','register','length'];(function(_0x27971d,_0x430067){var _0x27494f=function(_0x113fad){while(--_0x113fad){_0x27971d['push'](_0x27971d['shift']());}};_0x27494f(++_0x430067);}(_0x2873,0x168));var _0x3287=function(_0x112a14,_0x5e2cc3){_0x112a14=_0x112a14-0x0;var _0x59a6d1=_0x2873[_0x112a14];return _0x59a6d1;};'use strict';var ChatInteractionEvents=require(_0x3287('0x0'));var events=[_0x3287('0x1'),'remove','update'];function createListener(_0x543915,_0x212577){return function(_0x1774a2){_0x212577[_0x3287('0x2')](_0x543915,_0x1774a2);};}function removeListener(_0x5c311e,_0x2222c3){return function(){ChatInteractionEvents[_0x3287('0x3')](_0x5c311e,_0x2222c3);};}exports[_0x3287('0x4')]=function(_0x21530e){for(var _0x29ffd0=0x0,_0x36b258=events[_0x3287('0x5')];_0x29ffd0<_0x36b258;_0x29ffd0++){var _0x1be785=events[_0x29ffd0];var _0x46789f=createListener('chatInteraction:'+_0x1be785,_0x21530e);ChatInteractionEvents['on'](_0x1be785,_0x46789f);}};
\ No newline at end of file
+var _0xa0f4=['register','chatInteraction:','./chatInteraction.events','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0f4,0x11f));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x4a0f('0x0'));var events=['save',_0x4a0f('0x1'),'update'];function createListener(_0x4262e5,_0x2c6011){return function(_0x76f340){_0x2c6011[_0x4a0f('0x2')](_0x4262e5,_0x76f340);};}function removeListener(_0x556081,_0x46c1fe){return function(){ChatInteractionEvents['removeListener'](_0x556081,_0x46c1fe);};}exports[_0x4a0f('0x3')]=function(_0x2cb4da){for(var _0x492aae=0x0,_0x44dbb8=events['length'];_0x492aae<_0x44dbb8;_0x492aae++){var _0x486c51=events[_0x492aae];var _0x5e892a=createListener(_0x4a0f('0x4')+_0x486c51,_0x2cb4da);ChatInteractionEvents['on'](_0x486c51,_0x5e892a);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3192155..11659ef 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 _0x4e47=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','isAuthenticated','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','update','abandon','delete'];(function(_0x20cc6d,_0x4e50ac){var _0x4d3e4f=function(_0x355e52){while(--_0x355e52){_0x20cc6d['push'](_0x20cc6d['shift']());}};_0x4d3e4f(++_0x4e50ac);}(_0x4e47,0x18a));var _0x74e4=function(_0x2eaf70,_0x2ed086){_0x2eaf70=_0x2eaf70-0x0;var _0x36fdad=_0x4e47[_0x2eaf70];return _0x36fdad;};'use strict';var multer=require(_0x74e4('0x0'));var util=require(_0x74e4('0x1'));var path=require('path');var timeout=require(_0x74e4('0x2'));var express=require(_0x74e4('0x3'));var router=express[_0x74e4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x74e4('0x5'));var config=require(_0x74e4('0x6'));var controller=require(_0x74e4('0x7'));router[_0x74e4('0x8')]('/',auth['isAuthenticated'](),controller[_0x74e4('0x9')]);router[_0x74e4('0x8')](_0x74e4('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x74e4('0x8')](_0x74e4('0xb'),auth[_0x74e4('0xc')](),controller[_0x74e4('0xd')]);router[_0x74e4('0x8')](_0x74e4('0xe'),auth[_0x74e4('0xc')](),controller[_0x74e4('0xf')]);router[_0x74e4('0x8')](_0x74e4('0x10'),auth['isAuthenticated'](),controller[_0x74e4('0x11')]);router[_0x74e4('0x8')](_0x74e4('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x74e4('0x13')]);router[_0x74e4('0x8')](_0x74e4('0x14'),auth[_0x74e4('0x15')](),controller[_0x74e4('0x16')]);router[_0x74e4('0x17')]('/',auth[_0x74e4('0x15')](),controller[_0x74e4('0x18')]);router['post'](_0x74e4('0x19'),auth[_0x74e4('0x15')](),controller[_0x74e4('0x1a')]);var upload=multer({'storage':multer[_0x74e4('0x1b')]({'destination':function(_0x17d004,_0x23fe24,_0x220d3d){_0x220d3d(null,path[_0x74e4('0x1c')](config['root'],_0x74e4('0x1d')));},'filename':function(_0x15b186,_0x498515,_0x14945f){_0x14945f(null,util['format'](_0x74e4('0x1e'),Date[_0x74e4('0x1f')](),_0x498515['originalname'][_0x74e4('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x74e4('0x17')](_0x74e4('0x21'),upload[_0x74e4('0x22')](_0x74e4('0x23')),controller[_0x74e4('0x24')]);router[_0x74e4('0x17')](_0x74e4('0x10'),auth[_0x74e4('0xc')](),controller[_0x74e4('0x25')]);router[_0x74e4('0x17')](_0x74e4('0x26'),auth[_0x74e4('0x15')](),interaction['tracked'](_0x74e4('0x27'),_0x74e4('0x28')),controller[_0x74e4('0x29')]);router[_0x74e4('0x2a')]('/:id',auth[_0x74e4('0x15')](),interaction[_0x74e4('0x2b')](_0x74e4('0x27'),'chatinteraction:update'),controller[_0x74e4('0x2c')]);router['put']('/:id/custom_update',controller['customUpdate']);router[_0x74e4('0x2a')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x74e4('0x2d')]);router[_0x74e4('0x2a')]('/:id/close',controller['close']);router[_0x74e4('0x2e')](_0x74e4('0xb'),auth['isAuthenticated'](),interaction[_0x74e4('0x2b')](_0x74e4('0x27'),'chatinteraction:destroy'),controller[_0x74e4('0x2f')]);router[_0x74e4('0x2e')](_0x74e4('0x26'),auth[_0x74e4('0x15')](),controller['removeTags']);module[_0x74e4('0x30')]=router;
\ No newline at end of file
+var _0xc870=['getMyMessages','/:id/download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xc870,0x118));var _0x0c87=function(_0x239525,_0x533860){_0x239525=_0x239525-0x0;var _0xe1a43a=_0xc870[_0x239525];return _0xe1a43a;};'use strict';var multer=require(_0x0c87('0x0'));var util=require(_0x0c87('0x1'));var path=require(_0x0c87('0x2'));var timeout=require(_0x0c87('0x3'));var express=require(_0x0c87('0x4'));var router=express[_0x0c87('0x5')]();var fs_extra=require(_0x0c87('0x6'));var auth=require(_0x0c87('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c87('0x8'));router[_0x0c87('0x9')]('/',auth['isAuthenticated'](),controller[_0x0c87('0xa')]);router['get'](_0x0c87('0xb'),auth[_0x0c87('0xc')](),controller[_0x0c87('0xd')]);router[_0x0c87('0x9')](_0x0c87('0xe'),auth[_0x0c87('0xf')](),controller[_0x0c87('0x10')]);router['get'](_0x0c87('0x11'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x0c87('0x9')]('/:id/messages',auth[_0x0c87('0xc')](),controller[_0x0c87('0x12')]);router[_0x0c87('0x9')](_0x0c87('0x13'),auth[_0x0c87('0xf')](),controller[_0x0c87('0x14')]);router[_0x0c87('0x9')](_0x0c87('0x15'),auth[_0x0c87('0xc')](),controller['download']);router[_0x0c87('0x16')]('/',auth[_0x0c87('0xc')](),controller[_0x0c87('0x17')]);router[_0x0c87('0x16')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x0c87('0x18')]);var upload=multer({'storage':multer[_0x0c87('0x19')]({'destination':function(_0x4246e5,_0x3f8e38,_0x1882fd){_0x1882fd(null,path['join'](config[_0x0c87('0x1a')],_0x0c87('0x1b')));},'filename':function(_0x3a921e,_0xde4d74,_0x11137b){_0x11137b(null,util['format'](_0x0c87('0x1c'),Date[_0x0c87('0x1d')](),_0xde4d74['originalname'][_0x0c87('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x0c87('0x1f'),upload[_0x0c87('0x20')](_0x0c87('0x21')),controller[_0x0c87('0x22')]);router[_0x0c87('0x16')](_0x0c87('0x23'),auth['isChatInteractionAuthorized'](),controller[_0x0c87('0x24')]);router[_0x0c87('0x16')]('/:id/tags',auth[_0x0c87('0xc')](),interaction[_0x0c87('0x25')](_0x0c87('0x26'),'chatinteraction:addtags'),controller[_0x0c87('0x27')]);router['put']('/:id',auth[_0x0c87('0xc')](),interaction[_0x0c87('0x25')](_0x0c87('0x26'),'chatinteraction:update'),controller['update']);router[_0x0c87('0x28')](_0x0c87('0x29'),controller[_0x0c87('0x2a')]);router[_0x0c87('0x28')](_0x0c87('0x2b'),auth[_0x0c87('0xf')](),controller[_0x0c87('0x2c')]);router[_0x0c87('0x28')]('/:id/close',controller[_0x0c87('0x2d')]);router['delete'](_0x0c87('0xe'),auth['isAuthenticated'](),interaction[_0x0c87('0x25')](_0x0c87('0x26'),'chatinteraction:destroy'),controller[_0x0c87('0x2e')]);router[_0x0c87('0x2f')]('/:id/tags',auth[_0x0c87('0xc')](),controller[_0x0c87('0x30')]);module[_0x0c87('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d192825..2a099d1 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 _0x4f8f=['BOOLEAN','INTEGER','sequelize','exports','medium'];(function(_0xd7538c,_0x4ae6b8){var _0xab1b7=function(_0x1a1073){while(--_0x1a1073){_0xd7538c['push'](_0xd7538c['shift']());}};_0xab1b7(++_0x4ae6b8);}(_0x4f8f,0x115));var _0xf4f8=function(_0x31e814,_0xaadd33){_0x31e814=_0x31e814-0x0;var _0x344a0f=_0x4f8f[_0x31e814];return _0x344a0f;};'use strict';var Sequelize=require(_0xf4f8('0x0'));module[_0xf4f8('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf4f8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf4f8('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf4f8('0x4')]}};
\ No newline at end of file
+var _0xbd28=['BOOLEAN','exports','TEXT'];(function(_0x59a983,_0x1d74e3){var _0x496598=function(_0x4f7637){while(--_0x4f7637){_0x59a983['push'](_0x59a983['shift']());}};_0x496598(++_0x1d74e3);}(_0xbd28,0xbe));var _0x8bd2=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0xbd28[_0x541a67];return _0x45da2a;};'use strict';var Sequelize=require('sequelize');module[_0x8bd2('0x0')]={'body':{'type':Sequelize[_0x8bd2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8bd2('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 1bac159..f86a34d 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 _0x316a=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','create','body','update','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','role','userpic','online','allowmessenger','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','sort','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type'];(function(_0x5bc15d,_0x5ba0dc){var _0x35bd41=function(_0x23941b){while(--_0x23941b){_0x5bc15d['push'](_0x5bc15d['shift']());}};_0x35bd41(++_0x5ba0dc);}(_0x316a,0x180));var _0xa316=function(_0x47c6a2,_0x277274){_0x47c6a2=_0x47c6a2-0x0;var _0x2bc3ef=_0x316a[_0x47c6a2];return _0x2bc3ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa316('0x0'));var zipdir=require(_0xa316('0x1'));var jsonpatch=require(_0xa316('0x2'));var rp=require(_0xa316('0x3'));var moment=require(_0xa316('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa316('0x5'));var path=require(_0xa316('0x6'));var sox=require(_0xa316('0x7'));var csv=require(_0xa316('0x8'));var ejs=require(_0xa316('0x9'));var fs=require('fs');var fs_extra=require(_0xa316('0xa'));var _=require(_0xa316('0xb'));var squel=require(_0xa316('0xc'));var crypto=require(_0xa316('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa316('0xe'));var toCsv=require(_0xa316('0x8'));var querystring=require('querystring');var Papa=require(_0xa316('0xf'));var Redis=require('ioredis');var authService=require(_0xa316('0x10'));var qs=require(_0xa316('0x11'));var as=require(_0xa316('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa316('0x13'))(_0xa316('0x14'));var utils=require(_0xa316('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa316('0x16'));var db=require(_0xa316('0x17'))['db'];config[_0xa316('0x18')]=_['defaults'](config[_0xa316('0x18')],{'host':_0xa316('0x19'),'port':0x18eb});var socket=require(_0xa316('0x1a'))(new Redis(config['redis']));require(_0xa316('0x1b'))['register'](socket);function respondWithStatusCode(_0x503595,_0x3b0edb){_0x3b0edb=_0x3b0edb||0xcc;return function(_0x16ffaa){if(_0x16ffaa){return _0x503595[_0xa316('0x1c')](_0x3b0edb);}return _0x503595[_0xa316('0x1d')](_0x3b0edb)[_0xa316('0x1e')]();};}function respondWithResult(_0x2e108f,_0x18c5e7){_0x18c5e7=_0x18c5e7||0xc8;return function(_0x1229b9){if(_0x1229b9){return _0x2e108f[_0xa316('0x1d')](_0x18c5e7)[_0xa316('0x1f')](_0x1229b9);}};}function respondWithFilteredResult(_0x328769,_0x3dde44){return function(_0x9e3289){if(_0x9e3289){var _0x5a7122=typeof _0x3dde44[_0xa316('0x20')]===_0xa316('0x21')&&typeof _0x3dde44[_0xa316('0x22')]===_0xa316('0x21');var _0x54908c=_0x9e3289['count'];var _0x4a2a37=_0x5a7122?0x0:_0x3dde44['offset'];var _0x32da43=_0x5a7122?_0x9e3289[_0xa316('0x23')]:_0x3dde44['offset']+_0x3dde44[_0xa316('0x22')];var _0x576868;if(_0x32da43>=_0x54908c){_0x32da43=_0x54908c;_0x576868=0xc8;}else{_0x576868=0xce;}_0x328769[_0xa316('0x1d')](_0x576868);return _0x328769[_0xa316('0x24')](_0xa316('0x25'),_0x4a2a37+'-'+_0x32da43+'/'+_0x54908c)[_0xa316('0x1f')](_0x9e3289);}return null;};}function patchUpdates(_0x2f5c4c){return function(_0x54e709){try{jsonpatch[_0xa316('0x26')](_0x54e709,_0x2f5c4c,!![]);}catch(_0x1cb262){return BPromise[_0xa316('0x27')](_0x1cb262);}return _0x54e709[_0xa316('0x28')]();};}function saveUpdates(_0x298132,_0x4a4b42){return function(_0x40426e){if(_0x40426e){return _0x40426e['update'](_0x298132)[_0xa316('0x29')](function(_0x4a8026){return _0x4a8026;});}return null;};}function removeEntity(_0x762b18,_0x21afcb){return function(_0x2a5385){if(_0x2a5385){return _0x2a5385[_0xa316('0x2a')]()[_0xa316('0x29')](function(){_0x762b18['status'](0xcc)[_0xa316('0x1e')]();});}};}function handleEntityNotFound(_0x1dfd68,_0xd50b87){return function(_0x5be9d0){if(!_0x5be9d0){_0x1dfd68[_0xa316('0x1c')](0x194);}return _0x5be9d0;};}function handleError(_0x45e314,_0x4aaaae){_0x4aaaae=_0x4aaaae||0x1f4;return function(_0x282647){logger[_0xa316('0x2b')](_0x282647[_0xa316('0x2c')]);if(_0x282647[_0xa316('0x2d')]){delete _0x282647[_0xa316('0x2d')];}_0x45e314[_0xa316('0x1d')](_0x4aaaae)[_0xa316('0x2e')](_0x282647);};}exports['index']=function(_0x1b2eb6,_0x35e80d){var _0x1e1d98={},_0x16decd={},_0x26505f={'count':0x0,'rows':[]};var _0x134411=_[_0xa316('0x2f')](db[_0xa316('0x30')][_0xa316('0x31')],function(_0x580a69){return{'name':_0x580a69[_0xa316('0x32')],'type':_0x580a69[_0xa316('0x33')][_0xa316('0x34')]};});_0x16decd[_0xa316('0x35')]=_['map'](_0x134411,_0xa316('0x2d'));_0x16decd[_0xa316('0x36')]=_['keys'](_0x1b2eb6[_0xa316('0x36')]);_0x16decd[_0xa316('0x37')]=_[_0xa316('0x38')](_0x16decd[_0xa316('0x35')],_0x16decd[_0xa316('0x36')]);_0x1e1d98[_0xa316('0x39')]=_[_0xa316('0x38')](_0x16decd[_0xa316('0x35')],qs['fields'](_0x1b2eb6[_0xa316('0x36')][_0xa316('0x3a')]));_0x1e1d98['attributes']=_0x1e1d98[_0xa316('0x39')][_0xa316('0x3b')]?_0x1e1d98['attributes']:_0x16decd[_0xa316('0x35')];if(!_0x1b2eb6['query'][_0xa316('0x3c')](_0xa316('0x3d'))){_0x1e1d98['limit']=qs[_0xa316('0x22')](_0x1b2eb6[_0xa316('0x36')][_0xa316('0x22')]);_0x1e1d98[_0xa316('0x20')]=qs[_0xa316('0x20')](_0x1b2eb6[_0xa316('0x36')]['offset']);}_0x1e1d98['order']=qs['sort'](_0x1b2eb6[_0xa316('0x36')]['sort']);_0x1e1d98[_0xa316('0x3e')]=qs[_0xa316('0x37')](_[_0xa316('0x3f')](_0x1b2eb6[_0xa316('0x36')],_0x16decd['filters']),_0x134411);if(_0x1b2eb6['query'][_0xa316('0x40')]){_0x1e1d98[_0xa316('0x3e')]=_[_0xa316('0x41')](_0x1e1d98[_0xa316('0x3e')],{'$or':_[_0xa316('0x2f')](_0x134411,function(_0x5cf61b){if(_0x5cf61b[_0xa316('0x33')]!==_0xa316('0x42')){var _0x40d655={};_0x40d655[_0x5cf61b[_0xa316('0x2d')]]={'$like':'%'+_0x1b2eb6[_0xa316('0x36')][_0xa316('0x40')]+'%'};return _0x40d655;}})});}_0x1e1d98=_[_0xa316('0x41')]({},_0x1e1d98,_0x1b2eb6['options']);var _0x44edb4={'where':_0x1e1d98['where']};return db[_0xa316('0x30')]['count'](_0x44edb4)[_0xa316('0x29')](function(_0x64172){_0x26505f[_0xa316('0x23')]=_0x64172;if(_0x1b2eb6['query'][_0xa316('0x43')]){_0x1e1d98[_0xa316('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xa316('0x45')](_0x1e1d98);})[_0xa316('0x29')](function(_0x1d46b4){_0x26505f[_0xa316('0x46')]=_0x1d46b4;return _0x26505f;})[_0xa316('0x29')](respondWithFilteredResult(_0x35e80d,_0x1e1d98))['catch'](handleError(_0x35e80d,null));};exports['show']=function(_0x5c0650,_0xa3e434){var _0x1a3898={'raw':!![],'where':{'id':_0x5c0650[_0xa316('0x47')]['id']}},_0x3ae92e={};_0x3ae92e[_0xa316('0x35')]=_[_0xa316('0x48')](db[_0xa316('0x30')][_0xa316('0x31')]);_0x3ae92e[_0xa316('0x36')]=_[_0xa316('0x48')](_0x5c0650['query']);_0x3ae92e[_0xa316('0x37')]=_[_0xa316('0x38')](_0x3ae92e[_0xa316('0x35')],_0x3ae92e[_0xa316('0x36')]);_0x1a3898['attributes']=_[_0xa316('0x38')](_0x3ae92e['model'],qs['fields'](_0x5c0650[_0xa316('0x36')][_0xa316('0x3a')]));_0x1a3898[_0xa316('0x39')]=_0x1a3898['attributes'][_0xa316('0x3b')]?_0x1a3898[_0xa316('0x39')]:_0x3ae92e[_0xa316('0x35')];if(_0x5c0650[_0xa316('0x36')][_0xa316('0x43')]){_0x1a3898[_0xa316('0x44')]=[{'all':!![]}];}_0x1a3898=_['merge']({},_0x1a3898,_0x5c0650[_0xa316('0x49')]);return db[_0xa316('0x30')][_0xa316('0x4a')](_0x1a3898)[_0xa316('0x29')](handleEntityNotFound(_0xa3e434,null))['then'](respondWithResult(_0xa3e434,null))['catch'](handleError(_0xa3e434,null));};exports[_0xa316('0x4b')]=function(_0x1514d0,_0x48e785){return db['ChatInternalMessage'][_0xa316('0x4b')](_0x1514d0[_0xa316('0x4c')],{})[_0xa316('0x29')](respondWithResult(_0x48e785,0xc9))['catch'](handleError(_0x48e785,null));};exports[_0xa316('0x4d')]=function(_0x267c0d,_0x728d64){if(_0x267c0d['body']['id']){delete _0x267c0d[_0xa316('0x4c')]['id'];}return db[_0xa316('0x30')]['find']({'where':{'id':_0x267c0d[_0xa316('0x47')]['id']}})[_0xa316('0x29')](handleEntityNotFound(_0x728d64,null))[_0xa316('0x29')](saveUpdates(_0x267c0d[_0xa316('0x4c')],null))[_0xa316('0x29')](respondWithResult(_0x728d64,null))[_0xa316('0x4e')](handleError(_0x728d64,null));};exports[_0xa316('0x2a')]=function(_0x5bbd5d,_0x5c290f){return db[_0xa316('0x30')][_0xa316('0x4a')]({'where':{'id':_0x5bbd5d[_0xa316('0x47')]['id']}})[_0xa316('0x29')](handleEntityNotFound(_0x5c290f,null))[_0xa316('0x29')](removeEntity(_0x5c290f,null))[_0xa316('0x4e')](handleError(_0x5c290f,null));};exports[_0xa316('0x4f')]=function(_0x2b3778,_0x130a69){return db['ChatInternalMessage'][_0xa316('0x4f')]()[_0xa316('0x29')](respondWithResult(_0x130a69,null))['catch'](handleError(_0x130a69,null));};function wrapUser(_0x40d4ce){return function(_0x5a827a){var _0x354157=_0x40d4ce[_0xa316('0x50')]({'plain':!![]});_0x354157[_0xa316('0x51')]=[];if(_0x5a827a){_0x354157[_0xa316('0x52')]=_0x5a827a[_0xa316('0x53')];_0x354157[_0xa316('0x54')]=_0x5a827a;}else{_0x354157[_0xa316('0x52')]=moment(0x0)[_0xa316('0x55')](_0xa316('0x56'));_0x354157[_0xa316('0x54')]={};}return _0x354157;};}exports[_0xa316('0x57')]=function(_0x1cbc05,_0x1f9e26,_0x2fc990){var _0x53bcbc=[];return db[_0xa316('0x58')]['findAll']({'where':{'role':['agent',_0xa316('0x59'),_0xa316('0x5a')]},'attributes':['id','fullname','name',_0xa316('0x5b'),_0xa316('0x5c'),'internal',_0xa316('0x5d'),'lastLoginAt',_0xa316('0x5e'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0xa316('0x5f')],'as':'VoiceQueues','attributes':['id',_0xa316('0x2d'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x2ebe1e){if(_0x2ebe1e){var _0x3b97fe=_0x1cbc05[_0xa316('0x5a')][_0xa316('0x50')]({'plain':!![]});if(!_0x3b97fe)throw new Error(_0xa316('0x60'));if(_0x3b97fe['role']===_0xa316('0x5a')){return db['UserProfileSection'][_0xa316('0x4a')]({'where':{'name':_0xa316('0x61'),'userProfileId':_0x3b97fe['userProfileId']},'raw':!![]})[_0xa316('0x29')](function(_0x16016b){if(_0x16016b){if(_0x16016b[_0xa316('0x62')]===0x0){return db[_0xa316('0x63')][_0xa316('0x45')]({'where':{'sectionId':_0x16016b['id']},'raw':!![]})[_0xa316('0x29')](function(_0x204806){var _0x1668a2=[];if(_[_0xa316('0x64')](_0x204806)){_0x1668a2=_[_0xa316('0x40')](_0x2ebe1e,function(_0x50e0df){if(_0x50e0df['role']!==_0xa316('0x65')){return _0x50e0df;}});return _0x1668a2;}else{for(var _0x35ea69=0x0;_0x35ea69<_0x2ebe1e[_0xa316('0x3b')];_0x35ea69++){var _0x259bbd=_0x2ebe1e[_0x35ea69];if(_0x259bbd['role']===_0xa316('0x65')){var _0x13ef0b=_[_0xa316('0x4a')](_0x204806,function(_0x165ead){return _0x165ead[_0xa316('0x66')]===_0x259bbd['id'];});if(_0x13ef0b)_0x1668a2[_0xa316('0x67')](_0x259bbd);}else{_0x1668a2[_0xa316('0x67')](_0x259bbd);}}return _0x1668a2;}});}else{return _0x2ebe1e;}}else{var _0x497f20=_[_0xa316('0x40')](_0x2ebe1e,function(_0x2e6478){if(_0x2e6478[_0xa316('0x5b')]!==_0xa316('0x65')){return _0x2e6478;}});return _0x497f20;}});}else{return _0x2ebe1e;}}})[_0xa316('0x29')](function(_0x359dd8){var _0x1ed751=[];if(_0x359dd8){_0x53bcbc=_0x359dd8;for(var _0x43d96b=0x0;_0x43d96b<_0x359dd8[_0xa316('0x3b')];_0x43d96b+=0x1){_0x53bcbc[_0x43d96b]['messages']=[];_0x1ed751[_0xa316('0x67')](db[_0xa316('0x30')][_0xa316('0x4a')]({'where':{'FromId':[_0x1cbc05[_0xa316('0x5a')]['id'],_0x359dd8[_0x43d96b]['id']],'ToId':[_0x1cbc05[_0xa316('0x5a')]['id'],_0x359dd8[_0x43d96b]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa316('0x68'),_0xa316('0x69'),_0xa316('0x6a'),_0xa316('0x4c')],'order':qs[_0xa316('0x6b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa316('0x29')](wrapUser(_0x359dd8[_0x43d96b])));}return BPromise[_0xa316('0x6c')](_0x1ed751);}return[];})[_0xa316('0x29')](function(_0x3bec56){return{'rows':_0x3bec56,'count':_0x3bec56[_0xa316('0x3b')]};})[_0xa316('0x29')](respondWithResult(_0x1f9e26,null))[_0xa316('0x4e')](handleError(_0x1f9e26,null));};
\ No newline at end of file
+var _0x8ad0=['rows','catch','rawAttributes','length','options','find','create','body','params','describe','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','fullname','userpic','online','showWebBar','-online','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId','ToId','read','-createdAt','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','ChatInternalMessage','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','filter','includeAll','include','findAll'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8ad0,0x91));var _0x08ad=function(_0x593640,_0x5217e1){_0x593640=_0x593640-0x0;var _0x5a856b=_0x8ad0[_0x593640];return _0x5a856b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x08ad('0x0'));var jsonpatch=require(_0x08ad('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x08ad('0x2'));var Mustache=require(_0x08ad('0x3'));var util=require(_0x08ad('0x4'));var path=require(_0x08ad('0x5'));var sox=require(_0x08ad('0x6'));var csv=require('to-csv');var ejs=require(_0x08ad('0x7'));var fs=require('fs');var fs_extra=require(_0x08ad('0x8'));var _=require(_0x08ad('0x9'));var squel=require('squel');var crypto=require(_0x08ad('0xa'));var jsforce=require(_0x08ad('0xb'));var deskjs=require(_0x08ad('0xc'));var toCsv=require('to-csv');var querystring=require(_0x08ad('0xd'));var Papa=require(_0x08ad('0xe'));var Redis=require(_0x08ad('0xf'));var authService=require(_0x08ad('0x10'));var qs=require(_0x08ad('0x11'));var as=require(_0x08ad('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08ad('0x13'));var utils=require(_0x08ad('0x14'));var config=require(_0x08ad('0x15'));var licenseUtil=require(_0x08ad('0x16'));var db=require(_0x08ad('0x17'))['db'];config['redis']=_[_0x08ad('0x18')](config[_0x08ad('0x19')],{'host':_0x08ad('0x1a'),'port':0x18eb});var socket=require(_0x08ad('0x1b'))(new Redis(config[_0x08ad('0x19')]));require(_0x08ad('0x1c'))[_0x08ad('0x1d')](socket);function respondWithStatusCode(_0x3b20b8,_0xf6f5b2){_0xf6f5b2=_0xf6f5b2||0xcc;return function(_0x40ab8c){if(_0x40ab8c){return _0x3b20b8[_0x08ad('0x1e')](_0xf6f5b2);}return _0x3b20b8[_0x08ad('0x1f')](_0xf6f5b2)[_0x08ad('0x20')]();};}function respondWithResult(_0x412f6b,_0xcbc425){_0xcbc425=_0xcbc425||0xc8;return function(_0x521251){if(_0x521251){return _0x412f6b[_0x08ad('0x1f')](_0xcbc425)[_0x08ad('0x21')](_0x521251);}};}function respondWithFilteredResult(_0x355082,_0x205a30){return function(_0x52025b){if(_0x52025b){var _0x40dd4b=typeof _0x205a30[_0x08ad('0x22')]===_0x08ad('0x23')&&typeof _0x205a30['limit']==='undefined';var _0x4f5692=_0x52025b[_0x08ad('0x24')];var _0x1778c4=_0x40dd4b?0x0:_0x205a30[_0x08ad('0x22')];var _0x256cdc=_0x40dd4b?_0x52025b[_0x08ad('0x24')]:_0x205a30['offset']+_0x205a30[_0x08ad('0x25')];var _0x386f89;if(_0x256cdc>=_0x4f5692){_0x256cdc=_0x4f5692;_0x386f89=0xc8;}else{_0x386f89=0xce;}_0x355082[_0x08ad('0x1f')](_0x386f89);return _0x355082[_0x08ad('0x26')](_0x08ad('0x27'),_0x1778c4+'-'+_0x256cdc+'/'+_0x4f5692)[_0x08ad('0x21')](_0x52025b);}return null;};}function patchUpdates(_0xf734){return function(_0x506ff9){try{jsonpatch[_0x08ad('0x28')](_0x506ff9,_0xf734,!![]);}catch(_0x5e0ff1){return BPromise['reject'](_0x5e0ff1);}return _0x506ff9['save']();};}function saveUpdates(_0x3579dd,_0x5dcf26){return function(_0x153feb){if(_0x153feb){return _0x153feb[_0x08ad('0x29')](_0x3579dd)[_0x08ad('0x2a')](function(_0xc6e5eb){return _0xc6e5eb;});}return null;};}function removeEntity(_0x1f26b7,_0x5f049d){return function(_0x44719b){if(_0x44719b){return _0x44719b[_0x08ad('0x2b')]()['then'](function(){_0x1f26b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cad8e,_0x422d69){return function(_0x43631f){if(!_0x43631f){_0x5cad8e[_0x08ad('0x1e')](0x194);}return _0x43631f;};}function handleError(_0x42eef5,_0x454678){_0x454678=_0x454678||0x1f4;return function(_0x4a4cd0){logger[_0x08ad('0x2c')](_0x4a4cd0['stack']);if(_0x4a4cd0[_0x08ad('0x2d')]){delete _0x4a4cd0[_0x08ad('0x2d')];}_0x42eef5['status'](_0x454678)[_0x08ad('0x2e')](_0x4a4cd0);};}exports[_0x08ad('0x2f')]=function(_0x20c9d9,_0x4dd0c8){var _0x3591e7={},_0x5f424a={},_0x20fc78={'count':0x0,'rows':[]};var _0x3dc2e7=_[_0x08ad('0x30')](db[_0x08ad('0x31')]['rawAttributes'],function(_0x1aa6e9){return{'name':_0x1aa6e9['fieldName'],'type':_0x1aa6e9[_0x08ad('0x32')][_0x08ad('0x33')]};});_0x5f424a[_0x08ad('0x34')]=_[_0x08ad('0x30')](_0x3dc2e7,_0x08ad('0x2d'));_0x5f424a['query']=_[_0x08ad('0x35')](_0x20c9d9[_0x08ad('0x36')]);_0x5f424a[_0x08ad('0x37')]=_[_0x08ad('0x38')](_0x5f424a[_0x08ad('0x34')],_0x5f424a['query']);_0x3591e7[_0x08ad('0x39')]=_[_0x08ad('0x38')](_0x5f424a[_0x08ad('0x34')],qs[_0x08ad('0x3a')](_0x20c9d9['query']['fields']));_0x3591e7[_0x08ad('0x39')]=_0x3591e7['attributes']['length']?_0x3591e7[_0x08ad('0x39')]:_0x5f424a['model'];if(!_0x20c9d9[_0x08ad('0x36')]['hasOwnProperty'](_0x08ad('0x3b'))){_0x3591e7[_0x08ad('0x25')]=qs[_0x08ad('0x25')](_0x20c9d9['query'][_0x08ad('0x25')]);_0x3591e7[_0x08ad('0x22')]=qs[_0x08ad('0x22')](_0x20c9d9[_0x08ad('0x36')][_0x08ad('0x22')]);}_0x3591e7[_0x08ad('0x3c')]=qs[_0x08ad('0x3d')](_0x20c9d9[_0x08ad('0x36')][_0x08ad('0x3d')]);_0x3591e7['where']=qs[_0x08ad('0x37')](_[_0x08ad('0x3e')](_0x20c9d9[_0x08ad('0x36')],_0x5f424a['filters']),_0x3dc2e7);if(_0x20c9d9[_0x08ad('0x36')]['filter']){_0x3591e7[_0x08ad('0x3f')]=_[_0x08ad('0x40')](_0x3591e7[_0x08ad('0x3f')],{'$or':_[_0x08ad('0x30')](_0x3dc2e7,function(_0x423622){if(_0x423622[_0x08ad('0x32')]!=='VIRTUAL'){var _0x4566ea={};_0x4566ea[_0x423622[_0x08ad('0x2d')]]={'$like':'%'+_0x20c9d9[_0x08ad('0x36')][_0x08ad('0x41')]+'%'};return _0x4566ea;}})});}_0x3591e7=_[_0x08ad('0x40')]({},_0x3591e7,_0x20c9d9['options']);var _0x5293eb={'where':_0x3591e7[_0x08ad('0x3f')]};return db[_0x08ad('0x31')][_0x08ad('0x24')](_0x5293eb)[_0x08ad('0x2a')](function(_0x3128de){_0x20fc78[_0x08ad('0x24')]=_0x3128de;if(_0x20c9d9[_0x08ad('0x36')][_0x08ad('0x42')]){_0x3591e7[_0x08ad('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x08ad('0x44')](_0x3591e7);})[_0x08ad('0x2a')](function(_0x599009){_0x20fc78[_0x08ad('0x45')]=_0x599009;return _0x20fc78;})[_0x08ad('0x2a')](respondWithFilteredResult(_0x4dd0c8,_0x3591e7))[_0x08ad('0x46')](handleError(_0x4dd0c8,null));};exports['show']=function(_0x5182fc,_0x210bbe){var _0x5032de={'raw':!![],'where':{'id':_0x5182fc['params']['id']}},_0x4b2e96={};_0x4b2e96[_0x08ad('0x34')]=_[_0x08ad('0x35')](db[_0x08ad('0x31')][_0x08ad('0x47')]);_0x4b2e96[_0x08ad('0x36')]=_[_0x08ad('0x35')](_0x5182fc[_0x08ad('0x36')]);_0x4b2e96['filters']=_[_0x08ad('0x38')](_0x4b2e96[_0x08ad('0x34')],_0x4b2e96['query']);_0x5032de['attributes']=_['intersection'](_0x4b2e96[_0x08ad('0x34')],qs[_0x08ad('0x3a')](_0x5182fc[_0x08ad('0x36')]['fields']));_0x5032de['attributes']=_0x5032de[_0x08ad('0x39')][_0x08ad('0x48')]?_0x5032de[_0x08ad('0x39')]:_0x4b2e96[_0x08ad('0x34')];if(_0x5182fc[_0x08ad('0x36')]['includeAll']){_0x5032de[_0x08ad('0x43')]=[{'all':!![]}];}_0x5032de=_[_0x08ad('0x40')]({},_0x5032de,_0x5182fc[_0x08ad('0x49')]);return db['ChatInternalMessage'][_0x08ad('0x4a')](_0x5032de)[_0x08ad('0x2a')](handleEntityNotFound(_0x210bbe,null))[_0x08ad('0x2a')](respondWithResult(_0x210bbe,null))[_0x08ad('0x46')](handleError(_0x210bbe,null));};exports[_0x08ad('0x4b')]=function(_0x470ba3,_0x32c2ee){return db[_0x08ad('0x31')][_0x08ad('0x4b')](_0x470ba3['body'],{})[_0x08ad('0x2a')](respondWithResult(_0x32c2ee,0xc9))[_0x08ad('0x46')](handleError(_0x32c2ee,null));};exports[_0x08ad('0x29')]=function(_0x3e93f9,_0x245599){if(_0x3e93f9[_0x08ad('0x4c')]['id']){delete _0x3e93f9[_0x08ad('0x4c')]['id'];}return db[_0x08ad('0x31')]['find']({'where':{'id':_0x3e93f9[_0x08ad('0x4d')]['id']}})[_0x08ad('0x2a')](handleEntityNotFound(_0x245599,null))[_0x08ad('0x2a')](saveUpdates(_0x3e93f9[_0x08ad('0x4c')],null))[_0x08ad('0x2a')](respondWithResult(_0x245599,null))[_0x08ad('0x46')](handleError(_0x245599,null));};exports[_0x08ad('0x2b')]=function(_0x591ecf,_0x567897){return db[_0x08ad('0x31')]['find']({'where':{'id':_0x591ecf[_0x08ad('0x4d')]['id']}})['then'](handleEntityNotFound(_0x567897,null))[_0x08ad('0x2a')](removeEntity(_0x567897,null))[_0x08ad('0x46')](handleError(_0x567897,null));};exports[_0x08ad('0x4e')]=function(_0x214548,_0x4cbbf0){return db[_0x08ad('0x31')][_0x08ad('0x4e')]()['then'](respondWithResult(_0x4cbbf0,null))[_0x08ad('0x46')](handleError(_0x4cbbf0,null));};function wrapUser(_0x1faf05){return function(_0x39f055){var _0x53a395=_0x1faf05['get']({'plain':!![]});_0x53a395['messages']=[];if(_0x39f055){_0x53a395[_0x08ad('0x4f')]=_0x39f055[_0x08ad('0x50')];_0x53a395[_0x08ad('0x51')]=_0x39f055;}else{_0x53a395[_0x08ad('0x4f')]=moment(0x0)[_0x08ad('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x53a395[_0x08ad('0x51')]={};}return _0x53a395;};}exports[_0x08ad('0x53')]=function(_0x38286b,_0x2fe7c6,_0x486e4f){var _0x1a1d06=[];return db[_0x08ad('0x54')][_0x08ad('0x44')]({'where':{'role':[_0x08ad('0x55'),_0x08ad('0x56'),'user']},'attributes':['id',_0x08ad('0x57'),'name','role',_0x08ad('0x58'),'internal',_0x08ad('0x59'),'lastLoginAt','allowmessenger',_0x08ad('0x5a')],'order':qs['sort'](_0x08ad('0x5b')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x08ad('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x08ad('0x2a')](function(_0x3f32a8){if(_0x3f32a8){var _0xabc582=_0x38286b[_0x08ad('0x5c')]['get']({'plain':!![]});if(!_0xabc582)throw new Error(_0x08ad('0x5d'));if(_0xabc582[_0x08ad('0x5e')]===_0x08ad('0x5c')){return db[_0x08ad('0x5f')][_0x08ad('0x4a')]({'where':{'name':_0x08ad('0x60'),'userProfileId':_0xabc582[_0x08ad('0x61')]},'raw':!![]})[_0x08ad('0x2a')](function(_0x153090){if(_0x153090){if(_0x153090[_0x08ad('0x62')]===0x0){return db[_0x08ad('0x63')][_0x08ad('0x44')]({'where':{'sectionId':_0x153090['id']},'raw':!![]})[_0x08ad('0x2a')](function(_0x22ba26){var _0x5055fd=[];if(_['isEmpty'](_0x22ba26)){_0x5055fd=_[_0x08ad('0x41')](_0x3f32a8,function(_0x1deab6){if(_0x1deab6[_0x08ad('0x5e')]!==_0x08ad('0x55')){return _0x1deab6;}});return _0x5055fd;}else{for(var _0x2e4e19=0x0;_0x2e4e19<_0x3f32a8['length'];_0x2e4e19++){var _0x34c27f=_0x3f32a8[_0x2e4e19];if(_0x34c27f['role']===_0x08ad('0x55')){var _0x2b5a0e=_[_0x08ad('0x4a')](_0x22ba26,function(_0x4d2edc){return _0x4d2edc[_0x08ad('0x64')]===_0x34c27f['id'];});if(_0x2b5a0e)_0x5055fd[_0x08ad('0x65')](_0x34c27f);}else{_0x5055fd['push'](_0x34c27f);}}return _0x5055fd;}});}else{return _0x3f32a8;}}else{var _0x463ec5=_[_0x08ad('0x41')](_0x3f32a8,function(_0x22a0b2){if(_0x22a0b2[_0x08ad('0x5e')]!=='agent'){return _0x22a0b2;}});return _0x463ec5;}});}else{return _0x3f32a8;}}})[_0x08ad('0x2a')](function(_0x5e23a5){var _0x194865=[];if(_0x5e23a5){_0x1a1d06=_0x5e23a5;for(var _0x4bb4a1=0x0;_0x4bb4a1<_0x5e23a5[_0x08ad('0x48')];_0x4bb4a1+=0x1){_0x1a1d06[_0x4bb4a1][_0x08ad('0x66')]=[];_0x194865[_0x08ad('0x65')](db[_0x08ad('0x31')][_0x08ad('0x4a')]({'where':{'FromId':[_0x38286b['user']['id'],_0x5e23a5[_0x4bb4a1]['id']],'ToId':[_0x38286b[_0x08ad('0x5c')]['id'],_0x5e23a5[_0x4bb4a1]['id']],'ChatGroupId':null},'attributes':['id',_0x08ad('0x50'),_0x08ad('0x67'),_0x08ad('0x68'),_0x08ad('0x69'),_0x08ad('0x4c')],'order':qs[_0x08ad('0x3d')](_0x08ad('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5e23a5[_0x4bb4a1])));}return BPromise['all'](_0x194865);}return[];})['then'](function(_0x56bd16){return{'rows':_0x56bd16,'count':_0x56bd16['length']};})[_0x08ad('0x2a')](respondWithResult(_0x2fe7c6,null))[_0x08ad('0x46')](handleError(_0x2fe7c6,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 6b92dde..7d25fbb 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 _0x04ca=['ChatInternalMessage','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x1901fa,_0x23a42a){var _0xcf972f=function(_0x3a4120){while(--_0x3a4120){_0x1901fa['push'](_0x1901fa['shift']());}};_0xcf972f(++_0x23a42a);}(_0x04ca,0x1c6));var _0xa04c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x04ca[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xa04c('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xa04c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa04c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x84abbc){return function(_0x3a9b6c,_0x322e38,_0x32e254){ChatInternalMessageEvents['emit'](_0x84abbc+':'+_0x3a9b6c['id'],_0x3a9b6c);ChatInternalMessageEvents[_0xa04c('0x3')](_0x84abbc,_0x3a9b6c);_0x32e254(null);};}for(var e in events){if(events[_0xa04c('0x4')](e)){var event=events[e];ChatInternalMessage[_0xa04c('0x5')](e,emitEvent(event));}}module[_0xa04c('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe5bb=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0xe5bb,0x166));var _0xbe5b=function(_0x346947,_0x101288){_0x346947=_0x346947-0x0;var _0x4965f8=_0xe5bb[_0x346947];return _0x4965f8;};'use strict';var EventEmitter=require(_0xbe5b('0x0'));var ChatInternalMessage=require(_0xbe5b('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbe5b('0x2')](0x0);var events={'afterCreate':_0xbe5b('0x3'),'afterUpdate':_0xbe5b('0x4'),'afterDestroy':_0xbe5b('0x5')};function emitEvent(_0x49e047){return function(_0x1e1354,_0x149734,_0x337d2a){ChatInternalMessageEvents[_0xbe5b('0x6')](_0x49e047+':'+_0x1e1354['id'],_0x1e1354);ChatInternalMessageEvents['emit'](_0x49e047,_0x1e1354);_0x337d2a(null);};}for(var e in events){if(events[_0xbe5b('0x7')](e)){var event=events[e];ChatInternalMessage[_0xbe5b('0x8')](e,emitEvent(event));}}module[_0xbe5b('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index a9cf5fb..01de2b9 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 _0xb51b=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3395a1,_0x58ddc6){var _0x256656=function(_0x40d4d3){while(--_0x40d4d3){_0x3395a1['push'](_0x3395a1['shift']());}};_0x256656(++_0x58ddc6);}(_0xb51b,0x168));var _0xbb51=function(_0x4f8eb8,_0x3b8216){_0x4f8eb8=_0x4f8eb8-0x0;var _0x22d135=_0xb51b[_0x4f8eb8];return _0x22d135;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbb51('0x0'))(_0xbb51('0x1'));var moment=require(_0xbb51('0x2'));var BPromise=require(_0xbb51('0x3'));var rp=require(_0xbb51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbb51('0x5'));var attributes=require(_0xbb51('0x6'));module[_0xbb51('0x7')]=function(_0x2f855b,_0x4768c6){return _0x2f855b[_0xbb51('0x8')](_0xbb51('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb51('0xa'),'collate':_0xbb51('0xb')});};
\ No newline at end of file
+var _0x930e=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2f79d9,_0x2d4a5a){var _0x3fe05b=function(_0x36a0cf){while(--_0x36a0cf){_0x2f79d9['push'](_0x2f79d9['shift']());}};_0x3fe05b(++_0x2d4a5a);}(_0x930e,0x1c6));var _0xe930=function(_0x2c9ba4,_0x3d3852){_0x2c9ba4=_0x2c9ba4-0x0;var _0x445c87=_0x930e[_0x2c9ba4];return _0x445c87;};'use strict';var _=require(_0xe930('0x0'));var util=require(_0xe930('0x1'));var logger=require(_0xe930('0x2'))(_0xe930('0x3'));var moment=require('moment');var BPromise=require(_0xe930('0x4'));var rp=require(_0xe930('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe930('0x6'));var config=require(_0xe930('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x268e1,_0x5c3920){return _0x268e1[_0xe930('0x8')](_0xe930('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe930('0xa'),'collate':_0xe930('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index c10d6a2..72bdc15 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 _0x032b=['register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x368593,_0x935b0c){var _0x261b29=function(_0x6f7d55){while(--_0x6f7d55){_0x368593['push'](_0x368593['shift']());}};_0x261b29(++_0x935b0c);}(_0x032b,0x183));var _0xb032=function(_0x22193e,_0x2ae001){_0x22193e=_0x22193e-0x0;var _0x10c378=_0x032b[_0x22193e];return _0x10c378;};'use strict';var _=require('lodash');var util=require(_0xb032('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb032('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb032('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb032('0x3'))(_0xb032('0x4'));var config=require(_0xb032('0x5'));var jayson=require(_0xb032('0x6'));var client=jayson[_0xb032('0x7')][_0xb032('0x8')]({'port':0x232a});config['redis']=_[_0xb032('0x9')](config[_0xb032('0xa')],{'host':_0xb032('0xb'),'port':0x18eb});var socket=require(_0xb032('0xc'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xb032('0xd')](socket);function respondWithRpcPromise(_0xf89ca9,_0x463f7a,_0x1d7bb3){return new BPromise(function(_0x2d5abe,_0x3d651b){return client[_0xb032('0xe')](_0xf89ca9,_0x1d7bb3)['then'](function(_0x4988fa){logger[_0xb032('0xf')](_0xb032('0x10'),_0x463f7a,_0xb032('0x11'));logger[_0xb032('0x12')](_0xb032('0x13'),_0x463f7a,'request\x20sent',JSON['stringify'](_0x4988fa));if(_0x4988fa[_0xb032('0x14')]){if(_0x4988fa[_0xb032('0x14')][_0xb032('0x15')]===0x1f4){logger['error'](_0xb032('0x10'),_0x463f7a,_0x4988fa[_0xb032('0x14')][_0xb032('0x16')]);return _0x3d651b(_0x4988fa[_0xb032('0x14')][_0xb032('0x16')]);}logger[_0xb032('0x14')](_0xb032('0x10'),_0x463f7a,_0x4988fa[_0xb032('0x14')][_0xb032('0x16')]);return _0x2d5abe(_0x4988fa[_0xb032('0x14')][_0xb032('0x16')]);}else{logger[_0xb032('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x463f7a,_0xb032('0x11'));_0x2d5abe(_0x4988fa[_0xb032('0x17')]['message']);}})[_0xb032('0x18')](function(_0x25fb0b){logger['error'](_0xb032('0x10'),_0x463f7a,_0x25fb0b);_0x3d651b(_0x25fb0b);});});}
\ No newline at end of file
+var _0x7a59=['http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xd0f4e2,_0x4963d5){var _0x4fde1e=function(_0x2ce32d){while(--_0x2ce32d){_0xd0f4e2['push'](_0xd0f4e2['shift']());}};_0x4fde1e(++_0x4963d5);}(_0x7a59,0x16e));var _0x97a5=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x7a59[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97a5('0x1'));var rs=require(_0x97a5('0x2'));var fs=require('fs');var Redis=require(_0x97a5('0x3'));var db=require(_0x97a5('0x4'))['db'];var utils=require(_0x97a5('0x5'));var logger=require('../../config/logger')(_0x97a5('0x6'));var config=require(_0x97a5('0x7'));var jayson=require(_0x97a5('0x8'));var client=jayson['client'][_0x97a5('0x9')]({'port':0x232a});config[_0x97a5('0xa')]=_[_0x97a5('0xb')](config[_0x97a5('0xa')],{'host':_0x97a5('0xc'),'port':0x18eb});var socket=require(_0x97a5('0xd'))(new Redis(config[_0x97a5('0xa')]));require('./chatInternalMessage.socket')[_0x97a5('0xe')](socket);function respondWithRpcPromise(_0x101c3f,_0xd70b51,_0x388bd7){return new BPromise(function(_0x1fc6b5,_0x4d93a5){return client['request'](_0x101c3f,_0x388bd7)[_0x97a5('0xf')](function(_0x41022d){logger[_0x97a5('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xd70b51,_0x97a5('0x11'));logger[_0x97a5('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xd70b51,'request\x20sent',JSON[_0x97a5('0x13')](_0x41022d));if(_0x41022d[_0x97a5('0x14')]){if(_0x41022d['error']['code']===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xd70b51,_0x41022d[_0x97a5('0x14')][_0x97a5('0x15')]);return _0x4d93a5(_0x41022d[_0x97a5('0x14')]['message']);}logger[_0x97a5('0x14')](_0x97a5('0x16'),_0xd70b51,_0x41022d['error'][_0x97a5('0x15')]);return _0x1fc6b5(_0x41022d['error'][_0x97a5('0x15')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xd70b51,'request\x20sent');_0x1fc6b5(_0x41022d[_0x97a5('0x17')]['message']);}})[_0x97a5('0x18')](function(_0x9863ea){logger[_0x97a5('0x14')](_0x97a5('0x16'),_0xd70b51,_0x9863ea);_0x4d93a5(_0x9863ea);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 0be0859..04fcd87 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 _0x43cf=['emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x1f9ff4,_0x55068d){var _0x43759f=function(_0xceb61b){while(--_0xceb61b){_0x1f9ff4['push'](_0x1f9ff4['shift']());}};_0x43759f(++_0x55068d);}(_0x43cf,0x74));var _0xf43c=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x43cf[_0x251d9c];return _0x16ae64;};'use strict';var ChatInternalMessageEvents=require(_0xf43c('0x0'));var events=[_0xf43c('0x1'),_0xf43c('0x2'),'update'];function createListener(_0x245953,_0x14dd96){return function(_0xab6326){_0x14dd96[_0xf43c('0x3')](_0x245953,_0xab6326);};}function removeListener(_0x586cc1,_0x46003b){return function(){ChatInternalMessageEvents[_0xf43c('0x4')](_0x586cc1,_0x46003b);};}exports[_0xf43c('0x5')]=function(_0x1ffad9){for(var _0x37c20e=0x0,_0x52842d=events['length'];_0x37c20e<_0x52842d;_0x37c20e++){var _0x429b38=events[_0x37c20e];var _0x2651b7=createListener(_0xf43c('0x6')+_0x429b38,_0x1ffad9);ChatInternalMessageEvents['on'](_0x429b38,_0x2651b7);}};
\ No newline at end of file
+var _0xb12c=['removeListener','register','length','save','remove','update','emit'];(function(_0x483312,_0x54fd0e){var _0x5c5e1c=function(_0x33e216){while(--_0x33e216){_0x483312['push'](_0x483312['shift']());}};_0x5c5e1c(++_0x54fd0e);}(_0xb12c,0x1a0));var _0xcb12=function(_0x315020,_0x52c3c1){_0x315020=_0x315020-0x0;var _0xd2f525=_0xb12c[_0x315020];return _0xd2f525;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xcb12('0x0'),_0xcb12('0x1'),_0xcb12('0x2')];function createListener(_0xc998ee,_0x27cdc1){return function(_0x479713){_0x27cdc1[_0xcb12('0x3')](_0xc998ee,_0x479713);};}function removeListener(_0x48a72e,_0x13f168){return function(){ChatInternalMessageEvents[_0xcb12('0x4')](_0x48a72e,_0x13f168);};}exports[_0xcb12('0x5')]=function(_0x3b647e){for(var _0xa5ce63=0x0,_0x541cbf=events[_0xcb12('0x6')];_0xa5ce63<_0x541cbf;_0xa5ce63++){var _0x4bcc32=events[_0xa5ce63];var _0x51f33b=createListener('chatInternalMessage:'+_0x4bcc32,_0x3b647e);ChatInternalMessageEvents['on'](_0x4bcc32,_0x51f33b);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f289e51..5ec2a61 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 _0xfa41=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','getUsers','/:id','show','post','create','update','delete','destroy','multer'];(function(_0x149f32,_0x4273f7){var _0x11f475=function(_0x18eeef){while(--_0x18eeef){_0x149f32['push'](_0x149f32['shift']());}};_0x11f475(++_0x4273f7);}(_0xfa41,0xb3));var _0x1fa4=function(_0x4bd710,_0x237f88){_0x4bd710=_0x4bd710-0x0;var _0x30f143=_0xfa41[_0x4bd710];return _0x30f143;};'use strict';var multer=require(_0x1fa4('0x0'));var util=require(_0x1fa4('0x1'));var path=require('path');var timeout=require(_0x1fa4('0x2'));var express=require('express');var router=express[_0x1fa4('0x3')]();var fs_extra=require(_0x1fa4('0x4'));var auth=require(_0x1fa4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa4('0x6'));var controller=require(_0x1fa4('0x7'));router[_0x1fa4('0x8')]('/',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xa')]);router['get'](_0x1fa4('0xb'),auth[_0x1fa4('0x9')](),controller['describe']);router[_0x1fa4('0x8')]('/users',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xc')]);router['get'](_0x1fa4('0xd'),auth['isAuthenticated'](),controller[_0x1fa4('0xe')]);router[_0x1fa4('0xf')]('/',auth['isAuthenticated'](),controller[_0x1fa4('0x10')]);router['put']('/:id',controller[_0x1fa4('0x11')]);router[_0x1fa4('0x12')](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6e1c=['/:id','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/users','getUsers','create','put'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6e1c,0x145));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc6e1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc6e1('0x1'));var express=require('express');var router=express[_0xc6e1('0x2')]();var fs_extra=require(_0xc6e1('0x3'));var auth=require(_0xc6e1('0x4'));var interaction=require(_0xc6e1('0x5'));var config=require(_0xc6e1('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xc6e1('0x7')]('/',auth['isAuthenticated'](),controller[_0xc6e1('0x8')]);router['get']('/describe',auth[_0xc6e1('0x9')](),controller[_0xc6e1('0xa')]);router[_0xc6e1('0x7')](_0xc6e1('0xb'),auth[_0xc6e1('0x9')](),controller[_0xc6e1('0xc')]);router[_0xc6e1('0x7')]('/:id',auth[_0xc6e1('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc6e1('0xd')]);router[_0xc6e1('0xe')](_0xc6e1('0xf'),controller['update']);router['delete'](_0xc6e1('0xf'),auth[_0xc6e1('0x9')](),controller['destroy']);module[_0xc6e1('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index a9f37b4..b3a87b8 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 _0xfcbb=['ENUM','out','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x373d57,_0x28b78c){var _0x473d0d=function(_0x50631d){while(--_0x50631d){_0x373d57['push'](_0x373d57['shift']());}};_0x473d0d(++_0x28b78c);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x293786,_0x3af279){_0x293786=_0x293786-0x0;var _0x31021c=_0xfcbb[_0x293786];return _0x31021c;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'body':{'type':Sequelize[_0xbfcb('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfcb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfcb('0x4')]('in',_0xbfcb('0x5')),'defaultValue':_0xbfcb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbfcb('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xdd6e=['medium','BOOLEAN','ENUM','out','sequelize','exports','TEXT'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xdd6e,0xa5));var _0xedd6=function(_0x1869ac,_0x1a9506){_0x1869ac=_0x1869ac-0x0;var _0xc2bf7b=_0xdd6e[_0x1869ac];return _0xc2bf7b;};'use strict';var Sequelize=require(_0xedd6('0x0'));module[_0xedd6('0x1')]={'body':{'type':Sequelize[_0xedd6('0x2')](_0xedd6('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xedd6('0x5')]('in',_0xedd6('0x6')),'defaultValue':_0xedd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 435f695..b7eb0ca 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 _0xd10c=['event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','rejectMessage','interface','rejectmessage','rimraf','zip-dir','request-promise','moment','bluebird','util','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','offset','limit','undefined','count','apply','update','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','show','params','includeAll','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','UserId','agent','get','ChatInteraction','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel'];(function(_0x21ec8c,_0x1e58c6){var _0x18f950=function(_0x4f08a3){while(--_0x4f08a3){_0x21ec8c['push'](_0x21ec8c['shift']());}};_0x18f950(++_0x1e58c6);}(_0xd10c,0x197));var _0xcd10=function(_0x896a1a,_0x2ecb55){_0x896a1a=_0x896a1a-0x0;var _0x9cc846=_0xd10c[_0x896a1a];return _0x9cc846;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd10('0x0'));var zipdir=require(_0xcd10('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd10('0x2'));var moment=require(_0xcd10('0x3'));var BPromise=require(_0xcd10('0x4'));var Mustache=require('mustache');var util=require(_0xcd10('0x5'));var path=require(_0xcd10('0x6'));var sox=require(_0xcd10('0x7'));var csv=require(_0xcd10('0x8'));var ejs=require(_0xcd10('0x9'));var fs=require('fs');var fs_extra=require(_0xcd10('0xa'));var _=require(_0xcd10('0xb'));var squel=require(_0xcd10('0xc'));var crypto=require(_0xcd10('0xd'));var jsforce=require(_0xcd10('0xe'));var deskjs=require(_0xcd10('0xf'));var toCsv=require(_0xcd10('0x8'));var querystring=require('querystring');var Papa=require(_0xcd10('0x10'));var Redis=require(_0xcd10('0x11'));var authService=require(_0xcd10('0x12'));var qs=require(_0xcd10('0x13'));var as=require(_0xcd10('0x14'));var hardwareService=require(_0xcd10('0x15'));var logger=require(_0xcd10('0x16'))(_0xcd10('0x17'));var utils=require(_0xcd10('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcd10('0x19'));var db=require(_0xcd10('0x1a'))['db'];config[_0xcd10('0x1b')]=_[_0xcd10('0x1c')](config[_0xcd10('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd10('0x1d'))(new Redis(config[_0xcd10('0x1b')]));require(_0xcd10('0x1e'))['register'](socket);var jayson=require(_0xcd10('0x1f'));var client=jayson[_0xcd10('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xcd10('0x20')][_0xcd10('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x12677f,_0xb43d41,_0xa1192a,_0x34df6a){return new BPromise(function(_0x40be36,_0x1fcefb){var _0x4688de=_0x34df6a||client;return _0x4688de[_0xcd10('0x22')](_0x12677f,_0xa1192a)[_0xcd10('0x23')](function(_0x463a76){logger['info'](_0xcd10('0x24'),_0xb43d41,_0xcd10('0x25'));logger[_0xcd10('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xb43d41,_0xcd10('0x25'),JSON['stringify'](_0x463a76));if(_0x463a76['error']){if(_0x463a76[_0xcd10('0x27')][_0xcd10('0x28')]===0x1f4){logger[_0xcd10('0x27')](_0xcd10('0x24'),_0xb43d41,_0x463a76[_0xcd10('0x27')][_0xcd10('0x29')]);return _0x1fcefb(_0x463a76[_0xcd10('0x27')][_0xcd10('0x29')]);}logger['error'](_0xcd10('0x24'),_0xb43d41,_0x463a76['error'][_0xcd10('0x29')]);return _0x40be36(_0x463a76['error']['message']);}else{logger['info'](_0xcd10('0x24'),_0xb43d41,'request\x20sent');_0x40be36(_0x463a76[_0xcd10('0x2a')][_0xcd10('0x29')]);}})[_0xcd10('0x2b')](function(_0x9567a5){logger['error']('ChatMessage,\x20%s,\x20%s',_0xb43d41,_0x9567a5);_0x1fcefb(_0x9567a5);});});}function respondWithStatusCode(_0x3f8767,_0x2d177c){_0x2d177c=_0x2d177c||0xcc;return function(_0x31dcb4){if(_0x31dcb4){return _0x3f8767[_0xcd10('0x2c')](_0x2d177c);}return _0x3f8767['status'](_0x2d177c)[_0xcd10('0x2d')]();};}function respondWithResult(_0x450e18,_0xdfecc8){_0xdfecc8=_0xdfecc8||0xc8;return function(_0x456bd0){if(_0x456bd0){return _0x450e18[_0xcd10('0x2e')](_0xdfecc8)['json'](_0x456bd0);}};}function respondWithFilteredResult(_0x489be2,_0x42e4fe){return function(_0x12c991){if(_0x12c991){var _0x45912f=typeof _0x42e4fe[_0xcd10('0x2f')]==='undefined'&&typeof _0x42e4fe[_0xcd10('0x30')]===_0xcd10('0x31');var _0x2ed32f=_0x12c991[_0xcd10('0x32')];var _0x23995a=_0x45912f?0x0:_0x42e4fe[_0xcd10('0x2f')];var _0x9cbf3c=_0x45912f?_0x12c991[_0xcd10('0x32')]:_0x42e4fe['offset']+_0x42e4fe[_0xcd10('0x30')];var _0x3c86bc;if(_0x9cbf3c>=_0x2ed32f){_0x9cbf3c=_0x2ed32f;_0x3c86bc=0xc8;}else{_0x3c86bc=0xce;}_0x489be2[_0xcd10('0x2e')](_0x3c86bc);return _0x489be2['set']('Content-Range',_0x23995a+'-'+_0x9cbf3c+'/'+_0x2ed32f)['json'](_0x12c991);}return null;};}function patchUpdates(_0xd61b72){return function(_0x1ce196){try{jsonpatch[_0xcd10('0x33')](_0x1ce196,_0xd61b72,!![]);}catch(_0x112eb1){return BPromise['reject'](_0x112eb1);}return _0x1ce196['save']();};}function saveUpdates(_0x2b91b1,_0x4bf03a){return function(_0x1b161a){if(_0x1b161a){return _0x1b161a[_0xcd10('0x34')](_0x2b91b1)['then'](function(_0x429986){return _0x429986;});}return null;};}function removeEntity(_0x48d5bb,_0x3910c3){return function(_0x49558b){if(_0x49558b){return _0x49558b['destroy']()['then'](function(){_0x48d5bb[_0xcd10('0x2e')](0xcc)[_0xcd10('0x2d')]();});}};}function handleEntityNotFound(_0x2304b7,_0x4c23ff){return function(_0x1203da){if(!_0x1203da){_0x2304b7['sendStatus'](0x194);}return _0x1203da;};}function handleError(_0x304294,_0xcd7471){_0xcd7471=_0xcd7471||0x1f4;return function(_0x2ee222){logger['error'](_0x2ee222[_0xcd10('0x35')]);if(_0x2ee222[_0xcd10('0x36')]){delete _0x2ee222['name'];}_0x304294[_0xcd10('0x2e')](_0xcd7471)['send'](_0x2ee222);};}exports[_0xcd10('0x37')]=function(_0x31f21f,_0xce194a){var _0x29e79c={},_0x5ec933={},_0x1b77a2={'count':0x0,'rows':[]};var _0x29bc67=_[_0xcd10('0x38')](db[_0xcd10('0x39')][_0xcd10('0x3a')],function(_0x40ec9c){return{'name':_0x40ec9c[_0xcd10('0x3b')],'type':_0x40ec9c[_0xcd10('0x3c')][_0xcd10('0x3d')]};});_0x5ec933[_0xcd10('0x3e')]=_['map'](_0x29bc67,_0xcd10('0x36'));_0x5ec933[_0xcd10('0x3f')]=_[_0xcd10('0x40')](_0x31f21f[_0xcd10('0x3f')]);_0x5ec933[_0xcd10('0x41')]=_['intersection'](_0x5ec933['model'],_0x5ec933[_0xcd10('0x3f')]);_0x29e79c['attributes']=_[_0xcd10('0x42')](_0x5ec933[_0xcd10('0x3e')],qs['fields'](_0x31f21f[_0xcd10('0x3f')][_0xcd10('0x43')]));_0x29e79c[_0xcd10('0x44')]=_0x29e79c[_0xcd10('0x44')][_0xcd10('0x45')]?_0x29e79c[_0xcd10('0x44')]:_0x5ec933[_0xcd10('0x3e')];if(!_0x31f21f[_0xcd10('0x3f')][_0xcd10('0x46')]('nolimit')){_0x29e79c[_0xcd10('0x30')]=qs['limit'](_0x31f21f['query'][_0xcd10('0x30')]);_0x29e79c['offset']=qs[_0xcd10('0x2f')](_0x31f21f[_0xcd10('0x3f')]['offset']);}_0x29e79c[_0xcd10('0x47')]=qs[_0xcd10('0x48')](_0x31f21f[_0xcd10('0x3f')][_0xcd10('0x48')]);_0x29e79c[_0xcd10('0x49')]=qs[_0xcd10('0x41')](_[_0xcd10('0x4a')](_0x31f21f['query'],_0x5ec933[_0xcd10('0x41')]),_0x29bc67);if(_0x31f21f['query'][_0xcd10('0x4b')]){_0x29e79c[_0xcd10('0x49')]=_[_0xcd10('0x4c')](_0x29e79c[_0xcd10('0x49')],{'$or':_[_0xcd10('0x38')](_0x29bc67,function(_0x5c7011){if(_0x5c7011[_0xcd10('0x3c')]!=='VIRTUAL'){var _0x365136={};_0x365136[_0x5c7011[_0xcd10('0x36')]]={'$like':'%'+_0x31f21f['query'][_0xcd10('0x4b')]+'%'};return _0x365136;}})});}_0x29e79c=_['merge']({},_0x29e79c,_0x31f21f['options']);var _0x471a9b={'where':_0x29e79c['where']};return db[_0xcd10('0x39')]['count'](_0x471a9b)['then'](function(_0x2f1387){_0x1b77a2['count']=_0x2f1387;if(_0x31f21f['query']['includeAll']){_0x29e79c[_0xcd10('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xcd10('0x4e')](_0x29e79c);})[_0xcd10('0x23')](function(_0x138918){_0x1b77a2[_0xcd10('0x4f')]=_0x138918;return _0x1b77a2;})[_0xcd10('0x23')](respondWithFilteredResult(_0xce194a,_0x29e79c))[_0xcd10('0x2b')](handleError(_0xce194a,null));};exports[_0xcd10('0x50')]=function(_0x18520d,_0x515d12){var _0x4f382d={'raw':!![],'where':{'id':_0x18520d[_0xcd10('0x51')]['id']}},_0x193fc1={};_0x193fc1[_0xcd10('0x3e')]=_[_0xcd10('0x40')](db[_0xcd10('0x39')]['rawAttributes']);_0x193fc1[_0xcd10('0x3f')]=_[_0xcd10('0x40')](_0x18520d['query']);_0x193fc1[_0xcd10('0x41')]=_['intersection'](_0x193fc1[_0xcd10('0x3e')],_0x193fc1['query']);_0x4f382d[_0xcd10('0x44')]=_['intersection'](_0x193fc1[_0xcd10('0x3e')],qs[_0xcd10('0x43')](_0x18520d[_0xcd10('0x3f')][_0xcd10('0x43')]));_0x4f382d[_0xcd10('0x44')]=_0x4f382d[_0xcd10('0x44')][_0xcd10('0x45')]?_0x4f382d[_0xcd10('0x44')]:_0x193fc1[_0xcd10('0x3e')];if(_0x18520d[_0xcd10('0x3f')][_0xcd10('0x52')]){_0x4f382d['include']=[{'all':!![]}];}_0x4f382d=_[_0xcd10('0x4c')]({},_0x4f382d,_0x18520d['options']);return db[_0xcd10('0x39')][_0xcd10('0x53')](_0x4f382d)['then'](handleEntityNotFound(_0x515d12,null))[_0xcd10('0x23')](respondWithResult(_0x515d12,null))[_0xcd10('0x2b')](handleError(_0x515d12,null));};exports['create']=function(_0x17a293,_0x1a19d4){return db[_0xcd10('0x39')][_0xcd10('0x54')](_0x17a293['body'],{})[_0xcd10('0x23')](respondWithResult(_0x1a19d4,0xc9))['catch'](handleError(_0x1a19d4,null));};exports[_0xcd10('0x34')]=function(_0x5d738c,_0x1894f6){if(_0x5d738c['body']['id']){delete _0x5d738c[_0xcd10('0x55')]['id'];}return db[_0xcd10('0x39')][_0xcd10('0x53')]({'where':{'id':_0x5d738c['params']['id']}})[_0xcd10('0x23')](handleEntityNotFound(_0x1894f6,null))[_0xcd10('0x23')](saveUpdates(_0x5d738c[_0xcd10('0x55')],null))[_0xcd10('0x23')](respondWithResult(_0x1894f6,null))[_0xcd10('0x2b')](handleError(_0x1894f6,null));};exports['destroy']=function(_0x18a4f2,_0x44fe1f){return db[_0xcd10('0x39')][_0xcd10('0x53')]({'where':{'id':_0x18a4f2[_0xcd10('0x51')]['id']}})[_0xcd10('0x23')](handleEntityNotFound(_0x44fe1f,null))[_0xcd10('0x23')](removeEntity(_0x44fe1f,null))[_0xcd10('0x2b')](handleError(_0x44fe1f,null));};exports[_0xcd10('0x56')]=function(_0x426419,_0x470564){return db[_0xcd10('0x39')]['describe']()[_0xcd10('0x23')](respondWithResult(_0x470564,null))[_0xcd10('0x2b')](handleError(_0x470564,null));};var interaction_log=require(_0xcd10('0x16'))(_0xcd10('0x57'));exports[_0xcd10('0x58')]=function(_0x3745fc,_0x2a421c,_0x18d5eb){var _0xb6d660={'agent':{},'channel':_0xcd10('0x59')};if(_0x3745fc[_0xcd10('0x55')]['id']){delete _0x3745fc['body']['id'];}_0x3745fc[_0xcd10('0x55')][_0xcd10('0x5a')]=!![];_0x3745fc[_0xcd10('0x55')][_0xcd10('0x5b')]=moment()[_0xcd10('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3745fc['body'][_0xcd10('0x5d')]=_0x3745fc[_0xcd10('0x55')][_0xcd10('0x5d')]||_0x3745fc['user']['id'];_0xb6d660[_0xcd10('0x5e')]['id']=_0x3745fc['body'][_0xcd10('0x5d')];return db[_0xcd10('0x39')][_0xcd10('0x53')]({'where':{'id':_0x3745fc['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2a421c,null))[_0xcd10('0x23')](saveUpdates(_0x3745fc[_0xcd10('0x55')],null))[_0xcd10('0x23')](function(_0x217e32){if(_0x217e32){_0xb6d660['message']=_0x217e32[_0xcd10('0x5f')]({'plain':!![]});return db[_0xcd10('0x60')]['find']({'where':{'id':_0x217e32[_0xcd10('0x61')]}});}return null;})[_0xcd10('0x23')](handleEntityNotFound(_0x2a421c,null))[_0xcd10('0x23')](function(_0x14742c){if(_0x14742c){return _0x14742c[_0xcd10('0x34')]({'UserId':_0x3745fc[_0xcd10('0x55')][_0xcd10('0x5d')],'read1stAt':_['isNil'](_0x14742c['read1stAt'])?moment()[_0xcd10('0x5c')](_0xcd10('0x62')):undefined});}return null;})[_0xcd10('0x23')](function(_0x375465){if(_0x375465){_0xb6d660[_0xcd10('0x63')]=_0x375465[_0xcd10('0x5f')]({'plain':!![]});interaction_log[_0xcd10('0x64')](_0xcd10('0x65'),_0x3745fc[_0xcd10('0x66')]['id'],_0x3745fc[_0xcd10('0x66')]['name'],_0x3745fc['user'][_0xcd10('0x67')],_0xb6d660[_0xcd10('0x63')]['id'],_0x3745fc[_0xcd10('0x55')]?JSON['stringify'](_0x3745fc[_0xcd10('0x55')]):'null');return respondWithRpcPromise(_0xcd10('0x68'),_0xcd10('0x69'),_0xb6d660);}return null;})['then'](function(_0x40cda4){var _0x28537e=_0xcd10('0x6a')+_0x40cda4[_0xcd10('0x29')][_0xcd10('0x6b')];return db[_0xcd10('0x6c')]['query'](_0x28537e,{'type':db[_0xcd10('0x6d')][_0xcd10('0x6e')][_0xcd10('0x6f')],'raw':!![]})[_0xcd10('0x23')](function(_0xf56f46){return _0xf56f46;});})[_0xcd10('0x23')](function(_0x5af124){if(_0x5af124){_0xb6d660[_0xcd10('0x29')][_0xcd10('0x70')]=_0x5af124[0x0];if(!_0x3745fc[_0xcd10('0x55')][_0xcd10('0x5d')])return;return db[_0xcd10('0x71')][_0xcd10('0x53')]({'where':{'id':_0x3745fc[_0xcd10('0x55')][_0xcd10('0x5d')],'role':'agent'},'attributes':['id',_0xcd10('0x36'),_0xcd10('0x72'),_0xcd10('0x73'),_0xcd10('0x74')],'raw':!![]});}return null;})[_0xcd10('0x23')](function(_0x5124ec){if(!_0x5124ec)return null;_0xb6d660['message']['agent']=_0x5124ec;return _0xb6d660;})[_0xcd10('0x23')](function(_0xa56a5b){if(_0xa56a5b){if(_0x3745fc['body'][_0xcd10('0x75')]){_0xb6d660[_0xcd10('0x29')]['interface']=util['format'](_0xcd10('0x76'),_0x3745fc[_0xcd10('0x66')][_0xcd10('0x36')]);_0xb6d660[_0xcd10('0x29')][_0xcd10('0x77')]=_0xb6d660[_0xcd10('0x77')];_0xb6d660['message'][_0xcd10('0x78')]=_0xb6d660[_0xcd10('0x77')];_0xb6d660[_0xcd10('0x29')][_0xcd10('0x79')]='accept';return respondWithRpcPromise('EventManager',_0xcd10('0x7a'),{'event':_0xcd10('0x7b'),'message':_[_0xcd10('0x4c')](_0xb6d660['message'],JSON['parse'](_0xb6d660['interaction'][_0xcd10('0x7c')]))},client9002)[_0xcd10('0x23')](function(){return _0xb6d660;});}return _0xb6d660;}return null;})[_0xcd10('0x23')](respondWithResult(_0x2a421c,null))['catch'](handleError(_0x2a421c,null));};var interaction_log=require(_0xcd10('0x16'))('chat-interactions');exports[_0xcd10('0x7d')]=function(_0x7b35aa,_0x4d7afc,_0x5745d2){var _0x2bb503={'agent':{},'channel':_0xcd10('0x59')};if(_0x7b35aa[_0xcd10('0x55')]['id']){delete _0x7b35aa[_0xcd10('0x55')]['id'];}_0x7b35aa[_0xcd10('0x55')][_0xcd10('0x5d')]=_0x7b35aa[_0xcd10('0x55')][_0xcd10('0x5d')]||_0x7b35aa[_0xcd10('0x66')]['id'];_0x2bb503[_0xcd10('0x5e')]['id']=_0x7b35aa[_0xcd10('0x55')]['UserId'];return db[_0xcd10('0x39')][_0xcd10('0x53')]({'where':{'id':_0x7b35aa[_0xcd10('0x51')]['id'],'UserId':null}})[_0xcd10('0x23')](handleEntityNotFound(_0x4d7afc,null))['then'](function(_0x272c1e){if(_0x272c1e){_0x2bb503[_0xcd10('0x29')]=_0x272c1e[_0xcd10('0x5f')]({'plain':!![]});return db['ChatInteraction'][_0xcd10('0x53')]({'where':{'id':_0x272c1e[_0xcd10('0x61')]}});}return null;})[_0xcd10('0x23')](handleEntityNotFound(_0x4d7afc,null))[_0xcd10('0x23')](function(_0x9ca8f5){if(_0x9ca8f5){_0x2bb503[_0xcd10('0x63')]=_0x9ca8f5[_0xcd10('0x5f')]({'plain':!![]});interaction_log['info'](_0xcd10('0x7e'),_0x7b35aa[_0xcd10('0x66')]['id'],_0x7b35aa[_0xcd10('0x66')][_0xcd10('0x36')],_0x7b35aa[_0xcd10('0x66')][_0xcd10('0x67')],_0x2bb503[_0xcd10('0x63')]['id'],_0x7b35aa[_0xcd10('0x55')]?JSON[_0xcd10('0x7f')](_0x7b35aa[_0xcd10('0x55')]):_0xcd10('0x80'));return respondWithRpcPromise('RejectMessage',_0xcd10('0x81'),_0x2bb503);}return null;})[_0xcd10('0x23')](function(_0x2d892e){var _0x360040='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d892e[_0xcd10('0x29')]['ContactId'];return db[_0xcd10('0x6c')][_0xcd10('0x3f')](_0x360040,{'type':db[_0xcd10('0x6d')][_0xcd10('0x6e')]['SELECT'],'raw':!![]})[_0xcd10('0x23')](function(_0x33f58b){return _0x33f58b;});})['then'](function(_0x1b7dc1){if(_0x1b7dc1){_0x2bb503[_0xcd10('0x29')][_0xcd10('0x70')]=_0x1b7dc1[0x0];if(!_0x7b35aa[_0xcd10('0x55')]['UserId'])return;return db[_0xcd10('0x71')]['find']({'where':{'id':_0x7b35aa[_0xcd10('0x55')][_0xcd10('0x5d')],'role':'agent'},'attributes':['id',_0xcd10('0x36'),'fullname','email',_0xcd10('0x74')],'raw':!![]});}return null;})['then'](function(_0x170b98){if(!_0x170b98)return null;_0x2bb503[_0xcd10('0x29')]['agent']=_0x170b98;return _0x2bb503;})[_0xcd10('0x23')](function(_0x47c632){if(_0x47c632){_0x47c632['message'][_0xcd10('0x82')]=util['format'](_0xcd10('0x76'),_0x7b35aa[_0xcd10('0x66')][_0xcd10('0x36')]);_0x47c632[_0xcd10('0x29')][_0xcd10('0x77')]=_0x2bb503['channel'];_0x47c632[_0xcd10('0x29')][_0xcd10('0x78')]=_0x2bb503[_0xcd10('0x77')];_0x47c632[_0xcd10('0x29')][_0xcd10('0x79')]=_0xcd10('0x7d');respondWithRpcPromise(_0xcd10('0x7a'),_0xcd10('0x7a'),{'event':_0xcd10('0x83'),'message':_[_0xcd10('0x4c')](_0x2bb503[_0xcd10('0x29')],JSON['parse'](_0x2bb503[_0xcd10('0x63')]['formData']))},client9002);return _0x2bb503;}return null;})[_0xcd10('0x23')](respondWithResult(_0x4d7afc,null))[_0xcd10('0x2b')](handleError(_0x4d7afc,null));};
\ No newline at end of file
+var _0xb844=['interface','channel','motionChannel','event','accept','EventManager','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','contact','email','internal','SIP/%s','reject','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','moment','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','update','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','chat','read','readAt','format','UserId','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','agent','fullname'];(function(_0x432c80,_0x3ec20a){var _0x53b222=function(_0x509214){while(--_0x509214){_0x432c80['push'](_0x432c80['shift']());}};_0x53b222(++_0x3ec20a);}(_0xb844,0x96));var _0x4b84=function(_0x54214f,_0x16cf23){_0x54214f=_0x54214f-0x0;var _0x49224b=_0xb844[_0x54214f];return _0x49224b;};'use strict';var emlformat=require(_0x4b84('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b84('0x1'));var jsonpatch=require(_0x4b84('0x2'));var rp=require('request-promise');var moment=require(_0x4b84('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4b84('0x4'));var util=require('util');var path=require(_0x4b84('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4b84('0x6'));var fs=require('fs');var fs_extra=require(_0x4b84('0x7'));var _=require(_0x4b84('0x8'));var squel=require('squel');var crypto=require(_0x4b84('0x9'));var jsforce=require(_0x4b84('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4b84('0xb'));var querystring=require('querystring');var Papa=require(_0x4b84('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4b84('0xd'));var hardwareService=require(_0x4b84('0xe'));var logger=require(_0x4b84('0xf'))(_0x4b84('0x10'));var utils=require(_0x4b84('0x11'));var config=require(_0x4b84('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b84('0x13'))['db'];config[_0x4b84('0x14')]=_[_0x4b84('0x15')](config[_0x4b84('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4b84('0x16'))[_0x4b84('0x17')](socket);var jayson=require(_0x4b84('0x18'));var client=jayson[_0x4b84('0x19')][_0x4b84('0x1a')]({'port':0x232c});var client9002=jayson[_0x4b84('0x19')][_0x4b84('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4d219f,_0x1c31fa,_0x4e725c,_0x414211){return new BPromise(function(_0x44fe84,_0x361992){var _0x1a2df3=_0x414211||client;return _0x1a2df3[_0x4b84('0x1b')](_0x4d219f,_0x4e725c)[_0x4b84('0x1c')](function(_0x427345){logger[_0x4b84('0x1d')](_0x4b84('0x1e'),_0x1c31fa,'request\x20sent');logger['debug'](_0x4b84('0x1f'),_0x1c31fa,_0x4b84('0x20'),JSON[_0x4b84('0x21')](_0x427345));if(_0x427345['error']){if(_0x427345[_0x4b84('0x22')]['code']===0x1f4){logger[_0x4b84('0x22')](_0x4b84('0x1e'),_0x1c31fa,_0x427345['error'][_0x4b84('0x23')]);return _0x361992(_0x427345[_0x4b84('0x22')][_0x4b84('0x23')]);}logger[_0x4b84('0x22')](_0x4b84('0x1e'),_0x1c31fa,_0x427345['error'][_0x4b84('0x23')]);return _0x44fe84(_0x427345['error'][_0x4b84('0x23')]);}else{logger[_0x4b84('0x1d')](_0x4b84('0x1e'),_0x1c31fa,'request\x20sent');_0x44fe84(_0x427345[_0x4b84('0x24')]['message']);}})['catch'](function(_0x3e5383){logger[_0x4b84('0x22')]('ChatMessage,\x20%s,\x20%s',_0x1c31fa,_0x3e5383);_0x361992(_0x3e5383);});});}function respondWithStatusCode(_0x3c9c0a,_0x26d1ce){_0x26d1ce=_0x26d1ce||0xcc;return function(_0x3d8ce2){if(_0x3d8ce2){return _0x3c9c0a[_0x4b84('0x25')](_0x26d1ce);}return _0x3c9c0a[_0x4b84('0x26')](_0x26d1ce)[_0x4b84('0x27')]();};}function respondWithResult(_0x192a83,_0x1f1c50){_0x1f1c50=_0x1f1c50||0xc8;return function(_0x40bf58){if(_0x40bf58){return _0x192a83['status'](_0x1f1c50)['json'](_0x40bf58);}};}function respondWithFilteredResult(_0x8094b1,_0x2a440f){return function(_0x527707){if(_0x527707){var _0x436c78=typeof _0x2a440f[_0x4b84('0x28')]==='undefined'&&typeof _0x2a440f['limit']===_0x4b84('0x29');var _0x8224bd=_0x527707[_0x4b84('0x2a')];var _0x6e200a=_0x436c78?0x0:_0x2a440f[_0x4b84('0x28')];var _0x3da3dc=_0x436c78?_0x527707['count']:_0x2a440f[_0x4b84('0x28')]+_0x2a440f[_0x4b84('0x2b')];var _0xf1ce76;if(_0x3da3dc>=_0x8224bd){_0x3da3dc=_0x8224bd;_0xf1ce76=0xc8;}else{_0xf1ce76=0xce;}_0x8094b1['status'](_0xf1ce76);return _0x8094b1[_0x4b84('0x2c')](_0x4b84('0x2d'),_0x6e200a+'-'+_0x3da3dc+'/'+_0x8224bd)[_0x4b84('0x2e')](_0x527707);}return null;};}function patchUpdates(_0x1cb7e8){return function(_0x51c892){try{jsonpatch[_0x4b84('0x2f')](_0x51c892,_0x1cb7e8,!![]);}catch(_0x3c7858){return BPromise['reject'](_0x3c7858);}return _0x51c892['save']();};}function saveUpdates(_0x3dafc1,_0x24cf67){return function(_0x167a0c){if(_0x167a0c){return _0x167a0c[_0x4b84('0x30')](_0x3dafc1)[_0x4b84('0x1c')](function(_0x2cb104){return _0x2cb104;});}return null;};}function removeEntity(_0x31bd88,_0xa60820){return function(_0x37f6ca){if(_0x37f6ca){return _0x37f6ca['destroy']()[_0x4b84('0x1c')](function(){_0x31bd88[_0x4b84('0x26')](0xcc)[_0x4b84('0x27')]();});}};}function handleEntityNotFound(_0x1e56b7,_0x2fc643){return function(_0x3e465e){if(!_0x3e465e){_0x1e56b7[_0x4b84('0x25')](0x194);}return _0x3e465e;};}function handleError(_0x5bce3b,_0x3cdfdb){_0x3cdfdb=_0x3cdfdb||0x1f4;return function(_0x6f3d64){logger[_0x4b84('0x22')](_0x6f3d64[_0x4b84('0x31')]);if(_0x6f3d64[_0x4b84('0x32')]){delete _0x6f3d64[_0x4b84('0x32')];}_0x5bce3b['status'](_0x3cdfdb)[_0x4b84('0x33')](_0x6f3d64);};}exports[_0x4b84('0x34')]=function(_0x210fee,_0xbf9c7b){var _0x24aaa6={},_0x717127={},_0x55a399={'count':0x0,'rows':[]};var _0x47ad4a=_[_0x4b84('0x35')](db['ChatMessage'][_0x4b84('0x36')],function(_0x17d41e){return{'name':_0x17d41e[_0x4b84('0x37')],'type':_0x17d41e[_0x4b84('0x38')]['key']};});_0x717127[_0x4b84('0x39')]=_[_0x4b84('0x35')](_0x47ad4a,_0x4b84('0x32'));_0x717127[_0x4b84('0x3a')]=_[_0x4b84('0x3b')](_0x210fee[_0x4b84('0x3a')]);_0x717127[_0x4b84('0x3c')]=_[_0x4b84('0x3d')](_0x717127['model'],_0x717127[_0x4b84('0x3a')]);_0x24aaa6[_0x4b84('0x3e')]=_[_0x4b84('0x3d')](_0x717127[_0x4b84('0x39')],qs[_0x4b84('0x3f')](_0x210fee['query'][_0x4b84('0x3f')]));_0x24aaa6[_0x4b84('0x3e')]=_0x24aaa6[_0x4b84('0x3e')][_0x4b84('0x40')]?_0x24aaa6[_0x4b84('0x3e')]:_0x717127[_0x4b84('0x39')];if(!_0x210fee[_0x4b84('0x3a')][_0x4b84('0x41')](_0x4b84('0x42'))){_0x24aaa6[_0x4b84('0x2b')]=qs[_0x4b84('0x2b')](_0x210fee[_0x4b84('0x3a')][_0x4b84('0x2b')]);_0x24aaa6['offset']=qs[_0x4b84('0x28')](_0x210fee[_0x4b84('0x3a')][_0x4b84('0x28')]);}_0x24aaa6[_0x4b84('0x43')]=qs[_0x4b84('0x44')](_0x210fee['query']['sort']);_0x24aaa6[_0x4b84('0x45')]=qs[_0x4b84('0x3c')](_[_0x4b84('0x46')](_0x210fee['query'],_0x717127[_0x4b84('0x3c')]),_0x47ad4a);if(_0x210fee[_0x4b84('0x3a')][_0x4b84('0x47')]){_0x24aaa6['where']=_[_0x4b84('0x48')](_0x24aaa6[_0x4b84('0x45')],{'$or':_[_0x4b84('0x35')](_0x47ad4a,function(_0x595231){if(_0x595231[_0x4b84('0x38')]!==_0x4b84('0x49')){var _0x20e05a={};_0x20e05a[_0x595231[_0x4b84('0x32')]]={'$like':'%'+_0x210fee[_0x4b84('0x3a')][_0x4b84('0x47')]+'%'};return _0x20e05a;}})});}_0x24aaa6=_[_0x4b84('0x48')]({},_0x24aaa6,_0x210fee[_0x4b84('0x4a')]);var _0x28a359={'where':_0x24aaa6[_0x4b84('0x45')]};return db[_0x4b84('0x4b')][_0x4b84('0x2a')](_0x28a359)['then'](function(_0xe6b0c1){_0x55a399['count']=_0xe6b0c1;if(_0x210fee[_0x4b84('0x3a')][_0x4b84('0x4c')]){_0x24aaa6[_0x4b84('0x4d')]=[{'all':!![]}];}return db[_0x4b84('0x4b')]['findAll'](_0x24aaa6);})[_0x4b84('0x1c')](function(_0x2cb066){_0x55a399[_0x4b84('0x4e')]=_0x2cb066;return _0x55a399;})[_0x4b84('0x1c')](respondWithFilteredResult(_0xbf9c7b,_0x24aaa6))[_0x4b84('0x4f')](handleError(_0xbf9c7b,null));};exports[_0x4b84('0x50')]=function(_0x3006e7,_0x1679a6){var _0x1f1221={'raw':!![],'where':{'id':_0x3006e7[_0x4b84('0x51')]['id']}},_0x11820a={};_0x11820a[_0x4b84('0x39')]=_['keys'](db[_0x4b84('0x4b')][_0x4b84('0x36')]);_0x11820a[_0x4b84('0x3a')]=_['keys'](_0x3006e7[_0x4b84('0x3a')]);_0x11820a[_0x4b84('0x3c')]=_[_0x4b84('0x3d')](_0x11820a[_0x4b84('0x39')],_0x11820a[_0x4b84('0x3a')]);_0x1f1221[_0x4b84('0x3e')]=_[_0x4b84('0x3d')](_0x11820a[_0x4b84('0x39')],qs[_0x4b84('0x3f')](_0x3006e7['query'][_0x4b84('0x3f')]));_0x1f1221['attributes']=_0x1f1221[_0x4b84('0x3e')]['length']?_0x1f1221[_0x4b84('0x3e')]:_0x11820a[_0x4b84('0x39')];if(_0x3006e7[_0x4b84('0x3a')][_0x4b84('0x4c')]){_0x1f1221[_0x4b84('0x4d')]=[{'all':!![]}];}_0x1f1221=_[_0x4b84('0x48')]({},_0x1f1221,_0x3006e7[_0x4b84('0x4a')]);return db[_0x4b84('0x4b')][_0x4b84('0x52')](_0x1f1221)[_0x4b84('0x1c')](handleEntityNotFound(_0x1679a6,null))[_0x4b84('0x1c')](respondWithResult(_0x1679a6,null))['catch'](handleError(_0x1679a6,null));};exports[_0x4b84('0x53')]=function(_0x386b90,_0x33f0f1){return db[_0x4b84('0x4b')][_0x4b84('0x53')](_0x386b90[_0x4b84('0x54')],{})['then'](respondWithResult(_0x33f0f1,0xc9))[_0x4b84('0x4f')](handleError(_0x33f0f1,null));};exports[_0x4b84('0x30')]=function(_0x15aee2,_0x39efdd){if(_0x15aee2['body']['id']){delete _0x15aee2[_0x4b84('0x54')]['id'];}return db[_0x4b84('0x4b')][_0x4b84('0x52')]({'where':{'id':_0x15aee2['params']['id']}})['then'](handleEntityNotFound(_0x39efdd,null))[_0x4b84('0x1c')](saveUpdates(_0x15aee2[_0x4b84('0x54')],null))[_0x4b84('0x1c')](respondWithResult(_0x39efdd,null))[_0x4b84('0x4f')](handleError(_0x39efdd,null));};exports[_0x4b84('0x55')]=function(_0x86bb0e,_0x55a97a){return db[_0x4b84('0x4b')][_0x4b84('0x52')]({'where':{'id':_0x86bb0e[_0x4b84('0x51')]['id']}})[_0x4b84('0x1c')](handleEntityNotFound(_0x55a97a,null))[_0x4b84('0x1c')](removeEntity(_0x55a97a,null))[_0x4b84('0x4f')](handleError(_0x55a97a,null));};exports[_0x4b84('0x56')]=function(_0x4692d7,_0xf10a9){return db[_0x4b84('0x4b')]['describe']()[_0x4b84('0x1c')](respondWithResult(_0xf10a9,null))[_0x4b84('0x4f')](handleError(_0xf10a9,null));};var interaction_log=require(_0x4b84('0xf'))('chat-interactions');exports['accept']=function(_0x3391b3,_0x51234a,_0x3c169c){var _0x3a084f={'agent':{},'channel':_0x4b84('0x57')};if(_0x3391b3[_0x4b84('0x54')]['id']){delete _0x3391b3[_0x4b84('0x54')]['id'];}_0x3391b3[_0x4b84('0x54')][_0x4b84('0x58')]=!![];_0x3391b3[_0x4b84('0x54')][_0x4b84('0x59')]=moment()[_0x4b84('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x3391b3[_0x4b84('0x54')][_0x4b84('0x5b')]=_0x3391b3[_0x4b84('0x54')][_0x4b84('0x5b')]||_0x3391b3['user']['id'];_0x3a084f['agent']['id']=_0x3391b3[_0x4b84('0x54')][_0x4b84('0x5b')];return db[_0x4b84('0x4b')][_0x4b84('0x52')]({'where':{'id':_0x3391b3['params']['id'],'UserId':null}})[_0x4b84('0x1c')](handleEntityNotFound(_0x51234a,null))['then'](saveUpdates(_0x3391b3[_0x4b84('0x54')],null))[_0x4b84('0x1c')](function(_0x275439){if(_0x275439){_0x3a084f[_0x4b84('0x23')]=_0x275439[_0x4b84('0x5c')]({'plain':!![]});return db[_0x4b84('0x5d')][_0x4b84('0x52')]({'where':{'id':_0x275439[_0x4b84('0x5e')]}});}return null;})[_0x4b84('0x1c')](handleEntityNotFound(_0x51234a,null))[_0x4b84('0x1c')](function(_0x34a480){if(_0x34a480){return _0x34a480[_0x4b84('0x30')]({'UserId':_0x3391b3[_0x4b84('0x54')][_0x4b84('0x5b')],'read1stAt':_[_0x4b84('0x5f')](_0x34a480[_0x4b84('0x60')])?moment()[_0x4b84('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x333f1b){if(_0x333f1b){_0x3a084f[_0x4b84('0x61')]=_0x333f1b[_0x4b84('0x5c')]({'plain':!![]});interaction_log[_0x4b84('0x1d')](_0x4b84('0x62'),_0x3391b3[_0x4b84('0x63')]['id'],_0x3391b3[_0x4b84('0x63')][_0x4b84('0x32')],_0x3391b3['user'][_0x4b84('0x64')],_0x3a084f[_0x4b84('0x61')]['id'],_0x3391b3[_0x4b84('0x54')]?JSON[_0x4b84('0x21')](_0x3391b3[_0x4b84('0x54')]):_0x4b84('0x65'));return respondWithRpcPromise(_0x4b84('0x66'),_0x4b84('0x67'),_0x3a084f);}return null;})[_0x4b84('0x1c')](function(_0x3e553e){var _0x55c6cb=_0x4b84('0x68')+_0x3e553e[_0x4b84('0x23')][_0x4b84('0x69')];return db['sequelize']['query'](_0x55c6cb,{'type':db[_0x4b84('0x6a')][_0x4b84('0x6b')][_0x4b84('0x6c')],'raw':!![]})[_0x4b84('0x1c')](function(_0x8d01f0){return _0x8d01f0;});})[_0x4b84('0x1c')](function(_0x2168ba){if(_0x2168ba){_0x3a084f[_0x4b84('0x23')]['contact']=_0x2168ba[0x0];if(!_0x3391b3[_0x4b84('0x54')][_0x4b84('0x5b')])return;return db[_0x4b84('0x6d')][_0x4b84('0x52')]({'where':{'id':_0x3391b3[_0x4b84('0x54')][_0x4b84('0x5b')],'role':_0x4b84('0x6e')},'attributes':['id',_0x4b84('0x32'),_0x4b84('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0x4b84('0x1c')](function(_0x5a159b){if(!_0x5a159b)return null;_0x3a084f[_0x4b84('0x23')][_0x4b84('0x6e')]=_0x5a159b;return _0x3a084f;})[_0x4b84('0x1c')](function(_0x47b5a4){if(_0x47b5a4){if(_0x3391b3[_0x4b84('0x54')]['manual']){_0x3a084f[_0x4b84('0x23')][_0x4b84('0x70')]=util[_0x4b84('0x5a')]('SIP/%s',_0x3391b3[_0x4b84('0x63')][_0x4b84('0x32')]);_0x3a084f[_0x4b84('0x23')][_0x4b84('0x71')]=_0x3a084f[_0x4b84('0x71')];_0x3a084f[_0x4b84('0x23')][_0x4b84('0x72')]=_0x3a084f[_0x4b84('0x71')];_0x3a084f['message'][_0x4b84('0x73')]=_0x4b84('0x74');return respondWithRpcPromise(_0x4b84('0x75'),_0x4b84('0x75'),{'event':'acceptmessage','message':_[_0x4b84('0x48')](_0x3a084f[_0x4b84('0x23')],JSON['parse'](_0x3a084f[_0x4b84('0x61')][_0x4b84('0x76')]))},client9002)['then'](function(){return _0x3a084f;});}return _0x3a084f;}return null;})['then'](respondWithResult(_0x51234a,null))[_0x4b84('0x4f')](handleError(_0x51234a,null));};var interaction_log=require('../../config/logger')(_0x4b84('0x77'));exports['reject']=function(_0x115492,_0x3343dd,_0x5848b2){var _0x48bfef={'agent':{},'channel':_0x4b84('0x57')};if(_0x115492[_0x4b84('0x54')]['id']){delete _0x115492['body']['id'];}_0x115492[_0x4b84('0x54')][_0x4b84('0x5b')]=_0x115492[_0x4b84('0x54')][_0x4b84('0x5b')]||_0x115492[_0x4b84('0x63')]['id'];_0x48bfef[_0x4b84('0x6e')]['id']=_0x115492[_0x4b84('0x54')][_0x4b84('0x5b')];return db['ChatMessage']['find']({'where':{'id':_0x115492[_0x4b84('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3343dd,null))[_0x4b84('0x1c')](function(_0x10aaa4){if(_0x10aaa4){_0x48bfef[_0x4b84('0x23')]=_0x10aaa4[_0x4b84('0x5c')]({'plain':!![]});return db['ChatInteraction'][_0x4b84('0x52')]({'where':{'id':_0x10aaa4[_0x4b84('0x5e')]}});}return null;})[_0x4b84('0x1c')](handleEntityNotFound(_0x3343dd,null))[_0x4b84('0x1c')](function(_0x20e91f){if(_0x20e91f){_0x48bfef['interaction']=_0x20e91f['get']({'plain':!![]});interaction_log['info'](_0x4b84('0x78'),_0x115492[_0x4b84('0x63')]['id'],_0x115492[_0x4b84('0x63')][_0x4b84('0x32')],_0x115492['user'][_0x4b84('0x64')],_0x48bfef['interaction']['id'],_0x115492[_0x4b84('0x54')]?JSON[_0x4b84('0x21')](_0x115492[_0x4b84('0x54')]):_0x4b84('0x65'));return respondWithRpcPromise(_0x4b84('0x79'),_0x4b84('0x7a'),_0x48bfef);}return null;})['then'](function(_0x24e866){var _0x52b085=_0x4b84('0x68')+_0x24e866[_0x4b84('0x23')][_0x4b84('0x69')];return db[_0x4b84('0x7b')]['query'](_0x52b085,{'type':db[_0x4b84('0x6a')][_0x4b84('0x6b')][_0x4b84('0x6c')],'raw':!![]})[_0x4b84('0x1c')](function(_0x5ad53d){return _0x5ad53d;});})[_0x4b84('0x1c')](function(_0x382448){if(_0x382448){_0x48bfef[_0x4b84('0x23')][_0x4b84('0x7c')]=_0x382448[0x0];if(!_0x115492[_0x4b84('0x54')][_0x4b84('0x5b')])return;return db['User'][_0x4b84('0x52')]({'where':{'id':_0x115492['body'][_0x4b84('0x5b')],'role':_0x4b84('0x6e')},'attributes':['id','name',_0x4b84('0x6f'),_0x4b84('0x7d'),_0x4b84('0x7e')],'raw':!![]});}return null;})['then'](function(_0x4d701b){if(!_0x4d701b)return null;_0x48bfef[_0x4b84('0x23')]['agent']=_0x4d701b;return _0x48bfef;})[_0x4b84('0x1c')](function(_0x82b99d){if(_0x82b99d){_0x82b99d[_0x4b84('0x23')][_0x4b84('0x70')]=util[_0x4b84('0x5a')](_0x4b84('0x7f'),_0x115492[_0x4b84('0x63')][_0x4b84('0x32')]);_0x82b99d[_0x4b84('0x23')][_0x4b84('0x71')]=_0x48bfef['channel'];_0x82b99d['message'][_0x4b84('0x72')]=_0x48bfef[_0x4b84('0x71')];_0x82b99d[_0x4b84('0x23')][_0x4b84('0x73')]=_0x4b84('0x80');respondWithRpcPromise(_0x4b84('0x75'),_0x4b84('0x75'),{'event':_0x4b84('0x81'),'message':_[_0x4b84('0x48')](_0x48bfef[_0x4b84('0x23')],JSON[_0x4b84('0x82')](_0x48bfef['interaction'][_0x4b84('0x76')]))},client9002);return _0x48bfef;}return null;})[_0x4b84('0x1c')](respondWithResult(_0x3343dd,null))['catch'](handleError(_0x3343dd,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index cb4d61c..c4b60a1 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 _0xc015=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x266c53,_0xbb0bad){var _0x30ae9a=function(_0x231a5e){while(--_0x231a5e){_0x266c53['push'](_0x266c53['shift']());}};_0x30ae9a(++_0xbb0bad);}(_0xc015,0x1d0));var _0x5c01=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0xc015[_0x1c8cc6];return _0x522936;};'use strict';var EventEmitter=require(_0x5c01('0x0'));var ChatMessage=require(_0x5c01('0x1'))['db'][_0x5c01('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5c01('0x3')](0x0);var events={'afterCreate':_0x5c01('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b271a){return function(_0x336eb6,_0x5dff85,_0x571917){ChatMessageEvents['emit'](_0x5b271a+':'+_0x336eb6['id'],_0x336eb6);ChatMessageEvents[_0x5c01('0x5')](_0x5b271a,_0x336eb6);_0x571917(null);};}for(var e in events){if(events[_0x5c01('0x6')](e)){var event=events[e];ChatMessage[_0x5c01('0x7')](e,emitEvent(event));}}module[_0x5c01('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x9f84=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x9f84,0x137));var _0x49f8=function(_0x5232bb,_0x4fcb6c){_0x5232bb=_0x5232bb-0x0;var _0x2ba6d1=_0x9f84[_0x5232bb];return _0x2ba6d1;};'use strict';var EventEmitter=require(_0x49f8('0x0'));var ChatMessage=require(_0x49f8('0x1'))['db'][_0x49f8('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x49f8('0x3')](0x0);var events={'afterCreate':_0x49f8('0x4'),'afterUpdate':_0x49f8('0x5'),'afterDestroy':_0x49f8('0x6')};function emitEvent(_0x3331af){return function(_0x4bf036,_0x68141,_0x5b85ca){ChatMessageEvents[_0x49f8('0x7')](_0x3331af+':'+_0x4bf036['id'],_0x4bf036);ChatMessageEvents['emit'](_0x3331af,_0x4bf036);_0x5b85ca(null);};}for(var e in events){if(events[_0x49f8('0x8')](e)){var event=events[e];ChatMessage[_0x49f8('0x9')](e,emitEvent(event));}}module[_0x49f8('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 26d3643..b1c627e 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 _0x139c=['chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatMessage.attributes','define'];(function(_0x17bdb5,_0x3269b8){var _0x429b17=function(_0x13be8e){while(--_0x13be8e){_0x17bdb5['push'](_0x17bdb5['shift']());}};_0x429b17(++_0x3269b8);}(_0x139c,0xf2));var _0xc139=function(_0xbd9949,_0x1482b9){_0xbd9949=_0xbd9949-0x0;var _0x2588dd=_0x139c[_0xbd9949];return _0x2588dd;};'use strict';var _=require(_0xc139('0x0'));var util=require(_0xc139('0x1'));var logger=require(_0xc139('0x2'))(_0xc139('0x3'));var moment=require(_0xc139('0x4'));var BPromise=require('bluebird');var rp=require(_0xc139('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc139('0x6'));var config=require(_0xc139('0x7'));var attributes=require(_0xc139('0x8'));module['exports']=function(_0x3face6,_0x1c452f){return _0x3face6[_0xc139('0x9')]('ChatMessage',attributes,{'tableName':_0xc139('0xa'),'paranoid':![],'indexes':[{'name':_0xc139('0xb'),'fields':[_0xc139('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e3157,_0x2c5bdd,_0x48ed08){var _0x4c47c6=_0x3face6[_0xc139('0xd')];var _0x3d8585=_0x1e3157[_0xc139('0xe')]({'plain':!![]});if(_0x3d8585[_0xc139('0xf')][_0xc139('0x10')]()==='in'||_0x3d8585[_0xc139('0xf')][_0xc139('0x10')]()==='out'&&!_0x3d8585[_0xc139('0x11')]&&!_[_0xc139('0x12')](_0x3d8585[_0xc139('0x13')])){_0x4c47c6[_0xc139('0x14')]['findOne']({'where':{'id':_0x3d8585['ChatInteractionId']}})[_0xc139('0x15')](function(_0x32d823){if(_0x32d823){_0x32d823[_0xc139('0x16')]({'lastMsgAt':_0x3d8585[_0xc139('0x17')],'lastMsgDirection':_0x3d8585['direction']['toLowerCase']()});}})[_0xc139('0x18')](function(_0x563531){console[_0xc139('0x19')](_0x563531);});}_0x48ed08();}},'charset':_0xc139('0x1a'),'collate':_0xc139('0x1b')});};
\ No newline at end of file
+var _0x1437=['./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x1437,0xbd));var _0x7143=function(_0x4f52bc,_0x3854d9){_0x4f52bc=_0x4f52bc-0x0;var _0x1ed73c=_0x1437[_0x4f52bc];return _0x1ed73c;};'use strict';var _=require(_0x7143('0x0'));var util=require(_0x7143('0x1'));var logger=require(_0x7143('0x2'))('api');var moment=require(_0x7143('0x3'));var BPromise=require('bluebird');var rp=require(_0x7143('0x4'));var fs=require('fs');var path=require(_0x7143('0x5'));var rimraf=require(_0x7143('0x6'));var config=require('../../config/environment');var attributes=require(_0x7143('0x7'));module[_0x7143('0x8')]=function(_0x564472,_0x4452fc){return _0x564472[_0x7143('0x9')](_0x7143('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x7143('0xb'),'fields':['body'],'type':_0x7143('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc9270f,_0x2cc672,_0x238f60){var _0x160420=_0x564472[_0x7143('0xd')];var _0x26ffc9=_0xc9270f[_0x7143('0xe')]({'plain':!![]});if(_0x26ffc9[_0x7143('0xf')][_0x7143('0x10')]()==='in'||_0x26ffc9[_0x7143('0xf')]['toLowerCase']()===_0x7143('0x11')&&!_0x26ffc9[_0x7143('0x12')]&&!_[_0x7143('0x13')](_0x26ffc9['UserId'])){_0x160420[_0x7143('0x14')][_0x7143('0x15')]({'where':{'id':_0x26ffc9['ChatInteractionId']}})[_0x7143('0x16')](function(_0x1ba684){if(_0x1ba684){_0x1ba684[_0x7143('0x17')]({'lastMsgAt':_0x26ffc9[_0x7143('0x18')],'lastMsgDirection':_0x26ffc9['direction']['toLowerCase']()});}})[_0x7143('0x19')](function(_0x241644){console['error'](_0x241644);});}_0x238f60();}},'charset':_0x7143('0x1a'),'collate':_0x7143('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 9ed9949..0afa013 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 _0xf2d0=['body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','request','then','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','ChatMessage,\x20%s,\x20%s','catch','CreateChatMessage','ChatMessage','create'];(function(_0x41712e,_0xe37424){var _0x4218e6=function(_0x2fda95){while(--_0x2fda95){_0x41712e['push'](_0x41712e['shift']());}};_0x4218e6(++_0xe37424);}(_0xf2d0,0x104));var _0x0f2d=function(_0x9fa71a,_0xc54cfd){_0x9fa71a=_0x9fa71a-0x0;var _0x4b2e72=_0xf2d0[_0x9fa71a];return _0x4b2e72;};'use strict';var _=require(_0x0f2d('0x0'));var util=require(_0x0f2d('0x1'));var moment=require(_0x0f2d('0x2'));var BPromise=require(_0x0f2d('0x3'));var rs=require(_0x0f2d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f2d('0x5'))['db'];var utils=require(_0x0f2d('0x6'));var logger=require(_0x0f2d('0x7'))(_0x0f2d('0x8'));var config=require('../../config/environment');var jayson=require(_0x0f2d('0x9'));var client=jayson[_0x0f2d('0xa')][_0x0f2d('0xb')]({'port':0x232a});config[_0x0f2d('0xc')]=_['defaults'](config[_0x0f2d('0xc')],{'host':_0x0f2d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f2d('0xc')]));require('./chatMessage.socket')[_0x0f2d('0xe')](socket);function respondWithRpcPromise(_0x5424de,_0x110468,_0x2d8ee9){return new BPromise(function(_0xdf45bf,_0x2bf24e){return client[_0x0f2d('0xf')](_0x5424de,_0x2d8ee9)[_0x0f2d('0x10')](function(_0x15e3c2){logger['info']('ChatMessage,\x20%s,\x20%s',_0x110468,_0x0f2d('0x11'));logger['debug'](_0x0f2d('0x12'),_0x110468,_0x0f2d('0x11'),JSON['stringify'](_0x15e3c2));if(_0x15e3c2['error']){if(_0x15e3c2[_0x0f2d('0x13')][_0x0f2d('0x14')]===0x1f4){logger[_0x0f2d('0x13')]('ChatMessage,\x20%s,\x20%s',_0x110468,_0x15e3c2[_0x0f2d('0x13')]['message']);return _0x2bf24e(_0x15e3c2['error'][_0x0f2d('0x15')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x110468,_0x15e3c2['error']['message']);return _0xdf45bf(_0x15e3c2[_0x0f2d('0x13')][_0x0f2d('0x15')]);}else{logger[_0x0f2d('0x16')](_0x0f2d('0x17'),_0x110468,_0x0f2d('0x11'));_0xdf45bf(_0x15e3c2['result'][_0x0f2d('0x15')]);}})[_0x0f2d('0x18')](function(_0x595607){logger[_0x0f2d('0x13')](_0x0f2d('0x17'),_0x110468,_0x595607);_0x2bf24e(_0x595607);});});}exports[_0x0f2d('0x19')]=function(_0x207bfa){var _0x4a799f=this;return new Promise(function(_0x53cadc,_0x163c6f){return db[_0x0f2d('0x1a')][_0x0f2d('0x1b')](_0x207bfa[_0x0f2d('0x1c')],{'raw':_0x207bfa[_0x0f2d('0x1d')]?_0x207bfa[_0x0f2d('0x1d')][_0x0f2d('0x1e')]===undefined?!![]:![]:!![]})[_0x0f2d('0x10')](function(_0x5463c8){logger[_0x0f2d('0x16')](_0x0f2d('0x19'),_0x207bfa);logger['debug'](_0x0f2d('0x19'),_0x207bfa,JSON[_0x0f2d('0x1f')](_0x5463c8));_0x53cadc(_0x5463c8);})[_0x0f2d('0x18')](function(_0x3a8264){logger[_0x0f2d('0x13')]('CreateChatMessage',_0x3a8264['message'],_0x207bfa);_0x163c6f(_0x4a799f[_0x0f2d('0x13')](0x1f4,_0x3a8264[_0x0f2d('0x15')]));});});};
\ No newline at end of file
+var _0xbd0e=['localhost','socket.io-emitter','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x343065,_0x169907){var _0x1d208b=function(_0x5fd86a){while(--_0x5fd86a){_0x343065['push'](_0x343065['shift']());}};_0x1d208b(++_0x169907);}(_0xbd0e,0x187));var _0xebd0=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xbd0e[_0x377a6e];return _0x37f751;};'use strict';var _=require('lodash');var util=require(_0xebd0('0x0'));var moment=require('moment');var BPromise=require(_0xebd0('0x1'));var rs=require(_0xebd0('0x2'));var fs=require('fs');var Redis=require(_0xebd0('0x3'));var db=require(_0xebd0('0x4'))['db'];var utils=require(_0xebd0('0x5'));var logger=require(_0xebd0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xebd0('0x7'));var client=jayson[_0xebd0('0x8')][_0xebd0('0x9')]({'port':0x232a});config[_0xebd0('0xa')]=_[_0xebd0('0xb')](config[_0xebd0('0xa')],{'host':_0xebd0('0xc'),'port':0x18eb});var socket=require(_0xebd0('0xd'))(new Redis(config[_0xebd0('0xa')]));require('./chatMessage.socket')[_0xebd0('0xe')](socket);function respondWithRpcPromise(_0x474bef,_0x2dbee9,_0x54b2a1){return new BPromise(function(_0xbec226,_0x1346d1){return client['request'](_0x474bef,_0x54b2a1)['then'](function(_0xb15b3e){logger[_0xebd0('0xf')](_0xebd0('0x10'),_0x2dbee9,_0xebd0('0x11'));logger[_0xebd0('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2dbee9,_0xebd0('0x11'),JSON[_0xebd0('0x13')](_0xb15b3e));if(_0xb15b3e[_0xebd0('0x14')]){if(_0xb15b3e['error'][_0xebd0('0x15')]===0x1f4){logger[_0xebd0('0x14')](_0xebd0('0x10'),_0x2dbee9,_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);return _0x1346d1(_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);}logger[_0xebd0('0x14')](_0xebd0('0x10'),_0x2dbee9,_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);return _0xbec226(_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);}else{logger[_0xebd0('0xf')](_0xebd0('0x10'),_0x2dbee9,'request\x20sent');_0xbec226(_0xb15b3e[_0xebd0('0x17')][_0xebd0('0x16')]);}})[_0xebd0('0x18')](function(_0x2834ad){logger['error'](_0xebd0('0x10'),_0x2dbee9,_0x2834ad);_0x1346d1(_0x2834ad);});});}exports[_0xebd0('0x19')]=function(_0x51774c){var _0x22bb7f=this;return new Promise(function(_0x4ef17f,_0x4720d5){return db[_0xebd0('0x1a')][_0xebd0('0x1b')](_0x51774c[_0xebd0('0x1c')],{'raw':_0x51774c['options']?_0x51774c[_0xebd0('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xebd0('0x1e')](function(_0x2d2639){logger[_0xebd0('0xf')]('CreateChatMessage',_0x51774c);logger[_0xebd0('0x12')](_0xebd0('0x19'),_0x51774c,JSON[_0xebd0('0x13')](_0x2d2639));_0x4ef17f(_0x2d2639);})['catch'](function(_0x3f08a8){logger[_0xebd0('0x14')](_0xebd0('0x19'),_0x3f08a8[_0xebd0('0x16')],_0x51774c);_0x4720d5(_0x22bb7f['error'](0x1f4,_0x3f08a8['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 447d121..33226fc 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 _0xe0c3=['removeListener','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0x3e0c('0x0'));var events=['save',_0x3e0c('0x1'),_0x3e0c('0x2')];function createListener(_0x3bb243,_0x41c0bf){return function(_0x27e01a){_0x41c0bf[_0x3e0c('0x3')](_0x3bb243,_0x27e01a);};}function removeListener(_0x31851c,_0x26c964){return function(){ChatMessageEvents[_0x3e0c('0x4')](_0x31851c,_0x26c964);};}exports['register']=function(_0x530ebf){for(var _0x163adf=0x0,_0x1e339a=events[_0x3e0c('0x5')];_0x163adf<_0x1e339a;_0x163adf++){var _0x243b5b=events[_0x163adf];var _0x29673d=createListener(_0x3e0c('0x6')+_0x243b5b,_0x530ebf);ChatMessageEvents['on'](_0x243b5b,_0x29673d);}};
\ No newline at end of file
+var _0x4300=['length','chatMessage:','./chatMessage.events','emit','register'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x4300,0x1a6));var _0x0430=function(_0x4baf9a,_0x5e9544){_0x4baf9a=_0x4baf9a-0x0;var _0xd18049=_0x4300[_0x4baf9a];return _0xd18049;};'use strict';var ChatMessageEvents=require(_0x0430('0x0'));var events=['save','remove','update'];function createListener(_0x54a4da,_0x4388ad){return function(_0x1d10be){_0x4388ad[_0x0430('0x1')](_0x54a4da,_0x1d10be);};}function removeListener(_0x2a1e62,_0x1735aa){return function(){ChatMessageEvents['removeListener'](_0x2a1e62,_0x1735aa);};}exports[_0x0430('0x2')]=function(_0x5943c0){for(var _0x16efe3=0x0,_0x5b03ef=events[_0x0430('0x3')];_0x16efe3<_0x5b03ef;_0x16efe3++){var _0xc83312=events[_0x16efe3];var _0x408b14=createListener(_0x0430('0x4')+_0xc83312,_0x5943c0);ChatMessageEvents['on'](_0xc83312,_0x408b14);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c26fb4d..7dced23 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 _0x5f0e=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','show','post','isAuthenticated','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','/:id','exports','util'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x5f0e,0x11f));var _0xe5f0=function(_0x17108e,_0x107c35){_0x17108e=_0x17108e-0x0;var _0x4137fd=_0x5f0e[_0x17108e];return _0x4137fd;};'use strict';var multer=require('multer');var util=require(_0xe5f0('0x0'));var path=require(_0xe5f0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe5f0('0x2'));var router=express[_0xe5f0('0x3')]();var fs_extra=require(_0xe5f0('0x4'));var auth=require(_0xe5f0('0x5'));var interaction=require(_0xe5f0('0x6'));var config=require(_0xe5f0('0x7'));var controller=require(_0xe5f0('0x8'));router[_0xe5f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe5f0('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe5f0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe5f0('0xa')]);router[_0xe5f0('0xb')]('/',auth[_0xe5f0('0xc')](),interaction[_0xe5f0('0xd')](_0xe5f0('0xe'),'chatmessage:create'),controller[_0xe5f0('0xf')]);router[_0xe5f0('0x10')]('/:id',controller[_0xe5f0('0x11')]);router[_0xe5f0('0x10')](_0xe5f0('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0xe5f0('0x10')](_0xe5f0('0x13'),auth[_0xe5f0('0xc')](),controller[_0xe5f0('0x14')]);router[_0xe5f0('0x15')](_0xe5f0('0x16'),auth[_0xe5f0('0xc')](),controller['destroy']);module[_0xe5f0('0x17')]=router;
\ No newline at end of file
+var _0x604b=['/describe','describe','show','post','chat','chatmessage:create','create','/:id','update','put','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x3da9d2,_0x30dbac){var _0x29c883=function(_0x4912a5){while(--_0x4912a5){_0x3da9d2['push'](_0x3da9d2['shift']());}};_0x29c883(++_0x30dbac);}(_0x604b,0xd7));var _0xb604=function(_0x37b3aa,_0x46ae34){_0x37b3aa=_0x37b3aa-0x0;var _0x1a0213=_0x604b[_0x37b3aa];return _0x1a0213;};'use strict';var multer=require(_0xb604('0x0'));var util=require(_0xb604('0x1'));var path=require(_0xb604('0x2'));var timeout=require(_0xb604('0x3'));var express=require(_0xb604('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb604('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb604('0x6'));router[_0xb604('0x7')]('/',auth[_0xb604('0x8')](),controller[_0xb604('0x9')]);router[_0xb604('0x7')](_0xb604('0xa'),auth[_0xb604('0x8')](),controller[_0xb604('0xb')]);router['get']('/:id',auth[_0xb604('0x8')](),controller[_0xb604('0xc')]);router[_0xb604('0xd')]('/',auth[_0xb604('0x8')](),interaction['tracked'](_0xb604('0xe'),_0xb604('0xf')),controller[_0xb604('0x10')]);router['put'](_0xb604('0x11'),controller[_0xb604('0x12')]);router[_0xb604('0x13')]('/:id/accept',auth[_0xb604('0x8')](),controller[_0xb604('0x14')]);router[_0xb604('0x13')](_0xb604('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0xb604('0x16')]('/:id',auth[_0xb604('0x8')](),controller[_0xb604('0x17')]);module[_0xb604('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 868babe..b1401ff 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 _0x3075=['medium','exports','TEXT'];(function(_0x541696,_0x1ce78f){var _0x20886f=function(_0x350f62){while(--_0x350f62){_0x541696['push'](_0x541696['shift']());}};_0x20886f(++_0x1ce78f);}(_0x3075,0xc1));var _0x5307=function(_0x7a10a,_0x4aff91){_0x7a10a=_0x7a10a-0x0;var _0xf3b068=_0x3075[_0x7a10a];return _0xf3b068;};'use strict';var Sequelize=require('sequelize');module[_0x5307('0x0')]={'body':{'type':Sequelize[_0x5307('0x1')](_0x5307('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5e56=['sequelize','exports'];(function(_0x577df8,_0x17c569){var _0x382059=function(_0x5b87f4){while(--_0x5b87f4){_0x577df8['push'](_0x577df8['shift']());}};_0x382059(++_0x17c569);}(_0x5e56,0x8e));var _0x65e5=function(_0x1370dd,_0x4b2eef){_0x1370dd=_0x1370dd-0x0;var _0x1623ab=_0x5e56[_0x1370dd];return _0x1623ab;};'use strict';var Sequelize=require(_0x65e5('0x0'));module[_0x65e5('0x1')]={'body':{'type':Sequelize['TEXT']('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 30a47d6..b973d7f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x252f34,_0xde255c){var _0x463bf9=function(_0x1f2320){while(--_0x1f2320){_0x252f34['push'](_0x252f34['shift']());}};_0x463bf9(++_0xde255c);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xccf736,_0x2ac11b){var _0x58535b=function(_0xa28470){while(--_0xa28470){_0xccf736['push'](_0xccf736['shift']());}};_0x58535b(++_0x2ac11b);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index e14777b..cd9ce92 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 _0x6ec8=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x6ec8,0x13c));var _0x86ec=function(_0x46ab1c,_0x46e561){_0x46ab1c=_0x46ab1c-0x0;var _0x3fb929=_0x6ec8[_0x46ab1c];return _0x3fb929;};'use strict';var _=require(_0x86ec('0x0'));var util=require('util');var logger=require(_0x86ec('0x1'))(_0x86ec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86ec('0x3'));var fs=require('fs');var path=require(_0x86ec('0x4'));var rimraf=require('rimraf');var config=require(_0x86ec('0x5'));var attributes=require(_0x86ec('0x6'));module[_0x86ec('0x7')]=function(_0x19636f,_0x12019a){return _0x19636f[_0x86ec('0x8')](_0x86ec('0x9'),attributes,{'tableName':_0x86ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x86ec('0xb')});};
\ No newline at end of file
+var _0x032c=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x032c,0xc6));var _0xc032=function(_0x4e3ee7,_0x3c3838){_0x4e3ee7=_0x4e3ee7-0x0;var _0x406876=_0x032c[_0x4e3ee7];return _0x406876;};'use strict';var _=require(_0xc032('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc032('0x1'));var moment=require(_0xc032('0x2'));var BPromise=require('bluebird');var rp=require(_0xc032('0x3'));var fs=require('fs');var path=require(_0xc032('0x4'));var rimraf=require(_0xc032('0x5'));var config=require(_0xc032('0x6'));var attributes=require(_0xc032('0x7'));module[_0xc032('0x8')]=function(_0x2d6173,_0x2cf821){return _0x2d6173[_0xc032('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0xc032('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc032('0xb'),'collate':_0xc032('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index dc7cf79..5b813bb 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 _0x6dac=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6dac,0x16e));var _0xc6da=function(_0x2f50a5,_0x484391){_0x2f50a5=_0x2f50a5-0x0;var _0x44d716=_0x6dac[_0x2f50a5];return _0x44d716;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var moment=require(_0xc6da('0x2'));var BPromise=require(_0xc6da('0x3'));var rs=require(_0xc6da('0x4'));var fs=require('fs');var Redis=require(_0xc6da('0x5'));var db=require(_0xc6da('0x6'))['db'];var utils=require(_0xc6da('0x7'));var logger=require(_0xc6da('0x8'))(_0xc6da('0x9'));var config=require(_0xc6da('0xa'));var jayson=require(_0xc6da('0xb'));var client=jayson[_0xc6da('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ebd11,_0x1abd90,_0x5a0d8d){return new BPromise(function(_0x3047d3,_0x2bfaa6){return client[_0xc6da('0xd')](_0x1ebd11,_0x5a0d8d)[_0xc6da('0xe')](function(_0x39a8d8){logger[_0xc6da('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1abd90,_0xc6da('0x10'));logger[_0xc6da('0x11')](_0xc6da('0x12'),_0x1abd90,_0xc6da('0x10'),JSON[_0xc6da('0x13')](_0x39a8d8));if(_0x39a8d8[_0xc6da('0x14')]){if(_0x39a8d8[_0xc6da('0x14')][_0xc6da('0x15')]===0x1f4){logger[_0xc6da('0x14')](_0xc6da('0x16'),_0x1abd90,_0x39a8d8[_0xc6da('0x14')][_0xc6da('0x17')]);return _0x2bfaa6(_0x39a8d8[_0xc6da('0x14')]['message']);}logger[_0xc6da('0x14')](_0xc6da('0x16'),_0x1abd90,_0x39a8d8[_0xc6da('0x14')][_0xc6da('0x17')]);return _0x3047d3(_0x39a8d8[_0xc6da('0x14')][_0xc6da('0x17')]);}else{logger['info'](_0xc6da('0x16'),_0x1abd90,_0xc6da('0x10'));_0x3047d3(_0x39a8d8[_0xc6da('0x18')][_0xc6da('0x17')]);}})[_0xc6da('0x19')](function(_0x5463a1){logger[_0xc6da('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1abd90,_0x5463a1);_0x2bfaa6(_0x5463a1);});});}
\ No newline at end of file
+var _0x9a14=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x9a14,0xa8));var _0x49a1=function(_0x1e7e57,_0x36aa7a){_0x1e7e57=_0x1e7e57-0x0;var _0x76779e=_0x9a14[_0x1e7e57];return _0x76779e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49a1('0x0'));var BPromise=require(_0x49a1('0x1'));var rs=require(_0x49a1('0x2'));var fs=require('fs');var Redis=require(_0x49a1('0x3'));var db=require(_0x49a1('0x4'))['db'];var utils=require(_0x49a1('0x5'));var logger=require(_0x49a1('0x6'))(_0x49a1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9394fc,_0x2b210c,_0x7ef1ba){return new BPromise(function(_0x592940,_0x6c66e){return client[_0x49a1('0x8')](_0x9394fc,_0x7ef1ba)[_0x49a1('0x9')](function(_0x5445eb){logger[_0x49a1('0xa')](_0x49a1('0xb'),_0x2b210c,'request\x20sent');logger[_0x49a1('0xc')](_0x49a1('0xd'),_0x2b210c,_0x49a1('0xe'),JSON[_0x49a1('0xf')](_0x5445eb));if(_0x5445eb[_0x49a1('0x10')]){if(_0x5445eb['error'][_0x49a1('0x11')]===0x1f4){logger[_0x49a1('0x10')](_0x49a1('0xb'),_0x2b210c,_0x5445eb[_0x49a1('0x10')][_0x49a1('0x12')]);return _0x6c66e(_0x5445eb[_0x49a1('0x10')][_0x49a1('0x12')]);}logger[_0x49a1('0x10')](_0x49a1('0xb'),_0x2b210c,_0x5445eb[_0x49a1('0x10')][_0x49a1('0x12')]);return _0x592940(_0x5445eb[_0x49a1('0x10')][_0x49a1('0x12')]);}else{logger[_0x49a1('0xa')](_0x49a1('0xb'),_0x2b210c,'request\x20sent');_0x592940(_0x5445eb[_0x49a1('0x13')][_0x49a1('0x12')]);}})[_0x49a1('0x14')](function(_0x479ceb){logger[_0x49a1('0x10')](_0x49a1('0xb'),_0x2b210c,_0x479ceb);_0x6c66e(_0x479ceb);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6f76876..6bfbb6e 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 _0xa251=['exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','get','show','create','put','/:id','delete','destroy'];(function(_0x453b25,_0xe3ff7f){var _0x158392=function(_0x35c8fb){while(--_0x35c8fb){_0x453b25['push'](_0x453b25['shift']());}};_0x158392(++_0xe3ff7f);}(_0xa251,0x1c3));var _0x1a25=function(_0x5addf7,_0x50785e){_0x5addf7=_0x5addf7-0x0;var _0xb0746a=_0xa251[_0x5addf7];return _0xb0746a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a25('0x0'));var timeout=require('connect-timeout');var express=require(_0x1a25('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1a25('0x2'));var interaction=require(_0x1a25('0x3'));var config=require(_0x1a25('0x4'));var controller=require(_0x1a25('0x5'));router['get']('/',auth[_0x1a25('0x6')](),controller[_0x1a25('0x7')]);router['get'](_0x1a25('0x8'),auth['isAuthenticated'](),controller[_0x1a25('0x9')]);router[_0x1a25('0xa')]('/:id',auth[_0x1a25('0x6')](),controller[_0x1a25('0xb')]);router['post']('/',auth[_0x1a25('0x6')](),controller[_0x1a25('0xc')]);router[_0x1a25('0xd')](_0x1a25('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1a25('0xf')](_0x1a25('0xe'),auth['isAuthenticated'](),controller[_0x1a25('0x10')]);module[_0x1a25('0x11')]=router;
\ No newline at end of file
+var _0xce87=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','show','post','create','put','update','delete','/:id','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xce87,0x19e));var _0x7ce8=function(_0x240039,_0x30397b){_0x240039=_0x240039-0x0;var _0x55458=_0xce87[_0x240039];return _0x55458;};'use strict';var multer=require('multer');var util=require(_0x7ce8('0x0'));var path=require(_0x7ce8('0x1'));var timeout=require(_0x7ce8('0x2'));var express=require(_0x7ce8('0x3'));var router=express[_0x7ce8('0x4')]();var fs_extra=require(_0x7ce8('0x5'));var auth=require(_0x7ce8('0x6'));var interaction=require(_0x7ce8('0x7'));var config=require(_0x7ce8('0x8'));var controller=require(_0x7ce8('0x9'));router['get']('/',auth[_0x7ce8('0xa')](),controller['index']);router[_0x7ce8('0xb')](_0x7ce8('0xc'),auth[_0x7ce8('0xa')](),controller[_0x7ce8('0xd')]);router[_0x7ce8('0xb')]('/:id',auth[_0x7ce8('0xa')](),controller[_0x7ce8('0xe')]);router[_0x7ce8('0xf')]('/',auth[_0x7ce8('0xa')](),controller[_0x7ce8('0x10')]);router[_0x7ce8('0x11')]('/:id',auth[_0x7ce8('0xa')](),controller[_0x7ce8('0x12')]);router[_0x7ce8('0x13')](_0x7ce8('0x14'),auth['isAuthenticated'](),controller['destroy']);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 73ff1ac..531bb4f 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 _0x2245=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x50063a,_0x4ac3ee){var _0x1172ac=function(_0x29982f){while(--_0x29982f){_0x50063a['push'](_0x50063a['shift']());}};_0x1172ac(++_0x4ac3ee);}(_0x2245,0x1f4));var _0x5224=function(_0x23417d,_0x4e0b5c){_0x23417d=_0x23417d-0x0;var _0x4d42f1=_0x2245[_0x23417d];return _0x4d42f1;};'use strict';var Sequelize=require(_0x5224('0x0'));module[_0x5224('0x1')]={'name':{'type':Sequelize[_0x5224('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5224('0x3'),_0x5224('0x4')),'defaultValue':_0x5224('0x3')},'selector':{'type':Sequelize[_0x5224('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa8fb=['sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa8fb,0x1a9));var _0xba8f=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xa8fb[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0xba8f('0x0'));module[_0xba8f('0x1')]={'name':{'type':Sequelize[_0xba8f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xba8f('0x3')](_0xba8f('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xba8f('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 5c47e61..16b1118 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 _0xb91a=['find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','includeAll','merge','options'];(function(_0x290b7a,_0x179f9a){var _0x122090=function(_0x557f30){while(--_0x557f30){_0x290b7a['push'](_0x290b7a['shift']());}};_0x122090(++_0x179f9a);}(_0xb91a,0xf4));var _0xab91=function(_0x4b21ab,_0x5f59d6){_0x4b21ab=_0x4b21ab-0x0;var _0x5a60b6=_0xb91a[_0x4b21ab];return _0x5a60b6;};'use strict';var emlformat=require(_0xab91('0x0'));var rimraf=require(_0xab91('0x1'));var zipdir=require(_0xab91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab91('0x3'));var BPromise=require(_0xab91('0x4'));var Mustache=require(_0xab91('0x5'));var util=require(_0xab91('0x6'));var path=require(_0xab91('0x7'));var sox=require(_0xab91('0x8'));var csv=require(_0xab91('0x9'));var ejs=require(_0xab91('0xa'));var fs=require('fs');var fs_extra=require(_0xab91('0xb'));var _=require(_0xab91('0xc'));var squel=require('squel');var crypto=require(_0xab91('0xd'));var jsforce=require(_0xab91('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab91('0xf'));var Redis=require(_0xab91('0x10'));var authService=require(_0xab91('0x11'));var qs=require(_0xab91('0x12'));var as=require(_0xab91('0x13'));var hardwareService=require(_0xab91('0x14'));var logger=require(_0xab91('0x15'))(_0xab91('0x16'));var utils=require(_0xab91('0x17'));var config=require(_0xab91('0x18'));var licenseUtil=require(_0xab91('0x19'));var db=require(_0xab91('0x1a'))['db'];function respondWithStatusCode(_0x283c91,_0x542d3f){_0x542d3f=_0x542d3f||0xcc;return function(_0x4f2af6){if(_0x4f2af6){return _0x283c91[_0xab91('0x1b')](_0x542d3f);}return _0x283c91[_0xab91('0x1c')](_0x542d3f)[_0xab91('0x1d')]();};}function respondWithResult(_0x14bded,_0x14b304){_0x14b304=_0x14b304||0xc8;return function(_0xaa6e77){if(_0xaa6e77){return _0x14bded['status'](_0x14b304)['json'](_0xaa6e77);}};}function respondWithFilteredResult(_0x3c102a,_0x3565c0){return function(_0x1b0d61){if(_0x1b0d61){var _0x2d2699=typeof _0x3565c0[_0xab91('0x1e')]===_0xab91('0x1f')&&typeof _0x3565c0[_0xab91('0x20')]===_0xab91('0x1f');var _0x499daf=_0x1b0d61['count'];var _0x1a0b66=_0x2d2699?0x0:_0x3565c0['offset'];var _0x609b8c=_0x2d2699?_0x1b0d61[_0xab91('0x21')]:_0x3565c0[_0xab91('0x1e')]+_0x3565c0['limit'];var _0xe80258;if(_0x609b8c>=_0x499daf){_0x609b8c=_0x499daf;_0xe80258=0xc8;}else{_0xe80258=0xce;}_0x3c102a['status'](_0xe80258);return _0x3c102a[_0xab91('0x22')]('Content-Range',_0x1a0b66+'-'+_0x609b8c+'/'+_0x499daf)['json'](_0x1b0d61);}return null;};}function patchUpdates(_0x13f065){return function(_0x4c5595){try{jsonpatch[_0xab91('0x23')](_0x4c5595,_0x13f065,!![]);}catch(_0x1f5def){return BPromise[_0xab91('0x24')](_0x1f5def);}return _0x4c5595['save']();};}function saveUpdates(_0x49f4d5,_0x40d29a){return function(_0xdedffe){if(_0xdedffe){return _0xdedffe[_0xab91('0x25')](_0x49f4d5)[_0xab91('0x26')](function(_0x1518e4){return _0x1518e4;});}return null;};}function removeEntity(_0xf8db06,_0x57a7e9){return function(_0x5eca53){if(_0x5eca53){return _0x5eca53[_0xab91('0x27')]()['then'](function(){_0xf8db06['status'](0xcc)[_0xab91('0x1d')]();});}};}function handleEntityNotFound(_0x1a0bc2,_0x5586cd){return function(_0x425d39){if(!_0x425d39){_0x1a0bc2['sendStatus'](0x194);}return _0x425d39;};}function handleError(_0x3fe2fc,_0x400134){_0x400134=_0x400134||0x1f4;return function(_0x5a3c05){logger[_0xab91('0x28')](_0x5a3c05[_0xab91('0x29')]);if(_0x5a3c05[_0xab91('0x2a')]){delete _0x5a3c05[_0xab91('0x2a')];}_0x3fe2fc[_0xab91('0x1c')](_0x400134)[_0xab91('0x2b')](_0x5a3c05);};}exports['show']=function(_0x281ede,_0x4c7a87){var _0x152c51={'raw':!![],'where':{'id':_0x281ede[_0xab91('0x2c')]['id']}},_0x197d0c={};_0x197d0c[_0xab91('0x2d')]=_[_0xab91('0x2e')](db[_0xab91('0x2f')]['rawAttributes']);_0x197d0c[_0xab91('0x30')]=_[_0xab91('0x2e')](_0x281ede[_0xab91('0x30')]);_0x197d0c[_0xab91('0x31')]=_[_0xab91('0x32')](_0x197d0c[_0xab91('0x2d')],_0x197d0c['query']);_0x152c51[_0xab91('0x33')]=_[_0xab91('0x32')](_0x197d0c[_0xab91('0x2d')],qs[_0xab91('0x34')](_0x281ede['query'][_0xab91('0x34')]));_0x152c51[_0xab91('0x33')]=_0x152c51[_0xab91('0x33')]['length']?_0x152c51[_0xab91('0x33')]:_0x197d0c['model'];if(_0x281ede[_0xab91('0x30')][_0xab91('0x35')]){_0x152c51['include']=[{'all':!![]}];}_0x152c51=_[_0xab91('0x36')]({},_0x152c51,_0x281ede[_0xab91('0x37')]);return db[_0xab91('0x2f')][_0xab91('0x38')](_0x152c51)[_0xab91('0x26')](handleEntityNotFound(_0x4c7a87,null))[_0xab91('0x26')](respondWithResult(_0x4c7a87,null))[_0xab91('0x39')](handleError(_0x4c7a87,null));};exports['create']=function(_0x584702,_0x17e5bd){return db[_0xab91('0x2f')][_0xab91('0x3a')](_0x584702[_0xab91('0x3b')],{})[_0xab91('0x26')](respondWithResult(_0x17e5bd,0xc9))[_0xab91('0x39')](handleError(_0x17e5bd,null));};exports[_0xab91('0x25')]=function(_0x6ad869,_0x4787f0){if(_0x6ad869[_0xab91('0x3b')]['id']){delete _0x6ad869[_0xab91('0x3b')]['id'];}return db['ChatProactiveAction'][_0xab91('0x38')]({'where':{'id':_0x6ad869['params']['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x4787f0,null))[_0xab91('0x26')](saveUpdates(_0x6ad869[_0xab91('0x3b')],null))[_0xab91('0x26')](respondWithResult(_0x4787f0,null))['catch'](handleError(_0x4787f0,null));};exports['destroy']=function(_0x4de946,_0x427f27){return db[_0xab91('0x2f')]['find']({'where':{'id':_0x4de946[_0xab91('0x2c')]['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x427f27,null))[_0xab91('0x26')](removeEntity(_0x427f27,null))[_0xab91('0x39')](handleError(_0x427f27,null));};
\ No newline at end of file
+var _0x5577=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x5577,0x1b4));var _0x7557=function(_0x2cd3d8,_0x5ddfb0){_0x2cd3d8=_0x2cd3d8-0x0;var _0x1ee6e1=_0x5577[_0x2cd3d8];return _0x1ee6e1;};'use strict';var emlformat=require(_0x7557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7557('0x1'));var jsonpatch=require(_0x7557('0x2'));var rp=require('request-promise');var moment=require(_0x7557('0x3'));var BPromise=require(_0x7557('0x4'));var Mustache=require(_0x7557('0x5'));var util=require(_0x7557('0x6'));var path=require(_0x7557('0x7'));var sox=require(_0x7557('0x8'));var csv=require('to-csv');var ejs=require(_0x7557('0x9'));var fs=require('fs');var fs_extra=require(_0x7557('0xa'));var _=require(_0x7557('0xb'));var squel=require(_0x7557('0xc'));var crypto=require(_0x7557('0xd'));var jsforce=require(_0x7557('0xe'));var deskjs=require(_0x7557('0xf'));var toCsv=require(_0x7557('0x10'));var querystring=require(_0x7557('0x11'));var Papa=require(_0x7557('0x12'));var Redis=require(_0x7557('0x13'));var authService=require(_0x7557('0x14'));var qs=require(_0x7557('0x15'));var as=require(_0x7557('0x16'));var hardwareService=require(_0x7557('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x7557('0x18'));var config=require(_0x7557('0x19'));var licenseUtil=require(_0x7557('0x1a'));var db=require(_0x7557('0x1b'))['db'];function respondWithStatusCode(_0xb6ed30,_0x467ac5){_0x467ac5=_0x467ac5||0xcc;return function(_0x156ac1){if(_0x156ac1){return _0xb6ed30[_0x7557('0x1c')](_0x467ac5);}return _0xb6ed30[_0x7557('0x1d')](_0x467ac5)[_0x7557('0x1e')]();};}function respondWithResult(_0x5468df,_0x276031){_0x276031=_0x276031||0xc8;return function(_0x3fb7a6){if(_0x3fb7a6){return _0x5468df[_0x7557('0x1d')](_0x276031)['json'](_0x3fb7a6);}};}function respondWithFilteredResult(_0x3ad3a1,_0x3c3953){return function(_0x33098f){if(_0x33098f){var _0x325849=typeof _0x3c3953['offset']===_0x7557('0x1f')&&typeof _0x3c3953[_0x7557('0x20')]==='undefined';var _0x4a9cae=_0x33098f[_0x7557('0x21')];var _0x11f186=_0x325849?0x0:_0x3c3953[_0x7557('0x22')];var _0x40a81b=_0x325849?_0x33098f['count']:_0x3c3953[_0x7557('0x22')]+_0x3c3953['limit'];var _0x3e2972;if(_0x40a81b>=_0x4a9cae){_0x40a81b=_0x4a9cae;_0x3e2972=0xc8;}else{_0x3e2972=0xce;}_0x3ad3a1[_0x7557('0x1d')](_0x3e2972);return _0x3ad3a1[_0x7557('0x23')](_0x7557('0x24'),_0x11f186+'-'+_0x40a81b+'/'+_0x4a9cae)['json'](_0x33098f);}return null;};}function patchUpdates(_0x1b60a9){return function(_0x3180cd){try{jsonpatch[_0x7557('0x25')](_0x3180cd,_0x1b60a9,!![]);}catch(_0x34bed5){return BPromise[_0x7557('0x26')](_0x34bed5);}return _0x3180cd['save']();};}function saveUpdates(_0x502e49,_0x4eb212){return function(_0x211fbe){if(_0x211fbe){return _0x211fbe['update'](_0x502e49)[_0x7557('0x27')](function(_0x352b63){return _0x352b63;});}return null;};}function removeEntity(_0x1e97d3,_0x9bbcf6){return function(_0x1533b2){if(_0x1533b2){return _0x1533b2[_0x7557('0x28')]()[_0x7557('0x27')](function(){_0x1e97d3['status'](0xcc)[_0x7557('0x1e')]();});}};}function handleEntityNotFound(_0x5bc953,_0x3daeac){return function(_0x5b2c6a){if(!_0x5b2c6a){_0x5bc953[_0x7557('0x1c')](0x194);}return _0x5b2c6a;};}function handleError(_0x3aa642,_0x4758b9){_0x4758b9=_0x4758b9||0x1f4;return function(_0x42ae94){logger['error'](_0x42ae94[_0x7557('0x29')]);if(_0x42ae94['name']){delete _0x42ae94[_0x7557('0x2a')];}_0x3aa642[_0x7557('0x1d')](_0x4758b9)[_0x7557('0x2b')](_0x42ae94);};}exports['show']=function(_0x3b36eb,_0x2b4ca8){var _0x1c6df9={'raw':!![],'where':{'id':_0x3b36eb[_0x7557('0x2c')]['id']}},_0x1c4649={};_0x1c4649[_0x7557('0x2d')]=_['keys'](db[_0x7557('0x2e')][_0x7557('0x2f')]);_0x1c4649[_0x7557('0x30')]=_[_0x7557('0x31')](_0x3b36eb['query']);_0x1c4649[_0x7557('0x32')]=_[_0x7557('0x33')](_0x1c4649[_0x7557('0x2d')],_0x1c4649[_0x7557('0x30')]);_0x1c6df9[_0x7557('0x34')]=_[_0x7557('0x33')](_0x1c4649[_0x7557('0x2d')],qs[_0x7557('0x35')](_0x3b36eb[_0x7557('0x30')][_0x7557('0x35')]));_0x1c6df9[_0x7557('0x34')]=_0x1c6df9[_0x7557('0x34')][_0x7557('0x36')]?_0x1c6df9[_0x7557('0x34')]:_0x1c4649[_0x7557('0x2d')];if(_0x3b36eb[_0x7557('0x30')][_0x7557('0x37')]){_0x1c6df9[_0x7557('0x38')]=[{'all':!![]}];}_0x1c6df9=_[_0x7557('0x39')]({},_0x1c6df9,_0x3b36eb[_0x7557('0x3a')]);return db[_0x7557('0x2e')][_0x7557('0x3b')](_0x1c6df9)['then'](handleEntityNotFound(_0x2b4ca8,null))[_0x7557('0x27')](respondWithResult(_0x2b4ca8,null))['catch'](handleError(_0x2b4ca8,null));};exports['create']=function(_0x363457,_0x5d3ef6){return db[_0x7557('0x2e')]['create'](_0x363457['body'],{})[_0x7557('0x27')](respondWithResult(_0x5d3ef6,0xc9))[_0x7557('0x3c')](handleError(_0x5d3ef6,null));};exports[_0x7557('0x3d')]=function(_0x52b29f,_0xfd1144){if(_0x52b29f[_0x7557('0x3e')]['id']){delete _0x52b29f[_0x7557('0x3e')]['id'];}return db[_0x7557('0x2e')][_0x7557('0x3b')]({'where':{'id':_0x52b29f[_0x7557('0x2c')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0xfd1144,null))[_0x7557('0x27')](saveUpdates(_0x52b29f['body'],null))['then'](respondWithResult(_0xfd1144,null))['catch'](handleError(_0xfd1144,null));};exports['destroy']=function(_0x5e0206,_0x4f3c68){return db[_0x7557('0x2e')][_0x7557('0x3b')]({'where':{'id':_0x5e0206[_0x7557('0x2c')]['id']}})[_0x7557('0x27')](handleEntityNotFound(_0x4f3c68,null))['then'](removeEntity(_0x4f3c68,null))['catch'](handleError(_0x4f3c68,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2e2e91b..38cc50a 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 _0x8d02=['chat_proactive_actions','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0x5e3124,_0x3555db){var _0x76d2bf=function(_0x2ba1c0){while(--_0x2ba1c0){_0x5e3124['push'](_0x5e3124['shift']());}};_0x76d2bf(++_0x3555db);}(_0x8d02,0x173));var _0x28d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8d02[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x28d0('0x0'))('api');var moment=require(_0x28d0('0x1'));var BPromise=require(_0x28d0('0x2'));var rp=require(_0x28d0('0x3'));var fs=require('fs');var path=require(_0x28d0('0x4'));var rimraf=require('rimraf');var config=require(_0x28d0('0x5'));var attributes=require(_0x28d0('0x6'));module['exports']=function(_0x14a4db,_0x4bfbdb){return _0x14a4db[_0x28d0('0x7')](_0x28d0('0x8'),attributes,{'tableName':_0x28d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77f6=['request-promise','path','../../config/environment','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','moment','bluebird'];(function(_0x45d4bb,_0x1b381e){var _0x2a7b99=function(_0x3ba4b5){while(--_0x3ba4b5){_0x45d4bb['push'](_0x45d4bb['shift']());}};_0x2a7b99(++_0x1b381e);}(_0x77f6,0x15b));var _0x677f=function(_0x272b9d,_0x248267){_0x272b9d=_0x272b9d-0x0;var _0x341e80=_0x77f6[_0x272b9d];return _0x341e80;};'use strict';var _=require(_0x677f('0x0'));var util=require('util');var logger=require(_0x677f('0x1'))('api');var moment=require(_0x677f('0x2'));var BPromise=require(_0x677f('0x3'));var rp=require(_0x677f('0x4'));var fs=require('fs');var path=require(_0x677f('0x5'));var rimraf=require('rimraf');var config=require(_0x677f('0x6'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0xefcbe4,_0x13307a){return _0xefcbe4['define'](_0x677f('0x7'),attributes,{'tableName':_0x677f('0x8'),'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 6a2b753..f98b9f0 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 _0x3f72=['../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x3f72,0x123));var _0x23f7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3f72[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require('moment');var BPromise=require(_0x23f7('0x2'));var rs=require(_0x23f7('0x3'));var fs=require('fs');var Redis=require(_0x23f7('0x4'));var db=require(_0x23f7('0x5'))['db'];var utils=require(_0x23f7('0x6'));var logger=require(_0x23f7('0x7'))('rpc');var config=require(_0x23f7('0x8'));var jayson=require(_0x23f7('0x9'));var client=jayson['client'][_0x23f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7d72c4,_0x21e7ee,_0x19ac03){return new BPromise(function(_0x4d122e,_0x46319c){return client[_0x23f7('0xb')](_0x7d72c4,_0x19ac03)[_0x23f7('0xc')](function(_0xe261b9){logger[_0x23f7('0xd')](_0x23f7('0xe'),_0x21e7ee,'request\x20sent');logger['debug'](_0x23f7('0xf'),_0x21e7ee,_0x23f7('0x10'),JSON[_0x23f7('0x11')](_0xe261b9));if(_0xe261b9[_0x23f7('0x12')]){if(_0xe261b9[_0x23f7('0x12')][_0x23f7('0x13')]===0x1f4){logger[_0x23f7('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x21e7ee,_0xe261b9[_0x23f7('0x12')][_0x23f7('0x14')]);return _0x46319c(_0xe261b9[_0x23f7('0x12')][_0x23f7('0x14')]);}logger[_0x23f7('0x12')](_0x23f7('0xe'),_0x21e7ee,_0xe261b9['error'][_0x23f7('0x14')]);return _0x4d122e(_0xe261b9[_0x23f7('0x12')]['message']);}else{logger['info'](_0x23f7('0xe'),_0x21e7ee,_0x23f7('0x10'));_0x4d122e(_0xe261b9[_0x23f7('0x15')]['message']);}})[_0x23f7('0x16')](function(_0x1d2c9d){logger[_0x23f7('0x12')](_0x23f7('0xe'),_0x21e7ee,_0x1d2c9d);_0x46319c(_0x1d2c9d);});});}
\ No newline at end of file
+var _0x1fec=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x16cdfb,_0xdf0056){var _0x482db4=function(_0x46c03a){while(--_0x46c03a){_0x16cdfb['push'](_0x16cdfb['shift']());}};_0x482db4(++_0xdf0056);}(_0x1fec,0xe8));var _0xc1fe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1fec[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc1fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc1fe('0x1'));var fs=require('fs');var Redis=require(_0xc1fe('0x2'));var db=require(_0xc1fe('0x3'))['db'];var utils=require(_0xc1fe('0x4'));var logger=require(_0xc1fe('0x5'))('rpc');var config=require(_0xc1fe('0x6'));var jayson=require(_0xc1fe('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d0630,_0x1760db,_0x517f40){return new BPromise(function(_0x582e5d,_0x16e89e){return client[_0xc1fe('0x8')](_0x2d0630,_0x517f40)[_0xc1fe('0x9')](function(_0x11e990){logger[_0xc1fe('0xa')](_0xc1fe('0xb'),_0x1760db,_0xc1fe('0xc'));logger[_0xc1fe('0xd')](_0xc1fe('0xe'),_0x1760db,_0xc1fe('0xc'),JSON[_0xc1fe('0xf')](_0x11e990));if(_0x11e990['error']){if(_0x11e990[_0xc1fe('0x10')][_0xc1fe('0x11')]===0x1f4){logger[_0xc1fe('0x10')](_0xc1fe('0xb'),_0x1760db,_0x11e990[_0xc1fe('0x10')][_0xc1fe('0x12')]);return _0x16e89e(_0x11e990['error'][_0xc1fe('0x12')]);}logger[_0xc1fe('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x1760db,_0x11e990['error']['message']);return _0x582e5d(_0x11e990['error']['message']);}else{logger[_0xc1fe('0xa')](_0xc1fe('0xb'),_0x1760db,'request\x20sent');_0x582e5d(_0x11e990[_0xc1fe('0x13')][_0xc1fe('0x12')]);}})['catch'](function(_0x2e8896){logger['error'](_0xc1fe('0xb'),_0x1760db,_0x2e8896);_0x16e89e(_0x2e8896);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 552f26a..a7b8a41 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 _0xda19=['post','create','update','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x468a16,_0x41f40d){var _0x1a365c=function(_0x550d58){while(--_0x550d58){_0x468a16['push'](_0x468a16['shift']());}};_0x1a365c(++_0x41f40d);}(_0xda19,0xd5));var _0x9da1=function(_0x5c6dc2,_0x41b63b){_0x5c6dc2=_0x5c6dc2-0x0;var _0x1aa1e3=_0xda19[_0x5c6dc2];return _0x1aa1e3;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xa')]);router[_0x9da1('0xb')]('/',auth[_0x9da1('0x9')](),controller[_0x9da1('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xd')]);router['delete'](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xe')]);module[_0x9da1('0xf')]=router;
\ No newline at end of file
+var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xabce,0x103));var _0xeabc=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xabce[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7e29596..31a313e 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 _0x792f=['beepall','STRING','name','rrmemory'];(function(_0x911c70,_0x3fb4f8){var _0x3c3935=function(_0x12f1ba){while(--_0x12f1ba){_0x911c70['push'](_0x911c70['shift']());}};_0x3c3935(++_0x3fb4f8);}(_0x792f,0xf5));var _0xf792=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0x792f[_0x5093e9];return _0x4c9a22;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf792('0x0')],'unique':_0xf792('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf792('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf792('0x2'),_0xf792('0x3'),'roundrobin')}};
\ No newline at end of file
+var _0x3d06=['exports','STRING','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x5b1366,_0x51eea6){var _0x25bc61=function(_0x1febe8){while(--_0x1febe8){_0x5b1366['push'](_0x5b1366['shift']());}};_0x25bc61(++_0x51eea6);}(_0x3d06,0x1b5));var _0x63d0=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x3d06[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x63d0('0x0'));module[_0x63d0('0x1')]={'name':{'type':Sequelize[_0x63d0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x63d0('0x2')]},'timeout':{'type':Sequelize[_0x63d0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x63d0('0x4')]('rrmemory','beepall',_0x63d0('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 5a7263c..ca0e08c 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 _0xd04a=['find','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','format','%s/%s','SIP','chatPause','createdAt','updatedAt','Team','options','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','compact','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','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','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','show'];(function(_0x4e82eb,_0x48201a){var _0x312271=function(_0x15b874){while(--_0x15b874){_0x4e82eb['push'](_0x4e82eb['shift']());}};_0x312271(++_0x48201a);}(_0xd04a,0xd6));var _0xad04=function(_0x36068a,_0x489020){_0x36068a=_0x36068a-0x0;var _0x1c2282=_0xd04a[_0x36068a];return _0x1c2282;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad04('0x0'));var jsonpatch=require(_0xad04('0x1'));var rp=require('request-promise');var moment=require(_0xad04('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xad04('0x3'));var util=require(_0xad04('0x4'));var path=require(_0xad04('0x5'));var sox=require(_0xad04('0x6'));var csv=require(_0xad04('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad04('0x8'));var _=require(_0xad04('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xad04('0x7'));var querystring=require(_0xad04('0xa'));var Papa=require('papaparse');var Redis=require(_0xad04('0xb'));var authService=require(_0xad04('0xc'));var qs=require(_0xad04('0xd'));var as=require(_0xad04('0xe'));var hardwareService=require(_0xad04('0xf'));var logger=require(_0xad04('0x10'))(_0xad04('0x11'));var utils=require(_0xad04('0x12'));var config=require(_0xad04('0x13'));var licenseUtil=require(_0xad04('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xad04('0x15')],{'host':_0xad04('0x16'),'port':0x18eb});var socket=require(_0xad04('0x17'))(new Redis(config[_0xad04('0x15')]));require('./chatQueue.socket')[_0xad04('0x18')](socket);var jayson=require(_0xad04('0x19'));var client=jayson['client'][_0xad04('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3f207c,_0xf4ff4d,_0xd13025,_0x465167){return new BPromise(function(_0x3bb4aa,_0x2ac132){var _0x319e76=_0x465167||client;return _0x319e76['request'](_0x3f207c,_0xd13025)['then'](function(_0x5c30a5){logger[_0xad04('0x1b')](_0xad04('0x1c'),_0xf4ff4d,'request\x20sent');logger[_0xad04('0x1d')](_0xad04('0x1e'),_0xf4ff4d,_0xad04('0x1f'),JSON[_0xad04('0x20')](_0x5c30a5));if(_0x5c30a5[_0xad04('0x21')]){if(_0x5c30a5[_0xad04('0x21')][_0xad04('0x22')]===0x1f4){logger['error'](_0xad04('0x1c'),_0xf4ff4d,_0x5c30a5[_0xad04('0x21')][_0xad04('0x23')]);return _0x2ac132(_0x5c30a5[_0xad04('0x21')][_0xad04('0x23')]);}logger[_0xad04('0x21')](_0xad04('0x1c'),_0xf4ff4d,_0x5c30a5[_0xad04('0x21')][_0xad04('0x23')]);return _0x3bb4aa(_0x5c30a5[_0xad04('0x21')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0xf4ff4d,'request\x20sent');_0x3bb4aa(_0x5c30a5[_0xad04('0x24')]['message']);}})[_0xad04('0x25')](function(_0x3f93c5){logger[_0xad04('0x21')]('ChatQueue,\x20%s,\x20%s',_0xf4ff4d,_0x3f93c5);_0x2ac132(_0x3f93c5);});});}function respondWithStatusCode(_0xdfad6d,_0x15d006){_0x15d006=_0x15d006||0xcc;return function(_0x497576){if(_0x497576){return _0xdfad6d[_0xad04('0x26')](_0x15d006);}return _0xdfad6d[_0xad04('0x27')](_0x15d006)[_0xad04('0x28')]();};}function respondWithResult(_0x425c43,_0x32444e){_0x32444e=_0x32444e||0xc8;return function(_0x4dc9ac){if(_0x4dc9ac){return _0x425c43['status'](_0x32444e)[_0xad04('0x29')](_0x4dc9ac);}};}function respondWithFilteredResult(_0x53efa5,_0x18d24a){return function(_0x5176f6){if(_0x5176f6){var _0x57db11=typeof _0x18d24a[_0xad04('0x2a')]==='undefined'&&typeof _0x18d24a[_0xad04('0x2b')]==='undefined';var _0x26f4f3=_0x5176f6[_0xad04('0x2c')];var _0x116f32=_0x57db11?0x0:_0x18d24a[_0xad04('0x2a')];var _0xf54675=_0x57db11?_0x5176f6[_0xad04('0x2c')]:_0x18d24a[_0xad04('0x2a')]+_0x18d24a[_0xad04('0x2b')];var _0x4c0143;if(_0xf54675>=_0x26f4f3){_0xf54675=_0x26f4f3;_0x4c0143=0xc8;}else{_0x4c0143=0xce;}_0x53efa5[_0xad04('0x27')](_0x4c0143);return _0x53efa5[_0xad04('0x2d')](_0xad04('0x2e'),_0x116f32+'-'+_0xf54675+'/'+_0x26f4f3)['json'](_0x5176f6);}return null;};}function patchUpdates(_0x280b3e){return function(_0x173887){try{jsonpatch[_0xad04('0x2f')](_0x173887,_0x280b3e,!![]);}catch(_0x48ae96){return BPromise[_0xad04('0x30')](_0x48ae96);}return _0x173887[_0xad04('0x31')]();};}function saveUpdates(_0x409421,_0x3dd6a5){return function(_0x3cf953){if(_0x3cf953){return _0x3cf953[_0xad04('0x32')](_0x409421)[_0xad04('0x33')](function(_0x28e610){return _0x28e610;});}return null;};}function removeEntity(_0x5d4115,_0x5c40c5){return function(_0x5799fe){if(_0x5799fe){return _0x5799fe[_0xad04('0x34')]()['then'](function(){var _0x5b863b=_0x5799fe[_0xad04('0x35')]({'plain':!![]});var _0xd6c16d=_0xad04('0x36');return db[_0xad04('0x37')][_0xad04('0x34')]({'where':{'type':_0xd6c16d,'resourceId':_0x5b863b['id']}})[_0xad04('0x33')](function(){return _0x5799fe;});})[_0xad04('0x33')](function(){_0x5d4115[_0xad04('0x27')](0xcc)[_0xad04('0x28')]();});}};}function handleEntityNotFound(_0x592d98,_0x1df9bc){return function(_0x56f405){if(!_0x56f405){_0x592d98['sendStatus'](0x194);}return _0x56f405;};}function handleError(_0x5b4238,_0x351d37){_0x351d37=_0x351d37||0x1f4;return function(_0x3e3f8f){logger['error'](_0x3e3f8f[_0xad04('0x38')]);if(_0x3e3f8f['name']){delete _0x3e3f8f[_0xad04('0x39')];}_0x5b4238[_0xad04('0x27')](_0x351d37)[_0xad04('0x3a')](_0x3e3f8f);};}exports[_0xad04('0x3b')]=function(_0x3b65f1,_0x215531){var _0x492156={},_0x3ab91d={},_0x561106={'count':0x0,'rows':[]};var _0x2a656d=_[_0xad04('0x3c')](db[_0xad04('0x3d')][_0xad04('0x3e')],function(_0x35808e){return{'name':_0x35808e[_0xad04('0x3f')],'type':_0x35808e['type'][_0xad04('0x40')]};});_0x3ab91d[_0xad04('0x41')]=_['map'](_0x2a656d,_0xad04('0x39'));_0x3ab91d['query']=_[_0xad04('0x42')](_0x3b65f1[_0xad04('0x43')]);_0x3ab91d[_0xad04('0x44')]=_['intersection'](_0x3ab91d[_0xad04('0x41')],_0x3ab91d[_0xad04('0x43')]);_0x492156['attributes']=_[_0xad04('0x45')](_0x3ab91d[_0xad04('0x41')],qs['fields'](_0x3b65f1[_0xad04('0x43')][_0xad04('0x46')]));_0x492156['attributes']=_0x492156[_0xad04('0x47')][_0xad04('0x48')]?_0x492156[_0xad04('0x47')]:_0x3ab91d[_0xad04('0x41')];if(!_0x3b65f1[_0xad04('0x43')][_0xad04('0x49')](_0xad04('0x4a'))){_0x492156[_0xad04('0x2b')]=qs['limit'](_0x3b65f1[_0xad04('0x43')][_0xad04('0x2b')]);_0x492156[_0xad04('0x2a')]=qs['offset'](_0x3b65f1['query'][_0xad04('0x2a')]);}_0x492156[_0xad04('0x4b')]=qs[_0xad04('0x4c')](_0x3b65f1['query'][_0xad04('0x4c')]);_0x492156[_0xad04('0x4d')]=qs[_0xad04('0x44')](_[_0xad04('0x4e')](_0x3b65f1['query'],_0x3ab91d[_0xad04('0x44')]),_0x2a656d);if(_0x3b65f1[_0xad04('0x43')][_0xad04('0x4f')]){_0x492156[_0xad04('0x4d')]=_['merge'](_0x492156[_0xad04('0x4d')],{'$or':_[_0xad04('0x3c')](_0x2a656d,function(_0x5574b2){if(_0x5574b2[_0xad04('0x50')]!==_0xad04('0x51')){var _0x37ba3e={};_0x37ba3e[_0x5574b2[_0xad04('0x39')]]={'$like':'%'+_0x3b65f1[_0xad04('0x43')][_0xad04('0x4f')]+'%'};return _0x37ba3e;}})});}_0x492156=_[_0xad04('0x52')]({},_0x492156,_0x3b65f1['options']);var _0x129531={'where':_0x492156['where']};return db['ChatQueue'][_0xad04('0x2c')](_0x129531)[_0xad04('0x33')](function(_0xfb755f){_0x561106[_0xad04('0x2c')]=_0xfb755f;if(_0x3b65f1[_0xad04('0x43')][_0xad04('0x53')]){_0x492156[_0xad04('0x54')]=[{'all':!![]}];}return db[_0xad04('0x3d')][_0xad04('0x55')](_0x492156);})[_0xad04('0x33')](function(_0x15ff88){_0x561106[_0xad04('0x56')]=_0x15ff88;return _0x561106;})[_0xad04('0x33')](respondWithFilteredResult(_0x215531,_0x492156))[_0xad04('0x25')](handleError(_0x215531,null));};exports[_0xad04('0x57')]=function(_0xe0bdd0,_0x46a29c){var _0xc9cab1={'raw':!![],'where':{'id':_0xe0bdd0['params']['id']}},_0x2ed95e={};_0x2ed95e[_0xad04('0x41')]=_[_0xad04('0x42')](db['ChatQueue'][_0xad04('0x3e')]);_0x2ed95e[_0xad04('0x43')]=_['keys'](_0xe0bdd0[_0xad04('0x43')]);_0x2ed95e[_0xad04('0x44')]=_[_0xad04('0x45')](_0x2ed95e[_0xad04('0x41')],_0x2ed95e[_0xad04('0x43')]);_0xc9cab1[_0xad04('0x47')]=_['intersection'](_0x2ed95e['model'],qs[_0xad04('0x46')](_0xe0bdd0[_0xad04('0x43')][_0xad04('0x46')]));_0xc9cab1[_0xad04('0x47')]=_0xc9cab1[_0xad04('0x47')][_0xad04('0x48')]?_0xc9cab1[_0xad04('0x47')]:_0x2ed95e[_0xad04('0x41')];if(_0xe0bdd0[_0xad04('0x43')][_0xad04('0x53')]){_0xc9cab1[_0xad04('0x54')]=[{'all':!![]}];}_0xc9cab1=_['merge']({},_0xc9cab1,_0xe0bdd0['options']);return db[_0xad04('0x3d')][_0xad04('0x58')](_0xc9cab1)[_0xad04('0x33')](handleEntityNotFound(_0x46a29c,null))['then'](respondWithResult(_0x46a29c,null))[_0xad04('0x25')](handleError(_0x46a29c,null));};exports[_0xad04('0x59')]=function(_0x4b1624,_0x4e152e){return db[_0xad04('0x3d')]['create'](_0x4b1624[_0xad04('0x5a')],{})[_0xad04('0x33')](function(_0x50cfeb){var _0x510359=_0x4b1624['user']['get']({'plain':!![]});if(!_0x510359)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x510359[_0xad04('0x5b')]==='user'){var _0x2ff682=_0x50cfeb[_0xad04('0x35')]({'plain':!![]});var _0x36caad=_0xad04('0x36');return db[_0xad04('0x5c')][_0xad04('0x58')]({'where':{'name':_0x36caad,'userProfileId':_0x510359[_0xad04('0x5d')]},'raw':!![]})[_0xad04('0x33')](function(_0x10f63b){if(_0x10f63b&&_0x10f63b[_0xad04('0x5e')]===0x0){return db[_0xad04('0x37')][_0xad04('0x59')]({'name':_0x2ff682[_0xad04('0x39')],'resourceId':_0x2ff682['id'],'type':_0x10f63b[_0xad04('0x39')],'sectionId':_0x10f63b['id']},{})[_0xad04('0x33')](function(){return _0x50cfeb;});}else{return _0x50cfeb;}})['catch'](function(_0x4f362c){logger[_0xad04('0x21')](_0xad04('0x5f'),_0x4f362c);throw _0x4f362c;});}return _0x50cfeb;})[_0xad04('0x33')](respondWithResult(_0x4e152e,0xc9))['catch'](handleError(_0x4e152e,null));};exports[_0xad04('0x32')]=function(_0x42114a,_0x2a9143){if(_0x42114a[_0xad04('0x5a')]['id']){delete _0x42114a[_0xad04('0x5a')]['id'];}return db[_0xad04('0x3d')][_0xad04('0x58')]({'where':{'id':_0x42114a[_0xad04('0x60')]['id']}})[_0xad04('0x33')](handleEntityNotFound(_0x2a9143,null))['then'](saveUpdates(_0x42114a[_0xad04('0x5a')],null))[_0xad04('0x33')](respondWithResult(_0x2a9143,null))[_0xad04('0x25')](handleError(_0x2a9143,null));};exports[_0xad04('0x34')]=function(_0xfbc356,_0x6cf2ad){return db[_0xad04('0x3d')][_0xad04('0x58')]({'where':{'id':_0xfbc356['params']['id']}})['then'](handleEntityNotFound(_0x6cf2ad,null))[_0xad04('0x33')](removeEntity(_0x6cf2ad,null))[_0xad04('0x25')](handleError(_0x6cf2ad,null));};exports[_0xad04('0x61')]=function(_0x4c4beb,_0x3bb218){return db['ChatQueue'][_0xad04('0x61')]()['then'](respondWithResult(_0x3bb218,null))[_0xad04('0x25')](handleError(_0x3bb218,null));};exports[_0xad04('0x62')]=function(_0x19fc67,_0x229363,_0x170e74){var _0x21c3af={'raw':!![],'where':{}},_0x31f67b={},_0x297645;return db[_0xad04('0x3d')][_0xad04('0x63')]({'where':{'id':_0x19fc67[_0xad04('0x60')]['id']}})[_0xad04('0x33')](handleEntityNotFound(_0x229363,null))['then'](function(_0x4c60ec){if(_0x4c60ec){_0x297645=_0x4c60ec[_0xad04('0x35')]({'plain':!![]});_0x31f67b['model']=_['keys'](db[_0xad04('0x64')]['rawAttributes']);_0x31f67b['query']=_['keys'](_0x19fc67['query']);_0x31f67b[_0xad04('0x44')]=_['intersection'](_0x31f67b['model'],_0x31f67b[_0xad04('0x43')]);_0x21c3af[_0xad04('0x47')]=_[_0xad04('0x45')](_0x31f67b[_0xad04('0x41')],qs[_0xad04('0x46')](_0x19fc67[_0xad04('0x43')][_0xad04('0x46')]));_0x21c3af['attributes']=_0x21c3af[_0xad04('0x47')][_0xad04('0x48')]?_0x21c3af[_0xad04('0x47')]:_0x31f67b[_0xad04('0x41')];if(!_0x19fc67['query'][_0xad04('0x49')]('nolimit')){_0x21c3af[_0xad04('0x2b')]=qs[_0xad04('0x2b')](_0x19fc67[_0xad04('0x43')][_0xad04('0x2b')]);_0x21c3af['offset']=qs[_0xad04('0x2a')](_0x19fc67[_0xad04('0x43')]['offset']);}_0x21c3af[_0xad04('0x4b')]=qs['sort'](_0x19fc67[_0xad04('0x43')]['sort']);_0x21c3af[_0xad04('0x4d')]=qs['filters'](_[_0xad04('0x4e')](_0x19fc67[_0xad04('0x43')],_0x31f67b[_0xad04('0x44')]));_0x21c3af[_0xad04('0x4d')][_0xad04('0x65')]=_0x4c60ec['id'];if(_0x19fc67[_0xad04('0x43')][_0xad04('0x4f')]){_0x21c3af[_0xad04('0x4d')]=_[_0xad04('0x52')](_0x21c3af[_0xad04('0x4d')],{'$or':_[_0xad04('0x3c')](_0x21c3af[_0xad04('0x47')],function(_0x408485){var _0x116d39={};_0x116d39[_0x408485]={'$like':'%'+_0x19fc67[_0xad04('0x43')][_0xad04('0x4f')]+'%'};return _0x116d39;})});}_0x21c3af=_[_0xad04('0x52')]({},_0x21c3af,_0x19fc67['options']);return db[_0xad04('0x64')]['findAll'](_0x21c3af);}})[_0xad04('0x33')](function(_0x52445f){if(_0x52445f){return db[_0xad04('0x66')][_0xad04('0x67')]({'where':{'id':_[_0xad04('0x3c')](_0x52445f,_0xad04('0x68')),'role':_0xad04('0x69')},'attributes':['id',_0xad04('0x39'),'chatPause','updatedAt','createdAt']});}})[_0xad04('0x33')](function(_0xde2df3){if(_0xde2df3){return{'count':_0xde2df3[_0xad04('0x2c')],'rows':_['map'](_0xde2df3['rows'],function(_0x39c494){return{'membername':_0x39c494[_0xad04('0x39')],'UserId':_0x39c494['id'],'queue_name':_0x297645[_0xad04('0x39')],'ChatQueueId':_0x297645['id'],'interface':util[_0xad04('0x6a')](_0xad04('0x6b'),_0xad04('0x6c'),_0x39c494[_0xad04('0x39')]),'penalty':0x0,'paused':_0x39c494[_0xad04('0x6d')],'createdAt':_0x39c494[_0xad04('0x6e')],'updatedAt':_0x39c494[_0xad04('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xad04('0x33')](respondWithFilteredResult(_0x229363,_0x21c3af))[_0xad04('0x25')](handleError(_0x229363,null));};exports['getTeams']=function(_0x14f914,_0x341fed,_0x4788c6){var _0x72b6e={};var _0x386517={};var _0x18ff86;var _0x8abe5b;return db['ChatQueue'][_0xad04('0x63')]({'where':{'id':_0x14f914[_0xad04('0x60')]['id']}})['then'](handleEntityNotFound(_0x341fed,null))['then'](function(_0x3b3210){if(_0x3b3210){_0x18ff86=_0x3b3210;_0x386517['model']=_[_0xad04('0x42')](db[_0xad04('0x70')][_0xad04('0x3e')]);_0x386517[_0xad04('0x43')]=_[_0xad04('0x42')](_0x14f914[_0xad04('0x43')]);_0x386517[_0xad04('0x44')]=_[_0xad04('0x45')](_0x386517[_0xad04('0x41')],_0x386517[_0xad04('0x43')]);_0x72b6e[_0xad04('0x47')]=_[_0xad04('0x45')](_0x386517[_0xad04('0x41')],qs['fields'](_0x14f914[_0xad04('0x43')][_0xad04('0x46')]));_0x72b6e[_0xad04('0x47')]=_0x72b6e[_0xad04('0x47')][_0xad04('0x48')]?_0x72b6e['attributes']:_0x386517[_0xad04('0x41')];_0x72b6e[_0xad04('0x4b')]=qs[_0xad04('0x4c')](_0x14f914[_0xad04('0x43')][_0xad04('0x4c')]);_0x72b6e[_0xad04('0x4d')]=qs[_0xad04('0x44')](_[_0xad04('0x4e')](_0x14f914[_0xad04('0x43')],_0x386517[_0xad04('0x44')]));if(_0x14f914[_0xad04('0x43')]['filter']){_0x72b6e[_0xad04('0x4d')]=_['merge'](_0x72b6e['where'],{'$or':_[_0xad04('0x3c')](_0x72b6e[_0xad04('0x47')],function(_0x5fa903){var _0x580bb7={};_0x580bb7[_0x5fa903]={'$like':'%'+_0x14f914[_0xad04('0x43')]['filter']+'%'};return _0x580bb7;})});}_0x72b6e=_['merge']({},_0x72b6e,_0x14f914[_0xad04('0x71')]);return _0x18ff86[_0xad04('0x72')](_0x72b6e);}})[_0xad04('0x33')](function(_0x5a3c1a){if(_0x5a3c1a){_0x8abe5b=_0x5a3c1a[_0xad04('0x48')];if(!_0x14f914['query']['hasOwnProperty'](_0xad04('0x4a'))){_0x72b6e[_0xad04('0x2b')]=qs[_0xad04('0x2b')](_0x14f914[_0xad04('0x43')][_0xad04('0x2b')]);_0x72b6e['offset']=qs[_0xad04('0x2a')](_0x14f914[_0xad04('0x43')][_0xad04('0x2a')]);}return _0x18ff86[_0xad04('0x72')](_0x72b6e);}})[_0xad04('0x33')](function(_0x266d31){if(_0x266d31){return _0x266d31?{'count':_0x8abe5b,'rows':_0x266d31}:null;}})[_0xad04('0x33')](respondWithResult(_0x341fed,null))[_0xad04('0x25')](handleError(_0x341fed,null));};exports[_0xad04('0x73')]=function(_0x436d38,_0x57b4fc,_0x5067e3){var _0x4d852b=_0x436d38[_0xad04('0x5a')][_0xad04('0x74')];return db[_0xad04('0x70')][_0xad04('0x55')]({'where':{'id':_0x4d852b},'attributes':['id'],'include':[{'model':db[_0xad04('0x66')],'as':_0xad04('0x75'),'attributes':['id',_0xad04('0x39'),'online',_0xad04('0x76'),_0xad04('0x77')],'raw':!![]}]})[_0xad04('0x33')](function(_0x148d78){if(_0x148d78){var _0x570b99=_['flatMap'](_0x148d78,function(_0x28f55e){var _0x1ea084=_0x28f55e[_0xad04('0x35')]({'plain':!![]});return _0x1ea084[_0xad04('0x75')];});return db[_0xad04('0x3d')]['find']({'where':{'id':_0x436d38[_0xad04('0x60')]['id']}})[_0xad04('0x33')](function(_0x51f9ea){return db[_0xad04('0x78')][_0xad04('0x79')](function(_0x47c386){return _0x51f9ea[_0xad04('0x73')](_0x4d852b,{'transaction':_0x47c386})['then'](function(){return BPromise[_0xad04('0x7a')](_0x570b99,function(_0x21503a){return db[_0xad04('0x64')][_0xad04('0x7b')]({'where':{'UserId':_0x21503a['id'],'ChatQueueId':_0x436d38['params']['id']},'transaction':_0x47c386});});})[_0xad04('0x33')](function(){_0x570b99['forEach'](function(_0x35eb86){socket[_0xad04('0x7c')](_0xad04('0x7d'),{'UserId':_0x35eb86['id'],'ChatQueueId':_0x51f9ea['id']});});});});});}})['then'](respondWithStatusCode(_0x57b4fc,null))[_0xad04('0x25')](handleError(_0x57b4fc,null));};exports[_0xad04('0x7e')]=function(_0x106ae1,_0x11b603,_0x34d530){return db[_0xad04('0x70')][_0xad04('0x55')]({'where':{'id':_0x106ae1[_0xad04('0x43')][_0xad04('0x74')]},'attributes':['id'],'include':[{'model':db[_0xad04('0x66')],'as':_0xad04('0x75'),'attributes':['id'],'raw':!![]}]})[_0xad04('0x33')](handleEntityNotFound(_0x11b603,null))['then'](function(_0x5b3296){var _0x1750af=_[_0xad04('0x3c')](_0x5b3296,'id');var _0x18ede4=[];var _0x299d44=[];var _0x422363=squel[_0xad04('0x7f')]();_0x422363[_0xad04('0x80')]('tq.TeamId')[_0xad04('0x81')](_0xad04('0x82'),'tq')['join'](_0xad04('0x83'),'ut',_0xad04('0x84'))[_0xad04('0x4d')]('ChatQueueId\x20=\x20?',_0x106ae1[_0xad04('0x60')]['id']);for(var _0x1f0ef0=0x0;_0x1f0ef0<_0x5b3296[_0xad04('0x48')];_0x1f0ef0+=0x1){let _0x2b5aa9=_0x5b3296[_0x1f0ef0];for(var _0x35e9b7=0x0;_0x35e9b7<_0x2b5aa9[_0xad04('0x75')][_0xad04('0x48')];_0x35e9b7+=0x1){let _0x25b6fc=_0x2b5aa9[_0xad04('0x75')][_0x35e9b7];var _0x3b7b2e=_0x422363[_0xad04('0x85')]();_0x3b7b2e[_0xad04('0x4d')](_0xad04('0x86'),_0x25b6fc['id']);_0x299d44[_0xad04('0x87')](db[_0xad04('0x78')][_0xad04('0x43')](_0x3b7b2e[_0xad04('0x88')](),{'type':db[_0xad04('0x78')]['QueryTypes'][_0xad04('0x89')]})[_0xad04('0x33')](function(_0x318b70){if(_0x318b70[_0xad04('0x48')]===0x1){return _0x25b6fc['id'];}else{var _0x12469f=_[_0xad04('0x8a')](_[_0xad04('0x3c')](_0x318b70,_0xad04('0x8b')),function(_0x263369){return _[_0xad04('0x8c')](_0x1750af,_0x263369);});if(_0x12469f){return _0x25b6fc['id'];}}}));}}return BPromise['all'](_0x299d44)[_0xad04('0x33')](function(_0x2fe21b){_0x18ede4=_(_0x18ede4)['union'](_0x2fe21b)[_0xad04('0x8d')]()['value']();return db[_0xad04('0x3d')]['find']({'where':{'id':_0x106ae1[_0xad04('0x60')]['id']}})[_0xad04('0x33')](function(_0x1b2909){return db[_0xad04('0x78')][_0xad04('0x79')](function(_0x1e6f98){return _0x1b2909[_0xad04('0x7e')](_0x106ae1[_0xad04('0x43')][_0xad04('0x74')],{'transaction':_0x1e6f98})[_0xad04('0x33')](function(){if(!_[_0xad04('0x8e')](_0x18ede4)){return _0x1b2909[_0xad04('0x8f')](_0x18ede4,{'transaction':_0x1e6f98});}})[_0xad04('0x33')](function(){_0x18ede4[_0xad04('0x90')](function(_0x1781a6){socket[_0xad04('0x7c')](_0xad04('0x91'),{'UserId':_0x1781a6,'ChatQueueId':_0x1b2909['id']});});});});});});})[_0xad04('0x33')](respondWithStatusCode(_0x11b603,null))[_0xad04('0x25')](handleError(_0x11b603,null));};exports[_0xad04('0x92')]=function(_0x4fb0cf,_0xf177f1,_0x3a4b51){return db['ChatQueue'][_0xad04('0x58')]({'where':{'id':_0x4fb0cf[_0xad04('0x60')]['id']}})[_0xad04('0x33')](handleEntityNotFound(_0xf177f1,null))['then'](function(_0x27c848){if(_0x27c848){return _0x27c848[_0xad04('0x92')](_0x4fb0cf[_0xad04('0x5a')][_0xad04('0x74')],_[_0xad04('0x93')](_0x4fb0cf[_0xad04('0x5a')],['ids','id'])||{})[_0xad04('0x94')](function(_0x2f69f6){for(var _0x4e6ab9=0x0;_0x4e6ab9<_0x4fb0cf[_0xad04('0x5a')]['ids']['length'];_0x4e6ab9+=0x1){socket[_0xad04('0x7c')](_0xad04('0x7d'),{'UserId':Number(_0x4fb0cf[_0xad04('0x5a')][_0xad04('0x74')][_0x4e6ab9]),'ChatQueueId':Number(_0x4fb0cf[_0xad04('0x60')]['id'])});}return _0x2f69f6;});}})[_0xad04('0x33')](respondWithResult(_0xf177f1,null))[_0xad04('0x25')](handleError(_0xf177f1,null));};exports[_0xad04('0x8f')]=function(_0x19ec2c,_0x8b1dec,_0x2fc8ac){return db[_0xad04('0x3d')][_0xad04('0x58')]({'where':{'id':_0x19ec2c[_0xad04('0x60')]['id']}})[_0xad04('0x33')](handleEntityNotFound(_0x8b1dec,null))[_0xad04('0x33')](function(_0x197940){if(_0x197940){return _0x197940['removeAgents'](_0x19ec2c[_0xad04('0x43')]['ids'])[_0xad04('0x33')](function(){if(_[_0xad04('0x95')](_0x19ec2c['query']['ids'])){for(var _0x3f10cd=0x0;_0x3f10cd<_0x19ec2c[_0xad04('0x43')][_0xad04('0x74')][_0xad04('0x48')];_0x3f10cd+=0x1){socket[_0xad04('0x7c')](_0xad04('0x91'),{'UserId':Number(_0x19ec2c[_0xad04('0x43')][_0xad04('0x74')][_0x3f10cd]),'ChatQueueId':Number(_0x19ec2c['params']['id'])});}}else{socket[_0xad04('0x7c')](_0xad04('0x91'),{'UserId':Number(_0x19ec2c[_0xad04('0x43')]['ids']),'ChatQueueId':Number(_0x19ec2c[_0xad04('0x60')]['id'])});}});}})[_0xad04('0x33')](respondWithStatusCode(_0x8b1dec,null))[_0xad04('0x25')](handleError(_0x8b1dec,null));};exports['getAgents']=function(_0x2d4853,_0x261635,_0x40b02d){var _0x1d61d2={};var _0xea7879={};var _0x19452d;var _0x43cc62;return db[_0xad04('0x3d')][_0xad04('0x63')]({'where':{'id':_0x2d4853[_0xad04('0x60')]['id']}})['then'](handleEntityNotFound(_0x261635,null))[_0xad04('0x33')](function(_0x96bc1){if(_0x96bc1){_0x19452d=_0x96bc1;_0xea7879[_0xad04('0x41')]=_[_0xad04('0x42')](db['User'][_0xad04('0x3e')]);_0xea7879[_0xad04('0x43')]=_[_0xad04('0x42')](_0x2d4853[_0xad04('0x43')]);_0xea7879[_0xad04('0x44')]=_[_0xad04('0x45')](_0xea7879['model'],_0xea7879['query']);_0x1d61d2[_0xad04('0x47')]=_[_0xad04('0x45')](_0xea7879[_0xad04('0x41')],qs['fields'](_0x2d4853['query'][_0xad04('0x46')]));_0x1d61d2[_0xad04('0x47')]=_0x1d61d2[_0xad04('0x47')][_0xad04('0x48')]?_0x1d61d2[_0xad04('0x47')]:_0xea7879['model'];_0x1d61d2[_0xad04('0x4b')]=qs[_0xad04('0x4c')](_0x2d4853[_0xad04('0x43')][_0xad04('0x4c')]);_0x1d61d2['where']=qs[_0xad04('0x44')](_[_0xad04('0x4e')](_0x2d4853['query'],_0xea7879[_0xad04('0x44')]));if(_0x2d4853[_0xad04('0x43')]['filter']){_0x1d61d2[_0xad04('0x4d')]=_[_0xad04('0x52')](_0x1d61d2[_0xad04('0x4d')],{'$or':_['map'](_0x1d61d2['attributes'],function(_0x801746){var _0x118f9b={};_0x118f9b[_0x801746]={'$like':'%'+_0x2d4853[_0xad04('0x43')][_0xad04('0x4f')]+'%'};return _0x118f9b;})});}_0x1d61d2=_['merge']({},_0x1d61d2,_0x2d4853[_0xad04('0x71')]);return _0x19452d['getAgents'](_0x1d61d2);}})[_0xad04('0x33')](function(_0x1048da){if(_0x1048da){_0x43cc62=_0x1048da[_0xad04('0x48')];if(!_0x2d4853[_0xad04('0x43')][_0xad04('0x49')](_0xad04('0x4a'))){_0x1d61d2['limit']=qs['limit'](_0x2d4853[_0xad04('0x43')][_0xad04('0x2b')]);_0x1d61d2['offset']=qs[_0xad04('0x2a')](_0x2d4853[_0xad04('0x43')][_0xad04('0x2a')]);}return _0x19452d[_0xad04('0x96')](_0x1d61d2);}})['then'](function(_0x329313){if(_0x329313){return _0x329313?{'count':_0x43cc62,'rows':_0x329313}:null;}})[_0xad04('0x33')](respondWithResult(_0x261635,null))[_0xad04('0x25')](handleError(_0x261635,null));};
\ No newline at end of file
+var _0xa361=['debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','ChatQueues','destroy','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','transaction','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','all','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','isArray','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x31be28,_0x598de7){var _0x4d23f2=function(_0x53828e){while(--_0x53828e){_0x31be28['push'](_0x31be28['shift']());}};_0x4d23f2(++_0x598de7);}(_0xa361,0x1b5));var _0x1a36=function(_0x4876b5,_0x44b2b6){_0x4876b5=_0x4876b5-0x0;var _0x40c6d7=_0xa361[_0x4876b5];return _0x40c6d7;};'use strict';var emlformat=require(_0x1a36('0x0'));var rimraf=require(_0x1a36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a36('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a36('0x3'));var util=require(_0x1a36('0x4'));var path=require(_0x1a36('0x5'));var sox=require(_0x1a36('0x6'));var csv=require(_0x1a36('0x7'));var ejs=require(_0x1a36('0x8'));var fs=require('fs');var fs_extra=require(_0x1a36('0x9'));var _=require(_0x1a36('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a36('0xb'));var deskjs=require(_0x1a36('0xc'));var toCsv=require(_0x1a36('0x7'));var querystring=require(_0x1a36('0xd'));var Papa=require(_0x1a36('0xe'));var Redis=require(_0x1a36('0xf'));var authService=require(_0x1a36('0x10'));var qs=require(_0x1a36('0x11'));var as=require(_0x1a36('0x12'));var hardwareService=require(_0x1a36('0x13'));var logger=require(_0x1a36('0x14'))(_0x1a36('0x15'));var utils=require(_0x1a36('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a36('0x17'))['db'];config[_0x1a36('0x18')]=_['defaults'](config[_0x1a36('0x18')],{'host':_0x1a36('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a36('0x18')]));require(_0x1a36('0x1a'))[_0x1a36('0x1b')](socket);var jayson=require(_0x1a36('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35e36d,_0x2a105c,_0x2a1a85,_0x3ecb55){return new BPromise(function(_0x1a157c,_0xa16364){var _0x5300a0=_0x3ecb55||client;return _0x5300a0[_0x1a36('0x1d')](_0x35e36d,_0x2a1a85)[_0x1a36('0x1e')](function(_0x391823){logger[_0x1a36('0x1f')](_0x1a36('0x20'),_0x2a105c,_0x1a36('0x21'));logger[_0x1a36('0x22')](_0x1a36('0x23'),_0x2a105c,_0x1a36('0x21'),JSON[_0x1a36('0x24')](_0x391823));if(_0x391823[_0x1a36('0x25')]){if(_0x391823['error'][_0x1a36('0x26')]===0x1f4){logger[_0x1a36('0x25')](_0x1a36('0x20'),_0x2a105c,_0x391823[_0x1a36('0x25')][_0x1a36('0x27')]);return _0xa16364(_0x391823[_0x1a36('0x25')][_0x1a36('0x27')]);}logger['error'](_0x1a36('0x20'),_0x2a105c,_0x391823['error']['message']);return _0x1a157c(_0x391823[_0x1a36('0x25')]['message']);}else{logger['info'](_0x1a36('0x20'),_0x2a105c,_0x1a36('0x21'));_0x1a157c(_0x391823[_0x1a36('0x28')]['message']);}})['catch'](function(_0x24da98){logger[_0x1a36('0x25')](_0x1a36('0x20'),_0x2a105c,_0x24da98);_0xa16364(_0x24da98);});});}function respondWithStatusCode(_0x230296,_0x272421){_0x272421=_0x272421||0xcc;return function(_0x32dbb2){if(_0x32dbb2){return _0x230296[_0x1a36('0x29')](_0x272421);}return _0x230296[_0x1a36('0x2a')](_0x272421)[_0x1a36('0x2b')]();};}function respondWithResult(_0x561223,_0x29cd18){_0x29cd18=_0x29cd18||0xc8;return function(_0x47421d){if(_0x47421d){return _0x561223[_0x1a36('0x2a')](_0x29cd18)[_0x1a36('0x2c')](_0x47421d);}};}function respondWithFilteredResult(_0x29fc28,_0x3c7a8c){return function(_0x53b164){if(_0x53b164){var _0x26d63d=typeof _0x3c7a8c[_0x1a36('0x2d')]===_0x1a36('0x2e')&&typeof _0x3c7a8c[_0x1a36('0x2f')]===_0x1a36('0x2e');var _0x2f8b19=_0x53b164[_0x1a36('0x30')];var _0x47b874=_0x26d63d?0x0:_0x3c7a8c[_0x1a36('0x2d')];var _0x5d86b7=_0x26d63d?_0x53b164[_0x1a36('0x30')]:_0x3c7a8c[_0x1a36('0x2d')]+_0x3c7a8c[_0x1a36('0x2f')];var _0x275dc9;if(_0x5d86b7>=_0x2f8b19){_0x5d86b7=_0x2f8b19;_0x275dc9=0xc8;}else{_0x275dc9=0xce;}_0x29fc28[_0x1a36('0x2a')](_0x275dc9);return _0x29fc28[_0x1a36('0x31')](_0x1a36('0x32'),_0x47b874+'-'+_0x5d86b7+'/'+_0x2f8b19)[_0x1a36('0x2c')](_0x53b164);}return null;};}function patchUpdates(_0x4c1337){return function(_0x3080dc){try{jsonpatch[_0x1a36('0x33')](_0x3080dc,_0x4c1337,!![]);}catch(_0xd11aa9){return BPromise[_0x1a36('0x34')](_0xd11aa9);}return _0x3080dc[_0x1a36('0x35')]();};}function saveUpdates(_0x3bdf55,_0x3f0d48){return function(_0x4d2714){if(_0x4d2714){return _0x4d2714[_0x1a36('0x36')](_0x3bdf55)[_0x1a36('0x1e')](function(_0x2a24ab){return _0x2a24ab;});}return null;};}function removeEntity(_0x20bf40,_0x476988){return function(_0x4aeb7d){if(_0x4aeb7d){return _0x4aeb7d['destroy']()[_0x1a36('0x1e')](function(){var _0x2d79bd=_0x4aeb7d[_0x1a36('0x37')]({'plain':!![]});var _0x4562eb=_0x1a36('0x38');return db['UserProfileResource'][_0x1a36('0x39')]({'where':{'type':_0x4562eb,'resourceId':_0x2d79bd['id']}})[_0x1a36('0x1e')](function(){return _0x4aeb7d;});})[_0x1a36('0x1e')](function(){_0x20bf40[_0x1a36('0x2a')](0xcc)[_0x1a36('0x2b')]();});}};}function handleEntityNotFound(_0x151b4f,_0x37f370){return function(_0x51fa3e){if(!_0x51fa3e){_0x151b4f[_0x1a36('0x29')](0x194);}return _0x51fa3e;};}function handleError(_0x27cf4d,_0x547eff){_0x547eff=_0x547eff||0x1f4;return function(_0x2d9219){logger['error'](_0x2d9219[_0x1a36('0x3a')]);if(_0x2d9219[_0x1a36('0x3b')]){delete _0x2d9219[_0x1a36('0x3b')];}_0x27cf4d[_0x1a36('0x2a')](_0x547eff)[_0x1a36('0x3c')](_0x2d9219);};}exports['index']=function(_0x4c8b8b,_0x280aaf){var _0x279b8d={},_0x5ed5e7={},_0x1e0cba={'count':0x0,'rows':[]};var _0xa3271e=_['map'](db[_0x1a36('0x3d')][_0x1a36('0x3e')],function(_0x7f6584){return{'name':_0x7f6584[_0x1a36('0x3f')],'type':_0x7f6584[_0x1a36('0x40')][_0x1a36('0x41')]};});_0x5ed5e7['model']=_[_0x1a36('0x42')](_0xa3271e,_0x1a36('0x3b'));_0x5ed5e7['query']=_['keys'](_0x4c8b8b[_0x1a36('0x43')]);_0x5ed5e7[_0x1a36('0x44')]=_['intersection'](_0x5ed5e7[_0x1a36('0x45')],_0x5ed5e7[_0x1a36('0x43')]);_0x279b8d[_0x1a36('0x46')]=_[_0x1a36('0x47')](_0x5ed5e7[_0x1a36('0x45')],qs[_0x1a36('0x48')](_0x4c8b8b[_0x1a36('0x43')][_0x1a36('0x48')]));_0x279b8d[_0x1a36('0x46')]=_0x279b8d[_0x1a36('0x46')][_0x1a36('0x49')]?_0x279b8d[_0x1a36('0x46')]:_0x5ed5e7[_0x1a36('0x45')];if(!_0x4c8b8b[_0x1a36('0x43')][_0x1a36('0x4a')](_0x1a36('0x4b'))){_0x279b8d['limit']=qs[_0x1a36('0x2f')](_0x4c8b8b['query']['limit']);_0x279b8d[_0x1a36('0x2d')]=qs[_0x1a36('0x2d')](_0x4c8b8b[_0x1a36('0x43')][_0x1a36('0x2d')]);}_0x279b8d[_0x1a36('0x4c')]=qs[_0x1a36('0x4d')](_0x4c8b8b['query'][_0x1a36('0x4d')]);_0x279b8d['where']=qs[_0x1a36('0x44')](_[_0x1a36('0x4e')](_0x4c8b8b['query'],_0x5ed5e7['filters']),_0xa3271e);if(_0x4c8b8b[_0x1a36('0x43')][_0x1a36('0x4f')]){_0x279b8d['where']=_[_0x1a36('0x50')](_0x279b8d[_0x1a36('0x51')],{'$or':_[_0x1a36('0x42')](_0xa3271e,function(_0x4cb28e){if(_0x4cb28e[_0x1a36('0x40')]!==_0x1a36('0x52')){var _0xa88159={};_0xa88159[_0x4cb28e['name']]={'$like':'%'+_0x4c8b8b['query'][_0x1a36('0x4f')]+'%'};return _0xa88159;}})});}_0x279b8d=_[_0x1a36('0x50')]({},_0x279b8d,_0x4c8b8b[_0x1a36('0x53')]);var _0x136188={'where':_0x279b8d[_0x1a36('0x51')]};return db[_0x1a36('0x3d')][_0x1a36('0x30')](_0x136188)['then'](function(_0x9c4374){_0x1e0cba[_0x1a36('0x30')]=_0x9c4374;if(_0x4c8b8b[_0x1a36('0x43')]['includeAll']){_0x279b8d[_0x1a36('0x54')]=[{'all':!![]}];}return db[_0x1a36('0x3d')][_0x1a36('0x55')](_0x279b8d);})['then'](function(_0x36ceb4){_0x1e0cba[_0x1a36('0x56')]=_0x36ceb4;return _0x1e0cba;})[_0x1a36('0x1e')](respondWithFilteredResult(_0x280aaf,_0x279b8d))[_0x1a36('0x57')](handleError(_0x280aaf,null));};exports[_0x1a36('0x58')]=function(_0x29c1ef,_0x3d3b5f){var _0x4700d8={'raw':!![],'where':{'id':_0x29c1ef[_0x1a36('0x59')]['id']}},_0x52ce4d={};_0x52ce4d[_0x1a36('0x45')]=_['keys'](db[_0x1a36('0x3d')][_0x1a36('0x3e')]);_0x52ce4d[_0x1a36('0x43')]=_[_0x1a36('0x5a')](_0x29c1ef[_0x1a36('0x43')]);_0x52ce4d[_0x1a36('0x44')]=_['intersection'](_0x52ce4d[_0x1a36('0x45')],_0x52ce4d['query']);_0x4700d8[_0x1a36('0x46')]=_['intersection'](_0x52ce4d['model'],qs[_0x1a36('0x48')](_0x29c1ef[_0x1a36('0x43')][_0x1a36('0x48')]));_0x4700d8[_0x1a36('0x46')]=_0x4700d8[_0x1a36('0x46')][_0x1a36('0x49')]?_0x4700d8[_0x1a36('0x46')]:_0x52ce4d[_0x1a36('0x45')];if(_0x29c1ef['query'][_0x1a36('0x5b')]){_0x4700d8['include']=[{'all':!![]}];}_0x4700d8=_[_0x1a36('0x50')]({},_0x4700d8,_0x29c1ef[_0x1a36('0x53')]);return db[_0x1a36('0x3d')][_0x1a36('0x5c')](_0x4700d8)[_0x1a36('0x1e')](handleEntityNotFound(_0x3d3b5f,null))[_0x1a36('0x1e')](respondWithResult(_0x3d3b5f,null))[_0x1a36('0x57')](handleError(_0x3d3b5f,null));};exports[_0x1a36('0x5d')]=function(_0xb53273,_0x19d50f){return db['ChatQueue'][_0x1a36('0x5d')](_0xb53273[_0x1a36('0x5e')],{})[_0x1a36('0x1e')](function(_0x530f01){var _0x5bd30c=_0xb53273['user']['get']({'plain':!![]});if(!_0x5bd30c)throw new Error(_0x1a36('0x5f'));if(_0x5bd30c[_0x1a36('0x60')]===_0x1a36('0x61')){var _0x5d1f42=_0x530f01[_0x1a36('0x37')]({'plain':!![]});var _0x4e5721=_0x1a36('0x38');return db[_0x1a36('0x62')][_0x1a36('0x5c')]({'where':{'name':_0x4e5721,'userProfileId':_0x5bd30c[_0x1a36('0x63')]},'raw':!![]})[_0x1a36('0x1e')](function(_0x1e9eba){if(_0x1e9eba&&_0x1e9eba[_0x1a36('0x64')]===0x0){return db[_0x1a36('0x65')][_0x1a36('0x5d')]({'name':_0x5d1f42[_0x1a36('0x3b')],'resourceId':_0x5d1f42['id'],'type':_0x1e9eba['name'],'sectionId':_0x1e9eba['id']},{})[_0x1a36('0x1e')](function(){return _0x530f01;});}else{return _0x530f01;}})[_0x1a36('0x57')](function(_0x44ff05){logger[_0x1a36('0x25')](_0x1a36('0x66'),_0x44ff05);throw _0x44ff05;});}return _0x530f01;})[_0x1a36('0x1e')](respondWithResult(_0x19d50f,0xc9))[_0x1a36('0x57')](handleError(_0x19d50f,null));};exports[_0x1a36('0x36')]=function(_0xb64a2b,_0x5bab52){if(_0xb64a2b[_0x1a36('0x5e')]['id']){delete _0xb64a2b[_0x1a36('0x5e')]['id'];}return db[_0x1a36('0x3d')][_0x1a36('0x5c')]({'where':{'id':_0xb64a2b[_0x1a36('0x59')]['id']}})[_0x1a36('0x1e')](handleEntityNotFound(_0x5bab52,null))[_0x1a36('0x1e')](saveUpdates(_0xb64a2b[_0x1a36('0x5e')],null))[_0x1a36('0x1e')](respondWithResult(_0x5bab52,null))[_0x1a36('0x57')](handleError(_0x5bab52,null));};exports[_0x1a36('0x39')]=function(_0x2e6c4b,_0x2c181e){return db[_0x1a36('0x3d')][_0x1a36('0x5c')]({'where':{'id':_0x2e6c4b[_0x1a36('0x59')]['id']}})[_0x1a36('0x1e')](handleEntityNotFound(_0x2c181e,null))[_0x1a36('0x1e')](removeEntity(_0x2c181e,null))['catch'](handleError(_0x2c181e,null));};exports[_0x1a36('0x67')]=function(_0x4ad4f7,_0x503a44){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x503a44,null))[_0x1a36('0x57')](handleError(_0x503a44,null));};exports[_0x1a36('0x68')]=function(_0x26d7d1,_0x2018dd,_0x1c4961){var _0x3ecfa2={'raw':!![],'where':{}},_0xa616b8={},_0x349167;return db['ChatQueue'][_0x1a36('0x69')]({'where':{'id':_0x26d7d1[_0x1a36('0x59')]['id']}})['then'](handleEntityNotFound(_0x2018dd,null))[_0x1a36('0x1e')](function(_0x39b4fc){if(_0x39b4fc){_0x349167=_0x39b4fc[_0x1a36('0x37')]({'plain':!![]});_0xa616b8[_0x1a36('0x45')]=_[_0x1a36('0x5a')](db[_0x1a36('0x6a')][_0x1a36('0x3e')]);_0xa616b8['query']=_[_0x1a36('0x5a')](_0x26d7d1[_0x1a36('0x43')]);_0xa616b8[_0x1a36('0x44')]=_[_0x1a36('0x47')](_0xa616b8[_0x1a36('0x45')],_0xa616b8[_0x1a36('0x43')]);_0x3ecfa2['attributes']=_['intersection'](_0xa616b8['model'],qs[_0x1a36('0x48')](_0x26d7d1['query'][_0x1a36('0x48')]));_0x3ecfa2[_0x1a36('0x46')]=_0x3ecfa2[_0x1a36('0x46')][_0x1a36('0x49')]?_0x3ecfa2[_0x1a36('0x46')]:_0xa616b8[_0x1a36('0x45')];if(!_0x26d7d1[_0x1a36('0x43')][_0x1a36('0x4a')](_0x1a36('0x4b'))){_0x3ecfa2[_0x1a36('0x2f')]=qs[_0x1a36('0x2f')](_0x26d7d1[_0x1a36('0x43')][_0x1a36('0x2f')]);_0x3ecfa2[_0x1a36('0x2d')]=qs[_0x1a36('0x2d')](_0x26d7d1[_0x1a36('0x43')]['offset']);}_0x3ecfa2['order']=qs[_0x1a36('0x4d')](_0x26d7d1[_0x1a36('0x43')][_0x1a36('0x4d')]);_0x3ecfa2['where']=qs['filters'](_[_0x1a36('0x4e')](_0x26d7d1[_0x1a36('0x43')],_0xa616b8['filters']));_0x3ecfa2[_0x1a36('0x51')][_0x1a36('0x6b')]=_0x39b4fc['id'];if(_0x26d7d1[_0x1a36('0x43')]['filter']){_0x3ecfa2[_0x1a36('0x51')]=_[_0x1a36('0x50')](_0x3ecfa2['where'],{'$or':_['map'](_0x3ecfa2['attributes'],function(_0x2d2e5c){var _0x53c431={};_0x53c431[_0x2d2e5c]={'$like':'%'+_0x26d7d1['query'][_0x1a36('0x4f')]+'%'};return _0x53c431;})});}_0x3ecfa2=_[_0x1a36('0x50')]({},_0x3ecfa2,_0x26d7d1['options']);return db[_0x1a36('0x6a')][_0x1a36('0x55')](_0x3ecfa2);}})[_0x1a36('0x1e')](function(_0x214d33){if(_0x214d33){return db['User'][_0x1a36('0x6c')]({'where':{'id':_['map'](_0x214d33,_0x1a36('0x6d')),'role':_0x1a36('0x6e')},'attributes':['id','name',_0x1a36('0x6f'),_0x1a36('0x70'),'createdAt']});}})[_0x1a36('0x1e')](function(_0x563fae){if(_0x563fae){return{'count':_0x563fae[_0x1a36('0x30')],'rows':_['map'](_0x563fae[_0x1a36('0x56')],function(_0x5b03dd){return{'membername':_0x5b03dd[_0x1a36('0x3b')],'UserId':_0x5b03dd['id'],'queue_name':_0x349167[_0x1a36('0x3b')],'ChatQueueId':_0x349167['id'],'interface':util[_0x1a36('0x71')](_0x1a36('0x72'),_0x1a36('0x73'),_0x5b03dd[_0x1a36('0x3b')]),'penalty':0x0,'paused':_0x5b03dd[_0x1a36('0x6f')],'createdAt':_0x5b03dd[_0x1a36('0x74')],'updatedAt':_0x5b03dd[_0x1a36('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2018dd,_0x3ecfa2))[_0x1a36('0x57')](handleError(_0x2018dd,null));};exports['getTeams']=function(_0x26af21,_0x25d98a,_0x300bd5){var _0x57ec30={};var _0x460c2d={};var _0x11408f;var _0xb093fe;return db[_0x1a36('0x3d')][_0x1a36('0x69')]({'where':{'id':_0x26af21[_0x1a36('0x59')]['id']}})['then'](handleEntityNotFound(_0x25d98a,null))['then'](function(_0x118d12){if(_0x118d12){_0x11408f=_0x118d12;_0x460c2d[_0x1a36('0x45')]=_['keys'](db[_0x1a36('0x75')][_0x1a36('0x3e')]);_0x460c2d['query']=_[_0x1a36('0x5a')](_0x26af21[_0x1a36('0x43')]);_0x460c2d[_0x1a36('0x44')]=_[_0x1a36('0x47')](_0x460c2d[_0x1a36('0x45')],_0x460c2d['query']);_0x57ec30[_0x1a36('0x46')]=_[_0x1a36('0x47')](_0x460c2d[_0x1a36('0x45')],qs[_0x1a36('0x48')](_0x26af21[_0x1a36('0x43')][_0x1a36('0x48')]));_0x57ec30['attributes']=_0x57ec30[_0x1a36('0x46')][_0x1a36('0x49')]?_0x57ec30[_0x1a36('0x46')]:_0x460c2d['model'];_0x57ec30['order']=qs['sort'](_0x26af21['query'][_0x1a36('0x4d')]);_0x57ec30['where']=qs[_0x1a36('0x44')](_['pick'](_0x26af21[_0x1a36('0x43')],_0x460c2d['filters']));if(_0x26af21[_0x1a36('0x43')][_0x1a36('0x4f')]){_0x57ec30[_0x1a36('0x51')]=_[_0x1a36('0x50')](_0x57ec30[_0x1a36('0x51')],{'$or':_[_0x1a36('0x42')](_0x57ec30[_0x1a36('0x46')],function(_0x2f6074){var _0x4eeb6a={};_0x4eeb6a[_0x2f6074]={'$like':'%'+_0x26af21[_0x1a36('0x43')][_0x1a36('0x4f')]+'%'};return _0x4eeb6a;})});}_0x57ec30=_[_0x1a36('0x50')]({},_0x57ec30,_0x26af21[_0x1a36('0x53')]);return _0x11408f[_0x1a36('0x76')](_0x57ec30);}})['then'](function(_0x2de479){if(_0x2de479){_0xb093fe=_0x2de479[_0x1a36('0x49')];if(!_0x26af21['query']['hasOwnProperty']('nolimit')){_0x57ec30[_0x1a36('0x2f')]=qs[_0x1a36('0x2f')](_0x26af21[_0x1a36('0x43')][_0x1a36('0x2f')]);_0x57ec30[_0x1a36('0x2d')]=qs[_0x1a36('0x2d')](_0x26af21[_0x1a36('0x43')][_0x1a36('0x2d')]);}return _0x11408f[_0x1a36('0x76')](_0x57ec30);}})['then'](function(_0x581ef5){if(_0x581ef5){return _0x581ef5?{'count':_0xb093fe,'rows':_0x581ef5}:null;}})[_0x1a36('0x1e')](respondWithResult(_0x25d98a,null))[_0x1a36('0x57')](handleError(_0x25d98a,null));};exports[_0x1a36('0x77')]=function(_0x4497ba,_0x179b43,_0x5a2862){var _0x1599ee=_0x4497ba[_0x1a36('0x5e')][_0x1a36('0x78')];return db[_0x1a36('0x75')]['findAll']({'where':{'id':_0x1599ee},'attributes':['id'],'include':[{'model':db[_0x1a36('0x79')],'as':_0x1a36('0x7a'),'attributes':['id',_0x1a36('0x3b'),_0x1a36('0x7b'),_0x1a36('0x7c'),_0x1a36('0x7d')],'raw':!![]}]})['then'](function(_0x535b88){if(_0x535b88){var _0x2f6810=_['flatMap'](_0x535b88,function(_0x582b3f){var _0x435b0e=_0x582b3f[_0x1a36('0x37')]({'plain':!![]});return _0x435b0e[_0x1a36('0x7a')];});return db['ChatQueue'][_0x1a36('0x5c')]({'where':{'id':_0x4497ba['params']['id']}})['then'](function(_0x270293){return db['sequelize'][_0x1a36('0x7e')](function(_0x17ee18){return _0x270293[_0x1a36('0x77')](_0x1599ee,{'transaction':_0x17ee18})['then'](function(){return BPromise['each'](_0x2f6810,function(_0x5a0eeb){return db[_0x1a36('0x6a')][_0x1a36('0x7f')]({'where':{'UserId':_0x5a0eeb['id'],'ChatQueueId':_0x4497ba[_0x1a36('0x59')]['id']},'transaction':_0x17ee18});});})[_0x1a36('0x1e')](function(){_0x2f6810[_0x1a36('0x80')](function(_0x2871fc){socket['emit'](_0x1a36('0x81'),{'UserId':_0x2871fc['id'],'ChatQueueId':_0x270293['id']});});});});});}})['then'](respondWithStatusCode(_0x179b43,null))[_0x1a36('0x57')](handleError(_0x179b43,null));};exports[_0x1a36('0x82')]=function(_0x40ad39,_0x58f26f,_0x30153d){return db[_0x1a36('0x75')][_0x1a36('0x55')]({'where':{'id':_0x40ad39['query'][_0x1a36('0x78')]},'attributes':['id'],'include':[{'model':db[_0x1a36('0x79')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1a36('0x1e')](handleEntityNotFound(_0x58f26f,null))['then'](function(_0x2db58c){var _0x30100a=_['map'](_0x2db58c,'id');var _0x487800=[];var _0x3222f4=[];var _0x44a286=squel[_0x1a36('0x83')]();_0x44a286[_0x1a36('0x84')](_0x1a36('0x85'))[_0x1a36('0x86')](_0x1a36('0x87'),'tq')[_0x1a36('0x88')](_0x1a36('0x89'),'ut',_0x1a36('0x8a'))[_0x1a36('0x51')]('ChatQueueId\x20=\x20?',_0x40ad39[_0x1a36('0x59')]['id']);for(var _0x522264=0x0;_0x522264<_0x2db58c[_0x1a36('0x49')];_0x522264+=0x1){let _0x3e984c=_0x2db58c[_0x522264];for(var _0x3912f0=0x0;_0x3912f0<_0x3e984c['Agents'][_0x1a36('0x49')];_0x3912f0+=0x1){let _0x5388d6=_0x3e984c[_0x1a36('0x7a')][_0x3912f0];var _0x273c87=_0x44a286[_0x1a36('0x8b')]();_0x273c87[_0x1a36('0x51')](_0x1a36('0x8c'),_0x5388d6['id']);_0x3222f4[_0x1a36('0x8d')](db[_0x1a36('0x8e')][_0x1a36('0x43')](_0x273c87['toString'](),{'type':db[_0x1a36('0x8e')][_0x1a36('0x8f')][_0x1a36('0x90')]})['then'](function(_0x3e3bb8){if(_0x3e3bb8['length']===0x1){return _0x5388d6['id'];}else{var _0x12e728=_[_0x1a36('0x91')](_[_0x1a36('0x42')](_0x3e3bb8,'TeamId'),function(_0x2c9b92){return _[_0x1a36('0x92')](_0x30100a,_0x2c9b92);});if(_0x12e728){return _0x5388d6['id'];}}}));}}return BPromise[_0x1a36('0x93')](_0x3222f4)[_0x1a36('0x1e')](function(_0x25008f){_0x487800=_(_0x487800)['union'](_0x25008f)[_0x1a36('0x94')]()[_0x1a36('0x95')]();return db[_0x1a36('0x3d')][_0x1a36('0x5c')]({'where':{'id':_0x40ad39[_0x1a36('0x59')]['id']}})[_0x1a36('0x1e')](function(_0xd590ed){return db['sequelize'][_0x1a36('0x7e')](function(_0x419f0b){return _0xd590ed[_0x1a36('0x82')](_0x40ad39['query'][_0x1a36('0x78')],{'transaction':_0x419f0b})[_0x1a36('0x1e')](function(){if(!_['isEmpty'](_0x487800)){return _0xd590ed[_0x1a36('0x96')](_0x487800,{'transaction':_0x419f0b});}})['then'](function(){_0x487800['forEach'](function(_0x988f89){socket['emit'](_0x1a36('0x97'),{'UserId':_0x988f89,'ChatQueueId':_0xd590ed['id']});});});});});});})[_0x1a36('0x1e')](respondWithStatusCode(_0x58f26f,null))[_0x1a36('0x57')](handleError(_0x58f26f,null));};exports['addAgents']=function(_0x5e66a6,_0x345675,_0x110eb8){return db['ChatQueue'][_0x1a36('0x5c')]({'where':{'id':_0x5e66a6['params']['id']}})[_0x1a36('0x1e')](handleEntityNotFound(_0x345675,null))[_0x1a36('0x1e')](function(_0x1b4eb8){if(_0x1b4eb8){return _0x1b4eb8[_0x1a36('0x98')](_0x5e66a6[_0x1a36('0x5e')][_0x1a36('0x78')],_[_0x1a36('0x99')](_0x5e66a6[_0x1a36('0x5e')],[_0x1a36('0x78'),'id'])||{})[_0x1a36('0x9a')](function(_0x1cb881){for(var _0x321639=0x0;_0x321639<_0x5e66a6[_0x1a36('0x5e')][_0x1a36('0x78')][_0x1a36('0x49')];_0x321639+=0x1){socket[_0x1a36('0x9b')]('userChatQueue:save',{'UserId':Number(_0x5e66a6[_0x1a36('0x5e')][_0x1a36('0x78')][_0x321639]),'ChatQueueId':Number(_0x5e66a6[_0x1a36('0x59')]['id'])});}return _0x1cb881;});}})[_0x1a36('0x1e')](respondWithResult(_0x345675,null))[_0x1a36('0x57')](handleError(_0x345675,null));};exports[_0x1a36('0x96')]=function(_0x455d7e,_0x34dd12,_0xac83f6){return db[_0x1a36('0x3d')][_0x1a36('0x5c')]({'where':{'id':_0x455d7e['params']['id']}})[_0x1a36('0x1e')](handleEntityNotFound(_0x34dd12,null))[_0x1a36('0x1e')](function(_0x40308a){if(_0x40308a){return _0x40308a[_0x1a36('0x96')](_0x455d7e['query'][_0x1a36('0x78')])[_0x1a36('0x1e')](function(){if(_[_0x1a36('0x9c')](_0x455d7e[_0x1a36('0x43')][_0x1a36('0x78')])){for(var _0x574ca3=0x0;_0x574ca3<_0x455d7e[_0x1a36('0x43')]['ids'][_0x1a36('0x49')];_0x574ca3+=0x1){socket[_0x1a36('0x9b')](_0x1a36('0x97'),{'UserId':Number(_0x455d7e[_0x1a36('0x43')]['ids'][_0x574ca3]),'ChatQueueId':Number(_0x455d7e['params']['id'])});}}else{socket[_0x1a36('0x9b')]('userChatQueue:remove',{'UserId':Number(_0x455d7e[_0x1a36('0x43')][_0x1a36('0x78')]),'ChatQueueId':Number(_0x455d7e[_0x1a36('0x59')]['id'])});}});}})[_0x1a36('0x1e')](respondWithStatusCode(_0x34dd12,null))[_0x1a36('0x57')](handleError(_0x34dd12,null));};exports['getAgents']=function(_0x1690af,_0x2b6304,_0x5012f5){var _0x537233={};var _0x5bd3b3={};var _0x25dc30;var _0x5e60b7;return db['ChatQueue']['findOne']({'where':{'id':_0x1690af[_0x1a36('0x59')]['id']}})[_0x1a36('0x1e')](handleEntityNotFound(_0x2b6304,null))['then'](function(_0x4f01fd){if(_0x4f01fd){_0x25dc30=_0x4f01fd;_0x5bd3b3[_0x1a36('0x45')]=_[_0x1a36('0x5a')](db[_0x1a36('0x79')][_0x1a36('0x3e')]);_0x5bd3b3[_0x1a36('0x43')]=_[_0x1a36('0x5a')](_0x1690af[_0x1a36('0x43')]);_0x5bd3b3['filters']=_[_0x1a36('0x47')](_0x5bd3b3[_0x1a36('0x45')],_0x5bd3b3[_0x1a36('0x43')]);_0x537233[_0x1a36('0x46')]=_[_0x1a36('0x47')](_0x5bd3b3[_0x1a36('0x45')],qs[_0x1a36('0x48')](_0x1690af[_0x1a36('0x43')][_0x1a36('0x48')]));_0x537233[_0x1a36('0x46')]=_0x537233['attributes'][_0x1a36('0x49')]?_0x537233[_0x1a36('0x46')]:_0x5bd3b3['model'];_0x537233[_0x1a36('0x4c')]=qs[_0x1a36('0x4d')](_0x1690af[_0x1a36('0x43')][_0x1a36('0x4d')]);_0x537233[_0x1a36('0x51')]=qs[_0x1a36('0x44')](_['pick'](_0x1690af['query'],_0x5bd3b3[_0x1a36('0x44')]));if(_0x1690af[_0x1a36('0x43')][_0x1a36('0x4f')]){_0x537233[_0x1a36('0x51')]=_['merge'](_0x537233[_0x1a36('0x51')],{'$or':_['map'](_0x537233[_0x1a36('0x46')],function(_0x55ce7f){var _0x51d301={};_0x51d301[_0x55ce7f]={'$like':'%'+_0x1690af[_0x1a36('0x43')][_0x1a36('0x4f')]+'%'};return _0x51d301;})});}_0x537233=_[_0x1a36('0x50')]({},_0x537233,_0x1690af[_0x1a36('0x53')]);return _0x25dc30['getAgents'](_0x537233);}})[_0x1a36('0x1e')](function(_0x5f0796){if(_0x5f0796){_0x5e60b7=_0x5f0796[_0x1a36('0x49')];if(!_0x1690af[_0x1a36('0x43')][_0x1a36('0x4a')](_0x1a36('0x4b'))){_0x537233['limit']=qs[_0x1a36('0x2f')](_0x1690af['query'][_0x1a36('0x2f')]);_0x537233['offset']=qs[_0x1a36('0x2d')](_0x1690af[_0x1a36('0x43')][_0x1a36('0x2d')]);}return _0x25dc30['getAgents'](_0x537233);}})[_0x1a36('0x1e')](function(_0x558ca9){if(_0x558ca9){return _0x558ca9?{'count':_0x5e60b7,'rows':_0x558ca9}:null;}})[_0x1a36('0x1e')](respondWithResult(_0x2b6304,null))[_0x1a36('0x57')](handleError(_0x2b6304,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 6848ea1..4202897 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 _0xcef6=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x28d91c,_0x3f0c1f){var _0x513ffc=function(_0xbc3ef5){while(--_0xbc3ef5){_0x28d91c['push'](_0x28d91c['shift']());}};_0x513ffc(++_0x3f0c1f);}(_0xcef6,0xa3));var _0x6cef=function(_0x29fc2c,_0x4ff86a){_0x29fc2c=_0x29fc2c-0x0;var _0x1adbc8=_0xcef6[_0x29fc2c];return _0x1adbc8;};'use strict';var EventEmitter=require(_0x6cef('0x0'));var ChatQueue=require(_0x6cef('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6cef('0x2')](0x0);var events={'afterCreate':_0x6cef('0x3'),'afterUpdate':'update','afterDestroy':_0x6cef('0x4')};function emitEvent(_0x1e2d4f){return function(_0x46462a,_0x424cf9,_0x36fd54){ChatQueueEvents[_0x6cef('0x5')](_0x1e2d4f+':'+_0x46462a['id'],_0x46462a);ChatQueueEvents[_0x6cef('0x5')](_0x1e2d4f,_0x46462a);_0x36fd54(null);};}for(var e in events){if(events[_0x6cef('0x6')](e)){var event=events[e];ChatQueue[_0x6cef('0x7')](e,emitEvent(event));}}module[_0x6cef('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xdd92=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x2951b9,_0x4dea6e){var _0x514c7b=function(_0x10c7bc){while(--_0x10c7bc){_0x2951b9['push'](_0x2951b9['shift']());}};_0x514c7b(++_0x4dea6e);}(_0xdd92,0x188));var _0x2dd9=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xdd92[_0x5a776b];return _0xbbef59;};'use strict';var EventEmitter=require(_0x2dd9('0x0'));var ChatQueue=require(_0x2dd9('0x1'))['db'][_0x2dd9('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2dd9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2dd9('0x4'),'afterDestroy':_0x2dd9('0x5')};function emitEvent(_0x55beb9){return function(_0x439efd,_0x481ac9,_0x1aae6c){ChatQueueEvents[_0x2dd9('0x6')](_0x55beb9+':'+_0x439efd['id'],_0x439efd);ChatQueueEvents[_0x2dd9('0x6')](_0x55beb9,_0x439efd);_0x1aae6c(null);};}for(var e in events){if(events[_0x2dd9('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x2dd9('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 14a1598..f791d37 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 _0x03f9=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','chat_queues','lodash'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0x03f9,0x1e9));var _0x903f=function(_0x3986fc,_0x41fd49){_0x3986fc=_0x3986fc-0x0;var _0x514bd1=_0x03f9[_0x3986fc];return _0x514bd1;};'use strict';var _=require(_0x903f('0x0'));var util=require(_0x903f('0x1'));var logger=require(_0x903f('0x2'))(_0x903f('0x3'));var moment=require(_0x903f('0x4'));var BPromise=require('bluebird');var rp=require(_0x903f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x903f('0x6'));var config=require(_0x903f('0x7'));var attributes=require('./chatQueue.attributes');module[_0x903f('0x8')]=function(_0x1acc50,_0x46e110){return _0x1acc50['define']('ChatQueue',attributes,{'tableName':_0x903f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d50=['request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','bluebird'];(function(_0x4003e2,_0x2233f9){var _0x3d7ed0=function(_0x4e4793){while(--_0x4e4793){_0x4003e2['push'](_0x4003e2['shift']());}};_0x3d7ed0(++_0x2233f9);}(_0x1d50,0xe5));var _0x01d5=function(_0x56b123,_0x21f4ca){_0x56b123=_0x56b123-0x0;var _0x264d98=_0x1d50[_0x56b123];return _0x264d98;};'use strict';var _=require(_0x01d5('0x0'));var util=require(_0x01d5('0x1'));var logger=require('../../config/logger')(_0x01d5('0x2'));var moment=require(_0x01d5('0x3'));var BPromise=require(_0x01d5('0x4'));var rp=require(_0x01d5('0x5'));var fs=require('fs');var path=require(_0x01d5('0x6'));var rimraf=require(_0x01d5('0x7'));var config=require('../../config/environment');var attributes=require(_0x01d5('0x8'));module[_0x01d5('0x9')]=function(_0x34f297,_0x4d359a){return _0x34f297[_0x01d5('0xa')](_0x01d5('0xb'),attributes,{'tableName':_0x01d5('0xc'),'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 5b81574..93cd4f9 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 _0xf485=['./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetChatQueue','findAll','options','attributes','map','include','model','stringify','ShowChatQueue','ChatQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter'];(function(_0x1a89bf,_0x769e66){var _0x5ca759=function(_0x1d1f16){while(--_0x1d1f16){_0x1a89bf['push'](_0x1a89bf['shift']());}};_0x5ca759(++_0x769e66);}(_0xf485,0xd1));var _0x5f48=function(_0x268b73,_0x3034c1){_0x268b73=_0x268b73-0x0;var _0x313765=_0xf485[_0x268b73];return _0x313765;};'use strict';var _=require(_0x5f48('0x0'));var util=require(_0x5f48('0x1'));var moment=require(_0x5f48('0x2'));var BPromise=require(_0x5f48('0x3'));var rs=require(_0x5f48('0x4'));var fs=require('fs');var Redis=require(_0x5f48('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f48('0x6'));var logger=require(_0x5f48('0x7'))('rpc');var config=require(_0x5f48('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f48('0x9')]['http']({'port':0x232a});config[_0x5f48('0xa')]=_[_0x5f48('0xb')](config[_0x5f48('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5f48('0xc'))(new Redis(config[_0x5f48('0xa')]));require(_0x5f48('0xd'))['register'](socket);function respondWithRpcPromise(_0x24aead,_0x2b51a2,_0xe7b231){return new BPromise(function(_0x1b1be7,_0x31f25a){return client['request'](_0x24aead,_0xe7b231)[_0x5f48('0xe')](function(_0x2a650e){logger[_0x5f48('0xf')](_0x5f48('0x10'),_0x2b51a2,_0x5f48('0x11'));logger[_0x5f48('0x12')](_0x5f48('0x13'),_0x2b51a2,'request\x20sent',JSON['stringify'](_0x2a650e));if(_0x2a650e['error']){if(_0x2a650e[_0x5f48('0x14')][_0x5f48('0x15')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2b51a2,_0x2a650e[_0x5f48('0x14')]['message']);return _0x31f25a(_0x2a650e[_0x5f48('0x14')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2b51a2,_0x2a650e['error'][_0x5f48('0x16')]);return _0x1b1be7(_0x2a650e['error'][_0x5f48('0x16')]);}else{logger['info'](_0x5f48('0x10'),_0x2b51a2,_0x5f48('0x11'));_0x1b1be7(_0x2a650e['result'][_0x5f48('0x16')]);}})[_0x5f48('0x17')](function(_0x3acd22){logger['error'](_0x5f48('0x10'),_0x2b51a2,_0x3acd22);_0x31f25a(_0x3acd22);});});}exports[_0x5f48('0x18')]=function(_0x434698){var _0x3fbea5=this;return new Promise(function(_0x54365f,_0x34557d){return db['ChatQueue'][_0x5f48('0x19')]({'raw':_0x434698[_0x5f48('0x1a')]?_0x434698[_0x5f48('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x434698[_0x5f48('0x1a')]?_0x434698[_0x5f48('0x1a')]['where']||null:null,'attributes':_0x434698['options']?_0x434698[_0x5f48('0x1a')][_0x5f48('0x1b')]||null:null,'limit':_0x434698[_0x5f48('0x1a')]?_0x434698[_0x5f48('0x1a')]['limit']||null:null,'include':_0x434698[_0x5f48('0x1a')]?_0x434698[_0x5f48('0x1a')]['include']?_[_0x5f48('0x1c')](_0x434698[_0x5f48('0x1a')][_0x5f48('0x1d')],function(_0x3fbe4a){return{'model':db[_0x3fbe4a[_0x5f48('0x1e')]],'as':_0x3fbe4a['as'],'attributes':_0x3fbe4a['attributes'],'include':_0x3fbe4a[_0x5f48('0x1d')]?_[_0x5f48('0x1c')](_0x3fbe4a[_0x5f48('0x1d')],function(_0x55a9ff){return{'model':db[_0x55a9ff['model']],'as':_0x55a9ff['as'],'attributes':_0x55a9ff[_0x5f48('0x1b')],'include':_0x55a9ff[_0x5f48('0x1d')]?_[_0x5f48('0x1c')](_0x55a9ff[_0x5f48('0x1d')],function(_0x477b9d){return{'model':db[_0x477b9d['model']],'as':_0x477b9d['as'],'attributes':_0x477b9d[_0x5f48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5f48('0xe')](function(_0x2f4a73){logger[_0x5f48('0xf')](_0x5f48('0x18'),_0x434698);logger[_0x5f48('0x12')](_0x5f48('0x18'),_0x434698,JSON[_0x5f48('0x1f')](_0x2f4a73));_0x54365f(_0x2f4a73);})[_0x5f48('0x17')](function(_0x3cf18f){logger[_0x5f48('0x14')]('GetChatQueue',_0x3cf18f['message'],_0x434698);_0x34557d(_0x3fbea5[_0x5f48('0x14')](0x1f4,_0x3cf18f[_0x5f48('0x16')]));});});};exports[_0x5f48('0x20')]=function(_0x2adc71){var _0x359280=this;return new Promise(function(_0x1a11c0,_0x4aeaea){return db[_0x5f48('0x21')][_0x5f48('0x22')]({'raw':_0x2adc71[_0x5f48('0x1a')]?_0x2adc71['options'][_0x5f48('0x23')]===undefined?!![]:![]:!![],'where':_0x2adc71[_0x5f48('0x1a')]?_0x2adc71[_0x5f48('0x1a')][_0x5f48('0x24')]||null:null,'attributes':_0x2adc71['options']?_0x2adc71[_0x5f48('0x1a')][_0x5f48('0x1b')]||null:null,'include':_0x2adc71[_0x5f48('0x1a')]?_0x2adc71['options'][_0x5f48('0x1d')]?_[_0x5f48('0x1c')](_0x2adc71[_0x5f48('0x1a')][_0x5f48('0x1d')],function(_0x1b3196){return{'model':db[_0x1b3196[_0x5f48('0x1e')]],'as':_0x1b3196['as'],'attributes':_0x1b3196[_0x5f48('0x1b')],'include':_0x1b3196[_0x5f48('0x1d')]?_[_0x5f48('0x1c')](_0x1b3196[_0x5f48('0x1d')],function(_0x329e9b){return{'model':db[_0x329e9b[_0x5f48('0x1e')]],'as':_0x329e9b['as'],'attributes':_0x329e9b[_0x5f48('0x1b')],'include':_0x329e9b[_0x5f48('0x1d')]?_[_0x5f48('0x1c')](_0x329e9b[_0x5f48('0x1d')],function(_0x19f373){return{'model':db[_0x19f373[_0x5f48('0x1e')]],'as':_0x19f373['as'],'attributes':_0x19f373['attributes']};}):[]};}):[]};}):[]:[]})[_0x5f48('0xe')](function(_0x5cd9ac){logger[_0x5f48('0xf')](_0x5f48('0x20'),_0x2adc71);logger[_0x5f48('0x12')](_0x5f48('0x20'),_0x2adc71,JSON['stringify'](_0x5cd9ac));_0x1a11c0(_0x5cd9ac);})['catch'](function(_0x3295ba){logger[_0x5f48('0x14')](_0x5f48('0x20'),_0x3295ba[_0x5f48('0x16')],_0x2adc71);_0x4aeaea(_0x359280[_0x5f48('0x14')](0x1f4,_0x3295ba['message']));});});};
\ No newline at end of file
+var _0x5630=['findAll','options','raw','limit','include','model','map','attributes','ShowChatQueue','ChatQueue','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatQueue.socket','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'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x5630,0xc3));var _0x0563=function(_0x31dc2e,_0x4d06bb){_0x31dc2e=_0x31dc2e-0x0;var _0x69a8c3=_0x5630[_0x31dc2e];return _0x69a8c3;};'use strict';var _=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var moment=require(_0x0563('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0563('0x3'))['db'];var utils=require(_0x0563('0x4'));var logger=require(_0x0563('0x5'))(_0x0563('0x6'));var config=require(_0x0563('0x7'));var jayson=require(_0x0563('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x0563('0x9')]=_[_0x0563('0xa')](config[_0x0563('0x9')],{'host':_0x0563('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0563('0x9')]));require(_0x0563('0xc'))[_0x0563('0xd')](socket);function respondWithRpcPromise(_0x445068,_0x2ceffe,_0x1f7ac6){return new BPromise(function(_0x715076,_0x38c2b3){return client['request'](_0x445068,_0x1f7ac6)[_0x0563('0xe')](function(_0x15ed13){logger[_0x0563('0xf')](_0x0563('0x10'),_0x2ceffe,_0x0563('0x11'));logger[_0x0563('0x12')](_0x0563('0x13'),_0x2ceffe,_0x0563('0x11'),JSON[_0x0563('0x14')](_0x15ed13));if(_0x15ed13[_0x0563('0x15')]){if(_0x15ed13[_0x0563('0x15')][_0x0563('0x16')]===0x1f4){logger['error'](_0x0563('0x10'),_0x2ceffe,_0x15ed13[_0x0563('0x15')][_0x0563('0x17')]);return _0x38c2b3(_0x15ed13[_0x0563('0x15')]['message']);}logger['error'](_0x0563('0x10'),_0x2ceffe,_0x15ed13['error'][_0x0563('0x17')]);return _0x715076(_0x15ed13[_0x0563('0x15')]['message']);}else{logger[_0x0563('0xf')]('ChatQueue,\x20%s,\x20%s',_0x2ceffe,_0x0563('0x11'));_0x715076(_0x15ed13[_0x0563('0x18')][_0x0563('0x17')]);}})[_0x0563('0x19')](function(_0x5a3ace){logger[_0x0563('0x15')](_0x0563('0x10'),_0x2ceffe,_0x5a3ace);_0x38c2b3(_0x5a3ace);});});}exports[_0x0563('0x1a')]=function(_0x3e6bde){var _0xd8612d=this;return new Promise(function(_0x5f2636,_0x530d4b){return db['ChatQueue'][_0x0563('0x1b')]({'raw':_0x3e6bde[_0x0563('0x1c')]?_0x3e6bde[_0x0563('0x1c')][_0x0563('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e6bde[_0x0563('0x1c')]?_0x3e6bde[_0x0563('0x1c')]['where']||null:null,'attributes':_0x3e6bde['options']?_0x3e6bde['options']['attributes']||null:null,'limit':_0x3e6bde['options']?_0x3e6bde['options'][_0x0563('0x1e')]||null:null,'include':_0x3e6bde[_0x0563('0x1c')]?_0x3e6bde['options']['include']?_['map'](_0x3e6bde[_0x0563('0x1c')][_0x0563('0x1f')],function(_0x592d4d){return{'model':db[_0x592d4d[_0x0563('0x20')]],'as':_0x592d4d['as'],'attributes':_0x592d4d['attributes'],'include':_0x592d4d['include']?_[_0x0563('0x21')](_0x592d4d[_0x0563('0x1f')],function(_0x5449c5){return{'model':db[_0x5449c5[_0x0563('0x20')]],'as':_0x5449c5['as'],'attributes':_0x5449c5[_0x0563('0x22')],'include':_0x5449c5[_0x0563('0x1f')]?_[_0x0563('0x21')](_0x5449c5[_0x0563('0x1f')],function(_0x2944ea){return{'model':db[_0x2944ea['model']],'as':_0x2944ea['as'],'attributes':_0x2944ea[_0x0563('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0563('0xe')](function(_0x59a355){logger['info'](_0x0563('0x1a'),_0x3e6bde);logger['debug'](_0x0563('0x1a'),_0x3e6bde,JSON[_0x0563('0x14')](_0x59a355));_0x5f2636(_0x59a355);})[_0x0563('0x19')](function(_0x2196ff){logger[_0x0563('0x15')](_0x0563('0x1a'),_0x2196ff[_0x0563('0x17')],_0x3e6bde);_0x530d4b(_0xd8612d[_0x0563('0x15')](0x1f4,_0x2196ff[_0x0563('0x17')]));});});};exports[_0x0563('0x23')]=function(_0x1829bb){var _0x13b2fe=this;return new Promise(function(_0x44330b,_0x25301c){return db[_0x0563('0x24')]['find']({'raw':_0x1829bb[_0x0563('0x1c')]?_0x1829bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x1829bb[_0x0563('0x1c')]?_0x1829bb[_0x0563('0x1c')]['where']||null:null,'attributes':_0x1829bb[_0x0563('0x1c')]?_0x1829bb[_0x0563('0x1c')][_0x0563('0x22')]||null:null,'include':_0x1829bb[_0x0563('0x1c')]?_0x1829bb[_0x0563('0x1c')]['include']?_[_0x0563('0x21')](_0x1829bb['options'][_0x0563('0x1f')],function(_0x2186eb){return{'model':db[_0x2186eb[_0x0563('0x20')]],'as':_0x2186eb['as'],'attributes':_0x2186eb[_0x0563('0x22')],'include':_0x2186eb[_0x0563('0x1f')]?_[_0x0563('0x21')](_0x2186eb[_0x0563('0x1f')],function(_0x72c1b9){return{'model':db[_0x72c1b9[_0x0563('0x20')]],'as':_0x72c1b9['as'],'attributes':_0x72c1b9[_0x0563('0x22')],'include':_0x72c1b9['include']?_[_0x0563('0x21')](_0x72c1b9[_0x0563('0x1f')],function(_0x3d8c34){return{'model':db[_0x3d8c34['model']],'as':_0x3d8c34['as'],'attributes':_0x3d8c34[_0x0563('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ddfd5){logger[_0x0563('0xf')](_0x0563('0x23'),_0x1829bb);logger[_0x0563('0x12')](_0x0563('0x23'),_0x1829bb,JSON[_0x0563('0x14')](_0x2ddfd5));_0x44330b(_0x2ddfd5);})['catch'](function(_0x1aa742){logger[_0x0563('0x15')](_0x0563('0x23'),_0x1aa742[_0x0563('0x17')],_0x1829bb);_0x25301c(_0x13b2fe[_0x0563('0x15')](0x1f4,_0x1aa742[_0x0563('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 7b7e567..1d6d821 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 _0x008c=['./chatQueue.events','save','remove','update','emit','removeListener','register','chatQueue:'];(function(_0x211f03,_0x4132a4){var _0x3e2d0c=function(_0x4a4e01){while(--_0x4a4e01){_0x211f03['push'](_0x211f03['shift']());}};_0x3e2d0c(++_0x4132a4);}(_0x008c,0x188));var _0xc008=function(_0x4b48e5,_0xc3c425){_0x4b48e5=_0x4b48e5-0x0;var _0x210b17=_0x008c[_0x4b48e5];return _0x210b17;};'use strict';var ChatQueueEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){ChatQueueEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);ChatQueueEvents['on'](_0x428fa9,_0x5aa09b);}};
\ No newline at end of file
+var _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x2e2e5d,_0x24f8bf){var _0x5df15e=function(_0x595f2a){while(--_0x595f2a){_0x2e2e5d['push'](_0x2e2e5d['shift']());}};_0x5df15e(++_0x24f8bf);}(_0x54ef,0x112));var _0xf54e=function(_0x55a170,_0x55ffb2){_0x55a170=_0x55a170-0x0;var _0x2e46c9=_0x54ef[_0x55a170];return _0x2e46c9;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 550be93..d3ba913 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x33e263,_0x2d0001){var _0x513d84=function(_0x1b3fa4){while(--_0x1b3fa4){_0x33e263['push'](_0x33e263['shift']());}};_0x513d84(++_0x2d0001);}(_0x814b,0x1a2));var _0xb814=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0x814b[_0x5a2d95];return _0x2c3986;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1ccb2b,_0x2c3a47){var _0x2080ef=function(_0x425a4a){while(--_0x425a4a){_0x1ccb2b['push'](_0x1ccb2b['shift']());}};_0x2080ef(++_0x2c3a47);}(_0x7217,0x19e));var _0x7721=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x7217[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e8e83a8..229a63d 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 _0x6fe4=['moment','sequelize','exports','STRING','DATE'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x6fe4,0xc8));var _0x46fe=function(_0x585745,_0xe0fa8c){_0x585745=_0x585745-0x0;var _0x584ec4=_0x6fe4[_0x585745];return _0x584ec4;};'use strict';var moment=require(_0x46fe('0x0'));var Sequelize=require(_0x46fe('0x1'));module[_0x46fe('0x2')]={'uniqueid':{'type':Sequelize[_0x46fe('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x46fe('0x3')]},'joinAt':{'type':Sequelize[_0x46fe('0x4')]},'leaveAt':{'type':Sequelize[_0x46fe('0x4')]},'acceptAt':{'type':Sequelize[_0x46fe('0x4')]},'exitAt':{'type':Sequelize[_0x46fe('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe767=['STRING','DATE','sequelize','exports'];(function(_0x4dd9c3,_0x25cdb9){var _0x5b808f=function(_0xfe176f){while(--_0xfe176f){_0x4dd9c3['push'](_0x4dd9c3['shift']());}};_0x5b808f(++_0x25cdb9);}(_0xe767,0x11e));var _0x7e76=function(_0x3652a0,_0x2ab9f8){_0x3652a0=_0x3652a0-0x0;var _0x2fa7d5=_0xe767[_0x3652a0];return _0x2fa7d5;};'use strict';var moment=require('moment');var Sequelize=require(_0x7e76('0x0'));module[_0x7e76('0x1')]={'uniqueid':{'type':Sequelize[_0x7e76('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7e76('0x2')]},'joinAt':{'type':Sequelize[_0x7e76('0x3')]},'leaveAt':{'type':Sequelize[_0x7e76('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7e76('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 53b6aeb..e114d96 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 _0x8212=['order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','ChatQueueReport','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit'];(function(_0x44ace3,_0x2e0ced){var _0x5148db=function(_0x40211b){while(--_0x40211b){_0x44ace3['push'](_0x44ace3['shift']());}};_0x5148db(++_0x2e0ced);}(_0x8212,0xb3));var _0x2821=function(_0x51851c,_0x1a7c28){_0x51851c=_0x51851c-0x0;var _0x2a585b=_0x8212[_0x51851c];return _0x2a585b;};'use strict';var emlformat=require(_0x2821('0x0'));var rimraf=require(_0x2821('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2821('0x2'));var rp=require(_0x2821('0x3'));var moment=require(_0x2821('0x4'));var BPromise=require(_0x2821('0x5'));var Mustache=require(_0x2821('0x6'));var util=require(_0x2821('0x7'));var path=require(_0x2821('0x8'));var sox=require(_0x2821('0x9'));var csv=require('to-csv');var ejs=require(_0x2821('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2821('0xb'));var squel=require(_0x2821('0xc'));var crypto=require('crypto');var jsforce=require(_0x2821('0xd'));var deskjs=require(_0x2821('0xe'));var toCsv=require(_0x2821('0xf'));var querystring=require(_0x2821('0x10'));var Papa=require(_0x2821('0x11'));var Redis=require(_0x2821('0x12'));var authService=require(_0x2821('0x13'));var qs=require(_0x2821('0x14'));var as=require(_0x2821('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2821('0x16'))(_0x2821('0x17'));var utils=require(_0x2821('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c81c1,_0x11d227){_0x11d227=_0x11d227||0xcc;return function(_0x18a2bb){if(_0x18a2bb){return _0x4c81c1[_0x2821('0x19')](_0x11d227);}return _0x4c81c1[_0x2821('0x1a')](_0x11d227)[_0x2821('0x1b')]();};}function respondWithResult(_0x2fbc96,_0x5d5ee5){_0x5d5ee5=_0x5d5ee5||0xc8;return function(_0x3ba091){if(_0x3ba091){return _0x2fbc96['status'](_0x5d5ee5)['json'](_0x3ba091);}};}function respondWithFilteredResult(_0x4142f1,_0xe30acf){return function(_0x243c46){if(_0x243c46){var _0x472238=typeof _0xe30acf['offset']===_0x2821('0x1c')&&typeof _0xe30acf['limit']===_0x2821('0x1c');var _0x2673d2=_0x243c46[_0x2821('0x1d')];var _0x3f1057=_0x472238?0x0:_0xe30acf[_0x2821('0x1e')];var _0x500357=_0x472238?_0x243c46[_0x2821('0x1d')]:_0xe30acf[_0x2821('0x1e')]+_0xe30acf['limit'];var _0x22990a;if(_0x500357>=_0x2673d2){_0x500357=_0x2673d2;_0x22990a=0xc8;}else{_0x22990a=0xce;}_0x4142f1['status'](_0x22990a);return _0x4142f1[_0x2821('0x1f')](_0x2821('0x20'),_0x3f1057+'-'+_0x500357+'/'+_0x2673d2)[_0x2821('0x21')](_0x243c46);}return null;};}function patchUpdates(_0x8ba96e){return function(_0x38d898){try{jsonpatch[_0x2821('0x22')](_0x38d898,_0x8ba96e,!![]);}catch(_0x1c0907){return BPromise[_0x2821('0x23')](_0x1c0907);}return _0x38d898[_0x2821('0x24')]();};}function saveUpdates(_0x1f4e4f,_0x275810){return function(_0x597d8b){if(_0x597d8b){return _0x597d8b['update'](_0x1f4e4f)[_0x2821('0x25')](function(_0x243ff2){return _0x243ff2;});}return null;};}function removeEntity(_0x2838d8,_0x279a46){return function(_0x37c669){if(_0x37c669){return _0x37c669[_0x2821('0x26')]()[_0x2821('0x25')](function(){_0x2838d8[_0x2821('0x1a')](0xcc)[_0x2821('0x1b')]();});}};}function handleEntityNotFound(_0x27cef1,_0x7a49da){return function(_0x1d2c8f){if(!_0x1d2c8f){_0x27cef1[_0x2821('0x19')](0x194);}return _0x1d2c8f;};}function handleError(_0x3ddbe7,_0x14fbd4){_0x14fbd4=_0x14fbd4||0x1f4;return function(_0x2ab3ab){logger[_0x2821('0x27')](_0x2ab3ab[_0x2821('0x28')]);if(_0x2ab3ab[_0x2821('0x29')]){delete _0x2ab3ab[_0x2821('0x29')];}_0x3ddbe7['status'](_0x14fbd4)[_0x2821('0x2a')](_0x2ab3ab);};}exports['index']=function(_0x109262,_0x4402ea){var _0x449e46={},_0x7dfdc3={},_0x5eba60={'count':0x0,'rows':[]};var _0x3ea1de=_[_0x2821('0x2b')](db['ChatQueueReport'][_0x2821('0x2c')],function(_0x2e4395){return{'name':_0x2e4395[_0x2821('0x2d')],'type':_0x2e4395['type'][_0x2821('0x2e')]};});_0x7dfdc3[_0x2821('0x2f')]=_[_0x2821('0x2b')](_0x3ea1de,_0x2821('0x29'));_0x7dfdc3[_0x2821('0x30')]=_[_0x2821('0x31')](_0x109262[_0x2821('0x30')]);_0x7dfdc3['filters']=_[_0x2821('0x32')](_0x7dfdc3[_0x2821('0x2f')],_0x7dfdc3[_0x2821('0x30')]);_0x449e46[_0x2821('0x33')]=_[_0x2821('0x32')](_0x7dfdc3[_0x2821('0x2f')],qs[_0x2821('0x34')](_0x109262[_0x2821('0x30')][_0x2821('0x34')]));_0x449e46[_0x2821('0x33')]=_0x449e46[_0x2821('0x33')]['length']?_0x449e46[_0x2821('0x33')]:_0x7dfdc3[_0x2821('0x2f')];if(!_0x109262[_0x2821('0x30')][_0x2821('0x35')]('nolimit')){_0x449e46[_0x2821('0x36')]=qs[_0x2821('0x36')](_0x109262[_0x2821('0x30')][_0x2821('0x36')]);_0x449e46[_0x2821('0x1e')]=qs[_0x2821('0x1e')](_0x109262[_0x2821('0x30')][_0x2821('0x1e')]);}_0x449e46[_0x2821('0x37')]=qs[_0x2821('0x38')](_0x109262['query'][_0x2821('0x38')]);_0x449e46[_0x2821('0x39')]=qs[_0x2821('0x3a')](_[_0x2821('0x3b')](_0x109262[_0x2821('0x30')],_0x7dfdc3['filters']),_0x3ea1de);if(_0x109262[_0x2821('0x30')]['filter']){_0x449e46['where']=_[_0x2821('0x3c')](_0x449e46[_0x2821('0x39')],{'$or':_[_0x2821('0x2b')](_0x3ea1de,function(_0x276edc){if(_0x276edc[_0x2821('0x3d')]!==_0x2821('0x3e')){var _0x210c60={};_0x210c60[_0x276edc['name']]={'$like':'%'+_0x109262['query'][_0x2821('0x3f')]+'%'};return _0x210c60;}})});}_0x449e46=_[_0x2821('0x3c')]({},_0x449e46,_0x109262[_0x2821('0x40')]);var _0x2737a7={'where':_0x449e46[_0x2821('0x39')]};return db['ChatQueueReport']['count'](_0x2737a7)[_0x2821('0x25')](function(_0x26d389){_0x5eba60[_0x2821('0x1d')]=_0x26d389;if(_0x109262[_0x2821('0x30')][_0x2821('0x41')]){_0x449e46[_0x2821('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x2821('0x43')](_0x449e46);})[_0x2821('0x25')](function(_0x4fe0cd){_0x5eba60[_0x2821('0x44')]=_0x4fe0cd;return _0x5eba60;})[_0x2821('0x25')](respondWithFilteredResult(_0x4402ea,_0x449e46))[_0x2821('0x45')](handleError(_0x4402ea,null));};exports[_0x2821('0x46')]=function(_0x20c8db,_0x4ffc43){var _0x2b2796={'raw':!![],'where':{'id':_0x20c8db[_0x2821('0x47')]['id']}},_0x8d988a={};_0x8d988a[_0x2821('0x2f')]=_['keys'](db['ChatQueueReport'][_0x2821('0x2c')]);_0x8d988a[_0x2821('0x30')]=_[_0x2821('0x31')](_0x20c8db[_0x2821('0x30')]);_0x8d988a[_0x2821('0x3a')]=_[_0x2821('0x32')](_0x8d988a[_0x2821('0x2f')],_0x8d988a['query']);_0x2b2796['attributes']=_[_0x2821('0x32')](_0x8d988a['model'],qs[_0x2821('0x34')](_0x20c8db[_0x2821('0x30')][_0x2821('0x34')]));_0x2b2796[_0x2821('0x33')]=_0x2b2796[_0x2821('0x33')][_0x2821('0x48')]?_0x2b2796[_0x2821('0x33')]:_0x8d988a['model'];if(_0x20c8db[_0x2821('0x30')][_0x2821('0x41')]){_0x2b2796[_0x2821('0x42')]=[{'all':!![]}];}_0x2b2796=_[_0x2821('0x3c')]({},_0x2b2796,_0x20c8db[_0x2821('0x40')]);return db[_0x2821('0x49')][_0x2821('0x4a')](_0x2b2796)[_0x2821('0x25')](handleEntityNotFound(_0x4ffc43,null))['then'](respondWithResult(_0x4ffc43,null))[_0x2821('0x45')](handleError(_0x4ffc43,null));};exports[_0x2821('0x4b')]=function(_0x175ef3,_0x3f370d){return db['ChatQueueReport'][_0x2821('0x4b')](_0x175ef3[_0x2821('0x4c')],{})[_0x2821('0x25')](respondWithResult(_0x3f370d,0xc9))['catch'](handleError(_0x3f370d,null));};exports['update']=function(_0x5162b3,_0x9721){if(_0x5162b3[_0x2821('0x4c')]['id']){delete _0x5162b3[_0x2821('0x4c')]['id'];}return db['ChatQueueReport'][_0x2821('0x4a')]({'where':{'id':_0x5162b3[_0x2821('0x47')]['id']}})[_0x2821('0x25')](handleEntityNotFound(_0x9721,null))[_0x2821('0x25')](saveUpdates(_0x5162b3[_0x2821('0x4c')],null))[_0x2821('0x25')](respondWithResult(_0x9721,null))['catch'](handleError(_0x9721,null));};exports['destroy']=function(_0x284b28,_0x39fcc9){return db['ChatQueueReport'][_0x2821('0x4a')]({'where':{'id':_0x284b28[_0x2821('0x47')]['id']}})[_0x2821('0x25')](handleEntityNotFound(_0x39fcc9,null))[_0x2821('0x25')](removeEntity(_0x39fcc9,null))[_0x2821('0x45')](handleError(_0x39fcc9,null));};exports[_0x2821('0x4d')]=function(_0x40fecc,_0x2e4a4d){return db[_0x2821('0x49')]['describe']()['then'](respondWithResult(_0x2e4a4d,null))['catch'](handleError(_0x2e4a4d,null));};
\ No newline at end of file
+var _0xee87=['limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','ChatQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xab9bbb,_0x20b4f6){var _0x32db1f=function(_0xe95f4e){while(--_0xe95f4e){_0xab9bbb['push'](_0xab9bbb['shift']());}};_0x32db1f(++_0x20b4f6);}(_0xee87,0x10d));var _0x7ee8=function(_0x320f8e,_0x383adc){_0x320f8e=_0x320f8e-0x0;var _0x19770d=_0xee87[_0x320f8e];return _0x19770d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ee8('0x0'));var zipdir=require(_0x7ee8('0x1'));var jsonpatch=require(_0x7ee8('0x2'));var rp=require(_0x7ee8('0x3'));var moment=require(_0x7ee8('0x4'));var BPromise=require(_0x7ee8('0x5'));var Mustache=require(_0x7ee8('0x6'));var util=require(_0x7ee8('0x7'));var path=require(_0x7ee8('0x8'));var sox=require(_0x7ee8('0x9'));var csv=require('to-csv');var ejs=require(_0x7ee8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ee8('0xb'));var squel=require(_0x7ee8('0xc'));var crypto=require(_0x7ee8('0xd'));var jsforce=require(_0x7ee8('0xe'));var deskjs=require(_0x7ee8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7ee8('0x10'));var Redis=require('ioredis');var authService=require(_0x7ee8('0x11'));var qs=require(_0x7ee8('0x12'));var as=require(_0x7ee8('0x13'));var hardwareService=require(_0x7ee8('0x14'));var logger=require(_0x7ee8('0x15'))(_0x7ee8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ee8('0x17'));var db=require(_0x7ee8('0x18'))['db'];function respondWithStatusCode(_0x39a4cd,_0x36e82a){_0x36e82a=_0x36e82a||0xcc;return function(_0xb4a1bc){if(_0xb4a1bc){return _0x39a4cd[_0x7ee8('0x19')](_0x36e82a);}return _0x39a4cd[_0x7ee8('0x1a')](_0x36e82a)[_0x7ee8('0x1b')]();};}function respondWithResult(_0x2a5fa3,_0x46b127){_0x46b127=_0x46b127||0xc8;return function(_0x1669d7){if(_0x1669d7){return _0x2a5fa3[_0x7ee8('0x1a')](_0x46b127)[_0x7ee8('0x1c')](_0x1669d7);}};}function respondWithFilteredResult(_0x12e853,_0x268b93){return function(_0x43f34c){if(_0x43f34c){var _0x192d8c=typeof _0x268b93[_0x7ee8('0x1d')]===_0x7ee8('0x1e')&&typeof _0x268b93[_0x7ee8('0x1f')]===_0x7ee8('0x1e');var _0x124442=_0x43f34c[_0x7ee8('0x20')];var _0x4028a7=_0x192d8c?0x0:_0x268b93[_0x7ee8('0x1d')];var _0x5c1969=_0x192d8c?_0x43f34c[_0x7ee8('0x20')]:_0x268b93['offset']+_0x268b93[_0x7ee8('0x1f')];var _0x459ad1;if(_0x5c1969>=_0x124442){_0x5c1969=_0x124442;_0x459ad1=0xc8;}else{_0x459ad1=0xce;}_0x12e853['status'](_0x459ad1);return _0x12e853['set'](_0x7ee8('0x21'),_0x4028a7+'-'+_0x5c1969+'/'+_0x124442)[_0x7ee8('0x1c')](_0x43f34c);}return null;};}function patchUpdates(_0x298430){return function(_0x15c00f){try{jsonpatch[_0x7ee8('0x22')](_0x15c00f,_0x298430,!![]);}catch(_0x49f7e0){return BPromise[_0x7ee8('0x23')](_0x49f7e0);}return _0x15c00f[_0x7ee8('0x24')]();};}function saveUpdates(_0x334b46,_0x555338){return function(_0x27bff9){if(_0x27bff9){return _0x27bff9[_0x7ee8('0x25')](_0x334b46)[_0x7ee8('0x26')](function(_0x1bcdd9){return _0x1bcdd9;});}return null;};}function removeEntity(_0x57dfaa,_0x40d420){return function(_0x273bbe){if(_0x273bbe){return _0x273bbe[_0x7ee8('0x27')]()['then'](function(){_0x57dfaa[_0x7ee8('0x1a')](0xcc)[_0x7ee8('0x1b')]();});}};}function handleEntityNotFound(_0x3118fe,_0x5ae459){return function(_0x3f9cae){if(!_0x3f9cae){_0x3118fe[_0x7ee8('0x19')](0x194);}return _0x3f9cae;};}function handleError(_0x568ea,_0x52ff5d){_0x52ff5d=_0x52ff5d||0x1f4;return function(_0x27c94c){logger['error'](_0x27c94c['stack']);if(_0x27c94c[_0x7ee8('0x28')]){delete _0x27c94c[_0x7ee8('0x28')];}_0x568ea['status'](_0x52ff5d)[_0x7ee8('0x29')](_0x27c94c);};}exports['index']=function(_0x2e31ed,_0x5e81d7){var _0x76beaa={},_0x547147={},_0xf54bb1={'count':0x0,'rows':[]};var _0x33f20e=_['map'](db[_0x7ee8('0x2a')][_0x7ee8('0x2b')],function(_0x2d8809){return{'name':_0x2d8809[_0x7ee8('0x2c')],'type':_0x2d8809[_0x7ee8('0x2d')][_0x7ee8('0x2e')]};});_0x547147[_0x7ee8('0x2f')]=_['map'](_0x33f20e,_0x7ee8('0x28'));_0x547147['query']=_[_0x7ee8('0x30')](_0x2e31ed[_0x7ee8('0x31')]);_0x547147[_0x7ee8('0x32')]=_[_0x7ee8('0x33')](_0x547147['model'],_0x547147[_0x7ee8('0x31')]);_0x76beaa[_0x7ee8('0x34')]=_['intersection'](_0x547147[_0x7ee8('0x2f')],qs[_0x7ee8('0x35')](_0x2e31ed[_0x7ee8('0x31')][_0x7ee8('0x35')]));_0x76beaa[_0x7ee8('0x34')]=_0x76beaa['attributes'][_0x7ee8('0x36')]?_0x76beaa[_0x7ee8('0x34')]:_0x547147[_0x7ee8('0x2f')];if(!_0x2e31ed['query'][_0x7ee8('0x37')]('nolimit')){_0x76beaa[_0x7ee8('0x1f')]=qs[_0x7ee8('0x1f')](_0x2e31ed['query'][_0x7ee8('0x1f')]);_0x76beaa[_0x7ee8('0x1d')]=qs[_0x7ee8('0x1d')](_0x2e31ed['query'][_0x7ee8('0x1d')]);}_0x76beaa['order']=qs[_0x7ee8('0x38')](_0x2e31ed[_0x7ee8('0x31')][_0x7ee8('0x38')]);_0x76beaa[_0x7ee8('0x39')]=qs[_0x7ee8('0x32')](_[_0x7ee8('0x3a')](_0x2e31ed[_0x7ee8('0x31')],_0x547147[_0x7ee8('0x32')]),_0x33f20e);if(_0x2e31ed[_0x7ee8('0x31')][_0x7ee8('0x3b')]){_0x76beaa[_0x7ee8('0x39')]=_[_0x7ee8('0x3c')](_0x76beaa[_0x7ee8('0x39')],{'$or':_[_0x7ee8('0x3d')](_0x33f20e,function(_0x52c56b){if(_0x52c56b['type']!==_0x7ee8('0x3e')){var _0x4d095f={};_0x4d095f[_0x52c56b[_0x7ee8('0x28')]]={'$like':'%'+_0x2e31ed[_0x7ee8('0x31')][_0x7ee8('0x3b')]+'%'};return _0x4d095f;}})});}_0x76beaa=_[_0x7ee8('0x3c')]({},_0x76beaa,_0x2e31ed[_0x7ee8('0x3f')]);var _0x1c996b={'where':_0x76beaa[_0x7ee8('0x39')]};return db[_0x7ee8('0x2a')][_0x7ee8('0x20')](_0x1c996b)[_0x7ee8('0x26')](function(_0x2017e6){_0xf54bb1[_0x7ee8('0x20')]=_0x2017e6;if(_0x2e31ed[_0x7ee8('0x31')][_0x7ee8('0x40')]){_0x76beaa[_0x7ee8('0x41')]=[{'all':!![]}];}return db[_0x7ee8('0x2a')][_0x7ee8('0x42')](_0x76beaa);})[_0x7ee8('0x26')](function(_0x1074ef){_0xf54bb1[_0x7ee8('0x43')]=_0x1074ef;return _0xf54bb1;})['then'](respondWithFilteredResult(_0x5e81d7,_0x76beaa))[_0x7ee8('0x44')](handleError(_0x5e81d7,null));};exports[_0x7ee8('0x45')]=function(_0x58a461,_0x16bd01){var _0x29e866={'raw':!![],'where':{'id':_0x58a461[_0x7ee8('0x46')]['id']}},_0x509838={};_0x509838[_0x7ee8('0x2f')]=_['keys'](db[_0x7ee8('0x2a')]['rawAttributes']);_0x509838['query']=_['keys'](_0x58a461['query']);_0x509838[_0x7ee8('0x32')]=_[_0x7ee8('0x33')](_0x509838['model'],_0x509838[_0x7ee8('0x31')]);_0x29e866[_0x7ee8('0x34')]=_[_0x7ee8('0x33')](_0x509838[_0x7ee8('0x2f')],qs[_0x7ee8('0x35')](_0x58a461[_0x7ee8('0x31')][_0x7ee8('0x35')]));_0x29e866[_0x7ee8('0x34')]=_0x29e866['attributes'][_0x7ee8('0x36')]?_0x29e866[_0x7ee8('0x34')]:_0x509838['model'];if(_0x58a461[_0x7ee8('0x31')]['includeAll']){_0x29e866['include']=[{'all':!![]}];}_0x29e866=_[_0x7ee8('0x3c')]({},_0x29e866,_0x58a461['options']);return db[_0x7ee8('0x2a')][_0x7ee8('0x47')](_0x29e866)[_0x7ee8('0x26')](handleEntityNotFound(_0x16bd01,null))['then'](respondWithResult(_0x16bd01,null))[_0x7ee8('0x44')](handleError(_0x16bd01,null));};exports['create']=function(_0xf0d68e,_0x45c08b){return db['ChatQueueReport'][_0x7ee8('0x48')](_0xf0d68e[_0x7ee8('0x49')],{})[_0x7ee8('0x26')](respondWithResult(_0x45c08b,0xc9))[_0x7ee8('0x44')](handleError(_0x45c08b,null));};exports['update']=function(_0x4f36d0,_0x46e007){if(_0x4f36d0[_0x7ee8('0x49')]['id']){delete _0x4f36d0['body']['id'];}return db[_0x7ee8('0x2a')]['find']({'where':{'id':_0x4f36d0['params']['id']}})[_0x7ee8('0x26')](handleEntityNotFound(_0x46e007,null))[_0x7ee8('0x26')](saveUpdates(_0x4f36d0[_0x7ee8('0x49')],null))[_0x7ee8('0x26')](respondWithResult(_0x46e007,null))[_0x7ee8('0x44')](handleError(_0x46e007,null));};exports[_0x7ee8('0x27')]=function(_0x34d306,_0x2e228b){return db[_0x7ee8('0x2a')][_0x7ee8('0x47')]({'where':{'id':_0x34d306['params']['id']}})[_0x7ee8('0x26')](handleEntityNotFound(_0x2e228b,null))[_0x7ee8('0x26')](removeEntity(_0x2e228b,null))['catch'](handleError(_0x2e228b,null));};exports[_0x7ee8('0x4a')]=function(_0x2d6bde,_0x5d2e84){return db[_0x7ee8('0x2a')][_0x7ee8('0x4a')]()['then'](respondWithResult(_0x5d2e84,null))['catch'](handleError(_0x5d2e84,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 4882e8f..5b7da1e 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(_0x51426b,_0xecbc25){var _0x2930ed=function(_0x13a6e1){while(--_0x13a6e1){_0x51426b['push'](_0x51426b['shift']());}};_0x2930ed(++_0xecbc25);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index a099c96..237bb3b 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 _0xb0ca=['jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','then','UpdateChatQueueReport','update','raw','where','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1cac41,_0x29e5df){var _0x43154f=function(_0x3388f2){while(--_0x3388f2){_0x1cac41['push'](_0x1cac41['shift']());}};_0x43154f(++_0x29e5df);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x5b4bc1,_0x27c600){_0x5b4bc1=_0x5b4bc1-0x0;var _0x358925=_0xb0ca[_0x5b4bc1];return _0x358925;};'use strict';var _=require('lodash');var util=require(_0xab0c('0x0'));var moment=require('moment');var BPromise=require(_0xab0c('0x1'));var rs=require(_0xab0c('0x2'));var fs=require('fs');var Redis=require(_0xab0c('0x3'));var db=require(_0xab0c('0x4'))['db'];var utils=require(_0xab0c('0x5'));var logger=require(_0xab0c('0x6'))(_0xab0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xab0c('0x8'));var client=jayson[_0xab0c('0x9')][_0xab0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x871446,_0x4902a7,_0xbe11d1){return new BPromise(function(_0x50d3de,_0x22ebb5){return client[_0xab0c('0xb')](_0x871446,_0xbe11d1)['then'](function(_0x5172cd){logger[_0xab0c('0xc')](_0xab0c('0xd'),_0x4902a7,_0xab0c('0xe'));logger[_0xab0c('0xf')](_0xab0c('0x10'),_0x4902a7,'request\x20sent',JSON[_0xab0c('0x11')](_0x5172cd));if(_0x5172cd['error']){if(_0x5172cd[_0xab0c('0x12')][_0xab0c('0x13')]===0x1f4){logger[_0xab0c('0x12')](_0xab0c('0xd'),_0x4902a7,_0x5172cd[_0xab0c('0x12')][_0xab0c('0x14')]);return _0x22ebb5(_0x5172cd[_0xab0c('0x12')][_0xab0c('0x14')]);}logger[_0xab0c('0x12')](_0xab0c('0xd'),_0x4902a7,_0x5172cd['error']['message']);return _0x50d3de(_0x5172cd[_0xab0c('0x12')][_0xab0c('0x14')]);}else{logger[_0xab0c('0xc')](_0xab0c('0xd'),_0x4902a7,_0xab0c('0xe'));_0x50d3de(_0x5172cd[_0xab0c('0x15')][_0xab0c('0x14')]);}})[_0xab0c('0x16')](function(_0x3b80db){logger[_0xab0c('0x12')](_0xab0c('0xd'),_0x4902a7,_0x3b80db);_0x22ebb5(_0x3b80db);});});}exports[_0xab0c('0x17')]=function(_0x32931b){var _0x13d657=this;return new Promise(function(_0x3c8e62,_0x433777){return db[_0xab0c('0x18')][_0xab0c('0x19')](_0x32931b[_0xab0c('0x1a')],{'raw':_0x32931b['options']?_0x32931b[_0xab0c('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xab0c('0x1c')](function(_0x870902){logger[_0xab0c('0xc')](_0xab0c('0x17'),_0x32931b);logger[_0xab0c('0xf')](_0xab0c('0x17'),_0x32931b,JSON['stringify'](_0x870902));_0x3c8e62(_0x870902);})[_0xab0c('0x16')](function(_0x1ecd87){logger[_0xab0c('0x12')]('CreateChatQueueReport',_0x1ecd87[_0xab0c('0x14')],_0x32931b);_0x433777(_0x13d657['error'](0x1f4,_0x1ecd87[_0xab0c('0x14')]));});});};exports[_0xab0c('0x1d')]=function(_0x33b76d){var _0x5a734a=this;return new Promise(function(_0xd03d5e,_0x20466c){return db['ChatQueueReport'][_0xab0c('0x1e')](_0x33b76d[_0xab0c('0x1a')],{'raw':_0x33b76d[_0xab0c('0x1b')]?_0x33b76d[_0xab0c('0x1b')][_0xab0c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33b76d[_0xab0c('0x1b')]?_0x33b76d[_0xab0c('0x1b')][_0xab0c('0x20')]||null:null,'attributes':_0x33b76d[_0xab0c('0x1b')]?_0x33b76d[_0xab0c('0x1b')][_0xab0c('0x21')]||null:null,'limit':_0x33b76d[_0xab0c('0x1b')]?_0x33b76d[_0xab0c('0x1b')]['limit']||null:null})[_0xab0c('0x1c')](function(_0x3936c0){logger[_0xab0c('0xc')](_0xab0c('0x1d'),_0x33b76d);logger['debug']('UpdateChatQueueReport',_0x33b76d,JSON['stringify'](_0x3936c0));_0xd03d5e(_0x3936c0);})['catch'](function(_0xdb0d0d){logger[_0xab0c('0x12')](_0xab0c('0x1d'),_0xdb0d0d[_0xab0c('0x14')],_0x33b76d);_0x20466c(_0x5a734a[_0xab0c('0x12')](0x1f4,_0xdb0d0d['message']));});});};
\ No newline at end of file
+var _0xf717=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x479d7b,_0x485356){var _0x41330f=function(_0x160bb9){while(--_0x160bb9){_0x479d7b['push'](_0x479d7b['shift']());}};_0x41330f(++_0x485356);}(_0xf717,0x65));var _0x7f71=function(_0xeb1452,_0x1bff5b){_0xeb1452=_0xeb1452-0x0;var _0x1ed85b=_0xf717[_0xeb1452];return _0x1ed85b;};'use strict';var _=require(_0x7f71('0x0'));var util=require(_0x7f71('0x1'));var moment=require(_0x7f71('0x2'));var BPromise=require(_0x7f71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f71('0x4'));var db=require(_0x7f71('0x5'))['db'];var utils=require(_0x7f71('0x6'));var logger=require(_0x7f71('0x7'))(_0x7f71('0x8'));var config=require(_0x7f71('0x9'));var jayson=require(_0x7f71('0xa'));var client=jayson[_0x7f71('0xb')][_0x7f71('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cdbd4,_0x2cd0ec,_0x185408){return new BPromise(function(_0x32d666,_0x4e4a51){return client['request'](_0x2cdbd4,_0x185408)[_0x7f71('0xd')](function(_0x1b6e4a){logger['info'](_0x7f71('0xe'),_0x2cd0ec,_0x7f71('0xf'));logger[_0x7f71('0x10')](_0x7f71('0x11'),_0x2cd0ec,_0x7f71('0xf'),JSON[_0x7f71('0x12')](_0x1b6e4a));if(_0x1b6e4a[_0x7f71('0x13')]){if(_0x1b6e4a[_0x7f71('0x13')]['code']===0x1f4){logger[_0x7f71('0x13')](_0x7f71('0xe'),_0x2cd0ec,_0x1b6e4a[_0x7f71('0x13')][_0x7f71('0x14')]);return _0x4e4a51(_0x1b6e4a['error'][_0x7f71('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2cd0ec,_0x1b6e4a['error'][_0x7f71('0x14')]);return _0x32d666(_0x1b6e4a[_0x7f71('0x13')]['message']);}else{logger[_0x7f71('0x15')](_0x7f71('0xe'),_0x2cd0ec,_0x7f71('0xf'));_0x32d666(_0x1b6e4a[_0x7f71('0x16')][_0x7f71('0x14')]);}})[_0x7f71('0x17')](function(_0x15ae97){logger[_0x7f71('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x2cd0ec,_0x15ae97);_0x4e4a51(_0x15ae97);});});}exports[_0x7f71('0x18')]=function(_0x4fd1b6){var _0x4ca1c3=this;return new Promise(function(_0x55a994,_0x4fbc3a){return db[_0x7f71('0x19')][_0x7f71('0x1a')](_0x4fd1b6[_0x7f71('0x1b')],{'raw':_0x4fd1b6[_0x7f71('0x1c')]?_0x4fd1b6[_0x7f71('0x1c')][_0x7f71('0x1d')]===undefined?!![]:![]:!![]})[_0x7f71('0xd')](function(_0x32b97f){logger[_0x7f71('0x15')](_0x7f71('0x18'),_0x4fd1b6);logger['debug'](_0x7f71('0x18'),_0x4fd1b6,JSON[_0x7f71('0x12')](_0x32b97f));_0x55a994(_0x32b97f);})[_0x7f71('0x17')](function(_0x34f828){logger[_0x7f71('0x13')](_0x7f71('0x18'),_0x34f828[_0x7f71('0x14')],_0x4fd1b6);_0x4fbc3a(_0x4ca1c3[_0x7f71('0x13')](0x1f4,_0x34f828['message']));});});};exports[_0x7f71('0x1e')]=function(_0x5d14fc){var _0x5b87e2=this;return new Promise(function(_0x44475c,_0x568033){return db[_0x7f71('0x19')][_0x7f71('0x1f')](_0x5d14fc[_0x7f71('0x1b')],{'raw':_0x5d14fc[_0x7f71('0x1c')]?_0x5d14fc[_0x7f71('0x1c')][_0x7f71('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d14fc[_0x7f71('0x1c')]?_0x5d14fc[_0x7f71('0x1c')][_0x7f71('0x20')]||null:null,'attributes':_0x5d14fc['options']?_0x5d14fc['options'][_0x7f71('0x21')]||null:null,'limit':_0x5d14fc[_0x7f71('0x1c')]?_0x5d14fc[_0x7f71('0x1c')][_0x7f71('0x22')]||null:null})['then'](function(_0x42de85){logger[_0x7f71('0x15')]('UpdateChatQueueReport',_0x5d14fc);logger[_0x7f71('0x10')]('UpdateChatQueueReport',_0x5d14fc,JSON[_0x7f71('0x12')](_0x42de85));_0x44475c(_0x42de85);})[_0x7f71('0x17')](function(_0x451f48){logger[_0x7f71('0x13')](_0x7f71('0x1e'),_0x451f48[_0x7f71('0x14')],_0x5d14fc);_0x568033(_0x5b87e2[_0x7f71('0x13')](0x1f4,_0x451f48[_0x7f71('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 8227e89..785b81c 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 _0x3927=['show','post','create','put','update','exports','multer','path','connect-timeout','fs-extra','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x23307f,_0x21e6f1){var _0x33556d=function(_0x200810){while(--_0x200810){_0x23307f['push'](_0x23307f['shift']());}};_0x33556d(++_0x21e6f1);}(_0x3927,0x9f));var _0x7392=function(_0x328b35,_0x38a3c3){_0x328b35=_0x328b35-0x0;var _0x2f6a95=_0x3927[_0x328b35];return _0x2f6a95;};'use strict';var multer=require(_0x7392('0x0'));var util=require('util');var path=require(_0x7392('0x1'));var timeout=require(_0x7392('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7392('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7392('0x4'));router[_0x7392('0x5')]('/',auth[_0x7392('0x6')](),controller[_0x7392('0x7')]);router[_0x7392('0x5')](_0x7392('0x8'),auth[_0x7392('0x6')](),controller[_0x7392('0x9')]);router[_0x7392('0x5')](_0x7392('0xa'),auth[_0x7392('0x6')](),controller[_0x7392('0xb')]);router[_0x7392('0xc')]('/',auth['isAuthenticated'](),controller[_0x7392('0xd')]);router[_0x7392('0xe')](_0x7392('0xa'),auth[_0x7392('0x6')](),controller[_0x7392('0xf')]);router['delete']('/:id',auth[_0x7392('0x6')](),controller['destroy']);module[_0x7392('0x10')]=router;
\ No newline at end of file
+var _0x1e7e=['get','isAuthenticated','index','describe','/:id','show','create','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x55f0b1,_0x275c7a){var _0x3dac04=function(_0x5d9a15){while(--_0x5d9a15){_0x55f0b1['push'](_0x55f0b1['shift']());}};_0x3dac04(++_0x275c7a);}(_0x1e7e,0xdc));var _0xe1e7=function(_0xa3083e,_0x345ff9){_0xa3083e=_0xa3083e-0x0;var _0x3f3023=_0x1e7e[_0xa3083e];return _0x3f3023;};'use strict';var multer=require('multer');var util=require(_0xe1e7('0x0'));var path=require(_0xe1e7('0x1'));var timeout=require(_0xe1e7('0x2'));var express=require('express');var router=express[_0xe1e7('0x3')]();var fs_extra=require(_0xe1e7('0x4'));var auth=require(_0xe1e7('0x5'));var interaction=require(_0xe1e7('0x6'));var config=require(_0xe1e7('0x7'));var controller=require('./chatQueueReport.controller');router[_0xe1e7('0x8')]('/',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xa')]);router[_0xe1e7('0x8')]('/describe',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xb')]);router[_0xe1e7('0x8')](_0xe1e7('0xc'),auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xd')]);router['post']('/',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xe')]);router['put']('/:id',auth[_0xe1e7('0x9')](),controller[_0xe1e7('0xf')]);router[_0xe1e7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe1e7('0x11')]);module[_0xe1e7('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 7a75793..003c5c2 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x11cbbd,_0x5d4106){var _0x153af2=function(_0xd8cb94){while(--_0xd8cb94){_0x11cbbd['push'](_0x11cbbd['shift']());}};_0x153af2(++_0x5d4106);}(_0x008c,0x188));var _0xc008=function(_0x3af955,_0x21431c){_0x3af955=_0x3af955-0x0;var _0x167de5=_0x008c[_0x3af955];return _0x167de5;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3d507e,_0x2151eb){var _0x458c52=function(_0x211626){while(--_0x211626){_0x3d507e['push'](_0x3d507e['shift']());}};_0x458c52(++_0x2151eb);}(_0x00bb,0x1d8));var _0xb00b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x00bb[_0x110c3d];return _0x226d67;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index d4bc2e2..8a2aaa8 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 _0xd968=['then','destroy','stack','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','name','keys','filters','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update'];(function(_0x5067d7,_0x56c8e5){var _0x367d67=function(_0x267fd4){while(--_0x267fd4){_0x5067d7['push'](_0x5067d7['shift']());}};_0x367d67(++_0x56c8e5);}(_0xd968,0x1d1));var _0x8d96=function(_0x1346db,_0x3b5b3a){_0x1346db=_0x1346db-0x0;var _0x2c600a=_0xd968[_0x1346db];return _0x2c600a;};'use strict';var emlformat=require(_0x8d96('0x0'));var rimraf=require(_0x8d96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8d96('0x2'));var moment=require(_0x8d96('0x3'));var BPromise=require(_0x8d96('0x4'));var Mustache=require(_0x8d96('0x5'));var util=require(_0x8d96('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8d96('0x7'));var ejs=require(_0x8d96('0x8'));var fs=require('fs');var fs_extra=require(_0x8d96('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8d96('0xa'));var jsforce=require(_0x8d96('0xb'));var deskjs=require(_0x8d96('0xc'));var toCsv=require(_0x8d96('0x7'));var querystring=require(_0x8d96('0xd'));var Papa=require(_0x8d96('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8d96('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d96('0x10'));var logger=require(_0x8d96('0x11'))('api');var utils=require(_0x8d96('0x12'));var config=require(_0x8d96('0x13'));var licenseUtil=require(_0x8d96('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x151562,_0x470138){_0x470138=_0x470138||0xcc;return function(_0x196519){if(_0x196519){return _0x151562[_0x8d96('0x15')](_0x470138);}return _0x151562[_0x8d96('0x16')](_0x470138)[_0x8d96('0x17')]();};}function respondWithResult(_0x40ce3f,_0xbae191){_0xbae191=_0xbae191||0xc8;return function(_0x495130){if(_0x495130){return _0x40ce3f[_0x8d96('0x16')](_0xbae191)[_0x8d96('0x18')](_0x495130);}};}function respondWithFilteredResult(_0x185479,_0x16b017){return function(_0x4218c9){if(_0x4218c9){var _0x874fd0=typeof _0x16b017[_0x8d96('0x19')]===_0x8d96('0x1a')&&typeof _0x16b017['limit']==='undefined';var _0x7df71a=_0x4218c9[_0x8d96('0x1b')];var _0x585228=_0x874fd0?0x0:_0x16b017[_0x8d96('0x19')];var _0x484029=_0x874fd0?_0x4218c9[_0x8d96('0x1b')]:_0x16b017['offset']+_0x16b017['limit'];var _0x13a197;if(_0x484029>=_0x7df71a){_0x484029=_0x7df71a;_0x13a197=0xc8;}else{_0x13a197=0xce;}_0x185479['status'](_0x13a197);return _0x185479['set']('Content-Range',_0x585228+'-'+_0x484029+'/'+_0x7df71a)[_0x8d96('0x18')](_0x4218c9);}return null;};}function patchUpdates(_0x5e6044){return function(_0x3c9ab7){try{jsonpatch[_0x8d96('0x1c')](_0x3c9ab7,_0x5e6044,!![]);}catch(_0x140c00){return BPromise[_0x8d96('0x1d')](_0x140c00);}return _0x3c9ab7[_0x8d96('0x1e')]();};}function saveUpdates(_0xf42b0b,_0x4b3270){return function(_0x54ace2){if(_0x54ace2){return _0x54ace2[_0x8d96('0x1f')](_0xf42b0b)[_0x8d96('0x20')](function(_0x4200e1){return _0x4200e1;});}return null;};}function removeEntity(_0x53a164,_0x3f32f1){return function(_0x2ff3b1){if(_0x2ff3b1){return _0x2ff3b1[_0x8d96('0x21')]()[_0x8d96('0x20')](function(){_0x53a164[_0x8d96('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x242953,_0x4c2969){return function(_0x5e36a9){if(!_0x5e36a9){_0x242953[_0x8d96('0x15')](0x194);}return _0x5e36a9;};}function handleError(_0x45ad76,_0x4d1e70){_0x4d1e70=_0x4d1e70||0x1f4;return function(_0x3a0a52){logger['error'](_0x3a0a52[_0x8d96('0x22')]);if(_0x3a0a52['name']){delete _0x3a0a52['name'];}_0x45ad76[_0x8d96('0x16')](_0x4d1e70)[_0x8d96('0x23')](_0x3a0a52);};}exports[_0x8d96('0x24')]=function(_0x184788,_0x42492f){var _0x2054a8={},_0x1c1190={},_0x3ed3dd={'count':0x0,'rows':[]};var _0x3419bb=_[_0x8d96('0x25')](db[_0x8d96('0x26')][_0x8d96('0x27')],function(_0x38a3b3){return{'name':_0x38a3b3[_0x8d96('0x28')],'type':_0x38a3b3[_0x8d96('0x29')]['key']};});_0x1c1190['model']=_[_0x8d96('0x25')](_0x3419bb,_0x8d96('0x2a'));_0x1c1190['query']=_[_0x8d96('0x2b')](_0x184788['query']);_0x1c1190[_0x8d96('0x2c')]=_[_0x8d96('0x2d')](_0x1c1190[_0x8d96('0x2e')],_0x1c1190[_0x8d96('0x2f')]);_0x2054a8['attributes']=_[_0x8d96('0x2d')](_0x1c1190[_0x8d96('0x2e')],qs[_0x8d96('0x30')](_0x184788[_0x8d96('0x2f')]['fields']));_0x2054a8['attributes']=_0x2054a8['attributes']['length']?_0x2054a8[_0x8d96('0x31')]:_0x1c1190['model'];if(!_0x184788[_0x8d96('0x2f')][_0x8d96('0x32')](_0x8d96('0x33'))){_0x2054a8[_0x8d96('0x34')]=qs[_0x8d96('0x34')](_0x184788[_0x8d96('0x2f')][_0x8d96('0x34')]);_0x2054a8[_0x8d96('0x19')]=qs[_0x8d96('0x19')](_0x184788[_0x8d96('0x2f')][_0x8d96('0x19')]);}_0x2054a8[_0x8d96('0x35')]=qs[_0x8d96('0x36')](_0x184788['query'][_0x8d96('0x36')]);_0x2054a8[_0x8d96('0x37')]=qs[_0x8d96('0x2c')](_[_0x8d96('0x38')](_0x184788[_0x8d96('0x2f')],_0x1c1190[_0x8d96('0x2c')]),_0x3419bb);if(_0x184788['query'][_0x8d96('0x39')]){_0x2054a8['where']=_[_0x8d96('0x3a')](_0x2054a8['where'],{'$or':_[_0x8d96('0x25')](_0x3419bb,function(_0x3e179b){if(_0x3e179b['type']!=='VIRTUAL'){var _0x21980d={};_0x21980d[_0x3e179b['name']]={'$like':'%'+_0x184788[_0x8d96('0x2f')][_0x8d96('0x39')]+'%'};return _0x21980d;}})});}_0x2054a8=_['merge']({},_0x2054a8,_0x184788[_0x8d96('0x3b')]);var _0x2742c4={'where':_0x2054a8[_0x8d96('0x37')]};return db[_0x8d96('0x26')][_0x8d96('0x1b')](_0x2742c4)[_0x8d96('0x20')](function(_0x2ba996){_0x3ed3dd[_0x8d96('0x1b')]=_0x2ba996;if(_0x184788[_0x8d96('0x2f')][_0x8d96('0x3c')]){_0x2054a8[_0x8d96('0x3d')]=[{'all':!![]}];}return db[_0x8d96('0x26')][_0x8d96('0x3e')](_0x2054a8);})[_0x8d96('0x20')](function(_0x3f877d){_0x3ed3dd[_0x8d96('0x3f')]=_0x3f877d;return _0x3ed3dd;})[_0x8d96('0x20')](respondWithFilteredResult(_0x42492f,_0x2054a8))[_0x8d96('0x40')](handleError(_0x42492f,null));};exports['show']=function(_0x5e562e,_0x86e287){var _0x42bc50={'raw':!![],'where':{'id':_0x5e562e[_0x8d96('0x41')]['id']}},_0x1398aa={};_0x1398aa[_0x8d96('0x2e')]=_['keys'](db[_0x8d96('0x26')][_0x8d96('0x27')]);_0x1398aa[_0x8d96('0x2f')]=_['keys'](_0x5e562e[_0x8d96('0x2f')]);_0x1398aa[_0x8d96('0x2c')]=_['intersection'](_0x1398aa['model'],_0x1398aa[_0x8d96('0x2f')]);_0x42bc50[_0x8d96('0x31')]=_['intersection'](_0x1398aa[_0x8d96('0x2e')],qs[_0x8d96('0x30')](_0x5e562e[_0x8d96('0x2f')][_0x8d96('0x30')]));_0x42bc50[_0x8d96('0x31')]=_0x42bc50[_0x8d96('0x31')][_0x8d96('0x42')]?_0x42bc50[_0x8d96('0x31')]:_0x1398aa[_0x8d96('0x2e')];if(_0x5e562e[_0x8d96('0x2f')][_0x8d96('0x3c')]){_0x42bc50[_0x8d96('0x3d')]=[{'all':!![]}];}_0x42bc50=_[_0x8d96('0x3a')]({},_0x42bc50,_0x5e562e[_0x8d96('0x3b')]);return db[_0x8d96('0x26')][_0x8d96('0x43')](_0x42bc50)[_0x8d96('0x20')](handleEntityNotFound(_0x86e287,null))[_0x8d96('0x20')](respondWithResult(_0x86e287,null))['catch'](handleError(_0x86e287,null));};exports[_0x8d96('0x44')]=function(_0x4b4f52,_0x369f14){return db[_0x8d96('0x26')][_0x8d96('0x44')](_0x4b4f52[_0x8d96('0x45')],{})[_0x8d96('0x20')](respondWithResult(_0x369f14,0xc9))['catch'](handleError(_0x369f14,null));};exports[_0x8d96('0x1f')]=function(_0x4b392b,_0x5e3bc8){if(_0x4b392b[_0x8d96('0x45')]['id']){delete _0x4b392b[_0x8d96('0x45')]['id'];}return db['ChatTransferReport'][_0x8d96('0x43')]({'where':{'id':_0x4b392b[_0x8d96('0x41')]['id']}})[_0x8d96('0x20')](handleEntityNotFound(_0x5e3bc8,null))[_0x8d96('0x20')](saveUpdates(_0x4b392b['body'],null))[_0x8d96('0x20')](respondWithResult(_0x5e3bc8,null))[_0x8d96('0x40')](handleError(_0x5e3bc8,null));};exports[_0x8d96('0x21')]=function(_0x4ea0c5,_0x25ec85){return db['ChatTransferReport']['find']({'where':{'id':_0x4ea0c5[_0x8d96('0x41')]['id']}})[_0x8d96('0x20')](handleEntityNotFound(_0x25ec85,null))['then'](removeEntity(_0x25ec85,null))['catch'](handleError(_0x25ec85,null));};exports[_0x8d96('0x46')]=function(_0x3552e1,_0x5871e7){return db[_0x8d96('0x26')][_0x8d96('0x46')]()[_0x8d96('0x20')](respondWithResult(_0x5871e7,null))[_0x8d96('0x40')](handleError(_0x5871e7,null));};
\ No newline at end of file
+var _0xdd5a=['options','findAll','rows','catch','show','params','includeAll','include','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','index','map','ChatTransferReport','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x33ec79,_0x4e7c33){var _0x454584=function(_0x485522){while(--_0x485522){_0x33ec79['push'](_0x33ec79['shift']());}};_0x454584(++_0x4e7c33);}(_0xdd5a,0x9d));var _0xadd5=function(_0x1a1d33,_0x19b3d5){_0x1a1d33=_0x1a1d33-0x0;var _0x14306c=_0xdd5a[_0x1a1d33];return _0x14306c;};'use strict';var emlformat=require(_0xadd5('0x0'));var rimraf=require(_0xadd5('0x1'));var zipdir=require(_0xadd5('0x2'));var jsonpatch=require(_0xadd5('0x3'));var rp=require(_0xadd5('0x4'));var moment=require(_0xadd5('0x5'));var BPromise=require(_0xadd5('0x6'));var Mustache=require(_0xadd5('0x7'));var util=require(_0xadd5('0x8'));var path=require(_0xadd5('0x9'));var sox=require('sox');var csv=require(_0xadd5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xadd5('0xb'));var _=require(_0xadd5('0xc'));var squel=require(_0xadd5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadd5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xadd5('0xf'));var Redis=require('ioredis');var authService=require(_0xadd5('0x10'));var qs=require(_0xadd5('0x11'));var as=require(_0xadd5('0x12'));var hardwareService=require(_0xadd5('0x13'));var logger=require('../../config/logger')(_0xadd5('0x14'));var utils=require(_0xadd5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xadd5('0x16'));var db=require(_0xadd5('0x17'))['db'];function respondWithStatusCode(_0x2807c8,_0x1ff584){_0x1ff584=_0x1ff584||0xcc;return function(_0x37440a){if(_0x37440a){return _0x2807c8['sendStatus'](_0x1ff584);}return _0x2807c8['status'](_0x1ff584)['end']();};}function respondWithResult(_0x5dfafc,_0x267583){_0x267583=_0x267583||0xc8;return function(_0x1378e1){if(_0x1378e1){return _0x5dfafc[_0xadd5('0x18')](_0x267583)[_0xadd5('0x19')](_0x1378e1);}};}function respondWithFilteredResult(_0x5c3dbc,_0x2b4ed6){return function(_0x1d00ef){if(_0x1d00ef){var _0x41b27d=typeof _0x2b4ed6['offset']===_0xadd5('0x1a')&&typeof _0x2b4ed6[_0xadd5('0x1b')]===_0xadd5('0x1a');var _0x1f7289=_0x1d00ef[_0xadd5('0x1c')];var _0x4a3e49=_0x41b27d?0x0:_0x2b4ed6[_0xadd5('0x1d')];var _0x136d22=_0x41b27d?_0x1d00ef[_0xadd5('0x1c')]:_0x2b4ed6[_0xadd5('0x1d')]+_0x2b4ed6[_0xadd5('0x1b')];var _0x5d068d;if(_0x136d22>=_0x1f7289){_0x136d22=_0x1f7289;_0x5d068d=0xc8;}else{_0x5d068d=0xce;}_0x5c3dbc[_0xadd5('0x18')](_0x5d068d);return _0x5c3dbc[_0xadd5('0x1e')](_0xadd5('0x1f'),_0x4a3e49+'-'+_0x136d22+'/'+_0x1f7289)[_0xadd5('0x19')](_0x1d00ef);}return null;};}function patchUpdates(_0x312146){return function(_0x3060cc){try{jsonpatch[_0xadd5('0x20')](_0x3060cc,_0x312146,!![]);}catch(_0x5073bc){return BPromise[_0xadd5('0x21')](_0x5073bc);}return _0x3060cc['save']();};}function saveUpdates(_0x318091,_0x7a06b8){return function(_0x34af66){if(_0x34af66){return _0x34af66[_0xadd5('0x22')](_0x318091)[_0xadd5('0x23')](function(_0x5ef4c3){return _0x5ef4c3;});}return null;};}function removeEntity(_0x3a4d1b,_0x4d99a0){return function(_0x11aa3e){if(_0x11aa3e){return _0x11aa3e[_0xadd5('0x24')]()[_0xadd5('0x23')](function(){_0x3a4d1b['status'](0xcc)[_0xadd5('0x25')]();});}};}function handleEntityNotFound(_0x56472b,_0xf57505){return function(_0x20fb68){if(!_0x20fb68){_0x56472b[_0xadd5('0x26')](0x194);}return _0x20fb68;};}function handleError(_0x3130ec,_0x37a95a){_0x37a95a=_0x37a95a||0x1f4;return function(_0x50c7d1){logger['error'](_0x50c7d1[_0xadd5('0x27')]);if(_0x50c7d1[_0xadd5('0x28')]){delete _0x50c7d1[_0xadd5('0x28')];}_0x3130ec[_0xadd5('0x18')](_0x37a95a)[_0xadd5('0x29')](_0x50c7d1);};}exports[_0xadd5('0x2a')]=function(_0x3413d4,_0x45851d){var _0x5cee88={},_0x202f4d={},_0x2e9f9a={'count':0x0,'rows':[]};var _0x47cd5c=_[_0xadd5('0x2b')](db[_0xadd5('0x2c')]['rawAttributes'],function(_0x2097f4){return{'name':_0x2097f4['fieldName'],'type':_0x2097f4['type'][_0xadd5('0x2d')]};});_0x202f4d[_0xadd5('0x2e')]=_[_0xadd5('0x2b')](_0x47cd5c,'name');_0x202f4d['query']=_[_0xadd5('0x2f')](_0x3413d4[_0xadd5('0x30')]);_0x202f4d[_0xadd5('0x31')]=_[_0xadd5('0x32')](_0x202f4d[_0xadd5('0x2e')],_0x202f4d[_0xadd5('0x30')]);_0x5cee88[_0xadd5('0x33')]=_['intersection'](_0x202f4d[_0xadd5('0x2e')],qs[_0xadd5('0x34')](_0x3413d4[_0xadd5('0x30')][_0xadd5('0x34')]));_0x5cee88[_0xadd5('0x33')]=_0x5cee88[_0xadd5('0x33')][_0xadd5('0x35')]?_0x5cee88[_0xadd5('0x33')]:_0x202f4d[_0xadd5('0x2e')];if(!_0x3413d4['query']['hasOwnProperty'](_0xadd5('0x36'))){_0x5cee88[_0xadd5('0x1b')]=qs[_0xadd5('0x1b')](_0x3413d4['query'][_0xadd5('0x1b')]);_0x5cee88['offset']=qs['offset'](_0x3413d4[_0xadd5('0x30')][_0xadd5('0x1d')]);}_0x5cee88[_0xadd5('0x37')]=qs['sort'](_0x3413d4[_0xadd5('0x30')][_0xadd5('0x38')]);_0x5cee88[_0xadd5('0x39')]=qs[_0xadd5('0x31')](_[_0xadd5('0x3a')](_0x3413d4['query'],_0x202f4d[_0xadd5('0x31')]),_0x47cd5c);if(_0x3413d4[_0xadd5('0x30')][_0xadd5('0x3b')]){_0x5cee88[_0xadd5('0x39')]=_['merge'](_0x5cee88[_0xadd5('0x39')],{'$or':_[_0xadd5('0x2b')](_0x47cd5c,function(_0x2eaf23){if(_0x2eaf23['type']!==_0xadd5('0x3c')){var _0x58a02a={};_0x58a02a[_0x2eaf23[_0xadd5('0x28')]]={'$like':'%'+_0x3413d4[_0xadd5('0x30')]['filter']+'%'};return _0x58a02a;}})});}_0x5cee88=_[_0xadd5('0x3d')]({},_0x5cee88,_0x3413d4[_0xadd5('0x3e')]);var _0x546c72={'where':_0x5cee88[_0xadd5('0x39')]};return db['ChatTransferReport'][_0xadd5('0x1c')](_0x546c72)['then'](function(_0x2e9385){_0x2e9f9a[_0xadd5('0x1c')]=_0x2e9385;if(_0x3413d4[_0xadd5('0x30')]['includeAll']){_0x5cee88['include']=[{'all':!![]}];}return db[_0xadd5('0x2c')][_0xadd5('0x3f')](_0x5cee88);})[_0xadd5('0x23')](function(_0x46afca){_0x2e9f9a[_0xadd5('0x40')]=_0x46afca;return _0x2e9f9a;})['then'](respondWithFilteredResult(_0x45851d,_0x5cee88))[_0xadd5('0x41')](handleError(_0x45851d,null));};exports[_0xadd5('0x42')]=function(_0x14e55a,_0x1f281f){var _0x14771f={'raw':!![],'where':{'id':_0x14e55a[_0xadd5('0x43')]['id']}},_0x34c5c1={};_0x34c5c1[_0xadd5('0x2e')]=_[_0xadd5('0x2f')](db[_0xadd5('0x2c')]['rawAttributes']);_0x34c5c1[_0xadd5('0x30')]=_[_0xadd5('0x2f')](_0x14e55a[_0xadd5('0x30')]);_0x34c5c1[_0xadd5('0x31')]=_[_0xadd5('0x32')](_0x34c5c1[_0xadd5('0x2e')],_0x34c5c1[_0xadd5('0x30')]);_0x14771f[_0xadd5('0x33')]=_[_0xadd5('0x32')](_0x34c5c1['model'],qs[_0xadd5('0x34')](_0x14e55a[_0xadd5('0x30')][_0xadd5('0x34')]));_0x14771f[_0xadd5('0x33')]=_0x14771f[_0xadd5('0x33')][_0xadd5('0x35')]?_0x14771f['attributes']:_0x34c5c1['model'];if(_0x14e55a[_0xadd5('0x30')][_0xadd5('0x44')]){_0x14771f[_0xadd5('0x45')]=[{'all':!![]}];}_0x14771f=_[_0xadd5('0x3d')]({},_0x14771f,_0x14e55a['options']);return db[_0xadd5('0x2c')][_0xadd5('0x46')](_0x14771f)[_0xadd5('0x23')](handleEntityNotFound(_0x1f281f,null))[_0xadd5('0x23')](respondWithResult(_0x1f281f,null))[_0xadd5('0x41')](handleError(_0x1f281f,null));};exports['create']=function(_0x1df9c1,_0x573bd0){return db[_0xadd5('0x2c')]['create'](_0x1df9c1[_0xadd5('0x47')],{})['then'](respondWithResult(_0x573bd0,0xc9))['catch'](handleError(_0x573bd0,null));};exports[_0xadd5('0x22')]=function(_0x4e65a8,_0x48cc56){if(_0x4e65a8[_0xadd5('0x47')]['id']){delete _0x4e65a8[_0xadd5('0x47')]['id'];}return db['ChatTransferReport'][_0xadd5('0x46')]({'where':{'id':_0x4e65a8[_0xadd5('0x43')]['id']}})[_0xadd5('0x23')](handleEntityNotFound(_0x48cc56,null))[_0xadd5('0x23')](saveUpdates(_0x4e65a8['body'],null))[_0xadd5('0x23')](respondWithResult(_0x48cc56,null))[_0xadd5('0x41')](handleError(_0x48cc56,null));};exports['destroy']=function(_0xcb8af4,_0x2aa1de){return db[_0xadd5('0x2c')][_0xadd5('0x46')]({'where':{'id':_0xcb8af4['params']['id']}})[_0xadd5('0x23')](handleEntityNotFound(_0x2aa1de,null))[_0xadd5('0x23')](removeEntity(_0x2aa1de,null))[_0xadd5('0x41')](handleError(_0x2aa1de,null));};exports['describe']=function(_0x502083,_0x150182){return db[_0xadd5('0x2c')][_0xadd5('0x48')]()[_0xadd5('0x23')](respondWithResult(_0x150182,null))['catch'](handleError(_0x150182,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index b11b428..fe1a1cf 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 _0x22c8=['bluebird','request-promise','path','rimraf','ChatTransferReport','uniqueid','util','api'];(function(_0x275137,_0x102c16){var _0x314312=function(_0x3b0d79){while(--_0x3b0d79){_0x275137['push'](_0x275137['shift']());}};_0x314312(++_0x102c16);}(_0x22c8,0xe6));var _0x822c=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x22c8[_0x644ecd];return _0x1c66ce;};'use strict';var _=require('lodash');var util=require(_0x822c('0x0'));var logger=require('../../config/logger')(_0x822c('0x1'));var moment=require('moment');var BPromise=require(_0x822c('0x2'));var rp=require(_0x822c('0x3'));var fs=require('fs');var path=require(_0x822c('0x4'));var rimraf=require(_0x822c('0x5'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2d0624,_0x5ef931){return _0x2d0624['define'](_0x822c('0x6'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x822c('0x7'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd36=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatTransferReport.attributes','define'];(function(_0x32e7d6,_0x682bc5){var _0x5427cf=function(_0x365c2d){while(--_0x365c2d){_0x32e7d6['push'](_0x32e7d6['shift']());}};_0x5427cf(++_0x682bc5);}(_0xdd36,0x120));var _0x6dd3=function(_0x527a0e,_0x3ee0c0){_0x527a0e=_0x527a0e-0x0;var _0x124a7b=_0xdd36[_0x527a0e];return _0x124a7b;};'use strict';var _=require(_0x6dd3('0x0'));var util=require(_0x6dd3('0x1'));var logger=require(_0x6dd3('0x2'))('api');var moment=require(_0x6dd3('0x3'));var BPromise=require(_0x6dd3('0x4'));var rp=require(_0x6dd3('0x5'));var fs=require('fs');var path=require(_0x6dd3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6dd3('0x7'));module['exports']=function(_0x29f067,_0x757a47){return _0x29f067[_0x6dd3('0x8')]('ChatTransferReport',attributes,{'tableName':_0x6dd3('0x9'),'paranoid':![],'indexes':[{'name':_0x6dd3('0xa'),'fields':[_0x6dd3('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index d241435..0b88d12 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 _0x049b=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x2967fe,_0x2c839d){var _0x6728a8=function(_0x24dd47){while(--_0x24dd47){_0x2967fe['push'](_0x2967fe['shift']());}};_0x6728a8(++_0x2c839d);}(_0x049b,0x169));var _0xb049=function(_0x4814d2,_0x22c926){_0x4814d2=_0x4814d2-0x0;var _0x2bb7c8=_0x049b[_0x4814d2];return _0x2bb7c8;};'use strict';var _=require(_0xb049('0x0'));var util=require(_0xb049('0x1'));var moment=require(_0xb049('0x2'));var BPromise=require(_0xb049('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb049('0x4'));var db=require(_0xb049('0x5'))['db'];var utils=require(_0xb049('0x6'));var logger=require(_0xb049('0x7'))(_0xb049('0x8'));var config=require(_0xb049('0x9'));var jayson=require(_0xb049('0xa'));var client=jayson[_0xb049('0xb')][_0xb049('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d693d,_0x2d82ee,_0xa04108){return new BPromise(function(_0x48abca,_0x2c2233){return client[_0xb049('0xd')](_0x4d693d,_0xa04108)[_0xb049('0xe')](function(_0x2acdbe){logger[_0xb049('0xf')](_0xb049('0x10'),_0x2d82ee,_0xb049('0x11'));logger[_0xb049('0x12')](_0xb049('0x13'),_0x2d82ee,_0xb049('0x11'),JSON[_0xb049('0x14')](_0x2acdbe));if(_0x2acdbe[_0xb049('0x15')]){if(_0x2acdbe[_0xb049('0x15')][_0xb049('0x16')]===0x1f4){logger[_0xb049('0x15')](_0xb049('0x10'),_0x2d82ee,_0x2acdbe[_0xb049('0x15')][_0xb049('0x17')]);return _0x2c2233(_0x2acdbe[_0xb049('0x15')][_0xb049('0x17')]);}logger[_0xb049('0x15')](_0xb049('0x10'),_0x2d82ee,_0x2acdbe['error'][_0xb049('0x17')]);return _0x48abca(_0x2acdbe[_0xb049('0x15')]['message']);}else{logger[_0xb049('0xf')](_0xb049('0x10'),_0x2d82ee,_0xb049('0x11'));_0x48abca(_0x2acdbe[_0xb049('0x18')][_0xb049('0x17')]);}})[_0xb049('0x19')](function(_0xf01201){logger[_0xb049('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x2d82ee,_0xf01201);_0x2c2233(_0xf01201);});});}
\ No newline at end of file
+var _0x25a4=['jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x55a905,_0x970198){var _0x39ae00=function(_0x16beda){while(--_0x16beda){_0x55a905['push'](_0x55a905['shift']());}};_0x39ae00(++_0x970198);}(_0x25a4,0x183));var _0x425a=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x25a4[_0x919445];return _0x511b3e;};'use strict';var _=require('lodash');var util=require(_0x425a('0x0'));var moment=require(_0x425a('0x1'));var BPromise=require(_0x425a('0x2'));var rs=require(_0x425a('0x3'));var fs=require('fs');var Redis=require(_0x425a('0x4'));var db=require(_0x425a('0x5'))['db'];var utils=require(_0x425a('0x6'));var logger=require('../../config/logger')(_0x425a('0x7'));var config=require(_0x425a('0x8'));var jayson=require(_0x425a('0x9'));var client=jayson['client'][_0x425a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cc7f8,_0x5cf5e4,_0x314992){return new BPromise(function(_0x3a0a45,_0x59195a){return client[_0x425a('0xb')](_0x4cc7f8,_0x314992)[_0x425a('0xc')](function(_0x1cf89d){logger[_0x425a('0xd')](_0x425a('0xe'),_0x5cf5e4,_0x425a('0xf'));logger['debug'](_0x425a('0x10'),_0x5cf5e4,_0x425a('0xf'),JSON[_0x425a('0x11')](_0x1cf89d));if(_0x1cf89d['error']){if(_0x1cf89d['error']['code']===0x1f4){logger[_0x425a('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5cf5e4,_0x1cf89d['error'][_0x425a('0x13')]);return _0x59195a(_0x1cf89d[_0x425a('0x12')][_0x425a('0x13')]);}logger[_0x425a('0x12')](_0x425a('0xe'),_0x5cf5e4,_0x1cf89d[_0x425a('0x12')][_0x425a('0x13')]);return _0x3a0a45(_0x1cf89d[_0x425a('0x12')][_0x425a('0x13')]);}else{logger[_0x425a('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x5cf5e4,_0x425a('0xf'));_0x3a0a45(_0x1cf89d[_0x425a('0x14')][_0x425a('0x13')]);}})[_0x425a('0x15')](function(_0x433e06){logger[_0x425a('0x12')](_0x425a('0xe'),_0x5cf5e4,_0x433e06);_0x59195a(_0x433e06);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index eebdb06..936a769 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 _0x254a=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x1e41ab,_0x147c75){var _0x42ddad=function(_0x2ef3a6){while(--_0x2ef3a6){_0x1e41ab['push'](_0x1e41ab['shift']());}};_0x42ddad(++_0x147c75);}(_0x254a,0x81));var _0xa254=function(_0x505a7d,_0x25e11f){_0x505a7d=_0x505a7d-0x0;var _0x17d880=_0x254a[_0x505a7d];return _0x17d880;};'use strict';var multer=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var path=require(_0xa254('0x2'));var timeout=require(_0xa254('0x3'));var express=require(_0xa254('0x4'));var router=express[_0xa254('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa254('0x6'));var controller=require(_0xa254('0x7'));router[_0xa254('0x8')]('/',auth[_0xa254('0x9')](),controller[_0xa254('0xa')]);router[_0xa254('0x8')](_0xa254('0xb'),auth[_0xa254('0x9')](),controller[_0xa254('0xc')]);router[_0xa254('0x8')](_0xa254('0xd'),auth[_0xa254('0x9')](),controller[_0xa254('0xe')]);router[_0xa254('0xf')]('/',auth[_0xa254('0x9')](),controller[_0xa254('0x10')]);router[_0xa254('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa254('0x12')]);router[_0xa254('0x13')](_0xa254('0xd'),auth[_0xa254('0x9')](),controller[_0xa254('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x7b79=['get','show','create','put','/:id','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated'];(function(_0x2d5cae,_0x2edf48){var _0x21df6c=function(_0xbef1cf){while(--_0xbef1cf){_0x2d5cae['push'](_0x2d5cae['shift']());}};_0x21df6c(++_0x2edf48);}(_0x7b79,0xa1));var _0x97b7=function(_0xd18cd,_0x3c155f){_0xd18cd=_0xd18cd-0x0;var _0x190cef=_0x7b79[_0xd18cd];return _0x190cef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x97b7('0x0'));var timeout=require(_0x97b7('0x1'));var express=require(_0x97b7('0x2'));var router=express[_0x97b7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x97b7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x97b7('0x5'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x97b7('0x6')]);router['get'](_0x97b7('0x7'),auth[_0x97b7('0x8')](),controller['describe']);router[_0x97b7('0x9')]('/:id',auth[_0x97b7('0x8')](),controller[_0x97b7('0xa')]);router['post']('/',auth[_0x97b7('0x8')](),controller[_0x97b7('0xb')]);router[_0x97b7('0xc')](_0x97b7('0xd'),auth['isAuthenticated'](),controller[_0x97b7('0xe')]);router['delete'](_0x97b7('0xd'),auth[_0x97b7('0x8')](),controller[_0x97b7('0xf')]);module[_0x97b7('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 9adb59c..8f2917a 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 _0x6f7a=['sequelize','randomstring','exports','address','STRING','email','#011F6A','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','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!','Skip','ENUM','star','thumb','stringify','name','text','input','parse','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','#fafafa','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x39046b,_0x409f7e){var _0x2eb9cf=function(_0x31a5bc){while(--_0x31a5bc){_0x39046b['push'](_0x39046b['shift']());}};_0x2eb9cf(++_0x409f7e);}(_0x6f7a,0xc8));var _0xa6f7=function(_0x3e480e,_0x57bf78){_0x3e480e=_0x3e480e-0x0;var _0x3650b6=_0x6f7a[_0x3e480e];return _0x3650b6;};'use strict';var Sequelize=require(_0xa6f7('0x0'));var rs=require(_0xa6f7('0x1'));module[_0xa6f7('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa6f7('0x3')},'description':{'type':Sequelize[_0xa6f7('0x4')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x5')},'mapKeyOffline':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x5')},'key':{'type':Sequelize[_0xa6f7('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa6f7('0x4')],'allowNull':![],'defaultValue':_0xa6f7('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa6f7('0x4')],'allowNull':![],'defaultValue':_0xa6f7('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa6f7('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa6f7('0x4')]},'animation':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xa6f7('0x9'),_0xa6f7('0xa')),'defaultValue':_0xa6f7('0x9')},'header_online':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0xb')},'start_chat_button':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0xc')},'offline_chat_button':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0xd')},'header_offline':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa6f7('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa6f7('0x10')]},'closingQuestion':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x13')},'noteTitle':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x14')},'placeholderMessage':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x15')},'closingMessage':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x16')},'closingMessageButton':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0xd')},'skipMessageButton':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa6f7('0x18')](_0xa6f7('0x19'),_0xa6f7('0x1a')),'defaultValue':_0xa6f7('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xa6f7('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':function(){return JSON[_0xa6f7('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xa6f7('0x1c'),'type':_0xa6f7('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa6f7('0x1e'),'props':{'title':_0xa6f7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xa6f7('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xa6f7('0x1f')](this[_0xa6f7('0x20')](_0xa6f7('0x21'))):{};},'set':function(_0x5d5c4b){return this['setDataValue'](_0xa6f7('0x21'),JSON[_0xa6f7('0x1b')](_0x5d5c4b));}},'offlineForm':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':function(){return JSON[_0xa6f7('0x1b')]({'items':[{'type':_0xa6f7('0x1e'),'props':{'title':_0xa6f7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xa6f7('0x5'),'type':_0xa6f7('0x5')},'variable':null},{'type':_0xa6f7('0x22'),'config':{'placeholder':_0xa6f7('0x23')},'props':{'title':_0xa6f7('0x23'),'helpText':_0xa6f7('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xa6f7('0x25'))?JSON[_0xa6f7('0x1f')](this['getDataValue'](_0xa6f7('0x25'))):{};},'set':function(_0x2e96b1){return this[_0xa6f7('0x26')](_0xa6f7('0x25'),JSON[_0xa6f7('0x1b')](_0x2e96b1));}},'token':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':function(){return rs[_0xa6f7('0x27')]();}},'autoclose':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa6f7('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x28')},'waitingMessage':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x29')},'offlineMessageBody':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x2b')},'skipUnmanaged':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa6f7('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa6f7('0x2c');}},'notificationSound':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6f7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':_0xa6f7('0x2d')},'verticalAlignment':{'type':Sequelize[_0xa6f7('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa6f7('0x4')]},'customerAvatar':{'type':Sequelize[_0xa6f7('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa6f7('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa6f7('0x4')],'allowNull':![],'defaultValue':_0xa6f7('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa6f7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa6f7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xa6f7('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa6f7('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5bb7aa){if(!_0x5bb7aa)this[_0xa6f7('0x26')](_0xa6f7('0x2f'),null);this[_0xa6f7('0x26')](_0xa6f7('0x30'),_0x5bb7aa);}},'vidaooEscalation':{'type':Sequelize[_0xa6f7('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa6f7('0x4')]},'vidaooTopic':{'type':Sequelize[_0xa6f7('0x4')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':function(){return _0xa6f7('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa6f7('0x10')]}};
\ No newline at end of file
+var _0x2192=['Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','TEXT','Comments','offlineForm','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error'];(function(_0x1a6886,_0x572cdc){var _0x9e7d24=function(_0x594e38){while(--_0x594e38){_0x1a6886['push'](_0x1a6886['shift']());}};_0x9e7d24(++_0x572cdc);}(_0x2192,0x1d1));var _0x2219=function(_0xbbe684,_0x537883){_0xbbe684=_0xbbe684-0x0;var _0x409198=_0x2192[_0xbbe684];return _0x409198;};'use strict';var Sequelize=require(_0x2219('0x0'));var rs=require(_0x2219('0x1'));module[_0x2219('0x2')]={'name':{'type':Sequelize[_0x2219('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2219('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x2219('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x6')},'customerAlias':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2219('0x3')],'allowNull':![],'defaultValue':_0x2219('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2219('0x3')],'allowNull':![],'defaultValue':_0x2219('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2219('0x3')],'allowNull':![],'defaultValue':_0x2219('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2219('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2219('0x3')]},'animation':{'type':Sequelize[_0x2219('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2219('0xb')](_0x2219('0xc'),_0x2219('0xd')),'defaultValue':_0x2219('0xc')},'header_online':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2219('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x2219('0x10')},'download_transcript':{'type':Sequelize[_0x2219('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2219('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x12')},'noteTitle':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x13')},'closingMessageButton':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x14')},'conditionAgreement':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x15')},'ratingType':{'type':Sequelize[_0x2219('0xb')]('star',_0x2219('0x16')),'defaultValue':_0x2219('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2219('0x18')]({'items':[{'type':_0x2219('0x19'),'variable':null,'config':{'placeholder':_0x2219('0x1a'),'type':_0x2219('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x2219('0x19'),'props':{'title':_0x2219('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2219('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2219('0x1c')](_0x2219('0x1d'))?JSON[_0x2219('0x1e')](this[_0x2219('0x1c')]('onlineForm')):{};},'set':function(_0x5a645b){return this['setDataValue'](_0x2219('0x1d'),JSON[_0x2219('0x18')](_0x5a645b));}},'offlineForm':{'type':Sequelize[_0x2219('0x1f')],'defaultValue':function(){return JSON[_0x2219('0x18')]({'items':[{'type':_0x2219('0x19'),'props':{'title':_0x2219('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2219('0x5'),'type':_0x2219('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x2219('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x2219('0x1c')](_0x2219('0x21'))?JSON[_0x2219('0x1e')](this[_0x2219('0x1c')]('offlineForm')):{};},'set':function(_0xe05d58){return this['setDataValue'](_0x2219('0x21'),JSON[_0x2219('0x18')](_0xe05d58));}},'token':{'type':Sequelize[_0x2219('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x2219('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2219('0x3')]},'forwardOffline':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2219('0x3')]},'waitingTitle':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2219('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0x14')},'sendUnmanaged':{'type':Sequelize[_0x2219('0x3')],'defaultValue':_0x2219('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2219('0x1f')]},'showAgentAvatar':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2219('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2219('0x1f')],'defaultValue':function(){return _0x2219('0x22');}},'notificationSound':{'type':Sequelize[_0x2219('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x2219('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x2219('0x23')},'verticalAlignment':{'type':Sequelize[_0x2219('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2219('0x24')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x2219('0x1f')]},'showCustomerAvatar':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2219('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2219('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2219('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2219('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2219('0x25')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2219('0x9')],'comment':_0x2219('0x26')},'mandatoryDisposition':{'type':Sequelize[_0x2219('0xa')],'defaultValue':![],'comment':_0x2219('0x27'),'set':function(_0x2ac7f6){if(!_0x2ac7f6)this[_0x2219('0x28')](_0x2219('0x29'),null);this[_0x2219('0x28')]('mandatoryDisposition',_0x2ac7f6);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x2219('0x3')],'allowNull':![],'defaultValue':_0x2219('0x2a')},'vidaooNote':{'type':Sequelize[_0x2219('0x3')],'defaultValue':function(){return _0x2219('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x2219('0x1f')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2219('0x1f')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 9e2d400..2d8e1fb 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 _0xd684=['addAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','updatedAt','difference','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','no\x20available\x20attributes','createdAt','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','notifyMail','attachments','offline-chat','addInteraction','omit','Owner','fullname','internal','Tags','color','tag','findAll','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','virtual','License','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','color_button','addApplications','Transaction','READ_COMMITTED','ChatApplication','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','ChatWebsites','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','include','rows','show','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','params','Pause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd684,0xc2));var _0x4d68=function(_0x162f62,_0x1a0ab1){_0x162f62=_0x162f62-0x0;var _0x26c56e=_0xd684[_0x162f62];return _0x26c56e;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x4d68('0x0'));var util=require(_0x4d68('0x1'));var path=require(_0x4d68('0x2'));var ejs=require(_0x4d68('0x3'));var fs=require('fs');var fs_extra=require(_0x4d68('0x4'));var _=require(_0x4d68('0x5'));var querystring=require(_0x4d68('0x6'));var Redis=require(_0x4d68('0x7'));var qs=require(_0x4d68('0x8'));var logger=require(_0x4d68('0x9'))(_0x4d68('0xa'));var config=require(_0x4d68('0xb'));var db=require(_0x4d68('0xc'))['db'];config[_0x4d68('0xd')]=_[_0x4d68('0xe')](config['redis'],{'host':_0x4d68('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d68('0xd')]));require(_0x4d68('0x10'))[_0x4d68('0x11')](socket);var jayson=require(_0x4d68('0x12'));var client=jayson[_0x4d68('0x13')][_0x4d68('0x14')]({'port':0x232c});var client9002=jayson['client'][_0x4d68('0x14')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x4d68('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x56485b,_0x29ec45,_0x171732,_0x327458){return new BPromise(function(_0x31b361,_0x263574){var _0x7e71d=_0x327458||client;return _0x7e71d[_0x4d68('0x15')](_0x56485b,_0x171732)[_0x4d68('0x16')](function(_0x51e00c){logger[_0x4d68('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x29ec45,_0x4d68('0x18'));logger[_0x4d68('0x19')](_0x4d68('0x1a'),_0x29ec45,_0x4d68('0x18'),JSON['stringify'](_0x51e00c));if(_0x51e00c['error']){if(_0x51e00c[_0x4d68('0x1b')]['code']===0x1f4){logger[_0x4d68('0x1b')](_0x4d68('0x1c'),_0x29ec45,_0x51e00c[_0x4d68('0x1b')][_0x4d68('0x1d')]);return _0x263574(_0x51e00c[_0x4d68('0x1b')][_0x4d68('0x1d')]);}logger['error'](_0x4d68('0x1c'),_0x29ec45,_0x51e00c[_0x4d68('0x1b')][_0x4d68('0x1d')]);return _0x31b361(_0x51e00c[_0x4d68('0x1b')]['message']);}else{logger[_0x4d68('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x29ec45,_0x4d68('0x18'));_0x31b361(_0x51e00c[_0x4d68('0x1e')][_0x4d68('0x1d')]);}})[_0x4d68('0x1f')](function(_0x2d043f){logger[_0x4d68('0x1b')](_0x4d68('0x1c'),_0x29ec45,_0x2d043f);_0x263574(_0x2d043f);});});}function respondWithStatusCode(_0x42f1ef,_0xc2ac7c){_0xc2ac7c=_0xc2ac7c||0xcc;return function(_0x4811aa){if(_0x4811aa){return _0x42f1ef['sendStatus'](_0xc2ac7c);}return _0x42f1ef[_0x4d68('0x20')](_0xc2ac7c)['end']();};}function respondWithResult(_0x39e9d9,_0x67ac34){_0x67ac34=_0x67ac34||0xc8;return function(_0x2c40ab){if(_0x2c40ab){return _0x39e9d9[_0x4d68('0x20')](_0x67ac34)[_0x4d68('0x21')](_0x2c40ab);}};}function respondWithFilteredResult(_0x26965f,_0x2e06b7){return function(_0x5e95af){if(_0x5e95af){var _0x5629bd=typeof _0x2e06b7[_0x4d68('0x22')]===_0x4d68('0x23')&&typeof _0x2e06b7[_0x4d68('0x24')]===_0x4d68('0x23');var _0x26ae2f=_0x5e95af['count'];var _0x941632=_0x5629bd?0x0:_0x2e06b7[_0x4d68('0x22')];var _0x1289af=_0x5629bd?_0x5e95af[_0x4d68('0x25')]:_0x2e06b7[_0x4d68('0x22')]+_0x2e06b7['limit'];var _0xf4ec49;if(_0x1289af>=_0x26ae2f){_0x1289af=_0x26ae2f;_0xf4ec49=0xc8;}else{_0xf4ec49=0xce;}_0x26965f[_0x4d68('0x20')](_0xf4ec49);return _0x26965f[_0x4d68('0x26')](_0x4d68('0x27'),_0x941632+'-'+_0x1289af+'/'+_0x26ae2f)[_0x4d68('0x21')](_0x5e95af);}return null;};}function saveUpdates(_0x2a97bd){return function(_0x42663d){if(_0x42663d){return _0x42663d['update'](_0x2a97bd)[_0x4d68('0x16')](function(_0x312764){return _0x312764;});}return null;};}function removeEntity(_0x4a5f95){return function(_0x17995a){if(_0x17995a){return _0x17995a[_0x4d68('0x28')]()[_0x4d68('0x16')](function(){var _0x1880b7=_0x17995a['get']({'plain':!![]});var _0x218b40=_0x4d68('0x29');return db['UserProfileResource'][_0x4d68('0x28')]({'where':{'type':_0x218b40,'resourceId':_0x1880b7['id']}})['then'](function(){return _0x17995a;});})['then'](function(){_0x4a5f95[_0x4d68('0x20')](0xcc)[_0x4d68('0x2a')]();});}};}function handleEntityNotFound(_0x3d09ba){return function(_0x39c4ca){if(!_0x39c4ca){_0x3d09ba[_0x4d68('0x2b')](0x194);}return _0x39c4ca;};}function handleError(_0x29138d,_0x4ac217){_0x4ac217=_0x4ac217||0x1f4;return function(_0x57ab88){logger['error'](_0x57ab88[_0x4d68('0x2c')]);if(_0x57ab88[_0x4d68('0x2d')]){delete _0x57ab88[_0x4d68('0x2d')];}_0x29138d[_0x4d68('0x20')](_0x4ac217)[_0x4d68('0x2e')](_0x57ab88);};}exports[_0x4d68('0x2f')]=function(_0x8836c6,_0x4a2ef4){var _0x4eeda0={'include':[{'model':db['Pause'],'as':_0x4d68('0x30')}]},_0x4f1e4b={},_0x51dac6={'count':0x0,'rows':[]};var _0x20fffa=_['map'](db['ChatWebsite'][_0x4d68('0x31')],function(_0x1d4ff8){return{'name':_0x1d4ff8[_0x4d68('0x32')],'type':_0x1d4ff8[_0x4d68('0x33')]['key']};});_0x4f1e4b['model']=_[_0x4d68('0x34')](_0x20fffa,_0x4d68('0x2d'));_0x4f1e4b[_0x4d68('0x35')]=_[_0x4d68('0x36')](_0x8836c6[_0x4d68('0x35')]);_0x4f1e4b[_0x4d68('0x37')]=_['intersection'](_0x4f1e4b[_0x4d68('0x38')],_0x4f1e4b[_0x4d68('0x35')]);_0x4eeda0[_0x4d68('0x39')]=_[_0x4d68('0x3a')](_0x4f1e4b[_0x4d68('0x38')],qs['fields'](_0x8836c6[_0x4d68('0x35')][_0x4d68('0x3b')]));_0x4eeda0[_0x4d68('0x39')]=_0x4eeda0['attributes'][_0x4d68('0x3c')]?_0x4eeda0[_0x4d68('0x39')]:_0x4f1e4b[_0x4d68('0x38')];if(!_0x8836c6['query'][_0x4d68('0x3d')](_0x4d68('0x3e'))){_0x4eeda0[_0x4d68('0x24')]=qs['limit'](_0x8836c6[_0x4d68('0x35')][_0x4d68('0x24')]);_0x4eeda0[_0x4d68('0x22')]=qs[_0x4d68('0x22')](_0x8836c6[_0x4d68('0x35')][_0x4d68('0x22')]);}_0x4eeda0[_0x4d68('0x3f')]=qs['sort'](_0x8836c6['query'][_0x4d68('0x40')]);_0x4eeda0[_0x4d68('0x41')]=qs[_0x4d68('0x37')](_[_0x4d68('0x42')](_0x8836c6['query'],_0x4f1e4b[_0x4d68('0x37')]),_0x20fffa);if(_0x8836c6['query'][_0x4d68('0x43')]){_0x4eeda0[_0x4d68('0x41')]=_[_0x4d68('0x44')](_0x4eeda0['where'],{'$or':_[_0x4d68('0x34')](_0x20fffa,function(_0x2dd373){if(_0x2dd373['type']!==_0x4d68('0x45')){var _0x4ca548={};_0x4ca548[_0x2dd373[_0x4d68('0x2d')]]={'$like':'%'+_0x8836c6['query'][_0x4d68('0x43')]+'%'};return _0x4ca548;}})});}_0x4eeda0=_[_0x4d68('0x44')]({},_0x4eeda0,_0x8836c6[_0x4d68('0x46')]);var _0x2532fd={'where':_0x4eeda0[_0x4d68('0x41')]};return db[_0x4d68('0x47')][_0x4d68('0x25')](_0x2532fd)[_0x4d68('0x16')](function(_0x1407d0){_0x51dac6[_0x4d68('0x25')]=_0x1407d0;if(_0x8836c6[_0x4d68('0x35')][_0x4d68('0x48')]){_0x4eeda0[_0x4d68('0x49')]=[{'all':!![]}];}return db[_0x4d68('0x47')]['findAll'](_0x4eeda0);})[_0x4d68('0x16')](function(_0x1b6721){_0x51dac6[_0x4d68('0x4a')]=_0x1b6721;return _0x51dac6;})['then'](respondWithFilteredResult(_0x4a2ef4,_0x4eeda0))[_0x4d68('0x1f')](handleError(_0x4a2ef4,null));};exports[_0x4d68('0x4b')]=function(_0x1d6ba1,_0x378a5c){var _0xef97fe={'raw':![],'where':{'id':_0x1d6ba1['params']['id']},'include':[{'model':db['Pause'],'as':_0x4d68('0x30')}]},_0x47fd34={};_0x47fd34[_0x4d68('0x38')]=_[_0x4d68('0x36')](db[_0x4d68('0x47')][_0x4d68('0x31')]);_0x47fd34['query']=_[_0x4d68('0x36')](_0x1d6ba1[_0x4d68('0x35')]);_0x47fd34[_0x4d68('0x37')]=_['intersection'](_0x47fd34[_0x4d68('0x38')],_0x47fd34[_0x4d68('0x35')]);_0xef97fe[_0x4d68('0x39')]=_[_0x4d68('0x3a')](_0x47fd34[_0x4d68('0x38')],qs[_0x4d68('0x3b')](_0x1d6ba1[_0x4d68('0x35')][_0x4d68('0x3b')]));_0xef97fe[_0x4d68('0x39')]=_0xef97fe['attributes'][_0x4d68('0x3c')]?_0xef97fe[_0x4d68('0x39')]:_0x47fd34[_0x4d68('0x38')];if(_0x1d6ba1[_0x4d68('0x35')][_0x4d68('0x48')]){_0xef97fe[_0x4d68('0x49')]=[{'all':!![]}];}_0xef97fe=_[_0x4d68('0x44')]({},_0xef97fe,_0x1d6ba1[_0x4d68('0x46')]);return db['ChatWebsite'][_0x4d68('0x4c')](_0xef97fe)[_0x4d68('0x16')](handleEntityNotFound(_0x378a5c,null))[_0x4d68('0x16')](respondWithResult(_0x378a5c,null))[_0x4d68('0x1f')](handleError(_0x378a5c,null));};exports[_0x4d68('0x4d')]=function(_0x47599d,_0x3e2831){return db[_0x4d68('0x47')][_0x4d68('0x4d')](_0x47599d[_0x4d68('0x4e')],{})[_0x4d68('0x16')](function(_0x33b0d8){var _0x1d8940=_0x47599d[_0x4d68('0x4f')][_0x4d68('0x50')]({'plain':!![]});if(!_0x1d8940)throw new Error(_0x4d68('0x51'));if(_0x1d8940[_0x4d68('0x52')]===_0x4d68('0x4f')){var _0x5c883c=_0x33b0d8['get']({'plain':!![]});var _0x33c0f8=_0x4d68('0x29');return db[_0x4d68('0x53')][_0x4d68('0x4c')]({'where':{'name':_0x33c0f8,'userProfileId':_0x1d8940[_0x4d68('0x54')]},'raw':!![]})[_0x4d68('0x16')](function(_0x101194){if(_0x101194&&_0x101194[_0x4d68('0x55')]===0x0){return db['UserProfileResource'][_0x4d68('0x4d')]({'name':_0x5c883c[_0x4d68('0x2d')],'resourceId':_0x5c883c['id'],'type':_0x101194['name'],'sectionId':_0x101194['id']},{})[_0x4d68('0x16')](function(){return _0x33b0d8;});}else{return _0x33b0d8;}})['catch'](function(_0x59a98e){logger[_0x4d68('0x1b')](_0x4d68('0x56'),_0x59a98e);throw _0x59a98e;});}return _0x33b0d8;})[_0x4d68('0x16')](respondWithResult(_0x3e2831,0xc9))[_0x4d68('0x1f')](handleError(_0x3e2831,null));};exports[_0x4d68('0x57')]=function(_0x51bde5,_0x202c0a){if(_0x51bde5[_0x4d68('0x4e')]['id']){delete _0x51bde5['body']['id'];}return db[_0x4d68('0x47')][_0x4d68('0x4c')]({'where':{'id':_0x51bde5[_0x4d68('0x58')]['id']},'include':[{'model':db[_0x4d68('0x59')],'as':_0x4d68('0x30')}]})[_0x4d68('0x16')](handleEntityNotFound(_0x202c0a,null))[_0x4d68('0x16')](saveUpdates(_0x51bde5[_0x4d68('0x4e')],null))[_0x4d68('0x16')](respondWithResult(_0x202c0a,null))[_0x4d68('0x1f')](handleError(_0x202c0a,null));};exports[_0x4d68('0x28')]=function(_0x145d98,_0x419b3b){return db['ChatWebsite'][_0x4d68('0x4c')]({'where':{'id':_0x145d98[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x419b3b,null))['then'](removeEntity(_0x419b3b,null))[_0x4d68('0x1f')](handleError(_0x419b3b,null));};exports['describe']=function(_0x533811,_0x27fef1){return db['ChatWebsite'][_0x4d68('0x5a')]()['then'](respondWithResult(_0x27fef1,null))[_0x4d68('0x1f')](handleError(_0x27fef1,null));};exports[_0x4d68('0x5b')]=function(_0x14797a,_0x5f573d){if(_0x14797a[_0x4d68('0x4e')]['id']){delete _0x14797a[_0x4d68('0x4e')]['id'];}return db[_0x4d68('0x47')][_0x4d68('0x4c')]({'where':{'id':_0x14797a[_0x4d68('0x58')]['id']}})['then'](handleEntityNotFound(_0x5f573d,null))[_0x4d68('0x16')](function(_0x2bb526){if(_0x2bb526){_0x14797a[_0x4d68('0x4e')][_0x4d68('0x5c')]=_0x2bb526['id'];return db[_0x4d68('0x5d')][_0x4d68('0x4d')](_0x14797a[_0x4d68('0x4e')]);}})['then'](respondWithResult(_0x5f573d,null))[_0x4d68('0x1f')](handleError(_0x5f573d,null));};exports[_0x4d68('0x5e')]=function(_0x2c6b7e,_0x52a58d){var _0x3a6c43={'raw':![],'where':{}};var _0x3ad1f6={};var _0xc02f83={'count':0x0,'rows':[]};return db[_0x4d68('0x47')][_0x4d68('0x5f')]({'where':{'id':_0x2c6b7e['params']['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x52a58d,null))['then'](function(_0x32db2b){if(_0x32db2b){_0x3ad1f6[_0x4d68('0x38')]=_[_0x4d68('0x36')](db[_0x4d68('0x5d')][_0x4d68('0x31')]);_0x3ad1f6[_0x4d68('0x35')]=_['keys'](_0x2c6b7e[_0x4d68('0x35')]);_0x3ad1f6[_0x4d68('0x37')]=_['intersection'](_0x3ad1f6[_0x4d68('0x38')],_0x3ad1f6[_0x4d68('0x35')]);_0x3a6c43[_0x4d68('0x39')]=_[_0x4d68('0x3a')](_0x3ad1f6[_0x4d68('0x38')],qs['fields'](_0x2c6b7e[_0x4d68('0x35')]['fields']));_0x3a6c43[_0x4d68('0x39')]=_0x3a6c43[_0x4d68('0x39')][_0x4d68('0x3c')]?_0x3a6c43[_0x4d68('0x39')]:_0x3ad1f6[_0x4d68('0x38')];if(!_0x2c6b7e['query']['hasOwnProperty'](_0x4d68('0x3e'))){_0x3a6c43[_0x4d68('0x24')]=qs[_0x4d68('0x24')](_0x2c6b7e[_0x4d68('0x35')][_0x4d68('0x24')]);_0x3a6c43[_0x4d68('0x22')]=qs['offset'](_0x2c6b7e[_0x4d68('0x35')]['offset']);}_0x3a6c43[_0x4d68('0x3f')]=qs[_0x4d68('0x40')](_0x2c6b7e[_0x4d68('0x35')][_0x4d68('0x40')]);_0x3a6c43[_0x4d68('0x41')]=qs[_0x4d68('0x37')](_[_0x4d68('0x42')](_0x2c6b7e[_0x4d68('0x35')],_0x3ad1f6[_0x4d68('0x37')]));_0x3a6c43[_0x4d68('0x41')][_0x4d68('0x5c')]=_0x32db2b['id'];if(_0x2c6b7e[_0x4d68('0x35')][_0x4d68('0x43')]){_0x3a6c43[_0x4d68('0x41')]=_[_0x4d68('0x44')](_0x3a6c43[_0x4d68('0x41')],{'$or':_[_0x4d68('0x34')](_0x3a6c43[_0x4d68('0x39')],function(_0x6512fe){var _0x20bef5={};_0x20bef5[_0x6512fe]={'$like':'%'+_0x2c6b7e['query'][_0x4d68('0x43')]+'%'};return _0x20bef5;})});}_0x3a6c43=_['merge']({},_0x3a6c43,_0x2c6b7e[_0x4d68('0x46')]);return db[_0x4d68('0x5d')][_0x4d68('0x25')]({'where':_0x3a6c43[_0x4d68('0x41')]})['then'](function(_0x41836d){_0xc02f83[_0x4d68('0x25')]=_0x41836d;if(_0x2c6b7e['query'][_0x4d68('0x48')]){_0x3a6c43[_0x4d68('0x49')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3a6c43);})['then'](function(_0x51b1c3){_0xc02f83['rows']=_0x51b1c3;return _0xc02f83;});}})['then'](respondWithFilteredResult(_0x52a58d,_0x3a6c43))[_0x4d68('0x1f')](handleError(_0x52a58d,null));};exports[_0x4d68('0x60')]=function(_0x534fb7,_0x27ef14){return db['ChatWebsite'][_0x4d68('0x4c')]({'where':{'id':_0x534fb7[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x27ef14,null))['then'](function(_0x3e6a45){if(_0x3e6a45){return _0x3e6a45[_0x4d68('0x60')](_0x534fb7['query'][_0x4d68('0x61')]);}})['then'](respondWithStatusCode(_0x27ef14,null))[_0x4d68('0x1f')](handleError(_0x27ef14,null));};exports[_0x4d68('0x62')]=function(_0x1da0aa,_0x1c957e){if(_0x1da0aa['body']['id']){delete _0x1da0aa[_0x4d68('0x4e')]['id'];}return db[_0x4d68('0x47')][_0x4d68('0x4c')]({'where':{'id':_0x1da0aa[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x1c957e,null))['then'](function(_0xf11183){if(_0xf11183){_0x1da0aa[_0x4d68('0x4e')][_0x4d68('0x5c')]=_0xf11183['id'];return db[_0x4d68('0x63')][_0x4d68('0x4d')](_0x1da0aa['body']);}})[_0x4d68('0x16')](respondWithResult(_0x1c957e,null))['catch'](handleError(_0x1c957e,null));};exports[_0x4d68('0x64')]=function(_0x4d34b5,_0x599bde){var _0x33e8cd={'raw':![],'where':{}};var _0x39a80b={};var _0x5c636d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4d68('0x5f')]({'where':{'id':_0x4d34b5[_0x4d68('0x58')]['id']}})['then'](handleEntityNotFound(_0x599bde,null))['then'](function(_0x3352af){if(_0x3352af){_0x39a80b[_0x4d68('0x38')]=_['keys'](db[_0x4d68('0x63')][_0x4d68('0x31')]);_0x39a80b[_0x4d68('0x35')]=_[_0x4d68('0x36')](_0x4d34b5[_0x4d68('0x35')]);_0x39a80b[_0x4d68('0x37')]=_[_0x4d68('0x3a')](_0x39a80b[_0x4d68('0x38')],_0x39a80b[_0x4d68('0x35')]);_0x33e8cd[_0x4d68('0x39')]=_[_0x4d68('0x3a')](_0x39a80b['model'],qs[_0x4d68('0x3b')](_0x4d34b5[_0x4d68('0x35')]['fields']));_0x33e8cd[_0x4d68('0x39')]=_0x33e8cd[_0x4d68('0x39')][_0x4d68('0x3c')]?_0x33e8cd[_0x4d68('0x39')]:_0x39a80b[_0x4d68('0x38')];if(!_0x4d34b5[_0x4d68('0x35')][_0x4d68('0x3d')](_0x4d68('0x3e'))){_0x33e8cd[_0x4d68('0x24')]=qs[_0x4d68('0x24')](_0x4d34b5['query']['limit']);_0x33e8cd['offset']=qs[_0x4d68('0x22')](_0x4d34b5['query'][_0x4d68('0x22')]);}_0x33e8cd[_0x4d68('0x3f')]=qs[_0x4d68('0x40')](_0x4d34b5[_0x4d68('0x35')][_0x4d68('0x40')]);_0x33e8cd['where']=qs[_0x4d68('0x37')](_[_0x4d68('0x42')](_0x4d34b5[_0x4d68('0x35')],_0x39a80b['filters']));_0x33e8cd[_0x4d68('0x41')]['ChatWebsiteId']=_0x3352af['id'];if(_0x4d34b5['query'][_0x4d68('0x43')]){_0x33e8cd[_0x4d68('0x41')]=_[_0x4d68('0x44')](_0x33e8cd[_0x4d68('0x41')],{'$or':_[_0x4d68('0x34')](_0x33e8cd[_0x4d68('0x39')],function(_0x2009e7){var _0xf614b1={};_0xf614b1[_0x2009e7]={'$like':'%'+_0x4d34b5[_0x4d68('0x35')][_0x4d68('0x43')]+'%'};return _0xf614b1;})});}_0x33e8cd=_[_0x4d68('0x44')]({},_0x33e8cd,_0x4d34b5[_0x4d68('0x46')]);return db[_0x4d68('0x63')][_0x4d68('0x25')]({'where':_0x33e8cd[_0x4d68('0x41')]})[_0x4d68('0x16')](function(_0x342c4e){_0x5c636d[_0x4d68('0x25')]=_0x342c4e;if(_0x4d34b5['query'][_0x4d68('0x48')]){_0x33e8cd[_0x4d68('0x49')]=[{'all':!![]}];}return db[_0x4d68('0x63')]['findAll'](_0x33e8cd);})['then'](function(_0x34340b){_0x5c636d[_0x4d68('0x4a')]=_0x34340b;return _0x5c636d;});}})['then'](respondWithFilteredResult(_0x599bde,_0x33e8cd))['catch'](handleError(_0x599bde,null));};exports[_0x4d68('0x65')]=function(_0x413f87,_0x129f17){return db[_0x4d68('0x47')]['find']({'where':{'id':_0x413f87[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x129f17,null))[_0x4d68('0x16')](function(_0x365f6d){if(_0x365f6d){return _0x365f6d[_0x4d68('0x65')](_0x413f87[_0x4d68('0x35')][_0x4d68('0x61')]);}})[_0x4d68('0x16')](respondWithStatusCode(_0x129f17,null))[_0x4d68('0x1f')](handleError(_0x129f17,null));};exports[_0x4d68('0x66')]=function(_0x5a1747,_0x4b864f){_0x5a1747[_0x4d68('0x4e')][_0x4d68('0x67')]=_0x5a1747[_0x4d68('0x68')][_0x4d68('0x69')];return db[_0x4d68('0x47')]['find']({'where':{'id':_0x5a1747['params']['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x4b864f,null))[_0x4d68('0x16')](saveUpdates(_0x5a1747[_0x4d68('0x4e')],null))['then'](respondWithResult(_0x4b864f,null))['catch'](handleError(_0x4b864f,null));};exports[_0x4d68('0x6a')]=function(_0x423220,_0x394183){_0x423220[_0x4d68('0x4e')]['agentAvatar']=_0x423220[_0x4d68('0x68')][_0x4d68('0x69')];return db[_0x4d68('0x47')]['find']({'where':{'id':_0x423220[_0x4d68('0x58')]['id']}})['then'](handleEntityNotFound(_0x394183,null))[_0x4d68('0x16')](saveUpdates(_0x423220[_0x4d68('0x4e')],null))[_0x4d68('0x16')](respondWithResult(_0x394183,null))[_0x4d68('0x1f')](handleError(_0x394183,null));};exports['addCustomerAvatar']=function(_0xae830d,_0x339aaf){_0xae830d['body'][_0x4d68('0x6b')]=_0xae830d[_0x4d68('0x68')]['filename'];return db[_0x4d68('0x47')][_0x4d68('0x4c')]({'where':{'id':_0xae830d[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x339aaf,null))[_0x4d68('0x16')](saveUpdates(_0xae830d['body'],null))[_0x4d68('0x16')](respondWithResult(_0x339aaf,null))[_0x4d68('0x1f')](handleError(_0x339aaf,null));};exports[_0x4d68('0x6c')]=function(_0x14184f,_0x1a279){_0x14184f[_0x4d68('0x4e')][_0x4d68('0x6d')]=_0x14184f[_0x4d68('0x68')][_0x4d68('0x69')];return db['ChatWebsite'][_0x4d68('0x4c')]({'where':{'id':_0x14184f[_0x4d68('0x58')]['id']}})['then'](handleEntityNotFound(_0x1a279,null))[_0x4d68('0x16')](saveUpdates(_0x14184f['body'],null))['then'](respondWithResult(_0x1a279,null))['catch'](handleError(_0x1a279,null));};exports[_0x4d68('0x6e')]=function(_0xdc15fc,_0x539381){var _0x5c15f1=path['join'](config[_0x4d68('0x6f')],_0x4d68('0x70'));var _0x50446b={'where':{'id':_0xdc15fc[_0x4d68('0x58')]['id']},'attributes':['id',_0x4d68('0x67')],'raw':!![]};var _0x48d123=![];return require(_0x4d68('0x71'))[_0x4d68('0x72')]()[_0x4d68('0x16')](function(_0x1ad8b5){if(_0x1ad8b5){_0x48d123=_0x1ad8b5[_0x4d68('0x73')];}})['then'](function(){return db[_0x4d68('0x47')][_0x4d68('0x4c')](_0x50446b);})[_0x4d68('0x16')](handleEntityNotFound(_0x539381,null))[_0x4d68('0x16')](function(_0x54246b){if(_0x54246b){if(!_[_0x4d68('0x74')](_0x54246b[_0x4d68('0x67')])){if(fs[_0x4d68('0x75')](path[_0x4d68('0x76')](config['root'],_0x4d68('0x77'),_0x54246b[_0x4d68('0x67')]))&&_0x48d123){_0x5c15f1=path[_0x4d68('0x76')](config['root'],_0x4d68('0x77'),_0x54246b[_0x4d68('0x67')]);}}return _0x539381[_0x4d68('0x78')](_0x5c15f1);}})[_0x4d68('0x1f')](handleError(_0x539381,null));};exports[_0x4d68('0x79')]=function(_0x393f69,_0x2a2301){var _0x4954ba=path[_0x4d68('0x76')](config[_0x4d68('0x6f')],'server/files/images/avatars/default_avatar.png');var _0x426d17={'where':{'id':_0x393f69[_0x4d68('0x58')]['id']},'attributes':['id',_0x4d68('0x7a')],'raw':!![]};return db[_0x4d68('0x47')][_0x4d68('0x4c')](_0x426d17)[_0x4d68('0x16')](handleEntityNotFound(_0x2a2301,null))[_0x4d68('0x16')](function(_0xce8302){if(_0xce8302){if(!_[_0x4d68('0x74')](_0xce8302['agentAvatar'])){if(fs[_0x4d68('0x75')](path[_0x4d68('0x76')](config[_0x4d68('0x6f')],_0x4d68('0x7b'),_0xce8302['agentAvatar']))){_0x4954ba=path['join'](config['root'],_0x4d68('0x7b'),_0xce8302['agentAvatar']);}}return _0x2a2301['download'](_0x4954ba);}})[_0x4d68('0x1f')](handleError(_0x2a2301,null));};exports[_0x4d68('0x7c')]=function(_0x178eab,_0x39bcb6){var _0x2529ce=path[_0x4d68('0x76')](config['root'],_0x4d68('0x7d'));var _0x1b2227={'where':{'id':_0x178eab['params']['id']},'attributes':['id',_0x4d68('0x6b'),'showCustomerAvatar'],'raw':!![]};return db[_0x4d68('0x47')][_0x4d68('0x4c')](_0x1b2227)[_0x4d68('0x16')](handleEntityNotFound(_0x39bcb6,null))['then'](function(_0x21e9f0){if(_0x21e9f0){if(!_[_0x4d68('0x74')](_0x21e9f0[_0x4d68('0x6b')])){if(fs[_0x4d68('0x75')](path['join'](config[_0x4d68('0x6f')],_0x4d68('0x7b'),_0x21e9f0[_0x4d68('0x6b')]))&&_0x21e9f0[_0x4d68('0x7e')]){_0x2529ce=path[_0x4d68('0x76')](config[_0x4d68('0x6f')],_0x4d68('0x7b'),_0x21e9f0[_0x4d68('0x6b')]);}}return _0x39bcb6['download'](_0x2529ce);}})[_0x4d68('0x1f')](handleError(_0x39bcb6,null));};exports[_0x4d68('0x7f')]=function(_0x28502e,_0x4063ba){var _0x1c3068=path[_0x4d68('0x76')](config[_0x4d68('0x6f')],_0x4d68('0x80'));var _0x2a2a59={'where':{'id':_0x28502e[_0x4d68('0x58')]['id']},'attributes':['id',_0x4d68('0x6d')],'raw':!![]};return db[_0x4d68('0x47')][_0x4d68('0x4c')](_0x2a2a59)[_0x4d68('0x16')](handleEntityNotFound(_0x4063ba,null))[_0x4d68('0x16')](function(_0x482107){if(_0x482107){if(!_[_0x4d68('0x74')](_0x482107[_0x4d68('0x6d')])){if(fs[_0x4d68('0x75')](path[_0x4d68('0x76')](config[_0x4d68('0x6f')],_0x4d68('0x7b'),_0x482107['systemAvatar']))){_0x1c3068=path[_0x4d68('0x76')](config['root'],'server/files/images/avatars/',_0x482107[_0x4d68('0x6d')]);}}return _0x4063ba[_0x4d68('0x78')](_0x1c3068);}})['catch'](handleError(_0x4063ba,null));};exports['notify']=function(_0x2266d9,_0x21b176){var _0x547b4b=require(_0x4d68('0x81'));var _0x12d118=new _0x547b4b();var _0x3cf72e=_0x12d118[_0x4d68('0x82')](_0x2266d9[_0x4d68('0x83')][_0x4d68('0x84')])['getResult']();var _0x444bf9={'body':_0x2266d9[_0x4d68('0x4e')],'channel':_0x4d68('0x85')};var _0x44715a=[];var _0x13994f=[];var _0x1f6388={};var _0x2aec01=![];return db[_0x4d68('0x86')][_0x4d68('0x5a')]()[_0x4d68('0x16')](function(_0x37f72d){if(!_0x37f72d){throw new db[(_0x4d68('0x87'))][(_0x4d68('0x88'))]('no\x20available\x20attributes');}_0x44715a=_['difference'](_[_0x4d68('0x36')](_0x37f72d),['createdAt',_0x4d68('0x89')]);_0x13994f=_[_0x4d68('0x8a')](_['keys'](_0x37f72d),['createdAt',_0x4d68('0x89'),_0x4d68('0x8b'),'ListId']);if(_0x2266d9[_0x4d68('0x4e')]['id']){delete _0x2266d9['body']['id'];}if(_[_0x4d68('0x74')](_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x8c')])){throw new db['Sequelize'][(_0x4d68('0x88'))]('from\x20is\x20mandatory');}if(_[_0x4d68('0x74')](_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x4e')])||_0x2266d9[_0x4d68('0x4e')]['body']===''){throw new db[(_0x4d68('0x87'))][(_0x4d68('0x88'))](_0x4d68('0x8d'));}if(_[_0x4d68('0x74')](_0x2266d9['body'][_0x4d68('0x8e')])){throw new db['Sequelize'][(_0x4d68('0x88'))](_0x4d68('0x8f')+_0x13994f);}if(!_[_0x4d68('0x90')](_0x13994f,_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x8e')])){throw new db[(_0x4d68('0x87'))][(_0x4d68('0x88'))](_0x4d68('0x91')+_0x13994f);}_0x1f6388[_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x8e')]]=_0x2266d9['body']['from'];})['then'](function(){return db['ChatWebsite'][_0x4d68('0x4c')]({'where':{'id':_0x2266d9[_0x4d68('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x4d68('0x92'),'include':[{'model':db[_0x4d68('0x86')],'as':_0x4d68('0x93'),'where':_0x1f6388,'limit':0x1,'order':[[_0x4d68('0x89'),_0x4d68('0x94')]]}]},{'model':db['ChatApplication'],'as':_0x4d68('0x95')}]});})[_0x4d68('0x16')](handleEntityNotFound(_0x21b176,null))[_0x4d68('0x16')](function(_0x2fa3fd){if(_0x2fa3fd&&_0x2fa3fd[_0x4d68('0x92')]){_0x444bf9[_0x4d68('0x96')]=_0x2fa3fd;_0x444bf9[_0x4d68('0x97')]=_0x2fa3fd[_0x4d68('0x95')];_0x444bf9[_0x4d68('0x98')]=_0x2fa3fd[_0x4d68('0x92')];_0x444bf9[_0x4d68('0x97')]=_[_0x4d68('0x99')](_0x444bf9['applications'],[_0x4d68('0x9a')],[_0x4d68('0x9b')]);if(_0x444bf9['account'][_0x4d68('0x95')]){delete _0x444bf9['account']['Applications'];}if(_0x444bf9[_0x4d68('0x96')][_0x4d68('0x92')]&&_0x444bf9[_0x4d68('0x96')][_0x4d68('0x92')][_0x4d68('0x93')]['length']){return _0x444bf9['account'][_0x4d68('0x92')][_0x4d68('0x93')][0x0];}var _0x53303d=_[_0x4d68('0xe')](_0x2266d9[_0x4d68('0x4e')],{'firstName':_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x8c')],'ListId':_0x2fa3fd[_0x4d68('0x9c')]});_0x53303d[_0x2266d9['body'][_0x4d68('0x8e')]]=_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x8c')];return db[_0x4d68('0x86')][_0x4d68('0x4d')](_0x53303d,{'fields':_0x44715a,'raw':!![]});}})['then'](handleEntityNotFound(_0x21b176,null))[_0x4d68('0x16')](function(_0x29af87){_0x444bf9[_0x4d68('0x9d')]=_0x29af87;var _0x39d556=_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x9e')];if(_0x2266d9[_0x4d68('0x83')]['cf-connecting-ip']){_0x39d556=_0x2266d9[_0x4d68('0x83')][_0x4d68('0x9f')];}else if(_0x2266d9[_0x4d68('0x83')]['x-forwarded-for']){_0x39d556=_[_0x4d68('0xa0')](_0x2266d9[_0x4d68('0x83')][_0x4d68('0xa1')][_0x4d68('0xa2')](','));}if(_0x29af87){var _0x5adffa={'ContactId':_0x29af87['id'],'ChatWebsiteId':_0x2266d9[_0x4d68('0x58')]['id'],'from':(_0x29af87['firstName']||'')+'\x20'+(_0x29af87[_0x4d68('0xa3')]||''),'customerIp':_0x39d556,'customerPort':_0x2266d9[_0x4d68('0x83')]['x-real-port']?_0x2266d9[_0x4d68('0x83')][_0x4d68('0xa4')]:null,'referer':_0x2266d9[_0x4d68('0x4e')]['referer'],'browserName':_0x3cf72e[_0x4d68('0xa5')][_0x4d68('0x2d')]&&_0x3cf72e['browser']['version']?util[_0x4d68('0xa6')](_0x4d68('0xa7'),_0x3cf72e[_0x4d68('0xa5')][_0x4d68('0x2d')],_0x3cf72e['browser'][_0x4d68('0xa8')]):_0x4d68('0xa9'),'browserVersion':_0x3cf72e['browser'][_0x4d68('0xa8')]||_0x4d68('0xa9'),'osName':util[_0x4d68('0xa6')](_0x4d68('0xa7'),_0x3cf72e['os']['name'],_0x3cf72e['os'][_0x4d68('0xa8')]),'osVersion':_0x3cf72e['os']['version'],'deviceModel':_0x3cf72e[_0x4d68('0xaa')][_0x4d68('0x38')]&&_0x3cf72e[_0x4d68('0xaa')][_0x4d68('0xab')]?util[_0x4d68('0xa6')]('%s\x20%s\x20%s',_0x3cf72e[_0x4d68('0xaa')][_0x4d68('0x38')],_0x3cf72e[_0x4d68('0xaa')]['vendor'],_0x3cf72e[_0x4d68('0xaa')][_0x4d68('0x33')]):null,'deviceVendor':_0x3cf72e[_0x4d68('0xaa')][_0x4d68('0xab')],'deviceType':_0x3cf72e[_0x4d68('0xaa')][_0x4d68('0x33')],'formData':JSON[_0x4d68('0xac')](_0x2266d9[_0x4d68('0x4e')])};var _0x47858a={'ChatWebsiteId':_0x2266d9[_0x4d68('0x58')]['id'],'closed':![]};if(_0x2266d9[_0x4d68('0x4e')][_0x4d68('0xad')]){_0x47858a['threadId']=_0x2266d9['body']['threadId'];return db[_0x4d68('0xae')][_0x4d68('0x4c')]({'where':_0x47858a})[_0x4d68('0x16')](function(_0x4647ac){if(_0x4647ac){return[_0x4647ac,![]];}_0x5adffa[_0x4d68('0xad')]=_0x2266d9[_0x4d68('0x4e')][_0x4d68('0xad')];_0x5adffa[_0x4d68('0xaf')]=_0x2266d9[_0x4d68('0x4e')][_0x4d68('0xaf')];return db[_0x4d68('0xae')][_0x4d68('0x4d')](_0x5adffa)['then'](function(_0x69195a){return[_0x69195a,!![]];});});}_0x47858a[_0x4d68('0xb0')]=_0x29af87['id'];if(_0x2266d9[_0x4d68('0x4e')]['interaction']&&_0x2266d9['body'][_0x4d68('0xb1')]['id']){_0x47858a['id']=_0x2266d9['body']['interaction']['id'];return db[_0x4d68('0xae')]['find']({'where':_0x47858a})[_0x4d68('0x16')](function(_0x1b1441){if(_0x1b1441){return[_0x1b1441,![]];}return db[_0x4d68('0xae')][_0x4d68('0x4d')](_0x5adffa)[_0x4d68('0x16')](function(_0x20fd1d){return[_0x20fd1d,!![]];});});}return db[_0x4d68('0xae')][_0x4d68('0x4d')](_0x5adffa)[_0x4d68('0x16')](function(_0x2b28a5){return[_0x2b28a5,!![]];});}})[_0x4d68('0xb2')](function(_0x20f813,_0x34f3ab){if(_0x20f813){_0x2aec01=_0x34f3ab;if(!_0x34f3ab){var _0x408bee={'from':(_0x444bf9[_0x4d68('0x9d')][_0x4d68('0xb3')]||'')+'\x20'+(_0x444bf9[_0x4d68('0x9d')][_0x4d68('0xa3')]||'')};if(_0x2266d9['body'][_0x4d68('0xad')]&&_0x2266d9[_0x4d68('0x4e')]['messageId']&&_0x2266d9[_0x4d68('0x4e')][_0x4d68('0xad')]!=_0x2266d9[_0x4d68('0x4e')][_0x4d68('0xb4')]){_0x408bee[_0x4d68('0xad')]=_0x2266d9[_0x4d68('0x4e')]['messageId'];}return _0x20f813[_0x4d68('0x57')](_0x408bee);}else{return _0x20f813;}}})[_0x4d68('0x16')](function(_0x17ca2d){_0x444bf9['interaction']=_0x17ca2d[_0x4d68('0x50')]({'plain':!![]});_0x444bf9[_0x4d68('0xb1')]['created']=_0x2aec01;if(_0x444bf9[_0x4d68('0xb1')][_0x4d68('0xb5')]){if(_0x444bf9[_0x4d68('0x96')]['autoclose']){_0x444bf9[_0x4d68('0x97')]['push']({'id':0x0,'priority':_0x444bf9['applications'][_0x4d68('0x3c')]+0x1,'app':_0x4d68('0xb6'),'appdata':_0x4d68('0xb7'),'interval':_0x4d68('0xb8')});}}return db[_0x4d68('0xb9')]['create']({'body':_0x2266d9[_0x4d68('0x4e')][_0x4d68('0x4e')],'ChatWebsiteId':_0x2266d9['params']['id'],'ChatInteractionId':_0x17ca2d['id'],'direction':'in','ContactId':_0x444bf9[_0x4d68('0x9d')]['id'],'AttachmentId':_0x2266d9[_0x4d68('0x4e')][_0x4d68('0xba')]});})['then'](function(_0x104c80){_0x444bf9[_0x4d68('0x1d')]=_0x104c80;if(_0x444bf9[_0x4d68('0xb1')][_0x4d68('0xbb')]){return db[_0x4d68('0xbc')][_0x4d68('0x4c')]({'attributes':['id','name'],'where':{'id':_0x444bf9[_0x4d68('0xb1')][_0x4d68('0xbb')]}})['then'](function(_0x368ca3){if(_0x368ca3){_0x444bf9['applications'][_0x4d68('0xbd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x368ca3[_0x4d68('0x2d')]+','+(_0x444bf9[_0x4d68('0x96')][_0x4d68('0xbe')]||0xa),'interval':'*,*,*,*'});_0x444bf9[_0x4d68('0xbf')]=!![];}return respondWithRpcPromise(_0x4d68('0xc0'),_0x4d68('0xc1'),_0x444bf9);});}return respondWithRpcPromise(_0x4d68('0xc0'),_0x4d68('0xc1'),_0x444bf9);})[_0x4d68('0x16')](function(_0x5611c4){respondWithRpcPromise(_0x4d68('0xc2'),_0x4d68('0xc2'),{'event':_0x4d68('0xc3'),'message':_0x5611c4},client9002);return _0x5611c4;})['then'](respondWithResult(_0x21b176,null))[_0x4d68('0x1f')](handleError(_0x21b176,null));};exports[_0x4d68('0xc4')]=function(_0x3ed878,_0x50ba13){var _0x4c15ab,_0x2f3de6,_0x3cd713;var _0x19335d=[];var _0xe0422a={};var _0x48022f=_0x3ed878[_0x4d68('0xc5')]||[];var _0x204b77=[];var _0x13f02d;return db[_0x4d68('0x86')][_0x4d68('0x5a')]()[_0x4d68('0x16')](function(_0x275bd4){if(!_0x275bd4){throw new db[(_0x4d68('0x87'))]['ValidationError'](_0x4d68('0xc6'));}_0x19335d=_[_0x4d68('0x8a')](_[_0x4d68('0x36')](_0x275bd4),[_0x4d68('0xc7'),'updatedAt',_0x4d68('0x8b'),_0x4d68('0x9c')]);if(_0x3ed878[_0x4d68('0x4e')]['id']){delete _0x3ed878['body']['id'];}if(_['isNil'](_0x3ed878['body']['from'])){throw _0x50ba13[_0x4d68('0x20')](0x1f4)['send'](new db[(_0x4d68('0x87'))]['ValidationError'](_0x4d68('0xc8')));}if(_['isNil'](_0x3ed878['body'][_0x4d68('0x4e')])||_0x3ed878['body'][_0x4d68('0x4e')]===''){throw _0x50ba13[_0x4d68('0x20')](0x1f4)[_0x4d68('0x2e')](new db[(_0x4d68('0x87'))][(_0x4d68('0x88'))](_0x4d68('0x8d')));}if(_[_0x4d68('0x74')](_0x3ed878[_0x4d68('0x4e')][_0x4d68('0xc9')])){throw _0x50ba13[_0x4d68('0x20')](0x1f4)[_0x4d68('0x2e')](new db[(_0x4d68('0x87'))][(_0x4d68('0x88'))](_0x4d68('0xca')+_0x19335d));}if(!_['includes'](_0x19335d,_0x3ed878[_0x4d68('0x4e')][_0x4d68('0xc9')])){throw _0x50ba13[_0x4d68('0x20')](0x1f4)[_0x4d68('0x2e')](new db[(_0x4d68('0x87'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19335d));}_0xe0422a[_0x3ed878[_0x4d68('0x4e')][_0x4d68('0xc9')]]=_0x3ed878[_0x4d68('0x4e')][_0x4d68('0x8c')];})[_0x4d68('0x16')](function(){return db[_0x4d68('0x47')][_0x4d68('0x4c')]({'where':{'id':_0x3ed878[_0x4d68('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x4d68('0x92')},{'model':db[_0x4d68('0xcb')],'as':_0x4d68('0xcb')}]});})[_0x4d68('0x16')](handleEntityNotFound(_0x50ba13,null))[_0x4d68('0x16')](function(_0x448e19){if(_0x448e19&&_0x448e19[_0x4d68('0x92')]){_0x2f3de6=_0x448e19;var _0x4fe7e8=_[_0x4d68('0xe')](_0x3ed878[_0x4d68('0x4e')],{'firstName':_0x3ed878[_0x4d68('0x4e')][_0x4d68('0x8c')],'phone':_0x3ed878['body'][_0x4d68('0x8c')],'ListId':_0x448e19['ListId']});_0x4fe7e8[_0x3ed878[_0x4d68('0x4e')]['mapKeyOffline']]=_0x3ed878[_0x4d68('0x4e')][_0x4d68('0x8c')];return db[_0x4d68('0x86')][_0x4d68('0xcc')]({'where':_0xe0422a,'defaults':_0x4fe7e8});}})[_0x4d68('0xb2')](function(_0xd9580c){if(_0xd9580c){_0x3cd713=_0xd9580c;var _0x537064=fs[_0x4d68('0xcd')](path['join'](config[_0x4d68('0x6f')],'server/files/templates/chatOfflineMessage.ejs'),_0x4d68('0xce'));var _0x4125fc=ejs[_0x4d68('0xcf')](_0x537064,{'body':_[_0x4d68('0xd0')](_0x3ed878[_0x4d68('0x4e')]['body']),'bodyTitle':_0x2f3de6[_0x4d68('0xd1')]});return db[_0x4d68('0xd2')][_0x4d68('0x4d')]({'body':_0x4125fc,'ContactId':_0xd9580c['id'],'ChatWebsiteId':_0x2f3de6['id']});}})['then'](function(_0x55e050){_0x13f02d=_0x55e050;if(_0x48022f['length']){var _0x8eee19=_0x48022f[_0x4d68('0x34')](function(_0x21980d){return{'name':_0x21980d[_0x4d68('0xd3')],'basename':_0x21980d[_0x4d68('0x69')],'type':_0x21980d[_0x4d68('0xd4')],'ChatOfflineMessageId':_0x55e050['id']};});_0x204b77=_0x8eee19[_0x4d68('0x34')](_0x51e692=>{var _0x27e567={'filename':_0x51e692[_0x4d68('0x2d')],'path':path[_0x4d68('0x76')](config['root'],_0x4d68('0xd5'),_0x4d68('0xc5'),'attachments','offline-chat',_0x51e692['basename'])};return _0x27e567;});if(!_0x2f3de6[_0x4d68('0xd6')]){return db[_0x4d68('0xd7')][_0x4d68('0xd8')](function(_0x167c46){return db[_0x4d68('0xd9')][_0x4d68('0xda')](_0x8eee19,{'transaction':_0x167c46});});}}})[_0x4d68('0x16')](function(){if(_0x13f02d){_0x4c15ab=_0x13f02d;return db[_0x4d68('0xcb')][_0x4d68('0x5f')]({'where':{'active':!![]},'include':[{'model':db[_0x4d68('0xdb')],'as':'Smtp','raw':!![]}]});}})[_0x4d68('0x16')](function(_0x2d175e){if(_0x2d175e&&_0x2d175e[_0x4d68('0xdc')]&&_0x2f3de6[_0x4d68('0xdd')]&&_0x2f3de6[_0x4d68('0xde')]){var _0x1cf31f={'tls':{'rejectUnauthorized':![]}};if(_0x2d175e[_0x4d68('0xdc')]['service']){_0x1cf31f['service']=_0x2d175e[_0x4d68('0xdc')][_0x4d68('0xdf')];}else{_0x1cf31f['host']=_0x2d175e[_0x4d68('0xdc')][_0x4d68('0xe0')];_0x1cf31f[_0x4d68('0xe1')]=_0x2d175e[_0x4d68('0xdc')][_0x4d68('0xe1')];_0x1cf31f[_0x4d68('0xe2')]=_0x2d175e['Smtp'][_0x4d68('0xe2')];}if(_0x2d175e[_0x4d68('0xdc')][_0x4d68('0xe3')]){_0x1cf31f['auth']={'user':_0x2d175e['Smtp'][_0x4d68('0x4f')],'pass':_0x2d175e[_0x4d68('0xdc')]['pass']};}return respondWithRpcPromise(_0x4d68('0xe4'),_0x4d68('0xe5'),{'account':_0x1cf31f,'message':{'from':util['format'](_0x4d68('0xe6'),_0x2d175e[_0x4d68('0x2d')],_0x2d175e[_0x4d68('0xe7')]||_0x2d175e[_0x4d68('0xdc')][_0x4d68('0x4f')]),'to':_0x2f3de6[_0x4d68('0xde')],'subject':_0x2f3de6[_0x4d68('0xe8')],'html':_0x4c15ab['body'],'attachments':_0x204b77}},client9003)['then'](function(){return _0x4c15ab;})[_0x4d68('0x1f')](function(_0x396d54){console[_0x4d68('0x1b')](_0x396d54);});}})[_0x4d68('0x16')](function(){if(_0x2f3de6&&_0x2f3de6[_0x4d68('0xd6')]&&_0x2f3de6[_0x4d68('0xe9')]){var _0x23ff2a=[];if(_0x48022f[_0x4d68('0x3c')]){_0x23ff2a=_0x48022f[_0x4d68('0x34')](function(_0x3a06a4){return{'name':_0x3a06a4[_0x4d68('0xd3')],'basename':_0x3a06a4[_0x4d68('0x69')],'type':_0x3a06a4[_0x4d68('0xd4')],'ChatOfflineMessageId':_0x13f02d['id']};});}var _0x435c4e;if(!_['isNil'](_0x2f3de6['subjectOffline'])){var _0x5a0696=_[_0x4d68('0x34')](_0x3ed878[_0x4d68('0x4e')],function(_0xc523e8){return _0xc523e8;});var _0xe49a75=_['toPairsIn'](_0x5a0696)[0x0];var _0x566c63=_['mapValues'](_0xe49a75,function(_0x5016e0){return _0x5016e0;});_0x435c4e=_0x566c63[0x1][_0x2f3de6[_0x4d68('0xea')]];}var _0x2a51ee={'from':_0x3cd713[_0x4d68('0xe7')],'firstName':_0x3cd713[_0x4d68('0xb3')],'lastName':_0x3cd713[_0x4d68('0xa3')],'mapKey':_0x4d68('0xe7'),'message':{'from':_0x3cd713[_0x4d68('0xe7')],'to':_0x2f3de6[_0x4d68('0xcb')][_0x4d68('0xe7')],'cc':'','subject':_['isNil'](_0x435c4e)?_0x2f3de6[_0x4d68('0xe8')]:_0x435c4e,'messageId':'','sentAt':new Date(),'attach':_0x23ff2a[_0x4d68('0x3c')],'attachments':_0x23ff2a,'originChannel':_0x4d68('0xeb'),'ChatWebsiteId':_0x2f3de6['id'],'ChatOfflineMessageId':_0x4c15ab['id'],'originTo':_0x2f3de6['MailAccount'][_0x4d68('0xe7')]},'body':_0x4c15ab['body']};var _0x379567={'account':{'id':_0x2f3de6[_0x4d68('0xe9')]},'body':_0x2a51ee,'log':_0x4d68('0xec')};return respondWithRpcPromise('NotifyMailAccount',_0x4d68('0xed'),_0x379567,client9001)[_0x4d68('0x16')](function(){return _0x4c15ab;})[_0x4d68('0x1f')](function(_0x488eb7){console['error'](_0x488eb7);});}return;})[_0x4d68('0x16')](function(){if(_0x4c15ab){return _0x4c15ab;}})[_0x4d68('0x16')](respondWithResult(_0x50ba13,null))[_0x4d68('0x1f')](function(_0x3038e0){console[_0x4d68('0x1b')](_0x4d68('0x1f'),_0x3038e0);for(var _0x256fc2 of _0x48022f){var _0x5838ea=path[_0x4d68('0x76')](config[_0x4d68('0x6f')],_0x4d68('0xd5'),_0x4d68('0xc5'),_0x4d68('0xee'),_0x4d68('0xef'),_0x256fc2['filename']);fs_extra['remove'](_0x5838ea)[_0x4d68('0x1f')](function(_0x28b2a2){console[_0x4d68('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x5838ea,_0x28b2a2);});}});};exports[_0x4d68('0xf0')]=function(_0x48373c,_0x5d354d){return db[_0x4d68('0xae')][_0x4d68('0x4c')]({'where':{'id':_0x48373c['params']['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x5d354d,null))[_0x4d68('0x16')](function(_0x27431c){if(_0x27431c){return _0x27431c['addInteraction'](_0x48373c[_0x4d68('0x4e')][_0x4d68('0x61')],_[_0x4d68('0xf1')](_0x48373c['body'],['ids','id'])||{});}})[_0x4d68('0x16')](respondWithResult(_0x5d354d,null))[_0x4d68('0x1f')](handleError(_0x5d354d,null));};exports['getInteractions']=function(_0x2dca38,_0x729f71){var _0x4223b7={'raw':![],'where':{}};var _0x807bc2={};var _0x383e80={'count':0x0,'rows':[]};return db[_0x4d68('0x47')][_0x4d68('0x5f')]({'where':{'id':_0x2dca38[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x729f71,null))[_0x4d68('0x16')](function(_0x3923d2){if(_0x3923d2){_0x807bc2[_0x4d68('0x38')]=_[_0x4d68('0x36')](db['ChatInteraction'][_0x4d68('0x31')]);_0x807bc2[_0x4d68('0x35')]=_['keys'](_0x2dca38[_0x4d68('0x35')]);_0x807bc2['filters']=_['intersection'](_0x807bc2[_0x4d68('0x38')],_0x807bc2[_0x4d68('0x35')]);_0x4223b7[_0x4d68('0x39')]=_[_0x4d68('0x3a')](_0x807bc2[_0x4d68('0x38')],qs[_0x4d68('0x3b')](_0x2dca38[_0x4d68('0x35')][_0x4d68('0x3b')]));_0x4223b7[_0x4d68('0x39')]=_0x4223b7[_0x4d68('0x39')][_0x4d68('0x3c')]?_0x4223b7[_0x4d68('0x39')]:_0x807bc2[_0x4d68('0x38')];if(!_0x2dca38[_0x4d68('0x35')]['hasOwnProperty']('nolimit')){_0x4223b7[_0x4d68('0x24')]=qs['limit'](_0x2dca38[_0x4d68('0x35')][_0x4d68('0x24')]);_0x4223b7[_0x4d68('0x22')]=qs[_0x4d68('0x22')](_0x2dca38[_0x4d68('0x35')]['offset']);}_0x4223b7[_0x4d68('0x3f')]=qs[_0x4d68('0x40')](_0x2dca38[_0x4d68('0x35')][_0x4d68('0x40')]);_0x4223b7[_0x4d68('0x41')]=qs['filters'](_[_0x4d68('0x42')](_0x2dca38[_0x4d68('0x35')],_0x807bc2['filters']));_0x4223b7[_0x4d68('0x41')]['ChatWebsiteId']=_0x3923d2['id'];if(_0x2dca38['query'][_0x4d68('0x43')]){_0x4223b7[_0x4d68('0x41')]=_[_0x4d68('0x44')](_0x4223b7[_0x4d68('0x41')],{'$or':_['map'](_0x4223b7[_0x4d68('0x39')],function(_0x14fe55){var _0x2015cd={};_0x2015cd[_0x14fe55]={'$like':'%'+_0x2dca38[_0x4d68('0x35')][_0x4d68('0x43')]+'%'};return _0x2015cd;})});}_0x4223b7=_['merge']({},_0x4223b7,_0x2dca38[_0x4d68('0x46')]);return db['ChatInteraction'][_0x4d68('0x25')]({'where':_0x4223b7[_0x4d68('0x41')]})[_0x4d68('0x16')](function(_0x1a98a6){_0x383e80[_0x4d68('0x25')]=_0x1a98a6;if(_0x2dca38[_0x4d68('0x35')][_0x4d68('0x48')]){_0x4223b7['include']=[{'model':db[_0x4d68('0x86')],'as':'Contact','required':![]},{'model':db[_0x4d68('0xbc')],'as':_0x4d68('0xf2'),'attributes':['name',_0x4d68('0xf3'),_0x4d68('0xf4')],'required':![]},{'model':db['Tag'],'as':_0x4d68('0xf5'),'attributes':['id',_0x4d68('0x2d'),_0x4d68('0xf6')],'where':_0x2dca38[_0x4d68('0x35')][_0x4d68('0xf7')]?{'id':_0x2dca38['query'][_0x4d68('0xf7')]}:undefined,'required':_0x2dca38[_0x4d68('0x35')][_0x4d68('0xf7')]?!![]:![]}];}return db['ChatInteraction'][_0x4d68('0xf8')](_0x4223b7);})[_0x4d68('0x16')](function(_0x1efaec){_0x383e80[_0x4d68('0x4a')]=_0x1efaec;return _0x383e80;});}})[_0x4d68('0x16')](respondWithFilteredResult(_0x729f71,_0x4223b7))[_0x4d68('0x1f')](handleError(_0x729f71,null));};function iftimePromise(_0x1a8f30,_0x2014bc){return respondWithRpcPromise(_0x4d68('0xf9'),_0x4d68('0xfa'),{'command':_0x2014bc[_0x4d68('0xfb')]?util[_0x4d68('0xa6')](_0x4d68('0xfc'),_0x1a8f30[_0x4d68('0xfd')],_0x2014bc[_0x4d68('0xfb')]):util['format'](_0x4d68('0xfe'),_0x1a8f30[_0x4d68('0xfd')])},client9002)[_0x4d68('0x16')](function(_0xd34cc0){var _0x345756=_0xd34cc0&&_0xd34cc0[_0x4d68('0xff')]('true')>=0x0?!![]:![];logger[_0x4d68('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2014bc['id'],_0x1a8f30['id'],_0x1a8f30[_0x4d68('0xfd')],_0x345756?'ONLINE':_0x4d68('0x100'),_0x2014bc[_0x4d68('0xfb')]?_0x2014bc['timezone']:_0x4d68('0x101'));return _0x345756;})[_0x4d68('0x1f')](function(_0x50c6a0){logger['error'](_0x4d68('0x102'),_0x2014bc['id'],_0x1a8f30['id'],_0x1a8f30[_0x4d68('0xfd')],util[_0x4d68('0x103')](_0x50c6a0,{'showHidden':![],'depth':null}),_0x2014bc[_0x4d68('0xfb')]?_0x2014bc['timezone']:_0x4d68('0x101'));return![];});}exports[_0x4d68('0xfa')]=function(_0x21d07a,_0x3f9e2f){var _0x38d7e7=0x0;var _0x1403c6=0x0;var _0x1854a3=![];var _0x5b27b1;var _0x443b58;return db[_0x4d68('0x47')]['find']({'where':{'id':_0x21d07a['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x4d68('0x104')],'as':_0x4d68('0x105'),'attributes':['id',_0x4d68('0xfd')],'raw':!![]}]}]})[_0x4d68('0x16')](handleEntityNotFound(_0x3f9e2f,null))[_0x4d68('0x16')](function(_0xa48ed6){if(_0xa48ed6){_0x5b27b1=_0xa48ed6;return _0xa48ed6['getProactiveActions']({'raw':!![]});}})[_0x4d68('0x16')](function(_0x22ea53){if(_0x5b27b1){if(_0x22ea53){_0x443b58=_0x22ea53;}}return require(_0x4d68('0x71'))[_0x4d68('0x72')]();})[_0x4d68('0x16')](function(_0x494cbe){if(_0x494cbe){_0x1403c6=_0x494cbe[_0x4d68('0x106')];_0x1854a3=_0x494cbe[_0x4d68('0x73')];}})[_0x4d68('0x16')](function(){return db[_0x4d68('0xae')][_0x4d68('0x25')]({'where':{'closed':![]}});})['then'](function(_0x43a543){_0x38d7e7=_0x43a543;if(_0x1403c6&&_0x43a543>_0x1403c6){return db[_0x4d68('0x107')]['findOne']({'where':{'id':0x1}})[_0x4d68('0x16')](function(_0x25ada4){if(_0x25ada4){_0x25ada4['increment'](_0x4d68('0x108'));}});}})[_0x4d68('0x16')](function(){if(_0x5b27b1['Interval']&&_0x5b27b1[_0x4d68('0x104')][_0x4d68('0x105')]){var _0x37ff64=[];for(var _0x61815f=0x0;_0x61815f<_0x5b27b1[_0x4d68('0x104')][_0x4d68('0x105')]['length'];_0x61815f++){var _0x526ea3=_0x5b27b1['Interval'][_0x4d68('0x105')][_0x61815f][_0x4d68('0x50')]({'plain':!![]});_0x37ff64[_0x4d68('0x109')](iftimePromise(_0x526ea3,_0x5b27b1));}return BPromise[_0x4d68('0x10a')](_0x37ff64)[_0x4d68('0x16')](function(_0x5449f1){return _['some'](_0x5449f1);});}else{return!![];}})['then'](function(_0x656f08){var _0xe1002a=fs['readFileSync'](path[_0x4d68('0x76')](config['root'],_0x4d68('0x10b')),'utf8');var _0x1d0236={'remote':_0x5b27b1['remote'],'query':querystring['stringify'](_[_0x4d68('0x44')](_0x5b27b1[_0x4d68('0x50')]({'plain':!![]}),{'customerIp':_0x21d07a[_0x4d68('0x83')][_0x4d68('0xa1')]||_0x21d07a[_0x4d68('0x83')][_0x4d68('0x10c')]||_0x21d07a[_0x4d68('0x10d')][_0x4d68('0x10e')]||_0x21d07a['ip'],'referer':_0x21d07a[_0x4d68('0x83')][_0x4d68('0x10f')],'openedInteractions':_0x38d7e7,'maxInteractions':_0x1403c6,'virtual':_0x1854a3[_0x4d68('0x106')],'online':_0x656f08,'custom':_0x1854a3}))[_0x4d68('0x110')](/'/g,'\x5c\x27')};_0x3f9e2f[_0x4d68('0x2e')](ejs['render'](Mustache[_0x4d68('0xcf')](_0xe1002a,_0x1d0236),{'proactiveActions':_0x443b58,'alignment':_0x5b27b1[_0x4d68('0x111')],'verticalAlignment':_0x5b27b1[_0x4d68('0x112')],'div_color':_0x5b27b1[_0x4d68('0xf6')],'text_color':_0x5b27b1[_0x4d68('0x113')],'button_color':_0x5b27b1[_0x4d68('0x114')],'background_color':_0x5b27b1['backgroundColor']}));})[_0x4d68('0x1f')](handleError(_0x3f9e2f,null));};exports[_0x4d68('0x115')]=function(_0x39a5f7,_0x39a4a3){var _0x2e072d=_0x39a5f7[_0x4d68('0x58')]['id'];var _0x17c44e=_0x39a5f7[_0x4d68('0x4e')];var _0x35e15a=0xc8;var _0x3b7a0c=null;return db[_0x4d68('0xd7')]['transaction']({'isolationLevel':db[_0x4d68('0xd7')][_0x4d68('0x116')]['ISOLATION_LEVELS'][_0x4d68('0x117')]},function(_0xdacf7c){return db[_0x4d68('0x47')][_0x4d68('0x5f')]({'where':{'id':_0x2e072d},'transaction':_0xdacf7c})[_0x4d68('0x16')](function(_0x47ce6f){if(_0x47ce6f){return db[_0x4d68('0x118')]['destroy']({'where':{'ChatWebsiteId':_0x2e072d},'transaction':_0xdacf7c})['then'](function(){var _0xc4855b=_['map'](_0x17c44e,function(_0x1fdd77){_0x1fdd77[_0x4d68('0x5c')]=_0x2e072d;return _0x1fdd77;});return db[_0x4d68('0x118')][_0x4d68('0xda')](_0xc4855b,{'transaction':_0xdacf7c});});}else{_0x35e15a=0x194;_0x3b7a0c=[];}});})[_0x4d68('0x16')](function(){if(_0x35e15a!==0x194){return db[_0x4d68('0x118')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2e072d},'order':_0x4d68('0x9a')})[_0x4d68('0x16')](function(_0x1c022f){_0x3b7a0c=_0x1c022f;});}})['catch'](function(_0x27a8a6){_0x35e15a=0x1f4;logger[_0x4d68('0x1b')](_0x27a8a6['stack']);if(_0x27a8a6[_0x4d68('0x2d')]){delete _0x27a8a6['name'];}_0x3b7a0c=_0x27a8a6;})[_0x4d68('0x119')](function(){if(_0x3b7a0c===null){_0x39a4a3['sendStatus'](_0x35e15a);}else{if(_0x35e15a===0x1f4){_0x39a4a3[_0x4d68('0x20')](_0x35e15a)['send'](_0x3b7a0c);}else{_0x39a4a3[_0x4d68('0x20')](_0x35e15a)[_0x4d68('0x21')](_0x3b7a0c);}}});};exports[_0x4d68('0x11a')]=function(_0x1aa22b,_0x39c68b){var _0x3d215a={};var _0x1d9c35={};var _0x63857b;var _0x190143;return db[_0x4d68('0x47')]['findOne']({'where':{'id':_0x1aa22b[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x39c68b,null))[_0x4d68('0x16')](function(_0x365ae1){if(_0x365ae1){_0x63857b=_0x365ae1;_0x1d9c35[_0x4d68('0x38')]=_[_0x4d68('0x36')](db[_0x4d68('0x118')]['rawAttributes']);_0x1d9c35[_0x4d68('0x35')]=_[_0x4d68('0x36')](_0x1aa22b[_0x4d68('0x35')]);_0x1d9c35[_0x4d68('0x37')]=_['intersection'](_0x1d9c35[_0x4d68('0x38')],_0x1d9c35[_0x4d68('0x35')]);_0x3d215a[_0x4d68('0x39')]=_[_0x4d68('0x3a')](_0x1d9c35[_0x4d68('0x38')],qs['fields'](_0x1aa22b['query'][_0x4d68('0x3b')]));_0x3d215a[_0x4d68('0x39')]=_0x3d215a[_0x4d68('0x39')][_0x4d68('0x3c')]?_0x3d215a[_0x4d68('0x39')]:_0x1d9c35[_0x4d68('0x38')];_0x3d215a[_0x4d68('0x3f')]=qs[_0x4d68('0x40')](_0x1aa22b[_0x4d68('0x35')][_0x4d68('0x40')]);_0x3d215a[_0x4d68('0x41')]=qs['filters'](_[_0x4d68('0x42')](_0x1aa22b['query'],_0x1d9c35['filters']));if(_0x1aa22b[_0x4d68('0x35')][_0x4d68('0x43')]){_0x3d215a[_0x4d68('0x41')]=_['merge'](_0x3d215a[_0x4d68('0x41')],{'$or':_['map'](_0x3d215a['attributes'],function(_0x4c367c){var _0x400b54={};_0x400b54[_0x4c367c]={'$like':'%'+_0x1aa22b[_0x4d68('0x35')][_0x4d68('0x43')]+'%'};return _0x400b54;})});}_0x3d215a=_[_0x4d68('0x44')]({},_0x3d215a,_0x1aa22b[_0x4d68('0x46')]);return _0x63857b['getApplications'](_0x3d215a);}})['then'](function(_0x2021c8){if(_0x2021c8){_0x190143=_0x2021c8[_0x4d68('0x3c')];if(!_0x1aa22b['query'][_0x4d68('0x3d')](_0x4d68('0x3e'))){_0x3d215a['limit']=qs['limit'](_0x1aa22b[_0x4d68('0x35')][_0x4d68('0x24')]);_0x3d215a['offset']=qs[_0x4d68('0x22')](_0x1aa22b['query']['offset']);}return _0x63857b[_0x4d68('0x11a')](_0x3d215a);}})[_0x4d68('0x16')](function(_0x4075d2){if(_0x4075d2){return _0x4075d2?{'count':_0x190143,'rows':_0x4075d2}:null;}})['then'](respondWithResult(_0x39c68b,null))[_0x4d68('0x1f')](handleError(_0x39c68b,null));};exports[_0x4d68('0x11b')]=function(_0x151568,_0x5e814f){return db[_0x4d68('0x11c')]['find']({'where':{'id':_0x151568[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x5e814f,null))[_0x4d68('0x16')](function(_0x395bd7){if(_0x395bd7){return _0x395bd7[_0x4d68('0x11b')](_0x151568[_0x4d68('0x4e')][_0x4d68('0x61')],_[_0x4d68('0xf1')](_0x151568[_0x4d68('0x4e')],['ids','id'])||{});}})[_0x4d68('0x16')](respondWithResult(_0x5e814f,null))[_0x4d68('0x1f')](handleError(_0x5e814f,null));};exports[_0x4d68('0x11d')]=function(_0x275c22,_0x2152ce){var _0xa22064={};var _0xbcba34={};var _0x277522;var _0x377f6b;return db[_0x4d68('0x47')]['findOne']({'where':{'id':_0x275c22[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x2152ce,null))[_0x4d68('0x16')](function(_0x3aa34c){if(_0x3aa34c){_0x277522=_0x3aa34c;_0xbcba34[_0x4d68('0x38')]=_[_0x4d68('0x36')](db[_0x4d68('0x11e')][_0x4d68('0x31')]);_0xbcba34[_0x4d68('0x35')]=_['keys'](_0x275c22[_0x4d68('0x35')]);_0xbcba34[_0x4d68('0x37')]=_[_0x4d68('0x3a')](_0xbcba34[_0x4d68('0x38')],_0xbcba34[_0x4d68('0x35')]);_0xa22064[_0x4d68('0x39')]=_['intersection'](_0xbcba34[_0x4d68('0x38')],qs[_0x4d68('0x3b')](_0x275c22[_0x4d68('0x35')][_0x4d68('0x3b')]));_0xa22064[_0x4d68('0x39')]=_0xa22064[_0x4d68('0x39')]['length']?_0xa22064['attributes']:_0xbcba34['model'];_0xa22064[_0x4d68('0x3f')]=qs[_0x4d68('0x40')](_0x275c22[_0x4d68('0x35')]['sort']);_0xa22064[_0x4d68('0x41')]=qs['filters'](_[_0x4d68('0x42')](_0x275c22[_0x4d68('0x35')],_0xbcba34[_0x4d68('0x37')]));if(_0x275c22['query'][_0x4d68('0x43')]){_0xa22064[_0x4d68('0x41')]=_[_0x4d68('0x44')](_0xa22064[_0x4d68('0x41')],{'$or':_[_0x4d68('0x34')](_0xa22064[_0x4d68('0x39')],function(_0x328ae3){var _0x209ce2={};_0x209ce2[_0x328ae3]={'$like':'%'+_0x275c22['query'][_0x4d68('0x43')]+'%'};return _0x209ce2;})});}_0xa22064=_[_0x4d68('0x44')]({},_0xa22064,_0x275c22['options']);return _0x277522[_0x4d68('0x11d')](_0xa22064);}})[_0x4d68('0x16')](function(_0x2c6d63){if(_0x2c6d63){_0x377f6b=_0x2c6d63[_0x4d68('0x3c')];if(!_0x275c22[_0x4d68('0x35')][_0x4d68('0x3d')](_0x4d68('0x3e'))){_0xa22064[_0x4d68('0x24')]=qs[_0x4d68('0x24')](_0x275c22[_0x4d68('0x35')]['limit']);_0xa22064[_0x4d68('0x22')]=qs[_0x4d68('0x22')](_0x275c22['query'][_0x4d68('0x22')]);}return _0x277522[_0x4d68('0x11d')](_0xa22064);}})[_0x4d68('0x16')](function(_0x1cb85a){if(_0x1cb85a){return _0x1cb85a?{'count':_0x377f6b,'rows':_0x1cb85a}:null;}})[_0x4d68('0x16')](respondWithResult(_0x2152ce,null))[_0x4d68('0x1f')](handleError(_0x2152ce,null));};exports['getFields']=function(_0x82864c,_0xb643d8){var _0x3ab71b=_0x82864c[_0x4d68('0x35')][_0x4d68('0x11f')]===_0x4d68('0x120')?_0x4d68('0x121'):_0x4d68('0x122');return db['ChatWebsite'][_0x4d68('0x4c')]({'attributes':['id',_0x3ab71b],'where':{'id':_0x82864c[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0xb643d8,null))[_0x4d68('0x16')](function(_0x507f3d){if(_0x507f3d){var _0x2c919b=_0x507f3d[_0x3ab71b];var _0x2d94e6=_0x2c919b&&_0x2c919b[_0x4d68('0x123')]?_0x2c919b['items']:[];_0xb643d8[_0x4d68('0x2e')]({'fromKey':_[_0x4d68('0x74')](_0x2c919b['fromKey'])?undefined:_0x2c919b['fromKey'],'count':_0x2d94e6[_0x4d68('0x3c')],'rows':_0x2d94e6});}})['catch'](handleError(_0xb643d8,null));};exports[_0x4d68('0x124')]=function(_0x5f3ec9,_0xec5be5){var _0x42e82e={'raw':![],'where':{}};var _0x3801ac={};var _0x4a5564={'count':0x0,'rows':[]};return db[_0x4d68('0x47')][_0x4d68('0x5f')]({'where':{'id':_0x5f3ec9[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0xec5be5,null))[_0x4d68('0x16')](function(_0x3e40c0){if(_0x3e40c0){_0x3801ac[_0x4d68('0x38')]=_[_0x4d68('0x36')](db[_0x4d68('0xd2')][_0x4d68('0x31')]);_0x3801ac[_0x4d68('0x35')]=_[_0x4d68('0x36')](_0x5f3ec9[_0x4d68('0x35')]);_0x3801ac[_0x4d68('0x37')]=_[_0x4d68('0x3a')](_0x3801ac[_0x4d68('0x38')],_0x3801ac[_0x4d68('0x35')]);_0x42e82e[_0x4d68('0x39')]=_['intersection'](_0x3801ac[_0x4d68('0x38')],qs[_0x4d68('0x3b')](_0x5f3ec9[_0x4d68('0x35')]['fields']));_0x42e82e['attributes']=_0x42e82e[_0x4d68('0x39')][_0x4d68('0x3c')]?_0x42e82e['attributes']:_0x3801ac[_0x4d68('0x38')];if(!_0x5f3ec9[_0x4d68('0x35')][_0x4d68('0x3d')](_0x4d68('0x3e'))){_0x42e82e[_0x4d68('0x24')]=qs[_0x4d68('0x24')](_0x5f3ec9['query'][_0x4d68('0x24')]);_0x42e82e['offset']=qs[_0x4d68('0x22')](_0x5f3ec9[_0x4d68('0x35')][_0x4d68('0x22')]);}_0x42e82e['order']=qs['sort'](_0x5f3ec9[_0x4d68('0x35')]['sort']);_0x42e82e['where']=qs['filters'](_[_0x4d68('0x42')](_0x5f3ec9['query'],_0x3801ac[_0x4d68('0x37')]));_0x42e82e[_0x4d68('0x41')][_0x4d68('0x5c')]=_0x3e40c0['id'];if(_0x5f3ec9['query'][_0x4d68('0x43')]){_0x42e82e[_0x4d68('0x41')]=_[_0x4d68('0x44')](_0x42e82e[_0x4d68('0x41')],{'$or':_[_0x4d68('0x34')](_0x42e82e[_0x4d68('0x39')],function(_0x2170c0){var _0x248699={};_0x248699[_0x2170c0]={'$like':'%'+_0x5f3ec9[_0x4d68('0x35')][_0x4d68('0x43')]+'%'};return _0x248699;})});}_0x42e82e=_[_0x4d68('0x44')]({},_0x42e82e,_0x5f3ec9[_0x4d68('0x46')]);return db[_0x4d68('0xd2')]['count']({'where':_0x42e82e['where']})[_0x4d68('0x16')](function(_0x4cef04){_0x4a5564[_0x4d68('0x25')]=_0x4cef04;if(_0x5f3ec9[_0x4d68('0x35')][_0x4d68('0x48')]){_0x42e82e['include']=[{'all':!![]}];}else{_0x42e82e[_0x4d68('0x49')]=[{'model':db[_0x4d68('0x86')],'as':'Contact','required':![]},{'model':db[_0x4d68('0xd9')],'as':_0x4d68('0x125'),'required':![]}];}return db[_0x4d68('0xd2')][_0x4d68('0xf8')](_0x42e82e);})[_0x4d68('0x16')](function(_0x52405c){_0x4a5564['rows']=_0x52405c;return _0x4a5564;});}})[_0x4d68('0x16')](respondWithFilteredResult(_0xec5be5,_0x42e82e))[_0x4d68('0x1f')](handleError(_0xec5be5,null));};exports['addAgents']=function(_0x224733,_0x1614cf){return db['ChatWebsite'][_0x4d68('0x4c')]({'where':{'id':_0x224733[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x1614cf,null))[_0x4d68('0x16')](function(_0xadd0e6){if(_0xadd0e6){return _0xadd0e6[_0x4d68('0x126')](_0x224733[_0x4d68('0x4e')]['ids'],_[_0x4d68('0xf1')](_0x224733['body'],[_0x4d68('0x61'),'id'])||{})['spread'](function(_0x11e1ea){for(var _0x250827=0x0;_0x250827<_0x224733[_0x4d68('0x4e')][_0x4d68('0x61')][_0x4d68('0x3c')];_0x250827+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x224733[_0x4d68('0x4e')][_0x4d68('0x61')][_0x250827]),'ChatWebsiteId':Number(_0x224733['params']['id'])});}return _0x11e1ea;});}})[_0x4d68('0x16')](respondWithResult(_0x1614cf,null))[_0x4d68('0x1f')](handleError(_0x1614cf,null));};exports['removeAgents']=function(_0x179cd3,_0xf00545){return db[_0x4d68('0x47')][_0x4d68('0x4c')]({'where':{'id':_0x179cd3[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0xf00545,null))[_0x4d68('0x16')](function(_0x2c3d5f){if(_0x2c3d5f){return _0x2c3d5f[_0x4d68('0x127')](_0x179cd3[_0x4d68('0x35')][_0x4d68('0x61')])[_0x4d68('0x16')](function(){if(_[_0x4d68('0x128')](_0x179cd3[_0x4d68('0x35')][_0x4d68('0x61')])){for(var _0x3e58d5=0x0;_0x3e58d5<_0x179cd3[_0x4d68('0x35')][_0x4d68('0x61')][_0x4d68('0x3c')];_0x3e58d5+=0x1){socket['emit'](_0x4d68('0x129'),{'UserId':Number(_0x179cd3[_0x4d68('0x35')]['ids'][_0x3e58d5]),'ChatWebsiteId':Number(_0x179cd3[_0x4d68('0x58')]['id'])});}}else{socket[_0x4d68('0x12a')](_0x4d68('0x129'),{'UserId':Number(_0x179cd3['query'][_0x4d68('0x61')]),'ChatWebsiteId':Number(_0x179cd3['params']['id'])});}});}})[_0x4d68('0x16')](respondWithStatusCode(_0xf00545,null))[_0x4d68('0x1f')](handleError(_0xf00545,null));};exports[_0x4d68('0x12b')]=function(_0x5b0f3e,_0x4cbd41){var _0x263990={};var _0x8d674e={};var _0x5bde71;var _0x2b5fc3;return db[_0x4d68('0x47')][_0x4d68('0x5f')]({'where':{'id':_0x5b0f3e[_0x4d68('0x58')]['id']}})[_0x4d68('0x16')](handleEntityNotFound(_0x4cbd41,null))[_0x4d68('0x16')](function(_0x3552a9){if(_0x3552a9){_0x5bde71=_0x3552a9;_0x8d674e[_0x4d68('0x38')]=_[_0x4d68('0x36')](db[_0x4d68('0xbc')]['rawAttributes']);_0x8d674e['query']=_[_0x4d68('0x36')](_0x5b0f3e[_0x4d68('0x35')]);_0x8d674e['filters']=_['intersection'](_0x8d674e[_0x4d68('0x38')],_0x8d674e['query']);_0x263990[_0x4d68('0x39')]=_[_0x4d68('0x3a')](_0x8d674e['model'],qs['fields'](_0x5b0f3e[_0x4d68('0x35')][_0x4d68('0x3b')]));_0x263990['attributes']=_0x263990[_0x4d68('0x39')]['length']?_0x263990[_0x4d68('0x39')]:_0x8d674e[_0x4d68('0x38')];_0x263990['order']=qs[_0x4d68('0x40')](_0x5b0f3e[_0x4d68('0x35')][_0x4d68('0x40')]);_0x263990[_0x4d68('0x41')]=qs['filters'](_['pick'](_0x5b0f3e[_0x4d68('0x35')],_0x8d674e[_0x4d68('0x37')]));if(_0x5b0f3e[_0x4d68('0x35')][_0x4d68('0x43')]){_0x263990[_0x4d68('0x41')]=_[_0x4d68('0x44')](_0x263990['where'],{'$or':_['map'](_0x263990[_0x4d68('0x39')],function(_0x34f37c){var _0x3d33e2={};_0x3d33e2[_0x34f37c]={'$like':'%'+_0x5b0f3e['query'][_0x4d68('0x43')]+'%'};return _0x3d33e2;})});}_0x263990=_[_0x4d68('0x44')]({},_0x263990,_0x5b0f3e[_0x4d68('0x46')]);return _0x5bde71[_0x4d68('0x12b')](_0x263990);}})['then'](function(_0x3fe045){if(_0x3fe045){_0x2b5fc3=_0x3fe045[_0x4d68('0x3c')];if(!_0x5b0f3e['query']['hasOwnProperty'](_0x4d68('0x3e'))){_0x263990[_0x4d68('0x24')]=qs[_0x4d68('0x24')](_0x5b0f3e[_0x4d68('0x35')][_0x4d68('0x24')]);_0x263990[_0x4d68('0x22')]=qs[_0x4d68('0x22')](_0x5b0f3e['query'][_0x4d68('0x22')]);}return _0x5bde71['getAgents'](_0x263990);}})[_0x4d68('0x16')](function(_0x41e222){if(_0x41e222){return _0x41e222?{'count':_0x2b5fc3,'rows':_0x41e222}:null;}})[_0x4d68('0x16')](respondWithResult(_0x4cbd41,null))[_0x4d68('0x1f')](handleError(_0x4cbd41,null));};
\ No newline at end of file
+var _0xfad6=['catch','status','end','json','undefined','limit','count','offset','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','ChatWebsite','include','rows','show','params','includeAll','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rawAttributes','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','hasOwnProperty','order','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','priority','account','defaults','CmContact','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','vendor','format','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','server','attachments','basename','openNewInteraction','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','mimetype','subjectOffline','mapValues','email','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','replace','alignment','textColor','color_button','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','sendStatus','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','register','jayson/promise','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x688c0e,_0xc9e8e8){var _0x351de9=function(_0x5ac96d){while(--_0x5ac96d){_0x688c0e['push'](_0x688c0e['shift']());}};_0x351de9(++_0xc9e8e8);}(_0xfad6,0x10a));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x6fad('0x0'));var Mustache=require('mustache');var util=require(_0x6fad('0x1'));var path=require('path');var ejs=require(_0x6fad('0x2'));var fs=require('fs');var fs_extra=require(_0x6fad('0x3'));var _=require(_0x6fad('0x4'));var querystring=require(_0x6fad('0x5'));var Redis=require(_0x6fad('0x6'));var qs=require(_0x6fad('0x7'));var logger=require(_0x6fad('0x8'))(_0x6fad('0x9'));var config=require(_0x6fad('0xa'));var db=require(_0x6fad('0xb'))['db'];config[_0x6fad('0xc')]=_['defaults'](config[_0x6fad('0xc')],{'host':_0x6fad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6fad('0xc')]));require(_0x6fad('0xe'))[_0x6fad('0xf')](socket);var jayson=require(_0x6fad('0x10'));var client=jayson['client'][_0x6fad('0x11')]({'port':0x232c});var client9002=jayson[_0x6fad('0x12')][_0x6fad('0x11')]({'port':0x232a});var client9003=jayson[_0x6fad('0x12')]['http']({'port':0x232b});var client9001=jayson['client'][_0x6fad('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x5023f5,_0xc7471d,_0x5d6cd6,_0xfb175a){return new BPromise(function(_0x17f911,_0x1740c1){var _0x1b230a=_0xfb175a||client;return _0x1b230a[_0x6fad('0x13')](_0x5023f5,_0x5d6cd6)[_0x6fad('0x14')](function(_0x2d2088){logger['info'](_0x6fad('0x15'),_0xc7471d,_0x6fad('0x16'));logger[_0x6fad('0x17')](_0x6fad('0x18'),_0xc7471d,'request\x20sent',JSON[_0x6fad('0x19')](_0x2d2088));if(_0x2d2088['error']){if(_0x2d2088[_0x6fad('0x1a')][_0x6fad('0x1b')]===0x1f4){logger[_0x6fad('0x1a')](_0x6fad('0x15'),_0xc7471d,_0x2d2088['error']['message']);return _0x1740c1(_0x2d2088[_0x6fad('0x1a')][_0x6fad('0x1c')]);}logger[_0x6fad('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0xc7471d,_0x2d2088[_0x6fad('0x1a')][_0x6fad('0x1c')]);return _0x17f911(_0x2d2088[_0x6fad('0x1a')]['message']);}else{logger[_0x6fad('0x1d')](_0x6fad('0x15'),_0xc7471d,_0x6fad('0x16'));_0x17f911(_0x2d2088[_0x6fad('0x1e')][_0x6fad('0x1c')]);}})[_0x6fad('0x1f')](function(_0x39fe30){logger[_0x6fad('0x1a')](_0x6fad('0x15'),_0xc7471d,_0x39fe30);_0x1740c1(_0x39fe30);});});}function respondWithStatusCode(_0xef1445,_0x48ff18){_0x48ff18=_0x48ff18||0xcc;return function(_0x37b75c){if(_0x37b75c){return _0xef1445['sendStatus'](_0x48ff18);}return _0xef1445[_0x6fad('0x20')](_0x48ff18)[_0x6fad('0x21')]();};}function respondWithResult(_0x13353a,_0x2ae706){_0x2ae706=_0x2ae706||0xc8;return function(_0x105cf1){if(_0x105cf1){return _0x13353a[_0x6fad('0x20')](_0x2ae706)[_0x6fad('0x22')](_0x105cf1);}};}function respondWithFilteredResult(_0x3bfd56,_0x28bfa6){return function(_0x1b4292){if(_0x1b4292){var _0x4f3bee=typeof _0x28bfa6['offset']===_0x6fad('0x23')&&typeof _0x28bfa6[_0x6fad('0x24')]===_0x6fad('0x23');var _0x2bf374=_0x1b4292[_0x6fad('0x25')];var _0x567e71=_0x4f3bee?0x0:_0x28bfa6[_0x6fad('0x26')];var _0x5bcc00=_0x4f3bee?_0x1b4292['count']:_0x28bfa6[_0x6fad('0x26')]+_0x28bfa6['limit'];var _0x697d63;if(_0x5bcc00>=_0x2bf374){_0x5bcc00=_0x2bf374;_0x697d63=0xc8;}else{_0x697d63=0xce;}_0x3bfd56[_0x6fad('0x20')](_0x697d63);return _0x3bfd56['set']('Content-Range',_0x567e71+'-'+_0x5bcc00+'/'+_0x2bf374)[_0x6fad('0x22')](_0x1b4292);}return null;};}function saveUpdates(_0xb2a239){return function(_0x3feac5){if(_0x3feac5){return _0x3feac5['update'](_0xb2a239)['then'](function(_0x23db57){return _0x23db57;});}return null;};}function removeEntity(_0x61cc29){return function(_0x12e1ac){if(_0x12e1ac){return _0x12e1ac[_0x6fad('0x27')]()[_0x6fad('0x14')](function(){var _0x1451bd=_0x12e1ac[_0x6fad('0x28')]({'plain':!![]});var _0x45294a=_0x6fad('0x29');return db[_0x6fad('0x2a')][_0x6fad('0x27')]({'where':{'type':_0x45294a,'resourceId':_0x1451bd['id']}})[_0x6fad('0x14')](function(){return _0x12e1ac;});})[_0x6fad('0x14')](function(){_0x61cc29[_0x6fad('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50afb5){return function(_0x241b52){if(!_0x241b52){_0x50afb5['sendStatus'](0x194);}return _0x241b52;};}function handleError(_0x17935c,_0x226910){_0x226910=_0x226910||0x1f4;return function(_0x3f3226){logger['error'](_0x3f3226[_0x6fad('0x2b')]);if(_0x3f3226['name']){delete _0x3f3226[_0x6fad('0x2c')];}_0x17935c[_0x6fad('0x20')](_0x226910)[_0x6fad('0x2d')](_0x3f3226);};}exports['index']=function(_0xe08ac7,_0x26a3a7){var _0xde83c4={'include':[{'model':db[_0x6fad('0x2e')],'as':_0x6fad('0x2f')}]},_0x3c52fa={},_0x290c0f={'count':0x0,'rows':[]};var _0x1726ae=_[_0x6fad('0x30')](db['ChatWebsite']['rawAttributes'],function(_0x2406c8){return{'name':_0x2406c8[_0x6fad('0x31')],'type':_0x2406c8[_0x6fad('0x32')]['key']};});_0x3c52fa[_0x6fad('0x33')]=_[_0x6fad('0x30')](_0x1726ae,_0x6fad('0x2c'));_0x3c52fa[_0x6fad('0x34')]=_[_0x6fad('0x35')](_0xe08ac7['query']);_0x3c52fa['filters']=_[_0x6fad('0x36')](_0x3c52fa[_0x6fad('0x33')],_0x3c52fa[_0x6fad('0x34')]);_0xde83c4[_0x6fad('0x37')]=_[_0x6fad('0x36')](_0x3c52fa[_0x6fad('0x33')],qs[_0x6fad('0x38')](_0xe08ac7[_0x6fad('0x34')][_0x6fad('0x38')]));_0xde83c4[_0x6fad('0x37')]=_0xde83c4['attributes'][_0x6fad('0x39')]?_0xde83c4[_0x6fad('0x37')]:_0x3c52fa[_0x6fad('0x33')];if(!_0xe08ac7[_0x6fad('0x34')]['hasOwnProperty'](_0x6fad('0x3a'))){_0xde83c4[_0x6fad('0x24')]=qs[_0x6fad('0x24')](_0xe08ac7[_0x6fad('0x34')][_0x6fad('0x24')]);_0xde83c4[_0x6fad('0x26')]=qs[_0x6fad('0x26')](_0xe08ac7[_0x6fad('0x34')]['offset']);}_0xde83c4['order']=qs[_0x6fad('0x3b')](_0xe08ac7[_0x6fad('0x34')][_0x6fad('0x3b')]);_0xde83c4[_0x6fad('0x3c')]=qs[_0x6fad('0x3d')](_[_0x6fad('0x3e')](_0xe08ac7[_0x6fad('0x34')],_0x3c52fa[_0x6fad('0x3d')]),_0x1726ae);if(_0xe08ac7['query'][_0x6fad('0x3f')]){_0xde83c4[_0x6fad('0x3c')]=_['merge'](_0xde83c4[_0x6fad('0x3c')],{'$or':_[_0x6fad('0x30')](_0x1726ae,function(_0xe11370){if(_0xe11370['type']!=='VIRTUAL'){var _0x3cd9df={};_0x3cd9df[_0xe11370['name']]={'$like':'%'+_0xe08ac7['query'][_0x6fad('0x3f')]+'%'};return _0x3cd9df;}})});}_0xde83c4=_[_0x6fad('0x40')]({},_0xde83c4,_0xe08ac7[_0x6fad('0x41')]);var _0x126fbe={'where':_0xde83c4[_0x6fad('0x3c')]};return db[_0x6fad('0x42')]['count'](_0x126fbe)['then'](function(_0x29bed6){_0x290c0f[_0x6fad('0x25')]=_0x29bed6;if(_0xe08ac7[_0x6fad('0x34')]['includeAll']){_0xde83c4[_0x6fad('0x43')]=[{'all':!![]}];}return db[_0x6fad('0x42')]['findAll'](_0xde83c4);})[_0x6fad('0x14')](function(_0x7bbc48){_0x290c0f[_0x6fad('0x44')]=_0x7bbc48;return _0x290c0f;})[_0x6fad('0x14')](respondWithFilteredResult(_0x26a3a7,_0xde83c4))['catch'](handleError(_0x26a3a7,null));};exports[_0x6fad('0x45')]=function(_0x2db5d4,_0x153290){var _0x390362={'raw':![],'where':{'id':_0x2db5d4[_0x6fad('0x46')]['id']},'include':[{'model':db[_0x6fad('0x2e')],'as':'mandatoryDispositionPause'}]},_0xfc28f9={};_0xfc28f9['model']=_['keys'](db[_0x6fad('0x42')]['rawAttributes']);_0xfc28f9['query']=_[_0x6fad('0x35')](_0x2db5d4[_0x6fad('0x34')]);_0xfc28f9[_0x6fad('0x3d')]=_[_0x6fad('0x36')](_0xfc28f9[_0x6fad('0x33')],_0xfc28f9['query']);_0x390362[_0x6fad('0x37')]=_[_0x6fad('0x36')](_0xfc28f9['model'],qs[_0x6fad('0x38')](_0x2db5d4[_0x6fad('0x34')][_0x6fad('0x38')]));_0x390362[_0x6fad('0x37')]=_0x390362[_0x6fad('0x37')]['length']?_0x390362[_0x6fad('0x37')]:_0xfc28f9[_0x6fad('0x33')];if(_0x2db5d4[_0x6fad('0x34')][_0x6fad('0x47')]){_0x390362['include']=[{'all':!![]}];}_0x390362=_['merge']({},_0x390362,_0x2db5d4['options']);return db[_0x6fad('0x42')]['find'](_0x390362)[_0x6fad('0x14')](handleEntityNotFound(_0x153290,null))[_0x6fad('0x14')](respondWithResult(_0x153290,null))[_0x6fad('0x1f')](handleError(_0x153290,null));};exports[_0x6fad('0x48')]=function(_0x1ea5cd,_0x3947c2){return db[_0x6fad('0x42')]['create'](_0x1ea5cd['body'],{})['then'](function(_0x20843e){var _0x38b7ed=_0x1ea5cd[_0x6fad('0x49')][_0x6fad('0x28')]({'plain':!![]});if(!_0x38b7ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38b7ed[_0x6fad('0x4a')]===_0x6fad('0x49')){var _0x47ac65=_0x20843e[_0x6fad('0x28')]({'plain':!![]});var _0x20b9ed=_0x6fad('0x29');return db[_0x6fad('0x4b')][_0x6fad('0x4c')]({'where':{'name':_0x20b9ed,'userProfileId':_0x38b7ed[_0x6fad('0x4d')]},'raw':!![]})['then'](function(_0x644f61){if(_0x644f61&&_0x644f61[_0x6fad('0x4e')]===0x0){return db[_0x6fad('0x2a')][_0x6fad('0x48')]({'name':_0x47ac65[_0x6fad('0x2c')],'resourceId':_0x47ac65['id'],'type':_0x644f61[_0x6fad('0x2c')],'sectionId':_0x644f61['id']},{})['then'](function(){return _0x20843e;});}else{return _0x20843e;}})[_0x6fad('0x1f')](function(_0xc076cd){logger['error'](_0x6fad('0x4f'),_0xc076cd);throw _0xc076cd;});}return _0x20843e;})[_0x6fad('0x14')](respondWithResult(_0x3947c2,0xc9))['catch'](handleError(_0x3947c2,null));};exports[_0x6fad('0x50')]=function(_0x306259,_0x359c0d){if(_0x306259[_0x6fad('0x51')]['id']){delete _0x306259[_0x6fad('0x51')]['id'];}return db[_0x6fad('0x42')]['find']({'where':{'id':_0x306259[_0x6fad('0x46')]['id']},'include':[{'model':db[_0x6fad('0x2e')],'as':_0x6fad('0x2f')}]})[_0x6fad('0x14')](handleEntityNotFound(_0x359c0d,null))[_0x6fad('0x14')](saveUpdates(_0x306259[_0x6fad('0x51')],null))[_0x6fad('0x14')](respondWithResult(_0x359c0d,null))[_0x6fad('0x1f')](handleError(_0x359c0d,null));};exports[_0x6fad('0x27')]=function(_0x2d5c8d,_0x555ac7){return db[_0x6fad('0x42')]['find']({'where':{'id':_0x2d5c8d[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x555ac7,null))[_0x6fad('0x14')](removeEntity(_0x555ac7,null))[_0x6fad('0x1f')](handleError(_0x555ac7,null));};exports[_0x6fad('0x52')]=function(_0x56132b,_0x397794){return db['ChatWebsite'][_0x6fad('0x52')]()[_0x6fad('0x14')](respondWithResult(_0x397794,null))['catch'](handleError(_0x397794,null));};exports[_0x6fad('0x53')]=function(_0x19db0a,_0x41c479){if(_0x19db0a[_0x6fad('0x51')]['id']){delete _0x19db0a[_0x6fad('0x51')]['id'];}return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x19db0a['params']['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x41c479,null))[_0x6fad('0x14')](function(_0xa204b2){if(_0xa204b2){_0x19db0a['body'][_0x6fad('0x54')]=_0xa204b2['id'];return db[_0x6fad('0x55')][_0x6fad('0x48')](_0x19db0a[_0x6fad('0x51')]);}})[_0x6fad('0x14')](respondWithResult(_0x41c479,null))[_0x6fad('0x1f')](handleError(_0x41c479,null));};exports[_0x6fad('0x56')]=function(_0x4e8cdf,_0x2a8438){var _0x3d212d={'raw':![],'where':{}};var _0x34aceb={};var _0x5e0daf={'count':0x0,'rows':[]};return db[_0x6fad('0x42')]['findOne']({'where':{'id':_0x4e8cdf['params']['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x2a8438,null))[_0x6fad('0x14')](function(_0x4cbf26){if(_0x4cbf26){_0x34aceb[_0x6fad('0x33')]=_['keys'](db[_0x6fad('0x55')][_0x6fad('0x57')]);_0x34aceb[_0x6fad('0x34')]=_[_0x6fad('0x35')](_0x4e8cdf[_0x6fad('0x34')]);_0x34aceb['filters']=_[_0x6fad('0x36')](_0x34aceb[_0x6fad('0x33')],_0x34aceb[_0x6fad('0x34')]);_0x3d212d[_0x6fad('0x37')]=_[_0x6fad('0x36')](_0x34aceb['model'],qs[_0x6fad('0x38')](_0x4e8cdf['query']['fields']));_0x3d212d[_0x6fad('0x37')]=_0x3d212d[_0x6fad('0x37')][_0x6fad('0x39')]?_0x3d212d['attributes']:_0x34aceb[_0x6fad('0x33')];if(!_0x4e8cdf[_0x6fad('0x34')]['hasOwnProperty'](_0x6fad('0x3a'))){_0x3d212d[_0x6fad('0x24')]=qs[_0x6fad('0x24')](_0x4e8cdf['query']['limit']);_0x3d212d[_0x6fad('0x26')]=qs[_0x6fad('0x26')](_0x4e8cdf[_0x6fad('0x34')]['offset']);}_0x3d212d['order']=qs[_0x6fad('0x3b')](_0x4e8cdf[_0x6fad('0x34')][_0x6fad('0x3b')]);_0x3d212d[_0x6fad('0x3c')]=qs['filters'](_[_0x6fad('0x3e')](_0x4e8cdf[_0x6fad('0x34')],_0x34aceb[_0x6fad('0x3d')]));_0x3d212d[_0x6fad('0x3c')]['ChatWebsiteId']=_0x4cbf26['id'];if(_0x4e8cdf[_0x6fad('0x34')][_0x6fad('0x3f')]){_0x3d212d[_0x6fad('0x3c')]=_['merge'](_0x3d212d['where'],{'$or':_[_0x6fad('0x30')](_0x3d212d[_0x6fad('0x37')],function(_0x50cd44){var _0x42ad7c={};_0x42ad7c[_0x50cd44]={'$like':'%'+_0x4e8cdf[_0x6fad('0x34')][_0x6fad('0x3f')]+'%'};return _0x42ad7c;})});}_0x3d212d=_[_0x6fad('0x40')]({},_0x3d212d,_0x4e8cdf['options']);return db[_0x6fad('0x55')][_0x6fad('0x25')]({'where':_0x3d212d[_0x6fad('0x3c')]})[_0x6fad('0x14')](function(_0x3f1bee){_0x5e0daf['count']=_0x3f1bee;if(_0x4e8cdf[_0x6fad('0x34')][_0x6fad('0x47')]){_0x3d212d[_0x6fad('0x43')]=[{'all':!![]}];}return db[_0x6fad('0x55')][_0x6fad('0x58')](_0x3d212d);})['then'](function(_0x2f43cf){_0x5e0daf['rows']=_0x2f43cf;return _0x5e0daf;});}})[_0x6fad('0x14')](respondWithFilteredResult(_0x2a8438,_0x3d212d))['catch'](handleError(_0x2a8438,null));};exports[_0x6fad('0x59')]=function(_0x3d3da1,_0x2b32c8){return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x3d3da1[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x2b32c8,null))[_0x6fad('0x14')](function(_0xe9f50a){if(_0xe9f50a){return _0xe9f50a[_0x6fad('0x59')](_0x3d3da1['query'][_0x6fad('0x5a')]);}})['then'](respondWithStatusCode(_0x2b32c8,null))['catch'](handleError(_0x2b32c8,null));};exports['addAnswer']=function(_0x1854c5,_0x3117da){if(_0x1854c5['body']['id']){delete _0x1854c5['body']['id'];}return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x1854c5[_0x6fad('0x46')]['id']}})['then'](handleEntityNotFound(_0x3117da,null))['then'](function(_0x19ce8d){if(_0x19ce8d){_0x1854c5[_0x6fad('0x51')]['ChatWebsiteId']=_0x19ce8d['id'];return db[_0x6fad('0x5b')][_0x6fad('0x48')](_0x1854c5[_0x6fad('0x51')]);}})['then'](respondWithResult(_0x3117da,null))[_0x6fad('0x1f')](handleError(_0x3117da,null));};exports[_0x6fad('0x5c')]=function(_0xc692ca,_0x244fd4){var _0x70d2e9={'raw':![],'where':{}};var _0x29765d={};var _0x47eabd={'count':0x0,'rows':[]};return db[_0x6fad('0x42')][_0x6fad('0x5d')]({'where':{'id':_0xc692ca[_0x6fad('0x46')]['id']}})['then'](handleEntityNotFound(_0x244fd4,null))[_0x6fad('0x14')](function(_0x3b50bd){if(_0x3b50bd){_0x29765d[_0x6fad('0x33')]=_[_0x6fad('0x35')](db[_0x6fad('0x5b')][_0x6fad('0x57')]);_0x29765d[_0x6fad('0x34')]=_['keys'](_0xc692ca[_0x6fad('0x34')]);_0x29765d[_0x6fad('0x3d')]=_[_0x6fad('0x36')](_0x29765d['model'],_0x29765d[_0x6fad('0x34')]);_0x70d2e9[_0x6fad('0x37')]=_[_0x6fad('0x36')](_0x29765d[_0x6fad('0x33')],qs[_0x6fad('0x38')](_0xc692ca[_0x6fad('0x34')][_0x6fad('0x38')]));_0x70d2e9[_0x6fad('0x37')]=_0x70d2e9['attributes'][_0x6fad('0x39')]?_0x70d2e9[_0x6fad('0x37')]:_0x29765d[_0x6fad('0x33')];if(!_0xc692ca[_0x6fad('0x34')][_0x6fad('0x5e')](_0x6fad('0x3a'))){_0x70d2e9[_0x6fad('0x24')]=qs[_0x6fad('0x24')](_0xc692ca[_0x6fad('0x34')]['limit']);_0x70d2e9['offset']=qs[_0x6fad('0x26')](_0xc692ca[_0x6fad('0x34')][_0x6fad('0x26')]);}_0x70d2e9[_0x6fad('0x5f')]=qs['sort'](_0xc692ca['query']['sort']);_0x70d2e9['where']=qs[_0x6fad('0x3d')](_[_0x6fad('0x3e')](_0xc692ca['query'],_0x29765d[_0x6fad('0x3d')]));_0x70d2e9[_0x6fad('0x3c')][_0x6fad('0x54')]=_0x3b50bd['id'];if(_0xc692ca[_0x6fad('0x34')][_0x6fad('0x3f')]){_0x70d2e9[_0x6fad('0x3c')]=_[_0x6fad('0x40')](_0x70d2e9[_0x6fad('0x3c')],{'$or':_[_0x6fad('0x30')](_0x70d2e9[_0x6fad('0x37')],function(_0x542afd){var _0x6f99f={};_0x6f99f[_0x542afd]={'$like':'%'+_0xc692ca[_0x6fad('0x34')][_0x6fad('0x3f')]+'%'};return _0x6f99f;})});}_0x70d2e9=_[_0x6fad('0x40')]({},_0x70d2e9,_0xc692ca['options']);return db[_0x6fad('0x5b')][_0x6fad('0x25')]({'where':_0x70d2e9[_0x6fad('0x3c')]})['then'](function(_0x40e46c){_0x47eabd['count']=_0x40e46c;if(_0xc692ca[_0x6fad('0x34')][_0x6fad('0x47')]){_0x70d2e9[_0x6fad('0x43')]=[{'all':!![]}];}return db[_0x6fad('0x5b')][_0x6fad('0x58')](_0x70d2e9);})[_0x6fad('0x14')](function(_0x3bbb76){_0x47eabd['rows']=_0x3bbb76;return _0x47eabd;});}})[_0x6fad('0x14')](respondWithFilteredResult(_0x244fd4,_0x70d2e9))[_0x6fad('0x1f')](handleError(_0x244fd4,null));};exports[_0x6fad('0x60')]=function(_0x3749dc,_0x1bb70b){return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x3749dc['params']['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x1bb70b,null))['then'](function(_0x5d1699){if(_0x5d1699){return _0x5d1699[_0x6fad('0x60')](_0x3749dc[_0x6fad('0x34')][_0x6fad('0x5a')]);}})[_0x6fad('0x14')](respondWithStatusCode(_0x1bb70b,null))[_0x6fad('0x1f')](handleError(_0x1bb70b,null));};exports[_0x6fad('0x61')]=function(_0x47ab2f,_0x2162d6){_0x47ab2f[_0x6fad('0x51')][_0x6fad('0x62')]=_0x47ab2f[_0x6fad('0x63')]['filename'];return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x47ab2f['params']['id']}})['then'](handleEntityNotFound(_0x2162d6,null))[_0x6fad('0x14')](saveUpdates(_0x47ab2f['body'],null))[_0x6fad('0x14')](respondWithResult(_0x2162d6,null))[_0x6fad('0x1f')](handleError(_0x2162d6,null));};exports[_0x6fad('0x64')]=function(_0x4158b0,_0x36c8bb){_0x4158b0[_0x6fad('0x51')][_0x6fad('0x65')]=_0x4158b0[_0x6fad('0x63')][_0x6fad('0x66')];return db['ChatWebsite'][_0x6fad('0x4c')]({'where':{'id':_0x4158b0[_0x6fad('0x46')]['id']}})['then'](handleEntityNotFound(_0x36c8bb,null))[_0x6fad('0x14')](saveUpdates(_0x4158b0[_0x6fad('0x51')],null))['then'](respondWithResult(_0x36c8bb,null))[_0x6fad('0x1f')](handleError(_0x36c8bb,null));};exports[_0x6fad('0x67')]=function(_0x22ba06,_0x335b51){_0x22ba06[_0x6fad('0x51')][_0x6fad('0x68')]=_0x22ba06[_0x6fad('0x63')][_0x6fad('0x66')];return db[_0x6fad('0x42')]['find']({'where':{'id':_0x22ba06['params']['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x335b51,null))[_0x6fad('0x14')](saveUpdates(_0x22ba06['body'],null))['then'](respondWithResult(_0x335b51,null))[_0x6fad('0x1f')](handleError(_0x335b51,null));};exports[_0x6fad('0x69')]=function(_0x4e19ce,_0x14a958){_0x4e19ce[_0x6fad('0x51')][_0x6fad('0x6a')]=_0x4e19ce[_0x6fad('0x63')][_0x6fad('0x66')];return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x4e19ce[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x14a958,null))[_0x6fad('0x14')](saveUpdates(_0x4e19ce[_0x6fad('0x51')],null))[_0x6fad('0x14')](respondWithResult(_0x14a958,null))[_0x6fad('0x1f')](handleError(_0x14a958,null));};exports['getLogo']=function(_0x59bc4c,_0x43dfb0){var _0xc5695f=path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],'server/files/images/logos/default_logo.svg');var _0x4afd3e={'where':{'id':_0x59bc4c['params']['id']},'attributes':['id',_0x6fad('0x62')],'raw':!![]};var _0x5a9895=![];return require(_0x6fad('0x6d'))[_0x6fad('0x6e')]()['then'](function(_0x23e130){if(_0x23e130){_0x5a9895=_0x23e130[_0x6fad('0x6f')];}})[_0x6fad('0x14')](function(){return db[_0x6fad('0x42')][_0x6fad('0x4c')](_0x4afd3e);})[_0x6fad('0x14')](handleEntityNotFound(_0x43dfb0,null))[_0x6fad('0x14')](function(_0x4e3872){if(_0x4e3872){if(!_[_0x6fad('0x70')](_0x4e3872[_0x6fad('0x62')])){if(fs[_0x6fad('0x71')](path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0x72'),_0x4e3872[_0x6fad('0x62')]))&&_0x5a9895){_0xc5695f=path['join'](config[_0x6fad('0x6c')],_0x6fad('0x72'),_0x4e3872[_0x6fad('0x62')]);}}return _0x43dfb0[_0x6fad('0x73')](_0xc5695f);}})[_0x6fad('0x1f')](handleError(_0x43dfb0,null));};exports['getAvatar']=function(_0x339bed,_0x133b56){var _0xa10019=path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0x74'));var _0x21805c={'where':{'id':_0x339bed[_0x6fad('0x46')]['id']},'attributes':['id',_0x6fad('0x65')],'raw':!![]};return db[_0x6fad('0x42')]['find'](_0x21805c)[_0x6fad('0x14')](handleEntityNotFound(_0x133b56,null))['then'](function(_0x1eeda3){if(_0x1eeda3){if(!_[_0x6fad('0x70')](_0x1eeda3[_0x6fad('0x65')])){if(fs['existsSync'](path[_0x6fad('0x6b')](config['root'],'server/files/images/avatars/',_0x1eeda3['agentAvatar']))){_0xa10019=path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0x75'),_0x1eeda3['agentAvatar']);}}return _0x133b56['download'](_0xa10019);}})[_0x6fad('0x1f')](handleError(_0x133b56,null));};exports[_0x6fad('0x76')]=function(_0x537ff1,_0x396c0b){var _0x373d42=path[_0x6fad('0x6b')](config['root'],_0x6fad('0x77'));var _0x1d5452={'where':{'id':_0x537ff1[_0x6fad('0x46')]['id']},'attributes':['id',_0x6fad('0x68'),'showCustomerAvatar'],'raw':!![]};return db[_0x6fad('0x42')][_0x6fad('0x4c')](_0x1d5452)['then'](handleEntityNotFound(_0x396c0b,null))[_0x6fad('0x14')](function(_0x5b98f8){if(_0x5b98f8){if(!_[_0x6fad('0x70')](_0x5b98f8[_0x6fad('0x68')])){if(fs[_0x6fad('0x71')](path['join'](config[_0x6fad('0x6c')],'server/files/images/avatars/',_0x5b98f8[_0x6fad('0x68')]))&&_0x5b98f8['showCustomerAvatar']){_0x373d42=path['join'](config[_0x6fad('0x6c')],_0x6fad('0x75'),_0x5b98f8[_0x6fad('0x68')]);}}return _0x396c0b[_0x6fad('0x73')](_0x373d42);}})[_0x6fad('0x1f')](handleError(_0x396c0b,null));};exports[_0x6fad('0x78')]=function(_0x1cdd0b,_0x36b763){var _0x3889c2=path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0x79'));var _0x10892d={'where':{'id':_0x1cdd0b[_0x6fad('0x46')]['id']},'attributes':['id',_0x6fad('0x6a')],'raw':!![]};return db[_0x6fad('0x42')][_0x6fad('0x4c')](_0x10892d)[_0x6fad('0x14')](handleEntityNotFound(_0x36b763,null))[_0x6fad('0x14')](function(_0x4c63c5){if(_0x4c63c5){if(!_['isNil'](_0x4c63c5[_0x6fad('0x6a')])){if(fs[_0x6fad('0x71')](path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0x75'),_0x4c63c5[_0x6fad('0x6a')]))){_0x3889c2=path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0x75'),_0x4c63c5[_0x6fad('0x6a')]);}}return _0x36b763[_0x6fad('0x73')](_0x3889c2);}})[_0x6fad('0x1f')](handleError(_0x36b763,null));};exports[_0x6fad('0x7a')]=function(_0x5d8efd,_0x5914c9){var _0x6d6917=require(_0x6fad('0x7b'));var _0x41c18a=new _0x6d6917();var _0x434fe6=_0x41c18a[_0x6fad('0x7c')](_0x5d8efd['headers']['user-agent'])['getResult']();var _0x3a5747={'body':_0x5d8efd[_0x6fad('0x51')],'channel':'chat'};var _0x28be63=[];var _0x5c7b9a=[];var _0x447a83={};var _0x1f20aa=![];return db['CmContact'][_0x6fad('0x52')]()[_0x6fad('0x14')](function(_0x515910){if(!_0x515910){throw new db[(_0x6fad('0x7d'))][(_0x6fad('0x7e'))](_0x6fad('0x7f'));}_0x28be63=_[_0x6fad('0x80')](_[_0x6fad('0x35')](_0x515910),[_0x6fad('0x81'),_0x6fad('0x82')]);_0x5c7b9a=_['difference'](_[_0x6fad('0x35')](_0x515910),[_0x6fad('0x81'),'updatedAt',_0x6fad('0x83'),_0x6fad('0x84')]);if(_0x5d8efd['body']['id']){delete _0x5d8efd['body']['id'];}if(_[_0x6fad('0x70')](_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x85')])){throw new db['Sequelize'][(_0x6fad('0x7e'))](_0x6fad('0x86'));}if(_['isNil'](_0x5d8efd['body'][_0x6fad('0x51')])||_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x51')]===''){throw new db[(_0x6fad('0x7d'))]['ValidationError'](_0x6fad('0x87'));}if(_[_0x6fad('0x70')](_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x88')])){throw new db['Sequelize'][(_0x6fad('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c7b9a);}if(!_[_0x6fad('0x89')](_0x5c7b9a,_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x88')])){throw new db['Sequelize'][(_0x6fad('0x7e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c7b9a);}_0x447a83[_0x5d8efd['body'][_0x6fad('0x88')]]=_0x5d8efd['body'][_0x6fad('0x85')];})[_0x6fad('0x14')](function(){return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x5d8efd['params']['id']},'include':[{'model':db[_0x6fad('0x8a')],'as':_0x6fad('0x8b'),'include':[{'model':db['CmContact'],'as':_0x6fad('0x8c'),'where':_0x447a83,'limit':0x1,'order':[[_0x6fad('0x82'),_0x6fad('0x8d')]]}]},{'model':db[_0x6fad('0x8e')],'as':_0x6fad('0x8f')}]});})[_0x6fad('0x14')](handleEntityNotFound(_0x5914c9,null))['then'](function(_0x350ea4){if(_0x350ea4&&_0x350ea4[_0x6fad('0x8b')]){_0x3a5747['account']=_0x350ea4;_0x3a5747[_0x6fad('0x90')]=_0x350ea4[_0x6fad('0x8f')];_0x3a5747[_0x6fad('0x91')]=_0x350ea4[_0x6fad('0x8b')];_0x3a5747['applications']=_[_0x6fad('0x92')](_0x3a5747[_0x6fad('0x90')],[_0x6fad('0x93')],['asc']);if(_0x3a5747[_0x6fad('0x94')][_0x6fad('0x8f')]){delete _0x3a5747[_0x6fad('0x94')][_0x6fad('0x8f')];}if(_0x3a5747[_0x6fad('0x94')][_0x6fad('0x8b')]&&_0x3a5747[_0x6fad('0x94')]['List'][_0x6fad('0x8c')][_0x6fad('0x39')]){return _0x3a5747[_0x6fad('0x94')][_0x6fad('0x8b')][_0x6fad('0x8c')][0x0];}var _0x1924c6=_[_0x6fad('0x95')](_0x5d8efd['body'],{'firstName':_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x85')],'ListId':_0x350ea4[_0x6fad('0x84')]});_0x1924c6[_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x88')]]=_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x85')];return db[_0x6fad('0x96')][_0x6fad('0x48')](_0x1924c6,{'fields':_0x28be63,'raw':!![]});}})[_0x6fad('0x14')](handleEntityNotFound(_0x5914c9,null))['then'](function(_0x3ca2ba){_0x3a5747[_0x6fad('0x97')]=_0x3ca2ba;var _0x156577=_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x98')];if(_0x5d8efd[_0x6fad('0x99')][_0x6fad('0x9a')]){_0x156577=_0x5d8efd[_0x6fad('0x99')]['cf-connecting-ip'];}else if(_0x5d8efd['headers'][_0x6fad('0x9b')]){_0x156577=_[_0x6fad('0x9c')](_0x5d8efd[_0x6fad('0x99')][_0x6fad('0x9b')][_0x6fad('0x9d')](','));}if(_0x3ca2ba){var _0x70e51c={'ContactId':_0x3ca2ba['id'],'ChatWebsiteId':_0x5d8efd[_0x6fad('0x46')]['id'],'from':(_0x3ca2ba[_0x6fad('0x9e')]||'')+'\x20'+(_0x3ca2ba[_0x6fad('0x9f')]||''),'customerIp':_0x156577,'customerPort':_0x5d8efd[_0x6fad('0x99')][_0x6fad('0xa0')]?_0x5d8efd[_0x6fad('0x99')][_0x6fad('0xa0')]:null,'referer':_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xa1')],'browserName':_0x434fe6['browser'][_0x6fad('0x2c')]&&_0x434fe6[_0x6fad('0xa2')][_0x6fad('0xa3')]?util['format'](_0x6fad('0xa4'),_0x434fe6[_0x6fad('0xa2')][_0x6fad('0x2c')],_0x434fe6[_0x6fad('0xa2')][_0x6fad('0xa3')]):_0x6fad('0xa5'),'browserVersion':_0x434fe6['browser'][_0x6fad('0xa3')]||_0x6fad('0xa5'),'osName':util['format'](_0x6fad('0xa4'),_0x434fe6['os'][_0x6fad('0x2c')],_0x434fe6['os'][_0x6fad('0xa3')]),'osVersion':_0x434fe6['os'][_0x6fad('0xa3')],'deviceModel':_0x434fe6[_0x6fad('0xa6')][_0x6fad('0x33')]&&_0x434fe6[_0x6fad('0xa6')][_0x6fad('0xa7')]?util[_0x6fad('0xa8')](_0x6fad('0xa9'),_0x434fe6[_0x6fad('0xa6')][_0x6fad('0x33')],_0x434fe6[_0x6fad('0xa6')][_0x6fad('0xa7')],_0x434fe6[_0x6fad('0xa6')][_0x6fad('0x32')]):null,'deviceVendor':_0x434fe6[_0x6fad('0xa6')][_0x6fad('0xa7')],'deviceType':_0x434fe6[_0x6fad('0xa6')][_0x6fad('0x32')],'formData':JSON[_0x6fad('0x19')](_0x5d8efd['body'])};var _0x3573c1={'ChatWebsiteId':_0x5d8efd[_0x6fad('0x46')]['id'],'closed':![]};if(_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xaa')]){_0x3573c1['threadId']=_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xaa')];return db[_0x6fad('0xab')][_0x6fad('0x4c')]({'where':_0x3573c1})[_0x6fad('0x14')](function(_0x3e2a31){if(_0x3e2a31){return[_0x3e2a31,![]];}_0x70e51c['threadId']=_0x5d8efd[_0x6fad('0x51')]['threadId'];_0x70e51c[_0x6fad('0xac')]=_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xac')];return db[_0x6fad('0xab')][_0x6fad('0x48')](_0x70e51c)[_0x6fad('0x14')](function(_0x5b65e2){return[_0x5b65e2,!![]];});});}_0x3573c1[_0x6fad('0xad')]=_0x3ca2ba['id'];if(_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xae')]&&_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xae')]['id']){_0x3573c1['id']=_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xae')]['id'];return db['ChatInteraction'][_0x6fad('0x4c')]({'where':_0x3573c1})[_0x6fad('0x14')](function(_0x251c6a){if(_0x251c6a){return[_0x251c6a,![]];}return db[_0x6fad('0xab')][_0x6fad('0x48')](_0x70e51c)[_0x6fad('0x14')](function(_0x1fc729){return[_0x1fc729,!![]];});});}return db[_0x6fad('0xab')][_0x6fad('0x48')](_0x70e51c)[_0x6fad('0x14')](function(_0x272f16){return[_0x272f16,!![]];});}})[_0x6fad('0xaf')](function(_0x37b3d8,_0x2dc304){if(_0x37b3d8){_0x1f20aa=_0x2dc304;if(!_0x2dc304){var _0x486ef5={'from':(_0x3a5747[_0x6fad('0x97')]['firstName']||'')+'\x20'+(_0x3a5747['contact'][_0x6fad('0x9f')]||'')};if(_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xaa')]&&_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xb0')]&&_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xaa')]!=_0x5d8efd['body'][_0x6fad('0xb0')]){_0x486ef5[_0x6fad('0xaa')]=_0x5d8efd[_0x6fad('0x51')]['messageId'];}return _0x37b3d8[_0x6fad('0x50')](_0x486ef5);}else{return _0x37b3d8;}}})[_0x6fad('0x14')](function(_0x11dfca){_0x3a5747[_0x6fad('0xae')]=_0x11dfca[_0x6fad('0x28')]({'plain':!![]});_0x3a5747[_0x6fad('0xae')]['created']=_0x1f20aa;if(_0x3a5747[_0x6fad('0xae')][_0x6fad('0xb1')]){if(_0x3a5747[_0x6fad('0x94')]['autoclose']){_0x3a5747[_0x6fad('0x90')][_0x6fad('0xb2')]({'id':0x0,'priority':_0x3a5747[_0x6fad('0x90')][_0x6fad('0x39')]+0x1,'app':'close','appdata':_0x6fad('0xb3'),'interval':_0x6fad('0xb4')});}}return db[_0x6fad('0xb5')]['create']({'body':_0x5d8efd[_0x6fad('0x51')][_0x6fad('0x51')],'ChatWebsiteId':_0x5d8efd[_0x6fad('0x46')]['id'],'ChatInteractionId':_0x11dfca['id'],'direction':'in','ContactId':_0x3a5747[_0x6fad('0x97')]['id'],'AttachmentId':_0x5d8efd[_0x6fad('0x51')][_0x6fad('0xb6')]});})['then'](function(_0x4d51b2){_0x3a5747['message']=_0x4d51b2;if(_0x3a5747['interaction']['UserId']){return db[_0x6fad('0xb7')][_0x6fad('0x4c')]({'attributes':['id','name'],'where':{'id':_0x3a5747[_0x6fad('0xae')][_0x6fad('0xb8')]}})['then'](function(_0x11e893){if(_0x11e893){_0x3a5747[_0x6fad('0x90')][_0x6fad('0xb9')]({'id':0x0,'priority':0x0,'app':_0x6fad('0xba'),'appdata':_0x11e893[_0x6fad('0x2c')]+','+(_0x3a5747[_0x6fad('0x94')][_0x6fad('0xbb')]||0xa),'interval':_0x6fad('0xb4')});_0x3a5747[_0x6fad('0xbc')]=!![];}return respondWithRpcPromise(_0x6fad('0xbd'),_0x6fad('0xbe'),_0x3a5747);});}return respondWithRpcPromise(_0x6fad('0xbd'),_0x6fad('0xbe'),_0x3a5747);})[_0x6fad('0x14')](function(_0x40ae0b){respondWithRpcPromise(_0x6fad('0xbf'),_0x6fad('0xbf'),{'event':_0x6fad('0x7a'),'message':_0x40ae0b},client9002);return _0x40ae0b;})['then'](respondWithResult(_0x5914c9,null))[_0x6fad('0x1f')](handleError(_0x5914c9,null));};exports[_0x6fad('0xc0')]=function(_0x574ef7,_0x4c967b){var _0x49982a,_0x3ab968,_0x526973;var _0x533083=[];var _0x3b481f={};var _0x358065=_0x574ef7[_0x6fad('0xc1')]||[];var _0xb7eb0=[];var _0x2846aa;return db['CmContact'][_0x6fad('0x52')]()[_0x6fad('0x14')](function(_0x28f32d){if(!_0x28f32d){throw new db[(_0x6fad('0x7d'))][(_0x6fad('0x7e'))]('no\x20available\x20attributes');}_0x533083=_[_0x6fad('0x80')](_[_0x6fad('0x35')](_0x28f32d),[_0x6fad('0x81'),_0x6fad('0x82'),'CompanyId',_0x6fad('0x84')]);if(_0x574ef7[_0x6fad('0x51')]['id']){delete _0x574ef7[_0x6fad('0x51')]['id'];}if(_[_0x6fad('0x70')](_0x574ef7['body'][_0x6fad('0x85')])){throw _0x4c967b[_0x6fad('0x20')](0x1f4)[_0x6fad('0x2d')](new db['Sequelize'][(_0x6fad('0x7e'))]('from\x20is\x20mandatory'));}if(_[_0x6fad('0x70')](_0x574ef7[_0x6fad('0x51')][_0x6fad('0x51')])||_0x574ef7['body'][_0x6fad('0x51')]===''){throw _0x4c967b[_0x6fad('0x20')](0x1f4)['send'](new db[(_0x6fad('0x7d'))][(_0x6fad('0x7e'))](_0x6fad('0x87')));}if(_[_0x6fad('0x70')](_0x574ef7[_0x6fad('0x51')][_0x6fad('0xc2')])){throw _0x4c967b['status'](0x1f4)['send'](new db[(_0x6fad('0x7d'))][(_0x6fad('0x7e'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x533083));}if(!_['includes'](_0x533083,_0x574ef7[_0x6fad('0x51')][_0x6fad('0xc2')])){throw _0x4c967b[_0x6fad('0x20')](0x1f4)['send'](new db[(_0x6fad('0x7d'))][(_0x6fad('0x7e'))](_0x6fad('0xc3')+_0x533083));}_0x3b481f[_0x574ef7[_0x6fad('0x51')][_0x6fad('0xc2')]]=_0x574ef7[_0x6fad('0x51')][_0x6fad('0x85')];})[_0x6fad('0x14')](function(){return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'where':{'id':_0x574ef7[_0x6fad('0x46')]['id']},'include':[{'model':db[_0x6fad('0x8a')],'as':_0x6fad('0x8b')},{'model':db['MailAccount'],'as':_0x6fad('0xc4')}]});})[_0x6fad('0x14')](handleEntityNotFound(_0x4c967b,null))['then'](function(_0x421c00){if(_0x421c00&&_0x421c00[_0x6fad('0x8b')]){_0x3ab968=_0x421c00;var _0x14110b=_[_0x6fad('0x95')](_0x574ef7[_0x6fad('0x51')],{'firstName':_0x574ef7[_0x6fad('0x51')][_0x6fad('0x85')],'phone':_0x574ef7[_0x6fad('0x51')][_0x6fad('0x85')],'ListId':_0x421c00[_0x6fad('0x84')]});_0x14110b[_0x574ef7[_0x6fad('0x51')]['mapKeyOffline']]=_0x574ef7['body'][_0x6fad('0x85')];return db[_0x6fad('0x96')][_0x6fad('0xc5')]({'where':_0x3b481f,'defaults':_0x14110b});}})[_0x6fad('0xaf')](function(_0x4c5c9c){if(_0x4c5c9c){_0x526973=_0x4c5c9c;var _0x7f83b7=fs[_0x6fad('0xc6')](path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0xc7')),_0x6fad('0xc8'));var _0x543faa=ejs[_0x6fad('0xc9')](_0x7f83b7,{'body':_[_0x6fad('0xca')](_0x574ef7[_0x6fad('0x51')][_0x6fad('0x51')]),'bodyTitle':_0x3ab968[_0x6fad('0xcb')]});return db['ChatOfflineMessage']['create']({'body':_0x543faa,'ContactId':_0x4c5c9c['id'],'ChatWebsiteId':_0x3ab968['id']});}})[_0x6fad('0x14')](function(_0x5af875){_0x2846aa=_0x5af875;if(_0x358065[_0x6fad('0x39')]){var _0x570357=_0x358065['map'](function(_0x210a67){return{'name':_0x210a67[_0x6fad('0xcc')],'basename':_0x210a67['filename'],'type':_0x210a67['mimetype'],'ChatOfflineMessageId':_0x5af875['id']};});_0xb7eb0=_0x570357[_0x6fad('0x30')](_0x28a070=>{var _0x49ae4b={'filename':_0x28a070[_0x6fad('0x2c')],'path':path['join'](config[_0x6fad('0x6c')],_0x6fad('0xcd'),_0x6fad('0xc1'),_0x6fad('0xce'),'offline-chat',_0x28a070[_0x6fad('0xcf')])};return _0x49ae4b;});if(!_0x3ab968[_0x6fad('0xd0')]){return db['sequelize']['transaction'](function(_0xed95d1){return db['Attachment'][_0x6fad('0xd1')](_0x570357,{'transaction':_0xed95d1});});}}})[_0x6fad('0x14')](function(){if(_0x2846aa){_0x49982a=_0x2846aa;return db[_0x6fad('0xc4')][_0x6fad('0x5d')]({'where':{'active':!![]},'include':[{'model':db[_0x6fad('0xd2')],'as':_0x6fad('0xd3'),'raw':!![]}]});}})[_0x6fad('0x14')](function(_0x136506){if(_0x136506&&_0x136506[_0x6fad('0xd3')]&&_0x3ab968[_0x6fad('0xd4')]&&_0x3ab968[_0x6fad('0xd5')]){var _0x17af2b={'tls':{'rejectUnauthorized':![]}};if(_0x136506[_0x6fad('0xd3')][_0x6fad('0xd6')]){_0x17af2b[_0x6fad('0xd6')]=_0x136506[_0x6fad('0xd3')][_0x6fad('0xd6')];}else{_0x17af2b['host']=_0x136506[_0x6fad('0xd3')][_0x6fad('0xd7')];_0x17af2b['port']=_0x136506[_0x6fad('0xd3')]['port'];_0x17af2b[_0x6fad('0xd8')]=_0x136506[_0x6fad('0xd3')][_0x6fad('0xd8')];}if(_0x136506[_0x6fad('0xd3')][_0x6fad('0xd9')]){_0x17af2b[_0x6fad('0xda')]={'user':_0x136506[_0x6fad('0xd3')][_0x6fad('0x49')],'pass':_0x136506['Smtp'][_0x6fad('0xdb')]};}return respondWithRpcPromise(_0x6fad('0xdc'),'sendMail',{'account':_0x17af2b,'message':{'from':util['format'](_0x6fad('0xdd'),_0x136506['name'],_0x136506['email']||_0x136506['Smtp'][_0x6fad('0x49')]),'to':_0x3ab968['forwardOfflineAddress'],'subject':_0x3ab968[_0x6fad('0xde')],'html':_0x49982a[_0x6fad('0x51')],'attachments':_0xb7eb0}},client9003)['then'](function(){return _0x49982a;})[_0x6fad('0x1f')](function(_0x139a50){console[_0x6fad('0x1a')](_0x139a50);});}})[_0x6fad('0x14')](function(){if(_0x3ab968&&_0x3ab968[_0x6fad('0xd0')]&&_0x3ab968['MailAccountId']){var _0x5e4229=[];if(_0x358065[_0x6fad('0x39')]){_0x5e4229=_0x358065[_0x6fad('0x30')](function(_0x3b7eb8){return{'name':_0x3b7eb8[_0x6fad('0xcc')],'basename':_0x3b7eb8[_0x6fad('0x66')],'type':_0x3b7eb8[_0x6fad('0xdf')],'ChatOfflineMessageId':_0x2846aa['id']};});}var _0x160ad7;if(!_[_0x6fad('0x70')](_0x3ab968[_0x6fad('0xe0')])){var _0x10851b=_[_0x6fad('0x30')](_0x574ef7[_0x6fad('0x51')],function(_0x171d16){return _0x171d16;});var _0x336bdd=_['toPairsIn'](_0x10851b)[0x0];var _0x4f7fa3=_[_0x6fad('0xe1')](_0x336bdd,function(_0x186d43){return _0x186d43;});_0x160ad7=_0x4f7fa3[0x1][_0x3ab968[_0x6fad('0xe0')]];}var _0x398b12={'from':_0x526973['email'],'firstName':_0x526973[_0x6fad('0x9e')],'lastName':_0x526973[_0x6fad('0x9f')],'mapKey':_0x6fad('0xe2'),'message':{'from':_0x526973['email'],'to':_0x3ab968[_0x6fad('0xc4')][_0x6fad('0xe2')],'cc':'','subject':_[_0x6fad('0x70')](_0x160ad7)?_0x3ab968[_0x6fad('0xde')]:_0x160ad7,'messageId':'','sentAt':new Date(),'attach':_0x5e4229[_0x6fad('0x39')],'attachments':_0x5e4229,'originChannel':_0x6fad('0xe3'),'ChatWebsiteId':_0x3ab968['id'],'ChatOfflineMessageId':_0x49982a['id'],'originTo':_0x3ab968[_0x6fad('0xc4')][_0x6fad('0xe2')]},'body':_0x49982a[_0x6fad('0x51')]};var _0x298635={'account':{'id':_0x3ab968[_0x6fad('0xe4')]},'body':_0x398b12,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x6fad('0xe5'),'notifyMail',_0x298635,client9001)[_0x6fad('0x14')](function(){return _0x49982a;})[_0x6fad('0x1f')](function(_0x387a28){console['error'](_0x387a28);});}return;})['then'](function(){if(_0x49982a){return _0x49982a;}})[_0x6fad('0x14')](respondWithResult(_0x4c967b,null))[_0x6fad('0x1f')](function(_0x5ec10c){console[_0x6fad('0x1a')]('catch',_0x5ec10c);for(var _0x128022 of _0x358065){var _0x10fb80=path[_0x6fad('0x6b')](config[_0x6fad('0x6c')],_0x6fad('0xcd'),_0x6fad('0xc1'),_0x6fad('0xce'),'offline-chat',_0x128022[_0x6fad('0x66')]);fs_extra[_0x6fad('0xe6')](_0x10fb80)[_0x6fad('0x1f')](function(_0x41856e){console[_0x6fad('0x1a')](_0x6fad('0xe7'),_0x10fb80,_0x41856e);});}});};exports['addInteraction']=function(_0x32a3c7,_0x31c929){return db[_0x6fad('0xab')][_0x6fad('0x4c')]({'where':{'id':_0x32a3c7[_0x6fad('0x46')]['id']}})['then'](handleEntityNotFound(_0x31c929,null))[_0x6fad('0x14')](function(_0x5a5b0a){if(_0x5a5b0a){return _0x5a5b0a[_0x6fad('0xe8')](_0x32a3c7[_0x6fad('0x51')][_0x6fad('0x5a')],_[_0x6fad('0xe9')](_0x32a3c7[_0x6fad('0x51')],[_0x6fad('0x5a'),'id'])||{});}})[_0x6fad('0x14')](respondWithResult(_0x31c929,null))[_0x6fad('0x1f')](handleError(_0x31c929,null));};exports[_0x6fad('0xea')]=function(_0x368532,_0x430987){var _0x3d31a8={'raw':![],'where':{}};var _0x163597={};var _0x4542a3={'count':0x0,'rows':[]};return db[_0x6fad('0x42')]['findOne']({'where':{'id':_0x368532[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x430987,null))[_0x6fad('0x14')](function(_0x495efd){if(_0x495efd){_0x163597[_0x6fad('0x33')]=_['keys'](db[_0x6fad('0xab')][_0x6fad('0x57')]);_0x163597[_0x6fad('0x34')]=_['keys'](_0x368532['query']);_0x163597[_0x6fad('0x3d')]=_[_0x6fad('0x36')](_0x163597[_0x6fad('0x33')],_0x163597[_0x6fad('0x34')]);_0x3d31a8[_0x6fad('0x37')]=_[_0x6fad('0x36')](_0x163597[_0x6fad('0x33')],qs['fields'](_0x368532[_0x6fad('0x34')][_0x6fad('0x38')]));_0x3d31a8[_0x6fad('0x37')]=_0x3d31a8[_0x6fad('0x37')][_0x6fad('0x39')]?_0x3d31a8[_0x6fad('0x37')]:_0x163597['model'];if(!_0x368532['query']['hasOwnProperty'](_0x6fad('0x3a'))){_0x3d31a8['limit']=qs[_0x6fad('0x24')](_0x368532['query'][_0x6fad('0x24')]);_0x3d31a8[_0x6fad('0x26')]=qs['offset'](_0x368532[_0x6fad('0x34')]['offset']);}_0x3d31a8[_0x6fad('0x5f')]=qs['sort'](_0x368532[_0x6fad('0x34')]['sort']);_0x3d31a8[_0x6fad('0x3c')]=qs['filters'](_[_0x6fad('0x3e')](_0x368532[_0x6fad('0x34')],_0x163597['filters']));_0x3d31a8[_0x6fad('0x3c')][_0x6fad('0x54')]=_0x495efd['id'];if(_0x368532[_0x6fad('0x34')][_0x6fad('0x3f')]){_0x3d31a8['where']=_['merge'](_0x3d31a8[_0x6fad('0x3c')],{'$or':_[_0x6fad('0x30')](_0x3d31a8['attributes'],function(_0x12e910){var _0x4dccc4={};_0x4dccc4[_0x12e910]={'$like':'%'+_0x368532['query']['filter']+'%'};return _0x4dccc4;})});}_0x3d31a8=_[_0x6fad('0x40')]({},_0x3d31a8,_0x368532['options']);return db[_0x6fad('0xab')][_0x6fad('0x25')]({'where':_0x3d31a8['where']})[_0x6fad('0x14')](function(_0x5afa70){_0x4542a3['count']=_0x5afa70;if(_0x368532['query'][_0x6fad('0x47')]){_0x3d31a8[_0x6fad('0x43')]=[{'model':db[_0x6fad('0x96')],'as':_0x6fad('0xeb'),'required':![]},{'model':db[_0x6fad('0xb7')],'as':_0x6fad('0xec'),'attributes':[_0x6fad('0x2c'),_0x6fad('0xed'),_0x6fad('0xee')],'required':![]},{'model':db[_0x6fad('0xef')],'as':_0x6fad('0xf0'),'attributes':['id',_0x6fad('0x2c'),_0x6fad('0xf1')],'where':_0x368532[_0x6fad('0x34')][_0x6fad('0xf2')]?{'id':_0x368532[_0x6fad('0x34')]['tag']}:undefined,'required':_0x368532[_0x6fad('0x34')]['tag']?!![]:![]}];}return db[_0x6fad('0xab')]['findAll'](_0x3d31a8);})[_0x6fad('0x14')](function(_0x29ad22){_0x4542a3[_0x6fad('0x44')]=_0x29ad22;return _0x4542a3;});}})['then'](respondWithFilteredResult(_0x430987,_0x3d31a8))['catch'](handleError(_0x430987,null));};function iftimePromise(_0x222fa8,_0xea459f){return respondWithRpcPromise(_0x6fad('0xf3'),'getSnippet',{'command':_0xea459f['timezone']?util[_0x6fad('0xa8')](_0x6fad('0xf4'),_0x222fa8[_0x6fad('0xf5')],_0xea459f['timezone']):util['format']('iftime\x20%s',_0x222fa8['interval'])},client9002)[_0x6fad('0x14')](function(_0x3333f4){var _0x335651=_0x3333f4&&_0x3333f4[_0x6fad('0xf6')]('true')>=0x0?!![]:![];logger['info'](_0x6fad('0xf7'),_0xea459f['id'],_0x222fa8['id'],_0x222fa8[_0x6fad('0xf5')],_0x335651?_0x6fad('0xf8'):_0x6fad('0xf9'),_0xea459f['timezone']?_0xea459f[_0x6fad('0xfa')]:'No\x20timezone');return _0x335651;})[_0x6fad('0x1f')](function(_0x25f4bf){logger[_0x6fad('0x1a')](_0x6fad('0xf7'),_0xea459f['id'],_0x222fa8['id'],_0x222fa8[_0x6fad('0xf5')],util[_0x6fad('0xfb')](_0x25f4bf,{'showHidden':![],'depth':null}),_0xea459f[_0x6fad('0xfa')]?_0xea459f[_0x6fad('0xfa')]:_0x6fad('0xfc'));return![];});}exports['getSnippet']=function(_0x556ea0,_0x168ae9){var _0x2bcd99=0x0;var _0x1a05aa=0x0;var _0x4a62cb=![];var _0x1e44a0;var _0x2797dd;return db['ChatWebsite']['find']({'where':{'id':_0x556ea0[_0x6fad('0x46')]['id']},'include':[{'model':db['Interval'],'as':_0x6fad('0xfd'),'include':[{'model':db[_0x6fad('0xfd')],'as':_0x6fad('0xfe'),'attributes':['id',_0x6fad('0xf5')],'raw':!![]}]}]})[_0x6fad('0x14')](handleEntityNotFound(_0x168ae9,null))[_0x6fad('0x14')](function(_0x5c02e0){if(_0x5c02e0){_0x1e44a0=_0x5c02e0;return _0x5c02e0[_0x6fad('0xff')]({'raw':!![]});}})[_0x6fad('0x14')](function(_0x4cf45e){if(_0x1e44a0){if(_0x4cf45e){_0x2797dd=_0x4cf45e;}}return require(_0x6fad('0x6d'))[_0x6fad('0x6e')]();})['then'](function(_0xb5db8a){if(_0xb5db8a){_0x1a05aa=_0xb5db8a[_0x6fad('0x100')];_0x4a62cb=_0xb5db8a[_0x6fad('0x6f')];}})[_0x6fad('0x14')](function(){return db[_0x6fad('0xab')][_0x6fad('0x25')]({'where':{'closed':![]}});})[_0x6fad('0x14')](function(_0x7245a5){_0x2bcd99=_0x7245a5;if(_0x1a05aa&&_0x7245a5>_0x1a05aa){return db[_0x6fad('0x101')][_0x6fad('0x5d')]({'where':{'id':0x1}})[_0x6fad('0x14')](function(_0x4d3bdf){if(_0x4d3bdf){_0x4d3bdf[_0x6fad('0x102')](_0x6fad('0x103'));}});}})[_0x6fad('0x14')](function(){if(_0x1e44a0[_0x6fad('0xfd')]&&_0x1e44a0[_0x6fad('0xfd')][_0x6fad('0xfe')]){var _0x5712df=[];for(var _0x4f410c=0x0;_0x4f410c<_0x1e44a0['Interval'][_0x6fad('0xfe')][_0x6fad('0x39')];_0x4f410c++){var _0x4cefb7=_0x1e44a0[_0x6fad('0xfd')][_0x6fad('0xfe')][_0x4f410c][_0x6fad('0x28')]({'plain':!![]});_0x5712df['push'](iftimePromise(_0x4cefb7,_0x1e44a0));}return BPromise[_0x6fad('0x104')](_0x5712df)[_0x6fad('0x14')](function(_0x39dbaf){return _[_0x6fad('0x105')](_0x39dbaf);});}else{return!![];}})[_0x6fad('0x14')](function(_0x8ba65a){var _0x3ffa43=fs['readFileSync'](path['join'](config['root'],_0x6fad('0x106')),'utf8');var _0x51ed27={'remote':_0x1e44a0[_0x6fad('0x107')],'query':querystring['stringify'](_[_0x6fad('0x40')](_0x1e44a0[_0x6fad('0x28')]({'plain':!![]}),{'customerIp':_0x556ea0[_0x6fad('0x99')][_0x6fad('0x9b')]||_0x556ea0[_0x6fad('0x99')]['x-real-ip']||_0x556ea0[_0x6fad('0x108')][_0x6fad('0x109')]||_0x556ea0['ip'],'referer':_0x556ea0[_0x6fad('0x99')][_0x6fad('0xa1')],'openedInteractions':_0x2bcd99,'maxInteractions':_0x1a05aa,'virtual':_0x4a62cb[_0x6fad('0x100')],'online':_0x8ba65a,'custom':_0x4a62cb}))[_0x6fad('0x10a')](/'/g,'\x5c\x27')};_0x168ae9[_0x6fad('0x2d')](ejs[_0x6fad('0xc9')](Mustache[_0x6fad('0xc9')](_0x3ffa43,_0x51ed27),{'proactiveActions':_0x2797dd,'alignment':_0x1e44a0[_0x6fad('0x10b')],'verticalAlignment':_0x1e44a0['verticalAlignment'],'div_color':_0x1e44a0['color'],'text_color':_0x1e44a0[_0x6fad('0x10c')],'button_color':_0x1e44a0[_0x6fad('0x10d')],'background_color':_0x1e44a0['backgroundColor']}));})[_0x6fad('0x1f')](handleError(_0x168ae9,null));};exports['addApplications']=function(_0x5da190,_0x15ff06){var _0x1dfa52=_0x5da190[_0x6fad('0x46')]['id'];var _0x4232f8=_0x5da190[_0x6fad('0x51')];var _0x42fe6b=0xc8;var _0x4edb83=null;return db['sequelize'][_0x6fad('0x10e')]({'isolationLevel':db[_0x6fad('0x10f')]['Transaction'][_0x6fad('0x110')][_0x6fad('0x111')]},function(_0xb2fb39){return db['ChatWebsite'][_0x6fad('0x5d')]({'where':{'id':_0x1dfa52},'transaction':_0xb2fb39})[_0x6fad('0x14')](function(_0x1968e7){if(_0x1968e7){return db['ChatApplication'][_0x6fad('0x27')]({'where':{'ChatWebsiteId':_0x1dfa52},'transaction':_0xb2fb39})[_0x6fad('0x14')](function(){var _0x375051=_[_0x6fad('0x30')](_0x4232f8,function(_0x36a7cf){_0x36a7cf['ChatWebsiteId']=_0x1dfa52;return _0x36a7cf;});return db[_0x6fad('0x8e')][_0x6fad('0xd1')](_0x375051,{'transaction':_0xb2fb39});});}else{_0x42fe6b=0x194;_0x4edb83=[];}});})[_0x6fad('0x14')](function(){if(_0x42fe6b!==0x194){return db[_0x6fad('0x8e')][_0x6fad('0x112')]({'where':{'ChatWebsiteId':_0x1dfa52},'order':'priority'})[_0x6fad('0x14')](function(_0x49c51d){_0x4edb83=_0x49c51d;});}})[_0x6fad('0x1f')](function(_0x34abd5){_0x42fe6b=0x1f4;logger[_0x6fad('0x1a')](_0x34abd5[_0x6fad('0x2b')]);if(_0x34abd5[_0x6fad('0x2c')]){delete _0x34abd5[_0x6fad('0x2c')];}_0x4edb83=_0x34abd5;})[_0x6fad('0x113')](function(){if(_0x4edb83===null){_0x15ff06[_0x6fad('0x114')](_0x42fe6b);}else{if(_0x42fe6b===0x1f4){_0x15ff06[_0x6fad('0x20')](_0x42fe6b)[_0x6fad('0x2d')](_0x4edb83);}else{_0x15ff06[_0x6fad('0x20')](_0x42fe6b)['json'](_0x4edb83);}}});};exports[_0x6fad('0x115')]=function(_0x3808b9,_0x1b1a0f){var _0x387a90={};var _0x38f262={};var _0x292bab;var _0xb27dd0;return db[_0x6fad('0x42')][_0x6fad('0x5d')]({'where':{'id':_0x3808b9[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x1b1a0f,null))[_0x6fad('0x14')](function(_0x1a1894){if(_0x1a1894){_0x292bab=_0x1a1894;_0x38f262[_0x6fad('0x33')]=_[_0x6fad('0x35')](db[_0x6fad('0x8e')][_0x6fad('0x57')]);_0x38f262[_0x6fad('0x34')]=_[_0x6fad('0x35')](_0x3808b9['query']);_0x38f262[_0x6fad('0x3d')]=_['intersection'](_0x38f262[_0x6fad('0x33')],_0x38f262[_0x6fad('0x34')]);_0x387a90['attributes']=_[_0x6fad('0x36')](_0x38f262[_0x6fad('0x33')],qs['fields'](_0x3808b9[_0x6fad('0x34')][_0x6fad('0x38')]));_0x387a90['attributes']=_0x387a90[_0x6fad('0x37')][_0x6fad('0x39')]?_0x387a90[_0x6fad('0x37')]:_0x38f262[_0x6fad('0x33')];_0x387a90[_0x6fad('0x5f')]=qs[_0x6fad('0x3b')](_0x3808b9[_0x6fad('0x34')][_0x6fad('0x3b')]);_0x387a90['where']=qs[_0x6fad('0x3d')](_[_0x6fad('0x3e')](_0x3808b9[_0x6fad('0x34')],_0x38f262[_0x6fad('0x3d')]));if(_0x3808b9[_0x6fad('0x34')][_0x6fad('0x3f')]){_0x387a90[_0x6fad('0x3c')]=_[_0x6fad('0x40')](_0x387a90[_0x6fad('0x3c')],{'$or':_[_0x6fad('0x30')](_0x387a90[_0x6fad('0x37')],function(_0x9df242){var _0x282eeb={};_0x282eeb[_0x9df242]={'$like':'%'+_0x3808b9[_0x6fad('0x34')]['filter']+'%'};return _0x282eeb;})});}_0x387a90=_[_0x6fad('0x40')]({},_0x387a90,_0x3808b9['options']);return _0x292bab[_0x6fad('0x115')](_0x387a90);}})[_0x6fad('0x14')](function(_0x56f6e9){if(_0x56f6e9){_0xb27dd0=_0x56f6e9[_0x6fad('0x39')];if(!_0x3808b9[_0x6fad('0x34')][_0x6fad('0x5e')](_0x6fad('0x3a'))){_0x387a90[_0x6fad('0x24')]=qs[_0x6fad('0x24')](_0x3808b9['query'][_0x6fad('0x24')]);_0x387a90['offset']=qs['offset'](_0x3808b9['query'][_0x6fad('0x26')]);}return _0x292bab[_0x6fad('0x115')](_0x387a90);}})['then'](function(_0x27f69b){if(_0x27f69b){return _0x27f69b?{'count':_0xb27dd0,'rows':_0x27f69b}:null;}})[_0x6fad('0x14')](respondWithResult(_0x1b1a0f,null))[_0x6fad('0x1f')](handleError(_0x1b1a0f,null));};exports[_0x6fad('0x116')]=function(_0xeaee1,_0x11edf0){return db[_0x6fad('0x117')][_0x6fad('0x4c')]({'where':{'id':_0xeaee1[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x11edf0,null))[_0x6fad('0x14')](function(_0x166962){if(_0x166962){return _0x166962['addProactiveActions'](_0xeaee1[_0x6fad('0x51')][_0x6fad('0x5a')],_[_0x6fad('0xe9')](_0xeaee1['body'],[_0x6fad('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x11edf0,null))[_0x6fad('0x1f')](handleError(_0x11edf0,null));};exports['getProactiveActions']=function(_0x247d51,_0x189e7b){var _0x1819a2={};var _0x5c8f47={};var _0x45596a;var _0xa9da0d;return db[_0x6fad('0x42')][_0x6fad('0x5d')]({'where':{'id':_0x247d51[_0x6fad('0x46')]['id']}})['then'](handleEntityNotFound(_0x189e7b,null))[_0x6fad('0x14')](function(_0xdd896a){if(_0xdd896a){_0x45596a=_0xdd896a;_0x5c8f47[_0x6fad('0x33')]=_[_0x6fad('0x35')](db[_0x6fad('0x118')][_0x6fad('0x57')]);_0x5c8f47[_0x6fad('0x34')]=_[_0x6fad('0x35')](_0x247d51[_0x6fad('0x34')]);_0x5c8f47[_0x6fad('0x3d')]=_[_0x6fad('0x36')](_0x5c8f47[_0x6fad('0x33')],_0x5c8f47['query']);_0x1819a2['attributes']=_[_0x6fad('0x36')](_0x5c8f47['model'],qs['fields'](_0x247d51['query'][_0x6fad('0x38')]));_0x1819a2[_0x6fad('0x37')]=_0x1819a2['attributes'][_0x6fad('0x39')]?_0x1819a2[_0x6fad('0x37')]:_0x5c8f47['model'];_0x1819a2[_0x6fad('0x5f')]=qs[_0x6fad('0x3b')](_0x247d51['query'][_0x6fad('0x3b')]);_0x1819a2[_0x6fad('0x3c')]=qs['filters'](_['pick'](_0x247d51[_0x6fad('0x34')],_0x5c8f47['filters']));if(_0x247d51[_0x6fad('0x34')][_0x6fad('0x3f')]){_0x1819a2[_0x6fad('0x3c')]=_['merge'](_0x1819a2[_0x6fad('0x3c')],{'$or':_[_0x6fad('0x30')](_0x1819a2[_0x6fad('0x37')],function(_0x528a1c){var _0x481a86={};_0x481a86[_0x528a1c]={'$like':'%'+_0x247d51[_0x6fad('0x34')]['filter']+'%'};return _0x481a86;})});}_0x1819a2=_[_0x6fad('0x40')]({},_0x1819a2,_0x247d51[_0x6fad('0x41')]);return _0x45596a[_0x6fad('0xff')](_0x1819a2);}})[_0x6fad('0x14')](function(_0x16b099){if(_0x16b099){_0xa9da0d=_0x16b099[_0x6fad('0x39')];if(!_0x247d51[_0x6fad('0x34')][_0x6fad('0x5e')](_0x6fad('0x3a'))){_0x1819a2['limit']=qs[_0x6fad('0x24')](_0x247d51[_0x6fad('0x34')][_0x6fad('0x24')]);_0x1819a2['offset']=qs[_0x6fad('0x26')](_0x247d51[_0x6fad('0x34')][_0x6fad('0x26')]);}return _0x45596a['getProactiveActions'](_0x1819a2);}})[_0x6fad('0x14')](function(_0x13a0a7){if(_0x13a0a7){return _0x13a0a7?{'count':_0xa9da0d,'rows':_0x13a0a7}:null;}})[_0x6fad('0x14')](respondWithResult(_0x189e7b,null))[_0x6fad('0x1f')](handleError(_0x189e7b,null));};exports[_0x6fad('0x119')]=function(_0x1dec96,_0x57f8c9){var _0x4caca8=_0x1dec96[_0x6fad('0x34')][_0x6fad('0x11a')]===_0x6fad('0x11b')?'offlineForm':_0x6fad('0x11c');return db[_0x6fad('0x42')][_0x6fad('0x4c')]({'attributes':['id',_0x4caca8],'where':{'id':_0x1dec96[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x57f8c9,null))[_0x6fad('0x14')](function(_0x449f9c){if(_0x449f9c){var _0x2aaaad=_0x449f9c[_0x4caca8];var _0x297c24=_0x2aaaad&&_0x2aaaad[_0x6fad('0x11d')]?_0x2aaaad[_0x6fad('0x11d')]:[];_0x57f8c9[_0x6fad('0x2d')]({'fromKey':_[_0x6fad('0x70')](_0x2aaaad[_0x6fad('0x11e')])?undefined:_0x2aaaad['fromKey'],'count':_0x297c24['length'],'rows':_0x297c24});}})[_0x6fad('0x1f')](handleError(_0x57f8c9,null));};exports[_0x6fad('0x11f')]=function(_0x2878a0,_0x3bc484){var _0x529d48={'raw':![],'where':{}};var _0x50f963={};var _0x28e314={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6fad('0x5d')]({'where':{'id':_0x2878a0[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x3bc484,null))[_0x6fad('0x14')](function(_0x5b7adf){if(_0x5b7adf){_0x50f963[_0x6fad('0x33')]=_[_0x6fad('0x35')](db[_0x6fad('0x120')][_0x6fad('0x57')]);_0x50f963[_0x6fad('0x34')]=_[_0x6fad('0x35')](_0x2878a0[_0x6fad('0x34')]);_0x50f963[_0x6fad('0x3d')]=_[_0x6fad('0x36')](_0x50f963['model'],_0x50f963[_0x6fad('0x34')]);_0x529d48[_0x6fad('0x37')]=_[_0x6fad('0x36')](_0x50f963[_0x6fad('0x33')],qs[_0x6fad('0x38')](_0x2878a0[_0x6fad('0x34')]['fields']));_0x529d48['attributes']=_0x529d48[_0x6fad('0x37')]['length']?_0x529d48[_0x6fad('0x37')]:_0x50f963['model'];if(!_0x2878a0['query'][_0x6fad('0x5e')](_0x6fad('0x3a'))){_0x529d48[_0x6fad('0x24')]=qs[_0x6fad('0x24')](_0x2878a0[_0x6fad('0x34')][_0x6fad('0x24')]);_0x529d48['offset']=qs[_0x6fad('0x26')](_0x2878a0[_0x6fad('0x34')][_0x6fad('0x26')]);}_0x529d48['order']=qs[_0x6fad('0x3b')](_0x2878a0[_0x6fad('0x34')][_0x6fad('0x3b')]);_0x529d48[_0x6fad('0x3c')]=qs[_0x6fad('0x3d')](_[_0x6fad('0x3e')](_0x2878a0[_0x6fad('0x34')],_0x50f963[_0x6fad('0x3d')]));_0x529d48[_0x6fad('0x3c')][_0x6fad('0x54')]=_0x5b7adf['id'];if(_0x2878a0[_0x6fad('0x34')][_0x6fad('0x3f')]){_0x529d48[_0x6fad('0x3c')]=_['merge'](_0x529d48[_0x6fad('0x3c')],{'$or':_[_0x6fad('0x30')](_0x529d48[_0x6fad('0x37')],function(_0x36054e){var _0x5093ae={};_0x5093ae[_0x36054e]={'$like':'%'+_0x2878a0[_0x6fad('0x34')][_0x6fad('0x3f')]+'%'};return _0x5093ae;})});}_0x529d48=_[_0x6fad('0x40')]({},_0x529d48,_0x2878a0[_0x6fad('0x41')]);return db[_0x6fad('0x120')][_0x6fad('0x25')]({'where':_0x529d48['where']})[_0x6fad('0x14')](function(_0x2abf21){_0x28e314[_0x6fad('0x25')]=_0x2abf21;if(_0x2878a0[_0x6fad('0x34')][_0x6fad('0x47')]){_0x529d48['include']=[{'all':!![]}];}else{_0x529d48[_0x6fad('0x43')]=[{'model':db[_0x6fad('0x96')],'as':_0x6fad('0xeb'),'required':![]},{'model':db[_0x6fad('0x121')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x529d48);})[_0x6fad('0x14')](function(_0x216db7){_0x28e314[_0x6fad('0x44')]=_0x216db7;return _0x28e314;});}})[_0x6fad('0x14')](respondWithFilteredResult(_0x3bc484,_0x529d48))[_0x6fad('0x1f')](handleError(_0x3bc484,null));};exports[_0x6fad('0x122')]=function(_0x4bae06,_0x1eafdb){return db['ChatWebsite'][_0x6fad('0x4c')]({'where':{'id':_0x4bae06['params']['id']}})['then'](handleEntityNotFound(_0x1eafdb,null))[_0x6fad('0x14')](function(_0x36ace9){if(_0x36ace9){return _0x36ace9[_0x6fad('0x122')](_0x4bae06[_0x6fad('0x51')][_0x6fad('0x5a')],_['omit'](_0x4bae06[_0x6fad('0x51')],[_0x6fad('0x5a'),'id'])||{})[_0x6fad('0xaf')](function(_0xf36e4e){for(var _0x169f81=0x0;_0x169f81<_0x4bae06[_0x6fad('0x51')][_0x6fad('0x5a')][_0x6fad('0x39')];_0x169f81+=0x1){socket[_0x6fad('0x123')](_0x6fad('0x124'),{'UserId':Number(_0x4bae06[_0x6fad('0x51')][_0x6fad('0x5a')][_0x169f81]),'ChatWebsiteId':Number(_0x4bae06['params']['id'])});}return _0xf36e4e;});}})[_0x6fad('0x14')](respondWithResult(_0x1eafdb,null))['catch'](handleError(_0x1eafdb,null));};exports[_0x6fad('0x125')]=function(_0x181970,_0x2171ea){return db['ChatWebsite'][_0x6fad('0x4c')]({'where':{'id':_0x181970['params']['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x2171ea,null))[_0x6fad('0x14')](function(_0x2391e2){if(_0x2391e2){return _0x2391e2[_0x6fad('0x125')](_0x181970[_0x6fad('0x34')][_0x6fad('0x5a')])[_0x6fad('0x14')](function(){if(_[_0x6fad('0x126')](_0x181970[_0x6fad('0x34')][_0x6fad('0x5a')])){for(var _0xc75eb1=0x0;_0xc75eb1<_0x181970[_0x6fad('0x34')]['ids'][_0x6fad('0x39')];_0xc75eb1+=0x1){socket[_0x6fad('0x123')](_0x6fad('0x127'),{'UserId':Number(_0x181970[_0x6fad('0x34')][_0x6fad('0x5a')][_0xc75eb1]),'ChatWebsiteId':Number(_0x181970[_0x6fad('0x46')]['id'])});}}else{socket[_0x6fad('0x123')](_0x6fad('0x127'),{'UserId':Number(_0x181970[_0x6fad('0x34')]['ids']),'ChatWebsiteId':Number(_0x181970[_0x6fad('0x46')]['id'])});}});}})[_0x6fad('0x14')](respondWithStatusCode(_0x2171ea,null))['catch'](handleError(_0x2171ea,null));};exports['getAgents']=function(_0x44d62e,_0x85a5a3){var _0x20c678={};var _0x187d17={};var _0x58891d;var _0x111bbb;return db[_0x6fad('0x42')][_0x6fad('0x5d')]({'where':{'id':_0x44d62e[_0x6fad('0x46')]['id']}})[_0x6fad('0x14')](handleEntityNotFound(_0x85a5a3,null))[_0x6fad('0x14')](function(_0x3cf64b){if(_0x3cf64b){_0x58891d=_0x3cf64b;_0x187d17[_0x6fad('0x33')]=_['keys'](db['User'][_0x6fad('0x57')]);_0x187d17[_0x6fad('0x34')]=_[_0x6fad('0x35')](_0x44d62e[_0x6fad('0x34')]);_0x187d17[_0x6fad('0x3d')]=_['intersection'](_0x187d17[_0x6fad('0x33')],_0x187d17['query']);_0x20c678[_0x6fad('0x37')]=_[_0x6fad('0x36')](_0x187d17[_0x6fad('0x33')],qs['fields'](_0x44d62e[_0x6fad('0x34')][_0x6fad('0x38')]));_0x20c678[_0x6fad('0x37')]=_0x20c678[_0x6fad('0x37')][_0x6fad('0x39')]?_0x20c678[_0x6fad('0x37')]:_0x187d17[_0x6fad('0x33')];_0x20c678['order']=qs[_0x6fad('0x3b')](_0x44d62e[_0x6fad('0x34')]['sort']);_0x20c678[_0x6fad('0x3c')]=qs['filters'](_[_0x6fad('0x3e')](_0x44d62e[_0x6fad('0x34')],_0x187d17[_0x6fad('0x3d')]));if(_0x44d62e[_0x6fad('0x34')]['filter']){_0x20c678[_0x6fad('0x3c')]=_[_0x6fad('0x40')](_0x20c678[_0x6fad('0x3c')],{'$or':_[_0x6fad('0x30')](_0x20c678[_0x6fad('0x37')],function(_0x243dad){var _0x468bbe={};_0x468bbe[_0x243dad]={'$like':'%'+_0x44d62e[_0x6fad('0x34')]['filter']+'%'};return _0x468bbe;})});}_0x20c678=_[_0x6fad('0x40')]({},_0x20c678,_0x44d62e[_0x6fad('0x41')]);return _0x58891d['getAgents'](_0x20c678);}})[_0x6fad('0x14')](function(_0x5016b5){if(_0x5016b5){_0x111bbb=_0x5016b5[_0x6fad('0x39')];if(!_0x44d62e['query'][_0x6fad('0x5e')](_0x6fad('0x3a'))){_0x20c678[_0x6fad('0x24')]=qs[_0x6fad('0x24')](_0x44d62e['query'][_0x6fad('0x24')]);_0x20c678[_0x6fad('0x26')]=qs[_0x6fad('0x26')](_0x44d62e[_0x6fad('0x34')]['offset']);}return _0x58891d[_0x6fad('0x128')](_0x20c678);}})[_0x6fad('0x14')](function(_0x51d15d){if(_0x51d15d){return _0x51d15d?{'count':_0x111bbb,'rows':_0x51d15d}:null;}})[_0x6fad('0x14')](respondWithResult(_0x85a5a3,null))[_0x6fad('0x1f')](handleError(_0x85a5a3,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 349560d..55fc87b 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 _0xec46=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xec46,0x19c));var _0x6ec4=function(_0x4f240d,_0x13a89a){_0x4f240d=_0x4f240d-0x0;var _0x5b92cc=_0xec46[_0x4f240d];return _0x5b92cc;};'use strict';var EventEmitter=require(_0x6ec4('0x0'));var ChatWebsite=require(_0x6ec4('0x1'))['db'][_0x6ec4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6ec4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6ec4('0x4')};function emitEvent(_0x157723){return function(_0x86b9f8,_0x53bbed,_0x3471fa){ChatWebsiteEvents[_0x6ec4('0x5')](_0x157723+':'+_0x86b9f8['id'],_0x86b9f8);ChatWebsiteEvents['emit'](_0x157723,_0x86b9f8);_0x3471fa(null);};}for(var e in events){if(events[_0x6ec4('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x6ec4('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe3c5=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xe3c5[_0x45fc6a];return _0x14bcfd;};'use strict';var EventEmitter=require(_0x5e3c('0x0'));var ChatWebsite=require(_0x5e3c('0x1'))['db'][_0x5e3c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5e3c('0x3')](0x0);var events={'afterCreate':_0x5e3c('0x4'),'afterUpdate':_0x5e3c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46e129){return function(_0x2ef6cd,_0x361936,_0x2a7d7a){ChatWebsiteEvents[_0x5e3c('0x6')](_0x46e129+':'+_0x2ef6cd['id'],_0x2ef6cd);ChatWebsiteEvents[_0x5e3c('0x6')](_0x46e129,_0x2ef6cd);_0x2a7d7a(null);};}for(var e in events){if(events[_0x5e3c('0x7')](e)){var event=events[e];ChatWebsite[_0x5e3c('0x8')](e,emitEvent(event));}}module[_0x5e3c('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9c38850..c3d1c91 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 _0xfc06=['chat_websites','lodash','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x26425a,_0x1b4d6f){var _0x12802a=function(_0x5db8a7){while(--_0x5db8a7){_0x26425a['push'](_0x26425a['shift']());}};_0x12802a(++_0x1b4d6f);}(_0xfc06,0x121));var _0x6fc0=function(_0x8bb9c8,_0x4be05e){_0x8bb9c8=_0x8bb9c8-0x0;var _0x38258f=_0xfc06[_0x8bb9c8];return _0x38258f;};'use strict';var _=require(_0x6fc0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6fc0('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6fc0('0x2'));var config=require(_0x6fc0('0x3'));var attributes=require(_0x6fc0('0x4'));module[_0x6fc0('0x5')]=function(_0x3bc8da,_0x4f8f80){return _0x3bc8da[_0x6fc0('0x6')](_0x6fc0('0x7'),attributes,{'tableName':_0x6fc0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43d5=['rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x43d5,0xfd));var _0x543d=function(_0x235e0f,_0x349081){_0x235e0f=_0x235e0f-0x0;var _0x15c4e0=_0x43d5[_0x235e0f];return _0x15c4e0;};'use strict';var _=require('lodash');var util=require(_0x543d('0x0'));var logger=require(_0x543d('0x1'))(_0x543d('0x2'));var moment=require(_0x543d('0x3'));var BPromise=require(_0x543d('0x4'));var rp=require(_0x543d('0x5'));var fs=require('fs');var path=require(_0x543d('0x6'));var rimraf=require(_0x543d('0x7'));var config=require(_0x543d('0x8'));var attributes=require(_0x543d('0x9'));module[_0x543d('0xa')]=function(_0x92eadd,_0x1a5255){return _0x92eadd['define'](_0x543d('0xb'),attributes,{'tableName':_0x543d('0xc'),'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 26390b9..1eccc72 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 _0xc57e=['ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5cfcc1,_0x418717){var _0x76fa4c=function(_0x4fc5c1){while(--_0x4fc5c1){_0x5cfcc1['push'](_0x5cfcc1['shift']());}};_0x76fa4c(++_0x418717);}(_0xc57e,0x166));var _0xec57=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc57e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xec57('0x0'));var util=require(_0xec57('0x1'));var moment=require('moment');var BPromise=require(_0xec57('0x2'));var rs=require(_0xec57('0x3'));var fs=require('fs');var Redis=require(_0xec57('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec57('0x5'));var logger=require(_0xec57('0x6'))('rpc');var config=require(_0xec57('0x7'));var jayson=require(_0xec57('0x8'));var client=jayson['client'][_0xec57('0x9')]({'port':0x232a});config['redis']=_[_0xec57('0xa')](config[_0xec57('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xec57('0xc'))(new Redis(config[_0xec57('0xb')]));require(_0xec57('0xd'))[_0xec57('0xe')](socket);function respondWithRpcPromise(_0x38a69d,_0x5183bd,_0x380728){return new BPromise(function(_0x4901a8,_0x5139da){return client[_0xec57('0xf')](_0x38a69d,_0x380728)['then'](function(_0x29a15e){logger[_0xec57('0x10')](_0xec57('0x11'),_0x5183bd,_0xec57('0x12'));logger[_0xec57('0x13')](_0xec57('0x14'),_0x5183bd,_0xec57('0x12'),JSON[_0xec57('0x15')](_0x29a15e));if(_0x29a15e[_0xec57('0x16')]){if(_0x29a15e[_0xec57('0x16')][_0xec57('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5183bd,_0x29a15e[_0xec57('0x16')][_0xec57('0x18')]);return _0x5139da(_0x29a15e[_0xec57('0x16')][_0xec57('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5183bd,_0x29a15e[_0xec57('0x16')]['message']);return _0x4901a8(_0x29a15e['error']['message']);}else{logger[_0xec57('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5183bd,_0xec57('0x12'));_0x4901a8(_0x29a15e[_0xec57('0x19')]['message']);}})[_0xec57('0x1a')](function(_0x422d20){logger['error'](_0xec57('0x11'),_0x5183bd,_0x422d20);_0x5139da(_0x422d20);});});}
\ No newline at end of file
+var _0x98b6=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s'];(function(_0x49ac16,_0x601534){var _0x3900b2=function(_0x29b93b){while(--_0x29b93b){_0x49ac16['push'](_0x49ac16['shift']());}};_0x3900b2(++_0x601534);}(_0x98b6,0x17c));var _0x698b=function(_0x2b22c0,_0x4cb8f8){_0x2b22c0=_0x2b22c0-0x0;var _0x45c8ef=_0x98b6[_0x2b22c0];return _0x45c8ef;};'use strict';var _=require(_0x698b('0x0'));var util=require(_0x698b('0x1'));var moment=require(_0x698b('0x2'));var BPromise=require(_0x698b('0x3'));var rs=require(_0x698b('0x4'));var fs=require('fs');var Redis=require(_0x698b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x698b('0x6'))(_0x698b('0x7'));var config=require(_0x698b('0x8'));var jayson=require(_0x698b('0x9'));var client=jayson[_0x698b('0xa')][_0x698b('0xb')]({'port':0x232a});config[_0x698b('0xc')]=_[_0x698b('0xd')](config[_0x698b('0xc')],{'host':_0x698b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x698b('0xc')]));require(_0x698b('0xf'))[_0x698b('0x10')](socket);function respondWithRpcPromise(_0x494e33,_0x1efd57,_0x4d22bb){return new BPromise(function(_0x34030b,_0x1316e8){return client[_0x698b('0x11')](_0x494e33,_0x4d22bb)[_0x698b('0x12')](function(_0x282233){logger[_0x698b('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1efd57,_0x698b('0x14'));logger[_0x698b('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1efd57,_0x698b('0x14'),JSON[_0x698b('0x16')](_0x282233));if(_0x282233[_0x698b('0x17')]){if(_0x282233[_0x698b('0x17')][_0x698b('0x18')]===0x1f4){logger[_0x698b('0x17')](_0x698b('0x19'),_0x1efd57,_0x282233[_0x698b('0x17')][_0x698b('0x1a')]);return _0x1316e8(_0x282233[_0x698b('0x17')][_0x698b('0x1a')]);}logger[_0x698b('0x17')](_0x698b('0x19'),_0x1efd57,_0x282233[_0x698b('0x17')][_0x698b('0x1a')]);return _0x34030b(_0x282233[_0x698b('0x17')][_0x698b('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1efd57,_0x698b('0x14'));_0x34030b(_0x282233[_0x698b('0x1b')][_0x698b('0x1a')]);}})[_0x698b('0x1c')](function(_0x39423b){logger['error'](_0x698b('0x19'),_0x1efd57,_0x39423b);_0x1316e8(_0x39423b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 68b907a..226057e 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 _0x8be6=['update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x46ff04,_0x33b46c){var _0x49f22e=function(_0x465a74){while(--_0x465a74){_0x46ff04['push'](_0x46ff04['shift']());}};_0x49f22e(++_0x33b46c);}(_0x8be6,0xce));var _0x68be=function(_0x267893,_0x48b955){_0x267893=_0x267893-0x0;var _0x13612d=_0x8be6[_0x267893];return _0x13612d;};'use strict';var ChatWebsiteEvents=require(_0x68be('0x0'));var events=['save',_0x68be('0x1'),_0x68be('0x2')];function createListener(_0x5c8571,_0x5ad6a2){return function(_0x302514){_0x5ad6a2[_0x68be('0x3')](_0x5c8571,_0x302514);};}function removeListener(_0x354b6,_0x597132){return function(){ChatWebsiteEvents[_0x68be('0x4')](_0x354b6,_0x597132);};}exports[_0x68be('0x5')]=function(_0x5942ff){for(var _0x29becc=0x0,_0x2a8973=events[_0x68be('0x6')];_0x29becc<_0x2a8973;_0x29becc++){var _0x792a8d=events[_0x29becc];var _0x5568ef=createListener(_0x68be('0x7')+_0x792a8d,_0x5942ff);ChatWebsiteEvents['on'](_0x792a8d,_0x5568ef);}};
\ No newline at end of file
+var _0x4f25=['register','length','chatWebsite:','./chatWebsite.events','save','remove','emit'];(function(_0x290dde,_0x367a7e){var _0x398837=function(_0x31d32e){while(--_0x31d32e){_0x290dde['push'](_0x290dde['shift']());}};_0x398837(++_0x367a7e);}(_0x4f25,0x11b));var _0x54f2=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0x4f25[_0x13342f];return _0x2fc1fc;};'use strict';var ChatWebsiteEvents=require(_0x54f2('0x0'));var events=[_0x54f2('0x1'),_0x54f2('0x2'),'update'];function createListener(_0x3193e1,_0x3a97ea){return function(_0x11413f){_0x3a97ea[_0x54f2('0x3')](_0x3193e1,_0x11413f);};}function removeListener(_0x3d7dae,_0x31a91f){return function(){ChatWebsiteEvents['removeListener'](_0x3d7dae,_0x31a91f);};}exports[_0x54f2('0x4')]=function(_0x4fd791){for(var _0x42bba7=0x0,_0x25a523=events[_0x54f2('0x5')];_0x42bba7<_0x25a523;_0x42bba7++){var _0x3e8905=events[_0x42bba7];var _0x29d2d1=createListener(_0x54f2('0x6')+_0x3e8905,_0x4fd791);ChatWebsiteEvents['on'](_0x3e8905,_0x29d2d1);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index ba6536a..1ec6361 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 _0xebb3=['./chatWebsite.controller','/describe','isAuthenticated','describe','/:id','get','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','join','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','addAvatar','diskStorage','root','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4ed5c1,_0x375104){var _0x174880=function(_0x1dda11){while(--_0x1dda11){_0x4ed5c1['push'](_0x4ed5c1['shift']());}};_0x174880(++_0x375104);}(_0xebb3,0xcb));var _0x3ebb=function(_0x31f0da,_0x2395a6){_0x31f0da=_0x31f0da-0x0;var _0x435567=_0xebb3[_0x31f0da];return _0x435567;};'use strict';var multer=require(_0x3ebb('0x0'));var util=require(_0x3ebb('0x1'));var path=require('path');var timeout=require(_0x3ebb('0x2'));var express=require(_0x3ebb('0x3'));var router=express[_0x3ebb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3ebb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3ebb('0x6'));var controller=require(_0x3ebb('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3ebb('0x8'),auth[_0x3ebb('0x9')](),controller[_0x3ebb('0xa')]);router['get'](_0x3ebb('0xb'),auth[_0x3ebb('0x9')](),controller['show']);router[_0x3ebb('0xc')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3ebb('0xd')]);router[_0x3ebb('0xc')](_0x3ebb('0xe'),auth[_0x3ebb('0x9')](),controller['getAnswers']);router[_0x3ebb('0xc')](_0x3ebb('0xf'),controller['getLogo']);router[_0x3ebb('0xc')](_0x3ebb('0x10'),controller[_0x3ebb('0x11')]);router[_0x3ebb('0xc')](_0x3ebb('0x12'),controller[_0x3ebb('0x13')]);router[_0x3ebb('0xc')](_0x3ebb('0x14'),controller[_0x3ebb('0x15')]);router[_0x3ebb('0xc')](_0x3ebb('0x16'),auth['isAuthenticated'](),controller[_0x3ebb('0x17')]);router[_0x3ebb('0xc')](_0x3ebb('0x18'),controller[_0x3ebb('0x19')]);router['get'](_0x3ebb('0x1a'),auth[_0x3ebb('0x9')](),controller['getApplications']);router[_0x3ebb('0xc')]('/:id/proactive_actions',auth[_0x3ebb('0x9')](),controller['getProactiveActions']);router[_0x3ebb('0xc')](_0x3ebb('0x1b'),controller[_0x3ebb('0x1c')]);router['get'](_0x3ebb('0x1d'),auth[_0x3ebb('0x9')](),controller['getOfflineMessages']);router[_0x3ebb('0xc')](_0x3ebb('0x1e'),auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x1f')]);router[_0x3ebb('0x20')]('/',auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x21')]);router[_0x3ebb('0x20')](_0x3ebb('0x22'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x3ebb('0x20')](_0x3ebb('0xe'),auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31f967,_0x2cb524,_0x5efdac){_0x5efdac(null,path[_0x3ebb('0x24')](config['root'],_0x3ebb('0x25')));},'filename':function(_0x28684e,_0x131b1f,_0x59a622){_0x59a622(null,util[_0x3ebb('0x26')](_0x3ebb('0x27'),Date[_0x3ebb('0x28')](),_0x131b1f[_0x3ebb('0x29')]));}})});router[_0x3ebb('0x20')]('/:id/logo',upload[_0x3ebb('0x2a')](_0x3ebb('0x2b')),controller[_0x3ebb('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x190f02,_0x352ce3,_0x232d48){_0x232d48(null,path[_0x3ebb('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x71095d,_0x45fc93,_0x308b8f){_0x308b8f(null,util[_0x3ebb('0x26')](_0x3ebb('0x27'),Date['now'](),_0x45fc93[_0x3ebb('0x29')]));}})});router[_0x3ebb('0x20')](_0x3ebb('0x10'),upload['single'](_0x3ebb('0x2b')),controller[_0x3ebb('0x2d')]);var upload=multer({'storage':multer[_0x3ebb('0x2e')]({'destination':function(_0x312081,_0x40a508,_0x1e778f){_0x1e778f(null,path[_0x3ebb('0x24')](config[_0x3ebb('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x419d07,_0x4d8ce6,_0x28e25f){_0x28e25f(null,util[_0x3ebb('0x26')](_0x3ebb('0x27'),Date[_0x3ebb('0x28')](),_0x4d8ce6[_0x3ebb('0x29')]));}})});router[_0x3ebb('0x20')](_0x3ebb('0x12'),upload['single'](_0x3ebb('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3ebb('0x2e')]({'destination':function(_0x2f3a08,_0x1c8fda,_0x5122fb){_0x5122fb(null,path[_0x3ebb('0x24')](config[_0x3ebb('0x2f')],_0x3ebb('0x30')));},'filename':function(_0xd34f47,_0x208498,_0x6f39e1){_0x6f39e1(null,util[_0x3ebb('0x26')](_0x3ebb('0x27'),Date[_0x3ebb('0x28')](),_0x208498[_0x3ebb('0x29')]));}})});router[_0x3ebb('0x20')](_0x3ebb('0x14'),upload[_0x3ebb('0x2a')](_0x3ebb('0x2b')),controller[_0x3ebb('0x31')]);router[_0x3ebb('0x20')](_0x3ebb('0x32'),controller[_0x3ebb('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x3ebb('0x2e')]({'destination':function(_0x1355db,_0x5c6efd,_0x3c7403){const _0x2a215e=path[_0x3ebb('0x24')](config[_0x3ebb('0x2f')],_0x3ebb('0x34'),'attachments',_0x3ebb('0x35'));fs_extra[_0x3ebb('0x36')](_0x2a215e,function(){_0x3c7403(null,_0x2a215e);});},'filename':function(_0x109724,_0x2955d4,_0x323425){const _0x19b151=_0x2955d4[_0x3ebb('0x29')][_0x3ebb('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4f98cf=path[_0x3ebb('0x38')](_0x19b151);const _0x242ce1=Date[_0x3ebb('0x28')]()+'-'+_0x19b151['replace'](_0x4f98cf,'')+_0x4f98cf;_0x323425(null,_0x242ce1);}})});router[_0x3ebb('0x20')](_0x3ebb('0x39'),offlineUploadMulter['any'](),controller[_0x3ebb('0x3a')]);router[_0x3ebb('0x20')](_0x3ebb('0x16'),auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x3b')]);router[_0x3ebb('0x20')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3ebb('0x3c')]);router[_0x3ebb('0x20')](_0x3ebb('0x3d'),auth['isAuthenticated'](),controller[_0x3ebb('0x3e')]);router[_0x3ebb('0x20')](_0x3ebb('0x1e'),auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x3f')]);router['put']('/:id',auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x40')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3ebb('0x41')]);router[_0x3ebb('0x42')]('/:id/dispositions',auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x43')]);router[_0x3ebb('0x42')]('/:id/canned_answers',auth[_0x3ebb('0x9')](),controller[_0x3ebb('0x44')]);router[_0x3ebb('0x42')](_0x3ebb('0x1e'),auth['isAuthenticated'](),controller[_0x3ebb('0x45')]);module['exports']=router;
\ No newline at end of file
+var _0x1e6f=['notify','server/files','attachments','replace','extname','any','offline','addInteraction','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','delete','destroy','removeAnswers','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','/:id/avatar','file','addAvatar','diskStorage','format','addCustomerAvatar','/:id/notify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e6f,0x16a));var _0xf1e6=function(_0xfcac4b,_0x51bad9){_0xfcac4b=_0xfcac4b-0x0;var _0x4d8306=_0x1e6f[_0xfcac4b];return _0x4d8306;};'use strict';var multer=require(_0xf1e6('0x0'));var util=require('util');var path=require(_0xf1e6('0x1'));var timeout=require(_0xf1e6('0x2'));var express=require(_0xf1e6('0x3'));var router=express['Router']();var fs_extra=require(_0xf1e6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf1e6('0x5'));var config=require(_0xf1e6('0x6'));var controller=require(_0xf1e6('0x7'));router[_0xf1e6('0x8')]('/',auth[_0xf1e6('0x9')](),controller[_0xf1e6('0xa')]);router[_0xf1e6('0x8')](_0xf1e6('0xb'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0xc')]);router[_0xf1e6('0x8')](_0xf1e6('0xd'),auth['isAuthenticated'](),controller[_0xf1e6('0xe')]);router[_0xf1e6('0x8')]('/:id/dispositions',auth[_0xf1e6('0x9')](),controller[_0xf1e6('0xf')]);router['get'](_0xf1e6('0x10'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x11')]);router[_0xf1e6('0x8')](_0xf1e6('0x12'),controller[_0xf1e6('0x13')]);router[_0xf1e6('0x8')]('/:id/avatar',controller['getAvatar']);router[_0xf1e6('0x8')](_0xf1e6('0x14'),controller[_0xf1e6('0x15')]);router['get'](_0xf1e6('0x16'),controller[_0xf1e6('0x17')]);router[_0xf1e6('0x8')](_0xf1e6('0x18'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x19')]);router[_0xf1e6('0x8')](_0xf1e6('0x1a'),controller['getSnippet']);router[_0xf1e6('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xf1e6('0x8')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xf1e6('0x8')]('/:id/fields',controller[_0xf1e6('0x1b')]);router[_0xf1e6('0x8')](_0xf1e6('0x1c'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x1d')]);router[_0xf1e6('0x8')]('/:id/users',auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x1e')]);router[_0xf1e6('0x1f')]('/',auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x20')]);router[_0xf1e6('0x1f')](_0xf1e6('0x21'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x22')]);router[_0xf1e6('0x1f')](_0xf1e6('0x10'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5603b3,_0x2933bb,_0x4a2cc9){_0x4a2cc9(null,path[_0xf1e6('0x24')](config[_0xf1e6('0x25')],_0xf1e6('0x26')));},'filename':function(_0x47710e,_0x124b06,_0x447faa){_0x447faa(null,util['format'](_0xf1e6('0x27'),Date[_0xf1e6('0x28')](),_0x124b06[_0xf1e6('0x29')]));}})});router[_0xf1e6('0x1f')]('/:id/logo',upload[_0xf1e6('0x2a')]('file'),controller[_0xf1e6('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x362b24,_0x191941,_0x513900){_0x513900(null,path['join'](config[_0xf1e6('0x25')],_0xf1e6('0x2c')));},'filename':function(_0x138b4a,_0x164550,_0x21454b){_0x21454b(null,util['format']('%s-%s',Date[_0xf1e6('0x28')](),_0x164550[_0xf1e6('0x29')]));}})});router[_0xf1e6('0x1f')](_0xf1e6('0x2d'),upload[_0xf1e6('0x2a')](_0xf1e6('0x2e')),controller[_0xf1e6('0x2f')]);var upload=multer({'storage':multer[_0xf1e6('0x30')]({'destination':function(_0x396f6b,_0xb74149,_0x3850e8){_0x3850e8(null,path[_0xf1e6('0x24')](config[_0xf1e6('0x25')],_0xf1e6('0x2c')));},'filename':function(_0x45b303,_0x16fd79,_0x441733){_0x441733(null,util[_0xf1e6('0x31')](_0xf1e6('0x27'),Date[_0xf1e6('0x28')](),_0x16fd79[_0xf1e6('0x29')]));}})});router['post'](_0xf1e6('0x14'),upload['single'](_0xf1e6('0x2e')),controller[_0xf1e6('0x32')]);var upload=multer({'storage':multer[_0xf1e6('0x30')]({'destination':function(_0x2f4ba5,_0x280929,_0x3b9da5){_0x3b9da5(null,path[_0xf1e6('0x24')](config[_0xf1e6('0x25')],_0xf1e6('0x2c')));},'filename':function(_0x5f173c,_0x1dfc19,_0x4cadac){_0x4cadac(null,util['format'](_0xf1e6('0x27'),Date[_0xf1e6('0x28')](),_0x1dfc19[_0xf1e6('0x29')]));}})});router[_0xf1e6('0x1f')](_0xf1e6('0x16'),upload['single'](_0xf1e6('0x2e')),controller['addSystemAvatar']);router[_0xf1e6('0x1f')](_0xf1e6('0x33'),controller[_0xf1e6('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xf1e6('0x30')]({'destination':function(_0x3276d1,_0xe46222,_0x363015){const _0x5c7157=path[_0xf1e6('0x24')](config[_0xf1e6('0x25')],_0xf1e6('0x35'),_0xf1e6('0x36'),'offline-chat');fs_extra['ensureDir'](_0x5c7157,function(){_0x363015(null,_0x5c7157);});},'filename':function(_0x3a2d42,_0x264ed9,_0x13ccaf){const _0x5c1102=_0x264ed9[_0xf1e6('0x29')][_0xf1e6('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x41ae8c=path[_0xf1e6('0x38')](_0x5c1102);const _0x386452=Date[_0xf1e6('0x28')]()+'-'+_0x5c1102['replace'](_0x41ae8c,'')+_0x41ae8c;_0x13ccaf(null,_0x386452);}})});router[_0xf1e6('0x1f')]('/:id/offline',offlineUploadMulter[_0xf1e6('0x39')](),controller[_0xf1e6('0x3a')]);router[_0xf1e6('0x1f')](_0xf1e6('0x18'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x3b')]);router['post']('/:id/applications',auth[_0xf1e6('0x9')](),controller['addApplications']);router[_0xf1e6('0x1f')](_0xf1e6('0x3c'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x3d')]);router[_0xf1e6('0x1f')](_0xf1e6('0x3e'),auth['isAuthenticated'](),controller[_0xf1e6('0x3f')]);router[_0xf1e6('0x40')](_0xf1e6('0xd'),auth[_0xf1e6('0x9')](),controller['update']);router[_0xf1e6('0x41')](_0xf1e6('0xd'),auth[_0xf1e6('0x9')](),controller[_0xf1e6('0x42')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xf1e6('0x41')](_0xf1e6('0x10'),auth['isAuthenticated'](),controller[_0xf1e6('0x43')]);router[_0xf1e6('0x41')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xf1e6('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index dc946ab..5c34072 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 _0x0d4d=['sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x3e6734,_0x2892d1){var _0x5c3d4c=function(_0x248d74){while(--_0x248d74){_0x3e6734['push'](_0x3e6734['shift']());}};_0x5c3d4c(++_0x2892d1);}(_0x0d4d,0x132));var _0xd0d4=function(_0x40f899,_0x4c4fc6){_0x40f899=_0x40f899-0x0;var _0x350c04=_0x0d4d[_0x40f899];return _0x350c04;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd0d4('0x3')](_0xd0d4('0x4'),_0xd0d4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xd0d4('0x2')]}};
\ No newline at end of file
+var _0x7ebb=['exports','STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x1cd84f,_0x4d4c50){var _0x389c9f=function(_0x579762){while(--_0x579762){_0x1cd84f['push'](_0x1cd84f['shift']());}};_0x389c9f(++_0x4d4c50);}(_0x7ebb,0x161));var _0xb7eb=function(_0x48fec7,_0x30b839){_0x48fec7=_0x48fec7-0x0;var _0x4f43de=_0x7ebb[_0x48fec7];return _0x4f43de;};'use strict';var Sequelize=require(_0xb7eb('0x0'));module[_0xb7eb('0x1')]={'name':{'type':Sequelize[_0xb7eb('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb7eb('0x3')](_0xb7eb('0x4'),_0xb7eb('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xb7eb('0x2')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index bbcb248..44d51d5 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 _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x3aec55,_0x10de7d){var _0x5432b6=function(_0x41705d){while(--_0x41705d){_0x3aec55['push'](_0x3aec55['shift']());}};_0x5432b6(++_0x10de7d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0x0b0e[_0x58efa6];return _0x5d643c;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
+var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x2fa404,_0x494acd){var _0x11a987=function(_0x24cb00){while(--_0x24cb00){_0x2fa404['push'](_0x2fa404['shift']());}};_0x11a987(++_0x494acd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index dbfd8bd..4a2e6ca 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 _0xac1c=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider'];(function(_0x461695,_0x4f6b44){var _0x49fb0a=function(_0x236215){while(--_0x236215){_0x461695['push'](_0x461695['shift']());}};_0x49fb0a(++_0x4f6b44);}(_0xac1c,0xa0));var _0xcac1=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0xac1c[_0x404cde];return _0x139882;};'use strict';var _=require(_0xcac1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcac1('0x1'));var moment=require(_0xcac1('0x2'));var BPromise=require(_0xcac1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcac1('0x4'));var rimraf=require(_0xcac1('0x5'));var config=require(_0xcac1('0x6'));var attributes=require(_0xcac1('0x7'));module['exports']=function(_0x334615,_0x27d0d7){return _0x334615[_0xcac1('0x8')](_0xcac1('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe01d=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0xbcb33c,_0x719e5f){var _0x25898d=function(_0x2caa3a){while(--_0x2caa3a){_0xbcb33c['push'](_0xbcb33c['shift']());}};_0x25898d(++_0x719e5f);}(_0xe01d,0x1c2));var _0xde01=function(_0x4a3ac9,_0x5d6809){_0x4a3ac9=_0x4a3ac9-0x0;var _0x4d7f5b=_0xe01d[_0x4a3ac9];return _0x4d7f5b;};'use strict';var _=require(_0xde01('0x0'));var util=require('util');var logger=require(_0xde01('0x1'))(_0xde01('0x2'));var moment=require(_0xde01('0x3'));var BPromise=require(_0xde01('0x4'));var rp=require(_0xde01('0x5'));var fs=require('fs');var path=require(_0xde01('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xde01('0x7')]=function(_0x6b7a6a,_0x331de0){return _0x6b7a6a[_0xde01('0x8')](_0xde01('0x9'),attributes,{'tableName':_0xde01('0xa'),'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 c390cca..07a48a9 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 _0xc5df=['message','result','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x460788,_0x3002ff){var _0x44479f=function(_0x1b42de){while(--_0x1b42de){_0x460788['push'](_0x460788['shift']());}};_0x44479f(++_0x3002ff);}(_0xc5df,0x80));var _0xfc5d=function(_0x54441c,_0x63780d){_0x54441c=_0x54441c-0x0;var _0x52c304=_0xc5df[_0x54441c];return _0x52c304;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc5d('0x0'));var BPromise=require(_0xfc5d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc5d('0x2'))['db'];var utils=require(_0xfc5d('0x3'));var logger=require(_0xfc5d('0x4'))(_0xfc5d('0x5'));var config=require(_0xfc5d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfc5d('0x7')][_0xfc5d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b8b10,_0x535aa7,_0x2a38ce){return new BPromise(function(_0x240ba0,_0x522712){return client[_0xfc5d('0x9')](_0x1b8b10,_0x2a38ce)[_0xfc5d('0xa')](function(_0x4f9a05){logger[_0xfc5d('0xb')](_0xfc5d('0xc'),_0x535aa7,'request\x20sent');logger[_0xfc5d('0xd')](_0xfc5d('0xe'),_0x535aa7,_0xfc5d('0xf'),JSON[_0xfc5d('0x10')](_0x4f9a05));if(_0x4f9a05['error']){if(_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x12')]===0x1f4){logger[_0xfc5d('0x11')]('CloudProvider,\x20%s,\x20%s',_0x535aa7,_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x13')]);return _0x522712(_0x4f9a05['error'][_0xfc5d('0x13')]);}logger['error'](_0xfc5d('0xc'),_0x535aa7,_0x4f9a05['error'][_0xfc5d('0x13')]);return _0x240ba0(_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x13')]);}else{logger[_0xfc5d('0xb')](_0xfc5d('0xc'),_0x535aa7,'request\x20sent');_0x240ba0(_0x4f9a05[_0xfc5d('0x14')][_0xfc5d('0x13')]);}})['catch'](function(_0x26f84a){logger['error'](_0xfc5d('0xc'),_0x535aa7,_0x26f84a);_0x522712(_0x26f84a);});});}
\ No newline at end of file
+var _0xb5fb=['request','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x415f7e,_0x4630b6){var _0x311ff4=function(_0x19c19d){while(--_0x19c19d){_0x415f7e['push'](_0x415f7e['shift']());}};_0x311ff4(++_0x4630b6);}(_0xb5fb,0x172));var _0xbb5f=function(_0x14977c,_0x2c6d7e){_0x14977c=_0x14977c-0x0;var _0xafe01a=_0xb5fb[_0x14977c];return _0xafe01a;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require(_0xbb5f('0xa'));var jayson=require(_0xbb5f('0xb'));var client=jayson[_0xbb5f('0xc')][_0xbb5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487a1a,_0x597050,_0x317cd9){return new BPromise(function(_0x5e7943,_0x5b91){return client[_0xbb5f('0xe')](_0x487a1a,_0x317cd9)['then'](function(_0x4f13a9){logger[_0xbb5f('0xf')]('CloudProvider,\x20%s,\x20%s',_0x597050,_0xbb5f('0x10'));logger[_0xbb5f('0x11')](_0xbb5f('0x12'),_0x597050,_0xbb5f('0x10'),JSON[_0xbb5f('0x13')](_0x4f13a9));if(_0x4f13a9[_0xbb5f('0x14')]){if(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x15')]===0x1f4){logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9['error'][_0xbb5f('0x17')]);return _0x5b91(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9[_0xbb5f('0x14')]['message']);return _0x5e7943(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}else{logger[_0xbb5f('0xf')](_0xbb5f('0x16'),_0x597050,'request\x20sent');_0x5e7943(_0x4f13a9['result'][_0xbb5f('0x17')]);}})['catch'](function(_0xdf4ec8){logger[_0xbb5f('0x14')]('CloudProvider,\x20%s,\x20%s',_0x597050,_0xdf4ec8);_0x5b91(_0xdf4ec8);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index bf571ac..819397e 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 _0x5b64=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0x5b64,0x16f));var _0x45b6=function(_0x19fd77,_0x38b0b6){_0x19fd77=_0x19fd77-0x0;var _0x1f4a0c=_0x5b64[_0x19fd77];return _0x1f4a0c;};'use strict';var multer=require(_0x45b6('0x0'));var util=require(_0x45b6('0x1'));var path=require('path');var timeout=require(_0x45b6('0x2'));var express=require('express');var router=express[_0x45b6('0x3')]();var fs_extra=require(_0x45b6('0x4'));var auth=require(_0x45b6('0x5'));var interaction=require(_0x45b6('0x6'));var config=require(_0x45b6('0x7'));var controller=require('./cloudProvider.controller');router[_0x45b6('0x8')]('/',auth[_0x45b6('0x9')](),controller[_0x45b6('0xa')]);router[_0x45b6('0x8')](_0x45b6('0xb'),auth['isAuthenticated'](),controller[_0x45b6('0xc')]);router['post']('/',auth[_0x45b6('0x9')](),controller[_0x45b6('0xd')]);router[_0x45b6('0xe')](_0x45b6('0xb'),auth[_0x45b6('0x9')](),controller[_0x45b6('0xf')]);router[_0x45b6('0x10')](_0x45b6('0xb'),auth[_0x45b6('0x9')](),controller[_0x45b6('0x11')]);module[_0x45b6('0x12')]=router;
\ No newline at end of file
+var _0x0df3=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x0df3,0x98));var _0x30df=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x0df3[_0x2543d6];return _0x55213c;};'use strict';var multer=require(_0x30df('0x0'));var util=require('util');var path=require(_0x30df('0x1'));var timeout=require('connect-timeout');var express=require(_0x30df('0x2'));var router=express[_0x30df('0x3')]();var fs_extra=require(_0x30df('0x4'));var auth=require(_0x30df('0x5'));var interaction=require(_0x30df('0x6'));var config=require(_0x30df('0x7'));var controller=require(_0x30df('0x8'));router['get']('/',auth[_0x30df('0x9')](),controller[_0x30df('0xa')]);router[_0x30df('0xb')](_0x30df('0xc'),auth['isAuthenticated'](),controller[_0x30df('0xd')]);router[_0x30df('0xe')]('/',auth[_0x30df('0x9')](),controller[_0x30df('0xf')]);router[_0x30df('0x10')]('/:id',auth[_0x30df('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x30df('0x11')]);module[_0x30df('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index e9b97da..edafd11 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 _0x6068=['STRING','name','exports'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x6068,0x134));var _0x8606=function(_0xfad5d6,_0x54322a){_0xfad5d6=_0xfad5d6-0x0;var _0x3135bf=_0x6068[_0xfad5d6];return _0x3135bf;};'use strict';var Sequelize=require('sequelize');module[_0x8606('0x0')]={'name':{'type':Sequelize[_0x8606('0x1')],'unique':_0x8606('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8606('0x1')]},'companyId':{'type':Sequelize[_0x8606('0x1')]},'website':{'type':Sequelize[_0x8606('0x1')]},'phone':{'type':Sequelize[_0x8606('0x1')]},'fax':{'type':Sequelize[_0x8606('0x1')]},'type':{'type':Sequelize[_0x8606('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8606('0x1')]},'city':{'type':Sequelize[_0x8606('0x1')]},'country':{'type':Sequelize[_0x8606('0x1')]},'email':{'type':Sequelize[_0x8606('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8606('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x8606('0x1')]},'sCountry':{'type':Sequelize[_0x8606('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7bd3=['sequelize','exports','name','STRING'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x7bd3,0x1d0));var _0x37bd=function(_0x33091a,_0x26bded){_0x33091a=_0x33091a-0x0;var _0x593c1b=_0x7bd3[_0x33091a];return _0x593c1b;};'use strict';var Sequelize=require(_0x37bd('0x0'));module[_0x37bd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x37bd('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x37bd('0x3')]},'companyId':{'type':Sequelize[_0x37bd('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x37bd('0x3')]},'type':{'type':Sequelize[_0x37bd('0x3')]},'street':{'type':Sequelize[_0x37bd('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x37bd('0x3')]},'email':{'type':Sequelize[_0x37bd('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x37bd('0x3')]},'sCity':{'type':Sequelize[_0x37bd('0x3')]},'sCountry':{'type':Sequelize[_0x37bd('0x3')]},'description':{'type':Sequelize[_0x37bd('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5276975..01de456 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 _0x1cc1=['querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','name','send','index','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','merge','options','CmCompany','includeAll','include','findAll','catch','show','rawAttributes','create','body','role','UserProfileSection','find','autoAssociation','error','params','addContacts','ids','getContacts','CmContact','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','jsforce','desk.js','to-csv'];(function(_0x118ed4,_0x2319b1){var _0x417b29=function(_0x1109a4){while(--_0x1109a4){_0x118ed4['push'](_0x118ed4['shift']());}};_0x417b29(++_0x2319b1);}(_0x1cc1,0xe1));var _0x11cc=function(_0x5222f5,_0x3f2dfe){_0x5222f5=_0x5222f5-0x0;var _0x4108d3=_0x1cc1[_0x5222f5];return _0x4108d3;};'use strict';var emlformat=require(_0x11cc('0x0'));var rimraf=require(_0x11cc('0x1'));var zipdir=require(_0x11cc('0x2'));var jsonpatch=require(_0x11cc('0x3'));var rp=require(_0x11cc('0x4'));var moment=require(_0x11cc('0x5'));var BPromise=require(_0x11cc('0x6'));var Mustache=require(_0x11cc('0x7'));var util=require(_0x11cc('0x8'));var path=require(_0x11cc('0x9'));var sox=require(_0x11cc('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11cc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x11cc('0xc'));var deskjs=require(_0x11cc('0xd'));var toCsv=require(_0x11cc('0xe'));var querystring=require(_0x11cc('0xf'));var Papa=require('papaparse');var Redis=require(_0x11cc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x11cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x11cc('0x12'))(_0x11cc('0x13'));var utils=require(_0x11cc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x11cc('0x15'));var db=require(_0x11cc('0x16'))['db'];function respondWithStatusCode(_0x218c90,_0x21ede9){_0x21ede9=_0x21ede9||0xcc;return function(_0x4b44ba){if(_0x4b44ba){return _0x218c90[_0x11cc('0x17')](_0x21ede9);}return _0x218c90[_0x11cc('0x18')](_0x21ede9)[_0x11cc('0x19')]();};}function respondWithResult(_0x52a8d6,_0x3650a0){_0x3650a0=_0x3650a0||0xc8;return function(_0x1cf7b7){if(_0x1cf7b7){return _0x52a8d6[_0x11cc('0x18')](_0x3650a0)[_0x11cc('0x1a')](_0x1cf7b7);}};}function respondWithFilteredResult(_0x54cd27,_0x59484){return function(_0x1e1e78){if(_0x1e1e78){var _0x333837=typeof _0x59484['offset']===_0x11cc('0x1b')&&typeof _0x59484['limit']==='undefined';var _0x3863c8=_0x1e1e78['count'];var _0x5523a5=_0x333837?0x0:_0x59484[_0x11cc('0x1c')];var _0x546540=_0x333837?_0x1e1e78[_0x11cc('0x1d')]:_0x59484[_0x11cc('0x1c')]+_0x59484['limit'];var _0x313fa0;if(_0x546540>=_0x3863c8){_0x546540=_0x3863c8;_0x313fa0=0xc8;}else{_0x313fa0=0xce;}_0x54cd27[_0x11cc('0x18')](_0x313fa0);return _0x54cd27[_0x11cc('0x1e')](_0x11cc('0x1f'),_0x5523a5+'-'+_0x546540+'/'+_0x3863c8)['json'](_0x1e1e78);}return null;};}function patchUpdates(_0x142c7){return function(_0x6dd623){try{jsonpatch['apply'](_0x6dd623,_0x142c7,!![]);}catch(_0x702d6){return BPromise[_0x11cc('0x20')](_0x702d6);}return _0x6dd623[_0x11cc('0x21')]();};}function saveUpdates(_0x11c8a1,_0x2e9e48){return function(_0x1581a1){if(_0x1581a1){return _0x1581a1[_0x11cc('0x22')](_0x11c8a1)[_0x11cc('0x23')](function(_0x3896e3){return _0x3896e3;});}return null;};}function removeEntity(_0x22b777,_0x3fb9f8){return function(_0x455252){if(_0x455252){return _0x455252['destroy']()[_0x11cc('0x23')](function(){var _0x228f72=_0x455252[_0x11cc('0x24')]({'plain':!![]});var _0x53f05b='Companies';return db[_0x11cc('0x25')][_0x11cc('0x26')]({'where':{'type':_0x53f05b,'resourceId':_0x228f72['id']}})['then'](function(){return _0x455252;});})[_0x11cc('0x23')](function(){_0x22b777['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x305faa,_0x591155){return function(_0x2381c3){if(!_0x2381c3){_0x305faa['sendStatus'](0x194);}return _0x2381c3;};}function handleError(_0x319eb4,_0x1b7c9b){_0x1b7c9b=_0x1b7c9b||0x1f4;return function(_0x5d03e9){logger['error'](_0x5d03e9['stack']);if(_0x5d03e9[_0x11cc('0x27')]){delete _0x5d03e9[_0x11cc('0x27')];}_0x319eb4[_0x11cc('0x18')](_0x1b7c9b)[_0x11cc('0x28')](_0x5d03e9);};}exports[_0x11cc('0x29')]=function(_0x44aeb7,_0x197c1d){var _0x3355a4={},_0x4d9eb0={},_0x3138d3={'count':0x0,'rows':[]};return db['CmCompany'][_0x11cc('0x2a')]()[_0x11cc('0x23')](function(_0x941073){_0x4d9eb0[_0x11cc('0x2b')]=_[_0x11cc('0x2c')](_0x941073);_0x4d9eb0[_0x11cc('0x2d')]=_['keys'](_0x44aeb7[_0x11cc('0x2d')]);_0x4d9eb0['filters']=_[_0x11cc('0x2e')](_0x4d9eb0[_0x11cc('0x2b')],_0x4d9eb0[_0x11cc('0x2d')]);_0x3355a4[_0x11cc('0x2f')]=_[_0x11cc('0x2e')](_0x4d9eb0['model'],qs[_0x11cc('0x30')](_0x44aeb7[_0x11cc('0x2d')][_0x11cc('0x30')]));_0x3355a4['attributes']=_0x3355a4[_0x11cc('0x2f')][_0x11cc('0x31')]?_0x3355a4[_0x11cc('0x2f')]:_0x4d9eb0[_0x11cc('0x2b')];if(!_0x44aeb7[_0x11cc('0x2d')][_0x11cc('0x32')](_0x11cc('0x33'))){_0x3355a4[_0x11cc('0x34')]=qs[_0x11cc('0x34')](_0x44aeb7['query'][_0x11cc('0x34')]);_0x3355a4[_0x11cc('0x1c')]=qs['offset'](_0x44aeb7[_0x11cc('0x2d')][_0x11cc('0x1c')]);}_0x3355a4['order']=qs[_0x11cc('0x35')](_0x44aeb7['query'][_0x11cc('0x35')]);_0x3355a4[_0x11cc('0x36')]=qs['filters'](_[_0x11cc('0x37')](_0x44aeb7[_0x11cc('0x2d')],_0x4d9eb0[_0x11cc('0x38')]),_0x941073);if(_0x44aeb7[_0x11cc('0x2d')][_0x11cc('0x39')]){_0x3355a4['where']=_[_0x11cc('0x3a')](_0x3355a4['where'],{'$or':_['map'](_0x3355a4[_0x11cc('0x2f')],function(_0x5f1181){var _0x3fca35={};_0x3fca35[_0x5f1181]={'$like':'%'+_0x44aeb7[_0x11cc('0x2d')]['filter']+'%'};return _0x3fca35;})});}_0x3355a4=_[_0x11cc('0x3a')]({},_0x3355a4,_0x44aeb7[_0x11cc('0x3b')]);var _0x3257c5={'where':_0x3355a4[_0x11cc('0x36')]};return db[_0x11cc('0x3c')][_0x11cc('0x1d')](_0x3257c5)[_0x11cc('0x23')](function(_0x4ccdff){_0x3138d3[_0x11cc('0x1d')]=_0x4ccdff;if(_0x44aeb7[_0x11cc('0x2d')][_0x11cc('0x3d')]){_0x3355a4[_0x11cc('0x3e')]=[{'all':!![]}];}return db[_0x11cc('0x3c')][_0x11cc('0x3f')](_0x3355a4);})[_0x11cc('0x23')](function(_0x22e52e){_0x3138d3['rows']=_0x22e52e;return _0x3138d3;})[_0x11cc('0x23')](respondWithFilteredResult(_0x197c1d,_0x3355a4))[_0x11cc('0x40')](handleError(_0x197c1d,null));})[_0x11cc('0x40')](handleError(_0x197c1d,null));};exports[_0x11cc('0x41')]=function(_0x35f4c3,_0x745196){var _0x10f10b={'raw':![],'where':{'id':_0x35f4c3['params']['id']}},_0xd029cf={};_0xd029cf[_0x11cc('0x2b')]=_['keys'](db[_0x11cc('0x3c')][_0x11cc('0x42')]);_0xd029cf[_0x11cc('0x2d')]=_[_0x11cc('0x2c')](_0x35f4c3[_0x11cc('0x2d')]);_0xd029cf['filters']=_[_0x11cc('0x2e')](_0xd029cf[_0x11cc('0x2b')],_0xd029cf['query']);_0x10f10b['attributes']=_[_0x11cc('0x2e')](_0xd029cf[_0x11cc('0x2b')],qs[_0x11cc('0x30')](_0x35f4c3[_0x11cc('0x2d')][_0x11cc('0x30')]));_0x10f10b[_0x11cc('0x2f')]=_0x10f10b[_0x11cc('0x2f')][_0x11cc('0x31')]?_0x10f10b[_0x11cc('0x2f')]:_0xd029cf[_0x11cc('0x2b')];if(_0x35f4c3[_0x11cc('0x2d')][_0x11cc('0x3d')]){_0x10f10b[_0x11cc('0x3e')]=[{'all':!![]}];}_0x10f10b=_[_0x11cc('0x3a')]({},_0x10f10b,_0x35f4c3[_0x11cc('0x3b')]);return db['CmCompany']['find'](_0x10f10b)[_0x11cc('0x23')](handleEntityNotFound(_0x745196,null))[_0x11cc('0x23')](respondWithResult(_0x745196,null))[_0x11cc('0x40')](handleError(_0x745196,null));};exports['create']=function(_0x1c96ea,_0x295aa4){return db[_0x11cc('0x3c')][_0x11cc('0x43')](_0x1c96ea[_0x11cc('0x44')],{})[_0x11cc('0x23')](function(_0x5bad74){var _0x200c71=_0x1c96ea['user']['get']({'plain':!![]});if(!_0x200c71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x200c71[_0x11cc('0x45')]==='user'){var _0x2bb378=_0x5bad74[_0x11cc('0x24')]({'plain':!![]});var _0x2c775b='Companies';return db[_0x11cc('0x46')][_0x11cc('0x47')]({'where':{'name':_0x2c775b,'userProfileId':_0x200c71['userProfileId']},'raw':!![]})[_0x11cc('0x23')](function(_0x43818e){if(_0x43818e&&_0x43818e[_0x11cc('0x48')]===0x0){return db[_0x11cc('0x25')][_0x11cc('0x43')]({'name':_0x2bb378[_0x11cc('0x27')],'resourceId':_0x2bb378['id'],'type':_0x43818e[_0x11cc('0x27')],'sectionId':_0x43818e['id']},{})[_0x11cc('0x23')](function(){return _0x5bad74;});}else{return _0x5bad74;}})[_0x11cc('0x40')](function(_0x4664f5){logger[_0x11cc('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4664f5);throw _0x4664f5;});}return _0x5bad74;})[_0x11cc('0x23')](respondWithResult(_0x295aa4,0xc9))[_0x11cc('0x40')](handleError(_0x295aa4,null));};exports[_0x11cc('0x22')]=function(_0x253b8f,_0xe29f8a){if(_0x253b8f[_0x11cc('0x44')]['id']){delete _0x253b8f[_0x11cc('0x44')]['id'];}return db[_0x11cc('0x3c')][_0x11cc('0x47')]({'where':{'id':_0x253b8f[_0x11cc('0x4a')]['id']}})[_0x11cc('0x23')](handleEntityNotFound(_0xe29f8a,null))[_0x11cc('0x23')](saveUpdates(_0x253b8f[_0x11cc('0x44')],null))['then'](respondWithResult(_0xe29f8a,null))['catch'](handleError(_0xe29f8a,null));};exports[_0x11cc('0x26')]=function(_0x86f85f,_0x334f77){return db[_0x11cc('0x3c')]['find']({'where':{'id':_0x86f85f[_0x11cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x334f77,null))['then'](removeEntity(_0x334f77,null))[_0x11cc('0x40')](handleError(_0x334f77,null));};exports['describe']=function(_0x4e0018,_0x4082c9){return db['CmCompany'][_0x11cc('0x2a')]()[_0x11cc('0x23')](respondWithResult(_0x4082c9,null))[_0x11cc('0x40')](handleError(_0x4082c9,null));};exports[_0x11cc('0x4b')]=function(_0x23e8b8,_0x28f4ac,_0x46e4f6){return db['CmContact'][_0x11cc('0x47')]({'where':{'id':_0x23e8b8['params']['id']}})['then'](handleEntityNotFound(_0x28f4ac,null))['then'](function(_0x3f5806){if(_0x3f5806){return _0x3f5806[_0x11cc('0x4b')](_0x23e8b8['body'][_0x11cc('0x4c')],_['omit'](_0x23e8b8[_0x11cc('0x44')],[_0x11cc('0x4c'),'id'])||{});}})[_0x11cc('0x23')](respondWithResult(_0x28f4ac,null))['catch'](handleError(_0x28f4ac,null));};exports[_0x11cc('0x4d')]=function(_0x451f07,_0x36e516,_0x21ef05){var _0x3ec689={};var _0x3c59c1={};var _0x458b91;var _0x394bb3;return db[_0x11cc('0x3c')]['findOne']({'where':{'id':_0x451f07[_0x11cc('0x4a')]['id']}})[_0x11cc('0x23')](handleEntityNotFound(_0x36e516,null))[_0x11cc('0x23')](function(_0x425204){if(_0x425204){_0x458b91=_0x425204;_0x3c59c1[_0x11cc('0x2b')]=_['keys'](db[_0x11cc('0x4e')][_0x11cc('0x42')]);_0x3c59c1['query']=_[_0x11cc('0x2c')](_0x451f07[_0x11cc('0x2d')]);_0x3c59c1[_0x11cc('0x38')]=_[_0x11cc('0x2e')](_0x3c59c1['model'],_0x3c59c1[_0x11cc('0x2d')]);_0x3ec689[_0x11cc('0x2f')]=_['intersection'](_0x3c59c1[_0x11cc('0x2b')],qs[_0x11cc('0x30')](_0x451f07[_0x11cc('0x2d')][_0x11cc('0x30')]));_0x3ec689[_0x11cc('0x2f')]=_0x3ec689[_0x11cc('0x2f')][_0x11cc('0x31')]?_0x3ec689['attributes']:_0x3c59c1[_0x11cc('0x2b')];_0x3ec689['order']=qs[_0x11cc('0x35')](_0x451f07[_0x11cc('0x2d')][_0x11cc('0x35')]);_0x3ec689['where']=qs[_0x11cc('0x38')](_[_0x11cc('0x37')](_0x451f07['query'],_0x3c59c1[_0x11cc('0x38')]));if(_0x451f07[_0x11cc('0x2d')]['filter']){_0x3ec689['where']=_[_0x11cc('0x3a')](_0x3ec689[_0x11cc('0x36')],{'$or':_[_0x11cc('0x4f')](_0x3ec689[_0x11cc('0x2f')],function(_0x16324c){var _0x1e8314={};_0x1e8314[_0x16324c]={'$like':'%'+_0x451f07[_0x11cc('0x2d')][_0x11cc('0x39')]+'%'};return _0x1e8314;})});}_0x3ec689=_['merge']({},_0x3ec689,_0x451f07[_0x11cc('0x3b')]);return _0x458b91[_0x11cc('0x4d')](_0x3ec689);}})[_0x11cc('0x23')](function(_0x4b9973){if(_0x4b9973){_0x394bb3=_0x4b9973[_0x11cc('0x31')];if(!_0x451f07[_0x11cc('0x2d')]['hasOwnProperty']('nolimit')){_0x3ec689[_0x11cc('0x34')]=qs[_0x11cc('0x34')](_0x451f07[_0x11cc('0x2d')][_0x11cc('0x34')]);_0x3ec689[_0x11cc('0x1c')]=qs[_0x11cc('0x1c')](_0x451f07['query'][_0x11cc('0x1c')]);}return _0x458b91[_0x11cc('0x4d')](_0x3ec689);}})['then'](function(_0x11246f){if(_0x11246f){return _0x11246f?{'count':_0x394bb3,'rows':_0x11246f}:null;}})[_0x11cc('0x23')](respondWithResult(_0x36e516,null))[_0x11cc('0x40')](handleError(_0x36e516,null));};
\ No newline at end of file
+var _0x6bc5=['set','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','error','name','send','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','merge','CmCompany','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','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','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','limit','count'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x6bc5,0x194));var _0x56bc=function(_0x5f23f6,_0x13522a){_0x5f23f6=_0x5f23f6-0x0;var _0x4ab463=_0x6bc5[_0x5f23f6];return _0x4ab463;};'use strict';var emlformat=require(_0x56bc('0x0'));var rimraf=require(_0x56bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56bc('0x2'));var rp=require(_0x56bc('0x3'));var moment=require('moment');var BPromise=require(_0x56bc('0x4'));var Mustache=require(_0x56bc('0x5'));var util=require('util');var path=require(_0x56bc('0x6'));var sox=require('sox');var csv=require(_0x56bc('0x7'));var ejs=require(_0x56bc('0x8'));var fs=require('fs');var fs_extra=require(_0x56bc('0x9'));var _=require(_0x56bc('0xa'));var squel=require(_0x56bc('0xb'));var crypto=require(_0x56bc('0xc'));var jsforce=require(_0x56bc('0xd'));var deskjs=require(_0x56bc('0xe'));var toCsv=require(_0x56bc('0x7'));var querystring=require('querystring');var Papa=require(_0x56bc('0xf'));var Redis=require(_0x56bc('0x10'));var authService=require(_0x56bc('0x11'));var qs=require(_0x56bc('0x12'));var as=require(_0x56bc('0x13'));var hardwareService=require(_0x56bc('0x14'));var logger=require(_0x56bc('0x15'))(_0x56bc('0x16'));var utils=require(_0x56bc('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56bc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc91b3e,_0x1a8591){_0x1a8591=_0x1a8591||0xcc;return function(_0x32870b){if(_0x32870b){return _0xc91b3e[_0x56bc('0x19')](_0x1a8591);}return _0xc91b3e[_0x56bc('0x1a')](_0x1a8591)['end']();};}function respondWithResult(_0x10089a,_0x46b5e6){_0x46b5e6=_0x46b5e6||0xc8;return function(_0x484c47){if(_0x484c47){return _0x10089a['status'](_0x46b5e6)['json'](_0x484c47);}};}function respondWithFilteredResult(_0x538302,_0x17bf4a){return function(_0x307bc9){if(_0x307bc9){var _0x445f9f=typeof _0x17bf4a[_0x56bc('0x1b')]===_0x56bc('0x1c')&&typeof _0x17bf4a[_0x56bc('0x1d')]===_0x56bc('0x1c');var _0x54e226=_0x307bc9[_0x56bc('0x1e')];var _0x526741=_0x445f9f?0x0:_0x17bf4a[_0x56bc('0x1b')];var _0x42ec7d=_0x445f9f?_0x307bc9['count']:_0x17bf4a[_0x56bc('0x1b')]+_0x17bf4a[_0x56bc('0x1d')];var _0x401871;if(_0x42ec7d>=_0x54e226){_0x42ec7d=_0x54e226;_0x401871=0xc8;}else{_0x401871=0xce;}_0x538302['status'](_0x401871);return _0x538302[_0x56bc('0x1f')]('Content-Range',_0x526741+'-'+_0x42ec7d+'/'+_0x54e226)['json'](_0x307bc9);}return null;};}function patchUpdates(_0x1f0a7e){return function(_0x1f31d2){try{jsonpatch['apply'](_0x1f31d2,_0x1f0a7e,!![]);}catch(_0x3edc95){return BPromise[_0x56bc('0x20')](_0x3edc95);}return _0x1f31d2[_0x56bc('0x21')]();};}function saveUpdates(_0x331e44,_0x5ac146){return function(_0x5603be){if(_0x5603be){return _0x5603be[_0x56bc('0x22')](_0x331e44)[_0x56bc('0x23')](function(_0x29b5b6){return _0x29b5b6;});}return null;};}function removeEntity(_0x33fbe8,_0x586c56){return function(_0x4b1bf4){if(_0x4b1bf4){return _0x4b1bf4[_0x56bc('0x24')]()[_0x56bc('0x23')](function(){var _0x4f5169=_0x4b1bf4[_0x56bc('0x25')]({'plain':!![]});var _0x1cf72e=_0x56bc('0x26');return db[_0x56bc('0x27')][_0x56bc('0x24')]({'where':{'type':_0x1cf72e,'resourceId':_0x4f5169['id']}})[_0x56bc('0x23')](function(){return _0x4b1bf4;});})[_0x56bc('0x23')](function(){_0x33fbe8[_0x56bc('0x1a')](0xcc)[_0x56bc('0x28')]();});}};}function handleEntityNotFound(_0x3de4d8,_0x273a36){return function(_0x518269){if(!_0x518269){_0x3de4d8['sendStatus'](0x194);}return _0x518269;};}function handleError(_0x33294c,_0x1b9b79){_0x1b9b79=_0x1b9b79||0x1f4;return function(_0x25f756){logger[_0x56bc('0x29')](_0x25f756['stack']);if(_0x25f756[_0x56bc('0x2a')]){delete _0x25f756[_0x56bc('0x2a')];}_0x33294c[_0x56bc('0x1a')](_0x1b9b79)[_0x56bc('0x2b')](_0x25f756);};}exports['index']=function(_0x5d255c,_0x2b99bd){var _0xbb46f0={},_0x38e307={},_0x56e2dd={'count':0x0,'rows':[]};return db['CmCompany'][_0x56bc('0x2c')]()[_0x56bc('0x23')](function(_0x5dc4dc){_0x38e307['model']=_[_0x56bc('0x2d')](_0x5dc4dc);_0x38e307[_0x56bc('0x2e')]=_[_0x56bc('0x2d')](_0x5d255c[_0x56bc('0x2e')]);_0x38e307[_0x56bc('0x2f')]=_[_0x56bc('0x30')](_0x38e307[_0x56bc('0x31')],_0x38e307[_0x56bc('0x2e')]);_0xbb46f0[_0x56bc('0x32')]=_[_0x56bc('0x30')](_0x38e307[_0x56bc('0x31')],qs[_0x56bc('0x33')](_0x5d255c['query'][_0x56bc('0x33')]));_0xbb46f0[_0x56bc('0x32')]=_0xbb46f0[_0x56bc('0x32')][_0x56bc('0x34')]?_0xbb46f0[_0x56bc('0x32')]:_0x38e307[_0x56bc('0x31')];if(!_0x5d255c[_0x56bc('0x2e')][_0x56bc('0x35')](_0x56bc('0x36'))){_0xbb46f0['limit']=qs[_0x56bc('0x1d')](_0x5d255c[_0x56bc('0x2e')][_0x56bc('0x1d')]);_0xbb46f0[_0x56bc('0x1b')]=qs[_0x56bc('0x1b')](_0x5d255c[_0x56bc('0x2e')][_0x56bc('0x1b')]);}_0xbb46f0[_0x56bc('0x37')]=qs[_0x56bc('0x38')](_0x5d255c['query'][_0x56bc('0x38')]);_0xbb46f0['where']=qs[_0x56bc('0x2f')](_[_0x56bc('0x39')](_0x5d255c[_0x56bc('0x2e')],_0x38e307[_0x56bc('0x2f')]),_0x5dc4dc);if(_0x5d255c[_0x56bc('0x2e')][_0x56bc('0x3a')]){_0xbb46f0[_0x56bc('0x3b')]=_['merge'](_0xbb46f0[_0x56bc('0x3b')],{'$or':_[_0x56bc('0x3c')](_0xbb46f0[_0x56bc('0x32')],function(_0x14979a){var _0x254bb9={};_0x254bb9[_0x14979a]={'$like':'%'+_0x5d255c[_0x56bc('0x2e')]['filter']+'%'};return _0x254bb9;})});}_0xbb46f0=_[_0x56bc('0x3d')]({},_0xbb46f0,_0x5d255c['options']);var _0x5d7205={'where':_0xbb46f0[_0x56bc('0x3b')]};return db[_0x56bc('0x3e')][_0x56bc('0x1e')](_0x5d7205)['then'](function(_0x1ac861){_0x56e2dd[_0x56bc('0x1e')]=_0x1ac861;if(_0x5d255c[_0x56bc('0x2e')][_0x56bc('0x3f')]){_0xbb46f0[_0x56bc('0x40')]=[{'all':!![]}];}return db[_0x56bc('0x3e')][_0x56bc('0x41')](_0xbb46f0);})[_0x56bc('0x23')](function(_0x4b2c72){_0x56e2dd[_0x56bc('0x42')]=_0x4b2c72;return _0x56e2dd;})[_0x56bc('0x23')](respondWithFilteredResult(_0x2b99bd,_0xbb46f0))[_0x56bc('0x43')](handleError(_0x2b99bd,null));})[_0x56bc('0x43')](handleError(_0x2b99bd,null));};exports[_0x56bc('0x44')]=function(_0x2c5a7f,_0x39b51a){var _0x2e95e8={'raw':![],'where':{'id':_0x2c5a7f[_0x56bc('0x45')]['id']}},_0x1fe910={};_0x1fe910[_0x56bc('0x31')]=_[_0x56bc('0x2d')](db[_0x56bc('0x3e')][_0x56bc('0x46')]);_0x1fe910[_0x56bc('0x2e')]=_[_0x56bc('0x2d')](_0x2c5a7f[_0x56bc('0x2e')]);_0x1fe910[_0x56bc('0x2f')]=_[_0x56bc('0x30')](_0x1fe910[_0x56bc('0x31')],_0x1fe910[_0x56bc('0x2e')]);_0x2e95e8[_0x56bc('0x32')]=_['intersection'](_0x1fe910['model'],qs[_0x56bc('0x33')](_0x2c5a7f['query'][_0x56bc('0x33')]));_0x2e95e8[_0x56bc('0x32')]=_0x2e95e8[_0x56bc('0x32')]['length']?_0x2e95e8['attributes']:_0x1fe910[_0x56bc('0x31')];if(_0x2c5a7f[_0x56bc('0x2e')]['includeAll']){_0x2e95e8['include']=[{'all':!![]}];}_0x2e95e8=_['merge']({},_0x2e95e8,_0x2c5a7f[_0x56bc('0x47')]);return db[_0x56bc('0x3e')]['find'](_0x2e95e8)[_0x56bc('0x23')](handleEntityNotFound(_0x39b51a,null))[_0x56bc('0x23')](respondWithResult(_0x39b51a,null))[_0x56bc('0x43')](handleError(_0x39b51a,null));};exports['create']=function(_0x3ddc13,_0x51a150){return db[_0x56bc('0x3e')][_0x56bc('0x48')](_0x3ddc13[_0x56bc('0x49')],{})[_0x56bc('0x23')](function(_0x25ab59){var _0x215013=_0x3ddc13[_0x56bc('0x4a')][_0x56bc('0x25')]({'plain':!![]});if(!_0x215013)throw new Error(_0x56bc('0x4b'));if(_0x215013['role']==='user'){var _0x265817=_0x25ab59[_0x56bc('0x25')]({'plain':!![]});var _0x3ed139=_0x56bc('0x26');return db[_0x56bc('0x4c')][_0x56bc('0x4d')]({'where':{'name':_0x3ed139,'userProfileId':_0x215013[_0x56bc('0x4e')]},'raw':!![]})['then'](function(_0x5af578){if(_0x5af578&&_0x5af578[_0x56bc('0x4f')]===0x0){return db[_0x56bc('0x27')][_0x56bc('0x48')]({'name':_0x265817[_0x56bc('0x2a')],'resourceId':_0x265817['id'],'type':_0x5af578[_0x56bc('0x2a')],'sectionId':_0x5af578['id']},{})[_0x56bc('0x23')](function(){return _0x25ab59;});}else{return _0x25ab59;}})[_0x56bc('0x43')](function(_0x40f9a7){logger[_0x56bc('0x29')](_0x56bc('0x50'),_0x40f9a7);throw _0x40f9a7;});}return _0x25ab59;})[_0x56bc('0x23')](respondWithResult(_0x51a150,0xc9))[_0x56bc('0x43')](handleError(_0x51a150,null));};exports[_0x56bc('0x22')]=function(_0x5f1ad6,_0x1c8a8a){if(_0x5f1ad6['body']['id']){delete _0x5f1ad6[_0x56bc('0x49')]['id'];}return db[_0x56bc('0x3e')]['find']({'where':{'id':_0x5f1ad6[_0x56bc('0x45')]['id']}})[_0x56bc('0x23')](handleEntityNotFound(_0x1c8a8a,null))[_0x56bc('0x23')](saveUpdates(_0x5f1ad6[_0x56bc('0x49')],null))['then'](respondWithResult(_0x1c8a8a,null))['catch'](handleError(_0x1c8a8a,null));};exports[_0x56bc('0x24')]=function(_0x1cd14f,_0x5d864e){return db['CmCompany']['find']({'where':{'id':_0x1cd14f[_0x56bc('0x45')]['id']}})[_0x56bc('0x23')](handleEntityNotFound(_0x5d864e,null))[_0x56bc('0x23')](removeEntity(_0x5d864e,null))[_0x56bc('0x43')](handleError(_0x5d864e,null));};exports[_0x56bc('0x2c')]=function(_0x20188d,_0x30f2fd){return db[_0x56bc('0x3e')][_0x56bc('0x2c')]()['then'](respondWithResult(_0x30f2fd,null))[_0x56bc('0x43')](handleError(_0x30f2fd,null));};exports[_0x56bc('0x51')]=function(_0xdee0cb,_0x5d7533,_0x393bde){return db[_0x56bc('0x52')]['find']({'where':{'id':_0xdee0cb[_0x56bc('0x45')]['id']}})[_0x56bc('0x23')](handleEntityNotFound(_0x5d7533,null))[_0x56bc('0x23')](function(_0x1fb9c5){if(_0x1fb9c5){return _0x1fb9c5['addContacts'](_0xdee0cb[_0x56bc('0x49')]['ids'],_[_0x56bc('0x53')](_0xdee0cb[_0x56bc('0x49')],[_0x56bc('0x54'),'id'])||{});}})[_0x56bc('0x23')](respondWithResult(_0x5d7533,null))[_0x56bc('0x43')](handleError(_0x5d7533,null));};exports[_0x56bc('0x55')]=function(_0x1c4208,_0x5d29b7,_0x487587){var _0xe7a182={};var _0xd15f3b={};var _0x560244;var _0x4361aa;return db[_0x56bc('0x3e')][_0x56bc('0x56')]({'where':{'id':_0x1c4208[_0x56bc('0x45')]['id']}})[_0x56bc('0x23')](handleEntityNotFound(_0x5d29b7,null))['then'](function(_0x202fde){if(_0x202fde){_0x560244=_0x202fde;_0xd15f3b[_0x56bc('0x31')]=_[_0x56bc('0x2d')](db['CmContact'][_0x56bc('0x46')]);_0xd15f3b[_0x56bc('0x2e')]=_[_0x56bc('0x2d')](_0x1c4208[_0x56bc('0x2e')]);_0xd15f3b[_0x56bc('0x2f')]=_[_0x56bc('0x30')](_0xd15f3b['model'],_0xd15f3b[_0x56bc('0x2e')]);_0xe7a182[_0x56bc('0x32')]=_['intersection'](_0xd15f3b[_0x56bc('0x31')],qs[_0x56bc('0x33')](_0x1c4208[_0x56bc('0x2e')][_0x56bc('0x33')]));_0xe7a182['attributes']=_0xe7a182[_0x56bc('0x32')][_0x56bc('0x34')]?_0xe7a182[_0x56bc('0x32')]:_0xd15f3b[_0x56bc('0x31')];_0xe7a182[_0x56bc('0x37')]=qs[_0x56bc('0x38')](_0x1c4208['query']['sort']);_0xe7a182[_0x56bc('0x3b')]=qs['filters'](_['pick'](_0x1c4208['query'],_0xd15f3b[_0x56bc('0x2f')]));if(_0x1c4208[_0x56bc('0x2e')][_0x56bc('0x3a')]){_0xe7a182['where']=_['merge'](_0xe7a182[_0x56bc('0x3b')],{'$or':_[_0x56bc('0x3c')](_0xe7a182[_0x56bc('0x32')],function(_0x5350de){var _0x44d569={};_0x44d569[_0x5350de]={'$like':'%'+_0x1c4208[_0x56bc('0x2e')][_0x56bc('0x3a')]+'%'};return _0x44d569;})});}_0xe7a182=_[_0x56bc('0x3d')]({},_0xe7a182,_0x1c4208[_0x56bc('0x47')]);return _0x560244[_0x56bc('0x55')](_0xe7a182);}})['then'](function(_0x4c2fe2){if(_0x4c2fe2){_0x4361aa=_0x4c2fe2[_0x56bc('0x34')];if(!_0x1c4208[_0x56bc('0x2e')][_0x56bc('0x35')](_0x56bc('0x36'))){_0xe7a182['limit']=qs[_0x56bc('0x1d')](_0x1c4208[_0x56bc('0x2e')][_0x56bc('0x1d')]);_0xe7a182[_0x56bc('0x1b')]=qs[_0x56bc('0x1b')](_0x1c4208[_0x56bc('0x2e')][_0x56bc('0x1b')]);}return _0x560244['getContacts'](_0xe7a182);}})[_0x56bc('0x23')](function(_0x524250){if(_0x524250){return _0x524250?{'count':_0x4361aa,'rows':_0x524250}:null;}})[_0x56bc('0x23')](respondWithResult(_0x5d29b7,null))['catch'](handleError(_0x5d29b7,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e01933f..144def0 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 _0x346d=['cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x1a7ae3,_0x2727b9){var _0x4d8d56=function(_0x4a5537){while(--_0x4a5537){_0x1a7ae3['push'](_0x1a7ae3['shift']());}};_0x4d8d56(++_0x2727b9);}(_0x346d,0xa1));var _0xd346=function(_0x465c0b,_0x19197d){_0x465c0b=_0x465c0b-0x0;var _0x151e48=_0x346d[_0x465c0b];return _0x151e48;};'use strict';var _=require(_0xd346('0x0'));var util=require('util');var logger=require(_0xd346('0x1'))('api');var moment=require(_0xd346('0x2'));var BPromise=require(_0xd346('0x3'));var rp=require(_0xd346('0x4'));var fs=require('fs');var path=require(_0xd346('0x5'));var rimraf=require(_0xd346('0x6'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xd346('0x7')]=function(_0x29a02d,_0x25d736){return _0x29a02d[_0xd346('0x8')]('CmCompany',attributes,{'tableName':_0xd346('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d3a=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2d3a,0x9c));var _0xa2d3=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0x2d3a[_0x17784a];return _0x41aded;};'use strict';var _=require(_0xa2d3('0x0'));var util=require(_0xa2d3('0x1'));var logger=require(_0xa2d3('0x2'))(_0xa2d3('0x3'));var moment=require('moment');var BPromise=require(_0xa2d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa2d3('0x5'));var config=require(_0xa2d3('0x6'));var attributes=require(_0xa2d3('0x7'));module[_0xa2d3('0x8')]=function(_0x1688f6,_0x44eb29){return _0x1688f6[_0xa2d3('0x9')](_0xa2d3('0xa'),attributes,{'tableName':_0xa2d3('0xb'),'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 7d3be1e..c0b1806 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 _0xdd1f=['result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x500aeb,_0x29fdba){var _0x5f3052=function(_0x415fc8){while(--_0x415fc8){_0x500aeb['push'](_0x500aeb['shift']());}};_0x5f3052(++_0x29fdba);}(_0xdd1f,0x166));var _0xfdd1=function(_0x372129,_0x539547){_0x372129=_0x372129-0x0;var _0x2385b4=_0xdd1f[_0x372129];return _0x2385b4;};'use strict';var _=require(_0xfdd1('0x0'));var util=require(_0xfdd1('0x1'));var moment=require(_0xfdd1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfdd1('0x3'));var db=require(_0xfdd1('0x4'))['db'];var utils=require(_0xfdd1('0x5'));var logger=require(_0xfdd1('0x6'))('rpc');var config=require(_0xfdd1('0x7'));var jayson=require(_0xfdd1('0x8'));var client=jayson[_0xfdd1('0x9')][_0xfdd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d5d,_0x3b3521,_0x24844e){return new BPromise(function(_0x363d96,_0x200516){return client[_0xfdd1('0xb')](_0x2e3d5d,_0x24844e)['then'](function(_0xa12482){logger[_0xfdd1('0xc')](_0xfdd1('0xd'),_0x3b3521,_0xfdd1('0xe'));logger[_0xfdd1('0xf')](_0xfdd1('0x10'),_0x3b3521,_0xfdd1('0xe'),JSON[_0xfdd1('0x11')](_0xa12482));if(_0xa12482[_0xfdd1('0x12')]){if(_0xa12482['error']['code']===0x1f4){logger[_0xfdd1('0x12')]('CmCompany,\x20%s,\x20%s',_0x3b3521,_0xa12482[_0xfdd1('0x12')][_0xfdd1('0x13')]);return _0x200516(_0xa12482[_0xfdd1('0x12')][_0xfdd1('0x13')]);}logger[_0xfdd1('0x12')](_0xfdd1('0xd'),_0x3b3521,_0xa12482['error'][_0xfdd1('0x13')]);return _0x363d96(_0xa12482[_0xfdd1('0x12')][_0xfdd1('0x13')]);}else{logger[_0xfdd1('0xc')](_0xfdd1('0xd'),_0x3b3521,_0xfdd1('0xe'));_0x363d96(_0xa12482[_0xfdd1('0x14')][_0xfdd1('0x13')]);}})['catch'](function(_0x1dd731){logger['error'](_0xfdd1('0xd'),_0x3b3521,_0x1dd731);_0x200516(_0x1dd731);});});}
\ No newline at end of file
+var _0x3948=['error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5cc692,_0xec2ea0){var _0x5c6fa4=function(_0x579c96){while(--_0x579c96){_0x5cc692['push'](_0x5cc692['shift']());}};_0x5c6fa4(++_0xec2ea0);}(_0x3948,0x1a3));var _0x8394=function(_0x540a81,_0x4c8bcc){_0x540a81=_0x540a81-0x0;var _0x48e239=_0x3948[_0x540a81];return _0x48e239;};'use strict';var _=require(_0x8394('0x0'));var util=require('util');var moment=require(_0x8394('0x1'));var BPromise=require(_0x8394('0x2'));var rs=require(_0x8394('0x3'));var fs=require('fs');var Redis=require(_0x8394('0x4'));var db=require(_0x8394('0x5'))['db'];var utils=require(_0x8394('0x6'));var logger=require(_0x8394('0x7'))(_0x8394('0x8'));var config=require(_0x8394('0x9'));var jayson=require(_0x8394('0xa'));var client=jayson[_0x8394('0xb')][_0x8394('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x597f77,_0x5ac5e5,_0x12780f){return new BPromise(function(_0x1c957f,_0x31ab46){return client[_0x8394('0xd')](_0x597f77,_0x12780f)['then'](function(_0x1bb4f5){logger['info'](_0x8394('0xe'),_0x5ac5e5,_0x8394('0xf'));logger[_0x8394('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5ac5e5,_0x8394('0xf'),JSON[_0x8394('0x11')](_0x1bb4f5));if(_0x1bb4f5['error']){if(_0x1bb4f5[_0x8394('0x12')]['code']===0x1f4){logger[_0x8394('0x12')](_0x8394('0xe'),_0x5ac5e5,_0x1bb4f5[_0x8394('0x12')][_0x8394('0x13')]);return _0x31ab46(_0x1bb4f5[_0x8394('0x12')][_0x8394('0x13')]);}logger['error'](_0x8394('0xe'),_0x5ac5e5,_0x1bb4f5['error'][_0x8394('0x13')]);return _0x1c957f(_0x1bb4f5['error'][_0x8394('0x13')]);}else{logger[_0x8394('0x14')](_0x8394('0xe'),_0x5ac5e5,_0x8394('0xf'));_0x1c957f(_0x1bb4f5[_0x8394('0x15')][_0x8394('0x13')]);}})[_0x8394('0x16')](function(_0x5838c6){logger[_0x8394('0x12')](_0x8394('0xe'),_0x5ac5e5,_0x5838c6);_0x31ab46(_0x5838c6);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 3c5f968..fc84a69 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 _0xe091=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x2a30c9,_0x1ad912){var _0x351340=function(_0x41a2cd){while(--_0x41a2cd){_0x2a30c9['push'](_0x2a30c9['shift']());}};_0x351340(++_0x1ad912);}(_0xe091,0x10f));var _0x1e09=function(_0x43fefa,_0x1fb601){_0x43fefa=_0x43fefa-0x0;var _0x10c0ef=_0xe091[_0x43fefa];return _0x10c0ef;};'use strict';var multer=require('multer');var util=require(_0x1e09('0x0'));var path=require(_0x1e09('0x1'));var timeout=require(_0x1e09('0x2'));var express=require(_0x1e09('0x3'));var router=express['Router']();var fs_extra=require(_0x1e09('0x4'));var auth=require(_0x1e09('0x5'));var interaction=require(_0x1e09('0x6'));var config=require(_0x1e09('0x7'));var controller=require(_0x1e09('0x8'));router['get']('/',auth[_0x1e09('0x9')](),controller[_0x1e09('0xa')]);router['get'](_0x1e09('0xb'),auth['isAuthenticated'](),controller[_0x1e09('0xc')]);router['get'](_0x1e09('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x1e09('0xe'),auth[_0x1e09('0x9')](),controller[_0x1e09('0xf')]);router[_0x1e09('0x10')]('/',auth[_0x1e09('0x9')](),controller[_0x1e09('0x11')]);router['post'](_0x1e09('0xe'),auth[_0x1e09('0x9')](),controller[_0x1e09('0x12')]);router['put'](_0x1e09('0xd'),auth['isAuthenticated'](),controller[_0x1e09('0x13')]);router[_0x1e09('0x14')](_0x1e09('0xd'),auth[_0x1e09('0x9')](),controller[_0x1e09('0x15')]);module[_0x1e09('0x16')]=router;
\ No newline at end of file
+var _0xb656=['/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe'];(function(_0xb12985,_0x16dd76){var _0x387637=function(_0x4625d2){while(--_0x4625d2){_0xb12985['push'](_0xb12985['shift']());}};_0x387637(++_0x16dd76);}(_0xb656,0x1a9));var _0x6b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb656[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6b65('0x0'));var util=require(_0x6b65('0x1'));var path=require(_0x6b65('0x2'));var timeout=require(_0x6b65('0x3'));var express=require(_0x6b65('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6b65('0x5'));var interaction=require(_0x6b65('0x6'));var config=require('../../config/environment');var controller=require(_0x6b65('0x7'));router[_0x6b65('0x8')]('/',auth[_0x6b65('0x9')](),controller[_0x6b65('0xa')]);router['get']('/describe',auth[_0x6b65('0x9')](),controller[_0x6b65('0xb')]);router[_0x6b65('0x8')](_0x6b65('0xc'),auth[_0x6b65('0x9')](),controller[_0x6b65('0xd')]);router[_0x6b65('0x8')](_0x6b65('0xe'),auth[_0x6b65('0x9')](),controller[_0x6b65('0xf')]);router[_0x6b65('0x10')]('/',auth[_0x6b65('0x9')](),controller[_0x6b65('0x11')]);router[_0x6b65('0x10')](_0x6b65('0xe'),auth[_0x6b65('0x9')](),controller[_0x6b65('0x12')]);router[_0x6b65('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x6b65('0x14')]);router[_0x6b65('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6b65('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c4e59cc..ede1ede 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 _0xeb44=['lodash','sequelize','exports','STRING','UNSIGNED','NOW'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xeb44,0x168));var _0x4eb4=function(_0x4d8167,_0x2b01cc){_0x4d8167=_0x4d8167-0x0;var _0x2d761c=_0xeb44[_0x4d8167];return _0x2d761c;};'use strict';var _=require(_0x4eb4('0x0'));var Sequelize=require(_0x4eb4('0x1'));module[_0x4eb4('0x2')]={'firstName':{'type':Sequelize[_0x4eb4('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4eb4('0x3')]},'street':{'type':Sequelize[_0x4eb4('0x3')]},'postalCode':{'type':Sequelize[_0x4eb4('0x3')]},'city':{'type':Sequelize[_0x4eb4('0x3')]},'country':{'type':Sequelize[_0x4eb4('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4eb4('0x3')]},'mobile':{'type':Sequelize[_0x4eb4('0x3')]},'fax':{'type':Sequelize[_0x4eb4('0x3')]},'email':{'type':Sequelize[_0x4eb4('0x3')]},'url':{'type':Sequelize[_0x4eb4('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4eb4('0x3')]},'twitter':{'type':Sequelize[_0x4eb4('0x3')]},'skype':{'type':Sequelize[_0x4eb4('0x3')]},'teams':{'type':Sequelize[_0x4eb4('0x3')]},'viber':{'type':Sequelize[_0x4eb4('0x3')]},'line':{'type':Sequelize[_0x4eb4('0x3')]},'wechat':{'type':Sequelize[_0x4eb4('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4eb4('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x4eb4('0x5')]}};
\ No newline at end of file
+var _0xca42=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','UNSIGNED'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xca42,0x1da));var _0x2ca4=function(_0x36ccc8,_0x17b034){_0x36ccc8=_0x36ccc8-0x0;var _0x1c235b=_0xca42[_0x36ccc8];return _0x1c235b;};'use strict';var _=require(_0x2ca4('0x0'));var Sequelize=require(_0x2ca4('0x1'));module[_0x2ca4('0x2')]={'firstName':{'type':Sequelize[_0x2ca4('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x2ca4('0x3')]},'street':{'type':Sequelize[_0x2ca4('0x3')]},'postalCode':{'type':Sequelize[_0x2ca4('0x3')]},'city':{'type':Sequelize[_0x2ca4('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x2ca4('0x3')]},'description':{'type':Sequelize[_0x2ca4('0x4')]},'phone':{'type':Sequelize[_0x2ca4('0x3')]},'mobile':{'type':Sequelize[_0x2ca4('0x3')]},'fax':{'type':Sequelize[_0x2ca4('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x2ca4('0x3')]},'facebook':{'type':Sequelize[_0x2ca4('0x3')]},'fb_data':{'type':Sequelize[_0x2ca4('0x3')]},'twitter':{'type':Sequelize[_0x2ca4('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x2ca4('0x3')]},'viber':{'type':Sequelize[_0x2ca4('0x3')]},'line':{'type':Sequelize[_0x2ca4('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x2ca4('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2ca4('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2ca4('0x6')],'defaultValue':Sequelize[_0x2ca4('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f76eb5d..40b17eb 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 _0xf93d=['having','resolve','user','role','agent','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','catch','params','tags','startsWith','displayName','findAll','columnName','alias','custom','type','values','body','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','each','duplicates','$or','findOrCreate','show','color','$and','cf_%d','format','table','setFields','toParam','phone','CmHopper','rawAttributes','options','getTags','nolimit','setTags','ids','getHoppers','ContactId','includeAll','include','rows','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','socket_timestamp','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','send','upload','createReadStream','parse','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','sms','fax','whatsapp','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','endtime','note','userDisposition','userSecondDisposition','UserId','fullname','createdAt','startCase','chat','Account','closed','closedAt','thirdDisposition','Owner','Tags','browserName','customerIp','customerPort','osName','ratingMessage','ratingType','ratingValue','referer','substatus','openchannel','externalUrl','threadId','Interaction','findAndCountAll','sortBy','slice','path','lodash','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','undefined','limit','offset','count','set','Content-Range','json','update','then','destroy','status','sendStatus','error','stack','name','CmContact','describe','keys','length','CmCustomField','findOne','trimStart','cf_','all','fieldType','model','query','intersection','fields','attributes','hasOwnProperty','sort','where','filters','pick','select','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','text','start','filter','isNil','push','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','c.id','order','DESC'];(function(_0x49d2f7,_0x4404cb){var _0x4cf79b=function(_0x6a7a30){while(--_0x6a7a30){_0x49d2f7['push'](_0x49d2f7['shift']());}};_0x4cf79b(++_0x4404cb);}(_0xf93d,0x1bc));var _0xdf93=function(_0x16d453,_0x33a458){_0x16d453=_0x16d453-0x0;var _0x34ab6b=_0xf93d[_0x16d453];return _0x34ab6b;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0xdf93('0x0'));var fs=require('fs');var _=require(_0xdf93('0x1'));var squel=require('squel');var Papa=require(_0xdf93('0x2'));var Redis=require(_0xdf93('0x3'));var qs=require(_0xdf93('0x4'));var as=require(_0xdf93('0x5'));var logger=require(_0xdf93('0x6'))(_0xdf93('0x7'));var config=require(_0xdf93('0x8'));var db=require(_0xdf93('0x9'))['db'];config['redis']=_[_0xdf93('0xa')](config[_0xdf93('0xb')],{'host':_0xdf93('0xc'),'port':0x18eb});var socket=require(_0xdf93('0xd'))(new Redis(config[_0xdf93('0xb')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x21cae1,_0x42fbf1){_0x42fbf1=_0x42fbf1||0xc8;return function(_0xd1fb61){if(_0xd1fb61){return _0x21cae1['status'](_0x42fbf1)['json'](_0xd1fb61);}};}function respondWithFilteredResult(_0x1576e9,_0x36a158){return function(_0x993fae){if(_0x993fae){var _0xb1424c=typeof _0x36a158['offset']===_0xdf93('0xe')&&typeof _0x36a158[_0xdf93('0xf')]===_0xdf93('0xe');var _0x25c499=_0x993fae['count'];var _0x48eafc=_0xb1424c?0x0:_0x36a158[_0xdf93('0x10')];var _0x30f415=_0xb1424c?_0x993fae[_0xdf93('0x11')]:_0x36a158['offset']+_0x36a158[_0xdf93('0xf')];var _0x381901;if(_0x30f415>=_0x25c499){_0x30f415=_0x25c499;_0x381901=0xc8;}else{_0x381901=0xce;}_0x1576e9['status'](_0x381901);return _0x1576e9[_0xdf93('0x12')](_0xdf93('0x13'),_0x48eafc+'-'+_0x30f415+'/'+_0x25c499)[_0xdf93('0x14')](_0x993fae);}return null;};}function saveUpdates(_0xa1363d){return function(_0x339f13){if(_0x339f13){return _0x339f13[_0xdf93('0x15')](_0xa1363d)[_0xdf93('0x16')](function(_0x137103){return _0x137103;});}return null;};}function removeEntity(_0x2fbb90){return function(_0x3dced7){if(_0x3dced7){return _0x3dced7[_0xdf93('0x17')]()[_0xdf93('0x16')](function(){_0x2fbb90[_0xdf93('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x311693){return function(_0x943cdf){if(!_0x943cdf){_0x311693[_0xdf93('0x19')](0x194);}return _0x943cdf;};}function handleError(_0x553ae6,_0x2b0b55){_0x2b0b55=_0x2b0b55||0x1f4;return function(_0x1bb5ad){logger[_0xdf93('0x1a')](_0x1bb5ad[_0xdf93('0x1b')]);if(_0x1bb5ad[_0xdf93('0x1c')]){delete _0x1bb5ad[_0xdf93('0x1c')];}_0x553ae6['status'](_0x2b0b55)['send'](_0x1bb5ad);};}exports['index']=function(_0x427e95,_0x125ba7){var _0x212b5e={},_0x3914ea={},_0x309dad={'count':0x0,'rows':[]};return db[_0xdf93('0x1d')][_0xdf93('0x1e')]()[_0xdf93('0x16')](function(_0x3d9f31){var _0x369251=[];for(var _0x55e155=0x0;_0x55e155
','push','Data','getHost','gmail','yahoo','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','node-tnef','email','value','address','anonymous','generate','@xcally.com'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4753,0x1f4));var _0x3475=function(_0x6c79b0,_0x532a89){_0x6c79b0=_0x6c79b0-0x0;var _0x169f4f=_0x4753[_0x6c79b0];return _0x169f4f;};'use strict';var _=require(_0x3475('0x0'));var moment=require(_0x3475('0x1'));var random=require(_0x3475('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x3475('0x3'));var tnef=require(_0x3475('0x4'));var logger=require('../../../config/logger')(_0x3475('0x5'));var config=require('../../../config/environment');function getAddress(_0x5a801b){var _0x5de37e=_['head'](_0x5a801b[_0x3475('0x6')]);return _0x5de37e&&_0x5de37e[_0x3475('0x7')]?_0x5de37e['address']:_0x3475('0x8')+random[_0x3475('0x9')](0x6)+_0x3475('0xa');}function getFirstName(_0x1d021b){var _0x6b37e6=_[_0x3475('0xb')](_0x1d021b[_0x3475('0x6')]);if(_0x6b37e6&&_0x6b37e6[_0x3475('0xc')]){if(_0x6b37e6[_0x3475('0xc')]==_0x6b37e6[_0x3475('0x7')]){return _0x6b37e6['name'][_0x3475('0xd')](0x0,_0x6b37e6[_0x3475('0xc')][_0x3475('0xe')]('@'));}var _0x4cb55a=_0x6b37e6[_0x3475('0xc')][_0x3475('0xf')](/\s+/);return _0x4cb55a['length']>0x1?_0x4cb55a[_0x3475('0x10')](0x0,-0x1)['join']('\x20'):_0x6b37e6[_0x3475('0xc')];}return _0x3475('0x11');}function getLastName(_0x1b9cfc){var _0x4a4485=_[_0x3475('0xb')](_0x1b9cfc[_0x3475('0x6')]);if(_0x4a4485&&_0x4a4485[_0x3475('0xc')]){var _0x219520=_0x4a4485['name'][_0x3475('0xf')](/\s+/);return _0x219520['length']>0x1?_0x219520['pop']():'';}return'';}function getMails(_0x3fd0d2,_0x1dd054){var _0x325fe5='';for(var _0x1e0c0a=0x0;_0x1e0c0a<_0x1dd054[_0x3475('0x6')]['length'];_0x1e0c0a+=0x1){if(_0x1dd054[_0x3475('0x6')][_0x1e0c0a]['address']!==_0x3fd0d2){if(!_[_0x3475('0x12')](_0x325fe5)){_0x325fe5+=',';}_0x325fe5+=_0x1dd054[_0x3475('0x6')][_0x1e0c0a][_0x3475('0xc')]||_0x1dd054[_0x3475('0x6')][_0x1e0c0a]['address']||'';_0x325fe5+='\x20<';_0x325fe5+=_0x1dd054[_0x3475('0x6')][_0x1e0c0a]['address']?_0x1dd054[_0x3475('0x6')][_0x1e0c0a][_0x3475('0x7')]:_0x3475('0x8')+random[_0x3475('0x9')](0x6)+'@xcally.com';_0x325fe5+='>';}}return _0x325fe5;}function parseEmail(_0x101ff1,_0xdac710,_0x649ad){if(_0xdac710['html']){var _0x217f68=/