From: support
Date: Wed, 23 Mar 2022 09:09:30 +0000 (+0000)
Subject: Built motion from commit bba6c809.|2.6.7
X-Git-Url: http://repos.xcallymotion.com/base//%22https:/wiki.xcallymotion.com/display/XMV/%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%2014%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C21110E%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C202%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%200%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C205?a=commitdiff_plain;h=ef0d0a87e0cbab222d87f2cc6f4a557dff70ea7f;p=motion2.git
Built motion from commit bba6c809.|2.6.7
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index e2f6aed..c9fb332 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-22T15:58:35.841Z",
+ "time": "2022-03-23T09:01:48.645Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0b82988..ee3700c 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-22T15:58:35.841Z",
+ "time": "2022-03-23T09:01:48.645Z",
"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 3678d05..e888248 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 _0x48c4=['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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x4d9f3b,_0x4cc2d8){var _0x2c70c8=function(_0x221745){while(--_0x221745){_0x4d9f3b['push'](_0x4d9f3b['shift']());}};_0x2c70c8(++_0x4cc2d8);}(_0x48c4,0x134));var _0x448c=function(_0x2e693b,_0x452ee8){_0x2e693b=_0x2e693b-0x0;var _0x19220e=_0x48c4[_0x2e693b];return _0x19220e;};'use strict';var Sequelize=require(_0x448c('0x0'));module[_0x448c('0x1')]={'name':{'type':Sequelize[_0x448c('0x2')],'get':function(_0x5c7e51){return this[_0x448c('0x3')](_0x448c('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x448c('0x5'),'motionbar',_0x448c('0x6'),_0x448c('0x7'),_0x448c('0x8'),_0x448c('0x9'),_0x448c('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x448c('0xb')},'data1':{'type':Sequelize[_0x448c('0xc')](0x1000),'comment':_0x448c('0xd')},'data2':{'type':Sequelize[_0x448c('0xc')](0x1000),'comment':_0x448c('0xe')},'data3':{'type':Sequelize[_0x448c('0xc')](0x1000),'comment':_0x448c('0xf')},'data4':{'type':Sequelize[_0x448c('0xc')](0x1000),'comments':_0x448c('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x448c('0xc')],'comments':_0x448c('0x11')},'data7':{'type':Sequelize[_0x448c('0x12')],'comments':_0x448c('0x13')}};
\ No newline at end of file
+var _0x3a14=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','integration','motionbar','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3a14,0x69));var _0x43a1=function(_0x2fdbb7,_0x55a3cb){_0x2fdbb7=_0x2fdbb7-0x0;var _0x4613b8=_0x3a14[_0x2fdbb7];return _0x4613b8;};'use strict';var Sequelize=require(_0x43a1('0x0'));module[_0x43a1('0x1')]={'name':{'type':Sequelize[_0x43a1('0x2')],'get':function(_0x357b21){return this['getDataValue'](_0x43a1('0x3'));}},'action':{'type':Sequelize[_0x43a1('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x43a1('0x5'),_0x43a1('0x6'),'jscripty',_0x43a1('0x7'),_0x43a1('0x8'),'bot',_0x43a1('0x9')]],'msg':_0x43a1('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x43a1('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x43a1('0xc')},'data4':{'type':Sequelize[_0x43a1('0x4')](0x1000),'comments':_0x43a1('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x43a1('0xe')},'data6':{'type':Sequelize[_0x43a1('0x4')],'comments':_0x43a1('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0x43a1('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index f719a92..e764aeb 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 _0x656e=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','stack','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4f9b81,_0x3dcabf){var _0x260cdf=function(_0x2f09bc){while(--_0x2f09bc){_0x4f9b81['push'](_0x4f9b81['shift']());}};_0x260cdf(++_0x3dcabf);}(_0x656e,0x1f1));var _0xe656=function(_0x5ea2f9,_0x320917){_0x5ea2f9=_0x5ea2f9-0x0;var _0x36e586=_0x656e[_0x5ea2f9];return _0x36e586;};'use strict';var emlformat=require(_0xe656('0x0'));var rimraf=require(_0xe656('0x1'));var zipdir=require(_0xe656('0x2'));var jsonpatch=require(_0xe656('0x3'));var rp=require(_0xe656('0x4'));var moment=require(_0xe656('0x5'));var BPromise=require(_0xe656('0x6'));var Mustache=require(_0xe656('0x7'));var util=require(_0xe656('0x8'));var path=require(_0xe656('0x9'));var sox=require('sox');var csv=require(_0xe656('0xa'));var ejs=require(_0xe656('0xb'));var fs=require('fs');var fs_extra=require(_0xe656('0xc'));var _=require(_0xe656('0xd'));var squel=require(_0xe656('0xe'));var crypto=require(_0xe656('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe656('0x10'));var Papa=require('papaparse');var Redis=require(_0xe656('0x11'));var authService=require(_0xe656('0x12'));var qs=require(_0xe656('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe656('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe656('0x15'));var config=require(_0xe656('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe656('0x17'))['db'];function respondWithStatusCode(_0x5144cb,_0x25e3e1){_0x25e3e1=_0x25e3e1||0xcc;return function(_0x2fdd32){if(_0x2fdd32){return _0x5144cb['sendStatus'](_0x25e3e1);}return _0x5144cb[_0xe656('0x18')](_0x25e3e1)['end']();};}function respondWithResult(_0xde82ce,_0x448acb){_0x448acb=_0x448acb||0xc8;return function(_0xfce977){if(_0xfce977){return _0xde82ce[_0xe656('0x18')](_0x448acb)[_0xe656('0x19')](_0xfce977);}};}function respondWithFilteredResult(_0x5b7337,_0x215ef5){return function(_0x385e1b){if(_0x385e1b){var _0x4c2600=typeof _0x215ef5[_0xe656('0x1a')]==='undefined'&&typeof _0x215ef5['limit']===_0xe656('0x1b');var _0x5f7c45=_0x385e1b[_0xe656('0x1c')];var _0x60a4a0=_0x4c2600?0x0:_0x215ef5[_0xe656('0x1a')];var _0x32cd5e=_0x4c2600?_0x385e1b['count']:_0x215ef5[_0xe656('0x1a')]+_0x215ef5[_0xe656('0x1d')];var _0x2d8f33;if(_0x32cd5e>=_0x5f7c45){_0x32cd5e=_0x5f7c45;_0x2d8f33=0xc8;}else{_0x2d8f33=0xce;}_0x5b7337[_0xe656('0x18')](_0x2d8f33);return _0x5b7337[_0xe656('0x1e')](_0xe656('0x1f'),_0x60a4a0+'-'+_0x32cd5e+'/'+_0x5f7c45)[_0xe656('0x19')](_0x385e1b);}return null;};}function patchUpdates(_0x1f2f03){return function(_0x789ba9){try{jsonpatch['apply'](_0x789ba9,_0x1f2f03,!![]);}catch(_0xace569){return BPromise[_0xe656('0x20')](_0xace569);}return _0x789ba9[_0xe656('0x21')]();};}function saveUpdates(_0x5b1b2c,_0x2984d1){return function(_0x397d1a){if(_0x397d1a){return _0x397d1a['update'](_0x5b1b2c)[_0xe656('0x22')](function(_0x389ceb){return _0x389ceb;});}return null;};}function removeEntity(_0x3c4e9c,_0x19bad7){return function(_0x3f7e2a){if(_0x3f7e2a){return _0x3f7e2a[_0xe656('0x23')]()[_0xe656('0x22')](function(){_0x3c4e9c[_0xe656('0x18')](0xcc)[_0xe656('0x24')]();});}};}function handleEntityNotFound(_0x34d341,_0x5c5116){return function(_0x97b90f){if(!_0x97b90f){_0x34d341['sendStatus'](0x194);}return _0x97b90f;};}function handleError(_0x4f29be,_0x324784){_0x324784=_0x324784||0x1f4;return function(_0x38a1a5){logger['error'](_0x38a1a5[_0xe656('0x25')]);if(_0x38a1a5[_0xe656('0x26')]){delete _0x38a1a5[_0xe656('0x26')];}_0x4f29be[_0xe656('0x18')](_0x324784)[_0xe656('0x27')](_0x38a1a5);};}exports[_0xe656('0x28')]=function(_0x407435,_0x5089a6){if(_0x407435['body']['id']){delete _0x407435[_0xe656('0x29')]['id'];}return db[_0xe656('0x2a')][_0xe656('0x2b')]({'where':{'id':_0x407435[_0xe656('0x2c')]['id']}})[_0xe656('0x22')](handleEntityNotFound(_0x5089a6,null))['then'](saveUpdates(_0x407435[_0xe656('0x29')],null))['then'](respondWithResult(_0x5089a6,null))[_0xe656('0x2d')](handleError(_0x5089a6,null));};exports['destroy']=function(_0x4c5794,_0x5411a1){return db[_0xe656('0x2a')][_0xe656('0x2b')]({'where':{'id':_0x4c5794[_0xe656('0x2c')]['id']}})[_0xe656('0x22')](handleEntityNotFound(_0x5411a1,null))[_0xe656('0x22')](removeEntity(_0x5411a1,null))['catch'](handleError(_0x5411a1,null));};
\ No newline at end of file
+var _0x78db=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','body','params','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x78db,0x109));var _0xb78d=function(_0x1f9773,_0x4365fb){_0x1f9773=_0x1f9773-0x0;var _0x3fc947=_0x78db[_0x1f9773];return _0x3fc947;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb78d('0x0'));var zipdir=require(_0xb78d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb78d('0x2'));var moment=require(_0xb78d('0x3'));var BPromise=require(_0xb78d('0x4'));var Mustache=require(_0xb78d('0x5'));var util=require(_0xb78d('0x6'));var path=require(_0xb78d('0x7'));var sox=require(_0xb78d('0x8'));var csv=require(_0xb78d('0x9'));var ejs=require(_0xb78d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb78d('0xb'));var squel=require(_0xb78d('0xc'));var crypto=require('crypto');var jsforce=require(_0xb78d('0xd'));var deskjs=require(_0xb78d('0xe'));var toCsv=require(_0xb78d('0x9'));var querystring=require(_0xb78d('0xf'));var Papa=require(_0xb78d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb78d('0x11'));var as=require(_0xb78d('0x12'));var hardwareService=require(_0xb78d('0x13'));var logger=require(_0xb78d('0x14'))(_0xb78d('0x15'));var utils=require(_0xb78d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb78d('0x17'));var db=require(_0xb78d('0x18'))['db'];function respondWithStatusCode(_0x4dea84,_0x3102d2){_0x3102d2=_0x3102d2||0xcc;return function(_0x29374d){if(_0x29374d){return _0x4dea84[_0xb78d('0x19')](_0x3102d2);}return _0x4dea84[_0xb78d('0x1a')](_0x3102d2)[_0xb78d('0x1b')]();};}function respondWithResult(_0x3174f9,_0x86d9c6){_0x86d9c6=_0x86d9c6||0xc8;return function(_0x2af88a){if(_0x2af88a){return _0x3174f9[_0xb78d('0x1a')](_0x86d9c6)['json'](_0x2af88a);}};}function respondWithFilteredResult(_0x437aab,_0x4b8153){return function(_0x335e2d){if(_0x335e2d){var _0x2b1abd=typeof _0x4b8153[_0xb78d('0x1c')]===_0xb78d('0x1d')&&typeof _0x4b8153[_0xb78d('0x1e')]===_0xb78d('0x1d');var _0x2c3f81=_0x335e2d[_0xb78d('0x1f')];var _0x5d8ac1=_0x2b1abd?0x0:_0x4b8153[_0xb78d('0x1c')];var _0x26107b=_0x2b1abd?_0x335e2d[_0xb78d('0x1f')]:_0x4b8153[_0xb78d('0x1c')]+_0x4b8153[_0xb78d('0x1e')];var _0x5ebf39;if(_0x26107b>=_0x2c3f81){_0x26107b=_0x2c3f81;_0x5ebf39=0xc8;}else{_0x5ebf39=0xce;}_0x437aab[_0xb78d('0x1a')](_0x5ebf39);return _0x437aab[_0xb78d('0x20')](_0xb78d('0x21'),_0x5d8ac1+'-'+_0x26107b+'/'+_0x2c3f81)[_0xb78d('0x22')](_0x335e2d);}return null;};}function patchUpdates(_0x3b9400){return function(_0x1746e7){try{jsonpatch[_0xb78d('0x23')](_0x1746e7,_0x3b9400,!![]);}catch(_0x4d697e){return BPromise['reject'](_0x4d697e);}return _0x1746e7[_0xb78d('0x24')]();};}function saveUpdates(_0x5e33a0,_0x4b9acc){return function(_0x357738){if(_0x357738){return _0x357738[_0xb78d('0x25')](_0x5e33a0)[_0xb78d('0x26')](function(_0x572744){return _0x572744;});}return null;};}function removeEntity(_0x4fdbb5,_0x1ffe18){return function(_0x4d4bb6){if(_0x4d4bb6){return _0x4d4bb6[_0xb78d('0x27')]()[_0xb78d('0x26')](function(){_0x4fdbb5[_0xb78d('0x1a')](0xcc)[_0xb78d('0x1b')]();});}};}function handleEntityNotFound(_0x5da4a4,_0x10cd5b){return function(_0xb376ec){if(!_0xb376ec){_0x5da4a4['sendStatus'](0x194);}return _0xb376ec;};}function handleError(_0x1facf0,_0x40cb8b){_0x40cb8b=_0x40cb8b||0x1f4;return function(_0xa7e0b6){logger[_0xb78d('0x28')](_0xa7e0b6[_0xb78d('0x29')]);if(_0xa7e0b6[_0xb78d('0x2a')]){delete _0xa7e0b6[_0xb78d('0x2a')];}_0x1facf0[_0xb78d('0x1a')](_0x40cb8b)[_0xb78d('0x2b')](_0xa7e0b6);};}exports[_0xb78d('0x25')]=function(_0x169db7,_0x226f51){if(_0x169db7[_0xb78d('0x2c')]['id']){delete _0x169db7[_0xb78d('0x2c')]['id'];}return db['Action']['find']({'where':{'id':_0x169db7[_0xb78d('0x2d')]['id']}})[_0xb78d('0x26')](handleEntityNotFound(_0x226f51,null))[_0xb78d('0x26')](saveUpdates(_0x169db7[_0xb78d('0x2c')],null))['then'](respondWithResult(_0x226f51,null))[_0xb78d('0x2e')](handleError(_0x226f51,null));};exports[_0xb78d('0x27')]=function(_0x35e9d1,_0x51f4c1){return db['Action']['find']({'where':{'id':_0x35e9d1['params']['id']}})[_0xb78d('0x26')](handleEntityNotFound(_0x51f4c1,null))[_0xb78d('0x26')](removeEntity(_0x51f4c1,null))[_0xb78d('0x2e')](handleError(_0x51f4c1,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index faf7d79..bb21230 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 _0x25fd=['request-promise','rimraf','../../config/environment','exports','define','../../config/logger','api','bluebird'];(function(_0x2157ec,_0x3fc94f){var _0x4033e4=function(_0x207084){while(--_0x207084){_0x2157ec['push'](_0x2157ec['shift']());}};_0x4033e4(++_0x3fc94f);}(_0x25fd,0x16d));var _0xd25f=function(_0x1a681f,_0x574fb3){_0x1a681f=_0x1a681f-0x0;var _0x3d9241=_0x25fd[_0x1a681f];return _0x3d9241;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd25f('0x0'))(_0xd25f('0x1'));var moment=require('moment');var BPromise=require(_0xd25f('0x2'));var rp=require(_0xd25f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd25f('0x4'));var config=require(_0xd25f('0x5'));var attributes=require('./action.attributes');module[_0xd25f('0x6')]=function(_0x4ad800,_0x2752d7){return _0x4ad800[_0xd25f('0x7')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39bb=['exports','define','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./action.attributes'];(function(_0x3c2e5a,_0x97e5d3){var _0x4ccc31=function(_0x328df5){while(--_0x328df5){_0x3c2e5a['push'](_0x3c2e5a['shift']());}};_0x4ccc31(++_0x97e5d3);}(_0x39bb,0xe7));var _0xb39b=function(_0x18f82b,_0x3ea7a0){_0x18f82b=_0x18f82b-0x0;var _0x5d8128=_0x39bb[_0x18f82b];return _0x5d8128;};'use strict';var _=require('lodash');var util=require(_0xb39b('0x0'));var logger=require(_0xb39b('0x1'))(_0xb39b('0x2'));var moment=require(_0xb39b('0x3'));var BPromise=require(_0xb39b('0x4'));var rp=require(_0xb39b('0x5'));var fs=require('fs');var path=require(_0xb39b('0x6'));var rimraf=require(_0xb39b('0x7'));var config=require('../../config/environment');var attributes=require(_0xb39b('0x8'));module[_0xb39b('0x9')]=function(_0x340948,_0x24641b){return _0x340948[_0xb39b('0xa')]('Action',attributes,{'tableName':_0xb39b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index c363be8..e4f500e 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x145318,_0x445c34){var _0x5c82d5=function(_0x5447ce){while(--_0x5447ce){_0x145318['push'](_0x145318['shift']());}};_0x5c82d5(++_0x445c34);}(_0x1261,0x144));var _0x1126=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x1261[_0x3ef2d5];return _0x2fefb2;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x486b00,_0x501df5){var _0x47ea82=function(_0x997782){while(--_0x997782){_0x486b00['push'](_0x486b00['shift']());}};_0x47ea82(++_0x501df5);}(_0x5fab,0x177));var _0xb5fa=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x5fab[_0x267d8d];return _0x11a98f;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 422f8bd..63f4f4b 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 _0x445b=['path','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x4a4314,_0x49a980){var _0x83fca5=function(_0x19b25a){while(--_0x19b25a){_0x4a4314['push'](_0x4a4314['shift']());}};_0x83fca5(++_0x49a980);}(_0x445b,0xa3));var _0xb445=function(_0x45e9a2,_0x13d643){_0x45e9a2=_0x45e9a2-0x0;var _0x1a3247=_0x445b[_0x45e9a2];return _0x1a3247;};'use strict';var multer=require(_0xb445('0x0'));var util=require(_0xb445('0x1'));var path=require(_0xb445('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb445('0x3')]();var fs_extra=require(_0xb445('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb445('0x5'));var config=require(_0xb445('0x6'));var controller=require(_0xb445('0x7'));router[_0xb445('0x8')](_0xb445('0x9'),auth['isAuthenticated'](),controller[_0xb445('0xa')]);router[_0xb445('0xb')](_0xb445('0x9'),auth[_0xb445('0xc')](),controller[_0xb445('0xd')]);module[_0xb445('0xe')]=router;
\ No newline at end of file
+var _0xe085=['put','/:id','update','delete','isAuthenticated','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x16a9a0,_0x5e8414){var _0xc3657c=function(_0x4e037f){while(--_0x4e037f){_0x16a9a0['push'](_0x16a9a0['shift']());}};_0xc3657c(++_0x5e8414);}(_0xe085,0x132));var _0x5e08=function(_0x33a47c,_0x2ab830){_0x33a47c=_0x33a47c-0x0;var _0xa2f243=_0xe085[_0x33a47c];return _0xa2f243;};'use strict';var multer=require(_0x5e08('0x0'));var util=require(_0x5e08('0x1'));var path=require(_0x5e08('0x2'));var timeout=require('connect-timeout');var express=require(_0x5e08('0x3'));var router=express[_0x5e08('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5e08('0x5'));var interaction=require(_0x5e08('0x6'));var config=require(_0x5e08('0x7'));var controller=require(_0x5e08('0x8'));router[_0x5e08('0x9')](_0x5e08('0xa'),auth['isAuthenticated'](),controller[_0x5e08('0xb')]);router[_0x5e08('0xc')](_0x5e08('0xa'),auth[_0x5e08('0xd')](),controller[_0x5e08('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 4a387bf..5a51884 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1bd3ab,_0x352c42){_0x1bd3ab=_0x1bd3ab-0x0;var _0x37e394=_0xfdbd[_0x1bd3ab];return _0x37e394;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
+var _0x326f=['STRING','TEXT','sequelize'];(function(_0x158b72,_0x4f6dcb){var _0x361d41=function(_0x2d3986){while(--_0x2d3986){_0x158b72['push'](_0x158b72['shift']());}};_0x361d41(++_0x4f6dcb);}(_0x326f,0xd1));var _0xf326=function(_0x4f520e,_0x4d5bd7){_0x4f520e=_0x4f520e-0x0;var _0x5f3929=_0x326f[_0x4f520e];return _0x5f3929;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 621bf29..9c30174 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 _0x0079=['DATE(%s)','HOUR(%s)','IS\x20NOT\x20EMPTY','keyBy','%s.%s\x20=\x20%s.%s','web','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','Limited\x20Query:','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','key','map','keys','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','parentKey','conditions','clone','debug','toString','sequelize','QueryTypes','left_join','right_join','COUNT(%s)','MAX(%s)'];(function(_0x287059,_0x499940){var _0x225c79=function(_0x3aa36e){while(--_0x3aa36e){_0x287059['push'](_0x287059['shift']());}};_0x225c79(++_0x499940);}(_0x0079,0x16c));var _0x9007=function(_0x10209b,_0x3a1b5c){_0x10209b=_0x10209b-0x0;var _0x49541a=_0x0079[_0x10209b];return _0x49541a;};'use strict';var emlformat=require(_0x9007('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9007('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9007('0x2'));var moment=require(_0x9007('0x3'));var BPromise=require(_0x9007('0x4'));var Mustache=require(_0x9007('0x5'));var util=require(_0x9007('0x6'));var path=require(_0x9007('0x7'));var sox=require(_0x9007('0x8'));var csv=require('to-csv');var ejs=require(_0x9007('0x9'));var fs=require('fs');var fs_extra=require(_0x9007('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9007('0xb'));var deskjs=require(_0x9007('0xc'));var toCsv=require(_0x9007('0xd'));var querystring=require(_0x9007('0xe'));var Papa=require(_0x9007('0xf'));var Redis=require('ioredis');var authService=require(_0x9007('0x10'));var qs=require(_0x9007('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9007('0x12'));var logger=require(_0x9007('0x13'))(_0x9007('0x14'));var utils=require(_0x9007('0x15'));var config=require(_0x9007('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9007('0x17'))['db'];var dbH=require(_0x9007('0x17'))[_0x9007('0x18')];function respondWithStatusCode(_0x569e6c,_0x406463){_0x406463=_0x406463||0xcc;return function(_0x239e77){if(_0x239e77){return _0x569e6c[_0x9007('0x19')](_0x406463);}return _0x569e6c['status'](_0x406463)[_0x9007('0x1a')]();};}function respondWithResult(_0x17e13f,_0x254c44){_0x254c44=_0x254c44||0xc8;return function(_0x56f67d){if(_0x56f67d){return _0x17e13f[_0x9007('0x1b')](_0x254c44)[_0x9007('0x1c')](_0x56f67d);}};}function respondWithFilteredResult(_0x1ffcb0,_0x3f74bd){return function(_0x16962f){if(_0x16962f){var _0x590401=typeof _0x3f74bd[_0x9007('0x1d')]===_0x9007('0x1e')&&typeof _0x3f74bd[_0x9007('0x1f')]===_0x9007('0x1e');var _0x4a0dcb=_0x16962f[_0x9007('0x20')];var _0x1af394=_0x590401?0x0:_0x3f74bd[_0x9007('0x1d')];var _0x55f020=_0x590401?_0x16962f[_0x9007('0x20')]:_0x3f74bd[_0x9007('0x1d')]+_0x3f74bd[_0x9007('0x1f')];var _0x2a194e;if(_0x55f020>=_0x4a0dcb){_0x55f020=_0x4a0dcb;_0x2a194e=0xc8;}else{_0x2a194e=0xce;}_0x1ffcb0[_0x9007('0x1b')](_0x2a194e);return _0x1ffcb0[_0x9007('0x21')](_0x9007('0x22'),_0x1af394+'-'+_0x55f020+'/'+_0x4a0dcb)[_0x9007('0x1c')](_0x16962f);}return null;};}function patchUpdates(_0x527105){return function(_0x1ebf10){try{jsonpatch['apply'](_0x1ebf10,_0x527105,!![]);}catch(_0x344e8c){return BPromise[_0x9007('0x23')](_0x344e8c);}return _0x1ebf10[_0x9007('0x24')]();};}function saveUpdates(_0x35c60c,_0x9f2786){return function(_0x13bb50){if(_0x13bb50){return _0x13bb50[_0x9007('0x25')](_0x35c60c)[_0x9007('0x26')](function(_0x231fe7){return _0x231fe7;});}return null;};}function removeEntity(_0x3b3938,_0x4d7c44){return function(_0x1912ad){if(_0x1912ad){return _0x1912ad[_0x9007('0x27')]()['then'](function(){var _0x32dcf4=_0x1912ad[_0x9007('0x28')]({'plain':!![]});var _0x192040=_0x9007('0x29');return db[_0x9007('0x2a')][_0x9007('0x27')]({'where':{'type':_0x192040,'resourceId':_0x32dcf4['id']}})['then'](function(){return _0x1912ad;});})[_0x9007('0x26')](function(){_0x3b3938[_0x9007('0x1b')](0xcc)[_0x9007('0x1a')]();});}};}function handleEntityNotFound(_0x47ffef,_0x4d7a3f){return function(_0x334054){if(!_0x334054){_0x47ffef[_0x9007('0x19')](0x194);}return _0x334054;};}function handleError(_0x345a9d,_0x1b946c){_0x1b946c=_0x1b946c||0x1f4;return function(_0x1fbef6){logger[_0x9007('0x2b')](_0x1fbef6[_0x9007('0x2c')]);if(_0x1fbef6[_0x9007('0x2d')]){delete _0x1fbef6[_0x9007('0x2d')];}_0x345a9d['status'](_0x1b946c)[_0x9007('0x2e')](_0x1fbef6);};}exports['index']=function(_0x302f15,_0x11f550){var _0x477aef={},_0x2aa269={},_0x5b1958={'count':0x0,'rows':[]};var _0x43cff1=_['map'](db[_0x9007('0x2f')][_0x9007('0x30')],function(_0xa46fdf){return{'name':_0xa46fdf[_0x9007('0x31')],'type':_0xa46fdf[_0x9007('0x32')][_0x9007('0x33')]};});_0x2aa269['model']=_[_0x9007('0x34')](_0x43cff1,_0x9007('0x2d'));_0x2aa269['query']=_[_0x9007('0x35')](_0x302f15[_0x9007('0x36')]);_0x2aa269[_0x9007('0x37')]=_['intersection'](_0x2aa269[_0x9007('0x38')],_0x2aa269[_0x9007('0x36')]);_0x477aef['attributes']=_['intersection'](_0x2aa269[_0x9007('0x38')],qs[_0x9007('0x39')](_0x302f15[_0x9007('0x36')][_0x9007('0x39')]));_0x477aef[_0x9007('0x3a')]=_0x477aef[_0x9007('0x3a')][_0x9007('0x3b')]?_0x477aef[_0x9007('0x3a')]:_0x2aa269[_0x9007('0x38')];if(!_0x302f15[_0x9007('0x36')][_0x9007('0x3c')](_0x9007('0x3d'))){_0x477aef[_0x9007('0x1f')]=qs[_0x9007('0x1f')](_0x302f15[_0x9007('0x36')][_0x9007('0x1f')]);_0x477aef[_0x9007('0x1d')]=qs['offset'](_0x302f15[_0x9007('0x36')][_0x9007('0x1d')]);}_0x477aef[_0x9007('0x3e')]=qs[_0x9007('0x3f')](_0x302f15[_0x9007('0x36')]['sort']);_0x477aef[_0x9007('0x40')]=qs[_0x9007('0x37')](_[_0x9007('0x41')](_0x302f15['query'],_0x2aa269['filters']),_0x43cff1);if(_0x302f15[_0x9007('0x36')][_0x9007('0x42')]){_0x477aef['where']=_[_0x9007('0x43')](_0x477aef['where'],{'$or':_[_0x9007('0x34')](_0x43cff1,function(_0x4c5e28){if(_0x4c5e28[_0x9007('0x32')]!==_0x9007('0x44')){var _0x4e33aa={};_0x4e33aa[_0x4c5e28[_0x9007('0x2d')]]={'$like':'%'+_0x302f15[_0x9007('0x36')]['filter']+'%'};return _0x4e33aa;}})});}_0x477aef=_[_0x9007('0x43')]({},_0x477aef,_0x302f15['options']);var _0x11d7e4={'where':_0x477aef['where']};return db[_0x9007('0x2f')]['count'](_0x11d7e4)[_0x9007('0x26')](function(_0x5282a0){_0x5b1958['count']=_0x5282a0;if(_0x302f15['query'][_0x9007('0x45')]){_0x477aef['include']=[{'all':!![]}];}return db[_0x9007('0x2f')][_0x9007('0x46')](_0x477aef);})[_0x9007('0x26')](function(_0x3e6e4d){_0x5b1958[_0x9007('0x47')]=_0x3e6e4d;return _0x5b1958;})[_0x9007('0x26')](respondWithFilteredResult(_0x11f550,_0x477aef))[_0x9007('0x48')](handleError(_0x11f550,null));};exports[_0x9007('0x49')]=function(_0xa5be6a,_0x1cda38){var _0xb9b284={'raw':![],'where':{'id':_0xa5be6a[_0x9007('0x4a')]['id']}},_0x134934={};_0x134934[_0x9007('0x38')]=_[_0x9007('0x35')](db[_0x9007('0x2f')]['rawAttributes']);_0x134934['query']=_[_0x9007('0x35')](_0xa5be6a[_0x9007('0x36')]);_0x134934[_0x9007('0x37')]=_[_0x9007('0x4b')](_0x134934[_0x9007('0x38')],_0x134934[_0x9007('0x36')]);_0xb9b284['attributes']=_[_0x9007('0x4b')](_0x134934[_0x9007('0x38')],qs[_0x9007('0x39')](_0xa5be6a[_0x9007('0x36')][_0x9007('0x39')]));_0xb9b284['attributes']=_0xb9b284[_0x9007('0x3a')][_0x9007('0x3b')]?_0xb9b284['attributes']:_0x134934[_0x9007('0x38')];if(_0xa5be6a[_0x9007('0x36')]['includeAll']){_0xb9b284[_0x9007('0x4c')]=[{'all':!![]}];}_0xb9b284=_[_0x9007('0x43')]({},_0xb9b284,_0xa5be6a[_0x9007('0x4d')]);return db[_0x9007('0x2f')][_0x9007('0x4e')](_0xb9b284)['then'](handleEntityNotFound(_0x1cda38,null))[_0x9007('0x26')](respondWithResult(_0x1cda38,null))['catch'](handleError(_0x1cda38,null));};exports[_0x9007('0x4f')]=function(_0x503a6a,_0x2738f4){return db['AnalyticCustomReport'][_0x9007('0x4f')](_0x503a6a[_0x9007('0x50')],{})[_0x9007('0x26')](function(_0x38a4dd){var _0x2b3027=_0x503a6a['user'][_0x9007('0x28')]({'plain':!![]});if(!_0x2b3027)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b3027[_0x9007('0x51')]===_0x9007('0x52')){var _0x48c0c4=_0x38a4dd['get']({'plain':!![]});var _0x36c479='Reports';return db[_0x9007('0x53')]['find']({'where':{'name':_0x36c479,'userProfileId':_0x2b3027[_0x9007('0x54')]},'raw':!![]})[_0x9007('0x26')](function(_0x2c04bc){if(_0x2c04bc&&_0x2c04bc[_0x9007('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x48c0c4[_0x9007('0x2d')],'resourceId':_0x48c0c4['id'],'type':_0x9007('0x29'),'sectionId':_0x2c04bc['id']},{})[_0x9007('0x26')](function(){return _0x38a4dd;});}else{return _0x38a4dd;}})[_0x9007('0x48')](function(_0x20e176){logger[_0x9007('0x2b')](_0x9007('0x56'),_0x20e176);throw _0x20e176;});}return _0x38a4dd;})[_0x9007('0x26')](respondWithResult(_0x2738f4,0xc9))[_0x9007('0x48')](handleError(_0x2738f4,null));};exports[_0x9007('0x25')]=function(_0x2709bc,_0x4d1b8e){if(_0x2709bc['body']['id']){delete _0x2709bc[_0x9007('0x50')]['id'];}return db['AnalyticCustomReport'][_0x9007('0x4e')]({'where':{'id':_0x2709bc['params']['id']}})['then'](handleEntityNotFound(_0x4d1b8e,null))['then'](saveUpdates(_0x2709bc['body'],null))[_0x9007('0x26')](respondWithResult(_0x4d1b8e,null))[_0x9007('0x48')](handleError(_0x4d1b8e,null));};exports[_0x9007('0x27')]=function(_0x2fed69,_0x441da8){return db['AnalyticCustomReport'][_0x9007('0x4e')]({'where':{'id':_0x2fed69[_0x9007('0x4a')]['id']}})[_0x9007('0x26')](handleEntityNotFound(_0x441da8,null))[_0x9007('0x26')](removeEntity(_0x441da8,null))['catch'](handleError(_0x441da8,null));};exports[_0x9007('0x57')]=function(_0x1dbb8c,_0x1082d5){var _0x114185=0xa;var _0x100f56=[_0x9007('0x58'),'left_join','right_join',_0x9007('0x59')];var _0x4abae3={'SUM':_0x9007('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9007('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x9007('0x5c'),'GROUP_CONCAT':_0x9007('0x5d'),'GROUP_CONCAT ASC':_0x9007('0x5e'),'GROUP_CONCAT DESC':_0x9007('0x5f')};var _0x18d5c2={'SEC_TO_TIME':_0x9007('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9007('0x61')};var _0x37676a=function(_0x3086bc){return!_[_0x9007('0x62')]([_0x9007('0x63'),_0x9007('0x64'),_0x9007('0x65'),'IS\x20NOT\x20EMPTY'],_0x3086bc);};var _0x5a158a=function(_0x4b4496){if(!_0x4b4496||!_0x4b4496[_0x9007('0x66')]['length']){return'';}for(var _0x133133='(',_0x5c7d01=0x0;_0x5c7d01<_0x4b4496[_0x9007('0x66')][_0x9007('0x3b')];_0x5c7d01+=0x1){_0x5c7d01>0x0&&(_0x133133+='\x20'+_0x4b4496[_0x9007('0x67')]+'\x20');_0x133133+=_0x4b4496[_0x9007('0x66')][_0x5c7d01][_0x9007('0x68')]?_0x5a158a(_0x4b4496['rules'][_0x5c7d01]['group']):_0x4b4496[_0x9007('0x66')][_0x5c7d01][_0x9007('0x69')]+'\x20'+_0x4b4496[_0x9007('0x66')][_0x5c7d01][_0x9007('0x6a')]+(_0x37676a(_0x4b4496[_0x9007('0x66')][_0x5c7d01][_0x9007('0x6a')])?'\x20'+_0x4b4496[_0x9007('0x66')][_0x5c7d01][_0x9007('0x6b')]:'');}return _0x133133+')';};var _0x11fa28={'where':{'id':_0x1dbb8c[_0x9007('0x4a')]['id']}},_0x1f8538,_0x56c58d,_0x301a69,_0x146990,_0x514b42;_0x11fa28=_[_0x9007('0x43')]({},_0x11fa28,_0x1dbb8c['options']);return db['AnalyticCustomReport']['find'](_0x11fa28)[_0x9007('0x26')](function(_0x263215){if(_0x263215){_0x1f8538=_0x263215;return _0x263215[_0x9007('0x6c')]();}return null;})[_0x9007('0x26')](function(_0x10272c){if(_0x10272c){if(!_0x10272c[_0x9007('0x3b')]){throw new db[(_0x9007('0x6d'))][(_0x9007('0x6e'))](_0x9007('0x6f'),0x193);}_0x56c58d=_0x10272c;return db[_0x9007('0x70')][_0x9007('0x46')]({'raw':!![]});}return null;})[_0x9007('0x26')](function(_0x3ed135){if(_0x3ed135){_0x301a69=_['keyBy'](_0x3ed135,'id');var _0x265574;var _0xf34d6a=squel[_0x9007('0x71')]();_0xf34d6a[_0x9007('0x72')](_0x1f8538[_0x9007('0x73')]);for(var _0x58c6ef=0x0;_0x58c6ef<_0x56c58d[_0x9007('0x3b')];_0x58c6ef+=0x1){_0x265574=_0x56c58d[_0x58c6ef][_0x9007('0x74')]?_0x301a69[_0x56c58d[_0x58c6ef][_0x9007('0x74')]][_0x9007('0x75')]:_0x56c58d[_0x58c6ef][_0x9007('0x69')];_0x265574=_0x56c58d[_0x58c6ef]['function']?_[_0x9007('0x76')](_0x4abae3[_0x56c58d[_0x58c6ef][_0x9007('0x77')]],'%s',_0x265574):_0x265574;_0x265574=_0x56c58d[_0x58c6ef][_0x9007('0x78')]?_[_0x9007('0x76')](_0x18d5c2[_0x56c58d[_0x58c6ef][_0x9007('0x78')]],'%s',_0x265574):_0x265574;if(_0x56c58d[_0x58c6ef][_0x9007('0x79')]){_0xf34d6a[_0x9007('0x68')](_0x265574);}_0x56c58d[_0x58c6ef]['orderBy']&&_0xf34d6a['order'](_0x265574,_0x56c58d[_0x58c6ef][_0x9007('0x7a')]===_0x9007('0x7b')?![]:!![]);_0xf34d6a['field'](_0x265574,_0x56c58d[_0x58c6ef][_0x9007('0x7c')]||_0x265574);}if(_0x1f8538[_0x9007('0x7d')]){_0x1f8538['joins']=JSON[_0x9007('0x7e')](_0x1f8538[_0x9007('0x7d')]);for(var _0x1dd92e=0x0;_0x1dd92e<_0x1f8538[_0x9007('0x7d')][_0x9007('0x3b')];_0x1dd92e+=0x1){if(_0x1f8538[_0x9007('0x7d')][_0x1dd92e][_0x9007('0x32')]&&_['includes'](_0x100f56,_0x1f8538[_0x9007('0x7d')][_0x1dd92e][_0x9007('0x32')])&&_0x1f8538[_0x9007('0x7d')][_0x1dd92e]['parentKey']&&_0x1f8538[_0x9007('0x7d')][_0x1dd92e][_0x9007('0x7f')]&&_0x1f8538[_0x9007('0x7d')][_0x1dd92e][_0x9007('0x80')]){_0xf34d6a[_0x1f8538[_0x9007('0x7d')][_0x1dd92e][_0x9007('0x32')]](_0x1f8538[_0x9007('0x7d')][_0x1dd92e][_0x9007('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1f8538[_0x9007('0x73')],_0x1f8538[_0x9007('0x7d')][_0x1dd92e][_0x9007('0x81')],_0x1f8538['joins'][_0x1dd92e][_0x9007('0x7f')],_0x1f8538['joins'][_0x1dd92e][_0x9007('0x80')]));}}}if(_0x1f8538[_0x9007('0x82')]){_0x1f8538[_0x9007('0x82')]=JSON[_0x9007('0x7e')](_0x1f8538['conditions']);_0xf34d6a[_0x9007('0x40')](_0x5a158a(_0x1f8538[_0x9007('0x82')][_0x9007('0x68')]));}_0x514b42=_0xf34d6a[_0x9007('0x83')]();_0xf34d6a[_0x9007('0x1f')](_0x114185);_0xf34d6a['offset'](0x0);logger[_0x9007('0x84')]('Limited\x20Query:',_0xf34d6a[_0x9007('0x85')]());return dbH['sequelize']['query'](_0xf34d6a[_0x9007('0x85')](),{'type':dbH[_0x9007('0x86')][_0x9007('0x87')]['SELECT']});}})[_0x9007('0x26')](respondWithResult(_0x1082d5,null))[_0x9007('0x48')](handleError(_0x1082d5,null));};function runReport(_0x31ca5e,_0x3dcbb4,_0xd41a59){var _0xa13a34=_0x3dcbb4[_0x9007('0x2d')];var _0x10e285=0xa;var _0x2d694c=[_0x9007('0x58'),_0x9007('0x88'),_0x9007('0x89'),_0x9007('0x59')];var _0x2ce573={'SUM':_0x9007('0x5a'),'COUNT':_0x9007('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9007('0x8b'),'MIN':'MIN(%s)','AVG':_0x9007('0x5c'),'GROUP_CONCAT':_0x9007('0x5d'),'GROUP_CONCAT ASC':_0x9007('0x5e'),'GROUP_CONCAT DESC':_0x9007('0x5f')};var _0xd9fe03={'SEC_TO_TIME':_0x9007('0x60'),'DATE':_0x9007('0x8c'),'HOUR':_0x9007('0x8d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9007('0x61')};var _0x38b7ac=function(_0x5c6a4b){return!_[_0x9007('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x9007('0x65'),_0x9007('0x8e')],_0x5c6a4b);};var _0x2d9d00=function(_0x23221b){if(!_0x23221b||!_0x23221b[_0x9007('0x66')][_0x9007('0x3b')]){return'';}for(var _0x284ac9='(',_0x36f069=0x0;_0x36f069<_0x23221b[_0x9007('0x66')][_0x9007('0x3b')];_0x36f069+=0x1){_0x36f069>0x0&&(_0x284ac9+='\x20'+_0x23221b[_0x9007('0x67')]+'\x20');_0x284ac9+=_0x23221b[_0x9007('0x66')][_0x36f069][_0x9007('0x68')]?_0x2d9d00(_0x23221b[_0x9007('0x66')][_0x36f069]['group']):_0x23221b[_0x9007('0x66')][_0x36f069][_0x9007('0x69')]+'\x20'+_0x23221b['rules'][_0x36f069][_0x9007('0x6a')]+(_0x38b7ac(_0x23221b[_0x9007('0x66')][_0x36f069][_0x9007('0x6a')])?'\x20'+_0x23221b['rules'][_0x36f069][_0x9007('0x6b')]:'');}return _0x284ac9+')';};var _0xc6637c={'where':{'id':_0x31ca5e['id']}},_0x8ee6b3,_0xbb4d15,_0x367db6,_0x4184f8,_0x48ee83;_0xc6637c=_[_0x9007('0x43')]({},_0xc6637c,_0xd41a59);return db[_0x9007('0x2f')][_0x9007('0x4e')](_0xc6637c)['then'](function(_0x5a3062){if(_0x5a3062){_0x8ee6b3=_0x5a3062;return _0x5a3062[_0x9007('0x6c')]();}return null;})[_0x9007('0x26')](function(_0xfaa9a8){if(_0xfaa9a8){if(!_0xfaa9a8[_0x9007('0x3b')]){throw new db[(_0x9007('0x6d'))][(_0x9007('0x6e'))](_0x9007('0x6f'),0x193);}_0xbb4d15=_0xfaa9a8;return db[_0x9007('0x70')][_0x9007('0x46')]({'raw':!![]});}return null;})[_0x9007('0x26')](function(_0x1a9f59){if(_0x1a9f59){_0x367db6=_[_0x9007('0x8f')](_0x1a9f59,'id');var _0x294315;var _0x422c93=squel['select']();_0x422c93[_0x9007('0x72')](_0x8ee6b3['table']);for(var _0x32840c=0x0;_0x32840c<_0xbb4d15[_0x9007('0x3b')];_0x32840c+=0x1){_0x294315=_0xbb4d15[_0x32840c][_0x9007('0x74')]?_0x367db6[_0xbb4d15[_0x32840c][_0x9007('0x74')]][_0x9007('0x75')]:_0xbb4d15[_0x32840c][_0x9007('0x69')];_0x294315=_0xbb4d15[_0x32840c][_0x9007('0x77')]?_[_0x9007('0x76')](_0x2ce573[_0xbb4d15[_0x32840c][_0x9007('0x77')]],'%s',_0x294315):_0x294315;_0x294315=_0xbb4d15[_0x32840c][_0x9007('0x78')]?_[_0x9007('0x76')](_0xd9fe03[_0xbb4d15[_0x32840c]['format']],'%s',_0x294315):_0x294315;if(_0xbb4d15[_0x32840c][_0x9007('0x79')]){_0x422c93[_0x9007('0x68')](_0x294315);}_0xbb4d15[_0x32840c][_0x9007('0x7a')]&&_0x422c93[_0x9007('0x3e')](_0x294315,_0xbb4d15[_0x32840c][_0x9007('0x7a')]===_0x9007('0x7b')?![]:!![]);_0x422c93[_0x9007('0x69')](_0x294315,_0xbb4d15[_0x32840c]['alias']||_0x294315);}if(_0x8ee6b3['joins']){_0x8ee6b3[_0x9007('0x7d')]=JSON['parse'](_0x8ee6b3[_0x9007('0x7d')]);for(var _0x37d7cb=0x0;_0x37d7cb<_0x8ee6b3[_0x9007('0x7d')][_0x9007('0x3b')];_0x37d7cb+=0x1){if(_0x8ee6b3['joins'][_0x37d7cb]['type']&&_[_0x9007('0x62')](_0x2d694c,_0x8ee6b3['joins'][_0x37d7cb][_0x9007('0x32')])&&_0x8ee6b3[_0x9007('0x7d')][_0x37d7cb][_0x9007('0x81')]&&_0x8ee6b3['joins'][_0x37d7cb][_0x9007('0x7f')]&&_0x8ee6b3['joins'][_0x37d7cb][_0x9007('0x80')]){_0x422c93[_0x8ee6b3['joins'][_0x37d7cb]['type']](_0x8ee6b3[_0x9007('0x7d')][_0x37d7cb][_0x9007('0x7f')],null,util[_0x9007('0x78')](_0x9007('0x90'),_0x8ee6b3[_0x9007('0x73')],_0x8ee6b3['joins'][_0x37d7cb][_0x9007('0x81')],_0x8ee6b3[_0x9007('0x7d')][_0x37d7cb][_0x9007('0x7f')],_0x8ee6b3['joins'][_0x37d7cb]['foreignKey']));}}}if(_0x8ee6b3[_0x9007('0x82')]){_0x8ee6b3[_0x9007('0x82')]=JSON[_0x9007('0x7e')](_0x8ee6b3['conditions']);_0x422c93[_0x9007('0x40')](_0x2d9d00(_0x8ee6b3[_0x9007('0x82')][_0x9007('0x68')]));}_0x48ee83=_0x422c93['clone']();_0x422c93[_0x9007('0x1f')](_0x10e285);_0x422c93[_0x9007('0x1d')](0x0);return;}})[_0x9007('0x26')](function(){if(_0x3dcbb4['output']===_0x9007('0x91')){return null;}var _0x4880a8=_[_0x9007('0x43')](_0x3dcbb4,{'name':_0x3dcbb4['fullPath']||_0x3dcbb4[_0x9007('0x2d')]||_0x8ee6b3['name'],'basename':_0xa13a34,'savename':util[_0x9007('0x78')](_0x9007('0x92'),_0x3dcbb4[_0x9007('0x2d')]||_0x8ee6b3[_0x9007('0x2d')],require('randomstring')[_0x9007('0x93')](0x4),_0x3dcbb4[_0x9007('0x94')]||_0x9007('0x95')),'reportId':_0x8ee6b3['id'],'reportType':_0x9007('0x96')});return db[_0x9007('0x97')][_0x9007('0x4f')](_0x4880a8,{'raw':!![]});})['then'](function(_0x247b0d){if(_0x8ee6b3['table']===_0x9007('0x98')){_0x48ee83['where'](_0x8ee6b3[_0x9007('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3dcbb4[_0x9007('0x99')],_0x3dcbb4[_0x9007('0x9a')]);}else{_0x48ee83['where'](_0x8ee6b3['table']+_0x9007('0x9b'),_0x3dcbb4[_0x9007('0x99')],_0x3dcbb4['endDate']);}if(_0x247b0d){logger['info'](_0x9007('0x9c'),_0x48ee83[_0x9007('0x85')]());require(_0x9007('0x9d'))[_0x9007('0x9e')](path['join'](__dirname,_0x9007('0x9f'),_0x247b0d[_0x9007('0x94')]),[_0x247b0d['id'],_0x48ee83[_0x9007('0x85')](),path['join'](__dirname,_0x9007('0xa0'),_0x247b0d[_0x9007('0xa1')]),_0xa13a34]);return _0x247b0d;}else{var _0x2d6574=squel[_0x9007('0x71')]();_0x2d6574[_0x9007('0x72')]('('+_0x48ee83['toString']()+')',_0x9007('0xa2'));_0x2d6574['field'](_0x9007('0xa3'),_0x9007('0x20'));_0x48ee83['limit'](_0x3dcbb4[_0x9007('0x1f')]||_0x10e285);_0x48ee83['offset'](_0x3dcbb4[_0x9007('0x1d')]||0x0);return dbH['sequelize'][_0x9007('0x36')](_0x2d6574['toString'](),{'type':dbH[_0x9007('0x86')]['QueryTypes']['SELECT']})['then'](function(_0x22f87e){if(!_0x22f87e[_0x9007('0x3b')]){_0x4184f8=0x0;}else{_0x4184f8=_0x22f87e[0x0][_0x9007('0x20')]||0x0;}return dbH[_0x9007('0x86')][_0x9007('0x36')](_0x48ee83[_0x9007('0x85')](),{'type':dbH[_0x9007('0x86')][_0x9007('0x87')][_0x9007('0xa4')]});})[_0x9007('0x26')](function(_0x3bcafa){return{'rows':_0x3bcafa||[],'count':_0x4184f8};});}});}exports[_0x9007('0xa5')]=function(_0x2b6a84,_0x3befc6){return runReport(_0x2b6a84[_0x9007('0x4a')],_0x2b6a84[_0x9007('0x36')],_0x2b6a84[_0x9007('0x4d')])[_0x9007('0x26')](respondWithResult(_0x3befc6,null))[_0x9007('0x48')](handleError(_0x3befc6,null));};exports[_0x9007('0xa6')]=runReport;exports[_0x9007('0x36')]=function(_0x288986,_0x21df81){var _0x364f6b=0xa;var _0x4b9412=['join',_0x9007('0x88'),_0x9007('0x89'),_0x9007('0x59')];var _0x3cc46b={'SUM':_0x9007('0x5a'),'COUNT':_0x9007('0x8a'),'COUNT DISTINCT':_0x9007('0x5b'),'MAX':_0x9007('0x8b'),'MIN':'MIN(%s)','AVG':_0x9007('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9007('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x280640={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x9007('0x8d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9007('0x61')};var _0x2063f0=function(_0x3597fd){return!_[_0x9007('0x62')](['IS\x20NULL',_0x9007('0x64'),'IS\x20EMPTY',_0x9007('0x8e')],_0x3597fd);};var _0x18313a=function(_0xd35045){if(!_0xd35045||!_0xd35045[_0x9007('0x66')][_0x9007('0x3b')]){return'';}for(var _0x355a56='(',_0x148923=0x0;_0x148923<_0xd35045[_0x9007('0x66')][_0x9007('0x3b')];_0x148923+=0x1){_0x148923>0x0&&(_0x355a56+='\x20'+_0xd35045['operator']+'\x20');_0x355a56+=_0xd35045[_0x9007('0x66')][_0x148923][_0x9007('0x68')]?_0x18313a(_0xd35045[_0x9007('0x66')][_0x148923][_0x9007('0x68')]):_0xd35045[_0x9007('0x66')][_0x148923][_0x9007('0x69')]+'\x20'+_0xd35045['rules'][_0x148923][_0x9007('0x6a')]+(_0x2063f0(_0xd35045[_0x9007('0x66')][_0x148923][_0x9007('0x6a')])?'\x20'+_0xd35045['rules'][_0x148923]['value']:'');}return _0x355a56+')';};var _0x944976={'where':{'id':_0x288986[_0x9007('0x4a')]['id']}},_0x5ef233,_0xd688a1,_0x3d51b7,_0x5ba36c,_0x5e4087;_0x944976=_[_0x9007('0x43')]({},_0x944976,_0x288986[_0x9007('0x4d')]);return db['AnalyticCustomReport'][_0x9007('0x4e')](_0x944976)[_0x9007('0x26')](function(_0x3f78b2){if(_0x3f78b2){_0x5ef233=_0x3f78b2;return _0x3f78b2[_0x9007('0x6c')]();}return null;})[_0x9007('0x26')](function(_0x564172){if(_0x564172){if(!_0x564172[_0x9007('0x3b')]){throw new db[(_0x9007('0x6d'))][(_0x9007('0x6e'))](_0x9007('0x6f'),0x193);}_0xd688a1=_0x564172;return db[_0x9007('0x70')][_0x9007('0x46')]({'raw':!![]});}return null;})[_0x9007('0x26')](function(_0x4b43d5){if(_0x4b43d5){_0x3d51b7=_[_0x9007('0x8f')](_0x4b43d5,'id');var _0x375e91;var _0x26e0dd=squel['select']();_0x26e0dd[_0x9007('0x72')](_0x5ef233['table']);for(var _0x510728=0x0;_0x510728<_0xd688a1[_0x9007('0x3b')];_0x510728+=0x1){_0x375e91=_0xd688a1[_0x510728][_0x9007('0x74')]?_0x3d51b7[_0xd688a1[_0x510728][_0x9007('0x74')]][_0x9007('0x75')]:_0xd688a1[_0x510728][_0x9007('0x69')];_0x375e91=_0xd688a1[_0x510728][_0x9007('0x77')]?_[_0x9007('0x76')](_0x3cc46b[_0xd688a1[_0x510728][_0x9007('0x77')]],'%s',_0x375e91):_0x375e91;_0x375e91=_0xd688a1[_0x510728][_0x9007('0x78')]?_[_0x9007('0x76')](_0x280640[_0xd688a1[_0x510728]['format']],'%s',_0x375e91):_0x375e91;if(_0xd688a1[_0x510728][_0x9007('0x79')]){_0x26e0dd[_0x9007('0x68')](_0x375e91);}_0xd688a1[_0x510728][_0x9007('0x7a')]&&_0x26e0dd['order'](_0x375e91,_0xd688a1[_0x510728][_0x9007('0x7a')]===_0x9007('0x7b')?![]:!![]);_0x26e0dd[_0x9007('0x69')](_0x375e91,_0xd688a1[_0x510728]['alias']||_0x375e91);}if(_0x5ef233[_0x9007('0x7d')]){_0x5ef233[_0x9007('0x7d')]=JSON[_0x9007('0x7e')](_0x5ef233['joins']);for(var _0x4ae579=0x0;_0x4ae579<_0x5ef233[_0x9007('0x7d')][_0x9007('0x3b')];_0x4ae579+=0x1){if(_0x5ef233[_0x9007('0x7d')][_0x4ae579][_0x9007('0x32')]&&_[_0x9007('0x62')](_0x4b9412,_0x5ef233[_0x9007('0x7d')][_0x4ae579][_0x9007('0x32')])&&_0x5ef233['joins'][_0x4ae579][_0x9007('0x81')]&&_0x5ef233[_0x9007('0x7d')][_0x4ae579]['foreignTable']&&_0x5ef233[_0x9007('0x7d')][_0x4ae579][_0x9007('0x80')]){_0x26e0dd[_0x5ef233[_0x9007('0x7d')][_0x4ae579][_0x9007('0x32')]](_0x5ef233['joins'][_0x4ae579]['foreignTable'],null,util[_0x9007('0x78')](_0x9007('0x90'),_0x5ef233[_0x9007('0x73')],_0x5ef233[_0x9007('0x7d')][_0x4ae579][_0x9007('0x81')],_0x5ef233[_0x9007('0x7d')][_0x4ae579]['foreignTable'],_0x5ef233[_0x9007('0x7d')][_0x4ae579][_0x9007('0x80')]));}}}if(_0x5ef233[_0x9007('0x82')]){_0x5ef233[_0x9007('0x82')]=JSON[_0x9007('0x7e')](_0x5ef233[_0x9007('0x82')]);_0x26e0dd[_0x9007('0x40')](_0x18313a(_0x5ef233[_0x9007('0x82')][_0x9007('0x68')]));}_0x5e4087=_0x26e0dd[_0x9007('0x83')]();_0x26e0dd['limit'](_0x364f6b);_0x26e0dd[_0x9007('0x1d')](0x0);logger[_0x9007('0x84')](_0x9007('0xa7'),_0x26e0dd['toString']());return dbH['sequelize'][_0x9007('0x36')](_0x26e0dd['toString'](),{'type':dbH[_0x9007('0x86')][_0x9007('0x87')][_0x9007('0xa4')]});}})['then'](function(){return{'sql':_0x5e4087[_0x9007('0x85')]()};})[_0x9007('0x26')](respondWithResult(_0x21df81,null))['catch'](handleError(_0x21df81,null));};
\ No newline at end of file
+var _0xafb7=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','COUNT(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','getFields','Sequelize','parse','output','%s-%s.%s','randomstring','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','savename','countTable','runReport','debug','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','fieldName','type','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body'];(function(_0x5569ce,_0x2b9554){var _0x5a31a0=function(_0x2931ab){while(--_0x2931ab){_0x5569ce['push'](_0x5569ce['shift']());}};_0x5a31a0(++_0x2b9554);}(_0xafb7,0x19a));var _0x7afb=function(_0x3bad8e,_0x1105b8){_0x3bad8e=_0x3bad8e-0x0;var _0x182495=_0xafb7[_0x3bad8e];return _0x182495;};'use strict';var emlformat=require(_0x7afb('0x0'));var rimraf=require(_0x7afb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7afb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7afb('0x3'));var util=require(_0x7afb('0x4'));var path=require(_0x7afb('0x5'));var sox=require(_0x7afb('0x6'));var csv=require(_0x7afb('0x7'));var ejs=require(_0x7afb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7afb('0x9'));var squel=require('squel');var crypto=require(_0x7afb('0xa'));var jsforce=require(_0x7afb('0xb'));var deskjs=require(_0x7afb('0xc'));var toCsv=require(_0x7afb('0x7'));var querystring=require(_0x7afb('0xd'));var Papa=require(_0x7afb('0xe'));var Redis=require('ioredis');var authService=require(_0x7afb('0xf'));var qs=require(_0x7afb('0x10'));var as=require(_0x7afb('0x11'));var hardwareService=require(_0x7afb('0x12'));var logger=require('../../config/logger')(_0x7afb('0x13'));var utils=require(_0x7afb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7afb('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x7afb('0x16'))[_0x7afb('0x17')];function respondWithStatusCode(_0xa0cdff,_0x52fd36){_0x52fd36=_0x52fd36||0xcc;return function(_0x328139){if(_0x328139){return _0xa0cdff[_0x7afb('0x18')](_0x52fd36);}return _0xa0cdff[_0x7afb('0x19')](_0x52fd36)[_0x7afb('0x1a')]();};}function respondWithResult(_0x44505a,_0x1309b5){_0x1309b5=_0x1309b5||0xc8;return function(_0x4fd0b1){if(_0x4fd0b1){return _0x44505a['status'](_0x1309b5)[_0x7afb('0x1b')](_0x4fd0b1);}};}function respondWithFilteredResult(_0x3ff984,_0x19dea8){return function(_0x4a4f46){if(_0x4a4f46){var _0x4beddd=typeof _0x19dea8[_0x7afb('0x1c')]===_0x7afb('0x1d')&&typeof _0x19dea8[_0x7afb('0x1e')]===_0x7afb('0x1d');var _0x11a008=_0x4a4f46[_0x7afb('0x1f')];var _0x36c8b8=_0x4beddd?0x0:_0x19dea8[_0x7afb('0x1c')];var _0x33d162=_0x4beddd?_0x4a4f46[_0x7afb('0x1f')]:_0x19dea8[_0x7afb('0x1c')]+_0x19dea8['limit'];var _0x1830b9;if(_0x33d162>=_0x11a008){_0x33d162=_0x11a008;_0x1830b9=0xc8;}else{_0x1830b9=0xce;}_0x3ff984['status'](_0x1830b9);return _0x3ff984[_0x7afb('0x20')](_0x7afb('0x21'),_0x36c8b8+'-'+_0x33d162+'/'+_0x11a008)['json'](_0x4a4f46);}return null;};}function patchUpdates(_0x5554a6){return function(_0x5b075b){try{jsonpatch[_0x7afb('0x22')](_0x5b075b,_0x5554a6,!![]);}catch(_0x698ad5){return BPromise[_0x7afb('0x23')](_0x698ad5);}return _0x5b075b[_0x7afb('0x24')]();};}function saveUpdates(_0x35c039,_0x2bad55){return function(_0x479d5c){if(_0x479d5c){return _0x479d5c['update'](_0x35c039)['then'](function(_0x3f47b1){return _0x3f47b1;});}return null;};}function removeEntity(_0x2a0ab8,_0x224239){return function(_0x183483){if(_0x183483){return _0x183483[_0x7afb('0x25')]()[_0x7afb('0x26')](function(){var _0x3f46d8=_0x183483[_0x7afb('0x27')]({'plain':!![]});var _0x46acac=_0x7afb('0x28');return db[_0x7afb('0x29')]['destroy']({'where':{'type':_0x46acac,'resourceId':_0x3f46d8['id']}})['then'](function(){return _0x183483;});})[_0x7afb('0x26')](function(){_0x2a0ab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c9bd,_0x227c2c){return function(_0x5e047c){if(!_0x5e047c){_0x31c9bd[_0x7afb('0x18')](0x194);}return _0x5e047c;};}function handleError(_0x119e22,_0x5339fa){_0x5339fa=_0x5339fa||0x1f4;return function(_0xe7c78e){logger[_0x7afb('0x2a')](_0xe7c78e[_0x7afb('0x2b')]);if(_0xe7c78e['name']){delete _0xe7c78e[_0x7afb('0x2c')];}_0x119e22[_0x7afb('0x19')](_0x5339fa)[_0x7afb('0x2d')](_0xe7c78e);};}exports[_0x7afb('0x2e')]=function(_0xda1d98,_0x2b2cfb){var _0xb39d07={},_0x12b378={},_0x24ce0e={'count':0x0,'rows':[]};var _0x3578d9=_['map'](db[_0x7afb('0x2f')]['rawAttributes'],function(_0x44e39c){return{'name':_0x44e39c[_0x7afb('0x30')],'type':_0x44e39c[_0x7afb('0x31')]['key']};});_0x12b378[_0x7afb('0x32')]=_[_0x7afb('0x33')](_0x3578d9,_0x7afb('0x2c'));_0x12b378[_0x7afb('0x34')]=_[_0x7afb('0x35')](_0xda1d98[_0x7afb('0x34')]);_0x12b378['filters']=_['intersection'](_0x12b378[_0x7afb('0x32')],_0x12b378['query']);_0xb39d07[_0x7afb('0x36')]=_[_0x7afb('0x37')](_0x12b378['model'],qs[_0x7afb('0x38')](_0xda1d98['query'][_0x7afb('0x38')]));_0xb39d07[_0x7afb('0x36')]=_0xb39d07[_0x7afb('0x36')][_0x7afb('0x39')]?_0xb39d07['attributes']:_0x12b378[_0x7afb('0x32')];if(!_0xda1d98[_0x7afb('0x34')][_0x7afb('0x3a')]('nolimit')){_0xb39d07['limit']=qs[_0x7afb('0x1e')](_0xda1d98[_0x7afb('0x34')][_0x7afb('0x1e')]);_0xb39d07['offset']=qs['offset'](_0xda1d98[_0x7afb('0x34')][_0x7afb('0x1c')]);}_0xb39d07[_0x7afb('0x3b')]=qs[_0x7afb('0x3c')](_0xda1d98[_0x7afb('0x34')]['sort']);_0xb39d07[_0x7afb('0x3d')]=qs[_0x7afb('0x3e')](_['pick'](_0xda1d98['query'],_0x12b378[_0x7afb('0x3e')]),_0x3578d9);if(_0xda1d98[_0x7afb('0x34')]['filter']){_0xb39d07['where']=_[_0x7afb('0x3f')](_0xb39d07[_0x7afb('0x3d')],{'$or':_[_0x7afb('0x33')](_0x3578d9,function(_0x1686dd){if(_0x1686dd['type']!==_0x7afb('0x40')){var _0x363ae6={};_0x363ae6[_0x1686dd[_0x7afb('0x2c')]]={'$like':'%'+_0xda1d98['query']['filter']+'%'};return _0x363ae6;}})});}_0xb39d07=_[_0x7afb('0x3f')]({},_0xb39d07,_0xda1d98['options']);var _0x5d5ce8={'where':_0xb39d07[_0x7afb('0x3d')]};return db['AnalyticCustomReport'][_0x7afb('0x1f')](_0x5d5ce8)['then'](function(_0x4baf45){_0x24ce0e[_0x7afb('0x1f')]=_0x4baf45;if(_0xda1d98[_0x7afb('0x34')][_0x7afb('0x41')]){_0xb39d07[_0x7afb('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x7afb('0x43')](_0xb39d07);})['then'](function(_0x5d2765){_0x24ce0e[_0x7afb('0x44')]=_0x5d2765;return _0x24ce0e;})[_0x7afb('0x26')](respondWithFilteredResult(_0x2b2cfb,_0xb39d07))[_0x7afb('0x45')](handleError(_0x2b2cfb,null));};exports[_0x7afb('0x46')]=function(_0x1250d9,_0xdb3411){var _0x50c316={'raw':![],'where':{'id':_0x1250d9[_0x7afb('0x47')]['id']}},_0x3b3bec={};_0x3b3bec[_0x7afb('0x32')]=_[_0x7afb('0x35')](db[_0x7afb('0x2f')][_0x7afb('0x48')]);_0x3b3bec[_0x7afb('0x34')]=_['keys'](_0x1250d9[_0x7afb('0x34')]);_0x3b3bec[_0x7afb('0x3e')]=_[_0x7afb('0x37')](_0x3b3bec[_0x7afb('0x32')],_0x3b3bec['query']);_0x50c316['attributes']=_[_0x7afb('0x37')](_0x3b3bec[_0x7afb('0x32')],qs[_0x7afb('0x38')](_0x1250d9[_0x7afb('0x34')][_0x7afb('0x38')]));_0x50c316[_0x7afb('0x36')]=_0x50c316[_0x7afb('0x36')][_0x7afb('0x39')]?_0x50c316[_0x7afb('0x36')]:_0x3b3bec[_0x7afb('0x32')];if(_0x1250d9[_0x7afb('0x34')][_0x7afb('0x41')]){_0x50c316['include']=[{'all':!![]}];}_0x50c316=_[_0x7afb('0x3f')]({},_0x50c316,_0x1250d9[_0x7afb('0x49')]);return db[_0x7afb('0x2f')]['find'](_0x50c316)[_0x7afb('0x26')](handleEntityNotFound(_0xdb3411,null))[_0x7afb('0x26')](respondWithResult(_0xdb3411,null))['catch'](handleError(_0xdb3411,null));};exports['create']=function(_0x34185b,_0x25f7d4){return db['AnalyticCustomReport'][_0x7afb('0x4a')](_0x34185b[_0x7afb('0x4b')],{})[_0x7afb('0x26')](function(_0x3af4ff){var _0x434aac=_0x34185b['user'][_0x7afb('0x27')]({'plain':!![]});if(!_0x434aac)throw new Error(_0x7afb('0x4c'));if(_0x434aac[_0x7afb('0x4d')]===_0x7afb('0x4e')){var _0x1d2ff3=_0x3af4ff[_0x7afb('0x27')]({'plain':!![]});var _0xae136d=_0x7afb('0x4f');return db[_0x7afb('0x50')][_0x7afb('0x51')]({'where':{'name':_0xae136d,'userProfileId':_0x434aac[_0x7afb('0x52')]},'raw':!![]})[_0x7afb('0x26')](function(_0x163d10){if(_0x163d10&&_0x163d10[_0x7afb('0x53')]===0x0){return db[_0x7afb('0x29')][_0x7afb('0x4a')]({'name':_0x1d2ff3[_0x7afb('0x2c')],'resourceId':_0x1d2ff3['id'],'type':_0x7afb('0x28'),'sectionId':_0x163d10['id']},{})[_0x7afb('0x26')](function(){return _0x3af4ff;});}else{return _0x3af4ff;}})[_0x7afb('0x45')](function(_0xeb94f5){logger['error'](_0x7afb('0x54'),_0xeb94f5);throw _0xeb94f5;});}return _0x3af4ff;})[_0x7afb('0x26')](respondWithResult(_0x25f7d4,0xc9))[_0x7afb('0x45')](handleError(_0x25f7d4,null));};exports[_0x7afb('0x55')]=function(_0x3b37f4,_0x94a227){if(_0x3b37f4['body']['id']){delete _0x3b37f4[_0x7afb('0x4b')]['id'];}return db['AnalyticCustomReport'][_0x7afb('0x51')]({'where':{'id':_0x3b37f4['params']['id']}})[_0x7afb('0x26')](handleEntityNotFound(_0x94a227,null))['then'](saveUpdates(_0x3b37f4[_0x7afb('0x4b')],null))['then'](respondWithResult(_0x94a227,null))[_0x7afb('0x45')](handleError(_0x94a227,null));};exports['destroy']=function(_0x23faff,_0x2e907c){return db[_0x7afb('0x2f')][_0x7afb('0x51')]({'where':{'id':_0x23faff[_0x7afb('0x47')]['id']}})[_0x7afb('0x26')](handleEntityNotFound(_0x2e907c,null))[_0x7afb('0x26')](removeEntity(_0x2e907c,null))[_0x7afb('0x45')](handleError(_0x2e907c,null));};exports['preview']=function(_0x4b828d,_0x3a882e){var _0x514725=0xa;var _0x9df32e=[_0x7afb('0x56'),_0x7afb('0x57'),_0x7afb('0x58'),'cross_join'];var _0x2206ec={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7afb('0x59'),'MAX':_0x7afb('0x5a'),'MIN':_0x7afb('0x5b'),'AVG':_0x7afb('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7afb('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x38bde9={'SEC_TO_TIME':_0x7afb('0x5e'),'DATE':_0x7afb('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x7afb('0x60'),'UNIX_TIMESTAMP':_0x7afb('0x61')};var _0xa65cc7=function(_0x50ec09){return!_[_0x7afb('0x62')]([_0x7afb('0x63'),_0x7afb('0x64'),_0x7afb('0x65'),_0x7afb('0x66')],_0x50ec09);};var _0x44b4dc=function(_0x4c6139){if(!_0x4c6139||!_0x4c6139[_0x7afb('0x67')][_0x7afb('0x39')]){return'';}for(var _0x2fe5fc='(',_0xb6c167=0x0;_0xb6c167<_0x4c6139[_0x7afb('0x67')]['length'];_0xb6c167+=0x1){_0xb6c167>0x0&&(_0x2fe5fc+='\x20'+_0x4c6139[_0x7afb('0x68')]+'\x20');_0x2fe5fc+=_0x4c6139['rules'][_0xb6c167][_0x7afb('0x69')]?_0x44b4dc(_0x4c6139[_0x7afb('0x67')][_0xb6c167][_0x7afb('0x69')]):_0x4c6139[_0x7afb('0x67')][_0xb6c167][_0x7afb('0x6a')]+'\x20'+_0x4c6139[_0x7afb('0x67')][_0xb6c167][_0x7afb('0x6b')]+(_0xa65cc7(_0x4c6139[_0x7afb('0x67')][_0xb6c167]['condition'])?'\x20'+_0x4c6139['rules'][_0xb6c167][_0x7afb('0x6c')]:'');}return _0x2fe5fc+')';};var _0x47ba72={'where':{'id':_0x4b828d[_0x7afb('0x47')]['id']}},_0x548327,_0x1c7b06,_0x3168b0,_0x205982,_0x39030d;_0x47ba72=_['merge']({},_0x47ba72,_0x4b828d['options']);return db[_0x7afb('0x2f')][_0x7afb('0x51')](_0x47ba72)[_0x7afb('0x26')](function(_0x3f4bcd){if(_0x3f4bcd){_0x548327=_0x3f4bcd;return _0x3f4bcd['getFields']();}return null;})[_0x7afb('0x26')](function(_0x5383bc){if(_0x5383bc){if(!_0x5383bc[_0x7afb('0x39')]){throw new db['Sequelize'][(_0x7afb('0x6d'))](_0x7afb('0x6e'),0x193);}_0x1c7b06=_0x5383bc;return db[_0x7afb('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x459132){if(_0x459132){_0x3168b0=_[_0x7afb('0x70')](_0x459132,'id');var _0x3f0498;var _0x39bd67=squel[_0x7afb('0x71')]();_0x39bd67[_0x7afb('0x72')](_0x548327[_0x7afb('0x73')]);for(var _0x2bcb74=0x0;_0x2bcb74<_0x1c7b06[_0x7afb('0x39')];_0x2bcb74+=0x1){_0x3f0498=_0x1c7b06[_0x2bcb74][_0x7afb('0x74')]?_0x3168b0[_0x1c7b06[_0x2bcb74][_0x7afb('0x74')]][_0x7afb('0x75')]:_0x1c7b06[_0x2bcb74]['field'];_0x3f0498=_0x1c7b06[_0x2bcb74][_0x7afb('0x76')]?_[_0x7afb('0x77')](_0x2206ec[_0x1c7b06[_0x2bcb74]['function']],'%s',_0x3f0498):_0x3f0498;_0x3f0498=_0x1c7b06[_0x2bcb74]['format']?_[_0x7afb('0x77')](_0x38bde9[_0x1c7b06[_0x2bcb74][_0x7afb('0x78')]],'%s',_0x3f0498):_0x3f0498;if(_0x1c7b06[_0x2bcb74][_0x7afb('0x79')]){_0x39bd67[_0x7afb('0x69')](_0x3f0498);}_0x1c7b06[_0x2bcb74][_0x7afb('0x7a')]&&_0x39bd67['order'](_0x3f0498,_0x1c7b06[_0x2bcb74][_0x7afb('0x7a')]===_0x7afb('0x7b')?![]:!![]);_0x39bd67[_0x7afb('0x6a')](_0x3f0498,_0x1c7b06[_0x2bcb74][_0x7afb('0x7c')]||_0x3f0498);}if(_0x548327[_0x7afb('0x7d')]){_0x548327[_0x7afb('0x7d')]=JSON['parse'](_0x548327['joins']);for(var _0x371bc8=0x0;_0x371bc8<_0x548327[_0x7afb('0x7d')][_0x7afb('0x39')];_0x371bc8+=0x1){if(_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x31')]&&_['includes'](_0x9df32e,_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x31')])&&_0x548327['joins'][_0x371bc8][_0x7afb('0x7e')]&&_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x7f')]&&_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x80')]){_0x39bd67[_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x31')]](_0x548327['joins'][_0x371bc8][_0x7afb('0x7f')],null,util[_0x7afb('0x78')](_0x7afb('0x81'),_0x548327[_0x7afb('0x73')],_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x7e')],_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x7f')],_0x548327[_0x7afb('0x7d')][_0x371bc8][_0x7afb('0x80')]));}}}if(_0x548327[_0x7afb('0x82')]){_0x548327[_0x7afb('0x82')]=JSON['parse'](_0x548327[_0x7afb('0x82')]);_0x39bd67['where'](_0x44b4dc(_0x548327[_0x7afb('0x82')][_0x7afb('0x69')]));}_0x39030d=_0x39bd67[_0x7afb('0x83')]();_0x39bd67[_0x7afb('0x1e')](_0x514725);_0x39bd67[_0x7afb('0x1c')](0x0);logger['debug'](_0x7afb('0x84'),_0x39bd67[_0x7afb('0x85')]());return dbH[_0x7afb('0x86')][_0x7afb('0x34')](_0x39bd67[_0x7afb('0x85')](),{'type':dbH[_0x7afb('0x86')][_0x7afb('0x87')][_0x7afb('0x88')]});}})['then'](respondWithResult(_0x3a882e,null))[_0x7afb('0x45')](handleError(_0x3a882e,null));};function runReport(_0x1a58a7,_0x4025ec,_0x544ec2){var _0x1e1a13=_0x4025ec[_0x7afb('0x2c')];var _0x54d221=0xa;var _0x179a25=[_0x7afb('0x56'),'left_join',_0x7afb('0x58'),_0x7afb('0x89')];var _0x4e4a51={'SUM':_0x7afb('0x8a'),'COUNT':_0x7afb('0x8b'),'COUNT DISTINCT':_0x7afb('0x59'),'MAX':_0x7afb('0x5a'),'MIN':_0x7afb('0x5b'),'AVG':_0x7afb('0x5c'),'GROUP_CONCAT':_0x7afb('0x8c'),'GROUP_CONCAT ASC':_0x7afb('0x5d'),'GROUP_CONCAT DESC':_0x7afb('0x8d')};var _0x230724={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7afb('0x5f'),'HOUR':_0x7afb('0x8e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7afb('0x61')};var _0x223407=function(_0x5f41de){return!_[_0x7afb('0x62')]([_0x7afb('0x63'),_0x7afb('0x64'),_0x7afb('0x65'),_0x7afb('0x66')],_0x5f41de);};var _0x343b57=function(_0x4c1dc8){if(!_0x4c1dc8||!_0x4c1dc8[_0x7afb('0x67')][_0x7afb('0x39')]){return'';}for(var _0x3d5efb='(',_0x14f281=0x0;_0x14f281<_0x4c1dc8['rules'][_0x7afb('0x39')];_0x14f281+=0x1){_0x14f281>0x0&&(_0x3d5efb+='\x20'+_0x4c1dc8[_0x7afb('0x68')]+'\x20');_0x3d5efb+=_0x4c1dc8[_0x7afb('0x67')][_0x14f281]['group']?_0x343b57(_0x4c1dc8[_0x7afb('0x67')][_0x14f281][_0x7afb('0x69')]):_0x4c1dc8[_0x7afb('0x67')][_0x14f281][_0x7afb('0x6a')]+'\x20'+_0x4c1dc8[_0x7afb('0x67')][_0x14f281]['condition']+(_0x223407(_0x4c1dc8['rules'][_0x14f281][_0x7afb('0x6b')])?'\x20'+_0x4c1dc8[_0x7afb('0x67')][_0x14f281][_0x7afb('0x6c')]:'');}return _0x3d5efb+')';};var _0x2a08ee={'where':{'id':_0x1a58a7['id']}},_0x40bb7f,_0x28c8ae,_0x91c490,_0x2af096,_0x1301f1;_0x2a08ee=_[_0x7afb('0x3f')]({},_0x2a08ee,_0x544ec2);return db['AnalyticCustomReport'][_0x7afb('0x51')](_0x2a08ee)[_0x7afb('0x26')](function(_0x36933a){if(_0x36933a){_0x40bb7f=_0x36933a;return _0x36933a[_0x7afb('0x8f')]();}return null;})[_0x7afb('0x26')](function(_0x2cba3a){if(_0x2cba3a){if(!_0x2cba3a[_0x7afb('0x39')]){throw new db[(_0x7afb('0x90'))][(_0x7afb('0x6d'))](_0x7afb('0x6e'),0x193);}_0x28c8ae=_0x2cba3a;return db['AnalyticMetric'][_0x7afb('0x43')]({'raw':!![]});}return null;})[_0x7afb('0x26')](function(_0x4b13ff){if(_0x4b13ff){_0x91c490=_[_0x7afb('0x70')](_0x4b13ff,'id');var _0x334bde;var _0x1114ab=squel[_0x7afb('0x71')]();_0x1114ab[_0x7afb('0x72')](_0x40bb7f[_0x7afb('0x73')]);for(var _0x43d333=0x0;_0x43d333<_0x28c8ae[_0x7afb('0x39')];_0x43d333+=0x1){_0x334bde=_0x28c8ae[_0x43d333][_0x7afb('0x74')]?_0x91c490[_0x28c8ae[_0x43d333][_0x7afb('0x74')]][_0x7afb('0x75')]:_0x28c8ae[_0x43d333][_0x7afb('0x6a')];_0x334bde=_0x28c8ae[_0x43d333]['function']?_[_0x7afb('0x77')](_0x4e4a51[_0x28c8ae[_0x43d333][_0x7afb('0x76')]],'%s',_0x334bde):_0x334bde;_0x334bde=_0x28c8ae[_0x43d333][_0x7afb('0x78')]?_['replace'](_0x230724[_0x28c8ae[_0x43d333][_0x7afb('0x78')]],'%s',_0x334bde):_0x334bde;if(_0x28c8ae[_0x43d333][_0x7afb('0x79')]){_0x1114ab['group'](_0x334bde);}_0x28c8ae[_0x43d333]['orderBy']&&_0x1114ab[_0x7afb('0x3b')](_0x334bde,_0x28c8ae[_0x43d333][_0x7afb('0x7a')]===_0x7afb('0x7b')?![]:!![]);_0x1114ab[_0x7afb('0x6a')](_0x334bde,_0x28c8ae[_0x43d333][_0x7afb('0x7c')]||_0x334bde);}if(_0x40bb7f['joins']){_0x40bb7f[_0x7afb('0x7d')]=JSON[_0x7afb('0x91')](_0x40bb7f[_0x7afb('0x7d')]);for(var _0x157980=0x0;_0x157980<_0x40bb7f['joins'][_0x7afb('0x39')];_0x157980+=0x1){if(_0x40bb7f[_0x7afb('0x7d')][_0x157980][_0x7afb('0x31')]&&_[_0x7afb('0x62')](_0x179a25,_0x40bb7f[_0x7afb('0x7d')][_0x157980][_0x7afb('0x31')])&&_0x40bb7f[_0x7afb('0x7d')][_0x157980][_0x7afb('0x7e')]&&_0x40bb7f[_0x7afb('0x7d')][_0x157980][_0x7afb('0x7f')]&&_0x40bb7f['joins'][_0x157980][_0x7afb('0x80')]){_0x1114ab[_0x40bb7f['joins'][_0x157980]['type']](_0x40bb7f[_0x7afb('0x7d')][_0x157980]['foreignTable'],null,util[_0x7afb('0x78')]('%s.%s\x20=\x20%s.%s',_0x40bb7f['table'],_0x40bb7f[_0x7afb('0x7d')][_0x157980][_0x7afb('0x7e')],_0x40bb7f[_0x7afb('0x7d')][_0x157980][_0x7afb('0x7f')],_0x40bb7f[_0x7afb('0x7d')][_0x157980][_0x7afb('0x80')]));}}}if(_0x40bb7f[_0x7afb('0x82')]){_0x40bb7f['conditions']=JSON[_0x7afb('0x91')](_0x40bb7f[_0x7afb('0x82')]);_0x1114ab[_0x7afb('0x3d')](_0x343b57(_0x40bb7f[_0x7afb('0x82')][_0x7afb('0x69')]));}_0x1301f1=_0x1114ab[_0x7afb('0x83')]();_0x1114ab[_0x7afb('0x1e')](_0x54d221);_0x1114ab[_0x7afb('0x1c')](0x0);return;}})[_0x7afb('0x26')](function(){if(_0x4025ec[_0x7afb('0x92')]==='web'){return null;}var _0x3a97f9=_[_0x7afb('0x3f')](_0x4025ec,{'name':_0x4025ec['fullPath']||_0x4025ec[_0x7afb('0x2c')]||_0x40bb7f[_0x7afb('0x2c')],'basename':_0x1e1a13,'savename':util[_0x7afb('0x78')](_0x7afb('0x93'),_0x4025ec[_0x7afb('0x2c')]||_0x40bb7f[_0x7afb('0x2c')],require(_0x7afb('0x94'))['generate'](0x4),_0x4025ec[_0x7afb('0x92')]||_0x7afb('0x95')),'reportId':_0x40bb7f['id'],'reportType':_0x7afb('0x96')});return db['AnalyticExtractedReport'][_0x7afb('0x4a')](_0x3a97f9,{'raw':!![]});})[_0x7afb('0x26')](function(_0x2cbfa8){if(_0x40bb7f['table']==='cdr'){_0x1301f1[_0x7afb('0x3d')](_0x40bb7f['table']+_0x7afb('0x97'),_0x4025ec[_0x7afb('0x98')],_0x4025ec['endDate']);}else{_0x1301f1['where'](_0x40bb7f[_0x7afb('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4025ec['startDate'],_0x4025ec[_0x7afb('0x99')]);}if(_0x2cbfa8){logger[_0x7afb('0x9a')](_0x7afb('0x9b'),_0x1301f1[_0x7afb('0x85')]());require(_0x7afb('0x9c'))[_0x7afb('0x9d')](path[_0x7afb('0x56')](__dirname,'../../components/export/',_0x2cbfa8[_0x7afb('0x92')]),[_0x2cbfa8['id'],_0x1301f1[_0x7afb('0x85')](),path[_0x7afb('0x56')](__dirname,'../../files/reports',_0x2cbfa8[_0x7afb('0x9e')]),_0x1e1a13]);return _0x2cbfa8;}else{var _0x39f0ce=squel[_0x7afb('0x71')]();_0x39f0ce[_0x7afb('0x72')]('('+_0x1301f1[_0x7afb('0x85')]()+')',_0x7afb('0x9f'));_0x39f0ce[_0x7afb('0x6a')]('COUNT(*)','count');_0x1301f1[_0x7afb('0x1e')](_0x4025ec[_0x7afb('0x1e')]||_0x54d221);_0x1301f1[_0x7afb('0x1c')](_0x4025ec['offset']||0x0);return dbH['sequelize'][_0x7afb('0x34')](_0x39f0ce[_0x7afb('0x85')](),{'type':dbH[_0x7afb('0x86')][_0x7afb('0x87')][_0x7afb('0x88')]})[_0x7afb('0x26')](function(_0x4a136e){if(!_0x4a136e[_0x7afb('0x39')]){_0x2af096=0x0;}else{_0x2af096=_0x4a136e[0x0][_0x7afb('0x1f')]||0x0;}return dbH[_0x7afb('0x86')][_0x7afb('0x34')](_0x1301f1[_0x7afb('0x85')](),{'type':dbH[_0x7afb('0x86')][_0x7afb('0x87')]['SELECT']});})[_0x7afb('0x26')](function(_0x3898c5){return{'rows':_0x3898c5||[],'count':_0x2af096};});}});}exports['run']=function(_0xe723f4,_0x1d1699){return runReport(_0xe723f4[_0x7afb('0x47')],_0xe723f4['query'],_0xe723f4['options'])[_0x7afb('0x26')](respondWithResult(_0x1d1699,null))[_0x7afb('0x45')](handleError(_0x1d1699,null));};exports[_0x7afb('0xa0')]=runReport;exports[_0x7afb('0x34')]=function(_0x5dc5c9,_0x2e0fe5){var _0x15d3bf=0xa;var _0x563039=[_0x7afb('0x56'),'left_join',_0x7afb('0x58'),_0x7afb('0x89')];var _0x1d56d2={'SUM':'SUM(%s)','COUNT':_0x7afb('0x8b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7afb('0x5a'),'MIN':_0x7afb('0x5b'),'AVG':_0x7afb('0x5c'),'GROUP_CONCAT':_0x7afb('0x8c'),'GROUP_CONCAT ASC':_0x7afb('0x5d'),'GROUP_CONCAT DESC':_0x7afb('0x8d')};var _0x33123d={'SEC_TO_TIME':_0x7afb('0x5e'),'DATE':'DATE(%s)','HOUR':_0x7afb('0x8e'),'ROUND':_0x7afb('0x60'),'UNIX_TIMESTAMP':_0x7afb('0x61')};var _0x1290c1=function(_0x87bdfc){return!_['includes']([_0x7afb('0x63'),_0x7afb('0x64'),_0x7afb('0x65'),'IS\x20NOT\x20EMPTY'],_0x87bdfc);};var _0x2b31a4=function(_0x6379e9){if(!_0x6379e9||!_0x6379e9[_0x7afb('0x67')]['length']){return'';}for(var _0x1b0ed9='(',_0xd91650=0x0;_0xd91650<_0x6379e9['rules']['length'];_0xd91650+=0x1){_0xd91650>0x0&&(_0x1b0ed9+='\x20'+_0x6379e9[_0x7afb('0x68')]+'\x20');_0x1b0ed9+=_0x6379e9['rules'][_0xd91650][_0x7afb('0x69')]?_0x2b31a4(_0x6379e9['rules'][_0xd91650][_0x7afb('0x69')]):_0x6379e9[_0x7afb('0x67')][_0xd91650][_0x7afb('0x6a')]+'\x20'+_0x6379e9[_0x7afb('0x67')][_0xd91650][_0x7afb('0x6b')]+(_0x1290c1(_0x6379e9[_0x7afb('0x67')][_0xd91650]['condition'])?'\x20'+_0x6379e9['rules'][_0xd91650][_0x7afb('0x6c')]:'');}return _0x1b0ed9+')';};var _0x3f308e={'where':{'id':_0x5dc5c9['params']['id']}},_0x4503f8,_0x4675e6,_0x15779a,_0x31940d,_0x11c161;_0x3f308e=_['merge']({},_0x3f308e,_0x5dc5c9['options']);return db[_0x7afb('0x2f')][_0x7afb('0x51')](_0x3f308e)[_0x7afb('0x26')](function(_0x4d7083){if(_0x4d7083){_0x4503f8=_0x4d7083;return _0x4d7083[_0x7afb('0x8f')]();}return null;})[_0x7afb('0x26')](function(_0x2d8866){if(_0x2d8866){if(!_0x2d8866['length']){throw new db[(_0x7afb('0x90'))]['ValidationErrorItem'](_0x7afb('0x6e'),0x193);}_0x4675e6=_0x2d8866;return db[_0x7afb('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x7afb('0x26')](function(_0x163baf){if(_0x163baf){_0x15779a=_[_0x7afb('0x70')](_0x163baf,'id');var _0x35b9af;var _0x55fee6=squel[_0x7afb('0x71')]();_0x55fee6[_0x7afb('0x72')](_0x4503f8[_0x7afb('0x73')]);for(var _0x18fd21=0x0;_0x18fd21<_0x4675e6[_0x7afb('0x39')];_0x18fd21+=0x1){_0x35b9af=_0x4675e6[_0x18fd21][_0x7afb('0x74')]?_0x15779a[_0x4675e6[_0x18fd21][_0x7afb('0x74')]][_0x7afb('0x75')]:_0x4675e6[_0x18fd21][_0x7afb('0x6a')];_0x35b9af=_0x4675e6[_0x18fd21][_0x7afb('0x76')]?_['replace'](_0x1d56d2[_0x4675e6[_0x18fd21]['function']],'%s',_0x35b9af):_0x35b9af;_0x35b9af=_0x4675e6[_0x18fd21][_0x7afb('0x78')]?_[_0x7afb('0x77')](_0x33123d[_0x4675e6[_0x18fd21][_0x7afb('0x78')]],'%s',_0x35b9af):_0x35b9af;if(_0x4675e6[_0x18fd21][_0x7afb('0x79')]){_0x55fee6['group'](_0x35b9af);}_0x4675e6[_0x18fd21][_0x7afb('0x7a')]&&_0x55fee6[_0x7afb('0x3b')](_0x35b9af,_0x4675e6[_0x18fd21][_0x7afb('0x7a')]===_0x7afb('0x7b')?![]:!![]);_0x55fee6[_0x7afb('0x6a')](_0x35b9af,_0x4675e6[_0x18fd21][_0x7afb('0x7c')]||_0x35b9af);}if(_0x4503f8[_0x7afb('0x7d')]){_0x4503f8['joins']=JSON[_0x7afb('0x91')](_0x4503f8[_0x7afb('0x7d')]);for(var _0x432e6f=0x0;_0x432e6f<_0x4503f8[_0x7afb('0x7d')]['length'];_0x432e6f+=0x1){if(_0x4503f8[_0x7afb('0x7d')][_0x432e6f][_0x7afb('0x31')]&&_[_0x7afb('0x62')](_0x563039,_0x4503f8[_0x7afb('0x7d')][_0x432e6f][_0x7afb('0x31')])&&_0x4503f8['joins'][_0x432e6f][_0x7afb('0x7e')]&&_0x4503f8['joins'][_0x432e6f][_0x7afb('0x7f')]&&_0x4503f8[_0x7afb('0x7d')][_0x432e6f][_0x7afb('0x80')]){_0x55fee6[_0x4503f8[_0x7afb('0x7d')][_0x432e6f]['type']](_0x4503f8[_0x7afb('0x7d')][_0x432e6f][_0x7afb('0x7f')],null,util[_0x7afb('0x78')](_0x7afb('0x81'),_0x4503f8[_0x7afb('0x73')],_0x4503f8['joins'][_0x432e6f]['parentKey'],_0x4503f8[_0x7afb('0x7d')][_0x432e6f]['foreignTable'],_0x4503f8[_0x7afb('0x7d')][_0x432e6f][_0x7afb('0x80')]));}}}if(_0x4503f8[_0x7afb('0x82')]){_0x4503f8[_0x7afb('0x82')]=JSON[_0x7afb('0x91')](_0x4503f8[_0x7afb('0x82')]);_0x55fee6['where'](_0x2b31a4(_0x4503f8[_0x7afb('0x82')][_0x7afb('0x69')]));}_0x11c161=_0x55fee6[_0x7afb('0x83')]();_0x55fee6[_0x7afb('0x1e')](_0x15d3bf);_0x55fee6[_0x7afb('0x1c')](0x0);logger[_0x7afb('0xa1')](_0x7afb('0x84'),_0x55fee6[_0x7afb('0x85')]());return dbH['sequelize'][_0x7afb('0x34')](_0x55fee6[_0x7afb('0x85')](),{'type':dbH[_0x7afb('0x86')]['QueryTypes'][_0x7afb('0x88')]});}})[_0x7afb('0x26')](function(){return{'sql':_0x11c161[_0x7afb('0x85')]()};})['then'](respondWithResult(_0x2e0fe5,null))[_0x7afb('0x45')](handleError(_0x2e0fe5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 94a094f..3b31afa 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 _0x3cc9=['exports','define','AnalyticCustomReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x108dad,_0xc3f315){var _0x6a1719=function(_0x39841e){while(--_0x39841e){_0x108dad['push'](_0x108dad['shift']());}};_0x6a1719(++_0xc3f315);}(_0x3cc9,0xac));var _0x93cc=function(_0x305752,_0x1a05e0){_0x305752=_0x305752-0x0;var _0x256745=_0x3cc9[_0x305752];return _0x256745;};'use strict';var _=require(_0x93cc('0x0'));var util=require(_0x93cc('0x1'));var logger=require(_0x93cc('0x2'))('api');var moment=require(_0x93cc('0x3'));var BPromise=require(_0x93cc('0x4'));var rp=require(_0x93cc('0x5'));var fs=require('fs');var path=require(_0x93cc('0x6'));var rimraf=require(_0x93cc('0x7'));var config=require(_0x93cc('0x8'));var attributes=require(_0x93cc('0x9'));module[_0x93cc('0xa')]=function(_0x473d9e,_0x1d31b5){return _0x473d9e[_0x93cc('0xb')](_0x93cc('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34a1=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x5495a6,_0x324a2f){var _0x88eab6=function(_0x13c12){while(--_0x13c12){_0x5495a6['push'](_0x5495a6['shift']());}};_0x88eab6(++_0x324a2f);}(_0x34a1,0xe7));var _0x134a=function(_0x3f3685,_0x1fe8ec){_0x3f3685=_0x3f3685-0x0;var _0x2f432d=_0x34a1[_0x3f3685];return _0x2f432d;};'use strict';var _=require(_0x134a('0x0'));var util=require(_0x134a('0x1'));var logger=require(_0x134a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x134a('0x3'));var rp=require(_0x134a('0x4'));var fs=require('fs');var path=require(_0x134a('0x5'));var rimraf=require(_0x134a('0x6'));var config=require(_0x134a('0x7'));var attributes=require(_0x134a('0x8'));module[_0x134a('0x9')]=function(_0x1a1220,_0x818c01){return _0x1a1220[_0x134a('0xa')](_0x134a('0xb'),attributes,{'tableName':_0x134a('0xc'),'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 ee43a11..d9897ad 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 _0xffd1=['client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2adac1,_0x1439d0){var _0x5eb909=function(_0x17bcbe){while(--_0x17bcbe){_0x2adac1['push'](_0x2adac1['shift']());}};_0x5eb909(++_0x1439d0);}(_0xffd1,0x1f1));var _0x1ffd=function(_0x4a463a,_0x16dd8d){_0x4a463a=_0x4a463a-0x0;var _0x43d08d=_0xffd1[_0x4a463a];return _0x43d08d;};'use strict';var _=require('lodash');var util=require(_0x1ffd('0x0'));var moment=require('moment');var BPromise=require(_0x1ffd('0x1'));var rs=require(_0x1ffd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ffd('0x3'))['db'];var utils=require(_0x1ffd('0x4'));var logger=require(_0x1ffd('0x5'))(_0x1ffd('0x6'));var config=require(_0x1ffd('0x7'));var jayson=require(_0x1ffd('0x8'));var client=jayson[_0x1ffd('0x9')][_0x1ffd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12edbb,_0x1b80ca,_0x39c9fd){return new BPromise(function(_0x3fccdd,_0x2f45c5){return client[_0x1ffd('0xb')](_0x12edbb,_0x39c9fd)[_0x1ffd('0xc')](function(_0x532bc){logger[_0x1ffd('0xd')](_0x1ffd('0xe'),_0x1b80ca,_0x1ffd('0xf'));logger[_0x1ffd('0x10')](_0x1ffd('0x11'),_0x1b80ca,_0x1ffd('0xf'),JSON[_0x1ffd('0x12')](_0x532bc));if(_0x532bc[_0x1ffd('0x13')]){if(_0x532bc[_0x1ffd('0x13')]['code']===0x1f4){logger[_0x1ffd('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1b80ca,_0x532bc[_0x1ffd('0x13')][_0x1ffd('0x14')]);return _0x2f45c5(_0x532bc[_0x1ffd('0x13')][_0x1ffd('0x14')]);}logger[_0x1ffd('0x13')](_0x1ffd('0xe'),_0x1b80ca,_0x532bc['error']['message']);return _0x3fccdd(_0x532bc[_0x1ffd('0x13')][_0x1ffd('0x14')]);}else{logger[_0x1ffd('0xd')](_0x1ffd('0xe'),_0x1b80ca,_0x1ffd('0xf'));_0x3fccdd(_0x532bc[_0x1ffd('0x15')][_0x1ffd('0x14')]);}})['catch'](function(_0x28f343){logger[_0x1ffd('0x13')](_0x1ffd('0xe'),_0x1b80ca,_0x28f343);_0x2f45c5(_0x28f343);});});}
\ No newline at end of file
+var _0x03cb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1b5033,_0x1bf3ba){var _0xadb853=function(_0x1d1391){while(--_0x1d1391){_0x1b5033['push'](_0x1b5033['shift']());}};_0xadb853(++_0x1bf3ba);}(_0x03cb,0x1f2));var _0xb03c=function(_0x27973c,_0x2d8b16){_0x27973c=_0x27973c-0x0;var _0x2ef123=_0x03cb[_0x27973c];return _0x2ef123;};'use strict';var _=require(_0xb03c('0x0'));var util=require(_0xb03c('0x1'));var moment=require(_0xb03c('0x2'));var BPromise=require(_0xb03c('0x3'));var rs=require(_0xb03c('0x4'));var fs=require('fs');var Redis=require(_0xb03c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb03c('0x6'));var logger=require(_0xb03c('0x7'))('rpc');var config=require(_0xb03c('0x8'));var jayson=require(_0xb03c('0x9'));var client=jayson[_0xb03c('0xa')][_0xb03c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x209f9c,_0x24301f,_0x4916d4){return new BPromise(function(_0x2a77ba,_0xcb67bc){return client[_0xb03c('0xc')](_0x209f9c,_0x4916d4)[_0xb03c('0xd')](function(_0x1e7dc7){logger[_0xb03c('0xe')](_0xb03c('0xf'),_0x24301f,_0xb03c('0x10'));logger[_0xb03c('0x11')](_0xb03c('0x12'),_0x24301f,'request\x20sent',JSON[_0xb03c('0x13')](_0x1e7dc7));if(_0x1e7dc7[_0xb03c('0x14')]){if(_0x1e7dc7[_0xb03c('0x14')]['code']===0x1f4){logger[_0xb03c('0x14')](_0xb03c('0xf'),_0x24301f,_0x1e7dc7['error'][_0xb03c('0x15')]);return _0xcb67bc(_0x1e7dc7[_0xb03c('0x14')][_0xb03c('0x15')]);}logger[_0xb03c('0x14')](_0xb03c('0xf'),_0x24301f,_0x1e7dc7[_0xb03c('0x14')][_0xb03c('0x15')]);return _0x2a77ba(_0x1e7dc7[_0xb03c('0x14')][_0xb03c('0x15')]);}else{logger[_0xb03c('0xe')](_0xb03c('0xf'),_0x24301f,_0xb03c('0x10'));_0x2a77ba(_0x1e7dc7[_0xb03c('0x16')]['message']);}})[_0xb03c('0x17')](function(_0x166c8b){logger[_0xb03c('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x24301f,_0x166c8b);_0xcb67bc(_0x166c8b);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 97e1d54..ff76baa 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 _0xb5fb=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','preview','/:id/query','query','post','create','put','update'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xb5fb,0x131));var _0xbb5f=function(_0x2abde0,_0x34c56e){_0x2abde0=_0x2abde0-0x0;var _0x33d1e6=_0xb5fb[_0x2abde0];return _0x33d1e6;};'use strict';var multer=require(_0xbb5f('0x0'));var util=require('util');var path=require(_0xbb5f('0x1'));var timeout=require('connect-timeout');var express=require(_0xbb5f('0x2'));var router=express['Router']();var fs_extra=require(_0xbb5f('0x3'));var auth=require(_0xbb5f('0x4'));var interaction=require(_0xbb5f('0x5'));var config=require(_0xbb5f('0x6'));var controller=require(_0xbb5f('0x7'));router[_0xbb5f('0x8')]('/',auth[_0xbb5f('0x9')](),controller['index']);router['get'](_0xbb5f('0xa'),auth[_0xbb5f('0x9')](),controller['show']);router['get']('/:id/preview',auth[_0xbb5f('0x9')](),controller[_0xbb5f('0xb')]);router[_0xbb5f('0x8')]('/:id/run',auth[_0xbb5f('0x9')](),controller['run']);router[_0xbb5f('0x8')](_0xbb5f('0xc'),auth[_0xbb5f('0x9')](),controller[_0xbb5f('0xd')]);router[_0xbb5f('0xe')]('/',auth[_0xbb5f('0x9')](),controller[_0xbb5f('0xf')]);router[_0xbb5f('0x10')](_0xbb5f('0xa'),auth[_0xbb5f('0x9')](),controller[_0xbb5f('0x11')]);router['delete']('/:id',auth[_0xbb5f('0x9')](),controller['destroy']);module[_0xbb5f('0x12')]=router;
\ No newline at end of file
+var _0xc526=['express','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','post','create','put','update','delete','exports','multer','connect-timeout'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc526,0xcf));var _0x6c52=function(_0x6f75f4,_0x2b7618){_0x6f75f4=_0x6f75f4-0x0;var _0x443f6f=_0xc526[_0x6f75f4];return _0x443f6f;};'use strict';var multer=require(_0x6c52('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6c52('0x1'));var express=require(_0x6c52('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6c52('0x3'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x6c52('0x4')]('/',auth[_0x6c52('0x5')](),controller[_0x6c52('0x6')]);router['get'](_0x6c52('0x7'),auth[_0x6c52('0x5')](),controller[_0x6c52('0x8')]);router[_0x6c52('0x4')](_0x6c52('0x9'),auth[_0x6c52('0x5')](),controller[_0x6c52('0xa')]);router[_0x6c52('0x4')](_0x6c52('0xb'),auth['isAuthenticated'](),controller['run']);router['get'](_0x6c52('0xc'),auth[_0x6c52('0x5')](),controller['query']);router[_0x6c52('0xd')]('/',auth[_0x6c52('0x5')](),controller[_0x6c52('0xe')]);router[_0x6c52('0xf')](_0x6c52('0x7'),auth['isAuthenticated'](),controller[_0x6c52('0x10')]);router[_0x6c52('0x11')](_0x6c52('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x6c52('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 419a15a..a20395b 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 _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5214b3,_0x276ef3){_0x5214b3=_0x5214b3-0x0;var _0x383c8c=_0x8ef6[_0x5214b3];return _0x383c8c;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x31f0=['sequelize','STRING','TEXT'];(function(_0xca0228,_0x58e40a){var _0x14fc84=function(_0xc08485){while(--_0xc08485){_0xca0228['push'](_0xca0228['shift']());}};_0x14fc84(++_0x58e40a);}(_0x31f0,0xb7));var _0x031f=function(_0x12bc03,_0x103449){_0x12bc03=_0x12bc03-0x0;var _0x18720a=_0x31f0[_0x12bc03];return _0x18720a;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 132a2b8..5fbd755 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
+var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x29dc1f,_0x3ebbe8){var _0x442ad6=function(_0x4019a4){while(--_0x4019a4){_0x29dc1f['push'](_0x29dc1f['shift']());}};_0x442ad6(++_0x3ebbe8);}(_0x5fab,0x177));var _0xb5fa=function(_0x3407ee,_0xb2e716){_0x3407ee=_0x3407ee-0x0;var _0x1b0b35=_0x5fab[_0x3407ee];return _0x1b0b35;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5c18ea6..57d3aea 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 _0x6a90=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x264939,_0x3b0e5b){var _0x8db56e=function(_0x24a202){while(--_0x24a202){_0x264939['push'](_0x264939['shift']());}};_0x8db56e(++_0x3b0e5b);}(_0x6a90,0x111));var _0x06a9=function(_0x3ce3eb,_0x3e636a){_0x3ce3eb=_0x3ce3eb-0x0;var _0x10ee51=_0x6a90[_0x3ce3eb];return _0x10ee51;};'use strict';var _=require(_0x06a9('0x0'));var util=require(_0x06a9('0x1'));var logger=require(_0x06a9('0x2'))(_0x06a9('0x3'));var moment=require(_0x06a9('0x4'));var BPromise=require(_0x06a9('0x5'));var rp=require(_0x06a9('0x6'));var fs=require('fs');var path=require(_0x06a9('0x7'));var rimraf=require(_0x06a9('0x8'));var config=require(_0x06a9('0x9'));var attributes=require('./analyticDefaultReport.attributes');module[_0x06a9('0xa')]=function(_0x1cb8c3,_0x2933a1){return _0x1cb8c3['define'](_0x06a9('0xb'),attributes,{'tableName':_0x06a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe75=['path','rimraf','../../config/environment','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2cbd8c,_0x4f5428){var _0xf554ad=function(_0x5a5883){while(--_0x5a5883){_0x2cbd8c['push'](_0x2cbd8c['shift']());}};_0xf554ad(++_0x4f5428);}(_0xbe75,0x185));var _0x5be7=function(_0xfe28fe,_0x2e1f7b){_0xfe28fe=_0xfe28fe-0x0;var _0xf007af=_0xbe75[_0xfe28fe];return _0xf007af;};'use strict';var _=require(_0x5be7('0x0'));var util=require(_0x5be7('0x1'));var logger=require(_0x5be7('0x2'))(_0x5be7('0x3'));var moment=require(_0x5be7('0x4'));var BPromise=require(_0x5be7('0x5'));var rp=require(_0x5be7('0x6'));var fs=require('fs');var path=require(_0x5be7('0x7'));var rimraf=require(_0x5be7('0x8'));var config=require(_0x5be7('0x9'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x2078f8,_0x14618e){return _0x2078f8['define']('AnalyticDefaultReport',attributes,{'tableName':_0x5be7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index a6e409b..92a8fbd 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 _0x8fec=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment'];(function(_0x5cce5a,_0x298d54){var _0x354e33=function(_0xb372cf){while(--_0xb372cf){_0x5cce5a['push'](_0x5cce5a['shift']());}};_0x354e33(++_0x298d54);}(_0x8fec,0x157));var _0xc8fe=function(_0x4bbd76,_0x4ab867){_0x4bbd76=_0x4bbd76-0x0;var _0x1b5170=_0x8fec[_0x4bbd76];return _0x1b5170;};'use strict';var _=require('lodash');var util=require(_0xc8fe('0x0'));var moment=require(_0xc8fe('0x1'));var BPromise=require(_0xc8fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8fe('0x3'));var db=require(_0xc8fe('0x4'))['db'];var utils=require(_0xc8fe('0x5'));var logger=require(_0xc8fe('0x6'))(_0xc8fe('0x7'));var config=require(_0xc8fe('0x8'));var jayson=require(_0xc8fe('0x9'));var client=jayson[_0xc8fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10a41e,_0x186345,_0x105ace){return new BPromise(function(_0x3be2c8,_0x1deb53){return client[_0xc8fe('0xb')](_0x10a41e,_0x105ace)[_0xc8fe('0xc')](function(_0x3c8dfe){logger[_0xc8fe('0xd')](_0xc8fe('0xe'),_0x186345,_0xc8fe('0xf'));logger[_0xc8fe('0x10')](_0xc8fe('0x11'),_0x186345,_0xc8fe('0xf'),JSON[_0xc8fe('0x12')](_0x3c8dfe));if(_0x3c8dfe[_0xc8fe('0x13')]){if(_0x3c8dfe[_0xc8fe('0x13')]['code']===0x1f4){logger[_0xc8fe('0x13')](_0xc8fe('0xe'),_0x186345,_0x3c8dfe['error'][_0xc8fe('0x14')]);return _0x1deb53(_0x3c8dfe[_0xc8fe('0x13')][_0xc8fe('0x14')]);}logger[_0xc8fe('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x186345,_0x3c8dfe[_0xc8fe('0x13')]['message']);return _0x3be2c8(_0x3c8dfe[_0xc8fe('0x13')][_0xc8fe('0x14')]);}else{logger[_0xc8fe('0xd')](_0xc8fe('0xe'),_0x186345,_0xc8fe('0xf'));_0x3be2c8(_0x3c8dfe[_0xc8fe('0x15')][_0xc8fe('0x14')]);}})[_0xc8fe('0x16')](function(_0x3dc234){logger['error'](_0xc8fe('0xe'),_0x186345,_0x3dc234);_0x1deb53(_0x3dc234);});});}
\ No newline at end of file
+var _0x3042=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x987fe6,_0x24ac32){var _0x4fb549=function(_0x14a3d0){while(--_0x14a3d0){_0x987fe6['push'](_0x987fe6['shift']());}};_0x4fb549(++_0x24ac32);}(_0x3042,0x137));var _0x2304=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x3042[_0x368e09];return _0x14b7df;};'use strict';var _=require(_0x2304('0x0'));var util=require('util');var moment=require(_0x2304('0x1'));var BPromise=require('bluebird');var rs=require(_0x2304('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2304('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2304('0x4'))('rpc');var config=require(_0x2304('0x5'));var jayson=require(_0x2304('0x6'));var client=jayson[_0x2304('0x7')][_0x2304('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ada64,_0x2bb25e,_0x5cf342){return new BPromise(function(_0x2695c5,_0x5583ee){return client['request'](_0x4ada64,_0x5cf342)[_0x2304('0x9')](function(_0x3e6b6b){logger[_0x2304('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2bb25e,_0x2304('0xb'));logger[_0x2304('0xc')](_0x2304('0xd'),_0x2bb25e,_0x2304('0xb'),JSON[_0x2304('0xe')](_0x3e6b6b));if(_0x3e6b6b['error']){if(_0x3e6b6b['error'][_0x2304('0xf')]===0x1f4){logger[_0x2304('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2bb25e,_0x3e6b6b[_0x2304('0x10')][_0x2304('0x11')]);return _0x5583ee(_0x3e6b6b[_0x2304('0x10')][_0x2304('0x11')]);}logger[_0x2304('0x10')](_0x2304('0x12'),_0x2bb25e,_0x3e6b6b[_0x2304('0x10')][_0x2304('0x11')]);return _0x2695c5(_0x3e6b6b[_0x2304('0x10')][_0x2304('0x11')]);}else{logger[_0x2304('0xa')](_0x2304('0x12'),_0x2bb25e,_0x2304('0xb'));_0x2695c5(_0x3e6b6b[_0x2304('0x13')][_0x2304('0x11')]);}})[_0x2304('0x14')](function(_0x487bf6){logger['error'](_0x2304('0x12'),_0x2bb25e,_0x487bf6);_0x5583ee(_0x487bf6);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 63c2019..b24ce77 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 _0x03a6=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer'];(function(_0x2cadf8,_0x4995a1){var _0x4b878d=function(_0x5b67df){while(--_0x5b67df){_0x2cadf8['push'](_0x2cadf8['shift']());}};_0x4b878d(++_0x4995a1);}(_0x03a6,0xcf));var _0x603a=function(_0x5332ed,_0x5c6196){_0x5332ed=_0x5332ed-0x0;var _0x4576ac=_0x03a6[_0x5332ed];return _0x4576ac;};'use strict';var multer=require(_0x603a('0x0'));var util=require(_0x603a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x603a('0x2'));var router=express[_0x603a('0x3')]();var fs_extra=require(_0x603a('0x4'));var auth=require(_0x603a('0x5'));var interaction=require(_0x603a('0x6'));var config=require(_0x603a('0x7'));var controller=require(_0x603a('0x8'));router[_0x603a('0x9')]('/',auth[_0x603a('0xa')](),controller[_0x603a('0xb')]);router[_0x603a('0x9')](_0x603a('0xc'),auth[_0x603a('0xa')](),controller[_0x603a('0xd')]);router['get'](_0x603a('0xe'),auth[_0x603a('0xa')](),controller[_0x603a('0xf')]);router[_0x603a('0x9')](_0x603a('0x10'),auth[_0x603a('0xa')](),controller[_0x603a('0x11')]);router[_0x603a('0x9')](_0x603a('0x12'),auth[_0x603a('0xa')](),controller[_0x603a('0x13')]);router[_0x603a('0x14')]('/',auth[_0x603a('0xa')](),controller[_0x603a('0x15')]);router['put'](_0x603a('0xc'),auth[_0x603a('0xa')](),controller[_0x603a('0x16')]);router[_0x603a('0x17')](_0x603a('0xc'),auth[_0x603a('0xa')](),controller[_0x603a('0x18')]);module[_0x603a('0x19')]=router;
\ No newline at end of file
+var _0xae93=['/:id/query','post','put','/:id','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0xae93,0x1be));var _0x3ae9=function(_0x453c9f,_0x563800){_0x453c9f=_0x453c9f-0x0;var _0x3b22d3=_0xae93[_0x453c9f];return _0x3b22d3;};'use strict';var multer=require(_0x3ae9('0x0'));var util=require(_0x3ae9('0x1'));var path=require('path');var timeout=require(_0x3ae9('0x2'));var express=require(_0x3ae9('0x3'));var router=express[_0x3ae9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3ae9('0x5'));var interaction=require(_0x3ae9('0x6'));var config=require(_0x3ae9('0x7'));var controller=require(_0x3ae9('0x8'));router[_0x3ae9('0x9')]('/',auth[_0x3ae9('0xa')](),controller[_0x3ae9('0xb')]);router[_0x3ae9('0x9')]('/:id',auth[_0x3ae9('0xa')](),controller[_0x3ae9('0xc')]);router[_0x3ae9('0x9')](_0x3ae9('0xd'),auth[_0x3ae9('0xa')](),controller['preview']);router[_0x3ae9('0x9')](_0x3ae9('0xe'),auth[_0x3ae9('0xa')](),controller[_0x3ae9('0xf')]);router[_0x3ae9('0x9')](_0x3ae9('0x10'),auth[_0x3ae9('0xa')](),controller['query']);router[_0x3ae9('0x11')]('/',auth[_0x3ae9('0xa')](),controller['create']);router[_0x3ae9('0x12')](_0x3ae9('0x13'),auth[_0x3ae9('0xa')](),controller[_0x3ae9('0x14')]);router[_0x3ae9('0x15')](_0x3ae9('0x13'),auth['isAuthenticated'](),controller['destroy']);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 38ef375..37e28a3 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 _0xedc4=['ENUM','csv','xlsx','Loading','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xedc4,0x130));var _0x4edc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xedc4[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x4edc('0x0'));var moment=require(_0x4edc('0x1'));module[_0x4edc('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4edc('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x4edc('0x4')](_0x4edc('0x5'),'pdf',_0x4edc('0x6')),'allowNull':![],'defaultValue':_0x4edc('0x5')},'savename':{'type':Sequelize[_0x4edc('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x4edc('0x3')],'defaultValue':_0x4edc('0x7')},'type':{'type':Sequelize[_0x4edc('0x4')]('manual',_0x4edc('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x4edc('0x9')](0xb)[_0x4edc('0xa')]},'reportType':{'type':Sequelize[_0x4edc('0x3')]}};
\ No newline at end of file
+var _0x697e=['pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','STRING','ENUM','csv'];(function(_0x256e69,_0xa87315){var _0xd5c0e4=function(_0x4a7ab9){while(--_0x4a7ab9){_0x256e69['push'](_0x256e69['shift']());}};_0xd5c0e4(++_0xa87315);}(_0x697e,0xa3));var _0xe697=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x697e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe697('0x0'));var moment=require(_0xe697('0x1'));module['exports']={'name':{'type':Sequelize[_0xe697('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xe697('0x3')](_0xe697('0x4'),_0xe697('0x5'),_0xe697('0x6')),'allowNull':![],'defaultValue':_0xe697('0x4')},'savename':{'type':Sequelize[_0xe697('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe697('0x7')]},'endDate':{'type':Sequelize[_0xe697('0x7')]},'status':{'type':Sequelize[_0xe697('0x2')],'defaultValue':_0xe697('0x8')},'type':{'type':Sequelize[_0xe697('0x3')](_0xe697('0x9'),_0xe697('0xa')),'allowNull':![],'defaultValue':_0xe697('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xe697('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 27c1b2f..11b6f8b 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 _0x7a7c=['limit','set','Content-Range','apply','update','destroy','get','ExtractedReports','UserProfileResource','then','sendStatus','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','length','nolimit','sort','filter','where','type','VIRTUAL','count','includeAll','include','params','keys','fields','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','join','root','server/files/reports','ValidationError','exists','savename','format','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined'];(function(_0x340e0a,_0x3eba67){var _0x41bb2a=function(_0x100c98){while(--_0x100c98){_0x340e0a['push'](_0x340e0a['shift']());}};_0x41bb2a(++_0x3eba67);}(_0x7a7c,0x1ef));var _0xc7a7=function(_0x196993,_0x1075aa){_0x196993=_0x196993-0x0;var _0xb20f05=_0x7a7c[_0x196993];return _0xb20f05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc7a7('0x0'));var jsonpatch=require(_0xc7a7('0x1'));var rp=require(_0xc7a7('0x2'));var moment=require(_0xc7a7('0x3'));var BPromise=require(_0xc7a7('0x4'));var Mustache=require(_0xc7a7('0x5'));var util=require(_0xc7a7('0x6'));var path=require(_0xc7a7('0x7'));var sox=require(_0xc7a7('0x8'));var csv=require(_0xc7a7('0x9'));var ejs=require(_0xc7a7('0xa'));var fs=require('fs');var fs_extra=require(_0xc7a7('0xb'));var _=require(_0xc7a7('0xc'));var squel=require(_0xc7a7('0xd'));var crypto=require('crypto');var jsforce=require(_0xc7a7('0xe'));var deskjs=require(_0xc7a7('0xf'));var toCsv=require(_0xc7a7('0x9'));var querystring=require('querystring');var Papa=require(_0xc7a7('0x10'));var Redis=require(_0xc7a7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc7a7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7a7('0x13'))(_0xc7a7('0x14'));var utils=require(_0xc7a7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc7a7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb9181,_0x3f3f3a){_0x3f3f3a=_0x3f3f3a||0xcc;return function(_0x5f2aaa){if(_0x5f2aaa){return _0xb9181['sendStatus'](_0x3f3f3a);}return _0xb9181[_0xc7a7('0x17')](_0x3f3f3a)[_0xc7a7('0x18')]();};}function respondWithResult(_0x12fd4e,_0x560516){_0x560516=_0x560516||0xc8;return function(_0x4b5104){if(_0x4b5104){return _0x12fd4e['status'](_0x560516)['json'](_0x4b5104);}};}function respondWithFilteredResult(_0x5bdeb4,_0x393332){return function(_0x280646){if(_0x280646){var _0x42070b=typeof _0x393332[_0xc7a7('0x19')]===_0xc7a7('0x1a')&&typeof _0x393332[_0xc7a7('0x1b')]===_0xc7a7('0x1a');var _0x2c101d=_0x280646['count'];var _0x1e7199=_0x42070b?0x0:_0x393332['offset'];var _0x139609=_0x42070b?_0x280646['count']:_0x393332['offset']+_0x393332[_0xc7a7('0x1b')];var _0x346978;if(_0x139609>=_0x2c101d){_0x139609=_0x2c101d;_0x346978=0xc8;}else{_0x346978=0xce;}_0x5bdeb4[_0xc7a7('0x17')](_0x346978);return _0x5bdeb4[_0xc7a7('0x1c')](_0xc7a7('0x1d'),_0x1e7199+'-'+_0x139609+'/'+_0x2c101d)['json'](_0x280646);}return null;};}function patchUpdates(_0x1708e8){return function(_0x4e8b85){try{jsonpatch[_0xc7a7('0x1e')](_0x4e8b85,_0x1708e8,!![]);}catch(_0x590c24){return BPromise['reject'](_0x590c24);}return _0x4e8b85['save']();};}function saveUpdates(_0x14cf18,_0x2893f4){return function(_0x21822c){if(_0x21822c){return _0x21822c[_0xc7a7('0x1f')](_0x14cf18)['then'](function(_0x43dd29){return _0x43dd29;});}return null;};}function removeEntity(_0x1914c2,_0x1a4afd){return function(_0x4f78eb){if(_0x4f78eb){return _0x4f78eb[_0xc7a7('0x20')]()['then'](function(){var _0x6eff14=_0x4f78eb[_0xc7a7('0x21')]({'plain':!![]});var _0x1ef960=_0xc7a7('0x22');return db[_0xc7a7('0x23')][_0xc7a7('0x20')]({'where':{'type':_0x1ef960,'resourceId':_0x6eff14['id']}})[_0xc7a7('0x24')](function(){return _0x4f78eb;});})[_0xc7a7('0x24')](function(){_0x1914c2['status'](0xcc)[_0xc7a7('0x18')]();});}};}function handleEntityNotFound(_0x33a186,_0x48767e){return function(_0x5b4559){if(!_0x5b4559){_0x33a186[_0xc7a7('0x25')](0x194);}return _0x5b4559;};}function handleError(_0xbb42bb,_0x834d0e){_0x834d0e=_0x834d0e||0x1f4;return function(_0x354d68){logger['error'](_0x354d68[_0xc7a7('0x26')]);if(_0x354d68[_0xc7a7('0x27')]){delete _0x354d68['name'];}_0xbb42bb[_0xc7a7('0x17')](_0x834d0e)[_0xc7a7('0x28')](_0x354d68);};}exports[_0xc7a7('0x29')]=function(_0x29e2b0,_0x26515b){var _0x194f1b={},_0x29e5c6={},_0x1087d9={'count':0x0,'rows':[]};var _0x1ca0f8=_['map'](db[_0xc7a7('0x2a')][_0xc7a7('0x2b')],function(_0x3a0e50){return{'name':_0x3a0e50[_0xc7a7('0x2c')],'type':_0x3a0e50['type']['key']};});_0x29e5c6[_0xc7a7('0x2d')]=_[_0xc7a7('0x2e')](_0x1ca0f8,_0xc7a7('0x27'));_0x29e5c6[_0xc7a7('0x2f')]=_['keys'](_0x29e2b0['query']);_0x29e5c6[_0xc7a7('0x30')]=_[_0xc7a7('0x31')](_0x29e5c6[_0xc7a7('0x2d')],_0x29e5c6[_0xc7a7('0x2f')]);_0x194f1b[_0xc7a7('0x32')]=_[_0xc7a7('0x31')](_0x29e5c6['model'],qs['fields'](_0x29e2b0[_0xc7a7('0x2f')]['fields']));_0x194f1b[_0xc7a7('0x32')]=_0x194f1b[_0xc7a7('0x32')][_0xc7a7('0x33')]?_0x194f1b[_0xc7a7('0x32')]:_0x29e5c6['model'];if(!_0x29e2b0['query']['hasOwnProperty'](_0xc7a7('0x34'))){_0x194f1b[_0xc7a7('0x1b')]=qs[_0xc7a7('0x1b')](_0x29e2b0[_0xc7a7('0x2f')]['limit']);_0x194f1b[_0xc7a7('0x19')]=qs[_0xc7a7('0x19')](_0x29e2b0['query'][_0xc7a7('0x19')]);}_0x194f1b['order']=qs[_0xc7a7('0x35')](_0x29e2b0['query'][_0xc7a7('0x35')]);_0x194f1b['where']=qs[_0xc7a7('0x30')](_['pick'](_0x29e2b0[_0xc7a7('0x2f')],_0x29e5c6[_0xc7a7('0x30')]),_0x1ca0f8);if(_0x29e2b0[_0xc7a7('0x2f')][_0xc7a7('0x36')]){_0x194f1b[_0xc7a7('0x37')]=_['merge'](_0x194f1b[_0xc7a7('0x37')],{'$or':_['map'](_0x1ca0f8,function(_0x29c13a){if(_0x29c13a[_0xc7a7('0x38')]!==_0xc7a7('0x39')){var _0xbdcae8={};_0xbdcae8[_0x29c13a[_0xc7a7('0x27')]]={'$like':'%'+_0x29e2b0['query'][_0xc7a7('0x36')]+'%'};return _0xbdcae8;}})});}_0x194f1b=_['merge']({},_0x194f1b,_0x29e2b0['options']);var _0x5885c6={'where':_0x194f1b[_0xc7a7('0x37')]};return db[_0xc7a7('0x2a')][_0xc7a7('0x3a')](_0x5885c6)[_0xc7a7('0x24')](function(_0x17c816){_0x1087d9[_0xc7a7('0x3a')]=_0x17c816;if(_0x29e2b0['query'][_0xc7a7('0x3b')]){_0x194f1b[_0xc7a7('0x3c')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x194f1b);})[_0xc7a7('0x24')](function(_0x49eed5){_0x1087d9['rows']=_0x49eed5;return _0x1087d9;})['then'](respondWithFilteredResult(_0x26515b,_0x194f1b))['catch'](handleError(_0x26515b,null));};exports['show']=function(_0x31ea58,_0x38167e){var _0x4437a6={'raw':!![],'where':{'id':_0x31ea58[_0xc7a7('0x3d')]['id']}},_0x4b6e85={};_0x4b6e85['model']=_['keys'](db['AnalyticExtractedReport'][_0xc7a7('0x2b')]);_0x4b6e85['query']=_[_0xc7a7('0x3e')](_0x31ea58[_0xc7a7('0x2f')]);_0x4b6e85['filters']=_[_0xc7a7('0x31')](_0x4b6e85[_0xc7a7('0x2d')],_0x4b6e85[_0xc7a7('0x2f')]);_0x4437a6[_0xc7a7('0x32')]=_[_0xc7a7('0x31')](_0x4b6e85[_0xc7a7('0x2d')],qs[_0xc7a7('0x3f')](_0x31ea58['query']['fields']));_0x4437a6[_0xc7a7('0x32')]=_0x4437a6[_0xc7a7('0x32')]['length']?_0x4437a6[_0xc7a7('0x32')]:_0x4b6e85[_0xc7a7('0x2d')];if(_0x31ea58[_0xc7a7('0x2f')][_0xc7a7('0x3b')]){_0x4437a6[_0xc7a7('0x3c')]=[{'all':!![]}];}_0x4437a6=_[_0xc7a7('0x40')]({},_0x4437a6,_0x31ea58[_0xc7a7('0x41')]);return db[_0xc7a7('0x2a')]['find'](_0x4437a6)[_0xc7a7('0x24')](handleEntityNotFound(_0x38167e,null))[_0xc7a7('0x24')](respondWithResult(_0x38167e,null))[_0xc7a7('0x42')](handleError(_0x38167e,null));};exports[_0xc7a7('0x43')]=function(_0x3b0474,_0x438a0a){return db[_0xc7a7('0x2a')][_0xc7a7('0x43')](_0x3b0474[_0xc7a7('0x44')],{})['then'](function(_0x25aaf0){var _0xf09572=_0x3b0474[_0xc7a7('0x45')][_0xc7a7('0x21')]({'plain':!![]});if(!_0xf09572)throw new Error(_0xc7a7('0x46'));if(_0xf09572[_0xc7a7('0x47')]===_0xc7a7('0x45')){var _0x220755=_0x25aaf0[_0xc7a7('0x21')]({'plain':!![]});var _0x1b9c79=_0xc7a7('0x22');return db['UserProfileSection'][_0xc7a7('0x48')]({'where':{'name':_0x1b9c79,'userProfileId':_0xf09572['userProfileId']},'raw':!![]})[_0xc7a7('0x24')](function(_0x244fce){if(_0x244fce&&_0x244fce[_0xc7a7('0x49')]===0x0){return db['UserProfileResource'][_0xc7a7('0x43')]({'name':_0x220755[_0xc7a7('0x27')],'resourceId':_0x220755['id'],'type':_0x244fce[_0xc7a7('0x27')],'sectionId':_0x244fce['id']},{})[_0xc7a7('0x24')](function(){return _0x25aaf0;});}else{return _0x25aaf0;}})[_0xc7a7('0x42')](function(_0x4b54f0){logger[_0xc7a7('0x4a')](_0xc7a7('0x4b'),_0x4b54f0);throw _0x4b54f0;});}return _0x25aaf0;})[_0xc7a7('0x24')](respondWithResult(_0x438a0a,0xc9))['catch'](handleError(_0x438a0a,null));};exports[_0xc7a7('0x1f')]=function(_0x42c107,_0x231a5f){if(_0x42c107[_0xc7a7('0x44')]['id']){delete _0x42c107['body']['id'];}return db[_0xc7a7('0x2a')][_0xc7a7('0x48')]({'where':{'id':_0x42c107['params']['id']}})[_0xc7a7('0x24')](handleEntityNotFound(_0x231a5f,null))[_0xc7a7('0x24')](saveUpdates(_0x42c107['body'],null))[_0xc7a7('0x24')](respondWithResult(_0x231a5f,null))['catch'](handleError(_0x231a5f,null));};exports[_0xc7a7('0x20')]=function(_0x39ace1,_0x567d64){return db[_0xc7a7('0x2a')][_0xc7a7('0x48')]({'where':{'id':_0x39ace1['params']['id']}})[_0xc7a7('0x24')](handleEntityNotFound(_0x567d64,null))[_0xc7a7('0x24')](removeEntity(_0x567d64,null))['catch'](handleError(_0x567d64,null));};exports[_0xc7a7('0x4c')]=function(_0x46a03c,_0x493016,_0x53f2c5){return db[_0xc7a7('0x2a')][_0xc7a7('0x48')]({'where':{'id':_0x46a03c['params']['id']},'attributes':[_0xc7a7('0x27'),_0xc7a7('0x4d'),'savename',_0xc7a7('0x4e')],'raw':!![]})[_0xc7a7('0x24')](handleEntityNotFound(_0x493016,null))[_0xc7a7('0x24')](function(_0x50cace){if(_0x50cace){if(!fs['existsSync'](path[_0xc7a7('0x4f')](config[_0xc7a7('0x50')],_0xc7a7('0x51'),_0x50cace['savename']))){throw new db['Sequelize'][(_0xc7a7('0x52'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x46a03c[_0xc7a7('0x2f')][_0xc7a7('0x53')]){return _0x493016[_0xc7a7('0x25')](0xc8);}return _0x493016[_0xc7a7('0x4c')](path['join'](config[_0xc7a7('0x50')],_0xc7a7('0x51'),_0x50cace[_0xc7a7('0x54')]),util[_0xc7a7('0x55')]('%s.%s',_0x50cace[_0xc7a7('0x4d')]||_0x50cace[_0xc7a7('0x27')],_0x50cace[_0xc7a7('0x4e')][_0xc7a7('0x56')]()));}})[_0xc7a7('0x42')](handleError(_0x493016,null));};
\ No newline at end of file
+var _0xb9cb=['output','existsSync','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','join','server/files/reports','format','%s.%s','basename','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','catch','create','body','user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','savename'];(function(_0x2de590,_0x5c580d){var _0xe9c48d=function(_0x53a4f4){while(--_0x53a4f4){_0x2de590['push'](_0x2de590['shift']());}};_0xe9c48d(++_0x5c580d);}(_0xb9cb,0x123));var _0xbb9c=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0xb9cb[_0x1b02bb];return _0x131245;};'use strict';var emlformat=require(_0xbb9c('0x0'));var rimraf=require(_0xbb9c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb9c('0x2'));var rp=require(_0xbb9c('0x3'));var moment=require('moment');var BPromise=require(_0xbb9c('0x4'));var Mustache=require(_0xbb9c('0x5'));var util=require(_0xbb9c('0x6'));var path=require(_0xbb9c('0x7'));var sox=require('sox');var csv=require(_0xbb9c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb9c('0x9'));var _=require('lodash');var squel=require(_0xbb9c('0xa'));var crypto=require(_0xbb9c('0xb'));var jsforce=require(_0xbb9c('0xc'));var deskjs=require(_0xbb9c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbb9c('0xe'));var Papa=require(_0xbb9c('0xf'));var Redis=require(_0xbb9c('0x10'));var authService=require(_0xbb9c('0x11'));var qs=require(_0xbb9c('0x12'));var as=require(_0xbb9c('0x13'));var hardwareService=require(_0xbb9c('0x14'));var logger=require('../../config/logger')(_0xbb9c('0x15'));var utils=require('../../config/utils');var config=require(_0xbb9c('0x16'));var licenseUtil=require(_0xbb9c('0x17'));var db=require(_0xbb9c('0x18'))['db'];function respondWithStatusCode(_0x35a7e6,_0x2af566){_0x2af566=_0x2af566||0xcc;return function(_0x36e417){if(_0x36e417){return _0x35a7e6[_0xbb9c('0x19')](_0x2af566);}return _0x35a7e6['status'](_0x2af566)[_0xbb9c('0x1a')]();};}function respondWithResult(_0x374ee7,_0x5a829a){_0x5a829a=_0x5a829a||0xc8;return function(_0x12afc9){if(_0x12afc9){return _0x374ee7[_0xbb9c('0x1b')](_0x5a829a)[_0xbb9c('0x1c')](_0x12afc9);}};}function respondWithFilteredResult(_0x40ef15,_0x720598){return function(_0x5daa44){if(_0x5daa44){var _0x1cbc59=typeof _0x720598[_0xbb9c('0x1d')]===_0xbb9c('0x1e')&&typeof _0x720598[_0xbb9c('0x1f')]===_0xbb9c('0x1e');var _0x2cbb0e=_0x5daa44[_0xbb9c('0x20')];var _0x5f309b=_0x1cbc59?0x0:_0x720598[_0xbb9c('0x1d')];var _0x38360d=_0x1cbc59?_0x5daa44[_0xbb9c('0x20')]:_0x720598[_0xbb9c('0x1d')]+_0x720598[_0xbb9c('0x1f')];var _0x3a77fa;if(_0x38360d>=_0x2cbb0e){_0x38360d=_0x2cbb0e;_0x3a77fa=0xc8;}else{_0x3a77fa=0xce;}_0x40ef15[_0xbb9c('0x1b')](_0x3a77fa);return _0x40ef15[_0xbb9c('0x21')](_0xbb9c('0x22'),_0x5f309b+'-'+_0x38360d+'/'+_0x2cbb0e)['json'](_0x5daa44);}return null;};}function patchUpdates(_0x40b367){return function(_0x377702){try{jsonpatch['apply'](_0x377702,_0x40b367,!![]);}catch(_0x4b3b8b){return BPromise[_0xbb9c('0x23')](_0x4b3b8b);}return _0x377702[_0xbb9c('0x24')]();};}function saveUpdates(_0x107188,_0x254bcc){return function(_0x39df4d){if(_0x39df4d){return _0x39df4d['update'](_0x107188)[_0xbb9c('0x25')](function(_0x2ba75c){return _0x2ba75c;});}return null;};}function removeEntity(_0x26a424,_0x43aac4){return function(_0x4291f0){if(_0x4291f0){return _0x4291f0[_0xbb9c('0x26')]()[_0xbb9c('0x25')](function(){var _0x449590=_0x4291f0[_0xbb9c('0x27')]({'plain':!![]});var _0x275b90='ExtractedReports';return db['UserProfileResource'][_0xbb9c('0x26')]({'where':{'type':_0x275b90,'resourceId':_0x449590['id']}})[_0xbb9c('0x25')](function(){return _0x4291f0;});})[_0xbb9c('0x25')](function(){_0x26a424[_0xbb9c('0x1b')](0xcc)[_0xbb9c('0x1a')]();});}};}function handleEntityNotFound(_0x562899,_0x42125e){return function(_0x194e7f){if(!_0x194e7f){_0x562899[_0xbb9c('0x19')](0x194);}return _0x194e7f;};}function handleError(_0x69e5f4,_0x28ce38){_0x28ce38=_0x28ce38||0x1f4;return function(_0x53aa34){logger['error'](_0x53aa34['stack']);if(_0x53aa34[_0xbb9c('0x28')]){delete _0x53aa34['name'];}_0x69e5f4[_0xbb9c('0x1b')](_0x28ce38)['send'](_0x53aa34);};}exports['index']=function(_0x1832dc,_0x3471d2){var _0xb07d51={},_0x400a9c={},_0x3e7444={'count':0x0,'rows':[]};var _0x58025c=_[_0xbb9c('0x29')](db[_0xbb9c('0x2a')][_0xbb9c('0x2b')],function(_0x12eeda){return{'name':_0x12eeda[_0xbb9c('0x2c')],'type':_0x12eeda[_0xbb9c('0x2d')]['key']};});_0x400a9c['model']=_['map'](_0x58025c,'name');_0x400a9c['query']=_[_0xbb9c('0x2e')](_0x1832dc[_0xbb9c('0x2f')]);_0x400a9c[_0xbb9c('0x30')]=_['intersection'](_0x400a9c[_0xbb9c('0x31')],_0x400a9c[_0xbb9c('0x2f')]);_0xb07d51[_0xbb9c('0x32')]=_[_0xbb9c('0x33')](_0x400a9c[_0xbb9c('0x31')],qs[_0xbb9c('0x34')](_0x1832dc['query'][_0xbb9c('0x34')]));_0xb07d51[_0xbb9c('0x32')]=_0xb07d51['attributes']['length']?_0xb07d51[_0xbb9c('0x32')]:_0x400a9c[_0xbb9c('0x31')];if(!_0x1832dc[_0xbb9c('0x2f')][_0xbb9c('0x35')]('nolimit')){_0xb07d51[_0xbb9c('0x1f')]=qs[_0xbb9c('0x1f')](_0x1832dc[_0xbb9c('0x2f')][_0xbb9c('0x1f')]);_0xb07d51[_0xbb9c('0x1d')]=qs['offset'](_0x1832dc[_0xbb9c('0x2f')][_0xbb9c('0x1d')]);}_0xb07d51[_0xbb9c('0x36')]=qs[_0xbb9c('0x37')](_0x1832dc['query']['sort']);_0xb07d51[_0xbb9c('0x38')]=qs[_0xbb9c('0x30')](_['pick'](_0x1832dc[_0xbb9c('0x2f')],_0x400a9c[_0xbb9c('0x30')]),_0x58025c);if(_0x1832dc[_0xbb9c('0x2f')][_0xbb9c('0x39')]){_0xb07d51[_0xbb9c('0x38')]=_[_0xbb9c('0x3a')](_0xb07d51[_0xbb9c('0x38')],{'$or':_['map'](_0x58025c,function(_0x294ba4){if(_0x294ba4[_0xbb9c('0x2d')]!==_0xbb9c('0x3b')){var _0x17ea59={};_0x17ea59[_0x294ba4[_0xbb9c('0x28')]]={'$like':'%'+_0x1832dc[_0xbb9c('0x2f')][_0xbb9c('0x39')]+'%'};return _0x17ea59;}})});}_0xb07d51=_[_0xbb9c('0x3a')]({},_0xb07d51,_0x1832dc[_0xbb9c('0x3c')]);var _0x121959={'where':_0xb07d51[_0xbb9c('0x38')]};return db[_0xbb9c('0x2a')][_0xbb9c('0x20')](_0x121959)[_0xbb9c('0x25')](function(_0x309739){_0x3e7444['count']=_0x309739;if(_0x1832dc[_0xbb9c('0x2f')]['includeAll']){_0xb07d51[_0xbb9c('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xbb9c('0x3e')](_0xb07d51);})[_0xbb9c('0x25')](function(_0x4bd460){_0x3e7444[_0xbb9c('0x3f')]=_0x4bd460;return _0x3e7444;})[_0xbb9c('0x25')](respondWithFilteredResult(_0x3471d2,_0xb07d51))['catch'](handleError(_0x3471d2,null));};exports['show']=function(_0x505046,_0x9272ec){var _0x2f01ee={'raw':!![],'where':{'id':_0x505046[_0xbb9c('0x40')]['id']}},_0x57cc99={};_0x57cc99['model']=_['keys'](db[_0xbb9c('0x2a')][_0xbb9c('0x2b')]);_0x57cc99['query']=_[_0xbb9c('0x2e')](_0x505046[_0xbb9c('0x2f')]);_0x57cc99[_0xbb9c('0x30')]=_[_0xbb9c('0x33')](_0x57cc99[_0xbb9c('0x31')],_0x57cc99[_0xbb9c('0x2f')]);_0x2f01ee['attributes']=_['intersection'](_0x57cc99[_0xbb9c('0x31')],qs[_0xbb9c('0x34')](_0x505046[_0xbb9c('0x2f')][_0xbb9c('0x34')]));_0x2f01ee['attributes']=_0x2f01ee['attributes'][_0xbb9c('0x41')]?_0x2f01ee['attributes']:_0x57cc99[_0xbb9c('0x31')];if(_0x505046[_0xbb9c('0x2f')][_0xbb9c('0x42')]){_0x2f01ee[_0xbb9c('0x3d')]=[{'all':!![]}];}_0x2f01ee=_[_0xbb9c('0x3a')]({},_0x2f01ee,_0x505046[_0xbb9c('0x3c')]);return db['AnalyticExtractedReport']['find'](_0x2f01ee)[_0xbb9c('0x25')](handleEntityNotFound(_0x9272ec,null))[_0xbb9c('0x25')](respondWithResult(_0x9272ec,null))[_0xbb9c('0x43')](handleError(_0x9272ec,null));};exports[_0xbb9c('0x44')]=function(_0x45741a,_0x1df444){return db[_0xbb9c('0x2a')]['create'](_0x45741a[_0xbb9c('0x45')],{})[_0xbb9c('0x25')](function(_0x1a7b36){var _0x2435b4=_0x45741a[_0xbb9c('0x46')][_0xbb9c('0x27')]({'plain':!![]});if(!_0x2435b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2435b4[_0xbb9c('0x47')]==='user'){var _0x2a0da8=_0x1a7b36['get']({'plain':!![]});var _0x50f9dd=_0xbb9c('0x48');return db[_0xbb9c('0x49')][_0xbb9c('0x4a')]({'where':{'name':_0x50f9dd,'userProfileId':_0x2435b4[_0xbb9c('0x4b')]},'raw':!![]})['then'](function(_0x52b504){if(_0x52b504&&_0x52b504[_0xbb9c('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x2a0da8[_0xbb9c('0x28')],'resourceId':_0x2a0da8['id'],'type':_0x52b504['name'],'sectionId':_0x52b504['id']},{})[_0xbb9c('0x25')](function(){return _0x1a7b36;});}else{return _0x1a7b36;}})[_0xbb9c('0x43')](function(_0x39ca00){logger['error'](_0xbb9c('0x4d'),_0x39ca00);throw _0x39ca00;});}return _0x1a7b36;})[_0xbb9c('0x25')](respondWithResult(_0x1df444,0xc9))['catch'](handleError(_0x1df444,null));};exports[_0xbb9c('0x4e')]=function(_0x4db2b9,_0x5d80ed){if(_0x4db2b9['body']['id']){delete _0x4db2b9[_0xbb9c('0x45')]['id'];}return db[_0xbb9c('0x2a')]['find']({'where':{'id':_0x4db2b9[_0xbb9c('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d80ed,null))[_0xbb9c('0x25')](saveUpdates(_0x4db2b9[_0xbb9c('0x45')],null))['then'](respondWithResult(_0x5d80ed,null))[_0xbb9c('0x43')](handleError(_0x5d80ed,null));};exports[_0xbb9c('0x26')]=function(_0x1a5ef4,_0x394a52){return db[_0xbb9c('0x2a')]['find']({'where':{'id':_0x1a5ef4['params']['id']}})['then'](handleEntityNotFound(_0x394a52,null))[_0xbb9c('0x25')](removeEntity(_0x394a52,null))['catch'](handleError(_0x394a52,null));};exports[_0xbb9c('0x4f')]=function(_0x85fcf9,_0x20063a,_0x3849b3){return db['AnalyticExtractedReport'][_0xbb9c('0x4a')]({'where':{'id':_0x85fcf9[_0xbb9c('0x40')]['id']},'attributes':[_0xbb9c('0x28'),'basename',_0xbb9c('0x50'),_0xbb9c('0x51')],'raw':!![]})[_0xbb9c('0x25')](handleEntityNotFound(_0x20063a,null))['then'](function(_0x5edc83){if(_0x5edc83){if(!fs[_0xbb9c('0x52')](path['join'](config[_0xbb9c('0x53')],'server/files/reports',_0x5edc83[_0xbb9c('0x50')]))){throw new db[(_0xbb9c('0x54'))]['ValidationError'](_0xbb9c('0x55'));}if(_0x85fcf9[_0xbb9c('0x2f')][_0xbb9c('0x56')]){return _0x20063a['sendStatus'](0xc8);}return _0x20063a['download'](path[_0xbb9c('0x57')](config[_0xbb9c('0x53')],_0xbb9c('0x58'),_0x5edc83[_0xbb9c('0x50')]),util[_0xbb9c('0x59')](_0xbb9c('0x5a'),_0x5edc83[_0xbb9c('0x5b')]||_0x5edc83[_0xbb9c('0x28')],_0x5edc83[_0xbb9c('0x51')][_0xbb9c('0x5c')]()));}})[_0xbb9c('0x43')](handleError(_0x20063a,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 6b42644..0eac923 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 _0x2db8=['analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x4cb763,_0x5f5169){var _0x4beb7c=function(_0x1c0d73){while(--_0x1c0d73){_0x4cb763['push'](_0x4cb763['shift']());}};_0x4beb7c(++_0x5f5169);}(_0x2db8,0x90));var _0x82db=function(_0x57a56d,_0x5a6b31){_0x57a56d=_0x57a56d-0x0;var _0x202b30=_0x2db8[_0x57a56d];return _0x202b30;};'use strict';var _=require('lodash');var util=require(_0x82db('0x0'));var logger=require(_0x82db('0x1'))(_0x82db('0x2'));var moment=require(_0x82db('0x3'));var BPromise=require(_0x82db('0x4'));var rp=require(_0x82db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x82db('0x6'));var attributes=require(_0x82db('0x7'));module[_0x82db('0x8')]=function(_0x3ec653,_0x18885f){return _0x3ec653['define'](_0x82db('0x9'),attributes,{'tableName':_0x82db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94d1=['../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4deff,_0x42c328){var _0x440123=function(_0x2d7dde){while(--_0x2d7dde){_0x4deff['push'](_0x4deff['shift']());}};_0x440123(++_0x42c328);}(_0x94d1,0x137));var _0x194d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94d1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x194d('0x0'));var util=require(_0x194d('0x1'));var logger=require('../../config/logger')(_0x194d('0x2'));var moment=require(_0x194d('0x3'));var BPromise=require(_0x194d('0x4'));var rp=require(_0x194d('0x5'));var fs=require('fs');var path=require(_0x194d('0x6'));var rimraf=require(_0x194d('0x7'));var config=require(_0x194d('0x8'));var attributes=require(_0x194d('0x9'));module['exports']=function(_0x1cf32e,_0x27ead2){return _0x1cf32e['define'](_0x194d('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 6591d93..727d32e 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 _0x9656=['request\x20sent','error','code','message','info','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','rpc','jayson/promise','http','request','then','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9656,0x15e));var _0x6965=function(_0x442064,_0x3bb4d0){_0x442064=_0x442064-0x0;var _0x203a9b=_0x9656[_0x442064];return _0x203a9b;};'use strict';var _=require(_0x6965('0x0'));var util=require('util');var moment=require(_0x6965('0x1'));var BPromise=require(_0x6965('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6965('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6965('0x4'));var config=require('../../config/environment');var jayson=require(_0x6965('0x5'));var client=jayson['client'][_0x6965('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5312fb,_0x9a46c7,_0x1a4e13){return new BPromise(function(_0x55a024,_0x5ae918){return client[_0x6965('0x7')](_0x5312fb,_0x1a4e13)[_0x6965('0x8')](function(_0x34a8f8){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x9a46c7,'request\x20sent');logger[_0x6965('0x9')](_0x6965('0xa'),_0x9a46c7,_0x6965('0xb'),JSON['stringify'](_0x34a8f8));if(_0x34a8f8[_0x6965('0xc')]){if(_0x34a8f8[_0x6965('0xc')][_0x6965('0xd')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x9a46c7,_0x34a8f8[_0x6965('0xc')]['message']);return _0x5ae918(_0x34a8f8[_0x6965('0xc')][_0x6965('0xe')]);}logger[_0x6965('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x9a46c7,_0x34a8f8[_0x6965('0xc')][_0x6965('0xe')]);return _0x55a024(_0x34a8f8[_0x6965('0xc')][_0x6965('0xe')]);}else{logger[_0x6965('0xf')](_0x6965('0x10'),_0x9a46c7,_0x6965('0xb'));_0x55a024(_0x34a8f8[_0x6965('0x11')][_0x6965('0xe')]);}})[_0x6965('0x12')](function(_0x40b316){logger['error'](_0x6965('0x10'),_0x9a46c7,_0x40b316);_0x5ae918(_0x40b316);});});}
\ No newline at end of file
+var _0x5d6f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0xa74e4c,_0x152094){var _0x5aceaa=function(_0x1ae205){while(--_0x1ae205){_0xa74e4c['push'](_0xa74e4c['shift']());}};_0x5aceaa(++_0x152094);}(_0x5d6f,0x1d8));var _0xf5d6=function(_0x376dba,_0x481693){_0x376dba=_0x376dba-0x0;var _0x3b1b75=_0x5d6f[_0x376dba];return _0x3b1b75;};'use strict';var _=require(_0xf5d6('0x0'));var util=require(_0xf5d6('0x1'));var moment=require(_0xf5d6('0x2'));var BPromise=require(_0xf5d6('0x3'));var rs=require(_0xf5d6('0x4'));var fs=require('fs');var Redis=require(_0xf5d6('0x5'));var db=require(_0xf5d6('0x6'))['db'];var utils=require(_0xf5d6('0x7'));var logger=require(_0xf5d6('0x8'))(_0xf5d6('0x9'));var config=require(_0xf5d6('0xa'));var jayson=require(_0xf5d6('0xb'));var client=jayson[_0xf5d6('0xc')][_0xf5d6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2759e4,_0x133140,_0x4b21bc){return new BPromise(function(_0x3ab16a,_0x21fae5){return client['request'](_0x2759e4,_0x4b21bc)[_0xf5d6('0xe')](function(_0x15343c){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x133140,_0xf5d6('0xf'));logger[_0xf5d6('0x10')](_0xf5d6('0x11'),_0x133140,_0xf5d6('0xf'),JSON[_0xf5d6('0x12')](_0x15343c));if(_0x15343c['error']){if(_0x15343c['error']['code']===0x1f4){logger[_0xf5d6('0x13')](_0xf5d6('0x14'),_0x133140,_0x15343c[_0xf5d6('0x13')][_0xf5d6('0x15')]);return _0x21fae5(_0x15343c[_0xf5d6('0x13')][_0xf5d6('0x15')]);}logger[_0xf5d6('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x133140,_0x15343c[_0xf5d6('0x13')]['message']);return _0x3ab16a(_0x15343c[_0xf5d6('0x13')][_0xf5d6('0x15')]);}else{logger[_0xf5d6('0x16')](_0xf5d6('0x14'),_0x133140,_0xf5d6('0xf'));_0x3ab16a(_0x15343c[_0xf5d6('0x17')][_0xf5d6('0x15')]);}})[_0xf5d6('0x18')](function(_0x7e03b8){logger[_0xf5d6('0x13')](_0xf5d6('0x14'),_0x133140,_0x7e03b8);_0x21fae5(_0x7e03b8);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 5845954..3632e4e 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 _0xdfe5=['index','/:id','show','download','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x36b863,_0x528d3f){var _0x2ef697=function(_0x5e647a){while(--_0x5e647a){_0x36b863['push'](_0x36b863['shift']());}};_0x2ef697(++_0x528d3f);}(_0xdfe5,0xab));var _0x5dfe=function(_0x416398,_0x44af07){_0x416398=_0x416398-0x0;var _0x1791ca=_0xdfe5[_0x416398];return _0x1791ca;};'use strict';var multer=require(_0x5dfe('0x0'));var util=require(_0x5dfe('0x1'));var path=require('path');var timeout=require(_0x5dfe('0x2'));var express=require(_0x5dfe('0x3'));var router=express[_0x5dfe('0x4')]();var fs_extra=require(_0x5dfe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5dfe('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x5dfe('0x7')]('/',auth[_0x5dfe('0x8')](),controller[_0x5dfe('0x9')]);router[_0x5dfe('0x7')](_0x5dfe('0xa'),auth[_0x5dfe('0x8')](),controller[_0x5dfe('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x5dfe('0xc')]);router['post']('/',auth[_0x5dfe('0x8')](),controller[_0x5dfe('0xd')]);router[_0x5dfe('0xe')](_0x5dfe('0xa'),auth[_0x5dfe('0x8')](),controller[_0x5dfe('0xf')]);router[_0x5dfe('0x10')](_0x5dfe('0xa'),auth['isAuthenticated'](),controller[_0x5dfe('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x4d29=['get','isAuthenticated','show','/:id/download','download','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d29,0x15f));var _0x94d2=function(_0x42f07d,_0x4e9bd3){_0x42f07d=_0x42f07d-0x0;var _0x1bf35c=_0x4d29[_0x42f07d];return _0x1bf35c;};'use strict';var multer=require(_0x94d2('0x0'));var util=require('util');var path=require(_0x94d2('0x1'));var timeout=require(_0x94d2('0x2'));var express=require(_0x94d2('0x3'));var router=express[_0x94d2('0x4')]();var fs_extra=require(_0x94d2('0x5'));var auth=require(_0x94d2('0x6'));var interaction=require(_0x94d2('0x7'));var config=require(_0x94d2('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x94d2('0x9')]('/',auth[_0x94d2('0xa')](),controller['index']);router['get']('/:id',auth[_0x94d2('0xa')](),controller[_0x94d2('0xb')]);router['get'](_0x94d2('0xc'),auth['isAuthenticated'](),controller[_0x94d2('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x94d2('0xe')]('/:id',auth[_0x94d2('0xa')](),controller['update']);router['delete'](_0x94d2('0xf'),auth[_0x94d2('0xa')](),controller[_0x94d2('0x10')]);module[_0x94d2('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 830d4fa..c0c2a7e 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 _0x658c=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x6df205,_0x77b4cf){var _0x5933bd=function(_0x4c40f6){while(--_0x4c40f6){_0x6df205['push'](_0x6df205['shift']());}};_0x5933bd(++_0x77b4cf);}(_0x658c,0x132));var _0xc658=function(_0x335c1f,_0x532283){_0x335c1f=_0x335c1f-0x0;var _0x214c30=_0x658c[_0x335c1f];return _0x214c30;};'use strict';var Sequelize=require(_0xc658('0x0'));module[_0xc658('0x1')]={'field':{'type':Sequelize[_0xc658('0x2')]},'alias':{'type':Sequelize[_0xc658('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc658('0x3')]},'groupBy':{'type':Sequelize[_0xc658('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc658('0x3')]},'custom':{'type':Sequelize[_0xc658('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfa1b=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x213568,_0x114a6e){var _0x4fc3ff=function(_0x12b418){while(--_0x12b418){_0x213568['push'](_0x213568['shift']());}};_0x4fc3ff(++_0x114a6e);}(_0xfa1b,0x19a));var _0xbfa1=function(_0x3b9f41,_0x55482b){_0x3b9f41=_0x3b9f41-0x0;var _0x32c03d=_0xfa1b[_0x3b9f41];return _0x32c03d;};'use strict';var Sequelize=require(_0xbfa1('0x0'));module['exports']={'field':{'type':Sequelize[_0xbfa1('0x1')]},'alias':{'type':Sequelize[_0xbfa1('0x2')]},'function':{'type':Sequelize[_0xbfa1('0x2')]},'format':{'type':Sequelize[_0xbfa1('0x2')]},'groupBy':{'type':Sequelize[_0xbfa1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbfa1('0x2')]},'custom':{'type':Sequelize[_0xbfa1('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 b458d01..a096cf6 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 _0xfaf3=['set','Content-Range','json','apply','reject','update','then','end','sendStatus','stack','name','send','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','create','body','catch','bulkCreate','find','destroy','bulkDestroy','ids','AnalyticCustomReport','sequelize','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','offset','undefined','limit','count'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0xfaf3,0x11f));var _0x3faf=function(_0x7edcc5,_0x25fee2){_0x7edcc5=_0x7edcc5-0x0;var _0x806f40=_0xfaf3[_0x7edcc5];return _0x806f40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3faf('0x0'));var zipdir=require(_0x3faf('0x1'));var jsonpatch=require(_0x3faf('0x2'));var rp=require(_0x3faf('0x3'));var moment=require('moment');var BPromise=require(_0x3faf('0x4'));var Mustache=require(_0x3faf('0x5'));var util=require('util');var path=require(_0x3faf('0x6'));var sox=require(_0x3faf('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3faf('0x8'));var _=require('lodash');var squel=require(_0x3faf('0x9'));var crypto=require(_0x3faf('0xa'));var jsforce=require(_0x3faf('0xb'));var deskjs=require(_0x3faf('0xc'));var toCsv=require(_0x3faf('0xd'));var querystring=require(_0x3faf('0xe'));var Papa=require(_0x3faf('0xf'));var Redis=require(_0x3faf('0x10'));var authService=require(_0x3faf('0x11'));var qs=require(_0x3faf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3faf('0x13'));var logger=require(_0x3faf('0x14'))(_0x3faf('0x15'));var utils=require(_0x3faf('0x16'));var config=require(_0x3faf('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x565a76,_0x213c96){_0x213c96=_0x213c96||0xcc;return function(_0x22ae10){if(_0x22ae10){return _0x565a76['sendStatus'](_0x213c96);}return _0x565a76[_0x3faf('0x18')](_0x213c96)['end']();};}function respondWithResult(_0x44b67c,_0x17e1bd){_0x17e1bd=_0x17e1bd||0xc8;return function(_0x1b161c){if(_0x1b161c){return _0x44b67c['status'](_0x17e1bd)['json'](_0x1b161c);}};}function respondWithFilteredResult(_0x56f4cf,_0x5832d8){return function(_0x2efcca){if(_0x2efcca){var _0x270dc5=typeof _0x5832d8[_0x3faf('0x19')]===_0x3faf('0x1a')&&typeof _0x5832d8[_0x3faf('0x1b')]===_0x3faf('0x1a');var _0x373c21=_0x2efcca[_0x3faf('0x1c')];var _0x1f74a5=_0x270dc5?0x0:_0x5832d8[_0x3faf('0x19')];var _0x1e7529=_0x270dc5?_0x2efcca[_0x3faf('0x1c')]:_0x5832d8['offset']+_0x5832d8['limit'];var _0x2618c4;if(_0x1e7529>=_0x373c21){_0x1e7529=_0x373c21;_0x2618c4=0xc8;}else{_0x2618c4=0xce;}_0x56f4cf['status'](_0x2618c4);return _0x56f4cf[_0x3faf('0x1d')](_0x3faf('0x1e'),_0x1f74a5+'-'+_0x1e7529+'/'+_0x373c21)[_0x3faf('0x1f')](_0x2efcca);}return null;};}function patchUpdates(_0x4367bc){return function(_0x4d62c9){try{jsonpatch[_0x3faf('0x20')](_0x4d62c9,_0x4367bc,!![]);}catch(_0x1a64c0){return BPromise[_0x3faf('0x21')](_0x1a64c0);}return _0x4d62c9['save']();};}function saveUpdates(_0x1e56ca,_0x41b10e){return function(_0x3cd555){if(_0x3cd555){return _0x3cd555[_0x3faf('0x22')](_0x1e56ca)[_0x3faf('0x23')](function(_0x12904c){return _0x12904c;});}return null;};}function removeEntity(_0xf9df9,_0x363b84){return function(_0xb38611){if(_0xb38611){return _0xb38611['destroy']()['then'](function(){_0xf9df9[_0x3faf('0x18')](0xcc)[_0x3faf('0x24')]();});}};}function handleEntityNotFound(_0x2c4538,_0x4b5424){return function(_0x21837d){if(!_0x21837d){_0x2c4538[_0x3faf('0x25')](0x194);}return _0x21837d;};}function handleError(_0x46fc41,_0x4d148c){_0x4d148c=_0x4d148c||0x1f4;return function(_0x397896){logger['error'](_0x397896[_0x3faf('0x26')]);if(_0x397896[_0x3faf('0x27')]){delete _0x397896[_0x3faf('0x27')];}_0x46fc41[_0x3faf('0x18')](_0x4d148c)[_0x3faf('0x28')](_0x397896);};}exports['index']=function(_0x3abb4b,_0x1122af){var _0x578485={},_0x1adfda={},_0x2d7143={'count':0x0,'rows':[]};var _0x14a90d=_[_0x3faf('0x29')](db[_0x3faf('0x2a')][_0x3faf('0x2b')],function(_0x16b9f8){return{'name':_0x16b9f8['fieldName'],'type':_0x16b9f8[_0x3faf('0x2c')][_0x3faf('0x2d')]};});_0x1adfda[_0x3faf('0x2e')]=_[_0x3faf('0x29')](_0x14a90d,_0x3faf('0x27'));_0x1adfda[_0x3faf('0x2f')]=_[_0x3faf('0x30')](_0x3abb4b[_0x3faf('0x2f')]);_0x1adfda[_0x3faf('0x31')]=_[_0x3faf('0x32')](_0x1adfda[_0x3faf('0x2e')],_0x1adfda[_0x3faf('0x2f')]);_0x578485['attributes']=_[_0x3faf('0x32')](_0x1adfda[_0x3faf('0x2e')],qs[_0x3faf('0x33')](_0x3abb4b['query'][_0x3faf('0x33')]));_0x578485['attributes']=_0x578485[_0x3faf('0x34')]['length']?_0x578485[_0x3faf('0x34')]:_0x1adfda['model'];if(!_0x3abb4b[_0x3faf('0x2f')]['hasOwnProperty'](_0x3faf('0x35'))){_0x578485[_0x3faf('0x1b')]=qs['limit'](_0x3abb4b[_0x3faf('0x2f')][_0x3faf('0x1b')]);_0x578485['offset']=qs['offset'](_0x3abb4b[_0x3faf('0x2f')][_0x3faf('0x19')]);}_0x578485[_0x3faf('0x36')]=qs[_0x3faf('0x37')](_0x3abb4b['query'][_0x3faf('0x37')]);_0x578485[_0x3faf('0x38')]=qs[_0x3faf('0x31')](_[_0x3faf('0x39')](_0x3abb4b['query'],_0x1adfda['filters']),_0x14a90d);if(_0x3abb4b[_0x3faf('0x2f')][_0x3faf('0x3a')]){_0x578485[_0x3faf('0x38')]=_[_0x3faf('0x3b')](_0x578485['where'],{'$or':_['map'](_0x14a90d,function(_0x4ee468){if(_0x4ee468[_0x3faf('0x2c')]!==_0x3faf('0x3c')){var _0x514aee={};_0x514aee[_0x4ee468[_0x3faf('0x27')]]={'$like':'%'+_0x3abb4b[_0x3faf('0x2f')][_0x3faf('0x3a')]+'%'};return _0x514aee;}})});}_0x578485=_[_0x3faf('0x3b')]({},_0x578485,_0x3abb4b[_0x3faf('0x3d')]);var _0x3654eb={'where':_0x578485['where']};return db[_0x3faf('0x2a')][_0x3faf('0x1c')](_0x3654eb)[_0x3faf('0x23')](function(_0x56308d){_0x2d7143[_0x3faf('0x1c')]=_0x56308d;if(_0x3abb4b[_0x3faf('0x2f')][_0x3faf('0x3e')]){_0x578485[_0x3faf('0x3f')]=[{'all':!![]}];}return db[_0x3faf('0x2a')][_0x3faf('0x40')](_0x578485);})['then'](function(_0x1f1b9a){_0x2d7143[_0x3faf('0x41')]=_0x1f1b9a;return _0x2d7143;})[_0x3faf('0x23')](respondWithFilteredResult(_0x1122af,_0x578485))['catch'](handleError(_0x1122af,null));};exports['show']=function(_0x46ec23,_0x226dda){var _0x992422={'raw':![],'where':{'id':_0x46ec23[_0x3faf('0x42')]['id']}},_0x59a1c6={};_0x59a1c6[_0x3faf('0x2e')]=_['keys'](db[_0x3faf('0x2a')][_0x3faf('0x2b')]);_0x59a1c6[_0x3faf('0x2f')]=_[_0x3faf('0x30')](_0x46ec23[_0x3faf('0x2f')]);_0x59a1c6[_0x3faf('0x31')]=_['intersection'](_0x59a1c6[_0x3faf('0x2e')],_0x59a1c6[_0x3faf('0x2f')]);_0x992422['attributes']=_[_0x3faf('0x32')](_0x59a1c6[_0x3faf('0x2e')],qs[_0x3faf('0x33')](_0x46ec23['query'][_0x3faf('0x33')]));_0x992422[_0x3faf('0x34')]=_0x992422[_0x3faf('0x34')][_0x3faf('0x43')]?_0x992422[_0x3faf('0x34')]:_0x59a1c6['model'];if(_0x46ec23[_0x3faf('0x2f')]['includeAll']){_0x992422['include']=[{'all':!![]}];}_0x992422=_[_0x3faf('0x3b')]({},_0x992422,_0x46ec23['options']);return db[_0x3faf('0x2a')]['find'](_0x992422)[_0x3faf('0x23')](handleEntityNotFound(_0x226dda,null))[_0x3faf('0x23')](respondWithResult(_0x226dda,null))['catch'](handleError(_0x226dda,null));};exports[_0x3faf('0x44')]=function(_0x4dddaf,_0xbfd948){return db[_0x3faf('0x2a')][_0x3faf('0x44')](_0x4dddaf[_0x3faf('0x45')],{})[_0x3faf('0x23')](respondWithResult(_0xbfd948,0xc9))[_0x3faf('0x46')](handleError(_0xbfd948,null));};exports['bulkCreate']=function(_0x423294,_0x454349){return db[_0x3faf('0x2a')][_0x3faf('0x47')](_0x423294[_0x3faf('0x45')],{'raw':![],'individualHooks':!![]})[_0x3faf('0x23')](respondWithResult(_0x454349,0xc9))[_0x3faf('0x46')](handleError(_0x454349,null));};exports[_0x3faf('0x22')]=function(_0x269172,_0x5d2885){if(_0x269172[_0x3faf('0x45')]['id']){delete _0x269172[_0x3faf('0x45')]['id'];}return db['AnalyticFieldReport'][_0x3faf('0x48')]({'where':{'id':_0x269172[_0x3faf('0x42')]['id']}})[_0x3faf('0x23')](handleEntityNotFound(_0x5d2885,null))[_0x3faf('0x23')](saveUpdates(_0x269172['body'],null))[_0x3faf('0x23')](respondWithResult(_0x5d2885,null))[_0x3faf('0x46')](handleError(_0x5d2885,null));};exports[_0x3faf('0x49')]=function(_0x336e7c,_0xd12b37){return db[_0x3faf('0x2a')]['find']({'where':{'id':_0x336e7c[_0x3faf('0x42')]['id']}})[_0x3faf('0x23')](handleEntityNotFound(_0xd12b37,null))[_0x3faf('0x23')](removeEntity(_0xd12b37,null))[_0x3faf('0x46')](handleError(_0xd12b37,null));};exports[_0x3faf('0x4a')]=function(_0x5096a8,_0x216448){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x5096a8[_0x3faf('0x2f')][_0x3faf('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x3faf('0x23')](respondWithResult(_0x216448,0xcc))[_0x3faf('0x46')](handleError(_0x216448,null));};exports['addFields']=function(_0x4ebaf6,_0xaa72b0,_0x2ed6c0){return db[_0x3faf('0x4c')]['findOne']({'where':{'id':_0x4ebaf6[_0x3faf('0x42')]['id']}})[_0x3faf('0x23')](handleEntityNotFound(_0xaa72b0,null))[_0x3faf('0x23')](function(_0x23c45a){if(_0x23c45a){return db[_0x3faf('0x4d')]['transaction'](function(_0x221d1b){return db[_0x3faf('0x2a')][_0x3faf('0x49')]({'where':{'CustomReportId':_0x4ebaf6[_0x3faf('0x42')]['id']},'transaction':_0x221d1b})['then'](function(_0x43da8b){var _0x558ce0=_[_0x3faf('0x29')](_0x4ebaf6[_0x3faf('0x45')],function(_0x547b3b){delete _0x547b3b['id'];_0x547b3b[_0x3faf('0x4e')]=_0x4ebaf6[_0x3faf('0x42')]['id'];return _0x547b3b;});return db[_0x3faf('0x2a')][_0x3faf('0x47')](_0x558ce0,{'transaction':_0x221d1b});});})['then'](function(){return db[_0x3faf('0x2a')][_0x3faf('0x40')]({'where':{'CustomReportId':_0x4ebaf6['params']['id']}});});}})[_0x3faf('0x23')](respondWithResult(_0xaa72b0,null))[_0x3faf('0x46')](handleError(_0xaa72b0,null));};
\ No newline at end of file
+var _0x0e05=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','bulkCreate','update','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','AnalyticFieldReport'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x0e05,0xd5));var _0x50e0=function(_0x551051,_0x5a4c89){_0x551051=_0x551051-0x0;var _0x25c40f=_0x0e05[_0x551051];return _0x25c40f;};'use strict';var emlformat=require(_0x50e0('0x0'));var rimraf=require(_0x50e0('0x1'));var zipdir=require(_0x50e0('0x2'));var jsonpatch=require(_0x50e0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x50e0('0x4'));var Mustache=require(_0x50e0('0x5'));var util=require(_0x50e0('0x6'));var path=require(_0x50e0('0x7'));var sox=require('sox');var csv=require(_0x50e0('0x8'));var ejs=require(_0x50e0('0x9'));var fs=require('fs');var fs_extra=require(_0x50e0('0xa'));var _=require('lodash');var squel=require(_0x50e0('0xb'));var crypto=require('crypto');var jsforce=require(_0x50e0('0xc'));var deskjs=require(_0x50e0('0xd'));var toCsv=require(_0x50e0('0x8'));var querystring=require(_0x50e0('0xe'));var Papa=require(_0x50e0('0xf'));var Redis=require(_0x50e0('0x10'));var authService=require(_0x50e0('0x11'));var qs=require(_0x50e0('0x12'));var as=require(_0x50e0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x50e0('0x14'))(_0x50e0('0x15'));var utils=require(_0x50e0('0x16'));var config=require(_0x50e0('0x17'));var licenseUtil=require(_0x50e0('0x18'));var db=require(_0x50e0('0x19'))['db'];function respondWithStatusCode(_0x30ce19,_0x3a6787){_0x3a6787=_0x3a6787||0xcc;return function(_0x4b338f){if(_0x4b338f){return _0x30ce19[_0x50e0('0x1a')](_0x3a6787);}return _0x30ce19['status'](_0x3a6787)['end']();};}function respondWithResult(_0x291e02,_0x52bd50){_0x52bd50=_0x52bd50||0xc8;return function(_0x3be40a){if(_0x3be40a){return _0x291e02['status'](_0x52bd50)[_0x50e0('0x1b')](_0x3be40a);}};}function respondWithFilteredResult(_0x4e8b95,_0x4055bb){return function(_0x1df9f8){if(_0x1df9f8){var _0x17c22c=typeof _0x4055bb[_0x50e0('0x1c')]==='undefined'&&typeof _0x4055bb[_0x50e0('0x1d')]===_0x50e0('0x1e');var _0x4e09a6=_0x1df9f8[_0x50e0('0x1f')];var _0x2cef02=_0x17c22c?0x0:_0x4055bb[_0x50e0('0x1c')];var _0x602d43=_0x17c22c?_0x1df9f8[_0x50e0('0x1f')]:_0x4055bb['offset']+_0x4055bb[_0x50e0('0x1d')];var _0xa3c120;if(_0x602d43>=_0x4e09a6){_0x602d43=_0x4e09a6;_0xa3c120=0xc8;}else{_0xa3c120=0xce;}_0x4e8b95[_0x50e0('0x20')](_0xa3c120);return _0x4e8b95[_0x50e0('0x21')](_0x50e0('0x22'),_0x2cef02+'-'+_0x602d43+'/'+_0x4e09a6)[_0x50e0('0x1b')](_0x1df9f8);}return null;};}function patchUpdates(_0x11f866){return function(_0x348e0a){try{jsonpatch[_0x50e0('0x23')](_0x348e0a,_0x11f866,!![]);}catch(_0x2eb5a7){return BPromise[_0x50e0('0x24')](_0x2eb5a7);}return _0x348e0a[_0x50e0('0x25')]();};}function saveUpdates(_0x47f118,_0x3c1183){return function(_0x1f26e7){if(_0x1f26e7){return _0x1f26e7['update'](_0x47f118)[_0x50e0('0x26')](function(_0x257229){return _0x257229;});}return null;};}function removeEntity(_0x221574,_0x20c81a){return function(_0x1bbb0c){if(_0x1bbb0c){return _0x1bbb0c[_0x50e0('0x27')]()[_0x50e0('0x26')](function(){_0x221574[_0x50e0('0x20')](0xcc)[_0x50e0('0x28')]();});}};}function handleEntityNotFound(_0x424559,_0x413582){return function(_0x2e6b48){if(!_0x2e6b48){_0x424559[_0x50e0('0x1a')](0x194);}return _0x2e6b48;};}function handleError(_0x38faab,_0x4d7f5c){_0x4d7f5c=_0x4d7f5c||0x1f4;return function(_0x4d081a){logger['error'](_0x4d081a[_0x50e0('0x29')]);if(_0x4d081a[_0x50e0('0x2a')]){delete _0x4d081a[_0x50e0('0x2a')];}_0x38faab['status'](_0x4d7f5c)[_0x50e0('0x2b')](_0x4d081a);};}exports['index']=function(_0x15102d,_0xee221d){var _0x27db42={},_0x4b04a8={},_0x1028b7={'count':0x0,'rows':[]};var _0x3c3de8=_['map'](db[_0x50e0('0x2c')][_0x50e0('0x2d')],function(_0x466f13){return{'name':_0x466f13[_0x50e0('0x2e')],'type':_0x466f13[_0x50e0('0x2f')][_0x50e0('0x30')]};});_0x4b04a8[_0x50e0('0x31')]=_[_0x50e0('0x32')](_0x3c3de8,_0x50e0('0x2a'));_0x4b04a8[_0x50e0('0x33')]=_[_0x50e0('0x34')](_0x15102d[_0x50e0('0x33')]);_0x4b04a8[_0x50e0('0x35')]=_[_0x50e0('0x36')](_0x4b04a8[_0x50e0('0x31')],_0x4b04a8[_0x50e0('0x33')]);_0x27db42['attributes']=_[_0x50e0('0x36')](_0x4b04a8['model'],qs[_0x50e0('0x37')](_0x15102d[_0x50e0('0x33')][_0x50e0('0x37')]));_0x27db42[_0x50e0('0x38')]=_0x27db42[_0x50e0('0x38')]['length']?_0x27db42['attributes']:_0x4b04a8[_0x50e0('0x31')];if(!_0x15102d[_0x50e0('0x33')][_0x50e0('0x39')](_0x50e0('0x3a'))){_0x27db42[_0x50e0('0x1d')]=qs[_0x50e0('0x1d')](_0x15102d[_0x50e0('0x33')][_0x50e0('0x1d')]);_0x27db42[_0x50e0('0x1c')]=qs[_0x50e0('0x1c')](_0x15102d[_0x50e0('0x33')][_0x50e0('0x1c')]);}_0x27db42[_0x50e0('0x3b')]=qs[_0x50e0('0x3c')](_0x15102d[_0x50e0('0x33')]['sort']);_0x27db42[_0x50e0('0x3d')]=qs[_0x50e0('0x35')](_['pick'](_0x15102d[_0x50e0('0x33')],_0x4b04a8[_0x50e0('0x35')]),_0x3c3de8);if(_0x15102d['query'][_0x50e0('0x3e')]){_0x27db42[_0x50e0('0x3d')]=_['merge'](_0x27db42['where'],{'$or':_[_0x50e0('0x32')](_0x3c3de8,function(_0x56433a){if(_0x56433a[_0x50e0('0x2f')]!==_0x50e0('0x3f')){var _0x25bd18={};_0x25bd18[_0x56433a[_0x50e0('0x2a')]]={'$like':'%'+_0x15102d[_0x50e0('0x33')]['filter']+'%'};return _0x25bd18;}})});}_0x27db42=_['merge']({},_0x27db42,_0x15102d[_0x50e0('0x40')]);var _0x3dc394={'where':_0x27db42[_0x50e0('0x3d')]};return db[_0x50e0('0x2c')][_0x50e0('0x1f')](_0x3dc394)[_0x50e0('0x26')](function(_0x4339ae){_0x1028b7[_0x50e0('0x1f')]=_0x4339ae;if(_0x15102d[_0x50e0('0x33')][_0x50e0('0x41')]){_0x27db42[_0x50e0('0x42')]=[{'all':!![]}];}return db[_0x50e0('0x2c')][_0x50e0('0x43')](_0x27db42);})['then'](function(_0x4cf733){_0x1028b7[_0x50e0('0x44')]=_0x4cf733;return _0x1028b7;})[_0x50e0('0x26')](respondWithFilteredResult(_0xee221d,_0x27db42))[_0x50e0('0x45')](handleError(_0xee221d,null));};exports[_0x50e0('0x46')]=function(_0x4b50c9,_0x1807a3){var _0x41b34b={'raw':![],'where':{'id':_0x4b50c9[_0x50e0('0x47')]['id']}},_0x160840={};_0x160840[_0x50e0('0x31')]=_['keys'](db[_0x50e0('0x2c')][_0x50e0('0x2d')]);_0x160840['query']=_[_0x50e0('0x34')](_0x4b50c9[_0x50e0('0x33')]);_0x160840[_0x50e0('0x35')]=_['intersection'](_0x160840[_0x50e0('0x31')],_0x160840['query']);_0x41b34b['attributes']=_[_0x50e0('0x36')](_0x160840[_0x50e0('0x31')],qs[_0x50e0('0x37')](_0x4b50c9[_0x50e0('0x33')][_0x50e0('0x37')]));_0x41b34b[_0x50e0('0x38')]=_0x41b34b[_0x50e0('0x38')][_0x50e0('0x48')]?_0x41b34b[_0x50e0('0x38')]:_0x160840['model'];if(_0x4b50c9[_0x50e0('0x33')]['includeAll']){_0x41b34b['include']=[{'all':!![]}];}_0x41b34b=_[_0x50e0('0x49')]({},_0x41b34b,_0x4b50c9[_0x50e0('0x40')]);return db['AnalyticFieldReport'][_0x50e0('0x4a')](_0x41b34b)[_0x50e0('0x26')](handleEntityNotFound(_0x1807a3,null))[_0x50e0('0x26')](respondWithResult(_0x1807a3,null))[_0x50e0('0x45')](handleError(_0x1807a3,null));};exports[_0x50e0('0x4b')]=function(_0x5bd924,_0x755a1){return db[_0x50e0('0x2c')][_0x50e0('0x4b')](_0x5bd924[_0x50e0('0x4c')],{})['then'](respondWithResult(_0x755a1,0xc9))[_0x50e0('0x45')](handleError(_0x755a1,null));};exports[_0x50e0('0x4d')]=function(_0x51ba18,_0x410b27){return db[_0x50e0('0x2c')][_0x50e0('0x4d')](_0x51ba18[_0x50e0('0x4c')],{'raw':![],'individualHooks':!![]})[_0x50e0('0x26')](respondWithResult(_0x410b27,0xc9))[_0x50e0('0x45')](handleError(_0x410b27,null));};exports[_0x50e0('0x4e')]=function(_0x23df4d,_0x519d9e){if(_0x23df4d[_0x50e0('0x4c')]['id']){delete _0x23df4d['body']['id'];}return db[_0x50e0('0x2c')][_0x50e0('0x4a')]({'where':{'id':_0x23df4d[_0x50e0('0x47')]['id']}})['then'](handleEntityNotFound(_0x519d9e,null))[_0x50e0('0x26')](saveUpdates(_0x23df4d['body'],null))['then'](respondWithResult(_0x519d9e,null))[_0x50e0('0x45')](handleError(_0x519d9e,null));};exports[_0x50e0('0x27')]=function(_0x184cb8,_0x1d3004){return db[_0x50e0('0x2c')][_0x50e0('0x4a')]({'where':{'id':_0x184cb8['params']['id']}})[_0x50e0('0x26')](handleEntityNotFound(_0x1d3004,null))[_0x50e0('0x26')](removeEntity(_0x1d3004,null))[_0x50e0('0x45')](handleError(_0x1d3004,null));};exports[_0x50e0('0x4f')]=function(_0xf490be,_0x5b466c){return db[_0x50e0('0x2c')][_0x50e0('0x27')]({'where':{'id':_0xf490be[_0x50e0('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5b466c,0xcc))[_0x50e0('0x45')](handleError(_0x5b466c,null));};exports[_0x50e0('0x50')]=function(_0x3e93b8,_0x3c934d,_0xd7409a){return db[_0x50e0('0x51')][_0x50e0('0x52')]({'where':{'id':_0x3e93b8['params']['id']}})['then'](handleEntityNotFound(_0x3c934d,null))[_0x50e0('0x26')](function(_0xd712a){if(_0xd712a){return db[_0x50e0('0x53')][_0x50e0('0x54')](function(_0x541975){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x3e93b8[_0x50e0('0x47')]['id']},'transaction':_0x541975})[_0x50e0('0x26')](function(_0x3073a1){var _0x1d8c50=_[_0x50e0('0x32')](_0x3e93b8[_0x50e0('0x4c')],function(_0x573183){delete _0x573183['id'];_0x573183[_0x50e0('0x55')]=_0x3e93b8[_0x50e0('0x47')]['id'];return _0x573183;});return db[_0x50e0('0x2c')][_0x50e0('0x4d')](_0x1d8c50,{'transaction':_0x541975});});})['then'](function(){return db['AnalyticFieldReport'][_0x50e0('0x43')]({'where':{'CustomReportId':_0x3e93b8[_0x50e0('0x47')]['id']}});});}})[_0x50e0('0x26')](respondWithResult(_0x3c934d,null))['catch'](handleError(_0x3c934d,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index aad369d..6b88944 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 _0x33ea=['api','moment','bluebird','path','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33ea,0x1c0));var _0xa33e=function(_0x20cd38,_0x3a9033){_0x20cd38=_0x20cd38-0x0;var _0x52246d=_0x33ea[_0x20cd38];return _0x52246d;};'use strict';var _=require(_0xa33e('0x0'));var util=require(_0xa33e('0x1'));var logger=require('../../config/logger')(_0xa33e('0x2'));var moment=require(_0xa33e('0x3'));var BPromise=require(_0xa33e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa33e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa33e('0x6'));module[_0xa33e('0x7')]=function(_0x2775d5,_0x816e2d){return _0x2775d5['define'](_0xa33e('0x8'),attributes,{'tableName':_0xa33e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f6d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','util'];(function(_0x1f56fd,_0x374605){var _0x517f3b=function(_0x2dd330){while(--_0x2dd330){_0x1f56fd['push'](_0x1f56fd['shift']());}};_0x517f3b(++_0x374605);}(_0x5f6d,0x16a));var _0xd5f6=function(_0xb9b0f7,_0x353fd5){_0xb9b0f7=_0xb9b0f7-0x0;var _0x15912d=_0x5f6d[_0xb9b0f7];return _0x15912d;};'use strict';var _=require(_0xd5f6('0x0'));var util=require(_0xd5f6('0x1'));var logger=require(_0xd5f6('0x2'))(_0xd5f6('0x3'));var moment=require(_0xd5f6('0x4'));var BPromise=require(_0xd5f6('0x5'));var rp=require(_0xd5f6('0x6'));var fs=require('fs');var path=require(_0xd5f6('0x7'));var rimraf=require(_0xd5f6('0x8'));var config=require(_0xd5f6('0x9'));var attributes=require(_0xd5f6('0xa'));module['exports']=function(_0x5066ae,_0x341d52){return _0x5066ae[_0xd5f6('0xb')](_0xd5f6('0xc'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 78c265f..95d1db3 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 _0x2df7=['request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5031a7,_0x4078be){var _0x56bf3e=function(_0x1b46ab){while(--_0x1b46ab){_0x5031a7['push'](_0x5031a7['shift']());}};_0x56bf3e(++_0x4078be);}(_0x2df7,0x141));var _0x72df=function(_0x3c5524,_0x205d78){_0x3c5524=_0x3c5524-0x0;var _0x408950=_0x2df7[_0x3c5524];return _0x408950;};'use strict';var _=require(_0x72df('0x0'));var util=require(_0x72df('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x72df('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72df('0x3'))['db'];var utils=require(_0x72df('0x4'));var logger=require(_0x72df('0x5'))(_0x72df('0x6'));var config=require('../../config/environment');var jayson=require(_0x72df('0x7'));var client=jayson[_0x72df('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29ed2d,_0x3238af,_0x5558b7){return new BPromise(function(_0x3d7e53,_0x4feeba){return client[_0x72df('0x9')](_0x29ed2d,_0x5558b7)[_0x72df('0xa')](function(_0x296627){logger[_0x72df('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3238af,'request\x20sent');logger[_0x72df('0xc')](_0x72df('0xd'),_0x3238af,_0x72df('0xe'),JSON[_0x72df('0xf')](_0x296627));if(_0x296627['error']){if(_0x296627[_0x72df('0x10')][_0x72df('0x11')]===0x1f4){logger['error'](_0x72df('0x12'),_0x3238af,_0x296627['error'][_0x72df('0x13')]);return _0x4feeba(_0x296627[_0x72df('0x10')][_0x72df('0x13')]);}logger[_0x72df('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3238af,_0x296627['error'][_0x72df('0x13')]);return _0x3d7e53(_0x296627[_0x72df('0x10')][_0x72df('0x13')]);}else{logger[_0x72df('0xb')](_0x72df('0x12'),_0x3238af,'request\x20sent');_0x3d7e53(_0x296627[_0x72df('0x14')][_0x72df('0x13')]);}})[_0x72df('0x15')](function(_0x1f441f){logger[_0x72df('0x10')](_0x72df('0x12'),_0x3238af,_0x1f441f);_0x4feeba(_0x1f441f);});});}
\ No newline at end of file
+var _0xba7a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x277698,_0x48c3da){var _0x221fe1=function(_0x1a770a){while(--_0x1a770a){_0x277698['push'](_0x277698['shift']());}};_0x221fe1(++_0x48c3da);}(_0xba7a,0x18d));var _0xaba7=function(_0x3f9f0a,_0x463a73){_0x3f9f0a=_0x3f9f0a-0x0;var _0x2ac3fd=_0xba7a[_0x3f9f0a];return _0x2ac3fd;};'use strict';var _=require(_0xaba7('0x0'));var util=require(_0xaba7('0x1'));var moment=require(_0xaba7('0x2'));var BPromise=require(_0xaba7('0x3'));var rs=require(_0xaba7('0x4'));var fs=require('fs');var Redis=require(_0xaba7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaba7('0x6'));var logger=require(_0xaba7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaba7('0x8'));var client=jayson['client'][_0xaba7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13780d,_0x49e40c,_0x2d0684){return new BPromise(function(_0x32c06a,_0x2a9865){return client[_0xaba7('0xa')](_0x13780d,_0x2d0684)[_0xaba7('0xb')](function(_0x4bf5fe){logger[_0xaba7('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x49e40c,'request\x20sent');logger['debug'](_0xaba7('0xd'),_0x49e40c,_0xaba7('0xe'),JSON[_0xaba7('0xf')](_0x4bf5fe));if(_0x4bf5fe['error']){if(_0x4bf5fe[_0xaba7('0x10')]['code']===0x1f4){logger[_0xaba7('0x10')](_0xaba7('0x11'),_0x49e40c,_0x4bf5fe[_0xaba7('0x10')][_0xaba7('0x12')]);return _0x2a9865(_0x4bf5fe[_0xaba7('0x10')][_0xaba7('0x12')]);}logger[_0xaba7('0x10')](_0xaba7('0x11'),_0x49e40c,_0x4bf5fe[_0xaba7('0x10')][_0xaba7('0x12')]);return _0x32c06a(_0x4bf5fe[_0xaba7('0x10')][_0xaba7('0x12')]);}else{logger[_0xaba7('0xc')](_0xaba7('0x11'),_0x49e40c,_0xaba7('0xe'));_0x32c06a(_0x4bf5fe[_0xaba7('0x13')]['message']);}})['catch'](function(_0x358e5c){logger['error'](_0xaba7('0x11'),_0x49e40c,_0x358e5c);_0x2a9865(_0x358e5c);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index f39c98c..6470546 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(_0x114b70,_0x20d8b6){var _0x48e5b8=function(_0x3e6637){while(--_0x3e6637){_0x114b70['push'](_0x114b70['shift']());}};_0x48e5b8(++_0x20d8b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x2d9e85,_0x6ac8a4){var _0x1b01ce=function(_0x27a21c){while(--_0x27a21c){_0x2d9e85['push'](_0x2d9e85['shift']());}};_0x1b01ce(++_0x6ac8a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 e1ac9d0..aff3658 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 _0x6584=['STRING','name','TEXT','sequelize','exports'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6584,0x175));var _0x4658=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x6584[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0x4658('0x0'));module[_0x4658('0x1')]={'name':{'type':Sequelize[_0x4658('0x2')],'allowNull':![],'unique':_0x4658('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x4658('0x4')]},'description':{'type':Sequelize[_0x4658('0x2')]}};
\ No newline at end of file
+var _0x3276=['name','STRING','TEXT','sequelize'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x3276,0xc7));var _0x6327=function(_0x2fa0d7,_0x1fdf2d){_0x2fa0d7=_0x2fa0d7-0x0;var _0x162429=_0x3276[_0x2fa0d7];return _0x162429;};'use strict';var Sequelize=require(_0x6327('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6327('0x1')},'table':{'type':Sequelize[_0x6327('0x2')]},'metric':{'type':Sequelize[_0x6327('0x3')]},'description':{'type':Sequelize[_0x6327('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 38c71ab..f1e4cea 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 _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x3b6078,_0x4cccde){var _0x417d62=function(_0x5e99af){while(--_0x5e99af){_0x3b6078['push'](_0x3b6078['shift']());}};_0x417d62(++_0x4cccde);}(_0x3e74,0x175));var _0x43e7=function(_0x251a07,_0x3b5070){_0x251a07=_0x251a07-0x0;var _0xcdfbed=_0x3e74[_0x251a07];return _0xcdfbed;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
+var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x156795,_0x4cb45a){var _0x6d3d7e=function(_0x1a40b7){while(--_0x1a40b7){_0x156795['push'](_0x156795['shift']());}};_0x6d3d7e(++_0x4cb45a);}(_0x3e74,0x175));var _0x43e7=function(_0x1840cf,_0x5bd637){_0x1840cf=_0x1840cf-0x0;var _0x352648=_0x3e74[_0x1840cf];return _0x352648;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index aa8cc9b..57b4e44 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 _0x980e=['api','bluebird','path','rimraf','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x56724d,_0x25749f){var _0x4201ba=function(_0x3c4fd5){while(--_0x3c4fd5){_0x56724d['push'](_0x56724d['shift']());}};_0x4201ba(++_0x25749f);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe980('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe980('0x1'));var moment=require('moment');var BPromise=require(_0xe980('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe980('0x3'));var rimraf=require(_0xe980('0x4'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xe980('0x5')]=function(_0x55b114,_0x539945){return _0x55b114[_0xe980('0x6')](_0xe980('0x7'),attributes,{'tableName':_0xe980('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd991=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2e1d3d,_0x719bf0){var _0x3d81df=function(_0x3ddfa3){while(--_0x3ddfa3){_0x2e1d3d['push'](_0x2e1d3d['shift']());}};_0x3d81df(++_0x719bf0);}(_0xd991,0x115));var _0x1d99=function(_0x54dcb1,_0x21a9c9){_0x54dcb1=_0x54dcb1-0x0;var _0x284141=_0xd991[_0x54dcb1];return _0x284141;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var logger=require(_0x1d99('0x2'))(_0x1d99('0x3'));var moment=require(_0x1d99('0x4'));var BPromise=require('bluebird');var rp=require(_0x1d99('0x5'));var fs=require('fs');var path=require(_0x1d99('0x6'));var rimraf=require(_0x1d99('0x7'));var config=require(_0x1d99('0x8'));var attributes=require(_0x1d99('0x9'));module[_0x1d99('0xa')]=function(_0x5f3a37,_0x1adbca){return _0x5f3a37[_0x1d99('0xb')]('AnalyticMetric',attributes,{'tableName':_0x1d99('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 62e7b52..2900d69 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 _0xa899=['stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa899,0x17a));var _0x9a89=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0xa899[_0x1b8d87];return _0x182b74;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var moment=require('moment');var BPromise=require(_0x9a89('0x2'));var rs=require(_0x9a89('0x3'));var fs=require('fs');var Redis=require(_0x9a89('0x4'));var db=require(_0x9a89('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a89('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a89('0x7'));var client=jayson[_0x9a89('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x531a05,_0x580e6b,_0x29f6bd){return new BPromise(function(_0x38fae9,_0x54fc9c){return client['request'](_0x531a05,_0x29f6bd)['then'](function(_0x47c54d){logger[_0x9a89('0x9')](_0x9a89('0xa'),_0x580e6b,_0x9a89('0xb'));logger['debug'](_0x9a89('0xc'),_0x580e6b,'request\x20sent',JSON[_0x9a89('0xd')](_0x47c54d));if(_0x47c54d[_0x9a89('0xe')]){if(_0x47c54d['error']['code']===0x1f4){logger[_0x9a89('0xe')](_0x9a89('0xa'),_0x580e6b,_0x47c54d[_0x9a89('0xe')][_0x9a89('0xf')]);return _0x54fc9c(_0x47c54d[_0x9a89('0xe')]['message']);}logger[_0x9a89('0xe')](_0x9a89('0xa'),_0x580e6b,_0x47c54d[_0x9a89('0xe')][_0x9a89('0xf')]);return _0x38fae9(_0x47c54d[_0x9a89('0xe')][_0x9a89('0xf')]);}else{logger[_0x9a89('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x580e6b,'request\x20sent');_0x38fae9(_0x47c54d['result'][_0x9a89('0xf')]);}})[_0x9a89('0x10')](function(_0x1347fe){logger[_0x9a89('0xe')](_0x9a89('0xa'),_0x580e6b,_0x1347fe);_0x54fc9c(_0x1347fe);});});}
\ No newline at end of file
+var _0x4147=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3d86a4,_0x43dc05){var _0x100df5=function(_0x24d968){while(--_0x24d968){_0x3d86a4['push'](_0x3d86a4['shift']());}};_0x100df5(++_0x43dc05);}(_0x4147,0x19e));var _0x7414=function(_0xb4ce71,_0x23158f){_0xb4ce71=_0xb4ce71-0x0;var _0x476202=_0x4147[_0xb4ce71];return _0x476202;};'use strict';var _=require(_0x7414('0x0'));var util=require(_0x7414('0x1'));var moment=require(_0x7414('0x2'));var BPromise=require(_0x7414('0x3'));var rs=require(_0x7414('0x4'));var fs=require('fs');var Redis=require(_0x7414('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7414('0x6'))(_0x7414('0x7'));var config=require(_0x7414('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7414('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f3782,_0x4b3e03,_0x15e863){return new BPromise(function(_0x620f55,_0xa3efdd){return client[_0x7414('0xa')](_0x3f3782,_0x15e863)[_0x7414('0xb')](function(_0x19d46a){logger[_0x7414('0xc')](_0x7414('0xd'),_0x4b3e03,_0x7414('0xe'));logger[_0x7414('0xf')](_0x7414('0x10'),_0x4b3e03,_0x7414('0xe'),JSON[_0x7414('0x11')](_0x19d46a));if(_0x19d46a[_0x7414('0x12')]){if(_0x19d46a['error'][_0x7414('0x13')]===0x1f4){logger[_0x7414('0x12')](_0x7414('0xd'),_0x4b3e03,_0x19d46a[_0x7414('0x12')]['message']);return _0xa3efdd(_0x19d46a['error'][_0x7414('0x14')]);}logger[_0x7414('0x12')](_0x7414('0xd'),_0x4b3e03,_0x19d46a[_0x7414('0x12')][_0x7414('0x14')]);return _0x620f55(_0x19d46a[_0x7414('0x12')]['message']);}else{logger[_0x7414('0xc')](_0x7414('0xd'),_0x4b3e03,'request\x20sent');_0x620f55(_0x19d46a[_0x7414('0x15')][_0x7414('0x14')]);}})[_0x7414('0x16')](function(_0x105b0c){logger[_0x7414('0x12')](_0x7414('0xd'),_0x4b3e03,_0x105b0c);_0xa3efdd(_0x105b0c);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 4f7626c..e476f1e 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 _0x0b3d=['express','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','post','put','isAuthenticated','update','destroy','exports','multer','path'];(function(_0x3497b2,_0x32c98b){var _0x3c4622=function(_0x5c3fc2){while(--_0x5c3fc2){_0x3497b2['push'](_0x3497b2['shift']());}};_0x3c4622(++_0x32c98b);}(_0x0b3d,0x76));var _0xd0b3=function(_0x57d4c4,_0x1eb1c7){_0x57d4c4=_0x57d4c4-0x0;var _0x551561=_0x0b3d[_0x57d4c4];return _0x551561;};'use strict';var multer=require(_0xd0b3('0x0'));var util=require('util');var path=require(_0xd0b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd0b3('0x2'));var router=express['Router']();var fs_extra=require(_0xd0b3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd0b3('0x4'));var config=require('../../config/environment');var controller=require(_0xd0b3('0x5'));router[_0xd0b3('0x6')]('/',auth['isAuthenticated'](),controller[_0xd0b3('0x7')]);router['get'](_0xd0b3('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xd0b3('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0b3('0xa')]('/:id',auth[_0xd0b3('0xb')](),controller[_0xd0b3('0xc')]);router['delete']('/:id',auth[_0xd0b3('0xb')](),controller[_0xd0b3('0xd')]);module[_0xd0b3('0xe')]=router;
\ No newline at end of file
+var _0x4d61=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','post'];(function(_0x45b1ad,_0x3128e3){var _0x3a36df=function(_0x3bae63){while(--_0x3bae63){_0x45b1ad['push'](_0x45b1ad['shift']());}};_0x3a36df(++_0x3128e3);}(_0x4d61,0x147));var _0x14d6=function(_0x125243,_0x119e35){_0x125243=_0x125243-0x0;var _0x1e1a69=_0x4d61[_0x125243];return _0x1e1a69;};'use strict';var multer=require(_0x14d6('0x0'));var util=require(_0x14d6('0x1'));var path=require(_0x14d6('0x2'));var timeout=require(_0x14d6('0x3'));var express=require(_0x14d6('0x4'));var router=express[_0x14d6('0x5')]();var fs_extra=require(_0x14d6('0x6'));var auth=require(_0x14d6('0x7'));var interaction=require(_0x14d6('0x8'));var config=require('../../config/environment');var controller=require(_0x14d6('0x9'));router[_0x14d6('0xa')]('/',auth[_0x14d6('0xb')](),controller[_0x14d6('0xc')]);router[_0x14d6('0xa')](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller['show']);router[_0x14d6('0xe')]('/',auth['isAuthenticated'](),controller[_0x14d6('0xf')]);router['put'](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller['update']);router[_0x14d6('0x10')](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller[_0x14d6('0x11')]);module[_0x14d6('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 0d13aee..c70d5c0 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 _0xfa71=['TEXT'];(function(_0x5660d5,_0x235c27){var _0x2a144d=function(_0x54fb3f){while(--_0x54fb3f){_0x5660d5['push'](_0x5660d5['shift']());}};_0x2a144d(++_0x235c27);}(_0xfa71,0x13c));var _0x1fa7=function(_0x3585cc,_0x43fc48){_0x3585cc=_0x3585cc-0x0;var _0x19e326=_0xfa71[_0x3585cc];return _0x19e326;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x1fa7('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x3d56=['TEXT','sequelize'];(function(_0x2590f9,_0x57deb0){var _0x2b2779=function(_0x2444ec){while(--_0x2444ec){_0x2590f9['push'](_0x2590f9['shift']());}};_0x2b2779(++_0x57deb0);}(_0x3d56,0xd3));var _0x63d5=function(_0x4dd0e0,_0x11b9e9){_0x4dd0e0=_0x4dd0e0-0x0;var _0x11d1af=_0x3d56[_0x4dd0e0];return _0x11d1af;};'use strict';var Sequelize=require(_0x63d5('0x0'));module['exports']={'tree':{'type':Sequelize[_0x63d5('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 e27ca1b..49cde00 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 _0xeaf9=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','type','key'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xeaf9,0x1dc));var _0x9eaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeaf9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9eaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9eaf('0x1'));var jsonpatch=require(_0x9eaf('0x2'));var rp=require(_0x9eaf('0x3'));var moment=require('moment');var BPromise=require(_0x9eaf('0x4'));var Mustache=require(_0x9eaf('0x5'));var util=require(_0x9eaf('0x6'));var path=require('path');var sox=require(_0x9eaf('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9eaf('0x8'));var _=require(_0x9eaf('0x9'));var squel=require(_0x9eaf('0xa'));var crypto=require(_0x9eaf('0xb'));var jsforce=require(_0x9eaf('0xc'));var deskjs=require(_0x9eaf('0xd'));var toCsv=require(_0x9eaf('0xe'));var querystring=require('querystring');var Papa=require(_0x9eaf('0xf'));var Redis=require(_0x9eaf('0x10'));var authService=require(_0x9eaf('0x11'));var qs=require(_0x9eaf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9eaf('0x13'));var logger=require(_0x9eaf('0x14'))(_0x9eaf('0x15'));var utils=require(_0x9eaf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9eaf('0x17'));var db=require(_0x9eaf('0x18'))['db'];function respondWithStatusCode(_0x464b6f,_0x243b7e){_0x243b7e=_0x243b7e||0xcc;return function(_0x12132a){if(_0x12132a){return _0x464b6f[_0x9eaf('0x19')](_0x243b7e);}return _0x464b6f[_0x9eaf('0x1a')](_0x243b7e)[_0x9eaf('0x1b')]();};}function respondWithResult(_0x25c4bc,_0x85424a){_0x85424a=_0x85424a||0xc8;return function(_0x5e9681){if(_0x5e9681){return _0x25c4bc[_0x9eaf('0x1a')](_0x85424a)[_0x9eaf('0x1c')](_0x5e9681);}};}function respondWithFilteredResult(_0x2815b4,_0x5bc6b0){return function(_0x529eb8){if(_0x529eb8){var _0x1126ea=typeof _0x5bc6b0[_0x9eaf('0x1d')]==='undefined'&&typeof _0x5bc6b0[_0x9eaf('0x1e')]===_0x9eaf('0x1f');var _0x17c118=_0x529eb8[_0x9eaf('0x20')];var _0x173a58=_0x1126ea?0x0:_0x5bc6b0[_0x9eaf('0x1d')];var _0x489521=_0x1126ea?_0x529eb8['count']:_0x5bc6b0['offset']+_0x5bc6b0[_0x9eaf('0x1e')];var _0xa45aa5;if(_0x489521>=_0x17c118){_0x489521=_0x17c118;_0xa45aa5=0xc8;}else{_0xa45aa5=0xce;}_0x2815b4[_0x9eaf('0x1a')](_0xa45aa5);return _0x2815b4[_0x9eaf('0x21')](_0x9eaf('0x22'),_0x173a58+'-'+_0x489521+'/'+_0x17c118)['json'](_0x529eb8);}return null;};}function patchUpdates(_0xf28d27){return function(_0x324b96){try{jsonpatch[_0x9eaf('0x23')](_0x324b96,_0xf28d27,!![]);}catch(_0x118a46){return BPromise[_0x9eaf('0x24')](_0x118a46);}return _0x324b96['save']();};}function saveUpdates(_0x13288f,_0x2cc01f){return function(_0x2ac284){if(_0x2ac284){return _0x2ac284[_0x9eaf('0x25')](_0x13288f)['then'](function(_0x2b22aa){return _0x2b22aa;});}return null;};}function removeEntity(_0x17f8ec,_0x52f435){return function(_0x51b172){if(_0x51b172){return _0x51b172[_0x9eaf('0x26')]()[_0x9eaf('0x27')](function(){_0x17f8ec[_0x9eaf('0x1a')](0xcc)[_0x9eaf('0x1b')]();});}};}function handleEntityNotFound(_0x3a934e,_0x38f021){return function(_0x14f035){if(!_0x14f035){_0x3a934e[_0x9eaf('0x19')](0x194);}return _0x14f035;};}function handleError(_0x445490,_0x43dfb0){_0x43dfb0=_0x43dfb0||0x1f4;return function(_0x56a9bd){logger[_0x9eaf('0x28')](_0x56a9bd[_0x9eaf('0x29')]);if(_0x56a9bd[_0x9eaf('0x2a')]){delete _0x56a9bd['name'];}_0x445490['status'](_0x43dfb0)[_0x9eaf('0x2b')](_0x56a9bd);};}exports['index']=function(_0x1c822d,_0x263553){var _0x3529e9={},_0x582b95={},_0x2e4c20={'count':0x0,'rows':[]};var _0x2f1102=_[_0x9eaf('0x2c')](db[_0x9eaf('0x2d')][_0x9eaf('0x2e')],function(_0xd14d49){return{'name':_0xd14d49['fieldName'],'type':_0xd14d49[_0x9eaf('0x2f')][_0x9eaf('0x30')]};});_0x582b95[_0x9eaf('0x31')]=_[_0x9eaf('0x2c')](_0x2f1102,_0x9eaf('0x2a'));_0x582b95[_0x9eaf('0x32')]=_[_0x9eaf('0x33')](_0x1c822d[_0x9eaf('0x32')]);_0x582b95[_0x9eaf('0x34')]=_[_0x9eaf('0x35')](_0x582b95[_0x9eaf('0x31')],_0x582b95[_0x9eaf('0x32')]);_0x3529e9[_0x9eaf('0x36')]=_[_0x9eaf('0x35')](_0x582b95['model'],qs[_0x9eaf('0x37')](_0x1c822d[_0x9eaf('0x32')][_0x9eaf('0x37')]));_0x3529e9['attributes']=_0x3529e9[_0x9eaf('0x36')][_0x9eaf('0x38')]?_0x3529e9[_0x9eaf('0x36')]:_0x582b95[_0x9eaf('0x31')];if(!_0x1c822d[_0x9eaf('0x32')][_0x9eaf('0x39')](_0x9eaf('0x3a'))){_0x3529e9[_0x9eaf('0x1e')]=qs[_0x9eaf('0x1e')](_0x1c822d[_0x9eaf('0x32')][_0x9eaf('0x1e')]);_0x3529e9['offset']=qs[_0x9eaf('0x1d')](_0x1c822d[_0x9eaf('0x32')]['offset']);}_0x3529e9[_0x9eaf('0x3b')]=qs[_0x9eaf('0x3c')](_0x1c822d[_0x9eaf('0x32')]['sort']);_0x3529e9[_0x9eaf('0x3d')]=qs[_0x9eaf('0x34')](_[_0x9eaf('0x3e')](_0x1c822d[_0x9eaf('0x32')],_0x582b95[_0x9eaf('0x34')]),_0x2f1102);if(_0x1c822d[_0x9eaf('0x32')][_0x9eaf('0x3f')]){_0x3529e9['where']=_['merge'](_0x3529e9[_0x9eaf('0x3d')],{'$or':_[_0x9eaf('0x2c')](_0x2f1102,function(_0x22689f){if(_0x22689f[_0x9eaf('0x2f')]!=='VIRTUAL'){var _0x3ecfc0={};_0x3ecfc0[_0x22689f['name']]={'$like':'%'+_0x1c822d[_0x9eaf('0x32')][_0x9eaf('0x3f')]+'%'};return _0x3ecfc0;}})});}_0x3529e9=_[_0x9eaf('0x40')]({},_0x3529e9,_0x1c822d[_0x9eaf('0x41')]);var _0x553f6b={'where':_0x3529e9['where']};return db[_0x9eaf('0x2d')][_0x9eaf('0x20')](_0x553f6b)[_0x9eaf('0x27')](function(_0xf2433f){_0x2e4c20['count']=_0xf2433f;if(_0x1c822d['query'][_0x9eaf('0x42')]){_0x3529e9[_0x9eaf('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x9eaf('0x44')](_0x3529e9);})['then'](function(_0x44a5c6){_0x2e4c20[_0x9eaf('0x45')]=_0x44a5c6;return _0x2e4c20;})['then'](respondWithFilteredResult(_0x263553,_0x3529e9))[_0x9eaf('0x46')](handleError(_0x263553,null));};exports['show']=function(_0x4a2f11,_0x2d1b8a){var _0x3f1c01={'raw':!![],'where':{'id':_0x4a2f11[_0x9eaf('0x47')]['id']}},_0x369e51={};_0x369e51[_0x9eaf('0x31')]=_['keys'](db[_0x9eaf('0x2d')][_0x9eaf('0x2e')]);_0x369e51['query']=_['keys'](_0x4a2f11['query']);_0x369e51[_0x9eaf('0x34')]=_[_0x9eaf('0x35')](_0x369e51['model'],_0x369e51['query']);_0x3f1c01[_0x9eaf('0x36')]=_['intersection'](_0x369e51[_0x9eaf('0x31')],qs[_0x9eaf('0x37')](_0x4a2f11['query'][_0x9eaf('0x37')]));_0x3f1c01[_0x9eaf('0x36')]=_0x3f1c01[_0x9eaf('0x36')][_0x9eaf('0x38')]?_0x3f1c01['attributes']:_0x369e51[_0x9eaf('0x31')];if(_0x4a2f11[_0x9eaf('0x32')][_0x9eaf('0x42')]){_0x3f1c01[_0x9eaf('0x43')]=[{'all':!![]}];}_0x3f1c01=_[_0x9eaf('0x40')]({},_0x3f1c01,_0x4a2f11[_0x9eaf('0x41')]);return db[_0x9eaf('0x2d')]['find'](_0x3f1c01)[_0x9eaf('0x27')](handleEntityNotFound(_0x2d1b8a,null))[_0x9eaf('0x27')](respondWithResult(_0x2d1b8a,null))[_0x9eaf('0x46')](handleError(_0x2d1b8a,null));};exports['create']=function(_0x435315,_0x4159c8){return db[_0x9eaf('0x2d')][_0x9eaf('0x48')](_0x435315[_0x9eaf('0x49')],{})[_0x9eaf('0x27')](respondWithResult(_0x4159c8,0xc9))['catch'](handleError(_0x4159c8,null));};exports['update']=function(_0x1e1921,_0x261979){if(_0x1e1921['body']['id']){delete _0x1e1921[_0x9eaf('0x49')]['id'];}return db[_0x9eaf('0x2d')][_0x9eaf('0x4a')]({'where':{'id':_0x1e1921['params']['id']}})[_0x9eaf('0x27')](handleEntityNotFound(_0x261979,null))[_0x9eaf('0x27')](saveUpdates(_0x1e1921[_0x9eaf('0x49')],null))[_0x9eaf('0x27')](respondWithResult(_0x261979,null))[_0x9eaf('0x46')](handleError(_0x261979,null));};exports['destroy']=function(_0x4fd189,_0x26467b){return db[_0x9eaf('0x2d')][_0x9eaf('0x4a')]({'where':{'id':_0x4fd189[_0x9eaf('0x47')]['id']}})['then'](handleEntityNotFound(_0x26467b,null))['then'](removeEntity(_0x26467b,null))[_0x9eaf('0x46')](handleError(_0x26467b,null));};
\ No newline at end of file
+var _0x9fa7=['destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body'];(function(_0x35d32d,_0x189a93){var _0x278467=function(_0x1584fd){while(--_0x1584fd){_0x35d32d['push'](_0x35d32d['shift']());}};_0x278467(++_0x189a93);}(_0x9fa7,0x1e7));var _0x79fa=function(_0x149fa0,_0x599133){_0x149fa0=_0x149fa0-0x0;var _0x29da31=_0x9fa7[_0x149fa0];return _0x29da31;};'use strict';var emlformat=require(_0x79fa('0x0'));var rimraf=require(_0x79fa('0x1'));var zipdir=require(_0x79fa('0x2'));var jsonpatch=require(_0x79fa('0x3'));var rp=require(_0x79fa('0x4'));var moment=require('moment');var BPromise=require(_0x79fa('0x5'));var Mustache=require(_0x79fa('0x6'));var util=require(_0x79fa('0x7'));var path=require(_0x79fa('0x8'));var sox=require(_0x79fa('0x9'));var csv=require(_0x79fa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79fa('0xb'));var _=require(_0x79fa('0xc'));var squel=require(_0x79fa('0xd'));var crypto=require(_0x79fa('0xe'));var jsforce=require(_0x79fa('0xf'));var deskjs=require(_0x79fa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x79fa('0x11'));var Papa=require(_0x79fa('0x12'));var Redis=require(_0x79fa('0x13'));var authService=require(_0x79fa('0x14'));var qs=require(_0x79fa('0x15'));var as=require(_0x79fa('0x16'));var hardwareService=require(_0x79fa('0x17'));var logger=require(_0x79fa('0x18'))(_0x79fa('0x19'));var utils=require(_0x79fa('0x1a'));var config=require(_0x79fa('0x1b'));var licenseUtil=require(_0x79fa('0x1c'));var db=require(_0x79fa('0x1d'))['db'];function respondWithStatusCode(_0x232888,_0xd45ee6){_0xd45ee6=_0xd45ee6||0xcc;return function(_0x4f797c){if(_0x4f797c){return _0x232888['sendStatus'](_0xd45ee6);}return _0x232888[_0x79fa('0x1e')](_0xd45ee6)[_0x79fa('0x1f')]();};}function respondWithResult(_0x421283,_0x5d071b){_0x5d071b=_0x5d071b||0xc8;return function(_0x20b4ec){if(_0x20b4ec){return _0x421283['status'](_0x5d071b)['json'](_0x20b4ec);}};}function respondWithFilteredResult(_0x2e1514,_0x9b22c9){return function(_0x3ac3f5){if(_0x3ac3f5){var _0x5458bd=typeof _0x9b22c9[_0x79fa('0x20')]===_0x79fa('0x21')&&typeof _0x9b22c9[_0x79fa('0x22')]==='undefined';var _0x13436d=_0x3ac3f5[_0x79fa('0x23')];var _0x440a44=_0x5458bd?0x0:_0x9b22c9['offset'];var _0x39143e=_0x5458bd?_0x3ac3f5['count']:_0x9b22c9['offset']+_0x9b22c9['limit'];var _0x524fe7;if(_0x39143e>=_0x13436d){_0x39143e=_0x13436d;_0x524fe7=0xc8;}else{_0x524fe7=0xce;}_0x2e1514[_0x79fa('0x1e')](_0x524fe7);return _0x2e1514[_0x79fa('0x24')](_0x79fa('0x25'),_0x440a44+'-'+_0x39143e+'/'+_0x13436d)['json'](_0x3ac3f5);}return null;};}function patchUpdates(_0x5a2a15){return function(_0x101d3c){try{jsonpatch[_0x79fa('0x26')](_0x101d3c,_0x5a2a15,!![]);}catch(_0x58cabd){return BPromise[_0x79fa('0x27')](_0x58cabd);}return _0x101d3c[_0x79fa('0x28')]();};}function saveUpdates(_0x1a31b1,_0x1c70ee){return function(_0x56d63c){if(_0x56d63c){return _0x56d63c[_0x79fa('0x29')](_0x1a31b1)[_0x79fa('0x2a')](function(_0x1e0602){return _0x1e0602;});}return null;};}function removeEntity(_0x3d7480,_0x313a22){return function(_0x2199a0){if(_0x2199a0){return _0x2199a0['destroy']()[_0x79fa('0x2a')](function(){_0x3d7480['status'](0xcc)[_0x79fa('0x1f')]();});}};}function handleEntityNotFound(_0x5dd459,_0x513bf8){return function(_0x21e871){if(!_0x21e871){_0x5dd459[_0x79fa('0x2b')](0x194);}return _0x21e871;};}function handleError(_0x330f36,_0x4028c7){_0x4028c7=_0x4028c7||0x1f4;return function(_0x413e96){logger['error'](_0x413e96[_0x79fa('0x2c')]);if(_0x413e96[_0x79fa('0x2d')]){delete _0x413e96[_0x79fa('0x2d')];}_0x330f36[_0x79fa('0x1e')](_0x4028c7)[_0x79fa('0x2e')](_0x413e96);};}exports[_0x79fa('0x2f')]=function(_0x5d7460,_0x2fc4e3){var _0x47075c={},_0x2410e1={},_0x26adac={'count':0x0,'rows':[]};var _0x34182f=_[_0x79fa('0x30')](db[_0x79fa('0x31')][_0x79fa('0x32')],function(_0x334b17){return{'name':_0x334b17[_0x79fa('0x33')],'type':_0x334b17[_0x79fa('0x34')][_0x79fa('0x35')]};});_0x2410e1[_0x79fa('0x36')]=_[_0x79fa('0x30')](_0x34182f,_0x79fa('0x2d'));_0x2410e1[_0x79fa('0x37')]=_[_0x79fa('0x38')](_0x5d7460['query']);_0x2410e1[_0x79fa('0x39')]=_[_0x79fa('0x3a')](_0x2410e1[_0x79fa('0x36')],_0x2410e1['query']);_0x47075c[_0x79fa('0x3b')]=_[_0x79fa('0x3a')](_0x2410e1['model'],qs[_0x79fa('0x3c')](_0x5d7460['query'][_0x79fa('0x3c')]));_0x47075c[_0x79fa('0x3b')]=_0x47075c[_0x79fa('0x3b')][_0x79fa('0x3d')]?_0x47075c['attributes']:_0x2410e1[_0x79fa('0x36')];if(!_0x5d7460['query'][_0x79fa('0x3e')](_0x79fa('0x3f'))){_0x47075c['limit']=qs[_0x79fa('0x22')](_0x5d7460[_0x79fa('0x37')][_0x79fa('0x22')]);_0x47075c[_0x79fa('0x20')]=qs[_0x79fa('0x20')](_0x5d7460['query'][_0x79fa('0x20')]);}_0x47075c['order']=qs[_0x79fa('0x40')](_0x5d7460['query'][_0x79fa('0x40')]);_0x47075c[_0x79fa('0x41')]=qs[_0x79fa('0x39')](_[_0x79fa('0x42')](_0x5d7460['query'],_0x2410e1[_0x79fa('0x39')]),_0x34182f);if(_0x5d7460[_0x79fa('0x37')][_0x79fa('0x43')]){_0x47075c[_0x79fa('0x41')]=_[_0x79fa('0x44')](_0x47075c[_0x79fa('0x41')],{'$or':_[_0x79fa('0x30')](_0x34182f,function(_0xdca7c8){if(_0xdca7c8['type']!==_0x79fa('0x45')){var _0x340ab6={};_0x340ab6[_0xdca7c8['name']]={'$like':'%'+_0x5d7460[_0x79fa('0x37')][_0x79fa('0x43')]+'%'};return _0x340ab6;}})});}_0x47075c=_[_0x79fa('0x44')]({},_0x47075c,_0x5d7460[_0x79fa('0x46')]);var _0x27f84e={'where':_0x47075c[_0x79fa('0x41')]};return db[_0x79fa('0x31')][_0x79fa('0x23')](_0x27f84e)[_0x79fa('0x2a')](function(_0x57f84e){_0x26adac['count']=_0x57f84e;if(_0x5d7460[_0x79fa('0x37')][_0x79fa('0x47')]){_0x47075c[_0x79fa('0x48')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x79fa('0x49')](_0x47075c);})['then'](function(_0x51521c){_0x26adac['rows']=_0x51521c;return _0x26adac;})[_0x79fa('0x2a')](respondWithFilteredResult(_0x2fc4e3,_0x47075c))['catch'](handleError(_0x2fc4e3,null));};exports[_0x79fa('0x4a')]=function(_0x1b62e5,_0x1fb5fc){var _0x1468b5={'raw':!![],'where':{'id':_0x1b62e5[_0x79fa('0x4b')]['id']}},_0x247688={};_0x247688[_0x79fa('0x36')]=_[_0x79fa('0x38')](db['AnalyticTreeReport']['rawAttributes']);_0x247688[_0x79fa('0x37')]=_[_0x79fa('0x38')](_0x1b62e5[_0x79fa('0x37')]);_0x247688[_0x79fa('0x39')]=_[_0x79fa('0x3a')](_0x247688[_0x79fa('0x36')],_0x247688['query']);_0x1468b5[_0x79fa('0x3b')]=_['intersection'](_0x247688['model'],qs[_0x79fa('0x3c')](_0x1b62e5[_0x79fa('0x37')][_0x79fa('0x3c')]));_0x1468b5[_0x79fa('0x3b')]=_0x1468b5[_0x79fa('0x3b')][_0x79fa('0x3d')]?_0x1468b5[_0x79fa('0x3b')]:_0x247688['model'];if(_0x1b62e5['query'][_0x79fa('0x47')]){_0x1468b5[_0x79fa('0x48')]=[{'all':!![]}];}_0x1468b5=_[_0x79fa('0x44')]({},_0x1468b5,_0x1b62e5[_0x79fa('0x46')]);return db[_0x79fa('0x31')][_0x79fa('0x4c')](_0x1468b5)[_0x79fa('0x2a')](handleEntityNotFound(_0x1fb5fc,null))[_0x79fa('0x2a')](respondWithResult(_0x1fb5fc,null))[_0x79fa('0x4d')](handleError(_0x1fb5fc,null));};exports[_0x79fa('0x4e')]=function(_0x362dda,_0x61b95b){return db[_0x79fa('0x31')][_0x79fa('0x4e')](_0x362dda[_0x79fa('0x4f')],{})[_0x79fa('0x2a')](respondWithResult(_0x61b95b,0xc9))[_0x79fa('0x4d')](handleError(_0x61b95b,null));};exports[_0x79fa('0x29')]=function(_0x31c29b,_0x398a78){if(_0x31c29b[_0x79fa('0x4f')]['id']){delete _0x31c29b[_0x79fa('0x4f')]['id'];}return db[_0x79fa('0x31')][_0x79fa('0x4c')]({'where':{'id':_0x31c29b[_0x79fa('0x4b')]['id']}})[_0x79fa('0x2a')](handleEntityNotFound(_0x398a78,null))[_0x79fa('0x2a')](saveUpdates(_0x31c29b[_0x79fa('0x4f')],null))[_0x79fa('0x2a')](respondWithResult(_0x398a78,null))[_0x79fa('0x4d')](handleError(_0x398a78,null));};exports[_0x79fa('0x50')]=function(_0x195aae,_0x21dc62){return db[_0x79fa('0x31')][_0x79fa('0x4c')]({'where':{'id':_0x195aae[_0x79fa('0x4b')]['id']}})[_0x79fa('0x2a')](handleEntityNotFound(_0x21dc62,null))['then'](removeEntity(_0x21dc62,null))[_0x79fa('0x4d')](handleError(_0x21dc62,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index f91e05d..c830926 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 _0x5c79=['../../config/logger','api','moment','bluebird','path','rimraf','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x5560df,_0x548b46){var _0x1d0688=function(_0x5383f9){while(--_0x5383f9){_0x5560df['push'](_0x5560df['shift']());}};_0x1d0688(++_0x548b46);}(_0x5c79,0x1c6));var _0x95c7=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0x5c79[_0x53e3de];return _0x7b905b;};'use strict';var _=require(_0x95c7('0x0'));var util=require(_0x95c7('0x1'));var logger=require(_0x95c7('0x2'))(_0x95c7('0x3'));var moment=require(_0x95c7('0x4'));var BPromise=require(_0x95c7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95c7('0x6'));var rimraf=require(_0x95c7('0x7'));var config=require('../../config/environment');var attributes=require(_0x95c7('0x8'));module[_0x95c7('0x9')]=function(_0xe91a54,_0xcabcc8){return _0xe91a54['define'](_0x95c7('0xa'),attributes,{'tableName':_0x95c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde79=['analytics_report_trees','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticTreeReport'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xde79,0xc7));var _0x9de7=function(_0x57547d,_0x58db70){_0x57547d=_0x57547d-0x0;var _0x440342=_0xde79[_0x57547d];return _0x440342;};'use strict';var _=require('lodash');var util=require(_0x9de7('0x0'));var logger=require(_0x9de7('0x1'))('api');var moment=require(_0x9de7('0x2'));var BPromise=require(_0x9de7('0x3'));var rp=require(_0x9de7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9de7('0x5'));var config=require(_0x9de7('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x9de7('0x7')]=function(_0x37f10b,_0x42504b){return _0x37f10b[_0x9de7('0x8')](_0x9de7('0x9'),attributes,{'tableName':_0x9de7('0xa'),'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 14cd29b..8382ef9 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1e195b,_0x18ec21){var _0x1c98a3=function(_0x2d96c3){while(--_0x2d96c3){_0x1e195b['push'](_0x1e195b['shift']());}};_0x1c98a3(++_0x18ec21);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56b557,_0x4e06b1){_0x56b557=_0x56b557-0x0;var _0x596b6a=_0x5f2f[_0x56b557];return _0x596b6a;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x1e87a3,_0xf21a70){_0x1e87a3=_0x1e87a3-0x0;var _0x2f58ff=_0x7a54[_0x1e87a3];return _0x2f58ff;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 37649d4..91b7829 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 _0x07ed=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x07ed,0x16b));var _0xd07e=function(_0x436974,_0x78d896){_0x436974=_0x436974-0x0;var _0x2fbfc8=_0x07ed[_0x436974];return _0x2fbfc8;};'use strict';var multer=require(_0xd07e('0x0'));var util=require(_0xd07e('0x1'));var path=require(_0xd07e('0x2'));var timeout=require(_0xd07e('0x3'));var express=require(_0xd07e('0x4'));var router=express[_0xd07e('0x5')]();var fs_extra=require(_0xd07e('0x6'));var auth=require(_0xd07e('0x7'));var interaction=require(_0xd07e('0x8'));var config=require(_0xd07e('0x9'));var controller=require('./analyticTreeReport.controller');router[_0xd07e('0xa')]('/',auth['isAuthenticated'](),controller[_0xd07e('0xb')]);router[_0xd07e('0xa')](_0xd07e('0xc'),auth['isAuthenticated'](),controller[_0xd07e('0xd')]);router['post']('/',auth[_0xd07e('0xe')](),controller[_0xd07e('0xf')]);router[_0xd07e('0x10')](_0xd07e('0xc'),auth[_0xd07e('0xe')](),controller[_0xd07e('0x11')]);router[_0xd07e('0x12')]('/:id',auth[_0xd07e('0xe')](),controller[_0xd07e('0x13')]);module[_0xd07e('0x14')]=router;
\ No newline at end of file
+var _0x1a63=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','post','create','put','/:id','delete','exports','util'];(function(_0x446d9f,_0x4062f6){var _0xff1bce=function(_0x66cdd9){while(--_0x66cdd9){_0x446d9f['push'](_0x446d9f['shift']());}};_0xff1bce(++_0x4062f6);}(_0x1a63,0xc5));var _0x31a6=function(_0x4e8f63,_0x783de9){_0x4e8f63=_0x4e8f63-0x0;var _0x2a129f=_0x1a63[_0x4e8f63];return _0x2a129f;};'use strict';var multer=require('multer');var util=require(_0x31a6('0x0'));var path=require(_0x31a6('0x1'));var timeout=require(_0x31a6('0x2'));var express=require(_0x31a6('0x3'));var router=express['Router']();var fs_extra=require(_0x31a6('0x4'));var auth=require(_0x31a6('0x5'));var interaction=require(_0x31a6('0x6'));var config=require(_0x31a6('0x7'));var controller=require(_0x31a6('0x8'));router[_0x31a6('0x9')]('/',auth[_0x31a6('0xa')](),controller[_0x31a6('0xb')]);router[_0x31a6('0x9')]('/:id',auth[_0x31a6('0xa')](),controller['show']);router[_0x31a6('0xc')]('/',auth[_0x31a6('0xa')](),controller[_0x31a6('0xd')]);router[_0x31a6('0xe')](_0x31a6('0xf'),auth[_0x31a6('0xa')](),controller['update']);router[_0x31a6('0x10')](_0x31a6('0xf'),auth[_0x31a6('0xa')](),controller['destroy']);module[_0x31a6('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 7758685..df6bc3c 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 _0xf0ba=['STRING','sequelize','exports'];(function(_0x1e0de,_0x100b6e){var _0x511bfc=function(_0x1d2826){while(--_0x1d2826){_0x1e0de['push'](_0x1e0de['shift']());}};_0x511bfc(++_0x100b6e);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaf0b('0x0'));module[_0xaf0b('0x1')]={'name':{'type':Sequelize[_0xaf0b('0x2')]},'basename':{'type':Sequelize[_0xaf0b('0x2')]},'type':{'type':Sequelize[_0xaf0b('0x2')]}};
\ No newline at end of file
+var _0xfa2f=['STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa2f,0xe8));var _0xffa2=function(_0x4daa2f,_0x367bbd){_0x4daa2f=_0x4daa2f-0x0;var _0x2f6824=_0xfa2f[_0x4daa2f];return _0x2f6824;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xffa2('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xffa2('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 26f3d1e..2c035fd 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 _0xfbaa=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','set','save','then','destroy','end','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','clone','find','get','omit','createdAt','updatedAt','body','create','update','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x2bf4f3,_0x225c34){var _0x2147e2=function(_0x5b2ad2){while(--_0x5b2ad2){_0x2bf4f3['push'](_0x2bf4f3['shift']());}};_0x2147e2(++_0x225c34);}(_0xfbaa,0xf9));var _0xafba=function(_0x4fa166,_0x58b7fb){_0x4fa166=_0x4fa166-0x0;var _0x5dd974=_0xfbaa[_0x4fa166];return _0x5dd974;};'use strict';var emlformat=require(_0xafba('0x0'));var rimraf=require(_0xafba('0x1'));var zipdir=require(_0xafba('0x2'));var jsonpatch=require(_0xafba('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xafba('0x4'));var Mustache=require(_0xafba('0x5'));var util=require(_0xafba('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xafba('0x7'));var ejs=require(_0xafba('0x8'));var fs=require('fs');var fs_extra=require(_0xafba('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xafba('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xafba('0xb'));var toCsv=require(_0xafba('0x7'));var querystring=require(_0xafba('0xc'));var Papa=require(_0xafba('0xd'));var Redis=require(_0xafba('0xe'));var authService=require(_0xafba('0xf'));var qs=require(_0xafba('0x10'));var as=require(_0xafba('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xafba('0x12'))('api');var utils=require(_0xafba('0x13'));var config=require(_0xafba('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xafba('0x15'))['db'];function respondWithStatusCode(_0x4296f9,_0x50a7d2){_0x50a7d2=_0x50a7d2||0xcc;return function(_0xfafdd3){if(_0xfafdd3){return _0x4296f9[_0xafba('0x16')](_0x50a7d2);}return _0x4296f9['status'](_0x50a7d2)['end']();};}function respondWithResult(_0x4d944f,_0x4722a9){_0x4722a9=_0x4722a9||0xc8;return function(_0x4ebe96){if(_0x4ebe96){return _0x4d944f[_0xafba('0x17')](_0x4722a9)['json'](_0x4ebe96);}};}function respondWithFilteredResult(_0x1ac208,_0x45f5b2){return function(_0x41633d){if(_0x41633d){var _0x4db17f=typeof _0x45f5b2[_0xafba('0x18')]===_0xafba('0x19')&&typeof _0x45f5b2['limit']===_0xafba('0x19');var _0x14f6f5=_0x41633d[_0xafba('0x1a')];var _0xee6bf6=_0x4db17f?0x0:_0x45f5b2[_0xafba('0x18')];var _0x5cb665=_0x4db17f?_0x41633d[_0xafba('0x1a')]:_0x45f5b2[_0xafba('0x18')]+_0x45f5b2['limit'];var _0x5f4e64;if(_0x5cb665>=_0x14f6f5){_0x5cb665=_0x14f6f5;_0x5f4e64=0xc8;}else{_0x5f4e64=0xce;}_0x1ac208[_0xafba('0x17')](_0x5f4e64);return _0x1ac208[_0xafba('0x1b')]('Content-Range',_0xee6bf6+'-'+_0x5cb665+'/'+_0x14f6f5)['json'](_0x41633d);}return null;};}function patchUpdates(_0x2a0c71){return function(_0x1ed888){try{jsonpatch['apply'](_0x1ed888,_0x2a0c71,!![]);}catch(_0x171854){return BPromise['reject'](_0x171854);}return _0x1ed888[_0xafba('0x1c')]();};}function saveUpdates(_0x59f597,_0x4217b1){return function(_0xefedc0){if(_0xefedc0){return _0xefedc0['update'](_0x59f597)[_0xafba('0x1d')](function(_0x2dd6ba){return _0x2dd6ba;});}return null;};}function removeEntity(_0x4baf7e,_0x38aae6){return function(_0x1caf4a){if(_0x1caf4a){return _0x1caf4a[_0xafba('0x1e')]()[_0xafba('0x1d')](function(){_0x4baf7e['status'](0xcc)[_0xafba('0x1f')]();});}};}function handleEntityNotFound(_0x30ebec,_0x347825){return function(_0x50e677){if(!_0x50e677){_0x30ebec[_0xafba('0x16')](0x194);}return _0x50e677;};}function handleError(_0x35d31c,_0x9786df){_0x9786df=_0x9786df||0x1f4;return function(_0x560dd0){logger[_0xafba('0x20')](_0x560dd0[_0xafba('0x21')]);if(_0x560dd0[_0xafba('0x22')]){delete _0x560dd0[_0xafba('0x22')];}_0x35d31c[_0xafba('0x17')](_0x9786df)[_0xafba('0x23')](_0x560dd0);};}exports[_0xafba('0x24')]=function(_0xc668d0,_0x1bf9d2){var _0x7e241={},_0x5acb4a={},_0x51123b={'count':0x0,'rows':[]};var _0x171be9=_['map'](db[_0xafba('0x25')][_0xafba('0x26')],function(_0x3a1bae){return{'name':_0x3a1bae[_0xafba('0x27')],'type':_0x3a1bae[_0xafba('0x28')][_0xafba('0x29')]};});_0x5acb4a[_0xafba('0x2a')]=_[_0xafba('0x2b')](_0x171be9,_0xafba('0x22'));_0x5acb4a[_0xafba('0x2c')]=_[_0xafba('0x2d')](_0xc668d0['query']);_0x5acb4a['filters']=_[_0xafba('0x2e')](_0x5acb4a[_0xafba('0x2a')],_0x5acb4a['query']);_0x7e241[_0xafba('0x2f')]=_[_0xafba('0x2e')](_0x5acb4a[_0xafba('0x2a')],qs[_0xafba('0x30')](_0xc668d0['query'][_0xafba('0x30')]));_0x7e241[_0xafba('0x2f')]=_0x7e241[_0xafba('0x2f')][_0xafba('0x31')]?_0x7e241['attributes']:_0x5acb4a[_0xafba('0x2a')];if(!_0xc668d0[_0xafba('0x2c')][_0xafba('0x32')](_0xafba('0x33'))){_0x7e241[_0xafba('0x34')]=qs[_0xafba('0x34')](_0xc668d0[_0xafba('0x2c')][_0xafba('0x34')]);_0x7e241[_0xafba('0x18')]=qs[_0xafba('0x18')](_0xc668d0['query'][_0xafba('0x18')]);}_0x7e241[_0xafba('0x35')]=qs['sort'](_0xc668d0['query'][_0xafba('0x36')]);_0x7e241[_0xafba('0x37')]=qs[_0xafba('0x38')](_['pick'](_0xc668d0['query'],_0x5acb4a[_0xafba('0x38')]),_0x171be9);if(_0xc668d0[_0xafba('0x2c')][_0xafba('0x39')]){_0x7e241[_0xafba('0x37')]=_[_0xafba('0x3a')](_0x7e241[_0xafba('0x37')],{'$or':_[_0xafba('0x2b')](_0x171be9,function(_0x1f64bc){if(_0x1f64bc[_0xafba('0x28')]!==_0xafba('0x3b')){var _0xb63fbb={};_0xb63fbb[_0x1f64bc[_0xafba('0x22')]]={'$like':'%'+_0xc668d0[_0xafba('0x2c')][_0xafba('0x39')]+'%'};return _0xb63fbb;}})});}_0x7e241=_['merge']({},_0x7e241,_0xc668d0[_0xafba('0x3c')]);var _0x4481f2={'where':_0x7e241['where']};return db['Attachment']['count'](_0x4481f2)[_0xafba('0x1d')](function(_0x1dcd93){_0x51123b[_0xafba('0x1a')]=_0x1dcd93;if(_0xc668d0['query']['includeAll']){_0x7e241[_0xafba('0x3d')]=[{'all':!![]}];}return db[_0xafba('0x25')][_0xafba('0x3e')](_0x7e241);})[_0xafba('0x1d')](function(_0x23a18a){_0x51123b[_0xafba('0x3f')]=_0x23a18a;return _0x51123b;})[_0xafba('0x1d')](respondWithFilteredResult(_0x1bf9d2,_0x7e241))[_0xafba('0x40')](handleError(_0x1bf9d2,null));};exports[_0xafba('0x41')]=function(_0x568d97,_0x4c3229){var _0x1bf450={'raw':!![],'where':{'id':_0x568d97[_0xafba('0x42')]['id']}},_0x254281={};_0x254281[_0xafba('0x2a')]=_[_0xafba('0x2d')](db['Attachment'][_0xafba('0x26')]);_0x254281['query']=_[_0xafba('0x2d')](_0x568d97[_0xafba('0x2c')]);_0x254281['filters']=_['intersection'](_0x254281['model'],_0x254281[_0xafba('0x2c')]);_0x1bf450['attributes']=_[_0xafba('0x2e')](_0x254281[_0xafba('0x2a')],qs['fields'](_0x568d97['query']['fields']));_0x1bf450[_0xafba('0x2f')]=_0x1bf450[_0xafba('0x2f')][_0xafba('0x31')]?_0x1bf450[_0xafba('0x2f')]:_0x254281['model'];if(_0x568d97[_0xafba('0x2c')][_0xafba('0x43')]){_0x1bf450[_0xafba('0x3d')]=[{'all':!![]}];}_0x1bf450=_[_0xafba('0x3a')]({},_0x1bf450,_0x568d97[_0xafba('0x3c')]);return db[_0xafba('0x25')]['find'](_0x1bf450)[_0xafba('0x1d')](handleEntityNotFound(_0x4c3229,null))[_0xafba('0x1d')](respondWithResult(_0x4c3229,null))[_0xafba('0x40')](handleError(_0x4c3229,null));};exports[_0xafba('0x44')]=function(_0x26f39a,_0x53fe77){var _0x353e29={'where':{'id':_0x26f39a['params']['id']}},_0x568acc={};_0x568acc[_0xafba('0x2a')]=_[_0xafba('0x2d')](db[_0xafba('0x25')][_0xafba('0x26')]);_0x353e29[_0xafba('0x2f')]=_[_0xafba('0x2e')](_0x568acc[_0xafba('0x2a')],qs[_0xafba('0x30')](_0x26f39a['query'][_0xafba('0x30')]));_0x353e29[_0xafba('0x2f')]=_0x353e29[_0xafba('0x2f')][_0xafba('0x31')]?_0x353e29[_0xafba('0x2f')]:_0x568acc[_0xafba('0x2a')];if(_0x26f39a[_0xafba('0x2c')][_0xafba('0x43')]){_0x353e29[_0xafba('0x3d')]=[{'all':!![]}];}_0x353e29=_[_0xafba('0x3a')]({},_0x353e29,_0x26f39a['options']);return db[_0xafba('0x25')][_0xafba('0x45')](_0x353e29)[_0xafba('0x1d')](handleEntityNotFound(_0x53fe77,null))[_0xafba('0x1d')](function(_0x3137f3){if(_0x3137f3){var _0x1ead54=_0x3137f3[_0xafba('0x46')]({'plain':!![]});_0x1ead54=qs[_0xafba('0x47')](_0x1ead54,['id',_0xafba('0x48'),_0xafba('0x49')]);_0x26f39a[_0xafba('0x4a')]=_[_0xafba('0x47')](_0x26f39a[_0xafba('0x4a')],['id','createdAt','updatedAt']);return db[_0xafba('0x25')][_0xafba('0x4b')](_[_0xafba('0x3a')](_0x1ead54,_0x26f39a[_0xafba('0x4a')]),{'include':_0x26f39a[_0xafba('0x2c')][_0xafba('0x43')]?[{'all':!![]}]:undefined});}})[_0xafba('0x1d')](respondWithResult(_0x53fe77,0xc9))['catch'](handleError(_0x53fe77,null));};exports[_0xafba('0x4c')]=function(_0x4ce7c3,_0x494471){if(_0x4ce7c3[_0xafba('0x4a')]['id']){delete _0x4ce7c3['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x4ce7c3[_0xafba('0x42')]['id']}})[_0xafba('0x1d')](handleEntityNotFound(_0x494471,null))[_0xafba('0x1d')](saveUpdates(_0x4ce7c3[_0xafba('0x4a')],null))[_0xafba('0x1d')](respondWithResult(_0x494471,null))[_0xafba('0x40')](handleError(_0x494471,null));};exports['destroy']=function(_0x50c60a,_0x47805b){return db[_0xafba('0x25')][_0xafba('0x45')]({'where':{'id':_0x50c60a[_0xafba('0x42')]['id']}})[_0xafba('0x1d')](handleEntityNotFound(_0x47805b,null))[_0xafba('0x1d')](removeEntity(_0x47805b,null))['catch'](handleError(_0x47805b,null));};exports['create']=function(_0x579f04,_0x1bfb5e,_0x26d154){_0x579f04['body']['name']=_0x579f04[_0xafba('0x4d')]['originalname'];_0x579f04[_0xafba('0x4a')][_0xafba('0x4e')]=_0x579f04[_0xafba('0x4d')][_0xafba('0x4f')];_0x579f04[_0xafba('0x4a')][_0xafba('0x28')]=_0x579f04[_0xafba('0x4d')][_0xafba('0x50')];return db['Attachment'][_0xafba('0x4b')](_0x579f04['body'])['then'](respondWithResult(_0x1bfb5e,0xc9))['catch'](handleError(_0x1bfb5e,null));};exports[_0xafba('0x51')]=function(_0x1c5aa4,_0x21ab19,_0x54ed04){return db[_0xafba('0x25')][_0xafba('0x52')]({'where':{'id':_0x1c5aa4[_0xafba('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x21ab19,null))['then'](function(_0x3babf8){if(_0x3babf8){var _0x17956d=_0x3babf8[_0xafba('0x53')]!==null;var _0x2b5bf1=path[_0xafba('0x54')](config[_0xafba('0x55')],_0xafba('0x56'));if(_0x17956d){_0x2b5bf1=path[_0xafba('0x54')](_0x2b5bf1,_0xafba('0x57'));}var _0xc1bec1=path[_0xafba('0x54')](_0x2b5bf1,_0x3babf8[_0xafba('0x4e')]);return _0x21ab19[_0xafba('0x51')](_0xc1bec1);}})[_0xafba('0x40')](handleError(_0x21ab19,null));};
\ No newline at end of file
+var _0xc1ba=['create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','join','download','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','map','Attachment','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','find','get','omit','updatedAt','body'];(function(_0x1a8abe,_0x123187){var _0x424187=function(_0x471e95){while(--_0x471e95){_0x1a8abe['push'](_0x1a8abe['shift']());}};_0x424187(++_0x123187);}(_0xc1ba,0x187));var _0xac1b=function(_0x9153c6,_0x2745aa){_0x9153c6=_0x9153c6-0x0;var _0x8d0486=_0xc1ba[_0x9153c6];return _0x8d0486;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac1b('0x0'));var zipdir=require(_0xac1b('0x1'));var jsonpatch=require(_0xac1b('0x2'));var rp=require(_0xac1b('0x3'));var moment=require('moment');var BPromise=require(_0xac1b('0x4'));var Mustache=require('mustache');var util=require(_0xac1b('0x5'));var path=require(_0xac1b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac1b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac1b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac1b('0x9'));var deskjs=require(_0xac1b('0xa'));var toCsv=require(_0xac1b('0xb'));var querystring=require(_0xac1b('0xc'));var Papa=require('papaparse');var Redis=require(_0xac1b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xac1b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac1b('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xac1b('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xac1b('0x11'))['db'];function respondWithStatusCode(_0x43189b,_0x5f367a){_0x5f367a=_0x5f367a||0xcc;return function(_0x357e40){if(_0x357e40){return _0x43189b[_0xac1b('0x12')](_0x5f367a);}return _0x43189b['status'](_0x5f367a)['end']();};}function respondWithResult(_0x4739b7,_0x2b4adb){_0x2b4adb=_0x2b4adb||0xc8;return function(_0x5f4b42){if(_0x5f4b42){return _0x4739b7[_0xac1b('0x13')](_0x2b4adb)[_0xac1b('0x14')](_0x5f4b42);}};}function respondWithFilteredResult(_0x297c9c,_0x5083b1){return function(_0x299bde){if(_0x299bde){var _0x565b61=typeof _0x5083b1[_0xac1b('0x15')]==='undefined'&&typeof _0x5083b1[_0xac1b('0x16')]==='undefined';var _0x55f661=_0x299bde[_0xac1b('0x17')];var _0x382ae3=_0x565b61?0x0:_0x5083b1[_0xac1b('0x15')];var _0x9f048a=_0x565b61?_0x299bde[_0xac1b('0x17')]:_0x5083b1[_0xac1b('0x15')]+_0x5083b1[_0xac1b('0x16')];var _0x262959;if(_0x9f048a>=_0x55f661){_0x9f048a=_0x55f661;_0x262959=0xc8;}else{_0x262959=0xce;}_0x297c9c[_0xac1b('0x13')](_0x262959);return _0x297c9c['set'](_0xac1b('0x18'),_0x382ae3+'-'+_0x9f048a+'/'+_0x55f661)[_0xac1b('0x14')](_0x299bde);}return null;};}function patchUpdates(_0x3cb230){return function(_0x14708e){try{jsonpatch[_0xac1b('0x19')](_0x14708e,_0x3cb230,!![]);}catch(_0x2018ad){return BPromise[_0xac1b('0x1a')](_0x2018ad);}return _0x14708e[_0xac1b('0x1b')]();};}function saveUpdates(_0x4a5276,_0x3a7153){return function(_0xe56c0d){if(_0xe56c0d){return _0xe56c0d[_0xac1b('0x1c')](_0x4a5276)[_0xac1b('0x1d')](function(_0x14d5c6){return _0x14d5c6;});}return null;};}function removeEntity(_0xff7fae,_0x168531){return function(_0x27ec65){if(_0x27ec65){return _0x27ec65[_0xac1b('0x1e')]()[_0xac1b('0x1d')](function(){_0xff7fae[_0xac1b('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e7db,_0xdf2fd0){return function(_0x4c6b34){if(!_0x4c6b34){_0x52e7db[_0xac1b('0x12')](0x194);}return _0x4c6b34;};}function handleError(_0x2f3f06,_0x2e98aa){_0x2e98aa=_0x2e98aa||0x1f4;return function(_0x18dee6){logger['error'](_0x18dee6['stack']);if(_0x18dee6[_0xac1b('0x1f')]){delete _0x18dee6['name'];}_0x2f3f06[_0xac1b('0x13')](_0x2e98aa)[_0xac1b('0x20')](_0x18dee6);};}exports['index']=function(_0x34aad7,_0x461b4e){var _0x536b05={},_0x3b55ea={},_0xc4939c={'count':0x0,'rows':[]};var _0x2b0e7e=_[_0xac1b('0x21')](db[_0xac1b('0x22')][_0xac1b('0x23')],function(_0x2ad0cd){return{'name':_0x2ad0cd['fieldName'],'type':_0x2ad0cd[_0xac1b('0x24')]['key']};});_0x3b55ea[_0xac1b('0x25')]=_[_0xac1b('0x21')](_0x2b0e7e,'name');_0x3b55ea[_0xac1b('0x26')]=_['keys'](_0x34aad7[_0xac1b('0x26')]);_0x3b55ea[_0xac1b('0x27')]=_['intersection'](_0x3b55ea[_0xac1b('0x25')],_0x3b55ea['query']);_0x536b05['attributes']=_[_0xac1b('0x28')](_0x3b55ea[_0xac1b('0x25')],qs[_0xac1b('0x29')](_0x34aad7[_0xac1b('0x26')][_0xac1b('0x29')]));_0x536b05['attributes']=_0x536b05[_0xac1b('0x2a')]['length']?_0x536b05['attributes']:_0x3b55ea[_0xac1b('0x25')];if(!_0x34aad7[_0xac1b('0x26')][_0xac1b('0x2b')](_0xac1b('0x2c'))){_0x536b05[_0xac1b('0x16')]=qs['limit'](_0x34aad7[_0xac1b('0x26')][_0xac1b('0x16')]);_0x536b05[_0xac1b('0x15')]=qs[_0xac1b('0x15')](_0x34aad7[_0xac1b('0x26')]['offset']);}_0x536b05[_0xac1b('0x2d')]=qs[_0xac1b('0x2e')](_0x34aad7[_0xac1b('0x26')][_0xac1b('0x2e')]);_0x536b05[_0xac1b('0x2f')]=qs[_0xac1b('0x27')](_[_0xac1b('0x30')](_0x34aad7[_0xac1b('0x26')],_0x3b55ea['filters']),_0x2b0e7e);if(_0x34aad7[_0xac1b('0x26')][_0xac1b('0x31')]){_0x536b05[_0xac1b('0x2f')]=_['merge'](_0x536b05[_0xac1b('0x2f')],{'$or':_[_0xac1b('0x21')](_0x2b0e7e,function(_0x3278ce){if(_0x3278ce[_0xac1b('0x24')]!=='VIRTUAL'){var _0x16f1e9={};_0x16f1e9[_0x3278ce['name']]={'$like':'%'+_0x34aad7[_0xac1b('0x26')][_0xac1b('0x31')]+'%'};return _0x16f1e9;}})});}_0x536b05=_[_0xac1b('0x32')]({},_0x536b05,_0x34aad7[_0xac1b('0x33')]);var _0x2cee03={'where':_0x536b05[_0xac1b('0x2f')]};return db[_0xac1b('0x22')][_0xac1b('0x17')](_0x2cee03)[_0xac1b('0x1d')](function(_0x3b59df){_0xc4939c[_0xac1b('0x17')]=_0x3b59df;if(_0x34aad7['query'][_0xac1b('0x34')]){_0x536b05['include']=[{'all':!![]}];}return db[_0xac1b('0x22')][_0xac1b('0x35')](_0x536b05);})[_0xac1b('0x1d')](function(_0x546a37){_0xc4939c[_0xac1b('0x36')]=_0x546a37;return _0xc4939c;})[_0xac1b('0x1d')](respondWithFilteredResult(_0x461b4e,_0x536b05))[_0xac1b('0x37')](handleError(_0x461b4e,null));};exports[_0xac1b('0x38')]=function(_0x5c6931,_0x4828de){var _0x46fc79={'raw':!![],'where':{'id':_0x5c6931[_0xac1b('0x39')]['id']}},_0x950d03={};_0x950d03[_0xac1b('0x25')]=_[_0xac1b('0x3a')](db['Attachment']['rawAttributes']);_0x950d03[_0xac1b('0x26')]=_['keys'](_0x5c6931['query']);_0x950d03[_0xac1b('0x27')]=_[_0xac1b('0x28')](_0x950d03['model'],_0x950d03[_0xac1b('0x26')]);_0x46fc79[_0xac1b('0x2a')]=_['intersection'](_0x950d03[_0xac1b('0x25')],qs['fields'](_0x5c6931['query'][_0xac1b('0x29')]));_0x46fc79['attributes']=_0x46fc79['attributes'][_0xac1b('0x3b')]?_0x46fc79[_0xac1b('0x2a')]:_0x950d03['model'];if(_0x5c6931['query'][_0xac1b('0x34')]){_0x46fc79['include']=[{'all':!![]}];}_0x46fc79=_[_0xac1b('0x32')]({},_0x46fc79,_0x5c6931[_0xac1b('0x33')]);return db[_0xac1b('0x22')][_0xac1b('0x3c')](_0x46fc79)[_0xac1b('0x1d')](handleEntityNotFound(_0x4828de,null))[_0xac1b('0x1d')](respondWithResult(_0x4828de,null))[_0xac1b('0x37')](handleError(_0x4828de,null));};exports['clone']=function(_0x30d320,_0x3d6489){var _0x95c688={'where':{'id':_0x30d320['params']['id']}},_0x24ad3e={};_0x24ad3e['model']=_[_0xac1b('0x3a')](db['Attachment'][_0xac1b('0x23')]);_0x95c688[_0xac1b('0x2a')]=_[_0xac1b('0x28')](_0x24ad3e[_0xac1b('0x25')],qs[_0xac1b('0x29')](_0x30d320[_0xac1b('0x26')][_0xac1b('0x29')]));_0x95c688[_0xac1b('0x2a')]=_0x95c688[_0xac1b('0x2a')][_0xac1b('0x3b')]?_0x95c688[_0xac1b('0x2a')]:_0x24ad3e[_0xac1b('0x25')];if(_0x30d320[_0xac1b('0x26')][_0xac1b('0x34')]){_0x95c688['include']=[{'all':!![]}];}_0x95c688=_['merge']({},_0x95c688,_0x30d320['options']);return db['Attachment'][_0xac1b('0x3c')](_0x95c688)['then'](handleEntityNotFound(_0x3d6489,null))[_0xac1b('0x1d')](function(_0x55947c){if(_0x55947c){var _0x3735e6=_0x55947c[_0xac1b('0x3d')]({'plain':!![]});_0x3735e6=qs[_0xac1b('0x3e')](_0x3735e6,['id','createdAt',_0xac1b('0x3f')]);_0x30d320[_0xac1b('0x40')]=_[_0xac1b('0x3e')](_0x30d320[_0xac1b('0x40')],['id','createdAt','updatedAt']);return db[_0xac1b('0x22')][_0xac1b('0x41')](_['merge'](_0x3735e6,_0x30d320[_0xac1b('0x40')]),{'include':_0x30d320[_0xac1b('0x26')][_0xac1b('0x34')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3d6489,0xc9))[_0xac1b('0x37')](handleError(_0x3d6489,null));};exports['update']=function(_0xf801e1,_0x20585f){if(_0xf801e1[_0xac1b('0x40')]['id']){delete _0xf801e1[_0xac1b('0x40')]['id'];}return db[_0xac1b('0x22')][_0xac1b('0x3c')]({'where':{'id':_0xf801e1[_0xac1b('0x39')]['id']}})[_0xac1b('0x1d')](handleEntityNotFound(_0x20585f,null))[_0xac1b('0x1d')](saveUpdates(_0xf801e1[_0xac1b('0x40')],null))[_0xac1b('0x1d')](respondWithResult(_0x20585f,null))['catch'](handleError(_0x20585f,null));};exports[_0xac1b('0x1e')]=function(_0x1b64e9,_0x2ac772){return db[_0xac1b('0x22')][_0xac1b('0x3c')]({'where':{'id':_0x1b64e9[_0xac1b('0x39')]['id']}})['then'](handleEntityNotFound(_0x2ac772,null))[_0xac1b('0x1d')](removeEntity(_0x2ac772,null))['catch'](handleError(_0x2ac772,null));};exports[_0xac1b('0x41')]=function(_0x326ae0,_0x517b42,_0xd5b649){_0x326ae0[_0xac1b('0x40')][_0xac1b('0x1f')]=_0x326ae0[_0xac1b('0x42')][_0xac1b('0x43')];_0x326ae0[_0xac1b('0x40')][_0xac1b('0x44')]=_0x326ae0[_0xac1b('0x42')][_0xac1b('0x45')];_0x326ae0['body'][_0xac1b('0x24')]=_0x326ae0[_0xac1b('0x42')][_0xac1b('0x46')];return db[_0xac1b('0x22')]['create'](_0x326ae0['body'])['then'](respondWithResult(_0x517b42,0xc9))[_0xac1b('0x37')](handleError(_0x517b42,null));};exports['download']=function(_0xc7b42b,_0xce9b62,_0xdc7e0c){return db[_0xac1b('0x22')][_0xac1b('0x47')]({'where':{'id':_0xc7b42b[_0xac1b('0x39')]['id']},'raw':!![]})[_0xac1b('0x1d')](handleEntityNotFound(_0xce9b62,null))[_0xac1b('0x1d')](function(_0x90caaf){if(_0x90caaf){var _0xf4fc4a=_0x90caaf[_0xac1b('0x48')]!==null;var _0x22d5a9=path['join'](config[_0xac1b('0x49')],'server/files/attachments/');if(_0xf4fc4a){_0x22d5a9=path[_0xac1b('0x4a')](_0x22d5a9,'offline-chat/');}var _0x518e48=path['join'](_0x22d5a9,_0x90caaf[_0xac1b('0x44')]);return _0xce9b62[_0xac1b('0x4b')](_0x518e48);}})[_0xac1b('0x37')](handleError(_0xce9b62,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 4e8bdfa..e022c43 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 _0x5c0f=['Attachment','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define'];(function(_0x5a2f71,_0x98029e){var _0x3267cc=function(_0x5d64db){while(--_0x5d64db){_0x5a2f71['push'](_0x5a2f71['shift']());}};_0x3267cc(++_0x98029e);}(_0x5c0f,0xb1));var _0xf5c0=function(_0x3def1b,_0x56f748){_0x3def1b=_0x3def1b-0x0;var _0x57340e=_0x5c0f[_0x3def1b];return _0x57340e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5c0('0x0'))(_0xf5c0('0x1'));var moment=require(_0xf5c0('0x2'));var BPromise=require(_0xf5c0('0x3'));var rp=require(_0xf5c0('0x4'));var fs=require('fs');var path=require(_0xf5c0('0x5'));var rimraf=require(_0xf5c0('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5c0('0x7'));module[_0xf5c0('0x8')]=function(_0x152879,_0x541d87){return _0x152879[_0xf5c0('0x9')](_0xf5c0('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8871=['define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x4b0114,_0x1c3c3b){var _0x32dab9=function(_0x4f8f51){while(--_0x4f8f51){_0x4b0114['push'](_0x4b0114['shift']());}};_0x32dab9(++_0x1c3c3b);}(_0x8871,0x1bd));var _0x1887=function(_0x1554e6,_0x28607d){_0x1554e6=_0x1554e6-0x0;var _0x4cafbf=_0x8871[_0x1554e6];return _0x4cafbf;};'use strict';var _=require(_0x1887('0x0'));var util=require(_0x1887('0x1'));var logger=require(_0x1887('0x2'))(_0x1887('0x3'));var moment=require('moment');var BPromise=require(_0x1887('0x4'));var rp=require(_0x1887('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1887('0x6'));var config=require(_0x1887('0x7'));var attributes=require(_0x1887('0x8'));module[_0x1887('0x9')]=function(_0x55feab,_0x2bcc01){return _0x55feab[_0x1887('0xa')](_0x1887('0xb'),attributes,{'tableName':_0x1887('0xc'),'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 4ee4775..6f45ab6 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 _0xda55=['options','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body'];(function(_0x2a1ab6,_0x39b10e){var _0x182f6a=function(_0x69d9c4){while(--_0x69d9c4){_0x2a1ab6['push'](_0x2a1ab6['shift']());}};_0x182f6a(++_0x39b10e);}(_0xda55,0x6d));var _0x5da5=function(_0x4fe649,_0x177b95){_0x4fe649=_0x4fe649-0x0;var _0x19cebe=_0xda55[_0x4fe649];return _0x19cebe;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('Attachment,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});}exports[_0x5da5('0x16')]=function(_0x16b11f){var _0x3f7e98=this;return new Promise(function(_0x428b07,_0x547c58){return db[_0x5da5('0x17')][_0x5da5('0x18')](_0x16b11f[_0x5da5('0x19')],{'raw':_0x16b11f[_0x5da5('0x1a')]?_0x16b11f[_0x5da5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x5da5('0xa')](function(_0x3372fc){logger[_0x5da5('0x13')]('CreateAttachment',_0x16b11f);logger[_0x5da5('0xd')](_0x5da5('0x16'),_0x16b11f,JSON[_0x5da5('0xf')](_0x3372fc));_0x428b07(_0x3372fc);})[_0x5da5('0x15')](function(_0xec69f2){logger[_0x5da5('0x10')]('CreateAttachment',_0xec69f2[_0x5da5('0x12')],_0x16b11f);_0x547c58(_0x3f7e98['error'](0x1f4,_0xec69f2[_0x5da5('0x12')]));});});};
\ No newline at end of file
+var _0x720c=['http','request','info','request\x20sent','debug','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','Attachment','create','body','options','CreateAttachment','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a78f5,_0x25960f){var _0x158e72=function(_0x550e37){while(--_0x550e37){_0x2a78f5['push'](_0x2a78f5['shift']());}};_0x158e72(++_0x25960f);}(_0x720c,0x154));var _0xc720=function(_0x21f18f,_0xced443){_0x21f18f=_0x21f18f-0x0;var _0x44e5d0=_0x720c[_0x21f18f];return _0x44e5d0;};'use strict';var _=require(_0xc720('0x0'));var util=require('util');var moment=require(_0xc720('0x1'));var BPromise=require(_0xc720('0x2'));var rs=require(_0xc720('0x3'));var fs=require('fs');var Redis=require(_0xc720('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc720('0x5'));var logger=require(_0xc720('0x6'))(_0xc720('0x7'));var config=require(_0xc720('0x8'));var jayson=require(_0xc720('0x9'));var client=jayson[_0xc720('0xa')][_0xc720('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc8b0,_0x20d21c,_0x8a01fc){return new BPromise(function(_0x10a2c8,_0x1a2a00){return client[_0xc720('0xc')](_0x5bc8b0,_0x8a01fc)['then'](function(_0x539493){logger[_0xc720('0xd')]('Attachment,\x20%s,\x20%s',_0x20d21c,_0xc720('0xe'));logger[_0xc720('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x20d21c,_0xc720('0xe'),JSON[_0xc720('0x10')](_0x539493));if(_0x539493[_0xc720('0x11')]){if(_0x539493[_0xc720('0x11')][_0xc720('0x12')]===0x1f4){logger['error'](_0xc720('0x13'),_0x20d21c,_0x539493[_0xc720('0x11')][_0xc720('0x14')]);return _0x1a2a00(_0x539493[_0xc720('0x11')]['message']);}logger[_0xc720('0x11')](_0xc720('0x13'),_0x20d21c,_0x539493[_0xc720('0x11')]['message']);return _0x10a2c8(_0x539493[_0xc720('0x11')][_0xc720('0x14')]);}else{logger[_0xc720('0xd')](_0xc720('0x13'),_0x20d21c,_0xc720('0xe'));_0x10a2c8(_0x539493['result']['message']);}})[_0xc720('0x15')](function(_0x583e07){logger[_0xc720('0x11')](_0xc720('0x13'),_0x20d21c,_0x583e07);_0x1a2a00(_0x583e07);});});}exports['CreateAttachment']=function(_0x34de4c){var _0x2a4fc0=this;return new Promise(function(_0x195cf3,_0x7b41f3){return db[_0xc720('0x16')][_0xc720('0x17')](_0x34de4c[_0xc720('0x18')],{'raw':_0x34de4c[_0xc720('0x19')]?_0x34de4c[_0xc720('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x52cdf7){logger[_0xc720('0xd')](_0xc720('0x1a'),_0x34de4c);logger[_0xc720('0xf')](_0xc720('0x1a'),_0x34de4c,JSON[_0xc720('0x10')](_0x52cdf7));_0x195cf3(_0x52cdf7);})[_0xc720('0x15')](function(_0x358cfe){logger['error'](_0xc720('0x1a'),_0x358cfe['message'],_0x34de4c);_0x7b41f3(_0x2a4fc0[_0xc720('0x11')](0x1f4,_0x358cfe[_0xc720('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 23a43b1..9475c42 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x43c534,_0x51e65e){var _0x4dea44=function(_0x480adc){while(--_0x480adc){_0x43c534['push'](_0x43c534['shift']());}};_0x4dea44(++_0x51e65e);}(_0xb10b,0x12a));var _0xbb10=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xb10b[_0x41d02a];return _0x4c3983;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0xe5aeb9,_0x566135){var _0x471bdb=function(_0x421dc0){while(--_0x421dc0){_0xe5aeb9['push'](_0xe5aeb9['shift']());}};_0x471bdb(++_0x566135);}(_0xb10b,0x12a));var _0xbb10=function(_0xec919c,_0x45c528){_0xec919c=_0xec919c-0x0;var _0x516869=_0xb10b[_0xec919c];return _0x516869;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 33bca05..a48546a 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb08c=['authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role','disabled','blocked','blockedAt','online','admin','user','name','add','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','password','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','domain'];(function(_0x32fb5a,_0x565a38){var _0x2f212c=function(_0x597960){while(--_0x597960){_0x32fb5a['push'](_0x32fb5a['shift']());}};_0x2f212c(++_0x565a38);}(_0xb08c,0x181));var _0xcb08=function(_0x2f4ca9,_0x2898c9){_0x2f4ca9=_0x2f4ca9-0x0;var _0x50e240=_0xb08c[_0x2f4ca9];return _0x50e240;};'use strict';var passport=require(_0xcb08('0x0'));var LocalStrategy=require(_0xcb08('0x1'))[_0xcb08('0x2')];var moment=require(_0xcb08('0x3'));var ActiveDirectory=require(_0xcb08('0x4'));var BPromise=require('bluebird');var util=require(_0xcb08('0x5'));var db=require(_0xcb08('0x6'))['db'];var authService=require(_0xcb08('0x7'));var utils=require(_0xcb08('0x8'));var config=require(_0xcb08('0x9'));var logger=require(_0xcb08('0xa'))(_0xcb08('0xb'));function isActiveDirectoryConfigured(_0x5097b2){var _0x2444e0=![];if(typeof _0x5097b2[_0xcb08('0xc')]!=='undefined'){_0x2444e0=_0x5097b2['activedirectory'][_0xcb08('0xd')]&&_0x5097b2[_0xcb08('0xc')]['url']&&_0x5097b2[_0xcb08('0xc')][_0xcb08('0xe')];}return _0x2444e0;}function adAuthenticate(_0x3fbdbd,_0x303f37,_0xf5a47f){return new BPromise(function(_0x5aad94,_0x23b496){try{var _0x1c6fbb=new ActiveDirectory(_0x3fbdbd);_0x1c6fbb[_0xcb08('0xf')](_0x303f37,_0xf5a47f,function(_0x546cc4,_0x1906e9){if(_0x546cc4){logger['error'](_0xcb08('0x10'),_0x303f37,util[_0xcb08('0x11')](_0x546cc4,{'showHidden':![],'depth':null}));_0x23b496(_0xcb08('0x12'));}else if(!_0x1906e9){logger[_0xcb08('0x13')](_0xcb08('0x14'),_0x303f37);_0x23b496(_0xcb08('0x12'));}else{_0x5aad94(_0x1906e9);}});}catch(_0x3b0597){_0x23b496(_0x3b0597);}});}function ActiveDirectoryAuthenticate(_0xd6193f,_0xb7215f,_0x3f4eb4,_0x1a1960){var _0x18f2c0,_0x153886;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xb7215f);return _0x1a1960(null,![],{'message':_0xcb08('0x12')});}return db['Setting'][_0xcb08('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xcb08('0x16')],'raw':!![]})[_0xcb08('0x17')](function(_0x422c55){_0x18f2c0=_0x422c55;if(!_0x18f2c0[_0xcb08('0x18')]){logger[_0xcb08('0x13')](_0xcb08('0x19'),_0xb7215f);throw new Error(_0xcb08('0x12'));}return _0xd6193f[_0xcb08('0x15')]({'attributes':['id','name','password',_0xcb08('0x1a'),_0xcb08('0x1b'),_0xcb08('0x1c'),_0xcb08('0x1d'),_0xcb08('0x1e'),_0xcb08('0x1f')],'where':{'name':_0xb7215f,'role':{'$or':[_0xcb08('0x20'),_0xcb08('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0xcb08('0x17')](function(_0x27ef59){if(!_0x27ef59||_0x27ef59&&_0x27ef59[_0xcb08('0x22')]!==_0xb7215f){throw new Error(_0xcb08('0x12'));}_0x153886=_0x27ef59;var _0x58531e=_0x153886['name']+'@'+config[_0xcb08('0xc')][_0xcb08('0xe')];return adAuthenticate(config[_0xcb08('0xc')],_0x58531e,_0x3f4eb4);})[_0xcb08('0x17')](function(_0x1303d4){if(_0x153886[_0xcb08('0x1c')]){throw new Error(_0xcb08('0x12'));}if(_0x18f2c0[_0xcb08('0x16')]>0x0){if(_0x153886[_0xcb08('0x1d')]){if(moment(_0x153886['blockedAt'])[_0xcb08('0x23')](_0x18f2c0[_0xcb08('0x16')],_0xcb08('0x24'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xcb08('0x25')](_0x153886,0x0,![],null)[_0xcb08('0x17')](function(){return utils[_0xcb08('0x26')](_0x153886);})['then'](function(){return _0x1a1960(null,_0x153886);});}else{return utils[_0xcb08('0x26')](_0x153886)[_0xcb08('0x17')](function(){return _0x1a1960(null,_0x153886);});}}else{return utils[_0xcb08('0x26')](_0x153886)[_0xcb08('0x17')](function(){return _0x1a1960(null,_0x153886);});}})['catch'](function(_0x2b5faa){return _0x1a1960(null,![],_0x2b5faa);});}function handleError(_0x42981b,_0x3b3154,_0x202194){return _0x42981b[_0xcb08('0x27')](_0x3b3154||0x1f4)[_0xcb08('0x28')]({'message':_0x202194?_0x202194[_0xcb08('0x29')]||_0x202194:''});}exports[_0xcb08('0x2a')]=function(_0x4853de,_0x2283da,_0x5533d2){passport['authenticate'](_0xcb08('0x2b'),function(_0x5edf9b,_0x1651cc,_0xbfbf08){var _0x1c84e2=_0x5edf9b||_0xbfbf08;if(_0x1c84e2){return handleError(_0x2283da,0x191,_0x1c84e2);}if(!_0x1651cc){return handleError(_0x2283da,0x194,{'message':_0xcb08('0x2c')});}else{var _0x4b70e1={'payload':{'id':_0x1651cc['id'],'role':_0x1651cc[_0xcb08('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xcb08('0x2d')](_0x4b70e1)[_0xcb08('0x17')](function(_0x321473){_0x2283da[_0xcb08('0x2e')]({'id':_0x1651cc['id'],'token':_0x321473,'statusCall':'','isAlreadyLogged':_0x1651cc[_0xcb08('0x1f')]});});}})(_0x4853de,_0x2283da,_0x5533d2);};passport[_0xcb08('0x2f')](_0xcb08('0x2b'),new LocalStrategy({'usernameField':_0xcb08('0x22'),'passwordField':_0xcb08('0x30')},function(_0x554669,_0x11f981,_0x5951fd){return ActiveDirectoryAuthenticate(db[_0xcb08('0x31')],_0x554669,_0x11f981,_0x5951fd);}));
\ No newline at end of file
+var _0xb170=['online','admin','user','name','blocked','add','minutes','getLicense','status','send','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','use','User','Strategy','moment','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','disabled','blockedAt'];(function(_0x3f705a,_0x148dff){var _0x29c354=function(_0x4d9d7f){while(--_0x4d9d7f){_0x3f705a['push'](_0x3f705a['shift']());}};_0x29c354(++_0x148dff);}(_0xb170,0xbd));var _0x0b17=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb170[_0x122ef9];return _0x42fba0;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x0b17('0x0')];var moment=require(_0x0b17('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x0b17('0x2'));var db=require(_0x0b17('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x0b17('0x4'));var config=require(_0x0b17('0x5'));var logger=require(_0x0b17('0x6'))(_0x0b17('0x7'));function isActiveDirectoryConfigured(_0x170093){var _0x499bc2=![];if(typeof _0x170093[_0x0b17('0x8')]!==_0x0b17('0x9')){_0x499bc2=_0x170093[_0x0b17('0x8')][_0x0b17('0xa')]&&_0x170093[_0x0b17('0x8')][_0x0b17('0xb')]&&_0x170093[_0x0b17('0x8')][_0x0b17('0xc')];}return _0x499bc2;}function adAuthenticate(_0x40bd1c,_0x55d1f5,_0x5acf68){return new BPromise(function(_0x23b61e,_0xc83fbd){try{var _0x4fdb4d=new ActiveDirectory(_0x40bd1c);_0x4fdb4d['authenticate'](_0x55d1f5,_0x5acf68,function(_0x5aed64,_0x3734ef){if(_0x5aed64){logger[_0x0b17('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x55d1f5,util['inspect'](_0x5aed64,{'showHidden':![],'depth':null}));_0xc83fbd(_0x0b17('0xe'));}else if(!_0x3734ef){logger[_0x0b17('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x55d1f5);_0xc83fbd('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x23b61e(_0x3734ef);}});}catch(_0x7e3f13){_0xc83fbd(_0x7e3f13);}});}function ActiveDirectoryAuthenticate(_0x33fddd,_0x17c131,_0x56ac2d,_0x4626cc){var _0x215996,_0x45ba1a;if(!isActiveDirectoryConfigured(config)){logger[_0x0b17('0xd')](_0x0b17('0xf'),_0x17c131);return _0x4626cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0b17('0x10')][_0x0b17('0x11')]({'where':{'id':0x1},'attributes':[_0x0b17('0x12'),_0x0b17('0x13')],'raw':!![]})[_0x0b17('0x14')](function(_0x550664){_0x215996=_0x550664;if(!_0x215996[_0x0b17('0x12')]){logger[_0x0b17('0xd')](_0x0b17('0x15'),_0x17c131);throw new Error(_0x0b17('0xe'));}return _0x33fddd['findOne']({'attributes':['id','name',_0x0b17('0x16'),_0x0b17('0x17'),'role',_0x0b17('0x18'),'blocked',_0x0b17('0x19'),_0x0b17('0x1a')],'where':{'name':_0x17c131,'role':{'$or':[_0x0b17('0x1b'),_0x0b17('0x1c'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x4b0aaa){if(!_0x4b0aaa||_0x4b0aaa&&_0x4b0aaa[_0x0b17('0x1d')]!==_0x17c131){throw new Error(_0x0b17('0xe'));}_0x45ba1a=_0x4b0aaa;var _0x26998c=_0x45ba1a[_0x0b17('0x1d')]+'@'+config[_0x0b17('0x8')][_0x0b17('0xc')];return adAuthenticate(config[_0x0b17('0x8')],_0x26998c,_0x56ac2d);})[_0x0b17('0x14')](function(_0xc6ea5e){if(_0x45ba1a[_0x0b17('0x18')]){throw new Error(_0x0b17('0xe'));}if(_0x215996[_0x0b17('0x13')]>0x0){if(_0x45ba1a[_0x0b17('0x1e')]){if(moment(_0x45ba1a['blockedAt'])[_0x0b17('0x1f')](_0x215996[_0x0b17('0x13')],_0x0b17('0x20'))>moment()){throw new Error(_0x0b17('0xe'));}return utils['clearBlockUser'](_0x45ba1a,0x0,![],null)[_0x0b17('0x14')](function(){return utils[_0x0b17('0x21')](_0x45ba1a);})[_0x0b17('0x14')](function(){return _0x4626cc(null,_0x45ba1a);});}else{return utils['getLicense'](_0x45ba1a)['then'](function(){return _0x4626cc(null,_0x45ba1a);});}}else{return utils[_0x0b17('0x21')](_0x45ba1a)['then'](function(){return _0x4626cc(null,_0x45ba1a);});}})['catch'](function(_0x312d36){return _0x4626cc(null,![],_0x312d36);});}function handleError(_0x4564ef,_0x38988e,_0x62c586){return _0x4564ef[_0x0b17('0x22')](_0x38988e||0x1f4)[_0x0b17('0x23')]({'message':_0x62c586?_0x62c586['message']||_0x62c586:''});}exports[_0x0b17('0x24')]=function(_0x38aebf,_0x6bf581,_0x173b76){passport[_0x0b17('0x25')](_0x0b17('0x26'),function(_0x271588,_0x47a5ce,_0x24d716){var _0x597e6c=_0x271588||_0x24d716;if(_0x597e6c){return handleError(_0x6bf581,0x191,_0x597e6c);}if(!_0x47a5ce){return handleError(_0x6bf581,0x194,{'message':_0x0b17('0x27')});}else{var _0x57c43d={'payload':{'id':_0x47a5ce['id'],'role':_0x47a5ce[_0x0b17('0x28')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x57c43d)[_0x0b17('0x14')](function(_0xedebf7){_0x6bf581['json']({'id':_0x47a5ce['id'],'token':_0xedebf7,'statusCall':'','isAlreadyLogged':_0x47a5ce[_0x0b17('0x1a')]});});}})(_0x38aebf,_0x6bf581,_0x173b76);};passport[_0x0b17('0x29')](_0x0b17('0x26'),new LocalStrategy({'usernameField':'name','passwordField':_0x0b17('0x16')},function(_0x474d71,_0x49c75b,_0x14416f){return ActiveDirectoryAuthenticate(db[_0x0b17('0x2a')],_0x474d71,_0x49c75b,_0x14416f);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 197dec2..22378a5 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85bd=['Router','./authActiveDirectory.controller','express'];(function(_0x58beaa,_0x41a8f0){var _0x478b2a=function(_0x499abf){while(--_0x499abf){_0x58beaa['push'](_0x58beaa['shift']());}};_0x478b2a(++_0x41a8f0);}(_0x85bd,0x1b2));var _0xd85b=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x85bd[_0x10852d];return _0x13a8d6;};'use strict';var express=require(_0xd85b('0x0'));var router=express[_0xd85b('0x1')]();var controller=require(_0xd85b('0x2'));router['post']('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0x4de0=['express','Router','./authActiveDirectory.controller','post','login'];(function(_0x4c25cb,_0xce5c6c){var _0x5a61f2=function(_0x5ad642){while(--_0x5ad642){_0x4c25cb['push'](_0x4c25cb['shift']());}};_0x5a61f2(++_0xce5c6c);}(_0x4de0,0x16d));var _0x04de=function(_0x562435,_0x1cbdee){_0x562435=_0x562435-0x0;var _0x402999=_0x4de0[_0x562435];return _0x402999;};'use strict';var express=require(_0x04de('0x0'));var router=express[_0x04de('0x1')]();var controller=require(_0x04de('0x2'));router[_0x04de('0x3')]('/',controller[_0x04de('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 6ceaa93..f1fd18a 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x351c9d,_0x2b306e){var _0x281bfa=function(_0x32fe12){while(--_0x32fe12){_0x351c9d['push'](_0x351c9d['shift']());}};_0x281bfa(++_0x2b306e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7a54,0x106));var _0x47a5=function(_0x2c0025,_0x353ba8){_0x2c0025=_0x2c0025-0x0;var _0x5bb668=_0x7a54[_0x2c0025];return _0x5bb668;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 80b9485..694d376 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 _0x300f=['../user/user.controller.js','../../components/auth/service','/callback','isMiddleware','setTokenCookie','exports','Router','./authGoogle.controller'];(function(_0x5cfb43,_0xddf01b){var _0xd01d86=function(_0x45cb29){while(--_0x45cb29){_0x5cfb43['push'](_0x5cfb43['shift']());}};_0xd01d86(++_0xddf01b);}(_0x300f,0x18e));var _0xf300=function(_0x5b14c5,_0xe0f313){_0x5b14c5=_0x5b14c5-0x0;var _0x5c00c1=_0x300f[_0x5b14c5];return _0x5c00c1;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xf300('0x0')]();var controller=require(_0xf300('0x1'));var userController=require(_0xf300('0x2'));var authService=require(_0xf300('0x3'));router['get']('/',controller['login']);router['get'](_0xf300('0x4'),controller['callback'],authService[_0xf300('0x5')],userController['login'],authService[_0xf300('0x6')]);module[_0xf300('0x7')]=router;
\ No newline at end of file
+var _0x4e60=['../user/user.controller.js','../../components/auth/service','get','callback','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x477cb1,_0x1bd49a){var _0x40bfc2=function(_0x5d3d52){while(--_0x5d3d52){_0x477cb1['push'](_0x477cb1['shift']());}};_0x40bfc2(++_0x1bd49a);}(_0x4e60,0x150));var _0x04e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e60[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x04e6('0x0'));var passport=require(_0x04e6('0x1'));var router=express[_0x04e6('0x2')]();var controller=require(_0x04e6('0x3'));var userController=require(_0x04e6('0x4'));var authService=require(_0x04e6('0x5'));router[_0x04e6('0x6')]('/',controller['login']);router[_0x04e6('0x6')]('/callback',controller[_0x04e6('0x7')],authService['isMiddleware'],userController['login'],authService[_0x04e6('0x8')]);module[_0x04e6('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 6982bbe..2bdb58a 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 _0x2b86=['request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','minutes','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','add','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','merge','format','\x22%s\x22\x20<%s>','user'];(function(_0x9b0237,_0x2905ca){var _0x5203fe=function(_0x3d1db2){while(--_0x3d1db2){_0x9b0237['push'](_0x9b0237['shift']());}};_0x5203fe(++_0x2905ca);}(_0x2b86,0x1bb));var _0x62b8=function(_0x237aab,_0x523604){_0x237aab=_0x237aab-0x0;var _0x55b525=_0x2b86[_0x237aab];return _0x55b525;};'use strict';var util=require('util');var passport=require(_0x62b8('0x0'));var LocalStrategy=require(_0x62b8('0x1'))[_0x62b8('0x2')];var jayson=require(_0x62b8('0x3'));var _=require(_0x62b8('0x4'));var rs=require('randomstring');var moment=require(_0x62b8('0x5'));var db=require(_0x62b8('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x62b8('0x7'));var client=jayson[_0x62b8('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x3cadab,_0x1d0715,_0x276770,_0x6c2104){var _0x21575f,_0xede99c;return db[_0x62b8('0x9')][_0x62b8('0xa')]({'where':{'id':0x1},'attributes':[_0x62b8('0xb'),_0x62b8('0xc')],'raw':!![]})[_0x62b8('0xd')](function(_0x1170ad){_0x21575f=_0x1170ad;return _0x3cadab[_0x62b8('0xa')]({'attributes':['id',_0x62b8('0xe'),'password',_0x62b8('0xf'),_0x62b8('0x10'),'disabled',_0x62b8('0x11'),_0x62b8('0x12'),_0x62b8('0x13')],'where':{'name':_0x1d0715,'role':{'$or':[_0x62b8('0x14'),'user','agent']}}});})[_0x62b8('0xd')](function(_0x1f4864){if(!_0x1f4864||_0x1f4864&&_0x1f4864['name']!==_0x1d0715){throw new Error(_0x62b8('0x15'));}else{_0xede99c=_0x1f4864;return _0xede99c;}})[_0x62b8('0xd')](function(){_0xede99c['authenticate'](_0x276770,function(_0x36fd0f,_0x5809b5){var _0x5aa64b=_0xede99c[_0x62b8('0x13')]+0x1;if(_0x36fd0f){return _0x6c2104(_0x36fd0f);}else if(!_0x5809b5){if(_0xede99c[_0x62b8('0x16')]){return _0x6c2104(null,![],{'message':_0x62b8('0x15')});}else if(_0x21575f[_0x62b8('0xb')]>0x0){if(_0xede99c[_0x62b8('0x11')]){if(_0x21575f[_0x62b8('0xc')]>0x0){if(moment(_0xede99c[_0x62b8('0x12')])[_0x62b8('0x17')](_0x21575f[_0x62b8('0xc')],'minutes')>moment()){return _0x6c2104(null,![],{'message':_0x62b8('0x15')});}else{return utils[_0x62b8('0x18')](_0xede99c,_0x5aa64b,![],null)[_0x62b8('0xd')](function(){return _0x6c2104(null,![],{'message':_0x62b8('0x15')});});}}else{return _0x6c2104(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5aa64b>=_0x21575f[_0x62b8('0xb')]){return utils[_0x62b8('0x18')](_0xede99c,0x0,!![],moment())[_0x62b8('0xd')](function(){return _0x6c2104(null,![],{'message':_0x62b8('0x15')});});}else{return utils[_0x62b8('0x18')](_0xede99c,_0x5aa64b,![],null)[_0x62b8('0xd')](function(){return _0x6c2104(null,![],{'message':_0x62b8('0x15')});});}}}else{return _0x6c2104(null,![],{'message':_0x62b8('0x15')});}}else{if(_0xede99c[_0x62b8('0x16')]){return _0x6c2104(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x21575f[_0x62b8('0xb')]>0x0){if(_0xede99c[_0x62b8('0x11')]){if(_0x21575f[_0x62b8('0xc')]>0x0){if(moment(_0xede99c['blockedAt'])[_0x62b8('0x17')](_0x21575f[_0x62b8('0xc')],'minutes')>moment()){return _0x6c2104(null,![],{'message':_0x62b8('0x15')});}else{return utils[_0x62b8('0x18')](_0xede99c,0x0,![],null)[_0x62b8('0xd')](function(){return utils[_0x62b8('0x19')](_0xede99c);})[_0x62b8('0xd')](function(){return _0x6c2104(null,_0xede99c);});}}else{return _0x6c2104(null,![],{'message':_0x62b8('0x15')});}}else{return utils[_0x62b8('0x18')](_0xede99c,0x0,![],null)[_0x62b8('0xd')](function(){return utils[_0x62b8('0x19')](_0xede99c);})[_0x62b8('0xd')](function(){return _0x6c2104(null,_0xede99c);})[_0x62b8('0x1a')](function(_0x55c0cb){return _0x6c2104(null,![],_0x55c0cb);});}}else{if(_0xede99c[_0x62b8('0x11')]){return _0x6c2104(null,![],{'message':_0x62b8('0x15')});}else{return utils['getLicense'](_0xede99c)['then'](function(){return _0x6c2104(null,_0xede99c);});}}}});})[_0x62b8('0x1a')](function(_0x3c0d0c){return _0x6c2104(null,![],_0x3c0d0c);});}function sendServiceMail(_0x51d64d){return db[_0x62b8('0x1b')][_0x62b8('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x62b8('0xe'),_0x62b8('0x1d')],'include':[{'model':db[_0x62b8('0x1e')],'as':_0x62b8('0x1f'),'include':[{'model':db[_0x62b8('0x20')],'as':_0x62b8('0x20')}]}]})[_0x62b8('0xd')](function(_0x27c111){if(!_0x27c111){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x156906=_0x27c111['getSmtpOptions']();var _0x2363cb={'account':_0x156906,'message':_[_0x62b8('0x21')]({'from':util[_0x62b8('0x22')](_0x62b8('0x23'),_0x27c111[_0x62b8('0xe')],_0x27c111[_0x62b8('0x1d')]||_0x27c111['Smtp'][_0x62b8('0x24')])},_0x51d64d)};return client[_0x62b8('0x25')](_0x62b8('0x26'),_0x2363cb);})['then'](function(_0x26241c){if(_0x26241c[_0x62b8('0x27')]){throw new Error(util[_0x62b8('0x22')](_0x62b8('0x28'),_0x26241c[_0x62b8('0x27')][_0x62b8('0x29')]||JSON[_0x62b8('0x2a')](_0x26241c[_0x62b8('0x27')])));}return!![];});}function handleError(_0x2db6a4,_0x22a69c,_0x53d28d){return _0x2db6a4['status'](_0x22a69c||0x1f4)[_0x62b8('0x2b')]({'message':_0x53d28d?_0x53d28d[_0x62b8('0x29')]||_0x53d28d:''});}exports[_0x62b8('0x2c')]=function(_0x577e38,_0x1b9eff,_0x33e0a7){passport['authenticate'](_0x62b8('0x2d'),function(_0x2450a3,_0x21adc5,_0x4e1967){var _0x5213e5=_0x2450a3||_0x4e1967;if(_0x5213e5){return handleError(_0x1b9eff,0x191,_0x5213e5);}if(!_0x21adc5){return handleError(_0x1b9eff,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2bc806={'payload':{'id':_0x21adc5['id'],'role':_0x21adc5[_0x62b8('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x62b8('0x2e')](_0x2bc806)['then'](function(_0x21babd){_0x1b9eff[_0x62b8('0x2f')]({'id':_0x21adc5['id'],'token':_0x21babd,'statusCall':'','isAlreadyLogged':_0x21adc5[_0x62b8('0x30')]});});}})(_0x577e38,_0x1b9eff,_0x33e0a7);};exports[_0x62b8('0x31')]=function(_0x2f964d,_0x1c234c){if(!_0x2f964d[_0x62b8('0x32')][_0x62b8('0x1d')]){return handleError(_0x1c234c,0x1f4,{'message':_0x62b8('0x33')});}var _0x284808=rs[_0x62b8('0x34')]();_0x2f964d[_0x62b8('0x32')]['email']=_0x2f964d[_0x62b8('0x32')][_0x62b8('0x1d')][_0x62b8('0x35')]()[_0x62b8('0x36')]();var _0x576adc;return db[_0x62b8('0x9')][_0x62b8('0xa')]({'where':{'id':0x1},'attributes':[_0x62b8('0xb'),'blockDuration'],'raw':!![]})[_0x62b8('0xd')](function(_0x45ec90){_0x576adc=_0x45ec90;return db[_0x62b8('0x37')]['find']({'where':{'email':_0x2f964d[_0x62b8('0x32')]['email']}});})[_0x62b8('0xd')](function(_0x93d1c0){if(!_0x93d1c0){throw new Error(_0x62b8('0x38'));}if(_0x93d1c0['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x93d1c0['blocked']){if(moment(_0x93d1c0[_0x62b8('0x12')])[_0x62b8('0x17')](_0x576adc[_0x62b8('0xc')],_0x62b8('0x39'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x93d1c0[_0x62b8('0x11')]=![];_0x93d1c0[_0x62b8('0x12')]=null;}}_0x93d1c0[_0x62b8('0x3a')]=_0x284808;_0x93d1c0[_0x62b8('0x3b')]=Date['now']()+0x36ee80;return _0x93d1c0[_0x62b8('0x3c')]();})[_0x62b8('0xd')](function(){return sendServiceMail({'to':_0x2f964d[_0x62b8('0x32')][_0x62b8('0x1d')],'subject':_0x62b8('0x3d'),'text':_0x62b8('0x3e')+_0x62b8('0x3f')+'https://'+_0x2f964d[_0x62b8('0x40')][_0x62b8('0x41')]+_0x62b8('0x42')+_0x284808+'\x0a\x0a'+_0x62b8('0x43')});})[_0x62b8('0xd')](function(){_0x1c234c[_0x62b8('0x44')](0xc8)[_0x62b8('0x2b')]({'message':_0x62b8('0x45')});})[_0x62b8('0x1a')](function(_0x5513cc){return handleError(_0x1c234c,0x1f4,_0x5513cc);});};exports[_0x62b8('0x46')]=function(_0x38704f,_0x30e8ab){return db[_0x62b8('0x37')][_0x62b8('0x1c')]({'where':{'resetPasswordToken':_0x38704f[_0x62b8('0x47')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x62b8('0xd')](function(_0x255752){if(!_0x255752){throw new Error(_0x62b8('0x48'));}return db['Setting'][_0x62b8('0xa')]({'attributes':['id',_0x62b8('0x49'),'enforcePasswordHistory',_0x62b8('0x4a')]})[_0x62b8('0xd')](function(_0x19901f){if(_0x19901f['securePassword'])authService[_0x62b8('0x4b')](_0x38704f[_0x62b8('0x32')][_0x62b8('0x4c')]);if(!_0x19901f[_0x62b8('0x4d')]||!_0x255752[_0x62b8('0x4e')])return _0x255752;authService['validatePasswordHistory'](_0x38704f[_0x62b8('0x32')][_0x62b8('0x4c')],_0x255752[_0x62b8('0x4e')],_0x19901f[_0x62b8('0x4a')]);return _0x255752;})['then'](function(){_0x255752[_0x62b8('0x4c')]=_0x38704f[_0x62b8('0x32')][_0x62b8('0x4c')];_0x255752[_0x62b8('0x3a')]=null;_0x255752[_0x62b8('0x3b')]=null;return _0x255752['save']();});})[_0x62b8('0xd')](function(){_0x30e8ab['status'](0xc8)[_0x62b8('0x2b')]({'message':'Password\x20reset!'});})['catch'](function(_0x523716){return handleError(_0x30e8ab,0x1f4,_0x523716);});};passport[_0x62b8('0x4f')]('local-login',new LocalStrategy({'usernameField':_0x62b8('0xe'),'passwordField':_0x62b8('0x4c')},function(_0x1462ea,_0x31b514,_0x1fb611){return localAuthenticate(db[_0x62b8('0x37')],_0x1462ea,_0x31b514,_0x1fb611);}));
\ No newline at end of file
+var _0x5d01=['\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','blockedAt','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','merge','format'];(function(_0x3f4678,_0x3751cb){var _0x596a02=function(_0x32283c){while(--_0x32283c){_0x3f4678['push'](_0x3f4678['shift']());}};_0x596a02(++_0x3751cb);}(_0x5d01,0xd5));var _0x15d0=function(_0x40747f,_0xfb96d9){_0x40747f=_0x40747f-0x0;var _0x37edc6=_0x5d01[_0x40747f];return _0x37edc6;};'use strict';var util=require(_0x15d0('0x0'));var passport=require('passport');var LocalStrategy=require(_0x15d0('0x1'))['Strategy'];var jayson=require(_0x15d0('0x2'));var _=require(_0x15d0('0x3'));var rs=require('randomstring');var moment=require(_0x15d0('0x4'));var db=require(_0x15d0('0x5'))['db'];var authService=require(_0x15d0('0x6'));var utils=require('../../config/utils');var client=jayson[_0x15d0('0x7')][_0x15d0('0x8')]({'port':0x232b});function localAuthenticate(_0x98d71d,_0x54547f,_0x489fb3,_0x280993){var _0x404b5b,_0x490391;return db['Setting'][_0x15d0('0x9')]({'where':{'id':0x1},'attributes':[_0x15d0('0xa'),_0x15d0('0xb')],'raw':!![]})[_0x15d0('0xc')](function(_0x5090ca){_0x404b5b=_0x5090ca;return _0x98d71d[_0x15d0('0x9')]({'attributes':['id',_0x15d0('0xd'),_0x15d0('0xe'),'salt',_0x15d0('0xf'),_0x15d0('0x10'),'blocked','blockedAt',_0x15d0('0x11')],'where':{'name':_0x54547f,'role':{'$or':[_0x15d0('0x12'),_0x15d0('0x13'),_0x15d0('0x14')]}}});})[_0x15d0('0xc')](function(_0x3ad0b4){if(!_0x3ad0b4||_0x3ad0b4&&_0x3ad0b4['name']!==_0x54547f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x490391=_0x3ad0b4;return _0x490391;}})[_0x15d0('0xc')](function(){_0x490391['authenticate'](_0x489fb3,function(_0x7f6442,_0x4edac6){var _0x579f68=_0x490391['loginAttempts']+0x1;if(_0x7f6442){return _0x280993(_0x7f6442);}else if(!_0x4edac6){if(_0x490391[_0x15d0('0x10')]){return _0x280993(null,![],{'message':_0x15d0('0x15')});}else if(_0x404b5b[_0x15d0('0xa')]>0x0){if(_0x490391[_0x15d0('0x16')]){if(_0x404b5b[_0x15d0('0xb')]>0x0){if(moment(_0x490391['blockedAt'])[_0x15d0('0x17')](_0x404b5b[_0x15d0('0xb')],'minutes')>moment()){return _0x280993(null,![],{'message':_0x15d0('0x15')});}else{return utils[_0x15d0('0x18')](_0x490391,_0x579f68,![],null)[_0x15d0('0xc')](function(){return _0x280993(null,![],{'message':_0x15d0('0x15')});});}}else{return _0x280993(null,![],{'message':_0x15d0('0x15')});}}else{if(_0x579f68>=_0x404b5b[_0x15d0('0xa')]){return utils['clearBlockUser'](_0x490391,0x0,!![],moment())[_0x15d0('0xc')](function(){return _0x280993(null,![],{'message':_0x15d0('0x15')});});}else{return utils[_0x15d0('0x18')](_0x490391,_0x579f68,![],null)[_0x15d0('0xc')](function(){return _0x280993(null,![],{'message':_0x15d0('0x15')});});}}}else{return _0x280993(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x490391[_0x15d0('0x10')]){return _0x280993(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x404b5b[_0x15d0('0xa')]>0x0){if(_0x490391['blocked']){if(_0x404b5b[_0x15d0('0xb')]>0x0){if(moment(_0x490391[_0x15d0('0x19')])['add'](_0x404b5b[_0x15d0('0xb')],_0x15d0('0x1a'))>moment()){return _0x280993(null,![],{'message':_0x15d0('0x15')});}else{return utils[_0x15d0('0x18')](_0x490391,0x0,![],null)[_0x15d0('0xc')](function(){return utils[_0x15d0('0x1b')](_0x490391);})['then'](function(){return _0x280993(null,_0x490391);});}}else{return _0x280993(null,![],{'message':_0x15d0('0x15')});}}else{return utils[_0x15d0('0x18')](_0x490391,0x0,![],null)[_0x15d0('0xc')](function(){return utils['getLicense'](_0x490391);})['then'](function(){return _0x280993(null,_0x490391);})['catch'](function(_0x447018){return _0x280993(null,![],_0x447018);});}}else{if(_0x490391[_0x15d0('0x16')]){return _0x280993(null,![],{'message':_0x15d0('0x15')});}else{return utils[_0x15d0('0x1b')](_0x490391)[_0x15d0('0xc')](function(){return _0x280993(null,_0x490391);});}}}});})[_0x15d0('0x1c')](function(_0x323226){return _0x280993(null,![],_0x323226);});}function sendServiceMail(_0x4e4ba4){return db['MailAccount'][_0x15d0('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x15d0('0xd'),_0x15d0('0x1e')],'include':[{'model':db[_0x15d0('0x1f')],'as':_0x15d0('0x20'),'include':[{'model':db[_0x15d0('0x21')],'as':'CloudProvider'}]}]})[_0x15d0('0xc')](function(_0x8610e9){if(!_0x8610e9){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5787a7=_0x8610e9['getSmtpOptions']();var _0x1d64fb={'account':_0x5787a7,'message':_[_0x15d0('0x22')]({'from':util[_0x15d0('0x23')](_0x15d0('0x24'),_0x8610e9[_0x15d0('0xd')],_0x8610e9[_0x15d0('0x1e')]||_0x8610e9[_0x15d0('0x20')][_0x15d0('0x13')])},_0x4e4ba4)};return client[_0x15d0('0x25')](_0x15d0('0x26'),_0x1d64fb);})['then'](function(_0x49cc3f){if(_0x49cc3f[_0x15d0('0x27')]){throw new Error(util['format'](_0x15d0('0x28'),_0x49cc3f[_0x15d0('0x27')][_0x15d0('0x29')]||JSON[_0x15d0('0x2a')](_0x49cc3f[_0x15d0('0x27')])));}return!![];});}function handleError(_0x441c4b,_0x5090da,_0x8691a){return _0x441c4b[_0x15d0('0x2b')](_0x5090da||0x1f4)[_0x15d0('0x2c')]({'message':_0x8691a?_0x8691a[_0x15d0('0x29')]||_0x8691a:''});}exports[_0x15d0('0x2d')]=function(_0x3c7d32,_0x5ef28c,_0x5e75e2){passport[_0x15d0('0x2e')](_0x15d0('0x2f'),function(_0x3de7de,_0x5bd560,_0x5ea2e3){var _0x3c9831=_0x3de7de||_0x5ea2e3;if(_0x3c9831){return handleError(_0x5ef28c,0x191,_0x3c9831);}if(!_0x5bd560){return handleError(_0x5ef28c,0x194,{'message':_0x15d0('0x30')});}else{var _0x307561={'payload':{'id':_0x5bd560['id'],'role':_0x5bd560['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x307561)[_0x15d0('0xc')](function(_0xcee3e4){_0x5ef28c[_0x15d0('0x31')]({'id':_0x5bd560['id'],'token':_0xcee3e4,'statusCall':'','isAlreadyLogged':_0x5bd560[_0x15d0('0x32')]});});}})(_0x3c7d32,_0x5ef28c,_0x5e75e2);};exports[_0x15d0('0x33')]=function(_0x5d19ae,_0x27b8ab){if(!_0x5d19ae['body'][_0x15d0('0x1e')]){return handleError(_0x27b8ab,0x1f4,{'message':_0x15d0('0x34')});}var _0x1c4b4b=rs[_0x15d0('0x35')]();_0x5d19ae['body'][_0x15d0('0x1e')]=_0x5d19ae[_0x15d0('0x36')][_0x15d0('0x1e')][_0x15d0('0x37')]()[_0x15d0('0x38')]();var _0x3d57db;return db[_0x15d0('0x39')][_0x15d0('0x9')]({'where':{'id':0x1},'attributes':[_0x15d0('0xa'),'blockDuration'],'raw':!![]})[_0x15d0('0xc')](function(_0x579d15){_0x3d57db=_0x579d15;return db[_0x15d0('0x3a')][_0x15d0('0x1d')]({'where':{'email':_0x5d19ae['body'][_0x15d0('0x1e')]}});})['then'](function(_0x5e6782){if(!_0x5e6782){throw new Error(_0x15d0('0x3b'));}if(_0x5e6782[_0x15d0('0x10')]){throw new Error(_0x15d0('0x3c'));}if(_0x5e6782[_0x15d0('0x16')]){if(moment(_0x5e6782['blockedAt'])[_0x15d0('0x17')](_0x3d57db['blockDuration'],_0x15d0('0x1a'))>moment()){throw new Error(_0x15d0('0x3d'));}else{_0x5e6782[_0x15d0('0x16')]=![];_0x5e6782[_0x15d0('0x19')]=null;}}_0x5e6782['resetPasswordToken']=_0x1c4b4b;_0x5e6782[_0x15d0('0x3e')]=Date[_0x15d0('0x3f')]()+0x36ee80;return _0x5e6782['save']();})[_0x15d0('0xc')](function(){return sendServiceMail({'to':_0x5d19ae[_0x15d0('0x36')][_0x15d0('0x1e')],'subject':_0x15d0('0x40'),'text':_0x15d0('0x41')+_0x15d0('0x42')+_0x15d0('0x43')+_0x5d19ae['headers']['host']+_0x15d0('0x44')+_0x1c4b4b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x15d0('0xc')](function(){_0x27b8ab[_0x15d0('0x2b')](0xc8)[_0x15d0('0x2c')]({'message':_0x15d0('0x45')});})['catch'](function(_0x2ff62c){return handleError(_0x27b8ab,0x1f4,_0x2ff62c);});};exports[_0x15d0('0x46')]=function(_0x6bb6d,_0x284ca0){return db[_0x15d0('0x3a')]['find']({'where':{'resetPasswordToken':_0x6bb6d[_0x15d0('0x47')][_0x15d0('0x48')],'resetPasswordExpires':{'$gt':Date[_0x15d0('0x3f')]()}}})['then'](function(_0x483e84){if(!_0x483e84){throw new Error(_0x15d0('0x49'));}return db['Setting'][_0x15d0('0x9')]({'attributes':['id','securePassword',_0x15d0('0x4a'),_0x15d0('0x4b')]})[_0x15d0('0xc')](function(_0x3d2684){if(_0x3d2684[_0x15d0('0x4c')])authService[_0x15d0('0x4d')](_0x6bb6d['body'][_0x15d0('0xe')]);if(!_0x3d2684['enforcePasswordHistory']||!_0x483e84[_0x15d0('0x4e')])return _0x483e84;authService[_0x15d0('0x4f')](_0x6bb6d[_0x15d0('0x36')][_0x15d0('0xe')],_0x483e84[_0x15d0('0x4e')],_0x3d2684[_0x15d0('0x4b')]);return _0x483e84;})['then'](function(){_0x483e84[_0x15d0('0xe')]=_0x6bb6d[_0x15d0('0x36')][_0x15d0('0xe')];_0x483e84['resetPasswordToken']=null;_0x483e84['resetPasswordExpires']=null;return _0x483e84[_0x15d0('0x50')]();});})[_0x15d0('0xc')](function(){_0x284ca0[_0x15d0('0x2b')](0xc8)['send']({'message':_0x15d0('0x51')});})['catch'](function(_0x6f7015){return handleError(_0x284ca0,0x1f4,_0x6f7015);});};passport[_0x15d0('0x52')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x15d0('0xe')},function(_0x162df5,_0x3e24e3,_0x304ccc){return localAuthenticate(db[_0x15d0('0x3a')],_0x162df5,_0x3e24e3,_0x304ccc);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 05ec362..7794e67 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 _0xcade=['./authLocal.controller','post','login','forgot','reset','exports','express','Router'];(function(_0x1cfc39,_0x15adef){var _0x1ae59b=function(_0x153274){while(--_0x153274){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x1ae59b(++_0x15adef);}(_0xcade,0x176));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xecad('0x0'));var router=express[_0xecad('0x1')]();var controller=require(_0xecad('0x2'));router[_0xecad('0x3')]('/',controller[_0xecad('0x4')]);router[_0xecad('0x3')]('/forgot',controller[_0xecad('0x5')]);router[_0xecad('0x3')]('/reset/:token',controller[_0xecad('0x6')]);module[_0xecad('0x7')]=router;
\ No newline at end of file
+var _0x39d4=['/reset/:token','reset','exports','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x3d7f32,_0x1a0361){var _0x201b3f=function(_0x2e9100){while(--_0x2e9100){_0x3d7f32['push'](_0x3d7f32['shift']());}};_0x201b3f(++_0x1a0361);}(_0x39d4,0x93));var _0x439d=function(_0x12a909,_0x2809e8){_0x12a909=_0x12a909-0x0;var _0x2f98c5=_0x39d4[_0x12a909];return _0x2f98c5;};'use strict';var express=require('express');var router=express[_0x439d('0x0')]();var controller=require(_0x439d('0x1'));router[_0x439d('0x2')]('/',controller[_0x439d('0x3')]);router['post'](_0x439d('0x4'),controller[_0x439d('0x5')]);router[_0x439d('0x2')](_0x439d('0x6'),controller[_0x439d('0x7')]);module[_0x439d('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index cb8a0a3..b07460c 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 _0xf28b=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xf28b,0x1cb));var _0xbf28=function(_0x410746,_0x301fbb){_0x410746=_0x410746-0x0;var _0x37a399=_0xf28b[_0x410746];return _0x37a399;};'use strict';var Sequelize=require('sequelize');module[_0xbf28('0x0')]={'name':{'type':Sequelize[_0xbf28('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbf28('0x1')]},'status':{'type':Sequelize[_0xbf28('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbf28('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x4074=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x37f364,_0x56f6ae){var _0x1a97dd=function(_0x4f4161){while(--_0x4f4161){_0x37f364['push'](_0x37f364['shift']());}};_0x1a97dd(++_0x56f6ae);}(_0x4074,0xcd));var _0x4407=function(_0x3c5042,_0x4f390f){_0x3c5042=_0x3c5042-0x0;var _0x4cc406=_0x4074[_0x3c5042];return _0x4cc406;};'use strict';var Sequelize=require('sequelize');module[_0x4407('0x0')]={'name':{'type':Sequelize[_0x4407('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4407('0x1')]},'status':{'type':Sequelize[_0x4407('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4407('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 27419fc..a2a1f6d 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 _0x98ed=['fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','options','includeAll','rows','show','params','rawAttributes','include','create','body','catch','update','find','Condition','addConditions','ids','omit','getConditions','pick','addActions','getActions','findOne','Action','nolimit','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','name','send','index','map','Automation','fieldName','type','key','query','keys','filters','intersection','model','attributes'];(function(_0x56aca0,_0x18e90d){var _0x5bfcdd=function(_0x2a6ccb){while(--_0x2a6ccb){_0x56aca0['push'](_0x56aca0['shift']());}};_0x5bfcdd(++_0x18e90d);}(_0x98ed,0x1ce));var _0xd98e=function(_0x995f33,_0x17fdce){_0x995f33=_0x995f33-0x0;var _0x587aec=_0x98ed[_0x995f33];return _0x587aec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd98e('0x0'));var zipdir=require(_0xd98e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd98e('0x2'));var moment=require(_0xd98e('0x3'));var BPromise=require(_0xd98e('0x4'));var Mustache=require(_0xd98e('0x5'));var util=require(_0xd98e('0x6'));var path=require(_0xd98e('0x7'));var sox=require('sox');var csv=require(_0xd98e('0x8'));var ejs=require(_0xd98e('0x9'));var fs=require('fs');var fs_extra=require(_0xd98e('0xa'));var _=require(_0xd98e('0xb'));var squel=require('squel');var crypto=require(_0xd98e('0xc'));var jsforce=require(_0xd98e('0xd'));var deskjs=require(_0xd98e('0xe'));var toCsv=require(_0xd98e('0x8'));var querystring=require(_0xd98e('0xf'));var Papa=require(_0xd98e('0x10'));var Redis=require(_0xd98e('0x11'));var authService=require(_0xd98e('0x12'));var qs=require(_0xd98e('0x13'));var as=require(_0xd98e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd98e('0x15'))(_0xd98e('0x16'));var utils=require(_0xd98e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd98e('0x18'));var db=require(_0xd98e('0x19'))['db'];function respondWithStatusCode(_0x567bc0,_0x51450c){_0x51450c=_0x51450c||0xcc;return function(_0x4a289e){if(_0x4a289e){return _0x567bc0['sendStatus'](_0x51450c);}return _0x567bc0['status'](_0x51450c)[_0xd98e('0x1a')]();};}function respondWithResult(_0x547555,_0x38fd1f){_0x38fd1f=_0x38fd1f||0xc8;return function(_0x41b5e0){if(_0x41b5e0){return _0x547555[_0xd98e('0x1b')](_0x38fd1f)[_0xd98e('0x1c')](_0x41b5e0);}};}function respondWithFilteredResult(_0x488a73,_0x3e18dc){return function(_0x126fd4){if(_0x126fd4){var _0x573cca=typeof _0x3e18dc[_0xd98e('0x1d')]===_0xd98e('0x1e')&&typeof _0x3e18dc['limit']==='undefined';var _0x17fc1b=_0x126fd4[_0xd98e('0x1f')];var _0x248381=_0x573cca?0x0:_0x3e18dc['offset'];var _0x4924d8=_0x573cca?_0x126fd4[_0xd98e('0x1f')]:_0x3e18dc['offset']+_0x3e18dc['limit'];var _0x3fef2d;if(_0x4924d8>=_0x17fc1b){_0x4924d8=_0x17fc1b;_0x3fef2d=0xc8;}else{_0x3fef2d=0xce;}_0x488a73[_0xd98e('0x1b')](_0x3fef2d);return _0x488a73[_0xd98e('0x20')](_0xd98e('0x21'),_0x248381+'-'+_0x4924d8+'/'+_0x17fc1b)[_0xd98e('0x1c')](_0x126fd4);}return null;};}function patchUpdates(_0x5b39a5){return function(_0x3f9c26){try{jsonpatch[_0xd98e('0x22')](_0x3f9c26,_0x5b39a5,!![]);}catch(_0x1f1873){return BPromise[_0xd98e('0x23')](_0x1f1873);}return _0x3f9c26[_0xd98e('0x24')]();};}function saveUpdates(_0x172c16,_0x5b60b7){return function(_0x330abf){if(_0x330abf){return _0x330abf['update'](_0x172c16)[_0xd98e('0x25')](function(_0x161608){return _0x161608;});}return null;};}function removeEntity(_0x116788,_0x1aae96){return function(_0x44d0e1){if(_0x44d0e1){return _0x44d0e1[_0xd98e('0x26')]()[_0xd98e('0x25')](function(){_0x116788['status'](0xcc)[_0xd98e('0x1a')]();});}};}function handleEntityNotFound(_0x1e536e,_0x4e5eaa){return function(_0x11cf56){if(!_0x11cf56){_0x1e536e[_0xd98e('0x27')](0x194);}return _0x11cf56;};}function handleError(_0x32f1d3,_0x2e23f6){_0x2e23f6=_0x2e23f6||0x1f4;return function(_0x1ae3bd){logger['error'](_0x1ae3bd['stack']);if(_0x1ae3bd[_0xd98e('0x28')]){delete _0x1ae3bd[_0xd98e('0x28')];}_0x32f1d3['status'](_0x2e23f6)[_0xd98e('0x29')](_0x1ae3bd);};}exports[_0xd98e('0x2a')]=function(_0xadc207,_0x103c89){var _0xe5a52={},_0x2a056f={},_0x38ee5a={'count':0x0,'rows':[]};var _0x250d6d=_[_0xd98e('0x2b')](db[_0xd98e('0x2c')]['rawAttributes'],function(_0x15102c){return{'name':_0x15102c[_0xd98e('0x2d')],'type':_0x15102c[_0xd98e('0x2e')][_0xd98e('0x2f')]};});_0x2a056f['model']=_[_0xd98e('0x2b')](_0x250d6d,_0xd98e('0x28'));_0x2a056f[_0xd98e('0x30')]=_[_0xd98e('0x31')](_0xadc207[_0xd98e('0x30')]);_0x2a056f[_0xd98e('0x32')]=_[_0xd98e('0x33')](_0x2a056f[_0xd98e('0x34')],_0x2a056f['query']);_0xe5a52[_0xd98e('0x35')]=_[_0xd98e('0x33')](_0x2a056f[_0xd98e('0x34')],qs[_0xd98e('0x36')](_0xadc207['query'][_0xd98e('0x36')]));_0xe5a52[_0xd98e('0x35')]=_0xe5a52[_0xd98e('0x35')][_0xd98e('0x37')]?_0xe5a52[_0xd98e('0x35')]:_0x2a056f[_0xd98e('0x34')];if(!_0xadc207[_0xd98e('0x30')][_0xd98e('0x38')]('nolimit')){_0xe5a52[_0xd98e('0x39')]=qs[_0xd98e('0x39')](_0xadc207[_0xd98e('0x30')][_0xd98e('0x39')]);_0xe5a52['offset']=qs[_0xd98e('0x1d')](_0xadc207[_0xd98e('0x30')][_0xd98e('0x1d')]);}_0xe5a52[_0xd98e('0x3a')]=qs['sort'](_0xadc207[_0xd98e('0x30')][_0xd98e('0x3b')]);_0xe5a52[_0xd98e('0x3c')]=qs[_0xd98e('0x32')](_['pick'](_0xadc207[_0xd98e('0x30')],_0x2a056f['filters']),_0x250d6d);if(_0xadc207[_0xd98e('0x30')][_0xd98e('0x3d')]){_0xe5a52[_0xd98e('0x3c')]=_[_0xd98e('0x3e')](_0xe5a52[_0xd98e('0x3c')],{'$or':_['map'](_0x250d6d,function(_0x156827){if(_0x156827[_0xd98e('0x2e')]!=='VIRTUAL'){var _0x54a20a={};_0x54a20a[_0x156827[_0xd98e('0x28')]]={'$like':'%'+_0xadc207['query'][_0xd98e('0x3d')]+'%'};return _0x54a20a;}})});}_0xe5a52=_['merge']({},_0xe5a52,_0xadc207[_0xd98e('0x3f')]);var _0x5f4b91={'where':_0xe5a52['where']};return db['Automation'][_0xd98e('0x1f')](_0x5f4b91)[_0xd98e('0x25')](function(_0x13f513){_0x38ee5a[_0xd98e('0x1f')]=_0x13f513;if(_0xadc207[_0xd98e('0x30')][_0xd98e('0x40')]){_0xe5a52['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0xe5a52);})[_0xd98e('0x25')](function(_0x1c0da9){_0x38ee5a[_0xd98e('0x41')]=_0x1c0da9;return _0x38ee5a;})[_0xd98e('0x25')](respondWithFilteredResult(_0x103c89,_0xe5a52))['catch'](handleError(_0x103c89,null));};exports[_0xd98e('0x42')]=function(_0x4b0989,_0x321287){var _0x7969ed={'raw':![],'where':{'id':_0x4b0989[_0xd98e('0x43')]['id']}},_0x51380a={};_0x51380a[_0xd98e('0x34')]=_[_0xd98e('0x31')](db[_0xd98e('0x2c')][_0xd98e('0x44')]);_0x51380a[_0xd98e('0x30')]=_[_0xd98e('0x31')](_0x4b0989[_0xd98e('0x30')]);_0x51380a[_0xd98e('0x32')]=_[_0xd98e('0x33')](_0x51380a[_0xd98e('0x34')],_0x51380a[_0xd98e('0x30')]);_0x7969ed[_0xd98e('0x35')]=_[_0xd98e('0x33')](_0x51380a[_0xd98e('0x34')],qs['fields'](_0x4b0989['query']['fields']));_0x7969ed[_0xd98e('0x35')]=_0x7969ed[_0xd98e('0x35')]['length']?_0x7969ed[_0xd98e('0x35')]:_0x51380a[_0xd98e('0x34')];if(_0x4b0989['query'][_0xd98e('0x40')]){_0x7969ed[_0xd98e('0x45')]=[{'all':!![]}];}_0x7969ed=_['merge']({},_0x7969ed,_0x4b0989['options']);return db['Automation']['find'](_0x7969ed)[_0xd98e('0x25')](handleEntityNotFound(_0x321287,null))[_0xd98e('0x25')](respondWithResult(_0x321287,null))['catch'](handleError(_0x321287,null));};exports[_0xd98e('0x46')]=function(_0x1625d3,_0x20a282){return db[_0xd98e('0x2c')]['create'](_0x1625d3[_0xd98e('0x47')],{})['then'](respondWithResult(_0x20a282,0xc9))[_0xd98e('0x48')](handleError(_0x20a282,null));};exports[_0xd98e('0x49')]=function(_0x6adb85,_0x346595){if(_0x6adb85['body']['id']){delete _0x6adb85[_0xd98e('0x47')]['id'];}return db['Automation']['find']({'where':{'id':_0x6adb85['params']['id']}})[_0xd98e('0x25')](handleEntityNotFound(_0x346595,null))[_0xd98e('0x25')](saveUpdates(_0x6adb85[_0xd98e('0x47')],null))[_0xd98e('0x25')](respondWithResult(_0x346595,null))['catch'](handleError(_0x346595,null));};exports[_0xd98e('0x26')]=function(_0x7a3cfe,_0x5bf270){return db['Automation'][_0xd98e('0x4a')]({'where':{'id':_0x7a3cfe[_0xd98e('0x43')]['id']}})[_0xd98e('0x25')](handleEntityNotFound(_0x5bf270,null))[_0xd98e('0x25')](removeEntity(_0x5bf270,null))[_0xd98e('0x48')](handleError(_0x5bf270,null));};exports['addConditions']=function(_0x3467c7,_0x3cc191,_0xf3d19c){return db[_0xd98e('0x4b')]['find']({'where':{'id':_0x3467c7['params']['id']}})[_0xd98e('0x25')](handleEntityNotFound(_0x3cc191,null))[_0xd98e('0x25')](function(_0x217ece){if(_0x217ece){return _0x217ece[_0xd98e('0x4c')](_0x3467c7[_0xd98e('0x47')][_0xd98e('0x4d')],_[_0xd98e('0x4e')](_0x3467c7[_0xd98e('0x47')],[_0xd98e('0x4d'),'id'])||{});}})[_0xd98e('0x25')](respondWithResult(_0x3cc191,null))[_0xd98e('0x48')](handleError(_0x3cc191,null));};exports[_0xd98e('0x4f')]=function(_0xb03ada,_0x1ddfa2,_0x590ea6){var _0x157f44={};var _0x4107c5={};var _0x309864;var _0x1835f1;return db[_0xd98e('0x2c')]['findOne']({'where':{'id':_0xb03ada['params']['id']}})[_0xd98e('0x25')](handleEntityNotFound(_0x1ddfa2,null))[_0xd98e('0x25')](function(_0x292558){if(_0x292558){_0x309864=_0x292558;_0x4107c5[_0xd98e('0x34')]=_[_0xd98e('0x31')](db[_0xd98e('0x4b')][_0xd98e('0x44')]);_0x4107c5[_0xd98e('0x30')]=_[_0xd98e('0x31')](_0xb03ada['query']);_0x4107c5[_0xd98e('0x32')]=_[_0xd98e('0x33')](_0x4107c5[_0xd98e('0x34')],_0x4107c5[_0xd98e('0x30')]);_0x157f44[_0xd98e('0x35')]=_['intersection'](_0x4107c5[_0xd98e('0x34')],qs['fields'](_0xb03ada[_0xd98e('0x30')]['fields']));_0x157f44[_0xd98e('0x35')]=_0x157f44[_0xd98e('0x35')][_0xd98e('0x37')]?_0x157f44['attributes']:_0x4107c5['model'];_0x157f44[_0xd98e('0x3a')]=qs[_0xd98e('0x3b')](_0xb03ada[_0xd98e('0x30')][_0xd98e('0x3b')]);_0x157f44[_0xd98e('0x3c')]=qs[_0xd98e('0x32')](_[_0xd98e('0x50')](_0xb03ada['query'],_0x4107c5['filters']));if(_0xb03ada[_0xd98e('0x30')][_0xd98e('0x3d')]){_0x157f44[_0xd98e('0x3c')]=_[_0xd98e('0x3e')](_0x157f44[_0xd98e('0x3c')],{'$or':_[_0xd98e('0x2b')](_0x157f44[_0xd98e('0x35')],function(_0x16133b){var _0x33f7e0={};_0x33f7e0[_0x16133b]={'$like':'%'+_0xb03ada[_0xd98e('0x30')]['filter']+'%'};return _0x33f7e0;})});}_0x157f44=_[_0xd98e('0x3e')]({},_0x157f44,_0xb03ada[_0xd98e('0x3f')]);return _0x309864[_0xd98e('0x4f')](_0x157f44);}})[_0xd98e('0x25')](function(_0x35171f){if(_0x35171f){_0x1835f1=_0x35171f['length'];if(!_0xb03ada[_0xd98e('0x30')][_0xd98e('0x38')]('nolimit')){_0x157f44['limit']=qs[_0xd98e('0x39')](_0xb03ada[_0xd98e('0x30')][_0xd98e('0x39')]);_0x157f44['offset']=qs['offset'](_0xb03ada[_0xd98e('0x30')]['offset']);}return _0x309864[_0xd98e('0x4f')](_0x157f44);}})[_0xd98e('0x25')](function(_0x5aa8b9){if(_0x5aa8b9){return _0x5aa8b9?{'count':_0x1835f1,'rows':_0x5aa8b9}:null;}})['then'](respondWithResult(_0x1ddfa2,null))[_0xd98e('0x48')](handleError(_0x1ddfa2,null));};exports[_0xd98e('0x51')]=function(_0x878ebd,_0x9d8718,_0x2a5d7e){return db['Action'][_0xd98e('0x4a')]({'where':{'id':_0x878ebd[_0xd98e('0x43')]['id']}})[_0xd98e('0x25')](handleEntityNotFound(_0x9d8718,null))[_0xd98e('0x25')](function(_0x5c349d){if(_0x5c349d){return _0x5c349d[_0xd98e('0x51')](_0x878ebd[_0xd98e('0x47')]['ids'],_[_0xd98e('0x4e')](_0x878ebd[_0xd98e('0x47')],[_0xd98e('0x4d'),'id'])||{});}})[_0xd98e('0x25')](respondWithResult(_0x9d8718,null))['catch'](handleError(_0x9d8718,null));};exports[_0xd98e('0x52')]=function(_0x48930b,_0x1aa72f,_0x280bbb){var _0x5acf86={};var _0x8e80df={};var _0x342f5e;var _0x574f2d;return db[_0xd98e('0x2c')][_0xd98e('0x53')]({'where':{'id':_0x48930b['params']['id']}})[_0xd98e('0x25')](handleEntityNotFound(_0x1aa72f,null))[_0xd98e('0x25')](function(_0x47fe5c){if(_0x47fe5c){_0x342f5e=_0x47fe5c;_0x8e80df[_0xd98e('0x34')]=_[_0xd98e('0x31')](db[_0xd98e('0x54')][_0xd98e('0x44')]);_0x8e80df['query']=_[_0xd98e('0x31')](_0x48930b[_0xd98e('0x30')]);_0x8e80df[_0xd98e('0x32')]=_['intersection'](_0x8e80df['model'],_0x8e80df[_0xd98e('0x30')]);_0x5acf86[_0xd98e('0x35')]=_[_0xd98e('0x33')](_0x8e80df[_0xd98e('0x34')],qs[_0xd98e('0x36')](_0x48930b['query'][_0xd98e('0x36')]));_0x5acf86[_0xd98e('0x35')]=_0x5acf86['attributes'][_0xd98e('0x37')]?_0x5acf86['attributes']:_0x8e80df[_0xd98e('0x34')];_0x5acf86[_0xd98e('0x3a')]=qs['sort'](_0x48930b[_0xd98e('0x30')][_0xd98e('0x3b')]);_0x5acf86[_0xd98e('0x3c')]=qs[_0xd98e('0x32')](_[_0xd98e('0x50')](_0x48930b[_0xd98e('0x30')],_0x8e80df[_0xd98e('0x32')]));if(_0x48930b[_0xd98e('0x30')][_0xd98e('0x3d')]){_0x5acf86['where']=_[_0xd98e('0x3e')](_0x5acf86[_0xd98e('0x3c')],{'$or':_[_0xd98e('0x2b')](_0x5acf86[_0xd98e('0x35')],function(_0x47d20a){var _0x1731dc={};_0x1731dc[_0x47d20a]={'$like':'%'+_0x48930b[_0xd98e('0x30')][_0xd98e('0x3d')]+'%'};return _0x1731dc;})});}_0x5acf86=_[_0xd98e('0x3e')]({},_0x5acf86,_0x48930b[_0xd98e('0x3f')]);return _0x342f5e['getActions'](_0x5acf86);}})[_0xd98e('0x25')](function(_0x5b4765){if(_0x5b4765){_0x574f2d=_0x5b4765[_0xd98e('0x37')];if(!_0x48930b['query'][_0xd98e('0x38')](_0xd98e('0x55'))){_0x5acf86[_0xd98e('0x39')]=qs[_0xd98e('0x39')](_0x48930b[_0xd98e('0x30')]['limit']);_0x5acf86['offset']=qs['offset'](_0x48930b[_0xd98e('0x30')][_0xd98e('0x1d')]);}return _0x342f5e[_0xd98e('0x52')](_0x5acf86);}})[_0xd98e('0x25')](function(_0x93ab9){if(_0x93ab9){return _0x93ab9?{'count':_0x574f2d,'rows':_0x93ab9}:null;}})[_0xd98e('0x25')](respondWithResult(_0x1aa72f,null))[_0xd98e('0x48')](handleError(_0x1aa72f,null));};
\ No newline at end of file
+var _0x46fc=['length','includeAll','find','create','update','body','Condition','ids','omit','findOne','getConditions','nolimit','addActions','getActions','Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','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','undefined','limit','count','apply','save','destroy','then','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params'];(function(_0x4c0d78,_0x5860c5){var _0x2410e8=function(_0x28fbb8){while(--_0x28fbb8){_0x4c0d78['push'](_0x4c0d78['shift']());}};_0x2410e8(++_0x5860c5);}(_0x46fc,0x1c2));var _0xc46f=function(_0x416a38,_0x5004e0){_0x416a38=_0x416a38-0x0;var _0xec6c28=_0x46fc[_0x416a38];return _0xec6c28;};'use strict';var emlformat=require(_0xc46f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc46f('0x1'));var jsonpatch=require(_0xc46f('0x2'));var rp=require(_0xc46f('0x3'));var moment=require(_0xc46f('0x4'));var BPromise=require(_0xc46f('0x5'));var Mustache=require('mustache');var util=require(_0xc46f('0x6'));var path=require(_0xc46f('0x7'));var sox=require(_0xc46f('0x8'));var csv=require('to-csv');var ejs=require(_0xc46f('0x9'));var fs=require('fs');var fs_extra=require(_0xc46f('0xa'));var _=require(_0xc46f('0xb'));var squel=require(_0xc46f('0xc'));var crypto=require(_0xc46f('0xd'));var jsforce=require(_0xc46f('0xe'));var deskjs=require(_0xc46f('0xf'));var toCsv=require(_0xc46f('0x10'));var querystring=require(_0xc46f('0x11'));var Papa=require('papaparse');var Redis=require(_0xc46f('0x12'));var authService=require(_0xc46f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc46f('0x14'));var hardwareService=require(_0xc46f('0x15'));var logger=require(_0xc46f('0x16'))(_0xc46f('0x17'));var utils=require(_0xc46f('0x18'));var config=require(_0xc46f('0x19'));var licenseUtil=require(_0xc46f('0x1a'));var db=require(_0xc46f('0x1b'))['db'];function respondWithStatusCode(_0x2fb6be,_0x3c4cd7){_0x3c4cd7=_0x3c4cd7||0xcc;return function(_0x265bef){if(_0x265bef){return _0x2fb6be[_0xc46f('0x1c')](_0x3c4cd7);}return _0x2fb6be[_0xc46f('0x1d')](_0x3c4cd7)[_0xc46f('0x1e')]();};}function respondWithResult(_0x4f6543,_0x3c34c7){_0x3c34c7=_0x3c34c7||0xc8;return function(_0x8e4387){if(_0x8e4387){return _0x4f6543[_0xc46f('0x1d')](_0x3c34c7)[_0xc46f('0x1f')](_0x8e4387);}};}function respondWithFilteredResult(_0xf7615c,_0x53e7fc){return function(_0x5e0a9d){if(_0x5e0a9d){var _0x318b15=typeof _0x53e7fc[_0xc46f('0x20')]===_0xc46f('0x21')&&typeof _0x53e7fc[_0xc46f('0x22')]===_0xc46f('0x21');var _0x443495=_0x5e0a9d[_0xc46f('0x23')];var _0x586034=_0x318b15?0x0:_0x53e7fc[_0xc46f('0x20')];var _0x403592=_0x318b15?_0x5e0a9d[_0xc46f('0x23')]:_0x53e7fc['offset']+_0x53e7fc[_0xc46f('0x22')];var _0x334b7e;if(_0x403592>=_0x443495){_0x403592=_0x443495;_0x334b7e=0xc8;}else{_0x334b7e=0xce;}_0xf7615c[_0xc46f('0x1d')](_0x334b7e);return _0xf7615c['set']('Content-Range',_0x586034+'-'+_0x403592+'/'+_0x443495)[_0xc46f('0x1f')](_0x5e0a9d);}return null;};}function patchUpdates(_0x2fd5a0){return function(_0x694403){try{jsonpatch[_0xc46f('0x24')](_0x694403,_0x2fd5a0,!![]);}catch(_0x99ff22){return BPromise['reject'](_0x99ff22);}return _0x694403[_0xc46f('0x25')]();};}function saveUpdates(_0x15d462,_0x443034){return function(_0x154288){if(_0x154288){return _0x154288['update'](_0x15d462)['then'](function(_0x46ec8e){return _0x46ec8e;});}return null;};}function removeEntity(_0x160009,_0x2f8dc0){return function(_0x1bd6f0){if(_0x1bd6f0){return _0x1bd6f0[_0xc46f('0x26')]()[_0xc46f('0x27')](function(){_0x160009[_0xc46f('0x1d')](0xcc)[_0xc46f('0x1e')]();});}};}function handleEntityNotFound(_0x4e9df2,_0x557093){return function(_0x3c1961){if(!_0x3c1961){_0x4e9df2[_0xc46f('0x1c')](0x194);}return _0x3c1961;};}function handleError(_0x1b859f,_0x52ad7f){_0x52ad7f=_0x52ad7f||0x1f4;return function(_0x1ac116){logger['error'](_0x1ac116[_0xc46f('0x28')]);if(_0x1ac116[_0xc46f('0x29')]){delete _0x1ac116['name'];}_0x1b859f[_0xc46f('0x1d')](_0x52ad7f)[_0xc46f('0x2a')](_0x1ac116);};}exports[_0xc46f('0x2b')]=function(_0xaf9f65,_0x19b921){var _0x2888a5={},_0x383b8f={},_0x104cd5={'count':0x0,'rows':[]};var _0x37e3af=_[_0xc46f('0x2c')](db[_0xc46f('0x2d')][_0xc46f('0x2e')],function(_0x4b7071){return{'name':_0x4b7071[_0xc46f('0x2f')],'type':_0x4b7071[_0xc46f('0x30')][_0xc46f('0x31')]};});_0x383b8f['model']=_[_0xc46f('0x2c')](_0x37e3af,_0xc46f('0x29'));_0x383b8f['query']=_[_0xc46f('0x32')](_0xaf9f65[_0xc46f('0x33')]);_0x383b8f[_0xc46f('0x34')]=_[_0xc46f('0x35')](_0x383b8f[_0xc46f('0x36')],_0x383b8f[_0xc46f('0x33')]);_0x2888a5[_0xc46f('0x37')]=_[_0xc46f('0x35')](_0x383b8f[_0xc46f('0x36')],qs[_0xc46f('0x38')](_0xaf9f65[_0xc46f('0x33')][_0xc46f('0x38')]));_0x2888a5[_0xc46f('0x37')]=_0x2888a5[_0xc46f('0x37')]['length']?_0x2888a5[_0xc46f('0x37')]:_0x383b8f['model'];if(!_0xaf9f65['query'][_0xc46f('0x39')]('nolimit')){_0x2888a5[_0xc46f('0x22')]=qs[_0xc46f('0x22')](_0xaf9f65[_0xc46f('0x33')]['limit']);_0x2888a5[_0xc46f('0x20')]=qs[_0xc46f('0x20')](_0xaf9f65[_0xc46f('0x33')][_0xc46f('0x20')]);}_0x2888a5[_0xc46f('0x3a')]=qs[_0xc46f('0x3b')](_0xaf9f65[_0xc46f('0x33')][_0xc46f('0x3b')]);_0x2888a5[_0xc46f('0x3c')]=qs[_0xc46f('0x34')](_[_0xc46f('0x3d')](_0xaf9f65[_0xc46f('0x33')],_0x383b8f[_0xc46f('0x34')]),_0x37e3af);if(_0xaf9f65[_0xc46f('0x33')][_0xc46f('0x3e')]){_0x2888a5[_0xc46f('0x3c')]=_[_0xc46f('0x3f')](_0x2888a5[_0xc46f('0x3c')],{'$or':_['map'](_0x37e3af,function(_0x4bd2f5){if(_0x4bd2f5['type']!==_0xc46f('0x40')){var _0x317e08={};_0x317e08[_0x4bd2f5[_0xc46f('0x29')]]={'$like':'%'+_0xaf9f65[_0xc46f('0x33')][_0xc46f('0x3e')]+'%'};return _0x317e08;}})});}_0x2888a5=_[_0xc46f('0x3f')]({},_0x2888a5,_0xaf9f65[_0xc46f('0x41')]);var _0x4bfb83={'where':_0x2888a5[_0xc46f('0x3c')]};return db['Automation'][_0xc46f('0x23')](_0x4bfb83)[_0xc46f('0x27')](function(_0xc80523){_0x104cd5[_0xc46f('0x23')]=_0xc80523;if(_0xaf9f65[_0xc46f('0x33')]['includeAll']){_0x2888a5[_0xc46f('0x42')]=[{'all':!![]}];}return db[_0xc46f('0x2d')][_0xc46f('0x43')](_0x2888a5);})[_0xc46f('0x27')](function(_0x10a2f3){_0x104cd5[_0xc46f('0x44')]=_0x10a2f3;return _0x104cd5;})[_0xc46f('0x27')](respondWithFilteredResult(_0x19b921,_0x2888a5))[_0xc46f('0x45')](handleError(_0x19b921,null));};exports[_0xc46f('0x46')]=function(_0x4f307a,_0x1cfa85){var _0x284b02={'raw':![],'where':{'id':_0x4f307a[_0xc46f('0x47')]['id']}},_0x43a695={};_0x43a695['model']=_[_0xc46f('0x32')](db[_0xc46f('0x2d')][_0xc46f('0x2e')]);_0x43a695[_0xc46f('0x33')]=_['keys'](_0x4f307a[_0xc46f('0x33')]);_0x43a695[_0xc46f('0x34')]=_[_0xc46f('0x35')](_0x43a695[_0xc46f('0x36')],_0x43a695[_0xc46f('0x33')]);_0x284b02[_0xc46f('0x37')]=_['intersection'](_0x43a695[_0xc46f('0x36')],qs[_0xc46f('0x38')](_0x4f307a[_0xc46f('0x33')][_0xc46f('0x38')]));_0x284b02[_0xc46f('0x37')]=_0x284b02[_0xc46f('0x37')][_0xc46f('0x48')]?_0x284b02[_0xc46f('0x37')]:_0x43a695['model'];if(_0x4f307a['query'][_0xc46f('0x49')]){_0x284b02[_0xc46f('0x42')]=[{'all':!![]}];}_0x284b02=_[_0xc46f('0x3f')]({},_0x284b02,_0x4f307a['options']);return db[_0xc46f('0x2d')][_0xc46f('0x4a')](_0x284b02)['then'](handleEntityNotFound(_0x1cfa85,null))[_0xc46f('0x27')](respondWithResult(_0x1cfa85,null))[_0xc46f('0x45')](handleError(_0x1cfa85,null));};exports[_0xc46f('0x4b')]=function(_0x1262ad,_0x31a7ef){return db[_0xc46f('0x2d')][_0xc46f('0x4b')](_0x1262ad['body'],{})['then'](respondWithResult(_0x31a7ef,0xc9))['catch'](handleError(_0x31a7ef,null));};exports[_0xc46f('0x4c')]=function(_0x2ce979,_0x3b9db8){if(_0x2ce979[_0xc46f('0x4d')]['id']){delete _0x2ce979[_0xc46f('0x4d')]['id'];}return db[_0xc46f('0x2d')][_0xc46f('0x4a')]({'where':{'id':_0x2ce979[_0xc46f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b9db8,null))[_0xc46f('0x27')](saveUpdates(_0x2ce979[_0xc46f('0x4d')],null))['then'](respondWithResult(_0x3b9db8,null))[_0xc46f('0x45')](handleError(_0x3b9db8,null));};exports[_0xc46f('0x26')]=function(_0x534794,_0x7af268){return db['Automation'][_0xc46f('0x4a')]({'where':{'id':_0x534794[_0xc46f('0x47')]['id']}})[_0xc46f('0x27')](handleEntityNotFound(_0x7af268,null))[_0xc46f('0x27')](removeEntity(_0x7af268,null))['catch'](handleError(_0x7af268,null));};exports['addConditions']=function(_0x45aace,_0x21ca9b,_0x1708c8){return db[_0xc46f('0x4e')]['find']({'where':{'id':_0x45aace[_0xc46f('0x47')]['id']}})[_0xc46f('0x27')](handleEntityNotFound(_0x21ca9b,null))[_0xc46f('0x27')](function(_0xa50ac4){if(_0xa50ac4){return _0xa50ac4['addConditions'](_0x45aace['body'][_0xc46f('0x4f')],_[_0xc46f('0x50')](_0x45aace['body'],['ids','id'])||{});}})[_0xc46f('0x27')](respondWithResult(_0x21ca9b,null))['catch'](handleError(_0x21ca9b,null));};exports['getConditions']=function(_0x5b3c65,_0x2466d7,_0x2bc673){var _0x12b2fd={};var _0x973c={};var _0x36900b;var _0x199f66;return db['Automation'][_0xc46f('0x51')]({'where':{'id':_0x5b3c65[_0xc46f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2466d7,null))[_0xc46f('0x27')](function(_0x171566){if(_0x171566){_0x36900b=_0x171566;_0x973c[_0xc46f('0x36')]=_['keys'](db[_0xc46f('0x4e')][_0xc46f('0x2e')]);_0x973c[_0xc46f('0x33')]=_[_0xc46f('0x32')](_0x5b3c65['query']);_0x973c[_0xc46f('0x34')]=_[_0xc46f('0x35')](_0x973c[_0xc46f('0x36')],_0x973c['query']);_0x12b2fd[_0xc46f('0x37')]=_[_0xc46f('0x35')](_0x973c[_0xc46f('0x36')],qs['fields'](_0x5b3c65[_0xc46f('0x33')][_0xc46f('0x38')]));_0x12b2fd[_0xc46f('0x37')]=_0x12b2fd[_0xc46f('0x37')][_0xc46f('0x48')]?_0x12b2fd[_0xc46f('0x37')]:_0x973c[_0xc46f('0x36')];_0x12b2fd[_0xc46f('0x3a')]=qs[_0xc46f('0x3b')](_0x5b3c65[_0xc46f('0x33')][_0xc46f('0x3b')]);_0x12b2fd['where']=qs[_0xc46f('0x34')](_[_0xc46f('0x3d')](_0x5b3c65[_0xc46f('0x33')],_0x973c[_0xc46f('0x34')]));if(_0x5b3c65['query'][_0xc46f('0x3e')]){_0x12b2fd[_0xc46f('0x3c')]=_[_0xc46f('0x3f')](_0x12b2fd[_0xc46f('0x3c')],{'$or':_['map'](_0x12b2fd['attributes'],function(_0x3ae59c){var _0x6bd041={};_0x6bd041[_0x3ae59c]={'$like':'%'+_0x5b3c65[_0xc46f('0x33')][_0xc46f('0x3e')]+'%'};return _0x6bd041;})});}_0x12b2fd=_[_0xc46f('0x3f')]({},_0x12b2fd,_0x5b3c65[_0xc46f('0x41')]);return _0x36900b[_0xc46f('0x52')](_0x12b2fd);}})[_0xc46f('0x27')](function(_0x1b82a1){if(_0x1b82a1){_0x199f66=_0x1b82a1[_0xc46f('0x48')];if(!_0x5b3c65['query']['hasOwnProperty'](_0xc46f('0x53'))){_0x12b2fd[_0xc46f('0x22')]=qs['limit'](_0x5b3c65['query']['limit']);_0x12b2fd[_0xc46f('0x20')]=qs[_0xc46f('0x20')](_0x5b3c65[_0xc46f('0x33')][_0xc46f('0x20')]);}return _0x36900b[_0xc46f('0x52')](_0x12b2fd);}})[_0xc46f('0x27')](function(_0x3ba845){if(_0x3ba845){return _0x3ba845?{'count':_0x199f66,'rows':_0x3ba845}:null;}})['then'](respondWithResult(_0x2466d7,null))[_0xc46f('0x45')](handleError(_0x2466d7,null));};exports[_0xc46f('0x54')]=function(_0x417390,_0x39f181,_0x4d48e3){return db['Action'][_0xc46f('0x4a')]({'where':{'id':_0x417390['params']['id']}})[_0xc46f('0x27')](handleEntityNotFound(_0x39f181,null))[_0xc46f('0x27')](function(_0x25d194){if(_0x25d194){return _0x25d194[_0xc46f('0x54')](_0x417390[_0xc46f('0x4d')][_0xc46f('0x4f')],_[_0xc46f('0x50')](_0x417390[_0xc46f('0x4d')],[_0xc46f('0x4f'),'id'])||{});}})[_0xc46f('0x27')](respondWithResult(_0x39f181,null))['catch'](handleError(_0x39f181,null));};exports[_0xc46f('0x55')]=function(_0x2f9e56,_0x3f5103,_0x745069){var _0x3a642f={};var _0x1ce8de={};var _0x50d5b5;var _0x91d57;return db['Automation']['findOne']({'where':{'id':_0x2f9e56['params']['id']}})[_0xc46f('0x27')](handleEntityNotFound(_0x3f5103,null))['then'](function(_0x16e82b){if(_0x16e82b){_0x50d5b5=_0x16e82b;_0x1ce8de[_0xc46f('0x36')]=_[_0xc46f('0x32')](db[_0xc46f('0x56')][_0xc46f('0x2e')]);_0x1ce8de[_0xc46f('0x33')]=_[_0xc46f('0x32')](_0x2f9e56[_0xc46f('0x33')]);_0x1ce8de[_0xc46f('0x34')]=_[_0xc46f('0x35')](_0x1ce8de[_0xc46f('0x36')],_0x1ce8de[_0xc46f('0x33')]);_0x3a642f['attributes']=_[_0xc46f('0x35')](_0x1ce8de[_0xc46f('0x36')],qs[_0xc46f('0x38')](_0x2f9e56[_0xc46f('0x33')][_0xc46f('0x38')]));_0x3a642f[_0xc46f('0x37')]=_0x3a642f[_0xc46f('0x37')][_0xc46f('0x48')]?_0x3a642f[_0xc46f('0x37')]:_0x1ce8de[_0xc46f('0x36')];_0x3a642f['order']=qs['sort'](_0x2f9e56[_0xc46f('0x33')][_0xc46f('0x3b')]);_0x3a642f['where']=qs[_0xc46f('0x34')](_[_0xc46f('0x3d')](_0x2f9e56[_0xc46f('0x33')],_0x1ce8de[_0xc46f('0x34')]));if(_0x2f9e56[_0xc46f('0x33')]['filter']){_0x3a642f[_0xc46f('0x3c')]=_[_0xc46f('0x3f')](_0x3a642f[_0xc46f('0x3c')],{'$or':_[_0xc46f('0x2c')](_0x3a642f[_0xc46f('0x37')],function(_0x4189b4){var _0x3e9ea7={};_0x3e9ea7[_0x4189b4]={'$like':'%'+_0x2f9e56[_0xc46f('0x33')]['filter']+'%'};return _0x3e9ea7;})});}_0x3a642f=_[_0xc46f('0x3f')]({},_0x3a642f,_0x2f9e56[_0xc46f('0x41')]);return _0x50d5b5[_0xc46f('0x55')](_0x3a642f);}})[_0xc46f('0x27')](function(_0x657702){if(_0x657702){_0x91d57=_0x657702['length'];if(!_0x2f9e56[_0xc46f('0x33')][_0xc46f('0x39')](_0xc46f('0x53'))){_0x3a642f[_0xc46f('0x22')]=qs[_0xc46f('0x22')](_0x2f9e56['query'][_0xc46f('0x22')]);_0x3a642f['offset']=qs[_0xc46f('0x20')](_0x2f9e56['query'][_0xc46f('0x20')]);}return _0x50d5b5['getActions'](_0x3a642f);}})[_0xc46f('0x27')](function(_0x37967b){if(_0x37967b){return _0x37967b?{'count':_0x91d57,'rows':_0x37967b}:null;}})[_0xc46f('0x27')](respondWithResult(_0x3f5103,null))[_0xc46f('0x45')](handleError(_0x3f5103,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e430018..2e0a4b2 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 _0xa286=['tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','Automation'];(function(_0x5ba6f1,_0x3bcad1){var _0x2d5be8=function(_0x1fef87){while(--_0x1fef87){_0x5ba6f1['push'](_0x5ba6f1['shift']());}};_0x2d5be8(++_0x3bcad1);}(_0xa286,0x139));var _0x6a28=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xa286[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x6a28('0x0'));var util=require(_0x6a28('0x1'));var logger=require(_0x6a28('0x2'))('api');var moment=require(_0x6a28('0x3'));var BPromise=require(_0x6a28('0x4'));var rp=require(_0x6a28('0x5'));var fs=require('fs');var path=require(_0x6a28('0x6'));var rimraf=require('rimraf');var config=require(_0x6a28('0x7'));var attributes=require('./automation.attributes');module[_0x6a28('0x8')]=function(_0x3400d4,_0x25a07a){return _0x3400d4[_0x6a28('0x9')](_0x6a28('0xa'),attributes,{'tableName':_0x6a28('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48c3=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x433ef6,_0xfb9389){var _0x568cfd=function(_0x2384e5){while(--_0x2384e5){_0x433ef6['push'](_0x433ef6['shift']());}};_0x568cfd(++_0xfb9389);}(_0x48c3,0x16c));var _0x348c=function(_0x68c0da,_0x6b33c2){_0x68c0da=_0x68c0da-0x0;var _0x439da2=_0x48c3[_0x68c0da];return _0x439da2;};'use strict';var _=require(_0x348c('0x0'));var util=require('util');var logger=require(_0x348c('0x1'))(_0x348c('0x2'));var moment=require(_0x348c('0x3'));var BPromise=require(_0x348c('0x4'));var rp=require(_0x348c('0x5'));var fs=require('fs');var path=require(_0x348c('0x6'));var rimraf=require(_0x348c('0x7'));var config=require('../../config/environment');var attributes=require(_0x348c('0x8'));module[_0x348c('0x9')]=function(_0x335f35,_0x54a3d5){return _0x335f35[_0x348c('0xa')](_0x348c('0xb'),attributes,{'tableName':_0x348c('0xc'),'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 d9c8e44..0cbe1a5 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 _0x77e6=['client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3b0609,_0x3515d0){var _0x3326c1=function(_0x216cbb){while(--_0x216cbb){_0x3b0609['push'](_0x3b0609['shift']());}};_0x3326c1(++_0x3515d0);}(_0x77e6,0x1a6));var _0x677e=function(_0x2a7f61,_0x4bf309){_0x2a7f61=_0x2a7f61-0x0;var _0x10387c=_0x77e6[_0x2a7f61];return _0x10387c;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('Automation,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('Automation,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});}
\ No newline at end of file
+var _0xd142=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x492d93,_0x4a6106){var _0x2e46a3=function(_0x2d91ca){while(--_0x2d91ca){_0x492d93['push'](_0x492d93['shift']());}};_0x2e46a3(++_0x4a6106);}(_0xd142,0x11a));var _0x2d14=function(_0x214890,_0x2562c0){_0x214890=_0x214890-0x0;var _0x760050=_0xd142[_0x214890];return _0x760050;};'use strict';var _=require(_0x2d14('0x0'));var util=require(_0x2d14('0x1'));var moment=require(_0x2d14('0x2'));var BPromise=require(_0x2d14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d14('0x4'))['db'];var utils=require(_0x2d14('0x5'));var logger=require(_0x2d14('0x6'))(_0x2d14('0x7'));var config=require(_0x2d14('0x8'));var jayson=require(_0x2d14('0x9'));var client=jayson[_0x2d14('0xa')][_0x2d14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eb081,_0x2104d6,_0xba6306){return new BPromise(function(_0x1b2d92,_0x4e5f73){return client[_0x2d14('0xc')](_0x5eb081,_0xba6306)[_0x2d14('0xd')](function(_0x581f76){logger[_0x2d14('0xe')](_0x2d14('0xf'),_0x2104d6,_0x2d14('0x10'));logger['debug'](_0x2d14('0x11'),_0x2104d6,_0x2d14('0x10'),JSON['stringify'](_0x581f76));if(_0x581f76['error']){if(_0x581f76[_0x2d14('0x12')][_0x2d14('0x13')]===0x1f4){logger[_0x2d14('0x12')]('Automation,\x20%s,\x20%s',_0x2104d6,_0x581f76[_0x2d14('0x12')][_0x2d14('0x14')]);return _0x4e5f73(_0x581f76[_0x2d14('0x12')][_0x2d14('0x14')]);}logger['error'](_0x2d14('0xf'),_0x2104d6,_0x581f76[_0x2d14('0x12')]['message']);return _0x1b2d92(_0x581f76[_0x2d14('0x12')][_0x2d14('0x14')]);}else{logger[_0x2d14('0xe')](_0x2d14('0xf'),_0x2104d6,_0x2d14('0x10'));_0x1b2d92(_0x581f76['result'][_0x2d14('0x14')]);}})[_0x2d14('0x15')](function(_0x3e12d3){logger[_0x2d14('0x12')](_0x2d14('0xf'),_0x2104d6,_0x3e12d3);_0x4e5f73(_0x3e12d3);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 2305c21..daf4b44 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 _0xd89f=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions','post','addActions','update','destroy'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xd89f,0x191));var _0xfd89=function(_0x135363,_0x520e22){_0x135363=_0x135363-0x0;var _0x59c7a0=_0xd89f[_0x135363];return _0x59c7a0;};'use strict';var multer=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var path=require(_0xfd89('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd89('0x3'));var router=express[_0xfd89('0x4')]();var fs_extra=require(_0xfd89('0x5'));var auth=require(_0xfd89('0x6'));var interaction=require(_0xfd89('0x7'));var config=require(_0xfd89('0x8'));var controller=require('./automation.controller');router[_0xfd89('0x9')]('/',auth[_0xfd89('0xa')](),controller[_0xfd89('0xb')]);router[_0xfd89('0x9')](_0xfd89('0xc'),auth[_0xfd89('0xa')](),controller[_0xfd89('0xd')]);router[_0xfd89('0x9')](_0xfd89('0xe'),auth[_0xfd89('0xa')](),controller[_0xfd89('0xf')]);router[_0xfd89('0x9')](_0xfd89('0x10'),auth[_0xfd89('0xa')](),controller[_0xfd89('0x11')]);router['post']('/',auth[_0xfd89('0xa')](),controller[_0xfd89('0x12')]);router['post']('/:id/conditions',auth[_0xfd89('0xa')](),controller[_0xfd89('0x13')]);router[_0xfd89('0x14')](_0xfd89('0x10'),auth['isAuthenticated'](),controller[_0xfd89('0x15')]);router['put'](_0xfd89('0xc'),auth[_0xfd89('0xa')](),controller[_0xfd89('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfd89('0x17')]);module[_0xfd89('0x18')]=router;
\ No newline at end of file
+var _0xbd3b=['fs-extra','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','get','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x28ee74,_0x289441){_0x28ee74=_0x28ee74-0x0;var _0x6cc80c=_0xbd3b[_0x28ee74];return _0x6cc80c;};'use strict';var multer=require(_0xbbd3('0x0'));var util=require(_0xbbd3('0x1'));var path=require(_0xbbd3('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbd3('0x3'));var router=express[_0xbbd3('0x4')]();var fs_extra=require(_0xbbd3('0x5'));var auth=require(_0xbbd3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbd3('0x7'));var controller=require(_0xbbd3('0x8'));router['get']('/',auth[_0xbbd3('0x9')](),controller['index']);router[_0xbbd3('0xa')](_0xbbd3('0xb'),auth[_0xbbd3('0x9')](),controller['show']);router[_0xbbd3('0xa')](_0xbbd3('0xc'),auth[_0xbbd3('0x9')](),controller[_0xbbd3('0xd')]);router['get'](_0xbbd3('0xe'),auth[_0xbbd3('0x9')](),controller[_0xbbd3('0xf')]);router[_0xbbd3('0x10')]('/',auth['isAuthenticated'](),controller[_0xbbd3('0x11')]);router['post']('/:id/conditions',auth[_0xbbd3('0x9')](),controller[_0xbbd3('0x12')]);router[_0xbbd3('0x10')](_0xbbd3('0xe'),auth[_0xbbd3('0x9')](),controller[_0xbbd3('0x13')]);router[_0xbbd3('0x14')](_0xbbd3('0xb'),auth[_0xbbd3('0x9')](),controller[_0xbbd3('0x15')]);router['delete']('/:id',auth[_0xbbd3('0x9')](),controller[_0xbbd3('0x16')]);module[_0xbbd3('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e97b422..36e92a7 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 _0x6514=['always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ENUM','ivr','STRING','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x2af157,_0x374798){var _0x3b4d49=function(_0x51faac){while(--_0x51faac){_0x2af157['push'](_0x2af157['shift']());}};_0x3b4d49(++_0x374798);}(_0x6514,0x1ab));var _0x4651=function(_0x6ceb8,_0x4f1030){_0x6ceb8=_0x6ceb8-0x0;var _0x44b460=_0x6514[_0x6ceb8];return _0x44b460;};'use strict';var Sequelize=require('sequelize');module[_0x4651('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4651('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x4651('0x2')](_0x4651('0x3')),'allowNull':![],'defaultValue':_0x4651('0x3')},'description':{'type':Sequelize[_0x4651('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x4651('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4651('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4651('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4651('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4651('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4651('0x8')](0x3)[_0x4651('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4651('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4651('0x8')](0x5)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4651('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x4651('0x8')](0x3)[_0x4651('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4651('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4651('0x8')](0x5)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4651('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4651('0x5')],'defaultValue':0x3,'comment':_0x4651('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4651('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4651('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4651('0xf')},'dialTimezone':{'type':Sequelize[_0x4651('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4651('0x4')],'defaultValue':_0x4651('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x4651('0x11'),_0x4651('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4651('0x13')],'defaultValue':0x0,'comment':_0x4651('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x4651('0x8')](0x9)[_0x4651('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4651('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x4651('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4651('0x8')](0x9)[_0x4651('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4651('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4651('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x4651('0x8')](0x9)[_0x4651('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4651('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4651('0x8')](0x9)[_0x4651('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4651('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4651('0x8')](0x9)[_0x4651('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4651('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4651('0x8')](0x5)[_0x4651('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4651('0x8')](0x9)[_0x4651('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x4651('0x2')](_0x4651('0x1b'),'ASC'),'defaultValue':_0x4651('0x1b')},'dialPrefix':{'type':Sequelize[_0x4651('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4651('0x8')](0x3)[_0x4651('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4651('0x1c')},'dialCutDigit':{'type':Sequelize[_0x4651('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4651('0x8')](0x3)[_0x4651('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4651('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4651('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4651('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4651('0x8')](0x3)[_0x4651('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4651('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4651('0x8')](0x5)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x4651('0x8')](0x3)[_0x4651('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4651('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4651('0x8')](0x5)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4651('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4651('0x8')](0x3)[_0x4651('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4651('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4651('0x8')](0x5)[_0x4651('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4651('0x24')}};
\ No newline at end of file
+var _0xdb2d=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr'];(function(_0x4686cf,_0x103d2d){var _0x400108=function(_0x16e725){while(--_0x16e725){_0x4686cf['push'](_0x4686cf['shift']());}};_0x400108(++_0x103d2d);}(_0xdb2d,0x19c));var _0xddb2=function(_0xf8b370,_0x3fd468){_0xf8b370=_0xf8b370-0x0;var _0x2208be=_0xdb2d[_0xf8b370];return _0x2208be;};'use strict';var Sequelize=require(_0xddb2('0x0'));module[_0xddb2('0x1')]={'name':{'type':Sequelize[_0xddb2('0x2')],'unique':_0xddb2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xddb2('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xddb2('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xddb2('0x6')],'defaultValue':0x0,'comment':_0xddb2('0x7')},'limitCalls':{'type':Sequelize[_0xddb2('0x8')](0x4)[_0xddb2('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xddb2('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xddb2('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xddb2('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xddb2('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xddb2('0x8')](0x5)[_0xddb2('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xddb2('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xddb2('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'defaultValue':0x3,'comment':_0xddb2('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xddb2('0x8')](0x5)[_0xddb2('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0x10')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xddb2('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xddb2('0x11')},'dialTimezone':{'type':Sequelize[_0xddb2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xddb2('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xddb2('0x13'),_0xddb2('0x14'),_0xddb2('0x15')),'defaultValue':_0xddb2('0x13')},'dialAMDActive':{'type':Sequelize[_0xddb2('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xddb2('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xddb2('0x8')](0x9)[_0xddb2('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xddb2('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xddb2('0x8')](0x9)[_0xddb2('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xddb2('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xddb2('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xddb2('0x8')](0x9)[_0xddb2('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xddb2('0x8')](0x9)[_0xddb2('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xddb2('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xddb2('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xddb2('0x8')](0x5)[_0xddb2('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xddb2('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xddb2('0x1a'),_0xddb2('0x1b')),'defaultValue':_0xddb2('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xddb2('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xddb2('0x1c')},'dialCutDigit':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xddb2('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xddb2('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xddb2('0x8')](0x5)[_0xddb2('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xddb2('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xddb2('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xddb2('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xddb2('0x8')](0x3)[_0xddb2('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xddb2('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xddb2('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xddb2('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 142837e..7b0d0c5 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 _0x5ba3=['cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','into','select','scheduledAt','cm_contacts','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','Campaign','rawAttributes','fieldName','model','map','keys','filters','intersection','attributes','fields','nolimit','offset','order','sort','query','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','length','createdAt','omit','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','hasOwnProperty','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','ListId','updatedAt','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)'];(function(_0x203c16,_0x2103c3){var _0x166c59=function(_0x2a0113){while(--_0x2a0113){_0x203c16['push'](_0x203c16['shift']());}};_0x166c59(++_0x2103c3);}(_0x5ba3,0x140));var _0x35ba=function(_0x48e4df,_0x349364){_0x48e4df=_0x48e4df-0x0;var _0x751b1=_0x5ba3[_0x48e4df];return _0x751b1;};'use strict';var emlformat=require(_0x35ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35ba('0x1'));var jsonpatch=require(_0x35ba('0x2'));var rp=require('request-promise');var moment=require(_0x35ba('0x3'));var BPromise=require(_0x35ba('0x4'));var Mustache=require(_0x35ba('0x5'));var util=require('util');var path=require(_0x35ba('0x6'));var sox=require(_0x35ba('0x7'));var csv=require(_0x35ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35ba('0x9'));var squel=require(_0x35ba('0xa'));var crypto=require(_0x35ba('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35ba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x35ba('0xd'));var Papa=require(_0x35ba('0xe'));var Redis=require(_0x35ba('0xf'));var authService=require(_0x35ba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x35ba('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x35ba('0x12'));var config=require(_0x35ba('0x13'));var licenseUtil=require(_0x35ba('0x14'));var db=require(_0x35ba('0x15'))['db'];function respondWithStatusCode(_0x3755c0,_0x203e6e){_0x203e6e=_0x203e6e||0xcc;return function(_0x23c253){if(_0x23c253){return _0x3755c0[_0x35ba('0x16')](_0x203e6e);}return _0x3755c0['status'](_0x203e6e)[_0x35ba('0x17')]();};}function respondWithResult(_0x169a24,_0x3ad4cc){_0x3ad4cc=_0x3ad4cc||0xc8;return function(_0x249caf){if(_0x249caf){return _0x169a24['status'](_0x3ad4cc)[_0x35ba('0x18')](_0x249caf);}};}function respondWithFilteredResult(_0x58b608,_0x50bf46){return function(_0x2372f7){if(_0x2372f7){var _0x71a8b=typeof _0x50bf46['offset']===_0x35ba('0x19')&&typeof _0x50bf46[_0x35ba('0x1a')]===_0x35ba('0x19');var _0x32b9e4=_0x2372f7[_0x35ba('0x1b')];var _0x374f91=_0x71a8b?0x0:_0x50bf46['offset'];var _0x423666=_0x71a8b?_0x2372f7[_0x35ba('0x1b')]:_0x50bf46['offset']+_0x50bf46[_0x35ba('0x1a')];var _0x1d73a2;if(_0x423666>=_0x32b9e4){_0x423666=_0x32b9e4;_0x1d73a2=0xc8;}else{_0x1d73a2=0xce;}_0x58b608[_0x35ba('0x1c')](_0x1d73a2);return _0x58b608[_0x35ba('0x1d')](_0x35ba('0x1e'),_0x374f91+'-'+_0x423666+'/'+_0x32b9e4)[_0x35ba('0x18')](_0x2372f7);}return null;};}function patchUpdates(_0x3f5e92){return function(_0x430522){try{jsonpatch[_0x35ba('0x1f')](_0x430522,_0x3f5e92,!![]);}catch(_0x205889){return BPromise[_0x35ba('0x20')](_0x205889);}return _0x430522[_0x35ba('0x21')]();};}function saveUpdates(_0x4e4c09,_0x2d3b2b){return function(_0xba9dbc){if(_0xba9dbc){return _0xba9dbc[_0x35ba('0x22')](_0x4e4c09)[_0x35ba('0x23')](function(_0x29a25f){return _0x29a25f;});}return null;};}function removeEntity(_0x1a638a,_0xa9080b){return function(_0x439f43){if(_0x439f43){return _0x439f43['destroy']()[_0x35ba('0x23')](function(){var _0x53fd3d=_0x439f43['get']({'plain':!![]});var _0x1cffd9='IvrCampaigns';return db[_0x35ba('0x24')][_0x35ba('0x25')]({'where':{'type':_0x1cffd9,'resourceId':_0x53fd3d['id']}})[_0x35ba('0x23')](function(){return _0x439f43;});})[_0x35ba('0x23')](function(){_0x1a638a[_0x35ba('0x1c')](0xcc)[_0x35ba('0x17')]();});}};}function handleEntityNotFound(_0x246198,_0x25fc3b){return function(_0x13b8fb){if(!_0x13b8fb){_0x246198[_0x35ba('0x16')](0x194);}return _0x13b8fb;};}function handleError(_0x40f2fc,_0x1d3d7f){_0x1d3d7f=_0x1d3d7f||0x1f4;return function(_0x38112f){logger[_0x35ba('0x26')](_0x38112f[_0x35ba('0x27')]);if(_0x38112f[_0x35ba('0x28')]){delete _0x38112f['name'];}_0x40f2fc[_0x35ba('0x1c')](_0x1d3d7f)[_0x35ba('0x29')](_0x38112f);};}exports[_0x35ba('0x2a')]=function(_0x2185dd,_0xe022f2){var _0x1eceef={},_0xe130c5={},_0x246981={'count':0x0,'rows':[]};var _0x1cb674=_['map'](db[_0x35ba('0x2b')][_0x35ba('0x2c')],function(_0x1c2b6e){return{'name':_0x1c2b6e[_0x35ba('0x2d')],'type':_0x1c2b6e['type']['key']};});_0xe130c5[_0x35ba('0x2e')]=_[_0x35ba('0x2f')](_0x1cb674,_0x35ba('0x28'));_0xe130c5['query']=_[_0x35ba('0x30')](_0x2185dd['query']);_0xe130c5[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0xe130c5['model'],_0xe130c5['query']);_0x1eceef[_0x35ba('0x33')]=_[_0x35ba('0x32')](_0xe130c5[_0x35ba('0x2e')],qs[_0x35ba('0x34')](_0x2185dd['query'][_0x35ba('0x34')]));_0x1eceef[_0x35ba('0x33')]=_0x1eceef[_0x35ba('0x33')]['length']?_0x1eceef[_0x35ba('0x33')]:_0xe130c5[_0x35ba('0x2e')];if(!_0x2185dd['query']['hasOwnProperty'](_0x35ba('0x35'))){_0x1eceef[_0x35ba('0x1a')]=qs['limit'](_0x2185dd['query']['limit']);_0x1eceef[_0x35ba('0x36')]=qs['offset'](_0x2185dd['query'][_0x35ba('0x36')]);}_0x1eceef[_0x35ba('0x37')]=qs[_0x35ba('0x38')](_0x2185dd[_0x35ba('0x39')][_0x35ba('0x38')]);_0x1eceef[_0x35ba('0x3a')]=qs[_0x35ba('0x31')](_[_0x35ba('0x3b')](_0x2185dd[_0x35ba('0x39')],_0xe130c5[_0x35ba('0x31')]),_0x1cb674);if(_0x2185dd[_0x35ba('0x39')][_0x35ba('0x3c')]){_0x1eceef['where']=_[_0x35ba('0x3d')](_0x1eceef['where'],{'$or':_[_0x35ba('0x2f')](_0x1cb674,function(_0x3267a1){if(_0x3267a1['type']!=='VIRTUAL'){var _0x172e0a={};_0x172e0a[_0x3267a1['name']]={'$like':'%'+_0x2185dd['query']['filter']+'%'};return _0x172e0a;}})});}_0x1eceef=_[_0x35ba('0x3d')]({},_0x1eceef,_0x2185dd[_0x35ba('0x3e')]);var _0x1019c7={'where':_0x1eceef['where']};return db[_0x35ba('0x2b')]['count'](_0x1019c7)[_0x35ba('0x23')](function(_0x58481a){_0x246981[_0x35ba('0x1b')]=_0x58481a;if(_0x2185dd[_0x35ba('0x39')][_0x35ba('0x3f')]){_0x1eceef[_0x35ba('0x40')]=[{'all':!![]}];}return db['Campaign'][_0x35ba('0x41')](_0x1eceef);})[_0x35ba('0x23')](function(_0x51c9e1){_0x246981[_0x35ba('0x42')]=_0x51c9e1;return _0x246981;})[_0x35ba('0x23')](respondWithFilteredResult(_0xe022f2,_0x1eceef))[_0x35ba('0x43')](handleError(_0xe022f2,null));};exports[_0x35ba('0x44')]=function(_0x170e5c,_0x16f559){var _0x433077={'raw':![],'where':{'id':_0x170e5c[_0x35ba('0x45')]['id']}},_0xe86741={};_0xe86741[_0x35ba('0x2e')]=_['keys'](db[_0x35ba('0x2b')][_0x35ba('0x2c')]);_0xe86741[_0x35ba('0x39')]=_[_0x35ba('0x30')](_0x170e5c[_0x35ba('0x39')]);_0xe86741[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0xe86741[_0x35ba('0x2e')],_0xe86741[_0x35ba('0x39')]);_0x433077[_0x35ba('0x33')]=_[_0x35ba('0x32')](_0xe86741['model'],qs[_0x35ba('0x34')](_0x170e5c[_0x35ba('0x39')]['fields']));_0x433077[_0x35ba('0x33')]=_0x433077[_0x35ba('0x33')]['length']?_0x433077[_0x35ba('0x33')]:_0xe86741[_0x35ba('0x2e')];if(_0x170e5c[_0x35ba('0x39')][_0x35ba('0x3f')]){_0x433077[_0x35ba('0x40')]=[{'all':!![]}];}_0x433077=_[_0x35ba('0x3d')]({},_0x433077,_0x170e5c[_0x35ba('0x3e')]);return db[_0x35ba('0x2b')][_0x35ba('0x46')](_0x433077)['then'](handleEntityNotFound(_0x16f559,null))['then'](respondWithResult(_0x16f559,null))[_0x35ba('0x43')](handleError(_0x16f559,null));};exports[_0x35ba('0x47')]=function(_0xe2dd75,_0x55bc33){return db[_0x35ba('0x2b')]['create'](_0xe2dd75[_0x35ba('0x48')],{})[_0x35ba('0x23')](function(_0x4791b0){var _0x4075ac=_0xe2dd75['user'][_0x35ba('0x49')]({'plain':!![]});if(!_0x4075ac)throw new Error(_0x35ba('0x4a'));if(_0x4075ac[_0x35ba('0x4b')]==='user'){var _0x760f60=_0x4791b0[_0x35ba('0x49')]({'plain':!![]});var _0x2f7877='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x2f7877,'userProfileId':_0x4075ac['userProfileId']},'raw':!![]})[_0x35ba('0x23')](function(_0x12f0c5){if(_0x12f0c5&&_0x12f0c5[_0x35ba('0x4c')]===0x0){return db[_0x35ba('0x24')][_0x35ba('0x47')]({'name':_0x760f60[_0x35ba('0x28')],'resourceId':_0x760f60['id'],'type':_0x12f0c5[_0x35ba('0x28')],'sectionId':_0x12f0c5['id']},{})[_0x35ba('0x23')](function(){return _0x4791b0;});}else{return _0x4791b0;}})[_0x35ba('0x43')](function(_0x18bb1f){logger[_0x35ba('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18bb1f);throw _0x18bb1f;});}return _0x4791b0;})['then'](respondWithResult(_0x55bc33,0xc9))[_0x35ba('0x43')](handleError(_0x55bc33,null));};exports['clone']=function(_0xdb9d74,_0x4b8bf7){var _0x55f904={'where':{'id':_0xdb9d74['params']['id']}},_0x15744c={};_0x15744c[_0x35ba('0x2e')]=_[_0x35ba('0x30')](db['Campaign'][_0x35ba('0x2c')]);_0x55f904[_0x35ba('0x33')]=_[_0x35ba('0x32')](_0x15744c[_0x35ba('0x2e')],qs['fields'](_0xdb9d74[_0x35ba('0x39')]['fields']));_0x55f904[_0x35ba('0x33')]=_0x55f904[_0x35ba('0x33')][_0x35ba('0x4d')]?_0x55f904[_0x35ba('0x33')]:_0x15744c[_0x35ba('0x2e')];if(_0xdb9d74['query'][_0x35ba('0x3f')]){_0x55f904[_0x35ba('0x40')]=[{'all':!![]}];}_0x55f904=_['merge']({},_0x55f904,_0xdb9d74[_0x35ba('0x3e')]);return db['Campaign']['find'](_0x55f904)[_0x35ba('0x23')](handleEntityNotFound(_0x4b8bf7,null))['then'](function(_0x2766a9){if(_0x2766a9){var _0x441324=_0x2766a9[_0x35ba('0x49')]({'plain':!![]});_0x441324=qs['omit'](_0x441324,['id',_0x35ba('0x4e'),'updatedAt']);_0xdb9d74[_0x35ba('0x48')]=_[_0x35ba('0x4f')](_0xdb9d74[_0x35ba('0x48')],['id',_0x35ba('0x4e'),'updatedAt']);return db['Campaign']['create'](_['merge'](_0x441324,_0xdb9d74[_0x35ba('0x48')]),{'include':_0xdb9d74['query'][_0x35ba('0x3f')]?[{'all':!![]}]:undefined})[_0x35ba('0x23')](function(_0x2979a8){var _0x16ee0f=_0xdb9d74[_0x35ba('0x50')][_0x35ba('0x49')]({'plain':!![]});if(!_0x16ee0f)throw new Error(_0x35ba('0x4a'));if(_0x16ee0f['role']===_0x35ba('0x50')){var _0x20d08c=_0x2979a8[_0x35ba('0x49')]({'plain':!![]});var _0x234f78='IvrCampaigns';return db['UserProfileSection'][_0x35ba('0x46')]({'where':{'name':_0x234f78,'userProfileId':_0x16ee0f['userProfileId']},'raw':!![]})[_0x35ba('0x23')](function(_0x106510){if(_0x106510&&_0x106510['autoAssociation']===0x0){return db[_0x35ba('0x24')][_0x35ba('0x47')]({'name':_0x20d08c[_0x35ba('0x28')],'resourceId':_0x20d08c['id'],'type':_0x106510[_0x35ba('0x28')],'sectionId':_0x106510['id']},{})[_0x35ba('0x23')](function(){return _0x2979a8;});}else{return _0x2979a8;}})['catch'](function(_0x184b72){logger['error'](_0x35ba('0x51'),_0x184b72);throw _0x184b72;});}return _0x2979a8;});}})[_0x35ba('0x23')](respondWithResult(_0x4b8bf7,0xc9))['catch'](handleError(_0x4b8bf7,null));};exports['update']=function(_0x1a856a,_0x53d9c7){if(_0x1a856a[_0x35ba('0x48')]['id']){delete _0x1a856a[_0x35ba('0x48')]['id'];}return db[_0x35ba('0x2b')]['find']({'where':{'id':_0x1a856a['params']['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x53d9c7,null))[_0x35ba('0x23')](saveUpdates(_0x1a856a['body'],null))[_0x35ba('0x23')](respondWithResult(_0x53d9c7,null))[_0x35ba('0x43')](handleError(_0x53d9c7,null));};exports[_0x35ba('0x25')]=function(_0x2b001b,_0x1ad5e6){return db[_0x35ba('0x2b')][_0x35ba('0x46')]({'where':{'id':_0x2b001b[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x1ad5e6,null))['then'](removeEntity(_0x1ad5e6,null))[_0x35ba('0x43')](handleError(_0x1ad5e6,null));};exports[_0x35ba('0x52')]=function(_0x62ac22,_0x5eb454,_0x4b8994){var _0x17e870={'raw':!![],'where':{}};var _0x327918={};var _0x4de3d6={'count':0x0,'rows':[]};return db[_0x35ba('0x2b')]['findOne']({'where':{'id':_0x62ac22[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x5eb454,null))[_0x35ba('0x23')](function(_0x5d3b60){if(_0x5d3b60){_0x327918[_0x35ba('0x2e')]=_[_0x35ba('0x30')](db[_0x35ba('0x53')][_0x35ba('0x2c')]);_0x327918['query']=_[_0x35ba('0x30')](_0x62ac22['query']);_0x327918[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0x327918['model'],_0x327918['query']);_0x17e870[_0x35ba('0x33')]=_['intersection'](_0x327918[_0x35ba('0x2e')],qs[_0x35ba('0x34')](_0x62ac22['query'][_0x35ba('0x34')]));_0x17e870['attributes']=_0x17e870[_0x35ba('0x33')][_0x35ba('0x4d')]?_0x17e870[_0x35ba('0x33')]:_0x327918[_0x35ba('0x2e')];if(!_0x62ac22[_0x35ba('0x39')][_0x35ba('0x54')](_0x35ba('0x35'))){_0x17e870[_0x35ba('0x1a')]=qs['limit'](_0x62ac22[_0x35ba('0x39')][_0x35ba('0x1a')]);_0x17e870[_0x35ba('0x36')]=qs[_0x35ba('0x36')](_0x62ac22[_0x35ba('0x39')]['offset']);}_0x17e870['order']=qs[_0x35ba('0x38')](_0x62ac22[_0x35ba('0x39')][_0x35ba('0x38')]);_0x17e870[_0x35ba('0x3a')]=qs[_0x35ba('0x31')](_['pick'](_0x62ac22['query'],_0x327918[_0x35ba('0x31')]));_0x17e870[_0x35ba('0x3a')]['CampaignId']=_0x5d3b60['id'];if(_0x62ac22['query'][_0x35ba('0x3c')]){_0x17e870[_0x35ba('0x3a')]=_[_0x35ba('0x3d')](_0x17e870[_0x35ba('0x3a')],{'$or':_[_0x35ba('0x2f')](_0x17e870[_0x35ba('0x33')],function(_0x4c28b1){var _0x3b66f1={};_0x3b66f1[_0x4c28b1]={'$like':'%'+_0x62ac22['query'][_0x35ba('0x3c')]+'%'};return _0x3b66f1;})});}_0x17e870=_[_0x35ba('0x3d')]({},_0x17e870,_0x62ac22[_0x35ba('0x3e')]);return db[_0x35ba('0x53')][_0x35ba('0x1b')]({'where':_0x17e870[_0x35ba('0x3a')]})[_0x35ba('0x23')](function(_0x590ea5){_0x4de3d6[_0x35ba('0x1b')]=_0x590ea5;if(_0x62ac22[_0x35ba('0x39')][_0x35ba('0x3f')]){_0x17e870[_0x35ba('0x40')]=[{'all':!![]}];}return db[_0x35ba('0x53')][_0x35ba('0x41')](_0x17e870);})[_0x35ba('0x23')](function(_0x14a26d){_0x4de3d6['rows']=_0x14a26d;return _0x4de3d6;});}})[_0x35ba('0x23')](respondWithFilteredResult(_0x5eb454,_0x17e870))[_0x35ba('0x43')](handleError(_0x5eb454,null));};exports[_0x35ba('0x55')]=function(_0x4aeded,_0x28a39c,_0x2fc472){var _0x2cb290={'raw':!![],'where':{}};var _0x4384d4={};var _0xe7ab={'count':0x0,'rows':[]};return db[_0x35ba('0x2b')][_0x35ba('0x56')]({'where':{'id':_0x4aeded[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x28a39c,null))[_0x35ba('0x23')](function(_0x3f1347){if(_0x3f1347){_0x4384d4['model']=_[_0x35ba('0x30')](db['CmHopperHistory'][_0x35ba('0x2c')]);_0x4384d4['query']=_[_0x35ba('0x30')](_0x4aeded['query']);_0x4384d4[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0x4384d4['model'],_0x4384d4['query']);_0x2cb290[_0x35ba('0x33')]=_[_0x35ba('0x32')](_0x4384d4[_0x35ba('0x2e')],qs[_0x35ba('0x34')](_0x4aeded[_0x35ba('0x39')][_0x35ba('0x34')]));_0x2cb290[_0x35ba('0x33')]=_0x2cb290[_0x35ba('0x33')][_0x35ba('0x4d')]?_0x2cb290[_0x35ba('0x33')]:_0x4384d4['model'];if(!_0x4aeded['query'][_0x35ba('0x54')]('nolimit')){_0x2cb290['limit']=qs[_0x35ba('0x1a')](_0x4aeded['query'][_0x35ba('0x1a')]);_0x2cb290[_0x35ba('0x36')]=qs[_0x35ba('0x36')](_0x4aeded['query'][_0x35ba('0x36')]);}_0x2cb290['order']=qs[_0x35ba('0x38')](_0x4aeded[_0x35ba('0x39')][_0x35ba('0x38')]);_0x2cb290[_0x35ba('0x3a')]=qs['filters'](_[_0x35ba('0x3b')](_0x4aeded[_0x35ba('0x39')],_0x4384d4[_0x35ba('0x31')]));_0x2cb290[_0x35ba('0x3a')]['CampaignId']=_0x3f1347['id'];if(_0x4aeded[_0x35ba('0x39')][_0x35ba('0x3c')]){_0x2cb290['where']=_['merge'](_0x2cb290['where'],{'$or':_[_0x35ba('0x2f')](_0x2cb290['attributes'],function(_0x48cd25){var _0x59d990={};_0x59d990[_0x48cd25]={'$like':'%'+_0x4aeded[_0x35ba('0x39')][_0x35ba('0x3c')]+'%'};return _0x59d990;})});}_0x2cb290=_[_0x35ba('0x3d')]({},_0x2cb290,_0x4aeded[_0x35ba('0x3e')]);return db[_0x35ba('0x57')][_0x35ba('0x1b')]({'where':_0x2cb290[_0x35ba('0x3a')]})[_0x35ba('0x23')](function(_0x5a31f1){_0xe7ab[_0x35ba('0x1b')]=_0x5a31f1;if(_0x4aeded[_0x35ba('0x39')]['includeAll']){_0x2cb290[_0x35ba('0x40')]=[{'all':!![]}];}return db[_0x35ba('0x57')][_0x35ba('0x41')](_0x2cb290);})[_0x35ba('0x23')](function(_0x2697ee){_0xe7ab['rows']=_0x2697ee;return _0xe7ab;});}})[_0x35ba('0x23')](respondWithFilteredResult(_0x28a39c,_0x2cb290))['catch'](handleError(_0x28a39c,null));};exports[_0x35ba('0x58')]=function(_0x4ee40,_0x5180cc,_0x3ace0b){var _0x136607={'raw':!![],'where':{}};var _0x456a3c={};var _0xd4182b={'count':0x0,'rows':[]};return db[_0x35ba('0x2b')]['findOne']({'where':{'id':_0x4ee40['params']['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x5180cc,null))['then'](function(_0x47e877){if(_0x47e877){_0x456a3c['model']=_['keys'](db[_0x35ba('0x59')][_0x35ba('0x2c')]);_0x456a3c[_0x35ba('0x39')]=_[_0x35ba('0x30')](_0x4ee40[_0x35ba('0x39')]);_0x456a3c[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0x456a3c[_0x35ba('0x2e')],_0x456a3c['query']);_0x136607[_0x35ba('0x33')]=_[_0x35ba('0x32')](_0x456a3c[_0x35ba('0x2e')],qs[_0x35ba('0x34')](_0x4ee40['query']['fields']));_0x136607['attributes']=_0x136607['attributes'][_0x35ba('0x4d')]?_0x136607[_0x35ba('0x33')]:_0x456a3c[_0x35ba('0x2e')];if(!_0x4ee40[_0x35ba('0x39')][_0x35ba('0x54')](_0x35ba('0x35'))){_0x136607['limit']=qs[_0x35ba('0x1a')](_0x4ee40[_0x35ba('0x39')][_0x35ba('0x1a')]);_0x136607[_0x35ba('0x36')]=qs['offset'](_0x4ee40[_0x35ba('0x39')][_0x35ba('0x36')]);}_0x136607[_0x35ba('0x37')]=qs[_0x35ba('0x38')](_0x4ee40[_0x35ba('0x39')][_0x35ba('0x38')]);_0x136607[_0x35ba('0x3a')]=qs[_0x35ba('0x31')](_['pick'](_0x4ee40[_0x35ba('0x39')],_0x456a3c[_0x35ba('0x31')]));_0x136607[_0x35ba('0x3a')][_0x35ba('0x5a')]=_0x47e877['id'];if(_0x4ee40[_0x35ba('0x39')]['filter']){_0x136607[_0x35ba('0x3a')]=_[_0x35ba('0x3d')](_0x136607[_0x35ba('0x3a')],{'$or':_[_0x35ba('0x2f')](_0x136607['attributes'],function(_0x58ceaf){var _0xbb64e={};_0xbb64e[_0x58ceaf]={'$like':'%'+_0x4ee40[_0x35ba('0x39')][_0x35ba('0x3c')]+'%'};return _0xbb64e;})});}_0x136607=_[_0x35ba('0x3d')]({},_0x136607,_0x4ee40[_0x35ba('0x3e')]);return db[_0x35ba('0x59')]['count']({'where':_0x136607['where']})[_0x35ba('0x23')](function(_0x4e7bcf){_0xd4182b[_0x35ba('0x1b')]=_0x4e7bcf;if(_0x4ee40['query']['includeAll']){_0x136607[_0x35ba('0x40')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x35ba('0x41')](_0x136607);})[_0x35ba('0x23')](function(_0x3daef9){_0xd4182b[_0x35ba('0x42')]=_0x3daef9;return _0xd4182b;});}})[_0x35ba('0x23')](respondWithFilteredResult(_0x5180cc,_0x136607))[_0x35ba('0x43')](handleError(_0x5180cc,null));};exports['getHopperBlacks']=function(_0x2d3e20,_0x1c67b7,_0x3a0bbb){var _0x5c94f7={'raw':!![],'where':{}};var _0x4408bd={};var _0x7fc09b={'count':0x0,'rows':[]};return db[_0x35ba('0x2b')][_0x35ba('0x56')]({'where':{'id':_0x2d3e20[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x1c67b7,null))[_0x35ba('0x23')](function(_0x50a02a){if(_0x50a02a){_0x4408bd['model']=_[_0x35ba('0x30')](db[_0x35ba('0x5b')][_0x35ba('0x2c')]);_0x4408bd[_0x35ba('0x39')]=_[_0x35ba('0x30')](_0x2d3e20[_0x35ba('0x39')]);_0x4408bd[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0x4408bd[_0x35ba('0x2e')],_0x4408bd['query']);_0x5c94f7[_0x35ba('0x33')]=_[_0x35ba('0x32')](_0x4408bd['model'],qs['fields'](_0x2d3e20[_0x35ba('0x39')]['fields']));_0x5c94f7[_0x35ba('0x33')]=_0x5c94f7[_0x35ba('0x33')][_0x35ba('0x4d')]?_0x5c94f7['attributes']:_0x4408bd[_0x35ba('0x2e')];if(!_0x2d3e20['query'][_0x35ba('0x54')]('nolimit')){_0x5c94f7[_0x35ba('0x1a')]=qs[_0x35ba('0x1a')](_0x2d3e20[_0x35ba('0x39')][_0x35ba('0x1a')]);_0x5c94f7[_0x35ba('0x36')]=qs[_0x35ba('0x36')](_0x2d3e20[_0x35ba('0x39')]['offset']);}_0x5c94f7['order']=qs[_0x35ba('0x38')](_0x2d3e20[_0x35ba('0x39')][_0x35ba('0x38')]);_0x5c94f7[_0x35ba('0x3a')]=qs[_0x35ba('0x31')](_[_0x35ba('0x3b')](_0x2d3e20[_0x35ba('0x39')],_0x4408bd[_0x35ba('0x31')]));_0x5c94f7['where'][_0x35ba('0x5a')]=_0x50a02a['id'];if(_0x2d3e20[_0x35ba('0x39')][_0x35ba('0x3c')]){_0x5c94f7[_0x35ba('0x3a')]=_[_0x35ba('0x3d')](_0x5c94f7[_0x35ba('0x3a')],{'$or':_[_0x35ba('0x2f')](_0x5c94f7[_0x35ba('0x33')],function(_0x5d03c1){var _0x5e0332={};_0x5e0332[_0x5d03c1]={'$like':'%'+_0x2d3e20['query'][_0x35ba('0x3c')]+'%'};return _0x5e0332;})});}_0x5c94f7=_[_0x35ba('0x3d')]({},_0x5c94f7,_0x2d3e20['options']);return db[_0x35ba('0x5b')][_0x35ba('0x1b')]({'where':_0x5c94f7['where']})[_0x35ba('0x23')](function(_0x43aec5){_0x7fc09b[_0x35ba('0x1b')]=_0x43aec5;if(_0x2d3e20['query'][_0x35ba('0x3f')]){_0x5c94f7[_0x35ba('0x40')]=[{'all':!![]}];}return db[_0x35ba('0x5b')][_0x35ba('0x41')](_0x5c94f7);})[_0x35ba('0x23')](function(_0x44eb0e){_0x7fc09b[_0x35ba('0x42')]=_0x44eb0e;return _0x7fc09b;});}})['then'](respondWithFilteredResult(_0x1c67b7,_0x5c94f7))[_0x35ba('0x43')](handleError(_0x1c67b7,null));};exports[_0x35ba('0x5c')]=function(_0xc76997,_0x22576d,_0x5cf0e6){var _0xa51fd={};var _0x5cea6c={};var _0x2b581a;var _0x5c14f0;return db[_0x35ba('0x2b')][_0x35ba('0x56')]({'where':{'id':_0xc76997[_0x35ba('0x45')]['id']}})['then'](handleEntityNotFound(_0x22576d,null))[_0x35ba('0x23')](function(_0x4bb175){if(_0x4bb175){_0x2b581a=_0x4bb175;_0x5cea6c['model']=_[_0x35ba('0x30')](db[_0x35ba('0x5d')][_0x35ba('0x2c')]);_0x5cea6c[_0x35ba('0x39')]=_['keys'](_0xc76997[_0x35ba('0x39')]);_0x5cea6c[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0x5cea6c[_0x35ba('0x2e')],_0x5cea6c['query']);_0xa51fd['attributes']=_[_0x35ba('0x32')](_0x5cea6c['model'],qs[_0x35ba('0x34')](_0xc76997[_0x35ba('0x39')][_0x35ba('0x34')]));_0xa51fd['attributes']=_0xa51fd[_0x35ba('0x33')][_0x35ba('0x4d')]?_0xa51fd[_0x35ba('0x33')]:_0x5cea6c[_0x35ba('0x2e')];_0xa51fd[_0x35ba('0x37')]=qs[_0x35ba('0x38')](_0xc76997[_0x35ba('0x39')]['sort']);_0xa51fd[_0x35ba('0x3a')]=qs[_0x35ba('0x31')](_[_0x35ba('0x3b')](_0xc76997['query'],_0x5cea6c[_0x35ba('0x31')]));if(_0xc76997[_0x35ba('0x39')][_0x35ba('0x3c')]){_0xa51fd[_0x35ba('0x3a')]=_[_0x35ba('0x3d')](_0xa51fd[_0x35ba('0x3a')],{'$or':_[_0x35ba('0x2f')](_0xa51fd[_0x35ba('0x33')],function(_0x51a09e){var _0x3090e2={};_0x3090e2[_0x51a09e]={'$like':'%'+_0xc76997[_0x35ba('0x39')]['filter']+'%'};return _0x3090e2;})});}_0xa51fd=_[_0x35ba('0x3d')]({},_0xa51fd,_0xc76997[_0x35ba('0x3e')]);return _0x2b581a[_0x35ba('0x5c')](_0xa51fd);}})['then'](function(_0x50e22c){if(_0x50e22c){_0x5c14f0=_0x50e22c[_0x35ba('0x4d')];if(!_0xc76997[_0x35ba('0x39')][_0x35ba('0x54')](_0x35ba('0x35'))){_0xa51fd['limit']=qs[_0x35ba('0x1a')](_0xc76997['query'][_0x35ba('0x1a')]);_0xa51fd['offset']=qs[_0x35ba('0x36')](_0xc76997['query'][_0x35ba('0x36')]);}return _0x2b581a[_0x35ba('0x5c')](_0xa51fd);}})[_0x35ba('0x23')](function(_0x29ae75){if(_0x29ae75){return _0x29ae75?{'count':_0x5c14f0,'rows':_0x29ae75}:null;}})['then'](respondWithResult(_0x22576d,null))[_0x35ba('0x43')](handleError(_0x22576d,null));};exports[_0x35ba('0x5e')]=function(_0xbc360,_0x1a9885,_0x2d2449){var _0x50e74c,_0xf7bcce;var _0x2a7764=[];var _0xed4e6e=moment()[_0x35ba('0x5f')](_0x35ba('0x60'));return db[_0x35ba('0x2b')]['find']({'where':{'id':_0xbc360[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x1a9885,null))['then'](function(_0x285d16){if(_0x285d16){_0xf7bcce=_0x285d16;return _0x285d16['addLists'](_0xbc360[_0x35ba('0x48')][_0x35ba('0x61')],_[_0x35ba('0x4f')](_0xbc360[_0x35ba('0x48')],['ids','id'])||{});}return null;})[_0x35ba('0x62')](function(_0x1a7211){var _0x7cd657;var _0x236fff;_0x50e74c=_0x1a7211||[];var _0x1c6cb2=[];if(_0x1a7211){for(var _0x403763=0x0;_0x403763<_0x1a7211[_0x35ba('0x4d')];_0x403763+=0x1){var _0x445036=_0x1a7211[_0x403763][_0x35ba('0x49')]({'plain':!![]});_0xf7bcce['dialCheckDuplicateType']=_0xbc360['body']['dialCheckDuplicateType']?_0xbc360[_0x35ba('0x48')][_0x35ba('0x63')]:_0xf7bcce[_0x35ba('0x63')];switch(_0xf7bcce[_0x35ba('0x63')]){case _0x35ba('0x64'):_0x7cd657=squel[_0x35ba('0x65')]()['into'](_0x35ba('0x66'))[_0x35ba('0x67')]([_0x35ba('0x68'),'scheduledAt',_0x35ba('0x69'),_0x35ba('0x6a'),'CampaignId','createdAt',_0x35ba('0x6b')],squel['select']()[_0x35ba('0x6c')]('phone',_0x35ba('0x68'))['field'](_0x35ba('0x6d'),'scheduledAt')[_0x35ba('0x6c')]('id',_0x35ba('0x69'))[_0x35ba('0x6c')](_0x445036[_0x35ba('0x6e')][_0x35ba('0x6f')](),'ListId')[_0x35ba('0x6c')](_0xbc360[_0x35ba('0x45')]['id'][_0x35ba('0x6f')](),_0x35ba('0x5a'))['field']('\x27'+_0xed4e6e+'\x27',_0x35ba('0x4e'))['field']('\x27'+_0xed4e6e+'\x27','updatedAt')[_0x35ba('0x70')]('cm_contacts')[_0x35ba('0x3a')](_0x35ba('0x71'))[_0x35ba('0x3a')](_0x35ba('0x72'),_0x445036['CmListId'][_0x35ba('0x6f')]())[_0x35ba('0x3a')](_0x35ba('0x73'))[_0x35ba('0x3a')](_0x35ba('0x74'),squel['select']()['field'](_0x35ba('0x75'))[_0x35ba('0x70')](_0x35ba('0x76'))[_0x35ba('0x3a')]('CampaignId\x20=\x20?',_0xbc360[_0x35ba('0x45')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x35ba('0x6c')](_0x35ba('0x77'))['from']('cm_hopper')[_0x35ba('0x3a')](_0x35ba('0x78'),_0xbc360[_0x35ba('0x45')]['id'][_0x35ba('0x6f')]())))['toString']();break;case _0x35ba('0x79'):_0x7cd657=squel[_0x35ba('0x65')]()[_0x35ba('0x7a')]('cm_hopper')[_0x35ba('0x67')]([_0x35ba('0x68'),'scheduledAt','ContactId','ListId',_0x35ba('0x5a'),'createdAt','updatedAt'],squel[_0x35ba('0x7b')]()[_0x35ba('0x6c')](_0x35ba('0x68'),_0x35ba('0x68'))['field'](_0x35ba('0x6d'),_0x35ba('0x7c'))[_0x35ba('0x6c')]('id',_0x35ba('0x69'))[_0x35ba('0x6c')](_0x445036[_0x35ba('0x6e')][_0x35ba('0x6f')](),_0x35ba('0x6a'))[_0x35ba('0x6c')](_0xbc360['params']['id'][_0x35ba('0x6f')](),_0x35ba('0x5a'))[_0x35ba('0x6c')]('\x27'+_0xed4e6e+'\x27',_0x35ba('0x4e'))[_0x35ba('0x6c')]('\x27'+_0xed4e6e+'\x27',_0x35ba('0x6b'))[_0x35ba('0x70')](_0x35ba('0x7d'))[_0x35ba('0x3a')]('deletedAt\x20IS\x20NULL')[_0x35ba('0x3a')](_0x35ba('0x72'),_0x445036[_0x35ba('0x6e')][_0x35ba('0x6f')]())[_0x35ba('0x3a')](_0x35ba('0x73'))[_0x35ba('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x35ba('0x6c')]('COALESCE(phone,\x27\x27)')[_0x35ba('0x70')]('cm_hopper')[_0x35ba('0x3a')]('CampaignId\x20=\x20?',_0xbc360['params']['id'][_0x35ba('0x6f')]())))[_0x35ba('0x6f')]();break;default:_0x7cd657=squel[_0x35ba('0x65')]()[_0x35ba('0x7a')](_0x35ba('0x66'))[_0x35ba('0x67')]([_0x35ba('0x68'),_0x35ba('0x7c'),'ContactId',_0x35ba('0x6a'),'CampaignId',_0x35ba('0x4e'),_0x35ba('0x6b')],squel[_0x35ba('0x7b')]()[_0x35ba('0x6c')](_0x35ba('0x68'),_0x35ba('0x68'))[_0x35ba('0x6c')](_0x35ba('0x6d'),_0x35ba('0x7c'))[_0x35ba('0x6c')]('id',_0x35ba('0x69'))[_0x35ba('0x6c')](_0x445036[_0x35ba('0x6e')][_0x35ba('0x6f')](),_0x35ba('0x6a'))['field'](_0xbc360[_0x35ba('0x45')]['id'][_0x35ba('0x6f')](),_0x35ba('0x5a'))[_0x35ba('0x6c')]('\x27'+_0xed4e6e+'\x27',_0x35ba('0x4e'))['field']('\x27'+_0xed4e6e+'\x27',_0x35ba('0x6b'))['from'](_0x35ba('0x7d'))['where'](_0x35ba('0x71'))[_0x35ba('0x3a')](_0x35ba('0x72'),_0x445036[_0x35ba('0x6e')]['toString']())[_0x35ba('0x3a')](_0x35ba('0x73')))[_0x35ba('0x6f')]();}_0x236fff=squel[_0x35ba('0x65')]()[_0x35ba('0x7a')](_0x35ba('0x7e'))[_0x35ba('0x67')]([_0x35ba('0x7f'),_0x35ba('0x7c'),_0x35ba('0x68'),'OrderBy',_0x35ba('0x4e'),'updatedAt'],squel[_0x35ba('0x7b')]()['field'](_0x35ba('0x80'),'id')[_0x35ba('0x6c')](_0x35ba('0x6d'),_0x35ba('0x7c'))[_0x35ba('0x6c')](_0x35ba('0x81'),_0x35ba('0x68'))[_0x35ba('0x6c')](_0x35ba('0x82'),_0x35ba('0x83'))[_0x35ba('0x6c')]('\x27'+_0xed4e6e+'\x27',_0x35ba('0x4e'))[_0x35ba('0x6c')]('\x27'+_0xed4e6e+'\x27',_0x35ba('0x6b'))[_0x35ba('0x70')](_0x35ba('0x84'),'ci')[_0x35ba('0x85')](_0x35ba('0x66'),'h',_0x35ba('0x86'))['where'](_0x35ba('0x87'),_0x445036[_0x35ba('0x6e')][_0x35ba('0x6f')]())[_0x35ba('0x3a')](_0x35ba('0x88'),_0xbc360['params']['id']['toString']())[_0x35ba('0x3a')](_0x35ba('0x89'),_0xed4e6e))['toString']();_0x1c6cb2[_0x35ba('0x8a')](db[_0x35ba('0x8b')]['query'](_0x7cd657));_0x2a7764[_0x35ba('0x8a')](db[_0x35ba('0x8b')][_0x35ba('0x39')](_0x236fff));}return BPromise[_0x35ba('0x8c')](_0x1c6cb2);}})['then'](function(){return BPromise['all'](_0x2a7764);})['then'](function(){return _0x50e74c;})[_0x35ba('0x23')](respondWithResult(_0x1a9885,null))[_0x35ba('0x43')](handleError(_0x1a9885,null));};exports[_0x35ba('0x8d')]=function(_0x23f486,_0x48f1a3,_0x5c4c08){return db[_0x35ba('0x2b')][_0x35ba('0x46')]({'where':{'id':_0x23f486[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x48f1a3,null))[_0x35ba('0x23')](function(_0x5399bd){if(_0x5399bd){return _0x5399bd[_0x35ba('0x8d')](_0x23f486['query']['ids']);}})[_0x35ba('0x23')](function(_0x41dcc7){if(_0x41dcc7){return db[_0x35ba('0x53')][_0x35ba('0x25')]({'where':{'ListId':_0x23f486[_0x35ba('0x39')][_0x35ba('0x61')],'CampaignId':_0x23f486[_0x35ba('0x45')]['id']}})['then'](function(){return _0x41dcc7;});}})[_0x35ba('0x23')](respondWithStatusCode(_0x48f1a3,null))[_0x35ba('0x43')](handleError(_0x48f1a3,null));};exports[_0x35ba('0x8e')]=function(_0x15eeb7,_0x584223,_0x32e213){var _0x213037={};var _0x50bce2={};var _0x54e80a;var _0x5fd5d7;return db['Campaign'][_0x35ba('0x56')]({'where':{'id':_0x15eeb7['params']['id']}})['then'](handleEntityNotFound(_0x584223,null))[_0x35ba('0x23')](function(_0x5c1980){if(_0x5c1980){_0x54e80a=_0x5c1980;_0x50bce2[_0x35ba('0x2e')]=_[_0x35ba('0x30')](db[_0x35ba('0x5d')][_0x35ba('0x2c')]);_0x50bce2['query']=_[_0x35ba('0x30')](_0x15eeb7[_0x35ba('0x39')]);_0x50bce2[_0x35ba('0x31')]=_[_0x35ba('0x32')](_0x50bce2[_0x35ba('0x2e')],_0x50bce2[_0x35ba('0x39')]);_0x213037['attributes']=_['intersection'](_0x50bce2[_0x35ba('0x2e')],qs[_0x35ba('0x34')](_0x15eeb7['query'][_0x35ba('0x34')]));_0x213037[_0x35ba('0x33')]=_0x213037[_0x35ba('0x33')]['length']?_0x213037[_0x35ba('0x33')]:_0x50bce2[_0x35ba('0x2e')];_0x213037[_0x35ba('0x37')]=qs[_0x35ba('0x38')](_0x15eeb7['query'][_0x35ba('0x38')]);_0x213037['where']=qs[_0x35ba('0x31')](_[_0x35ba('0x3b')](_0x15eeb7[_0x35ba('0x39')],_0x50bce2[_0x35ba('0x31')]));if(_0x15eeb7['query'][_0x35ba('0x3c')]){_0x213037[_0x35ba('0x3a')]=_[_0x35ba('0x3d')](_0x213037[_0x35ba('0x3a')],{'$or':_[_0x35ba('0x2f')](_0x213037[_0x35ba('0x33')],function(_0x4a710e){var _0x275029={};_0x275029[_0x4a710e]={'$like':'%'+_0x15eeb7[_0x35ba('0x39')][_0x35ba('0x3c')]+'%'};return _0x275029;})});}_0x213037=_[_0x35ba('0x3d')]({},_0x213037,_0x15eeb7[_0x35ba('0x3e')]);return _0x54e80a[_0x35ba('0x8e')](_0x213037);}})[_0x35ba('0x23')](function(_0x4c0515){if(_0x4c0515){_0x5fd5d7=_0x4c0515[_0x35ba('0x4d')];if(!_0x15eeb7['query']['hasOwnProperty']('nolimit')){_0x213037[_0x35ba('0x1a')]=qs[_0x35ba('0x1a')](_0x15eeb7[_0x35ba('0x39')][_0x35ba('0x1a')]);_0x213037['offset']=qs[_0x35ba('0x36')](_0x15eeb7[_0x35ba('0x39')][_0x35ba('0x36')]);}return _0x54e80a[_0x35ba('0x8e')](_0x213037);}})[_0x35ba('0x23')](function(_0x334e6a){if(_0x334e6a){return _0x334e6a?{'count':_0x5fd5d7,'rows':_0x334e6a}:null;}})['then'](respondWithResult(_0x584223,null))[_0x35ba('0x43')](handleError(_0x584223,null));};exports[_0x35ba('0x8f')]=function(_0x34cd51,_0x40aeef,_0xefde4d){var _0x11c2b8,_0x30f4b0;var _0x132ca4=[];var _0x13bcca=moment()[_0x35ba('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x35ba('0x46')]({'where':{'id':_0x34cd51[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x40aeef,null))[_0x35ba('0x23')](function(_0x5e8239){if(_0x5e8239){_0x30f4b0=_0x5e8239;return _0x5e8239[_0x35ba('0x8f')](_0x34cd51['body']['ids'],_[_0x35ba('0x4f')](_0x34cd51[_0x35ba('0x48')],[_0x35ba('0x61'),'id'])||{});}return null;})['spread'](function(_0x113143){var _0x11b00d;var _0x5774d7;_0x11c2b8=_0x113143||[];var _0x2d4adb=[];if(_0x113143){for(var _0x135f3b=0x0;_0x135f3b<_0x113143[_0x35ba('0x4d')];_0x135f3b+=0x1){var _0x16a42e=_0x113143[_0x135f3b][_0x35ba('0x49')]({'plain':!![]});_0x11b00d=squel[_0x35ba('0x65')]()['into'](_0x35ba('0x90'))[_0x35ba('0x67')](['phone',_0x35ba('0x69'),_0x35ba('0x6a'),'CampaignId',_0x35ba('0x4e'),_0x35ba('0x6b')],squel[_0x35ba('0x7b')]()[_0x35ba('0x6c')](_0x35ba('0x68'),_0x35ba('0x68'))[_0x35ba('0x6c')]('id',_0x35ba('0x69'))[_0x35ba('0x6c')](_0x16a42e[_0x35ba('0x6e')][_0x35ba('0x6f')](),_0x35ba('0x6a'))[_0x35ba('0x6c')](_0x34cd51['params']['id']['toString'](),_0x35ba('0x5a'))['field'](_0x35ba('0x6d'),_0x35ba('0x4e'))[_0x35ba('0x6c')](_0x35ba('0x6d'),_0x35ba('0x6b'))[_0x35ba('0x70')](_0x35ba('0x7d'))[_0x35ba('0x3a')](_0x35ba('0x71'))[_0x35ba('0x3a')](_0x35ba('0x72'),_0x16a42e[_0x35ba('0x6e')]['toString']())[_0x35ba('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x35ba('0x6f')]();_0x2d4adb[_0x35ba('0x8a')](db[_0x35ba('0x8b')]['query'](_0x11b00d));}return BPromise[_0x35ba('0x8c')](_0x2d4adb);}})[_0x35ba('0x23')](function(){return _0x11c2b8;})['then'](respondWithResult(_0x40aeef,null))[_0x35ba('0x43')](handleError(_0x40aeef,null));};exports[_0x35ba('0x91')]=function(_0x5d5d00,_0x413a92,_0xdeade8){return db[_0x35ba('0x2b')][_0x35ba('0x46')]({'where':{'id':_0x5d5d00[_0x35ba('0x45')]['id']}})[_0x35ba('0x23')](handleEntityNotFound(_0x413a92,null))[_0x35ba('0x23')](function(_0x41fda5){if(_0x41fda5){return _0x41fda5['removeBlackLists'](_0x5d5d00[_0x35ba('0x39')]['ids']);}})['then'](function(_0x4c1fca){if(_0x4c1fca){return db[_0x35ba('0x5b')][_0x35ba('0x25')]({'where':{'ListId':_0x5d5d00[_0x35ba('0x39')][_0x35ba('0x61')],'CampaignId':_0x5d5d00['params']['id']}})[_0x35ba('0x23')](function(){return _0x4c1fca;});}})[_0x35ba('0x23')](respondWithStatusCode(_0x413a92,null))[_0x35ba('0x43')](handleError(_0x413a92,null));};
\ No newline at end of file
+var _0x13ea=['onlyIfOpen','into','phone\x20IS\x20NOT\x20NULL','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','findOne','CmList','addBlackLists','cm_hopper_black','all','removeBlackLists','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','IvrCampaigns','UserProfileResource','destroy','sendStatus','error','stack','send','index','map','Campaign','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','include','findAll','rows','catch','show','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','params','length','find','get','omit','updatedAt','createdAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CampaignId','options','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','ListId','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x13ea,0xa9));var _0xa13e=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x13ea[_0x506d83];return _0x335e8b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa13e('0x0'));var jsonpatch=require(_0xa13e('0x1'));var rp=require(_0xa13e('0x2'));var moment=require('moment');var BPromise=require(_0xa13e('0x3'));var Mustache=require('mustache');var util=require(_0xa13e('0x4'));var path=require('path');var sox=require(_0xa13e('0x5'));var csv=require(_0xa13e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa13e('0x7'));var jsforce=require(_0xa13e('0x8'));var deskjs=require(_0xa13e('0x9'));var toCsv=require('to-csv');var querystring=require(_0xa13e('0xa'));var Papa=require(_0xa13e('0xb'));var Redis=require(_0xa13e('0xc'));var authService=require(_0xa13e('0xd'));var qs=require(_0xa13e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa13e('0xf'));var logger=require(_0xa13e('0x10'))(_0xa13e('0x11'));var utils=require(_0xa13e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa13e('0x13'));var db=require(_0xa13e('0x14'))['db'];function respondWithStatusCode(_0x17a949,_0x39fa45){_0x39fa45=_0x39fa45||0xcc;return function(_0x423688){if(_0x423688){return _0x17a949['sendStatus'](_0x39fa45);}return _0x17a949[_0xa13e('0x15')](_0x39fa45)[_0xa13e('0x16')]();};}function respondWithResult(_0x57ec24,_0x493010){_0x493010=_0x493010||0xc8;return function(_0xd9c8a8){if(_0xd9c8a8){return _0x57ec24['status'](_0x493010)[_0xa13e('0x17')](_0xd9c8a8);}};}function respondWithFilteredResult(_0x513019,_0x112321){return function(_0x243ce5){if(_0x243ce5){var _0x1c5b14=typeof _0x112321[_0xa13e('0x18')]===_0xa13e('0x19')&&typeof _0x112321['limit']===_0xa13e('0x19');var _0x193d4a=_0x243ce5[_0xa13e('0x1a')];var _0x4f8af2=_0x1c5b14?0x0:_0x112321[_0xa13e('0x18')];var _0x36acb8=_0x1c5b14?_0x243ce5['count']:_0x112321[_0xa13e('0x18')]+_0x112321[_0xa13e('0x1b')];var _0x441df6;if(_0x36acb8>=_0x193d4a){_0x36acb8=_0x193d4a;_0x441df6=0xc8;}else{_0x441df6=0xce;}_0x513019[_0xa13e('0x15')](_0x441df6);return _0x513019['set'](_0xa13e('0x1c'),_0x4f8af2+'-'+_0x36acb8+'/'+_0x193d4a)[_0xa13e('0x17')](_0x243ce5);}return null;};}function patchUpdates(_0x24b13a){return function(_0x321cd3){try{jsonpatch[_0xa13e('0x1d')](_0x321cd3,_0x24b13a,!![]);}catch(_0x30f4e5){return BPromise['reject'](_0x30f4e5);}return _0x321cd3[_0xa13e('0x1e')]();};}function saveUpdates(_0x1eeacc,_0x498081){return function(_0x5136be){if(_0x5136be){return _0x5136be[_0xa13e('0x1f')](_0x1eeacc)[_0xa13e('0x20')](function(_0x359dd7){return _0x359dd7;});}return null;};}function removeEntity(_0x1932bd,_0x213000){return function(_0x2dc21b){if(_0x2dc21b){return _0x2dc21b['destroy']()[_0xa13e('0x20')](function(){var _0x364e70=_0x2dc21b['get']({'plain':!![]});var _0x1dd290=_0xa13e('0x21');return db[_0xa13e('0x22')][_0xa13e('0x23')]({'where':{'type':_0x1dd290,'resourceId':_0x364e70['id']}})[_0xa13e('0x20')](function(){return _0x2dc21b;});})[_0xa13e('0x20')](function(){_0x1932bd[_0xa13e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21c2b6,_0x416433){return function(_0x380f6b){if(!_0x380f6b){_0x21c2b6[_0xa13e('0x24')](0x194);}return _0x380f6b;};}function handleError(_0x4e8405,_0x643ce7){_0x643ce7=_0x643ce7||0x1f4;return function(_0x30814a){logger[_0xa13e('0x25')](_0x30814a[_0xa13e('0x26')]);if(_0x30814a['name']){delete _0x30814a['name'];}_0x4e8405[_0xa13e('0x15')](_0x643ce7)[_0xa13e('0x27')](_0x30814a);};}exports[_0xa13e('0x28')]=function(_0x5af83d,_0x133694){var _0x2d1a4d={},_0x5b919d={},_0x1a61a8={'count':0x0,'rows':[]};var _0x11bf12=_[_0xa13e('0x29')](db[_0xa13e('0x2a')][_0xa13e('0x2b')],function(_0x2bfd0b){return{'name':_0x2bfd0b['fieldName'],'type':_0x2bfd0b[_0xa13e('0x2c')][_0xa13e('0x2d')]};});_0x5b919d[_0xa13e('0x2e')]=_['map'](_0x11bf12,'name');_0x5b919d[_0xa13e('0x2f')]=_['keys'](_0x5af83d['query']);_0x5b919d[_0xa13e('0x30')]=_[_0xa13e('0x31')](_0x5b919d['model'],_0x5b919d['query']);_0x2d1a4d[_0xa13e('0x32')]=_[_0xa13e('0x31')](_0x5b919d[_0xa13e('0x2e')],qs[_0xa13e('0x33')](_0x5af83d['query']['fields']));_0x2d1a4d[_0xa13e('0x32')]=_0x2d1a4d['attributes']['length']?_0x2d1a4d[_0xa13e('0x32')]:_0x5b919d[_0xa13e('0x2e')];if(!_0x5af83d[_0xa13e('0x2f')][_0xa13e('0x34')](_0xa13e('0x35'))){_0x2d1a4d[_0xa13e('0x1b')]=qs['limit'](_0x5af83d[_0xa13e('0x2f')][_0xa13e('0x1b')]);_0x2d1a4d['offset']=qs[_0xa13e('0x18')](_0x5af83d[_0xa13e('0x2f')]['offset']);}_0x2d1a4d[_0xa13e('0x36')]=qs[_0xa13e('0x37')](_0x5af83d[_0xa13e('0x2f')][_0xa13e('0x37')]);_0x2d1a4d['where']=qs[_0xa13e('0x30')](_[_0xa13e('0x38')](_0x5af83d['query'],_0x5b919d[_0xa13e('0x30')]),_0x11bf12);if(_0x5af83d[_0xa13e('0x2f')][_0xa13e('0x39')]){_0x2d1a4d[_0xa13e('0x3a')]=_[_0xa13e('0x3b')](_0x2d1a4d['where'],{'$or':_[_0xa13e('0x29')](_0x11bf12,function(_0x1f41b1){if(_0x1f41b1['type']!==_0xa13e('0x3c')){var _0x2ed1eb={};_0x2ed1eb[_0x1f41b1[_0xa13e('0x3d')]]={'$like':'%'+_0x5af83d['query'][_0xa13e('0x39')]+'%'};return _0x2ed1eb;}})});}_0x2d1a4d=_[_0xa13e('0x3b')]({},_0x2d1a4d,_0x5af83d['options']);var _0x2b0834={'where':_0x2d1a4d[_0xa13e('0x3a')]};return db[_0xa13e('0x2a')][_0xa13e('0x1a')](_0x2b0834)[_0xa13e('0x20')](function(_0x1a66aa){_0x1a61a8[_0xa13e('0x1a')]=_0x1a66aa;if(_0x5af83d[_0xa13e('0x2f')]['includeAll']){_0x2d1a4d[_0xa13e('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0xa13e('0x3f')](_0x2d1a4d);})['then'](function(_0x4e23fc){_0x1a61a8[_0xa13e('0x40')]=_0x4e23fc;return _0x1a61a8;})[_0xa13e('0x20')](respondWithFilteredResult(_0x133694,_0x2d1a4d))[_0xa13e('0x41')](handleError(_0x133694,null));};exports[_0xa13e('0x42')]=function(_0xa5d7c5,_0x589051){var _0x3fc3d7={'raw':![],'where':{'id':_0xa5d7c5['params']['id']}},_0x19f127={};_0x19f127[_0xa13e('0x2e')]=_[_0xa13e('0x43')](db['Campaign'][_0xa13e('0x2b')]);_0x19f127[_0xa13e('0x2f')]=_[_0xa13e('0x43')](_0xa5d7c5[_0xa13e('0x2f')]);_0x19f127['filters']=_[_0xa13e('0x31')](_0x19f127[_0xa13e('0x2e')],_0x19f127['query']);_0x3fc3d7['attributes']=_[_0xa13e('0x31')](_0x19f127[_0xa13e('0x2e')],qs[_0xa13e('0x33')](_0xa5d7c5[_0xa13e('0x2f')][_0xa13e('0x33')]));_0x3fc3d7[_0xa13e('0x32')]=_0x3fc3d7[_0xa13e('0x32')]['length']?_0x3fc3d7['attributes']:_0x19f127[_0xa13e('0x2e')];if(_0xa5d7c5[_0xa13e('0x2f')][_0xa13e('0x44')]){_0x3fc3d7[_0xa13e('0x3e')]=[{'all':!![]}];}_0x3fc3d7=_[_0xa13e('0x3b')]({},_0x3fc3d7,_0xa5d7c5['options']);return db['Campaign']['find'](_0x3fc3d7)['then'](handleEntityNotFound(_0x589051,null))[_0xa13e('0x20')](respondWithResult(_0x589051,null))[_0xa13e('0x41')](handleError(_0x589051,null));};exports[_0xa13e('0x45')]=function(_0x1522b6,_0x2762d4){return db[_0xa13e('0x2a')][_0xa13e('0x45')](_0x1522b6[_0xa13e('0x46')],{})['then'](function(_0x49ea7b){var _0x58c8cc=_0x1522b6[_0xa13e('0x47')]['get']({'plain':!![]});if(!_0x58c8cc)throw new Error(_0xa13e('0x48'));if(_0x58c8cc['role']===_0xa13e('0x47')){var _0x7f3666=_0x49ea7b['get']({'plain':!![]});var _0x4d11d5=_0xa13e('0x21');return db[_0xa13e('0x49')]['find']({'where':{'name':_0x4d11d5,'userProfileId':_0x58c8cc[_0xa13e('0x4a')]},'raw':!![]})[_0xa13e('0x20')](function(_0x33431f){if(_0x33431f&&_0x33431f['autoAssociation']===0x0){return db['UserProfileResource'][_0xa13e('0x45')]({'name':_0x7f3666['name'],'resourceId':_0x7f3666['id'],'type':_0x33431f[_0xa13e('0x3d')],'sectionId':_0x33431f['id']},{})[_0xa13e('0x20')](function(){return _0x49ea7b;});}else{return _0x49ea7b;}})[_0xa13e('0x41')](function(_0x1c2726){logger[_0xa13e('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c2726);throw _0x1c2726;});}return _0x49ea7b;})[_0xa13e('0x20')](respondWithResult(_0x2762d4,0xc9))[_0xa13e('0x41')](handleError(_0x2762d4,null));};exports['clone']=function(_0x3d7f44,_0x437c68){var _0x4f5a6b={'where':{'id':_0x3d7f44[_0xa13e('0x4b')]['id']}},_0x255ba1={};_0x255ba1[_0xa13e('0x2e')]=_[_0xa13e('0x43')](db[_0xa13e('0x2a')][_0xa13e('0x2b')]);_0x4f5a6b['attributes']=_[_0xa13e('0x31')](_0x255ba1[_0xa13e('0x2e')],qs[_0xa13e('0x33')](_0x3d7f44[_0xa13e('0x2f')][_0xa13e('0x33')]));_0x4f5a6b[_0xa13e('0x32')]=_0x4f5a6b[_0xa13e('0x32')][_0xa13e('0x4c')]?_0x4f5a6b[_0xa13e('0x32')]:_0x255ba1[_0xa13e('0x2e')];if(_0x3d7f44[_0xa13e('0x2f')][_0xa13e('0x44')]){_0x4f5a6b['include']=[{'all':!![]}];}_0x4f5a6b=_[_0xa13e('0x3b')]({},_0x4f5a6b,_0x3d7f44['options']);return db[_0xa13e('0x2a')][_0xa13e('0x4d')](_0x4f5a6b)[_0xa13e('0x20')](handleEntityNotFound(_0x437c68,null))[_0xa13e('0x20')](function(_0x2b598d){if(_0x2b598d){var _0x47870e=_0x2b598d[_0xa13e('0x4e')]({'plain':!![]});_0x47870e=qs[_0xa13e('0x4f')](_0x47870e,['id','createdAt',_0xa13e('0x50')]);_0x3d7f44[_0xa13e('0x46')]=_[_0xa13e('0x4f')](_0x3d7f44[_0xa13e('0x46')],['id',_0xa13e('0x51'),'updatedAt']);return db[_0xa13e('0x2a')]['create'](_['merge'](_0x47870e,_0x3d7f44[_0xa13e('0x46')]),{'include':_0x3d7f44[_0xa13e('0x2f')][_0xa13e('0x44')]?[{'all':!![]}]:undefined})[_0xa13e('0x20')](function(_0x43e9fd){var _0x598a6a=_0x3d7f44[_0xa13e('0x47')][_0xa13e('0x4e')]({'plain':!![]});if(!_0x598a6a)throw new Error(_0xa13e('0x48'));if(_0x598a6a[_0xa13e('0x52')]===_0xa13e('0x47')){var _0x4cef03=_0x43e9fd['get']({'plain':!![]});var _0x2a291a=_0xa13e('0x21');return db['UserProfileSection'][_0xa13e('0x4d')]({'where':{'name':_0x2a291a,'userProfileId':_0x598a6a[_0xa13e('0x4a')]},'raw':!![]})[_0xa13e('0x20')](function(_0x18007a){if(_0x18007a&&_0x18007a[_0xa13e('0x53')]===0x0){return db['UserProfileResource'][_0xa13e('0x45')]({'name':_0x4cef03[_0xa13e('0x3d')],'resourceId':_0x4cef03['id'],'type':_0x18007a[_0xa13e('0x3d')],'sectionId':_0x18007a['id']},{})[_0xa13e('0x20')](function(){return _0x43e9fd;});}else{return _0x43e9fd;}})['catch'](function(_0xe918a){logger[_0xa13e('0x25')](_0xa13e('0x54'),_0xe918a);throw _0xe918a;});}return _0x43e9fd;});}})[_0xa13e('0x20')](respondWithResult(_0x437c68,0xc9))[_0xa13e('0x41')](handleError(_0x437c68,null));};exports[_0xa13e('0x1f')]=function(_0x249e41,_0x5df452){if(_0x249e41['body']['id']){delete _0x249e41[_0xa13e('0x46')]['id'];}return db['Campaign'][_0xa13e('0x4d')]({'where':{'id':_0x249e41[_0xa13e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5df452,null))[_0xa13e('0x20')](saveUpdates(_0x249e41[_0xa13e('0x46')],null))[_0xa13e('0x20')](respondWithResult(_0x5df452,null))[_0xa13e('0x41')](handleError(_0x5df452,null));};exports[_0xa13e('0x23')]=function(_0x112cc2,_0x194ce4){return db[_0xa13e('0x2a')][_0xa13e('0x4d')]({'where':{'id':_0x112cc2['params']['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0x194ce4,null))[_0xa13e('0x20')](removeEntity(_0x194ce4,null))[_0xa13e('0x41')](handleError(_0x194ce4,null));};exports[_0xa13e('0x55')]=function(_0x35be12,_0xab3a3c,_0x134fad){var _0x194a4c={'raw':!![],'where':{}};var _0x16dee2={};var _0x58f985={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x35be12[_0xa13e('0x4b')]['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0xab3a3c,null))[_0xa13e('0x20')](function(_0x2f513e){if(_0x2f513e){_0x16dee2[_0xa13e('0x2e')]=_[_0xa13e('0x43')](db['CmHopper'][_0xa13e('0x2b')]);_0x16dee2['query']=_[_0xa13e('0x43')](_0x35be12[_0xa13e('0x2f')]);_0x16dee2[_0xa13e('0x30')]=_[_0xa13e('0x31')](_0x16dee2[_0xa13e('0x2e')],_0x16dee2[_0xa13e('0x2f')]);_0x194a4c['attributes']=_[_0xa13e('0x31')](_0x16dee2[_0xa13e('0x2e')],qs[_0xa13e('0x33')](_0x35be12[_0xa13e('0x2f')][_0xa13e('0x33')]));_0x194a4c[_0xa13e('0x32')]=_0x194a4c['attributes'][_0xa13e('0x4c')]?_0x194a4c[_0xa13e('0x32')]:_0x16dee2['model'];if(!_0x35be12[_0xa13e('0x2f')][_0xa13e('0x34')](_0xa13e('0x35'))){_0x194a4c['limit']=qs[_0xa13e('0x1b')](_0x35be12['query']['limit']);_0x194a4c[_0xa13e('0x18')]=qs[_0xa13e('0x18')](_0x35be12[_0xa13e('0x2f')][_0xa13e('0x18')]);}_0x194a4c[_0xa13e('0x36')]=qs[_0xa13e('0x37')](_0x35be12['query'][_0xa13e('0x37')]);_0x194a4c[_0xa13e('0x3a')]=qs[_0xa13e('0x30')](_[_0xa13e('0x38')](_0x35be12['query'],_0x16dee2[_0xa13e('0x30')]));_0x194a4c[_0xa13e('0x3a')][_0xa13e('0x56')]=_0x2f513e['id'];if(_0x35be12['query']['filter']){_0x194a4c['where']=_['merge'](_0x194a4c['where'],{'$or':_[_0xa13e('0x29')](_0x194a4c['attributes'],function(_0x1e29cb){var _0x3d68ac={};_0x3d68ac[_0x1e29cb]={'$like':'%'+_0x35be12[_0xa13e('0x2f')][_0xa13e('0x39')]+'%'};return _0x3d68ac;})});}_0x194a4c=_[_0xa13e('0x3b')]({},_0x194a4c,_0x35be12[_0xa13e('0x57')]);return db['CmHopper']['count']({'where':_0x194a4c['where']})[_0xa13e('0x20')](function(_0x31d4e){_0x58f985[_0xa13e('0x1a')]=_0x31d4e;if(_0x35be12[_0xa13e('0x2f')][_0xa13e('0x44')]){_0x194a4c['include']=[{'all':!![]}];}return db[_0xa13e('0x58')]['findAll'](_0x194a4c);})[_0xa13e('0x20')](function(_0x212892){_0x58f985[_0xa13e('0x40')]=_0x212892;return _0x58f985;});}})[_0xa13e('0x20')](respondWithFilteredResult(_0xab3a3c,_0x194a4c))[_0xa13e('0x41')](handleError(_0xab3a3c,null));};exports[_0xa13e('0x59')]=function(_0x1c6d0a,_0x325492,_0x20d933){var _0x391356={'raw':!![],'where':{}};var _0x2633db={};var _0x5955c0={'count':0x0,'rows':[]};return db[_0xa13e('0x2a')]['findOne']({'where':{'id':_0x1c6d0a['params']['id']}})['then'](handleEntityNotFound(_0x325492,null))[_0xa13e('0x20')](function(_0x51636d){if(_0x51636d){_0x2633db[_0xa13e('0x2e')]=_['keys'](db[_0xa13e('0x5a')][_0xa13e('0x2b')]);_0x2633db[_0xa13e('0x2f')]=_['keys'](_0x1c6d0a['query']);_0x2633db[_0xa13e('0x30')]=_[_0xa13e('0x31')](_0x2633db[_0xa13e('0x2e')],_0x2633db['query']);_0x391356[_0xa13e('0x32')]=_[_0xa13e('0x31')](_0x2633db['model'],qs[_0xa13e('0x33')](_0x1c6d0a[_0xa13e('0x2f')][_0xa13e('0x33')]));_0x391356[_0xa13e('0x32')]=_0x391356[_0xa13e('0x32')][_0xa13e('0x4c')]?_0x391356['attributes']:_0x2633db[_0xa13e('0x2e')];if(!_0x1c6d0a[_0xa13e('0x2f')][_0xa13e('0x34')](_0xa13e('0x35'))){_0x391356[_0xa13e('0x1b')]=qs[_0xa13e('0x1b')](_0x1c6d0a['query'][_0xa13e('0x1b')]);_0x391356[_0xa13e('0x18')]=qs[_0xa13e('0x18')](_0x1c6d0a[_0xa13e('0x2f')][_0xa13e('0x18')]);}_0x391356['order']=qs[_0xa13e('0x37')](_0x1c6d0a['query']['sort']);_0x391356[_0xa13e('0x3a')]=qs[_0xa13e('0x30')](_[_0xa13e('0x38')](_0x1c6d0a[_0xa13e('0x2f')],_0x2633db[_0xa13e('0x30')]));_0x391356[_0xa13e('0x3a')][_0xa13e('0x56')]=_0x51636d['id'];if(_0x1c6d0a[_0xa13e('0x2f')]['filter']){_0x391356[_0xa13e('0x3a')]=_[_0xa13e('0x3b')](_0x391356[_0xa13e('0x3a')],{'$or':_[_0xa13e('0x29')](_0x391356['attributes'],function(_0xc544c0){var _0xc1e082={};_0xc1e082[_0xc544c0]={'$like':'%'+_0x1c6d0a[_0xa13e('0x2f')][_0xa13e('0x39')]+'%'};return _0xc1e082;})});}_0x391356=_[_0xa13e('0x3b')]({},_0x391356,_0x1c6d0a[_0xa13e('0x57')]);return db[_0xa13e('0x5a')]['count']({'where':_0x391356[_0xa13e('0x3a')]})[_0xa13e('0x20')](function(_0x536b50){_0x5955c0['count']=_0x536b50;if(_0x1c6d0a[_0xa13e('0x2f')][_0xa13e('0x44')]){_0x391356['include']=[{'all':!![]}];}return db[_0xa13e('0x5a')][_0xa13e('0x3f')](_0x391356);})[_0xa13e('0x20')](function(_0x4afca5){_0x5955c0['rows']=_0x4afca5;return _0x5955c0;});}})[_0xa13e('0x20')](respondWithFilteredResult(_0x325492,_0x391356))[_0xa13e('0x41')](handleError(_0x325492,null));};exports[_0xa13e('0x5b')]=function(_0xd9a51,_0x5943d1,_0x2825d2){var _0x4ce9b9={'raw':!![],'where':{}};var _0x3c09ba={};var _0x6acd20={'count':0x0,'rows':[]};return db[_0xa13e('0x2a')]['findOne']({'where':{'id':_0xd9a51[_0xa13e('0x4b')]['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0x5943d1,null))[_0xa13e('0x20')](function(_0x568a91){if(_0x568a91){_0x3c09ba['model']=_[_0xa13e('0x43')](db['CmHopperFinal'][_0xa13e('0x2b')]);_0x3c09ba[_0xa13e('0x2f')]=_['keys'](_0xd9a51[_0xa13e('0x2f')]);_0x3c09ba['filters']=_['intersection'](_0x3c09ba['model'],_0x3c09ba[_0xa13e('0x2f')]);_0x4ce9b9[_0xa13e('0x32')]=_['intersection'](_0x3c09ba[_0xa13e('0x2e')],qs[_0xa13e('0x33')](_0xd9a51[_0xa13e('0x2f')][_0xa13e('0x33')]));_0x4ce9b9['attributes']=_0x4ce9b9['attributes'][_0xa13e('0x4c')]?_0x4ce9b9[_0xa13e('0x32')]:_0x3c09ba[_0xa13e('0x2e')];if(!_0xd9a51['query']['hasOwnProperty'](_0xa13e('0x35'))){_0x4ce9b9['limit']=qs['limit'](_0xd9a51[_0xa13e('0x2f')]['limit']);_0x4ce9b9['offset']=qs[_0xa13e('0x18')](_0xd9a51[_0xa13e('0x2f')]['offset']);}_0x4ce9b9[_0xa13e('0x36')]=qs['sort'](_0xd9a51['query'][_0xa13e('0x37')]);_0x4ce9b9[_0xa13e('0x3a')]=qs[_0xa13e('0x30')](_[_0xa13e('0x38')](_0xd9a51['query'],_0x3c09ba[_0xa13e('0x30')]));_0x4ce9b9[_0xa13e('0x3a')][_0xa13e('0x56')]=_0x568a91['id'];if(_0xd9a51[_0xa13e('0x2f')]['filter']){_0x4ce9b9[_0xa13e('0x3a')]=_[_0xa13e('0x3b')](_0x4ce9b9[_0xa13e('0x3a')],{'$or':_[_0xa13e('0x29')](_0x4ce9b9[_0xa13e('0x32')],function(_0x3e53ba){var _0x57e8d5={};_0x57e8d5[_0x3e53ba]={'$like':'%'+_0xd9a51['query'][_0xa13e('0x39')]+'%'};return _0x57e8d5;})});}_0x4ce9b9=_[_0xa13e('0x3b')]({},_0x4ce9b9,_0xd9a51[_0xa13e('0x57')]);return db['CmHopperFinal'][_0xa13e('0x1a')]({'where':_0x4ce9b9[_0xa13e('0x3a')]})[_0xa13e('0x20')](function(_0xfa6a95){_0x6acd20[_0xa13e('0x1a')]=_0xfa6a95;if(_0xd9a51['query'][_0xa13e('0x44')]){_0x4ce9b9[_0xa13e('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa13e('0x3f')](_0x4ce9b9);})[_0xa13e('0x20')](function(_0xc034e3){_0x6acd20[_0xa13e('0x40')]=_0xc034e3;return _0x6acd20;});}})[_0xa13e('0x20')](respondWithFilteredResult(_0x5943d1,_0x4ce9b9))['catch'](handleError(_0x5943d1,null));};exports[_0xa13e('0x5c')]=function(_0x26bf7f,_0x3ceef4,_0x111cd3){var _0x2307c4={'raw':!![],'where':{}};var _0x3ac04d={};var _0x487ee8={'count':0x0,'rows':[]};return db[_0xa13e('0x2a')]['findOne']({'where':{'id':_0x26bf7f[_0xa13e('0x4b')]['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0x3ceef4,null))[_0xa13e('0x20')](function(_0x50a662){if(_0x50a662){_0x3ac04d[_0xa13e('0x2e')]=_[_0xa13e('0x43')](db[_0xa13e('0x5d')]['rawAttributes']);_0x3ac04d[_0xa13e('0x2f')]=_[_0xa13e('0x43')](_0x26bf7f[_0xa13e('0x2f')]);_0x3ac04d[_0xa13e('0x30')]=_[_0xa13e('0x31')](_0x3ac04d['model'],_0x3ac04d[_0xa13e('0x2f')]);_0x2307c4[_0xa13e('0x32')]=_['intersection'](_0x3ac04d[_0xa13e('0x2e')],qs[_0xa13e('0x33')](_0x26bf7f[_0xa13e('0x2f')][_0xa13e('0x33')]));_0x2307c4[_0xa13e('0x32')]=_0x2307c4[_0xa13e('0x32')][_0xa13e('0x4c')]?_0x2307c4['attributes']:_0x3ac04d[_0xa13e('0x2e')];if(!_0x26bf7f[_0xa13e('0x2f')][_0xa13e('0x34')](_0xa13e('0x35'))){_0x2307c4['limit']=qs[_0xa13e('0x1b')](_0x26bf7f[_0xa13e('0x2f')][_0xa13e('0x1b')]);_0x2307c4[_0xa13e('0x18')]=qs[_0xa13e('0x18')](_0x26bf7f[_0xa13e('0x2f')][_0xa13e('0x18')]);}_0x2307c4[_0xa13e('0x36')]=qs[_0xa13e('0x37')](_0x26bf7f['query'][_0xa13e('0x37')]);_0x2307c4[_0xa13e('0x3a')]=qs['filters'](_['pick'](_0x26bf7f[_0xa13e('0x2f')],_0x3ac04d['filters']));_0x2307c4[_0xa13e('0x3a')][_0xa13e('0x56')]=_0x50a662['id'];if(_0x26bf7f['query'][_0xa13e('0x39')]){_0x2307c4['where']=_[_0xa13e('0x3b')](_0x2307c4[_0xa13e('0x3a')],{'$or':_['map'](_0x2307c4[_0xa13e('0x32')],function(_0x16214c){var _0x5658a8={};_0x5658a8[_0x16214c]={'$like':'%'+_0x26bf7f['query'][_0xa13e('0x39')]+'%'};return _0x5658a8;})});}_0x2307c4=_['merge']({},_0x2307c4,_0x26bf7f[_0xa13e('0x57')]);return db[_0xa13e('0x5d')]['count']({'where':_0x2307c4[_0xa13e('0x3a')]})[_0xa13e('0x20')](function(_0x24f88f){_0x487ee8[_0xa13e('0x1a')]=_0x24f88f;if(_0x26bf7f[_0xa13e('0x2f')]['includeAll']){_0x2307c4[_0xa13e('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa13e('0x3f')](_0x2307c4);})[_0xa13e('0x20')](function(_0x125452){_0x487ee8['rows']=_0x125452;return _0x487ee8;});}})[_0xa13e('0x20')](respondWithFilteredResult(_0x3ceef4,_0x2307c4))[_0xa13e('0x41')](handleError(_0x3ceef4,null));};exports['getLists']=function(_0x11dc24,_0x4063fe,_0x32b444){var _0x48dad3={};var _0x3ed0f4={};var _0x229cc1;var _0x9dab81;return db[_0xa13e('0x2a')]['findOne']({'where':{'id':_0x11dc24[_0xa13e('0x4b')]['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0x4063fe,null))[_0xa13e('0x20')](function(_0x3a7183){if(_0x3a7183){_0x229cc1=_0x3a7183;_0x3ed0f4[_0xa13e('0x2e')]=_['keys'](db['CmList']['rawAttributes']);_0x3ed0f4[_0xa13e('0x2f')]=_[_0xa13e('0x43')](_0x11dc24[_0xa13e('0x2f')]);_0x3ed0f4[_0xa13e('0x30')]=_[_0xa13e('0x31')](_0x3ed0f4[_0xa13e('0x2e')],_0x3ed0f4[_0xa13e('0x2f')]);_0x48dad3[_0xa13e('0x32')]=_[_0xa13e('0x31')](_0x3ed0f4[_0xa13e('0x2e')],qs[_0xa13e('0x33')](_0x11dc24[_0xa13e('0x2f')][_0xa13e('0x33')]));_0x48dad3['attributes']=_0x48dad3[_0xa13e('0x32')][_0xa13e('0x4c')]?_0x48dad3[_0xa13e('0x32')]:_0x3ed0f4[_0xa13e('0x2e')];_0x48dad3[_0xa13e('0x36')]=qs[_0xa13e('0x37')](_0x11dc24[_0xa13e('0x2f')][_0xa13e('0x37')]);_0x48dad3[_0xa13e('0x3a')]=qs[_0xa13e('0x30')](_[_0xa13e('0x38')](_0x11dc24[_0xa13e('0x2f')],_0x3ed0f4[_0xa13e('0x30')]));if(_0x11dc24[_0xa13e('0x2f')][_0xa13e('0x39')]){_0x48dad3[_0xa13e('0x3a')]=_[_0xa13e('0x3b')](_0x48dad3[_0xa13e('0x3a')],{'$or':_[_0xa13e('0x29')](_0x48dad3[_0xa13e('0x32')],function(_0x530ec0){var _0x2b618a={};_0x2b618a[_0x530ec0]={'$like':'%'+_0x11dc24['query'][_0xa13e('0x39')]+'%'};return _0x2b618a;})});}_0x48dad3=_[_0xa13e('0x3b')]({},_0x48dad3,_0x11dc24['options']);return _0x229cc1[_0xa13e('0x5e')](_0x48dad3);}})['then'](function(_0x1b829a){if(_0x1b829a){_0x9dab81=_0x1b829a[_0xa13e('0x4c')];if(!_0x11dc24['query']['hasOwnProperty']('nolimit')){_0x48dad3['limit']=qs['limit'](_0x11dc24['query']['limit']);_0x48dad3[_0xa13e('0x18')]=qs['offset'](_0x11dc24[_0xa13e('0x2f')][_0xa13e('0x18')]);}return _0x229cc1[_0xa13e('0x5e')](_0x48dad3);}})[_0xa13e('0x20')](function(_0x264326){if(_0x264326){return _0x264326?{'count':_0x9dab81,'rows':_0x264326}:null;}})[_0xa13e('0x20')](respondWithResult(_0x4063fe,null))[_0xa13e('0x41')](handleError(_0x4063fe,null));};exports[_0xa13e('0x5f')]=function(_0x240232,_0x2af916,_0x421c27){var _0x1a30d1,_0x5bfca;var _0x338a00=[];var _0x2a56f9=moment()[_0xa13e('0x60')](_0xa13e('0x61'));return db[_0xa13e('0x2a')]['find']({'where':{'id':_0x240232['params']['id']}})['then'](handleEntityNotFound(_0x2af916,null))[_0xa13e('0x20')](function(_0x3ad70b){if(_0x3ad70b){_0x5bfca=_0x3ad70b;return _0x3ad70b[_0xa13e('0x5f')](_0x240232[_0xa13e('0x46')][_0xa13e('0x62')],_[_0xa13e('0x4f')](_0x240232['body'],[_0xa13e('0x62'),'id'])||{});}return null;})[_0xa13e('0x63')](function(_0x316ca8){var _0x449106;var _0xf30953;_0x1a30d1=_0x316ca8||[];var _0x1ffea2=[];if(_0x316ca8){for(var _0x20c8b0=0x0;_0x20c8b0<_0x316ca8[_0xa13e('0x4c')];_0x20c8b0+=0x1){var _0x12399c=_0x316ca8[_0x20c8b0]['get']({'plain':!![]});_0x5bfca[_0xa13e('0x64')]=_0x240232['body'][_0xa13e('0x64')]?_0x240232[_0xa13e('0x46')][_0xa13e('0x64')]:_0x5bfca['dialCheckDuplicateType'];switch(_0x5bfca[_0xa13e('0x64')]){case'always':_0x449106=squel[_0xa13e('0x65')]()['into'](_0xa13e('0x66'))[_0xa13e('0x67')]([_0xa13e('0x68'),_0xa13e('0x69'),_0xa13e('0x6a'),'ListId','CampaignId','createdAt',_0xa13e('0x50')],squel[_0xa13e('0x6b')]()[_0xa13e('0x6c')](_0xa13e('0x68'),_0xa13e('0x68'))[_0xa13e('0x6c')](_0xa13e('0x6d'),_0xa13e('0x69'))[_0xa13e('0x6c')]('id',_0xa13e('0x6a'))['field'](_0x12399c[_0xa13e('0x6e')][_0xa13e('0x6f')](),_0xa13e('0x70'))[_0xa13e('0x6c')](_0x240232[_0xa13e('0x4b')]['id'][_0xa13e('0x6f')](),_0xa13e('0x56'))[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27',_0xa13e('0x51'))[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27',_0xa13e('0x50'))['from']('cm_contacts')[_0xa13e('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xa13e('0x71'),_0x12399c[_0xa13e('0x6e')][_0xa13e('0x6f')]())[_0xa13e('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xa13e('0x3a')](_0xa13e('0x72'),squel[_0xa13e('0x6b')]()[_0xa13e('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0xa13e('0x73')](_0xa13e('0x74'))[_0xa13e('0x3a')](_0xa13e('0x75'),_0x240232[_0xa13e('0x4b')]['id'][_0xa13e('0x6f')]()))[_0xa13e('0x3a')](_0xa13e('0x72'),squel['select']()[_0xa13e('0x6c')](_0xa13e('0x76'))[_0xa13e('0x73')](_0xa13e('0x66'))['where'](_0xa13e('0x75'),_0x240232[_0xa13e('0x4b')]['id'][_0xa13e('0x6f')]())))[_0xa13e('0x6f')]();break;case _0xa13e('0x77'):_0x449106=squel[_0xa13e('0x65')]()[_0xa13e('0x78')](_0xa13e('0x66'))['fromQuery']([_0xa13e('0x68'),'scheduledAt',_0xa13e('0x6a'),_0xa13e('0x70'),'CampaignId',_0xa13e('0x51'),_0xa13e('0x50')],squel[_0xa13e('0x6b')]()[_0xa13e('0x6c')](_0xa13e('0x68'),_0xa13e('0x68'))[_0xa13e('0x6c')](_0xa13e('0x6d'),_0xa13e('0x69'))[_0xa13e('0x6c')]('id',_0xa13e('0x6a'))[_0xa13e('0x6c')](_0x12399c[_0xa13e('0x6e')]['toString'](),'ListId')[_0xa13e('0x6c')](_0x240232[_0xa13e('0x4b')]['id'][_0xa13e('0x6f')](),_0xa13e('0x56'))[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27',_0xa13e('0x51'))[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27','updatedAt')[_0xa13e('0x73')]('cm_contacts')[_0xa13e('0x3a')]('deletedAt\x20IS\x20NULL')[_0xa13e('0x3a')](_0xa13e('0x71'),_0x12399c[_0xa13e('0x6e')]['toString']())[_0xa13e('0x3a')](_0xa13e('0x79'))[_0xa13e('0x3a')](_0xa13e('0x72'),squel[_0xa13e('0x6b')]()[_0xa13e('0x6c')]('COALESCE(phone,\x27\x27)')['from'](_0xa13e('0x66'))[_0xa13e('0x3a')](_0xa13e('0x75'),_0x240232['params']['id'][_0xa13e('0x6f')]())))[_0xa13e('0x6f')]();break;default:_0x449106=squel[_0xa13e('0x65')]()[_0xa13e('0x78')](_0xa13e('0x66'))[_0xa13e('0x67')]([_0xa13e('0x68'),_0xa13e('0x69'),_0xa13e('0x6a'),_0xa13e('0x70'),'CampaignId',_0xa13e('0x51'),_0xa13e('0x50')],squel[_0xa13e('0x6b')]()[_0xa13e('0x6c')]('phone',_0xa13e('0x68'))['field'](_0xa13e('0x6d'),_0xa13e('0x69'))['field']('id',_0xa13e('0x6a'))[_0xa13e('0x6c')](_0x12399c['CmListId'][_0xa13e('0x6f')](),_0xa13e('0x70'))[_0xa13e('0x6c')](_0x240232['params']['id'][_0xa13e('0x6f')](),_0xa13e('0x56'))[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27',_0xa13e('0x51'))[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27',_0xa13e('0x50'))[_0xa13e('0x73')](_0xa13e('0x7a'))[_0xa13e('0x3a')](_0xa13e('0x7b'))[_0xa13e('0x3a')](_0xa13e('0x71'),_0x12399c[_0xa13e('0x6e')][_0xa13e('0x6f')]())[_0xa13e('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xa13e('0x6f')]();}_0xf30953=squel[_0xa13e('0x65')]()['into'](_0xa13e('0x7c'))['fromQuery'](['cmHopperId',_0xa13e('0x69'),'phone','OrderBy',_0xa13e('0x51'),'updatedAt'],squel['select']()[_0xa13e('0x6c')](_0xa13e('0x7d'),'id')['field'](_0xa13e('0x6d'),_0xa13e('0x69'))[_0xa13e('0x6c')](_0xa13e('0x7e'),'phone')['field'](_0xa13e('0x7f'),'OrderBy')[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27',_0xa13e('0x51'))[_0xa13e('0x6c')]('\x27'+_0x2a56f9+'\x27',_0xa13e('0x50'))[_0xa13e('0x73')](_0xa13e('0x80'),'ci')[_0xa13e('0x81')](_0xa13e('0x66'),'h',_0xa13e('0x82'))[_0xa13e('0x3a')](_0xa13e('0x83'),_0x12399c[_0xa13e('0x6e')][_0xa13e('0x6f')]())[_0xa13e('0x3a')](_0xa13e('0x84'),_0x240232[_0xa13e('0x4b')]['id'][_0xa13e('0x6f')]())['where'](_0xa13e('0x85'),_0x2a56f9))[_0xa13e('0x6f')]();_0x1ffea2[_0xa13e('0x86')](db[_0xa13e('0x87')][_0xa13e('0x2f')](_0x449106));_0x338a00['push'](db[_0xa13e('0x87')][_0xa13e('0x2f')](_0xf30953));}return BPromise['all'](_0x1ffea2);}})[_0xa13e('0x20')](function(){return BPromise['all'](_0x338a00);})[_0xa13e('0x20')](function(){return _0x1a30d1;})[_0xa13e('0x20')](respondWithResult(_0x2af916,null))[_0xa13e('0x41')](handleError(_0x2af916,null));};exports['removeLists']=function(_0x48b5a6,_0x2680bc,_0x4db4ab){return db[_0xa13e('0x2a')][_0xa13e('0x4d')]({'where':{'id':_0x48b5a6['params']['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0x2680bc,null))[_0xa13e('0x20')](function(_0x82421e){if(_0x82421e){return _0x82421e[_0xa13e('0x88')](_0x48b5a6['query'][_0xa13e('0x62')]);}})['then'](function(_0x4b8291){if(_0x4b8291){return db[_0xa13e('0x58')][_0xa13e('0x23')]({'where':{'ListId':_0x48b5a6[_0xa13e('0x2f')][_0xa13e('0x62')],'CampaignId':_0x48b5a6[_0xa13e('0x4b')]['id']}})[_0xa13e('0x20')](function(){return _0x4b8291;});}})['then'](respondWithStatusCode(_0x2680bc,null))[_0xa13e('0x41')](handleError(_0x2680bc,null));};exports[_0xa13e('0x89')]=function(_0x9ef5ef,_0x3ace49,_0x3c27cf){var _0x3d37d4={};var _0x56fcb9={};var _0x1235d2;var _0x3aa30d;return db['Campaign'][_0xa13e('0x8a')]({'where':{'id':_0x9ef5ef[_0xa13e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ace49,null))['then'](function(_0x531f45){if(_0x531f45){_0x1235d2=_0x531f45;_0x56fcb9[_0xa13e('0x2e')]=_[_0xa13e('0x43')](db[_0xa13e('0x8b')][_0xa13e('0x2b')]);_0x56fcb9[_0xa13e('0x2f')]=_[_0xa13e('0x43')](_0x9ef5ef[_0xa13e('0x2f')]);_0x56fcb9[_0xa13e('0x30')]=_[_0xa13e('0x31')](_0x56fcb9['model'],_0x56fcb9[_0xa13e('0x2f')]);_0x3d37d4[_0xa13e('0x32')]=_[_0xa13e('0x31')](_0x56fcb9['model'],qs['fields'](_0x9ef5ef[_0xa13e('0x2f')]['fields']));_0x3d37d4[_0xa13e('0x32')]=_0x3d37d4[_0xa13e('0x32')]['length']?_0x3d37d4[_0xa13e('0x32')]:_0x56fcb9[_0xa13e('0x2e')];_0x3d37d4[_0xa13e('0x36')]=qs[_0xa13e('0x37')](_0x9ef5ef['query'][_0xa13e('0x37')]);_0x3d37d4[_0xa13e('0x3a')]=qs['filters'](_['pick'](_0x9ef5ef[_0xa13e('0x2f')],_0x56fcb9[_0xa13e('0x30')]));if(_0x9ef5ef[_0xa13e('0x2f')]['filter']){_0x3d37d4[_0xa13e('0x3a')]=_[_0xa13e('0x3b')](_0x3d37d4[_0xa13e('0x3a')],{'$or':_[_0xa13e('0x29')](_0x3d37d4[_0xa13e('0x32')],function(_0x175c3d){var _0x4c0ce2={};_0x4c0ce2[_0x175c3d]={'$like':'%'+_0x9ef5ef[_0xa13e('0x2f')][_0xa13e('0x39')]+'%'};return _0x4c0ce2;})});}_0x3d37d4=_['merge']({},_0x3d37d4,_0x9ef5ef[_0xa13e('0x57')]);return _0x1235d2[_0xa13e('0x89')](_0x3d37d4);}})[_0xa13e('0x20')](function(_0x20888d){if(_0x20888d){_0x3aa30d=_0x20888d[_0xa13e('0x4c')];if(!_0x9ef5ef[_0xa13e('0x2f')][_0xa13e('0x34')](_0xa13e('0x35'))){_0x3d37d4[_0xa13e('0x1b')]=qs[_0xa13e('0x1b')](_0x9ef5ef[_0xa13e('0x2f')][_0xa13e('0x1b')]);_0x3d37d4[_0xa13e('0x18')]=qs[_0xa13e('0x18')](_0x9ef5ef[_0xa13e('0x2f')][_0xa13e('0x18')]);}return _0x1235d2['getBlackLists'](_0x3d37d4);}})[_0xa13e('0x20')](function(_0x2d67e5){if(_0x2d67e5){return _0x2d67e5?{'count':_0x3aa30d,'rows':_0x2d67e5}:null;}})['then'](respondWithResult(_0x3ace49,null))['catch'](handleError(_0x3ace49,null));};exports[_0xa13e('0x8c')]=function(_0x39de9d,_0xad3cd9,_0x18997c){var _0x568103,_0x53ed1a;var _0x1e7974=[];var _0x2055f2=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa13e('0x2a')][_0xa13e('0x4d')]({'where':{'id':_0x39de9d['params']['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0xad3cd9,null))[_0xa13e('0x20')](function(_0x144081){if(_0x144081){_0x53ed1a=_0x144081;return _0x144081[_0xa13e('0x8c')](_0x39de9d[_0xa13e('0x46')]['ids'],_[_0xa13e('0x4f')](_0x39de9d[_0xa13e('0x46')],[_0xa13e('0x62'),'id'])||{});}return null;})['spread'](function(_0x36c380){var _0x39f19e;var _0x5a137c;_0x568103=_0x36c380||[];var _0x7e2407=[];if(_0x36c380){for(var _0x22cf3f=0x0;_0x22cf3f<_0x36c380[_0xa13e('0x4c')];_0x22cf3f+=0x1){var _0x1a9d0b=_0x36c380[_0x22cf3f]['get']({'plain':!![]});_0x39f19e=squel['insert']()[_0xa13e('0x78')](_0xa13e('0x8d'))[_0xa13e('0x67')]([_0xa13e('0x68'),'ContactId',_0xa13e('0x70'),_0xa13e('0x56'),'createdAt','updatedAt'],squel[_0xa13e('0x6b')]()['field']('phone',_0xa13e('0x68'))['field']('id',_0xa13e('0x6a'))[_0xa13e('0x6c')](_0x1a9d0b[_0xa13e('0x6e')][_0xa13e('0x6f')](),_0xa13e('0x70'))[_0xa13e('0x6c')](_0x39de9d[_0xa13e('0x4b')]['id']['toString'](),'CampaignId')['field']('NOW()',_0xa13e('0x51'))['field'](_0xa13e('0x6d'),'updatedAt')[_0xa13e('0x73')](_0xa13e('0x7a'))[_0xa13e('0x3a')](_0xa13e('0x7b'))['where'](_0xa13e('0x71'),_0x1a9d0b[_0xa13e('0x6e')][_0xa13e('0x6f')]())['where'](_0xa13e('0x79')))[_0xa13e('0x6f')]();_0x7e2407[_0xa13e('0x86')](db[_0xa13e('0x87')][_0xa13e('0x2f')](_0x39f19e));}return BPromise[_0xa13e('0x8e')](_0x7e2407);}})['then'](function(){return _0x568103;})[_0xa13e('0x20')](respondWithResult(_0xad3cd9,null))['catch'](handleError(_0xad3cd9,null));};exports['removeBlackLists']=function(_0x1ccf44,_0xc645c2,_0x144e3b){return db['Campaign']['find']({'where':{'id':_0x1ccf44[_0xa13e('0x4b')]['id']}})[_0xa13e('0x20')](handleEntityNotFound(_0xc645c2,null))[_0xa13e('0x20')](function(_0x1ca7f3){if(_0x1ca7f3){return _0x1ca7f3[_0xa13e('0x8f')](_0x1ccf44['query']['ids']);}})['then'](function(_0x122a71){if(_0x122a71){return db[_0xa13e('0x5d')][_0xa13e('0x23')]({'where':{'ListId':_0x1ccf44[_0xa13e('0x2f')]['ids'],'CampaignId':_0x1ccf44[_0xa13e('0x4b')]['id']}})[_0xa13e('0x20')](function(){return _0x122a71;});}})['then'](respondWithStatusCode(_0xc645c2,null))[_0xa13e('0x41')](handleError(_0xc645c2,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index db96bf1..07d038b 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(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4c2a8c,_0x1df943){var _0x5d734f=function(_0x1c44f5){while(--_0x1c44f5){_0x4c2a8c['push'](_0x4c2a8c['shift']());}};_0x5d734f(++_0x1df943);}(_0x7a54,0x106));var _0x47a5=function(_0x4f9ca5,_0x42a802){_0x4f9ca5=_0x4f9ca5-0x0;var _0x4e0c9c=_0x7a54[_0x4f9ca5];return _0x4e0c9c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index a1903e7..fc62beb 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 _0x3eec=['debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','Campaign,\x20%s,\x20%s','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x22e2f1,_0xae1e65){var _0x495d2d=function(_0x3e1f5){while(--_0x3e1f5){_0x22e2f1['push'](_0x22e2f1['shift']());}};_0x495d2d(++_0xae1e65);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x12b5fa,_0x563c6c){_0x12b5fa=_0x12b5fa-0x0;var _0x1cef10=_0x3eec[_0x12b5fa];return _0x1cef10;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('Campaign,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('Campaign,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')]({'raw':_0x219db0[_0xc3ee('0x1b')]?_0x219db0[_0xc3ee('0x1b')][_0xc3ee('0x1c')]===undefined?!![]:![]:!![],'where':_0x219db0[_0xc3ee('0x1b')]?_0x219db0[_0xc3ee('0x1b')][_0xc3ee('0x1d')]||null:null,'attributes':_0x219db0[_0xc3ee('0x1b')]?_0x219db0[_0xc3ee('0x1b')][_0xc3ee('0x1e')]||null:null,'limit':_0x219db0[_0xc3ee('0x1b')]?_0x219db0[_0xc3ee('0x1b')][_0xc3ee('0x1f')]||null:null,'include':_0x219db0['options']?_0x219db0['options'][_0xc3ee('0x20')]?_[_0xc3ee('0x21')](_0x219db0[_0xc3ee('0x1b')][_0xc3ee('0x20')],function(_0x28bfeb){return{'model':db[_0x28bfeb[_0xc3ee('0x22')]],'as':_0x28bfeb['as'],'attributes':_0x28bfeb['attributes'],'include':_0x28bfeb[_0xc3ee('0x20')]?_[_0xc3ee('0x21')](_0x28bfeb[_0xc3ee('0x20')],function(_0xfd03bd){return{'model':db[_0xfd03bd[_0xc3ee('0x22')]],'as':_0xfd03bd['as'],'attributes':_0xfd03bd['attributes'],'include':_0xfd03bd['include']?_[_0xc3ee('0x21')](_0xfd03bd[_0xc3ee('0x20')],function(_0x3d8c79){return{'model':db[_0x3d8c79[_0xc3ee('0x22')]],'as':_0x3d8c79['as'],'attributes':_0x3d8c79[_0xc3ee('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56201a){logger['info'](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x23')](_0x56201a));_0x3acb0c(_0x56201a);})[_0xc3ee('0x17')](function(_0x50ffaa){logger[_0xc3ee('0x11')](_0xc3ee('0x18'),_0x50ffaa[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x50ffaa[_0xc3ee('0x13')]));});});};
\ No newline at end of file
+var _0x47d6=['error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48b355,_0x2dc37d){var _0x124e15=function(_0x4efdf5){while(--_0x4efdf5){_0x48b355['push'](_0x48b355['shift']());}};_0x124e15(++_0x2dc37d);}(_0x47d6,0x1de));var _0x647d=function(_0x41a502,_0x1adab8){_0x41a502=_0x41a502-0x0;var _0x4c5136=_0x47d6[_0x41a502];return _0x4c5136;};'use strict';var _=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var moment=require(_0x647d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x647d('0x3'));var db=require(_0x647d('0x4'))['db'];var utils=require(_0x647d('0x5'));var logger=require('../../config/logger')(_0x647d('0x6'));var config=require(_0x647d('0x7'));var jayson=require(_0x647d('0x8'));var client=jayson['client'][_0x647d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a77b3,_0xeab7f7,_0xe5937){return new BPromise(function(_0x2a9508,_0x11a337){return client[_0x647d('0xa')](_0x2a77b3,_0xe5937)[_0x647d('0xb')](function(_0x3ed97f){logger[_0x647d('0xc')](_0x647d('0xd'),_0xeab7f7,_0x647d('0xe'));logger['debug'](_0x647d('0xf'),_0xeab7f7,_0x647d('0xe'),JSON[_0x647d('0x10')](_0x3ed97f));if(_0x3ed97f[_0x647d('0x11')]){if(_0x3ed97f[_0x647d('0x11')][_0x647d('0x12')]===0x1f4){logger[_0x647d('0x11')](_0x647d('0xd'),_0xeab7f7,_0x3ed97f[_0x647d('0x11')][_0x647d('0x13')]);return _0x11a337(_0x3ed97f[_0x647d('0x11')][_0x647d('0x13')]);}logger[_0x647d('0x11')]('Campaign,\x20%s,\x20%s',_0xeab7f7,_0x3ed97f[_0x647d('0x11')][_0x647d('0x13')]);return _0x2a9508(_0x3ed97f[_0x647d('0x11')]['message']);}else{logger[_0x647d('0xc')]('Campaign,\x20%s,\x20%s',_0xeab7f7,_0x647d('0xe'));_0x2a9508(_0x3ed97f['result'][_0x647d('0x13')]);}})[_0x647d('0x14')](function(_0x598186){logger[_0x647d('0x11')]('Campaign,\x20%s,\x20%s',_0xeab7f7,_0x598186);_0x11a337(_0x598186);});});}exports[_0x647d('0x15')]=function(_0x30a107){var _0x15aa16=this;return new Promise(function(_0x407788,_0x2123d1){return db[_0x647d('0x16')][_0x647d('0x17')]({'raw':_0x30a107[_0x647d('0x18')]?_0x30a107[_0x647d('0x18')][_0x647d('0x19')]===undefined?!![]:![]:!![],'where':_0x30a107[_0x647d('0x18')]?_0x30a107[_0x647d('0x18')][_0x647d('0x1a')]||null:null,'attributes':_0x30a107[_0x647d('0x18')]?_0x30a107[_0x647d('0x18')][_0x647d('0x1b')]||null:null,'limit':_0x30a107[_0x647d('0x18')]?_0x30a107[_0x647d('0x18')][_0x647d('0x1c')]||null:null,'include':_0x30a107['options']?_0x30a107[_0x647d('0x18')][_0x647d('0x1d')]?_['map'](_0x30a107[_0x647d('0x18')][_0x647d('0x1d')],function(_0x1f4c09){return{'model':db[_0x1f4c09[_0x647d('0x1e')]],'as':_0x1f4c09['as'],'attributes':_0x1f4c09['attributes'],'include':_0x1f4c09[_0x647d('0x1d')]?_[_0x647d('0x1f')](_0x1f4c09[_0x647d('0x1d')],function(_0x2a974c){return{'model':db[_0x2a974c[_0x647d('0x1e')]],'as':_0x2a974c['as'],'attributes':_0x2a974c['attributes'],'include':_0x2a974c[_0x647d('0x1d')]?_[_0x647d('0x1f')](_0x2a974c[_0x647d('0x1d')],function(_0x4499b2){return{'model':db[_0x4499b2[_0x647d('0x1e')]],'as':_0x4499b2['as'],'attributes':_0x4499b2[_0x647d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x647d('0xb')](function(_0x26086e){logger['info']('GetCampaign',_0x30a107);logger[_0x647d('0x20')](_0x647d('0x15'),_0x30a107,JSON[_0x647d('0x10')](_0x26086e));_0x407788(_0x26086e);})[_0x647d('0x14')](function(_0xefdb81){logger[_0x647d('0x11')](_0x647d('0x15'),_0xefdb81[_0x647d('0x13')],_0x30a107);_0x2123d1(_0x15aa16[_0x647d('0x11')](0x1f4,_0xefdb81[_0x647d('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index a6894af..38abf63 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 _0xa47e=['getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','removeLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0xa47e,0x9a));var _0xea47=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa47e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xea47('0x0'));var util=require(_0xea47('0x1'));var path=require('path');var timeout=require(_0xea47('0x2'));var express=require(_0xea47('0x3'));var router=express[_0xea47('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea47('0x5'));var interaction=require(_0xea47('0x6'));var config=require(_0xea47('0x7'));var controller=require(_0xea47('0x8'));router['get']('/',auth[_0xea47('0x9')](),controller[_0xea47('0xa')]);router['get'](_0xea47('0xb'),auth[_0xea47('0x9')](),controller[_0xea47('0xc')]);router[_0xea47('0xd')]('/:id/hoppers',auth[_0xea47('0x9')](),controller[_0xea47('0xe')]);router[_0xea47('0xd')](_0xea47('0xf'),auth['isAuthenticated'](),controller[_0xea47('0x10')]);router['get'](_0xea47('0x11'),auth['isAuthenticated'](),controller[_0xea47('0x12')]);router[_0xea47('0xd')](_0xea47('0x13'),auth[_0xea47('0x9')](),controller['getHopperBlacks']);router[_0xea47('0xd')](_0xea47('0x14'),auth['isAuthenticated'](),controller[_0xea47('0x15')]);router['get'](_0xea47('0x16'),auth[_0xea47('0x9')](),controller[_0xea47('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea47('0x18')]);router[_0xea47('0x19')](_0xea47('0x1a'),auth[_0xea47('0x9')](),controller[_0xea47('0x1b')]);router[_0xea47('0x19')](_0xea47('0x14'),auth[_0xea47('0x9')](),controller[_0xea47('0x1c')]);router[_0xea47('0x19')]('/:id/blacklists',auth[_0xea47('0x9')](),controller[_0xea47('0x1d')]);router[_0xea47('0x1e')]('/:id',auth[_0xea47('0x9')](),controller[_0xea47('0x1f')]);router[_0xea47('0x20')](_0xea47('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xea47('0x20')](_0xea47('0x14'),auth[_0xea47('0x9')](),controller[_0xea47('0x21')]);router['delete'](_0xea47('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xea47('0x22')]=router;
\ No newline at end of file
+var _0x826a=['/:id/blacklists','create','clone','post','addLists','put','destroy','delete','removeLists','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists'];(function(_0x38c4ca,_0x56fa50){var _0x3b30be=function(_0x203bb1){while(--_0x203bb1){_0x38c4ca['push'](_0x38c4ca['shift']());}};_0x3b30be(++_0x56fa50);}(_0x826a,0x1aa));var _0xa826=function(_0x4b255b,_0x4615ef){_0x4b255b=_0x4b255b-0x0;var _0x4d7392=_0x826a[_0x4b255b];return _0x4d7392;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0x7')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);router['get'](_0xa826('0x10'),auth['isAuthenticated'](),controller[_0xa826('0x11')]);router[_0xa826('0x7')](_0xa826('0x12'),auth[_0xa826('0x8')](),controller[_0xa826('0x13')]);router[_0xa826('0x7')](_0xa826('0x14'),auth['isAuthenticated'](),controller[_0xa826('0x15')]);router['get'](_0xa826('0x16'),auth[_0xa826('0x8')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0xa826('0x17')]);router['post']('/:id/clone',auth[_0xa826('0x8')](),controller[_0xa826('0x18')]);router[_0xa826('0x19')]('/:id/lists',auth[_0xa826('0x8')](),controller[_0xa826('0x1a')]);router[_0xa826('0x19')](_0xa826('0x16'),auth[_0xa826('0x8')](),controller['addBlackLists']);router[_0xa826('0x1b')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller['update']);router['delete'](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0x1c')]);router[_0xa826('0x1d')](_0xa826('0x14'),auth['isAuthenticated'](),controller[_0xa826('0x1e')]);router[_0xa826('0x1d')](_0xa826('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xa826('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6311d4a..5d02ead 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 _0x835e=['TEXT','getDataValue','key','sequelize','exports'];(function(_0x244653,_0xc5c030){var _0xa3776c=function(_0x69a3a4){while(--_0x69a3a4){_0x244653['push'](_0x244653['shift']());}};_0xa3776c(++_0xc5c030);}(_0x835e,0x71));var _0xe835=function(_0x55034f,_0x8b08a6){_0x55034f=_0x55034f-0x0;var _0x124a13=_0x835e[_0x55034f];return _0x124a13;};'use strict';var Sequelize=require(_0xe835('0x0'));module[_0xe835('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xe835('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe835('0x3')](_0xe835('0x4'));}}};
\ No newline at end of file
+var _0x6d3c=['getDataValue','key','sequelize','exports','TEXT','STRING'];(function(_0x586e4e,_0x48d0bd){var _0xbe54fa=function(_0x538c1b){while(--_0x538c1b){_0x586e4e['push'](_0x586e4e['shift']());}};_0xbe54fa(++_0x48d0bd);}(_0x6d3c,0x176));var _0xc6d3=function(_0x26a09a,_0x335c58){_0x26a09a=_0x26a09a-0x0;var _0x2ec847=_0x6d3c[_0x26a09a];return _0x2ec847;};'use strict';var Sequelize=require(_0xc6d3('0x0'));module[_0xc6d3('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xc6d3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc6d3('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc6d3('0x4')](_0xc6d3('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 3ea57a0..5ed1281 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 _0xfbbb=['destroy','then','get','UserProfileResource','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x5c0967,_0x1412b6){var _0x3403ac=function(_0x20e400){while(--_0x20e400){_0x5c0967['push'](_0x5c0967['shift']());}};_0x3403ac(++_0x1412b6);}(_0xfbbb,0x147));var _0xbfbb=function(_0x52e4fc,_0x42843f){_0x52e4fc=_0x52e4fc-0x0;var _0x1816fe=_0xfbbb[_0x52e4fc];return _0x1816fe;};'use strict';var emlformat=require(_0xbfbb('0x0'));var rimraf=require(_0xbfbb('0x1'));var zipdir=require(_0xbfbb('0x2'));var jsonpatch=require(_0xbfbb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbfbb('0x4'));var Mustache=require('mustache');var util=require(_0xbfbb('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfbb('0x6'));var _=require(_0xbfbb('0x7'));var squel=require(_0xbfbb('0x8'));var crypto=require(_0xbfbb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbfbb('0xa'));var toCsv=require(_0xbfbb('0xb'));var querystring=require(_0xbfbb('0xc'));var Papa=require(_0xbfbb('0xd'));var Redis=require('ioredis');var authService=require(_0xbfbb('0xe'));var qs=require(_0xbfbb('0xf'));var as=require(_0xbfbb('0x10'));var hardwareService=require(_0xbfbb('0x11'));var logger=require(_0xbfbb('0x12'))(_0xbfbb('0x13'));var utils=require(_0xbfbb('0x14'));var config=require(_0xbfbb('0x15'));var licenseUtil=require(_0xbfbb('0x16'));var db=require(_0xbfbb('0x17'))['db'];function respondWithStatusCode(_0x5e848b,_0x5829b6){_0x5829b6=_0x5829b6||0xcc;return function(_0x1f39c4){if(_0x1f39c4){return _0x5e848b[_0xbfbb('0x18')](_0x5829b6);}return _0x5e848b[_0xbfbb('0x19')](_0x5829b6)[_0xbfbb('0x1a')]();};}function respondWithResult(_0x4f775e,_0x449007){_0x449007=_0x449007||0xc8;return function(_0xa7e8cb){if(_0xa7e8cb){return _0x4f775e['status'](_0x449007)['json'](_0xa7e8cb);}};}function respondWithFilteredResult(_0x4d81d3,_0x403ed8){return function(_0x3d8061){if(_0x3d8061){var _0x3e6510=typeof _0x403ed8[_0xbfbb('0x1b')]===_0xbfbb('0x1c')&&typeof _0x403ed8['limit']===_0xbfbb('0x1c');var _0x33ba70=_0x3d8061['count'];var _0x1f03b1=_0x3e6510?0x0:_0x403ed8[_0xbfbb('0x1b')];var _0x56139b=_0x3e6510?_0x3d8061[_0xbfbb('0x1d')]:_0x403ed8[_0xbfbb('0x1b')]+_0x403ed8[_0xbfbb('0x1e')];var _0x468bdf;if(_0x56139b>=_0x33ba70){_0x56139b=_0x33ba70;_0x468bdf=0xc8;}else{_0x468bdf=0xce;}_0x4d81d3[_0xbfbb('0x19')](_0x468bdf);return _0x4d81d3[_0xbfbb('0x1f')](_0xbfbb('0x20'),_0x1f03b1+'-'+_0x56139b+'/'+_0x33ba70)['json'](_0x3d8061);}return null;};}function patchUpdates(_0x50e766){return function(_0x3328fb){try{jsonpatch[_0xbfbb('0x21')](_0x3328fb,_0x50e766,!![]);}catch(_0x53ccc7){return BPromise[_0xbfbb('0x22')](_0x53ccc7);}return _0x3328fb[_0xbfbb('0x23')]();};}function saveUpdates(_0x2ab8f8,_0x1d1d80){return function(_0x458ec1){if(_0x458ec1){return _0x458ec1[_0xbfbb('0x24')](_0x2ab8f8)['then'](function(_0x580026){return _0x580026;});}return null;};}function removeEntity(_0x5af9bd,_0xa6d85e){return function(_0x6613eb){if(_0x6613eb){return _0x6613eb[_0xbfbb('0x25')]()[_0xbfbb('0x26')](function(){var _0x2e89f9=_0x6613eb[_0xbfbb('0x27')]({'plain':!![]});var _0x54877b='CannedAnswers';return db[_0xbfbb('0x28')][_0xbfbb('0x25')]({'where':{'type':_0x54877b,'resourceId':_0x2e89f9['id']}})[_0xbfbb('0x26')](function(){return _0x6613eb;});})[_0xbfbb('0x26')](function(){_0x5af9bd[_0xbfbb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46b269,_0x31a74c){return function(_0x2394f7){if(!_0x2394f7){_0x46b269['sendStatus'](0x194);}return _0x2394f7;};}function handleError(_0x421f1f,_0x2a43bf){_0x2a43bf=_0x2a43bf||0x1f4;return function(_0x545140){logger[_0xbfbb('0x29')](_0x545140[_0xbfbb('0x2a')]);if(_0x545140[_0xbfbb('0x2b')]){delete _0x545140[_0xbfbb('0x2b')];}_0x421f1f[_0xbfbb('0x19')](_0x2a43bf)[_0xbfbb('0x2c')](_0x545140);};}exports['index']=function(_0x345bf8,_0x4a6c8a){var _0x344b73={},_0x3304a0={},_0x1c4c16={'count':0x0,'rows':[]};var _0x22f90c=_[_0xbfbb('0x2d')](db[_0xbfbb('0x2e')][_0xbfbb('0x2f')],function(_0x267c1c){return{'name':_0x267c1c[_0xbfbb('0x30')],'type':_0x267c1c[_0xbfbb('0x31')]['key']};});_0x3304a0[_0xbfbb('0x32')]=_[_0xbfbb('0x2d')](_0x22f90c,'name');_0x3304a0[_0xbfbb('0x33')]=_[_0xbfbb('0x34')](_0x345bf8[_0xbfbb('0x33')]);_0x3304a0[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x3304a0[_0xbfbb('0x32')],_0x3304a0[_0xbfbb('0x33')]);_0x344b73[_0xbfbb('0x37')]=_[_0xbfbb('0x36')](_0x3304a0[_0xbfbb('0x32')],qs[_0xbfbb('0x38')](_0x345bf8[_0xbfbb('0x33')][_0xbfbb('0x38')]));_0x344b73['attributes']=_0x344b73[_0xbfbb('0x37')][_0xbfbb('0x39')]?_0x344b73[_0xbfbb('0x37')]:_0x3304a0['model'];if(!_0x345bf8['query'][_0xbfbb('0x3a')](_0xbfbb('0x3b'))){_0x344b73[_0xbfbb('0x1e')]=qs[_0xbfbb('0x1e')](_0x345bf8[_0xbfbb('0x33')][_0xbfbb('0x1e')]);_0x344b73[_0xbfbb('0x1b')]=qs[_0xbfbb('0x1b')](_0x345bf8[_0xbfbb('0x33')][_0xbfbb('0x1b')]);}_0x344b73['order']=qs[_0xbfbb('0x3c')](_0x345bf8['query']['sort']);_0x344b73[_0xbfbb('0x3d')]=qs[_0xbfbb('0x35')](_[_0xbfbb('0x3e')](_0x345bf8[_0xbfbb('0x33')],_0x3304a0[_0xbfbb('0x35')]),_0x22f90c);if(_0x345bf8[_0xbfbb('0x33')][_0xbfbb('0x3f')]){_0x344b73[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x344b73[_0xbfbb('0x3d')],{'$or':[{'key':{'$like':'%'+_0x345bf8[_0xbfbb('0x33')][_0xbfbb('0x3f')]+'%'}},{'value':{'$like':'%'+_0x345bf8[_0xbfbb('0x33')][_0xbfbb('0x3f')]+'%'}}]});}_0x344b73=_['merge']({},_0x344b73,_0x345bf8['options']);var _0x496127={'where':_0x344b73[_0xbfbb('0x3d')]};return db[_0xbfbb('0x2e')][_0xbfbb('0x1d')](_0x496127)['then'](function(_0x5594a7){_0x1c4c16['count']=_0x5594a7;if(_0x345bf8[_0xbfbb('0x33')][_0xbfbb('0x41')]){_0x344b73[_0xbfbb('0x42')]=[{'all':!![]}];}return db[_0xbfbb('0x2e')][_0xbfbb('0x43')](_0x344b73);})[_0xbfbb('0x26')](function(_0x541f46){_0x1c4c16[_0xbfbb('0x44')]=_0x541f46;return _0x1c4c16;})[_0xbfbb('0x26')](respondWithFilteredResult(_0x4a6c8a,_0x344b73))[_0xbfbb('0x45')](handleError(_0x4a6c8a,null));};exports[_0xbfbb('0x46')]=function(_0x2bbf6a,_0x2bdf1f){var _0x54aa77={'raw':!![],'where':{'id':_0x2bbf6a[_0xbfbb('0x47')]['id']}},_0x51544e={};_0x51544e[_0xbfbb('0x32')]=_[_0xbfbb('0x34')](db[_0xbfbb('0x2e')][_0xbfbb('0x2f')]);_0x51544e[_0xbfbb('0x33')]=_[_0xbfbb('0x34')](_0x2bbf6a[_0xbfbb('0x33')]);_0x51544e[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x51544e[_0xbfbb('0x32')],_0x51544e[_0xbfbb('0x33')]);_0x54aa77[_0xbfbb('0x37')]=_['intersection'](_0x51544e[_0xbfbb('0x32')],qs[_0xbfbb('0x38')](_0x2bbf6a[_0xbfbb('0x33')][_0xbfbb('0x38')]));_0x54aa77[_0xbfbb('0x37')]=_0x54aa77[_0xbfbb('0x37')][_0xbfbb('0x39')]?_0x54aa77[_0xbfbb('0x37')]:_0x51544e[_0xbfbb('0x32')];if(_0x2bbf6a['query'][_0xbfbb('0x41')]){_0x54aa77[_0xbfbb('0x42')]=[{'all':!![]}];}_0x54aa77=_[_0xbfbb('0x40')]({},_0x54aa77,_0x2bbf6a[_0xbfbb('0x48')]);return db[_0xbfbb('0x2e')][_0xbfbb('0x49')](_0x54aa77)[_0xbfbb('0x26')](handleEntityNotFound(_0x2bdf1f,null))['then'](respondWithResult(_0x2bdf1f,null))[_0xbfbb('0x45')](handleError(_0x2bdf1f,null));};exports[_0xbfbb('0x24')]=function(_0x270248,_0x570ec7){if(_0x270248[_0xbfbb('0x4a')]['id']){delete _0x270248['body']['id'];}return db['CannedAnswer'][_0xbfbb('0x49')]({'where':{'id':_0x270248[_0xbfbb('0x47')]['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x570ec7,null))[_0xbfbb('0x26')](saveUpdates(_0x270248['body'],null))[_0xbfbb('0x26')](respondWithResult(_0x570ec7,null))['catch'](handleError(_0x570ec7,null));};exports[_0xbfbb('0x25')]=function(_0x4617c7,_0x5a1783){return db[_0xbfbb('0x2e')][_0xbfbb('0x49')]({'where':{'id':_0x4617c7['params']['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x5a1783,null))['then'](removeEntity(_0x5a1783,null))[_0xbfbb('0x45')](handleError(_0x5a1783,null));};exports[_0xbfbb('0x4b')]=function(_0x5c3418,_0x54cc21){var _0x32d0cf={'key':_0x5c3418[_0xbfbb('0x4a')][_0xbfbb('0x4c')]};if(_0x5c3418[_0xbfbb('0x4a')][_0xbfbb('0x4d')]){_0x32d0cf[_0xbfbb('0x4d')]=_0x5c3418[_0xbfbb('0x4a')][_0xbfbb('0x4d')];}else if(_0x5c3418[_0xbfbb('0x4a')][_0xbfbb('0x4e')]){_0x32d0cf[_0xbfbb('0x4e')]=_0x5c3418[_0xbfbb('0x4a')]['SmsAccountId'];}else if(_0x5c3418['body']['OpenchannelAccountId']){_0x32d0cf[_0xbfbb('0x4f')]=_0x5c3418[_0xbfbb('0x4a')]['OpenchannelAccountId'];}else if(_0x5c3418[_0xbfbb('0x4a')][_0xbfbb('0x50')]){_0x32d0cf[_0xbfbb('0x50')]=_0x5c3418['body'][_0xbfbb('0x50')];}return db[_0xbfbb('0x2e')][_0xbfbb('0x49')]({'where':_0x32d0cf})[_0xbfbb('0x26')](function(_0x7c85a4){if(_0x7c85a4){throw new db[(_0xbfbb('0x51'))][(_0xbfbb('0x52'))](_0xbfbb('0x53'));}return db[_0xbfbb('0x2e')][_0xbfbb('0x4b')](_0x5c3418[_0xbfbb('0x4a')]);})['then'](function(_0x34e83e){var _0x3f71d1=_0x5c3418[_0xbfbb('0x54')]['get']({'plain':!![]});if(!_0x3f71d1)throw new Error(_0xbfbb('0x55'));if(_0x3f71d1[_0xbfbb('0x56')]===_0xbfbb('0x54')){var _0x470e5f=_0x34e83e[_0xbfbb('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xbfbb('0x49')]({'where':{'name':_0xbfbb('0x57'),'userProfileId':_0x3f71d1[_0xbfbb('0x58')]},'raw':!![]})[_0xbfbb('0x26')](function(_0x2183c2){if(_0x2183c2&&_0x2183c2[_0xbfbb('0x59')]===0x0){return db[_0xbfbb('0x28')][_0xbfbb('0x4b')]({'name':_0x470e5f[_0xbfbb('0x2b')],'resourceId':_0x470e5f['id'],'type':_0x2183c2[_0xbfbb('0x2b')],'sectionId':_0x2183c2['id']},{})[_0xbfbb('0x26')](function(){return _0x34e83e;});}else{return _0x34e83e;}})[_0xbfbb('0x45')](function(_0x2af38a){logger[_0xbfbb('0x29')](_0xbfbb('0x5a'),_0x2af38a);throw _0x2af38a;});}return _0x34e83e;})[_0xbfbb('0x26')](respondWithResult(_0x54cc21,0xc9))[_0xbfbb('0x45')](handleError(_0x54cc21,null));};
\ No newline at end of file
+var _0xf322=['fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','CannedAnswer','findAll','rows','catch','show','include','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','get','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes'];(function(_0x13facd,_0x202f99){var _0x106558=function(_0x37f3ed){while(--_0x37f3ed){_0x13facd['push'](_0x13facd['shift']());}};_0x106558(++_0x202f99);}(_0xf322,0xd3));var _0x2f32=function(_0x4f545a,_0x223855){_0x4f545a=_0x4f545a-0x0;var _0xbe2517=_0xf322[_0x4f545a];return _0xbe2517;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f32('0x0'));var zipdir=require(_0x2f32('0x1'));var jsonpatch=require(_0x2f32('0x2'));var rp=require('request-promise');var moment=require(_0x2f32('0x3'));var BPromise=require(_0x2f32('0x4'));var Mustache=require(_0x2f32('0x5'));var util=require(_0x2f32('0x6'));var path=require('path');var sox=require(_0x2f32('0x7'));var csv=require(_0x2f32('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f32('0x9'));var squel=require('squel');var crypto=require(_0x2f32('0xa'));var jsforce=require(_0x2f32('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2f32('0x8'));var querystring=require(_0x2f32('0xc'));var Papa=require(_0x2f32('0xd'));var Redis=require(_0x2f32('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2f32('0xf'));var as=require(_0x2f32('0x10'));var hardwareService=require(_0x2f32('0x11'));var logger=require(_0x2f32('0x12'))(_0x2f32('0x13'));var utils=require(_0x2f32('0x14'));var config=require(_0x2f32('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f32('0x16'))['db'];function respondWithStatusCode(_0x18d86c,_0x15576c){_0x15576c=_0x15576c||0xcc;return function(_0x46b22a){if(_0x46b22a){return _0x18d86c['sendStatus'](_0x15576c);}return _0x18d86c[_0x2f32('0x17')](_0x15576c)[_0x2f32('0x18')]();};}function respondWithResult(_0x5438a3,_0x5cd60c){_0x5cd60c=_0x5cd60c||0xc8;return function(_0x56a79c){if(_0x56a79c){return _0x5438a3[_0x2f32('0x17')](_0x5cd60c)[_0x2f32('0x19')](_0x56a79c);}};}function respondWithFilteredResult(_0x1f22df,_0x458a53){return function(_0x2aae03){if(_0x2aae03){var _0x158ad2=typeof _0x458a53[_0x2f32('0x1a')]===_0x2f32('0x1b')&&typeof _0x458a53[_0x2f32('0x1c')]===_0x2f32('0x1b');var _0x4069e4=_0x2aae03[_0x2f32('0x1d')];var _0x27369f=_0x158ad2?0x0:_0x458a53[_0x2f32('0x1a')];var _0x3e165c=_0x158ad2?_0x2aae03[_0x2f32('0x1d')]:_0x458a53[_0x2f32('0x1a')]+_0x458a53[_0x2f32('0x1c')];var _0x3e5c5a;if(_0x3e165c>=_0x4069e4){_0x3e165c=_0x4069e4;_0x3e5c5a=0xc8;}else{_0x3e5c5a=0xce;}_0x1f22df['status'](_0x3e5c5a);return _0x1f22df['set'](_0x2f32('0x1e'),_0x27369f+'-'+_0x3e165c+'/'+_0x4069e4)['json'](_0x2aae03);}return null;};}function patchUpdates(_0x1f85b0){return function(_0x4086b3){try{jsonpatch[_0x2f32('0x1f')](_0x4086b3,_0x1f85b0,!![]);}catch(_0x3cdb5e){return BPromise['reject'](_0x3cdb5e);}return _0x4086b3[_0x2f32('0x20')]();};}function saveUpdates(_0x17ce06,_0x193915){return function(_0x2fae97){if(_0x2fae97){return _0x2fae97['update'](_0x17ce06)[_0x2f32('0x21')](function(_0x14ad2d){return _0x14ad2d;});}return null;};}function removeEntity(_0x4a98cf,_0x32758e){return function(_0x1dd122){if(_0x1dd122){return _0x1dd122['destroy']()[_0x2f32('0x21')](function(){var _0x350197=_0x1dd122[_0x2f32('0x22')]({'plain':!![]});var _0x5169cd='CannedAnswers';return db['UserProfileResource'][_0x2f32('0x23')]({'where':{'type':_0x5169cd,'resourceId':_0x350197['id']}})['then'](function(){return _0x1dd122;});})[_0x2f32('0x21')](function(){_0x4a98cf[_0x2f32('0x17')](0xcc)[_0x2f32('0x18')]();});}};}function handleEntityNotFound(_0x405bd0,_0x4e0ac2){return function(_0x589532){if(!_0x589532){_0x405bd0[_0x2f32('0x24')](0x194);}return _0x589532;};}function handleError(_0x5a0808,_0x104de3){_0x104de3=_0x104de3||0x1f4;return function(_0x4f305c){logger[_0x2f32('0x25')](_0x4f305c[_0x2f32('0x26')]);if(_0x4f305c[_0x2f32('0x27')]){delete _0x4f305c['name'];}_0x5a0808['status'](_0x104de3)[_0x2f32('0x28')](_0x4f305c);};}exports[_0x2f32('0x29')]=function(_0x59fd3b,_0x2bce5b){var _0x3d3c4f={},_0x4718bb={},_0x3aee52={'count':0x0,'rows':[]};var _0x1f4300=_[_0x2f32('0x2a')](db['CannedAnswer'][_0x2f32('0x2b')],function(_0x122c4a){return{'name':_0x122c4a[_0x2f32('0x2c')],'type':_0x122c4a[_0x2f32('0x2d')][_0x2f32('0x2e')]};});_0x4718bb['model']=_[_0x2f32('0x2a')](_0x1f4300,_0x2f32('0x27'));_0x4718bb[_0x2f32('0x2f')]=_[_0x2f32('0x30')](_0x59fd3b[_0x2f32('0x2f')]);_0x4718bb[_0x2f32('0x31')]=_[_0x2f32('0x32')](_0x4718bb[_0x2f32('0x33')],_0x4718bb[_0x2f32('0x2f')]);_0x3d3c4f[_0x2f32('0x34')]=_[_0x2f32('0x32')](_0x4718bb['model'],qs['fields'](_0x59fd3b[_0x2f32('0x2f')][_0x2f32('0x35')]));_0x3d3c4f['attributes']=_0x3d3c4f[_0x2f32('0x34')]['length']?_0x3d3c4f[_0x2f32('0x34')]:_0x4718bb[_0x2f32('0x33')];if(!_0x59fd3b[_0x2f32('0x2f')][_0x2f32('0x36')](_0x2f32('0x37'))){_0x3d3c4f[_0x2f32('0x1c')]=qs[_0x2f32('0x1c')](_0x59fd3b['query'][_0x2f32('0x1c')]);_0x3d3c4f[_0x2f32('0x1a')]=qs['offset'](_0x59fd3b[_0x2f32('0x2f')][_0x2f32('0x1a')]);}_0x3d3c4f[_0x2f32('0x38')]=qs['sort'](_0x59fd3b[_0x2f32('0x2f')]['sort']);_0x3d3c4f[_0x2f32('0x39')]=qs[_0x2f32('0x31')](_[_0x2f32('0x3a')](_0x59fd3b['query'],_0x4718bb[_0x2f32('0x31')]),_0x1f4300);if(_0x59fd3b[_0x2f32('0x2f')][_0x2f32('0x3b')]){_0x3d3c4f[_0x2f32('0x39')]=_[_0x2f32('0x3c')](_0x3d3c4f[_0x2f32('0x39')],{'$or':[{'key':{'$like':'%'+_0x59fd3b[_0x2f32('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0x59fd3b[_0x2f32('0x2f')]['filter']+'%'}}]});}_0x3d3c4f=_[_0x2f32('0x3c')]({},_0x3d3c4f,_0x59fd3b[_0x2f32('0x3d')]);var _0xf1bf55={'where':_0x3d3c4f[_0x2f32('0x39')]};return db['CannedAnswer'][_0x2f32('0x1d')](_0xf1bf55)[_0x2f32('0x21')](function(_0x1264d9){_0x3aee52[_0x2f32('0x1d')]=_0x1264d9;if(_0x59fd3b[_0x2f32('0x2f')][_0x2f32('0x3e')]){_0x3d3c4f['include']=[{'all':!![]}];}return db[_0x2f32('0x3f')][_0x2f32('0x40')](_0x3d3c4f);})[_0x2f32('0x21')](function(_0x15ddd0){_0x3aee52[_0x2f32('0x41')]=_0x15ddd0;return _0x3aee52;})[_0x2f32('0x21')](respondWithFilteredResult(_0x2bce5b,_0x3d3c4f))[_0x2f32('0x42')](handleError(_0x2bce5b,null));};exports[_0x2f32('0x43')]=function(_0x338170,_0x9b2575){var _0x201fef={'raw':!![],'where':{'id':_0x338170['params']['id']}},_0x58a6b6={};_0x58a6b6[_0x2f32('0x33')]=_[_0x2f32('0x30')](db[_0x2f32('0x3f')][_0x2f32('0x2b')]);_0x58a6b6['query']=_['keys'](_0x338170[_0x2f32('0x2f')]);_0x58a6b6[_0x2f32('0x31')]=_[_0x2f32('0x32')](_0x58a6b6[_0x2f32('0x33')],_0x58a6b6[_0x2f32('0x2f')]);_0x201fef[_0x2f32('0x34')]=_[_0x2f32('0x32')](_0x58a6b6[_0x2f32('0x33')],qs[_0x2f32('0x35')](_0x338170[_0x2f32('0x2f')][_0x2f32('0x35')]));_0x201fef[_0x2f32('0x34')]=_0x201fef['attributes']['length']?_0x201fef[_0x2f32('0x34')]:_0x58a6b6[_0x2f32('0x33')];if(_0x338170[_0x2f32('0x2f')][_0x2f32('0x3e')]){_0x201fef[_0x2f32('0x44')]=[{'all':!![]}];}_0x201fef=_[_0x2f32('0x3c')]({},_0x201fef,_0x338170[_0x2f32('0x3d')]);return db[_0x2f32('0x3f')]['find'](_0x201fef)[_0x2f32('0x21')](handleEntityNotFound(_0x9b2575,null))['then'](respondWithResult(_0x9b2575,null))[_0x2f32('0x42')](handleError(_0x9b2575,null));};exports['update']=function(_0x196f06,_0x49c0de){if(_0x196f06['body']['id']){delete _0x196f06[_0x2f32('0x45')]['id'];}return db['CannedAnswer'][_0x2f32('0x46')]({'where':{'id':_0x196f06['params']['id']}})[_0x2f32('0x21')](handleEntityNotFound(_0x49c0de,null))['then'](saveUpdates(_0x196f06[_0x2f32('0x45')],null))['then'](respondWithResult(_0x49c0de,null))[_0x2f32('0x42')](handleError(_0x49c0de,null));};exports['destroy']=function(_0xcea8b3,_0x37ef5e){return db[_0x2f32('0x3f')][_0x2f32('0x46')]({'where':{'id':_0xcea8b3['params']['id']}})[_0x2f32('0x21')](handleEntityNotFound(_0x37ef5e,null))[_0x2f32('0x21')](removeEntity(_0x37ef5e,null))['catch'](handleError(_0x37ef5e,null));};exports[_0x2f32('0x47')]=function(_0x2adefb,_0x2ce987){var _0x1b9348={'key':_0x2adefb[_0x2f32('0x45')][_0x2f32('0x2e')]};if(_0x2adefb['body'][_0x2f32('0x48')]){_0x1b9348[_0x2f32('0x48')]=_0x2adefb['body'][_0x2f32('0x48')];}else if(_0x2adefb[_0x2f32('0x45')]['SmsAccountId']){_0x1b9348[_0x2f32('0x49')]=_0x2adefb[_0x2f32('0x45')][_0x2f32('0x49')];}else if(_0x2adefb[_0x2f32('0x45')]['OpenchannelAccountId']){_0x1b9348[_0x2f32('0x4a')]=_0x2adefb[_0x2f32('0x45')][_0x2f32('0x4a')];}else if(_0x2adefb[_0x2f32('0x45')][_0x2f32('0x4b')]){_0x1b9348['ChatWebsiteId']=_0x2adefb[_0x2f32('0x45')][_0x2f32('0x4b')];}return db[_0x2f32('0x3f')]['find']({'where':_0x1b9348})[_0x2f32('0x21')](function(_0x4738d5){if(_0x4738d5){throw new db[(_0x2f32('0x4c'))][(_0x2f32('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x2f32('0x3f')][_0x2f32('0x47')](_0x2adefb[_0x2f32('0x45')]);})[_0x2f32('0x21')](function(_0x44d1e4){var _0x3768d0=_0x2adefb['user']['get']({'plain':!![]});if(!_0x3768d0)throw new Error(_0x2f32('0x4e'));if(_0x3768d0[_0x2f32('0x4f')]===_0x2f32('0x50')){var _0x5bad29=_0x44d1e4[_0x2f32('0x22')]({'plain':!![]});return db[_0x2f32('0x51')][_0x2f32('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x3768d0[_0x2f32('0x52')]},'raw':!![]})[_0x2f32('0x21')](function(_0x5264fd){if(_0x5264fd&&_0x5264fd[_0x2f32('0x53')]===0x0){return db[_0x2f32('0x54')][_0x2f32('0x47')]({'name':_0x5bad29[_0x2f32('0x27')],'resourceId':_0x5bad29['id'],'type':_0x5264fd[_0x2f32('0x27')],'sectionId':_0x5264fd['id']},{})[_0x2f32('0x21')](function(){return _0x44d1e4;});}else{return _0x44d1e4;}})[_0x2f32('0x42')](function(_0x30c9c7){logger[_0x2f32('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30c9c7);throw _0x30c9c7;});}return _0x44d1e4;})[_0x2f32('0x21')](respondWithResult(_0x2ce987,0xc9))[_0x2f32('0x42')](handleError(_0x2ce987,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index b6ee3c0..18adb4a 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 _0x7f5e=['define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x4b92f7,_0x333277){var _0x2acc58=function(_0x2284d0){while(--_0x2284d0){_0x4b92f7['push'](_0x4b92f7['shift']());}};_0x2acc58(++_0x333277);}(_0x7f5e,0x139));var _0xe7f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f5e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe7f5('0x0'));var util=require(_0xe7f5('0x1'));var logger=require('../../config/logger')(_0xe7f5('0x2'));var moment=require(_0xe7f5('0x3'));var BPromise=require(_0xe7f5('0x4'));var rp=require(_0xe7f5('0x5'));var fs=require('fs');var path=require(_0xe7f5('0x6'));var rimraf=require(_0xe7f5('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xe7f5('0x8')]=function(_0x1a7cca,_0x4645f9){return _0x1a7cca[_0xe7f5('0x9')](_0xe7f5('0xa'),attributes,{'tableName':_0xe7f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe7f5('0xc'),'collate':_0xe7f5('0xd')});};
\ No newline at end of file
+var _0x08b3=['path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a9193,_0x9eeeae){var _0x10aa17=function(_0x3edffe){while(--_0x3edffe){_0x4a9193['push'](_0x4a9193['shift']());}};_0x10aa17(++_0x9eeeae);}(_0x08b3,0xe8));var _0x308b=function(_0xcf76f5,_0x49de1e){_0xcf76f5=_0xcf76f5-0x0;var _0x597348=_0x08b3[_0xcf76f5];return _0x597348;};'use strict';var _=require(_0x308b('0x0'));var util=require('util');var logger=require(_0x308b('0x1'))(_0x308b('0x2'));var moment=require(_0x308b('0x3'));var BPromise=require(_0x308b('0x4'));var rp=require(_0x308b('0x5'));var fs=require('fs');var path=require(_0x308b('0x6'));var rimraf=require('rimraf');var config=require(_0x308b('0x7'));var attributes=require(_0x308b('0x8'));module[_0x308b('0x9')]=function(_0x31ad9c,_0x5c3661){return _0x31ad9c[_0x308b('0xa')](_0x308b('0xb'),attributes,{'tableName':_0x308b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x308b('0xd'),'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 78bf518..6ccb868 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(_0x2eea9e,_0x5709fe){var _0x51413d=function(_0x5d82b5){while(--_0x5d82b5){_0x2eea9e['push'](_0x2eea9e['shift']());}};_0x51413d(++_0x5709fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x4ab6c6,_0x1715c1){var _0x48ac96=function(_0x1e0640){while(--_0x1e0640){_0x4ab6c6['push'](_0x4ab6c6['shift']());}};_0x48ac96(++_0x1715c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 53f8147..4292113 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 _0x0949=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','create','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x208d8a,_0x4d244f){var _0x3fc5ce=function(_0x522473){while(--_0x522473){_0x208d8a['push'](_0x208d8a['shift']());}};_0x3fc5ce(++_0x4d244f);}(_0x0949,0x149));var _0x9094=function(_0x2f9849,_0x209c0e){_0x2f9849=_0x2f9849-0x0;var _0x1aefac=_0x0949[_0x2f9849];return _0x1aefac;};'use strict';var multer=require('multer');var util=require(_0x9094('0x0'));var path=require(_0x9094('0x1'));var timeout=require(_0x9094('0x2'));var express=require(_0x9094('0x3'));var router=express[_0x9094('0x4')]();var fs_extra=require(_0x9094('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9094('0x6'));var config=require(_0x9094('0x7'));var controller=require(_0x9094('0x8'));router[_0x9094('0x9')]('/',auth[_0x9094('0xa')](),controller['index']);router[_0x9094('0x9')](_0x9094('0xb'),auth[_0x9094('0xa')](),controller['show']);router['post']('/',auth[_0x9094('0xa')](),controller[_0x9094('0xc')]);router[_0x9094('0xd')](_0x9094('0xb'),auth[_0x9094('0xa')](),controller['update']);router[_0x9094('0xe')](_0x9094('0xb'),auth[_0x9094('0xa')](),controller['destroy']);module[_0x9094('0xf')]=router;
\ No newline at end of file
+var _0xd572=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','delete','destroy','util','path'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xd572,0x141));var _0x2d57=function(_0x58c099,_0x5c8584){_0x58c099=_0x58c099-0x0;var _0x4b2be0=_0xd572[_0x58c099];return _0x4b2be0;};'use strict';var multer=require('multer');var util=require(_0x2d57('0x0'));var path=require(_0x2d57('0x1'));var timeout=require(_0x2d57('0x2'));var express=require(_0x2d57('0x3'));var router=express[_0x2d57('0x4')]();var fs_extra=require(_0x2d57('0x5'));var auth=require(_0x2d57('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2d57('0x7'));var controller=require(_0x2d57('0x8'));router[_0x2d57('0x9')]('/',auth[_0x2d57('0xa')](),controller[_0x2d57('0xb')]);router['get'](_0x2d57('0xc'),auth['isAuthenticated'](),controller[_0x2d57('0xd')]);router['post']('/',auth[_0x2d57('0xa')](),controller[_0x2d57('0xe')]);router['put'](_0x2d57('0xc'),auth[_0x2d57('0xa')](),controller['update']);router[_0x2d57('0xf')]('/:id',auth[_0x2d57('0xa')](),controller[_0x2d57('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 7c451ac..39ba010 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 _0x79d8=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x590a46,_0x3fe0a4){var _0x12efdc=function(_0x59d14b){while(--_0x59d14b){_0x590a46['push'](_0x590a46['shift']());}};_0x12efdc(++_0x3fe0a4);}(_0x79d8,0x67));var _0x879d=function(_0x3546b4,_0x34e1f5){_0x3546b4=_0x3546b4-0x0;var _0x507bdc=_0x79d8[_0x3546b4];return _0x507bdc;};'use strict';var Sequelize=require(_0x879d('0x0'));module[_0x879d('0x1')]={'calldate':{'type':Sequelize[_0x879d('0x2')],'allowNull':![],'defaultValue':_0x879d('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x879d('0x4')]},'dst':{'type':Sequelize[_0x879d('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x879d('0x4')]},'dstchannel':{'type':Sequelize[_0x879d('0x4')]},'lastapp':{'type':Sequelize[_0x879d('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x879d('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x879d('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x879d('0x4')]},'amaflags':{'type':Sequelize[_0x879d('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x879d('0x4')]},'uniqueid':{'type':Sequelize[_0x879d('0x4')]},'linkedid':{'type':Sequelize[_0x879d('0x4')]},'sequence':{'type':Sequelize[_0x879d('0x4')]},'peeraccount':{'type':Sequelize[_0x879d('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x879d('0x4')]}};
\ No newline at end of file
+var _0xab55=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x5c6671,_0x324809){var _0x12fe6e=function(_0x1d127a){while(--_0x1d127a){_0x5c6671['push'](_0x5c6671['shift']());}};_0x12fe6e(++_0x324809);}(_0xab55,0x139));var _0x5ab5=function(_0x36f0c9,_0x1203ef){_0x36f0c9=_0x36f0c9-0x0;var _0x50a510=_0xab55[_0x36f0c9];return _0x50a510;};'use strict';var Sequelize=require(_0x5ab5('0x0'));module[_0x5ab5('0x1')]={'calldate':{'type':Sequelize[_0x5ab5('0x2')],'allowNull':![],'defaultValue':_0x5ab5('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5ab5('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x5ab5('0x4')]},'channel':{'type':Sequelize[_0x5ab5('0x4')]},'dstchannel':{'type':Sequelize[_0x5ab5('0x4')]},'lastapp':{'type':Sequelize[_0x5ab5('0x4')]},'lastdata':{'type':Sequelize[_0x5ab5('0x4')]},'duration':{'type':Sequelize[_0x5ab5('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5ab5('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5ab5('0x4')]},'amaflags':{'type':Sequelize[_0x5ab5('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5ab5('0x4')]},'userfield':{'type':Sequelize[_0x5ab5('0x4')]},'uniqueid':{'type':Sequelize[_0x5ab5('0x4')]},'linkedid':{'type':Sequelize[_0x5ab5('0x4')]},'sequence':{'type':Sequelize[_0x5ab5('0x4')]},'peeraccount':{'type':Sequelize[_0x5ab5('0x4')]},'type':{'type':Sequelize[_0x5ab5('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 99447ae..a6a81b3 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 _0x3c94=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','Cdr','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x207312,_0x4c7652){var _0x49309d=function(_0x2caf1d){while(--_0x2caf1d){_0x207312['push'](_0x207312['shift']());}};_0x49309d(++_0x4c7652);}(_0x3c94,0xcd));var _0x43c9=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x3c94[_0x2c2980];return _0x2a20a9;};'use strict';var emlformat=require(_0x43c9('0x0'));var rimraf=require(_0x43c9('0x1'));var zipdir=require(_0x43c9('0x2'));var jsonpatch=require(_0x43c9('0x3'));var rp=require(_0x43c9('0x4'));var moment=require(_0x43c9('0x5'));var BPromise=require(_0x43c9('0x6'));var Mustache=require(_0x43c9('0x7'));var util=require(_0x43c9('0x8'));var path=require(_0x43c9('0x9'));var sox=require(_0x43c9('0xa'));var csv=require(_0x43c9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43c9('0xc'));var _=require(_0x43c9('0xd'));var squel=require(_0x43c9('0xe'));var crypto=require(_0x43c9('0xf'));var jsforce=require(_0x43c9('0x10'));var deskjs=require(_0x43c9('0x11'));var toCsv=require(_0x43c9('0xb'));var querystring=require(_0x43c9('0x12'));var Papa=require(_0x43c9('0x13'));var Redis=require('ioredis');var authService=require(_0x43c9('0x14'));var qs=require(_0x43c9('0x15'));var as=require(_0x43c9('0x16'));var hardwareService=require(_0x43c9('0x17'));var logger=require(_0x43c9('0x18'))(_0x43c9('0x19'));var utils=require(_0x43c9('0x1a'));var config=require(_0x43c9('0x1b'));var licenseUtil=require(_0x43c9('0x1c'));var db=require(_0x43c9('0x1d'))['db'];function respondWithStatusCode(_0x62bb3b,_0x31faa1){_0x31faa1=_0x31faa1||0xcc;return function(_0x11fe24){if(_0x11fe24){return _0x62bb3b[_0x43c9('0x1e')](_0x31faa1);}return _0x62bb3b[_0x43c9('0x1f')](_0x31faa1)[_0x43c9('0x20')]();};}function respondWithResult(_0x275b2b,_0x569fa9){_0x569fa9=_0x569fa9||0xc8;return function(_0x37932f){if(_0x37932f){return _0x275b2b[_0x43c9('0x1f')](_0x569fa9)[_0x43c9('0x21')](_0x37932f);}};}function respondWithFilteredResult(_0xe02707,_0x3f908d){return function(_0x5cc1fa){if(_0x5cc1fa){var _0x549d3f=typeof _0x3f908d[_0x43c9('0x22')]===_0x43c9('0x23')&&typeof _0x3f908d[_0x43c9('0x24')]===_0x43c9('0x23');var _0x501856=_0x5cc1fa[_0x43c9('0x25')];var _0x1da149=_0x549d3f?0x0:_0x3f908d[_0x43c9('0x22')];var _0x22bf3d=_0x549d3f?_0x5cc1fa[_0x43c9('0x25')]:_0x3f908d[_0x43c9('0x22')]+_0x3f908d[_0x43c9('0x24')];var _0x1e3996;if(_0x22bf3d>=_0x501856){_0x22bf3d=_0x501856;_0x1e3996=0xc8;}else{_0x1e3996=0xce;}_0xe02707[_0x43c9('0x1f')](_0x1e3996);return _0xe02707[_0x43c9('0x26')](_0x43c9('0x27'),_0x1da149+'-'+_0x22bf3d+'/'+_0x501856)['json'](_0x5cc1fa);}return null;};}function patchUpdates(_0x39c6f1){return function(_0x772b71){try{jsonpatch[_0x43c9('0x28')](_0x772b71,_0x39c6f1,!![]);}catch(_0x4c2d7c){return BPromise[_0x43c9('0x29')](_0x4c2d7c);}return _0x772b71[_0x43c9('0x2a')]();};}function saveUpdates(_0x2ef8d9,_0x5705c6){return function(_0x28290a){if(_0x28290a){return _0x28290a[_0x43c9('0x2b')](_0x2ef8d9)[_0x43c9('0x2c')](function(_0x4d58d7){return _0x4d58d7;});}return null;};}function removeEntity(_0x4963d2,_0x2a40f4){return function(_0x3fd641){if(_0x3fd641){return _0x3fd641[_0x43c9('0x2d')]()['then'](function(){_0x4963d2[_0x43c9('0x1f')](0xcc)[_0x43c9('0x20')]();});}};}function handleEntityNotFound(_0x1e676a,_0x16fee9){return function(_0x2c69af){if(!_0x2c69af){_0x1e676a['sendStatus'](0x194);}return _0x2c69af;};}function handleError(_0x386078,_0x3b5c47){_0x3b5c47=_0x3b5c47||0x1f4;return function(_0x3910af){logger[_0x43c9('0x2e')](_0x3910af[_0x43c9('0x2f')]);if(_0x3910af[_0x43c9('0x30')]){delete _0x3910af[_0x43c9('0x30')];}_0x386078[_0x43c9('0x1f')](_0x3b5c47)[_0x43c9('0x31')](_0x3910af);};}exports[_0x43c9('0x32')]=function(_0x4eb970,_0x11e3c3){var _0x2cbfd7={},_0x15028c={},_0x519e2c={'count':0x0,'rows':[]};var _0x2c0ccc=_[_0x43c9('0x33')](db['Cdr'][_0x43c9('0x34')],function(_0x497719){return{'name':_0x497719[_0x43c9('0x35')],'type':_0x497719[_0x43c9('0x36')][_0x43c9('0x37')]};});_0x15028c[_0x43c9('0x38')]=_['map'](_0x2c0ccc,_0x43c9('0x30'));_0x15028c[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0x4eb970['query']);_0x15028c[_0x43c9('0x3b')]=_['intersection'](_0x15028c[_0x43c9('0x38')],_0x15028c[_0x43c9('0x39')]);_0x2cbfd7[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x15028c['model'],qs[_0x43c9('0x3e')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x2cbfd7[_0x43c9('0x3c')]=_0x2cbfd7['attributes'][_0x43c9('0x3f')]?_0x2cbfd7[_0x43c9('0x3c')]:_0x15028c[_0x43c9('0x38')];if(!_0x4eb970[_0x43c9('0x39')][_0x43c9('0x40')](_0x43c9('0x41'))){_0x2cbfd7[_0x43c9('0x24')]=qs[_0x43c9('0x24')](_0x4eb970['query'][_0x43c9('0x24')]);_0x2cbfd7[_0x43c9('0x22')]=qs[_0x43c9('0x22')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x22')]);}_0x2cbfd7[_0x43c9('0x42')]=qs[_0x43c9('0x43')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x43')]);_0x2cbfd7['where']=qs[_0x43c9('0x3b')](_['pick'](_0x4eb970[_0x43c9('0x39')],_0x15028c[_0x43c9('0x3b')]),_0x2c0ccc);if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]){_0x2cbfd7[_0x43c9('0x45')]=_[_0x43c9('0x46')](_0x2cbfd7[_0x43c9('0x45')],{'$or':_[_0x43c9('0x33')](_0x2c0ccc,function(_0x518bd3){if(_0x518bd3['type']!==_0x43c9('0x47')){var _0x2d63bd={};_0x2d63bd[_0x518bd3['name']]={'$like':'%'+_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]+'%'};return _0x2d63bd;}})});}_0x2cbfd7=_[_0x43c9('0x46')]({},_0x2cbfd7,_0x4eb970['options']);var _0xb01a6e={'where':_0x2cbfd7[_0x43c9('0x45')]};return db[_0x43c9('0x48')][_0x43c9('0x25')](_0xb01a6e)[_0x43c9('0x2c')](function(_0x39601e){_0x519e2c[_0x43c9('0x25')]=_0x39601e;if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x49')]){_0x2cbfd7[_0x43c9('0x4a')]=[{'all':!![]}];}return db[_0x43c9('0x48')][_0x43c9('0x4b')](_0x2cbfd7);})['then'](function(_0x2d5dd5){_0x519e2c[_0x43c9('0x4c')]=_0x2d5dd5;return _0x519e2c;})[_0x43c9('0x2c')](respondWithFilteredResult(_0x11e3c3,_0x2cbfd7))[_0x43c9('0x4d')](handleError(_0x11e3c3,null));};exports['show']=function(_0xff891d,_0x66cac9){var _0x5ce14f={'raw':!![],'where':{'id':_0xff891d[_0x43c9('0x4e')]['id']}},_0x2a8f7d={};_0x2a8f7d[_0x43c9('0x38')]=_[_0x43c9('0x3a')](db[_0x43c9('0x48')][_0x43c9('0x34')]);_0x2a8f7d[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0xff891d[_0x43c9('0x39')]);_0x2a8f7d['filters']=_[_0x43c9('0x3d')](_0x2a8f7d['model'],_0x2a8f7d[_0x43c9('0x39')]);_0x5ce14f[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x2a8f7d[_0x43c9('0x38')],qs['fields'](_0xff891d[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x5ce14f['attributes']=_0x5ce14f[_0x43c9('0x3c')][_0x43c9('0x3f')]?_0x5ce14f['attributes']:_0x2a8f7d[_0x43c9('0x38')];if(_0xff891d[_0x43c9('0x39')][_0x43c9('0x49')]){_0x5ce14f['include']=[{'all':!![]}];}_0x5ce14f=_[_0x43c9('0x46')]({},_0x5ce14f,_0xff891d['options']);return db['Cdr'][_0x43c9('0x4f')](_0x5ce14f)[_0x43c9('0x2c')](handleEntityNotFound(_0x66cac9,null))[_0x43c9('0x2c')](respondWithResult(_0x66cac9,null))[_0x43c9('0x4d')](handleError(_0x66cac9,null));};exports[_0x43c9('0x50')]=function(_0x28fe5d,_0x1f966e){return db[_0x43c9('0x48')][_0x43c9('0x50')](_0x28fe5d[_0x43c9('0x51')],{})[_0x43c9('0x2c')](respondWithResult(_0x1f966e,0xc9))[_0x43c9('0x4d')](handleError(_0x1f966e,null));};exports[_0x43c9('0x2b')]=function(_0x5082e9,_0xc57086){if(_0x5082e9[_0x43c9('0x51')]['id']){delete _0x5082e9['body']['id'];}return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x5082e9[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0xc57086,null))[_0x43c9('0x2c')](saveUpdates(_0x5082e9[_0x43c9('0x51')],null))[_0x43c9('0x2c')](respondWithResult(_0xc57086,null))[_0x43c9('0x4d')](handleError(_0xc57086,null));};exports[_0x43c9('0x2d')]=function(_0x508b62,_0x27db89){return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x508b62[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0x27db89,null))[_0x43c9('0x2c')](removeEntity(_0x27db89,null))['catch'](handleError(_0x27db89,null));};exports[_0x43c9('0x52')]=function(_0x1bc3b5,_0x3aff2e){return db[_0x43c9('0x48')][_0x43c9('0x52')]()[_0x43c9('0x2c')](respondWithResult(_0x3aff2e,null))[_0x43c9('0x4d')](handleError(_0x3aff2e,null));};
\ No newline at end of file
+var _0xfd7b=['stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','end','error'];(function(_0x39bf9f,_0x4c9693){var _0x8cfbbf=function(_0x1cbf02){while(--_0x1cbf02){_0x39bf9f['push'](_0x39bf9f['shift']());}};_0x8cfbbf(++_0x4c9693);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xfd7b[_0x4e4f0e];return _0x1a7219;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd7('0x0'));var zipdir=require(_0xbfd7('0x1'));var jsonpatch=require(_0xbfd7('0x2'));var rp=require(_0xbfd7('0x3'));var moment=require(_0xbfd7('0x4'));var BPromise=require(_0xbfd7('0x5'));var Mustache=require(_0xbfd7('0x6'));var util=require(_0xbfd7('0x7'));var path=require(_0xbfd7('0x8'));var sox=require(_0xbfd7('0x9'));var csv=require(_0xbfd7('0xa'));var ejs=require(_0xbfd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xc'));var _=require('lodash');var squel=require(_0xbfd7('0xd'));var crypto=require('crypto');var jsforce=require(_0xbfd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xa'));var querystring=require(_0xbfd7('0xf'));var Papa=require(_0xbfd7('0x10'));var Redis=require(_0xbfd7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfd7('0x12'));var as=require(_0xbfd7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfd7('0x14'));var utils=require(_0xbfd7('0x15'));var config=require(_0xbfd7('0x16'));var licenseUtil=require(_0xbfd7('0x17'));var db=require(_0xbfd7('0x18'))['db'];function respondWithStatusCode(_0x559eca,_0x46feae){_0x46feae=_0x46feae||0xcc;return function(_0x534d66){if(_0x534d66){return _0x559eca[_0xbfd7('0x19')](_0x46feae);}return _0x559eca['status'](_0x46feae)['end']();};}function respondWithResult(_0x44847e,_0x4fec16){_0x4fec16=_0x4fec16||0xc8;return function(_0x3789b7){if(_0x3789b7){return _0x44847e[_0xbfd7('0x1a')](_0x4fec16)['json'](_0x3789b7);}};}function respondWithFilteredResult(_0x5efd54,_0x48f4a4){return function(_0x37e777){if(_0x37e777){var _0x115a34=typeof _0x48f4a4[_0xbfd7('0x1b')]===_0xbfd7('0x1c')&&typeof _0x48f4a4[_0xbfd7('0x1d')]===_0xbfd7('0x1c');var _0x137d50=_0x37e777[_0xbfd7('0x1e')];var _0x3053f3=_0x115a34?0x0:_0x48f4a4['offset'];var _0x5b718b=_0x115a34?_0x37e777[_0xbfd7('0x1e')]:_0x48f4a4[_0xbfd7('0x1b')]+_0x48f4a4['limit'];var _0x5ea27a;if(_0x5b718b>=_0x137d50){_0x5b718b=_0x137d50;_0x5ea27a=0xc8;}else{_0x5ea27a=0xce;}_0x5efd54[_0xbfd7('0x1a')](_0x5ea27a);return _0x5efd54['set']('Content-Range',_0x3053f3+'-'+_0x5b718b+'/'+_0x137d50)[_0xbfd7('0x1f')](_0x37e777);}return null;};}function patchUpdates(_0x5eab37){return function(_0x594792){try{jsonpatch[_0xbfd7('0x20')](_0x594792,_0x5eab37,!![]);}catch(_0x1db6de){return BPromise[_0xbfd7('0x21')](_0x1db6de);}return _0x594792['save']();};}function saveUpdates(_0xb38f6b,_0x32a489){return function(_0x152893){if(_0x152893){return _0x152893[_0xbfd7('0x22')](_0xb38f6b)[_0xbfd7('0x23')](function(_0x2639b6){return _0x2639b6;});}return null;};}function removeEntity(_0x51b13d,_0x2402fb){return function(_0x1c765b){if(_0x1c765b){return _0x1c765b[_0xbfd7('0x24')]()['then'](function(){_0x51b13d[_0xbfd7('0x1a')](0xcc)[_0xbfd7('0x25')]();});}};}function handleEntityNotFound(_0x18dd74,_0x2d0549){return function(_0x358549){if(!_0x358549){_0x18dd74['sendStatus'](0x194);}return _0x358549;};}function handleError(_0x2a7749,_0x6ef5aa){_0x6ef5aa=_0x6ef5aa||0x1f4;return function(_0x120e39){logger[_0xbfd7('0x26')](_0x120e39[_0xbfd7('0x27')]);if(_0x120e39[_0xbfd7('0x28')]){delete _0x120e39[_0xbfd7('0x28')];}_0x2a7749['status'](_0x6ef5aa)[_0xbfd7('0x29')](_0x120e39);};}exports[_0xbfd7('0x2a')]=function(_0x4d7ef4,_0x2971ea){var _0x33583b={},_0x2ec4a5={},_0x14c55d={'count':0x0,'rows':[]};var _0x510506=_[_0xbfd7('0x2b')](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')],function(_0x489365){return{'name':_0x489365[_0xbfd7('0x2e')],'type':_0x489365['type'][_0xbfd7('0x2f')]};});_0x2ec4a5['model']=_[_0xbfd7('0x2b')](_0x510506,_0xbfd7('0x28'));_0x2ec4a5['query']=_[_0xbfd7('0x30')](_0x4d7ef4[_0xbfd7('0x31')]);_0x2ec4a5['filters']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],_0x2ec4a5[_0xbfd7('0x31')]);_0x33583b['attributes']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],qs[_0xbfd7('0x34')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x34')]));_0x33583b[_0xbfd7('0x35')]=_0x33583b[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x33583b[_0xbfd7('0x35')]:_0x2ec4a5[_0xbfd7('0x33')];if(!_0x4d7ef4[_0xbfd7('0x31')]['hasOwnProperty'](_0xbfd7('0x37'))){_0x33583b['limit']=qs['limit'](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1d')]);_0x33583b[_0xbfd7('0x1b')]=qs[_0xbfd7('0x1b')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1b')]);}_0x33583b[_0xbfd7('0x38')]=qs[_0xbfd7('0x39')](_0x4d7ef4['query']['sort']);_0x33583b[_0xbfd7('0x3a')]=qs[_0xbfd7('0x3b')](_['pick'](_0x4d7ef4[_0xbfd7('0x31')],_0x2ec4a5[_0xbfd7('0x3b')]),_0x510506);if(_0x4d7ef4['query']['filter']){_0x33583b[_0xbfd7('0x3a')]=_[_0xbfd7('0x3c')](_0x33583b['where'],{'$or':_[_0xbfd7('0x2b')](_0x510506,function(_0xfee712){if(_0xfee712[_0xbfd7('0x3d')]!==_0xbfd7('0x3e')){var _0x68f13={};_0x68f13[_0xfee712['name']]={'$like':'%'+_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x3f')]+'%'};return _0x68f13;}})});}_0x33583b=_[_0xbfd7('0x3c')]({},_0x33583b,_0x4d7ef4[_0xbfd7('0x40')]);var _0x25ac4a={'where':_0x33583b[_0xbfd7('0x3a')]};return db[_0xbfd7('0x2c')][_0xbfd7('0x1e')](_0x25ac4a)['then'](function(_0x32df79){_0x14c55d['count']=_0x32df79;if(_0x4d7ef4['query'][_0xbfd7('0x41')]){_0x33583b[_0xbfd7('0x42')]=[{'all':!![]}];}return db[_0xbfd7('0x2c')][_0xbfd7('0x43')](_0x33583b);})[_0xbfd7('0x23')](function(_0x1236dd){_0x14c55d['rows']=_0x1236dd;return _0x14c55d;})[_0xbfd7('0x23')](respondWithFilteredResult(_0x2971ea,_0x33583b))['catch'](handleError(_0x2971ea,null));};exports[_0xbfd7('0x44')]=function(_0x3b7d7f,_0x12f99b){var _0x159c20={'raw':!![],'where':{'id':_0x3b7d7f[_0xbfd7('0x45')]['id']}},_0x1df6a3={};_0x1df6a3[_0xbfd7('0x33')]=_['keys'](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')]);_0x1df6a3[_0xbfd7('0x31')]=_[_0xbfd7('0x30')](_0x3b7d7f[_0xbfd7('0x31')]);_0x1df6a3[_0xbfd7('0x3b')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],_0x1df6a3[_0xbfd7('0x31')]);_0x159c20[_0xbfd7('0x35')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],qs['fields'](_0x3b7d7f['query'][_0xbfd7('0x34')]));_0x159c20[_0xbfd7('0x35')]=_0x159c20[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x159c20['attributes']:_0x1df6a3[_0xbfd7('0x33')];if(_0x3b7d7f['query'][_0xbfd7('0x41')]){_0x159c20[_0xbfd7('0x42')]=[{'all':!![]}];}_0x159c20=_['merge']({},_0x159c20,_0x3b7d7f[_0xbfd7('0x40')]);return db['Cdr'][_0xbfd7('0x46')](_0x159c20)[_0xbfd7('0x23')](handleEntityNotFound(_0x12f99b,null))[_0xbfd7('0x23')](respondWithResult(_0x12f99b,null))['catch'](handleError(_0x12f99b,null));};exports['create']=function(_0x356f58,_0xb8b319){return db['Cdr']['create'](_0x356f58[_0xbfd7('0x47')],{})[_0xbfd7('0x23')](respondWithResult(_0xb8b319,0xc9))[_0xbfd7('0x48')](handleError(_0xb8b319,null));};exports[_0xbfd7('0x22')]=function(_0x1cea7d,_0x14bc15){if(_0x1cea7d[_0xbfd7('0x47')]['id']){delete _0x1cea7d['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x1cea7d[_0xbfd7('0x45')]['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0x14bc15,null))[_0xbfd7('0x23')](saveUpdates(_0x1cea7d['body'],null))[_0xbfd7('0x23')](respondWithResult(_0x14bc15,null))[_0xbfd7('0x48')](handleError(_0x14bc15,null));};exports['destroy']=function(_0x4a7a72,_0xc89535){return db[_0xbfd7('0x2c')][_0xbfd7('0x46')]({'where':{'id':_0x4a7a72['params']['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0xc89535,null))[_0xbfd7('0x23')](removeEntity(_0xc89535,null))[_0xbfd7('0x48')](handleError(_0xc89535,null));};exports['describe']=function(_0x371d01,_0x15c0fe){return db[_0xbfd7('0x2c')][_0xbfd7('0x49')]()['then'](respondWithResult(_0x15c0fe,null))[_0xbfd7('0x48')](handleError(_0x15c0fe,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e447fa4..c55ea56 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(_0x47870f,_0x88bf6){var _0xb9bfa3=function(_0x1c676b){while(--_0x1c676b){_0x47870f['push'](_0x47870f['shift']());}};_0xb9bfa3(++_0x88bf6);}(_0x7a54,0x106));var _0x47a5=function(_0x5741dd,_0x2d9ae6){_0x5741dd=_0x5741dd-0x0;var _0x22f8ad=_0x7a54[_0x5741dd];return _0x22f8ad;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x492f29,_0x4ca0b0){var _0x4ef358=function(_0x4a2ed2){while(--_0x4a2ed2){_0x492f29['push'](_0x492f29['shift']());}};_0x4ef358(++_0x4ca0b0);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index f9fbcd4..651ac3c 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 _0x24b1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x1385dc,_0x2c7fd7){var _0x2f6469=function(_0x47ed8a){while(--_0x47ed8a){_0x1385dc['push'](_0x1385dc['shift']());}};_0x2f6469(++_0x2c7fd7);}(_0x24b1,0x108));var _0x124b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x24b1[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x124b('0x0'));var util=require(_0x124b('0x1'));var moment=require(_0x124b('0x2'));var BPromise=require(_0x124b('0x3'));var rs=require(_0x124b('0x4'));var fs=require('fs');var Redis=require(_0x124b('0x5'));var db=require(_0x124b('0x6'))['db'];var utils=require(_0x124b('0x7'));var logger=require(_0x124b('0x8'))(_0x124b('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x124b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe78f6b,_0x36f5c0,_0x26f9ce){return new BPromise(function(_0x57cc78,_0x96b2da){return client[_0x124b('0xb')](_0xe78f6b,_0x26f9ce)['then'](function(_0x3acb94){logger[_0x124b('0xc')](_0x124b('0xd'),_0x36f5c0,_0x124b('0xe'));logger[_0x124b('0xf')](_0x124b('0x10'),_0x36f5c0,_0x124b('0xe'),JSON[_0x124b('0x11')](_0x3acb94));if(_0x3acb94[_0x124b('0x12')]){if(_0x3acb94['error']['code']===0x1f4){logger[_0x124b('0x12')]('Cdr,\x20%s,\x20%s',_0x36f5c0,_0x3acb94[_0x124b('0x12')][_0x124b('0x13')]);return _0x96b2da(_0x3acb94[_0x124b('0x12')][_0x124b('0x13')]);}logger[_0x124b('0x12')]('Cdr,\x20%s,\x20%s',_0x36f5c0,_0x3acb94['error']['message']);return _0x57cc78(_0x3acb94['error']['message']);}else{logger[_0x124b('0xc')](_0x124b('0xd'),_0x36f5c0,_0x124b('0xe'));_0x57cc78(_0x3acb94[_0x124b('0x14')][_0x124b('0x13')]);}})[_0x124b('0x15')](function(_0x198259){logger[_0x124b('0x12')]('Cdr,\x20%s,\x20%s',_0x36f5c0,_0x198259);_0x96b2da(_0x198259);});});}
\ No newline at end of file
+var _0x8ea7=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x865802,_0x191bc4){var _0x2f2dc3=function(_0x348346){while(--_0x348346){_0x865802['push'](_0x865802['shift']());}};_0x2f2dc3(++_0x191bc4);}(_0x8ea7,0xd2));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ea('0x0'));var util=require('util');var moment=require(_0x78ea('0x1'));var BPromise=require(_0x78ea('0x2'));var rs=require(_0x78ea('0x3'));var fs=require('fs');var Redis=require(_0x78ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x78ea('0x5'));var logger=require(_0x78ea('0x6'))(_0x78ea('0x7'));var config=require(_0x78ea('0x8'));var jayson=require(_0x78ea('0x9'));var client=jayson[_0x78ea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac9cc,_0x3e32b8,_0x38f328){return new BPromise(function(_0xc5c863,_0x39a489){return client[_0x78ea('0xb')](_0x2ac9cc,_0x38f328)[_0x78ea('0xc')](function(_0x4a08f7){logger[_0x78ea('0xd')](_0x78ea('0xe'),_0x3e32b8,_0x78ea('0xf'));logger[_0x78ea('0x10')](_0x78ea('0x11'),_0x3e32b8,_0x78ea('0xf'),JSON['stringify'](_0x4a08f7));if(_0x4a08f7[_0x78ea('0x12')]){if(_0x4a08f7[_0x78ea('0x12')][_0x78ea('0x13')]===0x1f4){logger['error'](_0x78ea('0xe'),_0x3e32b8,_0x4a08f7[_0x78ea('0x12')][_0x78ea('0x14')]);return _0x39a489(_0x4a08f7['error'][_0x78ea('0x14')]);}logger[_0x78ea('0x12')](_0x78ea('0xe'),_0x3e32b8,_0x4a08f7[_0x78ea('0x12')]['message']);return _0xc5c863(_0x4a08f7[_0x78ea('0x12')]['message']);}else{logger[_0x78ea('0xd')]('Cdr,\x20%s,\x20%s',_0x3e32b8,_0x78ea('0xf'));_0xc5c863(_0x4a08f7[_0x78ea('0x15')][_0x78ea('0x14')]);}})[_0x78ea('0x16')](function(_0x3c422e){logger[_0x78ea('0x12')](_0x78ea('0xe'),_0x3e32b8,_0x3c422e);_0x39a489(_0x3c422e);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index d22d1b4..7643048 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(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4469d2,_0x307fda){var _0x1a312d=function(_0x562f9a){while(--_0x562f9a){_0x4469d2['push'](_0x4469d2['shift']());}};_0x1a312d(++_0x307fda);}(_0xb10b,0x12a));var _0xbb10=function(_0x8a2e9d,_0xa7a01c){_0x8a2e9d=_0x8a2e9d-0x0;var _0xf64cdd=_0xb10b[_0x8a2e9d];return _0xf64cdd;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index fc15550..58b3546 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 _0x539c=['INTEGER','STRING','exports'];(function(_0x53fcbb,_0x2cc6ab){var _0x2e4a99=function(_0x4c9d83){while(--_0x4c9d83){_0x53fcbb['push'](_0x53fcbb['shift']());}};_0x2e4a99(++_0x2cc6ab);}(_0x539c,0x1c4));var _0xc539=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x539c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xc539('0x0')]={'priority':{'type':Sequelize[_0xc539('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc539('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xd474=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x2ac9c1,_0x28f870){var _0x553d9d=function(_0x17a8b2){while(--_0x17a8b2){_0x2ac9c1['push'](_0x2ac9c1['shift']());}};_0x553d9d(++_0x28f870);}(_0xd474,0x6b));var _0x4d47=function(_0x33b627,_0xcd64e0){_0x33b627=_0x33b627-0x0;var _0x531df0=_0xd474[_0x33b627];return _0x531df0;};'use strict';var Sequelize=require(_0x4d47('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4d47('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4d47('0x2')],'allowNull':![],'defaultValue':_0x4d47('0x3')},'appdata':{'type':Sequelize[_0x4d47('0x4')]()},'description':{'type':Sequelize[_0x4d47('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4d47('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5949120..03fcf82 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 _0x6594=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','end','error','stack','name','send','show','params','ChatApplication','keys','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','catch','body','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x6594,0xcb));var _0x4659=function(_0x4a2689,_0x314a16){_0x4a2689=_0x4a2689-0x0;var _0x463450=_0x6594[_0x4a2689];return _0x463450;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4659('0x0'));var moment=require(_0x4659('0x1'));var BPromise=require(_0x4659('0x2'));var Mustache=require(_0x4659('0x3'));var util=require(_0x4659('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4659('0x5'));var ejs=require(_0x4659('0x6'));var fs=require('fs');var fs_extra=require(_0x4659('0x7'));var _=require(_0x4659('0x8'));var squel=require('squel');var crypto=require(_0x4659('0x9'));var jsforce=require(_0x4659('0xa'));var deskjs=require(_0x4659('0xb'));var toCsv=require(_0x4659('0x5'));var querystring=require(_0x4659('0xc'));var Papa=require(_0x4659('0xd'));var Redis=require('ioredis');var authService=require(_0x4659('0xe'));var qs=require(_0x4659('0xf'));var as=require(_0x4659('0x10'));var hardwareService=require(_0x4659('0x11'));var logger=require(_0x4659('0x12'))(_0x4659('0x13'));var utils=require(_0x4659('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4659('0x15'))['db'];function respondWithStatusCode(_0x22941b,_0x1f89cf){_0x1f89cf=_0x1f89cf||0xcc;return function(_0x5389a0){if(_0x5389a0){return _0x22941b[_0x4659('0x16')](_0x1f89cf);}return _0x22941b[_0x4659('0x17')](_0x1f89cf)['end']();};}function respondWithResult(_0x5d303e,_0x1a9e9c){_0x1a9e9c=_0x1a9e9c||0xc8;return function(_0x4c3c05){if(_0x4c3c05){return _0x5d303e[_0x4659('0x17')](_0x1a9e9c)[_0x4659('0x18')](_0x4c3c05);}};}function respondWithFilteredResult(_0x37d37d,_0x5c099c){return function(_0x3d9a17){if(_0x3d9a17){var _0x429b72=typeof _0x5c099c[_0x4659('0x19')]===_0x4659('0x1a')&&typeof _0x5c099c['limit']===_0x4659('0x1a');var _0xb9e922=_0x3d9a17[_0x4659('0x1b')];var _0x2fdd7a=_0x429b72?0x0:_0x5c099c['offset'];var _0x434282=_0x429b72?_0x3d9a17[_0x4659('0x1b')]:_0x5c099c['offset']+_0x5c099c[_0x4659('0x1c')];var _0x3c7bd0;if(_0x434282>=_0xb9e922){_0x434282=_0xb9e922;_0x3c7bd0=0xc8;}else{_0x3c7bd0=0xce;}_0x37d37d[_0x4659('0x17')](_0x3c7bd0);return _0x37d37d[_0x4659('0x1d')]('Content-Range',_0x2fdd7a+'-'+_0x434282+'/'+_0xb9e922)['json'](_0x3d9a17);}return null;};}function patchUpdates(_0x494261){return function(_0x157f1a){try{jsonpatch[_0x4659('0x1e')](_0x157f1a,_0x494261,!![]);}catch(_0xd6012e){return BPromise[_0x4659('0x1f')](_0xd6012e);}return _0x157f1a[_0x4659('0x20')]();};}function saveUpdates(_0x428e2c,_0x2e773b){return function(_0x1a016e){if(_0x1a016e){return _0x1a016e['update'](_0x428e2c)['then'](function(_0x31273d){return _0x31273d;});}return null;};}function removeEntity(_0x4c40b3,_0x1e9c93){return function(_0x47c73d){if(_0x47c73d){return _0x47c73d[_0x4659('0x21')]()[_0x4659('0x22')](function(){_0x4c40b3[_0x4659('0x17')](0xcc)[_0x4659('0x23')]();});}};}function handleEntityNotFound(_0x20fc37,_0x1fe661){return function(_0x2b4ad8){if(!_0x2b4ad8){_0x20fc37[_0x4659('0x16')](0x194);}return _0x2b4ad8;};}function handleError(_0x376e34,_0x507598){_0x507598=_0x507598||0x1f4;return function(_0x428dd5){logger[_0x4659('0x24')](_0x428dd5[_0x4659('0x25')]);if(_0x428dd5[_0x4659('0x26')]){delete _0x428dd5[_0x4659('0x26')];}_0x376e34[_0x4659('0x17')](_0x507598)[_0x4659('0x27')](_0x428dd5);};}exports[_0x4659('0x28')]=function(_0x5c152b,_0x479a2e){var _0x5d0c89={'raw':!![],'where':{'id':_0x5c152b[_0x4659('0x29')]['id']}},_0xde3c49={};_0xde3c49['model']=_['keys'](db[_0x4659('0x2a')]['rawAttributes']);_0xde3c49['query']=_[_0x4659('0x2b')](_0x5c152b[_0x4659('0x2c')]);_0xde3c49['filters']=_[_0x4659('0x2d')](_0xde3c49[_0x4659('0x2e')],_0xde3c49[_0x4659('0x2c')]);_0x5d0c89[_0x4659('0x2f')]=_[_0x4659('0x2d')](_0xde3c49[_0x4659('0x2e')],qs[_0x4659('0x30')](_0x5c152b['query'][_0x4659('0x30')]));_0x5d0c89[_0x4659('0x2f')]=_0x5d0c89[_0x4659('0x2f')][_0x4659('0x31')]?_0x5d0c89['attributes']:_0xde3c49[_0x4659('0x2e')];if(_0x5c152b[_0x4659('0x2c')][_0x4659('0x32')]){_0x5d0c89[_0x4659('0x33')]=[{'all':!![]}];}_0x5d0c89=_[_0x4659('0x34')]({},_0x5d0c89,_0x5c152b[_0x4659('0x35')]);return db['ChatApplication']['find'](_0x5d0c89)['then'](handleEntityNotFound(_0x479a2e,null))[_0x4659('0x22')](respondWithResult(_0x479a2e,null))[_0x4659('0x36')](handleError(_0x479a2e,null));};exports['update']=function(_0xe85ca8,_0xf2b91c){if(_0xe85ca8['body']['id']){delete _0xe85ca8[_0x4659('0x37')]['id'];}return db[_0x4659('0x2a')]['find']({'where':{'id':_0xe85ca8['params']['id']}})[_0x4659('0x22')](handleEntityNotFound(_0xf2b91c,null))[_0x4659('0x22')](saveUpdates(_0xe85ca8[_0x4659('0x37')],null))[_0x4659('0x22')](respondWithResult(_0xf2b91c,null))[_0x4659('0x36')](handleError(_0xf2b91c,null));};exports[_0x4659('0x21')]=function(_0xcac96a,_0x1f3259){return db[_0x4659('0x2a')]['find']({'where':{'id':_0xcac96a[_0x4659('0x29')]['id']}})[_0x4659('0x22')](handleEntityNotFound(_0x1f3259,null))['then'](removeEntity(_0x1f3259,null))['catch'](handleError(_0x1f3259,null));};
\ No newline at end of file
+var _0xc68d=['sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','apply','save','update','then','destroy','error','stack','name','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','options','find','catch','body','rimraf','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x420cb4,_0x2149bf){var _0x44bfb1=function(_0xcd79a8){while(--_0xcd79a8){_0x420cb4['push'](_0x420cb4['shift']());}};_0x44bfb1(++_0x2149bf);}(_0xc68d,0x17a));var _0xdc68=function(_0x281950,_0x3da368){_0x281950=_0x281950-0x0;var _0x24f81a=_0xc68d[_0x281950];return _0x24f81a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc68('0x0'));var zipdir=require(_0xdc68('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc68('0x2'));var BPromise=require(_0xdc68('0x3'));var Mustache=require(_0xdc68('0x4'));var util=require(_0xdc68('0x5'));var path=require(_0xdc68('0x6'));var sox=require(_0xdc68('0x7'));var csv=require('to-csv');var ejs=require(_0xdc68('0x8'));var fs=require('fs');var fs_extra=require(_0xdc68('0x9'));var _=require(_0xdc68('0xa'));var squel=require('squel');var crypto=require(_0xdc68('0xb'));var jsforce=require(_0xdc68('0xc'));var deskjs=require(_0xdc68('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc68('0xe'));var Redis=require(_0xdc68('0xf'));var authService=require(_0xdc68('0x10'));var qs=require(_0xdc68('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc68('0x12'));var logger=require(_0xdc68('0x13'))(_0xdc68('0x14'));var utils=require(_0xdc68('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdc68('0x16'));var db=require(_0xdc68('0x17'))['db'];function respondWithStatusCode(_0x500a71,_0x44775f){_0x44775f=_0x44775f||0xcc;return function(_0x448d4a){if(_0x448d4a){return _0x500a71[_0xdc68('0x18')](_0x44775f);}return _0x500a71['status'](_0x44775f)[_0xdc68('0x19')]();};}function respondWithResult(_0x181136,_0x19c1ed){_0x19c1ed=_0x19c1ed||0xc8;return function(_0xd229ba){if(_0xd229ba){return _0x181136[_0xdc68('0x1a')](_0x19c1ed)[_0xdc68('0x1b')](_0xd229ba);}};}function respondWithFilteredResult(_0x2b6883,_0x4a139b){return function(_0x210d65){if(_0x210d65){var _0x4aa2ad=typeof _0x4a139b[_0xdc68('0x1c')]==='undefined'&&typeof _0x4a139b[_0xdc68('0x1d')]===_0xdc68('0x1e');var _0x5c6d6b=_0x210d65[_0xdc68('0x1f')];var _0x3afa9a=_0x4aa2ad?0x0:_0x4a139b[_0xdc68('0x1c')];var _0x59896b=_0x4aa2ad?_0x210d65[_0xdc68('0x1f')]:_0x4a139b[_0xdc68('0x1c')]+_0x4a139b[_0xdc68('0x1d')];var _0x17c349;if(_0x59896b>=_0x5c6d6b){_0x59896b=_0x5c6d6b;_0x17c349=0xc8;}else{_0x17c349=0xce;}_0x2b6883['status'](_0x17c349);return _0x2b6883['set']('Content-Range',_0x3afa9a+'-'+_0x59896b+'/'+_0x5c6d6b)[_0xdc68('0x1b')](_0x210d65);}return null;};}function patchUpdates(_0x15f955){return function(_0x16e37d){try{jsonpatch[_0xdc68('0x20')](_0x16e37d,_0x15f955,!![]);}catch(_0xbeae7d){return BPromise['reject'](_0xbeae7d);}return _0x16e37d[_0xdc68('0x21')]();};}function saveUpdates(_0x42e1ce,_0x3199d8){return function(_0x1cea8e){if(_0x1cea8e){return _0x1cea8e[_0xdc68('0x22')](_0x42e1ce)[_0xdc68('0x23')](function(_0x5b3f02){return _0x5b3f02;});}return null;};}function removeEntity(_0x1f14b3,_0x34273d){return function(_0x5685ed){if(_0x5685ed){return _0x5685ed[_0xdc68('0x24')]()['then'](function(){_0x1f14b3[_0xdc68('0x1a')](0xcc)[_0xdc68('0x19')]();});}};}function handleEntityNotFound(_0xd5cceb,_0xeb9997){return function(_0x5e6f52){if(!_0x5e6f52){_0xd5cceb[_0xdc68('0x18')](0x194);}return _0x5e6f52;};}function handleError(_0x599af3,_0x4121cd){_0x4121cd=_0x4121cd||0x1f4;return function(_0x41e500){logger[_0xdc68('0x25')](_0x41e500[_0xdc68('0x26')]);if(_0x41e500[_0xdc68('0x27')]){delete _0x41e500['name'];}_0x599af3['status'](_0x4121cd)['send'](_0x41e500);};}exports['show']=function(_0x268766,_0x11418b){var _0x296424={'raw':!![],'where':{'id':_0x268766[_0xdc68('0x28')]['id']}},_0x472ca4={};_0x472ca4[_0xdc68('0x29')]=_[_0xdc68('0x2a')](db[_0xdc68('0x2b')][_0xdc68('0x2c')]);_0x472ca4[_0xdc68('0x2d')]=_[_0xdc68('0x2a')](_0x268766['query']);_0x472ca4[_0xdc68('0x2e')]=_[_0xdc68('0x2f')](_0x472ca4['model'],_0x472ca4['query']);_0x296424[_0xdc68('0x30')]=_[_0xdc68('0x2f')](_0x472ca4['model'],qs[_0xdc68('0x31')](_0x268766[_0xdc68('0x2d')]['fields']));_0x296424[_0xdc68('0x30')]=_0x296424['attributes']['length']?_0x296424[_0xdc68('0x30')]:_0x472ca4['model'];if(_0x268766[_0xdc68('0x2d')][_0xdc68('0x32')]){_0x296424['include']=[{'all':!![]}];}_0x296424=_['merge']({},_0x296424,_0x268766[_0xdc68('0x33')]);return db[_0xdc68('0x2b')][_0xdc68('0x34')](_0x296424)['then'](handleEntityNotFound(_0x11418b,null))[_0xdc68('0x23')](respondWithResult(_0x11418b,null))[_0xdc68('0x35')](handleError(_0x11418b,null));};exports['update']=function(_0x1bf8c6,_0x4e47c5){if(_0x1bf8c6[_0xdc68('0x36')]['id']){delete _0x1bf8c6[_0xdc68('0x36')]['id'];}return db[_0xdc68('0x2b')][_0xdc68('0x34')]({'where':{'id':_0x1bf8c6[_0xdc68('0x28')]['id']}})['then'](handleEntityNotFound(_0x4e47c5,null))[_0xdc68('0x23')](saveUpdates(_0x1bf8c6[_0xdc68('0x36')],null))['then'](respondWithResult(_0x4e47c5,null))[_0xdc68('0x35')](handleError(_0x4e47c5,null));};exports[_0xdc68('0x24')]=function(_0x5b77b3,_0x1e563a){return db[_0xdc68('0x2b')][_0xdc68('0x34')]({'where':{'id':_0x5b77b3['params']['id']}})[_0xdc68('0x23')](handleEntityNotFound(_0x1e563a,null))[_0xdc68('0x23')](removeEntity(_0x1e563a,null))[_0xdc68('0x35')](handleError(_0x1e563a,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 18ad6fa..79e6850 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 _0x1b4a=['api','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4dc4dd,_0xe3d8a4){var _0x46c030=function(_0x424349){while(--_0x424349){_0x4dc4dd['push'](_0x4dc4dd['shift']());}};_0x46c030(++_0xe3d8a4);}(_0x1b4a,0x99));var _0xa1b4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1b4a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xa1b4('0x0'));var util=require(_0xa1b4('0x1'));var logger=require(_0xa1b4('0x2'))(_0xa1b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa1b4('0x4'));var config=require(_0xa1b4('0x5'));var attributes=require(_0xa1b4('0x6'));module[_0xa1b4('0x7')]=function(_0x262f0c,_0x1a583c){return _0x262f0c[_0xa1b4('0x8')](_0xa1b4('0x9'),attributes,{'tableName':_0xa1b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa1b4('0xb'),'collate':_0xa1b4('0xc')});};
\ No newline at end of file
+var _0x5c21=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x2430de,_0x40394d){var _0x30d356=function(_0x2cd79d){while(--_0x2cd79d){_0x2430de['push'](_0x2430de['shift']());}};_0x30d356(++_0x40394d);}(_0x5c21,0x119));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x15c2('0x0'));var util=require(_0x15c2('0x1'));var logger=require(_0x15c2('0x2'))(_0x15c2('0x3'));var moment=require(_0x15c2('0x4'));var BPromise=require('bluebird');var rp=require(_0x15c2('0x5'));var fs=require('fs');var path=require(_0x15c2('0x6'));var rimraf=require(_0x15c2('0x7'));var config=require(_0x15c2('0x8'));var attributes=require(_0x15c2('0x9'));module[_0x15c2('0xa')]=function(_0xa3217b,_0x25dd42){return _0xa3217b[_0x15c2('0xb')](_0x15c2('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x15c2('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f6d2ea8..2c58432 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 _0x7afd=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x33b81e,_0x70384e){var _0x431c98=function(_0x3bbb88){while(--_0x3bbb88){_0x33b81e['push'](_0x33b81e['shift']());}};_0x431c98(++_0x70384e);}(_0x7afd,0x11c));var _0xd7af=function(_0x496c30,_0x4f32cf){_0x496c30=_0x496c30-0x0;var _0x168fbb=_0x7afd[_0x496c30];return _0x168fbb;};'use strict';var _=require(_0xd7af('0x0'));var util=require(_0xd7af('0x1'));var moment=require(_0xd7af('0x2'));var BPromise=require(_0xd7af('0x3'));var rs=require(_0xd7af('0x4'));var fs=require('fs');var Redis=require(_0xd7af('0x5'));var db=require(_0xd7af('0x6'))['db'];var utils=require(_0xd7af('0x7'));var logger=require('../../config/logger')(_0xd7af('0x8'));var config=require(_0xd7af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd7af('0xa')][_0xd7af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x501638,_0x52f399,_0x33e2cf){return new BPromise(function(_0x54bb8a,_0x4b326a){return client[_0xd7af('0xc')](_0x501638,_0x33e2cf)[_0xd7af('0xd')](function(_0x565c6b){logger[_0xd7af('0xe')](_0xd7af('0xf'),_0x52f399,_0xd7af('0x10'));logger[_0xd7af('0x11')](_0xd7af('0x12'),_0x52f399,'request\x20sent',JSON[_0xd7af('0x13')](_0x565c6b));if(_0x565c6b[_0xd7af('0x14')]){if(_0x565c6b[_0xd7af('0x14')]['code']===0x1f4){logger[_0xd7af('0x14')](_0xd7af('0xf'),_0x52f399,_0x565c6b['error'][_0xd7af('0x15')]);return _0x4b326a(_0x565c6b['error'][_0xd7af('0x15')]);}logger[_0xd7af('0x14')](_0xd7af('0xf'),_0x52f399,_0x565c6b[_0xd7af('0x14')][_0xd7af('0x15')]);return _0x54bb8a(_0x565c6b[_0xd7af('0x14')]['message']);}else{logger[_0xd7af('0xe')]('ChatApplication,\x20%s,\x20%s',_0x52f399,_0xd7af('0x10'));_0x54bb8a(_0x565c6b[_0xd7af('0x16')][_0xd7af('0x15')]);}})[_0xd7af('0x17')](function(_0x2b9eff){logger[_0xd7af('0x14')]('ChatApplication,\x20%s,\x20%s',_0x52f399,_0x2b9eff);_0x4b326a(_0x2b9eff);});});}
\ No newline at end of file
+var _0x80ee=['message','ChatApplication,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','stringify','error'];(function(_0x76a8ae,_0x38a5ea){var _0x3b3123=function(_0x2f95c6){while(--_0x2f95c6){_0x76a8ae['push'](_0x76a8ae['shift']());}};_0x3b3123(++_0x38a5ea);}(_0x80ee,0x67));var _0xe80e=function(_0x528bb5,_0x119c5b){_0x528bb5=_0x528bb5-0x0;var _0x58e8ca=_0x80ee[_0x528bb5];return _0x58e8ca;};'use strict';var _=require(_0xe80e('0x0'));var util=require(_0xe80e('0x1'));var moment=require('moment');var BPromise=require(_0xe80e('0x2'));var rs=require(_0xe80e('0x3'));var fs=require('fs');var Redis=require(_0xe80e('0x4'));var db=require(_0xe80e('0x5'))['db'];var utils=require(_0xe80e('0x6'));var logger=require(_0xe80e('0x7'))(_0xe80e('0x8'));var config=require('../../config/environment');var jayson=require(_0xe80e('0x9'));var client=jayson['client'][_0xe80e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c76e7,_0x115769,_0x5ce479){return new BPromise(function(_0x26ad08,_0x2ad388){return client['request'](_0x5c76e7,_0x5ce479)[_0xe80e('0xb')](function(_0xeecff9){logger[_0xe80e('0xc')]('ChatApplication,\x20%s,\x20%s',_0x115769,_0xe80e('0xd'));logger[_0xe80e('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x115769,_0xe80e('0xd'),JSON[_0xe80e('0xf')](_0xeecff9));if(_0xeecff9['error']){if(_0xeecff9[_0xe80e('0x10')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x115769,_0xeecff9[_0xe80e('0x10')][_0xe80e('0x11')]);return _0x2ad388(_0xeecff9[_0xe80e('0x10')][_0xe80e('0x11')]);}logger['error'](_0xe80e('0x12'),_0x115769,_0xeecff9[_0xe80e('0x10')][_0xe80e('0x11')]);return _0x26ad08(_0xeecff9['error']['message']);}else{logger[_0xe80e('0xc')](_0xe80e('0x12'),_0x115769,'request\x20sent');_0x26ad08(_0xeecff9['result']['message']);}})[_0xe80e('0x13')](function(_0x1d5c06){logger[_0xe80e('0x10')](_0xe80e('0x12'),_0x115769,_0x1d5c06);_0x2ad388(_0x1d5c06);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index aa01ce7..1facbb9 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 _0xbef1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete'];(function(_0xca3c23,_0x45c5a3){var _0x4012b2=function(_0x471f72){while(--_0x471f72){_0xca3c23['push'](_0xca3c23['shift']());}};_0x4012b2(++_0x45c5a3);}(_0xbef1,0x154));var _0x1bef=function(_0x4192ad,_0x488f5c){_0x4192ad=_0x4192ad-0x0;var _0x415dc3=_0xbef1[_0x4192ad];return _0x415dc3;};'use strict';var multer=require('multer');var util=require(_0x1bef('0x0'));var path=require(_0x1bef('0x1'));var timeout=require(_0x1bef('0x2'));var express=require(_0x1bef('0x3'));var router=express[_0x1bef('0x4')]();var fs_extra=require(_0x1bef('0x5'));var auth=require(_0x1bef('0x6'));var interaction=require(_0x1bef('0x7'));var config=require(_0x1bef('0x8'));var controller=require(_0x1bef('0x9'));router[_0x1bef('0xa')](_0x1bef('0xb'),auth[_0x1bef('0xc')](),controller[_0x1bef('0xd')]);router[_0x1bef('0xe')]('/:id',auth[_0x1bef('0xc')](),controller[_0x1bef('0xf')]);router[_0x1bef('0x10')](_0x1bef('0xb'),auth[_0x1bef('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd92c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0xd92c,0x1b3));var _0xcd92=function(_0x24d9e5,_0x42e6e2){_0x24d9e5=_0x24d9e5-0x0;var _0x2264b9=_0xd92c[_0x24d9e5];return _0x2264b9;};'use strict';var multer=require(_0xcd92('0x0'));var util=require(_0xcd92('0x1'));var path=require(_0xcd92('0x2'));var timeout=require(_0xcd92('0x3'));var express=require(_0xcd92('0x4'));var router=express[_0xcd92('0x5')]();var fs_extra=require(_0xcd92('0x6'));var auth=require(_0xcd92('0x7'));var interaction=require(_0xcd92('0x8'));var config=require(_0xcd92('0x9'));var controller=require(_0xcd92('0xa'));router['get'](_0xcd92('0xb'),auth[_0xcd92('0xc')](),controller[_0xcd92('0xd')]);router['put'](_0xcd92('0xb'),auth[_0xcd92('0xc')](),controller[_0xcd92('0xe')]);router[_0xcd92('0xf')](_0xcd92('0xb'),auth['isAuthenticated'](),controller[_0xcd92('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 884daf9..1b05094 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 _0x5a4f=['STRING','BOOLEAN','sequelize'];(function(_0x317cc2,_0x3aacf3){var _0x10d052=function(_0x3432ec){while(--_0x3432ec){_0x317cc2['push'](_0x317cc2['shift']());}};_0x10d052(++_0x3aacf3);}(_0x5a4f,0x10d));var _0xf5a4=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5a4f[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0xf5a4('0x0'));module['exports']={'name':{'type':Sequelize[_0xf5a4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xf5a4('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xac73=['STRING','BOOLEAN','sequelize','exports'];(function(_0x14193b,_0x26c176){var _0x3c3e79=function(_0x218d63){while(--_0x218d63){_0x14193b['push'](_0x14193b['shift']());}};_0x3c3e79(++_0x26c176);}(_0xac73,0x186));var _0x3ac7=function(_0x29b602,_0x294bfb){_0x29b602=_0x29b602-0x0;var _0x5e0a5b=_0xac73[_0x29b602];return _0x5e0a5b;};'use strict';var Sequelize=require(_0x3ac7('0x0'));module[_0x3ac7('0x1')]={'name':{'type':Sequelize[_0x3ac7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3ac7('0x2')]},'write':{'type':Sequelize[_0x3ac7('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 8042ef5..e991eda 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 _0x7a6a=['body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','User','pick','getMembers','removeMembers','addMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name','send','ChatGroup','rawAttributes','fieldName','model','map','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create'];(function(_0x353cad,_0x52220e){var _0xc1cfe3=function(_0x3f1c02){while(--_0x3f1c02){_0x353cad['push'](_0x353cad['shift']());}};_0xc1cfe3(++_0x52220e);}(_0x7a6a,0x19b));var _0xa7a6=function(_0x21a0c2,_0x4562da){_0x21a0c2=_0x21a0c2-0x0;var _0xa9659e=_0x7a6a[_0x21a0c2];return _0xa9659e;};'use strict';var emlformat=require(_0xa7a6('0x0'));var rimraf=require(_0xa7a6('0x1'));var zipdir=require(_0xa7a6('0x2'));var jsonpatch=require(_0xa7a6('0x3'));var rp=require(_0xa7a6('0x4'));var moment=require('moment');var BPromise=require(_0xa7a6('0x5'));var Mustache=require(_0xa7a6('0x6'));var util=require(_0xa7a6('0x7'));var path=require('path');var sox=require(_0xa7a6('0x8'));var csv=require(_0xa7a6('0x9'));var ejs=require(_0xa7a6('0xa'));var fs=require('fs');var fs_extra=require(_0xa7a6('0xb'));var _=require(_0xa7a6('0xc'));var squel=require(_0xa7a6('0xd'));var crypto=require(_0xa7a6('0xe'));var jsforce=require(_0xa7a6('0xf'));var deskjs=require(_0xa7a6('0x10'));var toCsv=require(_0xa7a6('0x9'));var querystring=require(_0xa7a6('0x11'));var Papa=require('papaparse');var Redis=require(_0xa7a6('0x12'));var authService=require(_0xa7a6('0x13'));var qs=require(_0xa7a6('0x14'));var as=require(_0xa7a6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a6('0x16'))('api');var utils=require(_0xa7a6('0x17'));var config=require(_0xa7a6('0x18'));var licenseUtil=require(_0xa7a6('0x19'));var db=require(_0xa7a6('0x1a'))['db'];config[_0xa7a6('0x1b')]=_['defaults'](config['redis'],{'host':_0xa7a6('0x1c'),'port':0x18eb});var socket=require(_0xa7a6('0x1d'))(new Redis(config['redis']));require(_0xa7a6('0x1e'))[_0xa7a6('0x1f')](socket);function respondWithStatusCode(_0x58b727,_0x425c6d){_0x425c6d=_0x425c6d||0xcc;return function(_0x1ef935){if(_0x1ef935){return _0x58b727[_0xa7a6('0x20')](_0x425c6d);}return _0x58b727['status'](_0x425c6d)[_0xa7a6('0x21')]();};}function respondWithResult(_0x29b3f2,_0x5565bf){_0x5565bf=_0x5565bf||0xc8;return function(_0x2ff273){if(_0x2ff273){return _0x29b3f2[_0xa7a6('0x22')](_0x5565bf)[_0xa7a6('0x23')](_0x2ff273);}};}function respondWithFilteredResult(_0x223af4,_0x56f3c0){return function(_0x481a7a){if(_0x481a7a){var _0x186b3c=typeof _0x56f3c0[_0xa7a6('0x24')]==='undefined'&&typeof _0x56f3c0[_0xa7a6('0x25')]===_0xa7a6('0x26');var _0x2009af=_0x481a7a['count'];var _0x10db83=_0x186b3c?0x0:_0x56f3c0[_0xa7a6('0x24')];var _0x287a44=_0x186b3c?_0x481a7a[_0xa7a6('0x27')]:_0x56f3c0[_0xa7a6('0x24')]+_0x56f3c0[_0xa7a6('0x25')];var _0x4c7741;if(_0x287a44>=_0x2009af){_0x287a44=_0x2009af;_0x4c7741=0xc8;}else{_0x4c7741=0xce;}_0x223af4[_0xa7a6('0x22')](_0x4c7741);return _0x223af4['set'](_0xa7a6('0x28'),_0x10db83+'-'+_0x287a44+'/'+_0x2009af)[_0xa7a6('0x23')](_0x481a7a);}return null;};}function patchUpdates(_0x5d196e){return function(_0x2a3ec3){try{jsonpatch[_0xa7a6('0x29')](_0x2a3ec3,_0x5d196e,!![]);}catch(_0x3e1105){return BPromise[_0xa7a6('0x2a')](_0x3e1105);}return _0x2a3ec3['save']();};}function saveUpdates(_0x9e8733,_0x3a7c81){return function(_0x56fa49){if(_0x56fa49){return _0x56fa49[_0xa7a6('0x2b')](_0x9e8733)[_0xa7a6('0x2c')](function(_0x517c2a){return _0x517c2a;});}return null;};}function removeEntity(_0x1a265b,_0x32e18b){return function(_0x3dc520){if(_0x3dc520){return _0x3dc520[_0xa7a6('0x2d')]()[_0xa7a6('0x2c')](function(){_0x1a265b[_0xa7a6('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x401ff1,_0xc0594){return function(_0x45f29c){if(!_0x45f29c){_0x401ff1[_0xa7a6('0x20')](0x194);}return _0x45f29c;};}function handleError(_0x2d3d68,_0x5bd74d){_0x5bd74d=_0x5bd74d||0x1f4;return function(_0x281413){logger[_0xa7a6('0x2e')](_0x281413['stack']);if(_0x281413['name']){delete _0x281413[_0xa7a6('0x2f')];}_0x2d3d68[_0xa7a6('0x22')](_0x5bd74d)[_0xa7a6('0x30')](_0x281413);};}exports['index']=function(_0x5edb7a,_0x55249d){var _0x539e5b={},_0x5b8bae={},_0x5aba8a={'count':0x0,'rows':[]};var _0x188268=_['map'](db[_0xa7a6('0x31')][_0xa7a6('0x32')],function(_0x1cfec7){return{'name':_0x1cfec7[_0xa7a6('0x33')],'type':_0x1cfec7['type']['key']};});_0x5b8bae[_0xa7a6('0x34')]=_[_0xa7a6('0x35')](_0x188268,_0xa7a6('0x2f'));_0x5b8bae['query']=_[_0xa7a6('0x36')](_0x5edb7a[_0xa7a6('0x37')]);_0x5b8bae[_0xa7a6('0x38')]=_[_0xa7a6('0x39')](_0x5b8bae[_0xa7a6('0x34')],_0x5b8bae[_0xa7a6('0x37')]);_0x539e5b['attributes']=_['intersection'](_0x5b8bae['model'],qs[_0xa7a6('0x3a')](_0x5edb7a['query'][_0xa7a6('0x3a')]));_0x539e5b['attributes']=_0x539e5b['attributes'][_0xa7a6('0x3b')]?_0x539e5b[_0xa7a6('0x3c')]:_0x5b8bae[_0xa7a6('0x34')];if(!_0x5edb7a[_0xa7a6('0x37')][_0xa7a6('0x3d')](_0xa7a6('0x3e'))){_0x539e5b[_0xa7a6('0x25')]=qs[_0xa7a6('0x25')](_0x5edb7a['query'][_0xa7a6('0x25')]);_0x539e5b[_0xa7a6('0x24')]=qs[_0xa7a6('0x24')](_0x5edb7a['query']['offset']);}_0x539e5b[_0xa7a6('0x3f')]=qs[_0xa7a6('0x40')](_0x5edb7a['query'][_0xa7a6('0x40')]);_0x539e5b[_0xa7a6('0x41')]=qs['filters'](_['pick'](_0x5edb7a[_0xa7a6('0x37')],_0x5b8bae[_0xa7a6('0x38')]),_0x188268);if(_0x5edb7a[_0xa7a6('0x37')]['filter']){_0x539e5b['where']=_[_0xa7a6('0x42')](_0x539e5b[_0xa7a6('0x41')],{'$or':_[_0xa7a6('0x35')](_0x188268,function(_0x46bee2){if(_0x46bee2[_0xa7a6('0x43')]!==_0xa7a6('0x44')){var _0x43ff9e={};_0x43ff9e[_0x46bee2[_0xa7a6('0x2f')]]={'$like':'%'+_0x5edb7a[_0xa7a6('0x37')][_0xa7a6('0x45')]+'%'};return _0x43ff9e;}})});}_0x539e5b=_[_0xa7a6('0x42')]({},_0x539e5b,_0x5edb7a['options']);var _0x39cf9f={'where':_0x539e5b[_0xa7a6('0x41')]};return db[_0xa7a6('0x31')]['count'](_0x39cf9f)['then'](function(_0x163997){_0x5aba8a['count']=_0x163997;if(_0x5edb7a['query'][_0xa7a6('0x46')]){_0x539e5b[_0xa7a6('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0xa7a6('0x48')](_0x539e5b);})['then'](function(_0x3ee11a){_0x5aba8a[_0xa7a6('0x49')]=_0x3ee11a;return _0x5aba8a;})[_0xa7a6('0x2c')](respondWithFilteredResult(_0x55249d,_0x539e5b))[_0xa7a6('0x4a')](handleError(_0x55249d,null));};exports[_0xa7a6('0x4b')]=function(_0x3742d6,_0x50bd8b){var _0x140772={'raw':!![],'where':{'id':_0x3742d6['params']['id']}},_0x53dc64={};_0x53dc64[_0xa7a6('0x34')]=_[_0xa7a6('0x36')](db[_0xa7a6('0x31')][_0xa7a6('0x32')]);_0x53dc64[_0xa7a6('0x37')]=_[_0xa7a6('0x36')](_0x3742d6[_0xa7a6('0x37')]);_0x53dc64[_0xa7a6('0x38')]=_[_0xa7a6('0x39')](_0x53dc64['model'],_0x53dc64[_0xa7a6('0x37')]);_0x140772['attributes']=_['intersection'](_0x53dc64[_0xa7a6('0x34')],qs[_0xa7a6('0x3a')](_0x3742d6['query'][_0xa7a6('0x3a')]));_0x140772['attributes']=_0x140772[_0xa7a6('0x3c')][_0xa7a6('0x3b')]?_0x140772[_0xa7a6('0x3c')]:_0x53dc64['model'];if(_0x3742d6[_0xa7a6('0x37')][_0xa7a6('0x46')]){_0x140772[_0xa7a6('0x47')]=[{'all':!![]}];}_0x140772=_[_0xa7a6('0x42')]({},_0x140772,_0x3742d6[_0xa7a6('0x4c')]);return db[_0xa7a6('0x31')][_0xa7a6('0x4d')](_0x140772)[_0xa7a6('0x2c')](handleEntityNotFound(_0x50bd8b,null))[_0xa7a6('0x2c')](respondWithResult(_0x50bd8b,null))[_0xa7a6('0x4a')](handleError(_0x50bd8b,null));};exports['create']=function(_0x300a3a,_0x1d9881){return db['ChatGroup'][_0xa7a6('0x4e')](_0x300a3a[_0xa7a6('0x4f')],{})[_0xa7a6('0x2c')](respondWithResult(_0x1d9881,0xc9))[_0xa7a6('0x4a')](handleError(_0x1d9881,null));};exports[_0xa7a6('0x2b')]=function(_0x2ccd45,_0x57948e){if(_0x2ccd45[_0xa7a6('0x4f')]['id']){delete _0x2ccd45['body']['id'];}return db[_0xa7a6('0x31')][_0xa7a6('0x4d')]({'where':{'id':_0x2ccd45[_0xa7a6('0x50')]['id']}})[_0xa7a6('0x2c')](handleEntityNotFound(_0x57948e,null))[_0xa7a6('0x2c')](saveUpdates(_0x2ccd45[_0xa7a6('0x4f')],null))[_0xa7a6('0x2c')](respondWithResult(_0x57948e,null))[_0xa7a6('0x4a')](handleError(_0x57948e,null));};exports['destroy']=function(_0x1ff91f,_0x346aa1){return db[_0xa7a6('0x31')]['find']({'where':{'id':_0x1ff91f['params']['id']}})['then'](handleEntityNotFound(_0x346aa1,null))['then'](removeEntity(_0x346aa1,null))['catch'](handleError(_0x346aa1,null));};exports['describe']=function(_0x130cd8,_0x422890){return db[_0xa7a6('0x31')][_0xa7a6('0x51')]()[_0xa7a6('0x2c')](respondWithResult(_0x422890,null))[_0xa7a6('0x4a')](handleError(_0x422890,null));};exports[_0xa7a6('0x52')]=function(_0x2df859,_0x393b39,_0x52db92){return db[_0xa7a6('0x53')][_0xa7a6('0x27')]({'where':{'ChatGroupId':_0x2df859[_0xa7a6('0x50')]['id'],'ToId':_0x2df859[_0xa7a6('0x54')]['id'],'read':![]}})[_0xa7a6('0x2c')](function(_0x3d61c5){return{'id':_[_0xa7a6('0x55')](_0x2df859[_0xa7a6('0x50')]['id']),'count':_0x3d61c5};})[_0xa7a6('0x2c')](respondWithResult(_0x393b39,null))['catch'](handleError(_0x393b39,null));};exports[_0xa7a6('0x56')]=function(_0x34d5dd,_0x3306c8,_0x48f583){return db['ChatGroup'][_0xa7a6('0x4d')]({'where':{'id':_0x34d5dd['params']['id']}})[_0xa7a6('0x2c')](handleEntityNotFound(_0x3306c8,null))[_0xa7a6('0x2c')](function(_0x3b3f7f){if(_0x3b3f7f){return _0x3b3f7f[_0xa7a6('0x56')](_0x34d5dd['body']['ids'],_['omit'](_0x34d5dd[_0xa7a6('0x4f')],[_0xa7a6('0x57'),'id'])||{});}})[_0xa7a6('0x2c')](respondWithResult(_0x3306c8,null))[_0xa7a6('0x4a')](handleError(_0x3306c8,null));};exports['getMembers']=function(_0x41abd8,_0x124ed2,_0x2eef4e){var _0x57941a={};var _0x2b135e={};var _0x46f775;var _0x12eef5;return db['ChatGroup'][_0xa7a6('0x58')]({'where':{'id':_0x41abd8[_0xa7a6('0x50')]['id']}})['then'](handleEntityNotFound(_0x124ed2,null))[_0xa7a6('0x2c')](function(_0x269613){if(_0x269613){_0x46f775=_0x269613;_0x2b135e[_0xa7a6('0x34')]=_[_0xa7a6('0x36')](db[_0xa7a6('0x59')][_0xa7a6('0x32')]);_0x2b135e[_0xa7a6('0x37')]=_[_0xa7a6('0x36')](_0x41abd8['query']);_0x2b135e['filters']=_[_0xa7a6('0x39')](_0x2b135e[_0xa7a6('0x34')],_0x2b135e[_0xa7a6('0x37')]);_0x57941a[_0xa7a6('0x3c')]=_['intersection'](_0x2b135e[_0xa7a6('0x34')],qs['fields'](_0x41abd8['query'][_0xa7a6('0x3a')]));_0x57941a[_0xa7a6('0x3c')]=_0x57941a[_0xa7a6('0x3c')][_0xa7a6('0x3b')]?_0x57941a['attributes']:_0x2b135e[_0xa7a6('0x34')];_0x57941a['order']=qs['sort'](_0x41abd8[_0xa7a6('0x37')][_0xa7a6('0x40')]);_0x57941a['where']=qs['filters'](_[_0xa7a6('0x5a')](_0x41abd8[_0xa7a6('0x37')],_0x2b135e[_0xa7a6('0x38')]));if(_0x41abd8[_0xa7a6('0x37')][_0xa7a6('0x45')]){_0x57941a[_0xa7a6('0x41')]=_[_0xa7a6('0x42')](_0x57941a[_0xa7a6('0x41')],{'$or':_[_0xa7a6('0x35')](_0x57941a[_0xa7a6('0x3c')],function(_0x4cbd2b){var _0x33487c={};_0x33487c[_0x4cbd2b]={'$like':'%'+_0x41abd8['query'][_0xa7a6('0x45')]+'%'};return _0x33487c;})});}_0x57941a=_[_0xa7a6('0x42')]({},_0x57941a,_0x41abd8[_0xa7a6('0x4c')]);return _0x46f775[_0xa7a6('0x5b')](_0x57941a);}})[_0xa7a6('0x2c')](function(_0x4d7e43){if(_0x4d7e43){_0x12eef5=_0x4d7e43[_0xa7a6('0x3b')];if(!_0x41abd8['query'][_0xa7a6('0x3d')]('nolimit')){_0x57941a[_0xa7a6('0x25')]=qs[_0xa7a6('0x25')](_0x41abd8['query'][_0xa7a6('0x25')]);_0x57941a[_0xa7a6('0x24')]=qs['offset'](_0x41abd8[_0xa7a6('0x37')][_0xa7a6('0x24')]);}return _0x46f775['getMembers'](_0x57941a);}})[_0xa7a6('0x2c')](function(_0xb693a0){if(_0xb693a0){return _0xb693a0?{'count':_0x12eef5,'rows':_0xb693a0}:null;}})[_0xa7a6('0x2c')](respondWithResult(_0x124ed2,null))[_0xa7a6('0x4a')](handleError(_0x124ed2,null));};exports[_0xa7a6('0x5c')]=function(_0x231213,_0x167e39,_0x317466){return db['ChatGroup'][_0xa7a6('0x4d')]({'where':{'id':_0x231213[_0xa7a6('0x50')]['id']}})[_0xa7a6('0x2c')](handleEntityNotFound(_0x167e39,null))['then'](function(_0x250580){if(_0x250580){return _0x250580[_0xa7a6('0x5c')](_0x231213[_0xa7a6('0x37')][_0xa7a6('0x57')]);}})[_0xa7a6('0x2c')](respondWithStatusCode(_0x167e39,null))[_0xa7a6('0x4a')](handleError(_0x167e39,null));};exports[_0xa7a6('0x5d')]=function(_0x16f456,_0x420e38,_0x176013){if(_0x16f456[_0xa7a6('0x4f')]['id']){delete _0x16f456[_0xa7a6('0x4f')]['id'];}return db[_0xa7a6('0x31')]['find']({'where':{'id':_0x16f456[_0xa7a6('0x50')]['id']}})[_0xa7a6('0x2c')](handleEntityNotFound(_0x420e38,null))[_0xa7a6('0x2c')](function(_0x377bc2){if(_0x377bc2){_0x16f456[_0xa7a6('0x4f')]['ChatGroupId']=_0x377bc2['id'];return db[_0xa7a6('0x53')]['create'](_0x16f456[_0xa7a6('0x4f')]);}})['then'](respondWithResult(_0x420e38,null))[_0xa7a6('0x4a')](handleError(_0x420e38,null));};exports[_0xa7a6('0x5e')]=function(_0x35dcc5,_0x5cee29,_0x1521f7){var _0x3754f0={};var _0x2a009d={};var _0x26d9f6;var _0x500b4f;return db[_0xa7a6('0x31')][_0xa7a6('0x58')]({'where':{'id':_0x35dcc5[_0xa7a6('0x50')]['id']}})[_0xa7a6('0x2c')](handleEntityNotFound(_0x5cee29,null))[_0xa7a6('0x2c')](function(_0x6f03a9){if(_0x6f03a9){_0x26d9f6=_0x6f03a9;_0x2a009d[_0xa7a6('0x34')]=_['keys'](db[_0xa7a6('0x53')][_0xa7a6('0x32')]);_0x2a009d[_0xa7a6('0x37')]=_[_0xa7a6('0x36')](_0x35dcc5[_0xa7a6('0x37')]);_0x2a009d['filters']=_[_0xa7a6('0x39')](_0x2a009d[_0xa7a6('0x34')],_0x2a009d[_0xa7a6('0x37')]);_0x3754f0['attributes']=_['intersection'](_0x2a009d['model'],qs[_0xa7a6('0x3a')](_0x35dcc5[_0xa7a6('0x37')][_0xa7a6('0x3a')]));_0x3754f0[_0xa7a6('0x3c')]=_0x3754f0[_0xa7a6('0x3c')][_0xa7a6('0x3b')]?_0x3754f0[_0xa7a6('0x3c')]:_0x2a009d[_0xa7a6('0x34')];_0x3754f0[_0xa7a6('0x3f')]=qs[_0xa7a6('0x40')](_0x35dcc5[_0xa7a6('0x37')]['sort']);_0x3754f0[_0xa7a6('0x41')]=qs[_0xa7a6('0x38')](_[_0xa7a6('0x5a')](_0x35dcc5[_0xa7a6('0x37')],_0x2a009d[_0xa7a6('0x38')]));if(_0x35dcc5[_0xa7a6('0x37')][_0xa7a6('0x45')]){_0x3754f0['where']=_[_0xa7a6('0x42')](_0x3754f0['where'],{'$or':_[_0xa7a6('0x35')](_0x3754f0[_0xa7a6('0x3c')],function(_0x53f647){var _0x2ea1bf={};_0x2ea1bf[_0x53f647]={'$like':'%'+_0x35dcc5['query'][_0xa7a6('0x45')]+'%'};return _0x2ea1bf;})});}if(_0x35dcc5[_0xa7a6('0x37')][_0xa7a6('0x5f')]){var _0x588836=_0x35dcc5[_0xa7a6('0x37')]['$gte']['split'](',');var _0x4005fd={};_0x4005fd[_0x588836[0x0]]={'$gte':moment(_0x588836[0x1])[_0xa7a6('0x60')](_0xa7a6('0x61'))};_0x3754f0[_0xa7a6('0x41')]=_[_0xa7a6('0x42')](_0x3754f0[_0xa7a6('0x41')],_0x4005fd);}_0x3754f0=_['merge']({},_0x3754f0,_0x35dcc5['options']);return _0x26d9f6[_0xa7a6('0x5e')](_0x3754f0);}})[_0xa7a6('0x2c')](function(_0x3cf0b){if(_0x3cf0b){_0x500b4f=_0x3cf0b[_0xa7a6('0x3b')];if(!_0x35dcc5['query'][_0xa7a6('0x3d')](_0xa7a6('0x3e'))){_0x3754f0[_0xa7a6('0x25')]=qs[_0xa7a6('0x25')](_0x35dcc5[_0xa7a6('0x37')]['limit']);_0x3754f0[_0xa7a6('0x24')]=qs[_0xa7a6('0x24')](_0x35dcc5[_0xa7a6('0x37')][_0xa7a6('0x24')]);}return _0x26d9f6[_0xa7a6('0x5e')](_0x3754f0);}})[_0xa7a6('0x2c')](function(_0x5b4d91){if(_0x5b4d91){return _0x5b4d91?{'count':_0x500b4f,'rows':_0x5b4d91}:null;}})[_0xa7a6('0x2c')](respondWithResult(_0x5cee29,null))[_0xa7a6('0x4a')](handleError(_0x5cee29,null));};
\ No newline at end of file
+var _0x610d=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','then','includeAll','rows','catch','show','params','fields','include','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','getMembers','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger'];(function(_0x491413,_0x5a439e){var _0x783705=function(_0x54cceb){while(--_0x54cceb){_0x491413['push'](_0x491413['shift']());}};_0x783705(++_0x5a439e);}(_0x610d,0x175));var _0xd610=function(_0x4af78d,_0x10b5e1){_0x4af78d=_0x4af78d-0x0;var _0x1892da=_0x610d[_0x4af78d];return _0x1892da;};'use strict';var emlformat=require(_0xd610('0x0'));var rimraf=require(_0xd610('0x1'));var zipdir=require(_0xd610('0x2'));var jsonpatch=require(_0xd610('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd610('0x4'));var Mustache=require(_0xd610('0x5'));var util=require(_0xd610('0x6'));var path=require(_0xd610('0x7'));var sox=require(_0xd610('0x8'));var csv=require(_0xd610('0x9'));var ejs=require(_0xd610('0xa'));var fs=require('fs');var fs_extra=require(_0xd610('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd610('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd610('0xd'));var toCsv=require(_0xd610('0x9'));var querystring=require(_0xd610('0xe'));var Papa=require(_0xd610('0xf'));var Redis=require(_0xd610('0x10'));var authService=require(_0xd610('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd610('0x12'))(_0xd610('0x13'));var utils=require(_0xd610('0x14'));var config=require(_0xd610('0x15'));var licenseUtil=require(_0xd610('0x16'));var db=require(_0xd610('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd610('0x18'))(new Redis(config['redis']));require(_0xd610('0x19'))[_0xd610('0x1a')](socket);function respondWithStatusCode(_0x45e02a,_0x27eb3c){_0x27eb3c=_0x27eb3c||0xcc;return function(_0x57c982){if(_0x57c982){return _0x45e02a[_0xd610('0x1b')](_0x27eb3c);}return _0x45e02a[_0xd610('0x1c')](_0x27eb3c)[_0xd610('0x1d')]();};}function respondWithResult(_0x3c2173,_0x5ce263){_0x5ce263=_0x5ce263||0xc8;return function(_0x1e70ff){if(_0x1e70ff){return _0x3c2173[_0xd610('0x1c')](_0x5ce263)['json'](_0x1e70ff);}};}function respondWithFilteredResult(_0x373f39,_0x4f4180){return function(_0x195fe9){if(_0x195fe9){var _0x19e318=typeof _0x4f4180[_0xd610('0x1e')]===_0xd610('0x1f')&&typeof _0x4f4180[_0xd610('0x20')]===_0xd610('0x1f');var _0x4fc34b=_0x195fe9[_0xd610('0x21')];var _0x33c86b=_0x19e318?0x0:_0x4f4180[_0xd610('0x1e')];var _0x2da88a=_0x19e318?_0x195fe9[_0xd610('0x21')]:_0x4f4180['offset']+_0x4f4180['limit'];var _0x31fa89;if(_0x2da88a>=_0x4fc34b){_0x2da88a=_0x4fc34b;_0x31fa89=0xc8;}else{_0x31fa89=0xce;}_0x373f39[_0xd610('0x1c')](_0x31fa89);return _0x373f39[_0xd610('0x22')]('Content-Range',_0x33c86b+'-'+_0x2da88a+'/'+_0x4fc34b)[_0xd610('0x23')](_0x195fe9);}return null;};}function patchUpdates(_0x32651e){return function(_0x1d136a){try{jsonpatch[_0xd610('0x24')](_0x1d136a,_0x32651e,!![]);}catch(_0x3b50b8){return BPromise[_0xd610('0x25')](_0x3b50b8);}return _0x1d136a[_0xd610('0x26')]();};}function saveUpdates(_0x254069,_0x2b4ee1){return function(_0x73b73f){if(_0x73b73f){return _0x73b73f[_0xd610('0x27')](_0x254069)['then'](function(_0x762709){return _0x762709;});}return null;};}function removeEntity(_0x5e4379,_0x1b8644){return function(_0x31d56a){if(_0x31d56a){return _0x31d56a['destroy']()['then'](function(){_0x5e4379['status'](0xcc)[_0xd610('0x1d')]();});}};}function handleEntityNotFound(_0x3f2302,_0xfbf197){return function(_0x275fdc){if(!_0x275fdc){_0x3f2302[_0xd610('0x1b')](0x194);}return _0x275fdc;};}function handleError(_0x51c1e0,_0x54261a){_0x54261a=_0x54261a||0x1f4;return function(_0x34581f){logger[_0xd610('0x28')](_0x34581f[_0xd610('0x29')]);if(_0x34581f[_0xd610('0x2a')]){delete _0x34581f['name'];}_0x51c1e0[_0xd610('0x1c')](_0x54261a)[_0xd610('0x2b')](_0x34581f);};}exports[_0xd610('0x2c')]=function(_0x219811,_0x5eddaa){var _0x2f0e36={},_0x15018c={},_0xf8bdb1={'count':0x0,'rows':[]};var _0x2fdf4d=_['map'](db[_0xd610('0x2d')][_0xd610('0x2e')],function(_0x19a767){return{'name':_0x19a767[_0xd610('0x2f')],'type':_0x19a767[_0xd610('0x30')][_0xd610('0x31')]};});_0x15018c[_0xd610('0x32')]=_[_0xd610('0x33')](_0x2fdf4d,_0xd610('0x2a'));_0x15018c[_0xd610('0x34')]=_[_0xd610('0x35')](_0x219811[_0xd610('0x34')]);_0x15018c['filters']=_[_0xd610('0x36')](_0x15018c[_0xd610('0x32')],_0x15018c['query']);_0x2f0e36['attributes']=_[_0xd610('0x36')](_0x15018c[_0xd610('0x32')],qs['fields'](_0x219811[_0xd610('0x34')]['fields']));_0x2f0e36[_0xd610('0x37')]=_0x2f0e36[_0xd610('0x37')][_0xd610('0x38')]?_0x2f0e36[_0xd610('0x37')]:_0x15018c[_0xd610('0x32')];if(!_0x219811[_0xd610('0x34')]['hasOwnProperty']('nolimit')){_0x2f0e36['limit']=qs[_0xd610('0x20')](_0x219811['query'][_0xd610('0x20')]);_0x2f0e36[_0xd610('0x1e')]=qs['offset'](_0x219811[_0xd610('0x34')][_0xd610('0x1e')]);}_0x2f0e36[_0xd610('0x39')]=qs[_0xd610('0x3a')](_0x219811[_0xd610('0x34')][_0xd610('0x3a')]);_0x2f0e36[_0xd610('0x3b')]=qs[_0xd610('0x3c')](_[_0xd610('0x3d')](_0x219811[_0xd610('0x34')],_0x15018c[_0xd610('0x3c')]),_0x2fdf4d);if(_0x219811[_0xd610('0x34')]['filter']){_0x2f0e36[_0xd610('0x3b')]=_[_0xd610('0x3e')](_0x2f0e36['where'],{'$or':_[_0xd610('0x33')](_0x2fdf4d,function(_0x22fa8c){if(_0x22fa8c[_0xd610('0x30')]!==_0xd610('0x3f')){var _0x1569a8={};_0x1569a8[_0x22fa8c[_0xd610('0x2a')]]={'$like':'%'+_0x219811[_0xd610('0x34')][_0xd610('0x40')]+'%'};return _0x1569a8;}})});}_0x2f0e36=_[_0xd610('0x3e')]({},_0x2f0e36,_0x219811[_0xd610('0x41')]);var _0x324f8f={'where':_0x2f0e36[_0xd610('0x3b')]};return db[_0xd610('0x2d')]['count'](_0x324f8f)[_0xd610('0x42')](function(_0x4712a2){_0xf8bdb1[_0xd610('0x21')]=_0x4712a2;if(_0x219811[_0xd610('0x34')][_0xd610('0x43')]){_0x2f0e36['include']=[{'all':!![]}];}return db[_0xd610('0x2d')]['findAll'](_0x2f0e36);})[_0xd610('0x42')](function(_0x32b68d){_0xf8bdb1[_0xd610('0x44')]=_0x32b68d;return _0xf8bdb1;})[_0xd610('0x42')](respondWithFilteredResult(_0x5eddaa,_0x2f0e36))[_0xd610('0x45')](handleError(_0x5eddaa,null));};exports[_0xd610('0x46')]=function(_0x421141,_0x16ffc1){var _0x28f6d2={'raw':!![],'where':{'id':_0x421141[_0xd610('0x47')]['id']}},_0x3bab2f={};_0x3bab2f['model']=_[_0xd610('0x35')](db['ChatGroup'][_0xd610('0x2e')]);_0x3bab2f['query']=_[_0xd610('0x35')](_0x421141['query']);_0x3bab2f['filters']=_[_0xd610('0x36')](_0x3bab2f[_0xd610('0x32')],_0x3bab2f[_0xd610('0x34')]);_0x28f6d2['attributes']=_['intersection'](_0x3bab2f[_0xd610('0x32')],qs[_0xd610('0x48')](_0x421141[_0xd610('0x34')][_0xd610('0x48')]));_0x28f6d2[_0xd610('0x37')]=_0x28f6d2[_0xd610('0x37')][_0xd610('0x38')]?_0x28f6d2[_0xd610('0x37')]:_0x3bab2f[_0xd610('0x32')];if(_0x421141[_0xd610('0x34')][_0xd610('0x43')]){_0x28f6d2[_0xd610('0x49')]=[{'all':!![]}];}_0x28f6d2=_['merge']({},_0x28f6d2,_0x421141[_0xd610('0x41')]);return db[_0xd610('0x2d')][_0xd610('0x4a')](_0x28f6d2)['then'](handleEntityNotFound(_0x16ffc1,null))[_0xd610('0x42')](respondWithResult(_0x16ffc1,null))[_0xd610('0x45')](handleError(_0x16ffc1,null));};exports[_0xd610('0x4b')]=function(_0x2b53fb,_0x28e8ef){return db['ChatGroup'][_0xd610('0x4b')](_0x2b53fb[_0xd610('0x4c')],{})[_0xd610('0x42')](respondWithResult(_0x28e8ef,0xc9))[_0xd610('0x45')](handleError(_0x28e8ef,null));};exports[_0xd610('0x27')]=function(_0x577816,_0x154ba7){if(_0x577816[_0xd610('0x4c')]['id']){delete _0x577816['body']['id'];}return db[_0xd610('0x2d')][_0xd610('0x4a')]({'where':{'id':_0x577816[_0xd610('0x47')]['id']}})[_0xd610('0x42')](handleEntityNotFound(_0x154ba7,null))[_0xd610('0x42')](saveUpdates(_0x577816['body'],null))[_0xd610('0x42')](respondWithResult(_0x154ba7,null))[_0xd610('0x45')](handleError(_0x154ba7,null));};exports[_0xd610('0x4d')]=function(_0x1fcafe,_0x172f17){return db[_0xd610('0x2d')][_0xd610('0x4a')]({'where':{'id':_0x1fcafe[_0xd610('0x47')]['id']}})['then'](handleEntityNotFound(_0x172f17,null))['then'](removeEntity(_0x172f17,null))['catch'](handleError(_0x172f17,null));};exports[_0xd610('0x4e')]=function(_0x10e057,_0x5b7039){return db[_0xd610('0x2d')][_0xd610('0x4e')]()[_0xd610('0x42')](respondWithResult(_0x5b7039,null))[_0xd610('0x45')](handleError(_0x5b7039,null));};exports[_0xd610('0x4f')]=function(_0x468c0d,_0x4d0690,_0x3ca62b){return db[_0xd610('0x50')][_0xd610('0x21')]({'where':{'ChatGroupId':_0x468c0d[_0xd610('0x47')]['id'],'ToId':_0x468c0d[_0xd610('0x51')]['id'],'read':![]}})['then'](function(_0x3aeb6b){return{'id':_[_0xd610('0x52')](_0x468c0d['params']['id']),'count':_0x3aeb6b};})[_0xd610('0x42')](respondWithResult(_0x4d0690,null))[_0xd610('0x45')](handleError(_0x4d0690,null));};exports[_0xd610('0x53')]=function(_0x101572,_0x48e04d,_0x117f55){return db[_0xd610('0x2d')]['find']({'where':{'id':_0x101572[_0xd610('0x47')]['id']}})[_0xd610('0x42')](handleEntityNotFound(_0x48e04d,null))['then'](function(_0x374d1a){if(_0x374d1a){return _0x374d1a[_0xd610('0x53')](_0x101572[_0xd610('0x4c')][_0xd610('0x54')],_[_0xd610('0x55')](_0x101572[_0xd610('0x4c')],[_0xd610('0x54'),'id'])||{});}})['then'](respondWithResult(_0x48e04d,null))[_0xd610('0x45')](handleError(_0x48e04d,null));};exports['getMembers']=function(_0x5541d9,_0x2a7f0f,_0x214a80){var _0x37a04d={};var _0x4fccf2={};var _0x20d835;var _0xa6052f;return db[_0xd610('0x2d')][_0xd610('0x56')]({'where':{'id':_0x5541d9[_0xd610('0x47')]['id']}})[_0xd610('0x42')](handleEntityNotFound(_0x2a7f0f,null))[_0xd610('0x42')](function(_0x55b630){if(_0x55b630){_0x20d835=_0x55b630;_0x4fccf2[_0xd610('0x32')]=_[_0xd610('0x35')](db[_0xd610('0x57')][_0xd610('0x2e')]);_0x4fccf2[_0xd610('0x34')]=_[_0xd610('0x35')](_0x5541d9['query']);_0x4fccf2[_0xd610('0x3c')]=_[_0xd610('0x36')](_0x4fccf2[_0xd610('0x32')],_0x4fccf2[_0xd610('0x34')]);_0x37a04d[_0xd610('0x37')]=_[_0xd610('0x36')](_0x4fccf2[_0xd610('0x32')],qs[_0xd610('0x48')](_0x5541d9[_0xd610('0x34')][_0xd610('0x48')]));_0x37a04d[_0xd610('0x37')]=_0x37a04d[_0xd610('0x37')][_0xd610('0x38')]?_0x37a04d[_0xd610('0x37')]:_0x4fccf2[_0xd610('0x32')];_0x37a04d[_0xd610('0x39')]=qs[_0xd610('0x3a')](_0x5541d9['query']['sort']);_0x37a04d[_0xd610('0x3b')]=qs[_0xd610('0x3c')](_[_0xd610('0x3d')](_0x5541d9['query'],_0x4fccf2[_0xd610('0x3c')]));if(_0x5541d9['query'][_0xd610('0x40')]){_0x37a04d[_0xd610('0x3b')]=_[_0xd610('0x3e')](_0x37a04d['where'],{'$or':_['map'](_0x37a04d[_0xd610('0x37')],function(_0x4a35ee){var _0x5d116c={};_0x5d116c[_0x4a35ee]={'$like':'%'+_0x5541d9[_0xd610('0x34')][_0xd610('0x40')]+'%'};return _0x5d116c;})});}_0x37a04d=_[_0xd610('0x3e')]({},_0x37a04d,_0x5541d9[_0xd610('0x41')]);return _0x20d835[_0xd610('0x58')](_0x37a04d);}})['then'](function(_0x343341){if(_0x343341){_0xa6052f=_0x343341[_0xd610('0x38')];if(!_0x5541d9[_0xd610('0x34')][_0xd610('0x59')](_0xd610('0x5a'))){_0x37a04d[_0xd610('0x20')]=qs['limit'](_0x5541d9[_0xd610('0x34')]['limit']);_0x37a04d['offset']=qs[_0xd610('0x1e')](_0x5541d9[_0xd610('0x34')][_0xd610('0x1e')]);}return _0x20d835['getMembers'](_0x37a04d);}})['then'](function(_0x41d208){if(_0x41d208){return _0x41d208?{'count':_0xa6052f,'rows':_0x41d208}:null;}})[_0xd610('0x42')](respondWithResult(_0x2a7f0f,null))[_0xd610('0x45')](handleError(_0x2a7f0f,null));};exports[_0xd610('0x5b')]=function(_0x17896a,_0x3b8a43,_0x3ca233){return db['ChatGroup']['find']({'where':{'id':_0x17896a['params']['id']}})['then'](handleEntityNotFound(_0x3b8a43,null))[_0xd610('0x42')](function(_0x1f8223){if(_0x1f8223){return _0x1f8223[_0xd610('0x5b')](_0x17896a['query']['ids']);}})[_0xd610('0x42')](respondWithStatusCode(_0x3b8a43,null))[_0xd610('0x45')](handleError(_0x3b8a43,null));};exports[_0xd610('0x5c')]=function(_0x550363,_0x32f7ee,_0x504a53){if(_0x550363[_0xd610('0x4c')]['id']){delete _0x550363[_0xd610('0x4c')]['id'];}return db['ChatGroup'][_0xd610('0x4a')]({'where':{'id':_0x550363[_0xd610('0x47')]['id']}})[_0xd610('0x42')](handleEntityNotFound(_0x32f7ee,null))[_0xd610('0x42')](function(_0xd06c64){if(_0xd06c64){_0x550363[_0xd610('0x4c')][_0xd610('0x5d')]=_0xd06c64['id'];return db[_0xd610('0x50')][_0xd610('0x4b')](_0x550363[_0xd610('0x4c')]);}})['then'](respondWithResult(_0x32f7ee,null))[_0xd610('0x45')](handleError(_0x32f7ee,null));};exports[_0xd610('0x5e')]=function(_0x4b7b8a,_0x598f14,_0x34fe23){var _0x4e881d={};var _0x1372f4={};var _0x28379e;var _0x4d0fa7;return db['ChatGroup'][_0xd610('0x56')]({'where':{'id':_0x4b7b8a[_0xd610('0x47')]['id']}})[_0xd610('0x42')](handleEntityNotFound(_0x598f14,null))[_0xd610('0x42')](function(_0x1f4a36){if(_0x1f4a36){_0x28379e=_0x1f4a36;_0x1372f4[_0xd610('0x32')]=_[_0xd610('0x35')](db[_0xd610('0x50')][_0xd610('0x2e')]);_0x1372f4[_0xd610('0x34')]=_[_0xd610('0x35')](_0x4b7b8a[_0xd610('0x34')]);_0x1372f4[_0xd610('0x3c')]=_[_0xd610('0x36')](_0x1372f4['model'],_0x1372f4['query']);_0x4e881d[_0xd610('0x37')]=_[_0xd610('0x36')](_0x1372f4[_0xd610('0x32')],qs[_0xd610('0x48')](_0x4b7b8a['query'][_0xd610('0x48')]));_0x4e881d[_0xd610('0x37')]=_0x4e881d[_0xd610('0x37')][_0xd610('0x38')]?_0x4e881d[_0xd610('0x37')]:_0x1372f4[_0xd610('0x32')];_0x4e881d[_0xd610('0x39')]=qs['sort'](_0x4b7b8a[_0xd610('0x34')]['sort']);_0x4e881d[_0xd610('0x3b')]=qs['filters'](_[_0xd610('0x3d')](_0x4b7b8a[_0xd610('0x34')],_0x1372f4[_0xd610('0x3c')]));if(_0x4b7b8a[_0xd610('0x34')][_0xd610('0x40')]){_0x4e881d['where']=_[_0xd610('0x3e')](_0x4e881d[_0xd610('0x3b')],{'$or':_[_0xd610('0x33')](_0x4e881d[_0xd610('0x37')],function(_0x3646f3){var _0xda7fda={};_0xda7fda[_0x3646f3]={'$like':'%'+_0x4b7b8a[_0xd610('0x34')][_0xd610('0x40')]+'%'};return _0xda7fda;})});}if(_0x4b7b8a[_0xd610('0x34')][_0xd610('0x5f')]){var _0xbfec2e=_0x4b7b8a['query'][_0xd610('0x5f')][_0xd610('0x60')](',');var _0x1fe060={};_0x1fe060[_0xbfec2e[0x0]]={'$gte':moment(_0xbfec2e[0x1])['format'](_0xd610('0x61'))};_0x4e881d[_0xd610('0x3b')]=_[_0xd610('0x3e')](_0x4e881d['where'],_0x1fe060);}_0x4e881d=_['merge']({},_0x4e881d,_0x4b7b8a[_0xd610('0x41')]);return _0x28379e[_0xd610('0x5e')](_0x4e881d);}})['then'](function(_0x59f3d1){if(_0x59f3d1){_0x4d0fa7=_0x59f3d1[_0xd610('0x38')];if(!_0x4b7b8a['query'][_0xd610('0x59')]('nolimit')){_0x4e881d[_0xd610('0x20')]=qs[_0xd610('0x20')](_0x4b7b8a[_0xd610('0x34')][_0xd610('0x20')]);_0x4e881d[_0xd610('0x1e')]=qs[_0xd610('0x1e')](_0x4b7b8a['query']['offset']);}return _0x28379e[_0xd610('0x5e')](_0x4e881d);}})[_0xd610('0x42')](function(_0xee5375){if(_0xee5375){return _0xee5375?{'count':_0x4d0fa7,'rows':_0xee5375}:null;}})[_0xd610('0x42')](respondWithResult(_0x598f14,null))['catch'](handleError(_0x598f14,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 52ec80b..37bade5 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 _0xba37=['emit','exports','events','ChatGroup','save','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xba37,0xb6));var _0x7ba3=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xba37[_0x500419];return _0x241c1a;};'use strict';var EventEmitter=require(_0x7ba3('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x7ba3('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ba3('0x2'),'afterUpdate':'update','afterDestroy':_0x7ba3('0x3')};function emitEvent(_0x413255){return function(_0x318802,_0x180ebc,_0x1ad964){ChatGroupEvents['emit'](_0x413255+':'+_0x318802['id'],_0x318802);ChatGroupEvents[_0x7ba3('0x4')](_0x413255,_0x318802);_0x1ad964(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x7ba3('0x5')]=ChatGroupEvents;
\ No newline at end of file
+var _0x161c=['exports','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0x161c,0xb7));var _0xc161=function(_0x3cb5bb,_0x272e35){_0x3cb5bb=_0x3cb5bb-0x0;var _0x2c765f=_0x161c[_0x3cb5bb];return _0x2c765f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xc161('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc161('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc161('0x2'),'afterDestroy':'remove'};function emitEvent(_0x336a55){return function(_0x2d9ae2,_0x4653a3,_0xa9e9ef){ChatGroupEvents[_0xc161('0x3')](_0x336a55+':'+_0x2d9ae2['id'],_0x2d9ae2);ChatGroupEvents[_0xc161('0x3')](_0x336a55,_0x2d9ae2);_0xa9e9ef(null);};}for(var e in events){if(events[_0xc161('0x4')](e)){var event=events[e];ChatGroup[_0xc161('0x5')](e,emitEvent(event));}}module[_0xc161('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index f123d67..a9618c5 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 _0x3553=['util','api','bluebird','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3553,0x10d));var _0x3355=function(_0x50cd20,_0xe3ff25){_0x50cd20=_0x50cd20-0x0;var _0x3506e1=_0x3553[_0x50cd20];return _0x3506e1;};'use strict';var _=require(_0x3355('0x0'));var util=require(_0x3355('0x1'));var logger=require('../../config/logger')(_0x3355('0x2'));var moment=require('moment');var BPromise=require(_0x3355('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3355('0x4'));var config=require(_0x3355('0x5'));var attributes=require(_0x3355('0x6'));module[_0x3355('0x7')]=function(_0x3744df,_0x3a6c06){return _0x3744df['define']('ChatGroup',attributes,{'tableName':_0x3355('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc54d=['api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','lodash','util','../../config/logger'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xc54d,0x173));var _0xdc54=function(_0x4ef34e,_0x11ac32){_0x4ef34e=_0x4ef34e-0x0;var _0x3a6f82=_0xc54d[_0x4ef34e];return _0x3a6f82;};'use strict';var _=require(_0xdc54('0x0'));var util=require(_0xdc54('0x1'));var logger=require(_0xdc54('0x2'))(_0xdc54('0x3'));var moment=require(_0xdc54('0x4'));var BPromise=require(_0xdc54('0x5'));var rp=require(_0xdc54('0x6'));var fs=require('fs');var path=require(_0xdc54('0x7'));var rimraf=require(_0xdc54('0x8'));var config=require('../../config/environment');var attributes=require(_0xdc54('0x9'));module[_0xdc54('0xa')]=function(_0x222526,_0x280da7){return _0x222526['define']('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 1fb5799..5f96770 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 _0xc4f5=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatGroup,\x20%s,\x20%s'];(function(_0x2f4878,_0x5bf834){var _0x1c22ac=function(_0x288f20){while(--_0x288f20){_0x2f4878['push'](_0x2f4878['shift']());}};_0x1c22ac(++_0x5bf834);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x1f1641,_0x42ad9d){_0x1f1641=_0x1f1641-0x0;var _0x9660b4=_0xc4f5[_0x1f1641];return _0x9660b4;};'use strict';var _=require('lodash');var util=require(_0x5c4f('0x0'));var moment=require(_0x5c4f('0x1'));var BPromise=require(_0x5c4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c4f('0x3'));var db=require(_0x5c4f('0x4'))['db'];var utils=require(_0x5c4f('0x5'));var logger=require(_0x5c4f('0x6'))(_0x5c4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c4f('0x8'));var client=jayson[_0x5c4f('0x9')][_0x5c4f('0xa')]({'port':0x232a});config[_0x5c4f('0xb')]=_[_0x5c4f('0xc')](config['redis'],{'host':_0x5c4f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c4f('0xb')]));require('./chatGroup.socket')[_0x5c4f('0xe')](socket);function respondWithRpcPromise(_0x458348,_0x19623c,_0x56535a){return new BPromise(function(_0x249955,_0x2a9bf9){return client[_0x5c4f('0xf')](_0x458348,_0x56535a)['then'](function(_0x255e5d){logger[_0x5c4f('0x10')]('ChatGroup,\x20%s,\x20%s',_0x19623c,_0x5c4f('0x11'));logger[_0x5c4f('0x12')](_0x5c4f('0x13'),_0x19623c,_0x5c4f('0x11'),JSON[_0x5c4f('0x14')](_0x255e5d));if(_0x255e5d['error']){if(_0x255e5d['error'][_0x5c4f('0x15')]===0x1f4){logger[_0x5c4f('0x16')](_0x5c4f('0x17'),_0x19623c,_0x255e5d[_0x5c4f('0x16')][_0x5c4f('0x18')]);return _0x2a9bf9(_0x255e5d['error']['message']);}logger[_0x5c4f('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19623c,_0x255e5d['error'][_0x5c4f('0x18')]);return _0x249955(_0x255e5d['error'][_0x5c4f('0x18')]);}else{logger[_0x5c4f('0x10')](_0x5c4f('0x17'),_0x19623c,_0x5c4f('0x11'));_0x249955(_0x255e5d[_0x5c4f('0x19')][_0x5c4f('0x18')]);}})[_0x5c4f('0x1a')](function(_0x3ec0ff){logger[_0x5c4f('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19623c,_0x3ec0ff);_0x2a9bf9(_0x3ec0ff);});});}
\ No newline at end of file
+var _0xaeaf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x3c0224,_0x243e3e){var _0x315ce8=function(_0x2c0659){while(--_0x2c0659){_0x3c0224['push'](_0x3c0224['shift']());}};_0x315ce8(++_0x243e3e);}(_0xaeaf,0x14e));var _0xfaea=function(_0x2ef644,_0x2ab0ff){_0x2ef644=_0x2ef644-0x0;var _0x11f00e=_0xaeaf[_0x2ef644];return _0x11f00e;};'use strict';var _=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var moment=require(_0xfaea('0x2'));var BPromise=require(_0xfaea('0x3'));var rs=require(_0xfaea('0x4'));var fs=require('fs');var Redis=require(_0xfaea('0x5'));var db=require(_0xfaea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaea('0x7'))(_0xfaea('0x8'));var config=require(_0xfaea('0x9'));var jayson=require(_0xfaea('0xa'));var client=jayson['client'][_0xfaea('0xb')]({'port':0x232a});config[_0xfaea('0xc')]=_[_0xfaea('0xd')](config[_0xfaea('0xc')],{'host':_0xfaea('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaea('0xc')]));require(_0xfaea('0xf'))['register'](socket);function respondWithRpcPromise(_0x191039,_0x3c1f4d,_0x2462f5){return new BPromise(function(_0x5078b6,_0x116379){return client[_0xfaea('0x10')](_0x191039,_0x2462f5)[_0xfaea('0x11')](function(_0x5c4746){logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));logger[_0xfaea('0x15')](_0xfaea('0x16'),_0x3c1f4d,'request\x20sent',JSON[_0xfaea('0x17')](_0x5c4746));if(_0x5c4746['error']){if(_0x5c4746[_0xfaea('0x18')]['code']===0x1f4){logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error'][_0xfaea('0x19')]);return _0x116379(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error']['message']);return _0x5078b6(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}else{logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));_0x5078b6(_0x5c4746[_0xfaea('0x1a')][_0xfaea('0x19')]);}})[_0xfaea('0x1b')](function(_0x328924){logger[_0xfaea('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3c1f4d,_0x328924);_0x116379(_0x328924);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e727238..28114e9 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 _0x0cad=['length','chatGroup:','./chatGroup.events','save','remove','update','emit','register'];(function(_0x38a247,_0x2d72bf){var _0x17a3b0=function(_0x5d201a){while(--_0x5d201a){_0x38a247['push'](_0x38a247['shift']());}};_0x17a3b0(++_0x2d72bf);}(_0x0cad,0x82));var _0xd0ca=function(_0x16972f,_0x24951d){_0x16972f=_0x16972f-0x0;var _0x3e2509=_0x0cad[_0x16972f];return _0x3e2509;};'use strict';var ChatGroupEvents=require(_0xd0ca('0x0'));var events=[_0xd0ca('0x1'),_0xd0ca('0x2'),_0xd0ca('0x3')];function createListener(_0x1681dc,_0x261c60){return function(_0x5bff60){_0x261c60[_0xd0ca('0x4')](_0x1681dc,_0x5bff60);};}function removeListener(_0x5c77fe,_0xeedf84){return function(){ChatGroupEvents['removeListener'](_0x5c77fe,_0xeedf84);};}exports[_0xd0ca('0x5')]=function(_0x324e74){for(var _0x3946bf=0x0,_0x155e3c=events[_0xd0ca('0x6')];_0x3946bf<_0x155e3c;_0x3946bf++){var _0x4ae3d6=events[_0x3946bf];var _0x40f76d=createListener(_0xd0ca('0x7')+_0x4ae3d6,_0x324e74);ChatGroupEvents['on'](_0x4ae3d6,_0x40f76d);}};
\ No newline at end of file
+var _0x2e56=['save','remove','emit','length','chatGroup:','./chatGroup.events'];(function(_0x4fccf1,_0x1c7cb3){var _0x1de5d9=function(_0x2b2e58){while(--_0x2b2e58){_0x4fccf1['push'](_0x4fccf1['shift']());}};_0x1de5d9(++_0x1c7cb3);}(_0x2e56,0x149));var _0x62e5=function(_0xae282f,_0x2d9368){_0xae282f=_0xae282f-0x0;var _0x5f46d4=_0x2e56[_0xae282f];return _0x5f46d4;};'use strict';var ChatGroupEvents=require(_0x62e5('0x0'));var events=[_0x62e5('0x1'),_0x62e5('0x2'),'update'];function createListener(_0x4c6c43,_0x149ca2){return function(_0x423601){_0x149ca2[_0x62e5('0x3')](_0x4c6c43,_0x423601);};}function removeListener(_0x1898d2,_0x278ac3){return function(){ChatGroupEvents['removeListener'](_0x1898d2,_0x278ac3);};}exports['register']=function(_0x5a649f){for(var _0xae5289=0x0,_0x25b884=events[_0x62e5('0x4')];_0xae5289<_0x25b884;_0xae5289++){var _0x31d06a=events[_0xae5289];var _0x14cd26=createListener(_0x62e5('0x5')+_0x31d06a,_0x5a649f);ChatGroupEvents['on'](_0x31d06a,_0x14cd26);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8e2c961..8ed2584 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 _0xd022=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','update','delete','destroy','removeMembers'];(function(_0xe13ec5,_0x45efea){var _0x219c41=function(_0x4f8f96){while(--_0x4f8f96){_0xe13ec5['push'](_0xe13ec5['shift']());}};_0x219c41(++_0x45efea);}(_0xd022,0x106));var _0x2d02=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xd022[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x2d02('0x0'));var util=require(_0x2d02('0x1'));var path=require(_0x2d02('0x2'));var timeout=require(_0x2d02('0x3'));var express=require(_0x2d02('0x4'));var router=express['Router']();var fs_extra=require(_0x2d02('0x5'));var auth=require(_0x2d02('0x6'));var interaction=require(_0x2d02('0x7'));var config=require(_0x2d02('0x8'));var controller=require(_0x2d02('0x9'));router[_0x2d02('0xa')]('/',auth[_0x2d02('0xb')](),controller[_0x2d02('0xc')]);router['get'](_0x2d02('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x2d02('0xa')](_0x2d02('0xe'),auth[_0x2d02('0xb')](),controller[_0x2d02('0xf')]);router[_0x2d02('0xa')](_0x2d02('0x10'),auth[_0x2d02('0xb')](),controller[_0x2d02('0x11')]);router[_0x2d02('0xa')](_0x2d02('0x12'),auth['isAuthenticated'](),controller[_0x2d02('0x13')]);router[_0x2d02('0xa')](_0x2d02('0x14'),auth[_0x2d02('0xb')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x2d02('0x15')]);router[_0x2d02('0x16')](_0x2d02('0x12'),auth[_0x2d02('0xb')](),controller[_0x2d02('0x17')]);router[_0x2d02('0x16')](_0x2d02('0x14'),auth['isAuthenticated'](),controller['addMessage']);router['put'](_0x2d02('0xe'),auth[_0x2d02('0xb')](),controller[_0x2d02('0x18')]);router[_0x2d02('0x19')](_0x2d02('0xe'),auth[_0x2d02('0xb')](),controller[_0x2d02('0x1a')]);router['delete'](_0x2d02('0x12'),auth[_0x2d02('0xb')](),controller[_0x2d02('0x1b')]);module[_0x2d02('0x1c')]=router;
\ No newline at end of file
+var _0xb0f5=['post','create','addMembers','put','delete','removeMembers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x28a8ca,_0x3d211a){var _0x1d5dfc=function(_0x376388){while(--_0x376388){_0x28a8ca['push'](_0x28a8ca['shift']());}};_0x1d5dfc(++_0x3d211a);}(_0xb0f5,0x18d));var _0x5b0f=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xb0f5[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5b0f('0x0'));var timeout=require(_0x5b0f('0x1'));var express=require(_0x5b0f('0x2'));var router=express[_0x5b0f('0x3')]();var fs_extra=require(_0x5b0f('0x4'));var auth=require(_0x5b0f('0x5'));var interaction=require(_0x5b0f('0x6'));var config=require('../../config/environment');var controller=require(_0x5b0f('0x7'));router[_0x5b0f('0x8')]('/',auth[_0x5b0f('0x9')](),controller['index']);router['get'](_0x5b0f('0xa'),auth[_0x5b0f('0x9')](),controller[_0x5b0f('0xb')]);router[_0x5b0f('0x8')](_0x5b0f('0xc'),auth[_0x5b0f('0x9')](),controller[_0x5b0f('0xd')]);router[_0x5b0f('0x8')](_0x5b0f('0xe'),auth[_0x5b0f('0x9')](),controller[_0x5b0f('0xf')]);router['get'](_0x5b0f('0x10'),auth[_0x5b0f('0x9')](),controller[_0x5b0f('0x11')]);router[_0x5b0f('0x8')](_0x5b0f('0x12'),auth[_0x5b0f('0x9')](),controller['getMessages']);router[_0x5b0f('0x13')]('/',auth[_0x5b0f('0x9')](),controller[_0x5b0f('0x14')]);router[_0x5b0f('0x13')]('/:id/members',auth[_0x5b0f('0x9')](),controller[_0x5b0f('0x15')]);router[_0x5b0f('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x5b0f('0x16')](_0x5b0f('0xc'),auth[_0x5b0f('0x9')](),controller['update']);router[_0x5b0f('0x17')](_0x5b0f('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x5b0f('0x17')](_0x5b0f('0x10'),auth[_0x5b0f('0x9')](),controller[_0x5b0f('0x18')]);module[_0x5b0f('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index a93ca31..66c1917 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 _0x928c=['TEXT','DATE','STRING','long','out','BOOLEAN','INTEGER','star','thumb'];(function(_0x24f69b,_0x432b8f){var _0x272ad6=function(_0x1b529a){while(--_0x1b529a){_0x24f69b['push'](_0x24f69b['shift']());}};_0x272ad6(++_0x432b8f);}(_0x928c,0x17f));var _0xc928=function(_0x25cd1b,_0x4cf5b4){_0x25cd1b=_0x25cd1b-0x0;var _0x4ef60d=_0x928c[_0x25cd1b];return _0x4ef60d;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xc928('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc928('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0xc928('0x2'),_0xc928('0x3')),'defaultValue':_0xc928('0x2')},'ratingMessage':{'type':Sequelize[_0xc928('0x4')]},'pathTranscript':{'type':Sequelize[_0xc928('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc928('0x5')]},'disposition':{'type':Sequelize[_0xc928('0x6')]},'secondDisposition':{'type':Sequelize[_0xc928('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xc928('0x6')]},'osName':{'type':Sequelize[_0xc928('0x6')]},'osVersion':{'type':Sequelize[_0xc928('0x6')]},'deviceModel':{'type':Sequelize[_0xc928('0x6')]},'deviceVendor':{'type':Sequelize[_0xc928('0x6')]},'deviceType':{'type':Sequelize[_0xc928('0x6')]},'referer':{'type':Sequelize[_0xc928('0x4')]},'customerIp':{'type':Sequelize[_0xc928('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xc928('0x7'))},'read1stAt':{'type':Sequelize[_0xc928('0x5')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc928('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xc928('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xc928('0x0')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9ffd=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x5ee635,_0x117d58){var _0x51d9be=function(_0x34f0e2){while(--_0x34f0e2){_0x5ee635['push'](_0x5ee635['shift']());}};_0x51d9be(++_0x117d58);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x47e7f3,_0x9bad04){_0x47e7f3=_0x47e7f3-0x0;var _0x128801=_0x9ffd[_0x47e7f3];return _0x128801;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'closed':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xd9ff('0x3')](_0xd9ff('0x4'),_0xd9ff('0x5')),'defaultValue':_0xd9ff('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd9ff('0x6')]},'mailTranscript':{'type':Sequelize[_0xd9ff('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd9ff('0x7')]},'secondDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'thirdDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'note':{'type':Sequelize[_0xd9ff('0x7')]},'browserName':{'type':Sequelize[_0xd9ff('0x7')]},'browserVersion':{'type':Sequelize[_0xd9ff('0x7')]},'osName':{'type':Sequelize[_0xd9ff('0x7')]},'osVersion':{'type':Sequelize[_0xd9ff('0x7')]},'deviceModel':{'type':Sequelize[_0xd9ff('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd9ff('0x6')](_0xd9ff('0x8'))},'read1stAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xd9ff('0x3')]('in',_0xd9ff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd9ff('0x7')]},'customerPort':{'type':Sequelize[_0xd9ff('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 5889132..a0f7aa0 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 _0xff23=['format','Visitor','website_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','keys','filters','nolimit','order','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','hasOwnProperty','ChatInteractionId','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','transcript-%d-%s.zip','push','CmContact','firstName','attachments','createdAt','direction','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerPort','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','merge','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','model','attributes','intersection','fields','length','includeAll','include','find','create','body','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','params','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','attachmentUpload','mimetype','Attachment','attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','server/files/attachments/','basename','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','ContactId','%s%d','agentAlias','System','customer'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xff23,0x1ee));var _0x3ff2=function(_0x205406,_0x11b6e0){_0x205406=_0x205406-0x0;var _0x238b92=_0xff23[_0x205406];return _0x238b92;};'use strict';var rimraf=require(_0x3ff2('0x0'));var zipdir=require(_0x3ff2('0x1'));var rp=require(_0x3ff2('0x2'));var moment=require(_0x3ff2('0x3'));var BPromise=require(_0x3ff2('0x4'));var Mustache=require('mustache');var util=require(_0x3ff2('0x5'));var path=require(_0x3ff2('0x6'));var ejs=require(_0x3ff2('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x3ff2('0x8'));var interaction=require(_0x3ff2('0x9'));var qs=require(_0x3ff2('0xa'));var pdf=require(_0x3ff2('0xb'));var logger=require('../../config/logger')(_0x3ff2('0xc'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3ff2('0xd')]=_['defaults'](config[_0x3ff2('0xd')],{'host':_0x3ff2('0xe'),'port':0x18eb});var socket=require(_0x3ff2('0xf'))(new Redis(config['redis']));require(_0x3ff2('0x10'))[_0x3ff2('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3ff2('0x12')]['http']({'port':0x232b});var client9004=jayson['client'][_0x3ff2('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x217576,_0x5c152c,_0x1892d5,_0x1161d6){return new BPromise(function(_0x174327,_0x23dbab){var _0x36f51e=_0x1161d6||client;return _0x36f51e[_0x3ff2('0x14')](_0x217576,_0x1892d5)[_0x3ff2('0x15')](function(_0x201886){logger['info'](_0x3ff2('0x16'),_0x5c152c,_0x3ff2('0x17'));logger[_0x3ff2('0x18')](_0x3ff2('0x19'),_0x5c152c,_0x3ff2('0x17'),JSON[_0x3ff2('0x1a')](_0x201886));if(_0x201886[_0x3ff2('0x1b')]){if(_0x201886[_0x3ff2('0x1b')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5c152c,_0x201886['error'][_0x3ff2('0x1c')]);return _0x23dbab(_0x201886['error'][_0x3ff2('0x1c')]);}logger[_0x3ff2('0x1b')](_0x3ff2('0x16'),_0x5c152c,_0x201886[_0x3ff2('0x1b')][_0x3ff2('0x1c')]);return _0x174327(_0x201886[_0x3ff2('0x1b')][_0x3ff2('0x1c')]);}else{logger[_0x3ff2('0x1d')](_0x3ff2('0x16'),_0x5c152c,_0x3ff2('0x17'));_0x174327(_0x201886[_0x3ff2('0x1e')][_0x3ff2('0x1c')]);}})[_0x3ff2('0x1f')](function(_0x45ef57){logger[_0x3ff2('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x5c152c,_0x45ef57);_0x23dbab(_0x45ef57);});});}function respondWithStatusCode(_0x5742f5,_0x972a74){_0x972a74=_0x972a74||0xcc;return function(_0x10d9c9){if(_0x10d9c9){return _0x5742f5[_0x3ff2('0x20')](_0x972a74);}return _0x5742f5[_0x3ff2('0x21')](_0x972a74)[_0x3ff2('0x22')]();};}function respondWithResult(_0x4a2cdc,_0xf8f32){_0xf8f32=_0xf8f32||0xc8;return function(_0x30610b){if(_0x30610b){return _0x4a2cdc['status'](_0xf8f32)[_0x3ff2('0x23')](_0x30610b);}};}function respondWithFilteredResult(_0x538cb7,_0x2b1203){return function(_0x4de4ce){if(_0x4de4ce){var _0x175340=typeof _0x2b1203[_0x3ff2('0x24')]===_0x3ff2('0x25')&&typeof _0x2b1203[_0x3ff2('0x26')]==='undefined';var _0x47cd32=_0x4de4ce[_0x3ff2('0x27')];var _0x78b989=_0x175340?0x0:_0x2b1203[_0x3ff2('0x24')];var _0x9f2201=_0x175340?_0x4de4ce[_0x3ff2('0x27')]:_0x2b1203[_0x3ff2('0x24')]+_0x2b1203['limit'];var _0x3ffd4c;if(_0x9f2201>=_0x47cd32){_0x9f2201=_0x47cd32;_0x3ffd4c=0xc8;}else{_0x3ffd4c=0xce;}_0x538cb7[_0x3ff2('0x21')](_0x3ffd4c);return _0x538cb7[_0x3ff2('0x28')]('Content-Range',_0x78b989+'-'+_0x9f2201+'/'+_0x47cd32)[_0x3ff2('0x23')](_0x4de4ce);}return null;};}function saveUpdates(_0x55fad0){return function(_0x267047){if(_0x267047){return _0x267047[_0x3ff2('0x29')](_0x55fad0)[_0x3ff2('0x15')](function(_0x160bfe){return _0x160bfe;});}return null;};}function removeEntity(_0x583c49){return function(_0x41fd95){if(_0x41fd95){return _0x41fd95[_0x3ff2('0x2a')]()['then'](function(){_0x583c49[_0x3ff2('0x21')](0xcc)[_0x3ff2('0x22')]();});}};}function handleEntityNotFound(_0x3f1fe3){return function(_0x32f543){if(!_0x32f543){_0x3f1fe3['sendStatus'](0x194);}return _0x32f543;};}function handleError(_0x32be6b,_0x4dfef0){_0x4dfef0=_0x4dfef0||0x1f4;return function(_0x10b3fb){logger[_0x3ff2('0x1b')](_0x10b3fb[_0x3ff2('0x2b')]);if(_0x10b3fb['name']){delete _0x10b3fb[_0x3ff2('0x2c')];}_0x32be6b[_0x3ff2('0x21')](_0x4dfef0)[_0x3ff2('0x2d')](_0x10b3fb);};}function getMustacheRender(_0x57e2e4,_0x5a5f70){return Mustache[_0x3ff2('0x2e')](_0x57e2e4,_[_0x3ff2('0x2f')](_0x5a5f70['body'],{'contact':_0x5a5f70[_0x3ff2('0x30')],'message':_0x5a5f70[_0x3ff2('0x1c')],'agent':_0x5a5f70[_0x3ff2('0x31')],'interaction':_0x5a5f70[_0x3ff2('0x32')],'account':_0x5a5f70[_0x3ff2('0x33')]}))||'';}exports[_0x3ff2('0x34')]=function(_0x56e5a3,_0x55e000){var _0xa989d9={};var _0x4200ac=_[_0x3ff2('0x35')](db[_0x3ff2('0x36')][_0x3ff2('0x37')],function(_0x15e08c){return{'name':_0x15e08c[_0x3ff2('0x38')],'type':_0x15e08c[_0x3ff2('0x39')][_0x3ff2('0x3a')]};});_0xa989d9=qs[_0x3ff2('0x3b')](_0x4200ac,_0x56e5a3);return interaction[_0x3ff2('0x3c')](_0x3ff2('0x3d'),_0x56e5a3[_0x3ff2('0x3e')],_0x56e5a3[_0x3ff2('0x3f')],_0xa989d9,_0x4200ac)[_0x3ff2('0x15')](respondWithFilteredResult(_0x55e000,_0xa989d9))[_0x3ff2('0x1f')](handleError(_0x55e000,null));};exports[_0x3ff2('0x40')]=function(_0x1d6648,_0x4e5e00){var _0x2f5e9d={'raw':![],'where':{'id':_0x1d6648['params']['id']}},_0x49830f={};_0x49830f[_0x3ff2('0x41')]=_['keys'](db[_0x3ff2('0x36')]['rawAttributes']);_0x49830f[_0x3ff2('0x3e')]=_['keys'](_0x1d6648['query']);_0x49830f['filters']=_['intersection'](_0x49830f['model'],_0x49830f[_0x3ff2('0x3e')]);_0x2f5e9d[_0x3ff2('0x42')]=_[_0x3ff2('0x43')](_0x49830f[_0x3ff2('0x41')],qs['fields'](_0x1d6648[_0x3ff2('0x3e')][_0x3ff2('0x44')]));_0x2f5e9d[_0x3ff2('0x42')]=_0x2f5e9d[_0x3ff2('0x42')][_0x3ff2('0x45')]?_0x2f5e9d[_0x3ff2('0x42')]:_0x49830f['model'];if(_0x1d6648[_0x3ff2('0x3e')][_0x3ff2('0x46')]){_0x2f5e9d[_0x3ff2('0x47')]=[{'all':!![]}];}_0x2f5e9d=_[_0x3ff2('0x2f')]({},_0x2f5e9d,_0x1d6648['options']);return db['ChatInteraction'][_0x3ff2('0x48')](_0x2f5e9d)['then'](handleEntityNotFound(_0x4e5e00,null))[_0x3ff2('0x15')](respondWithResult(_0x4e5e00,null))[_0x3ff2('0x1f')](handleError(_0x4e5e00,null));};exports[_0x3ff2('0x49')]=function(_0x2ee67a,_0x39b7c2){return db[_0x3ff2('0x36')]['create'](_0x2ee67a[_0x3ff2('0x4a')],{})[_0x3ff2('0x15')](respondWithResult(_0x39b7c2,0xc9))[_0x3ff2('0x1f')](handleError(_0x39b7c2,null));};exports[_0x3ff2('0x29')]=function(_0xfa6a24,_0x183132){if(_0xfa6a24[_0x3ff2('0x4a')]['id']){delete _0xfa6a24['body']['id'];}return db['ChatInteraction'][_0x3ff2('0x48')]({'where':{'id':_0xfa6a24['params']['id']}})[_0x3ff2('0x15')](handleEntityNotFound(_0x183132,null))[_0x3ff2('0x15')](saveUpdates(_0xfa6a24['body'],null))[_0x3ff2('0x15')](respondWithResult(_0x183132,null))[_0x3ff2('0x1f')](handleError(_0x183132,null));};exports['destroy']=function(_0x3dca91,_0x36bb3e){return db[_0x3ff2('0x36')][_0x3ff2('0x48')]({'where':{'id':_0x3dca91['params']['id']}})[_0x3ff2('0x15')](handleEntityNotFound(_0x36bb3e,null))['then'](removeEntity(_0x36bb3e,null))[_0x3ff2('0x1f')](handleError(_0x36bb3e,null));};exports[_0x3ff2('0x4b')]=function(_0x3e2dda,_0x16e331){return db[_0x3ff2('0x36')][_0x3ff2('0x4b')]()['then'](respondWithResult(_0x16e331,null))[_0x3ff2('0x1f')](handleError(_0x16e331,null));};exports[_0x3ff2('0x4c')]=function(_0x2cac90,_0x6c8752){var _0x4859a6=_0x2cac90['params']['id'];var _0x35e34e;var _0xbfab08;var _0x381e74;return db['ChatInteraction'][_0x3ff2('0x4d')]({'where':{'id':_0x4859a6}})[_0x3ff2('0x15')](function(_0xab9d4b){_0x35e34e=_0xab9d4b;return db['ChatWebsite'][_0x3ff2('0x4d')]({'where':{'id':_0xab9d4b[_0x3ff2('0x4e')]},'attributes':['id',_0x3ff2('0x4f'),'vidaooEscalation',_0x3ff2('0x50'),_0x3ff2('0x51'),_0x3ff2('0x52')],'raw':!![]});})['then'](function(_0x2a29a3){if(_0x2a29a3&&_0x2a29a3['vidaooApiKey']&&_0x2a29a3[_0x3ff2('0x53')]){_0xbfab08=_0x2a29a3;var _0x430ed1={'interaction':{'id':_0x4859a6},'agent':{'id':_0x2cac90['user']['id'],'name':_0x2cac90[_0x3ff2('0x3f')][_0x3ff2('0x2c')],'fullname':_0x2cac90[_0x3ff2('0x3f')][_0x3ff2('0x54')],'email':_0x2cac90[_0x3ff2('0x3f')]['email']},'contact':_0x2cac90['body']['contact'],'account':_0x2cac90[_0x3ff2('0x4a')]['account']};var _0x4b1222={'rejectUnauthorized':![],'method':_0x3ff2('0x55'),'url':_0x3ff2('0x56'),'headers':{'X-APIKEY':_0x2a29a3[_0x3ff2('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2cac90[_0x3ff2('0x3f')][_0x3ff2('0x57')]],'buttons':null,'topic':_0xbfab08[_0x3ff2('0x50')],'note':_[_0x3ff2('0x58')](_0xbfab08[_0x3ff2('0x51')])?null:getMustacheRender(_0xbfab08[_0x3ff2('0x51')],_0x430ed1),'metadata':null},'redirect':_0x3ff2('0x59'),'json':!![]};try{if(!_[_0x3ff2('0x58')](_0xbfab08['vidaooMetadata'])){var _0x33323c=getMustacheRender(_0xbfab08[_0x3ff2('0x52')],_0x430ed1);var _0x3c9520=JSON[_0x3ff2('0x5a')](_0x33323c);_0x4b1222[_0x3ff2('0x4a')][_0x3ff2('0x5b')]=_0x3c9520;}}catch(_0x4a834a){throw new db[(_0x3ff2('0x5c'))][(_0x3ff2('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x4b1222);}else{throw new db[(_0x3ff2('0x5c'))]['ValidationError'](_0x3ff2('0x5e'));}})[_0x3ff2('0x15')](function(_0x6cbac){_0x381e74=_0x6cbac;if(_0x381e74['id']){var _0x1ce0a9={'body':_0x381e74[_0x3ff2('0x5f')],'ChatWebsiteId':_0xbfab08['id'],'ChatInteractionId':_0x35e34e['id'],'direction':'out','UserId':_0x2cac90[_0x3ff2('0x3f')]['id']};return db['ChatMessage'][_0x3ff2('0x49')](_0x1ce0a9,{});}else{throw new db[(_0x3ff2('0x5c'))]['ValidationError'](_0x3ff2('0x60'));}})[_0x3ff2('0x15')](function(){return _0x35e34e[_0x3ff2('0x61')]({'vidaooSessionId':_0x381e74['id']});})[_0x3ff2('0x15')](respondWithResult(_0x6c8752,null))[_0x3ff2('0x1f')](handleError(_0x6c8752,null));};exports[_0x3ff2('0x62')]=function(_0x13f5d8,_0x5c4cb5){if(_0x13f5d8['body']['id']){delete _0x13f5d8[_0x3ff2('0x4a')]['id'];}return db[_0x3ff2('0x36')][_0x3ff2('0x48')]({'where':{'id':_0x13f5d8[_0x3ff2('0x63')]['id']},'include':[{'model':db['CmContact'],'as':_0x3ff2('0x64')}]})[_0x3ff2('0x15')](handleEntityNotFound(_0x5c4cb5,null))[_0x3ff2('0x15')](saveUpdates(_0x13f5d8[_0x3ff2('0x4a')],null))[_0x3ff2('0x15')](respondWithResult(_0x5c4cb5,null))[_0x3ff2('0x1f')](handleError(_0x5c4cb5,null));};exports[_0x3ff2('0x65')]=function(_0x14932d,_0x1d625c){if(_0x14932d[_0x3ff2('0x4a')]['id']){delete _0x14932d[_0x3ff2('0x4a')]['id'];}return db[_0x3ff2('0x36')]['find']({'where':{'id':_0x14932d['params']['id']}})[_0x3ff2('0x15')](function(_0x470166){if(!_0x470166){logger[_0x3ff2('0x1b')](_0x3ff2('0x66'),_0x3ff2('0x65'),0x194,_0x3ff2('0x67'));_0x1d625c['sendStatus'](0x194);}else{if(_0x470166[_0x3ff2('0x68')]){throw new db[(_0x3ff2('0x5c'))]['ValidationError'](_0x3ff2('0x69'));}}return _0x470166;})[_0x3ff2('0x15')](function(_0x418456){if(_0x418456){return _0x418456[_0x3ff2('0x29')]({'closed':_0x14932d[_0x3ff2('0x4a')]['closed'],'disposition':_0x14932d[_0x3ff2('0x4a')][_0x3ff2('0x6a')]})[_0x3ff2('0x15')](function(_0x35f6c2){return _0x35f6c2;});}})[_0x3ff2('0x15')](function(){return respondWithRpcPromise('AbandonInteraction',_0x3ff2('0x65'),_0x14932d[_0x3ff2('0x4a')],client9004);})[_0x3ff2('0x15')](respondWithResult(_0x1d625c,null))[_0x3ff2('0x1f')](handleError(_0x1d625c,null));};exports[_0x3ff2('0x6b')]=function(_0x1fdf93,_0x4b14ca){_0x1fdf93[_0x3ff2('0x4a')][_0x3ff2('0x2c')]=_0x1fdf93['file']['originalname'];_0x1fdf93[_0x3ff2('0x4a')]['basename']=_0x1fdf93['file']['filename'];_0x1fdf93['body']['type']=_0x1fdf93['file'][_0x3ff2('0x6c')];return db[_0x3ff2('0x6d')][_0x3ff2('0x49')](_0x1fdf93[_0x3ff2('0x4a')])[_0x3ff2('0x15')](respondWithResult(_0x4b14ca,0xc9))['catch'](handleError(_0x4b14ca,null));};exports[_0x3ff2('0x6e')]=function(_0x211768,_0x219a42){return db[_0x3ff2('0x36')][_0x3ff2('0x4d')]({'where':{'id':_0x211768[_0x3ff2('0x63')]['id']},'raw':!![]})[_0x3ff2('0x15')](handleEntityNotFound(_0x219a42,null))['then'](function(_0x4e45a6){if(_0x4e45a6){if(_0x4e45a6[_0x3ff2('0x6f')]){return _0x219a42['status'](0x193)['json']({'status':0x193,'message':_0x3ff2('0x70')});}return db['Attachment']['findOne']({'where':{'id':_0x211768['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x219a42,null));}})[_0x3ff2('0x15')](function(_0x103b02){if(_0x103b02){var _0x465b96=_0x103b02[_0x3ff2('0x71')]!==null;var _0x3243d7=path[_0x3ff2('0x72')](config['root'],_0x3ff2('0x73'));if(_0x465b96){_0x3243d7=path['join'](_0x3243d7,'offline-chat/');}var _0x2dddbd=path['join'](_0x3243d7,_0x103b02[_0x3ff2('0x74')]);return _0x219a42['download'](_0x2dddbd);}})[_0x3ff2('0x1f')](handleError(_0x219a42,null));};exports[_0x3ff2('0x75')]=function(_0xf28a9e,_0xaa0369){var _0x1c7d66=null;var _0x38f1b4=null;var _0x48f9bb=null;if(_0xf28a9e[_0x3ff2('0x4a')]['id']){delete _0xf28a9e['body']['id'];}if(_0xf28a9e[_0x3ff2('0x4a')][_0x3ff2('0x76')]){_0x48f9bb=path[_0x3ff2('0x72')](config[_0x3ff2('0x77')],_0x3ff2('0x78'),util['format'](_0x3ff2('0x79'),Date[_0x3ff2('0x7a')]()));_0xf28a9e[_0x3ff2('0x4a')][_0x3ff2('0x7b')]=_0x48f9bb;}return db[_0x3ff2('0x36')][_0x3ff2('0x48')]({'where':{'id':_0xf28a9e[_0x3ff2('0x63')]['id']},'include':[{'model':db[_0x3ff2('0x7c')],'as':_0x3ff2('0x7d'),'include':[{'model':db[_0x3ff2('0x7e')],'as':_0x3ff2('0x7e')}]}]})[_0x3ff2('0x15')](handleEntityNotFound(_0xaa0369,null))['then'](saveUpdates(_0xf28a9e[_0x3ff2('0x4a')],null))[_0x3ff2('0x15')](function(_0x3fb2f9){if(_0x3fb2f9){_0x1c7d66=_0x3fb2f9;return db[_0x3ff2('0x7f')][_0x3ff2('0x48')]({'where':{'id':_0x1c7d66[_0x3ff2('0x4e')]}});}})[_0x3ff2('0x15')](function(_0x49f27d){if(_0x49f27d){_0x38f1b4=_0x49f27d;return db['CmContact'][_0x3ff2('0x48')]({'where':{'id':_0x1c7d66[_0x3ff2('0x80')]}});}})[_0x3ff2('0x15')](function(_0x20bec3){if(_0x20bec3){if(_0x48f9bb){var _0x2abced=null;for(var _0x4beaf3=0x1;_0x4beaf3<_0x1c7d66[_0x3ff2('0x7d')][_0x3ff2('0x45')];++_0x4beaf3){_0x2abced=_0x1c7d66['Messages'][_0x4beaf3];var _0x20d42f=_0x2abced[_0x3ff2('0x68')]?util['format'](_0x3ff2('0x81'),_0x38f1b4[_0x3ff2('0x82')],_0x2abced[_0x3ff2('0x68')]):_0x3ff2('0x83');var _0x21db0d=_0xf28a9e[_0x3ff2('0x4a')][_0x3ff2('0x84')]||util[_0x3ff2('0x85')](_0x3ff2('0x81'),_0x3ff2('0x86'),_0x2abced[_0x3ff2('0x80')]);switch(_0x38f1b4['agentIdentifier']){case _0x3ff2('0x87'):_0x20d42f=_0x2abced[_0x3ff2('0x68')]?util[_0x3ff2('0x85')](_0x3ff2('0x81'),_0x38f1b4[_0x3ff2('0x82')],_0x2abced['UserId']):_0x3ff2('0x83');break;case'agent_alias':_0x20d42f=_0x2abced[_0x3ff2('0x68')]?_0x2abced['User'][_0x3ff2('0x88')]||_0x2abced[_0x3ff2('0x7e')][_0x3ff2('0x54')]:_0x3ff2('0x83');break;case'agent_fullname':_0x20d42f=_0x2abced[_0x3ff2('0x68')]?_0x2abced[_0x3ff2('0x7e')][_0x3ff2('0x54')]:_0x3ff2('0x83');break;default:_0x20d42f=_0x2abced[_0x3ff2('0x68')]?util['format']('%s%d',_0x38f1b4[_0x3ff2('0x82')],_0x2abced['UserId']):_0x3ff2('0x83');}var _0x168762=util[_0x3ff2('0x85')](_0x3ff2('0x89'),moment(_0x2abced['createdAt'])[_0x3ff2('0x85')](_0x3ff2('0x8a')),_0x2abced['direction']==='in'?_0x21db0d:_0x20d42f,_0x2abced[_0x3ff2('0x4a')]);if(!_0x2abced[_0x3ff2('0x8b')]){fs['appendFileSync'](_0x48f9bb,_0x168762);}}return db[_0x3ff2('0x8c')][_0x3ff2('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0x3ff2('0x8d')],'as':_0x3ff2('0x8e'),'raw':!![],'include':[{'model':db[_0x3ff2('0x8f')],'as':_0x3ff2('0x8f'),'raw':!![]}]}]});}}})[_0x3ff2('0x15')](function(_0x55af40){if(!_0x55af40||!_0x55af40['Smtp']||!_0xf28a9e['body'])return _0x1c7d66;var _0x9d9dda=_0x55af40[_0x3ff2('0x90')]();return respondWithRpcPromise(_0x3ff2('0x91'),_0x3ff2('0x92'),{'account':_0x9d9dda,'message':{'from':util[_0x3ff2('0x85')](_0x3ff2('0x93'),_0x55af40[_0x3ff2('0x2c')],_0x55af40[_0x3ff2('0x57')]||_0x55af40[_0x3ff2('0x8e')]['user']),'to':_0xf28a9e[_0x3ff2('0x4a')][_0x3ff2('0x76')],'subject':'Mail\x20Transcript','text':util['format'](_0x3ff2('0x94'),_0xf28a9e[_0x3ff2('0x4a')]['mailTranscript']),'attachments':[{'path':_0x48f9bb}]}})[_0x3ff2('0x15')](function(){return _0x1c7d66;})[_0x3ff2('0x1f')](function(_0x193cd1){logger[_0x3ff2('0x1b')](_0x193cd1);});})[_0x3ff2('0x15')](respondWithStatusCode(_0xaa0369,0xc8))[_0x3ff2('0x1f')](handleError(_0xaa0369,null));};exports[_0x3ff2('0x95')]=function(_0x52620a,_0x5dd5dc){return db[_0x3ff2('0x7c')][_0x3ff2('0x48')]({'where':{'id':_0x52620a[_0x3ff2('0x63')]['id']}})[_0x3ff2('0x15')](handleEntityNotFound(_0x5dd5dc,null))[_0x3ff2('0x15')](function(_0x57b1a5){if(_0x57b1a5){return _0x57b1a5[_0x3ff2('0x95')](_0x52620a[_0x3ff2('0x4a')][_0x3ff2('0x96')],_[_0x3ff2('0x97')](_0x52620a['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5dd5dc,null))[_0x3ff2('0x1f')](handleError(_0x5dd5dc,null));};exports[_0x3ff2('0x98')]=function(_0x35340f,_0x1cb3b4){var _0x5b51a1={'raw':![],'where':{}};var _0x240846={};var _0x1ce1b4={'count':0x0,'rows':[]};return db[_0x3ff2('0x36')][_0x3ff2('0x4d')]({'where':{'id':_0x35340f[_0x3ff2('0x63')]['id']}})[_0x3ff2('0x15')](handleEntityNotFound(_0x1cb3b4,null))[_0x3ff2('0x15')](function(_0x1913c9){if(_0x1913c9){_0x240846[_0x3ff2('0x41')]=_[_0x3ff2('0x99')](db['ChatMessage']['rawAttributes']);_0x240846[_0x3ff2('0x3e')]=_['keys'](_0x35340f['query']);_0x240846[_0x3ff2('0x9a')]=_[_0x3ff2('0x43')](_0x240846[_0x3ff2('0x41')],_0x240846[_0x3ff2('0x3e')]);_0x5b51a1[_0x3ff2('0x42')]=_[_0x3ff2('0x43')](_0x240846[_0x3ff2('0x41')],qs[_0x3ff2('0x44')](_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0x44')]));_0x5b51a1[_0x3ff2('0x42')]=_0x5b51a1[_0x3ff2('0x42')][_0x3ff2('0x45')]?_0x5b51a1[_0x3ff2('0x42')]:_0x240846[_0x3ff2('0x41')];if(!_0x35340f['query']['hasOwnProperty'](_0x3ff2('0x9b'))){_0x5b51a1[_0x3ff2('0x26')]=qs[_0x3ff2('0x26')](_0x35340f['query'][_0x3ff2('0x26')]);_0x5b51a1[_0x3ff2('0x24')]=qs[_0x3ff2('0x24')](_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0x24')]);}_0x5b51a1[_0x3ff2('0x9c')]=qs['sort'](_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0x9d')]);_0x5b51a1['where']=qs[_0x3ff2('0x9a')](_[_0x3ff2('0x9e')](_0x35340f[_0x3ff2('0x3e')],_0x240846['filters']));_0x5b51a1[_0x3ff2('0x9f')]['ChatInteractionId']=_0x1913c9['id'];if(_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0xa0')]){_0x5b51a1[_0x3ff2('0x9f')]=_[_0x3ff2('0x2f')](_0x5b51a1[_0x3ff2('0x9f')],{'$or':_['map'](_0x5b51a1[_0x3ff2('0x42')],function(_0x4671c5){var _0x539eb0={};_0x539eb0[_0x4671c5]={'$like':'%'+_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0xa0')]+'%'};return _0x539eb0;})});}if(_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0xa1')]){var _0x1e68b7=_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0xa1')][_0x3ff2('0xa2')](',');var _0x3ca197={};_0x3ca197[_0x1e68b7[0x0]]={'$gte':moment(_0x1e68b7[0x1])[_0x3ff2('0x85')](_0x3ff2('0xa3'))};_0x5b51a1['where']=_[_0x3ff2('0x2f')](_0x5b51a1['where'],_0x3ca197);}_0x5b51a1=_[_0x3ff2('0x2f')]({},_0x5b51a1,_0x35340f[_0x3ff2('0xa4')]);return db[_0x3ff2('0x7c')]['count']({'where':_0x5b51a1[_0x3ff2('0x9f')]})[_0x3ff2('0x15')](function(_0x44c28f){_0x1ce1b4[_0x3ff2('0x27')]=_0x44c28f;if(_0x35340f[_0x3ff2('0x3e')][_0x3ff2('0x46')]){_0x5b51a1[_0x3ff2('0x47')]=[{'all':!![]}];}return db[_0x3ff2('0x7c')][_0x3ff2('0x3c')](_0x5b51a1);})[_0x3ff2('0x15')](function(_0x27585d){_0x1ce1b4[_0x3ff2('0xa5')]=_0x27585d;return _0x1ce1b4;});}})[_0x3ff2('0x15')](respondWithFilteredResult(_0x1cb3b4,_0x5b51a1))[_0x3ff2('0x1f')](handleError(_0x1cb3b4,null));};exports[_0x3ff2('0xa6')]=function(_0x86843f,_0x5306f2){var _0x21e6f1={'where':{}},_0xdb60f1={},_0x353771={'count':0x0,'rows':[]};return db[_0x3ff2('0x36')][_0x3ff2('0x4d')]({'where':{'id':_0x86843f[_0x3ff2('0x63')]['id']}})[_0x3ff2('0x15')](handleEntityNotFound(_0x5306f2,null))['then'](function(_0x3a4997){if(_0x3a4997){_0xdb60f1['model']=_[_0x3ff2('0x99')](db[_0x3ff2('0x7c')]['rawAttributes']);_0xdb60f1[_0x3ff2('0x3e')]=_[_0x3ff2('0x99')](_0x86843f[_0x3ff2('0x3e')]);_0xdb60f1[_0x3ff2('0x9a')]=_['intersection'](_0xdb60f1[_0x3ff2('0x41')],_0xdb60f1[_0x3ff2('0x3e')]);_0x21e6f1[_0x3ff2('0x42')]=_[_0x3ff2('0x43')](_0xdb60f1[_0x3ff2('0x41')],qs[_0x3ff2('0x44')](_0x86843f[_0x3ff2('0x3e')][_0x3ff2('0x44')]));_0x21e6f1[_0x3ff2('0x42')]=_0x21e6f1['attributes'][_0x3ff2('0x45')]?_0x21e6f1[_0x3ff2('0x42')]:_0xdb60f1[_0x3ff2('0x41')];if(!_0x86843f[_0x3ff2('0x3e')][_0x3ff2('0xa7')](_0x3ff2('0x9b'))){_0x21e6f1[_0x3ff2('0x26')]=qs[_0x3ff2('0x26')](_0x86843f[_0x3ff2('0x3e')][_0x3ff2('0x26')]);_0x21e6f1[_0x3ff2('0x24')]=qs['offset'](_0x86843f[_0x3ff2('0x3e')][_0x3ff2('0x24')]);}_0x21e6f1['order']=qs[_0x3ff2('0x9d')](_0x86843f['query']['sort']);_0x21e6f1['where']=qs[_0x3ff2('0x9a')](_[_0x3ff2('0x9e')](_0x86843f[_0x3ff2('0x3e')],_0xdb60f1[_0x3ff2('0x9a')]));_0x21e6f1[_0x3ff2('0x9f')][_0x3ff2('0xa8')]=_0x3a4997['id'];if(_0x86843f[_0x3ff2('0x3e')]['filter']){_0x21e6f1[_0x3ff2('0x9f')]=_['merge'](_0x21e6f1[_0x3ff2('0x9f')],{'$or':_[_0x3ff2('0x35')](_0x21e6f1[_0x3ff2('0x42')],function(_0x27e1b4){var _0x42a7b9={};_0x42a7b9[_0x27e1b4]={'$like':'%'+_0x86843f[_0x3ff2('0x3e')]['filter']+'%'};return _0x42a7b9;})});}_0x21e6f1['where']['secret']=![];if(_0x86843f[_0x3ff2('0x3e')]['id']){_0x21e6f1[_0x3ff2('0x9f')]['id']={'$gt':_0x86843f['query']['id']};}_0x21e6f1=_[_0x3ff2('0x2f')]({},_0x21e6f1,_0x86843f[_0x3ff2('0xa4')]);return db['ChatMessage'][_0x3ff2('0x27')]({'where':_0x21e6f1[_0x3ff2('0x9f')]})['then'](function(_0x3dba77){_0x353771[_0x3ff2('0x27')]=_0x3dba77;_0x21e6f1[_0x3ff2('0x47')]=[];if(_0x86843f[_0x3ff2('0x3e')]['includeAgent']){_0x21e6f1['include']['push']({'model':db['User'],'as':'User','attributes':['id',_0x3ff2('0x54'),_0x3ff2('0x88')]});}if(_0x86843f[_0x3ff2('0x3e')][_0x3ff2('0x46')]){_0x21e6f1[_0x3ff2('0x47')]=[{'all':!![]}];}return db[_0x3ff2('0x7c')]['findAll'](_0x21e6f1);})[_0x3ff2('0x15')](function(_0x35f2c7){_0x353771[_0x3ff2('0xa5')]=_0x35f2c7;return _0x353771;});}})[_0x3ff2('0x15')](respondWithFilteredResult(_0x5306f2,_0x21e6f1))[_0x3ff2('0x1f')](handleError(_0x5306f2,null));};exports['addTags']=function(_0x26b448,_0x7dff07){return db[_0x3ff2('0x36')]['find']({'where':{'id':_0x26b448[_0x3ff2('0x63')]['id']}})[_0x3ff2('0x15')](handleEntityNotFound(_0x7dff07,null))['then'](function(_0x52d2fb){if(_0x52d2fb){return _0x52d2fb['setTags'](_0x26b448['body'][_0x3ff2('0x96')],_['omit'](_0x26b448[_0x3ff2('0x4a')],[_0x3ff2('0x96'),'id'])||{})['spread'](function(){return db[_0x3ff2('0xa9')][_0x3ff2('0x3c')]({'attributes':['id',_0x3ff2('0x2c'),_0x3ff2('0xaa')],'where':{'id':_0x26b448[_0x3ff2('0x4a')][_0x3ff2('0x96')]}});})[_0x3ff2('0x15')](function(_0x2598c0){socket[_0x3ff2('0xab')](_0x3ff2('0xac'),{'id':Number(_0x26b448['params']['id']),'tags':_0x2598c0||[]});return{'id':Number(_0x26b448[_0x3ff2('0x63')]['id']),'tags':_0x2598c0||[]};});}})[_0x3ff2('0x15')](respondWithResult(_0x7dff07,null))[_0x3ff2('0x1f')](handleError(_0x7dff07,null));};exports[_0x3ff2('0xad')]=function(_0x25ec02,_0x4adcc0){return db['ChatInteraction'][_0x3ff2('0x48')]({'where':{'id':_0x25ec02[_0x3ff2('0x63')]['id']}})['then'](handleEntityNotFound(_0x4adcc0,null))['then'](function(_0x5a7e91){if(_0x5a7e91){return _0x5a7e91[_0x3ff2('0xad')](_0x25ec02[_0x3ff2('0x3e')][_0x3ff2('0x96')]);}})['then'](respondWithStatusCode(_0x4adcc0,null))[_0x3ff2('0x1f')](handleError(_0x4adcc0,null));};exports[_0x3ff2('0xae')]=function(_0x5083e4,_0x462bf5){var _0x1680c4=moment()[_0x3ff2('0xaf')]()[_0x3ff2('0xb0')]();var _0xde5147=path[_0x3ff2('0x72')](config['root'],_0x3ff2('0xb1'),_0x3ff2('0xb2'),'tmp');var _0x3bc3e8=path[_0x3ff2('0x72')](config[_0x3ff2('0x77')],_0x3ff2('0xb1'),_0x3ff2('0xb2'),'attachments');var _0x2b9697=path[_0x3ff2('0x72')](_0xde5147,_0x1680c4);var _0x385548=util[_0x3ff2('0x85')](_0x3ff2('0xb3'),_0x5083e4[_0x3ff2('0x63')]['id'],_0x1680c4);var _0xd4ceb8=path[_0x3ff2('0x72')](_0xde5147,_0x385548);var _0x32c504=[];_0x32c504[_0x3ff2('0xb4')]({'model':db[_0x3ff2('0x7e')],'as':_0x3ff2('0x7e'),'attributes':['id',_0x3ff2('0x54')],'raw':!![]});_0x32c504['push']({'model':db[_0x3ff2('0xb5')],'as':_0x3ff2('0x64'),'attributes':['id',_0x3ff2('0xb6'),'lastName'],'raw':!![]});if(_0x5083e4[_0x3ff2('0x3e')][_0x3ff2('0xb7')]){_0x32c504['push']({'model':db[_0x3ff2('0x6d')],'as':_0x3ff2('0x6d'),'raw':!![]});}var _0x1f067a=[{'model':db[_0x3ff2('0x7c')],'as':_0x3ff2('0x7d'),'attributes':['id','body',_0x3ff2('0xb8'),_0x3ff2('0xb9'),_0x3ff2('0x8b'),_0x3ff2('0xba')],'include':_0x32c504}];_0x1f067a[_0x3ff2('0xb4')]({'model':db[_0x3ff2('0x7f')],'as':_0x3ff2('0xbb'),'attributes':['id','name']});_0x1f067a[_0x3ff2('0xb4')]({'model':db[_0x3ff2('0x7e')],'as':_0x3ff2('0xbc'),'attributes':['id','fullname']});return db[_0x3ff2('0x36')][_0x3ff2('0x48')]({'where':{'id':_0x5083e4[_0x3ff2('0x63')]['id']},'include':_0x1f067a})[_0x3ff2('0x15')](handleEntityNotFound(_0x462bf5,null))[_0x3ff2('0x15')](function(_0x275e26){if(_0x275e26){var _0x3383da=_0x275e26[_0x3ff2('0xbd')]({'plain':!![]});fs[_0x3ff2('0xbe')](_0x2b9697);var _0x110b19={'channel':_0x3ff2('0xbf'),'account':_0x3383da['Account'][_0x3ff2('0x2c')],'agent':_0x3383da['Owner']?_0x3383da[_0x3ff2('0xbc')][_0x3ff2('0x54')]:_0x3ff2('0xc0'),'createdAt':moment(_0x3383da[_0x3ff2('0xb8')])['format'](_0x3ff2('0xa3'))['toString'](),'closedAt':_0x3383da[_0x3ff2('0x6f')]?moment(_0x3383da[_0x3ff2('0xc1')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3383da[_0x3ff2('0x6a')],'chatInfo':{'browser':_0x3383da[_0x3ff2('0xc2')],'os':_0x3383da[_0x3ff2('0xc3')],'referer':_0x3383da['referer'],'customerIp':_0x3383da['customerIp'],'customerPort':_0x3383da['customerPort']?_0x3383da[_0x3ff2('0xc4')]:_0x3ff2('0xc0')},'messages':_(_0x3383da[_0x3ff2('0x7d')])['tail']()['filter']({'secret':![]})['map'](function(_0x33834d){if(_0x33834d[_0x3ff2('0x6d')]){var _0xd53f3f=path[_0x3ff2('0x72')](_0x3bc3e8,_0x33834d[_0x3ff2('0x6d')][_0x3ff2('0x74')]);if(fs['existsSync'](_0xd53f3f)){fs['createReadStream'](_0xd53f3f)['pipe'](fs[_0x3ff2('0xc5')](path[_0x3ff2('0x72')](_0x2b9697,_0x33834d[_0x3ff2('0x6d')]['basename'])));}}return{'date':moment(_0x33834d['createdAt'])[_0x3ff2('0x85')](_0x3ff2('0xa3'))[_0x3ff2('0xb0')](),'sender':_0x33834d[_0x3ff2('0xb9')]===_0x3ff2('0xc6')?_0x33834d[_0x3ff2('0x7e')]?_0x33834d[_0x3ff2('0x7e')][_0x3ff2('0x54')]:_0x3ff2('0x83'):_0x33834d['Contact'][_0x3ff2('0xb6')]+(_0x33834d['Contact'][_0x3ff2('0xc7')]?'\x20'+_0x33834d['Contact'][_0x3ff2('0xc7')]:''),'body':_0x33834d['Attachment']?_0x33834d[_0x3ff2('0x6d')][_0x3ff2('0x74')]:_0x33834d[_0x3ff2('0x4a')],'direction':_0x33834d[_0x3ff2('0xb9')]===_0x3ff2('0xc6')?'A':'C','secret':_0x33834d[_0x3ff2('0x8b')],'read':_0x33834d[_0x3ff2('0xba')],'attachment':_0x33834d[_0x3ff2('0x6d')]};})[_0x3ff2('0xc8')]()};return ejs[_0x3ff2('0xc9')](path['join'](config['root'],_0x3ff2('0xb1'),_0x3ff2('0xca'),_0x3ff2('0xcb')),{'interaction':_0x110b19})[_0x3ff2('0x15')](function(_0x45eeeb){var _0x34e329=path['join'](_0x2b9697,_0x3ff2('0xcc')+_0x3383da['id']+'-'+_0x1680c4+_0x3ff2('0xcd'));var _0x8b1a3b={'path':_0x34e329,'channel':_0x3ff2('0xbf'),'interactionId':_0x3383da['id']};return pdf[_0x3ff2('0xce')](_0x45eeeb,_0x8b1a3b);})['then'](function(){return new Promise(function(_0x38e4d1,_0x3eb81c){zipdir(_0x2b9697,{'saveTo':_0xd4ceb8},function(_0x56ab8c,_0x71eb54){if(_0x56ab8c)return _0x3eb81c(_0x56ab8c);return _0x38e4d1(_0x71eb54);});})[_0x3ff2('0x15')](function(){return new BPromise(function(_0x5e3198,_0x4111cc){rimraf(_0x2b9697,function(_0x54a473){if(_0x54a473)_0x4111cc(_0x54a473);return _0x5e3198();});});})[_0x3ff2('0x15')](function(){return _0x462bf5[_0x3ff2('0xae')](_0xd4ceb8,_0x385548,function(_0x45252a){if(_0x45252a){logger[_0x3ff2('0x1b')](_0x3ff2('0xcf'),_0x45252a);}else{fs[_0x3ff2('0xd0')](_0xd4ceb8);}});});});}else{return _0x462bf5['sendStatus'](0xc8);}})[_0x3ff2('0x1f')](handleError(_0x462bf5,null));};
\ No newline at end of file
+var _0x47da=['client','http','request','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','name','send','merge','body','contact','agent','interaction','account','index','rawAttributes','type','key','getOptions','query','user','show','keys','intersection','model','attributes','fields','includeAll','include','options','ChatInteraction','find','create','params','destroy','describe','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','findOne','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','ContactId','length','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','pick','push','setTags','spread','color','emit','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','read','Account','Owner','get','mkdirSync','closedAt','disposition','browserName','osName','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise'];(function(_0x4de0f7,_0x4d94f2){var _0x5ac7cd=function(_0x25983d){while(--_0x25983d){_0x4de0f7['push'](_0x4de0f7['shift']());}};_0x5ac7cd(++_0x4d94f2);}(_0x47da,0x195));var _0xa47d=function(_0x1b0fad,_0x2f3d35){_0x1b0fad=_0x1b0fad-0x0;var _0x49a68c=_0x47da[_0x1b0fad];return _0x49a68c;};'use strict';var rimraf=require(_0xa47d('0x0'));var zipdir=require(_0xa47d('0x1'));var rp=require(_0xa47d('0x2'));var moment=require(_0xa47d('0x3'));var BPromise=require(_0xa47d('0x4'));var Mustache=require(_0xa47d('0x5'));var util=require(_0xa47d('0x6'));var path=require(_0xa47d('0x7'));var ejs=require(_0xa47d('0x8'));var fs=require('fs');var _=require(_0xa47d('0x9'));var Redis=require(_0xa47d('0xa'));var interaction=require(_0xa47d('0xb'));var qs=require(_0xa47d('0xc'));var pdf=require(_0xa47d('0xd'));var logger=require(_0xa47d('0xe'))(_0xa47d('0xf'));var config=require(_0xa47d('0x10'));var db=require(_0xa47d('0x11'))['db'];config[_0xa47d('0x12')]=_[_0xa47d('0x13')](config['redis'],{'host':_0xa47d('0x14'),'port':0x18eb});var socket=require(_0xa47d('0x15'))(new Redis(config[_0xa47d('0x12')]));require(_0xa47d('0x16'))[_0xa47d('0x17')](socket);var jayson=require(_0xa47d('0x18'));var client=jayson[_0xa47d('0x19')][_0xa47d('0x1a')]({'port':0x232b});var client9004=jayson['client'][_0xa47d('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x35adf0,_0x11be8e,_0x117cab,_0x471587){return new BPromise(function(_0x47f254,_0xb410a0){var _0x100508=_0x471587||client;return _0x100508[_0xa47d('0x1b')](_0x35adf0,_0x117cab)['then'](function(_0x2d71d9){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x11be8e,_0xa47d('0x1c'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x11be8e,_0xa47d('0x1c'),JSON[_0xa47d('0x1d')](_0x2d71d9));if(_0x2d71d9['error']){if(_0x2d71d9[_0xa47d('0x1e')][_0xa47d('0x1f')]===0x1f4){logger[_0xa47d('0x1e')](_0xa47d('0x20'),_0x11be8e,_0x2d71d9[_0xa47d('0x1e')][_0xa47d('0x21')]);return _0xb410a0(_0x2d71d9[_0xa47d('0x1e')][_0xa47d('0x21')]);}logger[_0xa47d('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x11be8e,_0x2d71d9[_0xa47d('0x1e')][_0xa47d('0x21')]);return _0x47f254(_0x2d71d9[_0xa47d('0x1e')][_0xa47d('0x21')]);}else{logger[_0xa47d('0x22')](_0xa47d('0x20'),_0x11be8e,'request\x20sent');_0x47f254(_0x2d71d9['result'][_0xa47d('0x21')]);}})[_0xa47d('0x23')](function(_0x23ba4b){logger[_0xa47d('0x1e')](_0xa47d('0x20'),_0x11be8e,_0x23ba4b);_0xb410a0(_0x23ba4b);});});}function respondWithStatusCode(_0x5dc788,_0x340ada){_0x340ada=_0x340ada||0xcc;return function(_0x228ee1){if(_0x228ee1){return _0x5dc788['sendStatus'](_0x340ada);}return _0x5dc788[_0xa47d('0x24')](_0x340ada)[_0xa47d('0x25')]();};}function respondWithResult(_0x4c059f,_0x4a131b){_0x4a131b=_0x4a131b||0xc8;return function(_0x343024){if(_0x343024){return _0x4c059f[_0xa47d('0x24')](_0x4a131b)[_0xa47d('0x26')](_0x343024);}};}function respondWithFilteredResult(_0x1b7bcb,_0x2ddfc8){return function(_0x5c5234){if(_0x5c5234){var _0x340927=typeof _0x2ddfc8[_0xa47d('0x27')]===_0xa47d('0x28')&&typeof _0x2ddfc8[_0xa47d('0x29')]===_0xa47d('0x28');var _0x10fad1=_0x5c5234[_0xa47d('0x2a')];var _0x54ef39=_0x340927?0x0:_0x2ddfc8[_0xa47d('0x27')];var _0x45109f=_0x340927?_0x5c5234[_0xa47d('0x2a')]:_0x2ddfc8[_0xa47d('0x27')]+_0x2ddfc8['limit'];var _0x482889;if(_0x45109f>=_0x10fad1){_0x45109f=_0x10fad1;_0x482889=0xc8;}else{_0x482889=0xce;}_0x1b7bcb[_0xa47d('0x24')](_0x482889);return _0x1b7bcb[_0xa47d('0x2b')](_0xa47d('0x2c'),_0x54ef39+'-'+_0x45109f+'/'+_0x10fad1)['json'](_0x5c5234);}return null;};}function saveUpdates(_0x502aa1){return function(_0x2092d2){if(_0x2092d2){return _0x2092d2[_0xa47d('0x2d')](_0x502aa1)[_0xa47d('0x2e')](function(_0x4131d3){return _0x4131d3;});}return null;};}function removeEntity(_0x91416e){return function(_0x1a8135){if(_0x1a8135){return _0x1a8135['destroy']()['then'](function(){_0x91416e[_0xa47d('0x24')](0xcc)[_0xa47d('0x25')]();});}};}function handleEntityNotFound(_0x28e06a){return function(_0x45abf6){if(!_0x45abf6){_0x28e06a[_0xa47d('0x2f')](0x194);}return _0x45abf6;};}function handleError(_0x10ea03,_0x175bf4){_0x175bf4=_0x175bf4||0x1f4;return function(_0x566777){logger[_0xa47d('0x1e')](_0x566777['stack']);if(_0x566777[_0xa47d('0x30')]){delete _0x566777['name'];}_0x10ea03[_0xa47d('0x24')](_0x175bf4)[_0xa47d('0x31')](_0x566777);};}function getMustacheRender(_0xbb27bb,_0x451aa5){return Mustache['render'](_0xbb27bb,_[_0xa47d('0x32')](_0x451aa5[_0xa47d('0x33')],{'contact':_0x451aa5[_0xa47d('0x34')],'message':_0x451aa5[_0xa47d('0x21')],'agent':_0x451aa5[_0xa47d('0x35')],'interaction':_0x451aa5[_0xa47d('0x36')],'account':_0x451aa5[_0xa47d('0x37')]}))||'';}exports[_0xa47d('0x38')]=function(_0x15b530,_0x7b2f52){var _0x3693a2={};var _0x347cc3=_['map'](db['ChatInteraction'][_0xa47d('0x39')],function(_0x324a47){return{'name':_0x324a47['fieldName'],'type':_0x324a47[_0xa47d('0x3a')][_0xa47d('0x3b')]};});_0x3693a2=qs[_0xa47d('0x3c')](_0x347cc3,_0x15b530);return interaction['findAll']('chat',_0x15b530[_0xa47d('0x3d')],_0x15b530[_0xa47d('0x3e')],_0x3693a2,_0x347cc3)[_0xa47d('0x2e')](respondWithFilteredResult(_0x7b2f52,_0x3693a2))[_0xa47d('0x23')](handleError(_0x7b2f52,null));};exports[_0xa47d('0x3f')]=function(_0x1d7714,_0x2e1d67){var _0x4b1e73={'raw':![],'where':{'id':_0x1d7714['params']['id']}},_0x15b1e2={};_0x15b1e2['model']=_['keys'](db['ChatInteraction'][_0xa47d('0x39')]);_0x15b1e2[_0xa47d('0x3d')]=_[_0xa47d('0x40')](_0x1d7714[_0xa47d('0x3d')]);_0x15b1e2['filters']=_[_0xa47d('0x41')](_0x15b1e2[_0xa47d('0x42')],_0x15b1e2[_0xa47d('0x3d')]);_0x4b1e73[_0xa47d('0x43')]=_[_0xa47d('0x41')](_0x15b1e2[_0xa47d('0x42')],qs['fields'](_0x1d7714[_0xa47d('0x3d')][_0xa47d('0x44')]));_0x4b1e73[_0xa47d('0x43')]=_0x4b1e73[_0xa47d('0x43')]['length']?_0x4b1e73[_0xa47d('0x43')]:_0x15b1e2[_0xa47d('0x42')];if(_0x1d7714[_0xa47d('0x3d')][_0xa47d('0x45')]){_0x4b1e73[_0xa47d('0x46')]=[{'all':!![]}];}_0x4b1e73=_[_0xa47d('0x32')]({},_0x4b1e73,_0x1d7714[_0xa47d('0x47')]);return db[_0xa47d('0x48')][_0xa47d('0x49')](_0x4b1e73)[_0xa47d('0x2e')](handleEntityNotFound(_0x2e1d67,null))[_0xa47d('0x2e')](respondWithResult(_0x2e1d67,null))[_0xa47d('0x23')](handleError(_0x2e1d67,null));};exports['create']=function(_0x515f40,_0x3a989c){return db[_0xa47d('0x48')][_0xa47d('0x4a')](_0x515f40[_0xa47d('0x33')],{})['then'](respondWithResult(_0x3a989c,0xc9))[_0xa47d('0x23')](handleError(_0x3a989c,null));};exports[_0xa47d('0x2d')]=function(_0xd829ee,_0x596598){if(_0xd829ee[_0xa47d('0x33')]['id']){delete _0xd829ee[_0xa47d('0x33')]['id'];}return db[_0xa47d('0x48')]['find']({'where':{'id':_0xd829ee[_0xa47d('0x4b')]['id']}})[_0xa47d('0x2e')](handleEntityNotFound(_0x596598,null))[_0xa47d('0x2e')](saveUpdates(_0xd829ee[_0xa47d('0x33')],null))[_0xa47d('0x2e')](respondWithResult(_0x596598,null))[_0xa47d('0x23')](handleError(_0x596598,null));};exports[_0xa47d('0x4c')]=function(_0x8bb481,_0xc07ff6){return db[_0xa47d('0x48')][_0xa47d('0x49')]({'where':{'id':_0x8bb481[_0xa47d('0x4b')]['id']}})[_0xa47d('0x2e')](handleEntityNotFound(_0xc07ff6,null))[_0xa47d('0x2e')](removeEntity(_0xc07ff6,null))[_0xa47d('0x23')](handleError(_0xc07ff6,null));};exports[_0xa47d('0x4d')]=function(_0x3b96ad,_0x50af54){return db[_0xa47d('0x48')][_0xa47d('0x4d')]()['then'](respondWithResult(_0x50af54,null))['catch'](handleError(_0x50af54,null));};exports['createVidaooSession']=function(_0x5e490a,_0x2720a5){var _0x2e7789=_0x5e490a[_0xa47d('0x4b')]['id'];var _0x342663;var _0x36b3f5;var _0x44f55d;return db[_0xa47d('0x48')]['findOne']({'where':{'id':_0x2e7789}})[_0xa47d('0x2e')](function(_0x1c930c){_0x342663=_0x1c930c;return db[_0xa47d('0x4e')]['findOne']({'where':{'id':_0x1c930c[_0xa47d('0x4f')]},'attributes':['id',_0xa47d('0x50'),_0xa47d('0x51'),_0xa47d('0x52'),_0xa47d('0x53'),_0xa47d('0x54')],'raw':!![]});})[_0xa47d('0x2e')](function(_0x1dd58a){if(_0x1dd58a&&_0x1dd58a[_0xa47d('0x50')]&&_0x1dd58a[_0xa47d('0x51')]){_0x36b3f5=_0x1dd58a;var _0x20f706={'interaction':{'id':_0x2e7789},'agent':{'id':_0x5e490a[_0xa47d('0x3e')]['id'],'name':_0x5e490a[_0xa47d('0x3e')][_0xa47d('0x30')],'fullname':_0x5e490a[_0xa47d('0x3e')][_0xa47d('0x55')],'email':_0x5e490a['user']['email']},'contact':_0x5e490a['body'][_0xa47d('0x34')],'account':_0x5e490a[_0xa47d('0x33')][_0xa47d('0x37')]};var _0x143d8f={'rejectUnauthorized':![],'method':_0xa47d('0x56'),'url':_0xa47d('0x57'),'headers':{'X-APIKEY':_0x1dd58a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e490a[_0xa47d('0x3e')]['email']],'buttons':null,'topic':_0x36b3f5[_0xa47d('0x52')],'note':_[_0xa47d('0x58')](_0x36b3f5[_0xa47d('0x53')])?null:getMustacheRender(_0x36b3f5[_0xa47d('0x53')],_0x20f706),'metadata':null},'redirect':_0xa47d('0x59'),'json':!![]};try{if(!_[_0xa47d('0x58')](_0x36b3f5['vidaooMetadata'])){var _0x128e31=getMustacheRender(_0x36b3f5[_0xa47d('0x54')],_0x20f706);var _0x42c6b9=JSON[_0xa47d('0x5a')](_0x128e31);_0x143d8f[_0xa47d('0x33')][_0xa47d('0x5b')]=_0x42c6b9;}}catch(_0x1d91fe){throw new db[(_0xa47d('0x5c'))]['ValidationError'](_0xa47d('0x5d'));}return rp(_0x143d8f);}else{throw new db[(_0xa47d('0x5c'))][(_0xa47d('0x5e'))](_0xa47d('0x5f'));}})[_0xa47d('0x2e')](function(_0x364d34){_0x44f55d=_0x364d34;if(_0x44f55d['id']){var _0x3a5d63={'body':_0x44f55d['join_url'],'ChatWebsiteId':_0x36b3f5['id'],'ChatInteractionId':_0x342663['id'],'direction':_0xa47d('0x60'),'UserId':_0x5e490a[_0xa47d('0x3e')]['id']};return db['ChatMessage'][_0xa47d('0x4a')](_0x3a5d63,{});}else{throw new db[(_0xa47d('0x5c'))]['ValidationError'](_0xa47d('0x61'));}})['then'](function(){return _0x342663[_0xa47d('0x62')]({'vidaooSessionId':_0x44f55d['id']});})[_0xa47d('0x2e')](respondWithResult(_0x2720a5,null))[_0xa47d('0x23')](handleError(_0x2720a5,null));};exports[_0xa47d('0x63')]=function(_0x1b866d,_0x42236d){if(_0x1b866d[_0xa47d('0x33')]['id']){delete _0x1b866d[_0xa47d('0x33')]['id'];}return db[_0xa47d('0x48')][_0xa47d('0x49')]({'where':{'id':_0x1b866d[_0xa47d('0x4b')]['id']},'include':[{'model':db[_0xa47d('0x64')],'as':'Contact'}]})[_0xa47d('0x2e')](handleEntityNotFound(_0x42236d,null))['then'](saveUpdates(_0x1b866d[_0xa47d('0x33')],null))[_0xa47d('0x2e')](respondWithResult(_0x42236d,null))['catch'](handleError(_0x42236d,null));};exports[_0xa47d('0x65')]=function(_0x215473,_0x2d2230){if(_0x215473['body']['id']){delete _0x215473['body']['id'];}return db[_0xa47d('0x48')]['find']({'where':{'id':_0x215473[_0xa47d('0x4b')]['id']}})['then'](function(_0x5a41d7){if(!_0x5a41d7){logger[_0xa47d('0x1e')](_0xa47d('0x66'),'abandon',0x194,_0xa47d('0x67'));_0x2d2230[_0xa47d('0x2f')](0x194);}else{if(_0x5a41d7[_0xa47d('0x68')]){throw new db[(_0xa47d('0x5c'))]['ValidationError'](_0xa47d('0x69'));}}return _0x5a41d7;})[_0xa47d('0x2e')](function(_0x1e8a86){if(_0x1e8a86){return _0x1e8a86[_0xa47d('0x2d')]({'closed':_0x215473[_0xa47d('0x33')]['closed'],'disposition':_0x215473[_0xa47d('0x33')]['disposition']})[_0xa47d('0x2e')](function(_0x183b1e){return _0x183b1e;});}})[_0xa47d('0x2e')](function(){return respondWithRpcPromise(_0xa47d('0x6a'),_0xa47d('0x65'),_0x215473[_0xa47d('0x33')],client9004);})['then'](respondWithResult(_0x2d2230,null))[_0xa47d('0x23')](handleError(_0x2d2230,null));};exports[_0xa47d('0x6b')]=function(_0x2987f7,_0x1896d2){_0x2987f7[_0xa47d('0x33')][_0xa47d('0x30')]=_0x2987f7['file'][_0xa47d('0x6c')];_0x2987f7[_0xa47d('0x33')][_0xa47d('0x6d')]=_0x2987f7[_0xa47d('0x6e')][_0xa47d('0x6f')];_0x2987f7['body'][_0xa47d('0x3a')]=_0x2987f7[_0xa47d('0x6e')][_0xa47d('0x70')];return db[_0xa47d('0x71')][_0xa47d('0x4a')](_0x2987f7[_0xa47d('0x33')])['then'](respondWithResult(_0x1896d2,0xc9))['catch'](handleError(_0x1896d2,null));};exports[_0xa47d('0x72')]=function(_0x435ece,_0x1e7228){return db[_0xa47d('0x48')][_0xa47d('0x73')]({'where':{'id':_0x435ece[_0xa47d('0x4b')]['id']},'raw':!![]})[_0xa47d('0x2e')](handleEntityNotFound(_0x1e7228,null))['then'](function(_0x4bb329){if(_0x4bb329){if(_0x4bb329[_0xa47d('0x74')]){return _0x1e7228[_0xa47d('0x24')](0x193)[_0xa47d('0x26')]({'status':0x193,'message':_0xa47d('0x75')});}return db['Attachment']['findOne']({'where':{'id':_0x435ece['query'][_0xa47d('0x76')]},'raw':!![]})[_0xa47d('0x2e')](handleEntityNotFound(_0x1e7228,null));}})['then'](function(_0x1d4eca){if(_0x1d4eca){var _0x5072bb=_0x1d4eca[_0xa47d('0x77')]!==null;var _0x5c1813=path[_0xa47d('0x78')](config[_0xa47d('0x79')],'server/files/attachments/');if(_0x5072bb){_0x5c1813=path[_0xa47d('0x78')](_0x5c1813,_0xa47d('0x7a'));}var _0x3c4e5a=path[_0xa47d('0x78')](_0x5c1813,_0x1d4eca['basename']);return _0x1e7228[_0xa47d('0x7b')](_0x3c4e5a);}})[_0xa47d('0x23')](handleError(_0x1e7228,null));};exports[_0xa47d('0x7c')]=function(_0x54c5c5,_0x4bcc46){var _0x3976ac=null;var _0x3b8620=null;var _0x2293ab=null;if(_0x54c5c5[_0xa47d('0x33')]['id']){delete _0x54c5c5[_0xa47d('0x33')]['id'];}if(_0x54c5c5['body']['mailTranscript']){_0x2293ab=path[_0xa47d('0x78')](config[_0xa47d('0x79')],_0xa47d('0x7d'),util[_0xa47d('0x7e')](_0xa47d('0x7f'),Date['now']()));_0x54c5c5['body'][_0xa47d('0x80')]=_0x2293ab;}return db[_0xa47d('0x48')]['find']({'where':{'id':_0x54c5c5[_0xa47d('0x4b')]['id']},'include':[{'model':db[_0xa47d('0x81')],'as':_0xa47d('0x82'),'include':[{'model':db[_0xa47d('0x83')],'as':_0xa47d('0x83')}]}]})[_0xa47d('0x2e')](handleEntityNotFound(_0x4bcc46,null))[_0xa47d('0x2e')](saveUpdates(_0x54c5c5[_0xa47d('0x33')],null))[_0xa47d('0x2e')](function(_0x1ea00d){if(_0x1ea00d){_0x3976ac=_0x1ea00d;return db[_0xa47d('0x4e')]['find']({'where':{'id':_0x3976ac[_0xa47d('0x4f')]}});}})['then'](function(_0x11712d){if(_0x11712d){_0x3b8620=_0x11712d;return db['CmContact'][_0xa47d('0x49')]({'where':{'id':_0x3976ac[_0xa47d('0x84')]}});}})[_0xa47d('0x2e')](function(_0x434565){if(_0x434565){if(_0x2293ab){var _0x161a28=null;for(var _0x3a1b74=0x1;_0x3a1b74<_0x3976ac[_0xa47d('0x82')][_0xa47d('0x85')];++_0x3a1b74){_0x161a28=_0x3976ac[_0xa47d('0x82')][_0x3a1b74];var _0x1c3a72=_0x161a28[_0xa47d('0x68')]?util[_0xa47d('0x7e')](_0xa47d('0x86'),_0x3b8620[_0xa47d('0x87')],_0x161a28[_0xa47d('0x68')]):_0xa47d('0x88');var _0x162d82=_0x54c5c5[_0xa47d('0x33')]['customer']||util[_0xa47d('0x7e')](_0xa47d('0x86'),_0xa47d('0x89'),_0x161a28['ContactId']);switch(_0x3b8620[_0xa47d('0x8a')]){case _0xa47d('0x8b'):_0x1c3a72=_0x161a28[_0xa47d('0x68')]?util[_0xa47d('0x7e')]('%s%d',_0x3b8620[_0xa47d('0x87')],_0x161a28['UserId']):_0xa47d('0x88');break;case _0xa47d('0x8c'):_0x1c3a72=_0x161a28[_0xa47d('0x68')]?_0x161a28[_0xa47d('0x83')]['alias']||_0x161a28[_0xa47d('0x83')]['fullname']:_0xa47d('0x88');break;case'agent_fullname':_0x1c3a72=_0x161a28[_0xa47d('0x68')]?_0x161a28[_0xa47d('0x83')][_0xa47d('0x55')]:_0xa47d('0x88');break;default:_0x1c3a72=_0x161a28[_0xa47d('0x68')]?util[_0xa47d('0x7e')](_0xa47d('0x86'),_0x3b8620['agentAlias'],_0x161a28[_0xa47d('0x68')]):_0xa47d('0x88');}var _0x1a26af=util[_0xa47d('0x7e')](_0xa47d('0x8d'),moment(_0x161a28[_0xa47d('0x8e')])[_0xa47d('0x7e')](_0xa47d('0x8f')),_0x161a28[_0xa47d('0x90')]==='in'?_0x162d82:_0x1c3a72,_0x161a28['body']);if(!_0x161a28[_0xa47d('0x91')]){fs[_0xa47d('0x92')](_0x2293ab,_0x1a26af);}}return db[_0xa47d('0x93')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa47d('0x94')],'as':_0xa47d('0x95'),'raw':!![],'include':[{'model':db[_0xa47d('0x96')],'as':_0xa47d('0x96'),'raw':!![]}]}]});}}})[_0xa47d('0x2e')](function(_0x746241){if(!_0x746241||!_0x746241[_0xa47d('0x95')]||!_0x54c5c5['body'])return _0x3976ac;var _0x5d619a=_0x746241['getSmtpOptions']();return respondWithRpcPromise(_0xa47d('0x97'),_0xa47d('0x98'),{'account':_0x5d619a,'message':{'from':util[_0xa47d('0x7e')](_0xa47d('0x99'),_0x746241[_0xa47d('0x30')],_0x746241[_0xa47d('0x9a')]||_0x746241[_0xa47d('0x95')][_0xa47d('0x3e')]),'to':_0x54c5c5[_0xa47d('0x33')][_0xa47d('0x9b')],'subject':_0xa47d('0x9c'),'text':util['format'](_0xa47d('0x9d'),_0x54c5c5[_0xa47d('0x33')][_0xa47d('0x9b')]),'attachments':[{'path':_0x2293ab}]}})[_0xa47d('0x2e')](function(){return _0x3976ac;})[_0xa47d('0x23')](function(_0x50ed44){logger[_0xa47d('0x1e')](_0x50ed44);});})[_0xa47d('0x2e')](respondWithStatusCode(_0x4bcc46,0xc8))[_0xa47d('0x23')](handleError(_0x4bcc46,null));};exports['addMessage']=function(_0x441370,_0x33c3b8){return db[_0xa47d('0x81')][_0xa47d('0x49')]({'where':{'id':_0x441370[_0xa47d('0x4b')]['id']}})[_0xa47d('0x2e')](handleEntityNotFound(_0x33c3b8,null))[_0xa47d('0x2e')](function(_0x45c5f5){if(_0x45c5f5){return _0x45c5f5['addMessage'](_0x441370[_0xa47d('0x33')][_0xa47d('0x9e')],_[_0xa47d('0x9f')](_0x441370[_0xa47d('0x33')],['ids','id'])||{});}})[_0xa47d('0x2e')](respondWithResult(_0x33c3b8,null))[_0xa47d('0x23')](handleError(_0x33c3b8,null));};exports[_0xa47d('0xa0')]=function(_0x1539e2,_0x3f65f9){var _0x41d350={'raw':![],'where':{}};var _0x27acd1={};var _0x47b9c9={'count':0x0,'rows':[]};return db[_0xa47d('0x48')][_0xa47d('0x73')]({'where':{'id':_0x1539e2['params']['id']}})[_0xa47d('0x2e')](handleEntityNotFound(_0x3f65f9,null))[_0xa47d('0x2e')](function(_0x78b80){if(_0x78b80){_0x27acd1[_0xa47d('0x42')]=_[_0xa47d('0x40')](db[_0xa47d('0x81')][_0xa47d('0x39')]);_0x27acd1[_0xa47d('0x3d')]=_[_0xa47d('0x40')](_0x1539e2[_0xa47d('0x3d')]);_0x27acd1[_0xa47d('0xa1')]=_[_0xa47d('0x41')](_0x27acd1['model'],_0x27acd1[_0xa47d('0x3d')]);_0x41d350[_0xa47d('0x43')]=_[_0xa47d('0x41')](_0x27acd1[_0xa47d('0x42')],qs['fields'](_0x1539e2[_0xa47d('0x3d')][_0xa47d('0x44')]));_0x41d350['attributes']=_0x41d350[_0xa47d('0x43')][_0xa47d('0x85')]?_0x41d350[_0xa47d('0x43')]:_0x27acd1[_0xa47d('0x42')];if(!_0x1539e2[_0xa47d('0x3d')][_0xa47d('0xa2')](_0xa47d('0xa3'))){_0x41d350['limit']=qs['limit'](_0x1539e2['query']['limit']);_0x41d350[_0xa47d('0x27')]=qs[_0xa47d('0x27')](_0x1539e2['query'][_0xa47d('0x27')]);}_0x41d350[_0xa47d('0xa4')]=qs[_0xa47d('0xa5')](_0x1539e2[_0xa47d('0x3d')][_0xa47d('0xa5')]);_0x41d350[_0xa47d('0xa6')]=qs[_0xa47d('0xa1')](_['pick'](_0x1539e2[_0xa47d('0x3d')],_0x27acd1['filters']));_0x41d350[_0xa47d('0xa6')][_0xa47d('0xa7')]=_0x78b80['id'];if(_0x1539e2[_0xa47d('0x3d')][_0xa47d('0xa8')]){_0x41d350[_0xa47d('0xa6')]=_[_0xa47d('0x32')](_0x41d350[_0xa47d('0xa6')],{'$or':_[_0xa47d('0xa9')](_0x41d350[_0xa47d('0x43')],function(_0x2a63a1){var _0x3886f7={};_0x3886f7[_0x2a63a1]={'$like':'%'+_0x1539e2['query'][_0xa47d('0xa8')]+'%'};return _0x3886f7;})});}if(_0x1539e2[_0xa47d('0x3d')]['$gte']){var _0x173845=_0x1539e2['query'][_0xa47d('0xaa')][_0xa47d('0xab')](',');var _0xd8e032={};_0xd8e032[_0x173845[0x0]]={'$gte':moment(_0x173845[0x1])[_0xa47d('0x7e')](_0xa47d('0xac'))};_0x41d350[_0xa47d('0xa6')]=_[_0xa47d('0x32')](_0x41d350[_0xa47d('0xa6')],_0xd8e032);}_0x41d350=_[_0xa47d('0x32')]({},_0x41d350,_0x1539e2[_0xa47d('0x47')]);return db[_0xa47d('0x81')][_0xa47d('0x2a')]({'where':_0x41d350[_0xa47d('0xa6')]})[_0xa47d('0x2e')](function(_0x4079da){_0x47b9c9[_0xa47d('0x2a')]=_0x4079da;if(_0x1539e2[_0xa47d('0x3d')][_0xa47d('0x45')]){_0x41d350[_0xa47d('0x46')]=[{'all':!![]}];}return db[_0xa47d('0x81')][_0xa47d('0xad')](_0x41d350);})[_0xa47d('0x2e')](function(_0x2de9a3){_0x47b9c9[_0xa47d('0xae')]=_0x2de9a3;return _0x47b9c9;});}})['then'](respondWithFilteredResult(_0x3f65f9,_0x41d350))[_0xa47d('0x23')](handleError(_0x3f65f9,null));};exports['getMyMessages']=function(_0x3525f4,_0x76bae){var _0x16c7f4={'where':{}},_0x49dea3={},_0x1212f2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa47d('0x73')]({'where':{'id':_0x3525f4['params']['id']}})[_0xa47d('0x2e')](handleEntityNotFound(_0x76bae,null))[_0xa47d('0x2e')](function(_0x240e11){if(_0x240e11){_0x49dea3[_0xa47d('0x42')]=_[_0xa47d('0x40')](db['ChatMessage'][_0xa47d('0x39')]);_0x49dea3['query']=_[_0xa47d('0x40')](_0x3525f4[_0xa47d('0x3d')]);_0x49dea3[_0xa47d('0xa1')]=_['intersection'](_0x49dea3['model'],_0x49dea3[_0xa47d('0x3d')]);_0x16c7f4[_0xa47d('0x43')]=_['intersection'](_0x49dea3[_0xa47d('0x42')],qs['fields'](_0x3525f4[_0xa47d('0x3d')][_0xa47d('0x44')]));_0x16c7f4[_0xa47d('0x43')]=_0x16c7f4[_0xa47d('0x43')]['length']?_0x16c7f4[_0xa47d('0x43')]:_0x49dea3[_0xa47d('0x42')];if(!_0x3525f4['query']['hasOwnProperty'](_0xa47d('0xa3'))){_0x16c7f4[_0xa47d('0x29')]=qs[_0xa47d('0x29')](_0x3525f4[_0xa47d('0x3d')][_0xa47d('0x29')]);_0x16c7f4[_0xa47d('0x27')]=qs[_0xa47d('0x27')](_0x3525f4[_0xa47d('0x3d')][_0xa47d('0x27')]);}_0x16c7f4['order']=qs['sort'](_0x3525f4[_0xa47d('0x3d')][_0xa47d('0xa5')]);_0x16c7f4['where']=qs['filters'](_[_0xa47d('0xaf')](_0x3525f4[_0xa47d('0x3d')],_0x49dea3[_0xa47d('0xa1')]));_0x16c7f4['where']['ChatInteractionId']=_0x240e11['id'];if(_0x3525f4[_0xa47d('0x3d')]['filter']){_0x16c7f4[_0xa47d('0xa6')]=_['merge'](_0x16c7f4[_0xa47d('0xa6')],{'$or':_['map'](_0x16c7f4[_0xa47d('0x43')],function(_0x1028e1){var _0x1cbc72={};_0x1cbc72[_0x1028e1]={'$like':'%'+_0x3525f4[_0xa47d('0x3d')]['filter']+'%'};return _0x1cbc72;})});}_0x16c7f4[_0xa47d('0xa6')][_0xa47d('0x91')]=![];if(_0x3525f4['query']['id']){_0x16c7f4[_0xa47d('0xa6')]['id']={'$gt':_0x3525f4['query']['id']};}_0x16c7f4=_[_0xa47d('0x32')]({},_0x16c7f4,_0x3525f4['options']);return db[_0xa47d('0x81')][_0xa47d('0x2a')]({'where':_0x16c7f4['where']})['then'](function(_0xc349eb){_0x1212f2[_0xa47d('0x2a')]=_0xc349eb;_0x16c7f4[_0xa47d('0x46')]=[];if(_0x3525f4[_0xa47d('0x3d')]['includeAgent']){_0x16c7f4[_0xa47d('0x46')][_0xa47d('0xb0')]({'model':db['User'],'as':_0xa47d('0x83'),'attributes':['id',_0xa47d('0x55'),'alias']});}if(_0x3525f4[_0xa47d('0x3d')][_0xa47d('0x45')]){_0x16c7f4[_0xa47d('0x46')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x16c7f4);})[_0xa47d('0x2e')](function(_0x17c646){_0x1212f2[_0xa47d('0xae')]=_0x17c646;return _0x1212f2;});}})['then'](respondWithFilteredResult(_0x76bae,_0x16c7f4))[_0xa47d('0x23')](handleError(_0x76bae,null));};exports['addTags']=function(_0x24692a,_0x5d5ea1){return db[_0xa47d('0x48')][_0xa47d('0x49')]({'where':{'id':_0x24692a[_0xa47d('0x4b')]['id']}})[_0xa47d('0x2e')](handleEntityNotFound(_0x5d5ea1,null))[_0xa47d('0x2e')](function(_0x28411a){if(_0x28411a){return _0x28411a[_0xa47d('0xb1')](_0x24692a[_0xa47d('0x33')][_0xa47d('0x9e')],_[_0xa47d('0x9f')](_0x24692a[_0xa47d('0x33')],[_0xa47d('0x9e'),'id'])||{})[_0xa47d('0xb2')](function(){return db['Tag']['findAll']({'attributes':['id',_0xa47d('0x30'),_0xa47d('0xb3')],'where':{'id':_0x24692a[_0xa47d('0x33')][_0xa47d('0x9e')]}});})[_0xa47d('0x2e')](function(_0x4a0eea){socket[_0xa47d('0xb4')]('chatInteractionTags:save',{'id':Number(_0x24692a[_0xa47d('0x4b')]['id']),'tags':_0x4a0eea||[]});return{'id':Number(_0x24692a['params']['id']),'tags':_0x4a0eea||[]};});}})[_0xa47d('0x2e')](respondWithResult(_0x5d5ea1,null))['catch'](handleError(_0x5d5ea1,null));};exports[_0xa47d('0xb5')]=function(_0x31e6b8,_0x54d4e3){return db[_0xa47d('0x48')][_0xa47d('0x49')]({'where':{'id':_0x31e6b8[_0xa47d('0x4b')]['id']}})[_0xa47d('0x2e')](handleEntityNotFound(_0x54d4e3,null))['then'](function(_0x5cbb50){if(_0x5cbb50){return _0x5cbb50[_0xa47d('0xb5')](_0x31e6b8[_0xa47d('0x3d')]['ids']);}})[_0xa47d('0x2e')](respondWithStatusCode(_0x54d4e3,null))[_0xa47d('0x23')](handleError(_0x54d4e3,null));};exports[_0xa47d('0x7b')]=function(_0x259b83,_0x2708d4){var _0x3ae42d=moment()['unix']()[_0xa47d('0xb6')]();var _0x61940b=path['join'](config[_0xa47d('0x79')],_0xa47d('0xb7'),_0xa47d('0xb8'),_0xa47d('0xb9'));var _0x1db3d4=path[_0xa47d('0x78')](config[_0xa47d('0x79')],_0xa47d('0xb7'),'files',_0xa47d('0xba'));var _0x9fd3f2=path[_0xa47d('0x78')](_0x61940b,_0x3ae42d);var _0x3d71a4=util[_0xa47d('0x7e')](_0xa47d('0xbb'),_0x259b83[_0xa47d('0x4b')]['id'],_0x3ae42d);var _0x5753ab=path[_0xa47d('0x78')](_0x61940b,_0x3d71a4);var _0x5e803f=[];_0x5e803f[_0xa47d('0xb0')]({'model':db[_0xa47d('0x83')],'as':'User','attributes':['id',_0xa47d('0x55')],'raw':!![]});_0x5e803f[_0xa47d('0xb0')]({'model':db[_0xa47d('0x64')],'as':_0xa47d('0xbc'),'attributes':['id',_0xa47d('0xbd'),'lastName'],'raw':!![]});if(_0x259b83[_0xa47d('0x3d')][_0xa47d('0xba')]){_0x5e803f[_0xa47d('0xb0')]({'model':db[_0xa47d('0x71')],'as':_0xa47d('0x71'),'raw':!![]});}var _0x1572a6=[{'model':db['ChatMessage'],'as':_0xa47d('0x82'),'attributes':['id',_0xa47d('0x33'),_0xa47d('0x8e'),_0xa47d('0x90'),'secret',_0xa47d('0xbe')],'include':_0x5e803f}];_0x1572a6[_0xa47d('0xb0')]({'model':db[_0xa47d('0x4e')],'as':_0xa47d('0xbf'),'attributes':['id',_0xa47d('0x30')]});_0x1572a6[_0xa47d('0xb0')]({'model':db[_0xa47d('0x83')],'as':_0xa47d('0xc0'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xa47d('0x49')]({'where':{'id':_0x259b83[_0xa47d('0x4b')]['id']},'include':_0x1572a6})[_0xa47d('0x2e')](handleEntityNotFound(_0x2708d4,null))[_0xa47d('0x2e')](function(_0x77d38a){if(_0x77d38a){var _0x4758ba=_0x77d38a[_0xa47d('0xc1')]({'plain':!![]});fs[_0xa47d('0xc2')](_0x9fd3f2);var _0x185308={'channel':'Chat','account':_0x4758ba['Account'][_0xa47d('0x30')],'agent':_0x4758ba[_0xa47d('0xc0')]?_0x4758ba[_0xa47d('0xc0')]['fullname']:'N.A.','createdAt':moment(_0x4758ba['createdAt'])['format'](_0xa47d('0xac'))[_0xa47d('0xb6')](),'closedAt':_0x4758ba[_0xa47d('0x74')]?moment(_0x4758ba[_0xa47d('0xc3')])['format'](_0xa47d('0xac'))[_0xa47d('0xb6')]():'','disposition':_0x4758ba[_0xa47d('0xc4')],'chatInfo':{'browser':_0x4758ba[_0xa47d('0xc5')],'os':_0x4758ba[_0xa47d('0xc6')],'referer':_0x4758ba['referer'],'customerIp':_0x4758ba['customerIp'],'customerPort':_0x4758ba[_0xa47d('0xc7')]?_0x4758ba[_0xa47d('0xc7')]:_0xa47d('0xc8')},'messages':_(_0x4758ba[_0xa47d('0x82')])[_0xa47d('0xc9')]()[_0xa47d('0xa8')]({'secret':![]})['map'](function(_0x217e6f){if(_0x217e6f['Attachment']){var _0x2f0ad1=path['join'](_0x1db3d4,_0x217e6f[_0xa47d('0x71')]['basename']);if(fs[_0xa47d('0xca')](_0x2f0ad1)){fs[_0xa47d('0xcb')](_0x2f0ad1)[_0xa47d('0xcc')](fs[_0xa47d('0xcd')](path[_0xa47d('0x78')](_0x9fd3f2,_0x217e6f['Attachment'][_0xa47d('0x6d')])));}}return{'date':moment(_0x217e6f[_0xa47d('0x8e')])[_0xa47d('0x7e')](_0xa47d('0xac'))['toString'](),'sender':_0x217e6f[_0xa47d('0x90')]===_0xa47d('0x60')?_0x217e6f[_0xa47d('0x83')]?_0x217e6f['User'][_0xa47d('0x55')]:_0xa47d('0x88'):_0x217e6f[_0xa47d('0xbc')][_0xa47d('0xbd')]+(_0x217e6f['Contact'][_0xa47d('0xce')]?'\x20'+_0x217e6f['Contact']['lastName']:''),'body':_0x217e6f[_0xa47d('0x71')]?_0x217e6f[_0xa47d('0x71')][_0xa47d('0x6d')]:_0x217e6f[_0xa47d('0x33')],'direction':_0x217e6f[_0xa47d('0x90')]==='out'?'A':'C','secret':_0x217e6f[_0xa47d('0x91')],'read':_0x217e6f['read'],'attachment':_0x217e6f['Attachment']};})['value']()};return ejs[_0xa47d('0xcf')](path[_0xa47d('0x78')](config[_0xa47d('0x79')],_0xa47d('0xb7'),_0xa47d('0xd0'),'downloadInteraction.ejs'),{'interaction':_0x185308})['then'](function(_0x20e45a){var _0x29719b=path['join'](_0x9fd3f2,_0xa47d('0xd1')+_0x4758ba['id']+'-'+_0x3ae42d+_0xa47d('0xd2'));var _0x48774d={'path':_0x29719b,'channel':_0xa47d('0xd3'),'interactionId':_0x4758ba['id']};return pdf[_0xa47d('0xd4')](_0x20e45a,_0x48774d);})[_0xa47d('0x2e')](function(){return new Promise(function(_0x177fa0,_0x2c942f){zipdir(_0x9fd3f2,{'saveTo':_0x5753ab},function(_0x417f23,_0x8846c0){if(_0x417f23)return _0x2c942f(_0x417f23);return _0x177fa0(_0x8846c0);});})[_0xa47d('0x2e')](function(){return new BPromise(function(_0x2f2977,_0xd70464){rimraf(_0x9fd3f2,function(_0x4ffbd1){if(_0x4ffbd1)_0xd70464(_0x4ffbd1);return _0x2f2977();});});})[_0xa47d('0x2e')](function(){return _0x2708d4[_0xa47d('0x7b')](_0x5753ab,_0x3d71a4,function(_0x579399){if(_0x579399){logger[_0xa47d('0x1e')](_0xa47d('0xd5'),_0x579399);}else{fs[_0xa47d('0xd6')](_0x5753ab);}});});});}else{return _0x2708d4[_0xa47d('0x2f')](0xc8);}})[_0xa47d('0x23')](handleError(_0x2708d4,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index a67f30d..ce4ad7a 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 _0x4487=['events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x3529ea,_0x2061a1){var _0x5cad54=function(_0x5102d0){while(--_0x5102d0){_0x3529ea['push'](_0x3529ea['shift']());}};_0x5cad54(++_0x2061a1);}(_0x4487,0x12c));var _0x7448=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x4487[_0x44bcb0];return _0xfaf881;};'use strict';var EventEmitter=require(_0x7448('0x0'));var ChatInteraction=require(_0x7448('0x1'))['db'][_0x7448('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x7448('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7448('0x4')](0x0);var events={'afterCreate':_0x7448('0x5'),'afterUpdate':_0x7448('0x6'),'afterDestroy':_0x7448('0x7')};function emitEvent(_0xcb0ab0){return function(_0x41e9a3,_0x3a03b4,_0x40ffe3){_0x41e9a3[_0x7448('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x450a2d){_0x41e9a3[_0x7448('0x9')](_0x7448('0xa'),_0x450a2d[_0x7448('0xb')](function(_0x5e7412){return{'id':_0x5e7412['id']};}));return ChatMessage[_0x7448('0xc')]({'where':{'ChatInteractionId':_0x41e9a3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7448('0xd')](function(_0x1a638b){_0x41e9a3['setDataValue'](_0x7448('0xe'),_0x1a638b[_0x7448('0xf')]);ChatInteractionEvents[_0x7448('0x10')](_0xcb0ab0+':'+_0x41e9a3['id'],_0x41e9a3);ChatInteractionEvents[_0x7448('0x10')](_0xcb0ab0,_0x41e9a3);_0x40ffe3(null);})['catch'](_0x40ffe3(null));};}for(var e in events){if(events[_0x7448('0x11')](e)){var event=events[e];ChatInteraction[_0x7448('0x12')](e,emitEvent(event));}}module[_0x7448('0x13')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x18cd=['../../mysqldb','ChatMessage','setMaxListeners','save','getUsers','then','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x5bee7b,_0x2eac4e){var _0xdc2175=function(_0x22689e){while(--_0x22689e){_0x5bee7b['push'](_0x5bee7b['shift']());}};_0xdc2175(++_0x2eac4e);}(_0x18cd,0xe1));var _0xd18c=function(_0x1ea9e1,_0x3fb7b2){_0x1ea9e1=_0x1ea9e1-0x0;var _0x286900=_0x18cd[_0x1ea9e1];return _0x286900;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xd18c('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xd18c('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd18c('0x2')](0x0);var events={'afterCreate':_0xd18c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ee108){return function(_0x4d2af3,_0x109e39,_0xfccec8){_0x4d2af3[_0xd18c('0x4')]({'attributes':['id'],'raw':!![]})[_0xd18c('0x5')](function(_0x2bbcdf){_0x4d2af3['setDataValue']('Users',_0x2bbcdf[_0xd18c('0x6')](function(_0x5b5823){return{'id':_0x5b5823['id']};}));return ChatMessage[_0xd18c('0x7')]({'where':{'ChatInteractionId':_0x4d2af3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd18c('0x5')](function(_0x3f0e71){_0x4d2af3[_0xd18c('0x8')]('unreadMessages',_0x3f0e71[_0xd18c('0x9')]);ChatInteractionEvents[_0xd18c('0xa')](_0x3ee108+':'+_0x4d2af3['id'],_0x4d2af3);ChatInteractionEvents[_0xd18c('0xa')](_0x3ee108,_0x4d2af3);_0xfccec8(null);})[_0xd18c('0xb')](_0xfccec8(null));};}for(var e in events){if(events[_0xd18c('0xc')](e)){var event=events[e];ChatInteraction[_0xd18c('0xd')](e,emitEvent(event));}}module[_0xd18c('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index fe662bd..10e5812 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 _0x9f61=['path','rimraf','../../config/environment','exports','define','ChatInteraction','changed','format','utf8mb4_unicode_ci','util','api','request-promise'];(function(_0x23653e,_0x27eece){var _0x40fca4=function(_0x323050){while(--_0x323050){_0x23653e['push'](_0x23653e['shift']());}};_0x40fca4(++_0x27eece);}(_0x9f61,0xc9));var _0x19f6=function(_0x246768,_0x5aa36d){_0x246768=_0x246768-0x0;var _0x28de2f=_0x9f61[_0x246768];return _0x28de2f;};'use strict';var _=require('lodash');var util=require(_0x19f6('0x0'));var logger=require('../../config/logger')(_0x19f6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x19f6('0x2'));var fs=require('fs');var path=require(_0x19f6('0x3'));var rimraf=require(_0x19f6('0x4'));var config=require(_0x19f6('0x5'));var attributes=require('./chatInteraction.attributes');module[_0x19f6('0x6')]=function(_0x563b1d,_0x4ceeac){return _0x563b1d[_0x19f6('0x7')](_0x19f6('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a6484,_0x358074,_0x2272d8){if(_0x4a6484[_0x19f6('0x9')]('closed')){_0x4a6484['closedAt']=moment()[_0x19f6('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2272d8(null,_0x4a6484);}},'charset':'utf8mb4','collate':_0x19f6('0xb')});};
\ No newline at end of file
+var _0x79d3=['define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x2a86cd,_0x311500){var _0x2b4f82=function(_0x3c1c65){while(--_0x3c1c65){_0x2a86cd['push'](_0x2a86cd['shift']());}};_0x2b4f82(++_0x311500);}(_0x79d3,0xe9));var _0x379d=function(_0x103b91,_0x25f9da){_0x103b91=_0x103b91-0x0;var _0x281218=_0x79d3[_0x103b91];return _0x281218;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x379d('0x4'));var config=require(_0x379d('0x5'));var attributes=require('./chatInteraction.attributes');module[_0x379d('0x6')]=function(_0x127a6b,_0x503a51){return _0x127a6b[_0x379d('0x7')]('ChatInteraction',attributes,{'tableName':_0x379d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x598f4f,_0x52567d,_0x5bbab9){if(_0x598f4f[_0x379d('0x9')](_0x379d('0xa'))){_0x598f4f[_0x379d('0xb')]=moment()[_0x379d('0xc')](_0x379d('0xd'));}_0x5bbab9(null,_0x598f4f);}},'charset':_0x379d('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 582afd4..332c51c 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 _0x849c=['bluebird','../../config/utils','rpc','jayson/promise','redis','defaults','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','code','message','result','catch','UpdateChatInteraction','options','raw','where','limit','then','AddTagsToChatInteraction','body','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x5a2655,_0x3e36c3){var _0x4ddb50=function(_0x484f5e){while(--_0x484f5e){_0x5a2655['push'](_0x5a2655['shift']());}};_0x4ddb50(++_0x3e36c3);}(_0x849c,0x69));var _0xc849=function(_0x1b4ad3,_0x5b223f){_0x1b4ad3=_0x1b4ad3-0x0;var _0x373923=_0x849c[_0x1b4ad3];return _0x373923;};'use strict';var _=require(_0xc849('0x0'));var util=require(_0xc849('0x1'));var moment=require(_0xc849('0x2'));var BPromise=require(_0xc849('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc849('0x4'));var logger=require('../../config/logger')(_0xc849('0x5'));var config=require('../../config/environment');var jayson=require(_0xc849('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xc849('0x7')]=_[_0xc849('0x8')](config[_0xc849('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xc849('0x9'))(new Redis(config[_0xc849('0x7')]));require(_0xc849('0xa'))[_0xc849('0xb')](socket);function respondWithRpcPromise(_0x15843b,_0x15e56b,_0x1bc0fd){return new BPromise(function(_0x248172,_0x1ab049){return client[_0xc849('0xc')](_0x15843b,_0x1bc0fd)['then'](function(_0x40a0cb){logger[_0xc849('0xd')](_0xc849('0xe'),_0x15e56b,_0xc849('0xf'));logger[_0xc849('0x10')](_0xc849('0x11'),_0x15e56b,_0xc849('0xf'),JSON[_0xc849('0x12')](_0x40a0cb));if(_0x40a0cb[_0xc849('0x13')]){if(_0x40a0cb[_0xc849('0x13')][_0xc849('0x14')]===0x1f4){logger[_0xc849('0x13')](_0xc849('0xe'),_0x15e56b,_0x40a0cb[_0xc849('0x13')][_0xc849('0x15')]);return _0x1ab049(_0x40a0cb['error']['message']);}logger['error'](_0xc849('0xe'),_0x15e56b,_0x40a0cb[_0xc849('0x13')]['message']);return _0x248172(_0x40a0cb['error'][_0xc849('0x15')]);}else{logger['info'](_0xc849('0xe'),_0x15e56b,_0xc849('0xf'));_0x248172(_0x40a0cb[_0xc849('0x16')][_0xc849('0x15')]);}})[_0xc849('0x17')](function(_0x1aea6f){logger[_0xc849('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x15e56b,_0x1aea6f);_0x1ab049(_0x1aea6f);});});}exports[_0xc849('0x18')]=function(_0x3686d4){var _0x1477a9=this;return new Promise(function(_0x14553b,_0x1bca4b){return db['ChatInteraction']['update'](_0x3686d4['body'],{'raw':_0x3686d4[_0xc849('0x19')]?_0x3686d4[_0xc849('0x19')][_0xc849('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3686d4[_0xc849('0x19')]?_0x3686d4[_0xc849('0x19')][_0xc849('0x1b')]||null:null,'attributes':_0x3686d4[_0xc849('0x19')]?_0x3686d4['options']['attributes']||null:null,'limit':_0x3686d4[_0xc849('0x19')]?_0x3686d4['options'][_0xc849('0x1c')]||null:null})[_0xc849('0x1d')](function(_0x29bffe){logger[_0xc849('0xd')](_0xc849('0x18'),_0x3686d4);logger['debug'](_0xc849('0x18'),_0x3686d4,JSON[_0xc849('0x12')](_0x29bffe));_0x14553b(_0x29bffe);})['catch'](function(_0x36678a){logger['error'](_0xc849('0x18'),_0x36678a[_0xc849('0x15')],_0x3686d4);_0x1bca4b(_0x1477a9[_0xc849('0x13')](0x1f4,_0x36678a[_0xc849('0x15')]));});});};exports[_0xc849('0x1e')]=function(_0x3bcac1){return new Promise(function(_0x5d4a52,_0x1a8e6a){return db['ChatInteraction']['find']({'where':_0x3bcac1['options']?_0x3bcac1[_0xc849('0x19')][_0xc849('0x1b')]||null:null})[_0xc849('0x1d')](function(_0x1bb661){if(_0x1bb661){return _0x1bb661['addTags'](_0x3bcac1[_0xc849('0x1f')][_0xc849('0x20')],_[_0xc849('0x21')](_0x3bcac1[_0xc849('0x1f')],[_0xc849('0x20'),'id'])||{});}})[_0xc849('0x22')](function(_0x3b448e){logger['info'](_0xc849('0x23'),_0x3bcac1);logger[_0xc849('0x10')](_0xc849('0x23'),_0x3bcac1,JSON[_0xc849('0x12')](_0x3b448e));_0x5d4a52(_0x3b448e);})[_0xc849('0x17')](function(_0x1ae604){logger[_0xc849('0x13')](_0xc849('0x23'),_0x1ae604[_0xc849('0x15')],_0x3bcac1);_0x1a8e6a(_this[_0xc849('0x13')](0x1f4,_0x1ae604[_0xc849('0x15')]));});});};
\ No newline at end of file
+var _0x2d9e=['AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','info','debug','stringify'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x2d9e,0x1e7));var _0xe2d9=function(_0x3497ec,_0x9e1d14){_0x3497ec=_0x3497ec-0x0;var _0x47ee1e=_0x2d9e[_0x3497ec];return _0x47ee1e;};'use strict';var _=require('lodash');var util=require(_0xe2d9('0x0'));var moment=require('moment');var BPromise=require(_0xe2d9('0x1'));var rs=require(_0xe2d9('0x2'));var fs=require('fs');var Redis=require(_0xe2d9('0x3'));var db=require(_0xe2d9('0x4'))['db'];var utils=require(_0xe2d9('0x5'));var logger=require(_0xe2d9('0x6'))(_0xe2d9('0x7'));var config=require(_0xe2d9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe2d9('0x9')]({'port':0x232a});config[_0xe2d9('0xa')]=_[_0xe2d9('0xb')](config[_0xe2d9('0xa')],{'host':_0xe2d9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2d9('0xa')]));require(_0xe2d9('0xd'))[_0xe2d9('0xe')](socket);function respondWithRpcPromise(_0x11fb54,_0x3d240b,_0x72b4c7){return new BPromise(function(_0x1f1c38,_0x2f6b66){return client['request'](_0x11fb54,_0x72b4c7)[_0xe2d9('0xf')](function(_0x109687){logger['info'](_0xe2d9('0x10'),_0x3d240b,_0xe2d9('0x11'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3d240b,'request\x20sent',JSON['stringify'](_0x109687));if(_0x109687['error']){if(_0x109687[_0xe2d9('0x12')]['code']===0x1f4){logger['error'](_0xe2d9('0x10'),_0x3d240b,_0x109687[_0xe2d9('0x12')]['message']);return _0x2f6b66(_0x109687[_0xe2d9('0x12')][_0xe2d9('0x13')]);}logger['error'](_0xe2d9('0x10'),_0x3d240b,_0x109687['error'][_0xe2d9('0x13')]);return _0x1f1c38(_0x109687[_0xe2d9('0x12')][_0xe2d9('0x13')]);}else{logger['info'](_0xe2d9('0x10'),_0x3d240b,'request\x20sent');_0x1f1c38(_0x109687[_0xe2d9('0x14')][_0xe2d9('0x13')]);}})[_0xe2d9('0x15')](function(_0x301699){logger[_0xe2d9('0x12')](_0xe2d9('0x10'),_0x3d240b,_0x301699);_0x2f6b66(_0x301699);});});}exports[_0xe2d9('0x16')]=function(_0x36377f){var _0xf9ed9f=this;return new Promise(function(_0xf45d25,_0x55c58c){return db[_0xe2d9('0x17')][_0xe2d9('0x18')](_0x36377f[_0xe2d9('0x19')],{'raw':_0x36377f[_0xe2d9('0x1a')]?_0x36377f[_0xe2d9('0x1a')][_0xe2d9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36377f[_0xe2d9('0x1a')]?_0x36377f[_0xe2d9('0x1a')][_0xe2d9('0x1c')]||null:null,'attributes':_0x36377f[_0xe2d9('0x1a')]?_0x36377f[_0xe2d9('0x1a')]['attributes']||null:null,'limit':_0x36377f['options']?_0x36377f[_0xe2d9('0x1a')][_0xe2d9('0x1d')]||null:null})[_0xe2d9('0xf')](function(_0x30e9c6){logger[_0xe2d9('0x1e')]('UpdateChatInteraction',_0x36377f);logger[_0xe2d9('0x1f')](_0xe2d9('0x16'),_0x36377f,JSON[_0xe2d9('0x20')](_0x30e9c6));_0xf45d25(_0x30e9c6);})[_0xe2d9('0x15')](function(_0x2fd210){logger[_0xe2d9('0x12')]('UpdateChatInteraction',_0x2fd210[_0xe2d9('0x13')],_0x36377f);_0x55c58c(_0xf9ed9f[_0xe2d9('0x12')](0x1f4,_0x2fd210[_0xe2d9('0x13')]));});});};exports[_0xe2d9('0x21')]=function(_0x1196f0){return new Promise(function(_0x2335a2,_0x1e0d51){return db[_0xe2d9('0x17')][_0xe2d9('0x22')]({'where':_0x1196f0[_0xe2d9('0x1a')]?_0x1196f0['options'][_0xe2d9('0x1c')]||null:null})[_0xe2d9('0xf')](function(_0x17a63e){if(_0x17a63e){return _0x17a63e[_0xe2d9('0x23')](_0x1196f0[_0xe2d9('0x19')][_0xe2d9('0x24')],_[_0xe2d9('0x25')](_0x1196f0['body'],[_0xe2d9('0x24'),'id'])||{});}})[_0xe2d9('0x26')](function(_0x4d4a1b){logger[_0xe2d9('0x1e')]('AddTags',_0x1196f0);logger[_0xe2d9('0x1f')]('AddTags',_0x1196f0,JSON[_0xe2d9('0x20')](_0x4d4a1b));_0x2335a2(_0x4d4a1b);})[_0xe2d9('0x15')](function(_0x538a0b){logger[_0xe2d9('0x12')](_0xe2d9('0x27'),_0x538a0b[_0xe2d9('0x13')],_0x1196f0);_0x1e0d51(_this[_0xe2d9('0x12')](0x1f4,_0x538a0b[_0xe2d9('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index e5d173c..788ff83 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 _0x028b=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x028b,0x1c0));var _0xb028=function(_0x3afaa8,_0x1182bc){_0x3afaa8=_0x3afaa8-0x0;var _0x53844f=_0x028b[_0x3afaa8];return _0x53844f;};'use strict';var ChatInteractionEvents=require(_0xb028('0x0'));var events=[_0xb028('0x1'),_0xb028('0x2'),_0xb028('0x3')];function createListener(_0xce15cf,_0x4b0284){return function(_0x385330){_0x4b0284[_0xb028('0x4')](_0xce15cf,_0x385330);};}function removeListener(_0x694462,_0x26207a){return function(){ChatInteractionEvents[_0xb028('0x5')](_0x694462,_0x26207a);};}exports[_0xb028('0x6')]=function(_0x3fb92a){for(var _0x463c86=0x0,_0x3dad8e=events[_0xb028('0x7')];_0x463c86<_0x3dad8e;_0x463c86++){var _0x1e95e7=events[_0x463c86];var _0x1757ff=createListener(_0xb028('0x8')+_0x1e95e7,_0x3fb92a);ChatInteractionEvents['on'](_0x1e95e7,_0x1757ff);}};
\ No newline at end of file
+var _0x61c6=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','register','length'];(function(_0xa33769,_0x24efe9){var _0x4b39b8=function(_0x4a752c){while(--_0x4a752c){_0xa33769['push'](_0xa33769['shift']());}};_0x4b39b8(++_0x24efe9);}(_0x61c6,0x199));var _0x661c=function(_0x382f6c,_0x7e79e3){_0x382f6c=_0x382f6c-0x0;var _0x1ec773=_0x61c6[_0x382f6c];return _0x1ec773;};'use strict';var ChatInteractionEvents=require(_0x661c('0x0'));var events=[_0x661c('0x1'),_0x661c('0x2'),_0x661c('0x3')];function createListener(_0x51fa8d,_0x562393){return function(_0x29652b){_0x562393['emit'](_0x51fa8d,_0x29652b);};}function removeListener(_0x26d854,_0x5e5835){return function(){ChatInteractionEvents[_0x661c('0x4')](_0x26d854,_0x5e5835);};}exports[_0x661c('0x5')]=function(_0x531865){for(var _0x4936a9=0x0,_0x330c23=events[_0x661c('0x6')];_0x4936a9<_0x330c23;_0x4936a9++){var _0x306d2c=events[_0x4936a9];var _0x250e2c=createListener(_0x661c('0x7')+_0x306d2c,_0x531865);ChatInteractionEvents['on'](_0x306d2c,_0x250e2c);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index b47a4db..6f8befa 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 _0x0b48=['addTags','put','/:id','chatinteraction:update','update','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x1cc4e1,_0x1629d4){var _0x192d47=function(_0x40dbe2){while(--_0x40dbe2){_0x1cc4e1['push'](_0x1cc4e1['shift']());}};_0x192d47(++_0x1629d4);}(_0x0b48,0x1ef));var _0x80b4=function(_0x45c6f5,_0x4e7b86){_0x45c6f5=_0x45c6f5-0x0;var _0x2b4d40=_0x0b48[_0x45c6f5];return _0x2b4d40;};'use strict';var multer=require(_0x80b4('0x0'));var util=require(_0x80b4('0x1'));var path=require('path');var timeout=require(_0x80b4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x80b4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x80b4('0x4'));var config=require(_0x80b4('0x5'));var controller=require(_0x80b4('0x6'));router[_0x80b4('0x7')]('/',auth[_0x80b4('0x8')](),controller[_0x80b4('0x9')]);router[_0x80b4('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0x80b4('0x7')](_0x80b4('0xa'),auth['isChatInteractionAuthorized'](),controller[_0x80b4('0xb')]);router['get'](_0x80b4('0xc'),auth['isAuthenticated'](),controller[_0x80b4('0xd')]);router[_0x80b4('0x7')]('/:id/my_messages',auth[_0x80b4('0xe')](),controller[_0x80b4('0xf')]);router['get'](_0x80b4('0x10'),auth[_0x80b4('0x8')](),controller[_0x80b4('0x11')]);router[_0x80b4('0x12')]('/',auth[_0x80b4('0x8')](),controller[_0x80b4('0x13')]);router[_0x80b4('0x12')](_0x80b4('0x14'),auth[_0x80b4('0x8')](),controller[_0x80b4('0x15')]);var upload=multer({'storage':multer[_0x80b4('0x16')]({'destination':function(_0x5b9f93,_0x22cd31,_0x367447){_0x367447(null,path[_0x80b4('0x17')](config[_0x80b4('0x18')],'server/files/attachments/'));},'filename':function(_0x454d95,_0x4eb5d1,_0x2b7559){_0x2b7559(null,util[_0x80b4('0x19')]('%s-%s',Date['now'](),_0x4eb5d1['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x80b4('0x12')]('/:id/attachment_upload',upload[_0x80b4('0x1a')](_0x80b4('0x1b')),controller['attachmentUpload']);router[_0x80b4('0x12')]('/:id/messages',auth[_0x80b4('0xe')](),controller[_0x80b4('0x1c')]);router[_0x80b4('0x12')](_0x80b4('0x1d'),auth[_0x80b4('0x8')](),interaction[_0x80b4('0x1e')](_0x80b4('0x1f'),_0x80b4('0x20')),controller[_0x80b4('0x21')]);router[_0x80b4('0x22')](_0x80b4('0x23'),auth[_0x80b4('0x8')](),interaction[_0x80b4('0x1e')](_0x80b4('0x1f'),_0x80b4('0x24')),controller[_0x80b4('0x25')]);router[_0x80b4('0x22')]('/:id/custom_update',controller['customUpdate']);router[_0x80b4('0x22')](_0x80b4('0x26'),auth['isChatInteractionAuthorized'](),controller[_0x80b4('0x27')]);router[_0x80b4('0x22')]('/:id/close',controller['close']);router[_0x80b4('0x28')](_0x80b4('0x23'),auth[_0x80b4('0x8')](),interaction[_0x80b4('0x1e')](_0x80b4('0x1f'),_0x80b4('0x29')),controller[_0x80b4('0x2a')]);router[_0x80b4('0x28')](_0x80b4('0x1d'),auth[_0x80b4('0x8')](),controller['removeTags']);module[_0x80b4('0x2b')]=router;
\ No newline at end of file
+var _0x914c=['abandon','/:id/close','/:id','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','post','/:id/attachment_upload','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','customUpdate','/:id/abandon'];(function(_0x2cf68e,_0x32ed11){var _0x27ae6a=function(_0x5e39c7){while(--_0x5e39c7){_0x2cf68e['push'](_0x2cf68e['shift']());}};_0x27ae6a(++_0x32ed11);}(_0x914c,0x134));var _0xc914=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x914c[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xc914('0x0'));var util=require(_0xc914('0x1'));var path=require(_0xc914('0x2'));var timeout=require(_0xc914('0x3'));var express=require(_0xc914('0x4'));var router=express[_0xc914('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc914('0x6'));var controller=require(_0xc914('0x7'));router[_0xc914('0x8')]('/',auth[_0xc914('0x9')](),controller['index']);router[_0xc914('0x8')](_0xc914('0xa'),auth[_0xc914('0x9')](),controller['describe']);router[_0xc914('0x8')]('/:id',auth[_0xc914('0xb')](),controller[_0xc914('0xc')]);router['get'](_0xc914('0xd'),auth[_0xc914('0xb')](),controller[_0xc914('0xe')]);router[_0xc914('0x8')](_0xc914('0xf'),auth[_0xc914('0x9')](),controller[_0xc914('0x10')]);router[_0xc914('0x8')](_0xc914('0x11'),auth[_0xc914('0xb')](),controller['getMyMessages']);router[_0xc914('0x8')](_0xc914('0x12'),auth[_0xc914('0x9')](),controller[_0xc914('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc914('0x14')]);router['post']('/:id/vidaoo',auth[_0xc914('0x9')](),controller[_0xc914('0x15')]);var upload=multer({'storage':multer[_0xc914('0x16')]({'destination':function(_0x2d528b,_0x41bcc8,_0x2d2a43){_0x2d2a43(null,path[_0xc914('0x17')](config[_0xc914('0x18')],_0xc914('0x19')));},'filename':function(_0x3907ed,_0x39ee4e,_0x812d69){_0x812d69(null,util[_0xc914('0x1a')](_0xc914('0x1b'),Date[_0xc914('0x1c')](),_0x39ee4e[_0xc914('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc914('0x1e')](_0xc914('0x1f'),upload['single']('file'),controller[_0xc914('0x20')]);router[_0xc914('0x1e')](_0xc914('0xf'),auth[_0xc914('0xb')](),controller[_0xc914('0x21')]);router[_0xc914('0x1e')](_0xc914('0x22'),auth[_0xc914('0x9')](),interaction[_0xc914('0x23')](_0xc914('0x24'),'chatinteraction:addtags'),controller[_0xc914('0x25')]);router[_0xc914('0x26')]('/:id',auth[_0xc914('0x9')](),interaction[_0xc914('0x23')]('chat',_0xc914('0x27')),controller['update']);router[_0xc914('0x26')]('/:id/custom_update',controller[_0xc914('0x28')]);router[_0xc914('0x26')](_0xc914('0x29'),auth[_0xc914('0xb')](),controller[_0xc914('0x2a')]);router[_0xc914('0x26')](_0xc914('0x2b'),controller['close']);router['delete'](_0xc914('0x2c'),auth[_0xc914('0x9')](),interaction[_0xc914('0x23')](_0xc914('0x24'),_0xc914('0x2d')),controller[_0xc914('0x2e')]);router[_0xc914('0x2f')](_0xc914('0x22'),auth[_0xc914('0x9')](),controller[_0xc914('0x30')]);module[_0xc914('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 21017a5..5ba5f8b 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 _0xe10d=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe10d,0x1b8));var _0xde10=function(_0x5aa90c,_0x40e79b){_0x5aa90c=_0x5aa90c-0x0;var _0x228251=_0xe10d[_0x5aa90c];return _0x228251;};'use strict';var Sequelize=require(_0xde10('0x0'));module[_0xde10('0x1')]={'body':{'type':Sequelize[_0xde10('0x2')](_0xde10('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xde10('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xde10('0x5')]}};
\ No newline at end of file
+var _0xa36f=['TEXT','medium','BOOLEAN','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa36f,0xab));var _0xfa36=function(_0x5ede1a,_0x51e4d0){_0x5ede1a=_0x5ede1a-0x0;var _0x9b0761=_0xa36f[_0x5ede1a];return _0x9b0761;};'use strict';var Sequelize=require('sequelize');module[_0xfa36('0x0')]={'body':{'type':Sequelize[_0xfa36('0x1')](_0xfa36('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfa36('0x3')],'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 1c1efd2..0c96195 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 _0xb47e=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','ChatInternalMessage','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','describe','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','push','messages','FromId','ToId','read','-createdAt','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','type','key','model','map','query'];(function(_0x32d254,_0x15e17c){var _0x1b2a7a=function(_0x3ad486){while(--_0x3ad486){_0x32d254['push'](_0x32d254['shift']());}};_0x1b2a7a(++_0x15e17c);}(_0xb47e,0xa6));var _0xeb47=function(_0x2f11b1,_0x27fe5e){_0x2f11b1=_0x2f11b1-0x0;var _0x19f371=_0xb47e[_0x2f11b1];return _0x19f371;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb47('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb47('0x1'));var rp=require(_0xeb47('0x2'));var moment=require('moment');var BPromise=require(_0xeb47('0x3'));var Mustache=require('mustache');var util=require(_0xeb47('0x4'));var path=require(_0xeb47('0x5'));var sox=require(_0xeb47('0x6'));var csv=require(_0xeb47('0x7'));var ejs=require(_0xeb47('0x8'));var fs=require('fs');var fs_extra=require(_0xeb47('0x9'));var _=require(_0xeb47('0xa'));var squel=require('squel');var crypto=require(_0xeb47('0xb'));var jsforce=require(_0xeb47('0xc'));var deskjs=require(_0xeb47('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeb47('0xe'));var Redis=require('ioredis');var authService=require(_0xeb47('0xf'));var qs=require(_0xeb47('0x10'));var as=require(_0xeb47('0x11'));var hardwareService=require(_0xeb47('0x12'));var logger=require(_0xeb47('0x13'))('api');var utils=require(_0xeb47('0x14'));var config=require(_0xeb47('0x15'));var licenseUtil=require(_0xeb47('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xeb47('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeb47('0x18'))(new Redis(config[_0xeb47('0x19')]));require(_0xeb47('0x1a'))[_0xeb47('0x1b')](socket);function respondWithStatusCode(_0x585244,_0x57949f){_0x57949f=_0x57949f||0xcc;return function(_0x850454){if(_0x850454){return _0x585244[_0xeb47('0x1c')](_0x57949f);}return _0x585244[_0xeb47('0x1d')](_0x57949f)[_0xeb47('0x1e')]();};}function respondWithResult(_0x458f6d,_0x368422){_0x368422=_0x368422||0xc8;return function(_0x17afe2){if(_0x17afe2){return _0x458f6d[_0xeb47('0x1d')](_0x368422)['json'](_0x17afe2);}};}function respondWithFilteredResult(_0xbea28e,_0x7b5474){return function(_0x54f05c){if(_0x54f05c){var _0x5bdab4=typeof _0x7b5474[_0xeb47('0x1f')]==='undefined'&&typeof _0x7b5474[_0xeb47('0x20')]===_0xeb47('0x21');var _0x3dbaa5=_0x54f05c[_0xeb47('0x22')];var _0x1daac6=_0x5bdab4?0x0:_0x7b5474[_0xeb47('0x1f')];var _0x5913ea=_0x5bdab4?_0x54f05c[_0xeb47('0x22')]:_0x7b5474[_0xeb47('0x1f')]+_0x7b5474[_0xeb47('0x20')];var _0x22e77b;if(_0x5913ea>=_0x3dbaa5){_0x5913ea=_0x3dbaa5;_0x22e77b=0xc8;}else{_0x22e77b=0xce;}_0xbea28e[_0xeb47('0x1d')](_0x22e77b);return _0xbea28e['set'](_0xeb47('0x23'),_0x1daac6+'-'+_0x5913ea+'/'+_0x3dbaa5)[_0xeb47('0x24')](_0x54f05c);}return null;};}function patchUpdates(_0x40655b){return function(_0x58d75d){try{jsonpatch['apply'](_0x58d75d,_0x40655b,!![]);}catch(_0x489b01){return BPromise[_0xeb47('0x25')](_0x489b01);}return _0x58d75d[_0xeb47('0x26')]();};}function saveUpdates(_0x30a819,_0x546f0c){return function(_0x4aecdb){if(_0x4aecdb){return _0x4aecdb[_0xeb47('0x27')](_0x30a819)[_0xeb47('0x28')](function(_0x3f5d0a){return _0x3f5d0a;});}return null;};}function removeEntity(_0x2984a2,_0x48a5e6){return function(_0xc3e05){if(_0xc3e05){return _0xc3e05[_0xeb47('0x29')]()['then'](function(){_0x2984a2[_0xeb47('0x1d')](0xcc)[_0xeb47('0x1e')]();});}};}function handleEntityNotFound(_0x97d451,_0x19436a){return function(_0x1bbc87){if(!_0x1bbc87){_0x97d451[_0xeb47('0x1c')](0x194);}return _0x1bbc87;};}function handleError(_0x105a1e,_0x222258){_0x222258=_0x222258||0x1f4;return function(_0x2183ae){logger['error'](_0x2183ae[_0xeb47('0x2a')]);if(_0x2183ae[_0xeb47('0x2b')]){delete _0x2183ae[_0xeb47('0x2b')];}_0x105a1e[_0xeb47('0x1d')](_0x222258)[_0xeb47('0x2c')](_0x2183ae);};}exports[_0xeb47('0x2d')]=function(_0x949af,_0x23bb8f){var _0x3540c9={},_0x2cb46e={},_0x54e97a={'count':0x0,'rows':[]};var _0x4b8ed6=_['map'](db['ChatInternalMessage'][_0xeb47('0x2e')],function(_0x1e4417){return{'name':_0x1e4417['fieldName'],'type':_0x1e4417[_0xeb47('0x2f')][_0xeb47('0x30')]};});_0x2cb46e[_0xeb47('0x31')]=_[_0xeb47('0x32')](_0x4b8ed6,_0xeb47('0x2b'));_0x2cb46e[_0xeb47('0x33')]=_['keys'](_0x949af['query']);_0x2cb46e['filters']=_['intersection'](_0x2cb46e[_0xeb47('0x31')],_0x2cb46e[_0xeb47('0x33')]);_0x3540c9[_0xeb47('0x34')]=_[_0xeb47('0x35')](_0x2cb46e[_0xeb47('0x31')],qs[_0xeb47('0x36')](_0x949af[_0xeb47('0x33')][_0xeb47('0x36')]));_0x3540c9[_0xeb47('0x34')]=_0x3540c9[_0xeb47('0x34')][_0xeb47('0x37')]?_0x3540c9[_0xeb47('0x34')]:_0x2cb46e[_0xeb47('0x31')];if(!_0x949af['query'][_0xeb47('0x38')](_0xeb47('0x39'))){_0x3540c9['limit']=qs[_0xeb47('0x20')](_0x949af[_0xeb47('0x33')]['limit']);_0x3540c9['offset']=qs['offset'](_0x949af[_0xeb47('0x33')][_0xeb47('0x1f')]);}_0x3540c9[_0xeb47('0x3a')]=qs[_0xeb47('0x3b')](_0x949af[_0xeb47('0x33')][_0xeb47('0x3b')]);_0x3540c9[_0xeb47('0x3c')]=qs[_0xeb47('0x3d')](_[_0xeb47('0x3e')](_0x949af['query'],_0x2cb46e[_0xeb47('0x3d')]),_0x4b8ed6);if(_0x949af['query']['filter']){_0x3540c9[_0xeb47('0x3c')]=_[_0xeb47('0x3f')](_0x3540c9[_0xeb47('0x3c')],{'$or':_[_0xeb47('0x32')](_0x4b8ed6,function(_0x5bbff2){if(_0x5bbff2[_0xeb47('0x2f')]!==_0xeb47('0x40')){var _0x115610={};_0x115610[_0x5bbff2[_0xeb47('0x2b')]]={'$like':'%'+_0x949af[_0xeb47('0x33')][_0xeb47('0x41')]+'%'};return _0x115610;}})});}_0x3540c9=_[_0xeb47('0x3f')]({},_0x3540c9,_0x949af['options']);var _0x110d03={'where':_0x3540c9[_0xeb47('0x3c')]};return db['ChatInternalMessage']['count'](_0x110d03)[_0xeb47('0x28')](function(_0x30b0da){_0x54e97a[_0xeb47('0x22')]=_0x30b0da;if(_0x949af[_0xeb47('0x33')]['includeAll']){_0x3540c9[_0xeb47('0x42')]=[{'all':!![]}];}return db[_0xeb47('0x43')][_0xeb47('0x44')](_0x3540c9);})[_0xeb47('0x28')](function(_0x3ccdb5){_0x54e97a[_0xeb47('0x45')]=_0x3ccdb5;return _0x54e97a;})[_0xeb47('0x28')](respondWithFilteredResult(_0x23bb8f,_0x3540c9))[_0xeb47('0x46')](handleError(_0x23bb8f,null));};exports[_0xeb47('0x47')]=function(_0x4221e3,_0x3f056b){var _0x127f60={'raw':!![],'where':{'id':_0x4221e3[_0xeb47('0x48')]['id']}},_0x49bd43={};_0x49bd43[_0xeb47('0x31')]=_[_0xeb47('0x49')](db[_0xeb47('0x43')][_0xeb47('0x2e')]);_0x49bd43[_0xeb47('0x33')]=_[_0xeb47('0x49')](_0x4221e3[_0xeb47('0x33')]);_0x49bd43[_0xeb47('0x3d')]=_[_0xeb47('0x35')](_0x49bd43['model'],_0x49bd43[_0xeb47('0x33')]);_0x127f60[_0xeb47('0x34')]=_[_0xeb47('0x35')](_0x49bd43['model'],qs[_0xeb47('0x36')](_0x4221e3[_0xeb47('0x33')][_0xeb47('0x36')]));_0x127f60[_0xeb47('0x34')]=_0x127f60[_0xeb47('0x34')][_0xeb47('0x37')]?_0x127f60[_0xeb47('0x34')]:_0x49bd43[_0xeb47('0x31')];if(_0x4221e3['query'][_0xeb47('0x4a')]){_0x127f60[_0xeb47('0x42')]=[{'all':!![]}];}_0x127f60=_[_0xeb47('0x3f')]({},_0x127f60,_0x4221e3[_0xeb47('0x4b')]);return db['ChatInternalMessage'][_0xeb47('0x4c')](_0x127f60)[_0xeb47('0x28')](handleEntityNotFound(_0x3f056b,null))[_0xeb47('0x28')](respondWithResult(_0x3f056b,null))[_0xeb47('0x46')](handleError(_0x3f056b,null));};exports[_0xeb47('0x4d')]=function(_0x3213d1,_0x1894b8){return db[_0xeb47('0x43')]['create'](_0x3213d1[_0xeb47('0x4e')],{})[_0xeb47('0x28')](respondWithResult(_0x1894b8,0xc9))['catch'](handleError(_0x1894b8,null));};exports[_0xeb47('0x27')]=function(_0x3c11f7,_0x168749){if(_0x3c11f7[_0xeb47('0x4e')]['id']){delete _0x3c11f7[_0xeb47('0x4e')]['id'];}return db[_0xeb47('0x43')][_0xeb47('0x4c')]({'where':{'id':_0x3c11f7[_0xeb47('0x48')]['id']}})[_0xeb47('0x28')](handleEntityNotFound(_0x168749,null))[_0xeb47('0x28')](saveUpdates(_0x3c11f7[_0xeb47('0x4e')],null))[_0xeb47('0x28')](respondWithResult(_0x168749,null))[_0xeb47('0x46')](handleError(_0x168749,null));};exports['destroy']=function(_0x2c8922,_0x4252be){return db[_0xeb47('0x43')][_0xeb47('0x4c')]({'where':{'id':_0x2c8922[_0xeb47('0x48')]['id']}})[_0xeb47('0x28')](handleEntityNotFound(_0x4252be,null))[_0xeb47('0x28')](removeEntity(_0x4252be,null))['catch'](handleError(_0x4252be,null));};exports[_0xeb47('0x4f')]=function(_0x4444f6,_0x42c241){return db[_0xeb47('0x43')][_0xeb47('0x4f')]()[_0xeb47('0x28')](respondWithResult(_0x42c241,null))['catch'](handleError(_0x42c241,null));};function wrapUser(_0x338515){return function(_0x1c5385){var _0x15506a=_0x338515['get']({'plain':!![]});_0x15506a['messages']=[];if(_0x1c5385){_0x15506a['lastMessageAt']=_0x1c5385[_0xeb47('0x50')];_0x15506a[_0xeb47('0x51')]=_0x1c5385;}else{_0x15506a['lastMessageAt']=moment(0x0)[_0xeb47('0x52')](_0xeb47('0x53'));_0x15506a[_0xeb47('0x51')]={};}return _0x15506a;};}exports[_0xeb47('0x54')]=function(_0x17fa8f,_0x325f06,_0xf6066){var _0x6005fe=[];return db['User'][_0xeb47('0x44')]({'where':{'role':[_0xeb47('0x55'),_0xeb47('0x56'),_0xeb47('0x57')]},'attributes':['id',_0xeb47('0x58'),'name','role',_0xeb47('0x59'),_0xeb47('0x5a'),_0xeb47('0x5b'),'lastLoginAt',_0xeb47('0x5c'),_0xeb47('0x5d')],'order':qs[_0xeb47('0x3b')](_0xeb47('0x5e')),'include':[{'model':db['VoiceQueue'],'as':_0xeb47('0x5f'),'attributes':['id',_0xeb47('0x2b'),_0xeb47('0x2f')],'through':{'attributes':[]}}]})[_0xeb47('0x28')](function(_0xa139ab){if(_0xa139ab){var _0x3e16f8=_0x17fa8f[_0xeb47('0x57')]['get']({'plain':!![]});if(!_0x3e16f8)throw new Error(_0xeb47('0x60'));if(_0x3e16f8[_0xeb47('0x61')]===_0xeb47('0x57')){return db[_0xeb47('0x62')][_0xeb47('0x4c')]({'where':{'name':_0xeb47('0x63'),'userProfileId':_0x3e16f8[_0xeb47('0x64')]},'raw':!![]})[_0xeb47('0x28')](function(_0x4e0ad6){if(_0x4e0ad6){if(_0x4e0ad6[_0xeb47('0x65')]===0x0){return db['UserProfileResource'][_0xeb47('0x44')]({'where':{'sectionId':_0x4e0ad6['id']},'raw':!![]})['then'](function(_0x5a2b25){var _0x2a03dd=[];if(_[_0xeb47('0x66')](_0x5a2b25)){_0x2a03dd=_[_0xeb47('0x41')](_0xa139ab,function(_0x6068e3){if(_0x6068e3['role']!==_0xeb47('0x55')){return _0x6068e3;}});return _0x2a03dd;}else{for(var _0x5ed7a9=0x0;_0x5ed7a9<_0xa139ab['length'];_0x5ed7a9++){var _0x3ae34d=_0xa139ab[_0x5ed7a9];if(_0x3ae34d[_0xeb47('0x61')]===_0xeb47('0x55')){var _0x450d60=_[_0xeb47('0x4c')](_0x5a2b25,function(_0x46a2eb){return _0x46a2eb['resourceId']===_0x3ae34d['id'];});if(_0x450d60)_0x2a03dd[_0xeb47('0x67')](_0x3ae34d);}else{_0x2a03dd['push'](_0x3ae34d);}}return _0x2a03dd;}});}else{return _0xa139ab;}}else{var _0x9e6d24=_[_0xeb47('0x41')](_0xa139ab,function(_0x1a54f5){if(_0x1a54f5['role']!=='agent'){return _0x1a54f5;}});return _0x9e6d24;}});}else{return _0xa139ab;}}})[_0xeb47('0x28')](function(_0xab0246){var _0x3adedc=[];if(_0xab0246){_0x6005fe=_0xab0246;for(var _0x4a6664=0x0;_0x4a6664<_0xab0246[_0xeb47('0x37')];_0x4a6664+=0x1){_0x6005fe[_0x4a6664][_0xeb47('0x68')]=[];_0x3adedc['push'](db[_0xeb47('0x43')][_0xeb47('0x4c')]({'where':{'FromId':[_0x17fa8f[_0xeb47('0x57')]['id'],_0xab0246[_0x4a6664]['id']],'ToId':[_0x17fa8f[_0xeb47('0x57')]['id'],_0xab0246[_0x4a6664]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xeb47('0x69'),_0xeb47('0x6a'),_0xeb47('0x6b'),_0xeb47('0x4e')],'order':qs[_0xeb47('0x3b')](_0xeb47('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xab0246[_0x4a6664])));}return BPromise['all'](_0x3adedc);}return[];})[_0xeb47('0x28')](function(_0x299423){return{'rows':_0x299423,'count':_0x299423['length']};})[_0xeb47('0x28')](respondWithResult(_0x325f06,null))[_0xeb47('0x46')](handleError(_0x325f06,null));};
\ No newline at end of file
+var _0x5e0f=['sort','where','filters','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','intersection','find','create','body','catch','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','FromId','ToId','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0x5e0f,0x1f3));var _0xf5e0=function(_0x2bb428,_0xa4668d){_0x2bb428=_0x2bb428-0x0;var _0xb72625=_0x5e0f[_0x2bb428];return _0xb72625;};'use strict';var emlformat=require(_0xf5e0('0x0'));var rimraf=require(_0xf5e0('0x1'));var zipdir=require(_0xf5e0('0x2'));var jsonpatch=require(_0xf5e0('0x3'));var rp=require(_0xf5e0('0x4'));var moment=require(_0xf5e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf5e0('0x6'));var util=require('util');var path=require(_0xf5e0('0x7'));var sox=require(_0xf5e0('0x8'));var csv=require(_0xf5e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5e0('0xa'));var _=require('lodash');var squel=require(_0xf5e0('0xb'));var crypto=require(_0xf5e0('0xc'));var jsforce=require(_0xf5e0('0xd'));var deskjs=require(_0xf5e0('0xe'));var toCsv=require(_0xf5e0('0x9'));var querystring=require(_0xf5e0('0xf'));var Papa=require(_0xf5e0('0x10'));var Redis=require('ioredis');var authService=require(_0xf5e0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5e0('0x12'));var logger=require(_0xf5e0('0x13'))(_0xf5e0('0x14'));var utils=require('../../config/utils');var config=require(_0xf5e0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5e0('0x16'))['db'];config[_0xf5e0('0x17')]=_[_0xf5e0('0x18')](config[_0xf5e0('0x17')],{'host':_0xf5e0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5e0('0x17')]));require(_0xf5e0('0x1a'))[_0xf5e0('0x1b')](socket);function respondWithStatusCode(_0x1a6095,_0x198b44){_0x198b44=_0x198b44||0xcc;return function(_0x422d83){if(_0x422d83){return _0x1a6095[_0xf5e0('0x1c')](_0x198b44);}return _0x1a6095[_0xf5e0('0x1d')](_0x198b44)[_0xf5e0('0x1e')]();};}function respondWithResult(_0x1e8299,_0x40e6f4){_0x40e6f4=_0x40e6f4||0xc8;return function(_0x237281){if(_0x237281){return _0x1e8299[_0xf5e0('0x1d')](_0x40e6f4)[_0xf5e0('0x1f')](_0x237281);}};}function respondWithFilteredResult(_0x5aea67,_0x2b93e9){return function(_0xf70b2a){if(_0xf70b2a){var _0x4b5ae8=typeof _0x2b93e9[_0xf5e0('0x20')]==='undefined'&&typeof _0x2b93e9[_0xf5e0('0x21')]===_0xf5e0('0x22');var _0x4d6ad6=_0xf70b2a[_0xf5e0('0x23')];var _0x22c1cf=_0x4b5ae8?0x0:_0x2b93e9[_0xf5e0('0x20')];var _0x2bbf07=_0x4b5ae8?_0xf70b2a[_0xf5e0('0x23')]:_0x2b93e9[_0xf5e0('0x20')]+_0x2b93e9[_0xf5e0('0x21')];var _0x12a12b;if(_0x2bbf07>=_0x4d6ad6){_0x2bbf07=_0x4d6ad6;_0x12a12b=0xc8;}else{_0x12a12b=0xce;}_0x5aea67['status'](_0x12a12b);return _0x5aea67[_0xf5e0('0x24')](_0xf5e0('0x25'),_0x22c1cf+'-'+_0x2bbf07+'/'+_0x4d6ad6)['json'](_0xf70b2a);}return null;};}function patchUpdates(_0x4b5d67){return function(_0x3cf41a){try{jsonpatch[_0xf5e0('0x26')](_0x3cf41a,_0x4b5d67,!![]);}catch(_0x51c91a){return BPromise[_0xf5e0('0x27')](_0x51c91a);}return _0x3cf41a[_0xf5e0('0x28')]();};}function saveUpdates(_0x470efe,_0x49c504){return function(_0x24f8b7){if(_0x24f8b7){return _0x24f8b7[_0xf5e0('0x29')](_0x470efe)[_0xf5e0('0x2a')](function(_0x4aeba0){return _0x4aeba0;});}return null;};}function removeEntity(_0x53cc2b,_0x11dca9){return function(_0x21b3b1){if(_0x21b3b1){return _0x21b3b1[_0xf5e0('0x2b')]()[_0xf5e0('0x2a')](function(){_0x53cc2b[_0xf5e0('0x1d')](0xcc)[_0xf5e0('0x1e')]();});}};}function handleEntityNotFound(_0x283ad2,_0xf0f953){return function(_0x2fa981){if(!_0x2fa981){_0x283ad2[_0xf5e0('0x1c')](0x194);}return _0x2fa981;};}function handleError(_0x61281a,_0xbd8309){_0xbd8309=_0xbd8309||0x1f4;return function(_0x4d9974){logger[_0xf5e0('0x2c')](_0x4d9974[_0xf5e0('0x2d')]);if(_0x4d9974[_0xf5e0('0x2e')]){delete _0x4d9974[_0xf5e0('0x2e')];}_0x61281a[_0xf5e0('0x1d')](_0xbd8309)[_0xf5e0('0x2f')](_0x4d9974);};}exports[_0xf5e0('0x30')]=function(_0x3faed1,_0x3e83cc){var _0x4c443b={},_0x444af2={},_0x110d4e={'count':0x0,'rows':[]};var _0x2d7b8d=_[_0xf5e0('0x31')](db['ChatInternalMessage'][_0xf5e0('0x32')],function(_0x4bc063){return{'name':_0x4bc063[_0xf5e0('0x33')],'type':_0x4bc063[_0xf5e0('0x34')]['key']};});_0x444af2[_0xf5e0('0x35')]=_['map'](_0x2d7b8d,'name');_0x444af2[_0xf5e0('0x36')]=_[_0xf5e0('0x37')](_0x3faed1[_0xf5e0('0x36')]);_0x444af2['filters']=_['intersection'](_0x444af2['model'],_0x444af2[_0xf5e0('0x36')]);_0x4c443b[_0xf5e0('0x38')]=_['intersection'](_0x444af2['model'],qs[_0xf5e0('0x39')](_0x3faed1[_0xf5e0('0x36')][_0xf5e0('0x39')]));_0x4c443b[_0xf5e0('0x38')]=_0x4c443b[_0xf5e0('0x38')][_0xf5e0('0x3a')]?_0x4c443b[_0xf5e0('0x38')]:_0x444af2[_0xf5e0('0x35')];if(!_0x3faed1[_0xf5e0('0x36')][_0xf5e0('0x3b')](_0xf5e0('0x3c'))){_0x4c443b[_0xf5e0('0x21')]=qs[_0xf5e0('0x21')](_0x3faed1[_0xf5e0('0x36')]['limit']);_0x4c443b[_0xf5e0('0x20')]=qs[_0xf5e0('0x20')](_0x3faed1[_0xf5e0('0x36')][_0xf5e0('0x20')]);}_0x4c443b['order']=qs[_0xf5e0('0x3d')](_0x3faed1[_0xf5e0('0x36')][_0xf5e0('0x3d')]);_0x4c443b[_0xf5e0('0x3e')]=qs[_0xf5e0('0x3f')](_['pick'](_0x3faed1[_0xf5e0('0x36')],_0x444af2['filters']),_0x2d7b8d);if(_0x3faed1[_0xf5e0('0x36')][_0xf5e0('0x40')]){_0x4c443b['where']=_[_0xf5e0('0x41')](_0x4c443b['where'],{'$or':_[_0xf5e0('0x31')](_0x2d7b8d,function(_0x1d6116){if(_0x1d6116[_0xf5e0('0x34')]!==_0xf5e0('0x42')){var _0x21697b={};_0x21697b[_0x1d6116['name']]={'$like':'%'+_0x3faed1[_0xf5e0('0x36')][_0xf5e0('0x40')]+'%'};return _0x21697b;}})});}_0x4c443b=_[_0xf5e0('0x41')]({},_0x4c443b,_0x3faed1[_0xf5e0('0x43')]);var _0x5df3aa={'where':_0x4c443b[_0xf5e0('0x3e')]};return db[_0xf5e0('0x44')][_0xf5e0('0x23')](_0x5df3aa)[_0xf5e0('0x2a')](function(_0x2dbd6b){_0x110d4e[_0xf5e0('0x23')]=_0x2dbd6b;if(_0x3faed1['query'][_0xf5e0('0x45')]){_0x4c443b[_0xf5e0('0x46')]=[{'all':!![]}];}return db[_0xf5e0('0x44')][_0xf5e0('0x47')](_0x4c443b);})[_0xf5e0('0x2a')](function(_0xfc8977){_0x110d4e[_0xf5e0('0x48')]=_0xfc8977;return _0x110d4e;})[_0xf5e0('0x2a')](respondWithFilteredResult(_0x3e83cc,_0x4c443b))['catch'](handleError(_0x3e83cc,null));};exports[_0xf5e0('0x49')]=function(_0x461b15,_0x2c1af0){var _0x46fe04={'raw':!![],'where':{'id':_0x461b15[_0xf5e0('0x4a')]['id']}},_0x61d1e7={};_0x61d1e7[_0xf5e0('0x35')]=_['keys'](db[_0xf5e0('0x44')][_0xf5e0('0x32')]);_0x61d1e7[_0xf5e0('0x36')]=_[_0xf5e0('0x37')](_0x461b15['query']);_0x61d1e7[_0xf5e0('0x3f')]=_[_0xf5e0('0x4b')](_0x61d1e7[_0xf5e0('0x35')],_0x61d1e7['query']);_0x46fe04[_0xf5e0('0x38')]=_[_0xf5e0('0x4b')](_0x61d1e7[_0xf5e0('0x35')],qs['fields'](_0x461b15['query'][_0xf5e0('0x39')]));_0x46fe04[_0xf5e0('0x38')]=_0x46fe04['attributes']['length']?_0x46fe04[_0xf5e0('0x38')]:_0x61d1e7['model'];if(_0x461b15['query'][_0xf5e0('0x45')]){_0x46fe04[_0xf5e0('0x46')]=[{'all':!![]}];}_0x46fe04=_[_0xf5e0('0x41')]({},_0x46fe04,_0x461b15[_0xf5e0('0x43')]);return db[_0xf5e0('0x44')][_0xf5e0('0x4c')](_0x46fe04)['then'](handleEntityNotFound(_0x2c1af0,null))[_0xf5e0('0x2a')](respondWithResult(_0x2c1af0,null))['catch'](handleError(_0x2c1af0,null));};exports[_0xf5e0('0x4d')]=function(_0x3245c8,_0x2056c3){return db['ChatInternalMessage'][_0xf5e0('0x4d')](_0x3245c8[_0xf5e0('0x4e')],{})['then'](respondWithResult(_0x2056c3,0xc9))[_0xf5e0('0x4f')](handleError(_0x2056c3,null));};exports[_0xf5e0('0x29')]=function(_0x517229,_0x5bbdd1){if(_0x517229[_0xf5e0('0x4e')]['id']){delete _0x517229['body']['id'];}return db[_0xf5e0('0x44')][_0xf5e0('0x4c')]({'where':{'id':_0x517229[_0xf5e0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bbdd1,null))['then'](saveUpdates(_0x517229[_0xf5e0('0x4e')],null))['then'](respondWithResult(_0x5bbdd1,null))[_0xf5e0('0x4f')](handleError(_0x5bbdd1,null));};exports[_0xf5e0('0x2b')]=function(_0x45afde,_0x121fe6){return db[_0xf5e0('0x44')][_0xf5e0('0x4c')]({'where':{'id':_0x45afde['params']['id']}})[_0xf5e0('0x2a')](handleEntityNotFound(_0x121fe6,null))[_0xf5e0('0x2a')](removeEntity(_0x121fe6,null))['catch'](handleError(_0x121fe6,null));};exports[_0xf5e0('0x50')]=function(_0x589c80,_0xe875ac){return db['ChatInternalMessage'][_0xf5e0('0x50')]()[_0xf5e0('0x2a')](respondWithResult(_0xe875ac,null))[_0xf5e0('0x4f')](handleError(_0xe875ac,null));};function wrapUser(_0x4621bd){return function(_0x32d9ba){var _0x42b8e4=_0x4621bd[_0xf5e0('0x51')]({'plain':!![]});_0x42b8e4[_0xf5e0('0x52')]=[];if(_0x32d9ba){_0x42b8e4[_0xf5e0('0x53')]=_0x32d9ba['createdAt'];_0x42b8e4[_0xf5e0('0x54')]=_0x32d9ba;}else{_0x42b8e4[_0xf5e0('0x53')]=moment(0x0)[_0xf5e0('0x55')](_0xf5e0('0x56'));_0x42b8e4['lastMessage']={};}return _0x42b8e4;};}exports[_0xf5e0('0x57')]=function(_0x5cd3c6,_0x130cdd,_0x9fa3d1){var _0x7ca218=[];return db[_0xf5e0('0x58')]['findAll']({'where':{'role':['agent',_0xf5e0('0x59'),_0xf5e0('0x5a')]},'attributes':['id',_0xf5e0('0x5b'),'name',_0xf5e0('0x5c'),_0xf5e0('0x5d'),_0xf5e0('0x5e'),_0xf5e0('0x5f'),'lastLoginAt',_0xf5e0('0x60'),_0xf5e0('0x61')],'order':qs[_0xf5e0('0x3d')]('-online'),'include':[{'model':db[_0xf5e0('0x62')],'as':_0xf5e0('0x63'),'attributes':['id',_0xf5e0('0x2e'),_0xf5e0('0x34')],'through':{'attributes':[]}}]})[_0xf5e0('0x2a')](function(_0x5bb63f){if(_0x5bb63f){var _0x20df2a=_0x5cd3c6[_0xf5e0('0x5a')][_0xf5e0('0x51')]({'plain':!![]});if(!_0x20df2a)throw new Error(_0xf5e0('0x64'));if(_0x20df2a[_0xf5e0('0x5c')]==='user'){return db[_0xf5e0('0x65')][_0xf5e0('0x4c')]({'where':{'name':_0xf5e0('0x66'),'userProfileId':_0x20df2a[_0xf5e0('0x67')]},'raw':!![]})[_0xf5e0('0x2a')](function(_0x436537){if(_0x436537){if(_0x436537[_0xf5e0('0x68')]===0x0){return db[_0xf5e0('0x69')][_0xf5e0('0x47')]({'where':{'sectionId':_0x436537['id']},'raw':!![]})[_0xf5e0('0x2a')](function(_0xaa9cf9){var _0x23b10e=[];if(_['isEmpty'](_0xaa9cf9)){_0x23b10e=_['filter'](_0x5bb63f,function(_0x289a26){if(_0x289a26[_0xf5e0('0x5c')]!==_0xf5e0('0x6a')){return _0x289a26;}});return _0x23b10e;}else{for(var _0x101d60=0x0;_0x101d60<_0x5bb63f[_0xf5e0('0x3a')];_0x101d60++){var _0x7fe8c9=_0x5bb63f[_0x101d60];if(_0x7fe8c9['role']===_0xf5e0('0x6a')){var _0x394922=_[_0xf5e0('0x4c')](_0xaa9cf9,function(_0x3d67c6){return _0x3d67c6[_0xf5e0('0x6b')]===_0x7fe8c9['id'];});if(_0x394922)_0x23b10e['push'](_0x7fe8c9);}else{_0x23b10e[_0xf5e0('0x6c')](_0x7fe8c9);}}return _0x23b10e;}});}else{return _0x5bb63f;}}else{var _0x25341e=_[_0xf5e0('0x40')](_0x5bb63f,function(_0x3308ba){if(_0x3308ba[_0xf5e0('0x5c')]!==_0xf5e0('0x6a')){return _0x3308ba;}});return _0x25341e;}});}else{return _0x5bb63f;}}})[_0xf5e0('0x2a')](function(_0x1091fc){var _0x3f41bc=[];if(_0x1091fc){_0x7ca218=_0x1091fc;for(var _0x165ee6=0x0;_0x165ee6<_0x1091fc[_0xf5e0('0x3a')];_0x165ee6+=0x1){_0x7ca218[_0x165ee6][_0xf5e0('0x52')]=[];_0x3f41bc[_0xf5e0('0x6c')](db[_0xf5e0('0x44')][_0xf5e0('0x4c')]({'where':{'FromId':[_0x5cd3c6['user']['id'],_0x1091fc[_0x165ee6]['id']],'ToId':[_0x5cd3c6[_0xf5e0('0x5a')]['id'],_0x1091fc[_0x165ee6]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xf5e0('0x6d'),_0xf5e0('0x6e'),_0xf5e0('0x6f'),_0xf5e0('0x4e')],'order':qs[_0xf5e0('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf5e0('0x2a')](wrapUser(_0x1091fc[_0x165ee6])));}return BPromise['all'](_0x3f41bc);}return[];})['then'](function(_0x4e51ab){return{'rows':_0x4e51ab,'count':_0x4e51ab[_0xf5e0('0x3a')]};})[_0xf5e0('0x2a')](respondWithResult(_0x130cdd,null))[_0xf5e0('0x4f')](handleError(_0x130cdd,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 12ab840..5a57aca 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 _0x8079=['emit','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x8079,0x1e4));var _0x9807=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x8079[_0x19b84f];return _0x18067b;};'use strict';var EventEmitter=require(_0x9807('0x0'));var ChatInternalMessage=require(_0x9807('0x1'))['db'][_0x9807('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9807('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9807('0x4'),'afterDestroy':_0x9807('0x5')};function emitEvent(_0x44637a){return function(_0x388292,_0x3f405d,_0x1ddd20){ChatInternalMessageEvents[_0x9807('0x6')](_0x44637a+':'+_0x388292['id'],_0x388292);ChatInternalMessageEvents[_0x9807('0x6')](_0x44637a,_0x388292);_0x1ddd20(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5e36=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x55d040,_0xe989f4){var _0x442c89=function(_0x778f7){while(--_0x778f7){_0x55d040['push'](_0x55d040['shift']());}};_0x442c89(++_0xe989f4);}(_0x5e36,0xc8));var _0x65e3=function(_0x54e6e4,_0x537f82){_0x54e6e4=_0x54e6e4-0x0;var _0x1eaeef=_0x5e36[_0x54e6e4];return _0x1eaeef;};'use strict';var EventEmitter=require(_0x65e3('0x0'));var ChatInternalMessage=require(_0x65e3('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x65e3('0x2')](0x0);var events={'afterCreate':_0x65e3('0x3'),'afterUpdate':_0x65e3('0x4'),'afterDestroy':_0x65e3('0x5')};function emitEvent(_0x2e5411){return function(_0x12aad3,_0x795b2d,_0x431a4f){ChatInternalMessageEvents[_0x65e3('0x6')](_0x2e5411+':'+_0x12aad3['id'],_0x12aad3);ChatInternalMessageEvents['emit'](_0x2e5411,_0x12aad3);_0x431a4f(null);};}for(var e in events){if(events[_0x65e3('0x7')](e)){var event=events[e];ChatInternalMessage[_0x65e3('0x8')](e,emitEvent(event));}}module[_0x65e3('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 db30f77..98b3c60 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 _0x26ae=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','path','../../config/environment','exports'];(function(_0x102376,_0x16c6a2){var _0x29bc9c=function(_0x5fe5b1){while(--_0x5fe5b1){_0x102376['push'](_0x102376['shift']());}};_0x29bc9c(++_0x16c6a2);}(_0x26ae,0x16c));var _0xe26a=function(_0x574afd,_0x113fd0){_0x574afd=_0x574afd-0x0;var _0x50fdef=_0x26ae[_0x574afd];return _0x50fdef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe26a('0x0'))('api');var moment=require(_0xe26a('0x1'));var BPromise=require(_0xe26a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe26a('0x3'));var rimraf=require('rimraf');var config=require(_0xe26a('0x4'));var attributes=require('./chatInternalMessage.attributes');module[_0xe26a('0x5')]=function(_0xee6f66,_0x382efb){return _0xee6f66[_0xe26a('0x6')](_0xe26a('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe26a('0x8'),'collate':_0xe26a('0x9')});};
\ No newline at end of file
+var _0x6347=['moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x5b908d,_0x2a3602){var _0x369f1f=function(_0xc4273c){while(--_0xc4273c){_0x5b908d['push'](_0x5b908d['shift']());}};_0x369f1f(++_0x2a3602);}(_0x6347,0x1f4));var _0x7634=function(_0x7202ae,_0x24c776){_0x7202ae=_0x7202ae-0x0;var _0x2c4924=_0x6347[_0x7202ae];return _0x2c4924;};'use strict';var _=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var logger=require(_0x7634('0x2'))(_0x7634('0x3'));var moment=require(_0x7634('0x4'));var BPromise=require(_0x7634('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7634('0x6'));var rimraf=require(_0x7634('0x7'));var config=require(_0x7634('0x8'));var attributes=require(_0x7634('0x9'));module[_0x7634('0xa')]=function(_0x5b26bc,_0x25bc12){return _0x5b26bc[_0x7634('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x7634('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7634('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 927d63c..2b932f2 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 _0x5262=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x5262,0xc2));var _0x2526=function(_0x5e1d41,_0x40504e){_0x5e1d41=_0x5e1d41-0x0;var _0x199894=_0x5262[_0x5e1d41];return _0x199894;};'use strict';var _=require(_0x2526('0x0'));var util=require(_0x2526('0x1'));var moment=require(_0x2526('0x2'));var BPromise=require(_0x2526('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2526('0x4'));var db=require(_0x2526('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2526('0x6'));var config=require(_0x2526('0x7'));var jayson=require(_0x2526('0x8'));var client=jayson[_0x2526('0x9')]['http']({'port':0x232a});config[_0x2526('0xa')]=_[_0x2526('0xb')](config[_0x2526('0xa')],{'host':_0x2526('0xc'),'port':0x18eb});var socket=require(_0x2526('0xd'))(new Redis(config['redis']));require(_0x2526('0xe'))['register'](socket);function respondWithRpcPromise(_0x4508a4,_0x75b820,_0x38776d){return new BPromise(function(_0x236dff,_0x255c9d){return client[_0x2526('0xf')](_0x4508a4,_0x38776d)[_0x2526('0x10')](function(_0x4884f4){logger[_0x2526('0x11')](_0x2526('0x12'),_0x75b820,_0x2526('0x13'));logger[_0x2526('0x14')](_0x2526('0x15'),_0x75b820,_0x2526('0x13'),JSON['stringify'](_0x4884f4));if(_0x4884f4['error']){if(_0x4884f4['error']['code']===0x1f4){logger[_0x2526('0x16')](_0x2526('0x12'),_0x75b820,_0x4884f4[_0x2526('0x16')][_0x2526('0x17')]);return _0x255c9d(_0x4884f4[_0x2526('0x16')][_0x2526('0x17')]);}logger[_0x2526('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x75b820,_0x4884f4['error']['message']);return _0x236dff(_0x4884f4[_0x2526('0x16')][_0x2526('0x17')]);}else{logger[_0x2526('0x11')](_0x2526('0x12'),_0x75b820,_0x2526('0x13'));_0x236dff(_0x4884f4[_0x2526('0x18')][_0x2526('0x17')]);}})['catch'](function(_0x5c4bc3){logger['error'](_0x2526('0x12'),_0x75b820,_0x5c4bc3);_0x255c9d(_0x5c4bc3);});});}
\ No newline at end of file
+var _0xf3c2=['request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0xe7c0d9,_0x1fee6c){var _0x279170=function(_0x4e6a9e){while(--_0x4e6a9e){_0xe7c0d9['push'](_0xe7c0d9['shift']());}};_0x279170(++_0x1fee6c);}(_0xf3c2,0x14c));var _0x2f3c=function(_0x555878,_0x225ae8){_0x555878=_0x555878-0x0;var _0x20c8be=_0xf3c2[_0x555878];return _0x20c8be;};'use strict';var _=require(_0x2f3c('0x0'));var util=require('util');var moment=require(_0x2f3c('0x1'));var BPromise=require(_0x2f3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f3c('0x3'));var db=require(_0x2f3c('0x4'))['db'];var utils=require(_0x2f3c('0x5'));var logger=require(_0x2f3c('0x6'))(_0x2f3c('0x7'));var config=require(_0x2f3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2f3c('0x9')][_0x2f3c('0xa')]({'port':0x232a});config[_0x2f3c('0xb')]=_[_0x2f3c('0xc')](config['redis'],{'host':_0x2f3c('0xd'),'port':0x18eb});var socket=require(_0x2f3c('0xe'))(new Redis(config[_0x2f3c('0xb')]));require('./chatInternalMessage.socket')[_0x2f3c('0xf')](socket);function respondWithRpcPromise(_0x88af22,_0x140ee2,_0x1c6ded){return new BPromise(function(_0x182efe,_0x4e50da){return client[_0x2f3c('0x10')](_0x88af22,_0x1c6ded)[_0x2f3c('0x11')](function(_0x1e19ba){logger['info'](_0x2f3c('0x12'),_0x140ee2,_0x2f3c('0x13'));logger[_0x2f3c('0x14')](_0x2f3c('0x15'),_0x140ee2,_0x2f3c('0x13'),JSON[_0x2f3c('0x16')](_0x1e19ba));if(_0x1e19ba['error']){if(_0x1e19ba[_0x2f3c('0x17')][_0x2f3c('0x18')]===0x1f4){logger[_0x2f3c('0x17')](_0x2f3c('0x12'),_0x140ee2,_0x1e19ba[_0x2f3c('0x17')][_0x2f3c('0x19')]);return _0x4e50da(_0x1e19ba[_0x2f3c('0x17')][_0x2f3c('0x19')]);}logger[_0x2f3c('0x17')](_0x2f3c('0x12'),_0x140ee2,_0x1e19ba[_0x2f3c('0x17')]['message']);return _0x182efe(_0x1e19ba[_0x2f3c('0x17')][_0x2f3c('0x19')]);}else{logger[_0x2f3c('0x1a')](_0x2f3c('0x12'),_0x140ee2,'request\x20sent');_0x182efe(_0x1e19ba[_0x2f3c('0x1b')][_0x2f3c('0x19')]);}})[_0x2f3c('0x1c')](function(_0x2ab205){logger['error'](_0x2f3c('0x12'),_0x140ee2,_0x2ab205);_0x4e50da(_0x2ab205);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 2a4e5b7..30572d5 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 _0x59e7=['removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x59e7,0x83));var _0x759e=function(_0x568db3,_0x24395d){_0x568db3=_0x568db3-0x0;var _0x58c38b=_0x59e7[_0x568db3];return _0x58c38b;};'use strict';var ChatInternalMessageEvents=require(_0x759e('0x0'));var events=[_0x759e('0x1'),_0x759e('0x2'),_0x759e('0x3')];function createListener(_0x2c40a3,_0x493e43){return function(_0x1fa73e){_0x493e43[_0x759e('0x4')](_0x2c40a3,_0x1fa73e);};}function removeListener(_0x786f48,_0x1b0c1e){return function(){ChatInternalMessageEvents[_0x759e('0x5')](_0x786f48,_0x1b0c1e);};}exports[_0x759e('0x6')]=function(_0x3b64ff){for(var _0x56df42=0x0,_0x3a7aff=events['length'];_0x56df42<_0x3a7aff;_0x56df42++){var _0x15fcef=events[_0x56df42];var _0x1a303a=createListener(_0x759e('0x7')+_0x15fcef,_0x3b64ff);ChatInternalMessageEvents['on'](_0x15fcef,_0x1a303a);}};
\ No newline at end of file
+var _0x368e=['removeListener','register','length','./chatInternalMessage.events','save','remove','update'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x368e,0x192));var _0xe368=function(_0x5b2c50,_0x4db66b){_0x5b2c50=_0x5b2c50-0x0;var _0x47f2f9=_0x368e[_0x5b2c50];return _0x47f2f9;};'use strict';var ChatInternalMessageEvents=require(_0xe368('0x0'));var events=[_0xe368('0x1'),_0xe368('0x2'),_0xe368('0x3')];function createListener(_0x42c69f,_0x24c1d0){return function(_0x4c135e){_0x24c1d0['emit'](_0x42c69f,_0x4c135e);};}function removeListener(_0x1e1b1f,_0x310494){return function(){ChatInternalMessageEvents[_0xe368('0x4')](_0x1e1b1f,_0x310494);};}exports[_0xe368('0x5')]=function(_0x2e1eee){for(var _0x146250=0x0,_0x5ad4c7=events[_0xe368('0x6')];_0x146250<_0x5ad4c7;_0x146250++){var _0x1e8af7=events[_0x146250];var _0x4826a5=createListener('chatInternalMessage:'+_0x1e8af7,_0x2e1eee);ChatInternalMessageEvents['on'](_0x1e8af7,_0x4826a5);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7d3af9c..4359e0f 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 _0xe066=['describe','/users','getUsers','/:id','show','create','put','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x61a2a9,_0x3b02ae){var _0x43d36c=function(_0x299541){while(--_0x299541){_0x61a2a9['push'](_0x61a2a9['shift']());}};_0x43d36c(++_0x3b02ae);}(_0xe066,0x1c1));var _0x6e06=function(_0x3b7b42,_0x31badd){_0x3b7b42=_0x3b7b42-0x0;var _0x1ebaad=_0xe066[_0x3b7b42];return _0x1ebaad;};'use strict';var multer=require(_0x6e06('0x0'));var util=require('util');var path=require(_0x6e06('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e06('0x2'));var router=express[_0x6e06('0x3')]();var fs_extra=require(_0x6e06('0x4'));var auth=require(_0x6e06('0x5'));var interaction=require(_0x6e06('0x6'));var config=require(_0x6e06('0x7'));var controller=require(_0x6e06('0x8'));router[_0x6e06('0x9')]('/',auth[_0x6e06('0xa')](),controller[_0x6e06('0xb')]);router[_0x6e06('0x9')](_0x6e06('0xc'),auth[_0x6e06('0xa')](),controller[_0x6e06('0xd')]);router[_0x6e06('0x9')](_0x6e06('0xe'),auth[_0x6e06('0xa')](),controller[_0x6e06('0xf')]);router[_0x6e06('0x9')](_0x6e06('0x10'),auth[_0x6e06('0xa')](),controller[_0x6e06('0x11')]);router['post']('/',auth[_0x6e06('0xa')](),controller[_0x6e06('0x12')]);router[_0x6e06('0x13')](_0x6e06('0x10'),controller['update']);router[_0x6e06('0x14')](_0x6e06('0x10'),auth[_0x6e06('0xa')](),controller['destroy']);module[_0x6e06('0x15')]=router;
\ No newline at end of file
+var _0x11f3=['/users','show','post','/:id','update','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated'];(function(_0x3c933e,_0x26c429){var _0x3ad1eb=function(_0x2d9726){while(--_0x2d9726){_0x3c933e['push'](_0x3c933e['shift']());}};_0x3ad1eb(++_0x26c429);}(_0x11f3,0xe3));var _0x311f=function(_0x3c9c05,_0x31f740){_0x3c9c05=_0x3c9c05-0x0;var _0x2f1d51=_0x11f3[_0x3c9c05];return _0x2f1d51;};'use strict';var multer=require('multer');var util=require(_0x311f('0x0'));var path=require(_0x311f('0x1'));var timeout=require(_0x311f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x311f('0x3'));var auth=require(_0x311f('0x4'));var interaction=require(_0x311f('0x5'));var config=require(_0x311f('0x6'));var controller=require(_0x311f('0x7'));router[_0x311f('0x8')]('/',auth['isAuthenticated'](),controller[_0x311f('0x9')]);router[_0x311f('0x8')]('/describe',auth[_0x311f('0xa')](),controller['describe']);router[_0x311f('0x8')](_0x311f('0xb'),auth[_0x311f('0xa')](),controller['getUsers']);router[_0x311f('0x8')]('/:id',auth[_0x311f('0xa')](),controller[_0x311f('0xc')]);router[_0x311f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x311f('0xe'),controller[_0x311f('0xf')]);router['delete'](_0x311f('0xe'),auth[_0x311f('0xa')](),controller[_0x311f('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index af2ce6b..d15b919 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 _0xc692=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x40ca0f,_0x3ac979){var _0x25380b=function(_0x1483e9){while(--_0x1483e9){_0x40ca0f['push'](_0x40ca0f['shift']());}};_0x25380b(++_0x3ac979);}(_0xc692,0x15f));var _0x2c69=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xc692[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0x2c69('0x0'));module[_0x2c69('0x1')]={'body':{'type':Sequelize[_0x2c69('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2c69('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c69('0x4')]('in',_0x2c69('0x5')),'defaultValue':_0x2c69('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2c69('0x6')]},'providerName':{'type':Sequelize[_0x2c69('0x7')]},'providerResponse':{'type':Sequelize[_0x2c69('0x2')]}};
\ No newline at end of file
+var _0x6ae2=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x43a48f,_0x39a89a){_0x43a48f=_0x43a48f-0x0;var _0x19aeba=_0x6ae2[_0x43a48f];return _0x19aeba;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'body':{'type':Sequelize[_0x26ae('0x2')](_0x26ae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26ae('0x5')]('in',_0x26ae('0x6')),'defaultValue':_0x26ae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x26ae('0x7')]},'providerResponse':{'type':Sequelize[_0x26ae('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4c44d82..d4ad5fb 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 _0xf8c8=['internal','manual','interface','SIP/%s','channel','event','EventManager','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','fullname','email','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','json','offset','undefined','count','limit','Content-Range','reject','destroy','status','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','options','include','show','params','keys','includeAll','find','create','body','update','describe','../../config/logger','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User'];(function(_0x337e95,_0x4446a1){var _0x3ad74b=function(_0x2a73b1){while(--_0x2a73b1){_0x337e95['push'](_0x337e95['shift']());}};_0x3ad74b(++_0x4446a1);}(_0xf8c8,0x118));var _0x8f8c=function(_0x16dd60,_0x495245){_0x16dd60=_0x16dd60-0x0;var _0x167e1a=_0xf8c8[_0x16dd60];return _0x167e1a;};'use strict';var emlformat=require(_0x8f8c('0x0'));var rimraf=require(_0x8f8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f8c('0x2'));var rp=require(_0x8f8c('0x3'));var moment=require('moment');var BPromise=require(_0x8f8c('0x4'));var Mustache=require('mustache');var util=require(_0x8f8c('0x5'));var path=require(_0x8f8c('0x6'));var sox=require(_0x8f8c('0x7'));var csv=require(_0x8f8c('0x8'));var ejs=require(_0x8f8c('0x9'));var fs=require('fs');var fs_extra=require(_0x8f8c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8f8c('0xb'));var deskjs=require(_0x8f8c('0xc'));var toCsv=require(_0x8f8c('0x8'));var querystring=require(_0x8f8c('0xd'));var Papa=require(_0x8f8c('0xe'));var Redis=require(_0x8f8c('0xf'));var authService=require(_0x8f8c('0x10'));var qs=require(_0x8f8c('0x11'));var as=require(_0x8f8c('0x12'));var hardwareService=require(_0x8f8c('0x13'));var logger=require('../../config/logger')(_0x8f8c('0x14'));var utils=require(_0x8f8c('0x15'));var config=require(_0x8f8c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f8c('0x17'))['db'];config[_0x8f8c('0x18')]=_[_0x8f8c('0x19')](config[_0x8f8c('0x18')],{'host':_0x8f8c('0x1a'),'port':0x18eb});var socket=require(_0x8f8c('0x1b'))(new Redis(config['redis']));require(_0x8f8c('0x1c'))[_0x8f8c('0x1d')](socket);var jayson=require(_0x8f8c('0x1e'));var client=jayson[_0x8f8c('0x1f')][_0x8f8c('0x20')]({'port':0x232c});var client9002=jayson[_0x8f8c('0x1f')][_0x8f8c('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2a9d67,_0x5e1c12,_0x34464a,_0x37b405){return new BPromise(function(_0x4d6141,_0x306f43){var _0x2ccb7d=_0x37b405||client;return _0x2ccb7d['request'](_0x2a9d67,_0x34464a)[_0x8f8c('0x21')](function(_0xa11dac){logger['info'](_0x8f8c('0x22'),_0x5e1c12,'request\x20sent');logger[_0x8f8c('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5e1c12,_0x8f8c('0x24'),JSON[_0x8f8c('0x25')](_0xa11dac));if(_0xa11dac[_0x8f8c('0x26')]){if(_0xa11dac[_0x8f8c('0x26')][_0x8f8c('0x27')]===0x1f4){logger[_0x8f8c('0x26')](_0x8f8c('0x22'),_0x5e1c12,_0xa11dac[_0x8f8c('0x26')][_0x8f8c('0x28')]);return _0x306f43(_0xa11dac[_0x8f8c('0x26')]['message']);}logger[_0x8f8c('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5e1c12,_0xa11dac[_0x8f8c('0x26')][_0x8f8c('0x28')]);return _0x4d6141(_0xa11dac[_0x8f8c('0x26')][_0x8f8c('0x28')]);}else{logger[_0x8f8c('0x29')](_0x8f8c('0x22'),_0x5e1c12,_0x8f8c('0x24'));_0x4d6141(_0xa11dac[_0x8f8c('0x2a')][_0x8f8c('0x28')]);}})[_0x8f8c('0x2b')](function(_0x1e5684){logger[_0x8f8c('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5e1c12,_0x1e5684);_0x306f43(_0x1e5684);});});}function respondWithStatusCode(_0x380154,_0x557053){_0x557053=_0x557053||0xcc;return function(_0x20d8cc){if(_0x20d8cc){return _0x380154[_0x8f8c('0x2c')](_0x557053);}return _0x380154['status'](_0x557053)['end']();};}function respondWithResult(_0x418868,_0x5a9e8a){_0x5a9e8a=_0x5a9e8a||0xc8;return function(_0x49173d){if(_0x49173d){return _0x418868['status'](_0x5a9e8a)[_0x8f8c('0x2d')](_0x49173d);}};}function respondWithFilteredResult(_0x3542a7,_0x5e5a80){return function(_0x114196){if(_0x114196){var _0x21f96f=typeof _0x5e5a80[_0x8f8c('0x2e')]===_0x8f8c('0x2f')&&typeof _0x5e5a80['limit']==='undefined';var _0x77bee4=_0x114196[_0x8f8c('0x30')];var _0x127bbc=_0x21f96f?0x0:_0x5e5a80[_0x8f8c('0x2e')];var _0x58c24c=_0x21f96f?_0x114196[_0x8f8c('0x30')]:_0x5e5a80[_0x8f8c('0x2e')]+_0x5e5a80[_0x8f8c('0x31')];var _0x49e2aa;if(_0x58c24c>=_0x77bee4){_0x58c24c=_0x77bee4;_0x49e2aa=0xc8;}else{_0x49e2aa=0xce;}_0x3542a7['status'](_0x49e2aa);return _0x3542a7['set'](_0x8f8c('0x32'),_0x127bbc+'-'+_0x58c24c+'/'+_0x77bee4)[_0x8f8c('0x2d')](_0x114196);}return null;};}function patchUpdates(_0x2707b4){return function(_0x23d6c1){try{jsonpatch['apply'](_0x23d6c1,_0x2707b4,!![]);}catch(_0x301b45){return BPromise[_0x8f8c('0x33')](_0x301b45);}return _0x23d6c1['save']();};}function saveUpdates(_0x104d41,_0x590012){return function(_0x321ff6){if(_0x321ff6){return _0x321ff6['update'](_0x104d41)[_0x8f8c('0x21')](function(_0x283e36){return _0x283e36;});}return null;};}function removeEntity(_0x4a8543,_0x2dab9c){return function(_0x1f4fff){if(_0x1f4fff){return _0x1f4fff[_0x8f8c('0x34')]()[_0x8f8c('0x21')](function(){_0x4a8543[_0x8f8c('0x35')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ff82,_0x30f560){return function(_0x10e0a7){if(!_0x10e0a7){_0x15ff82['sendStatus'](0x194);}return _0x10e0a7;};}function handleError(_0xe88a41,_0x1ba517){_0x1ba517=_0x1ba517||0x1f4;return function(_0x477553){logger['error'](_0x477553[_0x8f8c('0x36')]);if(_0x477553[_0x8f8c('0x37')]){delete _0x477553[_0x8f8c('0x37')];}_0xe88a41['status'](_0x1ba517)[_0x8f8c('0x38')](_0x477553);};}exports[_0x8f8c('0x39')]=function(_0x1b20d2,_0x356f95){var _0x1d2829={},_0x2b05f8={},_0x29929e={'count':0x0,'rows':[]};var _0xdf976e=_[_0x8f8c('0x3a')](db[_0x8f8c('0x3b')][_0x8f8c('0x3c')],function(_0xd22039){return{'name':_0xd22039['fieldName'],'type':_0xd22039[_0x8f8c('0x3d')][_0x8f8c('0x3e')]};});_0x2b05f8[_0x8f8c('0x3f')]=_[_0x8f8c('0x3a')](_0xdf976e,_0x8f8c('0x37'));_0x2b05f8[_0x8f8c('0x40')]=_['keys'](_0x1b20d2[_0x8f8c('0x40')]);_0x2b05f8['filters']=_[_0x8f8c('0x41')](_0x2b05f8[_0x8f8c('0x3f')],_0x2b05f8[_0x8f8c('0x40')]);_0x1d2829[_0x8f8c('0x42')]=_[_0x8f8c('0x41')](_0x2b05f8['model'],qs[_0x8f8c('0x43')](_0x1b20d2[_0x8f8c('0x40')][_0x8f8c('0x43')]));_0x1d2829[_0x8f8c('0x42')]=_0x1d2829['attributes'][_0x8f8c('0x44')]?_0x1d2829['attributes']:_0x2b05f8[_0x8f8c('0x3f')];if(!_0x1b20d2[_0x8f8c('0x40')]['hasOwnProperty']('nolimit')){_0x1d2829[_0x8f8c('0x31')]=qs[_0x8f8c('0x31')](_0x1b20d2[_0x8f8c('0x40')]['limit']);_0x1d2829[_0x8f8c('0x2e')]=qs[_0x8f8c('0x2e')](_0x1b20d2['query'][_0x8f8c('0x2e')]);}_0x1d2829[_0x8f8c('0x45')]=qs[_0x8f8c('0x46')](_0x1b20d2[_0x8f8c('0x40')][_0x8f8c('0x46')]);_0x1d2829[_0x8f8c('0x47')]=qs['filters'](_[_0x8f8c('0x48')](_0x1b20d2[_0x8f8c('0x40')],_0x2b05f8[_0x8f8c('0x49')]),_0xdf976e);if(_0x1b20d2[_0x8f8c('0x40')][_0x8f8c('0x4a')]){_0x1d2829[_0x8f8c('0x47')]=_[_0x8f8c('0x4b')](_0x1d2829[_0x8f8c('0x47')],{'$or':_['map'](_0xdf976e,function(_0x5aff0c){if(_0x5aff0c[_0x8f8c('0x3d')]!=='VIRTUAL'){var _0x5aca4a={};_0x5aca4a[_0x5aff0c[_0x8f8c('0x37')]]={'$like':'%'+_0x1b20d2[_0x8f8c('0x40')][_0x8f8c('0x4a')]+'%'};return _0x5aca4a;}})});}_0x1d2829=_[_0x8f8c('0x4b')]({},_0x1d2829,_0x1b20d2[_0x8f8c('0x4c')]);var _0x52437b={'where':_0x1d2829[_0x8f8c('0x47')]};return db[_0x8f8c('0x3b')][_0x8f8c('0x30')](_0x52437b)[_0x8f8c('0x21')](function(_0x1116ce){_0x29929e[_0x8f8c('0x30')]=_0x1116ce;if(_0x1b20d2[_0x8f8c('0x40')]['includeAll']){_0x1d2829[_0x8f8c('0x4d')]=[{'all':!![]}];}return db[_0x8f8c('0x3b')]['findAll'](_0x1d2829);})[_0x8f8c('0x21')](function(_0x2d4fe0){_0x29929e['rows']=_0x2d4fe0;return _0x29929e;})[_0x8f8c('0x21')](respondWithFilteredResult(_0x356f95,_0x1d2829))['catch'](handleError(_0x356f95,null));};exports[_0x8f8c('0x4e')]=function(_0x276502,_0x2a0c9f){var _0x1193b0={'raw':!![],'where':{'id':_0x276502[_0x8f8c('0x4f')]['id']}},_0x37fc2b={};_0x37fc2b['model']=_[_0x8f8c('0x50')](db['ChatMessage'][_0x8f8c('0x3c')]);_0x37fc2b[_0x8f8c('0x40')]=_['keys'](_0x276502[_0x8f8c('0x40')]);_0x37fc2b['filters']=_[_0x8f8c('0x41')](_0x37fc2b['model'],_0x37fc2b[_0x8f8c('0x40')]);_0x1193b0['attributes']=_[_0x8f8c('0x41')](_0x37fc2b[_0x8f8c('0x3f')],qs[_0x8f8c('0x43')](_0x276502['query'][_0x8f8c('0x43')]));_0x1193b0[_0x8f8c('0x42')]=_0x1193b0['attributes'][_0x8f8c('0x44')]?_0x1193b0[_0x8f8c('0x42')]:_0x37fc2b[_0x8f8c('0x3f')];if(_0x276502[_0x8f8c('0x40')][_0x8f8c('0x51')]){_0x1193b0[_0x8f8c('0x4d')]=[{'all':!![]}];}_0x1193b0=_[_0x8f8c('0x4b')]({},_0x1193b0,_0x276502[_0x8f8c('0x4c')]);return db[_0x8f8c('0x3b')][_0x8f8c('0x52')](_0x1193b0)[_0x8f8c('0x21')](handleEntityNotFound(_0x2a0c9f,null))['then'](respondWithResult(_0x2a0c9f,null))[_0x8f8c('0x2b')](handleError(_0x2a0c9f,null));};exports[_0x8f8c('0x53')]=function(_0x123f08,_0x570284){return db[_0x8f8c('0x3b')][_0x8f8c('0x53')](_0x123f08[_0x8f8c('0x54')],{})[_0x8f8c('0x21')](respondWithResult(_0x570284,0xc9))['catch'](handleError(_0x570284,null));};exports[_0x8f8c('0x55')]=function(_0x20afc9,_0xd0c559){if(_0x20afc9[_0x8f8c('0x54')]['id']){delete _0x20afc9[_0x8f8c('0x54')]['id'];}return db[_0x8f8c('0x3b')][_0x8f8c('0x52')]({'where':{'id':_0x20afc9[_0x8f8c('0x4f')]['id']}})[_0x8f8c('0x21')](handleEntityNotFound(_0xd0c559,null))[_0x8f8c('0x21')](saveUpdates(_0x20afc9[_0x8f8c('0x54')],null))[_0x8f8c('0x21')](respondWithResult(_0xd0c559,null))[_0x8f8c('0x2b')](handleError(_0xd0c559,null));};exports[_0x8f8c('0x34')]=function(_0x344a79,_0x413801){return db[_0x8f8c('0x3b')]['find']({'where':{'id':_0x344a79[_0x8f8c('0x4f')]['id']}})[_0x8f8c('0x21')](handleEntityNotFound(_0x413801,null))[_0x8f8c('0x21')](removeEntity(_0x413801,null))[_0x8f8c('0x2b')](handleError(_0x413801,null));};exports[_0x8f8c('0x56')]=function(_0x13cbb1,_0x1fe372){return db[_0x8f8c('0x3b')]['describe']()['then'](respondWithResult(_0x1fe372,null))[_0x8f8c('0x2b')](handleError(_0x1fe372,null));};var interaction_log=require(_0x8f8c('0x57'))(_0x8f8c('0x58'));exports[_0x8f8c('0x59')]=function(_0x7cde34,_0x2aa3a5,_0x2a0a20){var _0x34eb4c={'agent':{},'channel':'chat'};if(_0x7cde34[_0x8f8c('0x54')]['id']){delete _0x7cde34[_0x8f8c('0x54')]['id'];}_0x7cde34['body'][_0x8f8c('0x5a')]=!![];_0x7cde34[_0x8f8c('0x54')][_0x8f8c('0x5b')]=moment()[_0x8f8c('0x5c')](_0x8f8c('0x5d'));_0x7cde34[_0x8f8c('0x54')][_0x8f8c('0x5e')]=_0x7cde34[_0x8f8c('0x54')]['UserId']||_0x7cde34[_0x8f8c('0x5f')]['id'];_0x34eb4c[_0x8f8c('0x60')]['id']=_0x7cde34['body'][_0x8f8c('0x5e')];return db['ChatMessage'][_0x8f8c('0x52')]({'where':{'id':_0x7cde34[_0x8f8c('0x4f')]['id'],'UserId':null}})[_0x8f8c('0x21')](handleEntityNotFound(_0x2aa3a5,null))[_0x8f8c('0x21')](saveUpdates(_0x7cde34[_0x8f8c('0x54')],null))[_0x8f8c('0x21')](function(_0x35c7e5){if(_0x35c7e5){_0x34eb4c[_0x8f8c('0x28')]=_0x35c7e5[_0x8f8c('0x61')]({'plain':!![]});return db[_0x8f8c('0x62')][_0x8f8c('0x52')]({'where':{'id':_0x35c7e5[_0x8f8c('0x63')]}});}return null;})[_0x8f8c('0x21')](handleEntityNotFound(_0x2aa3a5,null))[_0x8f8c('0x21')](function(_0x5db8c7){if(_0x5db8c7){return _0x5db8c7[_0x8f8c('0x55')]({'UserId':_0x7cde34['body'][_0x8f8c('0x5e')],'read1stAt':_['isNil'](_0x5db8c7[_0x8f8c('0x64')])?moment()[_0x8f8c('0x5c')](_0x8f8c('0x5d')):undefined});}return null;})[_0x8f8c('0x21')](function(_0x54fb4e){if(_0x54fb4e){_0x34eb4c['interaction']=_0x54fb4e[_0x8f8c('0x61')]({'plain':!![]});interaction_log[_0x8f8c('0x29')](_0x8f8c('0x65'),_0x7cde34['user']['id'],_0x7cde34[_0x8f8c('0x5f')][_0x8f8c('0x37')],_0x7cde34['user'][_0x8f8c('0x66')],_0x34eb4c[_0x8f8c('0x67')]['id'],_0x7cde34[_0x8f8c('0x54')]?JSON[_0x8f8c('0x25')](_0x7cde34[_0x8f8c('0x54')]):_0x8f8c('0x68'));return respondWithRpcPromise(_0x8f8c('0x69'),_0x8f8c('0x6a'),_0x34eb4c);}return null;})[_0x8f8c('0x21')](function(_0x164637){var _0x5e670c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x164637['message']['ContactId'];return db[_0x8f8c('0x6b')][_0x8f8c('0x40')](_0x5e670c,{'type':db[_0x8f8c('0x6c')][_0x8f8c('0x6d')][_0x8f8c('0x6e')],'raw':!![]})[_0x8f8c('0x21')](function(_0x2020e7){return _0x2020e7;});})['then'](function(_0x114989){if(_0x114989){_0x34eb4c[_0x8f8c('0x28')][_0x8f8c('0x6f')]=_0x114989[0x0];if(!_0x7cde34[_0x8f8c('0x54')][_0x8f8c('0x5e')])return;return db[_0x8f8c('0x70')][_0x8f8c('0x52')]({'where':{'id':_0x7cde34[_0x8f8c('0x54')][_0x8f8c('0x5e')],'role':_0x8f8c('0x60')},'attributes':['id',_0x8f8c('0x37'),'fullname','email',_0x8f8c('0x71')],'raw':!![]});}return null;})[_0x8f8c('0x21')](function(_0x2e93f9){if(!_0x2e93f9)return null;_0x34eb4c['message'][_0x8f8c('0x60')]=_0x2e93f9;return _0x34eb4c;})[_0x8f8c('0x21')](function(_0x5c6817){if(_0x5c6817){if(_0x7cde34['body'][_0x8f8c('0x72')]){_0x34eb4c[_0x8f8c('0x28')][_0x8f8c('0x73')]=util[_0x8f8c('0x5c')](_0x8f8c('0x74'),_0x7cde34[_0x8f8c('0x5f')][_0x8f8c('0x37')]);_0x34eb4c[_0x8f8c('0x28')][_0x8f8c('0x75')]=_0x34eb4c['channel'];_0x34eb4c[_0x8f8c('0x28')]['motionChannel']=_0x34eb4c[_0x8f8c('0x75')];_0x34eb4c[_0x8f8c('0x28')][_0x8f8c('0x76')]=_0x8f8c('0x59');return respondWithRpcPromise(_0x8f8c('0x77'),_0x8f8c('0x77'),{'event':'acceptmessage','message':_[_0x8f8c('0x4b')](_0x34eb4c['message'],JSON['parse'](_0x34eb4c[_0x8f8c('0x67')][_0x8f8c('0x78')]))},client9002)[_0x8f8c('0x21')](function(){return _0x34eb4c;});}return _0x34eb4c;}return null;})[_0x8f8c('0x21')](respondWithResult(_0x2aa3a5,null))[_0x8f8c('0x2b')](handleError(_0x2aa3a5,null));};var interaction_log=require(_0x8f8c('0x57'))(_0x8f8c('0x58'));exports[_0x8f8c('0x33')]=function(_0x4bad81,_0x65528f,_0x59bffb){var _0x4bec00={'agent':{},'channel':_0x8f8c('0x79')};if(_0x4bad81[_0x8f8c('0x54')]['id']){delete _0x4bad81[_0x8f8c('0x54')]['id'];}_0x4bad81[_0x8f8c('0x54')][_0x8f8c('0x5e')]=_0x4bad81[_0x8f8c('0x54')][_0x8f8c('0x5e')]||_0x4bad81[_0x8f8c('0x5f')]['id'];_0x4bec00[_0x8f8c('0x60')]['id']=_0x4bad81[_0x8f8c('0x54')][_0x8f8c('0x5e')];return db['ChatMessage'][_0x8f8c('0x52')]({'where':{'id':_0x4bad81[_0x8f8c('0x4f')]['id'],'UserId':null}})[_0x8f8c('0x21')](handleEntityNotFound(_0x65528f,null))[_0x8f8c('0x21')](function(_0x3582de){if(_0x3582de){_0x4bec00[_0x8f8c('0x28')]=_0x3582de['get']({'plain':!![]});return db['ChatInteraction'][_0x8f8c('0x52')]({'where':{'id':_0x3582de[_0x8f8c('0x63')]}});}return null;})[_0x8f8c('0x21')](handleEntityNotFound(_0x65528f,null))['then'](function(_0x3e5440){if(_0x3e5440){_0x4bec00[_0x8f8c('0x67')]=_0x3e5440['get']({'plain':!![]});interaction_log[_0x8f8c('0x29')](_0x8f8c('0x7a'),_0x4bad81['user']['id'],_0x4bad81[_0x8f8c('0x5f')][_0x8f8c('0x37')],_0x4bad81[_0x8f8c('0x5f')][_0x8f8c('0x66')],_0x4bec00[_0x8f8c('0x67')]['id'],_0x4bad81[_0x8f8c('0x54')]?JSON[_0x8f8c('0x25')](_0x4bad81[_0x8f8c('0x54')]):_0x8f8c('0x68'));return respondWithRpcPromise(_0x8f8c('0x7b'),_0x8f8c('0x7c'),_0x4bec00);}return null;})[_0x8f8c('0x21')](function(_0x409e12){var _0x59bdd4=_0x8f8c('0x7d')+_0x409e12[_0x8f8c('0x28')][_0x8f8c('0x7e')];return db[_0x8f8c('0x6b')][_0x8f8c('0x40')](_0x59bdd4,{'type':db[_0x8f8c('0x6c')][_0x8f8c('0x6d')]['SELECT'],'raw':!![]})[_0x8f8c('0x21')](function(_0x5c71eb){return _0x5c71eb;});})[_0x8f8c('0x21')](function(_0x1d199d){if(_0x1d199d){_0x4bec00['message'][_0x8f8c('0x6f')]=_0x1d199d[0x0];if(!_0x4bad81[_0x8f8c('0x54')][_0x8f8c('0x5e')])return;return db['User'][_0x8f8c('0x52')]({'where':{'id':_0x4bad81[_0x8f8c('0x54')][_0x8f8c('0x5e')],'role':_0x8f8c('0x60')},'attributes':['id',_0x8f8c('0x37'),_0x8f8c('0x7f'),_0x8f8c('0x80'),'internal'],'raw':!![]});}return null;})[_0x8f8c('0x21')](function(_0x5906ce){if(!_0x5906ce)return null;_0x4bec00[_0x8f8c('0x28')]['agent']=_0x5906ce;return _0x4bec00;})[_0x8f8c('0x21')](function(_0x5a5839){if(_0x5a5839){_0x5a5839[_0x8f8c('0x28')][_0x8f8c('0x73')]=util['format']('SIP/%s',_0x4bad81[_0x8f8c('0x5f')][_0x8f8c('0x37')]);_0x5a5839[_0x8f8c('0x28')][_0x8f8c('0x75')]=_0x4bec00['channel'];_0x5a5839[_0x8f8c('0x28')][_0x8f8c('0x81')]=_0x4bec00['channel'];_0x5a5839[_0x8f8c('0x28')][_0x8f8c('0x76')]='reject';respondWithRpcPromise(_0x8f8c('0x77'),_0x8f8c('0x77'),{'event':_0x8f8c('0x82'),'message':_['merge'](_0x4bec00[_0x8f8c('0x28')],JSON['parse'](_0x4bec00[_0x8f8c('0x67')]['formData']))},client9002);return _0x4bec00;}return null;})[_0x8f8c('0x21')](respondWithResult(_0x65528f,null))['catch'](handleError(_0x65528f,null));};
\ No newline at end of file
+var _0x12c4=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','offset','limit','undefined','count','set','json','apply','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','ChatMessage','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','agent','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','contact','fullname','internal','interface','motionChannel','parse','eml-format','rimraf','request-promise','moment','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c3798,_0x3c11e7){var _0x4d7e50=function(_0x5ca732){while(--_0x5ca732){_0x3c3798['push'](_0x3c3798['shift']());}};_0x4d7e50(++_0x3c11e7);}(_0x12c4,0x1e4));var _0x412c=function(_0x5be938,_0x2b9124){_0x5be938=_0x5be938-0x0;var _0x3de204=_0x12c4[_0x5be938];return _0x3de204;};'use strict';var emlformat=require(_0x412c('0x0'));var rimraf=require(_0x412c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x412c('0x2'));var moment=require(_0x412c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x412c('0x4'));var sox=require('sox');var csv=require(_0x412c('0x5'));var ejs=require(_0x412c('0x6'));var fs=require('fs');var fs_extra=require(_0x412c('0x7'));var _=require('lodash');var squel=require(_0x412c('0x8'));var crypto=require(_0x412c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x412c('0x5'));var querystring=require(_0x412c('0xa'));var Papa=require(_0x412c('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x412c('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x412c('0xd'));var logger=require('../../config/logger')(_0x412c('0xe'));var utils=require(_0x412c('0xf'));var config=require(_0x412c('0x10'));var licenseUtil=require(_0x412c('0x11'));var db=require(_0x412c('0x12'))['db'];config[_0x412c('0x13')]=_[_0x412c('0x14')](config[_0x412c('0x13')],{'host':_0x412c('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x412c('0x13')]));require(_0x412c('0x16'))['register'](socket);var jayson=require(_0x412c('0x17'));var client=jayson['client'][_0x412c('0x18')]({'port':0x232c});var client9002=jayson[_0x412c('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x111596,_0x3ed66b,_0x2aa6d8,_0x350eee){return new BPromise(function(_0x1ec1c0,_0x4fea71){var _0x51d72b=_0x350eee||client;return _0x51d72b[_0x412c('0x1a')](_0x111596,_0x2aa6d8)[_0x412c('0x1b')](function(_0x133cad){logger[_0x412c('0x1c')](_0x412c('0x1d'),_0x3ed66b,_0x412c('0x1e'));logger[_0x412c('0x1f')](_0x412c('0x20'),_0x3ed66b,_0x412c('0x1e'),JSON[_0x412c('0x21')](_0x133cad));if(_0x133cad[_0x412c('0x22')]){if(_0x133cad['error'][_0x412c('0x23')]===0x1f4){logger[_0x412c('0x22')]('ChatMessage,\x20%s,\x20%s',_0x3ed66b,_0x133cad['error'][_0x412c('0x24')]);return _0x4fea71(_0x133cad['error'][_0x412c('0x24')]);}logger[_0x412c('0x22')](_0x412c('0x1d'),_0x3ed66b,_0x133cad[_0x412c('0x22')][_0x412c('0x24')]);return _0x1ec1c0(_0x133cad[_0x412c('0x22')][_0x412c('0x24')]);}else{logger['info'](_0x412c('0x1d'),_0x3ed66b,_0x412c('0x1e'));_0x1ec1c0(_0x133cad['result'][_0x412c('0x24')]);}})['catch'](function(_0x3d6c77){logger['error'](_0x412c('0x1d'),_0x3ed66b,_0x3d6c77);_0x4fea71(_0x3d6c77);});});}function respondWithStatusCode(_0xa19c70,_0x230fcb){_0x230fcb=_0x230fcb||0xcc;return function(_0x1bd28f){if(_0x1bd28f){return _0xa19c70['sendStatus'](_0x230fcb);}return _0xa19c70[_0x412c('0x25')](_0x230fcb)['end']();};}function respondWithResult(_0x3c95b5,_0x7fefaf){_0x7fefaf=_0x7fefaf||0xc8;return function(_0x40f40b){if(_0x40f40b){return _0x3c95b5['status'](_0x7fefaf)['json'](_0x40f40b);}};}function respondWithFilteredResult(_0x585c1d,_0x8bd6cb){return function(_0x1625e4){if(_0x1625e4){var _0x5d8a1c=typeof _0x8bd6cb[_0x412c('0x26')]==='undefined'&&typeof _0x8bd6cb[_0x412c('0x27')]===_0x412c('0x28');var _0x1a166=_0x1625e4[_0x412c('0x29')];var _0x4a17fd=_0x5d8a1c?0x0:_0x8bd6cb[_0x412c('0x26')];var _0x3f0850=_0x5d8a1c?_0x1625e4['count']:_0x8bd6cb[_0x412c('0x26')]+_0x8bd6cb[_0x412c('0x27')];var _0x76f353;if(_0x3f0850>=_0x1a166){_0x3f0850=_0x1a166;_0x76f353=0xc8;}else{_0x76f353=0xce;}_0x585c1d[_0x412c('0x25')](_0x76f353);return _0x585c1d[_0x412c('0x2a')]('Content-Range',_0x4a17fd+'-'+_0x3f0850+'/'+_0x1a166)[_0x412c('0x2b')](_0x1625e4);}return null;};}function patchUpdates(_0xa86f67){return function(_0x414e67){try{jsonpatch[_0x412c('0x2c')](_0x414e67,_0xa86f67,!![]);}catch(_0x23be30){return BPromise['reject'](_0x23be30);}return _0x414e67['save']();};}function saveUpdates(_0x2f4c1a,_0x41bddc){return function(_0x4416cd){if(_0x4416cd){return _0x4416cd[_0x412c('0x2d')](_0x2f4c1a)[_0x412c('0x1b')](function(_0x5e0762){return _0x5e0762;});}return null;};}function removeEntity(_0x28c401,_0x4f2d71){return function(_0x4adeed){if(_0x4adeed){return _0x4adeed[_0x412c('0x2e')]()[_0x412c('0x1b')](function(){_0x28c401[_0x412c('0x25')](0xcc)[_0x412c('0x2f')]();});}};}function handleEntityNotFound(_0x7105c4,_0x5be686){return function(_0x3680b9){if(!_0x3680b9){_0x7105c4[_0x412c('0x30')](0x194);}return _0x3680b9;};}function handleError(_0x4c1093,_0x3658ac){_0x3658ac=_0x3658ac||0x1f4;return function(_0x5d23bb){logger[_0x412c('0x22')](_0x5d23bb[_0x412c('0x31')]);if(_0x5d23bb[_0x412c('0x32')]){delete _0x5d23bb[_0x412c('0x32')];}_0x4c1093[_0x412c('0x25')](_0x3658ac)[_0x412c('0x33')](_0x5d23bb);};}exports[_0x412c('0x34')]=function(_0x49bc0d,_0xe475de){var _0x36ffe1={},_0x79553={},_0x4abb1f={'count':0x0,'rows':[]};var _0x45dc06=_[_0x412c('0x35')](db['ChatMessage'][_0x412c('0x36')],function(_0x2fb0b6){return{'name':_0x2fb0b6[_0x412c('0x37')],'type':_0x2fb0b6[_0x412c('0x38')][_0x412c('0x39')]};});_0x79553[_0x412c('0x3a')]=_[_0x412c('0x35')](_0x45dc06,_0x412c('0x32'));_0x79553[_0x412c('0x3b')]=_[_0x412c('0x3c')](_0x49bc0d[_0x412c('0x3b')]);_0x79553['filters']=_['intersection'](_0x79553['model'],_0x79553[_0x412c('0x3b')]);_0x36ffe1[_0x412c('0x3d')]=_[_0x412c('0x3e')](_0x79553[_0x412c('0x3a')],qs[_0x412c('0x3f')](_0x49bc0d[_0x412c('0x3b')]['fields']));_0x36ffe1[_0x412c('0x3d')]=_0x36ffe1[_0x412c('0x3d')][_0x412c('0x40')]?_0x36ffe1[_0x412c('0x3d')]:_0x79553[_0x412c('0x3a')];if(!_0x49bc0d[_0x412c('0x3b')][_0x412c('0x41')](_0x412c('0x42'))){_0x36ffe1['limit']=qs[_0x412c('0x27')](_0x49bc0d['query']['limit']);_0x36ffe1[_0x412c('0x26')]=qs['offset'](_0x49bc0d[_0x412c('0x3b')][_0x412c('0x26')]);}_0x36ffe1['order']=qs['sort'](_0x49bc0d[_0x412c('0x3b')][_0x412c('0x43')]);_0x36ffe1[_0x412c('0x44')]=qs['filters'](_['pick'](_0x49bc0d[_0x412c('0x3b')],_0x79553[_0x412c('0x45')]),_0x45dc06);if(_0x49bc0d[_0x412c('0x3b')][_0x412c('0x46')]){_0x36ffe1[_0x412c('0x44')]=_['merge'](_0x36ffe1[_0x412c('0x44')],{'$or':_[_0x412c('0x35')](_0x45dc06,function(_0x50e220){if(_0x50e220['type']!==_0x412c('0x47')){var _0x2f786d={};_0x2f786d[_0x50e220[_0x412c('0x32')]]={'$like':'%'+_0x49bc0d['query']['filter']+'%'};return _0x2f786d;}})});}_0x36ffe1=_[_0x412c('0x48')]({},_0x36ffe1,_0x49bc0d['options']);var _0x2aed03={'where':_0x36ffe1[_0x412c('0x44')]};return db[_0x412c('0x49')][_0x412c('0x29')](_0x2aed03)[_0x412c('0x1b')](function(_0x3096e5){_0x4abb1f[_0x412c('0x29')]=_0x3096e5;if(_0x49bc0d[_0x412c('0x3b')][_0x412c('0x4a')]){_0x36ffe1[_0x412c('0x4b')]=[{'all':!![]}];}return db[_0x412c('0x49')][_0x412c('0x4c')](_0x36ffe1);})[_0x412c('0x1b')](function(_0x3514ca){_0x4abb1f['rows']=_0x3514ca;return _0x4abb1f;})['then'](respondWithFilteredResult(_0xe475de,_0x36ffe1))[_0x412c('0x4d')](handleError(_0xe475de,null));};exports[_0x412c('0x4e')]=function(_0x402e38,_0x27a107){var _0x4cde3d={'raw':!![],'where':{'id':_0x402e38[_0x412c('0x4f')]['id']}},_0x3b663d={};_0x3b663d[_0x412c('0x3a')]=_[_0x412c('0x3c')](db[_0x412c('0x49')][_0x412c('0x36')]);_0x3b663d[_0x412c('0x3b')]=_[_0x412c('0x3c')](_0x402e38[_0x412c('0x3b')]);_0x3b663d[_0x412c('0x45')]=_['intersection'](_0x3b663d[_0x412c('0x3a')],_0x3b663d[_0x412c('0x3b')]);_0x4cde3d[_0x412c('0x3d')]=_[_0x412c('0x3e')](_0x3b663d[_0x412c('0x3a')],qs[_0x412c('0x3f')](_0x402e38['query']['fields']));_0x4cde3d['attributes']=_0x4cde3d[_0x412c('0x3d')][_0x412c('0x40')]?_0x4cde3d[_0x412c('0x3d')]:_0x3b663d['model'];if(_0x402e38[_0x412c('0x3b')][_0x412c('0x4a')]){_0x4cde3d['include']=[{'all':!![]}];}_0x4cde3d=_[_0x412c('0x48')]({},_0x4cde3d,_0x402e38[_0x412c('0x50')]);return db[_0x412c('0x49')][_0x412c('0x51')](_0x4cde3d)[_0x412c('0x1b')](handleEntityNotFound(_0x27a107,null))[_0x412c('0x1b')](respondWithResult(_0x27a107,null))['catch'](handleError(_0x27a107,null));};exports[_0x412c('0x52')]=function(_0x2261be,_0x5f0d00){return db[_0x412c('0x49')]['create'](_0x2261be['body'],{})[_0x412c('0x1b')](respondWithResult(_0x5f0d00,0xc9))[_0x412c('0x4d')](handleError(_0x5f0d00,null));};exports[_0x412c('0x2d')]=function(_0x1f2e8b,_0x4711e4){if(_0x1f2e8b['body']['id']){delete _0x1f2e8b[_0x412c('0x53')]['id'];}return db[_0x412c('0x49')][_0x412c('0x51')]({'where':{'id':_0x1f2e8b[_0x412c('0x4f')]['id']}})[_0x412c('0x1b')](handleEntityNotFound(_0x4711e4,null))['then'](saveUpdates(_0x1f2e8b['body'],null))[_0x412c('0x1b')](respondWithResult(_0x4711e4,null))['catch'](handleError(_0x4711e4,null));};exports['destroy']=function(_0x4bdac2,_0x1e378a){return db[_0x412c('0x49')][_0x412c('0x51')]({'where':{'id':_0x4bdac2['params']['id']}})[_0x412c('0x1b')](handleEntityNotFound(_0x1e378a,null))['then'](removeEntity(_0x1e378a,null))[_0x412c('0x4d')](handleError(_0x1e378a,null));};exports[_0x412c('0x54')]=function(_0x4b05fd,_0x3bd0c3){return db[_0x412c('0x49')]['describe']()[_0x412c('0x1b')](respondWithResult(_0x3bd0c3,null))[_0x412c('0x4d')](handleError(_0x3bd0c3,null));};var interaction_log=require(_0x412c('0x55'))(_0x412c('0x56'));exports[_0x412c('0x57')]=function(_0x80aca9,_0x11bb1b,_0x450ccc){var _0x2ae459={'agent':{},'channel':_0x412c('0x58')};if(_0x80aca9['body']['id']){delete _0x80aca9[_0x412c('0x53')]['id'];}_0x80aca9[_0x412c('0x53')][_0x412c('0x59')]=!![];_0x80aca9[_0x412c('0x53')][_0x412c('0x5a')]=moment()[_0x412c('0x5b')](_0x412c('0x5c'));_0x80aca9['body'][_0x412c('0x5d')]=_0x80aca9['body'][_0x412c('0x5d')]||_0x80aca9[_0x412c('0x5e')]['id'];_0x2ae459['agent']['id']=_0x80aca9[_0x412c('0x53')][_0x412c('0x5d')];return db[_0x412c('0x49')]['find']({'where':{'id':_0x80aca9[_0x412c('0x4f')]['id'],'UserId':null}})[_0x412c('0x1b')](handleEntityNotFound(_0x11bb1b,null))['then'](saveUpdates(_0x80aca9['body'],null))['then'](function(_0x28bb45){if(_0x28bb45){_0x2ae459['message']=_0x28bb45['get']({'plain':!![]});return db[_0x412c('0x5f')][_0x412c('0x51')]({'where':{'id':_0x28bb45[_0x412c('0x60')]}});}return null;})[_0x412c('0x1b')](handleEntityNotFound(_0x11bb1b,null))[_0x412c('0x1b')](function(_0x461fbb){if(_0x461fbb){return _0x461fbb[_0x412c('0x2d')]({'UserId':_0x80aca9['body']['UserId'],'read1stAt':_['isNil'](_0x461fbb[_0x412c('0x61')])?moment()[_0x412c('0x5b')](_0x412c('0x5c')):undefined});}return null;})['then'](function(_0x23dd35){if(_0x23dd35){_0x2ae459[_0x412c('0x62')]=_0x23dd35[_0x412c('0x63')]({'plain':!![]});interaction_log[_0x412c('0x1c')](_0x412c('0x64'),_0x80aca9[_0x412c('0x5e')]['id'],_0x80aca9[_0x412c('0x5e')][_0x412c('0x32')],_0x80aca9[_0x412c('0x5e')]['role'],_0x2ae459[_0x412c('0x62')]['id'],_0x80aca9['body']?JSON['stringify'](_0x80aca9['body']):_0x412c('0x65'));return respondWithRpcPromise('AcceptMessage',_0x412c('0x66'),_0x2ae459);}return null;})[_0x412c('0x1b')](function(_0x29113e){var _0x21ccb3=_0x412c('0x67')+_0x29113e['message']['ContactId'];return db[_0x412c('0x68')]['query'](_0x21ccb3,{'type':db[_0x412c('0x69')][_0x412c('0x6a')][_0x412c('0x6b')],'raw':!![]})[_0x412c('0x1b')](function(_0x3f4d29){return _0x3f4d29;});})['then'](function(_0x52addc){if(_0x52addc){_0x2ae459['message']['contact']=_0x52addc[0x0];if(!_0x80aca9[_0x412c('0x53')]['UserId'])return;return db['User'][_0x412c('0x51')]({'where':{'id':_0x80aca9['body']['UserId'],'role':_0x412c('0x6c')},'attributes':['id',_0x412c('0x32'),'fullname',_0x412c('0x6d'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2d76ff){if(!_0x2d76ff)return null;_0x2ae459[_0x412c('0x24')][_0x412c('0x6c')]=_0x2d76ff;return _0x2ae459;})[_0x412c('0x1b')](function(_0x3895e9){if(_0x3895e9){if(_0x80aca9[_0x412c('0x53')][_0x412c('0x6e')]){_0x2ae459['message']['interface']=util[_0x412c('0x5b')](_0x412c('0x6f'),_0x80aca9['user'][_0x412c('0x32')]);_0x2ae459['message'][_0x412c('0x70')]=_0x2ae459[_0x412c('0x70')];_0x2ae459['message']['motionChannel']=_0x2ae459[_0x412c('0x70')];_0x2ae459[_0x412c('0x24')][_0x412c('0x71')]='accept';return respondWithRpcPromise(_0x412c('0x72'),_0x412c('0x72'),{'event':_0x412c('0x73'),'message':_['merge'](_0x2ae459[_0x412c('0x24')],JSON['parse'](_0x2ae459[_0x412c('0x62')][_0x412c('0x74')]))},client9002)['then'](function(){return _0x2ae459;});}return _0x2ae459;}return null;})[_0x412c('0x1b')](respondWithResult(_0x11bb1b,null))['catch'](handleError(_0x11bb1b,null));};var interaction_log=require('../../config/logger')(_0x412c('0x56'));exports[_0x412c('0x75')]=function(_0x4e9426,_0x554582,_0x2866a4){var _0x29f0d1={'agent':{},'channel':_0x412c('0x58')};if(_0x4e9426[_0x412c('0x53')]['id']){delete _0x4e9426[_0x412c('0x53')]['id'];}_0x4e9426['body'][_0x412c('0x5d')]=_0x4e9426[_0x412c('0x53')]['UserId']||_0x4e9426['user']['id'];_0x29f0d1[_0x412c('0x6c')]['id']=_0x4e9426[_0x412c('0x53')][_0x412c('0x5d')];return db[_0x412c('0x49')][_0x412c('0x51')]({'where':{'id':_0x4e9426[_0x412c('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x554582,null))['then'](function(_0x985895){if(_0x985895){_0x29f0d1[_0x412c('0x24')]=_0x985895['get']({'plain':!![]});return db[_0x412c('0x5f')][_0x412c('0x51')]({'where':{'id':_0x985895['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x554582,null))['then'](function(_0x482c91){if(_0x482c91){_0x29f0d1[_0x412c('0x62')]=_0x482c91[_0x412c('0x63')]({'plain':!![]});interaction_log[_0x412c('0x1c')](_0x412c('0x76'),_0x4e9426[_0x412c('0x5e')]['id'],_0x4e9426[_0x412c('0x5e')][_0x412c('0x32')],_0x4e9426['user'][_0x412c('0x77')],_0x29f0d1['interaction']['id'],_0x4e9426['body']?JSON[_0x412c('0x21')](_0x4e9426[_0x412c('0x53')]):_0x412c('0x65'));return respondWithRpcPromise(_0x412c('0x78'),_0x412c('0x79'),_0x29f0d1);}return null;})[_0x412c('0x1b')](function(_0x5204af){var _0x47c503=_0x412c('0x67')+_0x5204af[_0x412c('0x24')][_0x412c('0x7a')];return db[_0x412c('0x68')][_0x412c('0x3b')](_0x47c503,{'type':db[_0x412c('0x69')][_0x412c('0x6a')][_0x412c('0x6b')],'raw':!![]})['then'](function(_0x16df71){return _0x16df71;});})[_0x412c('0x1b')](function(_0x3f119c){if(_0x3f119c){_0x29f0d1[_0x412c('0x24')][_0x412c('0x7b')]=_0x3f119c[0x0];if(!_0x4e9426['body'][_0x412c('0x5d')])return;return db['User'][_0x412c('0x51')]({'where':{'id':_0x4e9426['body'][_0x412c('0x5d')],'role':'agent'},'attributes':['id',_0x412c('0x32'),_0x412c('0x7c'),_0x412c('0x6d'),_0x412c('0x7d')],'raw':!![]});}return null;})[_0x412c('0x1b')](function(_0x5d8410){if(!_0x5d8410)return null;_0x29f0d1[_0x412c('0x24')]['agent']=_0x5d8410;return _0x29f0d1;})[_0x412c('0x1b')](function(_0x3f0b20){if(_0x3f0b20){_0x3f0b20[_0x412c('0x24')][_0x412c('0x7e')]=util[_0x412c('0x5b')]('SIP/%s',_0x4e9426[_0x412c('0x5e')][_0x412c('0x32')]);_0x3f0b20[_0x412c('0x24')][_0x412c('0x70')]=_0x29f0d1[_0x412c('0x70')];_0x3f0b20[_0x412c('0x24')][_0x412c('0x7f')]=_0x29f0d1[_0x412c('0x70')];_0x3f0b20[_0x412c('0x24')][_0x412c('0x71')]=_0x412c('0x75');respondWithRpcPromise('EventManager',_0x412c('0x72'),{'event':'rejectmessage','message':_[_0x412c('0x48')](_0x29f0d1[_0x412c('0x24')],JSON[_0x412c('0x80')](_0x29f0d1[_0x412c('0x62')][_0x412c('0x74')]))},client9002);return _0x29f0d1;}return null;})['then'](respondWithResult(_0x554582,null))[_0x412c('0x4d')](handleError(_0x554582,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 02a0926..f3f5063 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 _0xd5d1=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x527099,_0xda2c2a){var _0x2ea130=function(_0x3b1f66){while(--_0x3b1f66){_0x527099['push'](_0x527099['shift']());}};_0x2ea130(++_0xda2c2a);}(_0xd5d1,0x14e));var _0x1d5d=function(_0x38d3c9,_0x86f436){_0x38d3c9=_0x38d3c9-0x0;var _0xb7bb23=_0xd5d1[_0x38d3c9];return _0xb7bb23;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x1d5d('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1d5d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d5d('0x2'),'afterDestroy':_0x1d5d('0x3')};function emitEvent(_0x3b8992){return function(_0x1bf717,_0x848497,_0x13cad0){ChatMessageEvents[_0x1d5d('0x4')](_0x3b8992+':'+_0x1bf717['id'],_0x1bf717);ChatMessageEvents['emit'](_0x3b8992,_0x1bf717);_0x13cad0(null);};}for(var e in events){if(events[_0x1d5d('0x5')](e)){var event=events[e];ChatMessage[_0x1d5d('0x6')](e,emitEvent(event));}}module[_0x1d5d('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x63d7=['emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x2aa5c1,_0x4292b4){var _0x3d7758=function(_0x20e29e){while(--_0x20e29e){_0x2aa5c1['push'](_0x2aa5c1['shift']());}};_0x3d7758(++_0x4292b4);}(_0x63d7,0x67));var _0x763d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x63d7[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x763d('0x0'));var ChatMessage=require(_0x763d('0x1'))['db'][_0x763d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x763d('0x3')](0x0);var events={'afterCreate':_0x763d('0x4'),'afterUpdate':_0x763d('0x5'),'afterDestroy':_0x763d('0x6')};function emitEvent(_0x43a2b7){return function(_0x13f16d,_0x145a35,_0xc97676){ChatMessageEvents[_0x763d('0x7')](_0x43a2b7+':'+_0x13f16d['id'],_0x13f16d);ChatMessageEvents[_0x763d('0x7')](_0x43a2b7,_0x13f16d);_0xc97676(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x763d('0x8')](e,emitEvent(event));}}module[_0x763d('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index c4048c2..76af9e1 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 _0x8066=['models','get','toLowerCase','direction','out','secret','isNil','UserId','update','catch','error','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT'];(function(_0x4f80b,_0x4f8552){var _0x26459c=function(_0x2d8fcb){while(--_0x2d8fcb){_0x4f80b['push'](_0x4f80b['shift']());}};_0x26459c(++_0x4f8552);}(_0x8066,0x83));var _0x6806=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x8066[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x6806('0x0'));var util=require(_0x6806('0x1'));var logger=require('../../config/logger')(_0x6806('0x2'));var moment=require(_0x6806('0x3'));var BPromise=require(_0x6806('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6806('0x5'));var config=require(_0x6806('0x6'));var attributes=require(_0x6806('0x7'));module['exports']=function(_0x1ec999,_0x38eac6){return _0x1ec999[_0x6806('0x8')]('ChatMessage',attributes,{'tableName':_0x6806('0x9'),'paranoid':![],'indexes':[{'name':_0x6806('0xa'),'fields':[_0x6806('0xb')],'type':_0x6806('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45836c,_0x3a3129,_0x2d9fc2){var _0x4313ae=_0x1ec999[_0x6806('0xd')];var _0x2a46a5=_0x45836c[_0x6806('0xe')]({'plain':!![]});if(_0x2a46a5['direction'][_0x6806('0xf')]()==='in'||_0x2a46a5[_0x6806('0x10')][_0x6806('0xf')]()===_0x6806('0x11')&&!_0x2a46a5[_0x6806('0x12')]&&!_[_0x6806('0x13')](_0x2a46a5[_0x6806('0x14')])){_0x4313ae['ChatInteraction']['findOne']({'where':{'id':_0x2a46a5['ChatInteractionId']}})['then'](function(_0x275c40){if(_0x275c40){_0x275c40[_0x6806('0x15')]({'lastMsgAt':_0x2a46a5['createdAt'],'lastMsgDirection':_0x2a46a5[_0x6806('0x10')]['toLowerCase']()});}})[_0x6806('0x16')](function(_0x4c5a11){console[_0x6806('0x17')](_0x4c5a11);});}_0x2d9fc2();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7b97=['direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','models','get'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x7b97,0x1c1));var _0x77b9=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x7b97[_0x162780];return _0x1ea2dc;};'use strict';var _=require('lodash');var util=require(_0x77b9('0x0'));var logger=require(_0x77b9('0x1'))(_0x77b9('0x2'));var moment=require(_0x77b9('0x3'));var BPromise=require('bluebird');var rp=require(_0x77b9('0x4'));var fs=require('fs');var path=require(_0x77b9('0x5'));var rimraf=require('rimraf');var config=require(_0x77b9('0x6'));var attributes=require(_0x77b9('0x7'));module[_0x77b9('0x8')]=function(_0x55fad1,_0x3bba19){return _0x55fad1['define'](_0x77b9('0x9'),attributes,{'tableName':_0x77b9('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x77b9('0xb')],'type':_0x77b9('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x112316,_0x1ea4be,_0x28574e){var _0x3f37b8=_0x55fad1[_0x77b9('0xd')];var _0x117e98=_0x112316[_0x77b9('0xe')]({'plain':!![]});if(_0x117e98[_0x77b9('0xf')][_0x77b9('0x10')]()==='in'||_0x117e98['direction'][_0x77b9('0x10')]()===_0x77b9('0x11')&&!_0x117e98[_0x77b9('0x12')]&&!_[_0x77b9('0x13')](_0x117e98[_0x77b9('0x14')])){_0x3f37b8['ChatInteraction'][_0x77b9('0x15')]({'where':{'id':_0x117e98[_0x77b9('0x16')]}})[_0x77b9('0x17')](function(_0x3c16a9){if(_0x3c16a9){_0x3c16a9[_0x77b9('0x18')]({'lastMsgAt':_0x117e98[_0x77b9('0x19')],'lastMsgDirection':_0x117e98[_0x77b9('0xf')][_0x77b9('0x10')]()});}})[_0x77b9('0x1a')](function(_0x2f662b){console[_0x77b9('0x1b')](_0x2f662b);});}_0x28574e();}},'charset':'utf8mb4','collate':_0x77b9('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 5614944..d79c975 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 _0x0835=['defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http'];(function(_0x24da21,_0x47a53d){var _0x33014f=function(_0x35ed22){while(--_0x35ed22){_0x24da21['push'](_0x24da21['shift']());}};_0x33014f(++_0x47a53d);}(_0x0835,0x77));var _0x5083=function(_0x2ba984,_0xd1af26){_0x2ba984=_0x2ba984-0x0;var _0x16d186=_0x0835[_0x2ba984];return _0x16d186;};'use strict';var _=require(_0x5083('0x0'));var util=require(_0x5083('0x1'));var moment=require(_0x5083('0x2'));var BPromise=require('bluebird');var rs=require(_0x5083('0x3'));var fs=require('fs');var Redis=require(_0x5083('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5083('0x5'));var logger=require(_0x5083('0x6'))(_0x5083('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5083('0x8')]({'port':0x232a});config['redis']=_[_0x5083('0x9')](config[_0x5083('0xa')],{'host':_0x5083('0xb'),'port':0x18eb});var socket=require(_0x5083('0xc'))(new Redis(config[_0x5083('0xa')]));require(_0x5083('0xd'))[_0x5083('0xe')](socket);function respondWithRpcPromise(_0x5f30b3,_0x2c01a1,_0x2059e6){return new BPromise(function(_0x344b07,_0x583b4d){return client[_0x5083('0xf')](_0x5f30b3,_0x2059e6)[_0x5083('0x10')](function(_0x488f26){logger['info'](_0x5083('0x11'),_0x2c01a1,_0x5083('0x12'));logger['debug'](_0x5083('0x13'),_0x2c01a1,_0x5083('0x12'),JSON[_0x5083('0x14')](_0x488f26));if(_0x488f26[_0x5083('0x15')]){if(_0x488f26['error']['code']===0x1f4){logger[_0x5083('0x15')](_0x5083('0x11'),_0x2c01a1,_0x488f26[_0x5083('0x15')]['message']);return _0x583b4d(_0x488f26['error'][_0x5083('0x16')]);}logger[_0x5083('0x15')](_0x5083('0x11'),_0x2c01a1,_0x488f26[_0x5083('0x15')][_0x5083('0x16')]);return _0x344b07(_0x488f26[_0x5083('0x15')][_0x5083('0x16')]);}else{logger[_0x5083('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2c01a1,_0x5083('0x12'));_0x344b07(_0x488f26[_0x5083('0x18')][_0x5083('0x16')]);}})['catch'](function(_0x4c762d){logger['error']('ChatMessage,\x20%s,\x20%s',_0x2c01a1,_0x4c762d);_0x583b4d(_0x4c762d);});});}exports[_0x5083('0x19')]=function(_0x494783){var _0x5d5ca4=this;return new Promise(function(_0x53251b,_0x19cf2c){return db[_0x5083('0x1a')][_0x5083('0x1b')](_0x494783[_0x5083('0x1c')],{'raw':_0x494783[_0x5083('0x1d')]?_0x494783[_0x5083('0x1d')][_0x5083('0x1e')]===undefined?!![]:![]:!![]})[_0x5083('0x10')](function(_0x2c282d){logger[_0x5083('0x17')](_0x5083('0x19'),_0x494783);logger[_0x5083('0x1f')](_0x5083('0x19'),_0x494783,JSON['stringify'](_0x2c282d));_0x53251b(_0x2c282d);})['catch'](function(_0x1e1fd9){logger['error'](_0x5083('0x19'),_0x1e1fd9['message'],_0x494783);_0x19cf2c(_0x5d5ca4[_0x5083('0x15')](0x1f4,_0x1e1fd9[_0x5083('0x16')]));});});};
\ No newline at end of file
+var _0x53fa=['redis','localhost','socket.io-emitter','./chatMessage.socket','request','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','then','lodash','util','bluebird','randomstring','rpc','../../config/environment','http'];(function(_0x242de6,_0x22ecad){var _0x7cb5a6=function(_0x466591){while(--_0x466591){_0x242de6['push'](_0x242de6['shift']());}};_0x7cb5a6(++_0x22ecad);}(_0x53fa,0x1ac));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa53f('0x0'));var util=require(_0xa53f('0x1'));var moment=require('moment');var BPromise=require(_0xa53f('0x2'));var rs=require(_0xa53f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa53f('0x4'));var config=require(_0xa53f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa53f('0x6')]({'port':0x232a});config[_0xa53f('0x7')]=_['defaults'](config[_0xa53f('0x7')],{'host':_0xa53f('0x8'),'port':0x18eb});var socket=require(_0xa53f('0x9'))(new Redis(config[_0xa53f('0x7')]));require(_0xa53f('0xa'))['register'](socket);function respondWithRpcPromise(_0x2cbdcf,_0x325f0c,_0x56d54e){return new BPromise(function(_0x83d645,_0x57fbe2){return client[_0xa53f('0xb')](_0x2cbdcf,_0x56d54e)['then'](function(_0x55e2ef){logger['info']('ChatMessage,\x20%s,\x20%s',_0x325f0c,_0xa53f('0xc'));logger[_0xa53f('0xd')](_0xa53f('0xe'),_0x325f0c,'request\x20sent',JSON[_0xa53f('0xf')](_0x55e2ef));if(_0x55e2ef[_0xa53f('0x10')]){if(_0x55e2ef[_0xa53f('0x10')][_0xa53f('0x11')]===0x1f4){logger['error'](_0xa53f('0x12'),_0x325f0c,_0x55e2ef['error']['message']);return _0x57fbe2(_0x55e2ef[_0xa53f('0x10')]['message']);}logger[_0xa53f('0x10')](_0xa53f('0x12'),_0x325f0c,_0x55e2ef[_0xa53f('0x10')][_0xa53f('0x13')]);return _0x83d645(_0x55e2ef[_0xa53f('0x10')][_0xa53f('0x13')]);}else{logger[_0xa53f('0x14')](_0xa53f('0x12'),_0x325f0c,_0xa53f('0xc'));_0x83d645(_0x55e2ef[_0xa53f('0x15')][_0xa53f('0x13')]);}})[_0xa53f('0x16')](function(_0x4d1a92){logger[_0xa53f('0x10')](_0xa53f('0x12'),_0x325f0c,_0x4d1a92);_0x57fbe2(_0x4d1a92);});});}exports[_0xa53f('0x17')]=function(_0x33c57e){var _0x5d0215=this;return new Promise(function(_0x2274ba,_0x1d6aa7){return db[_0xa53f('0x18')]['create'](_0x33c57e[_0xa53f('0x19')],{'raw':_0x33c57e[_0xa53f('0x1a')]?_0x33c57e[_0xa53f('0x1a')][_0xa53f('0x1b')]===undefined?!![]:![]:!![]})[_0xa53f('0x1c')](function(_0x138c69){logger[_0xa53f('0x14')]('CreateChatMessage',_0x33c57e);logger[_0xa53f('0xd')](_0xa53f('0x17'),_0x33c57e,JSON[_0xa53f('0xf')](_0x138c69));_0x2274ba(_0x138c69);})['catch'](function(_0x3c1546){logger[_0xa53f('0x10')](_0xa53f('0x17'),_0x3c1546[_0xa53f('0x13')],_0x33c57e);_0x1d6aa7(_0x5d0215['error'](0x1f4,_0x3c1546[_0xa53f('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2a6c520..7199f08 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 _0x2caf=['removeListener','register','length','chatMessage:','update','emit'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x2caf,0x6a));var _0xf2ca=function(_0x26dee2,_0x574477){_0x26dee2=_0x26dee2-0x0;var _0x3eaeaa=_0x2caf[_0x26dee2];return _0x3eaeaa;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove',_0xf2ca('0x0')];function createListener(_0x53a64f,_0x3b2612){return function(_0x36e439){_0x3b2612[_0xf2ca('0x1')](_0x53a64f,_0x36e439);};}function removeListener(_0x375e8b,_0x137501){return function(){ChatMessageEvents[_0xf2ca('0x2')](_0x375e8b,_0x137501);};}exports[_0xf2ca('0x3')]=function(_0x51372a){for(var _0x8ce770=0x0,_0x4292b4=events[_0xf2ca('0x4')];_0x8ce770<_0x4292b4;_0x8ce770++){var _0x57e3e8=events[_0x8ce770];var _0x4ea38c=createListener(_0xf2ca('0x5')+_0x57e3e8,_0x51372a);ChatMessageEvents['on'](_0x57e3e8,_0x4ea38c);}};
\ No newline at end of file
+var _0x24ca=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x24ca,0x1bc));var _0xa24c=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x24ca[_0xc8db6b];return _0x12cb81;};'use strict';var ChatMessageEvents=require(_0xa24c('0x0'));var events=['save',_0xa24c('0x1'),_0xa24c('0x2')];function createListener(_0x4defb1,_0x5876d6){return function(_0x18497e){_0x5876d6[_0xa24c('0x3')](_0x4defb1,_0x18497e);};}function removeListener(_0x195e60,_0x28aa2f){return function(){ChatMessageEvents[_0xa24c('0x4')](_0x195e60,_0x28aa2f);};}exports[_0xa24c('0x5')]=function(_0xf0511){for(var _0x3c0aaa=0x0,_0x2dd348=events[_0xa24c('0x6')];_0x3c0aaa<_0x2dd348;_0x3c0aaa++){var _0x9a5013=events[_0x3c0aaa];var _0x481196=createListener(_0xa24c('0x7')+_0x9a5013,_0xf0511);ChatMessageEvents['on'](_0x9a5013,_0x481196);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index c132393..567cec5 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 _0xea18=['tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x55e5b9,_0x1be20e){var _0x58d1e7=function(_0x3cba6d){while(--_0x3cba6d){_0x55e5b9['push'](_0x55e5b9['shift']());}};_0x58d1e7(++_0x1be20e);}(_0xea18,0x150));var _0x8ea1=function(_0x1275c8,_0x1d4a25){_0x1275c8=_0x1275c8-0x0;var _0x44637a=_0xea18[_0x1275c8];return _0x44637a;};'use strict';var multer=require(_0x8ea1('0x0'));var util=require(_0x8ea1('0x1'));var path=require(_0x8ea1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8ea1('0x3')]();var fs_extra=require(_0x8ea1('0x4'));var auth=require(_0x8ea1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea1('0x6'));var controller=require('./chatMessage.controller');router[_0x8ea1('0x7')]('/',auth[_0x8ea1('0x8')](),controller[_0x8ea1('0x9')]);router[_0x8ea1('0x7')](_0x8ea1('0xa'),auth[_0x8ea1('0x8')](),controller[_0x8ea1('0xb')]);router[_0x8ea1('0x7')](_0x8ea1('0xc'),auth['isAuthenticated'](),controller[_0x8ea1('0xd')]);router[_0x8ea1('0xe')]('/',auth[_0x8ea1('0x8')](),interaction[_0x8ea1('0xf')](_0x8ea1('0x10'),_0x8ea1('0x11')),controller[_0x8ea1('0x12')]);router[_0x8ea1('0x13')]('/:id',controller[_0x8ea1('0x14')]);router[_0x8ea1('0x13')](_0x8ea1('0x15'),auth[_0x8ea1('0x8')](),controller[_0x8ea1('0x16')]);router[_0x8ea1('0x13')](_0x8ea1('0x17'),auth[_0x8ea1('0x8')](),controller[_0x8ea1('0x18')]);router[_0x8ea1('0x19')](_0x8ea1('0xc'),auth['isAuthenticated'](),controller[_0x8ea1('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x058a=['../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','create','put','/:id','update','/:id/accept','accept','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x058a,0x180));var _0xa058=function(_0x2a0007,_0x15c8f3){_0x2a0007=_0x2a0007-0x0;var _0x2b4244=_0x058a[_0x2a0007];return _0x2b4244;};'use strict';var multer=require('multer');var util=require(_0xa058('0x0'));var path=require(_0xa058('0x1'));var timeout=require(_0xa058('0x2'));var express=require(_0xa058('0x3'));var router=express[_0xa058('0x4')]();var fs_extra=require(_0xa058('0x5'));var auth=require(_0xa058('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa058('0x7'));router[_0xa058('0x8')]('/',auth[_0xa058('0x9')](),controller[_0xa058('0xa')]);router[_0xa058('0x8')](_0xa058('0xb'),auth[_0xa058('0x9')](),controller[_0xa058('0xc')]);router[_0xa058('0x8')]('/:id',auth[_0xa058('0x9')](),controller[_0xa058('0xd')]);router[_0xa058('0xe')]('/',auth['isAuthenticated'](),interaction[_0xa058('0xf')]('chat','chatmessage:create'),controller[_0xa058('0x10')]);router[_0xa058('0x11')](_0xa058('0x12'),controller[_0xa058('0x13')]);router[_0xa058('0x11')](_0xa058('0x14'),auth['isAuthenticated'](),controller[_0xa058('0x15')]);router[_0xa058('0x11')]('/:id/reject',auth['isAuthenticated'](),controller[_0xa058('0x16')]);router[_0xa058('0x17')](_0xa058('0x12'),auth['isAuthenticated'](),controller[_0xa058('0x18')]);module[_0xa058('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 1a0ff38..0bf977f 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 _0x5f66=['medium','TEXT','exports'];(function(_0x4a07df,_0x35c682){var _0x104c21=function(_0x5c606c){while(--_0x5c606c){_0x4a07df['push'](_0x4a07df['shift']());}};_0x104c21(++_0x35c682);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x467e39,_0x54a12e){var _0x3d4c8e=function(_0x517c1f){while(--_0x517c1f){_0x467e39['push'](_0x467e39['shift']());}};_0x3d4c8e(++_0x54a12e);}(_0x2032,0xd9));var _0x2203=function(_0x4bc004,_0x15ce2d){_0x4bc004=_0x4bc004-0x0;var _0x115da2=_0x2032[_0x4bc004];return _0x115da2;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 3844e42..5b0b010 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(_0x1a68ba,_0x5edb89){var _0x227053=function(_0x17c9ee){while(--_0x17c9ee){_0x1a68ba['push'](_0x1a68ba['shift']());}};_0x227053(++_0x5edb89);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x4b2a2,_0x558e1a){_0x4b2a2=_0x4b2a2-0x0;var _0x4b66ad=_0x7a54[_0x4b2a2];return _0x4b66ad;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 79548d3..2ea12f1 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c55=['emit','../../mysqldb','ChatOfflineMessage','save','update'];(function(_0xd7fc59,_0x476659){var _0x43daa0=function(_0x357fd3){while(--_0x357fd3){_0xd7fc59['push'](_0xd7fc59['shift']());}};_0x43daa0(++_0x476659);}(_0x1c55,0x11e));var _0x51c5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c55[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x51c5('0x0'))['db'][_0x51c5('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x51c5('0x2'),'afterUpdate':_0x51c5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ae55a){return function(_0x11053b,_0x18aa0c,_0x161d84){ChatOfflineMessageEvents['emit'](_0x3ae55a+':'+_0x11053b['id'],_0x11053b);ChatOfflineMessageEvents[_0x51c5('0x4')](_0x3ae55a,_0x11053b);_0x161d84(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4969=['setMaxListeners','save','hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage'];(function(_0x5b5c45,_0x199467){var _0x2cd0dd=function(_0x3f3266){while(--_0x3f3266){_0x5b5c45['push'](_0x5b5c45['shift']());}};_0x2cd0dd(++_0x199467);}(_0x4969,0x1da));var _0x9496=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0x4969[_0x221ba2];return _0x47d08e;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9496('0x0'))['db'][_0x9496('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9496('0x2')](0x0);var events={'afterCreate':_0x9496('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x57c8a2){return function(_0x4cb924,_0x46385d,_0x26ac20){ChatOfflineMessageEvents['emit'](_0x57c8a2+':'+_0x4cb924['id'],_0x4cb924);ChatOfflineMessageEvents['emit'](_0x57c8a2,_0x4cb924);_0x26ac20(null);};}for(var e in events){if(events[_0x9496('0x4')](e)){var event=events[e];ChatOfflineMessage[_0x9496('0x5')](e,emitEvent(event));}}module[_0x9496('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 6a5920f..2dfaef1 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 _0x6e39=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6e39,0xd7));var _0x96e3=function(_0x19a107,_0x3d70ab){_0x19a107=_0x19a107-0x0;var _0x3a3332=_0x6e39[_0x19a107];return _0x3a3332;};'use strict';var attributes=require(_0x96e3('0x0'));module[_0x96e3('0x1')]=function(_0xe20aa2){return _0xe20aa2[_0x96e3('0x2')](_0x96e3('0x3'),attributes,{'tableName':_0x96e3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x96e3('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7072=['exports','define','ChatOfflineMessage','utf8mb4_unicode_ci'];(function(_0x6469e9,_0x42a60b){var _0x3cc75e=function(_0x227665){while(--_0x227665){_0x6469e9['push'](_0x6469e9['shift']());}};_0x3cc75e(++_0x42a60b);}(_0x7072,0xc4));var _0x2707=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x7072[_0x2283dc];return _0x16db90;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x2707('0x0')]=function(_0x2eded2){return _0x2eded2[_0x2707('0x1')](_0x2707('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2707('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index eae4009..da0b6a8 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 _0x28e8=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x41b6ba,_0x20e996){var _0x451a0a=function(_0x15866f){while(--_0x15866f){_0x41b6ba['push'](_0x41b6ba['shift']());}};_0x451a0a(++_0x20e996);}(_0x28e8,0x1e0));var _0x828e=function(_0x5911cb,_0x5202cf){_0x5911cb=_0x5911cb-0x0;var _0x49506f=_0x28e8[_0x5911cb];return _0x49506f;};'use strict';var _=require(_0x828e('0x0'));var util=require('util');var moment=require(_0x828e('0x1'));var BPromise=require(_0x828e('0x2'));var rs=require(_0x828e('0x3'));var fs=require('fs');var Redis=require(_0x828e('0x4'));var db=require(_0x828e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x828e('0x6'))('rpc');var config=require(_0x828e('0x7'));var jayson=require(_0x828e('0x8'));var client=jayson[_0x828e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3db8f7,_0x3008e9,_0x36d496){return new BPromise(function(_0x24afbc,_0x21a8f0){return client[_0x828e('0xa')](_0x3db8f7,_0x36d496)[_0x828e('0xb')](function(_0x16f441){logger[_0x828e('0xc')](_0x828e('0xd'),_0x3008e9,_0x828e('0xe'));logger[_0x828e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3008e9,_0x828e('0xe'),JSON[_0x828e('0x10')](_0x16f441));if(_0x16f441[_0x828e('0x11')]){if(_0x16f441[_0x828e('0x11')][_0x828e('0x12')]===0x1f4){logger[_0x828e('0x11')](_0x828e('0xd'),_0x3008e9,_0x16f441[_0x828e('0x11')][_0x828e('0x13')]);return _0x21a8f0(_0x16f441['error'][_0x828e('0x13')]);}logger[_0x828e('0x11')](_0x828e('0xd'),_0x3008e9,_0x16f441['error']['message']);return _0x24afbc(_0x16f441['error']['message']);}else{logger[_0x828e('0xc')](_0x828e('0xd'),_0x3008e9,'request\x20sent');_0x24afbc(_0x16f441[_0x828e('0x14')]['message']);}})[_0x828e('0x15')](function(_0x3e6b8c){logger['error'](_0x828e('0xd'),_0x3008e9,_0x3e6b8c);_0x21a8f0(_0x3e6b8c);});});}
\ No newline at end of file
+var _0xdb1e=['../../config/environment','client','request','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x532875,_0x1ca8c3){var _0x5a47f7=function(_0x208d84){while(--_0x208d84){_0x532875['push'](_0x532875['shift']());}};_0x5a47f7(++_0x1ca8c3);}(_0xdb1e,0xc6));var _0xedb1=function(_0x1680cf,_0x2af10a){_0x1680cf=_0x1680cf-0x0;var _0x34d4e8=_0xdb1e[_0x1680cf];return _0x34d4e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xedb1('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedb1('0x1'));var db=require(_0xedb1('0x2'))['db'];var utils=require(_0xedb1('0x3'));var logger=require(_0xedb1('0x4'))(_0xedb1('0x5'));var config=require(_0xedb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xedb1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x223e8,_0x38d840,_0x5e3a02){return new BPromise(function(_0x2bddcd,_0x17516b){return client[_0xedb1('0x8')](_0x223e8,_0x5e3a02)['then'](function(_0x1584a1){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x38d840,'request\x20sent');logger[_0xedb1('0x9')](_0xedb1('0xa'),_0x38d840,'request\x20sent',JSON[_0xedb1('0xb')](_0x1584a1));if(_0x1584a1[_0xedb1('0xc')]){if(_0x1584a1['error']['code']===0x1f4){logger[_0xedb1('0xc')](_0xedb1('0xd'),_0x38d840,_0x1584a1[_0xedb1('0xc')][_0xedb1('0xe')]);return _0x17516b(_0x1584a1[_0xedb1('0xc')][_0xedb1('0xe')]);}logger[_0xedb1('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x38d840,_0x1584a1[_0xedb1('0xc')][_0xedb1('0xe')]);return _0x2bddcd(_0x1584a1[_0xedb1('0xc')][_0xedb1('0xe')]);}else{logger['info'](_0xedb1('0xd'),_0x38d840,'request\x20sent');_0x2bddcd(_0x1584a1[_0xedb1('0xf')]['message']);}})[_0xedb1('0x10')](function(_0x3ad23c){logger[_0xedb1('0xc')](_0xedb1('0xd'),_0x38d840,_0x3ad23c);_0x17516b(_0x3ad23c);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 8da6093..e13bd13 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 _0x818d=['/describe','/:id','isAuthenticated','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get'];(function(_0x29c7d9,_0x4379b6){var _0x4b3432=function(_0x493139){while(--_0x493139){_0x29c7d9['push'](_0x29c7d9['shift']());}};_0x4b3432(++_0x4379b6);}(_0x818d,0x1e4));var _0xd818=function(_0x4776cc,_0x3a715e){_0x4776cc=_0x4776cc-0x0;var _0x427bda=_0x818d[_0x4776cc];return _0x427bda;};'use strict';var multer=require('multer');var util=require(_0xd818('0x0'));var path=require(_0xd818('0x1'));var timeout=require(_0xd818('0x2'));var express=require(_0xd818('0x3'));var router=express[_0xd818('0x4')]();var fs_extra=require(_0xd818('0x5'));var auth=require(_0xd818('0x6'));var interaction=require(_0xd818('0x7'));var config=require('../../config/environment');var controller=require(_0xd818('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd818('0x9')](_0xd818('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xd818('0xb'),auth[_0xd818('0xc')](),controller[_0xd818('0xd')]);router[_0xd818('0xe')]('/',auth[_0xd818('0xc')](),controller[_0xd818('0xf')]);router[_0xd818('0x10')](_0xd818('0xb'),auth[_0xd818('0xc')](),controller['update']);router[_0xd818('0x11')](_0xd818('0xb'),auth[_0xd818('0xc')](),controller[_0xd818('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4588=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','connect-timeout','express','fs-extra'];(function(_0x4a393d,_0x3447ea){var _0x1d57f5=function(_0x331e43){while(--_0x331e43){_0x4a393d['push'](_0x4a393d['shift']());}};_0x1d57f5(++_0x3447ea);}(_0x4588,0x1d7));var _0x8458=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x4588[_0x3792e6];return _0x441e44;};'use strict';var multer=require(_0x8458('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8458('0x1'));var express=require(_0x8458('0x2'));var router=express['Router']();var fs_extra=require(_0x8458('0x3'));var auth=require(_0x8458('0x4'));var interaction=require(_0x8458('0x5'));var config=require(_0x8458('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x8458('0x7')]('/',auth[_0x8458('0x8')](),controller[_0x8458('0x9')]);router[_0x8458('0x7')](_0x8458('0xa'),auth[_0x8458('0x8')](),controller[_0x8458('0xb')]);router['get'](_0x8458('0xc'),auth['isAuthenticated'](),controller[_0x8458('0xd')]);router[_0x8458('0xe')]('/',auth[_0x8458('0x8')](),controller[_0x8458('0xf')]);router['put'](_0x8458('0xc'),auth['isAuthenticated'](),controller[_0x8458('0x10')]);router['delete'](_0x8458('0xc'),auth['isAuthenticated'](),controller[_0x8458('0x11')]);module[_0x8458('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a301c41..1025bc0 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 _0x8073=['sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x34e311,_0x5ba39a){var _0x23abf8=function(_0x44c385){while(--_0x44c385){_0x34e311['push'](_0x34e311['shift']());}};_0x23abf8(++_0x5ba39a);}(_0x8073,0xcc));var _0x3807=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8073[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x3807('0x0'));module[_0x3807('0x1')]={'name':{'type':Sequelize[_0x3807('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3807('0x3')](_0x3807('0x4'),_0x3807('0x5')),'defaultValue':_0x3807('0x4')},'selector':{'type':Sequelize[_0x3807('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x462c=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x462c,0x169));var _0xc462=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x462c[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0xc462('0x0'));module[_0xc462('0x1')]={'name':{'type':Sequelize[_0xc462('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc462('0x3'),_0xc462('0x4')),'defaultValue':_0xc462('0x3')},'selector':{'type':Sequelize[_0xc462('0x2')]},'timeout':{'type':Sequelize[_0xc462('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index b59037e..39c2d9d 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 _0x14f5=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','update','destroy','then','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','length','includeAll','include','merge','options','create','body','catch','find','params','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0x14f5,0xae));var _0x514f=function(_0x5ea79f,_0x46484e){_0x5ea79f=_0x5ea79f-0x0;var _0xed70c8=_0x14f5[_0x5ea79f];return _0xed70c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x514f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x514f('0x1'));var rp=require(_0x514f('0x2'));var moment=require(_0x514f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x514f('0x4'));var util=require(_0x514f('0x5'));var path=require('path');var sox=require(_0x514f('0x6'));var csv=require(_0x514f('0x7'));var ejs=require(_0x514f('0x8'));var fs=require('fs');var fs_extra=require(_0x514f('0x9'));var _=require(_0x514f('0xa'));var squel=require(_0x514f('0xb'));var crypto=require(_0x514f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x514f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x514f('0xe'));var Papa=require(_0x514f('0xf'));var Redis=require(_0x514f('0x10'));var authService=require(_0x514f('0x11'));var qs=require(_0x514f('0x12'));var as=require(_0x514f('0x13'));var hardwareService=require(_0x514f('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x514f('0x15'));var licenseUtil=require(_0x514f('0x16'));var db=require(_0x514f('0x17'))['db'];function respondWithStatusCode(_0x321914,_0x3eed49){_0x3eed49=_0x3eed49||0xcc;return function(_0x2ed1b7){if(_0x2ed1b7){return _0x321914[_0x514f('0x18')](_0x3eed49);}return _0x321914[_0x514f('0x19')](_0x3eed49)[_0x514f('0x1a')]();};}function respondWithResult(_0x4124bf,_0x46e552){_0x46e552=_0x46e552||0xc8;return function(_0x3fc905){if(_0x3fc905){return _0x4124bf[_0x514f('0x19')](_0x46e552)[_0x514f('0x1b')](_0x3fc905);}};}function respondWithFilteredResult(_0x1694b3,_0x5865d1){return function(_0x70d2b4){if(_0x70d2b4){var _0x1f0cbe=typeof _0x5865d1['offset']===_0x514f('0x1c')&&typeof _0x5865d1['limit']===_0x514f('0x1c');var _0x309ce0=_0x70d2b4[_0x514f('0x1d')];var _0x5a5641=_0x1f0cbe?0x0:_0x5865d1[_0x514f('0x1e')];var _0x3673a4=_0x1f0cbe?_0x70d2b4[_0x514f('0x1d')]:_0x5865d1[_0x514f('0x1e')]+_0x5865d1['limit'];var _0x4f9193;if(_0x3673a4>=_0x309ce0){_0x3673a4=_0x309ce0;_0x4f9193=0xc8;}else{_0x4f9193=0xce;}_0x1694b3[_0x514f('0x19')](_0x4f9193);return _0x1694b3[_0x514f('0x1f')](_0x514f('0x20'),_0x5a5641+'-'+_0x3673a4+'/'+_0x309ce0)['json'](_0x70d2b4);}return null;};}function patchUpdates(_0x43fcf9){return function(_0x7248e8){try{jsonpatch['apply'](_0x7248e8,_0x43fcf9,!![]);}catch(_0x186417){return BPromise[_0x514f('0x21')](_0x186417);}return _0x7248e8['save']();};}function saveUpdates(_0xd093a1,_0x18a430){return function(_0xd89aa2){if(_0xd89aa2){return _0xd89aa2[_0x514f('0x22')](_0xd093a1)['then'](function(_0x58861e){return _0x58861e;});}return null;};}function removeEntity(_0x4b0245,_0x5d80cb){return function(_0x1c16f9){if(_0x1c16f9){return _0x1c16f9[_0x514f('0x23')]()[_0x514f('0x24')](function(){_0x4b0245[_0x514f('0x19')](0xcc)[_0x514f('0x1a')]();});}};}function handleEntityNotFound(_0x26df04,_0x2c6bb1){return function(_0x101742){if(!_0x101742){_0x26df04[_0x514f('0x18')](0x194);}return _0x101742;};}function handleError(_0x5f2da2,_0x8c8bdf){_0x8c8bdf=_0x8c8bdf||0x1f4;return function(_0x37b3db){logger[_0x514f('0x25')](_0x37b3db[_0x514f('0x26')]);if(_0x37b3db[_0x514f('0x27')]){delete _0x37b3db[_0x514f('0x27')];}_0x5f2da2[_0x514f('0x19')](_0x8c8bdf)[_0x514f('0x28')](_0x37b3db);};}exports[_0x514f('0x29')]=function(_0x594a50,_0x2c4c4b){var _0x488c17={'raw':!![],'where':{'id':_0x594a50['params']['id']}},_0x2b43e0={};_0x2b43e0[_0x514f('0x2a')]=_[_0x514f('0x2b')](db[_0x514f('0x2c')][_0x514f('0x2d')]);_0x2b43e0[_0x514f('0x2e')]=_['keys'](_0x594a50['query']);_0x2b43e0[_0x514f('0x2f')]=_['intersection'](_0x2b43e0[_0x514f('0x2a')],_0x2b43e0[_0x514f('0x2e')]);_0x488c17[_0x514f('0x30')]=_[_0x514f('0x31')](_0x2b43e0[_0x514f('0x2a')],qs['fields'](_0x594a50['query']['fields']));_0x488c17[_0x514f('0x30')]=_0x488c17[_0x514f('0x30')][_0x514f('0x32')]?_0x488c17[_0x514f('0x30')]:_0x2b43e0[_0x514f('0x2a')];if(_0x594a50[_0x514f('0x2e')][_0x514f('0x33')]){_0x488c17[_0x514f('0x34')]=[{'all':!![]}];}_0x488c17=_[_0x514f('0x35')]({},_0x488c17,_0x594a50[_0x514f('0x36')]);return db['ChatProactiveAction']['find'](_0x488c17)['then'](handleEntityNotFound(_0x2c4c4b,null))[_0x514f('0x24')](respondWithResult(_0x2c4c4b,null))['catch'](handleError(_0x2c4c4b,null));};exports[_0x514f('0x37')]=function(_0x50c120,_0x3aefc5){return db['ChatProactiveAction']['create'](_0x50c120[_0x514f('0x38')],{})['then'](respondWithResult(_0x3aefc5,0xc9))[_0x514f('0x39')](handleError(_0x3aefc5,null));};exports[_0x514f('0x22')]=function(_0x2cea89,_0x1696a2){if(_0x2cea89[_0x514f('0x38')]['id']){delete _0x2cea89['body']['id'];}return db[_0x514f('0x2c')][_0x514f('0x3a')]({'where':{'id':_0x2cea89[_0x514f('0x3b')]['id']}})[_0x514f('0x24')](handleEntityNotFound(_0x1696a2,null))['then'](saveUpdates(_0x2cea89[_0x514f('0x38')],null))[_0x514f('0x24')](respondWithResult(_0x1696a2,null))[_0x514f('0x39')](handleError(_0x1696a2,null));};exports[_0x514f('0x23')]=function(_0x51b24a,_0x1c1a24){return db[_0x514f('0x2c')][_0x514f('0x3a')]({'where':{'id':_0x51b24a[_0x514f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1c1a24,null))[_0x514f('0x24')](removeEntity(_0x1c1a24,null))['catch'](handleError(_0x1c1a24,null));};
\ No newline at end of file
+var _0x8ece=['apply','save','update','destroy','then','error','stack','name','send','show','params','keys','rawAttributes','query','filters','model','attributes','fields','length','includeAll','merge','options','ChatProactiveAction','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8ece,0x195));var _0xe8ec=function(_0x4f2530,_0x5c0bb5){_0x4f2530=_0x4f2530-0x0;var _0x4a9e71=_0x8ece[_0x4f2530];return _0x4a9e71;};'use strict';var emlformat=require(_0xe8ec('0x0'));var rimraf=require(_0xe8ec('0x1'));var zipdir=require(_0xe8ec('0x2'));var jsonpatch=require(_0xe8ec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe8ec('0x4'));var Mustache=require(_0xe8ec('0x5'));var util=require(_0xe8ec('0x6'));var path=require(_0xe8ec('0x7'));var sox=require(_0xe8ec('0x8'));var csv=require('to-csv');var ejs=require(_0xe8ec('0x9'));var fs=require('fs');var fs_extra=require(_0xe8ec('0xa'));var _=require(_0xe8ec('0xb'));var squel=require(_0xe8ec('0xc'));var crypto=require(_0xe8ec('0xd'));var jsforce=require(_0xe8ec('0xe'));var deskjs=require(_0xe8ec('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe8ec('0x10'));var Papa=require('papaparse');var Redis=require(_0xe8ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe8ec('0x12'));var as=require(_0xe8ec('0x13'));var hardwareService=require(_0xe8ec('0x14'));var logger=require(_0xe8ec('0x15'))(_0xe8ec('0x16'));var utils=require(_0xe8ec('0x17'));var config=require(_0xe8ec('0x18'));var licenseUtil=require(_0xe8ec('0x19'));var db=require(_0xe8ec('0x1a'))['db'];function respondWithStatusCode(_0x69a424,_0xf72aa7){_0xf72aa7=_0xf72aa7||0xcc;return function(_0x153203){if(_0x153203){return _0x69a424[_0xe8ec('0x1b')](_0xf72aa7);}return _0x69a424['status'](_0xf72aa7)[_0xe8ec('0x1c')]();};}function respondWithResult(_0x431723,_0x2e5a88){_0x2e5a88=_0x2e5a88||0xc8;return function(_0x167ebb){if(_0x167ebb){return _0x431723[_0xe8ec('0x1d')](_0x2e5a88)[_0xe8ec('0x1e')](_0x167ebb);}};}function respondWithFilteredResult(_0x1e76ac,_0x218a4b){return function(_0x531f69){if(_0x531f69){var _0x2e7c82=typeof _0x218a4b[_0xe8ec('0x1f')]===_0xe8ec('0x20')&&typeof _0x218a4b['limit']===_0xe8ec('0x20');var _0x20e847=_0x531f69[_0xe8ec('0x21')];var _0x34a582=_0x2e7c82?0x0:_0x218a4b[_0xe8ec('0x1f')];var _0x39e557=_0x2e7c82?_0x531f69[_0xe8ec('0x21')]:_0x218a4b[_0xe8ec('0x1f')]+_0x218a4b['limit'];var _0x11dbe0;if(_0x39e557>=_0x20e847){_0x39e557=_0x20e847;_0x11dbe0=0xc8;}else{_0x11dbe0=0xce;}_0x1e76ac[_0xe8ec('0x1d')](_0x11dbe0);return _0x1e76ac[_0xe8ec('0x22')](_0xe8ec('0x23'),_0x34a582+'-'+_0x39e557+'/'+_0x20e847)[_0xe8ec('0x1e')](_0x531f69);}return null;};}function patchUpdates(_0x3d6fbc){return function(_0xd5ccf5){try{jsonpatch[_0xe8ec('0x24')](_0xd5ccf5,_0x3d6fbc,!![]);}catch(_0x3a5d14){return BPromise['reject'](_0x3a5d14);}return _0xd5ccf5[_0xe8ec('0x25')]();};}function saveUpdates(_0x3fa53f,_0x3de125){return function(_0x31a97d){if(_0x31a97d){return _0x31a97d[_0xe8ec('0x26')](_0x3fa53f)['then'](function(_0x2e05d8){return _0x2e05d8;});}return null;};}function removeEntity(_0x78b6f4,_0x431af0){return function(_0x24260b){if(_0x24260b){return _0x24260b[_0xe8ec('0x27')]()[_0xe8ec('0x28')](function(){_0x78b6f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x457607,_0x1899d9){return function(_0x35af9b){if(!_0x35af9b){_0x457607[_0xe8ec('0x1b')](0x194);}return _0x35af9b;};}function handleError(_0xbec801,_0x3519a5){_0x3519a5=_0x3519a5||0x1f4;return function(_0x267356){logger[_0xe8ec('0x29')](_0x267356[_0xe8ec('0x2a')]);if(_0x267356[_0xe8ec('0x2b')]){delete _0x267356[_0xe8ec('0x2b')];}_0xbec801[_0xe8ec('0x1d')](_0x3519a5)[_0xe8ec('0x2c')](_0x267356);};}exports[_0xe8ec('0x2d')]=function(_0x1140d6,_0x5d6888){var _0x21badd={'raw':!![],'where':{'id':_0x1140d6[_0xe8ec('0x2e')]['id']}},_0x243904={};_0x243904['model']=_[_0xe8ec('0x2f')](db['ChatProactiveAction'][_0xe8ec('0x30')]);_0x243904[_0xe8ec('0x31')]=_[_0xe8ec('0x2f')](_0x1140d6[_0xe8ec('0x31')]);_0x243904[_0xe8ec('0x32')]=_['intersection'](_0x243904[_0xe8ec('0x33')],_0x243904[_0xe8ec('0x31')]);_0x21badd[_0xe8ec('0x34')]=_['intersection'](_0x243904[_0xe8ec('0x33')],qs['fields'](_0x1140d6[_0xe8ec('0x31')][_0xe8ec('0x35')]));_0x21badd[_0xe8ec('0x34')]=_0x21badd[_0xe8ec('0x34')][_0xe8ec('0x36')]?_0x21badd[_0xe8ec('0x34')]:_0x243904[_0xe8ec('0x33')];if(_0x1140d6[_0xe8ec('0x31')][_0xe8ec('0x37')]){_0x21badd['include']=[{'all':!![]}];}_0x21badd=_[_0xe8ec('0x38')]({},_0x21badd,_0x1140d6[_0xe8ec('0x39')]);return db[_0xe8ec('0x3a')]['find'](_0x21badd)[_0xe8ec('0x28')](handleEntityNotFound(_0x5d6888,null))[_0xe8ec('0x28')](respondWithResult(_0x5d6888,null))['catch'](handleError(_0x5d6888,null));};exports[_0xe8ec('0x3b')]=function(_0x5b638d,_0x1bd67e){return db[_0xe8ec('0x3a')]['create'](_0x5b638d[_0xe8ec('0x3c')],{})[_0xe8ec('0x28')](respondWithResult(_0x1bd67e,0xc9))[_0xe8ec('0x3d')](handleError(_0x1bd67e,null));};exports[_0xe8ec('0x26')]=function(_0x58eed6,_0x295cdb){if(_0x58eed6[_0xe8ec('0x3c')]['id']){delete _0x58eed6[_0xe8ec('0x3c')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x58eed6[_0xe8ec('0x2e')]['id']}})[_0xe8ec('0x28')](handleEntityNotFound(_0x295cdb,null))[_0xe8ec('0x28')](saveUpdates(_0x58eed6[_0xe8ec('0x3c')],null))[_0xe8ec('0x28')](respondWithResult(_0x295cdb,null))[_0xe8ec('0x3d')](handleError(_0x295cdb,null));};exports[_0xe8ec('0x27')]=function(_0x47d68b,_0x3ab84e){return db['ChatProactiveAction'][_0xe8ec('0x3e')]({'where':{'id':_0x47d68b[_0xe8ec('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3ab84e,null))['then'](removeEntity(_0x3ab84e,null))[_0xe8ec('0x3d')](handleError(_0x3ab84e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index cade51d..0ebf696 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 _0x4500=['define','ChatProactiveAction','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x4ea557,_0x41b5c4){var _0x4a6c3b=function(_0x5e28fc){while(--_0x5e28fc){_0x4ea557['push'](_0x4ea557['shift']());}};_0x4a6c3b(++_0x41b5c4);}(_0x4500,0xd4));var _0x0450=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0x4500[_0x578275];return _0xf78041;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0450('0x0'))('api');var moment=require(_0x0450('0x1'));var BPromise=require('bluebird');var rp=require(_0x0450('0x2'));var fs=require('fs');var path=require(_0x0450('0x3'));var rimraf=require(_0x0450('0x4'));var config=require(_0x0450('0x5'));var attributes=require(_0x0450('0x6'));module[_0x0450('0x7')]=function(_0x6f23aa,_0x11521d){return _0x6f23aa[_0x0450('0x8')](_0x0450('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2069=['moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x3a4fa5,_0x1caf4f){var _0x5e3215=function(_0x598eed){while(--_0x598eed){_0x3a4fa5['push'](_0x3a4fa5['shift']());}};_0x5e3215(++_0x1caf4f);}(_0x2069,0x170));var _0x9206=function(_0x4ec1ec,_0xf2176a){_0x4ec1ec=_0x4ec1ec-0x0;var _0x401e7e=_0x2069[_0x4ec1ec];return _0x401e7e;};'use strict';var _=require(_0x9206('0x0'));var util=require(_0x9206('0x1'));var logger=require(_0x9206('0x2'))(_0x9206('0x3'));var moment=require(_0x9206('0x4'));var BPromise=require(_0x9206('0x5'));var rp=require(_0x9206('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9206('0x7'));var config=require('../../config/environment');var attributes=require(_0x9206('0x8'));module[_0x9206('0x9')]=function(_0x422a24,_0x3981fc){return _0x422a24['define'](_0x9206('0xa'),attributes,{'tableName':_0x9206('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 03d27a1..f26f147 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 _0x72b4=['rpc','jayson/promise','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe299ae,_0x494c4b){var _0x258685=function(_0x598a46){while(--_0x598a46){_0xe299ae['push'](_0xe299ae['shift']());}};_0x258685(++_0x494c4b);}(_0x72b4,0x1c4));var _0x472b=function(_0x575d3d,_0x1b92d7){_0x575d3d=_0x575d3d-0x0;var _0x49e231=_0x72b4[_0x575d3d];return _0x49e231;};'use strict';var _=require(_0x472b('0x0'));var util=require(_0x472b('0x1'));var moment=require(_0x472b('0x2'));var BPromise=require(_0x472b('0x3'));var rs=require(_0x472b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x472b('0x5'))['db'];var utils=require(_0x472b('0x6'));var logger=require(_0x472b('0x7'))(_0x472b('0x8'));var config=require('../../config/environment');var jayson=require(_0x472b('0x9'));var client=jayson['client'][_0x472b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aa8e8,_0x48614a,_0x5c39e2){return new BPromise(function(_0x38d27c,_0x49708e){return client['request'](_0x2aa8e8,_0x5c39e2)[_0x472b('0xb')](function(_0x22d0ce){logger['info'](_0x472b('0xc'),_0x48614a,_0x472b('0xd'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x48614a,_0x472b('0xd'),JSON[_0x472b('0xe')](_0x22d0ce));if(_0x22d0ce[_0x472b('0xf')]){if(_0x22d0ce[_0x472b('0xf')][_0x472b('0x10')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x48614a,_0x22d0ce[_0x472b('0xf')][_0x472b('0x11')]);return _0x49708e(_0x22d0ce['error'][_0x472b('0x11')]);}logger[_0x472b('0xf')](_0x472b('0xc'),_0x48614a,_0x22d0ce['error']['message']);return _0x38d27c(_0x22d0ce[_0x472b('0xf')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x48614a,_0x472b('0xd'));_0x38d27c(_0x22d0ce[_0x472b('0x12')][_0x472b('0x11')]);}})[_0x472b('0x13')](function(_0x377af2){logger['error'](_0x472b('0xc'),_0x48614a,_0x377af2);_0x49708e(_0x377af2);});});}
\ No newline at end of file
+var _0x5772=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5772,0x1d3));var _0x2577=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x5772[_0x521929];return _0x632436;};'use strict';var _=require(_0x2577('0x0'));var util=require(_0x2577('0x1'));var moment=require(_0x2577('0x2'));var BPromise=require('bluebird');var rs=require(_0x2577('0x3'));var fs=require('fs');var Redis=require(_0x2577('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2577('0x5'));var logger=require(_0x2577('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2577('0x7'));var client=jayson[_0x2577('0x8')][_0x2577('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d829d,_0x618aea,_0x283f02){return new BPromise(function(_0x2cd138,_0x24e0aa){return client[_0x2577('0xa')](_0x2d829d,_0x283f02)[_0x2577('0xb')](function(_0x2eea19){logger[_0x2577('0xc')](_0x2577('0xd'),_0x618aea,_0x2577('0xe'));logger[_0x2577('0xf')](_0x2577('0x10'),_0x618aea,_0x2577('0xe'),JSON['stringify'](_0x2eea19));if(_0x2eea19[_0x2577('0x11')]){if(_0x2eea19['error']['code']===0x1f4){logger[_0x2577('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x618aea,_0x2eea19[_0x2577('0x11')][_0x2577('0x12')]);return _0x24e0aa(_0x2eea19[_0x2577('0x11')][_0x2577('0x12')]);}logger[_0x2577('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x618aea,_0x2eea19[_0x2577('0x11')][_0x2577('0x12')]);return _0x2cd138(_0x2eea19['error'][_0x2577('0x12')]);}else{logger['info'](_0x2577('0xd'),_0x618aea,_0x2577('0xe'));_0x2cd138(_0x2eea19[_0x2577('0x13')]['message']);}})[_0x2577('0x14')](function(_0xbb3d26){logger[_0x2577('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x618aea,_0xbb3d26);_0x24e0aa(_0xbb3d26);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a0153aa..f3c4d06 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 _0xbd51=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','./chatProactiveAction.controller','get','/:id'];(function(_0x38e37d,_0x2bbc57){var _0x386053=function(_0x1f58c0){while(--_0x1f58c0){_0x38e37d['push'](_0x38e37d['shift']());}};_0x386053(++_0x2bbc57);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3c68ad,_0x2f35d3){_0x3c68ad=_0x3c68ad-0x0;var _0x3ae640=_0xbd51[_0x3c68ad];return _0x3ae640;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bd5('0x5'));router[_0x1bd5('0x6')](_0x1bd5('0x7'),auth['isAuthenticated'](),controller[_0x1bd5('0x8')]);router[_0x1bd5('0x9')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0xc')]('/:id',auth[_0x1bd5('0xa')](),controller['update']);router[_0x1bd5('0xd')](_0x1bd5('0x7'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xe')]);module[_0x1bd5('0xf')]=router;
\ No newline at end of file
+var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x59a802,_0x4f63d7){var _0x200655=function(_0x4b1245){while(--_0x4b1245){_0x59a802['push'](_0x59a802['shift']());}};_0x200655(++_0x4f63d7);}(_0x33c5,0xe6));var _0x533c=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0x33c5[_0x46451c];return _0x12dce4;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7e138fd..9935dcc 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 _0xe8c5=['exports','STRING','INTEGER','ENUM','beepall','roundrobin'];(function(_0x4bd6a9,_0xad262){var _0x172f0b=function(_0x3e636b){while(--_0x3e636b){_0x4bd6a9['push'](_0x4bd6a9['shift']());}};_0x172f0b(++_0xad262);}(_0xe8c5,0x1f2));var _0x5e8c=function(_0x453a33,_0x1b123a){_0x453a33=_0x453a33-0x0;var _0x4c2b38=_0xe8c5[_0x453a33];return _0x4c2b38;};'use strict';var Sequelize=require('sequelize');module[_0x5e8c('0x0')]={'name':{'type':Sequelize[_0x5e8c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5e8c('0x1')]},'timeout':{'type':Sequelize[_0x5e8c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5e8c('0x3')]('rrmemory',_0x5e8c('0x4'),_0x5e8c('0x5'))}};
\ No newline at end of file
+var _0x64dd=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x4b0258,_0x5b87b7){var _0x1237c8=function(_0x5b5852){while(--_0x5b5852){_0x4b0258['push'](_0x4b0258['shift']());}};_0x1237c8(++_0x5b87b7);}(_0x64dd,0x180));var _0xd64d=function(_0x584cfa,_0x3d9b3a){_0x584cfa=_0x584cfa-0x0;var _0x1e6efa=_0x64dd[_0x584cfa];return _0x1e6efa;};'use strict';var Sequelize=require(_0xd64d('0x0'));module[_0xd64d('0x1')]={'name':{'type':Sequelize[_0xd64d('0x2')],'unique':_0xd64d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd64d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd64d('0x5')](_0xd64d('0x6'),_0xd64d('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 5d73b95..217681f 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 _0x5fdf=['include','findAll','rows','show','params','keys','includeAll','find','create','body','get','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','ChatQueueId','User','findAndCountAll','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','rawAttributes','addTeams','Agents','interface','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','end','json','offset','undefined','count','limit','set','apply','save','destroy','UserProfileResource','sendStatus','name','send','index','ChatQueue','fieldName','key','map','intersection','model','attributes','fields','query','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x5fdf,0xd9));var _0xf5fd=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0x5fdf[_0x1c510a];return _0x23cedd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5fd('0x0'));var zipdir=require(_0xf5fd('0x1'));var jsonpatch=require(_0xf5fd('0x2'));var rp=require(_0xf5fd('0x3'));var moment=require('moment');var BPromise=require(_0xf5fd('0x4'));var Mustache=require('mustache');var util=require(_0xf5fd('0x5'));var path=require(_0xf5fd('0x6'));var sox=require(_0xf5fd('0x7'));var csv=require(_0xf5fd('0x8'));var ejs=require(_0xf5fd('0x9'));var fs=require('fs');var fs_extra=require(_0xf5fd('0xa'));var _=require(_0xf5fd('0xb'));var squel=require(_0xf5fd('0xc'));var crypto=require(_0xf5fd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf5fd('0xe'));var toCsv=require(_0xf5fd('0x8'));var querystring=require(_0xf5fd('0xf'));var Papa=require(_0xf5fd('0x10'));var Redis=require(_0xf5fd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf5fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5fd('0x13'))(_0xf5fd('0x14'));var utils=require(_0xf5fd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5fd('0x16'));var db=require('../../mysqldb')['db'];config[_0xf5fd('0x17')]=_[_0xf5fd('0x18')](config[_0xf5fd('0x17')],{'host':_0xf5fd('0x19'),'port':0x18eb});var socket=require(_0xf5fd('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xf5fd('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf5fd('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15eca7,_0x1bc839,_0x5da757,_0x3d8618){return new BPromise(function(_0x33357c,_0x24f19d){var _0x4b2e58=_0x3d8618||client;return _0x4b2e58[_0xf5fd('0x1d')](_0x15eca7,_0x5da757)[_0xf5fd('0x1e')](function(_0x14cefa){logger[_0xf5fd('0x1f')](_0xf5fd('0x20'),_0x1bc839,'request\x20sent');logger[_0xf5fd('0x21')](_0xf5fd('0x22'),_0x1bc839,'request\x20sent',JSON[_0xf5fd('0x23')](_0x14cefa));if(_0x14cefa[_0xf5fd('0x24')]){if(_0x14cefa['error'][_0xf5fd('0x25')]===0x1f4){logger[_0xf5fd('0x24')](_0xf5fd('0x20'),_0x1bc839,_0x14cefa[_0xf5fd('0x24')][_0xf5fd('0x26')]);return _0x24f19d(_0x14cefa[_0xf5fd('0x24')][_0xf5fd('0x26')]);}logger[_0xf5fd('0x24')](_0xf5fd('0x20'),_0x1bc839,_0x14cefa[_0xf5fd('0x24')][_0xf5fd('0x26')]);return _0x33357c(_0x14cefa[_0xf5fd('0x24')]['message']);}else{logger['info'](_0xf5fd('0x20'),_0x1bc839,_0xf5fd('0x27'));_0x33357c(_0x14cefa['result'][_0xf5fd('0x26')]);}})[_0xf5fd('0x28')](function(_0x527799){logger[_0xf5fd('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1bc839,_0x527799);_0x24f19d(_0x527799);});});}function respondWithStatusCode(_0x594a4b,_0x57ca7e){_0x57ca7e=_0x57ca7e||0xcc;return function(_0x2a983f){if(_0x2a983f){return _0x594a4b['sendStatus'](_0x57ca7e);}return _0x594a4b[_0xf5fd('0x29')](_0x57ca7e)[_0xf5fd('0x2a')]();};}function respondWithResult(_0x2aeaa6,_0x123123){_0x123123=_0x123123||0xc8;return function(_0x25e7b2){if(_0x25e7b2){return _0x2aeaa6[_0xf5fd('0x29')](_0x123123)[_0xf5fd('0x2b')](_0x25e7b2);}};}function respondWithFilteredResult(_0x13b175,_0x178fe0){return function(_0x46c251){if(_0x46c251){var _0x4922fc=typeof _0x178fe0[_0xf5fd('0x2c')]===_0xf5fd('0x2d')&&typeof _0x178fe0['limit']===_0xf5fd('0x2d');var _0x114d87=_0x46c251[_0xf5fd('0x2e')];var _0x2c6775=_0x4922fc?0x0:_0x178fe0[_0xf5fd('0x2c')];var _0x3d7351=_0x4922fc?_0x46c251[_0xf5fd('0x2e')]:_0x178fe0['offset']+_0x178fe0[_0xf5fd('0x2f')];var _0x407459;if(_0x3d7351>=_0x114d87){_0x3d7351=_0x114d87;_0x407459=0xc8;}else{_0x407459=0xce;}_0x13b175[_0xf5fd('0x29')](_0x407459);return _0x13b175[_0xf5fd('0x30')]('Content-Range',_0x2c6775+'-'+_0x3d7351+'/'+_0x114d87)[_0xf5fd('0x2b')](_0x46c251);}return null;};}function patchUpdates(_0x58ce04){return function(_0x4d0997){try{jsonpatch[_0xf5fd('0x31')](_0x4d0997,_0x58ce04,!![]);}catch(_0x507155){return BPromise['reject'](_0x507155);}return _0x4d0997[_0xf5fd('0x32')]();};}function saveUpdates(_0x4af76b,_0x2332a1){return function(_0xb96a82){if(_0xb96a82){return _0xb96a82['update'](_0x4af76b)[_0xf5fd('0x1e')](function(_0x34b7ca){return _0x34b7ca;});}return null;};}function removeEntity(_0x56dbed,_0x183277){return function(_0x202e50){if(_0x202e50){return _0x202e50[_0xf5fd('0x33')]()['then'](function(){var _0x49bfe2=_0x202e50['get']({'plain':!![]});var _0x52c20c='ChatQueues';return db[_0xf5fd('0x34')][_0xf5fd('0x33')]({'where':{'type':_0x52c20c,'resourceId':_0x49bfe2['id']}})[_0xf5fd('0x1e')](function(){return _0x202e50;});})[_0xf5fd('0x1e')](function(){_0x56dbed[_0xf5fd('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42aab6,_0x1d1716){return function(_0x3601bd){if(!_0x3601bd){_0x42aab6[_0xf5fd('0x35')](0x194);}return _0x3601bd;};}function handleError(_0x54e001,_0x24fa70){_0x24fa70=_0x24fa70||0x1f4;return function(_0x1f432d){logger[_0xf5fd('0x24')](_0x1f432d['stack']);if(_0x1f432d[_0xf5fd('0x36')]){delete _0x1f432d['name'];}_0x54e001[_0xf5fd('0x29')](_0x24fa70)[_0xf5fd('0x37')](_0x1f432d);};}exports[_0xf5fd('0x38')]=function(_0x1c4771,_0xee2be3){var _0x30ba0d={},_0x450be1={},_0x45d41b={'count':0x0,'rows':[]};var _0x581eb0=_['map'](db[_0xf5fd('0x39')]['rawAttributes'],function(_0x15a9a0){return{'name':_0x15a9a0[_0xf5fd('0x3a')],'type':_0x15a9a0['type'][_0xf5fd('0x3b')]};});_0x450be1['model']=_[_0xf5fd('0x3c')](_0x581eb0,_0xf5fd('0x36'));_0x450be1['query']=_['keys'](_0x1c4771['query']);_0x450be1['filters']=_[_0xf5fd('0x3d')](_0x450be1[_0xf5fd('0x3e')],_0x450be1['query']);_0x30ba0d[_0xf5fd('0x3f')]=_[_0xf5fd('0x3d')](_0x450be1['model'],qs[_0xf5fd('0x40')](_0x1c4771[_0xf5fd('0x41')][_0xf5fd('0x40')]));_0x30ba0d[_0xf5fd('0x3f')]=_0x30ba0d['attributes'][_0xf5fd('0x42')]?_0x30ba0d['attributes']:_0x450be1[_0xf5fd('0x3e')];if(!_0x1c4771[_0xf5fd('0x41')]['hasOwnProperty'](_0xf5fd('0x43'))){_0x30ba0d[_0xf5fd('0x2f')]=qs['limit'](_0x1c4771[_0xf5fd('0x41')]['limit']);_0x30ba0d[_0xf5fd('0x2c')]=qs['offset'](_0x1c4771['query'][_0xf5fd('0x2c')]);}_0x30ba0d[_0xf5fd('0x44')]=qs[_0xf5fd('0x45')](_0x1c4771[_0xf5fd('0x41')][_0xf5fd('0x45')]);_0x30ba0d[_0xf5fd('0x46')]=qs['filters'](_[_0xf5fd('0x47')](_0x1c4771[_0xf5fd('0x41')],_0x450be1['filters']),_0x581eb0);if(_0x1c4771[_0xf5fd('0x41')]['filter']){_0x30ba0d['where']=_[_0xf5fd('0x48')](_0x30ba0d[_0xf5fd('0x46')],{'$or':_['map'](_0x581eb0,function(_0x3c37e0){if(_0x3c37e0[_0xf5fd('0x49')]!==_0xf5fd('0x4a')){var _0x19746f={};_0x19746f[_0x3c37e0[_0xf5fd('0x36')]]={'$like':'%'+_0x1c4771[_0xf5fd('0x41')][_0xf5fd('0x4b')]+'%'};return _0x19746f;}})});}_0x30ba0d=_[_0xf5fd('0x48')]({},_0x30ba0d,_0x1c4771[_0xf5fd('0x4c')]);var _0x422f7c={'where':_0x30ba0d[_0xf5fd('0x46')]};return db['ChatQueue'][_0xf5fd('0x2e')](_0x422f7c)[_0xf5fd('0x1e')](function(_0x12b8b4){_0x45d41b[_0xf5fd('0x2e')]=_0x12b8b4;if(_0x1c4771['query']['includeAll']){_0x30ba0d[_0xf5fd('0x4d')]=[{'all':!![]}];}return db[_0xf5fd('0x39')][_0xf5fd('0x4e')](_0x30ba0d);})['then'](function(_0x59f32e){_0x45d41b[_0xf5fd('0x4f')]=_0x59f32e;return _0x45d41b;})['then'](respondWithFilteredResult(_0xee2be3,_0x30ba0d))[_0xf5fd('0x28')](handleError(_0xee2be3,null));};exports[_0xf5fd('0x50')]=function(_0x43c33d,_0x2d6940){var _0x4139f4={'raw':!![],'where':{'id':_0x43c33d[_0xf5fd('0x51')]['id']}},_0x1a1677={};_0x1a1677[_0xf5fd('0x3e')]=_[_0xf5fd('0x52')](db[_0xf5fd('0x39')]['rawAttributes']);_0x1a1677[_0xf5fd('0x41')]=_[_0xf5fd('0x52')](_0x43c33d[_0xf5fd('0x41')]);_0x1a1677['filters']=_[_0xf5fd('0x3d')](_0x1a1677['model'],_0x1a1677[_0xf5fd('0x41')]);_0x4139f4['attributes']=_[_0xf5fd('0x3d')](_0x1a1677['model'],qs[_0xf5fd('0x40')](_0x43c33d['query']['fields']));_0x4139f4[_0xf5fd('0x3f')]=_0x4139f4[_0xf5fd('0x3f')][_0xf5fd('0x42')]?_0x4139f4[_0xf5fd('0x3f')]:_0x1a1677[_0xf5fd('0x3e')];if(_0x43c33d[_0xf5fd('0x41')][_0xf5fd('0x53')]){_0x4139f4[_0xf5fd('0x4d')]=[{'all':!![]}];}_0x4139f4=_[_0xf5fd('0x48')]({},_0x4139f4,_0x43c33d[_0xf5fd('0x4c')]);return db[_0xf5fd('0x39')][_0xf5fd('0x54')](_0x4139f4)[_0xf5fd('0x1e')](handleEntityNotFound(_0x2d6940,null))[_0xf5fd('0x1e')](respondWithResult(_0x2d6940,null))[_0xf5fd('0x28')](handleError(_0x2d6940,null));};exports[_0xf5fd('0x55')]=function(_0x1d73b3,_0x47c539){return db[_0xf5fd('0x39')][_0xf5fd('0x55')](_0x1d73b3[_0xf5fd('0x56')],{})[_0xf5fd('0x1e')](function(_0x187d97){var _0x56e9f6=_0x1d73b3['user'][_0xf5fd('0x57')]({'plain':!![]});if(!_0x56e9f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56e9f6[_0xf5fd('0x58')]===_0xf5fd('0x59')){var _0x1a9ce8=_0x187d97[_0xf5fd('0x57')]({'plain':!![]});var _0x3420b4='ChatQueues';return db['UserProfileSection'][_0xf5fd('0x54')]({'where':{'name':_0x3420b4,'userProfileId':_0x56e9f6['userProfileId']},'raw':!![]})[_0xf5fd('0x1e')](function(_0x385ce4){if(_0x385ce4&&_0x385ce4[_0xf5fd('0x5a')]===0x0){return db[_0xf5fd('0x34')][_0xf5fd('0x55')]({'name':_0x1a9ce8[_0xf5fd('0x36')],'resourceId':_0x1a9ce8['id'],'type':_0x385ce4[_0xf5fd('0x36')],'sectionId':_0x385ce4['id']},{})[_0xf5fd('0x1e')](function(){return _0x187d97;});}else{return _0x187d97;}})[_0xf5fd('0x28')](function(_0x3b72c8){logger[_0xf5fd('0x24')](_0xf5fd('0x5b'),_0x3b72c8);throw _0x3b72c8;});}return _0x187d97;})[_0xf5fd('0x1e')](respondWithResult(_0x47c539,0xc9))['catch'](handleError(_0x47c539,null));};exports[_0xf5fd('0x5c')]=function(_0x28a1da,_0x241dfb){if(_0x28a1da[_0xf5fd('0x56')]['id']){delete _0x28a1da[_0xf5fd('0x56')]['id'];}return db[_0xf5fd('0x39')][_0xf5fd('0x54')]({'where':{'id':_0x28a1da[_0xf5fd('0x51')]['id']}})[_0xf5fd('0x1e')](handleEntityNotFound(_0x241dfb,null))[_0xf5fd('0x1e')](saveUpdates(_0x28a1da['body'],null))[_0xf5fd('0x1e')](respondWithResult(_0x241dfb,null))[_0xf5fd('0x28')](handleError(_0x241dfb,null));};exports[_0xf5fd('0x33')]=function(_0x14b538,_0x4e4465){return db[_0xf5fd('0x39')][_0xf5fd('0x54')]({'where':{'id':_0x14b538[_0xf5fd('0x51')]['id']}})[_0xf5fd('0x1e')](handleEntityNotFound(_0x4e4465,null))['then'](removeEntity(_0x4e4465,null))[_0xf5fd('0x28')](handleError(_0x4e4465,null));};exports[_0xf5fd('0x5d')]=function(_0x5218b9,_0x926dc9){return db['ChatQueue'][_0xf5fd('0x5d')]()[_0xf5fd('0x1e')](respondWithResult(_0x926dc9,null))[_0xf5fd('0x28')](handleError(_0x926dc9,null));};exports[_0xf5fd('0x5e')]=function(_0x1f1e9b,_0x5e56a2,_0x3deda0){var _0xaf4665={'raw':!![],'where':{}},_0x4e7743={},_0x2a0327;return db['ChatQueue'][_0xf5fd('0x5f')]({'where':{'id':_0x1f1e9b['params']['id']}})[_0xf5fd('0x1e')](handleEntityNotFound(_0x5e56a2,null))[_0xf5fd('0x1e')](function(_0x3b0f25){if(_0x3b0f25){_0x2a0327=_0x3b0f25[_0xf5fd('0x57')]({'plain':!![]});_0x4e7743[_0xf5fd('0x3e')]=_['keys'](db[_0xf5fd('0x60')]['rawAttributes']);_0x4e7743[_0xf5fd('0x41')]=_['keys'](_0x1f1e9b[_0xf5fd('0x41')]);_0x4e7743[_0xf5fd('0x61')]=_[_0xf5fd('0x3d')](_0x4e7743[_0xf5fd('0x3e')],_0x4e7743[_0xf5fd('0x41')]);_0xaf4665[_0xf5fd('0x3f')]=_[_0xf5fd('0x3d')](_0x4e7743[_0xf5fd('0x3e')],qs['fields'](_0x1f1e9b['query'][_0xf5fd('0x40')]));_0xaf4665[_0xf5fd('0x3f')]=_0xaf4665[_0xf5fd('0x3f')][_0xf5fd('0x42')]?_0xaf4665[_0xf5fd('0x3f')]:_0x4e7743['model'];if(!_0x1f1e9b[_0xf5fd('0x41')][_0xf5fd('0x62')]('nolimit')){_0xaf4665[_0xf5fd('0x2f')]=qs[_0xf5fd('0x2f')](_0x1f1e9b[_0xf5fd('0x41')][_0xf5fd('0x2f')]);_0xaf4665[_0xf5fd('0x2c')]=qs['offset'](_0x1f1e9b[_0xf5fd('0x41')][_0xf5fd('0x2c')]);}_0xaf4665['order']=qs['sort'](_0x1f1e9b['query'][_0xf5fd('0x45')]);_0xaf4665[_0xf5fd('0x46')]=qs[_0xf5fd('0x61')](_[_0xf5fd('0x47')](_0x1f1e9b[_0xf5fd('0x41')],_0x4e7743[_0xf5fd('0x61')]));_0xaf4665[_0xf5fd('0x46')][_0xf5fd('0x63')]=_0x3b0f25['id'];if(_0x1f1e9b['query'][_0xf5fd('0x4b')]){_0xaf4665[_0xf5fd('0x46')]=_['merge'](_0xaf4665[_0xf5fd('0x46')],{'$or':_['map'](_0xaf4665[_0xf5fd('0x3f')],function(_0x2dd806){var _0x3c207a={};_0x3c207a[_0x2dd806]={'$like':'%'+_0x1f1e9b[_0xf5fd('0x41')][_0xf5fd('0x4b')]+'%'};return _0x3c207a;})});}_0xaf4665=_[_0xf5fd('0x48')]({},_0xaf4665,_0x1f1e9b[_0xf5fd('0x4c')]);return db['UserChatQueue'][_0xf5fd('0x4e')](_0xaf4665);}})[_0xf5fd('0x1e')](function(_0x413abd){if(_0x413abd){return db[_0xf5fd('0x64')][_0xf5fd('0x65')]({'where':{'id':_['map'](_0x413abd,'UserId'),'role':'agent'},'attributes':['id','name',_0xf5fd('0x66'),_0xf5fd('0x67'),_0xf5fd('0x68')]});}})[_0xf5fd('0x1e')](function(_0x546241){if(_0x546241){return{'count':_0x546241[_0xf5fd('0x2e')],'rows':_[_0xf5fd('0x3c')](_0x546241[_0xf5fd('0x4f')],function(_0x158aa3){return{'membername':_0x158aa3[_0xf5fd('0x36')],'UserId':_0x158aa3['id'],'queue_name':_0x2a0327[_0xf5fd('0x36')],'ChatQueueId':_0x2a0327['id'],'interface':util[_0xf5fd('0x69')](_0xf5fd('0x6a'),_0xf5fd('0x6b'),_0x158aa3[_0xf5fd('0x36')]),'penalty':0x0,'paused':_0x158aa3[_0xf5fd('0x66')],'createdAt':_0x158aa3[_0xf5fd('0x68')],'updatedAt':_0x158aa3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5e56a2,_0xaf4665))[_0xf5fd('0x28')](handleError(_0x5e56a2,null));};exports[_0xf5fd('0x6c')]=function(_0x5d7d10,_0x33ebe1,_0x19b863){var _0x1eaa35={};var _0x1295e9={};var _0x2d5cd0;var _0x2fab4f;return db[_0xf5fd('0x39')]['findOne']({'where':{'id':_0x5d7d10[_0xf5fd('0x51')]['id']}})['then'](handleEntityNotFound(_0x33ebe1,null))[_0xf5fd('0x1e')](function(_0x473079){if(_0x473079){_0x2d5cd0=_0x473079;_0x1295e9[_0xf5fd('0x3e')]=_[_0xf5fd('0x52')](db[_0xf5fd('0x6d')][_0xf5fd('0x6e')]);_0x1295e9['query']=_[_0xf5fd('0x52')](_0x5d7d10[_0xf5fd('0x41')]);_0x1295e9[_0xf5fd('0x61')]=_[_0xf5fd('0x3d')](_0x1295e9[_0xf5fd('0x3e')],_0x1295e9[_0xf5fd('0x41')]);_0x1eaa35['attributes']=_[_0xf5fd('0x3d')](_0x1295e9[_0xf5fd('0x3e')],qs[_0xf5fd('0x40')](_0x5d7d10[_0xf5fd('0x41')]['fields']));_0x1eaa35['attributes']=_0x1eaa35['attributes'][_0xf5fd('0x42')]?_0x1eaa35[_0xf5fd('0x3f')]:_0x1295e9[_0xf5fd('0x3e')];_0x1eaa35[_0xf5fd('0x44')]=qs[_0xf5fd('0x45')](_0x5d7d10['query']['sort']);_0x1eaa35['where']=qs['filters'](_[_0xf5fd('0x47')](_0x5d7d10[_0xf5fd('0x41')],_0x1295e9['filters']));if(_0x5d7d10[_0xf5fd('0x41')][_0xf5fd('0x4b')]){_0x1eaa35[_0xf5fd('0x46')]=_['merge'](_0x1eaa35['where'],{'$or':_['map'](_0x1eaa35[_0xf5fd('0x3f')],function(_0x527d9a){var _0x54191d={};_0x54191d[_0x527d9a]={'$like':'%'+_0x5d7d10['query'][_0xf5fd('0x4b')]+'%'};return _0x54191d;})});}_0x1eaa35=_[_0xf5fd('0x48')]({},_0x1eaa35,_0x5d7d10['options']);return _0x2d5cd0[_0xf5fd('0x6c')](_0x1eaa35);}})['then'](function(_0xa1bd9e){if(_0xa1bd9e){_0x2fab4f=_0xa1bd9e[_0xf5fd('0x42')];if(!_0x5d7d10[_0xf5fd('0x41')][_0xf5fd('0x62')](_0xf5fd('0x43'))){_0x1eaa35[_0xf5fd('0x2f')]=qs[_0xf5fd('0x2f')](_0x5d7d10[_0xf5fd('0x41')][_0xf5fd('0x2f')]);_0x1eaa35['offset']=qs[_0xf5fd('0x2c')](_0x5d7d10['query']['offset']);}return _0x2d5cd0['getTeams'](_0x1eaa35);}})[_0xf5fd('0x1e')](function(_0x293b3a){if(_0x293b3a){return _0x293b3a?{'count':_0x2fab4f,'rows':_0x293b3a}:null;}})[_0xf5fd('0x1e')](respondWithResult(_0x33ebe1,null))[_0xf5fd('0x28')](handleError(_0x33ebe1,null));};exports[_0xf5fd('0x6f')]=function(_0x1b7808,_0x431853,_0x525fff){var _0x1f1537=_0x1b7808[_0xf5fd('0x56')]['ids'];return db['Team'][_0xf5fd('0x4e')]({'where':{'id':_0x1f1537},'attributes':['id'],'include':[{'model':db[_0xf5fd('0x64')],'as':_0xf5fd('0x70'),'attributes':['id','name','online','voicePause',_0xf5fd('0x71')],'raw':!![]}]})[_0xf5fd('0x1e')](function(_0xc9dfda){if(_0xc9dfda){var _0x514ff1=_['flatMap'](_0xc9dfda,function(_0x33be23){var _0x156fa4=_0x33be23[_0xf5fd('0x57')]({'plain':!![]});return _0x156fa4[_0xf5fd('0x70')];});return db['ChatQueue'][_0xf5fd('0x54')]({'where':{'id':_0x1b7808[_0xf5fd('0x51')]['id']}})['then'](function(_0x428190){return db[_0xf5fd('0x72')][_0xf5fd('0x73')](function(_0x18a590){return _0x428190['addTeams'](_0x1f1537,{'transaction':_0x18a590})[_0xf5fd('0x1e')](function(){return BPromise[_0xf5fd('0x74')](_0x514ff1,function(_0x8f705d){return db[_0xf5fd('0x60')]['findOrCreate']({'where':{'UserId':_0x8f705d['id'],'ChatQueueId':_0x1b7808['params']['id']},'transaction':_0x18a590});});})[_0xf5fd('0x1e')](function(){_0x514ff1[_0xf5fd('0x75')](function(_0x231677){socket[_0xf5fd('0x76')](_0xf5fd('0x77'),{'UserId':_0x231677['id'],'ChatQueueId':_0x428190['id']});});});});});}})['then'](respondWithStatusCode(_0x431853,null))[_0xf5fd('0x28')](handleError(_0x431853,null));};exports[_0xf5fd('0x78')]=function(_0xb476a8,_0x11a102,_0x5a73be){return db[_0xf5fd('0x6d')][_0xf5fd('0x4e')]({'where':{'id':_0xb476a8['query'][_0xf5fd('0x79')]},'attributes':['id'],'include':[{'model':db[_0xf5fd('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5fd('0x1e')](handleEntityNotFound(_0x11a102,null))[_0xf5fd('0x1e')](function(_0x22d882){var _0xe517fe=_[_0xf5fd('0x3c')](_0x22d882,'id');var _0x45d2a6=[];var _0x5b2e98=[];var _0x24a35f=squel[_0xf5fd('0x7a')]();_0x24a35f['field'](_0xf5fd('0x7b'))[_0xf5fd('0x7c')](_0xf5fd('0x7d'),'tq')[_0xf5fd('0x7e')]('user_has_teams','ut',_0xf5fd('0x7f'))[_0xf5fd('0x46')](_0xf5fd('0x80'),_0xb476a8[_0xf5fd('0x51')]['id']);for(var _0x343702=0x0;_0x343702<_0x22d882[_0xf5fd('0x42')];_0x343702+=0x1){let _0x409a19=_0x22d882[_0x343702];for(var _0x51ab82=0x0;_0x51ab82<_0x409a19[_0xf5fd('0x70')]['length'];_0x51ab82+=0x1){let _0x1f6ce2=_0x409a19[_0xf5fd('0x70')][_0x51ab82];var _0x3a5876=_0x24a35f[_0xf5fd('0x81')]();_0x3a5876[_0xf5fd('0x46')](_0xf5fd('0x82'),_0x1f6ce2['id']);_0x5b2e98[_0xf5fd('0x83')](db[_0xf5fd('0x72')]['query'](_0x3a5876['toString'](),{'type':db[_0xf5fd('0x72')]['QueryTypes'][_0xf5fd('0x84')]})[_0xf5fd('0x1e')](function(_0x2602b5){if(_0x2602b5[_0xf5fd('0x42')]===0x1){return _0x1f6ce2['id'];}else{var _0x5280b9=_[_0xf5fd('0x85')](_[_0xf5fd('0x3c')](_0x2602b5,_0xf5fd('0x86')),function(_0x2a5c0a){return _[_0xf5fd('0x87')](_0xe517fe,_0x2a5c0a);});if(_0x5280b9){return _0x1f6ce2['id'];}}}));}}return BPromise[_0xf5fd('0x88')](_0x5b2e98)[_0xf5fd('0x1e')](function(_0x5aa4da){_0x45d2a6=_(_0x45d2a6)[_0xf5fd('0x89')](_0x5aa4da)['compact']()[_0xf5fd('0x8a')]();return db['ChatQueue'][_0xf5fd('0x54')]({'where':{'id':_0xb476a8[_0xf5fd('0x51')]['id']}})[_0xf5fd('0x1e')](function(_0x3817b0){return db[_0xf5fd('0x72')][_0xf5fd('0x73')](function(_0x3d1b75){return _0x3817b0[_0xf5fd('0x78')](_0xb476a8[_0xf5fd('0x41')][_0xf5fd('0x79')],{'transaction':_0x3d1b75})[_0xf5fd('0x1e')](function(){if(!_[_0xf5fd('0x8b')](_0x45d2a6)){return _0x3817b0['removeAgents'](_0x45d2a6,{'transaction':_0x3d1b75});}})[_0xf5fd('0x1e')](function(){_0x45d2a6[_0xf5fd('0x75')](function(_0x14f944){socket[_0xf5fd('0x76')](_0xf5fd('0x8c'),{'UserId':_0x14f944,'ChatQueueId':_0x3817b0['id']});});});});});});})[_0xf5fd('0x1e')](respondWithStatusCode(_0x11a102,null))[_0xf5fd('0x28')](handleError(_0x11a102,null));};exports[_0xf5fd('0x8d')]=function(_0x1f1318,_0x3df9c4,_0x1d06fc){return db['ChatQueue']['find']({'where':{'id':_0x1f1318[_0xf5fd('0x51')]['id']}})['then'](handleEntityNotFound(_0x3df9c4,null))[_0xf5fd('0x1e')](function(_0x4d231a){if(_0x4d231a){return _0x4d231a[_0xf5fd('0x8d')](_0x1f1318['body'][_0xf5fd('0x79')],_[_0xf5fd('0x8e')](_0x1f1318[_0xf5fd('0x56')],[_0xf5fd('0x79'),'id'])||{})[_0xf5fd('0x8f')](function(_0x391031){for(var _0x5fb63d=0x0;_0x5fb63d<_0x1f1318[_0xf5fd('0x56')][_0xf5fd('0x79')][_0xf5fd('0x42')];_0x5fb63d+=0x1){socket[_0xf5fd('0x76')](_0xf5fd('0x77'),{'UserId':Number(_0x1f1318[_0xf5fd('0x56')][_0xf5fd('0x79')][_0x5fb63d]),'ChatQueueId':Number(_0x1f1318[_0xf5fd('0x51')]['id'])});}return _0x391031;});}})[_0xf5fd('0x1e')](respondWithResult(_0x3df9c4,null))[_0xf5fd('0x28')](handleError(_0x3df9c4,null));};exports[_0xf5fd('0x90')]=function(_0x1c9766,_0x575469,_0x22c483){return db['ChatQueue']['find']({'where':{'id':_0x1c9766[_0xf5fd('0x51')]['id']}})['then'](handleEntityNotFound(_0x575469,null))['then'](function(_0xf02dba){if(_0xf02dba){return _0xf02dba[_0xf5fd('0x90')](_0x1c9766[_0xf5fd('0x41')]['ids'])[_0xf5fd('0x1e')](function(){if(_[_0xf5fd('0x91')](_0x1c9766['query'][_0xf5fd('0x79')])){for(var _0x1ee17f=0x0;_0x1ee17f<_0x1c9766[_0xf5fd('0x41')][_0xf5fd('0x79')][_0xf5fd('0x42')];_0x1ee17f+=0x1){socket[_0xf5fd('0x76')](_0xf5fd('0x8c'),{'UserId':Number(_0x1c9766[_0xf5fd('0x41')][_0xf5fd('0x79')][_0x1ee17f]),'ChatQueueId':Number(_0x1c9766[_0xf5fd('0x51')]['id'])});}}else{socket[_0xf5fd('0x76')](_0xf5fd('0x8c'),{'UserId':Number(_0x1c9766['query'][_0xf5fd('0x79')]),'ChatQueueId':Number(_0x1c9766[_0xf5fd('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0x575469,null))[_0xf5fd('0x28')](handleError(_0x575469,null));};exports['getAgents']=function(_0x307274,_0x2a99b4,_0x3a9eb2){var _0xeff33e={};var _0x237f32={};var _0x169228;var _0x1255a1;return db[_0xf5fd('0x39')]['findOne']({'where':{'id':_0x307274[_0xf5fd('0x51')]['id']}})[_0xf5fd('0x1e')](handleEntityNotFound(_0x2a99b4,null))[_0xf5fd('0x1e')](function(_0x4248b8){if(_0x4248b8){_0x169228=_0x4248b8;_0x237f32[_0xf5fd('0x3e')]=_[_0xf5fd('0x52')](db['User']['rawAttributes']);_0x237f32[_0xf5fd('0x41')]=_[_0xf5fd('0x52')](_0x307274['query']);_0x237f32['filters']=_[_0xf5fd('0x3d')](_0x237f32[_0xf5fd('0x3e')],_0x237f32[_0xf5fd('0x41')]);_0xeff33e[_0xf5fd('0x3f')]=_[_0xf5fd('0x3d')](_0x237f32[_0xf5fd('0x3e')],qs[_0xf5fd('0x40')](_0x307274[_0xf5fd('0x41')][_0xf5fd('0x40')]));_0xeff33e[_0xf5fd('0x3f')]=_0xeff33e[_0xf5fd('0x3f')][_0xf5fd('0x42')]?_0xeff33e['attributes']:_0x237f32[_0xf5fd('0x3e')];_0xeff33e[_0xf5fd('0x44')]=qs[_0xf5fd('0x45')](_0x307274[_0xf5fd('0x41')][_0xf5fd('0x45')]);_0xeff33e['where']=qs[_0xf5fd('0x61')](_[_0xf5fd('0x47')](_0x307274['query'],_0x237f32[_0xf5fd('0x61')]));if(_0x307274[_0xf5fd('0x41')][_0xf5fd('0x4b')]){_0xeff33e[_0xf5fd('0x46')]=_[_0xf5fd('0x48')](_0xeff33e[_0xf5fd('0x46')],{'$or':_['map'](_0xeff33e[_0xf5fd('0x3f')],function(_0x5415ca){var _0xf54fac={};_0xf54fac[_0x5415ca]={'$like':'%'+_0x307274['query'][_0xf5fd('0x4b')]+'%'};return _0xf54fac;})});}_0xeff33e=_[_0xf5fd('0x48')]({},_0xeff33e,_0x307274[_0xf5fd('0x4c')]);return _0x169228[_0xf5fd('0x92')](_0xeff33e);}})['then'](function(_0x277bd3){if(_0x277bd3){_0x1255a1=_0x277bd3[_0xf5fd('0x42')];if(!_0x307274[_0xf5fd('0x41')]['hasOwnProperty'](_0xf5fd('0x43'))){_0xeff33e[_0xf5fd('0x2f')]=qs['limit'](_0x307274[_0xf5fd('0x41')]['limit']);_0xeff33e[_0xf5fd('0x2c')]=qs[_0xf5fd('0x2c')](_0x307274['query']['offset']);}return _0x169228[_0xf5fd('0x92')](_0xeff33e);}})[_0xf5fd('0x1e')](function(_0x566080){if(_0x566080){return _0x566080?{'count':_0x1255a1,'rows':_0x566080}:null;}})[_0xf5fd('0x1e')](respondWithResult(_0x2a99b4,null))[_0xf5fd('0x28')](handleError(_0x2a99b4,null));};
\ No newline at end of file
+var _0x38f3=['update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','pick','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','push','QueryTypes','SELECT','all','union','compact','userChatQueue:remove','addAgents','omit','userChatQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x1ae125,_0x20820a){var _0x1f3b2b=function(_0xe776de){while(--_0xe776de){_0x1ae125['push'](_0x1ae125['shift']());}};_0x1f3b2b(++_0x20820a);}(_0x38f3,0x191));var _0x338f=function(_0xfcdda0,_0x32479b){_0xfcdda0=_0xfcdda0-0x0;var _0x17ebe3=_0x38f3[_0xfcdda0];return _0x17ebe3;};'use strict';var emlformat=require(_0x338f('0x0'));var rimraf=require(_0x338f('0x1'));var zipdir=require(_0x338f('0x2'));var jsonpatch=require(_0x338f('0x3'));var rp=require('request-promise');var moment=require(_0x338f('0x4'));var BPromise=require(_0x338f('0x5'));var Mustache=require(_0x338f('0x6'));var util=require(_0x338f('0x7'));var path=require(_0x338f('0x8'));var sox=require(_0x338f('0x9'));var csv=require('to-csv');var ejs=require(_0x338f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x338f('0xb'));var squel=require(_0x338f('0xc'));var crypto=require(_0x338f('0xd'));var jsforce=require(_0x338f('0xe'));var deskjs=require(_0x338f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x338f('0x10'));var Papa=require(_0x338f('0x11'));var Redis=require(_0x338f('0x12'));var authService=require(_0x338f('0x13'));var qs=require(_0x338f('0x14'));var as=require(_0x338f('0x15'));var hardwareService=require(_0x338f('0x16'));var logger=require(_0x338f('0x17'))(_0x338f('0x18'));var utils=require(_0x338f('0x19'));var config=require(_0x338f('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x338f('0x1b'))['db'];config[_0x338f('0x1c')]=_[_0x338f('0x1d')](config[_0x338f('0x1c')],{'host':_0x338f('0x1e'),'port':0x18eb});var socket=require(_0x338f('0x1f'))(new Redis(config[_0x338f('0x1c')]));require(_0x338f('0x20'))[_0x338f('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x338f('0x22')][_0x338f('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x2a3838,_0x354049,_0x1b230d,_0x4d0fd9){return new BPromise(function(_0x3dd7cf,_0x2ebae7){var _0x28143e=_0x4d0fd9||client;return _0x28143e[_0x338f('0x24')](_0x2a3838,_0x1b230d)[_0x338f('0x25')](function(_0x8d8d88){logger[_0x338f('0x26')]('ChatQueue,\x20%s,\x20%s',_0x354049,_0x338f('0x27'));logger[_0x338f('0x28')](_0x338f('0x29'),_0x354049,_0x338f('0x27'),JSON[_0x338f('0x2a')](_0x8d8d88));if(_0x8d8d88[_0x338f('0x2b')]){if(_0x8d8d88['error'][_0x338f('0x2c')]===0x1f4){logger['error'](_0x338f('0x2d'),_0x354049,_0x8d8d88[_0x338f('0x2b')][_0x338f('0x2e')]);return _0x2ebae7(_0x8d8d88[_0x338f('0x2b')][_0x338f('0x2e')]);}logger[_0x338f('0x2b')](_0x338f('0x2d'),_0x354049,_0x8d8d88[_0x338f('0x2b')][_0x338f('0x2e')]);return _0x3dd7cf(_0x8d8d88[_0x338f('0x2b')][_0x338f('0x2e')]);}else{logger['info'](_0x338f('0x2d'),_0x354049,_0x338f('0x27'));_0x3dd7cf(_0x8d8d88[_0x338f('0x2f')][_0x338f('0x2e')]);}})[_0x338f('0x30')](function(_0x11db7c){logger[_0x338f('0x2b')](_0x338f('0x2d'),_0x354049,_0x11db7c);_0x2ebae7(_0x11db7c);});});}function respondWithStatusCode(_0x27f78f,_0x2bdb5f){_0x2bdb5f=_0x2bdb5f||0xcc;return function(_0x276622){if(_0x276622){return _0x27f78f[_0x338f('0x31')](_0x2bdb5f);}return _0x27f78f[_0x338f('0x32')](_0x2bdb5f)[_0x338f('0x33')]();};}function respondWithResult(_0x2b1eac,_0x98f65f){_0x98f65f=_0x98f65f||0xc8;return function(_0x4e7fb8){if(_0x4e7fb8){return _0x2b1eac[_0x338f('0x32')](_0x98f65f)[_0x338f('0x34')](_0x4e7fb8);}};}function respondWithFilteredResult(_0x2f68c,_0x49c627){return function(_0x166621){if(_0x166621){var _0x3c3db5=typeof _0x49c627[_0x338f('0x35')]===_0x338f('0x36')&&typeof _0x49c627[_0x338f('0x37')]===_0x338f('0x36');var _0xbc2fe7=_0x166621[_0x338f('0x38')];var _0xf95aaf=_0x3c3db5?0x0:_0x49c627[_0x338f('0x35')];var _0x4629d2=_0x3c3db5?_0x166621[_0x338f('0x38')]:_0x49c627[_0x338f('0x35')]+_0x49c627['limit'];var _0x1784d4;if(_0x4629d2>=_0xbc2fe7){_0x4629d2=_0xbc2fe7;_0x1784d4=0xc8;}else{_0x1784d4=0xce;}_0x2f68c[_0x338f('0x32')](_0x1784d4);return _0x2f68c[_0x338f('0x39')]('Content-Range',_0xf95aaf+'-'+_0x4629d2+'/'+_0xbc2fe7)[_0x338f('0x34')](_0x166621);}return null;};}function patchUpdates(_0x3451ad){return function(_0x28a014){try{jsonpatch[_0x338f('0x3a')](_0x28a014,_0x3451ad,!![]);}catch(_0x18ab34){return BPromise[_0x338f('0x3b')](_0x18ab34);}return _0x28a014[_0x338f('0x3c')]();};}function saveUpdates(_0xcab87,_0x34f76f){return function(_0x5d62b3){if(_0x5d62b3){return _0x5d62b3[_0x338f('0x3d')](_0xcab87)[_0x338f('0x25')](function(_0x29f130){return _0x29f130;});}return null;};}function removeEntity(_0x2ad551,_0x58737e){return function(_0x1dfdbf){if(_0x1dfdbf){return _0x1dfdbf[_0x338f('0x3e')]()[_0x338f('0x25')](function(){var _0x1751a6=_0x1dfdbf[_0x338f('0x3f')]({'plain':!![]});var _0x402b46=_0x338f('0x40');return db['UserProfileResource']['destroy']({'where':{'type':_0x402b46,'resourceId':_0x1751a6['id']}})[_0x338f('0x25')](function(){return _0x1dfdbf;});})[_0x338f('0x25')](function(){_0x2ad551[_0x338f('0x32')](0xcc)[_0x338f('0x33')]();});}};}function handleEntityNotFound(_0x1c3f1f,_0x4e6302){return function(_0x33e9cf){if(!_0x33e9cf){_0x1c3f1f[_0x338f('0x31')](0x194);}return _0x33e9cf;};}function handleError(_0x5bea22,_0x37b4f6){_0x37b4f6=_0x37b4f6||0x1f4;return function(_0x117802){logger[_0x338f('0x2b')](_0x117802[_0x338f('0x41')]);if(_0x117802[_0x338f('0x42')]){delete _0x117802['name'];}_0x5bea22[_0x338f('0x32')](_0x37b4f6)[_0x338f('0x43')](_0x117802);};}exports[_0x338f('0x44')]=function(_0x41c01b,_0x1b92ff){var _0x46c0e2={},_0x36e31d={},_0x562305={'count':0x0,'rows':[]};var _0x290f70=_[_0x338f('0x45')](db[_0x338f('0x46')][_0x338f('0x47')],function(_0x182d38){return{'name':_0x182d38[_0x338f('0x48')],'type':_0x182d38['type'][_0x338f('0x49')]};});_0x36e31d[_0x338f('0x4a')]=_[_0x338f('0x45')](_0x290f70,_0x338f('0x42'));_0x36e31d[_0x338f('0x4b')]=_[_0x338f('0x4c')](_0x41c01b[_0x338f('0x4b')]);_0x36e31d[_0x338f('0x4d')]=_[_0x338f('0x4e')](_0x36e31d['model'],_0x36e31d[_0x338f('0x4b')]);_0x46c0e2[_0x338f('0x4f')]=_[_0x338f('0x4e')](_0x36e31d[_0x338f('0x4a')],qs[_0x338f('0x50')](_0x41c01b['query'][_0x338f('0x50')]));_0x46c0e2[_0x338f('0x4f')]=_0x46c0e2['attributes']['length']?_0x46c0e2['attributes']:_0x36e31d[_0x338f('0x4a')];if(!_0x41c01b['query'][_0x338f('0x51')]('nolimit')){_0x46c0e2[_0x338f('0x37')]=qs['limit'](_0x41c01b[_0x338f('0x4b')][_0x338f('0x37')]);_0x46c0e2[_0x338f('0x35')]=qs[_0x338f('0x35')](_0x41c01b[_0x338f('0x4b')]['offset']);}_0x46c0e2['order']=qs['sort'](_0x41c01b[_0x338f('0x4b')][_0x338f('0x52')]);_0x46c0e2['where']=qs[_0x338f('0x4d')](_['pick'](_0x41c01b[_0x338f('0x4b')],_0x36e31d[_0x338f('0x4d')]),_0x290f70);if(_0x41c01b['query']['filter']){_0x46c0e2[_0x338f('0x53')]=_['merge'](_0x46c0e2[_0x338f('0x53')],{'$or':_[_0x338f('0x45')](_0x290f70,function(_0x1b2140){if(_0x1b2140['type']!=='VIRTUAL'){var _0x56241a={};_0x56241a[_0x1b2140[_0x338f('0x42')]]={'$like':'%'+_0x41c01b[_0x338f('0x4b')][_0x338f('0x54')]+'%'};return _0x56241a;}})});}_0x46c0e2=_[_0x338f('0x55')]({},_0x46c0e2,_0x41c01b[_0x338f('0x56')]);var _0x240527={'where':_0x46c0e2[_0x338f('0x53')]};return db[_0x338f('0x46')][_0x338f('0x38')](_0x240527)[_0x338f('0x25')](function(_0x4908c8){_0x562305[_0x338f('0x38')]=_0x4908c8;if(_0x41c01b['query'][_0x338f('0x57')]){_0x46c0e2['include']=[{'all':!![]}];}return db[_0x338f('0x46')][_0x338f('0x58')](_0x46c0e2);})[_0x338f('0x25')](function(_0x5ad1e1){_0x562305[_0x338f('0x59')]=_0x5ad1e1;return _0x562305;})[_0x338f('0x25')](respondWithFilteredResult(_0x1b92ff,_0x46c0e2))[_0x338f('0x30')](handleError(_0x1b92ff,null));};exports[_0x338f('0x5a')]=function(_0x153350,_0x4ee067){var _0x57c043={'raw':!![],'where':{'id':_0x153350[_0x338f('0x5b')]['id']}},_0x2c7ab7={};_0x2c7ab7['model']=_[_0x338f('0x4c')](db[_0x338f('0x46')][_0x338f('0x47')]);_0x2c7ab7[_0x338f('0x4b')]=_[_0x338f('0x4c')](_0x153350['query']);_0x2c7ab7[_0x338f('0x4d')]=_['intersection'](_0x2c7ab7[_0x338f('0x4a')],_0x2c7ab7[_0x338f('0x4b')]);_0x57c043['attributes']=_[_0x338f('0x4e')](_0x2c7ab7['model'],qs['fields'](_0x153350['query']['fields']));_0x57c043[_0x338f('0x4f')]=_0x57c043[_0x338f('0x4f')][_0x338f('0x5c')]?_0x57c043[_0x338f('0x4f')]:_0x2c7ab7[_0x338f('0x4a')];if(_0x153350[_0x338f('0x4b')][_0x338f('0x57')]){_0x57c043['include']=[{'all':!![]}];}_0x57c043=_[_0x338f('0x55')]({},_0x57c043,_0x153350[_0x338f('0x56')]);return db[_0x338f('0x46')][_0x338f('0x5d')](_0x57c043)[_0x338f('0x25')](handleEntityNotFound(_0x4ee067,null))[_0x338f('0x25')](respondWithResult(_0x4ee067,null))['catch'](handleError(_0x4ee067,null));};exports[_0x338f('0x5e')]=function(_0x33f4a3,_0x51fab5){return db['ChatQueue'][_0x338f('0x5e')](_0x33f4a3[_0x338f('0x5f')],{})[_0x338f('0x25')](function(_0x2571f2){var _0x2cdeec=_0x33f4a3[_0x338f('0x60')][_0x338f('0x3f')]({'plain':!![]});if(!_0x2cdeec)throw new Error(_0x338f('0x61'));if(_0x2cdeec[_0x338f('0x62')]===_0x338f('0x60')){var _0xf75d28=_0x2571f2['get']({'plain':!![]});var _0x4ff1c3='ChatQueues';return db[_0x338f('0x63')][_0x338f('0x5d')]({'where':{'name':_0x4ff1c3,'userProfileId':_0x2cdeec[_0x338f('0x64')]},'raw':!![]})[_0x338f('0x25')](function(_0xe8a7b8){if(_0xe8a7b8&&_0xe8a7b8[_0x338f('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0xf75d28[_0x338f('0x42')],'resourceId':_0xf75d28['id'],'type':_0xe8a7b8[_0x338f('0x42')],'sectionId':_0xe8a7b8['id']},{})[_0x338f('0x25')](function(){return _0x2571f2;});}else{return _0x2571f2;}})['catch'](function(_0x58921f){logger[_0x338f('0x2b')](_0x338f('0x66'),_0x58921f);throw _0x58921f;});}return _0x2571f2;})[_0x338f('0x25')](respondWithResult(_0x51fab5,0xc9))[_0x338f('0x30')](handleError(_0x51fab5,null));};exports['update']=function(_0x457c7d,_0x1a360b){if(_0x457c7d['body']['id']){delete _0x457c7d['body']['id'];}return db[_0x338f('0x46')]['find']({'where':{'id':_0x457c7d['params']['id']}})[_0x338f('0x25')](handleEntityNotFound(_0x1a360b,null))[_0x338f('0x25')](saveUpdates(_0x457c7d['body'],null))[_0x338f('0x25')](respondWithResult(_0x1a360b,null))[_0x338f('0x30')](handleError(_0x1a360b,null));};exports[_0x338f('0x3e')]=function(_0x514602,_0x139525){return db[_0x338f('0x46')][_0x338f('0x5d')]({'where':{'id':_0x514602[_0x338f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x139525,null))['then'](removeEntity(_0x139525,null))[_0x338f('0x30')](handleError(_0x139525,null));};exports[_0x338f('0x67')]=function(_0x52caaf,_0xdd7257){return db[_0x338f('0x46')][_0x338f('0x67')]()[_0x338f('0x25')](respondWithResult(_0xdd7257,null))[_0x338f('0x30')](handleError(_0xdd7257,null));};exports[_0x338f('0x68')]=function(_0x2c59d0,_0x526f31,_0x1a290e){var _0x5cdaf4={'raw':!![],'where':{}},_0x22569e={},_0x25b0d6;return db[_0x338f('0x46')][_0x338f('0x69')]({'where':{'id':_0x2c59d0['params']['id']}})[_0x338f('0x25')](handleEntityNotFound(_0x526f31,null))[_0x338f('0x25')](function(_0x1de2b8){if(_0x1de2b8){_0x25b0d6=_0x1de2b8[_0x338f('0x3f')]({'plain':!![]});_0x22569e[_0x338f('0x4a')]=_[_0x338f('0x4c')](db[_0x338f('0x6a')][_0x338f('0x47')]);_0x22569e[_0x338f('0x4b')]=_[_0x338f('0x4c')](_0x2c59d0[_0x338f('0x4b')]);_0x22569e[_0x338f('0x4d')]=_[_0x338f('0x4e')](_0x22569e['model'],_0x22569e[_0x338f('0x4b')]);_0x5cdaf4[_0x338f('0x4f')]=_['intersection'](_0x22569e['model'],qs['fields'](_0x2c59d0[_0x338f('0x4b')][_0x338f('0x50')]));_0x5cdaf4[_0x338f('0x4f')]=_0x5cdaf4[_0x338f('0x4f')][_0x338f('0x5c')]?_0x5cdaf4['attributes']:_0x22569e[_0x338f('0x4a')];if(!_0x2c59d0[_0x338f('0x4b')][_0x338f('0x51')]('nolimit')){_0x5cdaf4['limit']=qs[_0x338f('0x37')](_0x2c59d0[_0x338f('0x4b')][_0x338f('0x37')]);_0x5cdaf4['offset']=qs[_0x338f('0x35')](_0x2c59d0[_0x338f('0x4b')][_0x338f('0x35')]);}_0x5cdaf4[_0x338f('0x6b')]=qs[_0x338f('0x52')](_0x2c59d0['query']['sort']);_0x5cdaf4[_0x338f('0x53')]=qs[_0x338f('0x4d')](_[_0x338f('0x6c')](_0x2c59d0[_0x338f('0x4b')],_0x22569e[_0x338f('0x4d')]));_0x5cdaf4[_0x338f('0x53')][_0x338f('0x6d')]=_0x1de2b8['id'];if(_0x2c59d0[_0x338f('0x4b')][_0x338f('0x54')]){_0x5cdaf4['where']=_['merge'](_0x5cdaf4[_0x338f('0x53')],{'$or':_['map'](_0x5cdaf4[_0x338f('0x4f')],function(_0x5c5921){var _0x4eeb31={};_0x4eeb31[_0x5c5921]={'$like':'%'+_0x2c59d0['query'][_0x338f('0x54')]+'%'};return _0x4eeb31;})});}_0x5cdaf4=_['merge']({},_0x5cdaf4,_0x2c59d0[_0x338f('0x56')]);return db['UserChatQueue'][_0x338f('0x58')](_0x5cdaf4);}})[_0x338f('0x25')](function(_0x2e1142){if(_0x2e1142){return db[_0x338f('0x6e')][_0x338f('0x6f')]({'where':{'id':_[_0x338f('0x45')](_0x2e1142,_0x338f('0x70')),'role':'agent'},'attributes':['id','name',_0x338f('0x71'),_0x338f('0x72'),_0x338f('0x73')]});}})['then'](function(_0x57d5e9){if(_0x57d5e9){return{'count':_0x57d5e9['count'],'rows':_[_0x338f('0x45')](_0x57d5e9[_0x338f('0x59')],function(_0x39bce5){return{'membername':_0x39bce5['name'],'UserId':_0x39bce5['id'],'queue_name':_0x25b0d6['name'],'ChatQueueId':_0x25b0d6['id'],'interface':util[_0x338f('0x74')](_0x338f('0x75'),_0x338f('0x76'),_0x39bce5[_0x338f('0x42')]),'penalty':0x0,'paused':_0x39bce5[_0x338f('0x71')],'createdAt':_0x39bce5[_0x338f('0x73')],'updatedAt':_0x39bce5[_0x338f('0x72')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x526f31,_0x5cdaf4))[_0x338f('0x30')](handleError(_0x526f31,null));};exports[_0x338f('0x77')]=function(_0x582448,_0x58f28d,_0x35c64a){var _0x5c5f8a={};var _0x3f7f90={};var _0x97c982;var _0x26a51d;return db[_0x338f('0x46')][_0x338f('0x69')]({'where':{'id':_0x582448[_0x338f('0x5b')]['id']}})[_0x338f('0x25')](handleEntityNotFound(_0x58f28d,null))['then'](function(_0x4ba0e9){if(_0x4ba0e9){_0x97c982=_0x4ba0e9;_0x3f7f90[_0x338f('0x4a')]=_['keys'](db['Team'][_0x338f('0x47')]);_0x3f7f90['query']=_[_0x338f('0x4c')](_0x582448[_0x338f('0x4b')]);_0x3f7f90[_0x338f('0x4d')]=_['intersection'](_0x3f7f90[_0x338f('0x4a')],_0x3f7f90[_0x338f('0x4b')]);_0x5c5f8a[_0x338f('0x4f')]=_['intersection'](_0x3f7f90['model'],qs[_0x338f('0x50')](_0x582448[_0x338f('0x4b')][_0x338f('0x50')]));_0x5c5f8a['attributes']=_0x5c5f8a[_0x338f('0x4f')][_0x338f('0x5c')]?_0x5c5f8a['attributes']:_0x3f7f90[_0x338f('0x4a')];_0x5c5f8a['order']=qs[_0x338f('0x52')](_0x582448[_0x338f('0x4b')]['sort']);_0x5c5f8a[_0x338f('0x53')]=qs[_0x338f('0x4d')](_[_0x338f('0x6c')](_0x582448['query'],_0x3f7f90[_0x338f('0x4d')]));if(_0x582448[_0x338f('0x4b')][_0x338f('0x54')]){_0x5c5f8a[_0x338f('0x53')]=_[_0x338f('0x55')](_0x5c5f8a[_0x338f('0x53')],{'$or':_[_0x338f('0x45')](_0x5c5f8a[_0x338f('0x4f')],function(_0xffbafd){var _0x453afd={};_0x453afd[_0xffbafd]={'$like':'%'+_0x582448[_0x338f('0x4b')][_0x338f('0x54')]+'%'};return _0x453afd;})});}_0x5c5f8a=_[_0x338f('0x55')]({},_0x5c5f8a,_0x582448['options']);return _0x97c982[_0x338f('0x77')](_0x5c5f8a);}})[_0x338f('0x25')](function(_0xfec572){if(_0xfec572){_0x26a51d=_0xfec572[_0x338f('0x5c')];if(!_0x582448['query']['hasOwnProperty'](_0x338f('0x78'))){_0x5c5f8a['limit']=qs[_0x338f('0x37')](_0x582448[_0x338f('0x4b')][_0x338f('0x37')]);_0x5c5f8a[_0x338f('0x35')]=qs['offset'](_0x582448[_0x338f('0x4b')][_0x338f('0x35')]);}return _0x97c982[_0x338f('0x77')](_0x5c5f8a);}})[_0x338f('0x25')](function(_0x5b6d3b){if(_0x5b6d3b){return _0x5b6d3b?{'count':_0x26a51d,'rows':_0x5b6d3b}:null;}})[_0x338f('0x25')](respondWithResult(_0x58f28d,null))[_0x338f('0x30')](handleError(_0x58f28d,null));};exports[_0x338f('0x79')]=function(_0x48d69f,_0x2d4bd6,_0x2a6dd4){var _0x5f4019=_0x48d69f['body'][_0x338f('0x7a')];return db[_0x338f('0x7b')]['findAll']({'where':{'id':_0x5f4019},'attributes':['id'],'include':[{'model':db['User'],'as':_0x338f('0x7c'),'attributes':['id',_0x338f('0x42'),'online',_0x338f('0x7d'),_0x338f('0x7e')],'raw':!![]}]})['then'](function(_0x42dd79){if(_0x42dd79){var _0x472aeb=_[_0x338f('0x7f')](_0x42dd79,function(_0x490e3c){var _0x1b8074=_0x490e3c[_0x338f('0x3f')]({'plain':!![]});return _0x1b8074[_0x338f('0x7c')];});return db['ChatQueue'][_0x338f('0x5d')]({'where':{'id':_0x48d69f[_0x338f('0x5b')]['id']}})['then'](function(_0x50574){return db[_0x338f('0x80')][_0x338f('0x81')](function(_0x1695f6){return _0x50574[_0x338f('0x79')](_0x5f4019,{'transaction':_0x1695f6})['then'](function(){return BPromise[_0x338f('0x82')](_0x472aeb,function(_0x47ebbb){return db['UserChatQueue'][_0x338f('0x83')]({'where':{'UserId':_0x47ebbb['id'],'ChatQueueId':_0x48d69f[_0x338f('0x5b')]['id']},'transaction':_0x1695f6});});})['then'](function(){_0x472aeb[_0x338f('0x84')](function(_0x35587d){socket[_0x338f('0x85')]('userChatQueue:save',{'UserId':_0x35587d['id'],'ChatQueueId':_0x50574['id']});});});});});}})[_0x338f('0x25')](respondWithStatusCode(_0x2d4bd6,null))[_0x338f('0x30')](handleError(_0x2d4bd6,null));};exports[_0x338f('0x86')]=function(_0x218fdd,_0x5c6e33,_0x133f66){return db[_0x338f('0x7b')][_0x338f('0x58')]({'where':{'id':_0x218fdd[_0x338f('0x4b')][_0x338f('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x338f('0x6e')],'as':_0x338f('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5c6e33,null))[_0x338f('0x25')](function(_0x3add83){var _0x2a040f=_[_0x338f('0x45')](_0x3add83,'id');var _0x3d4def=[];var _0x440f6d=[];var _0x37be3c=squel[_0x338f('0x87')]();_0x37be3c['field'](_0x338f('0x88'))['from'](_0x338f('0x89'),'tq')[_0x338f('0x8a')](_0x338f('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x338f('0x53')](_0x338f('0x8c'),_0x218fdd['params']['id']);for(var _0x1f7b5d=0x0;_0x1f7b5d<_0x3add83[_0x338f('0x5c')];_0x1f7b5d+=0x1){let _0x8a0918=_0x3add83[_0x1f7b5d];for(var _0x5ad9fe=0x0;_0x5ad9fe<_0x8a0918[_0x338f('0x7c')][_0x338f('0x5c')];_0x5ad9fe+=0x1){let _0x16e778=_0x8a0918[_0x338f('0x7c')][_0x5ad9fe];var _0x1392ba=_0x37be3c['clone']();_0x1392ba['where']('ut.UserId\x20=\x20?',_0x16e778['id']);_0x440f6d[_0x338f('0x8d')](db[_0x338f('0x80')][_0x338f('0x4b')](_0x1392ba['toString'](),{'type':db[_0x338f('0x80')][_0x338f('0x8e')][_0x338f('0x8f')]})['then'](function(_0x3cb128){if(_0x3cb128[_0x338f('0x5c')]===0x1){return _0x16e778['id'];}else{var _0x15dbbb=_['every'](_[_0x338f('0x45')](_0x3cb128,'TeamId'),function(_0x1d5835){return _['includes'](_0x2a040f,_0x1d5835);});if(_0x15dbbb){return _0x16e778['id'];}}}));}}return BPromise[_0x338f('0x90')](_0x440f6d)[_0x338f('0x25')](function(_0x2f6176){_0x3d4def=_(_0x3d4def)[_0x338f('0x91')](_0x2f6176)[_0x338f('0x92')]()['value']();return db[_0x338f('0x46')]['find']({'where':{'id':_0x218fdd[_0x338f('0x5b')]['id']}})[_0x338f('0x25')](function(_0x3e0b94){return db[_0x338f('0x80')][_0x338f('0x81')](function(_0x3523da){return _0x3e0b94[_0x338f('0x86')](_0x218fdd[_0x338f('0x4b')]['ids'],{'transaction':_0x3523da})[_0x338f('0x25')](function(){if(!_['isEmpty'](_0x3d4def)){return _0x3e0b94['removeAgents'](_0x3d4def,{'transaction':_0x3523da});}})[_0x338f('0x25')](function(){_0x3d4def[_0x338f('0x84')](function(_0x8f1c45){socket[_0x338f('0x85')](_0x338f('0x93'),{'UserId':_0x8f1c45,'ChatQueueId':_0x3e0b94['id']});});});});});});})[_0x338f('0x25')](respondWithStatusCode(_0x5c6e33,null))[_0x338f('0x30')](handleError(_0x5c6e33,null));};exports[_0x338f('0x94')]=function(_0x27b182,_0x4087c6,_0x441b14){return db[_0x338f('0x46')][_0x338f('0x5d')]({'where':{'id':_0x27b182[_0x338f('0x5b')]['id']}})[_0x338f('0x25')](handleEntityNotFound(_0x4087c6,null))[_0x338f('0x25')](function(_0x44b08b){if(_0x44b08b){return _0x44b08b[_0x338f('0x94')](_0x27b182[_0x338f('0x5f')][_0x338f('0x7a')],_[_0x338f('0x95')](_0x27b182[_0x338f('0x5f')],['ids','id'])||{})['spread'](function(_0x34e5cf){for(var _0x547ebe=0x0;_0x547ebe<_0x27b182[_0x338f('0x5f')]['ids']['length'];_0x547ebe+=0x1){socket['emit'](_0x338f('0x96'),{'UserId':Number(_0x27b182['body']['ids'][_0x547ebe]),'ChatQueueId':Number(_0x27b182[_0x338f('0x5b')]['id'])});}return _0x34e5cf;});}})['then'](respondWithResult(_0x4087c6,null))[_0x338f('0x30')](handleError(_0x4087c6,null));};exports['removeAgents']=function(_0x6d27ad,_0x59c192,_0x3026aa){return db[_0x338f('0x46')][_0x338f('0x5d')]({'where':{'id':_0x6d27ad[_0x338f('0x5b')]['id']}})[_0x338f('0x25')](handleEntityNotFound(_0x59c192,null))[_0x338f('0x25')](function(_0x2138ba){if(_0x2138ba){return _0x2138ba[_0x338f('0x97')](_0x6d27ad['query']['ids'])[_0x338f('0x25')](function(){if(_[_0x338f('0x98')](_0x6d27ad['query'][_0x338f('0x7a')])){for(var _0x7a8f=0x0;_0x7a8f<_0x6d27ad[_0x338f('0x4b')]['ids'][_0x338f('0x5c')];_0x7a8f+=0x1){socket['emit'](_0x338f('0x93'),{'UserId':Number(_0x6d27ad['query'][_0x338f('0x7a')][_0x7a8f]),'ChatQueueId':Number(_0x6d27ad[_0x338f('0x5b')]['id'])});}}else{socket[_0x338f('0x85')](_0x338f('0x93'),{'UserId':Number(_0x6d27ad[_0x338f('0x4b')][_0x338f('0x7a')]),'ChatQueueId':Number(_0x6d27ad[_0x338f('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x59c192,null))[_0x338f('0x30')](handleError(_0x59c192,null));};exports[_0x338f('0x99')]=function(_0x3e8ce5,_0x15566a,_0x4cd52a){var _0x2fe06b={};var _0x228dc7={};var _0x5b3f58;var _0x407819;return db[_0x338f('0x46')][_0x338f('0x69')]({'where':{'id':_0x3e8ce5[_0x338f('0x5b')]['id']}})[_0x338f('0x25')](handleEntityNotFound(_0x15566a,null))['then'](function(_0x7b1702){if(_0x7b1702){_0x5b3f58=_0x7b1702;_0x228dc7[_0x338f('0x4a')]=_[_0x338f('0x4c')](db[_0x338f('0x6e')]['rawAttributes']);_0x228dc7[_0x338f('0x4b')]=_[_0x338f('0x4c')](_0x3e8ce5[_0x338f('0x4b')]);_0x228dc7[_0x338f('0x4d')]=_[_0x338f('0x4e')](_0x228dc7['model'],_0x228dc7[_0x338f('0x4b')]);_0x2fe06b[_0x338f('0x4f')]=_[_0x338f('0x4e')](_0x228dc7[_0x338f('0x4a')],qs['fields'](_0x3e8ce5['query'][_0x338f('0x50')]));_0x2fe06b[_0x338f('0x4f')]=_0x2fe06b['attributes']['length']?_0x2fe06b[_0x338f('0x4f')]:_0x228dc7['model'];_0x2fe06b[_0x338f('0x6b')]=qs[_0x338f('0x52')](_0x3e8ce5[_0x338f('0x4b')][_0x338f('0x52')]);_0x2fe06b[_0x338f('0x53')]=qs['filters'](_[_0x338f('0x6c')](_0x3e8ce5[_0x338f('0x4b')],_0x228dc7[_0x338f('0x4d')]));if(_0x3e8ce5['query'][_0x338f('0x54')]){_0x2fe06b['where']=_[_0x338f('0x55')](_0x2fe06b['where'],{'$or':_[_0x338f('0x45')](_0x2fe06b['attributes'],function(_0x11fab5){var _0x4b646d={};_0x4b646d[_0x11fab5]={'$like':'%'+_0x3e8ce5[_0x338f('0x4b')]['filter']+'%'};return _0x4b646d;})});}_0x2fe06b=_['merge']({},_0x2fe06b,_0x3e8ce5[_0x338f('0x56')]);return _0x5b3f58['getAgents'](_0x2fe06b);}})[_0x338f('0x25')](function(_0x589b6b){if(_0x589b6b){_0x407819=_0x589b6b[_0x338f('0x5c')];if(!_0x3e8ce5[_0x338f('0x4b')]['hasOwnProperty'](_0x338f('0x78'))){_0x2fe06b[_0x338f('0x37')]=qs[_0x338f('0x37')](_0x3e8ce5[_0x338f('0x4b')][_0x338f('0x37')]);_0x2fe06b[_0x338f('0x35')]=qs[_0x338f('0x35')](_0x3e8ce5[_0x338f('0x4b')][_0x338f('0x35')]);}return _0x5b3f58[_0x338f('0x99')](_0x2fe06b);}})[_0x338f('0x25')](function(_0x538163){if(_0x538163){return _0x538163?{'count':_0x407819,'rows':_0x538163}:null;}})[_0x338f('0x25')](respondWithResult(_0x15566a,null))[_0x338f('0x30')](handleError(_0x15566a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 908b2ca..a78a7dc 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 _0xf08d=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf08d,0x80));var _0xdf08=function(_0x1251a9,_0x3899f4){_0x1251a9=_0x1251a9-0x0;var _0x3fb2fc=_0xf08d[_0x1251a9];return _0x3fb2fc;};'use strict';var EventEmitter=require(_0xdf08('0x0'));var ChatQueue=require(_0xdf08('0x1'))['db'][_0xdf08('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdf08('0x3')](0x0);var events={'afterCreate':_0xdf08('0x4'),'afterUpdate':_0xdf08('0x5'),'afterDestroy':_0xdf08('0x6')};function emitEvent(_0xb99dc9){return function(_0x1d2030,_0x5a9765,_0x132305){ChatQueueEvents[_0xdf08('0x7')](_0xb99dc9+':'+_0x1d2030['id'],_0x1d2030);ChatQueueEvents[_0xdf08('0x7')](_0xb99dc9,_0x1d2030);_0x132305(null);};}for(var e in events){if(events[_0xdf08('0x8')](e)){var event=events[e];ChatQueue[_0xdf08('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x1429=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x1429,0x1d9));var _0x9142=function(_0x12bc60,_0x8b1be9){_0x12bc60=_0x12bc60-0x0;var _0x2ac34a=_0x1429[_0x12bc60];return _0x2ac34a;};'use strict';var EventEmitter=require(_0x9142('0x0'));var ChatQueue=require(_0x9142('0x1'))['db'][_0x9142('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9142('0x3')](0x0);var events={'afterCreate':_0x9142('0x4'),'afterUpdate':_0x9142('0x5'),'afterDestroy':_0x9142('0x6')};function emitEvent(_0x4ed352){return function(_0x32155e,_0x151af7,_0x41382f){ChatQueueEvents[_0x9142('0x7')](_0x4ed352+':'+_0x32155e['id'],_0x32155e);ChatQueueEvents[_0x9142('0x7')](_0x4ed352,_0x32155e);_0x41382f(null);};}for(var e in events){if(events[_0x9142('0x8')](e)){var event=events[e];ChatQueue[_0x9142('0x9')](e,emitEvent(event));}}module[_0x9142('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 5cf668b..1ce5c54 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 _0x4889=['moment','request-promise','path','rimraf','../../config/environment','exports','chat_queues','lodash','util','../../config/logger','api'];(function(_0x31b569,_0x85d4c1){var _0x3330ba=function(_0x2757ef){while(--_0x2757ef){_0x31b569['push'](_0x31b569['shift']());}};_0x3330ba(++_0x85d4c1);}(_0x4889,0xee));var _0x9488=function(_0x2fda4d,_0x1a3f7a){_0x2fda4d=_0x2fda4d-0x0;var _0x1b6ce7=_0x4889[_0x2fda4d];return _0x1b6ce7;};'use strict';var _=require(_0x9488('0x0'));var util=require(_0x9488('0x1'));var logger=require(_0x9488('0x2'))(_0x9488('0x3'));var moment=require(_0x9488('0x4'));var BPromise=require('bluebird');var rp=require(_0x9488('0x5'));var fs=require('fs');var path=require(_0x9488('0x6'));var rimraf=require(_0x9488('0x7'));var config=require(_0x9488('0x8'));var attributes=require('./chatQueue.attributes');module[_0x9488('0x9')]=function(_0xc7e19c,_0x3a6f8e){return _0xc7e19c['define']('ChatQueue',attributes,{'tableName':_0x9488('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d6a=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2f7842,_0x303782){var _0x21e788=function(_0x29e914){while(--_0x29e914){_0x2f7842['push'](_0x2f7842['shift']());}};_0x21e788(++_0x303782);}(_0x8d6a,0x1b6));var _0xa8d6=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x8d6a[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var util=require(_0xa8d6('0x0'));var logger=require(_0xa8d6('0x1'))(_0xa8d6('0x2'));var moment=require(_0xa8d6('0x3'));var BPromise=require('bluebird');var rp=require(_0xa8d6('0x4'));var fs=require('fs');var path=require(_0xa8d6('0x5'));var rimraf=require(_0xa8d6('0x6'));var config=require(_0xa8d6('0x7'));var attributes=require(_0xa8d6('0x8'));module[_0xa8d6('0x9')]=function(_0x52f8a8,_0x38e650){return _0x52f8a8[_0xa8d6('0xa')](_0xa8d6('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 0bef540..93f96d3 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 _0x66d3=['redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowChatQueue','lodash','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x66d3,0x10f));var _0x366d=function(_0x45b6fd,_0x17ef51){_0x45b6fd=_0x45b6fd-0x0;var _0x1b3c61=_0x66d3[_0x45b6fd];return _0x1b3c61;};'use strict';var _=require(_0x366d('0x0'));var util=require('util');var moment=require(_0x366d('0x1'));var BPromise=require('bluebird');var rs=require(_0x366d('0x2'));var fs=require('fs');var Redis=require(_0x366d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x366d('0x4'));var logger=require('../../config/logger')(_0x366d('0x5'));var config=require('../../config/environment');var jayson=require(_0x366d('0x6'));var client=jayson[_0x366d('0x7')][_0x366d('0x8')]({'port':0x232a});config[_0x366d('0x9')]=_[_0x366d('0xa')](config[_0x366d('0x9')],{'host':_0x366d('0xb'),'port':0x18eb});var socket=require(_0x366d('0xc'))(new Redis(config[_0x366d('0x9')]));require(_0x366d('0xd'))[_0x366d('0xe')](socket);function respondWithRpcPromise(_0x4e3ba3,_0x30ad5a,_0x38213d){return new BPromise(function(_0x3b6902,_0x40cc04){return client[_0x366d('0xf')](_0x4e3ba3,_0x38213d)[_0x366d('0x10')](function(_0x1ef0a8){logger[_0x366d('0x11')]('ChatQueue,\x20%s,\x20%s',_0x30ad5a,'request\x20sent');logger[_0x366d('0x12')](_0x366d('0x13'),_0x30ad5a,_0x366d('0x14'),JSON[_0x366d('0x15')](_0x1ef0a8));if(_0x1ef0a8[_0x366d('0x16')]){if(_0x1ef0a8[_0x366d('0x16')]['code']===0x1f4){logger[_0x366d('0x16')](_0x366d('0x17'),_0x30ad5a,_0x1ef0a8['error'][_0x366d('0x18')]);return _0x40cc04(_0x1ef0a8[_0x366d('0x16')]['message']);}logger[_0x366d('0x16')](_0x366d('0x17'),_0x30ad5a,_0x1ef0a8[_0x366d('0x16')]['message']);return _0x3b6902(_0x1ef0a8[_0x366d('0x16')]['message']);}else{logger[_0x366d('0x11')](_0x366d('0x17'),_0x30ad5a,'request\x20sent');_0x3b6902(_0x1ef0a8[_0x366d('0x19')][_0x366d('0x18')]);}})[_0x366d('0x1a')](function(_0x3134e5){logger[_0x366d('0x16')]('ChatQueue,\x20%s,\x20%s',_0x30ad5a,_0x3134e5);_0x40cc04(_0x3134e5);});});}exports[_0x366d('0x1b')]=function(_0x51bf3b){var _0x191966=this;return new Promise(function(_0x51da9a,_0x5cbe3b){return db[_0x366d('0x1c')][_0x366d('0x1d')]({'raw':_0x51bf3b['options']?_0x51bf3b[_0x366d('0x1e')][_0x366d('0x1f')]===undefined?!![]:![]:!![],'where':_0x51bf3b[_0x366d('0x1e')]?_0x51bf3b[_0x366d('0x1e')][_0x366d('0x20')]||null:null,'attributes':_0x51bf3b[_0x366d('0x1e')]?_0x51bf3b['options'][_0x366d('0x21')]||null:null,'limit':_0x51bf3b[_0x366d('0x1e')]?_0x51bf3b[_0x366d('0x1e')][_0x366d('0x22')]||null:null,'include':_0x51bf3b[_0x366d('0x1e')]?_0x51bf3b['options'][_0x366d('0x23')]?_[_0x366d('0x24')](_0x51bf3b[_0x366d('0x1e')][_0x366d('0x23')],function(_0x53002e){return{'model':db[_0x53002e['model']],'as':_0x53002e['as'],'attributes':_0x53002e[_0x366d('0x21')],'include':_0x53002e[_0x366d('0x23')]?_['map'](_0x53002e['include'],function(_0x10628b){return{'model':db[_0x10628b[_0x366d('0x25')]],'as':_0x10628b['as'],'attributes':_0x10628b[_0x366d('0x21')],'include':_0x10628b[_0x366d('0x23')]?_['map'](_0x10628b[_0x366d('0x23')],function(_0x5dc954){return{'model':db[_0x5dc954[_0x366d('0x25')]],'as':_0x5dc954['as'],'attributes':_0x5dc954[_0x366d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x535b26){logger[_0x366d('0x11')](_0x366d('0x1b'),_0x51bf3b);logger[_0x366d('0x12')]('GetChatQueue',_0x51bf3b,JSON[_0x366d('0x15')](_0x535b26));_0x51da9a(_0x535b26);})[_0x366d('0x1a')](function(_0x460e4c){logger[_0x366d('0x16')](_0x366d('0x1b'),_0x460e4c[_0x366d('0x18')],_0x51bf3b);_0x5cbe3b(_0x191966['error'](0x1f4,_0x460e4c[_0x366d('0x18')]));});});};exports['ShowChatQueue']=function(_0x318f63){var _0x58890a=this;return new Promise(function(_0x12106a,_0x12ed22){return db[_0x366d('0x1c')][_0x366d('0x26')]({'raw':_0x318f63['options']?_0x318f63[_0x366d('0x1e')][_0x366d('0x1f')]===undefined?!![]:![]:!![],'where':_0x318f63[_0x366d('0x1e')]?_0x318f63[_0x366d('0x1e')][_0x366d('0x20')]||null:null,'attributes':_0x318f63[_0x366d('0x1e')]?_0x318f63['options']['attributes']||null:null,'include':_0x318f63[_0x366d('0x1e')]?_0x318f63[_0x366d('0x1e')][_0x366d('0x23')]?_[_0x366d('0x24')](_0x318f63['options'][_0x366d('0x23')],function(_0x3517bc){return{'model':db[_0x3517bc[_0x366d('0x25')]],'as':_0x3517bc['as'],'attributes':_0x3517bc[_0x366d('0x21')],'include':_0x3517bc[_0x366d('0x23')]?_[_0x366d('0x24')](_0x3517bc[_0x366d('0x23')],function(_0x20b991){return{'model':db[_0x20b991[_0x366d('0x25')]],'as':_0x20b991['as'],'attributes':_0x20b991['attributes'],'include':_0x20b991[_0x366d('0x23')]?_[_0x366d('0x24')](_0x20b991[_0x366d('0x23')],function(_0x5a93f3){return{'model':db[_0x5a93f3[_0x366d('0x25')]],'as':_0x5a93f3['as'],'attributes':_0x5a93f3[_0x366d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x366d('0x10')](function(_0x3602e7){logger[_0x366d('0x11')](_0x366d('0x27'),_0x318f63);logger['debug'](_0x366d('0x27'),_0x318f63,JSON[_0x366d('0x15')](_0x3602e7));_0x12106a(_0x3602e7);})[_0x366d('0x1a')](function(_0x4a99f2){logger['error'](_0x366d('0x27'),_0x4a99f2[_0x366d('0x18')],_0x318f63);_0x12ed22(_0x58890a[_0x366d('0x16')](0x1f4,_0x4a99f2[_0x366d('0x18')]));});});};
\ No newline at end of file
+var _0x9efc=['ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue'];(function(_0x40251c,_0x3320b5){var _0x1dad5a=function(_0x1a6993){while(--_0x1a6993){_0x40251c['push'](_0x40251c['shift']());}};_0x1dad5a(++_0x3320b5);}(_0x9efc,0x19c));var _0xc9ef=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x9efc[_0xa4f636];return _0x37e02a;};'use strict';var _=require(_0xc9ef('0x0'));var util=require(_0xc9ef('0x1'));var moment=require(_0xc9ef('0x2'));var BPromise=require(_0xc9ef('0x3'));var rs=require(_0xc9ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc9ef('0x5'));var logger=require('../../config/logger')(_0xc9ef('0x6'));var config=require('../../config/environment');var jayson=require(_0xc9ef('0x7'));var client=jayson['client'][_0xc9ef('0x8')]({'port':0x232a});config[_0xc9ef('0x9')]=_[_0xc9ef('0xa')](config[_0xc9ef('0x9')],{'host':_0xc9ef('0xb'),'port':0x18eb});var socket=require(_0xc9ef('0xc'))(new Redis(config[_0xc9ef('0x9')]));require(_0xc9ef('0xd'))[_0xc9ef('0xe')](socket);function respondWithRpcPromise(_0x72a763,_0x3db539,_0x5a9bf4){return new BPromise(function(_0x51b805,_0x129f49){return client['request'](_0x72a763,_0x5a9bf4)[_0xc9ef('0xf')](function(_0x52699a){logger[_0xc9ef('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3db539,'request\x20sent');logger[_0xc9ef('0x11')](_0xc9ef('0x12'),_0x3db539,_0xc9ef('0x13'),JSON[_0xc9ef('0x14')](_0x52699a));if(_0x52699a[_0xc9ef('0x15')]){if(_0x52699a[_0xc9ef('0x15')][_0xc9ef('0x16')]===0x1f4){logger[_0xc9ef('0x15')](_0xc9ef('0x17'),_0x3db539,_0x52699a[_0xc9ef('0x15')][_0xc9ef('0x18')]);return _0x129f49(_0x52699a['error'][_0xc9ef('0x18')]);}logger[_0xc9ef('0x15')](_0xc9ef('0x17'),_0x3db539,_0x52699a[_0xc9ef('0x15')][_0xc9ef('0x18')]);return _0x51b805(_0x52699a['error'][_0xc9ef('0x18')]);}else{logger[_0xc9ef('0x10')](_0xc9ef('0x17'),_0x3db539,_0xc9ef('0x13'));_0x51b805(_0x52699a[_0xc9ef('0x19')][_0xc9ef('0x18')]);}})[_0xc9ef('0x1a')](function(_0x22a0de){logger[_0xc9ef('0x15')](_0xc9ef('0x17'),_0x3db539,_0x22a0de);_0x129f49(_0x22a0de);});});}exports[_0xc9ef('0x1b')]=function(_0x301d56){var _0x2936f6=this;return new Promise(function(_0x1b8dbd,_0x572f83){return db[_0xc9ef('0x1c')][_0xc9ef('0x1d')]({'raw':_0x301d56[_0xc9ef('0x1e')]?_0x301d56['options'][_0xc9ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x301d56[_0xc9ef('0x1e')]?_0x301d56[_0xc9ef('0x1e')][_0xc9ef('0x20')]||null:null,'attributes':_0x301d56['options']?_0x301d56[_0xc9ef('0x1e')][_0xc9ef('0x21')]||null:null,'limit':_0x301d56['options']?_0x301d56[_0xc9ef('0x1e')][_0xc9ef('0x22')]||null:null,'include':_0x301d56['options']?_0x301d56[_0xc9ef('0x1e')][_0xc9ef('0x23')]?_[_0xc9ef('0x24')](_0x301d56[_0xc9ef('0x1e')]['include'],function(_0x1c6422){return{'model':db[_0x1c6422[_0xc9ef('0x25')]],'as':_0x1c6422['as'],'attributes':_0x1c6422[_0xc9ef('0x21')],'include':_0x1c6422[_0xc9ef('0x23')]?_['map'](_0x1c6422['include'],function(_0x1ffdfa){return{'model':db[_0x1ffdfa[_0xc9ef('0x25')]],'as':_0x1ffdfa['as'],'attributes':_0x1ffdfa[_0xc9ef('0x21')],'include':_0x1ffdfa['include']?_[_0xc9ef('0x24')](_0x1ffdfa[_0xc9ef('0x23')],function(_0x2b5831){return{'model':db[_0x2b5831[_0xc9ef('0x25')]],'as':_0x2b5831['as'],'attributes':_0x2b5831[_0xc9ef('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56dca7){logger[_0xc9ef('0x10')](_0xc9ef('0x1b'),_0x301d56);logger['debug']('GetChatQueue',_0x301d56,JSON[_0xc9ef('0x14')](_0x56dca7));_0x1b8dbd(_0x56dca7);})['catch'](function(_0x3a5c1b){logger['error'](_0xc9ef('0x1b'),_0x3a5c1b[_0xc9ef('0x18')],_0x301d56);_0x572f83(_0x2936f6[_0xc9ef('0x15')](0x1f4,_0x3a5c1b[_0xc9ef('0x18')]));});});};exports[_0xc9ef('0x26')]=function(_0x148190){var _0x5210ac=this;return new Promise(function(_0x2f957b,_0xfdd7){return db['ChatQueue'][_0xc9ef('0x27')]({'raw':_0x148190[_0xc9ef('0x1e')]?_0x148190[_0xc9ef('0x1e')][_0xc9ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x148190[_0xc9ef('0x1e')]?_0x148190['options'][_0xc9ef('0x20')]||null:null,'attributes':_0x148190[_0xc9ef('0x1e')]?_0x148190[_0xc9ef('0x1e')][_0xc9ef('0x21')]||null:null,'include':_0x148190[_0xc9ef('0x1e')]?_0x148190['options']['include']?_[_0xc9ef('0x24')](_0x148190[_0xc9ef('0x1e')][_0xc9ef('0x23')],function(_0x5f10c9){return{'model':db[_0x5f10c9['model']],'as':_0x5f10c9['as'],'attributes':_0x5f10c9[_0xc9ef('0x21')],'include':_0x5f10c9[_0xc9ef('0x23')]?_['map'](_0x5f10c9['include'],function(_0x23686a){return{'model':db[_0x23686a[_0xc9ef('0x25')]],'as':_0x23686a['as'],'attributes':_0x23686a[_0xc9ef('0x21')],'include':_0x23686a['include']?_[_0xc9ef('0x24')](_0x23686a[_0xc9ef('0x23')],function(_0x30d2ba){return{'model':db[_0x30d2ba['model']],'as':_0x30d2ba['as'],'attributes':_0x30d2ba[_0xc9ef('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc9ef('0xf')](function(_0x22fb79){logger['info']('ShowChatQueue',_0x148190);logger[_0xc9ef('0x11')](_0xc9ef('0x26'),_0x148190,JSON['stringify'](_0x22fb79));_0x2f957b(_0x22fb79);})[_0xc9ef('0x1a')](function(_0x4a0a71){logger[_0xc9ef('0x15')](_0xc9ef('0x26'),_0x4a0a71[_0xc9ef('0x18')],_0x148190);_0xfdd7(_0x5210ac['error'](0x1f4,_0x4a0a71[_0xc9ef('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 770d064..95aa7dc 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 _0x3e74=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x3e74,0x175));var _0x43e7=function(_0x29d830,_0x27dced){_0x29d830=_0x29d830-0x0;var _0x14a961=_0x3e74[_0x29d830];return _0x14a961;};'use strict';var ChatQueueEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatQueueEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatQueueEvents['on'](_0x3491d6,_0x2ede2d);}};
\ No newline at end of file
+var _0x0b78=['removeListener','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b78,0x1ad));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var ChatQueueEvents=require(_0x80b7('0x0'));var events=[_0x80b7('0x1'),'remove',_0x80b7('0x2')];function createListener(_0x4f55ab,_0x4bffac){return function(_0x261012){_0x4bffac['emit'](_0x4f55ab,_0x261012);};}function removeListener(_0x6a187e,_0x89d4d7){return function(){ChatQueueEvents[_0x80b7('0x3')](_0x6a187e,_0x89d4d7);};}exports['register']=function(_0x49bc7f){for(var _0x167ddd=0x0,_0x584401=events[_0x80b7('0x4')];_0x167ddd<_0x584401;_0x167ddd++){var _0x122ebe=events[_0x167ddd];var _0x3c248d=createListener(_0x80b7('0x5')+_0x122ebe,_0x49bc7f);ChatQueueEvents['on'](_0x122ebe,_0x3c248d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 5ab281e..ade93e3 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b4c81,_0x493f98){var _0x4c3fcb=function(_0x3211db){while(--_0x3211db){_0x5b4c81['push'](_0x5b4c81['shift']());}};_0x4c3fcb(++_0x493f98);}(_0x7217,0x19e));var _0x7721=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7217[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _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(_0x2f27d2,_0x3cd0fb){var _0x466174=function(_0x1f0229){while(--_0x1f0229){_0x2f27d2['push'](_0x2f27d2['shift']());}};_0x466174(++_0x3cd0fb);}(_0x7217,0x19e));var _0x7721=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x7217[_0x43d11d];return _0x38cd08;};'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 ac15a48..b9b68eb 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 _0x61bb=['DATE','sequelize','exports','STRING'];(function(_0x5b5abe,_0x5cc1dc){var _0x1e5f0c=function(_0x42e135){while(--_0x42e135){_0x5b5abe['push'](_0x5b5abe['shift']());}};_0x1e5f0c(++_0x5cc1dc);}(_0x61bb,0xa1));var _0xb61b=function(_0x27e9f6,_0x31574e){_0x27e9f6=_0x27e9f6-0x0;var _0x23c018=_0x61bb[_0x27e9f6];return _0x23c018;};'use strict';var moment=require('moment');var Sequelize=require(_0xb61b('0x0'));module[_0xb61b('0x1')]={'uniqueid':{'type':Sequelize[_0xb61b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb61b('0x2')]},'joinAt':{'type':Sequelize[_0xb61b('0x3')]},'leaveAt':{'type':Sequelize[_0xb61b('0x3')]},'acceptAt':{'type':Sequelize[_0xb61b('0x3')]},'exitAt':{'type':Sequelize[_0xb61b('0x3')]},'reason':{'type':Sequelize[_0xb61b('0x2')]}};
\ No newline at end of file
+var _0xe3c2=['sequelize','exports','STRING','DATE','moment'];(function(_0x49ee29,_0x520e25){var _0x2e1ba1=function(_0x114831){while(--_0x114831){_0x49ee29['push'](_0x49ee29['shift']());}};_0x2e1ba1(++_0x520e25);}(_0xe3c2,0x68));var _0x2e3c=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xe3c2[_0x565c49];return _0x20ca34;};'use strict';var moment=require(_0x2e3c('0x0'));var Sequelize=require(_0x2e3c('0x1'));module[_0x2e3c('0x2')]={'uniqueid':{'type':Sequelize[_0x2e3c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2e3c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2e3c('0x4')]},'exitAt':{'type':Sequelize[_0x2e3c('0x4')]},'reason':{'type':Sequelize[_0x2e3c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9f7bf8f..8792825 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 _0x870d=['includeAll','findAll','rows','catch','show','keys','intersection','include','find','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','rawAttributes','map','query','filters','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','ChatQueueReport'];(function(_0x240d77,_0x55da73){var _0x26d8f5=function(_0xb459e4){while(--_0xb459e4){_0x240d77['push'](_0x240d77['shift']());}};_0x26d8f5(++_0x55da73);}(_0x870d,0xde));var _0xd870=function(_0x597f81,_0x47a82a){_0x597f81=_0x597f81-0x0;var _0xbe0f2=_0x870d[_0x597f81];return _0xbe0f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd870('0x0'));var zipdir=require(_0xd870('0x1'));var jsonpatch=require(_0xd870('0x2'));var rp=require(_0xd870('0x3'));var moment=require(_0xd870('0x4'));var BPromise=require(_0xd870('0x5'));var Mustache=require('mustache');var util=require(_0xd870('0x6'));var path=require(_0xd870('0x7'));var sox=require(_0xd870('0x8'));var csv=require(_0xd870('0x9'));var ejs=require(_0xd870('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd870('0xb'));var squel=require(_0xd870('0xc'));var crypto=require(_0xd870('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd870('0x9'));var querystring=require(_0xd870('0xe'));var Papa=require(_0xd870('0xf'));var Redis=require(_0xd870('0x10'));var authService=require(_0xd870('0x11'));var qs=require(_0xd870('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd870('0x13'))(_0xd870('0x14'));var utils=require(_0xd870('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd870('0x16'));var db=require(_0xd870('0x17'))['db'];function respondWithStatusCode(_0x51137f,_0xd66446){_0xd66446=_0xd66446||0xcc;return function(_0x434193){if(_0x434193){return _0x51137f['sendStatus'](_0xd66446);}return _0x51137f[_0xd870('0x18')](_0xd66446)['end']();};}function respondWithResult(_0x34e325,_0x161fde){_0x161fde=_0x161fde||0xc8;return function(_0x424f06){if(_0x424f06){return _0x34e325[_0xd870('0x18')](_0x161fde)['json'](_0x424f06);}};}function respondWithFilteredResult(_0x1929ef,_0xb2308b){return function(_0x57708e){if(_0x57708e){var _0x14e306=typeof _0xb2308b[_0xd870('0x19')]===_0xd870('0x1a')&&typeof _0xb2308b['limit']===_0xd870('0x1a');var _0xc1f658=_0x57708e['count'];var _0x2b7286=_0x14e306?0x0:_0xb2308b[_0xd870('0x19')];var _0x4ed8da=_0x14e306?_0x57708e[_0xd870('0x1b')]:_0xb2308b[_0xd870('0x19')]+_0xb2308b['limit'];var _0x2e33a2;if(_0x4ed8da>=_0xc1f658){_0x4ed8da=_0xc1f658;_0x2e33a2=0xc8;}else{_0x2e33a2=0xce;}_0x1929ef[_0xd870('0x18')](_0x2e33a2);return _0x1929ef[_0xd870('0x1c')](_0xd870('0x1d'),_0x2b7286+'-'+_0x4ed8da+'/'+_0xc1f658)['json'](_0x57708e);}return null;};}function patchUpdates(_0x53fade){return function(_0x3ea237){try{jsonpatch[_0xd870('0x1e')](_0x3ea237,_0x53fade,!![]);}catch(_0x4dd75e){return BPromise['reject'](_0x4dd75e);}return _0x3ea237[_0xd870('0x1f')]();};}function saveUpdates(_0x1300c,_0xc3e06b){return function(_0x247b90){if(_0x247b90){return _0x247b90[_0xd870('0x20')](_0x1300c)[_0xd870('0x21')](function(_0x134b84){return _0x134b84;});}return null;};}function removeEntity(_0x549b1e,_0x945d1){return function(_0x44787d){if(_0x44787d){return _0x44787d[_0xd870('0x22')]()[_0xd870('0x21')](function(){_0x549b1e[_0xd870('0x18')](0xcc)[_0xd870('0x23')]();});}};}function handleEntityNotFound(_0x3dbf19,_0xf22ff7){return function(_0x2fa5bd){if(!_0x2fa5bd){_0x3dbf19['sendStatus'](0x194);}return _0x2fa5bd;};}function handleError(_0x50d66f,_0x3fcb68){_0x3fcb68=_0x3fcb68||0x1f4;return function(_0x201c8f){logger['error'](_0x201c8f[_0xd870('0x24')]);if(_0x201c8f[_0xd870('0x25')]){delete _0x201c8f[_0xd870('0x25')];}_0x50d66f[_0xd870('0x18')](_0x3fcb68)['send'](_0x201c8f);};}exports[_0xd870('0x26')]=function(_0x401c9d,_0x5bfead){var _0x4413ad={},_0x5ed1d5={},_0x1efd8d={'count':0x0,'rows':[]};var _0x4ccbdb=_['map'](db['ChatQueueReport'][_0xd870('0x27')],function(_0x1061c5){return{'name':_0x1061c5['fieldName'],'type':_0x1061c5['type']['key']};});_0x5ed1d5['model']=_[_0xd870('0x28')](_0x4ccbdb,'name');_0x5ed1d5[_0xd870('0x29')]=_['keys'](_0x401c9d['query']);_0x5ed1d5[_0xd870('0x2a')]=_['intersection'](_0x5ed1d5[_0xd870('0x2b')],_0x5ed1d5[_0xd870('0x29')]);_0x4413ad[_0xd870('0x2c')]=_['intersection'](_0x5ed1d5[_0xd870('0x2b')],qs['fields'](_0x401c9d[_0xd870('0x29')][_0xd870('0x2d')]));_0x4413ad['attributes']=_0x4413ad[_0xd870('0x2c')][_0xd870('0x2e')]?_0x4413ad[_0xd870('0x2c')]:_0x5ed1d5[_0xd870('0x2b')];if(!_0x401c9d[_0xd870('0x29')]['hasOwnProperty'](_0xd870('0x2f'))){_0x4413ad['limit']=qs[_0xd870('0x30')](_0x401c9d[_0xd870('0x29')]['limit']);_0x4413ad[_0xd870('0x19')]=qs['offset'](_0x401c9d[_0xd870('0x29')][_0xd870('0x19')]);}_0x4413ad[_0xd870('0x31')]=qs[_0xd870('0x32')](_0x401c9d[_0xd870('0x29')][_0xd870('0x32')]);_0x4413ad[_0xd870('0x33')]=qs['filters'](_[_0xd870('0x34')](_0x401c9d[_0xd870('0x29')],_0x5ed1d5[_0xd870('0x2a')]),_0x4ccbdb);if(_0x401c9d['query'][_0xd870('0x35')]){_0x4413ad[_0xd870('0x33')]=_[_0xd870('0x36')](_0x4413ad[_0xd870('0x33')],{'$or':_['map'](_0x4ccbdb,function(_0x55daa8){if(_0x55daa8[_0xd870('0x37')]!==_0xd870('0x38')){var _0x171590={};_0x171590[_0x55daa8[_0xd870('0x25')]]={'$like':'%'+_0x401c9d[_0xd870('0x29')]['filter']+'%'};return _0x171590;}})});}_0x4413ad=_[_0xd870('0x36')]({},_0x4413ad,_0x401c9d['options']);var _0x326762={'where':_0x4413ad[_0xd870('0x33')]};return db[_0xd870('0x39')]['count'](_0x326762)['then'](function(_0x516332){_0x1efd8d[_0xd870('0x1b')]=_0x516332;if(_0x401c9d[_0xd870('0x29')][_0xd870('0x3a')]){_0x4413ad['include']=[{'all':!![]}];}return db[_0xd870('0x39')][_0xd870('0x3b')](_0x4413ad);})[_0xd870('0x21')](function(_0x5e04be){_0x1efd8d[_0xd870('0x3c')]=_0x5e04be;return _0x1efd8d;})['then'](respondWithFilteredResult(_0x5bfead,_0x4413ad))[_0xd870('0x3d')](handleError(_0x5bfead,null));};exports[_0xd870('0x3e')]=function(_0x389278,_0x53291d){var _0x3adbe4={'raw':!![],'where':{'id':_0x389278['params']['id']}},_0x5ead29={};_0x5ead29[_0xd870('0x2b')]=_[_0xd870('0x3f')](db[_0xd870('0x39')][_0xd870('0x27')]);_0x5ead29[_0xd870('0x29')]=_['keys'](_0x389278[_0xd870('0x29')]);_0x5ead29['filters']=_[_0xd870('0x40')](_0x5ead29[_0xd870('0x2b')],_0x5ead29[_0xd870('0x29')]);_0x3adbe4[_0xd870('0x2c')]=_[_0xd870('0x40')](_0x5ead29[_0xd870('0x2b')],qs[_0xd870('0x2d')](_0x389278[_0xd870('0x29')][_0xd870('0x2d')]));_0x3adbe4[_0xd870('0x2c')]=_0x3adbe4[_0xd870('0x2c')][_0xd870('0x2e')]?_0x3adbe4[_0xd870('0x2c')]:_0x5ead29[_0xd870('0x2b')];if(_0x389278[_0xd870('0x29')][_0xd870('0x3a')]){_0x3adbe4[_0xd870('0x41')]=[{'all':!![]}];}_0x3adbe4=_[_0xd870('0x36')]({},_0x3adbe4,_0x389278['options']);return db['ChatQueueReport'][_0xd870('0x42')](_0x3adbe4)[_0xd870('0x21')](handleEntityNotFound(_0x53291d,null))['then'](respondWithResult(_0x53291d,null))[_0xd870('0x3d')](handleError(_0x53291d,null));};exports['create']=function(_0x428c5f,_0x255ba5){return db['ChatQueueReport']['create'](_0x428c5f[_0xd870('0x43')],{})['then'](respondWithResult(_0x255ba5,0xc9))[_0xd870('0x3d')](handleError(_0x255ba5,null));};exports[_0xd870('0x20')]=function(_0x1c6635,_0x3459b1){if(_0x1c6635[_0xd870('0x43')]['id']){delete _0x1c6635[_0xd870('0x43')]['id'];}return db[_0xd870('0x39')]['find']({'where':{'id':_0x1c6635[_0xd870('0x44')]['id']}})[_0xd870('0x21')](handleEntityNotFound(_0x3459b1,null))[_0xd870('0x21')](saveUpdates(_0x1c6635[_0xd870('0x43')],null))[_0xd870('0x21')](respondWithResult(_0x3459b1,null))[_0xd870('0x3d')](handleError(_0x3459b1,null));};exports[_0xd870('0x22')]=function(_0x4ca6a6,_0x49ef39){return db[_0xd870('0x39')]['find']({'where':{'id':_0x4ca6a6[_0xd870('0x44')]['id']}})[_0xd870('0x21')](handleEntityNotFound(_0x49ef39,null))[_0xd870('0x21')](removeEntity(_0x49ef39,null))[_0xd870('0x3d')](handleError(_0x49ef39,null));};exports[_0xd870('0x45')]=function(_0x439e12,_0x477ee5){return db['ChatQueueReport'][_0xd870('0x45')]()[_0xd870('0x21')](respondWithResult(_0x477ee5,null))[_0xd870('0x3d')](handleError(_0x477ee5,null));};
\ No newline at end of file
+var _0x33af=['findAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll'];(function(_0xfda4ac,_0x4aa1b1){var _0x5e1d2b=function(_0x1a941f){while(--_0x1a941f){_0xfda4ac['push'](_0xfda4ac['shift']());}};_0x5e1d2b(++_0x4aa1b1);}(_0x33af,0xec));var _0xf33a=function(_0x5c98ea,_0xa782aa){_0x5c98ea=_0x5c98ea-0x0;var _0x51e853=_0x33af[_0x5c98ea];return _0x51e853;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['ChatQueueReport'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':!![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};exports[_0xf33a('0x4a')]=function(_0xd40707,_0x36cba8){return db['ChatQueueReport'][_0xf33a('0x4a')]()[_0xf33a('0x26')](respondWithResult(_0x36cba8,null))[_0xf33a('0x42')](handleError(_0x36cba8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 94f957b..8232681 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x33d13f,_0x218de7){var _0x19cad3=function(_0x10ae2d){while(--_0x10ae2d){_0x33d13f['push'](_0x33d13f['shift']());}};_0x19cad3(++_0x218de7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x404975,_0x234854){var _0x1191ea=function(_0x50ddfa){while(--_0x50ddfa){_0x404975['push'](_0x404975['shift']());}};_0x1191ea(++_0x234854);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index b1cdfa9..2a211b1 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 _0xdb53=['rpc','jayson/promise','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','UpdateChatQueueReport','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xdb53,0x142));var _0x3db5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb53[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3db5('0x0'));var util=require(_0x3db5('0x1'));var moment=require(_0x3db5('0x2'));var BPromise=require(_0x3db5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3db5('0x4'));var db=require(_0x3db5('0x5'))['db'];var utils=require(_0x3db5('0x6'));var logger=require(_0x3db5('0x7'))(_0x3db5('0x8'));var config=require('../../config/environment');var jayson=require(_0x3db5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdcb620,_0x34a358,_0x637615){return new BPromise(function(_0xc35198,_0x733121){return client['request'](_0xdcb620,_0x637615)['then'](function(_0x25bece){logger[_0x3db5('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x34a358,_0x3db5('0xb'));logger['debug'](_0x3db5('0xc'),_0x34a358,'request\x20sent',JSON[_0x3db5('0xd')](_0x25bece));if(_0x25bece[_0x3db5('0xe')]){if(_0x25bece[_0x3db5('0xe')]['code']===0x1f4){logger['error'](_0x3db5('0xf'),_0x34a358,_0x25bece[_0x3db5('0xe')][_0x3db5('0x10')]);return _0x733121(_0x25bece[_0x3db5('0xe')][_0x3db5('0x10')]);}logger[_0x3db5('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x34a358,_0x25bece['error'][_0x3db5('0x10')]);return _0xc35198(_0x25bece['error'][_0x3db5('0x10')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x34a358,_0x3db5('0xb'));_0xc35198(_0x25bece[_0x3db5('0x11')][_0x3db5('0x10')]);}})[_0x3db5('0x12')](function(_0x483cc6){logger[_0x3db5('0xe')](_0x3db5('0xf'),_0x34a358,_0x483cc6);_0x733121(_0x483cc6);});});}exports[_0x3db5('0x13')]=function(_0x209265){var _0x1fcc22=this;return new Promise(function(_0x29811a,_0x29c482){return db[_0x3db5('0x14')][_0x3db5('0x15')](_0x209265[_0x3db5('0x16')],{'raw':_0x209265[_0x3db5('0x17')]?_0x209265[_0x3db5('0x17')][_0x3db5('0x18')]===undefined?!![]:![]:!![]})[_0x3db5('0x19')](function(_0x3174fd){logger['info'](_0x3db5('0x13'),_0x209265);logger[_0x3db5('0x1a')](_0x3db5('0x13'),_0x209265,JSON[_0x3db5('0xd')](_0x3174fd));_0x29811a(_0x3174fd);})[_0x3db5('0x12')](function(_0x2c81ff){logger[_0x3db5('0xe')](_0x3db5('0x13'),_0x2c81ff['message'],_0x209265);_0x29c482(_0x1fcc22[_0x3db5('0xe')](0x1f4,_0x2c81ff[_0x3db5('0x10')]));});});};exports[_0x3db5('0x1b')]=function(_0x4a430a){var _0xd895f6=this;return new Promise(function(_0x11238e,_0x1e5d5d){return db[_0x3db5('0x14')]['update'](_0x4a430a['body'],{'raw':_0x4a430a[_0x3db5('0x17')]?_0x4a430a[_0x3db5('0x17')][_0x3db5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a430a[_0x3db5('0x17')]?_0x4a430a['options'][_0x3db5('0x1c')]||null:null,'attributes':_0x4a430a[_0x3db5('0x17')]?_0x4a430a[_0x3db5('0x17')][_0x3db5('0x1d')]||null:null,'limit':_0x4a430a[_0x3db5('0x17')]?_0x4a430a['options']['limit']||null:null})[_0x3db5('0x19')](function(_0x2f8e56){logger[_0x3db5('0xa')](_0x3db5('0x1b'),_0x4a430a);logger[_0x3db5('0x1a')](_0x3db5('0x1b'),_0x4a430a,JSON[_0x3db5('0xd')](_0x2f8e56));_0x11238e(_0x2f8e56);})['catch'](function(_0x136f87){logger[_0x3db5('0xe')](_0x3db5('0x1b'),_0x136f87[_0x3db5('0x10')],_0x4a430a);_0x1e5d5d(_0xd895f6['error'](0x1f4,_0x136f87['message']));});});};
\ No newline at end of file
+var _0xee89=['stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','attributes','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xee89,0x1ad));var _0x9ee8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xee89[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x9ee8('0x0'));var util=require(_0x9ee8('0x1'));var moment=require('moment');var BPromise=require(_0x9ee8('0x2'));var rs=require(_0x9ee8('0x3'));var fs=require('fs');var Redis=require(_0x9ee8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ee8('0x5'));var logger=require(_0x9ee8('0x6'))(_0x9ee8('0x7'));var config=require(_0x9ee8('0x8'));var jayson=require(_0x9ee8('0x9'));var client=jayson[_0x9ee8('0xa')][_0x9ee8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ee39c,_0x488849,_0x32b783){return new BPromise(function(_0xc9552e,_0x29be17){return client[_0x9ee8('0xc')](_0x2ee39c,_0x32b783)[_0x9ee8('0xd')](function(_0x5cc067){logger[_0x9ee8('0xe')](_0x9ee8('0xf'),_0x488849,_0x9ee8('0x10'));logger[_0x9ee8('0x11')](_0x9ee8('0x12'),_0x488849,_0x9ee8('0x10'),JSON[_0x9ee8('0x13')](_0x5cc067));if(_0x5cc067[_0x9ee8('0x14')]){if(_0x5cc067[_0x9ee8('0x14')][_0x9ee8('0x15')]===0x1f4){logger[_0x9ee8('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x488849,_0x5cc067[_0x9ee8('0x14')][_0x9ee8('0x16')]);return _0x29be17(_0x5cc067[_0x9ee8('0x14')][_0x9ee8('0x16')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x488849,_0x5cc067[_0x9ee8('0x14')][_0x9ee8('0x16')]);return _0xc9552e(_0x5cc067['error']['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x488849,'request\x20sent');_0xc9552e(_0x5cc067[_0x9ee8('0x17')][_0x9ee8('0x16')]);}})['catch'](function(_0x2a905e){logger[_0x9ee8('0x14')](_0x9ee8('0xf'),_0x488849,_0x2a905e);_0x29be17(_0x2a905e);});});}exports[_0x9ee8('0x18')]=function(_0xf9951b){var _0x3044b3=this;return new Promise(function(_0x5d5832,_0x34985f){return db[_0x9ee8('0x19')][_0x9ee8('0x1a')](_0xf9951b[_0x9ee8('0x1b')],{'raw':_0xf9951b['options']?_0xf9951b[_0x9ee8('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x559eb8){logger[_0x9ee8('0xe')](_0x9ee8('0x18'),_0xf9951b);logger[_0x9ee8('0x11')]('CreateChatQueueReport',_0xf9951b,JSON[_0x9ee8('0x13')](_0x559eb8));_0x5d5832(_0x559eb8);})['catch'](function(_0x4d118a){logger[_0x9ee8('0x14')](_0x9ee8('0x18'),_0x4d118a[_0x9ee8('0x16')],_0xf9951b);_0x34985f(_0x3044b3[_0x9ee8('0x14')](0x1f4,_0x4d118a['message']));});});};exports[_0x9ee8('0x1d')]=function(_0x2bbed9){var _0x4ea04f=this;return new Promise(function(_0x5e2dad,_0x269c66){return db[_0x9ee8('0x19')]['update'](_0x2bbed9['body'],{'raw':_0x2bbed9[_0x9ee8('0x1c')]?_0x2bbed9[_0x9ee8('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bbed9[_0x9ee8('0x1c')]?_0x2bbed9[_0x9ee8('0x1c')]['where']||null:null,'attributes':_0x2bbed9[_0x9ee8('0x1c')]?_0x2bbed9[_0x9ee8('0x1c')][_0x9ee8('0x1e')]||null:null,'limit':_0x2bbed9['options']?_0x2bbed9[_0x9ee8('0x1c')]['limit']||null:null})[_0x9ee8('0xd')](function(_0x1dd412){logger['info']('UpdateChatQueueReport',_0x2bbed9);logger[_0x9ee8('0x11')](_0x9ee8('0x1d'),_0x2bbed9,JSON['stringify'](_0x1dd412));_0x5e2dad(_0x1dd412);})[_0x9ee8('0x1f')](function(_0xa38f6b){logger['error']('UpdateChatQueueReport',_0xa38f6b[_0x9ee8('0x16')],_0x2bbed9);_0x269c66(_0x4ea04f[_0x9ee8('0x14')](0x1f4,_0xa38f6b[_0x9ee8('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index e1c85b4..0159623 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 _0xc174=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x5567a7,_0x42dd01){var _0xf09423=function(_0x3a48bb){while(--_0x3a48bb){_0x5567a7['push'](_0x5567a7['shift']());}};_0xf09423(++_0x42dd01);}(_0xc174,0x17b));var _0x4c17=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0xc174[_0x810e4d];return _0x13f01c;};'use strict';var multer=require('multer');var util=require(_0x4c17('0x0'));var path=require(_0x4c17('0x1'));var timeout=require(_0x4c17('0x2'));var express=require(_0x4c17('0x3'));var router=express[_0x4c17('0x4')]();var fs_extra=require(_0x4c17('0x5'));var auth=require(_0x4c17('0x6'));var interaction=require(_0x4c17('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x4c17('0x8')](),controller[_0x4c17('0x9')]);router[_0x4c17('0xa')](_0x4c17('0xb'),auth[_0x4c17('0x8')](),controller[_0x4c17('0xc')]);router[_0x4c17('0xa')](_0x4c17('0xd'),auth[_0x4c17('0x8')](),controller[_0x4c17('0xe')]);router[_0x4c17('0xf')]('/',auth[_0x4c17('0x8')](),controller['create']);router[_0x4c17('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4c17('0x11')]);router[_0x4c17('0x12')](_0x4c17('0xd'),auth[_0x4c17('0x8')](),controller[_0x4c17('0x13')]);module[_0x4c17('0x14')]=router;
\ No newline at end of file
+var _0x7dfc=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','describe','/:id','post','put','destroy','util'];(function(_0xe4b4fa,_0x1dbb08){var _0x3f49b7=function(_0x14e17f){while(--_0x14e17f){_0xe4b4fa['push'](_0xe4b4fa['shift']());}};_0x3f49b7(++_0x1dbb08);}(_0x7dfc,0x1cf));var _0xc7df=function(_0xf606a0,_0x38f3b1){_0xf606a0=_0xf606a0-0x0;var _0x345298=_0x7dfc[_0xf606a0];return _0x345298;};'use strict';var multer=require('multer');var util=require(_0xc7df('0x0'));var path=require(_0xc7df('0x1'));var timeout=require(_0xc7df('0x2'));var express=require('express');var router=express[_0xc7df('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc7df('0x4'));var interaction=require(_0xc7df('0x5'));var config=require(_0xc7df('0x6'));var controller=require(_0xc7df('0x7'));router['get']('/',auth[_0xc7df('0x8')](),controller[_0xc7df('0x9')]);router[_0xc7df('0xa')]('/describe',auth[_0xc7df('0x8')](),controller[_0xc7df('0xb')]);router[_0xc7df('0xa')](_0xc7df('0xc'),auth[_0xc7df('0x8')](),controller['show']);router[_0xc7df('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc7df('0xe')](_0xc7df('0xc'),auth[_0xc7df('0x8')](),controller['update']);router['delete'](_0xc7df('0xc'),auth[_0xc7df('0x8')](),controller[_0xc7df('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f34b368..5ba040a 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x516f2e,_0x42130a){var _0x25414a=function(_0x170a0a){while(--_0x170a0a){_0x516f2e['push'](_0x516f2e['shift']());}};_0x25414a(++_0x42130a);}(_0x70e0,0x17b));var _0x070e=function(_0x2c02a7,_0xe1bc68){_0x2c02a7=_0x2c02a7-0x0;var _0x24ba66=_0x70e0[_0x2c02a7];return _0x24ba66;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x293da6,_0x5112e3){var _0x38005a=function(_0x331f70){while(--_0x331f70){_0x293da6['push'](_0x293da6['shift']());}};_0x38005a(++_0x5112e3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1e235e,_0x994b77){_0x1e235e=_0x1e235e-0x0;var _0x1e8e94=_0xf3cd[_0x1e235e];return _0x1e8e94;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 621a9ab..e665545 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 _0xf6b2=['catch','params','model','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','stack','name','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll'];(function(_0x5ef12e,_0x59a72a){var _0xd8607=function(_0x4a71f8){while(--_0x4a71f8){_0x5ef12e['push'](_0x5ef12e['shift']());}};_0xd8607(++_0x59a72a);}(_0xf6b2,0x115));var _0x2f6b=function(_0x5bfd0e,_0x542423){_0x5bfd0e=_0x5bfd0e-0x0;var _0x1e0110=_0xf6b2[_0x5bfd0e];return _0x1e0110;};'use strict';var emlformat=require(_0x2f6b('0x0'));var rimraf=require(_0x2f6b('0x1'));var zipdir=require(_0x2f6b('0x2'));var jsonpatch=require(_0x2f6b('0x3'));var rp=require(_0x2f6b('0x4'));var moment=require(_0x2f6b('0x5'));var BPromise=require(_0x2f6b('0x6'));var Mustache=require('mustache');var util=require(_0x2f6b('0x7'));var path=require(_0x2f6b('0x8'));var sox=require(_0x2f6b('0x9'));var csv=require(_0x2f6b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f6b('0xb'));var _=require('lodash');var squel=require(_0x2f6b('0xc'));var crypto=require('crypto');var jsforce=require(_0x2f6b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2f6b('0xa'));var querystring=require('querystring');var Papa=require(_0x2f6b('0xe'));var Redis=require(_0x2f6b('0xf'));var authService=require(_0x2f6b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2f6b('0x11'));var hardwareService=require(_0x2f6b('0x12'));var logger=require('../../config/logger')(_0x2f6b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c0a7c,_0x18689e){_0x18689e=_0x18689e||0xcc;return function(_0x1b7bc2){if(_0x1b7bc2){return _0x2c0a7c[_0x2f6b('0x14')](_0x18689e);}return _0x2c0a7c['status'](_0x18689e)[_0x2f6b('0x15')]();};}function respondWithResult(_0x2cb311,_0x344aa8){_0x344aa8=_0x344aa8||0xc8;return function(_0x432616){if(_0x432616){return _0x2cb311[_0x2f6b('0x16')](_0x344aa8)['json'](_0x432616);}};}function respondWithFilteredResult(_0x435502,_0x2f901a){return function(_0x3a509b){if(_0x3a509b){var _0x20832c=typeof _0x2f901a[_0x2f6b('0x17')]===_0x2f6b('0x18')&&typeof _0x2f901a[_0x2f6b('0x19')]===_0x2f6b('0x18');var _0x224a04=_0x3a509b[_0x2f6b('0x1a')];var _0x187965=_0x20832c?0x0:_0x2f901a['offset'];var _0x555d1d=_0x20832c?_0x3a509b['count']:_0x2f901a[_0x2f6b('0x17')]+_0x2f901a['limit'];var _0x5a68be;if(_0x555d1d>=_0x224a04){_0x555d1d=_0x224a04;_0x5a68be=0xc8;}else{_0x5a68be=0xce;}_0x435502['status'](_0x5a68be);return _0x435502[_0x2f6b('0x1b')](_0x2f6b('0x1c'),_0x187965+'-'+_0x555d1d+'/'+_0x224a04)[_0x2f6b('0x1d')](_0x3a509b);}return null;};}function patchUpdates(_0x1b1df8){return function(_0x37e480){try{jsonpatch['apply'](_0x37e480,_0x1b1df8,!![]);}catch(_0x4d72e2){return BPromise['reject'](_0x4d72e2);}return _0x37e480[_0x2f6b('0x1e')]();};}function saveUpdates(_0x5d75d2,_0x72f558){return function(_0xc7c90d){if(_0xc7c90d){return _0xc7c90d['update'](_0x5d75d2)[_0x2f6b('0x1f')](function(_0x45ac3e){return _0x45ac3e;});}return null;};}function removeEntity(_0x1a1055,_0x16baab){return function(_0x4ed0b3){if(_0x4ed0b3){return _0x4ed0b3[_0x2f6b('0x20')]()['then'](function(){_0x1a1055[_0x2f6b('0x16')](0xcc)[_0x2f6b('0x15')]();});}};}function handleEntityNotFound(_0x801552,_0x4f87d1){return function(_0x5e96ee){if(!_0x5e96ee){_0x801552[_0x2f6b('0x14')](0x194);}return _0x5e96ee;};}function handleError(_0xc35a55,_0x599375){_0x599375=_0x599375||0x1f4;return function(_0x1c7344){logger['error'](_0x1c7344[_0x2f6b('0x21')]);if(_0x1c7344[_0x2f6b('0x22')]){delete _0x1c7344['name'];}_0xc35a55[_0x2f6b('0x16')](_0x599375)['send'](_0x1c7344);};}exports['index']=function(_0x1987a6,_0x4d6138){var _0x112426={},_0x419887={},_0x2fae44={'count':0x0,'rows':[]};var _0x1088f6=_[_0x2f6b('0x23')](db[_0x2f6b('0x24')][_0x2f6b('0x25')],function(_0x163037){return{'name':_0x163037[_0x2f6b('0x26')],'type':_0x163037[_0x2f6b('0x27')][_0x2f6b('0x28')]};});_0x419887['model']=_[_0x2f6b('0x23')](_0x1088f6,_0x2f6b('0x22'));_0x419887[_0x2f6b('0x29')]=_[_0x2f6b('0x2a')](_0x1987a6[_0x2f6b('0x29')]);_0x419887[_0x2f6b('0x2b')]=_['intersection'](_0x419887['model'],_0x419887[_0x2f6b('0x29')]);_0x112426['attributes']=_[_0x2f6b('0x2c')](_0x419887['model'],qs[_0x2f6b('0x2d')](_0x1987a6[_0x2f6b('0x29')]['fields']));_0x112426[_0x2f6b('0x2e')]=_0x112426[_0x2f6b('0x2e')][_0x2f6b('0x2f')]?_0x112426['attributes']:_0x419887['model'];if(!_0x1987a6[_0x2f6b('0x29')][_0x2f6b('0x30')]('nolimit')){_0x112426[_0x2f6b('0x19')]=qs['limit'](_0x1987a6[_0x2f6b('0x29')][_0x2f6b('0x19')]);_0x112426[_0x2f6b('0x17')]=qs[_0x2f6b('0x17')](_0x1987a6[_0x2f6b('0x29')][_0x2f6b('0x17')]);}_0x112426[_0x2f6b('0x31')]=qs[_0x2f6b('0x32')](_0x1987a6[_0x2f6b('0x29')][_0x2f6b('0x32')]);_0x112426[_0x2f6b('0x33')]=qs[_0x2f6b('0x2b')](_['pick'](_0x1987a6[_0x2f6b('0x29')],_0x419887['filters']),_0x1088f6);if(_0x1987a6[_0x2f6b('0x29')][_0x2f6b('0x34')]){_0x112426[_0x2f6b('0x33')]=_[_0x2f6b('0x35')](_0x112426[_0x2f6b('0x33')],{'$or':_['map'](_0x1088f6,function(_0x3d9e1d){if(_0x3d9e1d[_0x2f6b('0x27')]!==_0x2f6b('0x36')){var _0x58b112={};_0x58b112[_0x3d9e1d[_0x2f6b('0x22')]]={'$like':'%'+_0x1987a6[_0x2f6b('0x29')][_0x2f6b('0x34')]+'%'};return _0x58b112;}})});}_0x112426=_['merge']({},_0x112426,_0x1987a6[_0x2f6b('0x37')]);var _0x38b57a={'where':_0x112426[_0x2f6b('0x33')]};return db[_0x2f6b('0x24')][_0x2f6b('0x1a')](_0x38b57a)[_0x2f6b('0x1f')](function(_0x27ef7e){_0x2fae44[_0x2f6b('0x1a')]=_0x27ef7e;if(_0x1987a6[_0x2f6b('0x29')]['includeAll']){_0x112426[_0x2f6b('0x38')]=[{'all':!![]}];}return db[_0x2f6b('0x24')][_0x2f6b('0x39')](_0x112426);})[_0x2f6b('0x1f')](function(_0x294a80){_0x2fae44['rows']=_0x294a80;return _0x2fae44;})['then'](respondWithFilteredResult(_0x4d6138,_0x112426))[_0x2f6b('0x3a')](handleError(_0x4d6138,null));};exports['show']=function(_0x25224b,_0x3e2f46){var _0x3b36c8={'raw':!![],'where':{'id':_0x25224b[_0x2f6b('0x3b')]['id']}},_0x22f73a={};_0x22f73a['model']=_[_0x2f6b('0x2a')](db[_0x2f6b('0x24')][_0x2f6b('0x25')]);_0x22f73a['query']=_['keys'](_0x25224b['query']);_0x22f73a['filters']=_[_0x2f6b('0x2c')](_0x22f73a['model'],_0x22f73a[_0x2f6b('0x29')]);_0x3b36c8[_0x2f6b('0x2e')]=_[_0x2f6b('0x2c')](_0x22f73a[_0x2f6b('0x3c')],qs[_0x2f6b('0x2d')](_0x25224b[_0x2f6b('0x29')]['fields']));_0x3b36c8[_0x2f6b('0x2e')]=_0x3b36c8[_0x2f6b('0x2e')]['length']?_0x3b36c8[_0x2f6b('0x2e')]:_0x22f73a['model'];if(_0x25224b[_0x2f6b('0x29')][_0x2f6b('0x3d')]){_0x3b36c8['include']=[{'all':!![]}];}_0x3b36c8=_['merge']({},_0x3b36c8,_0x25224b[_0x2f6b('0x37')]);return db['ChatTransferReport'][_0x2f6b('0x3e')](_0x3b36c8)[_0x2f6b('0x1f')](handleEntityNotFound(_0x3e2f46,null))[_0x2f6b('0x1f')](respondWithResult(_0x3e2f46,null))[_0x2f6b('0x3a')](handleError(_0x3e2f46,null));};exports['create']=function(_0x4290c4,_0x4445db){return db[_0x2f6b('0x24')][_0x2f6b('0x3f')](_0x4290c4[_0x2f6b('0x40')],{})['then'](respondWithResult(_0x4445db,0xc9))[_0x2f6b('0x3a')](handleError(_0x4445db,null));};exports[_0x2f6b('0x41')]=function(_0x2a7220,_0x5b7ed7){if(_0x2a7220[_0x2f6b('0x40')]['id']){delete _0x2a7220['body']['id'];}return db['ChatTransferReport'][_0x2f6b('0x3e')]({'where':{'id':_0x2a7220[_0x2f6b('0x3b')]['id']}})[_0x2f6b('0x1f')](handleEntityNotFound(_0x5b7ed7,null))[_0x2f6b('0x1f')](saveUpdates(_0x2a7220[_0x2f6b('0x40')],null))[_0x2f6b('0x1f')](respondWithResult(_0x5b7ed7,null))[_0x2f6b('0x3a')](handleError(_0x5b7ed7,null));};exports[_0x2f6b('0x20')]=function(_0x532ba0,_0x5779db){return db['ChatTransferReport'][_0x2f6b('0x3e')]({'where':{'id':_0x532ba0[_0x2f6b('0x3b')]['id']}})[_0x2f6b('0x1f')](handleEntityNotFound(_0x5779db,null))[_0x2f6b('0x1f')](removeEntity(_0x5779db,null))['catch'](handleError(_0x5779db,null));};exports[_0x2f6b('0x42')]=function(_0x8ad272,_0x13cfec){return db[_0x2f6b('0x24')]['describe']()[_0x2f6b('0x1f')](respondWithResult(_0x13cfec,null))['catch'](handleError(_0x13cfec,null));};
\ No newline at end of file
+var _0xa17e=['ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','ChatTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x2e9703,_0x299227){var _0x5056a3=function(_0x36990e){while(--_0x36990e){_0x2e9703['push'](_0x2e9703['shift']());}};_0x5056a3(++_0x299227);}(_0xa17e,0x171));var _0xea17=function(_0x1ff98d,_0x1e263c){_0x1ff98d=_0x1ff98d-0x0;var _0x1884c8=_0xa17e[_0x1ff98d];return _0x1884c8;};'use strict';var emlformat=require(_0xea17('0x0'));var rimraf=require(_0xea17('0x1'));var zipdir=require(_0xea17('0x2'));var jsonpatch=require(_0xea17('0x3'));var rp=require(_0xea17('0x4'));var moment=require(_0xea17('0x5'));var BPromise=require(_0xea17('0x6'));var Mustache=require(_0xea17('0x7'));var util=require(_0xea17('0x8'));var path=require(_0xea17('0x9'));var sox=require('sox');var csv=require(_0xea17('0xa'));var ejs=require(_0xea17('0xb'));var fs=require('fs');var fs_extra=require(_0xea17('0xc'));var _=require('lodash');var squel=require(_0xea17('0xd'));var crypto=require(_0xea17('0xe'));var jsforce=require(_0xea17('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xea17('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea17('0x10'));var authService=require(_0xea17('0x11'));var qs=require(_0xea17('0x12'));var as=require(_0xea17('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea17('0x14'))(_0xea17('0x15'));var utils=require(_0xea17('0x16'));var config=require(_0xea17('0x17'));var licenseUtil=require(_0xea17('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf3b54f,_0x36a826){_0x36a826=_0x36a826||0xcc;return function(_0x32bb3f){if(_0x32bb3f){return _0xf3b54f[_0xea17('0x19')](_0x36a826);}return _0xf3b54f[_0xea17('0x1a')](_0x36a826)['end']();};}function respondWithResult(_0x4c9afb,_0x3daa2c){_0x3daa2c=_0x3daa2c||0xc8;return function(_0x4936aa){if(_0x4936aa){return _0x4c9afb[_0xea17('0x1a')](_0x3daa2c)[_0xea17('0x1b')](_0x4936aa);}};}function respondWithFilteredResult(_0x358625,_0x4fdfd1){return function(_0x1dbd26){if(_0x1dbd26){var _0x284ab7=typeof _0x4fdfd1[_0xea17('0x1c')]===_0xea17('0x1d')&&typeof _0x4fdfd1[_0xea17('0x1e')]==='undefined';var _0x3bc262=_0x1dbd26['count'];var _0x1cb206=_0x284ab7?0x0:_0x4fdfd1[_0xea17('0x1c')];var _0x133432=_0x284ab7?_0x1dbd26[_0xea17('0x1f')]:_0x4fdfd1[_0xea17('0x1c')]+_0x4fdfd1[_0xea17('0x1e')];var _0xee0653;if(_0x133432>=_0x3bc262){_0x133432=_0x3bc262;_0xee0653=0xc8;}else{_0xee0653=0xce;}_0x358625[_0xea17('0x1a')](_0xee0653);return _0x358625[_0xea17('0x20')](_0xea17('0x21'),_0x1cb206+'-'+_0x133432+'/'+_0x3bc262)['json'](_0x1dbd26);}return null;};}function patchUpdates(_0x2ac329){return function(_0x14e906){try{jsonpatch['apply'](_0x14e906,_0x2ac329,!![]);}catch(_0x164997){return BPromise[_0xea17('0x22')](_0x164997);}return _0x14e906[_0xea17('0x23')]();};}function saveUpdates(_0x5ea37b,_0x4aeede){return function(_0x1dfacf){if(_0x1dfacf){return _0x1dfacf[_0xea17('0x24')](_0x5ea37b)[_0xea17('0x25')](function(_0xacb961){return _0xacb961;});}return null;};}function removeEntity(_0x3805ba,_0x121c00){return function(_0x2ee9dc){if(_0x2ee9dc){return _0x2ee9dc[_0xea17('0x26')]()[_0xea17('0x25')](function(){_0x3805ba[_0xea17('0x1a')](0xcc)[_0xea17('0x27')]();});}};}function handleEntityNotFound(_0x26675b,_0x28b0af){return function(_0x37c769){if(!_0x37c769){_0x26675b['sendStatus'](0x194);}return _0x37c769;};}function handleError(_0x1f1ad5,_0x2c26a7){_0x2c26a7=_0x2c26a7||0x1f4;return function(_0x32f6f5){logger[_0xea17('0x28')](_0x32f6f5['stack']);if(_0x32f6f5[_0xea17('0x29')]){delete _0x32f6f5[_0xea17('0x29')];}_0x1f1ad5[_0xea17('0x1a')](_0x2c26a7)[_0xea17('0x2a')](_0x32f6f5);};}exports[_0xea17('0x2b')]=function(_0x1ff394,_0x2ced8a){var _0x29c97e={},_0x4d8b4f={},_0x1153d5={'count':0x0,'rows':[]};var _0x5b4081=_[_0xea17('0x2c')](db[_0xea17('0x2d')]['rawAttributes'],function(_0x256585){return{'name':_0x256585['fieldName'],'type':_0x256585[_0xea17('0x2e')][_0xea17('0x2f')]};});_0x4d8b4f[_0xea17('0x30')]=_['map'](_0x5b4081,_0xea17('0x29'));_0x4d8b4f[_0xea17('0x31')]=_[_0xea17('0x32')](_0x1ff394[_0xea17('0x31')]);_0x4d8b4f[_0xea17('0x33')]=_[_0xea17('0x34')](_0x4d8b4f['model'],_0x4d8b4f['query']);_0x29c97e[_0xea17('0x35')]=_[_0xea17('0x34')](_0x4d8b4f[_0xea17('0x30')],qs[_0xea17('0x36')](_0x1ff394[_0xea17('0x31')]['fields']));_0x29c97e[_0xea17('0x35')]=_0x29c97e['attributes'][_0xea17('0x37')]?_0x29c97e[_0xea17('0x35')]:_0x4d8b4f[_0xea17('0x30')];if(!_0x1ff394[_0xea17('0x31')][_0xea17('0x38')](_0xea17('0x39'))){_0x29c97e['limit']=qs[_0xea17('0x1e')](_0x1ff394[_0xea17('0x31')][_0xea17('0x1e')]);_0x29c97e[_0xea17('0x1c')]=qs[_0xea17('0x1c')](_0x1ff394[_0xea17('0x31')][_0xea17('0x1c')]);}_0x29c97e[_0xea17('0x3a')]=qs['sort'](_0x1ff394[_0xea17('0x31')][_0xea17('0x3b')]);_0x29c97e[_0xea17('0x3c')]=qs[_0xea17('0x33')](_[_0xea17('0x3d')](_0x1ff394[_0xea17('0x31')],_0x4d8b4f[_0xea17('0x33')]),_0x5b4081);if(_0x1ff394['query'][_0xea17('0x3e')]){_0x29c97e[_0xea17('0x3c')]=_[_0xea17('0x3f')](_0x29c97e[_0xea17('0x3c')],{'$or':_['map'](_0x5b4081,function(_0x3f4a74){if(_0x3f4a74['type']!==_0xea17('0x40')){var _0x93809f={};_0x93809f[_0x3f4a74[_0xea17('0x29')]]={'$like':'%'+_0x1ff394[_0xea17('0x31')][_0xea17('0x3e')]+'%'};return _0x93809f;}})});}_0x29c97e=_['merge']({},_0x29c97e,_0x1ff394[_0xea17('0x41')]);var _0x551bc3={'where':_0x29c97e[_0xea17('0x3c')]};return db['ChatTransferReport'][_0xea17('0x1f')](_0x551bc3)[_0xea17('0x25')](function(_0x142ece){_0x1153d5[_0xea17('0x1f')]=_0x142ece;if(_0x1ff394[_0xea17('0x31')][_0xea17('0x42')]){_0x29c97e[_0xea17('0x43')]=[{'all':!![]}];}return db[_0xea17('0x2d')][_0xea17('0x44')](_0x29c97e);})['then'](function(_0x16bcfe){_0x1153d5[_0xea17('0x45')]=_0x16bcfe;return _0x1153d5;})[_0xea17('0x25')](respondWithFilteredResult(_0x2ced8a,_0x29c97e))['catch'](handleError(_0x2ced8a,null));};exports['show']=function(_0x526f3a,_0x18b354){var _0x346de7={'raw':!![],'where':{'id':_0x526f3a[_0xea17('0x46')]['id']}},_0x3f59d9={};_0x3f59d9[_0xea17('0x30')]=_[_0xea17('0x32')](db[_0xea17('0x2d')]['rawAttributes']);_0x3f59d9[_0xea17('0x31')]=_[_0xea17('0x32')](_0x526f3a['query']);_0x3f59d9[_0xea17('0x33')]=_[_0xea17('0x34')](_0x3f59d9[_0xea17('0x30')],_0x3f59d9[_0xea17('0x31')]);_0x346de7[_0xea17('0x35')]=_[_0xea17('0x34')](_0x3f59d9[_0xea17('0x30')],qs[_0xea17('0x36')](_0x526f3a[_0xea17('0x31')][_0xea17('0x36')]));_0x346de7['attributes']=_0x346de7[_0xea17('0x35')]['length']?_0x346de7[_0xea17('0x35')]:_0x3f59d9['model'];if(_0x526f3a['query'][_0xea17('0x42')]){_0x346de7['include']=[{'all':!![]}];}_0x346de7=_[_0xea17('0x3f')]({},_0x346de7,_0x526f3a[_0xea17('0x41')]);return db[_0xea17('0x2d')][_0xea17('0x47')](_0x346de7)['then'](handleEntityNotFound(_0x18b354,null))[_0xea17('0x25')](respondWithResult(_0x18b354,null))['catch'](handleError(_0x18b354,null));};exports[_0xea17('0x48')]=function(_0x2fbf90,_0xad9a2a){return db['ChatTransferReport'][_0xea17('0x48')](_0x2fbf90[_0xea17('0x49')],{})[_0xea17('0x25')](respondWithResult(_0xad9a2a,0xc9))['catch'](handleError(_0xad9a2a,null));};exports[_0xea17('0x24')]=function(_0x38c9ce,_0x12fb3a){if(_0x38c9ce['body']['id']){delete _0x38c9ce['body']['id'];}return db['ChatTransferReport'][_0xea17('0x47')]({'where':{'id':_0x38c9ce[_0xea17('0x46')]['id']}})['then'](handleEntityNotFound(_0x12fb3a,null))[_0xea17('0x25')](saveUpdates(_0x38c9ce['body'],null))[_0xea17('0x25')](respondWithResult(_0x12fb3a,null))[_0xea17('0x4a')](handleError(_0x12fb3a,null));};exports['destroy']=function(_0x4db2e3,_0x4f70c9){return db[_0xea17('0x2d')][_0xea17('0x47')]({'where':{'id':_0x4db2e3[_0xea17('0x46')]['id']}})[_0xea17('0x25')](handleEntityNotFound(_0x4f70c9,null))[_0xea17('0x25')](removeEntity(_0x4f70c9,null))['catch'](handleError(_0x4f70c9,null));};exports[_0xea17('0x4b')]=function(_0x346424,_0x4a0cfd){return db[_0xea17('0x2d')][_0xea17('0x4b')]()[_0xea17('0x25')](respondWithResult(_0x4a0cfd,null))[_0xea17('0x4a')](handleError(_0x4a0cfd,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 99ada88..0bc058e 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 _0x0697=['rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','util','api','moment','request-promise','path'];(function(_0x5d70bf,_0x19b7e4){var _0x35946d=function(_0x5cce87){while(--_0x5cce87){_0x5d70bf['push'](_0x5d70bf['shift']());}};_0x35946d(++_0x19b7e4);}(_0x0697,0x1c9));var _0x7069=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x0697[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require(_0x7069('0x0'));var logger=require('../../config/logger')(_0x7069('0x1'));var moment=require(_0x7069('0x2'));var BPromise=require('bluebird');var rp=require(_0x7069('0x3'));var fs=require('fs');var path=require(_0x7069('0x4'));var rimraf=require(_0x7069('0x5'));var config=require('../../config/environment');var attributes=require(_0x7069('0x6'));module[_0x7069('0x7')]=function(_0x2e3fde,_0x482841){return _0x2e3fde[_0x7069('0x8')](_0x7069('0x9'),attributes,{'tableName':_0x7069('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2052=['report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport'];(function(_0x595669,_0x4620f0){var _0xf33ba2=function(_0x40bf73){while(--_0x40bf73){_0x595669['push'](_0x595669['shift']());}};_0xf33ba2(++_0x4620f0);}(_0x2052,0xb8));var _0x2205=function(_0x31daf4,_0x3e2d34){_0x31daf4=_0x31daf4-0x0;var _0x129207=_0x2052[_0x31daf4];return _0x129207;};'use strict';var _=require(_0x2205('0x0'));var util=require('util');var logger=require(_0x2205('0x1'))(_0x2205('0x2'));var moment=require(_0x2205('0x3'));var BPromise=require(_0x2205('0x4'));var rp=require(_0x2205('0x5'));var fs=require('fs');var path=require(_0x2205('0x6'));var rimraf=require(_0x2205('0x7'));var config=require(_0x2205('0x8'));var attributes=require(_0x2205('0x9'));module[_0x2205('0xa')]=function(_0x460b9f,_0x386a2){return _0x460b9f['define'](_0x2205('0xb'),attributes,{'tableName':_0x2205('0xc'),'paranoid':![],'indexes':[{'name':_0x2205('0xd'),'fields':[_0x2205('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index f16d01d..c1582e9 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 _0x6369=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x6369,0xf7));var _0x9636=function(_0x230249,_0x27c009){_0x230249=_0x230249-0x0;var _0x4f6e0b=_0x6369[_0x230249];return _0x4f6e0b;};'use strict';var _=require(_0x9636('0x0'));var util=require(_0x9636('0x1'));var moment=require('moment');var BPromise=require(_0x9636('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9636('0x3'));var db=require(_0x9636('0x4'))['db'];var utils=require(_0x9636('0x5'));var logger=require(_0x9636('0x6'))(_0x9636('0x7'));var config=require(_0x9636('0x8'));var jayson=require(_0x9636('0x9'));var client=jayson['client'][_0x9636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x586d0f,_0x35e7d1,_0xa57bdd){return new BPromise(function(_0x4e7162,_0x266db0){return client[_0x9636('0xb')](_0x586d0f,_0xa57bdd)[_0x9636('0xc')](function(_0x2f7b16){logger[_0x9636('0xd')](_0x9636('0xe'),_0x35e7d1,_0x9636('0xf'));logger[_0x9636('0x10')](_0x9636('0x11'),_0x35e7d1,'request\x20sent',JSON[_0x9636('0x12')](_0x2f7b16));if(_0x2f7b16[_0x9636('0x13')]){if(_0x2f7b16[_0x9636('0x13')][_0x9636('0x14')]===0x1f4){logger[_0x9636('0x13')](_0x9636('0xe'),_0x35e7d1,_0x2f7b16[_0x9636('0x13')][_0x9636('0x15')]);return _0x266db0(_0x2f7b16[_0x9636('0x13')][_0x9636('0x15')]);}logger[_0x9636('0x13')](_0x9636('0xe'),_0x35e7d1,_0x2f7b16[_0x9636('0x13')][_0x9636('0x15')]);return _0x4e7162(_0x2f7b16[_0x9636('0x13')][_0x9636('0x15')]);}else{logger[_0x9636('0xd')](_0x9636('0xe'),_0x35e7d1,_0x9636('0xf'));_0x4e7162(_0x2f7b16[_0x9636('0x16')]['message']);}})[_0x9636('0x17')](function(_0x1c97e5){logger[_0x9636('0x13')](_0x9636('0xe'),_0x35e7d1,_0x1c97e5);_0x266db0(_0x1c97e5);});});}
\ No newline at end of file
+var _0xa39e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x36bf46,_0x3d8db9){var _0x1d0a72=function(_0x328e8d){while(--_0x328e8d){_0x36bf46['push'](_0x36bf46['shift']());}};_0x1d0a72(++_0x3d8db9);}(_0xa39e,0x1df));var _0xea39=function(_0x34bc5e,_0x538eb4){_0x34bc5e=_0x34bc5e-0x0;var _0x3e6969=_0xa39e[_0x34bc5e];return _0x3e6969;};'use strict';var _=require(_0xea39('0x0'));var util=require(_0xea39('0x1'));var moment=require(_0xea39('0x2'));var BPromise=require(_0xea39('0x3'));var rs=require(_0xea39('0x4'));var fs=require('fs');var Redis=require(_0xea39('0x5'));var db=require(_0xea39('0x6'))['db'];var utils=require(_0xea39('0x7'));var logger=require(_0xea39('0x8'))(_0xea39('0x9'));var config=require(_0xea39('0xa'));var jayson=require(_0xea39('0xb'));var client=jayson['client'][_0xea39('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fcbab,_0x3380d1,_0xf32174){return new BPromise(function(_0x1d19a1,_0x32ed4c){return client[_0xea39('0xd')](_0x2fcbab,_0xf32174)[_0xea39('0xe')](function(_0x10b8d7){logger['info'](_0xea39('0xf'),_0x3380d1,_0xea39('0x10'));logger['debug'](_0xea39('0x11'),_0x3380d1,_0xea39('0x10'),JSON[_0xea39('0x12')](_0x10b8d7));if(_0x10b8d7[_0xea39('0x13')]){if(_0x10b8d7[_0xea39('0x13')][_0xea39('0x14')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3380d1,_0x10b8d7[_0xea39('0x13')][_0xea39('0x15')]);return _0x32ed4c(_0x10b8d7['error'][_0xea39('0x15')]);}logger[_0xea39('0x13')](_0xea39('0xf'),_0x3380d1,_0x10b8d7[_0xea39('0x13')][_0xea39('0x15')]);return _0x1d19a1(_0x10b8d7['error'][_0xea39('0x15')]);}else{logger['info'](_0xea39('0xf'),_0x3380d1,_0xea39('0x10'));_0x1d19a1(_0x10b8d7[_0xea39('0x16')][_0xea39('0x15')]);}})[_0xea39('0x17')](function(_0x30c7db){logger[_0xea39('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3380d1,_0x30c7db);_0x32ed4c(_0x30c7db);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 1ed44a5..d51dac4 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 _0x5e45=['update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','/:id','show','post','create','put'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x5e45,0x1bb));var _0x55e4=function(_0x464f43,_0x515b97){_0x464f43=_0x464f43-0x0;var _0x5e17db=_0x5e45[_0x464f43];return _0x5e17db;};'use strict';var multer=require(_0x55e4('0x0'));var util=require(_0x55e4('0x1'));var path=require('path');var timeout=require(_0x55e4('0x2'));var express=require(_0x55e4('0x3'));var router=express['Router']();var fs_extra=require(_0x55e4('0x4'));var auth=require(_0x55e4('0x5'));var interaction=require(_0x55e4('0x6'));var config=require(_0x55e4('0x7'));var controller=require(_0x55e4('0x8'));router[_0x55e4('0x9')]('/',auth['isAuthenticated'](),controller[_0x55e4('0xa')]);router['get']('/describe',auth[_0x55e4('0xb')](),controller['describe']);router['get'](_0x55e4('0xc'),auth[_0x55e4('0xb')](),controller[_0x55e4('0xd')]);router[_0x55e4('0xe')]('/',auth[_0x55e4('0xb')](),controller[_0x55e4('0xf')]);router[_0x55e4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x55e4('0x11')]);router[_0x55e4('0x12')](_0x55e4('0xc'),auth[_0x55e4('0xb')](),controller[_0x55e4('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x5291=['/:id','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x5291,0x92));var _0x1529=function(_0x125f58,_0x565244){_0x125f58=_0x125f58-0x0;var _0x553b08=_0x5291[_0x125f58];return _0x553b08;};'use strict';var multer=require(_0x1529('0x0'));var util=require(_0x1529('0x1'));var path=require(_0x1529('0x2'));var timeout=require(_0x1529('0x3'));var express=require(_0x1529('0x4'));var router=express[_0x1529('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1529('0x6'));var interaction=require(_0x1529('0x7'));var config=require('../../config/environment');var controller=require(_0x1529('0x8'));router[_0x1529('0x9')]('/',auth[_0x1529('0xa')](),controller[_0x1529('0xb')]);router[_0x1529('0x9')](_0x1529('0xc'),auth[_0x1529('0xa')](),controller[_0x1529('0xd')]);router[_0x1529('0x9')](_0x1529('0xe'),auth[_0x1529('0xa')](),controller['show']);router['post']('/',auth[_0x1529('0xa')](),controller[_0x1529('0xf')]);router[_0x1529('0x10')](_0x1529('0xe'),auth[_0x1529('0xa')](),controller[_0x1529('0x11')]);router['delete']('/:id',auth[_0x1529('0xa')](),controller[_0x1529('0x12')]);module[_0x1529('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 1d761ed..4a448d8 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 _0x6324=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','thumb','INTEGER','stringify','input','name','text','email','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2a76fb,_0x2405e2){var _0x5781c7=function(_0x1da807){while(--_0x1da807){_0x2a76fb['push'](_0x2a76fb['shift']());}};_0x5781c7(++_0x2405e2);}(_0x6324,0x142));var _0x4632=function(_0x3ea3ae,_0x29dd29){_0x3ea3ae=_0x3ea3ae-0x0;var _0x2aa587=_0x6324[_0x3ea3ae];return _0x2aa587;};'use strict';var Sequelize=require(_0x4632('0x0'));var rs=require(_0x4632('0x1'));module[_0x4632('0x2')]={'name':{'type':Sequelize[_0x4632('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4632('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x4632('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x5')},'customerAlias':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4632('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4632('0x3')],'allowNull':![],'defaultValue':_0x4632('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4632('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4632('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4632('0x3')]},'animation':{'type':Sequelize[_0x4632('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4632('0x9')](_0x4632('0xa'),_0x4632('0xb')),'defaultValue':_0x4632('0xa')},'header_online':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4632('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4632('0xe')},'header_offline':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0xf')},'download_transcript':{'type':Sequelize[_0x4632('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x4632('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4632('0x11')]},'closingQuestion':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4632('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x13')},'noteTitle':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x14')},'closingMessage':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x15')},'ratingType':{'type':Sequelize[_0x4632('0x9')](_0x4632('0x16'),_0x4632('0x17')),'defaultValue':_0x4632('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x4632('0x18')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4632('0x11')],'defaultValue':function(){return JSON[_0x4632('0x19')]({'items':[{'type':_0x4632('0x1a'),'variable':null,'config':{'placeholder':_0x4632('0x1b'),'type':_0x4632('0x1c'),'required':!![]},'props':{'title':_0x4632('0x1b'),'helpText':''}},{'type':_0x4632('0x1a'),'props':{'title':_0x4632('0x1d'),'helpText':''},'config':{'required':!![],'placeholder':_0x4632('0x1d'),'type':_0x4632('0x1d')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4632('0x1e')](_0x4632('0x1f'))?JSON[_0x4632('0x20')](this[_0x4632('0x1e')](_0x4632('0x1f'))):{};},'set':function(_0x4af026){return this[_0x4632('0x21')](_0x4632('0x1f'),JSON[_0x4632('0x19')](_0x4af026));}},'offlineForm':{'type':Sequelize[_0x4632('0x11')],'defaultValue':function(){return JSON[_0x4632('0x19')]({'items':[{'type':_0x4632('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4632('0x1d')},'variable':null},{'type':_0x4632('0x22'),'config':{'placeholder':_0x4632('0x23')},'props':{'title':_0x4632('0x23'),'helpText':_0x4632('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x4632('0x1e')](_0x4632('0x25'))?JSON['parse'](this[_0x4632('0x1e')](_0x4632('0x25'))):{};},'set':function(_0x48f5fb){return this[_0x4632('0x21')]('offlineForm',JSON[_0x4632('0x19')](_0x48f5fb));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x4632('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4632('0x3')]},'waitingTitle':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4632('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x4632('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x4632('0x29')},'sendUnmanaged':{'type':Sequelize[_0x4632('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4632('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4632('0x2a');}},'notificationSound':{'type':Sequelize[_0x4632('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4632('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x4632('0x2d')},'messagesAlignment':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4632('0x18')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4632('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4632('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4632('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4632('0x3')],'defaultValue':_0x4632('0x2f')},'systemAvatar':{'type':Sequelize[_0x4632('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4632('0x18')],'comment':_0x4632('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![],'comment':_0x4632('0x31'),'set':function(_0x3b6258){if(!_0x3b6258)this['setDataValue'](_0x4632('0x32'),null);this[_0x4632('0x21')]('mandatoryDisposition',_0x3b6258);}},'vidaooEscalation':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4632('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4632('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4632('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x4632('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4632('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4632('0x11')]}};
\ No newline at end of file
+var _0x0bb5=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','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','Feedback','star','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','stringify','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2f02d4,_0x27b24a){var _0x4b707d=function(_0x52f3ba){while(--_0x52f3ba){_0x2f02d4['push'](_0x2f02d4['shift']());}};_0x4b707d(++_0x27b24a);}(_0x0bb5,0x148));var _0x50bb=function(_0xbe507e,_0x261a54){_0xbe507e=_0xbe507e-0x0;var _0x1359ad=_0x0bb5[_0xbe507e];return _0x1359ad;};'use strict';var Sequelize=require(_0x50bb('0x0'));var rs=require(_0x50bb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'unique':_0x50bb('0x3')},'description':{'type':Sequelize[_0x50bb('0x2')]},'mapKey':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'key':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0xa'),_0x50bb('0xb')),'defaultValue':_0x50bb('0xa')},'header_online':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xe')},'header_offline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50bb('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x15')},'placeholderMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x16')},'ratingType':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0x17'),'thumb'),'defaultValue':_0x50bb('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x50bb('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x50bb('0x19'),'required':!![]},'props':{'title':_0x50bb('0x1a'),'helpText':''}},{'type':_0x50bb('0x18'),'props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50bb('0x1b'))?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x1b'))):{};},'set':function(_0x5234d7){return this[_0x50bb('0x1e')]('onlineForm',JSON['stringify'](_0x5234d7));}},'offlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null},{'type':_0x50bb('0x1f'),'config':{'placeholder':_0x50bb('0x20')},'props':{'title':_0x50bb('0x20'),'helpText':_0x50bb('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x50bb('0x1d')]('offlineForm')?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x22'))):{};},'set':function(_0x1b7c0f){return this['setDataValue'](_0x50bb('0x22'),JSON[_0x50bb('0x23')](_0x1b7c0f));}},'token':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return rs[_0x50bb('0x24')]();}},'autoclose':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50bb('0x2')]},'forwardOffline':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x50bb('0x2')]},'waitingTitle':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x27')},'offlineMessageBody':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x29')},'skipUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50bb('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50bb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50bb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2d')},'defaultTitle':{'type':Sequelize[_0x50bb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bb('0x7')],'comment':_0x50bb('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![],'comment':_0x50bb('0x31'),'set':function(_0x3a9fe4){if(!_0x3a9fe4)this[_0x50bb('0x1e')](_0x50bb('0x32'),null);this[_0x50bb('0x1e')](_0x50bb('0x33'),_0x3a9fe4);}},'vidaooEscalation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x34')},'vidaooNote':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return _0x50bb('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50bb('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 6486a5d..7cc82b2 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 _0x1806=['index','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','mandatoryDispositionPause','rawAttributes','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','CannedAnswer','findOne','findAll','removeAnswers','addLogo','sitepic','file','filename','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','systemAvatar','notify','setUA','headers','getResult','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','ValidationError','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','applications','asc','contact','customerIp','cf-connecting-ip','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','startRouting','Start','EventManager','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','server','attachments','openNewInteraction','sequelize','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-forwarded-for','virtual','alignment','verticalAlignment','labelText','backgroundColor','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','destroy','UserProfileResource','stack','name','send'];(function(_0x2eeed4,_0x28dc98){var _0x56099d=function(_0x1018a7){while(--_0x1018a7){_0x2eeed4['push'](_0x2eeed4['shift']());}};_0x56099d(++_0x28dc98);}(_0x1806,0xec));var _0x6180=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1806[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x6180('0x0'));var util=require(_0x6180('0x1'));var path=require(_0x6180('0x2'));var ejs=require(_0x6180('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x6180('0x4'));var qs=require(_0x6180('0x5'));var logger=require(_0x6180('0x6'))('api');var config=require(_0x6180('0x7'));var db=require(_0x6180('0x8'))['db'];config[_0x6180('0x9')]=_[_0x6180('0xa')](config[_0x6180('0x9')],{'host':_0x6180('0xb'),'port':0x18eb});var socket=require(_0x6180('0xc'))(new Redis(config[_0x6180('0x9')]));require(_0x6180('0xd'))[_0x6180('0xe')](socket);var htmlToText=require(_0x6180('0xf'));var jayson=require(_0x6180('0x10'));var client=jayson[_0x6180('0x11')][_0x6180('0x12')]({'port':0x232c});var client9002=jayson[_0x6180('0x11')][_0x6180('0x12')]({'port':0x232a});var client9003=jayson[_0x6180('0x11')][_0x6180('0x12')]({'port':0x232b});var client9001=jayson[_0x6180('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0xa081dc,_0x4fd411,_0x25269e,_0x1c6d58){return new BPromise(function(_0x503908,_0x1b9f19){var _0x70b237=_0x1c6d58||client;return _0x70b237[_0x6180('0x13')](_0xa081dc,_0x25269e)[_0x6180('0x14')](function(_0x55ca9e){logger[_0x6180('0x15')](_0x6180('0x16'),_0x4fd411,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4fd411,_0x6180('0x17'),JSON[_0x6180('0x18')](_0x55ca9e));if(_0x55ca9e[_0x6180('0x19')]){if(_0x55ca9e[_0x6180('0x19')][_0x6180('0x1a')]===0x1f4){logger['error'](_0x6180('0x16'),_0x4fd411,_0x55ca9e[_0x6180('0x19')][_0x6180('0x1b')]);return _0x1b9f19(_0x55ca9e[_0x6180('0x19')][_0x6180('0x1b')]);}logger['error'](_0x6180('0x16'),_0x4fd411,_0x55ca9e[_0x6180('0x19')]['message']);return _0x503908(_0x55ca9e[_0x6180('0x19')][_0x6180('0x1b')]);}else{logger[_0x6180('0x15')](_0x6180('0x16'),_0x4fd411,_0x6180('0x17'));_0x503908(_0x55ca9e['result'][_0x6180('0x1b')]);}})[_0x6180('0x1c')](function(_0x20fc9b){logger[_0x6180('0x19')](_0x6180('0x16'),_0x4fd411,_0x20fc9b);_0x1b9f19(_0x20fc9b);});});}function respondWithStatusCode(_0x589a74,_0x23a41a){_0x23a41a=_0x23a41a||0xcc;return function(_0x3261f2){if(_0x3261f2){return _0x589a74[_0x6180('0x1d')](_0x23a41a);}return _0x589a74[_0x6180('0x1e')](_0x23a41a)['end']();};}function respondWithResult(_0x3acc02,_0x3e05fe){_0x3e05fe=_0x3e05fe||0xc8;return function(_0x24ad44){if(_0x24ad44){return _0x3acc02[_0x6180('0x1e')](_0x3e05fe)[_0x6180('0x1f')](_0x24ad44);}};}function respondWithFilteredResult(_0x2830ca,_0x55b71b){return function(_0x58f69c){if(_0x58f69c){var _0xcc82d8=typeof _0x55b71b['offset']===_0x6180('0x20')&&typeof _0x55b71b[_0x6180('0x21')]===_0x6180('0x20');var _0x69a84f=_0x58f69c[_0x6180('0x22')];var _0x4c398b=_0xcc82d8?0x0:_0x55b71b[_0x6180('0x23')];var _0x1298c7=_0xcc82d8?_0x58f69c[_0x6180('0x22')]:_0x55b71b[_0x6180('0x23')]+_0x55b71b[_0x6180('0x21')];var _0x4e5bba;if(_0x1298c7>=_0x69a84f){_0x1298c7=_0x69a84f;_0x4e5bba=0xc8;}else{_0x4e5bba=0xce;}_0x2830ca[_0x6180('0x1e')](_0x4e5bba);return _0x2830ca['set'](_0x6180('0x24'),_0x4c398b+'-'+_0x1298c7+'/'+_0x69a84f)[_0x6180('0x1f')](_0x58f69c);}return null;};}function saveUpdates(_0x4431c9){return function(_0x1a4d3e){if(_0x1a4d3e){return _0x1a4d3e['update'](_0x4431c9)[_0x6180('0x14')](function(_0xef7ad){return _0xef7ad;});}return null;};}function removeEntity(_0x1df772){return function(_0x3b4151){if(_0x3b4151){return _0x3b4151[_0x6180('0x25')]()[_0x6180('0x14')](function(){var _0x47ee1f=_0x3b4151['get']({'plain':!![]});var _0x59c505='ChatWebsites';return db[_0x6180('0x26')][_0x6180('0x25')]({'where':{'type':_0x59c505,'resourceId':_0x47ee1f['id']}})[_0x6180('0x14')](function(){return _0x3b4151;});})['then'](function(){_0x1df772[_0x6180('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xddba3){return function(_0x2f83cd){if(!_0x2f83cd){_0xddba3[_0x6180('0x1d')](0x194);}return _0x2f83cd;};}function handleError(_0xd770d7,_0x4ec04b){_0x4ec04b=_0x4ec04b||0x1f4;return function(_0x27fd4a){logger[_0x6180('0x19')](_0x27fd4a[_0x6180('0x27')]);if(_0x27fd4a[_0x6180('0x28')]){delete _0x27fd4a[_0x6180('0x28')];}_0xd770d7[_0x6180('0x1e')](_0x4ec04b)[_0x6180('0x29')](_0x27fd4a);};}exports[_0x6180('0x2a')]=function(_0x2de8f4,_0x22bdec){var _0x584bb0={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4b8a51={},_0xd46127={'count':0x0,'rows':[]};var _0x1fed2e=_[_0x6180('0x2b')](db[_0x6180('0x2c')]['rawAttributes'],function(_0x440a97){return{'name':_0x440a97[_0x6180('0x2d')],'type':_0x440a97[_0x6180('0x2e')][_0x6180('0x2f')]};});_0x4b8a51[_0x6180('0x30')]=_[_0x6180('0x2b')](_0x1fed2e,'name');_0x4b8a51[_0x6180('0x31')]=_[_0x6180('0x32')](_0x2de8f4['query']);_0x4b8a51[_0x6180('0x33')]=_[_0x6180('0x34')](_0x4b8a51[_0x6180('0x30')],_0x4b8a51['query']);_0x584bb0[_0x6180('0x35')]=_[_0x6180('0x34')](_0x4b8a51[_0x6180('0x30')],qs[_0x6180('0x36')](_0x2de8f4['query']['fields']));_0x584bb0[_0x6180('0x35')]=_0x584bb0['attributes']['length']?_0x584bb0[_0x6180('0x35')]:_0x4b8a51[_0x6180('0x30')];if(!_0x2de8f4[_0x6180('0x31')]['hasOwnProperty'](_0x6180('0x37'))){_0x584bb0[_0x6180('0x21')]=qs[_0x6180('0x21')](_0x2de8f4['query'][_0x6180('0x21')]);_0x584bb0[_0x6180('0x23')]=qs[_0x6180('0x23')](_0x2de8f4['query'][_0x6180('0x23')]);}_0x584bb0[_0x6180('0x38')]=qs[_0x6180('0x39')](_0x2de8f4[_0x6180('0x31')]['sort']);_0x584bb0['where']=qs[_0x6180('0x33')](_[_0x6180('0x3a')](_0x2de8f4[_0x6180('0x31')],_0x4b8a51['filters']),_0x1fed2e);if(_0x2de8f4[_0x6180('0x31')][_0x6180('0x3b')]){_0x584bb0[_0x6180('0x3c')]=_[_0x6180('0x3d')](_0x584bb0[_0x6180('0x3c')],{'$or':_[_0x6180('0x2b')](_0x1fed2e,function(_0x57d8f7){if(_0x57d8f7[_0x6180('0x2e')]!==_0x6180('0x3e')){var _0x524ad0={};_0x524ad0[_0x57d8f7[_0x6180('0x28')]]={'$like':'%'+_0x2de8f4[_0x6180('0x31')][_0x6180('0x3b')]+'%'};return _0x524ad0;}})});}_0x584bb0=_['merge']({},_0x584bb0,_0x2de8f4[_0x6180('0x3f')]);var _0x19398b={'where':_0x584bb0[_0x6180('0x3c')]};return db[_0x6180('0x2c')]['count'](_0x19398b)[_0x6180('0x14')](function(_0x34bb3a){_0xd46127['count']=_0x34bb3a;if(_0x2de8f4[_0x6180('0x31')][_0x6180('0x40')]){_0x584bb0[_0x6180('0x41')]=[{'all':!![]}];}return db[_0x6180('0x2c')]['findAll'](_0x584bb0);})['then'](function(_0x2fce13){_0xd46127[_0x6180('0x42')]=_0x2fce13;return _0xd46127;})['then'](respondWithFilteredResult(_0x22bdec,_0x584bb0))[_0x6180('0x1c')](handleError(_0x22bdec,null));};exports['show']=function(_0x425d26,_0x5a416e){var _0x234e65={'raw':![],'where':{'id':_0x425d26['params']['id']},'include':[{'model':db['Pause'],'as':_0x6180('0x43')}]},_0x5813d0={};_0x5813d0[_0x6180('0x30')]=_[_0x6180('0x32')](db[_0x6180('0x2c')][_0x6180('0x44')]);_0x5813d0[_0x6180('0x31')]=_[_0x6180('0x32')](_0x425d26['query']);_0x5813d0[_0x6180('0x33')]=_[_0x6180('0x34')](_0x5813d0[_0x6180('0x30')],_0x5813d0[_0x6180('0x31')]);_0x234e65['attributes']=_[_0x6180('0x34')](_0x5813d0[_0x6180('0x30')],qs[_0x6180('0x36')](_0x425d26[_0x6180('0x31')]['fields']));_0x234e65[_0x6180('0x35')]=_0x234e65['attributes'][_0x6180('0x45')]?_0x234e65[_0x6180('0x35')]:_0x5813d0[_0x6180('0x30')];if(_0x425d26[_0x6180('0x31')][_0x6180('0x40')]){_0x234e65[_0x6180('0x41')]=[{'all':!![]}];}_0x234e65=_[_0x6180('0x3d')]({},_0x234e65,_0x425d26[_0x6180('0x3f')]);return db[_0x6180('0x2c')]['find'](_0x234e65)[_0x6180('0x14')](handleEntityNotFound(_0x5a416e,null))[_0x6180('0x14')](respondWithResult(_0x5a416e,null))['catch'](handleError(_0x5a416e,null));};exports[_0x6180('0x46')]=function(_0x38f699,_0xfb0115){return db[_0x6180('0x2c')][_0x6180('0x46')](_0x38f699[_0x6180('0x47')],{})[_0x6180('0x14')](function(_0xb62887){var _0x152ffb=_0x38f699[_0x6180('0x48')][_0x6180('0x49')]({'plain':!![]});if(!_0x152ffb)throw new Error(_0x6180('0x4a'));if(_0x152ffb['role']===_0x6180('0x48')){var _0x966c3b=_0xb62887[_0x6180('0x49')]({'plain':!![]});var _0x51eec6=_0x6180('0x4b');return db[_0x6180('0x4c')][_0x6180('0x4d')]({'where':{'name':_0x51eec6,'userProfileId':_0x152ffb[_0x6180('0x4e')]},'raw':!![]})[_0x6180('0x14')](function(_0x333aaa){if(_0x333aaa&&_0x333aaa[_0x6180('0x4f')]===0x0){return db['UserProfileResource'][_0x6180('0x46')]({'name':_0x966c3b[_0x6180('0x28')],'resourceId':_0x966c3b['id'],'type':_0x333aaa['name'],'sectionId':_0x333aaa['id']},{})[_0x6180('0x14')](function(){return _0xb62887;});}else{return _0xb62887;}})[_0x6180('0x1c')](function(_0x4fa84d){logger['error'](_0x6180('0x50'),_0x4fa84d);throw _0x4fa84d;});}return _0xb62887;})[_0x6180('0x14')](respondWithResult(_0xfb0115,0xc9))[_0x6180('0x1c')](handleError(_0xfb0115,null));};exports[_0x6180('0x51')]=function(_0xea5f8c,_0xceefc9){if(_0xea5f8c[_0x6180('0x47')]['id']){delete _0xea5f8c['body']['id'];}return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0xea5f8c[_0x6180('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x6180('0x43')}]})[_0x6180('0x14')](handleEntityNotFound(_0xceefc9,null))[_0x6180('0x14')](saveUpdates(_0xea5f8c[_0x6180('0x47')],null))['then'](respondWithResult(_0xceefc9,null))[_0x6180('0x1c')](handleError(_0xceefc9,null));};exports[_0x6180('0x25')]=function(_0x3d164c,_0x390541){return db[_0x6180('0x2c')]['find']({'where':{'id':_0x3d164c[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x390541,null))[_0x6180('0x14')](removeEntity(_0x390541,null))[_0x6180('0x1c')](handleError(_0x390541,null));};exports[_0x6180('0x53')]=function(_0x2b4a74,_0x189564){return db[_0x6180('0x2c')][_0x6180('0x53')]()['then'](respondWithResult(_0x189564,null))[_0x6180('0x1c')](handleError(_0x189564,null));};exports[_0x6180('0x54')]=function(_0x223982,_0x2b6abc){if(_0x223982[_0x6180('0x47')]['id']){delete _0x223982[_0x6180('0x47')]['id'];}return db[_0x6180('0x2c')]['find']({'where':{'id':_0x223982[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x2b6abc,null))[_0x6180('0x14')](function(_0x2ef3d3){if(_0x2ef3d3){_0x223982['body'][_0x6180('0x55')]=_0x2ef3d3['id'];return db[_0x6180('0x56')][_0x6180('0x46')](_0x223982['body']);}})[_0x6180('0x14')](respondWithResult(_0x2b6abc,null))[_0x6180('0x1c')](handleError(_0x2b6abc,null));};exports[_0x6180('0x57')]=function(_0x19afac,_0x1d0bd8){var _0x5b4858={'raw':![],'where':{}};var _0x5a156f={};var _0x2fade1={'count':0x0,'rows':[]};return db[_0x6180('0x2c')]['findOne']({'where':{'id':_0x19afac[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x1d0bd8,null))[_0x6180('0x14')](function(_0x47d775){if(_0x47d775){_0x5a156f[_0x6180('0x30')]=_[_0x6180('0x32')](db[_0x6180('0x56')][_0x6180('0x44')]);_0x5a156f[_0x6180('0x31')]=_[_0x6180('0x32')](_0x19afac[_0x6180('0x31')]);_0x5a156f[_0x6180('0x33')]=_['intersection'](_0x5a156f['model'],_0x5a156f[_0x6180('0x31')]);_0x5b4858[_0x6180('0x35')]=_['intersection'](_0x5a156f['model'],qs[_0x6180('0x36')](_0x19afac[_0x6180('0x31')][_0x6180('0x36')]));_0x5b4858[_0x6180('0x35')]=_0x5b4858['attributes'][_0x6180('0x45')]?_0x5b4858['attributes']:_0x5a156f[_0x6180('0x30')];if(!_0x19afac[_0x6180('0x31')][_0x6180('0x58')](_0x6180('0x37'))){_0x5b4858[_0x6180('0x21')]=qs[_0x6180('0x21')](_0x19afac['query'][_0x6180('0x21')]);_0x5b4858[_0x6180('0x23')]=qs['offset'](_0x19afac['query'][_0x6180('0x23')]);}_0x5b4858['order']=qs[_0x6180('0x39')](_0x19afac['query'][_0x6180('0x39')]);_0x5b4858[_0x6180('0x3c')]=qs[_0x6180('0x33')](_[_0x6180('0x3a')](_0x19afac[_0x6180('0x31')],_0x5a156f[_0x6180('0x33')]));_0x5b4858[_0x6180('0x3c')][_0x6180('0x55')]=_0x47d775['id'];if(_0x19afac[_0x6180('0x31')]['filter']){_0x5b4858[_0x6180('0x3c')]=_[_0x6180('0x3d')](_0x5b4858[_0x6180('0x3c')],{'$or':_['map'](_0x5b4858[_0x6180('0x35')],function(_0x565217){var _0x21a3b4={};_0x21a3b4[_0x565217]={'$like':'%'+_0x19afac[_0x6180('0x31')]['filter']+'%'};return _0x21a3b4;})});}_0x5b4858=_[_0x6180('0x3d')]({},_0x5b4858,_0x19afac[_0x6180('0x3f')]);return db[_0x6180('0x56')][_0x6180('0x22')]({'where':_0x5b4858[_0x6180('0x3c')]})[_0x6180('0x14')](function(_0x4afeaa){_0x2fade1[_0x6180('0x22')]=_0x4afeaa;if(_0x19afac[_0x6180('0x31')][_0x6180('0x40')]){_0x5b4858['include']=[{'all':!![]}];}return db[_0x6180('0x56')]['findAll'](_0x5b4858);})['then'](function(_0x3cada6){_0x2fade1[_0x6180('0x42')]=_0x3cada6;return _0x2fade1;});}})[_0x6180('0x14')](respondWithFilteredResult(_0x1d0bd8,_0x5b4858))['catch'](handleError(_0x1d0bd8,null));};exports[_0x6180('0x59')]=function(_0x27df8d,_0xa00c3c){return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0x27df8d[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0xa00c3c,null))[_0x6180('0x14')](function(_0xbb1581){if(_0xbb1581){return _0xbb1581['removeDispositions'](_0x27df8d[_0x6180('0x31')][_0x6180('0x5a')]);}})[_0x6180('0x14')](respondWithStatusCode(_0xa00c3c,null))[_0x6180('0x1c')](handleError(_0xa00c3c,null));};exports['addAnswer']=function(_0x7a51d3,_0x1a3fcc){if(_0x7a51d3[_0x6180('0x47')]['id']){delete _0x7a51d3[_0x6180('0x47')]['id'];}return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0x7a51d3[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x1a3fcc,null))['then'](function(_0x35a3cc){if(_0x35a3cc){_0x7a51d3[_0x6180('0x47')][_0x6180('0x55')]=_0x35a3cc['id'];return db[_0x6180('0x5b')]['create'](_0x7a51d3[_0x6180('0x47')]);}})[_0x6180('0x14')](respondWithResult(_0x1a3fcc,null))['catch'](handleError(_0x1a3fcc,null));};exports['getAnswers']=function(_0x2552ac,_0x3e8ab7){var _0x4d5e37={'raw':![],'where':{}};var _0x4af3cd={};var _0x2b11fe={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6180('0x5c')]({'where':{'id':_0x2552ac[_0x6180('0x52')]['id']}})['then'](handleEntityNotFound(_0x3e8ab7,null))[_0x6180('0x14')](function(_0x54c40a){if(_0x54c40a){_0x4af3cd[_0x6180('0x30')]=_[_0x6180('0x32')](db['CannedAnswer'][_0x6180('0x44')]);_0x4af3cd[_0x6180('0x31')]=_[_0x6180('0x32')](_0x2552ac[_0x6180('0x31')]);_0x4af3cd[_0x6180('0x33')]=_[_0x6180('0x34')](_0x4af3cd[_0x6180('0x30')],_0x4af3cd[_0x6180('0x31')]);_0x4d5e37['attributes']=_[_0x6180('0x34')](_0x4af3cd[_0x6180('0x30')],qs[_0x6180('0x36')](_0x2552ac[_0x6180('0x31')]['fields']));_0x4d5e37[_0x6180('0x35')]=_0x4d5e37[_0x6180('0x35')][_0x6180('0x45')]?_0x4d5e37[_0x6180('0x35')]:_0x4af3cd[_0x6180('0x30')];if(!_0x2552ac[_0x6180('0x31')][_0x6180('0x58')](_0x6180('0x37'))){_0x4d5e37[_0x6180('0x21')]=qs[_0x6180('0x21')](_0x2552ac[_0x6180('0x31')][_0x6180('0x21')]);_0x4d5e37[_0x6180('0x23')]=qs[_0x6180('0x23')](_0x2552ac[_0x6180('0x31')]['offset']);}_0x4d5e37['order']=qs[_0x6180('0x39')](_0x2552ac['query'][_0x6180('0x39')]);_0x4d5e37[_0x6180('0x3c')]=qs[_0x6180('0x33')](_[_0x6180('0x3a')](_0x2552ac[_0x6180('0x31')],_0x4af3cd[_0x6180('0x33')]));_0x4d5e37['where'][_0x6180('0x55')]=_0x54c40a['id'];if(_0x2552ac['query'][_0x6180('0x3b')]){_0x4d5e37[_0x6180('0x3c')]=_[_0x6180('0x3d')](_0x4d5e37[_0x6180('0x3c')],{'$or':_[_0x6180('0x2b')](_0x4d5e37[_0x6180('0x35')],function(_0x3e426a){var _0x39dc40={};_0x39dc40[_0x3e426a]={'$like':'%'+_0x2552ac['query'][_0x6180('0x3b')]+'%'};return _0x39dc40;})});}_0x4d5e37=_[_0x6180('0x3d')]({},_0x4d5e37,_0x2552ac[_0x6180('0x3f')]);return db['CannedAnswer'][_0x6180('0x22')]({'where':_0x4d5e37[_0x6180('0x3c')]})[_0x6180('0x14')](function(_0x52d45b){_0x2b11fe[_0x6180('0x22')]=_0x52d45b;if(_0x2552ac[_0x6180('0x31')]['includeAll']){_0x4d5e37[_0x6180('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6180('0x5d')](_0x4d5e37);})['then'](function(_0x4455bb){_0x2b11fe[_0x6180('0x42')]=_0x4455bb;return _0x2b11fe;});}})[_0x6180('0x14')](respondWithFilteredResult(_0x3e8ab7,_0x4d5e37))[_0x6180('0x1c')](handleError(_0x3e8ab7,null));};exports['removeAnswers']=function(_0x42d426,_0x4a9559){return db['ChatWebsite'][_0x6180('0x4d')]({'where':{'id':_0x42d426['params']['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x4a9559,null))['then'](function(_0x2d4740){if(_0x2d4740){return _0x2d4740[_0x6180('0x5e')](_0x42d426[_0x6180('0x31')]['ids']);}})[_0x6180('0x14')](respondWithStatusCode(_0x4a9559,null))[_0x6180('0x1c')](handleError(_0x4a9559,null));};exports[_0x6180('0x5f')]=function(_0x2a4ae5,_0x17282d){_0x2a4ae5['body'][_0x6180('0x60')]=_0x2a4ae5[_0x6180('0x61')][_0x6180('0x62')];return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0x2a4ae5[_0x6180('0x52')]['id']}})['then'](handleEntityNotFound(_0x17282d,null))[_0x6180('0x14')](saveUpdates(_0x2a4ae5[_0x6180('0x47')],null))[_0x6180('0x14')](respondWithResult(_0x17282d,null))[_0x6180('0x1c')](handleError(_0x17282d,null));};exports['addAvatar']=function(_0x337115,_0x631335){_0x337115['body']['agentAvatar']=_0x337115[_0x6180('0x61')][_0x6180('0x62')];return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0x337115[_0x6180('0x52')]['id']}})['then'](handleEntityNotFound(_0x631335,null))[_0x6180('0x14')](saveUpdates(_0x337115['body'],null))[_0x6180('0x14')](respondWithResult(_0x631335,null))[_0x6180('0x1c')](handleError(_0x631335,null));};exports['addCustomerAvatar']=function(_0x45a998,_0x15fb89){_0x45a998[_0x6180('0x47')]['customerAvatar']=_0x45a998[_0x6180('0x61')][_0x6180('0x62')];return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0x45a998['params']['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x15fb89,null))['then'](saveUpdates(_0x45a998['body'],null))[_0x6180('0x14')](respondWithResult(_0x15fb89,null))[_0x6180('0x1c')](handleError(_0x15fb89,null));};exports['addSystemAvatar']=function(_0x1f918b,_0x41682a){_0x1f918b[_0x6180('0x47')]['systemAvatar']=_0x1f918b[_0x6180('0x61')]['filename'];return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0x1f918b[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x41682a,null))[_0x6180('0x14')](saveUpdates(_0x1f918b['body'],null))[_0x6180('0x14')](respondWithResult(_0x41682a,null))['catch'](handleError(_0x41682a,null));};exports[_0x6180('0x63')]=function(_0x3fd8b7,_0x9bc909){var _0x1af513=path[_0x6180('0x64')](config['root'],_0x6180('0x65'));var _0x3866da={'where':{'id':_0x3fd8b7[_0x6180('0x52')]['id']},'attributes':['id',_0x6180('0x60')],'raw':!![]};var _0x3d6c22=![];return require(_0x6180('0x66'))[_0x6180('0x67')]()['then'](function(_0x12c94c){if(_0x12c94c){_0x3d6c22=_0x12c94c[_0x6180('0x68')];}})[_0x6180('0x14')](function(){return db[_0x6180('0x2c')][_0x6180('0x4d')](_0x3866da);})[_0x6180('0x14')](handleEntityNotFound(_0x9bc909,null))[_0x6180('0x14')](function(_0x40593b){if(_0x40593b){if(!_[_0x6180('0x69')](_0x40593b[_0x6180('0x60')])){if(fs[_0x6180('0x6a')](path['join'](config[_0x6180('0x6b')],_0x6180('0x6c'),_0x40593b[_0x6180('0x60')]))&&_0x3d6c22){_0x1af513=path[_0x6180('0x64')](config[_0x6180('0x6b')],'server/files/images/logos/',_0x40593b['sitepic']);}}return _0x9bc909[_0x6180('0x6d')](_0x1af513);}})['catch'](handleError(_0x9bc909,null));};exports[_0x6180('0x6e')]=function(_0x31baca,_0x248f44){var _0x18a936=path[_0x6180('0x64')](config[_0x6180('0x6b')],_0x6180('0x6f'));var _0x4d1441={'where':{'id':_0x31baca['params']['id']},'attributes':['id',_0x6180('0x70')],'raw':!![]};return db[_0x6180('0x2c')][_0x6180('0x4d')](_0x4d1441)[_0x6180('0x14')](handleEntityNotFound(_0x248f44,null))[_0x6180('0x14')](function(_0x4e5723){if(_0x4e5723){if(!_[_0x6180('0x69')](_0x4e5723[_0x6180('0x70')])){if(fs[_0x6180('0x6a')](path[_0x6180('0x64')](config[_0x6180('0x6b')],_0x6180('0x71'),_0x4e5723[_0x6180('0x70')]))){_0x18a936=path[_0x6180('0x64')](config['root'],_0x6180('0x71'),_0x4e5723[_0x6180('0x70')]);}}return _0x248f44[_0x6180('0x6d')](_0x18a936);}})[_0x6180('0x1c')](handleError(_0x248f44,null));};exports[_0x6180('0x72')]=function(_0x3c5ad0,_0x68f219){var _0x41aba0=path[_0x6180('0x64')](config[_0x6180('0x6b')],'server/files/images/avatars/customer_avatar.png');var _0xfc06de={'where':{'id':_0x3c5ad0[_0x6180('0x52')]['id']},'attributes':['id','customerAvatar',_0x6180('0x73')],'raw':!![]};return db['ChatWebsite'][_0x6180('0x4d')](_0xfc06de)['then'](handleEntityNotFound(_0x68f219,null))['then'](function(_0x4c0fc9){if(_0x4c0fc9){if(!_['isNil'](_0x4c0fc9[_0x6180('0x74')])){if(fs[_0x6180('0x6a')](path['join'](config[_0x6180('0x6b')],_0x6180('0x71'),_0x4c0fc9[_0x6180('0x74')]))&&_0x4c0fc9[_0x6180('0x73')]){_0x41aba0=path[_0x6180('0x64')](config[_0x6180('0x6b')],_0x6180('0x71'),_0x4c0fc9[_0x6180('0x74')]);}}return _0x68f219['download'](_0x41aba0);}})[_0x6180('0x1c')](handleError(_0x68f219,null));};exports[_0x6180('0x75')]=function(_0x4c2b36,_0x31bd79){var _0x44fa36=path[_0x6180('0x64')](config[_0x6180('0x6b')],'server/files/images/avatars/system_avatar.png');var _0x5ce254={'where':{'id':_0x4c2b36[_0x6180('0x52')]['id']},'attributes':['id',_0x6180('0x76')],'raw':!![]};return db[_0x6180('0x2c')][_0x6180('0x4d')](_0x5ce254)[_0x6180('0x14')](handleEntityNotFound(_0x31bd79,null))[_0x6180('0x14')](function(_0x42420a){if(_0x42420a){if(!_['isNil'](_0x42420a[_0x6180('0x76')])){if(fs[_0x6180('0x6a')](path[_0x6180('0x64')](config[_0x6180('0x6b')],'server/files/images/avatars/',_0x42420a[_0x6180('0x76')]))){_0x44fa36=path['join'](config[_0x6180('0x6b')],_0x6180('0x71'),_0x42420a[_0x6180('0x76')]);}}return _0x31bd79['download'](_0x44fa36);}})['catch'](handleError(_0x31bd79,null));};exports[_0x6180('0x77')]=function(_0x1abb72,_0x1027c3){var _0x4f3f41=require('user-agent-parser');var _0x9c08f8=new _0x4f3f41();var _0x4b8c94=_0x9c08f8[_0x6180('0x78')](_0x1abb72[_0x6180('0x79')]['user-agent'])[_0x6180('0x7a')]();var _0x23ef81={'body':_0x1abb72[_0x6180('0x47')],'channel':'chat'};var _0x511db4=[];var _0x3b025a=[];var _0x3c8de1={};var _0x2227a9=![];return db[_0x6180('0x7b')][_0x6180('0x53')]()[_0x6180('0x14')](function(_0x4bb03a){if(!_0x4bb03a){throw new db['Sequelize']['ValidationError'](_0x6180('0x7c'));}_0x511db4=_[_0x6180('0x7d')](_['keys'](_0x4bb03a),[_0x6180('0x7e'),'updatedAt']);_0x3b025a=_[_0x6180('0x7d')](_['keys'](_0x4bb03a),[_0x6180('0x7e'),_0x6180('0x7f'),_0x6180('0x80'),_0x6180('0x81')]);if(_0x1abb72[_0x6180('0x47')]['id']){delete _0x1abb72[_0x6180('0x47')]['id'];}if(_[_0x6180('0x69')](_0x1abb72[_0x6180('0x47')][_0x6180('0x82')])){throw new db['Sequelize']['ValidationError'](_0x6180('0x83'));}if(_['isNil'](_0x1abb72['body']['body'])||_0x1abb72[_0x6180('0x47')]['body']===''){throw new db['Sequelize'][(_0x6180('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1abb72[_0x6180('0x47')]['mapKey'])){throw new db[(_0x6180('0x85'))][(_0x6180('0x84'))](_0x6180('0x86')+_0x3b025a);}if(!_['includes'](_0x3b025a,_0x1abb72[_0x6180('0x47')][_0x6180('0x87')])){throw new db['Sequelize'][(_0x6180('0x84'))](_0x6180('0x88')+_0x3b025a);}_0x3c8de1[_0x1abb72[_0x6180('0x47')][_0x6180('0x87')]]=_0x1abb72['body']['from'];})[_0x6180('0x14')](function(){return db[_0x6180('0x2c')][_0x6180('0x4d')]({'where':{'id':_0x1abb72[_0x6180('0x52')]['id']},'include':[{'model':db[_0x6180('0x89')],'as':_0x6180('0x8a'),'include':[{'model':db[_0x6180('0x7b')],'as':_0x6180('0x8b'),'where':_0x3c8de1,'limit':0x1,'order':[[_0x6180('0x7f'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x6180('0x8c')}]});})[_0x6180('0x14')](handleEntityNotFound(_0x1027c3,null))['then'](function(_0x1530aa){if(_0x1530aa&&_0x1530aa[_0x6180('0x8a')]){_0x23ef81[_0x6180('0x8d')]=_0x1530aa;_0x23ef81[_0x6180('0x8e')]=_0x1530aa[_0x6180('0x8c')];_0x23ef81['list']=_0x1530aa[_0x6180('0x8a')];_0x23ef81[_0x6180('0x8e')]=_['orderBy'](_0x23ef81['applications'],['priority'],[_0x6180('0x8f')]);if(_0x23ef81[_0x6180('0x8d')][_0x6180('0x8c')]){delete _0x23ef81['account'][_0x6180('0x8c')];}if(_0x23ef81[_0x6180('0x8d')]['List']&&_0x23ef81[_0x6180('0x8d')][_0x6180('0x8a')]['Contacts']['length']){return _0x23ef81[_0x6180('0x8d')][_0x6180('0x8a')][_0x6180('0x8b')][0x0];}var _0x5e8515=_[_0x6180('0xa')](_0x1abb72['body'],{'firstName':_0x1abb72[_0x6180('0x47')][_0x6180('0x82')],'ListId':_0x1530aa[_0x6180('0x81')]});_0x5e8515[_0x1abb72[_0x6180('0x47')]['mapKey']]=_0x1abb72[_0x6180('0x47')]['from'];return db[_0x6180('0x7b')]['create'](_0x5e8515,{'fields':_0x511db4,'raw':!![]});}})[_0x6180('0x14')](handleEntityNotFound(_0x1027c3,null))[_0x6180('0x14')](function(_0x5eb357){_0x23ef81[_0x6180('0x90')]=_0x5eb357;var _0x550ae7=_0x1abb72[_0x6180('0x47')][_0x6180('0x91')];if(_0x1abb72[_0x6180('0x79')][_0x6180('0x92')]){_0x550ae7=_0x1abb72[_0x6180('0x79')]['cf-connecting-ip'];}else if(_0x1abb72[_0x6180('0x79')]['x-forwarded-for']){_0x550ae7=_['first'](_0x1abb72[_0x6180('0x79')]['x-forwarded-for'][_0x6180('0x93')](','));}if(_0x5eb357){var _0x41bd41={'ContactId':_0x5eb357['id'],'ChatWebsiteId':_0x1abb72[_0x6180('0x52')]['id'],'from':(_0x5eb357[_0x6180('0x94')]||'')+'\x20'+(_0x5eb357[_0x6180('0x95')]||''),'customerIp':_0x550ae7,'customerPort':_0x1abb72['headers'][_0x6180('0x96')]?_0x1abb72[_0x6180('0x79')][_0x6180('0x96')]:null,'referer':_0x1abb72[_0x6180('0x47')]['referer'],'browserName':_0x4b8c94[_0x6180('0x97')][_0x6180('0x28')]&&_0x4b8c94[_0x6180('0x97')][_0x6180('0x98')]?util[_0x6180('0x99')](_0x6180('0x9a'),_0x4b8c94[_0x6180('0x97')][_0x6180('0x28')],_0x4b8c94[_0x6180('0x97')]['version']):'unknown','browserVersion':_0x4b8c94[_0x6180('0x97')][_0x6180('0x98')]||_0x6180('0x9b'),'osName':util['format']('%s\x20%s',_0x4b8c94['os'][_0x6180('0x28')],_0x4b8c94['os'][_0x6180('0x98')]),'osVersion':_0x4b8c94['os'][_0x6180('0x98')],'deviceModel':_0x4b8c94[_0x6180('0x9c')]['model']&&_0x4b8c94[_0x6180('0x9c')][_0x6180('0x9d')]?util[_0x6180('0x99')](_0x6180('0x9e'),_0x4b8c94['device'][_0x6180('0x30')],_0x4b8c94[_0x6180('0x9c')][_0x6180('0x9d')],_0x4b8c94[_0x6180('0x9c')][_0x6180('0x2e')]):null,'deviceVendor':_0x4b8c94[_0x6180('0x9c')][_0x6180('0x9d')],'deviceType':_0x4b8c94[_0x6180('0x9c')][_0x6180('0x2e')],'formData':JSON['stringify'](_0x1abb72['body'])};var _0x34b7c5={'ChatWebsiteId':_0x1abb72[_0x6180('0x52')]['id'],'closed':![]};if(_0x1abb72['body'][_0x6180('0x9f')]){_0x34b7c5[_0x6180('0x9f')]=_0x1abb72[_0x6180('0x47')][_0x6180('0x9f')];return db['ChatInteraction'][_0x6180('0x4d')]({'where':_0x34b7c5})['then'](function(_0x383f6c){if(_0x383f6c){return[_0x383f6c,![]];}_0x41bd41[_0x6180('0x9f')]=_0x1abb72[_0x6180('0x47')][_0x6180('0x9f')];_0x41bd41[_0x6180('0xa0')]=_0x1abb72[_0x6180('0x47')]['externalUrl'];return db[_0x6180('0xa1')][_0x6180('0x46')](_0x41bd41)[_0x6180('0x14')](function(_0x32ccf0){return[_0x32ccf0,!![]];});});}_0x34b7c5['ContactId']=_0x5eb357['id'];if(_0x1abb72['body'][_0x6180('0xa2')]&&_0x1abb72[_0x6180('0x47')]['interaction']['id']){_0x34b7c5['id']=_0x1abb72[_0x6180('0x47')][_0x6180('0xa2')]['id'];return db['ChatInteraction'][_0x6180('0x4d')]({'where':_0x34b7c5})[_0x6180('0x14')](function(_0xb24872){if(_0xb24872){return[_0xb24872,![]];}return db[_0x6180('0xa1')][_0x6180('0x46')](_0x41bd41)[_0x6180('0x14')](function(_0x4ac1d0){return[_0x4ac1d0,!![]];});});}return db[_0x6180('0xa1')][_0x6180('0x46')](_0x41bd41)[_0x6180('0x14')](function(_0x94799e){return[_0x94799e,!![]];});}})['spread'](function(_0x4d4172,_0x3f8bda){if(_0x4d4172){_0x2227a9=_0x3f8bda;if(!_0x3f8bda){var _0x33d217={'from':(_0x23ef81[_0x6180('0x90')]['firstName']||'')+'\x20'+(_0x23ef81[_0x6180('0x90')]['lastName']||'')};if(_0x1abb72[_0x6180('0x47')][_0x6180('0x9f')]&&_0x1abb72[_0x6180('0x47')][_0x6180('0xa3')]&&_0x1abb72[_0x6180('0x47')][_0x6180('0x9f')]!=_0x1abb72[_0x6180('0x47')][_0x6180('0xa3')]){_0x33d217[_0x6180('0x9f')]=_0x1abb72[_0x6180('0x47')][_0x6180('0xa3')];}return _0x4d4172[_0x6180('0x51')](_0x33d217);}else{return _0x4d4172;}}})[_0x6180('0x14')](function(_0x185e75){_0x23ef81['interaction']=_0x185e75['get']({'plain':!![]});_0x23ef81['interaction'][_0x6180('0xa4')]=_0x2227a9;if(_0x23ef81['interaction'][_0x6180('0xa4')]){if(_0x23ef81[_0x6180('0x8d')][_0x6180('0xa5')]){_0x23ef81[_0x6180('0x8e')][_0x6180('0xa6')]({'id':0x0,'priority':_0x23ef81[_0x6180('0x8e')][_0x6180('0x45')]+0x1,'app':_0x6180('0xa7'),'appdata':_0x6180('0xa8'),'interval':_0x6180('0xa9')});}}return db['ChatMessage'][_0x6180('0x46')]({'body':_0x1abb72[_0x6180('0x47')]['body'],'ChatWebsiteId':_0x1abb72[_0x6180('0x52')]['id'],'ChatInteractionId':_0x185e75['id'],'direction':'in','ContactId':_0x23ef81[_0x6180('0x90')]['id'],'AttachmentId':_0x1abb72[_0x6180('0x47')][_0x6180('0xaa')]});})[_0x6180('0x14')](function(_0x1b79d2){_0x23ef81[_0x6180('0x1b')]=_0x1b79d2;if(_0x23ef81['interaction'][_0x6180('0xab')]){return db[_0x6180('0xac')][_0x6180('0x4d')]({'attributes':['id',_0x6180('0x28')],'where':{'id':_0x23ef81['interaction'][_0x6180('0xab')]}})['then'](function(_0x3f26f4){if(_0x3f26f4){_0x23ef81[_0x6180('0x8e')][_0x6180('0xad')]({'id':0x0,'priority':0x0,'app':_0x6180('0xae'),'appdata':_0x3f26f4[_0x6180('0x28')]+','+(_0x23ef81[_0x6180('0x8d')]['waitForTheAssignedAgent']||0xa),'interval':_0x6180('0xa9')});_0x23ef81['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x6180('0xaf'),_0x23ef81);});}return respondWithRpcPromise(_0x6180('0xb0'),'startRouting',_0x23ef81);})[_0x6180('0x14')](function(_0x17470e){respondWithRpcPromise(_0x6180('0xb1'),_0x6180('0xb1'),{'event':'notify','message':_0x17470e},client9002);return _0x17470e;})['then'](respondWithResult(_0x1027c3,null))['catch'](handleError(_0x1027c3,null));};exports['offline']=function(_0x723b52,_0x2db59f){var _0x2e38bf,_0x4f62d,_0x4484f4;var _0xc84533=[];var _0x6a406c={};var _0x4fc8a6=_0x723b52[_0x6180('0xb2')]||[];var _0x144c84=[];var _0x1602f4;return db[_0x6180('0x7b')][_0x6180('0x53')]()[_0x6180('0x14')](function(_0x317ce2){if(!_0x317ce2){throw new db[(_0x6180('0x85'))][(_0x6180('0x84'))]('no\x20available\x20attributes');}_0xc84533=_['difference'](_['keys'](_0x317ce2),[_0x6180('0x7e'),_0x6180('0x7f'),_0x6180('0x80'),'ListId']);if(_0x723b52[_0x6180('0x47')]['id']){delete _0x723b52[_0x6180('0x47')]['id'];}if(_[_0x6180('0x69')](_0x723b52[_0x6180('0x47')]['from'])){throw _0x2db59f[_0x6180('0x1e')](0x1f4)[_0x6180('0x29')](new db['Sequelize'][(_0x6180('0x84'))]('from\x20is\x20mandatory'));}if(_[_0x6180('0x69')](_0x723b52[_0x6180('0x47')][_0x6180('0x47')])||_0x723b52[_0x6180('0x47')][_0x6180('0x47')]===''){throw _0x2db59f[_0x6180('0x1e')](0x1f4)[_0x6180('0x29')](new db['Sequelize'][(_0x6180('0x84'))](_0x6180('0xb3')));}if(_['isNil'](_0x723b52[_0x6180('0x47')][_0x6180('0xb4')])){throw _0x2db59f[_0x6180('0x1e')](0x1f4)[_0x6180('0x29')](new db['Sequelize']['ValidationError'](_0x6180('0xb5')+_0xc84533));}if(!_['includes'](_0xc84533,_0x723b52[_0x6180('0x47')]['mapKeyOffline'])){throw _0x2db59f[_0x6180('0x1e')](0x1f4)[_0x6180('0x29')](new db[(_0x6180('0x85'))][(_0x6180('0x84'))](_0x6180('0xb6')+_0xc84533));}_0x6a406c[_0x723b52[_0x6180('0x47')][_0x6180('0xb4')]]=_0x723b52[_0x6180('0x47')]['from'];})[_0x6180('0x14')](function(){return db[_0x6180('0x2c')]['find']({'where':{'id':_0x723b52['params']['id']},'include':[{'model':db[_0x6180('0x89')],'as':_0x6180('0x8a')},{'model':db[_0x6180('0xb7')],'as':'MailAccount'}]});})[_0x6180('0x14')](handleEntityNotFound(_0x2db59f,null))['then'](function(_0x3ee7d2){if(_0x3ee7d2&&_0x3ee7d2[_0x6180('0x8a')]){_0x4f62d=_0x3ee7d2;var _0x3b8fa6=_[_0x6180('0xa')](_0x723b52[_0x6180('0x47')],{'firstName':_0x723b52[_0x6180('0x47')][_0x6180('0x82')],'phone':_0x723b52[_0x6180('0x47')][_0x6180('0x82')],'ListId':_0x3ee7d2[_0x6180('0x81')]});_0x3b8fa6[_0x723b52[_0x6180('0x47')][_0x6180('0xb4')]]=_0x723b52[_0x6180('0x47')][_0x6180('0x82')];return db['CmContact'][_0x6180('0xb8')]({'where':_0x6a406c,'defaults':_0x3b8fa6});}})[_0x6180('0xb9')](function(_0x3f80c3){if(_0x3f80c3){_0x4484f4=_0x3f80c3;var _0x5893a6=fs[_0x6180('0xba')](path[_0x6180('0x64')](config[_0x6180('0x6b')],_0x6180('0xbb')),_0x6180('0xbc'));var _0x57bbaa=ejs[_0x6180('0xbd')](_0x5893a6,{'body':_['toPairs'](_0x723b52[_0x6180('0x47')][_0x6180('0x47')]),'bodyTitle':_0x4f62d['offlineMessageBody']});return db[_0x6180('0xbe')][_0x6180('0x46')]({'body':_0x57bbaa,'plainBody':htmlToText[_0x6180('0xbf')](_0x57bbaa),'ContactId':_0x3f80c3['id'],'ChatWebsiteId':_0x4f62d['id']});}})[_0x6180('0x14')](function(_0x216358){_0x1602f4=_0x216358;if(_0x4fc8a6[_0x6180('0x45')]){var _0x52abf3=_0x4fc8a6[_0x6180('0x2b')](function(_0x830e54){return{'name':_0x830e54[_0x6180('0xc0')],'basename':_0x830e54[_0x6180('0x62')],'type':_0x830e54['mimetype'],'ChatOfflineMessageId':_0x216358['id']};});_0x144c84=_0x52abf3[_0x6180('0x2b')](_0x1f87fb=>{var _0x2652cc={'filename':_0x1f87fb[_0x6180('0x28')],'path':path[_0x6180('0x64')](config[_0x6180('0x6b')],_0x6180('0xc1'),_0x6180('0xb2'),_0x6180('0xc2'),'offline-chat',_0x1f87fb['basename'])};return _0x2652cc;});if(!_0x4f62d[_0x6180('0xc3')]){return db[_0x6180('0xc4')]['transaction'](function(_0x4266bc){return db['Attachment']['bulkCreate'](_0x52abf3,{'transaction':_0x4266bc});});}}})[_0x6180('0x14')](function(){if(_0x1602f4){_0x2e38bf=_0x1602f4;return db['MailAccount'][_0x6180('0x5c')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6180('0xc5'),'raw':!![],'include':[{'model':db[_0x6180('0xc6')],'as':_0x6180('0xc6'),'raw':!![]}]}]});}})[_0x6180('0x14')](function(_0x400c4c){if(_0x400c4c&&_0x400c4c[_0x6180('0xc5')]&&_0x4f62d[_0x6180('0xc7')]&&_0x4f62d[_0x6180('0xc8')]){var _0x20f229=_0x400c4c[_0x6180('0xc9')]();return respondWithRpcPromise('SendMail',_0x6180('0xca'),{'account':_0x20f229,'message':{'from':util[_0x6180('0x99')](_0x6180('0xcb'),_0x400c4c[_0x6180('0x28')],_0x400c4c[_0x6180('0xcc')]||_0x400c4c[_0x6180('0xc5')]['user']),'to':_0x4f62d[_0x6180('0xc8')],'subject':_0x4f62d[_0x6180('0xcd')],'html':_0x2e38bf[_0x6180('0x47')],'attachments':_0x144c84}},client9003)[_0x6180('0x14')](function(){return _0x2e38bf;})[_0x6180('0x1c')](function(_0x423582){logger[_0x6180('0x19')](_0x423582);});}})['then'](function(){if(_0x4f62d&&_0x4f62d[_0x6180('0xc3')]&&_0x4f62d['MailAccountId']){var _0x4e26a8=[];if(_0x4fc8a6[_0x6180('0x45')]){_0x4e26a8=_0x4fc8a6[_0x6180('0x2b')](function(_0x3b3451){return{'name':_0x3b3451[_0x6180('0xc0')],'basename':_0x3b3451[_0x6180('0x62')],'type':_0x3b3451[_0x6180('0xce')],'ChatOfflineMessageId':_0x1602f4['id']};});}var _0x4694bb;if(!_['isNil'](_0x4f62d[_0x6180('0xcf')])){var _0x259295=_[_0x6180('0x2b')](_0x723b52['body'],function(_0x254e98){return _0x254e98;});var _0x11dbc8=_['toPairsIn'](_0x259295)[0x0];var _0x43855f=_[_0x6180('0xd0')](_0x11dbc8,function(_0x533064){return _0x533064;});_0x4694bb=_0x43855f[0x1][_0x4f62d[_0x6180('0xcf')]];}var _0x4f4b1d={'from':_0x4484f4['email'],'firstName':_0x4484f4[_0x6180('0x94')],'lastName':_0x4484f4[_0x6180('0x95')],'mapKey':_0x6180('0xcc'),'message':{'from':_0x4484f4[_0x6180('0xcc')],'to':_0x4f62d[_0x6180('0xb7')][_0x6180('0xcc')],'cc':'','subject':_['isNil'](_0x4694bb)?_0x4f62d[_0x6180('0xcd')]:_0x4694bb,'messageId':'','sentAt':new Date(),'attach':_0x4e26a8[_0x6180('0x45')],'attachments':_0x4e26a8,'originChannel':_0x6180('0xd1'),'ChatWebsiteId':_0x4f62d['id'],'ChatOfflineMessageId':_0x2e38bf['id'],'originTo':_0x4f62d['MailAccount'][_0x6180('0xcc')]},'body':_0x2e38bf['body']};var _0x1ce91d={'account':{'id':_0x4f62d[_0x6180('0xd2')]},'body':_0x4f4b1d,'log':_0x6180('0xd3')};return respondWithRpcPromise(_0x6180('0xd3'),_0x6180('0xd4'),_0x1ce91d,client9001)[_0x6180('0x14')](function(){return _0x2e38bf;})[_0x6180('0x1c')](function(_0x341268){logger[_0x6180('0x19')](_0x341268);});}return;})[_0x6180('0x14')](function(){if(_0x2e38bf){return _0x2e38bf;}})['then'](respondWithResult(_0x2db59f,null))[_0x6180('0x1c')](function(_0x331353){logger[_0x6180('0x19')](_0x6180('0x1c'),_0x331353);for(var _0x1a7db8 of _0x4fc8a6){var _0x39d9b6=path['join'](config[_0x6180('0x6b')],_0x6180('0xc1'),_0x6180('0xb2'),_0x6180('0xc2'),_0x6180('0xd5'),_0x1a7db8[_0x6180('0x62')]);fs_extra[_0x6180('0xd6')](_0x39d9b6)['catch'](function(_0xa6a703){logger[_0x6180('0x19')](_0x6180('0xd7'),_0x39d9b6,_0xa6a703);});}});};exports['addInteraction']=function(_0xe65422,_0x90cc71){return db[_0x6180('0xa1')][_0x6180('0x4d')]({'where':{'id':_0xe65422[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x90cc71,null))[_0x6180('0x14')](function(_0x4da34e){if(_0x4da34e){return _0x4da34e[_0x6180('0xd8')](_0xe65422['body']['ids'],_[_0x6180('0xd9')](_0xe65422[_0x6180('0x47')],[_0x6180('0x5a'),'id'])||{});}})[_0x6180('0x14')](respondWithResult(_0x90cc71,null))['catch'](handleError(_0x90cc71,null));};exports[_0x6180('0xda')]=function(_0x45f903,_0x580703){var _0xb65a00={'raw':![],'where':{}};var _0xb8b698={};var _0x4848be={'count':0x0,'rows':[]};return db[_0x6180('0x2c')]['findOne']({'where':{'id':_0x45f903[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x580703,null))[_0x6180('0x14')](function(_0x27ad86){if(_0x27ad86){_0xb8b698[_0x6180('0x30')]=_[_0x6180('0x32')](db[_0x6180('0xa1')]['rawAttributes']);_0xb8b698[_0x6180('0x31')]=_['keys'](_0x45f903[_0x6180('0x31')]);_0xb8b698['filters']=_[_0x6180('0x34')](_0xb8b698[_0x6180('0x30')],_0xb8b698[_0x6180('0x31')]);_0xb65a00['attributes']=_[_0x6180('0x34')](_0xb8b698[_0x6180('0x30')],qs['fields'](_0x45f903[_0x6180('0x31')][_0x6180('0x36')]));_0xb65a00[_0x6180('0x35')]=_0xb65a00[_0x6180('0x35')][_0x6180('0x45')]?_0xb65a00['attributes']:_0xb8b698[_0x6180('0x30')];if(!_0x45f903['query'][_0x6180('0x58')]('nolimit')){_0xb65a00[_0x6180('0x21')]=qs[_0x6180('0x21')](_0x45f903[_0x6180('0x31')][_0x6180('0x21')]);_0xb65a00[_0x6180('0x23')]=qs[_0x6180('0x23')](_0x45f903[_0x6180('0x31')][_0x6180('0x23')]);}_0xb65a00['order']=qs['sort'](_0x45f903[_0x6180('0x31')][_0x6180('0x39')]);_0xb65a00[_0x6180('0x3c')]=qs[_0x6180('0x33')](_[_0x6180('0x3a')](_0x45f903[_0x6180('0x31')],_0xb8b698['filters']));_0xb65a00['where']['ChatWebsiteId']=_0x27ad86['id'];if(_0x45f903[_0x6180('0x31')][_0x6180('0x3b')]){_0xb65a00['where']=_[_0x6180('0x3d')](_0xb65a00[_0x6180('0x3c')],{'$or':_[_0x6180('0x2b')](_0xb65a00[_0x6180('0x35')],function(_0x1e14fc){var _0x15959c={};_0x15959c[_0x1e14fc]={'$like':'%'+_0x45f903[_0x6180('0x31')][_0x6180('0x3b')]+'%'};return _0x15959c;})});}_0xb65a00=_[_0x6180('0x3d')]({},_0xb65a00,_0x45f903[_0x6180('0x3f')]);return db[_0x6180('0xa1')][_0x6180('0x22')]({'where':_0xb65a00['where']})[_0x6180('0x14')](function(_0x105028){_0x4848be[_0x6180('0x22')]=_0x105028;if(_0x45f903[_0x6180('0x31')][_0x6180('0x40')]){_0xb65a00[_0x6180('0x41')]=[{'model':db['CmContact'],'as':_0x6180('0xdb'),'required':![]},{'model':db['User'],'as':_0x6180('0xdc'),'attributes':['name',_0x6180('0xdd'),_0x6180('0xde')],'required':![]},{'model':db[_0x6180('0xdf')],'as':'Tags','attributes':['id',_0x6180('0x28'),_0x6180('0xe0')],'where':_0x45f903[_0x6180('0x31')]['tag']?{'id':_0x45f903[_0x6180('0x31')][_0x6180('0xe1')]}:undefined,'required':_0x45f903[_0x6180('0x31')][_0x6180('0xe1')]?!![]:![]}];}return db['ChatInteraction'][_0x6180('0x5d')](_0xb65a00);})[_0x6180('0x14')](function(_0x34f1e9){_0x4848be[_0x6180('0x42')]=_0x34f1e9;return _0x4848be;});}})[_0x6180('0x14')](respondWithFilteredResult(_0x580703,_0xb65a00))[_0x6180('0x1c')](handleError(_0x580703,null));};function iftimePromise(_0x4cfccd,_0x2642a0){return respondWithRpcPromise('Command',_0x6180('0xe2'),{'command':_0x2642a0['timezone']?util[_0x6180('0x99')](_0x6180('0xe3'),_0x4cfccd[_0x6180('0xe4')],_0x2642a0[_0x6180('0xe5')]):util['format'](_0x6180('0xe6'),_0x4cfccd[_0x6180('0xe4')])},client9002)[_0x6180('0x14')](function(_0xae9c47){var _0x4f59e2=_0xae9c47&&_0xae9c47[_0x6180('0xe7')](_0x6180('0xe8'))>=0x0?!![]:![];logger[_0x6180('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2642a0['id'],_0x4cfccd['id'],_0x4cfccd['interval'],_0x4f59e2?_0x6180('0xe9'):'OFFLINE',_0x2642a0[_0x6180('0xe5')]?_0x2642a0[_0x6180('0xe5')]:_0x6180('0xea'));return _0x4f59e2;})['catch'](function(_0x19c83b){logger[_0x6180('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2642a0['id'],_0x4cfccd['id'],_0x4cfccd[_0x6180('0xe4')],util[_0x6180('0xeb')](_0x19c83b,{'showHidden':![],'depth':null}),_0x2642a0[_0x6180('0xe5')]?_0x2642a0[_0x6180('0xe5')]:'No\x20timezone');return![];});}exports[_0x6180('0xe2')]=function(_0x506233,_0x3b67c2){var _0x1ac3cb=0x0;var _0x225577=0x0;var _0x276253=![];var _0x5572ce;var _0x1ecf51;return db['ChatWebsite'][_0x6180('0x4d')]({'where':{'id':_0x506233[_0x6180('0x52')]['id']},'include':[{'model':db[_0x6180('0xec')],'as':'Interval','include':[{'model':db[_0x6180('0xec')],'as':_0x6180('0xed'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x6180('0x14')](handleEntityNotFound(_0x3b67c2,null))['then'](function(_0x3ffc79){if(_0x3ffc79){_0x5572ce=_0x3ffc79;return _0x3ffc79[_0x6180('0xee')]({'raw':!![]});}})['then'](function(_0x34ecb1){if(_0x5572ce){if(_0x34ecb1){_0x1ecf51=_0x34ecb1;}}return require(_0x6180('0x66'))[_0x6180('0x67')]();})[_0x6180('0x14')](function(_0x4a7fb3){if(_0x4a7fb3){_0x225577=_0x4a7fb3['virtual'];_0x276253=_0x4a7fb3[_0x6180('0x68')];}})['then'](function(){return db[_0x6180('0xa1')]['count']({'where':{'closed':![]}});})['then'](function(_0x331ed){_0x1ac3cb=_0x331ed;if(_0x225577&&_0x331ed>_0x225577){return db[_0x6180('0xef')][_0x6180('0x5c')]({'where':{'id':0x1}})[_0x6180('0x14')](function(_0x4d7f6a){if(_0x4d7f6a){_0x4d7f6a[_0x6180('0xf0')](_0x6180('0xf1'));}});}})[_0x6180('0x14')](function(){if(_0x5572ce[_0x6180('0xec')]&&_0x5572ce['Interval'][_0x6180('0xed')]){var _0x401235=[];for(var _0x40e7ea=0x0;_0x40e7ea<_0x5572ce[_0x6180('0xec')][_0x6180('0xed')][_0x6180('0x45')];_0x40e7ea++){var _0x32c03c=_0x5572ce[_0x6180('0xec')][_0x6180('0xed')][_0x40e7ea][_0x6180('0x49')]({'plain':!![]});_0x401235['push'](iftimePromise(_0x32c03c,_0x5572ce));}return BPromise[_0x6180('0xf2')](_0x401235)[_0x6180('0x14')](function(_0x5bea57){return _[_0x6180('0xf3')](_0x5bea57);});}else{return!![];}})[_0x6180('0x14')](function(_0x422af6){var _0x1dd1d5=fs['readFileSync'](path[_0x6180('0x64')](config[_0x6180('0x6b')],_0x6180('0xf4')),_0x6180('0xbc'));var _0x176e26={'remote':_0x5572ce[_0x6180('0xf5')],'query':querystring[_0x6180('0x18')](_[_0x6180('0x3d')](_0x5572ce[_0x6180('0x49')]({'plain':!![]}),{'customerIp':_0x506233[_0x6180('0x79')][_0x6180('0xf6')]||_0x506233[_0x6180('0x79')]['x-real-ip']||_0x506233['connection']['remoteAddress']||_0x506233['ip'],'referer':_0x506233[_0x6180('0x79')]['referer'],'openedInteractions':_0x1ac3cb,'maxInteractions':_0x225577,'virtual':_0x276253[_0x6180('0xf7')],'online':_0x422af6,'custom':_0x276253}))['replace'](/'/g,'\x5c\x27')};_0x3b67c2['send'](ejs[_0x6180('0xbd')](Mustache[_0x6180('0xbd')](_0x1dd1d5,_0x176e26),{'proactiveActions':_0x1ecf51,'alignment':_0x5572ce[_0x6180('0xf8')],'verticalAlignment':_0x5572ce[_0x6180('0xf9')],'div_color':_0x5572ce[_0x6180('0xe0')],'labelText':_0x5572ce[_0x6180('0xfa')],'text_color':_0x5572ce['textColor'],'text_button_color':_0x5572ce['textButtonColor'],'button_color':_0x5572ce['color_button'],'background_color':_0x5572ce[_0x6180('0xfb')],'hideWhenOffline':_0x5572ce['hideWhenOffline'],'interval':_0x5572ce['IntervalId']}));})[_0x6180('0x1c')](handleError(_0x3b67c2,null));};exports[_0x6180('0xfc')]=function(_0x5d0df5,_0xc865a8){var _0x3f7e19=_0x5d0df5[_0x6180('0x52')]['id'];var _0xc2a58a=_0x5d0df5[_0x6180('0x47')];var _0x32199f=0xc8;var _0x9f3650=null;return db['sequelize'][_0x6180('0xfd')]({'isolationLevel':db[_0x6180('0xc4')][_0x6180('0xfe')][_0x6180('0xff')][_0x6180('0x100')]},function(_0x28b0ba){return db[_0x6180('0x2c')][_0x6180('0x5c')]({'where':{'id':_0x3f7e19},'transaction':_0x28b0ba})[_0x6180('0x14')](function(_0x3e7724){if(_0x3e7724){return db[_0x6180('0x101')]['destroy']({'where':{'ChatWebsiteId':_0x3f7e19},'transaction':_0x28b0ba})['then'](function(){var _0x53f8c3=_['map'](_0xc2a58a,function(_0x41e907){_0x41e907[_0x6180('0x55')]=_0x3f7e19;return _0x41e907;});return db[_0x6180('0x101')]['bulkCreate'](_0x53f8c3,{'transaction':_0x28b0ba});});}else{_0x32199f=0x194;_0x9f3650=[];}});})[_0x6180('0x14')](function(){if(_0x32199f!==0x194){return db[_0x6180('0x101')][_0x6180('0x102')]({'where':{'ChatWebsiteId':_0x3f7e19},'order':'priority'})[_0x6180('0x14')](function(_0x7ac0f3){_0x9f3650=_0x7ac0f3;});}})['catch'](function(_0x49ce0a){_0x32199f=0x1f4;logger[_0x6180('0x19')](_0x49ce0a[_0x6180('0x27')]);if(_0x49ce0a[_0x6180('0x28')]){delete _0x49ce0a[_0x6180('0x28')];}_0x9f3650=_0x49ce0a;})[_0x6180('0x103')](function(){if(_0x9f3650===null){_0xc865a8['sendStatus'](_0x32199f);}else{if(_0x32199f===0x1f4){_0xc865a8['status'](_0x32199f)[_0x6180('0x29')](_0x9f3650);}else{_0xc865a8[_0x6180('0x1e')](_0x32199f)[_0x6180('0x1f')](_0x9f3650);}}});};exports['getApplications']=function(_0x319e2c,_0x1f6d51){var _0x5d7c9a={};var _0x132bcf={};var _0x28444e;var _0x554633;return db[_0x6180('0x2c')][_0x6180('0x5c')]({'where':{'id':_0x319e2c[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x1f6d51,null))[_0x6180('0x14')](function(_0x9fca9a){if(_0x9fca9a){_0x28444e=_0x9fca9a;_0x132bcf[_0x6180('0x30')]=_[_0x6180('0x32')](db[_0x6180('0x101')][_0x6180('0x44')]);_0x132bcf[_0x6180('0x31')]=_[_0x6180('0x32')](_0x319e2c['query']);_0x132bcf[_0x6180('0x33')]=_['intersection'](_0x132bcf[_0x6180('0x30')],_0x132bcf[_0x6180('0x31')]);_0x5d7c9a['attributes']=_['intersection'](_0x132bcf[_0x6180('0x30')],qs[_0x6180('0x36')](_0x319e2c['query'][_0x6180('0x36')]));_0x5d7c9a[_0x6180('0x35')]=_0x5d7c9a['attributes'][_0x6180('0x45')]?_0x5d7c9a['attributes']:_0x132bcf['model'];_0x5d7c9a[_0x6180('0x38')]=qs['sort'](_0x319e2c[_0x6180('0x31')][_0x6180('0x39')]);_0x5d7c9a['where']=qs['filters'](_[_0x6180('0x3a')](_0x319e2c[_0x6180('0x31')],_0x132bcf['filters']));if(_0x319e2c['query'][_0x6180('0x3b')]){_0x5d7c9a[_0x6180('0x3c')]=_[_0x6180('0x3d')](_0x5d7c9a[_0x6180('0x3c')],{'$or':_[_0x6180('0x2b')](_0x5d7c9a[_0x6180('0x35')],function(_0x53796e){var _0x1328ca={};_0x1328ca[_0x53796e]={'$like':'%'+_0x319e2c[_0x6180('0x31')][_0x6180('0x3b')]+'%'};return _0x1328ca;})});}_0x5d7c9a=_['merge']({},_0x5d7c9a,_0x319e2c[_0x6180('0x3f')]);return _0x28444e[_0x6180('0x104')](_0x5d7c9a);}})[_0x6180('0x14')](function(_0x10465b){if(_0x10465b){_0x554633=_0x10465b[_0x6180('0x45')];if(!_0x319e2c[_0x6180('0x31')][_0x6180('0x58')](_0x6180('0x37'))){_0x5d7c9a[_0x6180('0x21')]=qs['limit'](_0x319e2c[_0x6180('0x31')][_0x6180('0x21')]);_0x5d7c9a[_0x6180('0x23')]=qs[_0x6180('0x23')](_0x319e2c['query'][_0x6180('0x23')]);}return _0x28444e[_0x6180('0x104')](_0x5d7c9a);}})[_0x6180('0x14')](function(_0x27a473){if(_0x27a473){return _0x27a473?{'count':_0x554633,'rows':_0x27a473}:null;}})[_0x6180('0x14')](respondWithResult(_0x1f6d51,null))[_0x6180('0x1c')](handleError(_0x1f6d51,null));};exports[_0x6180('0x105')]=function(_0xd070a6,_0x2c6247){return db[_0x6180('0x106')][_0x6180('0x4d')]({'where':{'id':_0xd070a6[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x2c6247,null))[_0x6180('0x14')](function(_0x32de76){if(_0x32de76){return _0x32de76[_0x6180('0x105')](_0xd070a6[_0x6180('0x47')]['ids'],_[_0x6180('0xd9')](_0xd070a6[_0x6180('0x47')],['ids','id'])||{});}})[_0x6180('0x14')](respondWithResult(_0x2c6247,null))[_0x6180('0x1c')](handleError(_0x2c6247,null));};exports['getProactiveActions']=function(_0x1fe38c,_0x2f4de3){var _0x138bb1={};var _0x67f245={};var _0x55fc7d;var _0x4e4c5c;return db[_0x6180('0x2c')]['findOne']({'where':{'id':_0x1fe38c[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x2f4de3,null))[_0x6180('0x14')](function(_0xa18bdc){if(_0xa18bdc){_0x55fc7d=_0xa18bdc;_0x67f245[_0x6180('0x30')]=_[_0x6180('0x32')](db[_0x6180('0x107')][_0x6180('0x44')]);_0x67f245[_0x6180('0x31')]=_[_0x6180('0x32')](_0x1fe38c[_0x6180('0x31')]);_0x67f245[_0x6180('0x33')]=_[_0x6180('0x34')](_0x67f245[_0x6180('0x30')],_0x67f245[_0x6180('0x31')]);_0x138bb1[_0x6180('0x35')]=_[_0x6180('0x34')](_0x67f245[_0x6180('0x30')],qs[_0x6180('0x36')](_0x1fe38c['query'][_0x6180('0x36')]));_0x138bb1[_0x6180('0x35')]=_0x138bb1['attributes'][_0x6180('0x45')]?_0x138bb1['attributes']:_0x67f245[_0x6180('0x30')];_0x138bb1['order']=qs[_0x6180('0x39')](_0x1fe38c[_0x6180('0x31')][_0x6180('0x39')]);_0x138bb1[_0x6180('0x3c')]=qs[_0x6180('0x33')](_[_0x6180('0x3a')](_0x1fe38c[_0x6180('0x31')],_0x67f245[_0x6180('0x33')]));if(_0x1fe38c[_0x6180('0x31')][_0x6180('0x3b')]){_0x138bb1['where']=_['merge'](_0x138bb1[_0x6180('0x3c')],{'$or':_[_0x6180('0x2b')](_0x138bb1[_0x6180('0x35')],function(_0x9778a4){var _0x1f71c3={};_0x1f71c3[_0x9778a4]={'$like':'%'+_0x1fe38c[_0x6180('0x31')][_0x6180('0x3b')]+'%'};return _0x1f71c3;})});}_0x138bb1=_['merge']({},_0x138bb1,_0x1fe38c[_0x6180('0x3f')]);return _0x55fc7d['getProactiveActions'](_0x138bb1);}})['then'](function(_0x53ac08){if(_0x53ac08){_0x4e4c5c=_0x53ac08['length'];if(!_0x1fe38c[_0x6180('0x31')][_0x6180('0x58')]('nolimit')){_0x138bb1[_0x6180('0x21')]=qs['limit'](_0x1fe38c[_0x6180('0x31')][_0x6180('0x21')]);_0x138bb1[_0x6180('0x23')]=qs[_0x6180('0x23')](_0x1fe38c[_0x6180('0x31')][_0x6180('0x23')]);}return _0x55fc7d['getProactiveActions'](_0x138bb1);}})[_0x6180('0x14')](function(_0x398ae5){if(_0x398ae5){return _0x398ae5?{'count':_0x4e4c5c,'rows':_0x398ae5}:null;}})[_0x6180('0x14')](respondWithResult(_0x2f4de3,null))[_0x6180('0x1c')](handleError(_0x2f4de3,null));};exports[_0x6180('0x108')]=function(_0x2042ca,_0x499461){var _0x5f1044=_0x2042ca['query'][_0x6180('0x109')]===_0x6180('0x10a')?_0x6180('0x10b'):'onlineForm';return db[_0x6180('0x2c')]['find']({'attributes':['id',_0x5f1044],'where':{'id':_0x2042ca['params']['id']}})['then'](handleEntityNotFound(_0x499461,null))[_0x6180('0x14')](function(_0x1241f2){if(_0x1241f2){var _0xd7e651=_0x1241f2[_0x5f1044];var _0x116e3f=_0xd7e651&&_0xd7e651[_0x6180('0x10c')]?_0xd7e651[_0x6180('0x10c')]:[];_0x499461[_0x6180('0x29')]({'fromKey':_[_0x6180('0x69')](_0xd7e651[_0x6180('0x10d')])?undefined:_0xd7e651['fromKey'],'count':_0x116e3f[_0x6180('0x45')],'rows':_0x116e3f});}})[_0x6180('0x1c')](handleError(_0x499461,null));};exports['getOfflineMessages']=function(_0x535fe8,_0x54fc42){var _0x25d24b={'raw':![],'where':{}};var _0x53f67e={};var _0x227bb0={'count':0x0,'rows':[]};return db[_0x6180('0x2c')][_0x6180('0x5c')]({'where':{'id':_0x535fe8[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x54fc42,null))['then'](function(_0x3771dc){if(_0x3771dc){_0x53f67e['model']=_[_0x6180('0x32')](db[_0x6180('0xbe')][_0x6180('0x44')]);_0x53f67e[_0x6180('0x31')]=_[_0x6180('0x32')](_0x535fe8['query']);_0x53f67e[_0x6180('0x33')]=_[_0x6180('0x34')](_0x53f67e['model'],_0x53f67e['query']);_0x25d24b['attributes']=_[_0x6180('0x34')](_0x53f67e[_0x6180('0x30')],qs[_0x6180('0x36')](_0x535fe8[_0x6180('0x31')][_0x6180('0x36')]));_0x25d24b[_0x6180('0x35')]=_0x25d24b['attributes']['length']?_0x25d24b[_0x6180('0x35')]:_0x53f67e[_0x6180('0x30')];if(!_0x535fe8[_0x6180('0x31')][_0x6180('0x58')](_0x6180('0x37'))){_0x25d24b['limit']=qs[_0x6180('0x21')](_0x535fe8['query']['limit']);_0x25d24b['offset']=qs[_0x6180('0x23')](_0x535fe8['query'][_0x6180('0x23')]);}_0x25d24b[_0x6180('0x38')]=qs[_0x6180('0x39')](_0x535fe8['query'][_0x6180('0x39')]);_0x25d24b[_0x6180('0x3c')]=qs[_0x6180('0x33')](_['pick'](_0x535fe8['query'],_0x53f67e[_0x6180('0x33')]));_0x25d24b['where']['ChatWebsiteId']=_0x3771dc['id'];if(_0x535fe8[_0x6180('0x31')][_0x6180('0x3b')]){_0x25d24b['where']=_[_0x6180('0x3d')](_0x25d24b[_0x6180('0x3c')],{'$or':_[_0x6180('0x2b')](_0x25d24b[_0x6180('0x35')],function(_0x15bbab){var _0x2833ee={};_0x2833ee[_0x15bbab]={'$like':'%'+_0x535fe8[_0x6180('0x31')][_0x6180('0x3b')]+'%'};return _0x2833ee;})});}_0x25d24b=_[_0x6180('0x3d')]({},_0x25d24b,_0x535fe8['options']);return db[_0x6180('0xbe')][_0x6180('0x22')]({'where':_0x25d24b['where']})[_0x6180('0x14')](function(_0x138a51){_0x227bb0['count']=_0x138a51;if(_0x535fe8[_0x6180('0x31')][_0x6180('0x40')]){_0x25d24b[_0x6180('0x41')]=[{'all':!![]}];}else{_0x25d24b['include']=[{'model':db[_0x6180('0x7b')],'as':_0x6180('0xdb'),'required':![]},{'model':db[_0x6180('0x10e')],'as':'Attachments','required':![]}];}return db[_0x6180('0xbe')][_0x6180('0x5d')](_0x25d24b);})[_0x6180('0x14')](function(_0x102b54){_0x227bb0['rows']=_0x102b54;return _0x227bb0;});}})['then'](respondWithFilteredResult(_0x54fc42,_0x25d24b))['catch'](handleError(_0x54fc42,null));};exports[_0x6180('0x10f')]=function(_0x502612,_0x36d498){return db[_0x6180('0x2c')]['find']({'where':{'id':_0x502612[_0x6180('0x52')]['id']}})['then'](handleEntityNotFound(_0x36d498,null))[_0x6180('0x14')](function(_0x35e620){if(_0x35e620){return _0x35e620[_0x6180('0x10f')](_0x502612[_0x6180('0x47')][_0x6180('0x5a')],_[_0x6180('0xd9')](_0x502612[_0x6180('0x47')],[_0x6180('0x5a'),'id'])||{})[_0x6180('0xb9')](function(_0x468c81){for(var _0x283014=0x0;_0x283014<_0x502612[_0x6180('0x47')][_0x6180('0x5a')][_0x6180('0x45')];_0x283014+=0x1){socket[_0x6180('0x110')](_0x6180('0x111'),{'UserId':Number(_0x502612[_0x6180('0x47')][_0x6180('0x5a')][_0x283014]),'ChatWebsiteId':Number(_0x502612[_0x6180('0x52')]['id'])});}return _0x468c81;});}})[_0x6180('0x14')](respondWithResult(_0x36d498,null))[_0x6180('0x1c')](handleError(_0x36d498,null));};exports[_0x6180('0x112')]=function(_0xa11ad3,_0x4d2573){return db['ChatWebsite'][_0x6180('0x4d')]({'where':{'id':_0xa11ad3[_0x6180('0x52')]['id']}})[_0x6180('0x14')](handleEntityNotFound(_0x4d2573,null))['then'](function(_0x1eb867){if(_0x1eb867){return _0x1eb867[_0x6180('0x112')](_0xa11ad3['query']['ids'])[_0x6180('0x14')](function(){if(_[_0x6180('0x113')](_0xa11ad3[_0x6180('0x31')][_0x6180('0x5a')])){for(var _0x7c0fb=0x0;_0x7c0fb<_0xa11ad3['query'][_0x6180('0x5a')]['length'];_0x7c0fb+=0x1){socket[_0x6180('0x110')]('userChatWebsite:remove',{'UserId':Number(_0xa11ad3[_0x6180('0x31')][_0x6180('0x5a')][_0x7c0fb]),'ChatWebsiteId':Number(_0xa11ad3[_0x6180('0x52')]['id'])});}}else{socket['emit'](_0x6180('0x114'),{'UserId':Number(_0xa11ad3['query'][_0x6180('0x5a')]),'ChatWebsiteId':Number(_0xa11ad3[_0x6180('0x52')]['id'])});}});}})[_0x6180('0x14')](respondWithStatusCode(_0x4d2573,null))['catch'](handleError(_0x4d2573,null));};exports[_0x6180('0x115')]=function(_0x49dd63,_0x2d84fb){var _0x215495={};var _0x5f2875={};var _0x3f6c0d;var _0x2629ee;return db[_0x6180('0x2c')][_0x6180('0x5c')]({'where':{'id':_0x49dd63[_0x6180('0x52')]['id']}})['then'](handleEntityNotFound(_0x2d84fb,null))[_0x6180('0x14')](function(_0x22d919){if(_0x22d919){_0x3f6c0d=_0x22d919;_0x5f2875[_0x6180('0x30')]=_[_0x6180('0x32')](db[_0x6180('0xac')][_0x6180('0x44')]);_0x5f2875['query']=_['keys'](_0x49dd63[_0x6180('0x31')]);_0x5f2875[_0x6180('0x33')]=_[_0x6180('0x34')](_0x5f2875[_0x6180('0x30')],_0x5f2875['query']);_0x215495[_0x6180('0x35')]=_['intersection'](_0x5f2875[_0x6180('0x30')],qs['fields'](_0x49dd63[_0x6180('0x31')][_0x6180('0x36')]));_0x215495[_0x6180('0x35')]=_0x215495[_0x6180('0x35')][_0x6180('0x45')]?_0x215495['attributes']:_0x5f2875[_0x6180('0x30')];_0x215495['order']=qs['sort'](_0x49dd63[_0x6180('0x31')][_0x6180('0x39')]);_0x215495[_0x6180('0x3c')]=qs['filters'](_[_0x6180('0x3a')](_0x49dd63[_0x6180('0x31')],_0x5f2875[_0x6180('0x33')]));if(_0x49dd63[_0x6180('0x31')][_0x6180('0x3b')]){_0x215495['where']=_[_0x6180('0x3d')](_0x215495[_0x6180('0x3c')],{'$or':_[_0x6180('0x2b')](_0x215495[_0x6180('0x35')],function(_0x258cef){var _0xe1291d={};_0xe1291d[_0x258cef]={'$like':'%'+_0x49dd63['query'][_0x6180('0x3b')]+'%'};return _0xe1291d;})});}_0x215495=_['merge']({},_0x215495,_0x49dd63[_0x6180('0x3f')]);return _0x3f6c0d[_0x6180('0x115')](_0x215495);}})[_0x6180('0x14')](function(_0x418a00){if(_0x418a00){_0x2629ee=_0x418a00[_0x6180('0x45')];if(!_0x49dd63[_0x6180('0x31')][_0x6180('0x58')]('nolimit')){_0x215495['limit']=qs[_0x6180('0x21')](_0x49dd63[_0x6180('0x31')][_0x6180('0x21')]);_0x215495[_0x6180('0x23')]=qs[_0x6180('0x23')](_0x49dd63['query'][_0x6180('0x23')]);}return _0x3f6c0d['getAgents'](_0x215495);}})[_0x6180('0x14')](function(_0x3988be){if(_0x3988be){return _0x3988be?{'count':_0x2629ee,'rows':_0x3988be}:null;}})[_0x6180('0x14')](respondWithResult(_0x2d84fb,null))[_0x6180('0x1c')](handleError(_0x2d84fb,null));};
\ No newline at end of file
+var _0xcd27=['forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','ChatApplication','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','show','params','include','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','order','pick','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','account','applications','List','orderBy','asc','Applications','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','CloudProvider','forwardOffline'];(function(_0xefac4e,_0x201094){var _0x42bbd4=function(_0x4bebc8){while(--_0x4bebc8){_0xefac4e['push'](_0xefac4e['shift']());}};_0x42bbd4(++_0x201094);}(_0xcd27,0x177));var _0x7cd2=function(_0xefc997,_0x223a4d){_0xefc997=_0xefc997-0x0;var _0x3079ed=_0xcd27[_0xefc997];return _0x3079ed;};'use strict';var BPromise=require(_0x7cd2('0x0'));var Mustache=require(_0x7cd2('0x1'));var util=require(_0x7cd2('0x2'));var path=require(_0x7cd2('0x3'));var ejs=require(_0x7cd2('0x4'));var fs=require('fs');var fs_extra=require(_0x7cd2('0x5'));var _=require(_0x7cd2('0x6'));var querystring=require(_0x7cd2('0x7'));var Redis=require(_0x7cd2('0x8'));var qs=require(_0x7cd2('0x9'));var logger=require('../../config/logger')(_0x7cd2('0xa'));var config=require('../../config/environment');var db=require(_0x7cd2('0xb'))['db'];config[_0x7cd2('0xc')]=_[_0x7cd2('0xd')](config[_0x7cd2('0xc')],{'host':_0x7cd2('0xe'),'port':0x18eb});var socket=require(_0x7cd2('0xf'))(new Redis(config[_0x7cd2('0xc')]));require(_0x7cd2('0x10'))[_0x7cd2('0x11')](socket);var htmlToText=require(_0x7cd2('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x7cd2('0x13')][_0x7cd2('0x14')]({'port':0x232c});var client9002=jayson[_0x7cd2('0x13')][_0x7cd2('0x14')]({'port':0x232a});var client9003=jayson[_0x7cd2('0x13')][_0x7cd2('0x14')]({'port':0x232b});var client9001=jayson[_0x7cd2('0x13')][_0x7cd2('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x34dd69,_0x32e324,_0x4c411b,_0x424cdd){return new BPromise(function(_0x4a81be,_0x4f94a8){var _0x2ab3c3=_0x424cdd||client;return _0x2ab3c3[_0x7cd2('0x15')](_0x34dd69,_0x4c411b)[_0x7cd2('0x16')](function(_0x1e7354){logger['info'](_0x7cd2('0x17'),_0x32e324,_0x7cd2('0x18'));logger[_0x7cd2('0x19')](_0x7cd2('0x1a'),_0x32e324,_0x7cd2('0x18'),JSON[_0x7cd2('0x1b')](_0x1e7354));if(_0x1e7354[_0x7cd2('0x1c')]){if(_0x1e7354['error']['code']===0x1f4){logger[_0x7cd2('0x1c')](_0x7cd2('0x17'),_0x32e324,_0x1e7354[_0x7cd2('0x1c')][_0x7cd2('0x1d')]);return _0x4f94a8(_0x1e7354[_0x7cd2('0x1c')][_0x7cd2('0x1d')]);}logger[_0x7cd2('0x1c')](_0x7cd2('0x17'),_0x32e324,_0x1e7354['error'][_0x7cd2('0x1d')]);return _0x4a81be(_0x1e7354[_0x7cd2('0x1c')][_0x7cd2('0x1d')]);}else{logger[_0x7cd2('0x1e')](_0x7cd2('0x17'),_0x32e324,_0x7cd2('0x18'));_0x4a81be(_0x1e7354['result'][_0x7cd2('0x1d')]);}})[_0x7cd2('0x1f')](function(_0x45c268){logger['error'](_0x7cd2('0x17'),_0x32e324,_0x45c268);_0x4f94a8(_0x45c268);});});}function respondWithStatusCode(_0x920269,_0x5197a3){_0x5197a3=_0x5197a3||0xcc;return function(_0x45eacb){if(_0x45eacb){return _0x920269[_0x7cd2('0x20')](_0x5197a3);}return _0x920269[_0x7cd2('0x21')](_0x5197a3)[_0x7cd2('0x22')]();};}function respondWithResult(_0x1b27c5,_0x3e2093){_0x3e2093=_0x3e2093||0xc8;return function(_0x1baf30){if(_0x1baf30){return _0x1b27c5[_0x7cd2('0x21')](_0x3e2093)[_0x7cd2('0x23')](_0x1baf30);}};}function respondWithFilteredResult(_0x5e2897,_0x355f3a){return function(_0x3713a7){if(_0x3713a7){var _0x19c114=typeof _0x355f3a[_0x7cd2('0x24')]===_0x7cd2('0x25')&&typeof _0x355f3a['limit']===_0x7cd2('0x25');var _0x11abc6=_0x3713a7[_0x7cd2('0x26')];var _0x3e99d0=_0x19c114?0x0:_0x355f3a[_0x7cd2('0x24')];var _0x2e4115=_0x19c114?_0x3713a7[_0x7cd2('0x26')]:_0x355f3a[_0x7cd2('0x24')]+_0x355f3a['limit'];var _0xea4cf9;if(_0x2e4115>=_0x11abc6){_0x2e4115=_0x11abc6;_0xea4cf9=0xc8;}else{_0xea4cf9=0xce;}_0x5e2897[_0x7cd2('0x21')](_0xea4cf9);return _0x5e2897[_0x7cd2('0x27')](_0x7cd2('0x28'),_0x3e99d0+'-'+_0x2e4115+'/'+_0x11abc6)[_0x7cd2('0x23')](_0x3713a7);}return null;};}function saveUpdates(_0x54b19f){return function(_0x531e40){if(_0x531e40){return _0x531e40[_0x7cd2('0x29')](_0x54b19f)[_0x7cd2('0x16')](function(_0x3a7914){return _0x3a7914;});}return null;};}function removeEntity(_0x4333df){return function(_0x52fab2){if(_0x52fab2){return _0x52fab2[_0x7cd2('0x2a')]()['then'](function(){var _0x549123=_0x52fab2[_0x7cd2('0x2b')]({'plain':!![]});var _0x233ab8=_0x7cd2('0x2c');return db[_0x7cd2('0x2d')][_0x7cd2('0x2a')]({'where':{'type':_0x233ab8,'resourceId':_0x549123['id']}})[_0x7cd2('0x16')](function(){return _0x52fab2;});})[_0x7cd2('0x16')](function(){_0x4333df[_0x7cd2('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a811){return function(_0x36af96){if(!_0x36af96){_0x51a811[_0x7cd2('0x20')](0x194);}return _0x36af96;};}function handleError(_0x5f4e85,_0x3b3c81){_0x3b3c81=_0x3b3c81||0x1f4;return function(_0x437e56){logger[_0x7cd2('0x1c')](_0x437e56[_0x7cd2('0x2e')]);if(_0x437e56[_0x7cd2('0x2f')]){delete _0x437e56[_0x7cd2('0x2f')];}_0x5f4e85[_0x7cd2('0x21')](_0x3b3c81)['send'](_0x437e56);};}exports[_0x7cd2('0x30')]=function(_0x7aff6d,_0x1879a2){var _0x11d4db={'include':[{'model':db[_0x7cd2('0x31')],'as':_0x7cd2('0x32')}]},_0x554302={},_0x315e88={'count':0x0,'rows':[]};var _0x101700=_[_0x7cd2('0x33')](db[_0x7cd2('0x34')][_0x7cd2('0x35')],function(_0x47aa54){return{'name':_0x47aa54[_0x7cd2('0x36')],'type':_0x47aa54[_0x7cd2('0x37')]['key']};});_0x554302[_0x7cd2('0x38')]=_[_0x7cd2('0x33')](_0x101700,'name');_0x554302[_0x7cd2('0x39')]=_[_0x7cd2('0x3a')](_0x7aff6d[_0x7cd2('0x39')]);_0x554302[_0x7cd2('0x3b')]=_[_0x7cd2('0x3c')](_0x554302[_0x7cd2('0x38')],_0x554302['query']);_0x11d4db['attributes']=_[_0x7cd2('0x3c')](_0x554302[_0x7cd2('0x38')],qs[_0x7cd2('0x3d')](_0x7aff6d[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0x11d4db[_0x7cd2('0x3e')]=_0x11d4db['attributes'][_0x7cd2('0x3f')]?_0x11d4db['attributes']:_0x554302['model'];if(!_0x7aff6d[_0x7cd2('0x39')][_0x7cd2('0x40')]('nolimit')){_0x11d4db[_0x7cd2('0x41')]=qs['limit'](_0x7aff6d['query']['limit']);_0x11d4db[_0x7cd2('0x24')]=qs[_0x7cd2('0x24')](_0x7aff6d[_0x7cd2('0x39')]['offset']);}_0x11d4db['order']=qs[_0x7cd2('0x42')](_0x7aff6d[_0x7cd2('0x39')][_0x7cd2('0x42')]);_0x11d4db[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_['pick'](_0x7aff6d[_0x7cd2('0x39')],_0x554302[_0x7cd2('0x3b')]),_0x101700);if(_0x7aff6d[_0x7cd2('0x39')][_0x7cd2('0x44')]){_0x11d4db[_0x7cd2('0x43')]=_['merge'](_0x11d4db[_0x7cd2('0x43')],{'$or':_[_0x7cd2('0x33')](_0x101700,function(_0x543f98){if(_0x543f98['type']!==_0x7cd2('0x45')){var _0x293c16={};_0x293c16[_0x543f98[_0x7cd2('0x2f')]]={'$like':'%'+_0x7aff6d[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0x293c16;}})});}_0x11d4db=_['merge']({},_0x11d4db,_0x7aff6d[_0x7cd2('0x46')]);var _0x4955f1={'where':_0x11d4db[_0x7cd2('0x43')]};return db[_0x7cd2('0x34')][_0x7cd2('0x26')](_0x4955f1)[_0x7cd2('0x16')](function(_0x262b3f){_0x315e88[_0x7cd2('0x26')]=_0x262b3f;if(_0x7aff6d['query'][_0x7cd2('0x47')]){_0x11d4db['include']=[{'all':!![]}];}return db[_0x7cd2('0x34')][_0x7cd2('0x48')](_0x11d4db);})[_0x7cd2('0x16')](function(_0x3dc157){_0x315e88[_0x7cd2('0x49')]=_0x3dc157;return _0x315e88;})[_0x7cd2('0x16')](respondWithFilteredResult(_0x1879a2,_0x11d4db))['catch'](handleError(_0x1879a2,null));};exports[_0x7cd2('0x4a')]=function(_0x516fe6,_0x1c19e3){var _0x2069ac={'raw':![],'where':{'id':_0x516fe6[_0x7cd2('0x4b')]['id']},'include':[{'model':db[_0x7cd2('0x31')],'as':_0x7cd2('0x32')}]},_0x114420={};_0x114420['model']=_['keys'](db[_0x7cd2('0x34')][_0x7cd2('0x35')]);_0x114420['query']=_[_0x7cd2('0x3a')](_0x516fe6['query']);_0x114420['filters']=_[_0x7cd2('0x3c')](_0x114420['model'],_0x114420[_0x7cd2('0x39')]);_0x2069ac[_0x7cd2('0x3e')]=_[_0x7cd2('0x3c')](_0x114420['model'],qs['fields'](_0x516fe6[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0x2069ac[_0x7cd2('0x3e')]=_0x2069ac['attributes'][_0x7cd2('0x3f')]?_0x2069ac[_0x7cd2('0x3e')]:_0x114420[_0x7cd2('0x38')];if(_0x516fe6[_0x7cd2('0x39')][_0x7cd2('0x47')]){_0x2069ac[_0x7cd2('0x4c')]=[{'all':!![]}];}_0x2069ac=_[_0x7cd2('0x4d')]({},_0x2069ac,_0x516fe6[_0x7cd2('0x46')]);return db[_0x7cd2('0x34')]['find'](_0x2069ac)[_0x7cd2('0x16')](handleEntityNotFound(_0x1c19e3,null))['then'](respondWithResult(_0x1c19e3,null))[_0x7cd2('0x1f')](handleError(_0x1c19e3,null));};exports[_0x7cd2('0x4e')]=function(_0x3e50e2,_0x54b996){return db[_0x7cd2('0x34')][_0x7cd2('0x4e')](_0x3e50e2[_0x7cd2('0x4f')],{})[_0x7cd2('0x16')](function(_0x156a8f){var _0x398023=_0x3e50e2['user'][_0x7cd2('0x2b')]({'plain':!![]});if(!_0x398023)throw new Error(_0x7cd2('0x50'));if(_0x398023[_0x7cd2('0x51')]===_0x7cd2('0x52')){var _0x57c7b5=_0x156a8f[_0x7cd2('0x2b')]({'plain':!![]});var _0x20e09d='ChatWebsites';return db[_0x7cd2('0x53')][_0x7cd2('0x54')]({'where':{'name':_0x20e09d,'userProfileId':_0x398023['userProfileId']},'raw':!![]})['then'](function(_0x53c1a9){if(_0x53c1a9&&_0x53c1a9[_0x7cd2('0x55')]===0x0){return db[_0x7cd2('0x2d')][_0x7cd2('0x4e')]({'name':_0x57c7b5[_0x7cd2('0x2f')],'resourceId':_0x57c7b5['id'],'type':_0x53c1a9[_0x7cd2('0x2f')],'sectionId':_0x53c1a9['id']},{})[_0x7cd2('0x16')](function(){return _0x156a8f;});}else{return _0x156a8f;}})[_0x7cd2('0x1f')](function(_0x2e7e80){logger[_0x7cd2('0x1c')](_0x7cd2('0x56'),_0x2e7e80);throw _0x2e7e80;});}return _0x156a8f;})[_0x7cd2('0x16')](respondWithResult(_0x54b996,0xc9))[_0x7cd2('0x1f')](handleError(_0x54b996,null));};exports[_0x7cd2('0x29')]=function(_0x1bb5ee,_0x37444f){if(_0x1bb5ee[_0x7cd2('0x4f')]['id']){delete _0x1bb5ee['body']['id'];}return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0x1bb5ee[_0x7cd2('0x4b')]['id']},'include':[{'model':db[_0x7cd2('0x31')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x37444f,null))[_0x7cd2('0x16')](saveUpdates(_0x1bb5ee['body'],null))[_0x7cd2('0x16')](respondWithResult(_0x37444f,null))[_0x7cd2('0x1f')](handleError(_0x37444f,null));};exports[_0x7cd2('0x2a')]=function(_0x4f4ebb,_0x34d54d){return db['ChatWebsite'][_0x7cd2('0x54')]({'where':{'id':_0x4f4ebb['params']['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x34d54d,null))[_0x7cd2('0x16')](removeEntity(_0x34d54d,null))['catch'](handleError(_0x34d54d,null));};exports[_0x7cd2('0x57')]=function(_0x553dd0,_0x284cfc){return db[_0x7cd2('0x34')]['describe']()[_0x7cd2('0x16')](respondWithResult(_0x284cfc,null))[_0x7cd2('0x1f')](handleError(_0x284cfc,null));};exports[_0x7cd2('0x58')]=function(_0x25d8c9,_0x32ac83){if(_0x25d8c9['body']['id']){delete _0x25d8c9[_0x7cd2('0x4f')]['id'];}return db[_0x7cd2('0x34')]['find']({'where':{'id':_0x25d8c9[_0x7cd2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x32ac83,null))[_0x7cd2('0x16')](function(_0x4640cc){if(_0x4640cc){_0x25d8c9[_0x7cd2('0x4f')][_0x7cd2('0x59')]=_0x4640cc['id'];return db[_0x7cd2('0x5a')][_0x7cd2('0x4e')](_0x25d8c9[_0x7cd2('0x4f')]);}})[_0x7cd2('0x16')](respondWithResult(_0x32ac83,null))['catch'](handleError(_0x32ac83,null));};exports[_0x7cd2('0x5b')]=function(_0x34fc89,_0x57d533){var _0xd8a061={'raw':![],'where':{}};var _0x42edab={};var _0x3b1b34={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x34fc89[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x57d533,null))[_0x7cd2('0x16')](function(_0x593429){if(_0x593429){_0x42edab[_0x7cd2('0x38')]=_[_0x7cd2('0x3a')](db[_0x7cd2('0x5a')]['rawAttributes']);_0x42edab[_0x7cd2('0x39')]=_['keys'](_0x34fc89[_0x7cd2('0x39')]);_0x42edab[_0x7cd2('0x3b')]=_[_0x7cd2('0x3c')](_0x42edab[_0x7cd2('0x38')],_0x42edab[_0x7cd2('0x39')]);_0xd8a061[_0x7cd2('0x3e')]=_[_0x7cd2('0x3c')](_0x42edab[_0x7cd2('0x38')],qs['fields'](_0x34fc89[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0xd8a061[_0x7cd2('0x3e')]=_0xd8a061['attributes']['length']?_0xd8a061[_0x7cd2('0x3e')]:_0x42edab['model'];if(!_0x34fc89[_0x7cd2('0x39')][_0x7cd2('0x40')](_0x7cd2('0x5c'))){_0xd8a061['limit']=qs['limit'](_0x34fc89[_0x7cd2('0x39')][_0x7cd2('0x41')]);_0xd8a061['offset']=qs[_0x7cd2('0x24')](_0x34fc89[_0x7cd2('0x39')]['offset']);}_0xd8a061['order']=qs[_0x7cd2('0x42')](_0x34fc89[_0x7cd2('0x39')][_0x7cd2('0x42')]);_0xd8a061[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_['pick'](_0x34fc89[_0x7cd2('0x39')],_0x42edab[_0x7cd2('0x3b')]));_0xd8a061[_0x7cd2('0x43')][_0x7cd2('0x59')]=_0x593429['id'];if(_0x34fc89[_0x7cd2('0x39')][_0x7cd2('0x44')]){_0xd8a061[_0x7cd2('0x43')]=_[_0x7cd2('0x4d')](_0xd8a061[_0x7cd2('0x43')],{'$or':_[_0x7cd2('0x33')](_0xd8a061[_0x7cd2('0x3e')],function(_0x1e3109){var _0x31ac99={};_0x31ac99[_0x1e3109]={'$like':'%'+_0x34fc89[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0x31ac99;})});}_0xd8a061=_[_0x7cd2('0x4d')]({},_0xd8a061,_0x34fc89[_0x7cd2('0x46')]);return db[_0x7cd2('0x5a')]['count']({'where':_0xd8a061['where']})[_0x7cd2('0x16')](function(_0x40f6d6){_0x3b1b34[_0x7cd2('0x26')]=_0x40f6d6;if(_0x34fc89[_0x7cd2('0x39')][_0x7cd2('0x47')]){_0xd8a061[_0x7cd2('0x4c')]=[{'all':!![]}];}return db[_0x7cd2('0x5a')]['findAll'](_0xd8a061);})[_0x7cd2('0x16')](function(_0x5dd8a8){_0x3b1b34['rows']=_0x5dd8a8;return _0x3b1b34;});}})['then'](respondWithFilteredResult(_0x57d533,_0xd8a061))['catch'](handleError(_0x57d533,null));};exports[_0x7cd2('0x5d')]=function(_0x236679,_0x24b751){return db['ChatWebsite'][_0x7cd2('0x54')]({'where':{'id':_0x236679['params']['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x24b751,null))[_0x7cd2('0x16')](function(_0x510569){if(_0x510569){return _0x510569[_0x7cd2('0x5d')](_0x236679[_0x7cd2('0x39')][_0x7cd2('0x5e')]);}})[_0x7cd2('0x16')](respondWithStatusCode(_0x24b751,null))[_0x7cd2('0x1f')](handleError(_0x24b751,null));};exports[_0x7cd2('0x5f')]=function(_0x2b2d38,_0x34bd0c){if(_0x2b2d38[_0x7cd2('0x4f')]['id']){delete _0x2b2d38[_0x7cd2('0x4f')]['id'];}return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0x2b2d38[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x34bd0c,null))[_0x7cd2('0x16')](function(_0x5290c3){if(_0x5290c3){_0x2b2d38[_0x7cd2('0x4f')][_0x7cd2('0x59')]=_0x5290c3['id'];return db[_0x7cd2('0x60')][_0x7cd2('0x4e')](_0x2b2d38[_0x7cd2('0x4f')]);}})[_0x7cd2('0x16')](respondWithResult(_0x34bd0c,null))[_0x7cd2('0x1f')](handleError(_0x34bd0c,null));};exports[_0x7cd2('0x61')]=function(_0x26252b,_0x2fc015){var _0x457ecf={'raw':![],'where':{}};var _0x48407f={};var _0x5dd2b7={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7cd2('0x62')]({'where':{'id':_0x26252b[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x2fc015,null))[_0x7cd2('0x16')](function(_0x26c740){if(_0x26c740){_0x48407f[_0x7cd2('0x38')]=_[_0x7cd2('0x3a')](db[_0x7cd2('0x60')][_0x7cd2('0x35')]);_0x48407f[_0x7cd2('0x39')]=_[_0x7cd2('0x3a')](_0x26252b[_0x7cd2('0x39')]);_0x48407f[_0x7cd2('0x3b')]=_['intersection'](_0x48407f[_0x7cd2('0x38')],_0x48407f[_0x7cd2('0x39')]);_0x457ecf[_0x7cd2('0x3e')]=_[_0x7cd2('0x3c')](_0x48407f['model'],qs[_0x7cd2('0x3d')](_0x26252b[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0x457ecf['attributes']=_0x457ecf['attributes'][_0x7cd2('0x3f')]?_0x457ecf['attributes']:_0x48407f['model'];if(!_0x26252b[_0x7cd2('0x39')][_0x7cd2('0x40')]('nolimit')){_0x457ecf['limit']=qs[_0x7cd2('0x41')](_0x26252b[_0x7cd2('0x39')]['limit']);_0x457ecf[_0x7cd2('0x24')]=qs[_0x7cd2('0x24')](_0x26252b[_0x7cd2('0x39')][_0x7cd2('0x24')]);}_0x457ecf[_0x7cd2('0x63')]=qs['sort'](_0x26252b['query'][_0x7cd2('0x42')]);_0x457ecf[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_[_0x7cd2('0x64')](_0x26252b[_0x7cd2('0x39')],_0x48407f['filters']));_0x457ecf['where'][_0x7cd2('0x59')]=_0x26c740['id'];if(_0x26252b[_0x7cd2('0x39')][_0x7cd2('0x44')]){_0x457ecf[_0x7cd2('0x43')]=_[_0x7cd2('0x4d')](_0x457ecf[_0x7cd2('0x43')],{'$or':_[_0x7cd2('0x33')](_0x457ecf[_0x7cd2('0x3e')],function(_0x29574b){var _0x4f2a1e={};_0x4f2a1e[_0x29574b]={'$like':'%'+_0x26252b[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0x4f2a1e;})});}_0x457ecf=_[_0x7cd2('0x4d')]({},_0x457ecf,_0x26252b[_0x7cd2('0x46')]);return db[_0x7cd2('0x60')][_0x7cd2('0x26')]({'where':_0x457ecf[_0x7cd2('0x43')]})[_0x7cd2('0x16')](function(_0x6d550b){_0x5dd2b7[_0x7cd2('0x26')]=_0x6d550b;if(_0x26252b[_0x7cd2('0x39')][_0x7cd2('0x47')]){_0x457ecf[_0x7cd2('0x4c')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7cd2('0x48')](_0x457ecf);})[_0x7cd2('0x16')](function(_0x379f4){_0x5dd2b7['rows']=_0x379f4;return _0x5dd2b7;});}})[_0x7cd2('0x16')](respondWithFilteredResult(_0x2fc015,_0x457ecf))[_0x7cd2('0x1f')](handleError(_0x2fc015,null));};exports[_0x7cd2('0x65')]=function(_0xaeedfd,_0x472827){return db['ChatWebsite'][_0x7cd2('0x54')]({'where':{'id':_0xaeedfd[_0x7cd2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x472827,null))['then'](function(_0x221063){if(_0x221063){return _0x221063[_0x7cd2('0x65')](_0xaeedfd[_0x7cd2('0x39')]['ids']);}})[_0x7cd2('0x16')](respondWithStatusCode(_0x472827,null))[_0x7cd2('0x1f')](handleError(_0x472827,null));};exports[_0x7cd2('0x66')]=function(_0x3e9c87,_0x586f80){_0x3e9c87[_0x7cd2('0x4f')][_0x7cd2('0x67')]=_0x3e9c87[_0x7cd2('0x68')][_0x7cd2('0x69')];return db[_0x7cd2('0x34')]['find']({'where':{'id':_0x3e9c87[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x586f80,null))[_0x7cd2('0x16')](saveUpdates(_0x3e9c87['body'],null))[_0x7cd2('0x16')](respondWithResult(_0x586f80,null))[_0x7cd2('0x1f')](handleError(_0x586f80,null));};exports[_0x7cd2('0x6a')]=function(_0x11ca13,_0x16ef4f){_0x11ca13[_0x7cd2('0x4f')][_0x7cd2('0x6b')]=_0x11ca13['file'][_0x7cd2('0x69')];return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0x11ca13[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x16ef4f,null))[_0x7cd2('0x16')](saveUpdates(_0x11ca13[_0x7cd2('0x4f')],null))['then'](respondWithResult(_0x16ef4f,null))[_0x7cd2('0x1f')](handleError(_0x16ef4f,null));};exports['addCustomerAvatar']=function(_0xda5680,_0x46c1a4){_0xda5680[_0x7cd2('0x4f')]['customerAvatar']=_0xda5680['file']['filename'];return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0xda5680[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x46c1a4,null))[_0x7cd2('0x16')](saveUpdates(_0xda5680[_0x7cd2('0x4f')],null))['then'](respondWithResult(_0x46c1a4,null))[_0x7cd2('0x1f')](handleError(_0x46c1a4,null));};exports[_0x7cd2('0x6c')]=function(_0x57f63d,_0x3023fa){_0x57f63d[_0x7cd2('0x4f')][_0x7cd2('0x6d')]=_0x57f63d[_0x7cd2('0x68')][_0x7cd2('0x69')];return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0x57f63d[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x3023fa,null))[_0x7cd2('0x16')](saveUpdates(_0x57f63d[_0x7cd2('0x4f')],null))[_0x7cd2('0x16')](respondWithResult(_0x3023fa,null))[_0x7cd2('0x1f')](handleError(_0x3023fa,null));};exports[_0x7cd2('0x6e')]=function(_0x16faba,_0xabf49c){var _0x1cb705=path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x71'));var _0x3387b2={'where':{'id':_0x16faba['params']['id']},'attributes':['id',_0x7cd2('0x67')],'raw':!![]};var _0x345aab=![];return require(_0x7cd2('0x72'))[_0x7cd2('0x73')]()[_0x7cd2('0x16')](function(_0x3af4af){if(_0x3af4af){_0x345aab=_0x3af4af[_0x7cd2('0x74')];}})['then'](function(){return db['ChatWebsite'][_0x7cd2('0x54')](_0x3387b2);})[_0x7cd2('0x16')](handleEntityNotFound(_0xabf49c,null))[_0x7cd2('0x16')](function(_0x374f8d){if(_0x374f8d){if(!_[_0x7cd2('0x75')](_0x374f8d[_0x7cd2('0x67')])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/logos/',_0x374f8d[_0x7cd2('0x67')]))&&_0x345aab){_0x1cb705=path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x76'),_0x374f8d[_0x7cd2('0x67')]);}}return _0xabf49c[_0x7cd2('0x77')](_0x1cb705);}})[_0x7cd2('0x1f')](handleError(_0xabf49c,null));};exports[_0x7cd2('0x78')]=function(_0x1e7667,_0x401301){var _0x74e28d=path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x79'));var _0x24f986={'where':{'id':_0x1e7667[_0x7cd2('0x4b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7cd2('0x34')][_0x7cd2('0x54')](_0x24f986)[_0x7cd2('0x16')](handleEntityNotFound(_0x401301,null))[_0x7cd2('0x16')](function(_0x4b3ea9){if(_0x4b3ea9){if(!_[_0x7cd2('0x75')](_0x4b3ea9[_0x7cd2('0x6b')])){if(fs[_0x7cd2('0x7a')](path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x7b'),_0x4b3ea9[_0x7cd2('0x6b')]))){_0x74e28d=path[_0x7cd2('0x6f')](config['root'],_0x7cd2('0x7b'),_0x4b3ea9[_0x7cd2('0x6b')]);}}return _0x401301[_0x7cd2('0x77')](_0x74e28d);}})[_0x7cd2('0x1f')](handleError(_0x401301,null));};exports[_0x7cd2('0x7c')]=function(_0x3a3d16,_0xe651bf){var _0x5948bb=path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x7d'));var _0x90bdf3={'where':{'id':_0x3a3d16[_0x7cd2('0x4b')]['id']},'attributes':['id','customerAvatar',_0x7cd2('0x7e')],'raw':!![]};return db[_0x7cd2('0x34')]['find'](_0x90bdf3)['then'](handleEntityNotFound(_0xe651bf,null))['then'](function(_0x44a52e){if(_0x44a52e){if(!_[_0x7cd2('0x75')](_0x44a52e['customerAvatar'])){if(fs[_0x7cd2('0x7a')](path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],'server/files/images/avatars/',_0x44a52e[_0x7cd2('0x7f')]))&&_0x44a52e[_0x7cd2('0x7e')]){_0x5948bb=path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x7b'),_0x44a52e[_0x7cd2('0x7f')]);}}return _0xe651bf[_0x7cd2('0x77')](_0x5948bb);}})[_0x7cd2('0x1f')](handleError(_0xe651bf,null));};exports[_0x7cd2('0x80')]=function(_0x251097,_0xd14c04){var _0x536bfe=path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x81'));var _0x360e85={'where':{'id':_0x251097[_0x7cd2('0x4b')]['id']},'attributes':['id',_0x7cd2('0x6d')],'raw':!![]};return db['ChatWebsite'][_0x7cd2('0x54')](_0x360e85)['then'](handleEntityNotFound(_0xd14c04,null))[_0x7cd2('0x16')](function(_0x4929a0){if(_0x4929a0){if(!_[_0x7cd2('0x75')](_0x4929a0[_0x7cd2('0x6d')])){if(fs[_0x7cd2('0x7a')](path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],_0x7cd2('0x7b'),_0x4929a0[_0x7cd2('0x6d')]))){_0x536bfe=path[_0x7cd2('0x6f')](config['root'],_0x7cd2('0x7b'),_0x4929a0['systemAvatar']);}}return _0xd14c04[_0x7cd2('0x77')](_0x536bfe);}})[_0x7cd2('0x1f')](handleError(_0xd14c04,null));};exports[_0x7cd2('0x82')]=function(_0x22268b,_0x186e2b){var _0x3ddd0f=require(_0x7cd2('0x83'));var _0x1c5163=new _0x3ddd0f();var _0x2a8bed=_0x1c5163['setUA'](_0x22268b[_0x7cd2('0x84')][_0x7cd2('0x85')])[_0x7cd2('0x86')]();var _0x4787cb={'body':_0x22268b['body'],'channel':_0x7cd2('0x87')};var _0x75889f=[];var _0x473fb9=[];var _0x877413={};var _0x2ccf0d=![];return db[_0x7cd2('0x88')][_0x7cd2('0x57')]()[_0x7cd2('0x16')](function(_0x4f8567){if(!_0x4f8567){throw new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))](_0x7cd2('0x8b'));}_0x75889f=_['difference'](_[_0x7cd2('0x3a')](_0x4f8567),[_0x7cd2('0x8c'),_0x7cd2('0x8d')]);_0x473fb9=_['difference'](_[_0x7cd2('0x3a')](_0x4f8567),['createdAt','updatedAt',_0x7cd2('0x8e'),_0x7cd2('0x8f')]);if(_0x22268b[_0x7cd2('0x4f')]['id']){delete _0x22268b[_0x7cd2('0x4f')]['id'];}if(_['isNil'](_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x90')])){throw new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))]('from\x20is\x20mandatory');}if(_[_0x7cd2('0x75')](_0x22268b[_0x7cd2('0x4f')]['body'])||_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x4f')]===''){throw new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))](_0x7cd2('0x91'));}if(_[_0x7cd2('0x75')](_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x92')])){throw new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))](_0x7cd2('0x93')+_0x473fb9);}if(!_['includes'](_0x473fb9,_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x92')])){throw new db[(_0x7cd2('0x89'))]['ValidationError'](_0x7cd2('0x94')+_0x473fb9);}_0x877413[_0x22268b['body'][_0x7cd2('0x92')]]=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x90')];})[_0x7cd2('0x16')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x22268b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7cd2('0x88')],'as':_0x7cd2('0x95'),'where':_0x877413,'limit':0x1,'order':[[_0x7cd2('0x8d'),_0x7cd2('0x96')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x7cd2('0x16')](handleEntityNotFound(_0x186e2b,null))[_0x7cd2('0x16')](function(_0x192fa9){if(_0x192fa9&&_0x192fa9['List']){_0x4787cb[_0x7cd2('0x97')]=_0x192fa9;_0x4787cb[_0x7cd2('0x98')]=_0x192fa9['Applications'];_0x4787cb['list']=_0x192fa9[_0x7cd2('0x99')];_0x4787cb[_0x7cd2('0x98')]=_[_0x7cd2('0x9a')](_0x4787cb[_0x7cd2('0x98')],['priority'],[_0x7cd2('0x9b')]);if(_0x4787cb[_0x7cd2('0x97')][_0x7cd2('0x9c')]){delete _0x4787cb[_0x7cd2('0x97')][_0x7cd2('0x9c')];}if(_0x4787cb[_0x7cd2('0x97')][_0x7cd2('0x99')]&&_0x4787cb['account'][_0x7cd2('0x99')][_0x7cd2('0x95')][_0x7cd2('0x3f')]){return _0x4787cb[_0x7cd2('0x97')][_0x7cd2('0x99')][_0x7cd2('0x95')][0x0];}var _0x1796ac=_['defaults'](_0x22268b[_0x7cd2('0x4f')],{'firstName':_0x22268b['body'][_0x7cd2('0x90')],'ListId':_0x192fa9['ListId']});_0x1796ac[_0x22268b['body'][_0x7cd2('0x92')]]=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x90')];return db[_0x7cd2('0x88')][_0x7cd2('0x4e')](_0x1796ac,{'fields':_0x75889f,'raw':!![]});}})[_0x7cd2('0x16')](handleEntityNotFound(_0x186e2b,null))['then'](function(_0x44901f){_0x4787cb[_0x7cd2('0x9d')]=_0x44901f;var _0xa65f73=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x9e')];if(_0x22268b[_0x7cd2('0x84')]['cf-connecting-ip']){_0xa65f73=_0x22268b[_0x7cd2('0x84')][_0x7cd2('0x9f')];}else if(_0x22268b[_0x7cd2('0x84')][_0x7cd2('0xa0')]){_0xa65f73=_[_0x7cd2('0xa1')](_0x22268b['headers'][_0x7cd2('0xa0')][_0x7cd2('0xa2')](','));}if(_0x44901f){var _0x5f0e1a={'ContactId':_0x44901f['id'],'ChatWebsiteId':_0x22268b[_0x7cd2('0x4b')]['id'],'from':(_0x44901f[_0x7cd2('0xa3')]||'')+'\x20'+(_0x44901f[_0x7cd2('0xa4')]||''),'customerIp':_0xa65f73,'customerPort':_0x22268b[_0x7cd2('0x84')][_0x7cd2('0xa5')]?_0x22268b[_0x7cd2('0x84')][_0x7cd2('0xa5')]:null,'referer':_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xa6')],'browserName':_0x2a8bed['browser'][_0x7cd2('0x2f')]&&_0x2a8bed[_0x7cd2('0xa7')][_0x7cd2('0xa8')]?util[_0x7cd2('0xa9')](_0x7cd2('0xaa'),_0x2a8bed[_0x7cd2('0xa7')]['name'],_0x2a8bed[_0x7cd2('0xa7')][_0x7cd2('0xa8')]):'unknown','browserVersion':_0x2a8bed[_0x7cd2('0xa7')][_0x7cd2('0xa8')]||_0x7cd2('0xab'),'osName':util[_0x7cd2('0xa9')](_0x7cd2('0xaa'),_0x2a8bed['os'][_0x7cd2('0x2f')],_0x2a8bed['os']['version']),'osVersion':_0x2a8bed['os'][_0x7cd2('0xa8')],'deviceModel':_0x2a8bed[_0x7cd2('0xac')]['model']&&_0x2a8bed[_0x7cd2('0xac')][_0x7cd2('0xad')]?util[_0x7cd2('0xa9')](_0x7cd2('0xae'),_0x2a8bed[_0x7cd2('0xac')]['model'],_0x2a8bed['device']['vendor'],_0x2a8bed[_0x7cd2('0xac')][_0x7cd2('0x37')]):null,'deviceVendor':_0x2a8bed[_0x7cd2('0xac')][_0x7cd2('0xad')],'deviceType':_0x2a8bed[_0x7cd2('0xac')][_0x7cd2('0x37')],'formData':JSON[_0x7cd2('0x1b')](_0x22268b[_0x7cd2('0x4f')])};var _0x40bb82={'ChatWebsiteId':_0x22268b['params']['id'],'closed':![]};if(_0x22268b['body']['threadId']){_0x40bb82[_0x7cd2('0xaf')]=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xaf')];return db[_0x7cd2('0xb0')][_0x7cd2('0x54')]({'where':_0x40bb82})['then'](function(_0x5d3f50){if(_0x5d3f50){return[_0x5d3f50,![]];}_0x5f0e1a[_0x7cd2('0xaf')]=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xaf')];_0x5f0e1a[_0x7cd2('0xb1')]=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xb1')];return db[_0x7cd2('0xb0')][_0x7cd2('0x4e')](_0x5f0e1a)[_0x7cd2('0x16')](function(_0x5005d1){return[_0x5005d1,!![]];});});}_0x40bb82[_0x7cd2('0xb2')]=_0x44901f['id'];if(_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xb3')]&&_0x22268b['body'][_0x7cd2('0xb3')]['id']){_0x40bb82['id']=_0x22268b['body']['interaction']['id'];return db[_0x7cd2('0xb0')]['find']({'where':_0x40bb82})[_0x7cd2('0x16')](function(_0x51e4f2){if(_0x51e4f2){return[_0x51e4f2,![]];}return db[_0x7cd2('0xb0')][_0x7cd2('0x4e')](_0x5f0e1a)[_0x7cd2('0x16')](function(_0x8978b1){return[_0x8978b1,!![]];});});}return db[_0x7cd2('0xb0')][_0x7cd2('0x4e')](_0x5f0e1a)[_0x7cd2('0x16')](function(_0x308f81){return[_0x308f81,!![]];});}})[_0x7cd2('0xb4')](function(_0x4d86e7,_0x148b71){if(_0x4d86e7){_0x2ccf0d=_0x148b71;if(!_0x148b71){var _0x4e207e={'from':(_0x4787cb[_0x7cd2('0x9d')][_0x7cd2('0xa3')]||'')+'\x20'+(_0x4787cb[_0x7cd2('0x9d')][_0x7cd2('0xa4')]||'')};if(_0x22268b[_0x7cd2('0x4f')]['threadId']&&_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xb5')]&&_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xaf')]!=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xb5')]){_0x4e207e[_0x7cd2('0xaf')]=_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0xb5')];}return _0x4d86e7[_0x7cd2('0x29')](_0x4e207e);}else{return _0x4d86e7;}}})[_0x7cd2('0x16')](function(_0x422d70){_0x4787cb['interaction']=_0x422d70[_0x7cd2('0x2b')]({'plain':!![]});_0x4787cb['interaction'][_0x7cd2('0xb6')]=_0x2ccf0d;if(_0x4787cb[_0x7cd2('0xb3')][_0x7cd2('0xb6')]){if(_0x4787cb[_0x7cd2('0x97')][_0x7cd2('0xb7')]){_0x4787cb[_0x7cd2('0x98')][_0x7cd2('0xb8')]({'id':0x0,'priority':_0x4787cb[_0x7cd2('0x98')][_0x7cd2('0x3f')]+0x1,'app':'close','appdata':_0x7cd2('0xb9'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x22268b[_0x7cd2('0x4f')][_0x7cd2('0x4f')],'ChatWebsiteId':_0x22268b['params']['id'],'ChatInteractionId':_0x422d70['id'],'direction':'in','ContactId':_0x4787cb[_0x7cd2('0x9d')]['id'],'AttachmentId':_0x22268b['body'][_0x7cd2('0xba')]});})[_0x7cd2('0x16')](function(_0x467181){_0x4787cb[_0x7cd2('0x1d')]=_0x467181;if(_0x4787cb[_0x7cd2('0xb3')][_0x7cd2('0xbb')]){return db[_0x7cd2('0xbc')][_0x7cd2('0x54')]({'attributes':['id',_0x7cd2('0x2f')],'where':{'id':_0x4787cb[_0x7cd2('0xb3')][_0x7cd2('0xbb')]}})[_0x7cd2('0x16')](function(_0x2ebcd1){if(_0x2ebcd1){_0x4787cb['applications'][_0x7cd2('0xbd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2ebcd1['name']+','+(_0x4787cb[_0x7cd2('0x97')][_0x7cd2('0xbe')]||0xa),'interval':'*,*,*,*'});_0x4787cb['forcedOwnership']=!![];}return respondWithRpcPromise(_0x7cd2('0xbf'),_0x7cd2('0xc0'),_0x4787cb);});}return respondWithRpcPromise(_0x7cd2('0xbf'),_0x7cd2('0xc0'),_0x4787cb);})['then'](function(_0x476924){respondWithRpcPromise(_0x7cd2('0xc1'),'EventManager',{'event':_0x7cd2('0x82'),'message':_0x476924},client9002);return _0x476924;})['then'](respondWithResult(_0x186e2b,null))[_0x7cd2('0x1f')](handleError(_0x186e2b,null));};exports[_0x7cd2('0xc2')]=function(_0xdd71a7,_0x1d0bb2){var _0x6cdfe1,_0x2d3cb5,_0x14d680;var _0x2df905=[];var _0x521b49={};var _0xf1af17=_0xdd71a7[_0x7cd2('0xc3')]||[];var _0x2e1b91=[];var _0x3ed64f;return db[_0x7cd2('0x88')]['describe']()[_0x7cd2('0x16')](function(_0x436d61){if(!_0x436d61){throw new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))](_0x7cd2('0x8b'));}_0x2df905=_['difference'](_[_0x7cd2('0x3a')](_0x436d61),[_0x7cd2('0x8c'),_0x7cd2('0x8d'),_0x7cd2('0x8e'),_0x7cd2('0x8f')]);if(_0xdd71a7[_0x7cd2('0x4f')]['id']){delete _0xdd71a7[_0x7cd2('0x4f')]['id'];}if(_['isNil'](_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0x90')])){throw _0x1d0bb2[_0x7cd2('0x21')](0x1f4)[_0x7cd2('0xc4')](new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0x4f')])||_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0x4f')]===''){throw _0x1d0bb2[_0x7cd2('0x21')](0x1f4)[_0x7cd2('0xc4')](new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0xc5')])){throw _0x1d0bb2['status'](0x1f4)[_0x7cd2('0xc4')](new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2df905));}if(!_[_0x7cd2('0xc6')](_0x2df905,_0xdd71a7['body'][_0x7cd2('0xc5')])){throw _0x1d0bb2['status'](0x1f4)[_0x7cd2('0xc4')](new db[(_0x7cd2('0x89'))][(_0x7cd2('0x8a'))](_0x7cd2('0xc7')+_0x2df905));}_0x521b49[_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0xc5')]]=_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0x90')];})['then'](function(){return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0xdd71a7[_0x7cd2('0x4b')]['id']},'include':[{'model':db[_0x7cd2('0xc8')],'as':_0x7cd2('0x99')},{'model':db[_0x7cd2('0xc9')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x1d0bb2,null))['then'](function(_0xe62b36){if(_0xe62b36&&_0xe62b36['List']){_0x2d3cb5=_0xe62b36;var _0x2c0d10=_['defaults'](_0xdd71a7[_0x7cd2('0x4f')],{'firstName':_0xdd71a7['body']['from'],'phone':_0xdd71a7['body'][_0x7cd2('0x90')],'ListId':_0xe62b36['ListId']});_0x2c0d10[_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0xc5')]]=_0xdd71a7[_0x7cd2('0x4f')][_0x7cd2('0x90')];return db[_0x7cd2('0x88')][_0x7cd2('0xca')]({'where':_0x521b49,'defaults':_0x2c0d10});}})[_0x7cd2('0xb4')](function(_0x31dbdf){if(_0x31dbdf){_0x14d680=_0x31dbdf;var _0x4977d0=fs[_0x7cd2('0xcb')](path[_0x7cd2('0x6f')](config[_0x7cd2('0x70')],'server/files/templates/chatOfflineMessage.ejs'),_0x7cd2('0xcc'));var _0x209c0=ejs[_0x7cd2('0xcd')](_0x4977d0,{'body':_[_0x7cd2('0xce')](_0xdd71a7[_0x7cd2('0x4f')]['body']),'bodyTitle':_0x2d3cb5[_0x7cd2('0xcf')]});return db['ChatOfflineMessage'][_0x7cd2('0x4e')]({'body':_0x209c0,'plainBody':htmlToText[_0x7cd2('0xd0')](_0x209c0),'ContactId':_0x31dbdf['id'],'ChatWebsiteId':_0x2d3cb5['id']});}})[_0x7cd2('0x16')](function(_0x5baaf9){_0x3ed64f=_0x5baaf9;if(_0xf1af17[_0x7cd2('0x3f')]){var _0x5cef90=_0xf1af17[_0x7cd2('0x33')](function(_0x480529){return{'name':_0x480529[_0x7cd2('0xd1')],'basename':_0x480529[_0x7cd2('0x69')],'type':_0x480529[_0x7cd2('0xd2')],'ChatOfflineMessageId':_0x5baaf9['id']};});_0x2e1b91=_0x5cef90['map'](_0x47b4f1=>{var _0x355161={'filename':_0x47b4f1[_0x7cd2('0x2f')],'path':path['join'](config[_0x7cd2('0x70')],_0x7cd2('0xd3'),_0x7cd2('0xc3'),_0x7cd2('0xd4'),_0x7cd2('0xd5'),_0x47b4f1[_0x7cd2('0xd6')])};return _0x355161;});if(!_0x2d3cb5[_0x7cd2('0xd7')]){return db['sequelize']['transaction'](function(_0x19e102){return db[_0x7cd2('0xd8')][_0x7cd2('0xd9')](_0x5cef90,{'transaction':_0x19e102});});}}})['then'](function(){if(_0x3ed64f){_0x6cdfe1=_0x3ed64f;return db[_0x7cd2('0xc9')][_0x7cd2('0x62')]({'where':{'service':!![]},'include':[{'model':db[_0x7cd2('0xda')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7cd2('0xdb')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x7cd2('0x16')](function(_0x416ce4){if(_0x416ce4&&_0x416ce4['Smtp']&&_0x2d3cb5[_0x7cd2('0xdc')]&&_0x2d3cb5[_0x7cd2('0xdd')]){var _0x48a14d=_0x416ce4[_0x7cd2('0xde')]();return respondWithRpcPromise(_0x7cd2('0xdf'),_0x7cd2('0xe0'),{'account':_0x48a14d,'message':{'from':util[_0x7cd2('0xa9')](_0x7cd2('0xe1'),_0x416ce4[_0x7cd2('0x2f')],_0x416ce4['email']||_0x416ce4['Smtp'][_0x7cd2('0x52')]),'to':_0x2d3cb5['forwardOfflineAddress'],'subject':_0x2d3cb5['offlineMessageSubject'],'html':_0x6cdfe1[_0x7cd2('0x4f')],'attachments':_0x2e1b91}},client9003)[_0x7cd2('0x16')](function(){return _0x6cdfe1;})['catch'](function(_0x2017f6){logger['error'](_0x2017f6);});}})[_0x7cd2('0x16')](function(){if(_0x2d3cb5&&_0x2d3cb5['openNewInteraction']&&_0x2d3cb5['MailAccountId']){var _0x72b8c8=[];if(_0xf1af17[_0x7cd2('0x3f')]){_0x72b8c8=_0xf1af17[_0x7cd2('0x33')](function(_0x1d99a4){return{'name':_0x1d99a4[_0x7cd2('0xd1')],'basename':_0x1d99a4[_0x7cd2('0x69')],'type':_0x1d99a4[_0x7cd2('0xd2')],'ChatOfflineMessageId':_0x3ed64f['id']};});}var _0x5a1678;if(!_[_0x7cd2('0x75')](_0x2d3cb5[_0x7cd2('0xe2')])){var _0x433c95=_[_0x7cd2('0x33')](_0xdd71a7[_0x7cd2('0x4f')],function(_0x3506af){return _0x3506af;});var _0x34ce3b=_[_0x7cd2('0xe3')](_0x433c95)[0x0];var _0x218f6c=_[_0x7cd2('0xe4')](_0x34ce3b,function(_0x4d829a){return _0x4d829a;});_0x5a1678=_0x218f6c[0x1][_0x2d3cb5[_0x7cd2('0xe2')]];}var _0x4d2e54={'from':_0x14d680['email'],'firstName':_0x14d680[_0x7cd2('0xa3')],'lastName':_0x14d680[_0x7cd2('0xa4')],'mapKey':_0x7cd2('0xe5'),'message':{'from':_0x14d680[_0x7cd2('0xe5')],'to':_0x2d3cb5[_0x7cd2('0xc9')][_0x7cd2('0xe5')],'cc':'','subject':_[_0x7cd2('0x75')](_0x5a1678)?_0x2d3cb5['offlineMessageSubject']:_0x5a1678,'messageId':'','sentAt':new Date(),'attach':_0x72b8c8['length'],'attachments':_0x72b8c8,'originChannel':_0x7cd2('0xe6'),'ChatWebsiteId':_0x2d3cb5['id'],'ChatOfflineMessageId':_0x6cdfe1['id'],'originTo':_0x2d3cb5[_0x7cd2('0xc9')]['email']},'body':_0x6cdfe1[_0x7cd2('0x4f')]};var _0x2516e0={'account':{'id':_0x2d3cb5[_0x7cd2('0xe7')]},'body':_0x4d2e54,'log':_0x7cd2('0xe8')};return respondWithRpcPromise(_0x7cd2('0xe8'),_0x7cd2('0xe9'),_0x2516e0,client9001)[_0x7cd2('0x16')](function(){return _0x6cdfe1;})['catch'](function(_0x10ea17){logger[_0x7cd2('0x1c')](_0x10ea17);});}return;})[_0x7cd2('0x16')](function(){if(_0x6cdfe1){return _0x6cdfe1;}})[_0x7cd2('0x16')](respondWithResult(_0x1d0bb2,null))[_0x7cd2('0x1f')](function(_0x10f3f5){logger[_0x7cd2('0x1c')](_0x7cd2('0x1f'),_0x10f3f5);for(var _0x5082c9 of _0xf1af17){var _0x38407b=path[_0x7cd2('0x6f')](config['root'],_0x7cd2('0xd3'),_0x7cd2('0xc3'),_0x7cd2('0xd4'),_0x7cd2('0xd5'),_0x5082c9[_0x7cd2('0x69')]);fs_extra['remove'](_0x38407b)[_0x7cd2('0x1f')](function(_0x5cfe75){logger['error'](_0x7cd2('0xea'),_0x38407b,_0x5cfe75);});}});};exports[_0x7cd2('0xeb')]=function(_0x2300c7,_0x101ac6){return db['ChatInteraction'][_0x7cd2('0x54')]({'where':{'id':_0x2300c7[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x101ac6,null))[_0x7cd2('0x16')](function(_0x11d086){if(_0x11d086){return _0x11d086[_0x7cd2('0xeb')](_0x2300c7[_0x7cd2('0x4f')][_0x7cd2('0x5e')],_[_0x7cd2('0xec')](_0x2300c7[_0x7cd2('0x4f')],[_0x7cd2('0x5e'),'id'])||{});}})[_0x7cd2('0x16')](respondWithResult(_0x101ac6,null))[_0x7cd2('0x1f')](handleError(_0x101ac6,null));};exports[_0x7cd2('0xed')]=function(_0x26091c,_0x538094){var _0x128dc0={'raw':![],'where':{}};var _0x405b81={};var _0x1e5620={'count':0x0,'rows':[]};return db[_0x7cd2('0x34')][_0x7cd2('0x62')]({'where':{'id':_0x26091c['params']['id']}})['then'](handleEntityNotFound(_0x538094,null))[_0x7cd2('0x16')](function(_0x5bdf9f){if(_0x5bdf9f){_0x405b81[_0x7cd2('0x38')]=_[_0x7cd2('0x3a')](db['ChatInteraction'][_0x7cd2('0x35')]);_0x405b81['query']=_['keys'](_0x26091c['query']);_0x405b81[_0x7cd2('0x3b')]=_[_0x7cd2('0x3c')](_0x405b81[_0x7cd2('0x38')],_0x405b81[_0x7cd2('0x39')]);_0x128dc0[_0x7cd2('0x3e')]=_[_0x7cd2('0x3c')](_0x405b81[_0x7cd2('0x38')],qs[_0x7cd2('0x3d')](_0x26091c[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0x128dc0[_0x7cd2('0x3e')]=_0x128dc0[_0x7cd2('0x3e')][_0x7cd2('0x3f')]?_0x128dc0[_0x7cd2('0x3e')]:_0x405b81['model'];if(!_0x26091c['query'][_0x7cd2('0x40')](_0x7cd2('0x5c'))){_0x128dc0['limit']=qs['limit'](_0x26091c[_0x7cd2('0x39')][_0x7cd2('0x41')]);_0x128dc0['offset']=qs['offset'](_0x26091c['query'][_0x7cd2('0x24')]);}_0x128dc0[_0x7cd2('0x63')]=qs[_0x7cd2('0x42')](_0x26091c[_0x7cd2('0x39')]['sort']);_0x128dc0[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_['pick'](_0x26091c['query'],_0x405b81[_0x7cd2('0x3b')]));_0x128dc0[_0x7cd2('0x43')]['ChatWebsiteId']=_0x5bdf9f['id'];if(_0x26091c[_0x7cd2('0x39')][_0x7cd2('0x44')]){_0x128dc0[_0x7cd2('0x43')]=_[_0x7cd2('0x4d')](_0x128dc0['where'],{'$or':_[_0x7cd2('0x33')](_0x128dc0[_0x7cd2('0x3e')],function(_0xe0bdca){var _0x59f724={};_0x59f724[_0xe0bdca]={'$like':'%'+_0x26091c[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0x59f724;})});}_0x128dc0=_[_0x7cd2('0x4d')]({},_0x128dc0,_0x26091c[_0x7cd2('0x46')]);return db[_0x7cd2('0xb0')][_0x7cd2('0x26')]({'where':_0x128dc0[_0x7cd2('0x43')]})[_0x7cd2('0x16')](function(_0x39d6e7){_0x1e5620[_0x7cd2('0x26')]=_0x39d6e7;if(_0x26091c[_0x7cd2('0x39')][_0x7cd2('0x47')]){_0x128dc0[_0x7cd2('0x4c')]=[{'model':db[_0x7cd2('0x88')],'as':_0x7cd2('0xee'),'required':![]},{'model':db[_0x7cd2('0xbc')],'as':'Owner','attributes':[_0x7cd2('0x2f'),_0x7cd2('0xef'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x7cd2('0xf0'),'attributes':['id',_0x7cd2('0x2f'),_0x7cd2('0xf1')],'where':_0x26091c[_0x7cd2('0x39')]['tag']?{'id':_0x26091c[_0x7cd2('0x39')][_0x7cd2('0xf2')]}:undefined,'required':_0x26091c[_0x7cd2('0x39')]['tag']?!![]:![]}];}return db[_0x7cd2('0xb0')][_0x7cd2('0x48')](_0x128dc0);})[_0x7cd2('0x16')](function(_0x26be3b){_0x1e5620[_0x7cd2('0x49')]=_0x26be3b;return _0x1e5620;});}})[_0x7cd2('0x16')](respondWithFilteredResult(_0x538094,_0x128dc0))[_0x7cd2('0x1f')](handleError(_0x538094,null));};function iftimePromise(_0x3c77df,_0x5ab79d){return respondWithRpcPromise('Command',_0x7cd2('0xf3'),{'command':_0x5ab79d[_0x7cd2('0xf4')]?util[_0x7cd2('0xa9')](_0x7cd2('0xf5'),_0x3c77df['interval'],_0x5ab79d['timezone']):util['format'](_0x7cd2('0xf6'),_0x3c77df[_0x7cd2('0xf7')])},client9002)[_0x7cd2('0x16')](function(_0x20f10d){var _0x3c5cf9=_0x20f10d&&_0x20f10d[_0x7cd2('0xf8')]('true')>=0x0?!![]:![];logger[_0x7cd2('0x1e')](_0x7cd2('0xf9'),_0x5ab79d['id'],_0x3c77df['id'],_0x3c77df[_0x7cd2('0xf7')],_0x3c5cf9?_0x7cd2('0xfa'):_0x7cd2('0xfb'),_0x5ab79d[_0x7cd2('0xf4')]?_0x5ab79d[_0x7cd2('0xf4')]:_0x7cd2('0xfc'));return _0x3c5cf9;})[_0x7cd2('0x1f')](function(_0x5d85e3){logger[_0x7cd2('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5ab79d['id'],_0x3c77df['id'],_0x3c77df[_0x7cd2('0xf7')],util['inspect'](_0x5d85e3,{'showHidden':![],'depth':null}),_0x5ab79d[_0x7cd2('0xf4')]?_0x5ab79d[_0x7cd2('0xf4')]:_0x7cd2('0xfc'));return![];});}exports[_0x7cd2('0xf3')]=function(_0x5af50a,_0x50dc06){var _0xd28bf3=0x0;var _0x5b2510=0x0;var _0x53559a=![];var _0x175d8e;var _0xd366aa;return db['ChatWebsite'][_0x7cd2('0x54')]({'where':{'id':_0x5af50a['params']['id']},'include':[{'model':db[_0x7cd2('0xfd')],'as':'Interval','include':[{'model':db[_0x7cd2('0xfd')],'as':_0x7cd2('0xfe'),'attributes':['id',_0x7cd2('0xf7')],'raw':!![]}]}]})[_0x7cd2('0x16')](handleEntityNotFound(_0x50dc06,null))[_0x7cd2('0x16')](function(_0x509fa5){if(_0x509fa5){_0x175d8e=_0x509fa5;return _0x509fa5[_0x7cd2('0xff')]({'raw':!![]});}})[_0x7cd2('0x16')](function(_0x1b4c3a){if(_0x175d8e){if(_0x1b4c3a){_0xd366aa=_0x1b4c3a;}}return require(_0x7cd2('0x72'))[_0x7cd2('0x73')]();})[_0x7cd2('0x16')](function(_0x5205cc){if(_0x5205cc){_0x5b2510=_0x5205cc[_0x7cd2('0x100')];_0x53559a=_0x5205cc['custom'];}})[_0x7cd2('0x16')](function(){return db['ChatInteraction'][_0x7cd2('0x26')]({'where':{'closed':![]}});})[_0x7cd2('0x16')](function(_0x46d746){_0xd28bf3=_0x46d746;if(_0x5b2510&&_0x46d746>_0x5b2510){return db['License'][_0x7cd2('0x62')]({'where':{'id':0x1}})[_0x7cd2('0x16')](function(_0x1b5686){if(_0x1b5686){_0x1b5686[_0x7cd2('0x101')](_0x7cd2('0x102'));}});}})[_0x7cd2('0x16')](function(){if(_0x175d8e[_0x7cd2('0xfd')]&&_0x175d8e['Interval'][_0x7cd2('0xfe')]){var _0x1dfc20=[];for(var _0x47dc8b=0x0;_0x47dc8b<_0x175d8e[_0x7cd2('0xfd')][_0x7cd2('0xfe')]['length'];_0x47dc8b++){var _0x160069=_0x175d8e[_0x7cd2('0xfd')]['Intervals'][_0x47dc8b]['get']({'plain':!![]});_0x1dfc20[_0x7cd2('0xb8')](iftimePromise(_0x160069,_0x175d8e));}return BPromise[_0x7cd2('0x103')](_0x1dfc20)[_0x7cd2('0x16')](function(_0x14f2f5){return _[_0x7cd2('0x104')](_0x14f2f5);});}else{return!![];}})[_0x7cd2('0x16')](function(_0x5aabb8){var _0x39f73a=fs[_0x7cd2('0xcb')](path['join'](config[_0x7cd2('0x70')],_0x7cd2('0x105')),_0x7cd2('0xcc'));var _0x92ff24={'remote':_0x175d8e[_0x7cd2('0x106')],'query':querystring[_0x7cd2('0x1b')](_[_0x7cd2('0x4d')](_0x175d8e[_0x7cd2('0x2b')]({'plain':!![]}),{'customerIp':_0x5af50a[_0x7cd2('0x84')][_0x7cd2('0xa0')]||_0x5af50a['headers'][_0x7cd2('0x107')]||_0x5af50a[_0x7cd2('0x108')][_0x7cd2('0x109')]||_0x5af50a['ip'],'referer':_0x5af50a[_0x7cd2('0x84')][_0x7cd2('0xa6')],'openedInteractions':_0xd28bf3,'maxInteractions':_0x5b2510,'virtual':_0x53559a[_0x7cd2('0x100')],'online':_0x5aabb8,'custom':_0x53559a}))[_0x7cd2('0x10a')](/'/g,'\x5c\x27')};_0x50dc06[_0x7cd2('0xc4')](ejs[_0x7cd2('0xcd')](Mustache[_0x7cd2('0xcd')](_0x39f73a,_0x92ff24),{'proactiveActions':_0xd366aa,'alignment':_0x175d8e['alignment'],'verticalAlignment':_0x175d8e[_0x7cd2('0x10b')],'div_color':_0x175d8e[_0x7cd2('0xf1')],'labelText':_0x175d8e[_0x7cd2('0x10c')],'text_color':_0x175d8e[_0x7cd2('0x10d')],'text_button_color':_0x175d8e[_0x7cd2('0x10e')],'button_color':_0x175d8e[_0x7cd2('0x10f')],'background_color':_0x175d8e[_0x7cd2('0x110')],'hideWhenOffline':_0x175d8e['hideWhenOffline'],'interval':_0x175d8e[_0x7cd2('0x111')]}));})[_0x7cd2('0x1f')](handleError(_0x50dc06,null));};exports[_0x7cd2('0x112')]=function(_0x583771,_0x151aba){var _0x1e88dc=_0x583771[_0x7cd2('0x4b')]['id'];var _0x54757e=_0x583771['body'];var _0x2bb9c0=0xc8;var _0x12e3f2=null;return db[_0x7cd2('0x113')][_0x7cd2('0x114')]({'isolationLevel':db['sequelize'][_0x7cd2('0x115')][_0x7cd2('0x116')]['READ_COMMITTED']},function(_0x5d32e3){return db[_0x7cd2('0x34')][_0x7cd2('0x62')]({'where':{'id':_0x1e88dc},'transaction':_0x5d32e3})[_0x7cd2('0x16')](function(_0xfd4bd5){if(_0xfd4bd5){return db[_0x7cd2('0x117')]['destroy']({'where':{'ChatWebsiteId':_0x1e88dc},'transaction':_0x5d32e3})['then'](function(){var _0x363fc8=_[_0x7cd2('0x33')](_0x54757e,function(_0x3508b4){_0x3508b4[_0x7cd2('0x59')]=_0x1e88dc;return _0x3508b4;});return db[_0x7cd2('0x117')][_0x7cd2('0xd9')](_0x363fc8,{'transaction':_0x5d32e3});});}else{_0x2bb9c0=0x194;_0x12e3f2=[];}});})[_0x7cd2('0x16')](function(){if(_0x2bb9c0!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x1e88dc},'order':_0x7cd2('0x118')})['then'](function(_0x54e751){_0x12e3f2=_0x54e751;});}})['catch'](function(_0x16f6ea){_0x2bb9c0=0x1f4;logger[_0x7cd2('0x1c')](_0x16f6ea[_0x7cd2('0x2e')]);if(_0x16f6ea[_0x7cd2('0x2f')]){delete _0x16f6ea[_0x7cd2('0x2f')];}_0x12e3f2=_0x16f6ea;})[_0x7cd2('0x119')](function(){if(_0x12e3f2===null){_0x151aba[_0x7cd2('0x20')](_0x2bb9c0);}else{if(_0x2bb9c0===0x1f4){_0x151aba[_0x7cd2('0x21')](_0x2bb9c0)['send'](_0x12e3f2);}else{_0x151aba['status'](_0x2bb9c0)[_0x7cd2('0x23')](_0x12e3f2);}}});};exports[_0x7cd2('0x11a')]=function(_0x1c8efd,_0x3c71d2){var _0xae75ad={};var _0x3abb51={};var _0x4e5cf5;var _0x5f01b2;return db[_0x7cd2('0x34')][_0x7cd2('0x62')]({'where':{'id':_0x1c8efd['params']['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x3c71d2,null))[_0x7cd2('0x16')](function(_0xccc8df){if(_0xccc8df){_0x4e5cf5=_0xccc8df;_0x3abb51[_0x7cd2('0x38')]=_['keys'](db['ChatApplication'][_0x7cd2('0x35')]);_0x3abb51['query']=_[_0x7cd2('0x3a')](_0x1c8efd[_0x7cd2('0x39')]);_0x3abb51['filters']=_['intersection'](_0x3abb51[_0x7cd2('0x38')],_0x3abb51[_0x7cd2('0x39')]);_0xae75ad[_0x7cd2('0x3e')]=_[_0x7cd2('0x3c')](_0x3abb51['model'],qs['fields'](_0x1c8efd[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0xae75ad['attributes']=_0xae75ad[_0x7cd2('0x3e')][_0x7cd2('0x3f')]?_0xae75ad[_0x7cd2('0x3e')]:_0x3abb51[_0x7cd2('0x38')];_0xae75ad['order']=qs[_0x7cd2('0x42')](_0x1c8efd[_0x7cd2('0x39')][_0x7cd2('0x42')]);_0xae75ad[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_[_0x7cd2('0x64')](_0x1c8efd['query'],_0x3abb51[_0x7cd2('0x3b')]));if(_0x1c8efd[_0x7cd2('0x39')][_0x7cd2('0x44')]){_0xae75ad['where']=_['merge'](_0xae75ad[_0x7cd2('0x43')],{'$or':_[_0x7cd2('0x33')](_0xae75ad['attributes'],function(_0x5e051b){var _0x5a92b6={};_0x5a92b6[_0x5e051b]={'$like':'%'+_0x1c8efd[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0x5a92b6;})});}_0xae75ad=_[_0x7cd2('0x4d')]({},_0xae75ad,_0x1c8efd[_0x7cd2('0x46')]);return _0x4e5cf5[_0x7cd2('0x11a')](_0xae75ad);}})['then'](function(_0x51c05d){if(_0x51c05d){_0x5f01b2=_0x51c05d['length'];if(!_0x1c8efd[_0x7cd2('0x39')][_0x7cd2('0x40')](_0x7cd2('0x5c'))){_0xae75ad[_0x7cd2('0x41')]=qs[_0x7cd2('0x41')](_0x1c8efd[_0x7cd2('0x39')]['limit']);_0xae75ad['offset']=qs[_0x7cd2('0x24')](_0x1c8efd[_0x7cd2('0x39')]['offset']);}return _0x4e5cf5[_0x7cd2('0x11a')](_0xae75ad);}})[_0x7cd2('0x16')](function(_0x395864){if(_0x395864){return _0x395864?{'count':_0x5f01b2,'rows':_0x395864}:null;}})['then'](respondWithResult(_0x3c71d2,null))[_0x7cd2('0x1f')](handleError(_0x3c71d2,null));};exports[_0x7cd2('0x11b')]=function(_0x12c6e8,_0x5cfa7e){return db[_0x7cd2('0x11c')]['find']({'where':{'id':_0x12c6e8[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x5cfa7e,null))[_0x7cd2('0x16')](function(_0x127b3e){if(_0x127b3e){return _0x127b3e[_0x7cd2('0x11b')](_0x12c6e8[_0x7cd2('0x4f')]['ids'],_[_0x7cd2('0xec')](_0x12c6e8[_0x7cd2('0x4f')],[_0x7cd2('0x5e'),'id'])||{});}})[_0x7cd2('0x16')](respondWithResult(_0x5cfa7e,null))[_0x7cd2('0x1f')](handleError(_0x5cfa7e,null));};exports[_0x7cd2('0xff')]=function(_0xef147d,_0xb5a2a2){var _0x315788={};var _0x44a232={};var _0x34a414;var _0x39b14f;return db['ChatWebsite']['findOne']({'where':{'id':_0xef147d[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0xb5a2a2,null))['then'](function(_0xc9c84e){if(_0xc9c84e){_0x34a414=_0xc9c84e;_0x44a232[_0x7cd2('0x38')]=_[_0x7cd2('0x3a')](db[_0x7cd2('0x11d')][_0x7cd2('0x35')]);_0x44a232[_0x7cd2('0x39')]=_[_0x7cd2('0x3a')](_0xef147d[_0x7cd2('0x39')]);_0x44a232[_0x7cd2('0x3b')]=_['intersection'](_0x44a232[_0x7cd2('0x38')],_0x44a232[_0x7cd2('0x39')]);_0x315788[_0x7cd2('0x3e')]=_[_0x7cd2('0x3c')](_0x44a232['model'],qs[_0x7cd2('0x3d')](_0xef147d['query'][_0x7cd2('0x3d')]));_0x315788['attributes']=_0x315788[_0x7cd2('0x3e')][_0x7cd2('0x3f')]?_0x315788[_0x7cd2('0x3e')]:_0x44a232['model'];_0x315788[_0x7cd2('0x63')]=qs[_0x7cd2('0x42')](_0xef147d['query'][_0x7cd2('0x42')]);_0x315788[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_[_0x7cd2('0x64')](_0xef147d['query'],_0x44a232[_0x7cd2('0x3b')]));if(_0xef147d[_0x7cd2('0x39')][_0x7cd2('0x44')]){_0x315788[_0x7cd2('0x43')]=_[_0x7cd2('0x4d')](_0x315788[_0x7cd2('0x43')],{'$or':_[_0x7cd2('0x33')](_0x315788[_0x7cd2('0x3e')],function(_0x598822){var _0xef4aa4={};_0xef4aa4[_0x598822]={'$like':'%'+_0xef147d[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0xef4aa4;})});}_0x315788=_[_0x7cd2('0x4d')]({},_0x315788,_0xef147d['options']);return _0x34a414[_0x7cd2('0xff')](_0x315788);}})['then'](function(_0x299e2c){if(_0x299e2c){_0x39b14f=_0x299e2c[_0x7cd2('0x3f')];if(!_0xef147d[_0x7cd2('0x39')][_0x7cd2('0x40')](_0x7cd2('0x5c'))){_0x315788[_0x7cd2('0x41')]=qs[_0x7cd2('0x41')](_0xef147d[_0x7cd2('0x39')][_0x7cd2('0x41')]);_0x315788[_0x7cd2('0x24')]=qs[_0x7cd2('0x24')](_0xef147d['query'][_0x7cd2('0x24')]);}return _0x34a414[_0x7cd2('0xff')](_0x315788);}})[_0x7cd2('0x16')](function(_0x297379){if(_0x297379){return _0x297379?{'count':_0x39b14f,'rows':_0x297379}:null;}})['then'](respondWithResult(_0xb5a2a2,null))['catch'](handleError(_0xb5a2a2,null));};exports[_0x7cd2('0x11e')]=function(_0x1175d7,_0x522bb9){var _0x2f98fa=_0x1175d7['query']['online']===_0x7cd2('0x11f')?'offlineForm':_0x7cd2('0x120');return db[_0x7cd2('0x34')]['find']({'attributes':['id',_0x2f98fa],'where':{'id':_0x1175d7[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x522bb9,null))[_0x7cd2('0x16')](function(_0x561ee5){if(_0x561ee5){var _0x5147b6=_0x561ee5[_0x2f98fa];var _0x20510c=_0x5147b6&&_0x5147b6[_0x7cd2('0x121')]?_0x5147b6[_0x7cd2('0x121')]:[];_0x522bb9[_0x7cd2('0xc4')]({'fromKey':_[_0x7cd2('0x75')](_0x5147b6[_0x7cd2('0x122')])?undefined:_0x5147b6[_0x7cd2('0x122')],'count':_0x20510c[_0x7cd2('0x3f')],'rows':_0x20510c});}})[_0x7cd2('0x1f')](handleError(_0x522bb9,null));};exports['getOfflineMessages']=function(_0x5bcd51,_0x3c9747){var _0x1c8bc8={'raw':![],'where':{}};var _0x59d3df={};var _0x42f372={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7cd2('0x62')]({'where':{'id':_0x5bcd51[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x3c9747,null))['then'](function(_0x86513a){if(_0x86513a){_0x59d3df['model']=_['keys'](db[_0x7cd2('0x123')][_0x7cd2('0x35')]);_0x59d3df[_0x7cd2('0x39')]=_[_0x7cd2('0x3a')](_0x5bcd51[_0x7cd2('0x39')]);_0x59d3df[_0x7cd2('0x3b')]=_[_0x7cd2('0x3c')](_0x59d3df['model'],_0x59d3df[_0x7cd2('0x39')]);_0x1c8bc8[_0x7cd2('0x3e')]=_['intersection'](_0x59d3df[_0x7cd2('0x38')],qs['fields'](_0x5bcd51[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0x1c8bc8[_0x7cd2('0x3e')]=_0x1c8bc8[_0x7cd2('0x3e')]['length']?_0x1c8bc8[_0x7cd2('0x3e')]:_0x59d3df[_0x7cd2('0x38')];if(!_0x5bcd51['query'][_0x7cd2('0x40')](_0x7cd2('0x5c'))){_0x1c8bc8[_0x7cd2('0x41')]=qs['limit'](_0x5bcd51[_0x7cd2('0x39')][_0x7cd2('0x41')]);_0x1c8bc8[_0x7cd2('0x24')]=qs[_0x7cd2('0x24')](_0x5bcd51[_0x7cd2('0x39')]['offset']);}_0x1c8bc8[_0x7cd2('0x63')]=qs[_0x7cd2('0x42')](_0x5bcd51['query'][_0x7cd2('0x42')]);_0x1c8bc8[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_[_0x7cd2('0x64')](_0x5bcd51['query'],_0x59d3df[_0x7cd2('0x3b')]));_0x1c8bc8[_0x7cd2('0x43')][_0x7cd2('0x59')]=_0x86513a['id'];if(_0x5bcd51['query'][_0x7cd2('0x44')]){_0x1c8bc8[_0x7cd2('0x43')]=_[_0x7cd2('0x4d')](_0x1c8bc8[_0x7cd2('0x43')],{'$or':_[_0x7cd2('0x33')](_0x1c8bc8[_0x7cd2('0x3e')],function(_0x2aee4d){var _0x34f5cd={};_0x34f5cd[_0x2aee4d]={'$like':'%'+_0x5bcd51[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0x34f5cd;})});}_0x1c8bc8=_[_0x7cd2('0x4d')]({},_0x1c8bc8,_0x5bcd51[_0x7cd2('0x46')]);return db['ChatOfflineMessage']['count']({'where':_0x1c8bc8[_0x7cd2('0x43')]})[_0x7cd2('0x16')](function(_0x38a07e){_0x42f372[_0x7cd2('0x26')]=_0x38a07e;if(_0x5bcd51[_0x7cd2('0x39')][_0x7cd2('0x47')]){_0x1c8bc8['include']=[{'all':!![]}];}else{_0x1c8bc8[_0x7cd2('0x4c')]=[{'model':db['CmContact'],'as':_0x7cd2('0xee'),'required':![]},{'model':db['Attachment'],'as':_0x7cd2('0x124'),'required':![]}];}return db[_0x7cd2('0x123')][_0x7cd2('0x48')](_0x1c8bc8);})['then'](function(_0x5ea675){_0x42f372[_0x7cd2('0x49')]=_0x5ea675;return _0x42f372;});}})['then'](respondWithFilteredResult(_0x3c9747,_0x1c8bc8))[_0x7cd2('0x1f')](handleError(_0x3c9747,null));};exports[_0x7cd2('0x125')]=function(_0x626d28,_0x3c3a82){return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0x626d28[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0x3c3a82,null))[_0x7cd2('0x16')](function(_0x12c5da){if(_0x12c5da){return _0x12c5da[_0x7cd2('0x125')](_0x626d28[_0x7cd2('0x4f')][_0x7cd2('0x5e')],_[_0x7cd2('0xec')](_0x626d28[_0x7cd2('0x4f')],['ids','id'])||{})['spread'](function(_0x33d6ae){for(var _0x2c86bf=0x0;_0x2c86bf<_0x626d28[_0x7cd2('0x4f')]['ids'][_0x7cd2('0x3f')];_0x2c86bf+=0x1){socket['emit'](_0x7cd2('0x126'),{'UserId':Number(_0x626d28[_0x7cd2('0x4f')][_0x7cd2('0x5e')][_0x2c86bf]),'ChatWebsiteId':Number(_0x626d28[_0x7cd2('0x4b')]['id'])});}return _0x33d6ae;});}})[_0x7cd2('0x16')](respondWithResult(_0x3c3a82,null))['catch'](handleError(_0x3c3a82,null));};exports['removeAgents']=function(_0x5916a7,_0x1716ba){return db[_0x7cd2('0x34')][_0x7cd2('0x54')]({'where':{'id':_0x5916a7['params']['id']}})['then'](handleEntityNotFound(_0x1716ba,null))[_0x7cd2('0x16')](function(_0x1f7853){if(_0x1f7853){return _0x1f7853['removeAgents'](_0x5916a7['query'][_0x7cd2('0x5e')])[_0x7cd2('0x16')](function(){if(_[_0x7cd2('0x127')](_0x5916a7[_0x7cd2('0x39')][_0x7cd2('0x5e')])){for(var _0x402a20=0x0;_0x402a20<_0x5916a7[_0x7cd2('0x39')][_0x7cd2('0x5e')][_0x7cd2('0x3f')];_0x402a20+=0x1){socket['emit'](_0x7cd2('0x128'),{'UserId':Number(_0x5916a7[_0x7cd2('0x39')][_0x7cd2('0x5e')][_0x402a20]),'ChatWebsiteId':Number(_0x5916a7[_0x7cd2('0x4b')]['id'])});}}else{socket['emit'](_0x7cd2('0x128'),{'UserId':Number(_0x5916a7[_0x7cd2('0x39')]['ids']),'ChatWebsiteId':Number(_0x5916a7[_0x7cd2('0x4b')]['id'])});}});}})[_0x7cd2('0x16')](respondWithStatusCode(_0x1716ba,null))[_0x7cd2('0x1f')](handleError(_0x1716ba,null));};exports[_0x7cd2('0x129')]=function(_0x19ed38,_0xcf900e){var _0x4e8925={};var _0x541b22={};var _0x273521;var _0x44f74a;return db[_0x7cd2('0x34')]['findOne']({'where':{'id':_0x19ed38[_0x7cd2('0x4b')]['id']}})[_0x7cd2('0x16')](handleEntityNotFound(_0xcf900e,null))[_0x7cd2('0x16')](function(_0x1e2d4c){if(_0x1e2d4c){_0x273521=_0x1e2d4c;_0x541b22[_0x7cd2('0x38')]=_['keys'](db['User']['rawAttributes']);_0x541b22[_0x7cd2('0x39')]=_['keys'](_0x19ed38[_0x7cd2('0x39')]);_0x541b22['filters']=_['intersection'](_0x541b22[_0x7cd2('0x38')],_0x541b22[_0x7cd2('0x39')]);_0x4e8925[_0x7cd2('0x3e')]=_[_0x7cd2('0x3c')](_0x541b22[_0x7cd2('0x38')],qs[_0x7cd2('0x3d')](_0x19ed38[_0x7cd2('0x39')][_0x7cd2('0x3d')]));_0x4e8925['attributes']=_0x4e8925[_0x7cd2('0x3e')][_0x7cd2('0x3f')]?_0x4e8925['attributes']:_0x541b22['model'];_0x4e8925[_0x7cd2('0x63')]=qs[_0x7cd2('0x42')](_0x19ed38[_0x7cd2('0x39')][_0x7cd2('0x42')]);_0x4e8925[_0x7cd2('0x43')]=qs[_0x7cd2('0x3b')](_[_0x7cd2('0x64')](_0x19ed38[_0x7cd2('0x39')],_0x541b22[_0x7cd2('0x3b')]));if(_0x19ed38['query'][_0x7cd2('0x44')]){_0x4e8925[_0x7cd2('0x43')]=_[_0x7cd2('0x4d')](_0x4e8925['where'],{'$or':_['map'](_0x4e8925['attributes'],function(_0x116c94){var _0x19896e={};_0x19896e[_0x116c94]={'$like':'%'+_0x19ed38[_0x7cd2('0x39')][_0x7cd2('0x44')]+'%'};return _0x19896e;})});}_0x4e8925=_['merge']({},_0x4e8925,_0x19ed38['options']);return _0x273521[_0x7cd2('0x129')](_0x4e8925);}})[_0x7cd2('0x16')](function(_0x9c1561){if(_0x9c1561){_0x44f74a=_0x9c1561[_0x7cd2('0x3f')];if(!_0x19ed38[_0x7cd2('0x39')][_0x7cd2('0x40')](_0x7cd2('0x5c'))){_0x4e8925['limit']=qs[_0x7cd2('0x41')](_0x19ed38['query'][_0x7cd2('0x41')]);_0x4e8925[_0x7cd2('0x24')]=qs[_0x7cd2('0x24')](_0x19ed38[_0x7cd2('0x39')][_0x7cd2('0x24')]);}return _0x273521['getAgents'](_0x4e8925);}})[_0x7cd2('0x16')](function(_0x1c82ed){if(_0x1c82ed){return _0x1c82ed?{'count':_0x44f74a,'rows':_0x1c82ed}:null;}})[_0x7cd2('0x16')](respondWithResult(_0xcf900e,null))[_0x7cd2('0x1f')](handleError(_0xcf900e,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index f68ed9d..795890d 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 _0x8743=['update','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','save'];(function(_0x51bcee,_0x3706c4){var _0x43a631=function(_0x4b1497){while(--_0x4b1497){_0x51bcee['push'](_0x51bcee['shift']());}};_0x43a631(++_0x3706c4);}(_0x8743,0x7a));var _0x3874=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8743[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x3874('0x0'));var ChatWebsite=require(_0x3874('0x1'))['db'][_0x3874('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3874('0x3'),'afterUpdate':_0x3874('0x4'),'afterDestroy':'remove'};function emitEvent(_0x511fe6){return function(_0x35cd1b,_0x230e06,_0x17e25f){ChatWebsiteEvents['emit'](_0x511fe6+':'+_0x35cd1b['id'],_0x35cd1b);ChatWebsiteEvents['emit'](_0x511fe6,_0x35cd1b);_0x17e25f(null);};}for(var e in events){if(events[_0x3874('0x5')](e)){var event=events[e];ChatWebsite[_0x3874('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xd82a=['events','../../mysqldb','ChatWebsite','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x3fcd68,_0x110de5){var _0x4521d7=function(_0x1c7380){while(--_0x1c7380){_0x3fcd68['push'](_0x3fcd68['shift']());}};_0x4521d7(++_0x110de5);}(_0xd82a,0xbd));var _0xad82=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xd82a[_0x51020b];return _0x371e47;};'use strict';var EventEmitter=require(_0xad82('0x0'));var ChatWebsite=require(_0xad82('0x1'))['db'][_0xad82('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xad82('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad82('0x4'),'afterDestroy':'remove'};function emitEvent(_0x17cf59){return function(_0x3a0a37,_0x40b3d6,_0x43a596){ChatWebsiteEvents[_0xad82('0x5')](_0x17cf59+':'+_0x3a0a37['id'],_0x3a0a37);ChatWebsiteEvents[_0xad82('0x5')](_0x17cf59,_0x3a0a37);_0x43a596(null);};}for(var e in events){if(events[_0xad82('0x6')](e)){var event=events[e];ChatWebsite[_0xad82('0x7')](e,emitEvent(event));}}module[_0xad82('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7d29039..4968085 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 _0xeab2=['rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x21d2af,_0x3285bd){var _0x39bcf9=function(_0x379d02){while(--_0x379d02){_0x21d2af['push'](_0x21d2af['shift']());}};_0x39bcf9(++_0x3285bd);}(_0xeab2,0x149));var _0x2eab=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xeab2[_0x2cc8bb];return _0x140e40;};'use strict';var _=require(_0x2eab('0x0'));var util=require(_0x2eab('0x1'));var logger=require(_0x2eab('0x2'))(_0x2eab('0x3'));var moment=require('moment');var BPromise=require(_0x2eab('0x4'));var rp=require(_0x2eab('0x5'));var fs=require('fs');var path=require(_0x2eab('0x6'));var rimraf=require(_0x2eab('0x7'));var config=require(_0x2eab('0x8'));var attributes=require(_0x2eab('0x9'));module[_0x2eab('0xa')]=function(_0x549823,_0xe257d1){return _0x549823['define'](_0x2eab('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x92a3=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','api','moment'];(function(_0x6143dc,_0x1ffb4e){var _0x1fb65b=function(_0x5f058e){while(--_0x5f058e){_0x6143dc['push'](_0x6143dc['shift']());}};_0x1fb65b(++_0x1ffb4e);}(_0x92a3,0x174));var _0x392a=function(_0x37f220,_0xf0f4ba){_0x37f220=_0x37f220-0x0;var _0x52b81d=_0x92a3[_0x37f220];return _0x52b81d;};'use strict';var _=require(_0x392a('0x0'));var util=require(_0x392a('0x1'));var logger=require(_0x392a('0x2'))(_0x392a('0x3'));var moment=require(_0x392a('0x4'));var BPromise=require('bluebird');var rp=require(_0x392a('0x5'));var fs=require('fs');var path=require(_0x392a('0x6'));var rimraf=require(_0x392a('0x7'));var config=require(_0x392a('0x8'));var attributes=require(_0x392a('0x9'));module[_0x392a('0xa')]=function(_0x132f6d,_0x15b31f){return _0x132f6d[_0x392a('0xb')](_0x392a('0xc'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 6606670..8023ec3 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 _0x5467=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch'];(function(_0xab6a2b,_0x403a6b){var _0x33edba=function(_0x533c32){while(--_0x533c32){_0xab6a2b['push'](_0xab6a2b['shift']());}};_0x33edba(++_0x403a6b);}(_0x5467,0x91));var _0x7546=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x5467[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x7546('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7546('0x1'));var rs=require(_0x7546('0x2'));var fs=require('fs');var Redis=require(_0x7546('0x3'));var db=require(_0x7546('0x4'))['db'];var utils=require(_0x7546('0x5'));var logger=require(_0x7546('0x6'))('rpc');var config=require(_0x7546('0x7'));var jayson=require(_0x7546('0x8'));var client=jayson[_0x7546('0x9')][_0x7546('0xa')]({'port':0x232a});config[_0x7546('0xb')]=_[_0x7546('0xc')](config[_0x7546('0xb')],{'host':_0x7546('0xd'),'port':0x18eb});var socket=require(_0x7546('0xe'))(new Redis(config[_0x7546('0xb')]));require(_0x7546('0xf'))[_0x7546('0x10')](socket);function respondWithRpcPromise(_0x25cea8,_0x225173,_0x378e35){return new BPromise(function(_0x2958e5,_0x5f3467){return client['request'](_0x25cea8,_0x378e35)[_0x7546('0x11')](function(_0x2f7aea){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x225173,'request\x20sent');logger[_0x7546('0x12')](_0x7546('0x13'),_0x225173,_0x7546('0x14'),JSON[_0x7546('0x15')](_0x2f7aea));if(_0x2f7aea[_0x7546('0x16')]){if(_0x2f7aea[_0x7546('0x16')][_0x7546('0x17')]===0x1f4){logger[_0x7546('0x16')](_0x7546('0x18'),_0x225173,_0x2f7aea[_0x7546('0x16')][_0x7546('0x19')]);return _0x5f3467(_0x2f7aea[_0x7546('0x16')][_0x7546('0x19')]);}logger['error'](_0x7546('0x18'),_0x225173,_0x2f7aea[_0x7546('0x16')][_0x7546('0x19')]);return _0x2958e5(_0x2f7aea[_0x7546('0x16')][_0x7546('0x19')]);}else{logger[_0x7546('0x1a')](_0x7546('0x18'),_0x225173,'request\x20sent');_0x2958e5(_0x2f7aea[_0x7546('0x1b')]['message']);}})[_0x7546('0x1c')](function(_0x2a12e7){logger[_0x7546('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x225173,_0x2a12e7);_0x5f3467(_0x2a12e7);});});}
\ No newline at end of file
+var _0xd32b=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0xa8929b,_0x4b6426){var _0x2f5ccf=function(_0x2ce9f3){while(--_0x2ce9f3){_0xa8929b['push'](_0xa8929b['shift']());}};_0x2f5ccf(++_0x4b6426);}(_0xd32b,0x1c0));var _0xbd32=function(_0x4b318e,_0x15fe4f){_0x4b318e=_0x4b318e-0x0;var _0x3b6a2f=_0xd32b[_0x4b318e];return _0x3b6a2f;};'use strict';var _=require(_0xbd32('0x0'));var util=require(_0xbd32('0x1'));var moment=require(_0xbd32('0x2'));var BPromise=require(_0xbd32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd32('0x4'));var logger=require(_0xbd32('0x5'))(_0xbd32('0x6'));var config=require(_0xbd32('0x7'));var jayson=require(_0xbd32('0x8'));var client=jayson[_0xbd32('0x9')]['http']({'port':0x232a});config[_0xbd32('0xa')]=_[_0xbd32('0xb')](config[_0xbd32('0xa')],{'host':_0xbd32('0xc'),'port':0x18eb});var socket=require(_0xbd32('0xd'))(new Redis(config[_0xbd32('0xa')]));require(_0xbd32('0xe'))[_0xbd32('0xf')](socket);function respondWithRpcPromise(_0x26329d,_0x24c033,_0x1b7b55){return new BPromise(function(_0x40510c,_0x31f910){return client['request'](_0x26329d,_0x1b7b55)[_0xbd32('0x10')](function(_0x27d9da){logger[_0xbd32('0x11')](_0xbd32('0x12'),_0x24c033,_0xbd32('0x13'));logger['debug'](_0xbd32('0x14'),_0x24c033,'request\x20sent',JSON[_0xbd32('0x15')](_0x27d9da));if(_0x27d9da['error']){if(_0x27d9da['error'][_0xbd32('0x16')]===0x1f4){logger[_0xbd32('0x17')](_0xbd32('0x12'),_0x24c033,_0x27d9da[_0xbd32('0x17')][_0xbd32('0x18')]);return _0x31f910(_0x27d9da['error'][_0xbd32('0x18')]);}logger[_0xbd32('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x24c033,_0x27d9da[_0xbd32('0x17')][_0xbd32('0x18')]);return _0x40510c(_0x27d9da[_0xbd32('0x17')]['message']);}else{logger[_0xbd32('0x11')](_0xbd32('0x12'),_0x24c033,_0xbd32('0x13'));_0x40510c(_0x27d9da[_0xbd32('0x19')][_0xbd32('0x18')]);}})[_0xbd32('0x1a')](function(_0x36894c){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x24c033,_0x36894c);_0x31f910(_0x36894c);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8957413..9574eb5 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 _0x3294=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','register'];(function(_0x163386,_0x3af94f){var _0x2df3e2=function(_0x1ef691){while(--_0x1ef691){_0x163386['push'](_0x163386['shift']());}};_0x2df3e2(++_0x3af94f);}(_0x3294,0x1da));var _0x4329=function(_0x709fff,_0x365daf){_0x709fff=_0x709fff-0x0;var _0x591717=_0x3294[_0x709fff];return _0x591717;};'use strict';var ChatWebsiteEvents=require(_0x4329('0x0'));var events=[_0x4329('0x1'),_0x4329('0x2'),_0x4329('0x3')];function createListener(_0x5a9d67,_0x49fe30){return function(_0x4ed992){_0x49fe30[_0x4329('0x4')](_0x5a9d67,_0x4ed992);};}function removeListener(_0xa2512d,_0x3c99be){return function(){ChatWebsiteEvents['removeListener'](_0xa2512d,_0x3c99be);};}exports[_0x4329('0x5')]=function(_0x1265f5){for(var _0x3cf176=0x0,_0x5c7cb3=events[_0x4329('0x6')];_0x3cf176<_0x5c7cb3;_0x3cf176++){var _0x3d9f0a=events[_0x3cf176];var _0x2aacec=createListener(_0x4329('0x7')+_0x3d9f0a,_0x1265f5);ChatWebsiteEvents['on'](_0x3d9f0a,_0x2aacec);}};
\ No newline at end of file
+var _0xd7e7=['chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7e7,0x111));var _0x7d7e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd7e7[_0x42cae2];return _0x5f256f;};'use strict';var ChatWebsiteEvents=require(_0x7d7e('0x0'));var events=['save',_0x7d7e('0x1'),_0x7d7e('0x2')];function createListener(_0x20f383,_0x2e69a8){return function(_0x222b70){_0x2e69a8[_0x7d7e('0x3')](_0x20f383,_0x222b70);};}function removeListener(_0xba6244,_0x367a3b){return function(){ChatWebsiteEvents[_0x7d7e('0x4')](_0xba6244,_0x367a3b);};}exports[_0x7d7e('0x5')]=function(_0x136250){for(var _0x33e251=0x0,_0x3299b9=events[_0x7d7e('0x6')];_0x33e251<_0x3299b9;_0x33e251++){var _0x2113f2=events[_0x33e251];var _0x423bd6=createListener(_0x7d7e('0x7')+_0x2113f2,_0x136250);ChatWebsiteEvents['on'](_0x2113f2,_0x423bd6);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 1cb96d5..434883e 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 _0xf00c=['destroy','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','single','join','server/files/images/avatars/','now','file','addAvatar','addSystemAvatar','attachments','offline-chat','replace','extname','/:id/offline','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','/:id','update'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xf00c,0x1e9));var _0xcf00=function(_0x5375ae,_0x4ef5c7){_0x5375ae=_0x5375ae-0x0;var _0x357f37=_0xf00c[_0x5375ae];return _0x357f37;};'use strict';var multer=require(_0xcf00('0x0'));var util=require(_0xcf00('0x1'));var path=require(_0xcf00('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf00('0x3'));var router=express[_0xcf00('0x4')]();var fs_extra=require(_0xcf00('0x5'));var auth=require(_0xcf00('0x6'));var interaction=require(_0xcf00('0x7'));var config=require('../../config/environment');var controller=require(_0xcf00('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcf00('0x9')]('/describe',auth[_0xcf00('0xa')](),controller[_0xcf00('0xb')]);router[_0xcf00('0x9')]('/:id',auth[_0xcf00('0xa')](),controller[_0xcf00('0xc')]);router[_0xcf00('0x9')](_0xcf00('0xd'),auth[_0xcf00('0xa')](),controller[_0xcf00('0xe')]);router['get']('/:id/canned_answers',auth[_0xcf00('0xa')](),controller[_0xcf00('0xf')]);router['get'](_0xcf00('0x10'),controller[_0xcf00('0x11')]);router[_0xcf00('0x9')](_0xcf00('0x12'),controller['getAvatar']);router['get'](_0xcf00('0x13'),controller[_0xcf00('0x14')]);router[_0xcf00('0x9')](_0xcf00('0x15'),controller[_0xcf00('0x16')]);router[_0xcf00('0x9')](_0xcf00('0x17'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x18')]);router[_0xcf00('0x9')](_0xcf00('0x19'),controller[_0xcf00('0x1a')]);router[_0xcf00('0x9')](_0xcf00('0x1b'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x1c')]);router[_0xcf00('0x9')]('/:id/proactive_actions',auth[_0xcf00('0xa')](),controller[_0xcf00('0x1d')]);router[_0xcf00('0x9')]('/:id/fields',controller['getFields']);router[_0xcf00('0x9')](_0xcf00('0x1e'),auth[_0xcf00('0xa')](),controller['getOfflineMessages']);router[_0xcf00('0x9')](_0xcf00('0x1f'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x20')]);router[_0xcf00('0x21')]('/',auth['isAuthenticated'](),controller[_0xcf00('0x22')]);router[_0xcf00('0x21')](_0xcf00('0xd'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x23')]);router[_0xcf00('0x21')]('/:id/canned_answers',auth[_0xcf00('0xa')](),controller[_0xcf00('0x24')]);var upload=multer({'storage':multer[_0xcf00('0x25')]({'destination':function(_0x18fc4c,_0x333103,_0x2ade38){_0x2ade38(null,path['join'](config[_0xcf00('0x26')],_0xcf00('0x27')));},'filename':function(_0x34259f,_0x17d5d8,_0x308ca5){_0x308ca5(null,util[_0xcf00('0x28')](_0xcf00('0x29'),Date['now'](),_0x17d5d8[_0xcf00('0x2a')]));}})});router[_0xcf00('0x21')](_0xcf00('0x10'),upload[_0xcf00('0x2b')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xcf00('0x25')]({'destination':function(_0x1d1629,_0x199484,_0x5eb0b2){_0x5eb0b2(null,path[_0xcf00('0x2c')](config['root'],_0xcf00('0x2d')));},'filename':function(_0x1ca305,_0x546fae,_0x2764c3){_0x2764c3(null,util[_0xcf00('0x28')](_0xcf00('0x29'),Date[_0xcf00('0x2e')](),_0x546fae[_0xcf00('0x2a')]));}})});router[_0xcf00('0x21')](_0xcf00('0x12'),upload[_0xcf00('0x2b')](_0xcf00('0x2f')),controller[_0xcf00('0x30')]);var upload=multer({'storage':multer[_0xcf00('0x25')]({'destination':function(_0x36bc8e,_0x57ed8f,_0x33203f){_0x33203f(null,path[_0xcf00('0x2c')](config[_0xcf00('0x26')],_0xcf00('0x2d')));},'filename':function(_0x47953e,_0x1d604c,_0x291246){_0x291246(null,util[_0xcf00('0x28')](_0xcf00('0x29'),Date[_0xcf00('0x2e')](),_0x1d604c['originalname']));}})});router[_0xcf00('0x21')](_0xcf00('0x13'),upload[_0xcf00('0x2b')](_0xcf00('0x2f')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xcf00('0x25')]({'destination':function(_0x3f983d,_0x10c840,_0x14ec37){_0x14ec37(null,path['join'](config[_0xcf00('0x26')],_0xcf00('0x2d')));},'filename':function(_0x153732,_0x755e6b,_0x475652){_0x475652(null,util[_0xcf00('0x28')](_0xcf00('0x29'),Date['now'](),_0x755e6b['originalname']));}})});router[_0xcf00('0x21')](_0xcf00('0x15'),upload[_0xcf00('0x2b')](_0xcf00('0x2f')),controller[_0xcf00('0x31')]);router['post']('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xcf00('0x25')]({'destination':function(_0x2ad0b9,_0x52ebca,_0x16d1ff){const _0x102656=path[_0xcf00('0x2c')](config['root'],'server/files',_0xcf00('0x32'),_0xcf00('0x33'));fs_extra['ensureDir'](_0x102656,function(){_0x16d1ff(null,_0x102656);});},'filename':function(_0x50992d,_0x2e048b,_0x114bdc){const _0x54fa87=_0x2e048b['originalname'][_0xcf00('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1d1350=path[_0xcf00('0x35')](_0x54fa87);const _0x1a940d=Date[_0xcf00('0x2e')]()+'-'+_0x54fa87['replace'](_0x1d1350,'')+_0x1d1350;_0x114bdc(null,_0x1a940d);}})});router['post'](_0xcf00('0x36'),offlineUploadMulter['any'](),controller[_0xcf00('0x37')]);router[_0xcf00('0x21')](_0xcf00('0x17'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x38')]);router[_0xcf00('0x21')](_0xcf00('0x1b'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x39')]);router[_0xcf00('0x21')](_0xcf00('0x3a'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x3b')]);router['post'](_0xcf00('0x1f'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x3c')]);router['put'](_0xcf00('0x3d'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x3e')]);router['delete'](_0xcf00('0x3d'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x3f')]);router[_0xcf00('0x40')](_0xcf00('0xd'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x41')]);router[_0xcf00('0x40')](_0xcf00('0x42'),auth[_0xcf00('0xa')](),controller[_0xcf00('0x43')]);router[_0xcf00('0x40')](_0xcf00('0x1f'),auth['isAuthenticated'](),controller[_0xcf00('0x44')]);module['exports']=router;
\ No newline at end of file
+var _0xcc35=['getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','offline','addInteraction','/:id/applications','addApplications','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar'];(function(_0x4f8a16,_0x35acb3){var _0x4c1c46=function(_0x483ae3){while(--_0x483ae3){_0x4f8a16['push'](_0x4f8a16['shift']());}};_0x4c1c46(++_0x35acb3);}(_0xcc35,0xc1));var _0x5cc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc35[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5cc3('0x0'));var util=require(_0x5cc3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5cc3('0x2')]();var fs_extra=require(_0x5cc3('0x3'));var auth=require(_0x5cc3('0x4'));var interaction=require(_0x5cc3('0x5'));var config=require(_0x5cc3('0x6'));var controller=require('./chatWebsite.controller');router[_0x5cc3('0x7')]('/',auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x9')]);router[_0x5cc3('0x7')](_0x5cc3('0xa'),auth[_0x5cc3('0x8')](),controller['describe']);router[_0x5cc3('0x7')](_0x5cc3('0xb'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0xc')]);router[_0x5cc3('0x7')](_0x5cc3('0xd'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0xe')]);router[_0x5cc3('0x7')](_0x5cc3('0xf'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x10')]);router['get'](_0x5cc3('0x11'),controller[_0x5cc3('0x12')]);router[_0x5cc3('0x7')](_0x5cc3('0x13'),controller[_0x5cc3('0x14')]);router[_0x5cc3('0x7')](_0x5cc3('0x15'),controller[_0x5cc3('0x16')]);router[_0x5cc3('0x7')](_0x5cc3('0x17'),controller[_0x5cc3('0x18')]);router['get'](_0x5cc3('0x19'),auth['isAuthenticated'](),controller[_0x5cc3('0x1a')]);router[_0x5cc3('0x7')]('/:id/snippet',controller['getSnippet']);router[_0x5cc3('0x7')]('/:id/applications',auth[_0x5cc3('0x8')](),controller['getApplications']);router[_0x5cc3('0x7')](_0x5cc3('0x1b'),auth['isAuthenticated'](),controller[_0x5cc3('0x1c')]);router[_0x5cc3('0x7')](_0x5cc3('0x1d'),controller['getFields']);router['get'](_0x5cc3('0x1e'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x1f')]);router[_0x5cc3('0x7')](_0x5cc3('0x20'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x21')]);router[_0x5cc3('0x22')]('/',auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x23')]);router[_0x5cc3('0x22')](_0x5cc3('0xd'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x24')]);router[_0x5cc3('0x22')](_0x5cc3('0xf'),auth[_0x5cc3('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x5cc3('0x25')]({'destination':function(_0x51fd45,_0x3fe1a0,_0x1f1ea0){_0x1f1ea0(null,path[_0x5cc3('0x26')](config[_0x5cc3('0x27')],_0x5cc3('0x28')));},'filename':function(_0x428015,_0xb90809,_0x177c47){_0x177c47(null,util[_0x5cc3('0x29')](_0x5cc3('0x2a'),Date[_0x5cc3('0x2b')](),_0xb90809[_0x5cc3('0x2c')]));}})});router['post'](_0x5cc3('0x11'),upload[_0x5cc3('0x2d')]('file'),controller[_0x5cc3('0x2e')]);var upload=multer({'storage':multer[_0x5cc3('0x25')]({'destination':function(_0x13fe3d,_0x252ab9,_0x2501b0){_0x2501b0(null,path[_0x5cc3('0x26')](config[_0x5cc3('0x27')],_0x5cc3('0x2f')));},'filename':function(_0x63c5b3,_0x490acc,_0x4a0c36){_0x4a0c36(null,util[_0x5cc3('0x29')]('%s-%s',Date[_0x5cc3('0x2b')](),_0x490acc[_0x5cc3('0x2c')]));}})});router[_0x5cc3('0x22')](_0x5cc3('0x13'),upload['single']('file'),controller[_0x5cc3('0x30')]);var upload=multer({'storage':multer[_0x5cc3('0x25')]({'destination':function(_0x14a6e6,_0x37820d,_0x2781d4){_0x2781d4(null,path[_0x5cc3('0x26')](config[_0x5cc3('0x27')],_0x5cc3('0x2f')));},'filename':function(_0x3e2ba5,_0x404306,_0x3abeb7){_0x3abeb7(null,util[_0x5cc3('0x29')](_0x5cc3('0x2a'),Date[_0x5cc3('0x2b')](),_0x404306[_0x5cc3('0x2c')]));}})});router[_0x5cc3('0x22')](_0x5cc3('0x15'),upload[_0x5cc3('0x2d')]('file'),controller[_0x5cc3('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53452b,_0x3fbd0f,_0x53ae56){_0x53ae56(null,path['join'](config['root'],_0x5cc3('0x2f')));},'filename':function(_0x6fc2ae,_0x5775f5,_0x565fcb){_0x565fcb(null,util[_0x5cc3('0x29')](_0x5cc3('0x2a'),Date[_0x5cc3('0x2b')](),_0x5775f5[_0x5cc3('0x2c')]));}})});router['post'](_0x5cc3('0x17'),upload[_0x5cc3('0x2d')]('file'),controller[_0x5cc3('0x32')]);router[_0x5cc3('0x22')](_0x5cc3('0x33'),controller[_0x5cc3('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x5cc3('0x25')]({'destination':function(_0x105be0,_0x306292,_0x4a10b1){const _0x2f8bfe=path['join'](config[_0x5cc3('0x27')],_0x5cc3('0x35'),_0x5cc3('0x36'),_0x5cc3('0x37'));fs_extra[_0x5cc3('0x38')](_0x2f8bfe,function(){_0x4a10b1(null,_0x2f8bfe);});},'filename':function(_0xa6fa15,_0x449296,_0x29a456){const _0x13787f=_0x449296[_0x5cc3('0x2c')][_0x5cc3('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x33a683=path['extname'](_0x13787f);const _0x382866=Date[_0x5cc3('0x2b')]()+'-'+_0x13787f[_0x5cc3('0x39')](_0x33a683,'')+_0x33a683;_0x29a456(null,_0x382866);}})});router[_0x5cc3('0x22')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x5cc3('0x3a')]);router[_0x5cc3('0x22')]('/:id/interactions',auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x3b')]);router[_0x5cc3('0x22')](_0x5cc3('0x3c'),auth['isAuthenticated'](),controller[_0x5cc3('0x3d')]);router[_0x5cc3('0x22')](_0x5cc3('0x1b'),auth[_0x5cc3('0x8')](),controller['addProactiveActions']);router[_0x5cc3('0x22')](_0x5cc3('0x20'),auth['isAuthenticated'](),controller[_0x5cc3('0x3e')]);router[_0x5cc3('0x3f')](_0x5cc3('0xb'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x40')]);router['delete'](_0x5cc3('0xb'),auth['isAuthenticated'](),controller[_0x5cc3('0x41')]);router[_0x5cc3('0x42')](_0x5cc3('0xd'),auth['isAuthenticated'](),controller[_0x5cc3('0x43')]);router['delete'](_0x5cc3('0xf'),auth[_0x5cc3('0x8')](),controller[_0x5cc3('0x44')]);router['delete'](_0x5cc3('0x20'),auth['isAuthenticated'](),controller[_0x5cc3('0x45')]);module[_0x5cc3('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 82e9972..6107a3f 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85dd=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','express','../components/auth/service','../config/environment','Router','env','production'];(function(_0x7a1a95,_0x3f1f79){var _0x401748=function(_0x108c28){while(--_0x108c28){_0x7a1a95['push'](_0x7a1a95['shift']());}};_0x401748(++_0x3f1f79);}(_0x85dd,0x14a));var _0xd85d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x85dd[_0x432682];return _0x463d05;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd85d('0x0'));var auth=require(_0xd85d('0x1'));var config=require(_0xd85d('0x2'));var router=express[_0xd85d('0x3')]();var isProduction=config[_0xd85d('0x4')]===_0xd85d('0x5')||![];function clientSideLogs(_0x91f8a2,_0x57610e,_0xc16663){var _0x11a8b7=_0x91f8a2[_0xd85d('0x6')][_0xd85d('0x7')](_0xd85d('0x8'));if(!_0x11a8b7){throw new Error(_0xd85d('0x9'));}return beaverLogger[_0xd85d('0xa')]({'uri':_0xd85d('0xb'),'logger':_0x11a8b7,'enableCors':!isProduction})(_0x91f8a2,_0x57610e,_0xc16663);}router[_0xd85d('0xc')](auth['isAuthenticated'](),clientSideLogs);module[_0xd85d('0xd')]=router;
\ No newline at end of file
+var _0x1329=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env'];(function(_0x499e72,_0x2618c8){var _0x456522=function(_0x372456){while(--_0x372456){_0x499e72['push'](_0x499e72['shift']());}};_0x456522(++_0x2618c8);}(_0x1329,0x140));var _0x9132=function(_0x139f28,_0x5956b9){_0x139f28=_0x139f28-0x0;var _0x5420c9=_0x1329[_0x139f28];return _0x5420c9;};var beaverLogger=require(_0x9132('0x0'));var express=require('express');var auth=require(_0x9132('0x1'));var config=require(_0x9132('0x2'));var router=express[_0x9132('0x3')]();var isProduction=config[_0x9132('0x4')]==='production'||![];function clientSideLogs(_0x57fba0,_0x22a68b,_0x194aec){var _0x355ee4=_0x57fba0[_0x9132('0x5')][_0x9132('0x6')](_0x9132('0x7'));if(!_0x355ee4){throw new Error(_0x9132('0x8'));}return beaverLogger[_0x9132('0x9')]({'uri':'/client-logs','logger':_0x355ee4,'enableCors':!isProduction})(_0x57fba0,_0x22a68b,_0x194aec);}router[_0x9132('0xa')](auth[_0x9132('0xb')](),clientSideLogs);module[_0x9132('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 5cdbff1..d82f721 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 _0x1626=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','ENUM','Dynamics365','TEXT'];(function(_0x2a94c0,_0x6f7914){var _0x39296f=function(_0x559af1){while(--_0x559af1){_0x2a94c0['push'](_0x2a94c0['shift']());}};_0x39296f(++_0x6f7914);}(_0x1626,0x12b));var _0x6162=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x1626[_0x55d58f];return _0x1ad6e6;};'use strict';var Sequelize=require(_0x6162('0x0'));module[_0x6162('0x1')]={'name':{'type':Sequelize[_0x6162('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x6162('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6162('0x4')]('Outlook365',_0x6162('0x5'))},'data1':{'type':Sequelize[_0x6162('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x6162('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x6162('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x6162('0x6')],'comment':_0x6162('0x7')},'data7':{'type':Sequelize[_0x6162('0x6')],'comment':_0x6162('0x8')}};
\ No newline at end of file
+var _0xcf63=['AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM'];(function(_0x3df249,_0x1d0c54){var _0x15ad5b=function(_0x1432c3){while(--_0x1432c3){_0x3df249['push'](_0x3df249['shift']());}};_0x15ad5b(++_0x1d0c54);}(_0xcf63,0xc1));var _0x3cf6=function(_0x484473,_0x38314e){_0x484473=_0x484473-0x0;var _0x5f5914=_0xcf63[_0x484473];return _0x5f5914;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3cf6('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3cf6('0x1')](_0x3cf6('0x2'),'Google',_0x3cf6('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3cf6('0x4'),_0x3cf6('0x5'))},'data1':{'type':Sequelize[_0x3cf6('0x0')],'comment':_0x3cf6('0x6')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x3cf6('0x0')],'comment':_0x3cf6('0x7')},'data4':{'type':Sequelize[_0x3cf6('0x0')],'comment':_0x3cf6('0x8')},'data5':{'type':Sequelize[_0x3cf6('0x9')],'comment':_0x3cf6('0xa')},'data6':{'type':Sequelize[_0x3cf6('0x9')],'comment':_0x3cf6('0xb')},'data7':{'type':Sequelize[_0x3cf6('0x9')],'comment':_0x3cf6('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e785813..b1844f6 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 _0xcd0a=['state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','limit','undefined','then','destroy','sendStatus','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','rows','decryptString','catch','show','rawAttributes','length','includeAll','find','service','data3','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','params','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get'];(function(_0x45b2b8,_0x2ad5f0){var _0x125c87=function(_0x27ac50){while(--_0x27ac50){_0x45b2b8['push'](_0x45b2b8['shift']());}};_0x125c87(++_0x2ad5f0);}(_0xcd0a,0x1ed));var _0xacd0=function(_0x44d88c,_0x4e0cb4){_0x44d88c=_0x44d88c-0x0;var _0x508da7=_0xcd0a[_0x44d88c];return _0x508da7;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xacd0('0x0'));var config=require(_0xacd0('0x1'));var logger=require(_0xacd0('0x2'))('api');var db=require(_0xacd0('0x3'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xacd0('0x4')]=_[_0xacd0('0x5')](config[_0xacd0('0x4')],{'host':_0xacd0('0x6'),'port':0x18eb});var socket=require(_0xacd0('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0xacd0('0x4')]);function respondWithStatusCode(_0x5d0829,_0x3252c7){_0x3252c7=_0x3252c7||0xcc;return function(_0x17ebab){if(_0x17ebab){return _0x5d0829['sendStatus'](_0x3252c7);}return _0x5d0829[_0xacd0('0x8')](_0x3252c7)['end']();};}function respondWithResult(_0x418a0c,_0x1a4b59){_0x1a4b59=_0x1a4b59||0xc8;return function(_0x48d1c6){if(_0x48d1c6){return _0x418a0c['status'](_0x1a4b59)[_0xacd0('0x9')](_0x48d1c6);}};}function respondWithFilteredResult(_0x358eda,_0x53c763){return function(_0x38281f){if(_0x38281f){var _0x52ec11=typeof _0x53c763[_0xacd0('0xa')]==='undefined'&&typeof _0x53c763[_0xacd0('0xb')]===_0xacd0('0xc');var _0xf0bead=_0x38281f['count'];var _0x26e6cc=_0x52ec11?0x0:_0x53c763[_0xacd0('0xa')];var _0x34003a=_0x52ec11?_0x38281f['count']:_0x53c763[_0xacd0('0xa')]+_0x53c763['limit'];var _0x25336c;if(_0x34003a>=_0xf0bead){_0x34003a=_0xf0bead;_0x25336c=0xc8;}else{_0x25336c=0xce;}_0x358eda[_0xacd0('0x8')](_0x25336c);return _0x358eda['set']('Content-Range',_0x26e6cc+'-'+_0x34003a+'/'+_0xf0bead)[_0xacd0('0x9')](_0x38281f);}return null;};}function saveUpdates(_0x390628){return function(_0x554c3b){if(_0x554c3b){return _0x554c3b['update'](_0x390628)[_0xacd0('0xd')](function(_0x2eb885){return _0x2eb885;});}return null;};}function removeEntity(_0x476d24){return function(_0x2b627e){if(_0x2b627e){return _0x2b627e[_0xacd0('0xe')]()['then'](function(){_0x476d24[_0xacd0('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b33cd){return function(_0x43bd2b){if(!_0x43bd2b){_0x1b33cd[_0xacd0('0xf')](0x194);}return _0x43bd2b;};}function handleError(_0x32ae56,_0xaaa8a4){_0xaaa8a4=_0xaaa8a4||0x1f4;return function(_0x2639f3){logger['error'](_0x2639f3[_0xacd0('0x10')]);if(_0x2639f3[_0xacd0('0x11')]){delete _0x2639f3[_0xacd0('0x11')];}_0x32ae56[_0xacd0('0x8')](_0xaaa8a4)[_0xacd0('0x12')](_0x2639f3);};}function maskClientSecret(_0x2daeec){return _[_0xacd0('0x13')](_0x2daeec[_0xacd0('0x14')](0x0,0x3),0x14,'*');}exports[_0xacd0('0x15')]=function(_0x98a2e7,_0x85d4ae){var _0x4e2486={},_0x37212e={},_0x5d345f={'count':0x0,'rows':[]};var _0x4d8875=_[_0xacd0('0x16')](db[_0xacd0('0x17')]['rawAttributes'],function(_0x1b8d93){return{'name':_0x1b8d93[_0xacd0('0x18')],'type':_0x1b8d93[_0xacd0('0x19')][_0xacd0('0x1a')]};});_0x37212e[_0xacd0('0x1b')]=_[_0xacd0('0x16')](_0x4d8875,_0xacd0('0x11'));_0x37212e[_0xacd0('0x1c')]=_[_0xacd0('0x1d')](_0x98a2e7['query']);_0x37212e[_0xacd0('0x1e')]=_[_0xacd0('0x1f')](_0x37212e['model'],_0x37212e[_0xacd0('0x1c')]);_0x4e2486[_0xacd0('0x20')]=_[_0xacd0('0x1f')](_0x37212e['model'],qs[_0xacd0('0x21')](_0x98a2e7[_0xacd0('0x1c')][_0xacd0('0x21')]));_0x4e2486['attributes']=_0x4e2486[_0xacd0('0x20')]['length']?_0x4e2486[_0xacd0('0x20')]:_0x37212e[_0xacd0('0x1b')];if(!_0x98a2e7[_0xacd0('0x1c')][_0xacd0('0x22')]('nolimit')){_0x4e2486['limit']=qs[_0xacd0('0xb')](_0x98a2e7[_0xacd0('0x1c')]['limit']);_0x4e2486[_0xacd0('0xa')]=qs[_0xacd0('0xa')](_0x98a2e7['query']['offset']);}_0x4e2486[_0xacd0('0x23')]=qs[_0xacd0('0x24')](_0x98a2e7['query'][_0xacd0('0x24')]);_0x4e2486[_0xacd0('0x25')]=qs[_0xacd0('0x1e')](_[_0xacd0('0x26')](_0x98a2e7[_0xacd0('0x1c')],_0x37212e[_0xacd0('0x1e')]),_0x4d8875);if(_0x98a2e7[_0xacd0('0x1c')][_0xacd0('0x27')]){_0x4e2486[_0xacd0('0x25')]=_[_0xacd0('0x28')](_0x4e2486[_0xacd0('0x25')],{'$or':_[_0xacd0('0x16')](_0x4d8875,function(_0x3bae34){if(_0x3bae34[_0xacd0('0x19')]!==_0xacd0('0x29')){var _0x516a52={};_0x516a52[_0x3bae34[_0xacd0('0x11')]]={'$like':'%'+_0x98a2e7[_0xacd0('0x1c')][_0xacd0('0x27')]+'%'};return _0x516a52;}})});}_0x4e2486=_[_0xacd0('0x28')]({},_0x4e2486,_0x98a2e7[_0xacd0('0x2a')]);var _0x51d541={'where':_0x4e2486[_0xacd0('0x25')]};return db['CloudProvider'][_0xacd0('0x2b')](_0x51d541)['then'](function(_0x316e3d){_0x5d345f[_0xacd0('0x2b')]=_0x316e3d;if(_0x98a2e7[_0xacd0('0x1c')]['includeAll']){_0x4e2486['include']=[{'all':!![]}];}return db[_0xacd0('0x17')][_0xacd0('0x2c')](_0x4e2486);})[_0xacd0('0xd')](function(_0x549bc1){_0x5d345f[_0xacd0('0x2d')]=_[_0xacd0('0x16')](_0x549bc1,function(_0x398ccd){if(_0x398ccd['service']==='MicrosoftAzure'){var _0x4b662c=encryptor[_0xacd0('0x2e')](_0x398ccd['data3']);_0x398ccd['data3']=maskClientSecret(_0x4b662c);}return _0x398ccd;});return _0x5d345f;})[_0xacd0('0xd')](respondWithFilteredResult(_0x85d4ae,_0x4e2486))[_0xacd0('0x2f')](handleError(_0x85d4ae,null));};exports[_0xacd0('0x30')]=function(_0x24aa07,_0x24d1f3){var _0x5702bd={'raw':!![],'where':{'id':_0x24aa07['params']['id']}},_0x1c0b90={};_0x1c0b90[_0xacd0('0x1b')]=_[_0xacd0('0x1d')](db['CloudProvider'][_0xacd0('0x31')]);_0x1c0b90[_0xacd0('0x1c')]=_[_0xacd0('0x1d')](_0x24aa07['query']);_0x1c0b90[_0xacd0('0x1e')]=_[_0xacd0('0x1f')](_0x1c0b90[_0xacd0('0x1b')],_0x1c0b90['query']);_0x5702bd[_0xacd0('0x20')]=_[_0xacd0('0x1f')](_0x1c0b90[_0xacd0('0x1b')],qs['fields'](_0x24aa07[_0xacd0('0x1c')][_0xacd0('0x21')]));_0x5702bd[_0xacd0('0x20')]=_0x5702bd[_0xacd0('0x20')][_0xacd0('0x32')]?_0x5702bd[_0xacd0('0x20')]:_0x1c0b90[_0xacd0('0x1b')];if(_0x24aa07[_0xacd0('0x1c')][_0xacd0('0x33')]){_0x5702bd['include']=[{'all':!![]}];}_0x5702bd=_[_0xacd0('0x28')]({},_0x5702bd,_0x24aa07[_0xacd0('0x2a')]);return db[_0xacd0('0x17')][_0xacd0('0x34')](_0x5702bd)[_0xacd0('0xd')](handleEntityNotFound(_0x24d1f3,null))['then'](function(_0x1c8784){if(_0x1c8784[_0xacd0('0x35')]==='MicrosoftAzure'){var _0x2800e5=encryptor[_0xacd0('0x2e')](_0x1c8784[_0xacd0('0x36')]);_0x1c8784[_0xacd0('0x36')]=maskClientSecret(_0x2800e5);}return _0x1c8784;})['then'](respondWithResult(_0x24d1f3,null))['catch'](handleError(_0x24d1f3,null));};exports[_0xacd0('0x37')]=function(_0x4ae249,_0x1888ac){if(!_0x4ae249['body'][_0xacd0('0x11')])throw new Error(_0xacd0('0x38'));if(!_0x4ae249[_0xacd0('0x39')][_0xacd0('0x35')])throw new Error(_0xacd0('0x3a'));var _0x17cf01=db[_0xacd0('0x17')]['rawAttributes'][_0xacd0('0x35')][_0xacd0('0x3b')];if(!_0x17cf01[_0xacd0('0x3c')](_0x4ae249['body'][_0xacd0('0x35')]))throw new Error(_0xacd0('0x3d')+_0x17cf01[_0xacd0('0x3e')](',\x20'));if(_0x4ae249['body'][_0xacd0('0x35')]===_0xacd0('0x3f')&&_0x4ae249[_0xacd0('0x39')][_0xacd0('0x36')]){_0x4ae249[_0xacd0('0x39')][_0xacd0('0x36')]=encryptor[_0xacd0('0x40')](_0x4ae249[_0xacd0('0x39')][_0xacd0('0x36')]);}return db[_0xacd0('0x17')]['create'](_0x4ae249['body'],{})[_0xacd0('0xd')](respondWithResult(_0x1888ac,0xc9))['catch'](handleError(_0x1888ac,null));};exports['update']=function(_0x2a140b,_0x45b294){if(_0x2a140b['body']['id']){delete _0x2a140b[_0xacd0('0x39')]['id'];}return db[_0xacd0('0x17')][_0xacd0('0x34')]({'where':{'id':_0x2a140b[_0xacd0('0x41')]['id']}})[_0xacd0('0xd')](handleEntityNotFound(_0x45b294,null))[_0xacd0('0xd')](function(_0x24a2fc){if(_0x24a2fc[_0xacd0('0x35')]===_0xacd0('0x3f')&&_0x2a140b[_0xacd0('0x39')][_0xacd0('0x36')]){_0x2a140b[_0xacd0('0x39')][_0xacd0('0x36')]=encryptor[_0xacd0('0x40')](_0x2a140b[_0xacd0('0x39')]['data3']);}return _0x24a2fc;})[_0xacd0('0xd')](saveUpdates(_0x2a140b[_0xacd0('0x39')],null))[_0xacd0('0xd')](respondWithResult(_0x45b294,null))['catch'](handleError(_0x45b294,null));};exports['destroy']=function(_0x33e687,_0x114e57){return db[_0xacd0('0x17')][_0xacd0('0x34')]({'where':{'id':_0x33e687[_0xacd0('0x41')]['id']}})['then'](handleEntityNotFound(_0x114e57,null))[_0xacd0('0xd')](removeEntity(_0x114e57,null))['catch'](handleError(_0x114e57,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5810a1,_0x50f0d5){return db['CloudProvider']['findOne']({'where':{'id':_0x5810a1[_0xacd0('0x41')]['id']},'raw':!![]})[_0xacd0('0xd')](function(_0x73db11){if(!_0x73db11)return _0x50f0d5[_0xacd0('0xf')](0x194);return{'url':oauth[_0xacd0('0x42')](_0x73db11,_0x5810a1[_0xacd0('0x43')]['id'])};})[_0xacd0('0xd')](respondWithResult(_0x50f0d5,null))[_0xacd0('0x2f')](handleError(_0x50f0d5,null));};exports[_0xacd0('0x44')]=function(_0x6e6d92,_0x4c7c36){var _0x50ed62=_0x6e6d92[_0xacd0('0x39')];var _0x27519c;var _0x138146;if(_0x50ed62[_0xacd0('0x45')])throw _0x50ed62;redis[_0xacd0('0x46')](_0x50ed62[_0xacd0('0x47')])['then'](function(_0x26f1ce){if(!_0x26f1ce)throw new Error('Invalid\x20state\x20parameter');_0x27519c=JSON[_0xacd0('0x48')](_0x26f1ce);var _0x4c7b93=Buffer[_0xacd0('0x49')](_0x50ed62[_0xacd0('0x47')],_0xacd0('0x4a'))[_0xacd0('0x4b')](_0xacd0('0x4c'));_0x138146=JSON['parse'](_0x4c7b93);if(!oauth[_0xacd0('0x4d')](_0x50ed62[_0xacd0('0x4e')],_0x27519c[_0xacd0('0x4f')]))throw new Error(_0xacd0('0x50'));redis[_0xacd0('0x51')](_0x50ed62[_0xacd0('0x47')]);return oauth[_0xacd0('0x52')](_0x50ed62[_0xacd0('0x53')],_0x27519c);})[_0xacd0('0xd')](function(_0x409014){_0x27519c[_0xacd0('0x54')]=_0x409014[_0xacd0('0x55')];_0x27519c[_0xacd0('0x56')]=_0x409014[_0xacd0('0x57')];return db[_0xacd0('0x17')]['update']({'data5':_0x27519c[_0xacd0('0x54')],'data6':_0x27519c['data6']},{'where':{'id':_0x27519c['id']}});})['then'](function(){oauth[_0xacd0('0x58')](_0x27519c);socket[_0xacd0('0x59')]('microsoftAuthorization:success',{'id':_0x138146['id']});return;})['then'](respondWithStatusCode(_0x4c7c36,null))[_0xacd0('0x2f')](function(_0x189a25){if(_0x138146){socket[_0xacd0('0x59')](_0xacd0('0x5a'),{'id':_0x138146['id']});}if(!_0x27519c){logger[_0xacd0('0x45')](_0xacd0('0x5b'),_0x189a25);return _0x4c7c36[_0xacd0('0x8')](0x1f4)[_0xacd0('0x12')](_0x189a25[_0xacd0('0x5c')]);}logger[_0xacd0('0x45')](_0xacd0('0x5d'),_0x27519c['id'],JSON['stringify'](_0x189a25));});};
\ No newline at end of file
+var _0xfec1=['map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','then','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','includeAll','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','undefined','count','offset','limit','set','json','update','destroy','error','stack','name','send','slice','index'];(function(_0x1aec28,_0x556b6f){var _0x2398c7=function(_0x27ee37){while(--_0x27ee37){_0x1aec28['push'](_0x1aec28['shift']());}};_0x2398c7(++_0x556b6f);}(_0xfec1,0xa6));var _0x1fec=function(_0xf8973d,_0x56a803){_0xf8973d=_0xf8973d-0x0;var _0x1c46bc=_0xfec1[_0xf8973d];return _0x1c46bc;};'use strict';var _=require('lodash');var Redis=require(_0x1fec('0x0'));var qs=require(_0x1fec('0x1'));var encryptor=require(_0x1fec('0x2'));var config=require(_0x1fec('0x3'));var logger=require(_0x1fec('0x4'))('api');var db=require(_0x1fec('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x1fec('0x6')]=_[_0x1fec('0x7')](config[_0x1fec('0x6')],{'host':_0x1fec('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x1fec('0x6')]);function respondWithStatusCode(_0x4bb85d,_0x5a003c){_0x5a003c=_0x5a003c||0xcc;return function(_0x3246e2){if(_0x3246e2){return _0x4bb85d[_0x1fec('0x9')](_0x5a003c);}return _0x4bb85d['status'](_0x5a003c)[_0x1fec('0xa')]();};}function respondWithResult(_0x945ac0,_0x394acc){_0x394acc=_0x394acc||0xc8;return function(_0x2c5668){if(_0x2c5668){return _0x945ac0[_0x1fec('0xb')](_0x394acc)['json'](_0x2c5668);}};}function respondWithFilteredResult(_0x439a6c,_0xee3d1a){return function(_0x15dd8f){if(_0x15dd8f){var _0x1c0f40=typeof _0xee3d1a['offset']===_0x1fec('0xc')&&typeof _0xee3d1a['limit']===_0x1fec('0xc');var _0x1cfad7=_0x15dd8f['count'];var _0x389d2e=_0x1c0f40?0x0:_0xee3d1a['offset'];var _0x3d9aa4=_0x1c0f40?_0x15dd8f[_0x1fec('0xd')]:_0xee3d1a[_0x1fec('0xe')]+_0xee3d1a[_0x1fec('0xf')];var _0x2f25c4;if(_0x3d9aa4>=_0x1cfad7){_0x3d9aa4=_0x1cfad7;_0x2f25c4=0xc8;}else{_0x2f25c4=0xce;}_0x439a6c[_0x1fec('0xb')](_0x2f25c4);return _0x439a6c[_0x1fec('0x10')]('Content-Range',_0x389d2e+'-'+_0x3d9aa4+'/'+_0x1cfad7)[_0x1fec('0x11')](_0x15dd8f);}return null;};}function saveUpdates(_0x21081f){return function(_0x3dfd36){if(_0x3dfd36){return _0x3dfd36[_0x1fec('0x12')](_0x21081f)['then'](function(_0x42e750){return _0x42e750;});}return null;};}function removeEntity(_0x30518d){return function(_0x358e83){if(_0x358e83){return _0x358e83[_0x1fec('0x13')]()['then'](function(){_0x30518d[_0x1fec('0xb')](0xcc)[_0x1fec('0xa')]();});}};}function handleEntityNotFound(_0x475ea0){return function(_0x24b3b5){if(!_0x24b3b5){_0x475ea0[_0x1fec('0x9')](0x194);}return _0x24b3b5;};}function handleError(_0x1f5db1,_0x3da31c){_0x3da31c=_0x3da31c||0x1f4;return function(_0x314db1){logger[_0x1fec('0x14')](_0x314db1[_0x1fec('0x15')]);if(_0x314db1[_0x1fec('0x16')]){delete _0x314db1[_0x1fec('0x16')];}_0x1f5db1[_0x1fec('0xb')](_0x3da31c)[_0x1fec('0x17')](_0x314db1);};}function maskClientSecret(_0x289f88){return _['padEnd'](_0x289f88[_0x1fec('0x18')](0x0,0x3),0x14,'*');}exports[_0x1fec('0x19')]=function(_0x260d67,_0x510ec8){var _0x2f1883={},_0x10483c={},_0x7e5849={'count':0x0,'rows':[]};var _0x258fad=_[_0x1fec('0x1a')](db[_0x1fec('0x1b')][_0x1fec('0x1c')],function(_0x45ee9b){return{'name':_0x45ee9b[_0x1fec('0x1d')],'type':_0x45ee9b[_0x1fec('0x1e')][_0x1fec('0x1f')]};});_0x10483c['model']=_[_0x1fec('0x1a')](_0x258fad,'name');_0x10483c[_0x1fec('0x20')]=_[_0x1fec('0x21')](_0x260d67[_0x1fec('0x20')]);_0x10483c[_0x1fec('0x22')]=_[_0x1fec('0x23')](_0x10483c[_0x1fec('0x24')],_0x10483c['query']);_0x2f1883['attributes']=_[_0x1fec('0x23')](_0x10483c['model'],qs[_0x1fec('0x25')](_0x260d67['query']['fields']));_0x2f1883[_0x1fec('0x26')]=_0x2f1883[_0x1fec('0x26')][_0x1fec('0x27')]?_0x2f1883[_0x1fec('0x26')]:_0x10483c[_0x1fec('0x24')];if(!_0x260d67['query'][_0x1fec('0x28')](_0x1fec('0x29'))){_0x2f1883[_0x1fec('0xf')]=qs[_0x1fec('0xf')](_0x260d67[_0x1fec('0x20')][_0x1fec('0xf')]);_0x2f1883[_0x1fec('0xe')]=qs['offset'](_0x260d67[_0x1fec('0x20')][_0x1fec('0xe')]);}_0x2f1883[_0x1fec('0x2a')]=qs[_0x1fec('0x2b')](_0x260d67[_0x1fec('0x20')][_0x1fec('0x2b')]);_0x2f1883[_0x1fec('0x2c')]=qs[_0x1fec('0x22')](_[_0x1fec('0x2d')](_0x260d67['query'],_0x10483c['filters']),_0x258fad);if(_0x260d67[_0x1fec('0x20')]['filter']){_0x2f1883[_0x1fec('0x2c')]=_[_0x1fec('0x2e')](_0x2f1883[_0x1fec('0x2c')],{'$or':_[_0x1fec('0x1a')](_0x258fad,function(_0x35164c){if(_0x35164c['type']!==_0x1fec('0x2f')){var _0x1e829c={};_0x1e829c[_0x35164c[_0x1fec('0x16')]]={'$like':'%'+_0x260d67[_0x1fec('0x20')]['filter']+'%'};return _0x1e829c;}})});}_0x2f1883=_[_0x1fec('0x2e')]({},_0x2f1883,_0x260d67[_0x1fec('0x30')]);var _0x26bfca={'where':_0x2f1883[_0x1fec('0x2c')]};return db[_0x1fec('0x1b')][_0x1fec('0xd')](_0x26bfca)[_0x1fec('0x31')](function(_0x3f2da5){_0x7e5849[_0x1fec('0xd')]=_0x3f2da5;if(_0x260d67[_0x1fec('0x20')]['includeAll']){_0x2f1883[_0x1fec('0x32')]=[{'all':!![]}];}return db[_0x1fec('0x1b')][_0x1fec('0x33')](_0x2f1883);})[_0x1fec('0x31')](function(_0x349d45){_0x7e5849[_0x1fec('0x34')]=_[_0x1fec('0x1a')](_0x349d45,function(_0x229b75){if(_0x229b75[_0x1fec('0x35')]===_0x1fec('0x36')){var _0xe66e6b=encryptor[_0x1fec('0x37')](_0x229b75[_0x1fec('0x38')]);_0x229b75[_0x1fec('0x38')]=maskClientSecret(_0xe66e6b);}return _0x229b75;});return _0x7e5849;})[_0x1fec('0x31')](respondWithFilteredResult(_0x510ec8,_0x2f1883))[_0x1fec('0x39')](handleError(_0x510ec8,null));};exports[_0x1fec('0x3a')]=function(_0x49d317,_0x39accb){var _0x38daa9={'raw':!![],'where':{'id':_0x49d317[_0x1fec('0x3b')]['id']}},_0x20dda1={};_0x20dda1[_0x1fec('0x24')]=_[_0x1fec('0x21')](db[_0x1fec('0x1b')][_0x1fec('0x1c')]);_0x20dda1['query']=_['keys'](_0x49d317['query']);_0x20dda1['filters']=_[_0x1fec('0x23')](_0x20dda1[_0x1fec('0x24')],_0x20dda1[_0x1fec('0x20')]);_0x38daa9['attributes']=_[_0x1fec('0x23')](_0x20dda1[_0x1fec('0x24')],qs[_0x1fec('0x25')](_0x49d317['query'][_0x1fec('0x25')]));_0x38daa9[_0x1fec('0x26')]=_0x38daa9[_0x1fec('0x26')]['length']?_0x38daa9[_0x1fec('0x26')]:_0x20dda1[_0x1fec('0x24')];if(_0x49d317['query'][_0x1fec('0x3c')]){_0x38daa9['include']=[{'all':!![]}];}_0x38daa9=_[_0x1fec('0x2e')]({},_0x38daa9,_0x49d317[_0x1fec('0x30')]);return db[_0x1fec('0x1b')]['find'](_0x38daa9)[_0x1fec('0x31')](handleEntityNotFound(_0x39accb,null))[_0x1fec('0x31')](function(_0x12f19c){if(_0x12f19c[_0x1fec('0x35')]==='MicrosoftAzure'){var _0x2b4631=encryptor[_0x1fec('0x37')](_0x12f19c[_0x1fec('0x38')]);_0x12f19c[_0x1fec('0x38')]=maskClientSecret(_0x2b4631);}return _0x12f19c;})[_0x1fec('0x31')](respondWithResult(_0x39accb,null))[_0x1fec('0x39')](handleError(_0x39accb,null));};exports[_0x1fec('0x3d')]=function(_0xb4895,_0xd552c9){if(!_0xb4895[_0x1fec('0x3e')][_0x1fec('0x16')])throw new Error(_0x1fec('0x3f'));if(!_0xb4895['body'][_0x1fec('0x35')])throw new Error(_0x1fec('0x40'));var _0x161f42=db['CloudProvider'][_0x1fec('0x1c')][_0x1fec('0x35')][_0x1fec('0x41')];if(!_0x161f42[_0x1fec('0x42')](_0xb4895[_0x1fec('0x3e')][_0x1fec('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x161f42[_0x1fec('0x43')](',\x20'));if(_0xb4895[_0x1fec('0x3e')][_0x1fec('0x35')]===_0x1fec('0x36')&&_0xb4895['body']['data3']){_0xb4895[_0x1fec('0x3e')][_0x1fec('0x38')]=encryptor[_0x1fec('0x44')](_0xb4895[_0x1fec('0x3e')]['data3']);}return db[_0x1fec('0x1b')][_0x1fec('0x3d')](_0xb4895[_0x1fec('0x3e')],{})[_0x1fec('0x31')](respondWithResult(_0xd552c9,0xc9))[_0x1fec('0x39')](handleError(_0xd552c9,null));};exports[_0x1fec('0x12')]=function(_0x1f95e7,_0x2e59ed){if(_0x1f95e7[_0x1fec('0x3e')]['id']){delete _0x1f95e7[_0x1fec('0x3e')]['id'];}return db[_0x1fec('0x1b')][_0x1fec('0x45')]({'where':{'id':_0x1f95e7['params']['id']}})[_0x1fec('0x31')](handleEntityNotFound(_0x2e59ed,null))[_0x1fec('0x31')](function(_0x1637b3){if(_0x1637b3[_0x1fec('0x35')]===_0x1fec('0x36')&&_0x1f95e7[_0x1fec('0x3e')]['data3']){_0x1f95e7[_0x1fec('0x3e')]['data3']=encryptor['encryptString'](_0x1f95e7[_0x1fec('0x3e')][_0x1fec('0x38')]);}return _0x1637b3;})[_0x1fec('0x31')](saveUpdates(_0x1f95e7[_0x1fec('0x3e')],null))[_0x1fec('0x31')](respondWithResult(_0x2e59ed,null))[_0x1fec('0x39')](handleError(_0x2e59ed,null));};exports[_0x1fec('0x13')]=function(_0x563940,_0x2933c7){return db['CloudProvider'][_0x1fec('0x45')]({'where':{'id':_0x563940[_0x1fec('0x3b')]['id']}})[_0x1fec('0x31')](handleEntityNotFound(_0x2933c7,null))[_0x1fec('0x31')](removeEntity(_0x2933c7,null))[_0x1fec('0x39')](handleError(_0x2933c7,null));};exports['oauth2MicrosoftAuthorize']=function(_0x503174,_0x5d682c){return db[_0x1fec('0x1b')][_0x1fec('0x46')]({'where':{'id':_0x503174[_0x1fec('0x3b')]['id']},'raw':!![]})[_0x1fec('0x31')](function(_0x119987){if(!_0x119987)return _0x5d682c['sendStatus'](0x194);return{'url':oauth[_0x1fec('0x47')](_0x119987,_0x503174[_0x1fec('0x48')]['id'])};})['then'](respondWithResult(_0x5d682c,null))[_0x1fec('0x39')](handleError(_0x5d682c,null));};exports[_0x1fec('0x49')]=function(_0x5eb245,_0x3bc044){var _0x145227=_0x5eb245[_0x1fec('0x3e')];var _0x376b73;var _0x463446;if(_0x145227[_0x1fec('0x14')])throw _0x145227;redis[_0x1fec('0x4a')](_0x145227[_0x1fec('0x4b')])[_0x1fec('0x31')](function(_0x382d1a){if(!_0x382d1a)throw new Error(_0x1fec('0x4c'));_0x376b73=JSON[_0x1fec('0x4d')](_0x382d1a);var _0x2b800e=Buffer['from'](_0x145227[_0x1fec('0x4b')],'base64')[_0x1fec('0x4e')](_0x1fec('0x4f'));_0x463446=JSON[_0x1fec('0x4d')](_0x2b800e);if(!oauth['isValidIdToken'](_0x145227[_0x1fec('0x50')],_0x376b73[_0x1fec('0x51')]))throw new Error(_0x1fec('0x52'));redis[_0x1fec('0x53')](_0x145227['state']);return oauth[_0x1fec('0x54')](_0x145227[_0x1fec('0x55')],_0x376b73);})[_0x1fec('0x31')](function(_0x4cf51a){_0x376b73[_0x1fec('0x56')]=_0x4cf51a['access_token'];_0x376b73[_0x1fec('0x57')]=_0x4cf51a[_0x1fec('0x58')];return db[_0x1fec('0x1b')][_0x1fec('0x12')]({'data5':_0x376b73[_0x1fec('0x56')],'data6':_0x376b73[_0x1fec('0x57')]},{'where':{'id':_0x376b73['id']}});})[_0x1fec('0x31')](function(){oauth[_0x1fec('0x59')](_0x376b73);socket[_0x1fec('0x5a')](_0x1fec('0x5b'),{'id':_0x463446['id']});return;})[_0x1fec('0x31')](respondWithStatusCode(_0x3bc044,null))[_0x1fec('0x39')](function(_0xf071ab){if(_0x463446){socket[_0x1fec('0x5a')](_0x1fec('0x5c'),{'id':_0x463446['id']});}if(!_0x376b73){logger[_0x1fec('0x14')](_0x1fec('0x5d'),_0xf071ab);return _0x3bc044[_0x1fec('0xb')](0x1f4)['send'](_0xf071ab[_0x1fec('0x5e')]);}logger[_0x1fec('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x376b73['id'],JSON[_0x1fec('0x5f')](_0xf071ab));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 92a86c1..e6e13c0 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 _0x17cb=['cloud_providers','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x17cb,0x7a));var _0xb17c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x17cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb17c('0x0'));var util=require(_0xb17c('0x1'));var logger=require(_0xb17c('0x2'))('api');var moment=require(_0xb17c('0x3'));var BPromise=require(_0xb17c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb17c('0x5'));var rimraf=require(_0xb17c('0x6'));var config=require(_0xb17c('0x7'));var attributes=require(_0xb17c('0x8'));module['exports']=function(_0x37146e,_0x39ffd7){return _0x37146e['define'](_0xb17c('0x9'),attributes,{'tableName':_0xb17c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3cf=['./cloudProvider.attributes','exports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3cf,0x142));var _0xfa3c=function(_0x5b3229,_0x4bf196){_0x5b3229=_0x5b3229-0x0;var _0x1d8932=_0xa3cf[_0x5b3229];return _0x1d8932;};'use strict';var _=require(_0xfa3c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa3c('0x1'));var moment=require(_0xfa3c('0x2'));var BPromise=require(_0xfa3c('0x3'));var rp=require(_0xfa3c('0x4'));var fs=require('fs');var path=require(_0xfa3c('0x5'));var rimraf=require(_0xfa3c('0x6'));var config=require(_0xfa3c('0x7'));var attributes=require(_0xfa3c('0x8'));module[_0xfa3c('0x9')]=function(_0x519e7,_0x6ceff1){return _0x519e7['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 0e4553b..91fb5f3 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd308=['stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2/','decode','aud','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','POST','data5','access_token','update','catch','authorization_code','data4','decryptString','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','/authorize','/token','map','type','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from'];(function(_0x577ee4,_0x4ea06e){var _0x407b75=function(_0x3302a5){while(--_0x3302a5){_0x577ee4['push'](_0x577ee4['shift']());}};_0x407b75(++_0x4ea06e);}(_0xd308,0xcd));var _0x8d30=function(_0x242e48,_0x1ea276){_0x242e48=_0x242e48-0x0;var _0x3eca29=_0xd308[_0x242e48];return _0x3eca29;};'use strict';var _=require(_0x8d30('0x0'));var crypto=require(_0x8d30('0x1'));var jwt=require(_0x8d30('0x2'));var moment=require(_0x8d30('0x3'));var Redis=require('ioredis');var rp=require(_0x8d30('0x4'));var util=require(_0x8d30('0x5'));var encryptor=require(_0x8d30('0x6'));var config=require(_0x8d30('0x7'));var logger=require(_0x8d30('0x8'))(_0x8d30('0x9'));var schedule=require(_0x8d30('0xa'));var db=require(_0x8d30('0xb'))['db'];config['redis']=_[_0x8d30('0xc')](config['redis'],{'host':_0x8d30('0xd'),'port':0x18eb});var redis=new Redis(config[_0x8d30('0xe')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x8d30('0xf'),_0x8d30('0x10'),_0x8d30('0x11'),_0x8d30('0x12'),_0x8d30('0x13'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x8d30('0xf'),_0x8d30('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x8d30('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x8d30('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4f4585){var _0x499156=_[_0x8d30('0x16')](AZURE_AUTH_SCOPES[_0x4f4585[_0x8d30('0x17')]]);if(_0x4f4585[_0x8d30('0x17')]==='Dynamics365')_0x499156['push'](_0x4f4585[_0x8d30('0x18')]+_0x8d30('0x19'));return _0x499156[_0x8d30('0x1a')]('\x20');}function getAccessTokenScope(_0x5d473c){if(_0x5d473c['type']===_0x8d30('0x1b'))return _0x8d30('0x13');if(_0x5d473c[_0x8d30('0x17')]===_0x8d30('0x1c'))return _0x5d473c[_0x8d30('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x300f84,_0x2b7efc){var _0x71ecf1=MICROSOFT_AUTH_URL[_0x8d30('0x1d')](_0x8d30('0x1e'),_0x300f84[_0x8d30('0x1f')]);var _0x1d58b9=[_0x8d30('0x20'),_0x8d30('0x21')];var _0x3208cb=Buffer[_0x8d30('0x22')](JSON[_0x8d30('0x23')]({'id':_0x2b7efc}))[_0x8d30('0x24')](_0x8d30('0x25'));var _0x19fa08=crypto[_0x8d30('0x26')](0x10)[_0x8d30('0x24')](_0x8d30('0x27'));var _0x1e2de1=getAuthorizationScopes(_0x300f84);var _0x5bf83e=[{'key':_0x8d30('0x28'),'value':_0x300f84[_0x8d30('0x29')]},{'key':_0x8d30('0x2a'),'value':encodeURIComponent(_0x1d58b9[_0x8d30('0x1a')]('\x20'))},{'key':_0x8d30('0x2b'),'value':_0x300f84['data4']},{'key':_0x8d30('0x2c'),'value':_0x8d30('0x2d')},{'key':_0x8d30('0x2e'),'value':encodeURIComponent(_0x1e2de1)},{'key':_0x8d30('0x2f'),'value':_0x3208cb},{'key':_0x8d30('0x30'),'value':_0x19fa08},{'key':_0x8d30('0x31'),'value':'login'}];var _0x9cf7cb=_0x71ecf1+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5bf83e,function(_0x2ceb9a){return _0x2ceb9a[_0x8d30('0x32')]+'='+_0x2ceb9a[_0x8d30('0x33')];})[_0x8d30('0x1a')]('&');_0x300f84['oauth2Claims']={'issuer':_0x71ecf1['replace'](_0x8d30('0x34'),''),'audience':_0x300f84['data1'],'state':_0x3208cb,'nonce':_0x19fa08};redis['set'](_0x3208cb,JSON[_0x8d30('0x23')](_0x300f84));return _0x9cf7cb;}function isValidIdToken(_0xa6e728,_0x3c7cb7){try{var _0x18e86e=jwt[_0x8d30('0x35')](_0xa6e728,{'complete':!![]});var _0x2f6e7f=_0x18e86e['payload'];if(_0x2f6e7f['iss']!==_0x3c7cb7['issuer'])return![];if(_0x2f6e7f[_0x8d30('0x36')]!==_0x3c7cb7['audience'])return![];if(_0x2f6e7f[_0x8d30('0x30')]!==_0x3c7cb7[_0x8d30('0x30')])return![];if(moment()[_0x8d30('0x37')](moment[_0x8d30('0x38')](_0x2f6e7f[_0x8d30('0x39')])))return![];return!![];}catch(_0x369606){throw _0x369606;}}function refreshOauth2MicrosoftAccessToken(_0x4419ea){return Promise['resolve']()[_0x8d30('0x3a')](function(){if(_0x4419ea[_0x8d30('0x3b')])return _0x4419ea;return db[_0x8d30('0x3c')][_0x8d30('0x3d')]({'where':{'id':_0x4419ea['id']},'raw':!![]});})['then'](function(_0x5b5864){var _0x1c6545={'grant_type':_0x8d30('0x3e'),'refresh_token':_0x5b5864[_0x8d30('0x3f')],'scope':getAccessTokenScope(_0x5b5864),'redirect_uri':_0x5b5864['data4'],'client_id':_0x5b5864[_0x8d30('0x29')],'client_secret':encryptor['decryptString'](_0x5b5864[_0x8d30('0x3b')])};var _0x14c85e={'method':_0x8d30('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0x8d30('0x1e'),_0x5b5864['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1c6545,'json':!![]};return rp(_0x14c85e);})[_0x8d30('0x3a')](function(_0x519279){_0x4419ea[_0x8d30('0x41')]=_0x519279[_0x8d30('0x42')];_0x4419ea['data6']=_0x519279[_0x8d30('0x3e')];return db[_0x8d30('0x3c')][_0x8d30('0x43')]({'data5':_0x4419ea[_0x8d30('0x41')],'data6':_0x4419ea[_0x8d30('0x3f')]},{'where':{'id':_0x4419ea['id']}});})[_0x8d30('0x3a')](function(){return _0x4419ea;})[_0x8d30('0x44')](function(_0x12a2dd){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x4419ea['id'],_0x12a2dd);});}function getOauth2MicrosoftAccessToken(_0x1b5d7b,_0x2bfa7c){var _0x33d295={'grant_type':_0x8d30('0x45'),'code':_0x1b5d7b,'scope':getAccessTokenScope(_0x2bfa7c),'redirect_uri':_0x2bfa7c[_0x8d30('0x46')],'client_id':_0x2bfa7c['data1'],'client_secret':encryptor[_0x8d30('0x47')](_0x2bfa7c[_0x8d30('0x3b')])};var _0x25d1e2={'method':_0x8d30('0x40'),'uri':MICROSOFT_AUTH_URL[_0x8d30('0x1d')](_0x8d30('0x1e'),_0x2bfa7c[_0x8d30('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33d295,'json':!![]};return rp(_0x25d1e2);}function startRefreshInterval(_0x532eb8){var _0x40fd0a=schedule[_0x8d30('0x48')];if(_0x40fd0a[_0x532eb8['id']])clearInterval(_0x40fd0a[_0x532eb8['id']]);_0x40fd0a[_0x532eb8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8d30('0x49')](this,{'id':_0x532eb8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8d30('0x48')]=_0x40fd0a;}function startAllRefreshIntervals(){return db[_0x8d30('0x3c')][_0x8d30('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8d30('0x3a')](function(_0x4b205f){var _0x34ff5b=_0x4b205f[_0x8d30('0x16')](function(_0x487f0a){return refreshOauth2MicrosoftAccessToken(_0x487f0a)[_0x8d30('0x3a')](function(_0x4eaa2e){startRefreshInterval(_0x4eaa2e);});});return Promise[_0x8d30('0x4b')](_0x34ff5b);})[_0x8d30('0x44')](function(_0x334af6){var _0x137bce=_0x334af6?util[_0x8d30('0x4c')](_0x334af6,{'showHidden':![],'depth':null}):'';logger[_0x8d30('0x4d')](_0x8d30('0x4e'),_0x137bce);});}module[_0x8d30('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1e17=['iss','aud','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data4','decryptString','POST','data5','access_token','data6','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','intervals','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','/token','map','type','Dynamics365','join','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','payload'];(function(_0x424d40,_0x2cd41a){var _0x247f84=function(_0x2a0318){while(--_0x2a0318){_0x424d40['push'](_0x424d40['shift']());}};_0x247f84(++_0x2cd41a);}(_0x1e17,0x106));var _0x71e1=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0x1e17[_0x340380];return _0x49ce1c;};'use strict';var _=require(_0x71e1('0x0'));var crypto=require(_0x71e1('0x1'));var jwt=require(_0x71e1('0x2'));var moment=require(_0x71e1('0x3'));var Redis=require('ioredis');var rp=require(_0x71e1('0x4'));var util=require(_0x71e1('0x5'));var encryptor=require(_0x71e1('0x6'));var config=require(_0x71e1('0x7'));var logger=require('../../config/logger')(_0x71e1('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x71e1('0x9'))['db'];config[_0x71e1('0xa')]=_[_0x71e1('0xb')](config['redis'],{'host':_0x71e1('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x71e1('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x71e1('0xe'),_0x71e1('0xf'),'offline_access',_0x71e1('0x10'),_0x71e1('0x11'),_0x71e1('0x12')],'Dynamics365':[_0x71e1('0x13'),_0x71e1('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x71e1('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x71e1('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xaa6a85){var _0x1fdc35=_[_0x71e1('0x17')](AZURE_AUTH_SCOPES[_0xaa6a85[_0x71e1('0x18')]]);if(_0xaa6a85[_0x71e1('0x18')]===_0x71e1('0x19'))_0x1fdc35['push'](_0xaa6a85['data7']+'/.default');return _0x1fdc35[_0x71e1('0x1a')]('\x20');}function getAccessTokenScope(_0x5afe96){if(_0x5afe96['type']==='Outlook365')return _0x71e1('0x10');if(_0x5afe96['type']==='Dynamics365')return _0x5afe96['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4a07c2,_0x53bd57){var _0x492bde=MICROSOFT_AUTH_URL[_0x71e1('0x1b')](_0x71e1('0x1c'),_0x4a07c2[_0x71e1('0x1d')]);var _0x56380d=['code',_0x71e1('0x1e')];var _0x41c2ed=Buffer[_0x71e1('0x1f')](JSON[_0x71e1('0x20')]({'id':_0x53bd57}))[_0x71e1('0x21')]('base64');var _0x13ca88=crypto[_0x71e1('0x22')](0x10)[_0x71e1('0x21')](_0x71e1('0x23'));var _0x313cc5=getAuthorizationScopes(_0x4a07c2);var _0x1154b6=[{'key':_0x71e1('0x24'),'value':_0x4a07c2[_0x71e1('0x25')]},{'key':_0x71e1('0x26'),'value':encodeURIComponent(_0x56380d[_0x71e1('0x1a')]('\x20'))},{'key':_0x71e1('0x27'),'value':_0x4a07c2['data4']},{'key':_0x71e1('0x28'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x313cc5)},{'key':_0x71e1('0x29'),'value':_0x41c2ed},{'key':_0x71e1('0x2a'),'value':_0x13ca88},{'key':_0x71e1('0x2b'),'value':'login'}];var _0x1d5bae=_0x492bde+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x71e1('0x17')](_0x1154b6,function(_0x32b7ca){return _0x32b7ca[_0x71e1('0x2c')]+'='+_0x32b7ca[_0x71e1('0x2d')];})[_0x71e1('0x1a')]('&');_0x4a07c2[_0x71e1('0x2e')]={'issuer':_0x492bde['replace'](_0x71e1('0x2f'),''),'audience':_0x4a07c2[_0x71e1('0x25')],'state':_0x41c2ed,'nonce':_0x13ca88};redis[_0x71e1('0x30')](_0x41c2ed,JSON[_0x71e1('0x20')](_0x4a07c2));return _0x1d5bae;}function isValidIdToken(_0x5d6c42,_0x18311c){try{var _0xc8625f=jwt['decode'](_0x5d6c42,{'complete':!![]});var _0x595563=_0xc8625f[_0x71e1('0x31')];if(_0x595563[_0x71e1('0x32')]!==_0x18311c['issuer'])return![];if(_0x595563[_0x71e1('0x33')]!==_0x18311c[_0x71e1('0x34')])return![];if(_0x595563['nonce']!==_0x18311c[_0x71e1('0x2a')])return![];if(moment()[_0x71e1('0x35')](moment[_0x71e1('0x36')](_0x595563[_0x71e1('0x37')])))return![];return!![];}catch(_0x38e7aa){throw _0x38e7aa;}}function refreshOauth2MicrosoftAccessToken(_0x1d8895){return Promise[_0x71e1('0x38')]()[_0x71e1('0x39')](function(){if(_0x1d8895[_0x71e1('0x3a')])return _0x1d8895;return db['CloudProvider'][_0x71e1('0x3b')]({'where':{'id':_0x1d8895['id']},'raw':!![]});})[_0x71e1('0x39')](function(_0x33737f){var _0x5a2506={'grant_type':_0x71e1('0x3c'),'refresh_token':_0x33737f['data6'],'scope':getAccessTokenScope(_0x33737f),'redirect_uri':_0x33737f[_0x71e1('0x3d')],'client_id':_0x33737f[_0x71e1('0x25')],'client_secret':encryptor[_0x71e1('0x3e')](_0x33737f[_0x71e1('0x3a')])};var _0x22b144={'method':_0x71e1('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x71e1('0x1b')](_0x71e1('0x1c'),_0x33737f[_0x71e1('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5a2506,'json':!![]};return rp(_0x22b144);})[_0x71e1('0x39')](function(_0x2d4414){_0x1d8895[_0x71e1('0x40')]=_0x2d4414[_0x71e1('0x41')];_0x1d8895[_0x71e1('0x42')]=_0x2d4414[_0x71e1('0x3c')];return db[_0x71e1('0x43')][_0x71e1('0x44')]({'data5':_0x1d8895[_0x71e1('0x40')],'data6':_0x1d8895[_0x71e1('0x42')]},{'where':{'id':_0x1d8895['id']}});})[_0x71e1('0x39')](function(){return _0x1d8895;})[_0x71e1('0x45')](function(_0x372762){logger['error'](_0x71e1('0x46'),_0x1d8895['id'],_0x372762);});}function getOauth2MicrosoftAccessToken(_0x7f4b5,_0x34588){var _0x216882={'grant_type':'authorization_code','code':_0x7f4b5,'scope':getAccessTokenScope(_0x34588),'redirect_uri':_0x34588[_0x71e1('0x3d')],'client_id':_0x34588[_0x71e1('0x25')],'client_secret':encryptor[_0x71e1('0x3e')](_0x34588['data3'])};var _0x346074={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x71e1('0x1c'),_0x34588[_0x71e1('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x216882,'json':!![]};return rp(_0x346074);}function startRefreshInterval(_0x48b85b){var _0x3779d9=schedule['intervals'];if(_0x3779d9[_0x48b85b['id']])clearInterval(_0x3779d9[_0x48b85b['id']]);_0x3779d9[_0x48b85b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x71e1('0x47')](this,{'id':_0x48b85b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x71e1('0x48')]=_0x3779d9;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x71e1('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x71e1('0x39')](function(_0x12255f){var _0x537f4d=_0x12255f['map'](function(_0x438eac){return refreshOauth2MicrosoftAccessToken(_0x438eac)[_0x71e1('0x39')](function(_0x3bd3b7){startRefreshInterval(_0x3bd3b7);});});return Promise[_0x71e1('0x4a')](_0x537f4d);})[_0x71e1('0x45')](function(_0x226b5c){var _0x2a5687=_0x226b5c?util[_0x71e1('0x4b')](_0x226b5c,{'showHidden':![],'depth':null}):'';logger[_0x71e1('0x4c')](_0x71e1('0x4d'),_0x2a5687);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index d462e33..218b069 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 _0x58cc=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4068a3,_0x1c2cd3){var _0xcdea1=function(_0x1eabe1){while(--_0x1eabe1){_0x4068a3['push'](_0x4068a3['shift']());}};_0xcdea1(++_0x1c2cd3);}(_0x58cc,0x7a));var _0xc58c=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x58cc[_0x460150];return _0x340677;};'use strict';var _=require(_0xc58c('0x0'));var util=require(_0xc58c('0x1'));var moment=require(_0xc58c('0x2'));var BPromise=require(_0xc58c('0x3'));var rs=require(_0xc58c('0x4'));var fs=require('fs');var Redis=require(_0xc58c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc58c('0x6'));var logger=require(_0xc58c('0x7'))(_0xc58c('0x8'));var config=require(_0xc58c('0x9'));var jayson=require(_0xc58c('0xa'));var client=jayson[_0xc58c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f1b4e,_0x448646,_0x282354){return new BPromise(function(_0x48a9f4,_0x184b6d){return client[_0xc58c('0xc')](_0x4f1b4e,_0x282354)['then'](function(_0x248c8c){logger['info'](_0xc58c('0xd'),_0x448646,_0xc58c('0xe'));logger[_0xc58c('0xf')](_0xc58c('0x10'),_0x448646,_0xc58c('0xe'),JSON[_0xc58c('0x11')](_0x248c8c));if(_0x248c8c['error']){if(_0x248c8c[_0xc58c('0x12')][_0xc58c('0x13')]===0x1f4){logger[_0xc58c('0x12')](_0xc58c('0xd'),_0x448646,_0x248c8c[_0xc58c('0x12')][_0xc58c('0x14')]);return _0x184b6d(_0x248c8c[_0xc58c('0x12')][_0xc58c('0x14')]);}logger[_0xc58c('0x12')](_0xc58c('0xd'),_0x448646,_0x248c8c['error'][_0xc58c('0x14')]);return _0x48a9f4(_0x248c8c['error'][_0xc58c('0x14')]);}else{logger[_0xc58c('0x15')](_0xc58c('0xd'),_0x448646,_0xc58c('0xe'));_0x48a9f4(_0x248c8c[_0xc58c('0x16')][_0xc58c('0x14')]);}})[_0xc58c('0x17')](function(_0xf1601f){logger[_0xc58c('0x12')](_0xc58c('0xd'),_0x448646,_0xf1601f);_0x184b6d(_0xf1601f);});});}
\ No newline at end of file
+var _0x9e6b=['request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e6b[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var moment=require('moment');var BPromise=require(_0xb9e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9e6('0x3'))['db'];var utils=require(_0xb9e6('0x4'));var logger=require(_0xb9e6('0x5'))(_0xb9e6('0x6'));var config=require('../../config/environment');var jayson=require(_0xb9e6('0x7'));var client=jayson[_0xb9e6('0x8')][_0xb9e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bb674,_0x2cbcf7,_0x49565c){return new BPromise(function(_0x5a54db,_0x4cc018){return client[_0xb9e6('0xa')](_0x4bb674,_0x49565c)['then'](function(_0x378e17){logger[_0xb9e6('0xb')](_0xb9e6('0xc'),_0x2cbcf7,_0xb9e6('0xd'));logger[_0xb9e6('0xe')](_0xb9e6('0xf'),_0x2cbcf7,_0xb9e6('0xd'),JSON[_0xb9e6('0x10')](_0x378e17));if(_0x378e17[_0xb9e6('0x11')]){if(_0x378e17[_0xb9e6('0x11')]['code']===0x1f4){logger[_0xb9e6('0x11')](_0xb9e6('0xc'),_0x2cbcf7,_0x378e17[_0xb9e6('0x11')][_0xb9e6('0x12')]);return _0x4cc018(_0x378e17['error'][_0xb9e6('0x12')]);}logger[_0xb9e6('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2cbcf7,_0x378e17['error'][_0xb9e6('0x12')]);return _0x5a54db(_0x378e17[_0xb9e6('0x11')][_0xb9e6('0x12')]);}else{logger[_0xb9e6('0xb')]('CloudProvider,\x20%s,\x20%s',_0x2cbcf7,_0xb9e6('0xd'));_0x5a54db(_0x378e17[_0xb9e6('0x13')][_0xb9e6('0x12')]);}})[_0xb9e6('0x14')](function(_0x15aa3d){logger[_0xb9e6('0x11')](_0xb9e6('0xc'),_0x2cbcf7,_0x15aa3d);_0x4cc018(_0x15aa3d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 071c2ea..7853112 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x1261,0x144));var _0x1126=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x1261[_0x2a0350];return _0x425220;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0xcb5608,_0x5ec499){var _0x3941d9=function(_0x3f3965){while(--_0x3f3965){_0xcb5608['push'](_0xcb5608['shift']());}};_0x3941d9(++_0x5ec499);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index a002d0f..2977a5c 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 _0xa67b=['exports','STRING','sequelize'];(function(_0x493b80,_0x6b33a1){var _0x11d5c6=function(_0x3010fc){while(--_0x3010fc){_0x493b80['push'](_0x493b80['shift']());}};_0x11d5c6(++_0x6b33a1);}(_0xa67b,0xc5));var _0xba67=function(_0x98e3a1,_0x5ba9bd){_0x98e3a1=_0x98e3a1-0x0;var _0x1836e0=_0xa67b[_0x98e3a1];return _0x1836e0;};'use strict';var Sequelize=require(_0xba67('0x0'));module[_0xba67('0x1')]={'name':{'type':Sequelize[_0xba67('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xba67('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xba67('0x2')]},'phone':{'type':Sequelize[_0xba67('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xba67('0x2')]},'street':{'type':Sequelize[_0xba67('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xba67('0x2')]},'country':{'type':Sequelize[_0xba67('0x2')]},'email':{'type':Sequelize[_0xba67('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xba67('0x2')]},'sStreet':{'type':Sequelize[_0xba67('0x2')]},'sPostalCode':{'type':Sequelize[_0xba67('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba67('0x2')]}};
\ No newline at end of file
+var _0xefe5=['sequelize','STRING','name'];(function(_0x3ec7ff,_0x3f87f4){var _0x4468d8=function(_0x30e7d4){while(--_0x30e7d4){_0x3ec7ff['push'](_0x3ec7ff['shift']());}};_0x4468d8(++_0x3f87f4);}(_0xefe5,0x10b));var _0x5efe=function(_0x25be2d,_0xbe7d6b){_0x25be2d=_0x25be2d-0x0;var _0x366bb0=_0xefe5[_0x25be2d];return _0x366bb0;};'use strict';var Sequelize=require(_0x5efe('0x0'));module['exports']={'name':{'type':Sequelize[_0x5efe('0x1')],'unique':_0x5efe('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5efe('0x1')]},'companyId':{'type':Sequelize[_0x5efe('0x1')]},'website':{'type':Sequelize[_0x5efe('0x1')]},'phone':{'type':Sequelize[_0x5efe('0x1')]},'fax':{'type':Sequelize[_0x5efe('0x1')]},'type':{'type':Sequelize[_0x5efe('0x1')]},'street':{'type':Sequelize[_0x5efe('0x1')]},'postalCode':{'type':Sequelize[_0x5efe('0x1')]},'city':{'type':Sequelize[_0x5efe('0x1')]},'country':{'type':Sequelize[_0x5efe('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5efe('0x1')]},'sStreet':{'type':Sequelize[_0x5efe('0x1')]},'sPostalCode':{'type':Sequelize[_0x5efe('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5efe('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b5bfdf5..49e58bd 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 _0x280d=['moment','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','get','Companies','UserProfileResource','then','error','name','send','index','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','CmCompany','includeAll','include','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','CmContact','ids','findOne','pick','getContacts','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x386e,_0x384ed8){var _0xc45a21=function(_0x5ac954){while(--_0x5ac954){_0x386e['push'](_0x386e['shift']());}};_0xc45a21(++_0x384ed8);}(_0x280d,0xa0));var _0xd280=function(_0x5e5fb3,_0x856803){_0x5e5fb3=_0x5e5fb3-0x0;var _0x1a40f7=_0x280d[_0x5e5fb3];return _0x1a40f7;};'use strict';var emlformat=require(_0xd280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd280('0x1'));var jsonpatch=require(_0xd280('0x2'));var rp=require(_0xd280('0x3'));var moment=require(_0xd280('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd280('0x5'));var path=require(_0xd280('0x6'));var sox=require(_0xd280('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd280('0x8'));var _=require(_0xd280('0x9'));var squel=require(_0xd280('0xa'));var crypto=require(_0xd280('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd280('0xc'));var toCsv=require(_0xd280('0xd'));var querystring=require(_0xd280('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd280('0xf'));var as=require(_0xd280('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd280('0x11'))(_0xd280('0x12'));var utils=require(_0xd280('0x13'));var config=require(_0xd280('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd280('0x15'))['db'];function respondWithStatusCode(_0x3fab85,_0x2c7ca4){_0x2c7ca4=_0x2c7ca4||0xcc;return function(_0x11cc1e){if(_0x11cc1e){return _0x3fab85[_0xd280('0x16')](_0x2c7ca4);}return _0x3fab85[_0xd280('0x17')](_0x2c7ca4)[_0xd280('0x18')]();};}function respondWithResult(_0x34d1f4,_0x29fee2){_0x29fee2=_0x29fee2||0xc8;return function(_0x132249){if(_0x132249){return _0x34d1f4[_0xd280('0x17')](_0x29fee2)['json'](_0x132249);}};}function respondWithFilteredResult(_0x5d7c39,_0x2823e9){return function(_0x30ba9e){if(_0x30ba9e){var _0x20dd53=typeof _0x2823e9[_0xd280('0x19')]===_0xd280('0x1a')&&typeof _0x2823e9[_0xd280('0x1b')]===_0xd280('0x1a');var _0x2da025=_0x30ba9e[_0xd280('0x1c')];var _0x36f682=_0x20dd53?0x0:_0x2823e9['offset'];var _0x414634=_0x20dd53?_0x30ba9e['count']:_0x2823e9[_0xd280('0x19')]+_0x2823e9[_0xd280('0x1b')];var _0x1fa291;if(_0x414634>=_0x2da025){_0x414634=_0x2da025;_0x1fa291=0xc8;}else{_0x1fa291=0xce;}_0x5d7c39['status'](_0x1fa291);return _0x5d7c39[_0xd280('0x1d')](_0xd280('0x1e'),_0x36f682+'-'+_0x414634+'/'+_0x2da025)[_0xd280('0x1f')](_0x30ba9e);}return null;};}function patchUpdates(_0x2e4b04){return function(_0x11f1f6){try{jsonpatch[_0xd280('0x20')](_0x11f1f6,_0x2e4b04,!![]);}catch(_0x12e8eb){return BPromise[_0xd280('0x21')](_0x12e8eb);}return _0x11f1f6['save']();};}function saveUpdates(_0x56a18f,_0x12c689){return function(_0x5559d4){if(_0x5559d4){return _0x5559d4[_0xd280('0x22')](_0x56a18f)['then'](function(_0x528a5b){return _0x528a5b;});}return null;};}function removeEntity(_0x225eb1,_0x39ac4e){return function(_0x1ff8b7){if(_0x1ff8b7){return _0x1ff8b7[_0xd280('0x23')]()['then'](function(){var _0x1697a5=_0x1ff8b7[_0xd280('0x24')]({'plain':!![]});var _0x480d1d=_0xd280('0x25');return db[_0xd280('0x26')][_0xd280('0x23')]({'where':{'type':_0x480d1d,'resourceId':_0x1697a5['id']}})[_0xd280('0x27')](function(){return _0x1ff8b7;});})[_0xd280('0x27')](function(){_0x225eb1[_0xd280('0x17')](0xcc)[_0xd280('0x18')]();});}};}function handleEntityNotFound(_0x3af1c8,_0x449899){return function(_0x59299e){if(!_0x59299e){_0x3af1c8[_0xd280('0x16')](0x194);}return _0x59299e;};}function handleError(_0x470574,_0x3132f9){_0x3132f9=_0x3132f9||0x1f4;return function(_0x79bb8d){logger[_0xd280('0x28')](_0x79bb8d['stack']);if(_0x79bb8d[_0xd280('0x29')]){delete _0x79bb8d['name'];}_0x470574[_0xd280('0x17')](_0x3132f9)[_0xd280('0x2a')](_0x79bb8d);};}exports[_0xd280('0x2b')]=function(_0x5be81b,_0x3cad21){var _0x458dee={},_0x608853={},_0x40a001={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xd280('0x27')](function(_0x24ffb3){_0x608853['model']=_[_0xd280('0x2c')](_0x24ffb3);_0x608853[_0xd280('0x2d')]=_[_0xd280('0x2c')](_0x5be81b[_0xd280('0x2d')]);_0x608853['filters']=_[_0xd280('0x2e')](_0x608853[_0xd280('0x2f')],_0x608853[_0xd280('0x2d')]);_0x458dee[_0xd280('0x30')]=_[_0xd280('0x2e')](_0x608853[_0xd280('0x2f')],qs[_0xd280('0x31')](_0x5be81b[_0xd280('0x2d')][_0xd280('0x31')]));_0x458dee['attributes']=_0x458dee[_0xd280('0x30')][_0xd280('0x32')]?_0x458dee[_0xd280('0x30')]:_0x608853['model'];if(!_0x5be81b[_0xd280('0x2d')][_0xd280('0x33')](_0xd280('0x34'))){_0x458dee[_0xd280('0x1b')]=qs['limit'](_0x5be81b[_0xd280('0x2d')]['limit']);_0x458dee[_0xd280('0x19')]=qs['offset'](_0x5be81b['query']['offset']);}_0x458dee[_0xd280('0x35')]=qs[_0xd280('0x36')](_0x5be81b[_0xd280('0x2d')][_0xd280('0x36')]);_0x458dee[_0xd280('0x37')]=qs['filters'](_['pick'](_0x5be81b[_0xd280('0x2d')],_0x608853[_0xd280('0x38')]),_0x24ffb3);if(_0x5be81b[_0xd280('0x2d')][_0xd280('0x39')]){_0x458dee['where']=_[_0xd280('0x3a')](_0x458dee['where'],{'$or':_[_0xd280('0x3b')](_0x458dee[_0xd280('0x30')],function(_0x83a96d){var _0xe18223={};_0xe18223[_0x83a96d]={'$like':'%'+_0x5be81b[_0xd280('0x2d')][_0xd280('0x39')]+'%'};return _0xe18223;})});}_0x458dee=_[_0xd280('0x3a')]({},_0x458dee,_0x5be81b[_0xd280('0x3c')]);var _0x31ff09={'where':_0x458dee['where']};return db[_0xd280('0x3d')]['count'](_0x31ff09)[_0xd280('0x27')](function(_0x2e77ca){_0x40a001[_0xd280('0x1c')]=_0x2e77ca;if(_0x5be81b['query'][_0xd280('0x3e')]){_0x458dee[_0xd280('0x3f')]=[{'all':!![]}];}return db[_0xd280('0x3d')]['findAll'](_0x458dee);})[_0xd280('0x27')](function(_0x4ced00){_0x40a001['rows']=_0x4ced00;return _0x40a001;})['then'](respondWithFilteredResult(_0x3cad21,_0x458dee))[_0xd280('0x40')](handleError(_0x3cad21,null));})[_0xd280('0x40')](handleError(_0x3cad21,null));};exports[_0xd280('0x41')]=function(_0x385d70,_0x318987){var _0x15d5fd={'raw':![],'where':{'id':_0x385d70[_0xd280('0x42')]['id']}},_0x58c56d={};_0x58c56d[_0xd280('0x2f')]=_[_0xd280('0x2c')](db['CmCompany']['rawAttributes']);_0x58c56d[_0xd280('0x2d')]=_[_0xd280('0x2c')](_0x385d70[_0xd280('0x2d')]);_0x58c56d[_0xd280('0x38')]=_[_0xd280('0x2e')](_0x58c56d['model'],_0x58c56d[_0xd280('0x2d')]);_0x15d5fd['attributes']=_[_0xd280('0x2e')](_0x58c56d[_0xd280('0x2f')],qs[_0xd280('0x31')](_0x385d70[_0xd280('0x2d')][_0xd280('0x31')]));_0x15d5fd[_0xd280('0x30')]=_0x15d5fd['attributes'][_0xd280('0x32')]?_0x15d5fd[_0xd280('0x30')]:_0x58c56d['model'];if(_0x385d70[_0xd280('0x2d')][_0xd280('0x3e')]){_0x15d5fd[_0xd280('0x3f')]=[{'all':!![]}];}_0x15d5fd=_[_0xd280('0x3a')]({},_0x15d5fd,_0x385d70['options']);return db['CmCompany'][_0xd280('0x43')](_0x15d5fd)[_0xd280('0x27')](handleEntityNotFound(_0x318987,null))['then'](respondWithResult(_0x318987,null))[_0xd280('0x40')](handleError(_0x318987,null));};exports[_0xd280('0x44')]=function(_0x366844,_0x19aac8){return db[_0xd280('0x3d')][_0xd280('0x44')](_0x366844['body'],{})['then'](function(_0xf664c){var _0x491074=_0x366844[_0xd280('0x45')][_0xd280('0x24')]({'plain':!![]});if(!_0x491074)throw new Error(_0xd280('0x46'));if(_0x491074[_0xd280('0x47')]===_0xd280('0x45')){var _0x166117=_0xf664c[_0xd280('0x24')]({'plain':!![]});var _0x4f3312=_0xd280('0x25');return db['UserProfileSection'][_0xd280('0x43')]({'where':{'name':_0x4f3312,'userProfileId':_0x491074[_0xd280('0x48')]},'raw':!![]})[_0xd280('0x27')](function(_0x2951b9){if(_0x2951b9&&_0x2951b9['autoAssociation']===0x0){return db[_0xd280('0x26')]['create']({'name':_0x166117[_0xd280('0x29')],'resourceId':_0x166117['id'],'type':_0x2951b9[_0xd280('0x29')],'sectionId':_0x2951b9['id']},{})['then'](function(){return _0xf664c;});}else{return _0xf664c;}})[_0xd280('0x40')](function(_0x20a02a){logger[_0xd280('0x28')](_0xd280('0x49'),_0x20a02a);throw _0x20a02a;});}return _0xf664c;})[_0xd280('0x27')](respondWithResult(_0x19aac8,0xc9))[_0xd280('0x40')](handleError(_0x19aac8,null));};exports[_0xd280('0x22')]=function(_0x197918,_0x160e1b){if(_0x197918[_0xd280('0x4a')]['id']){delete _0x197918[_0xd280('0x4a')]['id'];}return db[_0xd280('0x3d')]['find']({'where':{'id':_0x197918[_0xd280('0x42')]['id']}})['then'](handleEntityNotFound(_0x160e1b,null))['then'](saveUpdates(_0x197918[_0xd280('0x4a')],null))['then'](respondWithResult(_0x160e1b,null))[_0xd280('0x40')](handleError(_0x160e1b,null));};exports[_0xd280('0x23')]=function(_0x1b7f90,_0xb992eb){return db[_0xd280('0x3d')][_0xd280('0x43')]({'where':{'id':_0x1b7f90['params']['id']}})[_0xd280('0x27')](handleEntityNotFound(_0xb992eb,null))['then'](removeEntity(_0xb992eb,null))[_0xd280('0x40')](handleError(_0xb992eb,null));};exports[_0xd280('0x4b')]=function(_0xb1eca0,_0x579349){return db[_0xd280('0x3d')]['describe']()['then'](respondWithResult(_0x579349,null))[_0xd280('0x40')](handleError(_0x579349,null));};exports[_0xd280('0x4c')]=function(_0x4c207e,_0x4a5515,_0x4838fc){return db[_0xd280('0x4d')][_0xd280('0x43')]({'where':{'id':_0x4c207e[_0xd280('0x42')]['id']}})[_0xd280('0x27')](handleEntityNotFound(_0x4a5515,null))[_0xd280('0x27')](function(_0x2d42a2){if(_0x2d42a2){return _0x2d42a2['addContacts'](_0x4c207e[_0xd280('0x4a')][_0xd280('0x4e')],_['omit'](_0x4c207e['body'],[_0xd280('0x4e'),'id'])||{});}})[_0xd280('0x27')](respondWithResult(_0x4a5515,null))[_0xd280('0x40')](handleError(_0x4a5515,null));};exports['getContacts']=function(_0x15660f,_0x5b6a90,_0x5c68f5){var _0x59d27e={};var _0x1e0c11={};var _0x3a7cd9;var _0x46fc4f;return db['CmCompany'][_0xd280('0x4f')]({'where':{'id':_0x15660f[_0xd280('0x42')]['id']}})[_0xd280('0x27')](handleEntityNotFound(_0x5b6a90,null))[_0xd280('0x27')](function(_0x22021b){if(_0x22021b){_0x3a7cd9=_0x22021b;_0x1e0c11[_0xd280('0x2f')]=_[_0xd280('0x2c')](db['CmContact']['rawAttributes']);_0x1e0c11[_0xd280('0x2d')]=_[_0xd280('0x2c')](_0x15660f['query']);_0x1e0c11[_0xd280('0x38')]=_[_0xd280('0x2e')](_0x1e0c11[_0xd280('0x2f')],_0x1e0c11['query']);_0x59d27e['attributes']=_['intersection'](_0x1e0c11[_0xd280('0x2f')],qs[_0xd280('0x31')](_0x15660f[_0xd280('0x2d')][_0xd280('0x31')]));_0x59d27e['attributes']=_0x59d27e[_0xd280('0x30')][_0xd280('0x32')]?_0x59d27e[_0xd280('0x30')]:_0x1e0c11[_0xd280('0x2f')];_0x59d27e[_0xd280('0x35')]=qs['sort'](_0x15660f['query'][_0xd280('0x36')]);_0x59d27e['where']=qs[_0xd280('0x38')](_[_0xd280('0x50')](_0x15660f['query'],_0x1e0c11[_0xd280('0x38')]));if(_0x15660f[_0xd280('0x2d')]['filter']){_0x59d27e['where']=_[_0xd280('0x3a')](_0x59d27e[_0xd280('0x37')],{'$or':_[_0xd280('0x3b')](_0x59d27e[_0xd280('0x30')],function(_0x1e9dd0){var _0x12e883={};_0x12e883[_0x1e9dd0]={'$like':'%'+_0x15660f['query'][_0xd280('0x39')]+'%'};return _0x12e883;})});}_0x59d27e=_[_0xd280('0x3a')]({},_0x59d27e,_0x15660f['options']);return _0x3a7cd9[_0xd280('0x51')](_0x59d27e);}})['then'](function(_0x25e8b5){if(_0x25e8b5){_0x46fc4f=_0x25e8b5[_0xd280('0x32')];if(!_0x15660f[_0xd280('0x2d')][_0xd280('0x33')](_0xd280('0x34'))){_0x59d27e[_0xd280('0x1b')]=qs[_0xd280('0x1b')](_0x15660f[_0xd280('0x2d')][_0xd280('0x1b')]);_0x59d27e['offset']=qs[_0xd280('0x19')](_0x15660f[_0xd280('0x2d')][_0xd280('0x19')]);}return _0x3a7cd9[_0xd280('0x51')](_0x59d27e);}})['then'](function(_0x1fb6ce){if(_0x1fb6ce){return _0x1fb6ce?{'count':_0x46fc4f,'rows':_0x1fb6ce}:null;}})[_0xd280('0x27')](respondWithResult(_0x5b6a90,null))['catch'](handleError(_0x5b6a90,null));};
\ No newline at end of file
+var _0xb7ba=['undefined','limit','count','offset','set','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','CmCompany','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','options','where','findAll','rows','catch','params','rawAttributes','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb7ba,0x1e1));var _0xab7b=function(_0x2ea087,_0x17f324){_0x2ea087=_0x2ea087-0x0;var _0x23ebac=_0xb7ba[_0x2ea087];return _0x23ebac;};'use strict';var emlformat=require(_0xab7b('0x0'));var rimraf=require(_0xab7b('0x1'));var zipdir=require(_0xab7b('0x2'));var jsonpatch=require(_0xab7b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab7b('0x4'));var Mustache=require(_0xab7b('0x5'));var util=require(_0xab7b('0x6'));var path=require('path');var sox=require(_0xab7b('0x7'));var csv=require(_0xab7b('0x8'));var ejs=require(_0xab7b('0x9'));var fs=require('fs');var fs_extra=require(_0xab7b('0xa'));var _=require(_0xab7b('0xb'));var squel=require(_0xab7b('0xc'));var crypto=require(_0xab7b('0xd'));var jsforce=require(_0xab7b('0xe'));var deskjs=require(_0xab7b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab7b('0x10'));var authService=require(_0xab7b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xab7b('0x12'));var hardwareService=require(_0xab7b('0x13'));var logger=require(_0xab7b('0x14'))(_0xab7b('0x15'));var utils=require(_0xab7b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xab7b('0x17'));var db=require(_0xab7b('0x18'))['db'];function respondWithStatusCode(_0x1e5ed8,_0x49d4ec){_0x49d4ec=_0x49d4ec||0xcc;return function(_0x14e260){if(_0x14e260){return _0x1e5ed8[_0xab7b('0x19')](_0x49d4ec);}return _0x1e5ed8[_0xab7b('0x1a')](_0x49d4ec)[_0xab7b('0x1b')]();};}function respondWithResult(_0x525354,_0x73d615){_0x73d615=_0x73d615||0xc8;return function(_0x561a01){if(_0x561a01){return _0x525354[_0xab7b('0x1a')](_0x73d615)[_0xab7b('0x1c')](_0x561a01);}};}function respondWithFilteredResult(_0x19b9e6,_0x32f4ad){return function(_0xc89968){if(_0xc89968){var _0x520e68=typeof _0x32f4ad['offset']===_0xab7b('0x1d')&&typeof _0x32f4ad[_0xab7b('0x1e')]===_0xab7b('0x1d');var _0x22ed5f=_0xc89968[_0xab7b('0x1f')];var _0x3a8583=_0x520e68?0x0:_0x32f4ad['offset'];var _0x3c38dc=_0x520e68?_0xc89968[_0xab7b('0x1f')]:_0x32f4ad[_0xab7b('0x20')]+_0x32f4ad['limit'];var _0x105af7;if(_0x3c38dc>=_0x22ed5f){_0x3c38dc=_0x22ed5f;_0x105af7=0xc8;}else{_0x105af7=0xce;}_0x19b9e6[_0xab7b('0x1a')](_0x105af7);return _0x19b9e6[_0xab7b('0x21')]('Content-Range',_0x3a8583+'-'+_0x3c38dc+'/'+_0x22ed5f)[_0xab7b('0x1c')](_0xc89968);}return null;};}function patchUpdates(_0x363fcb){return function(_0x4d96a3){try{jsonpatch[_0xab7b('0x22')](_0x4d96a3,_0x363fcb,!![]);}catch(_0x257b50){return BPromise['reject'](_0x257b50);}return _0x4d96a3[_0xab7b('0x23')]();};}function saveUpdates(_0x52f07d,_0x33083b){return function(_0x4af165){if(_0x4af165){return _0x4af165[_0xab7b('0x24')](_0x52f07d)[_0xab7b('0x25')](function(_0x408c3f){return _0x408c3f;});}return null;};}function removeEntity(_0x5b2e26,_0x1b1d9b){return function(_0x235fcf){if(_0x235fcf){return _0x235fcf[_0xab7b('0x26')]()[_0xab7b('0x25')](function(){var _0xb982d4=_0x235fcf[_0xab7b('0x27')]({'plain':!![]});var _0x139e9c=_0xab7b('0x28');return db[_0xab7b('0x29')][_0xab7b('0x26')]({'where':{'type':_0x139e9c,'resourceId':_0xb982d4['id']}})[_0xab7b('0x25')](function(){return _0x235fcf;});})[_0xab7b('0x25')](function(){_0x5b2e26[_0xab7b('0x1a')](0xcc)[_0xab7b('0x1b')]();});}};}function handleEntityNotFound(_0x2af2a3,_0x1c8528){return function(_0x4b79ed){if(!_0x4b79ed){_0x2af2a3[_0xab7b('0x19')](0x194);}return _0x4b79ed;};}function handleError(_0x4ed10c,_0x2dfb1d){_0x2dfb1d=_0x2dfb1d||0x1f4;return function(_0x280d71){logger[_0xab7b('0x2a')](_0x280d71[_0xab7b('0x2b')]);if(_0x280d71[_0xab7b('0x2c')]){delete _0x280d71[_0xab7b('0x2c')];}_0x4ed10c[_0xab7b('0x1a')](_0x2dfb1d)['send'](_0x280d71);};}exports['index']=function(_0x4262ae,_0x5b2f17){var _0x29d3a5={},_0x68a317={},_0x3d0184={'count':0x0,'rows':[]};return db[_0xab7b('0x2d')]['describe']()[_0xab7b('0x25')](function(_0x5b4fd4){_0x68a317['model']=_['keys'](_0x5b4fd4);_0x68a317[_0xab7b('0x2e')]=_[_0xab7b('0x2f')](_0x4262ae['query']);_0x68a317[_0xab7b('0x30')]=_[_0xab7b('0x31')](_0x68a317[_0xab7b('0x32')],_0x68a317[_0xab7b('0x2e')]);_0x29d3a5[_0xab7b('0x33')]=_[_0xab7b('0x31')](_0x68a317[_0xab7b('0x32')],qs[_0xab7b('0x34')](_0x4262ae['query'][_0xab7b('0x34')]));_0x29d3a5[_0xab7b('0x33')]=_0x29d3a5['attributes'][_0xab7b('0x35')]?_0x29d3a5[_0xab7b('0x33')]:_0x68a317[_0xab7b('0x32')];if(!_0x4262ae[_0xab7b('0x2e')][_0xab7b('0x36')](_0xab7b('0x37'))){_0x29d3a5[_0xab7b('0x1e')]=qs[_0xab7b('0x1e')](_0x4262ae[_0xab7b('0x2e')][_0xab7b('0x1e')]);_0x29d3a5[_0xab7b('0x20')]=qs[_0xab7b('0x20')](_0x4262ae[_0xab7b('0x2e')][_0xab7b('0x20')]);}_0x29d3a5[_0xab7b('0x38')]=qs[_0xab7b('0x39')](_0x4262ae[_0xab7b('0x2e')]['sort']);_0x29d3a5['where']=qs[_0xab7b('0x30')](_[_0xab7b('0x3a')](_0x4262ae['query'],_0x68a317[_0xab7b('0x30')]),_0x5b4fd4);if(_0x4262ae[_0xab7b('0x2e')][_0xab7b('0x3b')]){_0x29d3a5['where']=_[_0xab7b('0x3c')](_0x29d3a5['where'],{'$or':_[_0xab7b('0x3d')](_0x29d3a5[_0xab7b('0x33')],function(_0x3e2514){var _0x13389e={};_0x13389e[_0x3e2514]={'$like':'%'+_0x4262ae['query']['filter']+'%'};return _0x13389e;})});}_0x29d3a5=_[_0xab7b('0x3c')]({},_0x29d3a5,_0x4262ae[_0xab7b('0x3e')]);var _0x586b96={'where':_0x29d3a5[_0xab7b('0x3f')]};return db[_0xab7b('0x2d')][_0xab7b('0x1f')](_0x586b96)[_0xab7b('0x25')](function(_0xab5785){_0x3d0184[_0xab7b('0x1f')]=_0xab5785;if(_0x4262ae['query']['includeAll']){_0x29d3a5['include']=[{'all':!![]}];}return db[_0xab7b('0x2d')][_0xab7b('0x40')](_0x29d3a5);})[_0xab7b('0x25')](function(_0x511a58){_0x3d0184[_0xab7b('0x41')]=_0x511a58;return _0x3d0184;})['then'](respondWithFilteredResult(_0x5b2f17,_0x29d3a5))[_0xab7b('0x42')](handleError(_0x5b2f17,null));})[_0xab7b('0x42')](handleError(_0x5b2f17,null));};exports['show']=function(_0xc37e8c,_0x5db34e){var _0x130bd8={'raw':![],'where':{'id':_0xc37e8c[_0xab7b('0x43')]['id']}},_0x211396={};_0x211396[_0xab7b('0x32')]=_[_0xab7b('0x2f')](db[_0xab7b('0x2d')][_0xab7b('0x44')]);_0x211396[_0xab7b('0x2e')]=_[_0xab7b('0x2f')](_0xc37e8c[_0xab7b('0x2e')]);_0x211396[_0xab7b('0x30')]=_[_0xab7b('0x31')](_0x211396[_0xab7b('0x32')],_0x211396['query']);_0x130bd8['attributes']=_[_0xab7b('0x31')](_0x211396[_0xab7b('0x32')],qs['fields'](_0xc37e8c[_0xab7b('0x2e')][_0xab7b('0x34')]));_0x130bd8[_0xab7b('0x33')]=_0x130bd8[_0xab7b('0x33')][_0xab7b('0x35')]?_0x130bd8[_0xab7b('0x33')]:_0x211396[_0xab7b('0x32')];if(_0xc37e8c[_0xab7b('0x2e')]['includeAll']){_0x130bd8[_0xab7b('0x45')]=[{'all':!![]}];}_0x130bd8=_[_0xab7b('0x3c')]({},_0x130bd8,_0xc37e8c['options']);return db[_0xab7b('0x2d')]['find'](_0x130bd8)[_0xab7b('0x25')](handleEntityNotFound(_0x5db34e,null))[_0xab7b('0x25')](respondWithResult(_0x5db34e,null))[_0xab7b('0x42')](handleError(_0x5db34e,null));};exports['create']=function(_0x4829e3,_0x18b978){return db[_0xab7b('0x2d')][_0xab7b('0x46')](_0x4829e3[_0xab7b('0x47')],{})[_0xab7b('0x25')](function(_0x1c433e){var _0xe9f21b=_0x4829e3[_0xab7b('0x48')][_0xab7b('0x27')]({'plain':!![]});if(!_0xe9f21b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe9f21b[_0xab7b('0x49')]===_0xab7b('0x48')){var _0x48c44f=_0x1c433e[_0xab7b('0x27')]({'plain':!![]});var _0x23d550=_0xab7b('0x28');return db[_0xab7b('0x4a')]['find']({'where':{'name':_0x23d550,'userProfileId':_0xe9f21b[_0xab7b('0x4b')]},'raw':!![]})[_0xab7b('0x25')](function(_0x42ce19){if(_0x42ce19&&_0x42ce19[_0xab7b('0x4c')]===0x0){return db[_0xab7b('0x29')][_0xab7b('0x46')]({'name':_0x48c44f['name'],'resourceId':_0x48c44f['id'],'type':_0x42ce19[_0xab7b('0x2c')],'sectionId':_0x42ce19['id']},{})[_0xab7b('0x25')](function(){return _0x1c433e;});}else{return _0x1c433e;}})[_0xab7b('0x42')](function(_0x5e8d54){logger[_0xab7b('0x2a')](_0xab7b('0x4d'),_0x5e8d54);throw _0x5e8d54;});}return _0x1c433e;})['then'](respondWithResult(_0x18b978,0xc9))[_0xab7b('0x42')](handleError(_0x18b978,null));};exports['update']=function(_0x5b4800,_0x415727){if(_0x5b4800[_0xab7b('0x47')]['id']){delete _0x5b4800[_0xab7b('0x47')]['id'];}return db[_0xab7b('0x2d')][_0xab7b('0x4e')]({'where':{'id':_0x5b4800[_0xab7b('0x43')]['id']}})[_0xab7b('0x25')](handleEntityNotFound(_0x415727,null))['then'](saveUpdates(_0x5b4800['body'],null))[_0xab7b('0x25')](respondWithResult(_0x415727,null))[_0xab7b('0x42')](handleError(_0x415727,null));};exports[_0xab7b('0x26')]=function(_0x2f08f5,_0x24c396){return db[_0xab7b('0x2d')][_0xab7b('0x4e')]({'where':{'id':_0x2f08f5[_0xab7b('0x43')]['id']}})[_0xab7b('0x25')](handleEntityNotFound(_0x24c396,null))[_0xab7b('0x25')](removeEntity(_0x24c396,null))['catch'](handleError(_0x24c396,null));};exports[_0xab7b('0x4f')]=function(_0x1f2f81,_0x95675c){return db[_0xab7b('0x2d')]['describe']()['then'](respondWithResult(_0x95675c,null))[_0xab7b('0x42')](handleError(_0x95675c,null));};exports[_0xab7b('0x50')]=function(_0x25873c,_0x91015c,_0xade2ad){return db[_0xab7b('0x51')][_0xab7b('0x4e')]({'where':{'id':_0x25873c[_0xab7b('0x43')]['id']}})[_0xab7b('0x25')](handleEntityNotFound(_0x91015c,null))[_0xab7b('0x25')](function(_0x389a45){if(_0x389a45){return _0x389a45['addContacts'](_0x25873c[_0xab7b('0x47')][_0xab7b('0x52')],_['omit'](_0x25873c[_0xab7b('0x47')],[_0xab7b('0x52'),'id'])||{});}})[_0xab7b('0x25')](respondWithResult(_0x91015c,null))[_0xab7b('0x42')](handleError(_0x91015c,null));};exports[_0xab7b('0x53')]=function(_0x46a8d7,_0x226e4c,_0x40ec46){var _0x4f9b32={};var _0x14b597={};var _0x32f9c2;var _0x457e75;return db[_0xab7b('0x2d')][_0xab7b('0x54')]({'where':{'id':_0x46a8d7[_0xab7b('0x43')]['id']}})[_0xab7b('0x25')](handleEntityNotFound(_0x226e4c,null))[_0xab7b('0x25')](function(_0x48cc38){if(_0x48cc38){_0x32f9c2=_0x48cc38;_0x14b597[_0xab7b('0x32')]=_[_0xab7b('0x2f')](db['CmContact']['rawAttributes']);_0x14b597[_0xab7b('0x2e')]=_[_0xab7b('0x2f')](_0x46a8d7[_0xab7b('0x2e')]);_0x14b597[_0xab7b('0x30')]=_[_0xab7b('0x31')](_0x14b597[_0xab7b('0x32')],_0x14b597['query']);_0x4f9b32[_0xab7b('0x33')]=_[_0xab7b('0x31')](_0x14b597[_0xab7b('0x32')],qs['fields'](_0x46a8d7['query'][_0xab7b('0x34')]));_0x4f9b32[_0xab7b('0x33')]=_0x4f9b32[_0xab7b('0x33')][_0xab7b('0x35')]?_0x4f9b32['attributes']:_0x14b597[_0xab7b('0x32')];_0x4f9b32[_0xab7b('0x38')]=qs[_0xab7b('0x39')](_0x46a8d7[_0xab7b('0x2e')]['sort']);_0x4f9b32['where']=qs[_0xab7b('0x30')](_['pick'](_0x46a8d7[_0xab7b('0x2e')],_0x14b597[_0xab7b('0x30')]));if(_0x46a8d7[_0xab7b('0x2e')][_0xab7b('0x3b')]){_0x4f9b32[_0xab7b('0x3f')]=_[_0xab7b('0x3c')](_0x4f9b32[_0xab7b('0x3f')],{'$or':_['map'](_0x4f9b32[_0xab7b('0x33')],function(_0x324330){var _0x14ccb3={};_0x14ccb3[_0x324330]={'$like':'%'+_0x46a8d7['query'][_0xab7b('0x3b')]+'%'};return _0x14ccb3;})});}_0x4f9b32=_[_0xab7b('0x3c')]({},_0x4f9b32,_0x46a8d7[_0xab7b('0x3e')]);return _0x32f9c2[_0xab7b('0x53')](_0x4f9b32);}})[_0xab7b('0x25')](function(_0x1a8ff0){if(_0x1a8ff0){_0x457e75=_0x1a8ff0[_0xab7b('0x35')];if(!_0x46a8d7['query'][_0xab7b('0x36')](_0xab7b('0x37'))){_0x4f9b32[_0xab7b('0x1e')]=qs[_0xab7b('0x1e')](_0x46a8d7[_0xab7b('0x2e')][_0xab7b('0x1e')]);_0x4f9b32[_0xab7b('0x20')]=qs[_0xab7b('0x20')](_0x46a8d7['query'][_0xab7b('0x20')]);}return _0x32f9c2['getContacts'](_0x4f9b32);}})[_0xab7b('0x25')](function(_0x59c268){if(_0x59c268){return _0x59c268?{'count':_0x457e75,'rows':_0x59c268}:null;}})['then'](respondWithResult(_0x226e4c,null))[_0xab7b('0x42')](handleError(_0x226e4c,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 14e2cdb..0173bdf 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 _0xd55b=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','CmCompany','cm_companies'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xd55b,0xfa));var _0xbd55=function(_0x361382,_0x29c2ce){_0x361382=_0x361382-0x0;var _0x3394b9=_0xd55b[_0x361382];return _0x3394b9;};'use strict';var _=require('lodash');var util=require(_0xbd55('0x0'));var logger=require(_0xbd55('0x1'))('api');var moment=require(_0xbd55('0x2'));var BPromise=require(_0xbd55('0x3'));var rp=require(_0xbd55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbd55('0x5'));var attributes=require('./cmCompany.attributes');module[_0xbd55('0x6')]=function(_0x27b84f,_0x56786c){return _0x27b84f[_0xbd55('0x7')](_0xbd55('0x8'),attributes,{'tableName':_0xbd55('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1dd=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_companies'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0xf1dd,0x6c));var _0xdf1d=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0xf1dd[_0x26a818];return _0x5d8ca0;};'use strict';var _=require(_0xdf1d('0x0'));var util=require('util');var logger=require(_0xdf1d('0x1'))(_0xdf1d('0x2'));var moment=require(_0xdf1d('0x3'));var BPromise=require(_0xdf1d('0x4'));var rp=require(_0xdf1d('0x5'));var fs=require('fs');var path=require(_0xdf1d('0x6'));var rimraf=require(_0xdf1d('0x7'));var config=require(_0xdf1d('0x8'));var attributes=require('./cmCompany.attributes');module[_0xdf1d('0x9')]=function(_0x529b1a,_0x4a180e){return _0x529b1a[_0xdf1d('0xa')]('CmCompany',attributes,{'tableName':_0xdf1d('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 e74a514..a75740b 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 _0xddb6=['error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0xddb6,0x1a4));var _0x6ddb=function(_0x1de654,_0x438816){_0x1de654=_0x1de654-0x0;var _0x5ba5fb=_0xddb6[_0x1de654];return _0x5ba5fb;};'use strict';var _=require(_0x6ddb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ddb('0x1'));var rs=require(_0x6ddb('0x2'));var fs=require('fs');var Redis=require(_0x6ddb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ddb('0x4'));var logger=require(_0x6ddb('0x5'))(_0x6ddb('0x6'));var config=require(_0x6ddb('0x7'));var jayson=require(_0x6ddb('0x8'));var client=jayson[_0x6ddb('0x9')][_0x6ddb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x702e43,_0x30d28a,_0x52755c){return new BPromise(function(_0x4e3ea5,_0x54eaec){return client[_0x6ddb('0xb')](_0x702e43,_0x52755c)[_0x6ddb('0xc')](function(_0x216f35){logger['info'](_0x6ddb('0xd'),_0x30d28a,_0x6ddb('0xe'));logger[_0x6ddb('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x30d28a,_0x6ddb('0xe'),JSON[_0x6ddb('0x10')](_0x216f35));if(_0x216f35[_0x6ddb('0x11')]){if(_0x216f35['error'][_0x6ddb('0x12')]===0x1f4){logger[_0x6ddb('0x11')](_0x6ddb('0xd'),_0x30d28a,_0x216f35[_0x6ddb('0x11')][_0x6ddb('0x13')]);return _0x54eaec(_0x216f35['error']['message']);}logger[_0x6ddb('0x11')](_0x6ddb('0xd'),_0x30d28a,_0x216f35['error'][_0x6ddb('0x13')]);return _0x4e3ea5(_0x216f35['error'][_0x6ddb('0x13')]);}else{logger[_0x6ddb('0x14')](_0x6ddb('0xd'),_0x30d28a,_0x6ddb('0xe'));_0x4e3ea5(_0x216f35[_0x6ddb('0x15')][_0x6ddb('0x13')]);}})[_0x6ddb('0x16')](function(_0x49b0b1){logger[_0x6ddb('0x11')](_0x6ddb('0xd'),_0x30d28a,_0x49b0b1);_0x54eaec(_0x49b0b1);});});}
\ No newline at end of file
+var _0x4e8a=['debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x281305,_0x2998d6){var _0x56ffbe=function(_0x270b4c){while(--_0x270b4c){_0x281305['push'](_0x281305['shift']());}};_0x56ffbe(++_0x2998d6);}(_0x4e8a,0x17e));var _0xa4e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e8a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa4e8('0x0'));var moment=require('moment');var BPromise=require(_0xa4e8('0x1'));var rs=require(_0xa4e8('0x2'));var fs=require('fs');var Redis=require(_0xa4e8('0x3'));var db=require(_0xa4e8('0x4'))['db'];var utils=require(_0xa4e8('0x5'));var logger=require(_0xa4e8('0x6'))(_0xa4e8('0x7'));var config=require(_0xa4e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa4e8('0x9')][_0xa4e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbe47b1,_0x1ef0a9,_0x1a9785){return new BPromise(function(_0x5eac77,_0x36e240){return client['request'](_0xbe47b1,_0x1a9785)[_0xa4e8('0xb')](function(_0x46d010){logger[_0xa4e8('0xc')](_0xa4e8('0xd'),_0x1ef0a9,'request\x20sent');logger[_0xa4e8('0xe')](_0xa4e8('0xf'),_0x1ef0a9,_0xa4e8('0x10'),JSON[_0xa4e8('0x11')](_0x46d010));if(_0x46d010[_0xa4e8('0x12')]){if(_0x46d010['error'][_0xa4e8('0x13')]===0x1f4){logger[_0xa4e8('0x12')](_0xa4e8('0xd'),_0x1ef0a9,_0x46d010['error'][_0xa4e8('0x14')]);return _0x36e240(_0x46d010[_0xa4e8('0x12')]['message']);}logger[_0xa4e8('0x12')]('CmCompany,\x20%s,\x20%s',_0x1ef0a9,_0x46d010['error'][_0xa4e8('0x14')]);return _0x5eac77(_0x46d010[_0xa4e8('0x12')]['message']);}else{logger[_0xa4e8('0xc')](_0xa4e8('0xd'),_0x1ef0a9,_0xa4e8('0x10'));_0x5eac77(_0x46d010[_0xa4e8('0x15')][_0xa4e8('0x14')]);}})['catch'](function(_0x1fff9d){logger['error']('CmCompany,\x20%s,\x20%s',_0x1ef0a9,_0x1fff9d);_0x36e240(_0x1fff9d);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 83c331a..3659d62 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 _0x6011=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6011,0xa6));var _0x1601=function(_0x5c135d,_0x52bd57){_0x5c135d=_0x5c135d-0x0;var _0x264044=_0x6011[_0x5c135d];return _0x264044;};'use strict';var multer=require(_0x1601('0x0'));var util=require(_0x1601('0x1'));var path=require(_0x1601('0x2'));var timeout=require(_0x1601('0x3'));var express=require(_0x1601('0x4'));var router=express['Router']();var fs_extra=require(_0x1601('0x5'));var auth=require(_0x1601('0x6'));var interaction=require(_0x1601('0x7'));var config=require(_0x1601('0x8'));var controller=require(_0x1601('0x9'));router[_0x1601('0xa')]('/',auth[_0x1601('0xb')](),controller[_0x1601('0xc')]);router[_0x1601('0xa')](_0x1601('0xd'),auth[_0x1601('0xb')](),controller[_0x1601('0xe')]);router[_0x1601('0xa')](_0x1601('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0x1601('0x10'),auth[_0x1601('0xb')](),controller[_0x1601('0x11')]);router[_0x1601('0x12')]('/',auth[_0x1601('0xb')](),controller[_0x1601('0x13')]);router[_0x1601('0x12')](_0x1601('0x10'),auth[_0x1601('0xb')](),controller[_0x1601('0x14')]);router[_0x1601('0x15')](_0x1601('0xf'),auth[_0x1601('0xb')](),controller['update']);router[_0x1601('0x16')](_0x1601('0xf'),auth['isAuthenticated'](),controller[_0x1601('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x06e3=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2980de,_0x1426a4){var _0x81a4ca=function(_0x19040e){while(--_0x19040e){_0x2980de['push'](_0x2980de['shift']());}};_0x81a4ca(++_0x1426a4);}(_0x06e3,0x1cc));var _0x306e=function(_0x39ad28,_0x36dbfd){_0x39ad28=_0x39ad28-0x0;var _0x1a6e47=_0x06e3[_0x39ad28];return _0x1a6e47;};'use strict';var multer=require(_0x306e('0x0'));var util=require(_0x306e('0x1'));var path=require(_0x306e('0x2'));var timeout=require(_0x306e('0x3'));var express=require(_0x306e('0x4'));var router=express[_0x306e('0x5')]();var fs_extra=require(_0x306e('0x6'));var auth=require(_0x306e('0x7'));var interaction=require(_0x306e('0x8'));var config=require(_0x306e('0x9'));var controller=require('./cmCompany.controller');router[_0x306e('0xa')]('/',auth[_0x306e('0xb')](),controller[_0x306e('0xc')]);router[_0x306e('0xa')]('/describe',auth[_0x306e('0xb')](),controller[_0x306e('0xd')]);router[_0x306e('0xa')](_0x306e('0xe'),auth[_0x306e('0xb')](),controller[_0x306e('0xf')]);router[_0x306e('0xa')](_0x306e('0x10'),auth[_0x306e('0xb')](),controller[_0x306e('0x11')]);router['post']('/',auth[_0x306e('0xb')](),controller[_0x306e('0x12')]);router[_0x306e('0x13')]('/:id/contacts',auth[_0x306e('0xb')](),controller[_0x306e('0x14')]);router[_0x306e('0x15')](_0x306e('0xe'),auth['isAuthenticated'](),controller[_0x306e('0x16')]);router[_0x306e('0x17')](_0x306e('0xe'),auth[_0x306e('0xb')](),controller[_0x306e('0x18')]);module[_0x306e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c234c72..630b763 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 _0x93ac=['DATE','NOW','sequelize','exports','STRING','INTEGER','UNSIGNED'];(function(_0x4b64a4,_0x1bdc50){var _0xd19b0e=function(_0x4dfbe0){while(--_0x4dfbe0){_0x4b64a4['push'](_0x4b64a4['shift']());}};_0xd19b0e(++_0x1bdc50);}(_0x93ac,0xfe));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Sequelize=require(_0xc93a('0x0'));module[_0xc93a('0x1')]={'firstName':{'type':Sequelize[_0xc93a('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc93a('0x2')]},'postalCode':{'type':Sequelize[_0xc93a('0x2')]},'city':{'type':Sequelize[_0xc93a('0x2')]},'country':{'type':Sequelize[_0xc93a('0x2')]},'dateOfBirth':{'type':Sequelize[_0xc93a('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xc93a('0x2')]},'mobile':{'type':Sequelize[_0xc93a('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc93a('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xc93a('0x2')]},'skype':{'type':Sequelize[_0xc93a('0x2')]},'teams':{'type':Sequelize[_0xc93a('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xc93a('0x2')]},'wechat':{'type':Sequelize[_0xc93a('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xc93a('0x3')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc93a('0x3')](0x2)[_0xc93a('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc93a('0x5')],'defaultValue':Sequelize[_0xc93a('0x6')]},'dialTimezone':{'type':Sequelize[_0xc93a('0x2')]},'utcOffset':{'type':Sequelize[_0xc93a('0x3')]}};
\ No newline at end of file
+var _0xd365=['STRING','INTEGER','UNSIGNED','DATE','exports'];(function(_0x444b0d,_0x27bac6){var _0x368629=function(_0x3dbbb4){while(--_0x3dbbb4){_0x444b0d['push'](_0x444b0d['shift']());}};_0x368629(++_0x27bac6);}(_0xd365,0x6d));var _0x5d36=function(_0x2af262,_0x1c6838){_0x2af262=_0x2af262-0x0;var _0x2df649=_0xd365[_0x2af262];return _0x2df649;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x5d36('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x5d36('0x1')]},'street':{'type':Sequelize[_0x5d36('0x1')]},'postalCode':{'type':Sequelize[_0x5d36('0x1')]},'city':{'type':Sequelize[_0x5d36('0x1')]},'country':{'type':Sequelize[_0x5d36('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x5d36('0x1')]},'mobile':{'type':Sequelize[_0x5d36('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5d36('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x5d36('0x1')]},'fb_data':{'type':Sequelize[_0x5d36('0x1')]},'twitter':{'type':Sequelize[_0x5d36('0x1')]},'skype':{'type':Sequelize[_0x5d36('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x5d36('0x1')]},'line':{'type':Sequelize[_0x5d36('0x1')]},'wechat':{'type':Sequelize[_0x5d36('0x1')]},'telegram':{'type':Sequelize[_0x5d36('0x1')]},'UserId':{'type':Sequelize[_0x5d36('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x5d36('0x1')]},'priority':{'type':Sequelize[_0x5d36('0x2')](0x2)[_0x5d36('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5d36('0x4')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x5d36('0x1')]},'utcOffset':{'type':Sequelize[_0x5d36('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 8f9388e..506ba5d 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 _0x84a0=['duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','pick','ContactId','includeAll','include','getHopperHistories','options','getHopperFinals','getJscriptySessions','binding_keys','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','includes','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','findAndCountAll','startCase','Website','Account','closed','note','disposition','thirdDisposition','UserId','key','Owner','browserName','customerIp','deviceModel','osName','ratingType','ratingValue','referer','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','slice','moment','bluebird','util','path','squel','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','castTo','DATE','text','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','COUNT(*)','order','DESC','having','t.id\x20IN\x20?','resolve','user','agent','some','c.ListId\x20IS\x20NULL','role','autocomplete','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','push','rows','params','catch','tags','columnName','displayName','alias','custom','values','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','contact','all','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','findAll','omit','format','cf_%d','$and','CmCustomField','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','setTags','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones'];(function(_0x46dd2b,_0x4d6e97){var _0x3f29c6=function(_0x123a2f){while(--_0x123a2f){_0x46dd2b['push'](_0x46dd2b['shift']());}};_0x3f29c6(++_0x4d6e97);}(_0x84a0,0x66));var _0x084a=function(_0x25f4dc,_0x59bec9){_0x25f4dc=_0x25f4dc-0x0;var _0x46ce50=_0x84a0[_0x25f4dc];return _0x46ce50;};'use strict';var moment=require(_0x084a('0x0'));var BPromise=require(_0x084a('0x1'));var util=require(_0x084a('0x2'));var path=require(_0x084a('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x084a('0x4'));var Papa=require(_0x084a('0x5'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x6'));var logger=require(_0x084a('0x7'))('api');var config=require(_0x084a('0x8'));var shared=require(_0x084a('0x9'));var db=require(_0x084a('0xa'))['db'];config[_0x084a('0xb')]=_[_0x084a('0xc')](config['redis'],{'host':_0x084a('0xd'),'port':0x18eb});var socket=require(_0x084a('0xe'))(new Redis(config[_0x084a('0xb')]));require(_0x084a('0xf'))[_0x084a('0x10')](socket);function respondWithResult(_0x4c1e29,_0x4dd423){_0x4dd423=_0x4dd423||0xc8;return function(_0x3d9dc6){if(_0x3d9dc6){return _0x4c1e29[_0x084a('0x11')](_0x4dd423)[_0x084a('0x12')](_0x3d9dc6);}};}function respondWithFilteredResult(_0x2abce2,_0x2d7c90){return function(_0x57c405){if(_0x57c405){var _0x4ef41f=typeof _0x2d7c90[_0x084a('0x13')]===_0x084a('0x14')&&typeof _0x2d7c90[_0x084a('0x15')]===_0x084a('0x14');var _0x1bdfb8=_0x57c405[_0x084a('0x16')];var _0x3ff351=_0x4ef41f?0x0:_0x2d7c90[_0x084a('0x13')];var _0x5aef40=_0x4ef41f?_0x57c405[_0x084a('0x16')]:_0x2d7c90['offset']+_0x2d7c90[_0x084a('0x15')];var _0x3ccaca;if(_0x5aef40>=_0x1bdfb8){_0x5aef40=_0x1bdfb8;_0x3ccaca=0xc8;}else{_0x3ccaca=0xce;}_0x2abce2[_0x084a('0x11')](_0x3ccaca);return _0x2abce2[_0x084a('0x17')](_0x084a('0x18'),_0x3ff351+'-'+_0x5aef40+'/'+_0x1bdfb8)['json'](_0x57c405);}return null;};}function saveUpdates(_0x443ebb){return function(_0x4abd81){if(_0x4abd81){return _0x4abd81[_0x084a('0x19')](_0x443ebb)[_0x084a('0x1a')](function(_0x4af43e){return _0x4af43e;});}return null;};}function removeEntity(_0xf2c333){return function(_0x32c729){if(_0x32c729){return _0x32c729[_0x084a('0x1b')]()[_0x084a('0x1a')](function(){_0xf2c333[_0x084a('0x11')](0xcc)[_0x084a('0x1c')]();});}};}function handleEntityNotFound(_0x447a19){return function(_0x34e86e){if(!_0x34e86e){_0x447a19[_0x084a('0x1d')](0x194);}return _0x34e86e;};}function handleError(_0xcb5356,_0x3c7fd6){_0x3c7fd6=_0x3c7fd6||0x1f4;return function(_0x279e25){logger[_0x084a('0x1e')](_0x279e25[_0x084a('0x1f')]);if(_0x279e25[_0x084a('0x20')]){delete _0x279e25['name'];}_0xcb5356[_0x084a('0x11')](_0x3c7fd6)[_0x084a('0x21')](_0x279e25);};}exports[_0x084a('0x22')]=function(_0x2d62bf,_0x1c3f6c){var _0x4865c8={},_0x755c24={},_0x288e9e={'count':0x0,'rows':[]};return db[_0x084a('0x23')][_0x084a('0x24')]()[_0x084a('0x1a')](function(_0x3cdc1e){var _0x5be167=[];for(var _0x297e5b=0x0;_0x297e5b
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','moment','path','node-tnef','../../../config/logger','../../../config/environment','head','value','anonymous','generate','name','address','substring','split','length','slice','join','Anonymous','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body'];(function(_0x44c40f,_0x12268c){var _0x159b61=function(_0xd458ca){while(--_0xd458ca){_0x44c40f['push'](_0x44c40f['shift']());}};_0x159b61(++_0x12268c);}(_0xfa42,0x1d5));var _0x2fa4=function(_0x221f79,_0x2032b0){_0x221f79=_0x221f79-0x0;var _0x22c595=_0xfa42[_0x221f79];return _0x22c595;};'use strict';var _=require('lodash');var moment=require(_0x2fa4('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2fa4('0x1'));var util=require('util');var tnef=require(_0x2fa4('0x2'));var logger=require(_0x2fa4('0x3'))('email');var config=require(_0x2fa4('0x4'));function getAddress(_0x1fb1d5){var _0x64f6ea=_[_0x2fa4('0x5')](_0x1fb1d5[_0x2fa4('0x6')]);return _0x64f6ea&&_0x64f6ea['address']?_0x64f6ea['address']:_0x2fa4('0x7')+random[_0x2fa4('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x3fd865){var _0x270c30=_[_0x2fa4('0x5')](_0x3fd865[_0x2fa4('0x6')]);if(_0x270c30&&_0x270c30[_0x2fa4('0x9')]){if(_0x270c30[_0x2fa4('0x9')]==_0x270c30[_0x2fa4('0xa')]){return _0x270c30[_0x2fa4('0x9')][_0x2fa4('0xb')](0x0,_0x270c30[_0x2fa4('0x9')]['indexOf']('@'));}var _0x4e7bdc=_0x270c30[_0x2fa4('0x9')][_0x2fa4('0xc')](/\s+/);return _0x4e7bdc[_0x2fa4('0xd')]>0x1?_0x4e7bdc[_0x2fa4('0xe')](0x0,-0x1)[_0x2fa4('0xf')]('\x20'):_0x270c30['name'];}return _0x2fa4('0x10');}function getLastName(_0x474407){var _0x153503=_[_0x2fa4('0x5')](_0x474407[_0x2fa4('0x6')]);if(_0x153503&&_0x153503['name']){var _0x5e160d=_0x153503[_0x2fa4('0x9')][_0x2fa4('0xc')](/\s+/);return _0x5e160d['length']>0x1?_0x5e160d['pop']():'';}return'';}function getMails(_0x3d3def,_0x5a18ed){var _0xe78cad='';for(var _0x1cdb75=0x0;_0x1cdb75<_0x5a18ed[_0x2fa4('0x6')][_0x2fa4('0xd')];_0x1cdb75+=0x1){if(_0x5a18ed[_0x2fa4('0x6')][_0x1cdb75]['address']!==_0x3d3def){if(!_['isEmpty'](_0xe78cad)){_0xe78cad+=',';}_0xe78cad+=_0x5a18ed[_0x2fa4('0x6')][_0x1cdb75][_0x2fa4('0x9')]||_0x5a18ed[_0x2fa4('0x6')][_0x1cdb75][_0x2fa4('0xa')]||'';_0xe78cad+='\x20<';_0xe78cad+=_0x5a18ed[_0x2fa4('0x6')][_0x1cdb75][_0x2fa4('0xa')]?_0x5a18ed[_0x2fa4('0x6')][_0x1cdb75]['address']:'anonymous'+random[_0x2fa4('0x8')](0x6)+_0x2fa4('0x11');_0xe78cad+='>';}}return _0xe78cad;}function parseEmail(_0x389ad6,_0xeccfa1,_0x3d0090){if(_0xeccfa1[_0x2fa4('0x12')]){var _0x15779f=/